code: def delete_identity(session, identity):
      
      uidentity = identity.uidentity
      uidentity.last_modified = datetime.datetime.utcnow()
  
      session.delete(identity)
      session.flush()
docs: Remove an identity from the session.
  
      This function removes from the session the identity given
      in `identity`. Take into account this function does not
      remove unique identities in the case they get empty.
  
      :param session: database session
      :param identity: identity to remove