def get_user(self, user, user_id_type=None):
from canvasapi.user import User<EOL>if user_id_type:<EOL><INDENT>uri = '<STR_LIT>'.format(self.id, user_id_type, user)<EOL><DEDENT>else:<EOL><INDENT>user_id = obj_or_id(user, "<STR_LIT:user>", (User,))<EOL>uri = '<STR_LIT>'.format(self.id, user_id)<EOL><DEDENT>response = self._requester.request(<EOL>'<STR_LIT:GET>',<EOL>uri<EOL>)<EOL>return User(self._requester, response.json())<EOL>
Retrieve a user by their ID. `user_id_type` denotes which endpoint to try as there are
several different ids that can pull the same user record from Canvas.

:calls: `GET /api/v1/courses/:course_id/users/:id \
<https://canvas.instructure.com/doc/api/courses.html#method.courses.user>`_

:param user: The object or ID of the user to retrieve.
:type user: :class:`canvasapi.user.User` or int
:param user_id_type: The type of the ID to search for.
:type user_id_type: str

:rtype: :class:`canvasapi.user.User`