def trace_cls(name, **kwargs):
 def decorator(cls):
  if (profiler and ('profiler' in CONF) and CONF.profiler.enabled):
   trace_decorator = profiler.trace_cls(name, kwargs)
   return trace_decorator(cls)
  return cls
 return decorator

def trace_cls ( name , ** kwargs ) : def decorator ( cls ) : if ( profiler and ( 'profiler' in CONF ) and CONF . profiler . enabled ) : trace_decorator = profiler . trace_cls ( name , kwargs ) return trace_decorator ( cls ) return cls return decorator
wrap the osprofiler trace_cls decorator so that it will not try to patch the class unless osprofiler is present and enabled in the config .