Return any entity that matches the specification

        :param typ: Type of entity
        :param service:
        :param binding:
        :return:
340147
def any(self, typ, service, binding=None):
        
        res = {}
        for ent in self.keys():
            bind = self.service(ent, typ, service, binding)
            if bind:
                res[ent] = bind

        return res
1136128
def parse_authn_query_response(self, response, binding=BINDING_SOAP):
        
        kwargs = {"entity_id": self.config.entityid,
                  "attribute_converters": self.config.attribute_converters}

        return self._parse_response(response, AuthnQueryResponse, "", binding,
                                    **kwargs)
141818
function findEntity(collection, entity) {
	return collection.findIndex(item => angular.equals(item, entity));
}
1025093
def _get_by_type(self, key, operation, create, type_, default, return_default=True):
        
        key = self._encode(key)
        if self.type(key) in [type_, b'none']:
            if create:
                return self.redis.setdefault(key, default)
            else:
                return self.redis.get(key, default if return_default else None)

        raise TypeError("{} requires a {}".format(operation, type_))
114122
def parse_assertion_id_request_response(self, response, binding):
        
        kwargs = {"entity_id": self.config.entityid,
                  "attribute_converters": self.config.attribute_converters}

        res = self._parse_response(response, AssertionIDResponse, "", binding,
                                   **kwargs)
        return res
34899
def get(self, identity):
        
        return EntityContext(self._version, service_sid=self._solution['service_sid'], identity=identity, )
1232556
def match_type?(object)
            result = object.kind_of_any? self.type_classes
            if not result
                result = object.type_of_any? self.type_types
            end
            
            return result
        end
1137558
def _validate_entities(self, tasks):
        

        if not tasks:
            raise TypeError(expected_type=Task, actual_type=type(tasks))

        if not isinstance(tasks, set):

            if not isinstance(tasks, list):
                tasks = set([tasks])
            else:
                tasks = set(tasks)

        for t in tasks:

            if not isinstance(t, Task):
                raise TypeError(expected_type=Task, actual_type=type(t))

        return tasks
127046
def bind(var, typ, force: false)
      raise RuntimeError, "Can't update variable with fixed type" if !force && @env[var] && @env[var][:fixed]
      result = Env.new
      result.env = @env.merge(var => {type: typ, fixed: false})
      return result
    end
491191
def _find_entity(self, entity):
        ''' '''
        if entity in self.entities:
            return self.entities[entity]
        _ent = [e for e in self.entities.values() if e.name == entity]
        if len(_ent) > 1:
            raise ValueError("Entity name '%s' matches %d entities. To "
                             "avoid ambiguity, please prefix the entity "
                             "name with its domain (e.g., 'bids.%s'." %
                             (entity, len(_ent), entity))
        if _ent:
            return _ent[0]

        raise ValueError("No entity '%s' found." % entity)
428495
public static Specification<JpaSoftwareModule> equalType(final Long type) {
        return (targetRoot, query, cb) -> cb.equal(
                targetRoot.<JpaSoftwareModuleType> get(JpaSoftwareModule_.type).get(JpaSoftwareModuleType_.id), type);
    }
330569
function conformDispatch (spec) {
  if ('schema' in spec) {
    return 'schema'
  } else if ('$ref' in spec) {
    return '$ref'
  } else if ('enum' in spec) {
    return 'enum'
  } else if ('allOf' in spec) {
    return 'allOf'
  } else if ('type' in spec) {
    return spec.type
  } else {
    throw Object.assign(Error('Could not determine type'), { spec })
  }
}
933652
def get_any_entity(self, id=None, uri=None, match=None):
        

        if not id and not uri and not match:
            return None

        if type(id) == type("string"):
            uri = id
            id = None
            if not is_http(uri):
                match = uri
                uri = None
        if match:
            if type(match) != type("string"):
                return []
            res = []
            if ":" in match:  # qname
                for x in self.all_classes:
                    if match.lower() in x.qname.lower():
                        res += [x]
                for x in self.all_properties:
                    if match.lower() in x.qname.lower():
                        res += [x]
            else:
                for x in self.all_classes:
                    if match.lower() in x.uri.lower():
                        res += [x]
                for x in self.all_properties:
                    if match.lower() in x.uri.lower():
                        res += [x]
            return res
        else:
            for x in self.all_classes:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            for x in self.all_properties:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            return None
987159
public static EntityType checkIsEntityType(Type type) {
        if (!isEntityType(type)) {
            throw new ODataSystemException("An entity type is required, but '" + type.getFullyQualifiedName() +
                    "' is not an entity type: " + type.getMetaType());
        }
        return (EntityType) type;
    }
1359210
def get_object_from_content(entity, key):
    
    def object_from_content_function(service, message):
        """Actual implementation of get_object_from_content function.

        :param service: SelenolService object.
        :param message: SelenolMessage request.
        """
        id_ = get_value_from_content(key)(service, message)
        result = service.session.query(entity).get(id_)
        if not result:
            raise SelenolInvalidArgumentException(key, id_)
        return result
    return object_from_content_function
897275
def get_type_data(self, name):
        """"""
        try:
            return {
                'authority': 'DLKIT',
                'namespace': 'relationship.Relationship',
                'identifier': name.lower(),
                'domain': 'Generic Types',
                'display_name': name.title() + ' Type',
                'display_label': name.title(),
                'description': ('The ' + name.title() + ' Type.')
            }
        except IndexError:
            raise NotFound('RelationshipType: ' + name.title())
229243
def get_instance(self, payload):
        
        return BindingInstance(self._version, payload, service_sid=self._solution['service_sid'], )