Returns the entity with the given entity ID as a dict
351959
def get_by_entityid(self, entityid):
		
		data = self.list(entityid=entityid)
		if len(data) == 0:
			return None

		eid = int( next(iter(data)) )
		entity = self.get(eid)

		self.debug(0x01,entity)
		return entity
782031
def _convert_json_response_to_entities(response, property_resolver, require_encryption,
                                       key_encryption_key, key_resolver):
    ''' 
    '''
    if response is None or response.body is None:
        return None

    entities = _list()

    entities.next_marker = _get_continuation_from_response_headers(response)

    root = loads(response.body.decode('utf-8'))

    if 'value' in root:
        for entity in root['value']:
            entity = _decrypt_and_deserialize_entity(entity, property_resolver, require_encryption, 
                                           key_encryption_key, key_resolver)
            entities.append(entity)

    else:
        entities.append(_convert_json_to_entity(entity, 
                                             property_resolver))

    return entities
695880
def get(self, id):
        
        try:
            session_json = self.db[id]
        except KeyError:
            session_json = "{}"
        return json_loads(session_json)
552530
def __get_entities(self, etype):
        """"""
        r = fapi.get_entities(self.namespace, self.name,
                              etype, self.api_url)
        fapi._check_response_code(r, 200)
        return [Entity(e['entityType'], e['name'], e['attributes'])
                for e in r.json()]
933907
def get(self, id):
        
        for obj in self.model.db:
            if obj["id"] == id:
                return self._cast_model(obj)

        return None
447700
def [](key)
      entity = new_entity
      key_property = entity.get_property(entity.primary_key)
      key_property.value = key

      result = service.execute("#{name}(#{key_property.url_value})")
      entities = service.find_entities(result)
      single_entity_from_xml(entities)
    end
910098
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'entities') and self.entities is not None:
            _dict['entities'] = [x._to_dict() for x in self.entities]
        if hasattr(self, 'location') and self.location is not None:
            _dict['location'] = self.location
        if hasattr(self, 'text') and self.text is not None:
            _dict['text'] = self.text
        return _dict
748939
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'generic' in _dict:
            args['generic'] = [
                DialogRuntimeResponseGeneric._from_dict(x)
                for x in (_dict.get('generic'))
            ]
        if 'intents' in _dict:
            args['intents'] = [
                RuntimeIntent._from_dict(x) for x in (_dict.get('intents'))
            ]
        if 'entities' in _dict:
            args['entities'] = [
                RuntimeEntity._from_dict(x) for x in (_dict.get('entities'))
            ]
        if 'actions' in _dict:
            args['actions'] = [
                DialogNodeAction._from_dict(x) for x in (_dict.get('actions'))
            ]
        if 'debug' in _dict:
            args['debug'] = MessageOutputDebug._from_dict(_dict.get('debug'))
        if 'user_defined' in _dict:
            args['user_defined'] = _dict.get('user_defined')
        return cls(**args)
226272
def query_by_id(self, id):
        
        return json.loads(self._get(UrlEncoded(str(id))).body.read().decode('utf-8'))
1358267
def entityId(self, partial, channel=None):
        '''
        '''
        url = '{}/{}/meta/any'.format(self.url, _get_path(partial))
        data = self._get(_add_channel(url, channel))
        return data.json()['Id']
1108932
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'entities' in _dict:
            args['entities'] = [
                QueryEntitiesResponseItem._from_dict(x)
                for x in (_dict.get('entities'))
            ]
        return cls(**args)
429299
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'input' in _dict:
            args['input'] = MessageInput._from_dict(_dict.get('input'))
        if 'intents' in _dict:
            args['intents'] = [
                RuntimeIntent._from_dict(x) for x in (_dict.get('intents'))
            ]
        if 'entities' in _dict:
            args['entities'] = [
                RuntimeEntity._from_dict(x) for x in (_dict.get('entities'))
            ]
        if 'alternate_intents' in _dict:
            args['alternate_intents'] = _dict.get('alternate_intents')
        if 'context' in _dict:
            args['context'] = Context._from_dict(_dict.get('context'))
        if 'output' in _dict:
            args['output'] = OutputData._from_dict(_dict.get('output'))
        if 'actions' in _dict:
            args['actions'] = [
                DialogNodeAction._from_dict(x) for x in (_dict.get('actions'))
            ]
        return cls(**args)
985694
def entity_data(self, entity_type, entity_id, history_index):
        
        return self.entity_history(entity_type, entity_id)[history_index]
1051359
def get(cls, id):
        '''  '''

        if not id:
            return None

        redis = cls.get_redis()
        key = '{}:{}:obj'.format(cls.cls_key(), id)

        if not redis.exists(key):
            return None

        obj = cls(id=id)
        obj._persisted = True

        data = debyte_hash(redis.hgetall(key))

        for fieldname, field in obj.proxy:
            value = field.recover(data, redis)

            setattr(
                obj,
                fieldname,
                value
            )

        return obj
762944
def entities(self, name_id):
        
        cni = code(name_id)
        return list(self._db[cni].keys())
561506
def get_entity(self, ilx_id: str) -> dict:
        
        ilx_id = self.fix_ilx(ilx_id)
        url = self.base_url + "ilx/search/identifier/{identifier}?key={api_key}".format(
            identifier = ilx_id,
            api_key = self.api_key,
        )
        return self.get(url)
473039
def get_wd_entity(self):
        
        params = {
            'action': 'wbgetentities',
            'sites': 'enwiki',
            'ids': self.wd_item_id,
            'format': 'json'
        }
        headers = {
            'User-Agent': self.user_agent
        }
        json_data = self.mediawiki_api_call("GET", self.mediawiki_api_url, params=params, headers=headers)
        return self.parse_wd_json(wd_json=json_data['entities'][self.wd_item_id])