# 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)


def set_save_itrs_root(setting):
    """
    Adjust the root timer save_itrs setting, such as for use in
    multiprocessing, when a root timer may become a parallel subdivision (see
    subdivide()).

    Args:
        setting (bool): Save individual iterations data, passed through bool()

    Returns:
        bool: Implemented setting value.
    """
    setting = bool(setting)
    f.root.times.save_itrs = setting
    return setting


def rgstr_stamps_root(rgstr_stamps):
    """
    Register stamps with the root timer (see subdivision()).

    Args:
        rgstr_stamps (list, tuple): Collection of identifiers, passed through
            set(), then each is passed through str().

    Returns:
        list: Implemented registered stamp collection.
    """

# 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)



def set_save_itrs_root(setting):
    """
    Adjust the root timer save_itrs setting, such as for use in
    multiprocessing, when a root timer may become a parallel subdivision (see
    subdivide()).

    Args:
        setting (bool): Save individual iterations data, passed through bool()

    Returns:
        bool: Implemented setting value.
    """
    setting = bool(setting)
    f.root.times.save_itrs = setting
    return setting


def rgstr_stamps_root(rgstr_stamps):
    """
    Register stamps with the root timer (see subdivision()).

    Args:
        rgstr_stamps (list, tuple): Collection of identifiers, passed through
            set(), then each is passed through str().

    Returns:
        list: Implemented registered stamp collection.
    """

    rgstr_stamps = sanitize_rgstr_stamps(rgstr_stamps)