<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_identity(session, identity):
 """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 """

    uidentity = identity.uidentity
    uidentity.last_modified = datetime.datetime.utcnow()

    session.delete(identity)
    session.flush()