async def create_email_identity(self, <EOL>client_id, identity, passwd, *, <EOL>user_id=None <EOL>) -> SessionIdentity :
assert passwd<EOL>value, _ = await self._client.get(f"<STR_LIT>")<EOL>if value:<EOL><INDENT>raise ValueError(f'<STR_LIT>')<EOL><DEDENT>if user_id is None: <EOL><INDENT>user_id = await self._user_id_generator.new()<EOL><DEDENT>hashed = sha256_crypt.using(rounds=<NUM_LIT>, salt_size=<NUM_LIT:8>).hash(passwd)<EOL>profile = {<EOL>"<STR_LIT>": user_id,<EOL>"<STR_LIT>": identity,<EOL>"<STR_LIT>": hashed<EOL>}<EOL>token = genword(length=<NUM_LIT:32>, charset="<STR_LIT>")<EOL>key = f"<STR_LIT>"<EOL>await self._client.put(key, json.dumps(profile))<EOL>return SessionIdentity(user_id=user_id, identity=identity)<EOL>
创建使用电子邮件地址和密码登录的用户身份