def report_progress(progress, n=None, dt=None):
    """Wraps the provided progress function such that it will only be called
    at the specified increments or time intervals.

    Example usage::

        import fiftyone as fo
        import fiftyone.zoo as foz

        def print_progress(pb):
            if pb.complete:
                print("COMPLETE")
            else:
                print("PROGRESS: %0.3f" % pb.progress)

        dataset = foz.load_zoo_dataset("cifar10", split="test")

        # Print progress at 10 equally-spaced increments
        progress = fo.report_progress(print_progress, n=10)
        dataset.compute_metadata(progress=progress)

        # Print progress every 0.5 seconds
        progress = fo.report_progress(print_progress, dt=0.5)
        dataset.compute_metadata(progress=progress, overwrite=True)

    Args:
        progress: a function that accepts a :class:`ProgressBar` as input
        n (None): a number of equally-spaced increments to invoke ``progress``
        dt (None): a number of seconds between ``progress`` calls

    Returns:
        a function that accepts a :class:`ProgressBar` as input
    """
    if n is not None:
        return _report_progress_n(progress, n)

    if dt is not None:
        return _report_progress_dt(progress, dt)

    return progress
Wraps the provided progress function such that it will only be called
    at the specified increments or time intervals.

    Example usage::

        import fiftyone as fo
        import fiftyone.zoo as foz

        def print_progress(pb):
            if pb.complete:
                print("COMPLETE")
            else:
                print("PROGRESS: %0.3f" % pb.progress)

        dataset = foz.load_zoo_dataset("cifar10", split="test")

        # Print progress at 10 equally-spaced increments
        progress = fo.report_progress(print_progress, n=10)
        dataset.compute_metadata(progress=progress)

        # Print progress every 0.5 seconds
        progress = fo.report_progress(print_progress, dt=0.5)
        dataset.compute_metadata(progress=progress, overwrite=True)

    Args:
        progress: a function that accepts a :class:`ProgressBar` as input
        n (None): a number of equally-spaced increments to invoke ``progress``
        dt (None): a number of seconds between ``progress`` calls

    Returns:
        a function that accepts a :class:`ProgressBar` as input
    
fiftyone/core/utils.py