'Wraps and calls a function at each level of stack depth
to measure the overhead of the wrapped function.'

def call_wrapped(self, count):

    queue = collections.deque()
    self.call_wrapped_inner(queue, count)
    while queue:
        queue.popleft()()
