# Path: sequere/registry.py
# class SequereRegistry(dict):
#     def __init__(self):
#     def for_model(self, model):
#     def get_identifier(self, instance):
#     def identifiers(self):
#     def unregister(self, name):
#     def register(self, *args, **kwargs):
#     def _register_model(self, model, sequere=None,
#                         name=None, **kwargs):
#     def _register(self, sequere):
# def autodiscover():
# def register(*args, **kwargs):
# 
# Path: sequere/backends/redis/utils.py
# def get_key(*args, **kwargs):
#     separator = kwargs.pop('separator', get_setting('KEY_SEPARATOR'))
# 
#     key = separator.join(['%s' % arg for arg in args if arg is not None])
# 
#     return key


import six
import uuid
from collections import defaultdict
from sequere.registry import registry
from .utils import get_key

    def get_from_uid_list(self, uid_list):
        with self.client.pipeline() as pipe:
            for uid in uid_list:
                pipe.hgetall(self.add_prefix(get_key('uid', uid)))

            identifier_ids = defaultdict(dict)

            results = pipe.execute()

            for i, value in enumerate(results):
                identifier_ids[value['identifier']][int(value['object_id'])] = None

            for identifier, objects in six.iteritems(identifier_ids):
                klass = registry.identifiers.get(identifier)

                for result in klass.objects.filter(pk__in=objects.keys()):
                    identifier_ids[identifier][result.pk] = result

            results = [identifier_ids[value['identifier']][int(value['object_id'])]
                       for i, value in enumerate(results)]

            return results

    def get_from_uid(self, uid):
        data = self.get_data_from_uid(uid)

        if not data:
            return None


# Path: sequere/registry.py
# class SequereRegistry(dict):
#     def __init__(self):
#     def for_model(self, model):
#     def get_identifier(self, instance):
#     def identifiers(self):
#     def unregister(self, name):
#     def register(self, *args, **kwargs):
#     def _register_model(self, model, sequere=None,
#                         name=None, **kwargs):
#     def _register(self, sequere):
# def autodiscover():
# def register(*args, **kwargs):
# 
# Path: sequere/backends/redis/utils.py
# def get_key(*args, **kwargs):
#     separator = kwargs.pop('separator', get_setting('KEY_SEPARATOR'))
# 
#     key = separator.join(['%s' % arg for arg in args if arg is not None])
# 
#     return key


# Path: sequere/backends/redis/managers.py
import six
import uuid
from collections import defaultdict
from sequere.registry import registry
from .utils import get_key


    def get_from_uid_list(self, uid_list):
        with self.client.pipeline() as pipe:
            for uid in uid_list:
                pipe.hgetall(self.add_prefix(get_key('uid', uid)))

            identifier_ids = defaultdict(dict)

            results = pipe.execute()

            for i, value in enumerate(results):
                identifier_ids[value['identifier']][int(value['object_id'])] = None

            for identifier, objects in six.iteritems(identifier_ids):
                klass = registry.identifiers.get(identifier)

                for result in klass.objects.filter(pk__in=objects.keys()):
                    identifier_ids[identifier][result.pk] = result

            results = [identifier_ids[value['identifier']][int(value['object_id'])]
                       for i, value in enumerate(results)]

            return results

    def get_from_uid(self, uid):
        data = self.get_data_from_uid(uid)

        if not data:
            return None


        klass = registry.identifiers.get(data['identifier'])