Return a raw document of the Identity
        :return:
179721
def raw(self) -> str:
        
        return """Version: {version}
Type: Identity
Currency: {currency}
Issuer: {pubkey}
UniqueID: {uid}
Timestamp: {timestamp}
""".format(version=self.version,
           currency=self.currency,
           pubkey=self.pubkey,
           uid=self.uid,
           timestamp=self.timestamp)
473262
def get_document(id, index=INDEX_NAME, doc_type=DOC_TYPE, **kwargs):
    
    result = es_conn.get(index=index, doc_type=doc_type, id=id, **kwargs)
    return result['_source']
477226
def extract_self_cert(signed_raw: str) -> Identity:
        
        lines = signed_raw.splitlines(True)
        n = 0

        version = int(Revocation.parse_field("Version", lines[n]))
        n += 1

        Revocation.parse_field("Type", lines[n])
        n += 1

        currency = Revocation.parse_field("Currency", lines[n])
        n += 1

        issuer = Revocation.parse_field("Issuer", lines[n])
        n += 1

        unique_id = Revocation.parse_field("IdtyUniqueID", lines[n])
        n += 1

        timestamp = Revocation.parse_field("IdtyTimestamp", lines[n])
        n += 1

        signature = Revocation.parse_field("IdtySignature", lines[n])
        n += 1

        return Identity(version, currency, issuer, unique_id, timestamp, signature)
1243988
def identityRequest():
    """"""
    a = TpPd(pd=0x5)
    b = MessageType(mesType=0x8)  # 00001000
    c = IdentityTypeAndSpareHalfOctets()
    packet = a / b / c
    return packet
800466
def get_identities(self, item):
        

        message = item['data']['message']
        identity = self.get_sh_identity(message['from'])

        yield identity
50791
def get_identities(self, item):
        

        item = item['data']
        user = self.get_sh_identity(item)

        yield user
972800
def get_identity(self):
        
        ava = {}
        for _assertion in self.assertions:
            if _assertion.advice:
                if _assertion.advice.assertion:
                    for tmp_assertion in _assertion.advice.assertion:
                        if tmp_assertion.attribute_statement:
                            assert len(tmp_assertion.attribute_statement) == 1
                            ava.update(self.read_attribute_statement(
                                tmp_assertion.attribute_statement[0]))
            if _assertion.attribute_statement:
                logger.debug("Assertion contains %s attribute statement(s)",
                             (len(self.assertion.attribute_statement)))
                for _attr_statem in _assertion.attribute_statement:
                    logger.debug("Attribute Statement: %s" % (_attr_statem,))
                    ava.update(self.read_attribute_statement(_attr_statem))
            if not ava:
                logger.debug("Assertion contains no attribute statements")
        return ava
809012
def get_contents_sig(self):
        

        try:
            return self.contentsig
        except AttributeError:
            pass

        executor = self.get_executor()

        result = self.contentsig = SCons.Util.MD5signature(executor.get_contents())
        return result
566063
def serialize(self) -> str:
        

        return {
            '@context': DIDDoc.CONTEXT,
            'id': canon_ref(self.did, self.did),
            'publicKey': [pubkey.to_dict() for pubkey in self.pubkey.values()],
            'authentication': [{
                'type': pubkey.type.authn_type,
                'publicKey': canon_ref(self.did, pubkey.id)
            } for pubkey in self.pubkey.values() if pubkey.authn],
            'service': [service.to_dict() for service in self.service.values()]
        }
749155
private static String getIdentityDocument(final HttpClient client) throws IOException {
    try {
      final HttpGet getInstance = new HttpGet();
      getInstance.setURI(INSTANCE_IDENTITY_URI);
      final HttpResponse response = client.execute(getInstance);
      if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
        throw new IOException("failed to get instance identity, tried: " + INSTANCE_IDENTITY_URL + ", response: " + response.getStatusLine().getReasonPhrase());
      }
      return EntityUtils.toString(response.getEntity());
    } catch (Exception e) {
      throw new IOException("failed to get instance identity", e);
    }
  }
734619
def from_signed_raw(cls: Type[IdentityType], signed_raw: str) -> IdentityType:
        
        n = 0
        lines = signed_raw.splitlines(True)

        version = int(Identity.parse_field("Version", lines[n]))
        n += 1

        Identity.parse_field("Type", lines[n])
        n += 1

        currency = Identity.parse_field("Currency", lines[n])
        n += 1

        pubkey = Identity.parse_field("Issuer", lines[n])
        n += 1

        uid = Identity.parse_field("UniqueID", lines[n])
        n += 1

        ts = BlockUID.from_str(Identity.parse_field("Timestamp", lines[n]))
        n += 1

        signature = Identity.parse_field("Signature", lines[n])

        return cls(version, currency, pubkey, uid, ts, signature)
1331966
def get_identities(self, item):
        """"""

        category = item['category']
        item = item['data']

        if category == "issue":
            identity_types = ['user', 'assignee']
        elif category == "pull_request":
            identity_types = ['user', 'merged_by']
        else:
            identity_types = []

        for identity in identity_types:
            if item[identity]:
                # In user_data we have the full user data
                user = self.get_sh_identity(item[identity + "_data"])
                if user:
                    yield user
578351
def from_dict(document):
        
        if 'default' in document:
            default = document['default']
        else:
            default = None
        return AttributeDefinition(
            document['id'],
            document['name'],
            document['description'],
            AttributeType.from_dict(document['type']),
            default=default
        )
811304
def identity_map(self):
        
        pk = self.identity_attributes()
        values = {}
        for name in pk:
            values[name] = getattr(self, name)
        return values
345847
def get_certification_document(current_block: dict, self_cert_document: Identity, from_pubkey: str) -> Certification:
    
    # construct Certification Document
    return Certification(version=10, currency=current_block['currency'], pubkey_from=from_pubkey,
                                  identity=self_cert_document,
                                  timestamp=BlockUID(current_block['number'], current_block['hash']), signature="")
950077
public ORID getIdentity() {
		if(orid!=null) return orid;
		ODocument doc = getObject();
		return doc!=null?doc.getIdentity():null;
	}
729943
def identify(self, request):
        
        try:
            authorization = request.authorization
        except ValueError:
            return NO_IDENTITY
        if authorization is None:
            return NO_IDENTITY
        authtype, params = authorization
        auth = parse_basic_auth(authtype, params)
        if auth is None:
            return NO_IDENTITY
        return Identity(userid=auth.username, password=auth.password)