code: def _parse_opts(args, default_tags):
      """_parse_opts(args) -> (log_level, action, tags)"""
      opts, raw_tags = getopt.getopt(
          args,
          "hvqdlL:n",
          [
              "help",
              "verbose",
              "quiet",
              "debug",
              "list",
              "no-default-tags",
          ],
      )
      log_level = logging.WARN
      action = "test"
      no_default_tags = False
      for opt, optarg in opts:
          if opt in ("-h", "--help"):
              action = "help"
          elif opt in ("-v", "--verbose"):
              log_level = logging.INFO
          elif opt in ("-q", "--quiet"):
              log_level = logging.ERROR
          elif opt in ("-d", "--debug"):
              log_level = logging.DEBUG
          elif opt in ("-l", "--list"):
              action = "list"
          elif opt in ("-n", "--no-default-tags"):
              no_default_tags = True
          elif opt == "-L":
              # Optarg is of the form '<logname>:<levelname>', e.g.
              # "codeintel:DEBUG", "codeintel.db:INFO".
              lname, llevelname = optarg.split(":", 1)
              llevel = getattr(logging, llevelname)
              logging.getLogger(lname).setLevel(llevel)
  
      # Clean up the given tags.
      if no_default_tags:
          tags = []
      else:
          tags = default_tags
      for raw_tag in raw_tags:
          if splitext(raw_tag)[1] in (
              ".py",
              ".pyc",
              ".pyo",
              ".pyw",
          ) and exists(raw_tag):
              # Trim '.py' from user-supplied tags if it looks to be from
              # shell expansion.
              tags.append(splitext(raw_tag)[0])
          elif "/" in raw_tag:
              # Split one '/' to allow the shortname from the test listing
              # to be used as a filter.
              tags += raw_tag.split("/")
          else:
              tags.append(raw_tag)
  
      return log_level, action, tags
  
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 11 for calling a global function with example usage: _parse_opts(args, default_tags) and returns: log_level,  action,  tags