code: def trace_filter (patterns):
      
      if patterns is None:
          _trace_filter.clear()
      else:
          _trace_filter.update(re.compile(pat) for pat in patterns)
docs: Add given patterns to trace filter set or clear set if patterns is
      None.