code: def delete_enrollment(session, enrollment):
      
      uidentity = enrollment.uidentity
      uidentity.last_modified = datetime.datetime.utcnow()
  
      session.delete(enrollment)
      session.flush()
docs: Remove an enrollment from the session.
  
      This function removes from the session the given enrollment.
  
      :param session: database session
      :param enrollment: enrollment to remove