def _get_single_trace_by_component(**component_filter):
 traces = Trace.query(**component_filter)
 if (len(traces) == 0):
  return None
 elif (len(traces) > 1):
  raise UniqueTraceNotFoundException(('More than 1 trace matching %s found.' % component_filter))
 return traces[0]

def _get_single_trace_by_component ( ** component_filter ) : traces = Trace . query ( ** component_filter ) if ( len ( traces ) == 0 ) : return None elif ( len ( traces ) > 1 ) : raise UniqueTraceNotFoundException ( ( 'More than 1 trace matching %s found.' % component_filter ) ) return traces [ 0 ]
tries to return a single trace mathing component_filter .