Return flyweight object with specified key, if it has already been created.

        Returns:
            cls or None: Previously constructed flyweight object with given
            key or None if key not found
187047
def from_key(cls, *args):
        
        key = args if len(args) > 1 else args[0]
        return cls._instances.get(key, None)
82566
def get(self, key):
        

        if not self.is_loaded:
            self.retrieve()

            self.is_loaded = True

        if self.has(key=key):
            return self.data[key]
        else:
            return None
161316
def singleton(cls):
    '''
    
    '''

    cls.__new_original__ = cls.__new__

    @wraps(cls.__new__)
    def singleton_new(cls, *args, **kw):
        it = cls.__dict__.get('__it__')
        if it is not None:
            return it

        cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
        it.__init_original__(*args, **kw)
        return it

    cls.__new__ = singleton_new
    cls.__init_original__ = cls.__init__
    cls.__init__ = object.__init__

    return cls
1011091
def get(self):
        
        header = {}
        if self.key is not None and self.value is not None:
            header[self.key] = self.value
        return header
1319277
def get(self, key, default=None):
        """"""
        for k, v in self:
            if k == key:
                return v
        return default
139339
def copy(self, key=None):
        
        other = self.__class__(
            redis=self.redis, key=key, writeback=self.writeback
        )
        other.extend(self)

        return other
927078
def get(self, key, key_length=0):
        
        if key_length < 1:
            key_length = len(key)
        return self.get_method(self, key, key_length)
843820
def get_object_or_none(cls, **kwargs):
    
    from django.shortcuts import _get_queryset
    qs = _get_queryset(cls)
    try:
        return qs.get(**kwargs)
    except qs.model.DoesNotExist:
        return None
672560
def get_iss(self, key):
        
        _state = self.get_state(key)
        if not _state:
            raise KeyError(key)
        return _state['iss']
52988
def create_from_key(cls, oldvalue, key):
    ""
    if oldvalue is not None:
        raise AlreadyExistsException('%r already exists' % (oldvalue,))
    return cls.create_from_key(key)
1273033
def get(self, key, default=_NoValue):
        
        self._checkType(key, "key")
        if default is _NoValue:
            return self._jconf.get(key)
        else:
            if default is not None:
                self._checkType(default, "default")
            return self._jconf.get(key, default)
1302219
def _check_object_exists(self):
        
        if not DB.get_keys(self.key):
            raise KeyError("Object with key '{}' not exist".format(self.key))
212954
def get(self, key, default=UndefinedKey):
        
        return self._get(ConfigTree.parse_key(key), 0, default)
1120348
def pks_from_objects(self, objects):
        
        return {o.pk if isinstance(o, Model) else o for o in objects}
2548
def get(self, key):
        
        return self._object_class(json.loads(self._db[key]))
1182571
def get(self, key, default=Empty, creator=Empty, expire=None):
        
        try:
            return self.storage.get(key)
        except KeyError as e:
            if creator is not Empty:
                if callable(creator):
                    v = creator()
                else:
                    v = creator
                self.set(key, v, expire)
                return v
            else:
                if default is not Empty:
                    if callable(default):
                        v = default()
                        return v
                    return default
                else:
                    raise
229024
def get(self, key, default=None):
        
        try:
            val = self[key]
        except KeyError:
            val = default
        return val