original_docstring: 
      List all identities on an account.
  
      :param account: The account name.
      :param session: the database session in use.
      
docstring: List all identities on an account.
docstring_tokens: List all identities on an account .
code: def list_identities(account, session=None):
      """
      List all identities on an account.
  
      :param account: The account name.
      :param session: the database session in use.
      """
      identity_list = list()
  
      query = session.query(models.Account).filter_by(account=account).filter_by(status=AccountStatus.ACTIVE)
      try:
          query.one()
      except exc.NoResultFound:
          raise exception.AccountNotFound('Account with ID \'%s\' cannot be found' % account)
  
      query = session.query(models.IdentityAccountAssociation, models.Identity)\
                     .join(models.Identity, and_(models.Identity.identity == models.IdentityAccountAssociation.identity,
                                                 models.Identity.identity_type == models.IdentityAccountAssociation.identity_type))\
                     .filter(models.IdentityAccountAssociation.account == account)
      for identity in query:
          identity_list.append({'type': identity[0].identity_type, 'identity': identity[0].identity, 'email': identity[1].email})
  
      return identity_list
code_tokens: def list_identities ( account , session = None ) : identity_list = list ( ) query = session . query ( models . Account ) . filter_by ( account = account ) . filter_by ( status = AccountStatus . ACTIVE ) try : query . one ( ) except exc . NoResultFound : raise exception . AccountNotFound ( 'Account with ID \'%s\' cannot be found' % account ) query = session . query ( models . IdentityAccountAssociation , models . Identity ) . join ( models . Identity , and_ ( models . Identity . identity == models . IdentityAccountAssociation . identity , models . Identity . identity_type == models . IdentityAccountAssociation . identity_type ) ) . filter ( models . IdentityAccountAssociation . account == account ) for identity in query : identity_list . append ( { 'type' : identity [ 0 ] . identity_type , 'identity' : identity [ 0 ] . identity , 'email' : identity [ 1 ] . email } ) return identity_list
short_docstring: List all identities on an account.
short_docstring_tokens: List all identities on an account .
comment: """
      List all identities on an account.
  
      :param account: The account name.
      :param session: the database session in use.
      """