def get_enrollments_for_regid(self, regid, params={},<EOL>include_courses=True):
sis_user_id = self._sis_id(regid, sis_field="<STR_LIT:user>")<EOL>url = USERS_API.format(sis_user_id) + "<STR_LIT>"<EOL>courses = Courses() if include_courses else None<EOL>enrollments = []<EOL>for datum in self._get_paged_resource(url, params=params):<EOL><INDENT>enrollment = CanvasEnrollment(data=datum)<EOL>if include_courses:<EOL><INDENT>course_id = datum["<STR_LIT>"]<EOL>course = courses.get_course(course_id)<EOL>if course.sis_course_id is not None:<EOL><INDENT>enrollment.course = course<EOL>enrollment.course_url = course.course_url<EOL>enrollment.course_name = course.name<EOL>enrollment.sis_course_id = course.sis_course_id<EOL><DEDENT><DEDENT>else:<EOL><INDENT>enrollment.course_url = re.sub(<EOL>r'<STR_LIT>', '<STR_LIT>', enrollment.html_url)<EOL><DEDENT>enrollments.append(enrollment)<EOL><DEDENT>return enrollments<EOL>
Return a list of enrollments for the passed user regid.

https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index