def enroll_user(self, course_id, user_id, enrollment_type, params=None):
url = COURSES_API.format(course_id) + "<STR_LIT>"<EOL>if not params:<EOL><INDENT>params = {}<EOL><DEDENT>params["<STR_LIT>"] = user_id<EOL>params["<STR_LIT:type>"] = enrollment_type<EOL>data = self._post_resource(url, {"<STR_LIT>": params})<EOL>return CanvasEnrollment(data=data)<EOL>
Enroll a user into a course.

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