code: def test_glob_to_re(self):
      sep = os.sep
      if os.sep == "\\":
          sep = re.escape(os.sep)
  
      for glob, regex in (
          # simple cases
          ("foo*", r"foo[^%(sep)s]*\Z(?ms)"),
          ("foo?", r"foo[^%(sep)s]\Z(?ms)"),
          ("foo??", r"foo[^%(sep)s][^%(sep)s]\Z(?ms)"),
          # special cases
          (r"foo\\*", r"foo\\\\[^%(sep)s]*\Z(?ms)"),
          (r"foo\\\*", r"foo\\\\\\[^%(sep)s]*\Z(?ms)"),
          (
              "foo????",
              r"foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s]\Z(?ms)",
          ),
          (r"foo\\??", r"foo\\\\[^%(sep)s][^%(sep)s]\Z(?ms)"),
      ):
          regex = regex % {"sep": sep}
          self.assertEqual(glob_to_re(glob), regex)
  
imports: import os
  import re
  import unittest
  from distutils import debug
  from distutils.log import WARN
  from distutils.errors import DistutilsTemplateError
  from distutils.filelist import glob_to_re, translate_pattern, FileList
  from test.test_support import captured_stdout, run_unittest
  from distutils.tests import support
label_desc: Use image node_id 3 for calling the FileListTestCase obj's underlying member method code with example usage: obj.test_glob_to_re() without return types