Return the entity with the given entity ID in short form. If no entity 
		ID is given, all records are listed.
		
		It returns a dictionary of the form:
		{eid : {'id' :
				'isActive' :
				'name' :
				'revisionNr' :
				'state' :
				'type' :
				}}
511015
def list(self, entityid=None):
		
		params = {}
		if entityid:
			params['name'] = entityid
		data = self._http_req('connections',params=params)
		entities = data['decoded']['connections']

		# hash key will be string (damned json), so convert to integer
		entities = {int(k): v for k, v in entities.items()}
		entities_list = sorted(entities.items(), key=lambda x: x[0])
		entities = OrderedDict(entities_list)
		return entities
34899
def get(self, identity):
        
        return EntityContext(self._version, service_sid=self._solution['service_sid'], identity=identity, )
1029540
public String getEntityId() {
    if (DictTerm_Type.featOkTst && ((DictTerm_Type)jcasType).casFeat_entityId == null)
      jcasType.jcas.throwFeatMissing("entityId", "ch.epfl.bbp.uima.types.DictTerm");
    return jcasType.ll_cas.ll_getStringValue(addr, ((DictTerm_Type)jcasType).casFeatCode_entityId);}
1272867
def extract_entity(found):
    """"""
    obj = dict()
    for prop in found.entity.property:
        obj[prop.name] = prop.value.string_value
    return obj
1300430
def get(self, id):
        """"""
        params = {'q': 'id:%s' % str(id), 'wt': 'python'}
        request = urllib.parse.urlencode(params, doseq=True)
        data = None
        try:
            rsp = self.doPost(self.solrBase + '', request, self.formheaders)
            data = eval(rsp.read())
        except Exception:
            pass
        if data['response']['numFound'] > 0:
            return data['response']['docs'][0]
        return None
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)
985694
def entity_data(self, entity_type, entity_id, history_index):
        
        return self.entity_history(entity_type, entity_id)[history_index]
1187986
async def get_entity(self):
        
        if not self.entity and await self.get_input_entity():
            try:
                self._entity =\
                    await self._client.get_entity(self._input_entity)
            except ValueError:
                pass

        return self._entity
1009619
def to_dict(self):
        
        entity_dict = {}

        for field, val in six.iteritems(self._fields):
            if field.multiple:
                if val:
                    val = [_dictify(field, x) for x in val]
                else:
                    val = []
            else:
                val = _dictify(field, val)

            # Only add non-None objects or non-empty lists
            if val is not None and val != []:
                entity_dict[field.key_name] = val

        self._finalize_dict(entity_dict)

        return entity_dict
762944
def entities(self, name_id):
        
        cni = code(name_id)
        return list(self._db[cni].keys())
1129957
def get_document(self, id):
        
        obj_list = self.document_list
        matches = [i for i in obj_list if str(i.id) == str(id)]
        if not matches:
            raise DoesNotExistError("The resource you've requested does not \
exist or is unavailable without the proper credentials.")
        return matches[0]
1297474
def _populate_sub_entity(self, entity, type_name):
        
        key = type_name.lower()
        if isinstance(entity[key], str):
            # If the expected sub-entity is a string, it's a unknown ID
            entity[key] = dict(id=entity[key])
            return
        cache = self._cache[key]
        subentity = cache.get(entity[key]['id'])
        if not subentity:
            subentities = self.api.get(type_name, id=entity[key]['id'], results_limit=1)
            if len(subentities) > 0:
                subentity = subentities[0]
                entity[key] = subentity
        else:
            entity[key] = subentity
1034103
def get_parent(self):
        """"""
        if self.is_entity():
            return self.get_index_url(**self.default_kwargs_for_urls())
        elif self._parent is not None:
            resource = self._parent.rsplit('_', 1)[0]
            parts = self.default_kwargs_for_urls()

            if '{}_id'.format(resource) in parts:
                id = parts.pop('{}_id'.format(resource))
                parts['id'] = id
            return self.get_full_url(
                self.app.reverse(
                    self._parent, **parts
                )
            )
1117282
def list(self, entity=None):
        
        uri = "/%s" % self.uri_base
        if entity:
            uri = "%s?entityId=%s" % (uri, utils.get_id(entity))
        resp, resp_body = self._list(uri, return_raw=True)
        return resp_body
1136781
def get_entity_by_regid(self, regid):
        
        if not self.valid_uwregid(regid):
            raise InvalidRegID(regid)

        url = "{}/{}.json".format(ENTITY_PREFIX, regid.upper())
        response = DAO.getURL(url, {"Accept": "application/json"})

        if response.status != 200:
            raise DataFailureException(url, response.status, response.data)

        return self._entity_from_json(response.data)
1233663
def get_entity(self, etype, entity_id):
        
        r = fapi.get_entity(self.namespace, self.name, etype,
                               entity_id, self.api_url)
        fapi._check_response_code(r, 200)
        dresp = r.json()
        return Entity(etype, entity_id, dresp['attributes'])
715340
def update(self, eid, entity, note=None):
		
		# fetch the current entity
		newentity = self.get(eid)
		for field in ('createdAtDate', 'id', 'isActive', 'parentRevision', 'revisionNr', 'updatedAtDate', 'updatedByUserName','updatedFromIp'):
			if field in newentity: del newentity[field]

		# replace fields as specified in entity
		for field in entity:
			if field=='metadata':
				for mfield in entity['metadata']:
					newentity['metadata'][mfield] = entity['metadata'][mfield]
			else:
				newentity[field] = entity[field]

		result = self.replace(eid,newentity,note=note)
		return result