Mark the end of timing.  Optionally performs a stamp, hence accepts the
    same arguments.

    Notes:
        If keeping subdivisions and not calling a stamp, any awaiting subdivisions
        will be assigned to a special 'UNASSIGNED' position to indicate that they
        are not properly accounted for in the hierarchy (these can happen at
        different places and may be combined inadvertently).

        Backdating: For subdivisions only.  Backdate time must be in the past
        but more recent than the latest stamp.

    Args:
        name (any, optional): If used, passed to a call to stamp()
        backdate (float, optional): time to use for stop instead of current
        unique (bool, optional): see stamp()
        keep_subdivisions (bool, optional): keep awaiting subdivisions
        quick_print (bool, optional): boolean, print total time
        un (bool, optional): see stamp()
        ks (bool, optional): see stamp()
        qp (bool, optional): see stamp()


    Returns:
        float: The current time.

    Raises:
        BackdateError: If given backdate is out of range, or if used in root timer.
        PausedError: If attempting stamp in paused timer.
        StoppedError: If timer already stopped.
        TypeError: If given backdate value is not type float.

def stop(name=None, backdate=None,
         unique=None, keep_subdivisions=None, quick_print=None,
         un=None, ks=None, qp=None):
    """
    Mark the end of timing.  Optionally performs a stamp, hence accepts the
    same arguments.

    Notes:
        If keeping subdivisions and not calling a stamp, any awaiting subdivisions
        will be assigned to a special 'UNASSIGNED' position to indicate that they
        are not properly accounted for in the hierarchy (these can happen at
        different places and may be combined inadvertently).

        Backdating: For subdivisions only.  Backdate time must be in the past
        but more recent than the latest stamp.

    Args:
        name (any, optional): If used, passed to a call to stamp()
        backdate (float, optional): time to use for stop instead of current
        unique (bool, optional): see stamp()
        keep_subdivisions (bool, optional): keep awaiting subdivisions
        quick_print (bool, optional): boolean, print total time
        un (bool, optional): see stamp()
        ks (bool, optional): see stamp()
        qp (bool, optional): see stamp()


    Returns:
        float: The current time.

    Raises:
        BackdateError: If given backdate is out of range, or if used in root timer.
        PausedError: If attempting stamp in paused timer.
        StoppedError: If timer already stopped.
        TypeError: If given backdate value is not type float.
    """
    t = timer()
    if f.t.stopped:
        raise StoppedError("Timer already stopped.")
    if backdate is None:
        t_stop = t
    else:
        if f.t is f.root:
            raise BackdateError("Cannot backdate stop of root timer.")
        if not isinstance(backdate, float):
            raise TypeError("Backdate must be type float.")
        if backdate > t:
            raise BackdateError("Cannot backdate to future time.")
        if backdate < f.t.last_t:
            raise BackdateError("Cannot backdate to time earlier than last stamp.")
        t_stop = backdate
    unique = SET['UN'] if (unique is None and un is None) else bool(unique or un)  # bool(None) becomes False
    keep_subdivisions = SET['KS'] if (keep_subdivisions is None and ks is None) else bool(keep_subdivisions or ks)
    quick_print = SET['QP'] if (quick_print is None and qp is None) else bool(quick_print or qp)
    if name is not None:
        if f.t.paused:
            raise PausedError("Cannot stamp paused timer.")
        elapsed = t_stop - f.t.last_t
        _stamp(name, elapsed, unique, keep_subdivisions, quick_print)
    else:
        times_priv.assign_subdivisions(UNASGN, keep_subdivisions)
    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