src/canvas-extractor/tests/data_generation/courses.py
def load_courses(account: Account, courses: List[Dict]) -> List[Course]:
    """
    Load a list of courses via the Canvas API.

    Parameters
    ----------
    account : Account
        An Account SDK object
    courses: List[Dict]
        A list of JSON-like course objects in a form suitable for submission to the
        Canvas course creation endpoint.

    Returns
    -------
    List[Course]
        A list of Canvas SDK Course objects representing the created courses
    """
    logger.info("Creating %s courses via Canvas API", len(courses))

    result: List[Course] = []
    for course in courses:
        result.append(account.create_course(**course))

    logger.info("Successfully created %s courses", len(courses))

    return result

    Load a list of courses via the Canvas API.

    Parameters
    ----------
    account : Account
        An Account SDK object
    courses: List[Dict]
        A list of JSON-like course objects in a form suitable for submission to the
        Canvas course creation endpoint.

    Returns
    -------
    List[Course]
        A list of Canvas SDK Course objects representing the created courses
    
Load a list of courses via the Canvas API.
Parameters

account : Account
An Account SDK object
courses: List[Dict]
A list of JSON-like course objects in a form suitable for submission to the
Canvas course creation endpoint.

Returns

List[Course]
A list of Canvas SDK Course objects representing the created courses
Load a list of courses via the Canvas API . Parameters account : Account An Account SDK object courses : List [ Dict ] A list of JSON - like course objects in a form suitable for submission to the Canvas course creation endpoint . Returns List [ Course ] A list of Canvas SDK Course objects representing the created courses
def load_courses(account: Account, courses: List[Dict]) -> List[Course]:
    logger.info("Creating %s courses via Canvas API", len(courses))
    result: List[Course] = []
    for course in courses:
        result.append(account.create_course(**course))
    logger.info("Successfully created %s courses", len(courses))
    return result
def load_courses ( account : Account , courses : List [ Dict ] ) -> List [ Course ] : logger . info ( "Creating %s courses via Canvas API" , len ( courses ) ) result : List [ Course ] = [ ] for course in courses : result . append ( account . create_course ( ** course ) ) logger . info ( "Successfully created %s courses" , len ( courses ) ) return result
Load a list of courses via the Canvas API.
Load a list of courses via the Canvas API .
"""
    Load a list of courses via the Canvas API.

    Parameters
    ----------
    account : Account
        An Account SDK object
    courses: List[Dict]
        A list of JSON-like course objects in a form suitable for submission to the
        Canvas course creation endpoint.

    Returns
    -------
    List[Course]
        A list of Canvas SDK Course objects representing the created courses
    """
account
Account
courses
List[Dict]