<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __reset_unique_identities(self):
 """Clear identities relationships and enrollments data"""


        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")