code: def _compile_pattern(pat, ignore_case=True):
      """Translate and compile a glob pattern to a regular expression matcher."""
      if isinstance(pat, bytes):
          pat_str = pat.decode("ISO-8859-1")
          res_str = _translate_glob(pat_str)
          res = res_str.encode("ISO-8859-1")
      else:
          res = _translate_glob(pat)
      flags = re.IGNORECASE if ignore_case else 0
      return re.compile(res, flags=flags).match
  
imports: from collections import defaultdict
  from os.path import join
  import io
  import os
  import functools
  import pipes
  import re
  import shlex
  import subprocess
  import sys
  from setuptools import Command
  from setuptools.command.build_py import build_py
  from setuptools.command.sdist import sdist
  from distutils import log
  from setuptools.command.develop import develop
  from setuptools.command.bdist_egg import bdist_egg
label_desc: Use image node_id 22 for calling a global function with example usage: _compile_pattern(pat, ignore_case) and returns: re