def profile_decorator(**options):
 if options.get('no_profile'):
  def decorator(func):
   return func
  return decorator
 def decorator(func):
  def replacement(*args, **kw):
   return DecoratedProfile(func, **options)(*args, **kw)
  return replacement
 return decorator

def profile_decorator ( ** options ) : if options . get ( 'no_profile' ) : def decorator ( func ) : return func return decorator def decorator ( func ) : def replacement ( * args , ** kw ) : return DecoratedProfile ( func , ** options ) ( * args , ** kw ) return replacement return decorator
profile a single function call .