# Path: gtimer/private/focus.py
# def create_next_timer(*args, **kwargs):
# def remove_last_timer():
# def create_next_loop(*args, **kwargs):
# def remove_last_loop():
# def refresh_shortcuts():
# def hard_reset():
# def get_current_timer():
# 
# Path: gtimer/private/times.py
# def dump_times():
# def assign_subdivisions(position, keep_subdivisions=True):
# def _assign_subdvsn(position):
# def _assign_par_subdvsn(position):
# 
# Path: gtimer/local/util.py
# def sanitize_rgstr_stamps(rgstr_stamps=None):
#     if rgstr_stamps is not None:
#         if not isinstance(rgstr_stamps, (list, tuple)):
#             raise TypeError("Expected list or tuple for param 'rgstr_stamps' (elements passed through str()).")
#         rgstr_stamps = list(set(rgstr_stamps))
#         for s in rgstr_stamps:
#             s = str(s)
#     else:
#         rgstr_stamps = list()
#     return rgstr_stamps
# 
# Path: gtimer/util.py
# def opt_arg_wrap(inner_wrap):
#     def wrapped_dec(*args, **kwargs):
#         if len(args) == 1 and callable(args[0]):
#             return inner_wrap(args[0])
#         else:
#             def gtimer_wrapped_arg(func):
#                 return inner_wrap(func, *args, **kwargs)
#             return gtimer_wrapped_arg
#     return wrapped_dec
# 
# Path: gtimer/private/const.py
# UNASGN = 'UNASSIGNED'
# 
# Path: gtimer/local/exceptions.py
# class StartError(GTimerError):
#     pass
# 
# class StoppedError(GTimerError):
#     pass
# 
# class PausedError(GTimerError):
#     pass
# 
# class LoopError(GTimerError):
#     pass
# 
# class GTimerError(Exception):
#     pass
# 
# class UniqueNameError(GTimerError):
#     pass
# 
# class BackdateError(GTimerError):
#     pass


from timeit import default_timer as timer
from gtimer.private import focus as f
from gtimer.private import times as times_priv
from gtimer.local.util import sanitize_rgstr_stamps
from gtimer.util import opt_arg_wrap
from gtimer.private.const import UNASGN
from gtimer.local.exceptions import (StartError, StoppedError, PausedError,
                                     LoopError, GTimerError, UniqueNameError,
                                     BackdateError)
    for s in f.t.rgstr_stamps:
        if s not in f.s.cum:
            f.s.cum[s] = 0.
            f.s.order.append(s)
    if not f.t.paused:
        f.t.tmp_total += t_stop - f.t.start_t
    f.t.tmp_total -= f.t.self_cut
    f.t.self_cut += timer() - t  # AFTER subtraction from tmp_total, before dump
    times_priv.dump_times()
    f.t.stopped = True
    if quick_print:
        print("({}) Total: {:.4f}".format(f.t.name, f.r.total))
    return t


def pause():
    """
    Pause the timer, preventing subsequent time from accumulating in the
    total.  Renders the timer inactive, disabling other timing commands.

    Returns:
        float: The current time.

    Raises:
        PausedError: If timer already paused.
        StoppedError: If timer already stopped.
    """
    t = timer()
    if f.t.stopped:
        raise StoppedError("Cannot pause stopped timer.")

# Path: gtimer/private/focus.py
# def create_next_timer(*args, **kwargs):
# def remove_last_timer():
# def create_next_loop(*args, **kwargs):
# def remove_last_loop():
# def refresh_shortcuts():
# def hard_reset():
# def get_current_timer():
# 
# Path: gtimer/private/times.py
# def dump_times():
# def assign_subdivisions(position, keep_subdivisions=True):
# def _assign_subdvsn(position):
# def _assign_par_subdvsn(position):
# 
# Path: gtimer/local/util.py
# def sanitize_rgstr_stamps(rgstr_stamps=None):
#     if rgstr_stamps is not None:
#         if not isinstance(rgstr_stamps, (list, tuple)):
#             raise TypeError("Expected list or tuple for param 'rgstr_stamps' (elements passed through str()).")
#         rgstr_stamps = list(set(rgstr_stamps))
#         for s in rgstr_stamps:
#             s = str(s)
#     else:
#         rgstr_stamps = list()
#     return rgstr_stamps
# 
# Path: gtimer/util.py
# def opt_arg_wrap(inner_wrap):
#     def wrapped_dec(*args, **kwargs):
#         if len(args) == 1 and callable(args[0]):
#             return inner_wrap(args[0])
#         else:
#             def gtimer_wrapped_arg(func):
#                 return inner_wrap(func, *args, **kwargs)
#             return gtimer_wrapped_arg
#     return wrapped_dec
# 
# Path: gtimer/private/const.py
# UNASGN = 'UNASSIGNED'
# 
# Path: gtimer/local/exceptions.py
# class StartError(GTimerError):
#     pass
# 
# class StoppedError(GTimerError):
#     pass
# 
# class PausedError(GTimerError):
#     pass
# 
# class LoopError(GTimerError):
#     pass
# 
# class GTimerError(Exception):
#     pass
# 
# class UniqueNameError(GTimerError):
#     pass
# 
# class BackdateError(GTimerError):
#     pass


# Path: gtimer/public/timer.py
from timeit import default_timer as timer
from gtimer.private import focus as f
from gtimer.private import times as times_priv
from gtimer.local.util import sanitize_rgstr_stamps
from gtimer.util import opt_arg_wrap
from gtimer.private.const import UNASGN
from gtimer.local.exceptions import (StartError, StoppedError, PausedError,
                                     LoopError, GTimerError, UniqueNameError,
                                     BackdateError)

    for s in f.t.rgstr_stamps:
        if s not in f.s.cum:
            f.s.cum[s] = 0.
            f.s.order.append(s)
    if not f.t.paused:
        f.t.tmp_total += t_stop - f.t.start_t
    f.t.tmp_total -= f.t.self_cut
    f.t.self_cut += timer() - t  # AFTER subtraction from tmp_total, before dump
    times_priv.dump_times()
    f.t.stopped = True
    if quick_print:
        print("({}) Total: {:.4f}".format(f.t.name, f.r.total))
    return t


def pause():
    """
    Pause the timer, preventing subsequent time from accumulating in the
    total.  Renders the timer inactive, disabling other timing commands.

    Returns:
        float: The current time.

    Raises:
        PausedError: If timer already paused.
        StoppedError: If timer already stopped.
    """
    t = timer()
    if f.t.stopped:
        raise StoppedError("Cannot pause stopped timer.")

    if f.t.paused: