Some entities return the register entity id,
        but other do not. Unsure if this is a bug or
        inconsistently registered data.
17802
def registration_authority_entity_id(self):
        

        if ATTR_ENTITY_REGISTRATION_AUTHORITY in self.raw:
            try:
                return self.raw[
                    ATTR_ENTITY_REGISTRATION_AUTHORITY][
                    ATTR_ENTITY_REGISTRATION_AUTHORITY_ENTITY_ID][
                    ATTR_DOLLAR_SIGN]
            except KeyError:
                pass
799265
function _getEntityKey(entityType, entity) {
  switch (entityType) {
    case 'remote-application':
    case 'application':
    case 'unit':
      return entity.name;
    case 'machine':
    case 'relation':
      return entity.id;
    case 'annotation':
      return entity.tag;
    default:
      // This is an unknown entity type so ignore it as we don't know how to
      // handle it.
      return null;
  }
}
17026
def _match_registers(self, query):
        
        if query in self._status_registers:
            register = self._status_registers[query]
            response = register.value
            logger.debug('Found response in status register: %s',
                         repr(response))
            register.clear()

            return response
540772
EntityType getEntityTypeBypassingRegistry(String entityTypeId) {
    return entityTypeId != null
        ? dataService.findOneById(
            ENTITY_TYPE_META_DATA, entityTypeId, getEntityTypeFetch(), EntityType.class)
        : null;
  }
1157048
function checkEntityTypes(em, entityTypes) {
    assertParam(entityTypes, "entityTypes").isString().isOptional().or().isNonEmptyArray().isString()
        .or().isInstanceOf(EntityType).or().isNonEmptyArray().isInstanceOf(EntityType).check();
    if (typeof entityTypes === "string") {
      entityTypes = em.metadataStore._getEntityType(entityTypes, false);
    } else if (Array.isArray(entityTypes) && typeof entityTypes[0] === "string") {
      entityTypes = entityTypes.map(function (etName) {
        return em.metadataStore._getEntityType(etName, false);
      });
    }
    return entityTypes;
  }
1304947
function registerTypeById(type) {
    if (registryLogger.isDebugEnabled()) {
        registryLogger.debug('Register Type \'%s\' by id [%s]', type.typeName, type.id);
    }
    if(type.id) {
        typeById[type.id] = type;
    }
    return type;
}
703840
private String validateEntity(Entity entity) throws WIMException {
        String METHODNAME = "validateEntity";
        String type = null;
        String secName = null;
        String uniqueId = null;
        String uniqueName = null;

        if (entity.getIdentifier().isSet(SchemaConstants.PROP_UNIQUE_NAME)) {
            uniqueName = entity.getIdentifier().getUniqueName();
        } else if (entity.getIdentifier().isSet(SchemaConstants.PROP_EXTERNAL_NAME)) {
            uniqueName = entity.getIdentifier().getExternalName();
        } else if (entity.getIdentifier().isSet(SchemaConstants.PROP_UNIQUE_ID)) {
            uniqueId = entity.getIdentifier().getUniqueId();
        } else if (entity.getIdentifier().isSet(SchemaConstants.PROP_EXTERNAL_ID)) {
            uniqueId = entity.getIdentifier().getExternalId();
        }

        if (uniqueName != null) {
            secName = uniqueName; // stripRDN(uniqueName);
        }

        if (uniqueId != null && uniqueId.trim().length() > 0) {
            if (isValidUserOrGroup(uniqueId)) {
                uniqueName = uniqueId;
                secName = uniqueId;
            } else {
                secName = getSecNameFromUniqueID(uniqueId);
                uniqueName = secName;
            }
        }

        if (secName != null && secName.trim().length() > 0) {
            String rdnAttr = getRDN(entity.getIdentifier().getUniqueName());
            Set<String> EntityTypes = entityConfigMap.keySet();
            List<String> entities = new ArrayList<String>();
            Iterator<String> it = EntityTypes.iterator();

            while (it.hasNext()) {
                String entityType = it.next();
                if ((rdnAttr == null) || (rdnAttr.equalsIgnoreCase(entityConfigMap.get(entityType)))) {
                    entities.add(entityType);
                }
            }
            //handle if entities.size== or >1 then respect entity.getType from input DO
            //this is better than just letting the last matching type be returned.
            String inputType = entity.getTypeName();
            type = getEntityTypeFromUniqueName(secName, entities, inputType);
            entity.getIdentifier().setUniqueName(uniqueName);
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, METHODNAME + " The entity type for " + secName + " is " + type);
        }
        if (type == null) {
            throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                               WIMMessageHelper.generateMsgParms(secName)));
        }
        return type;
    }
