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

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

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

    result: List[User] = []
    for user in users:
        try:
            result.append(account.create_user(user))
        except Exception as ex:
            logger.exception(ex)
            time.sleep(10)

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

    return result

    Load a list of users via the Canvas API.

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

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

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

Returns

List[User]
A list of Canvas SDK User objects representing the created users
Load a list of users via the Canvas API . Parameters account : Account An Account SDK object users : List [ Dict ] A list of JSON - like user objects in a form suitable for submission to the Canvas user creation endpoint . Returns List [ User ] A list of Canvas SDK User objects representing the created users
def load_users(account: Account, users: List[Dict]) -> List[User]:
    logger.info("Creating %s users via Canvas API", len(users))
    result: List[User] = []
    for user in users:
        try:
            result.append(account.create_user(user))
        except Exception as ex:
            logger.exception(ex)
            time.sleep(10)
    logger.info("Successfully created %s users", len(result))
    return result
def load_users ( account : Account , users : List [ Dict ] ) -> List [ User ] : logger . info ( "Creating %s users via Canvas API" , len ( users ) ) result : List [ User ] = [ ] for user in users : try : result . append ( account . create_user ( user ) ) except Exception as ex : logger . exception ( ex ) time . sleep ( 10 ) logger . info ( "Successfully created %s users" , len ( result ) ) return result
Load a list of users via the Canvas API.
Load a list of users via the Canvas API .
"""
    Load a list of users via the Canvas API.

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

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