code: def get_pattern(glob=None, regex=None, match_case=None):
      assert glob is not None or regex is not None
  
      if glob is not None and regex is not None:
          raise ValueError(
              "You should specify at most one of `glob` and `regex` parameters but not both"
          )
  
      if glob is not None:
          pattern = glob_to_regex(glob)
      else:  # regex is not None
          if match_case is not None and not isinstance(regex, str):
              raise ValueError(
                  "Regex must be a string if `match_case` is specified when "
                  "calling assert_raises_pattern"
              )
          pattern = regex
  
      if (
          isinstance(pattern, str) and not match_case
      ):  # ignore case by default
          pattern = re.compile(pattern, re.IGNORECASE)
  
      return pattern
  
file_path: DALI/dali/test/python/nose_utils.py
imports: import sys
  import collections
  import nose.case
  import nose.inspector
  import nose.loader
  import nose.suite
  import nose.plugins.attrib
  import nose.tools
  import re
  import fnmatch
label_desc: Use image node_id 2 for calling a global function with example usage: get_pattern(glob, regex, match_case) and returns: pattern