def setup_tracing(trace_flags):
 global TRACE_METHOD
 global TRACE_API
 try:
  trace_flags = [flag.strip() for flag in trace_flags]
 except TypeError:
  trace_flags = []
 for invalid_flag in (set(trace_flags) - VALID_TRACE_FLAGS):
  LOG.warning(_LW('Invalid trace flag: %s'), invalid_flag)
 TRACE_METHOD = ('method' in trace_flags)
 TRACE_API = ('api' in trace_flags)

def setup_tracing ( trace_flags ) : global TRACE_METHOD global TRACE_API try : trace_flags = [ flag . strip ( ) for flag in trace_flags ] except TypeError : trace_flags = [ ] for invalid_flag in ( set ( trace_flags ) - VALID_TRACE_FLAGS ) : LOG . warning ( _LW ( 'Invalid trace flag: %s' ) , invalid_flag ) TRACE_METHOD = ( 'method' in trace_flags ) TRACE_API = ( 'api' in trace_flags )
set global variables for each trace flag .