def to_progress_instance(
    progress: Union[Callable[..., Any], RemoteProgress, None],
) -> Union[RemoteProgress, CallableRemoteProgress]:
    """Given the `progress` return a suitable object derived from
    :class:`~git.util.RemoteProgress`."""
    # New API only needs progress as a function.
    if callable(progress):
        return CallableRemoteProgress(progress)

    # Where None is passed create a parser that eats the progress.
    elif progress is None:
        return RemoteProgress()

    # Assume its the old API with an instance of RemoteProgress.
    return progress
Given the `progress` return a suitable object derived from
    :class:`~git.util.RemoteProgress`.
git/remote.py