<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __parse_enrollments(self, user):
 """Parse user enrollments"""


        enrollments = []

        for company in user['companies']:
            name = company['company_name']

            org = self._organizations.get(name, None)

            if not org:
                org = Organization(name=name)
                self._organizations[name] = org

            start_date = MIN_PERIOD_DATE
            end_date = MAX_PERIOD_DATE

            if company['end_date']:
                end_date = str_to_datetime(company['end_date'])

            rol = Enrollment(start=start_date, end=end_date,
                             organization=org)
            enrollments.append(rol)

        return enrollments