def fetch_argument(
    args: _List[_Any],
    kwargs: _Dict[str, _Any],
    default: _Any,
    position: int,
    keyword: str = None,
) -> _Any:
    """
    Given a list of arguments, a dictionary of keyword arguments, a default value
    for the parameter if it cannot be found, the expected position of the parameter
    and the keyword corresponding to the parameter, this function determines the
    value of the parameter and returns it.
    """

    ret = default
    if keyword in kwargs:
        ret = kwargs[keyword]
    elif len(args) > position:
        ret = args[position]
    return ret

    Given a list of arguments, a dictionary of keyword arguments, a default value
    for the parameter if it cannot be found, the expected position of the parameter
    and the keyword corresponding to the parameter, this function determines the
    value of the parameter and returns it.
    
coremltools/optimize/torch/_utils/transforms.py