from pycanvas import Course, Requester
from pycanvas.util import combine_kwargs
from pycanvas.exceptions import ResourceDoesNotExist


class Canvas(object):
    """
    The main class to be instantiated to provide access to Canvas's API.
    """

    def __init__(self, base_url, access_token):
        """
        :param base_url: string
        :param access_token: string
        """
        self.__requester = Requester(base_url, access_token)

    def create_course(self, account_id, **kwargs):
        """
        Create a course.

        :calls: `POST /api/v1/accounts/:account_id/courses <https://canvas.instructure.com/doc/api/courses.html#method.courses.create>`
        :param account_id: int
        :rtype: :class:`pycanvas.course.Course`
        """
        response = self.__requester.request(
            'POST',
            'accounts/%s/courses' % (account_id),
            account_id=account_id,
            **combine_kwargs(**kwargs)
        )
        return Course(self.__requester, response.json())

    def get_course(self, id):
        """
        Retrieve a course by its ID.

        :calls: `GET /courses/:id <https://canvas.instructure.com/doc/api/courses.html#method.courses.show>`
        :param id: int
        :rtype: :class:`pycanvas.course.Course`
        """
        response = self.__requester.request(
            'GET',
            'courses/%s' % (id)
        )
        return Course(self.__requester, response.json())

from pycanvas import Course, Requester
from pycanvas.util import combine_kwargs


class Canvas(object):
    """
    The main class to be instantiated to provide access to Canvas's API.
    """

    def __init__(self, base_url, access_token):
        """
        :param base_url: string
        :param access_token: string
        """
        self.__requester = Requester(base_url, access_token)

    def create_course(self, account_id, **kwargs):
        """
        Create a course.

        :calls: `POST /api/v1/accounts/:account_id/courses <https://canvas.instructure.com/doc/api/courses.html#method.courses.create>`
        :param account_id: int
        :rtype: :class:`pycanvas.course.Course`
        """
        response = self.__requester.request(
            'POST',
            'accounts/%s/courses' % (account_id),
            account_id=account_id,
            **combine_kwargs(**kwargs)
        )
        return Course(self.__requester, response.json())

    def get_course(self, id):
        """
        Retrieve a course by its ID.

        :calls: `GET /courses/:id <https://canvas.instructure.com/doc/api/courses.html#method.courses.show>`
        :param id: int
        :rtype: :class:`pycanvas.course.Course`
        """
        response = self.__requester.request(
            'GET',
            'courses/%s' % (id)
        )
        return Course(self.__requester, response.json())

Remove unused import.