def set_course_nickname(self, course, nickname):
from canvasapi.course import CourseNickname<EOL>course_id = obj_or_id(course, "<STR_LIT>", (Course,))<EOL>response = self.__requester.request(<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(course_id),<EOL>nickname=nickname<EOL>)<EOL>return CourseNickname(self.__requester, response.json())<EOL>
Set a nickname for the given course. This will replace the
course's name in the output of subsequent API calls, as
well as in selected places in the Canvas web user interface.

:calls: `PUT /api/v1/users/self/course_nicknames/:course_id \
<https://canvas.instructure.com/doc/api/users.html#method.course_nicknames.update>`_

:param course: The ID of the course.
:type course: :class:`canvasapi.course.Course` or int
:param nickname: The nickname for the course.
:type nickname: str

:rtype: :class:`canvasapi.course.CourseNickname`