code: def wrap(function_to_trace=None, **trace_options):
      
  
      def tracing_decorator(func):
          @functools.wraps(func)
          def tracing_wrapper(*args, **kwargs):
              predicates = []
              local = trace_options.pop('local', False)
              if local:
                  predicates.append(Q(depth_lt=2))
              predicates.append(~When(Q(calls_gt=0, depth=0) & ~Q(kind='return'), Stop))
              local_tracer = trace(*predicates, **trace_options)
              try:
                  return func(*args, **kwargs)
              finally:
                  local_tracer.stop()
          return tracing_wrapper
      if function_to_trace is None:
          return tracing_decorator
      else:
          return tracing_decorator(function_to_trace)
docs: Functions decorated with this will be traced.
  
      Use ``local=True`` to only trace local code, eg::
  
          @hunter.wrap(local=True)
          def my_function():
              ...
  
      Keyword arguments are allowed, eg::
  
          @hunter.wrap(action=hunter.CallPrinter)
          def my_function():
              ...
  
      Or, filters::
  
          @hunter.wrap(module='foobar')
          def my_function():
              ...