def get_time_tracking_deco(
    filepath,
    profiling_title="Different ways of doing a task",
    solution_title="Solution A",
    quantity_at_which_to_save=10,
    current_time_func=time,
):
    """Return decorator function which stores time intervals.

    Works just like get_time_tracking_ctman(), but instead
    of returning a context manager, it returns a decorator
    function instead, which stores the execution time of
    each run of the callable decorated.

    Parameters
    ==========
    Same parameters as in get_time_tracking_ctman() as
    save_intervals().
    """
    ### define the decorator function

    def time_tracking_decorator(callable_obj):
        """Decorates given callable to track its time."""

        ### create a list wherein to store the intervals
        intervals = []

        ### define the wrapper function

        @wraps(callable_obj)
        def time_tracking_wrapper(*args, **kwargs):
            """Store execution time of wrapped callable.

            Also triggers the saving of such data when it
            reaches a predefined quantity.
            """
            ### store the start time
            start = current_time_func()

            ### execute wrapped callable w/ given arguments
            callable_obj(*args, **kwargs)

            ### store difference between current and
            ### start time
            intervals.append(current_time_func() - start)

            ### save intervals if the predefined quantity is
            ### reached

            if len(intervals) == quantity_at_which_to_save:

                save_intervals(intervals, filepath, profiling_title, solution_title)

        ### return the wrapper function
        return time_tracking_wrapper

    ### return the decorator function
    return time_tracking_decorator
Return decorator function which stores time intervals.

    Works just like get_time_tracking_ctman(), but instead
    of returning a context manager, it returns a decorator
    function instead, which stores the execution time of
    each run of the callable decorated.

    Parameters
    ==========
    Same parameters as in get_time_tracking_ctman() as
    save_intervals().
    
nodezator/ourstdlibs/profileutils.py