code: def tag(*tags):
      """Decorator to add tags to test_* functions.
  
      Example:
          class MyTestCase(unittest.TestCase):
              @testlib.tag("knownfailure")
              def test_foo(self):
                  #...
      """
  
      def decorate(f):
          if not hasattr(f, "tags"):
              f.tags = []
          f.tags += tags
          return f
  
      return decorate
  
imports: import os
  from os.path import join, basename, abspath, splitext, isfile, isdir, normpath, exists
  import sys
  import getopt
  import glob
  import time
  import unittest
  import importlib
  import logging
  import textwrap
  import traceback
label_desc: Use image node_id 1 for calling a global function with example usage: tag() and returns: decorate, f