code: def __reset_unique_identities(self):
          
  
          self.log("Reseting unique identities...")
  
          self.log("Clearing identities relationships")
  
          nids = 0
          uidentities = api.unique_identities(self.db)
  
          for uidentity in uidentities:
              for identity in uidentity.identities:
                  api.move_identity(self.db, identity.id, identity.id)
                  nids += 1
  
          self.log("Relationships cleared for %s identities" % nids)
  
          self.log("Clearing enrollments")
  
          with self.db.connect() as session:
              enrollments = session.query(Enrollment).all()
  
              for enr in enrollments:
                  session.delete(enr)
  
          self.log("Enrollments cleared")
docs: Clear identities relationships and enrollments data