Returns all the entities of assertions for a subject, disregarding
        whether the assertion still is valid or not.

        :param name_id: The subject identifier, a NameID instance
        :return: A possibly empty list of entity identifiers
762944
def entities(self, name_id):
        
        cni = code(name_id)
        return list(self._db[cni].keys())
701525
def namedb_name_fields_check( name_rec ):
    

    if not name_rec.has_key('name'):
        raise Exception("BUG: name record has no name")

    # extract namespace ID if it's not already there 
    if not name_rec.has_key('namespace_id'):
        name_rec['namespace_id'] = get_namespace_from_name( name_rec['name'] )

    # extract name_hash if it's not already there 
    if not name_rec.has_key('name_hash128'):
        name_rec['name_hash128'] = hash256_trunc128( name_rec['name'] )

    return True
196125
def members_to_ask(self, name_id):
        

        vo_members = self._affiliation_members()
        for member in self.member:
            if member not in vo_members:
                vo_members.append(member)

        # Remove the ones I have cached data from about this subject
        vo_members = [m for m in vo_members if not self.sp.users.cache.active(
            name_id, m)]
        logger.info("VO members (not cached): %s", vo_members)
        return vo_members
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
1100100
def get_name(model_id):
    
    name = _names.get(model_id)
    if name is None:
        name = 'id = %s (no name)' % str(model_id)
    return name
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
402200
def get_multi_instances_by_id(self, instance_ids):
        
        result = []

        for reservation in self.all_reservations():
            for instance in reservation.instances:
                if instance.id in instance_ids:
                    result.append(instance)

        # TODO: Trim error message down to specific invalid id.
        if instance_ids and len(instance_ids) > len(result):
            raise InvalidInstanceIdError(instance_ids)

        return result
811304
def identity_map(self):
        
        pk = self.identity_attributes()
        values = {}
        for name in pk:
            values[name] = getattr(self, name)
        return values
1245166
def getEntity(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 uri.startswith("http://"):
                match = uri
                uri = None
        if match:
            if type(match) != type("string"):
                return []
            res = []
            if ":" in match: # qname
                for x in self.classes:
                    if match.lower() in x.qname.lower():
                        res += [x]
                for x in self.properties:
                    if match.lower() in x.qname.lower():
                        res += [x]
            else:
                for x in self.classes:
                    if match.lower() in x.uri.lower():
                        res += [x]
                for x in self.properties:
                    if match.lower() in x.uri.lower():
                        res += [x]
            return res
        else:
            for x in self.classes:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            for x in self.properties:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            return None
756152
def get_nameid_format(request, key=None):
        
        name_id_format = None
        name_id_data = OneLogin_Saml2_Logout_Request.get_nameid_data(request, key)
        if name_id_data and 'Format' in name_id_data.keys():
            name_id_format = name_id_data['Format']
        return name_id_format
1001688
def get_subject(self, identifier):
        
        subject = etree.Element('Subject')
        name = etree.SubElement(subject, 'NameIdentifier')
        name.text = identifier
        subject_confirmation = etree.SubElement(subject, 'SubjectConfirmation')
        method = etree.SubElement(subject_confirmation, 'ConfirmationMethod')
        method.text = self.confirmation_method
        return subject
586434
def _list(self):
        
        all = self.driver.instance.metadata.get(search=self.namespace)
        list = []
        for id in all:
            try:
                if not self._get(id['id']) in list:
                    list.append(self._get(id['id']))
            except Exception:
                pass

        return list
1042644
def get_subject_version(self, subject, version_id):
        
        res = requests.get(self._url('/subjects/{}/versions/{}', subject, version_id))
        raise_if_failed(res)
        return json.loads(res.json()['schema'])
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
716930
def _determine_critical(self, name):
        

        if name == 'subject_alt_name':
            return len(self._subject) == 0

        if name == 'basic_constraints':
            return self.ca is True

        return {
            'subject_directory_attributes': False,
            'key_usage': True,
            'issuer_alt_name': False,
            'name_constraints': True,
            # Based on example EV certificates, non-CA certs have this marked
            # as non-critical, most likely because existing browsers don't
            # seem to support policies or name constraints
            'certificate_policies': False,
            'policy_mappings': True,
            'policy_constraints': True,
            'extended_key_usage': False,
            'inhibit_any_policy': True,
            'subject_information_access': False,
            'tls_feature': False,
            'ocsp_no_check': False,
        }.get(name, False)
169707
def usable_id(cls, id):
        
        try:
            # id is maybe a sshkey name
            qry_id = cls.from_name(id)
            if not qry_id:
                qry_id = int(id)
        except DuplicateResults as exc:
            cls.error(exc.errors)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id
925010
def getOntology(self, id_):
        
        if id_ not in self._ontologyIdMap:
            raise exceptions.OntologyNotFoundException(id_)
        return self._ontologyIdMap[id_]