parameters: (undefined=None, *, name=None)
return_statement: return options.func
docstring: Register function for benchmarking.
docstring_summary: Register function for benchmarking.
docstring_tokens: Register function for benchmarking .
function: def register(undefined=None, *, name=None):
      """Register function for benchmarking."""
      if undefined is None:
          # Decorator is called without parenthesis so we return a decorator
          return lambda f: register(f, name=name)
  
      # We have either the function to benchmark (simple case) or an instance of Options
      # (@option._ case).
      options = __OptionMaker.make(undefined)
  
      if name is None:
          name = options.func.__name__
  
      # We register the benchmark and reproduce all the @option._ calls onto the
      # benchmark builder pattern
      benchmark = _benchmark.RegisterBenchmark(name, options.func)
      for name, args, kwargs in options.builder_calls[::-1]:
          getattr(benchmark, name)(*args, **kwargs)
  
      # return the benchmarked function because the decorator does not modify it
      return options.func
function_tokens: def register ( undefined = None , * , name = None ) : if undefined is None : # Decorator is called without parenthesis so we return a decorator return lambda f : register ( f , name = name ) # We have either the function to benchmark (simple case) or an instance of Options # (@option._ case). options = __OptionMaker . make ( undefined ) if name is None : name = options . func . __name__ # We register the benchmark and reproduce all the @option._ calls onto the # benchmark builder pattern benchmark = _benchmark . RegisterBenchmark ( name , options . func ) for name , args , kwargs in options . builder_calls [ : : - 1 ] : getattr ( benchmark , name ) ( * args , * * kwargs ) # return the benchmarked function because the decorator does not modify it return options . func