code: def _translate_glob(pat):
      """Translate a glob PATTERN to a regular expression."""
      translated_parts = []
      for part in _iexplode_path(pat):
          translated_parts.append(_translate_glob_part(part))
      os_sep_class = "[%s]" % re.escape(SEPARATORS)
      res = _join_translated(translated_parts, os_sep_class)
      return "(?ms){res}\\Z".format(res=res)
  
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 24 for calling a global function with example usage: _translate_glob(pat) and returns: str