990806
def is_registered(id):
    """"""
    bucket = registration_s3_bucket()
    key = registration_key(id)
    found_keys = set(obj.key for obj in bucket.objects.filter(Prefix=key))
    return key in found_keys
9232
public String getId(OWLClass entity) {
    for (OWLAnnotationProperty owlObjectProperty : ontology.getAnnotationPropertiesInSignature()) {
      if (ifExistsAnnotation(owlObjectProperty.toString(), "id")) {
        Set<String> annotation = getAnnotation(entity, owlObjectProperty.getIRI().toString());
        if (!annotation.isEmpty()) {
          return annotation.iterator().next();
        }
      }
    }
    return StringUtils.EMPTY;
  }
314861
function getEntities(callback) {
    self.get(filter, fields, null, page, sort, function(error, entities, pagination) {
      if (error) return callback(error);

      allEntities = allEntities.concat(entities);

      if (page < pagination.pages - 1) {

        // There are other pages
        // Get next page
        page++;
        getEntities(callback);

      } else {

        // No more pages
        // End it
        callback(null);
      }
    });
  }
153118
protected void checkEntity(InputProblemReporter rep, String id, EntityDecl ent)
        throws XMLStreamException
    {
        if (ent == null) {
            rep.reportValidationProblem("Referenced entity '"+id+"' not defined");
        } else if (ent.isParsed()) {
            rep.reportValidationProblem("Referenced entity '"+id+"' is not an unparsed entity");
        }
    }
147312
public function getEntityId($entity)
    {
        $entityId = $this->idAccessorRegistry->getEntityId($entity);

        if (is_array($entityId)) {
            ksort($entityId);
            $entityId = json_encode($entityId);
        }

        return $entityId;
    }
141503
def _is_initialized(self, entity):
    
    return (not self._required or
            ((self._has_value(entity) or self._default is not None) and
             self._get_value(entity) is not None))
717019
function registrationIds() {
			const ids = [];
			for (const regid of findChildren(sapFioriAppData, "registrationId")) {
				ids.push(regid._);
			}
			return ids.length > 0 ? ids : undefined;
		}
699762
public static Entity getEntity(EntityWidget widget, StorageService storageService) {
		Entity entity = widget.getEntity();				
		if (entity == null) {	
            String entityId = widget.getInternalSettings().get(EntityWidget.ENTITY_ID);
            try {
                entity = storageService.getEntityById(entityId);
            } catch (NotFoundException e) {                
                e.printStackTrace();
            }      
            widget.setEntity(entity);
        }
		return entity;
	}
1043620
def is_marked_new(self, entity):
        
        try:
            result = EntityState.get_state(entity).status == ENTITY_STATUS.NEW
        except ValueError:
            result = False
        return result
973704
protected void entity() {
        nextChar();
        String name = null;
        if (ch == '#') {
            int namep = bp;
            nextChar();
            if (isDecimalDigit(ch)) {
                nextChar();
                while (isDecimalDigit(ch))
                    nextChar();
                name = new String(buf, namep, bp - namep);
            } else if (ch == 'x' || ch == 'X') {
                nextChar();
                if (isHexDigit(ch)) {
                    nextChar();
                    while (isHexDigit(ch))
                        nextChar();
                    name = new String(buf, namep, bp - namep);
                }
            }
        } else if (isIdentifierStart(ch)) {
            name = readIdentifier();
        }

        if (name != null) {
            if (ch != ';')
                return;
            nextChar();
        }
    }