'Record the stack frames starting at the caller of this method, and
ending at the top of the stack as defined by the ``stack_depth``.
Arguments:
args: The positional arguments to capture at this stack frame
kwargs: The keyword arguments to capture at this stack frame'

def capture_stack(self, args, kwargs):

    stack = traceback.extract_stack()[:(-2)]
    if (self._top_of_stack in stack):
        stack = stack[stack.index(self._top_of_stack):]
    if self.include_arguments:
        safe_args = []
        for arg in args:
            try:
                safe_args.append(repr(arg))
            except Exception as exc:
                safe_args.append('<un-repr-able    value:    {}'.format(exc))
        safe_kwargs = {}
        for (key, kwarg) in kwargs.items():
            try:
                safe_kwargs[key] = repr(kwarg)
            except Exception as exc:
                safe_kwargs[key] = '<un-repr-able    value:    {}'.format(exc)
        self._stacks[tuple(stack)][(tuple(safe_args), tuple(safe_kwargs.items()))] += 1
    else:
        self._stacks[tuple(stack)] += 1
