Did I find the right examples for you? yes no

All Samples(10)  |  Call(6)  |  Derive(0)  |  Import(4)

src/a/r/armstrong.utils.celery-0.1.4/armstrong/utils/celery/tasks.py   armstrong.utils.celery(Download)
 
from .utils import model_to_tuple
from .utils import tuple_to_model
 
 
def deserialize_sender_and_instance(kwargs):
    sender_tuple, instance_tuple = (kwargs.pop("sender_tuple"),
            kwargs.pop("instance_tuple", None))
    sender = tuple_to_model(sender_tuple)
    kwargs["sender"] = sender
    if instance_tuple is not None:
        instance_model = tuple_to_model(instance_tuple[:2])
        if instance_model is None:
            # Handle situtation where invalid data is sent across the wire

src/a/r/armstrong.utils.celery-HEAD/armstrong/utils/celery/tasks.py   armstrong.utils.celery(Download)
 
from .utils import model_to_tuple
from .utils import tuple_to_model
 
 
def deserialize_sender_and_instance(kwargs):
    sender_tuple, instance_tuple = (kwargs.pop("sender_tuple"),
            kwargs.pop("instance_tuple", None))
    sender = tuple_to_model(sender_tuple)
    kwargs["sender"] = sender
    if instance_tuple is not None:
        instance_model = tuple_to_model(instance_tuple[:2])
        if instance_model is None:
            # Handle situtation where invalid data is sent across the wire

src/a/r/armstrong.utils.celery-0.1.4/armstrong/utils/celery/tests/utils.py   armstrong.utils.celery(Download)
from ._utils import SimpleModel
from ._utils import TestCase
from ..utils import model_to_tuple
from ..utils import tuple_to_model
 
    def test_loads_model_from_tuple(self):
        result = tuple_to_model(("tests", "simplemodel"))
        self.assertEqual(result.__name__, SimpleModel.__name__)
 

src/a/r/armstrong.utils.celery-HEAD/armstrong/utils/celery/tests/utils.py   armstrong.utils.celery(Download)
from ._utils import SimpleModel
from ._utils import TestCase
from ..utils import model_to_tuple
from ..utils import tuple_to_model
 
    def test_loads_model_from_tuple(self):
        result = tuple_to_model(("tests", "simplemodel"))
        self.assertEqual(result.__name__, SimpleModel.__name__)