code: def test_translate_pattern(self):
      # not regex
      self.assertTrue(
          hasattr(
              translate_pattern("a", anchor=True, is_regex=False),
              "search",
          )
      )
  
      # is a regex
      regex = re.compile("a")
      self.assertEqual(
          translate_pattern(regex, anchor=True, is_regex=True), regex
      )
  
      # plain string flagged as regex
      self.assertTrue(
          hasattr(
              translate_pattern("a", anchor=True, is_regex=True),
              "search",
          )
      )
  
      # glob support
      self.assertTrue(
          translate_pattern("*.py", anchor=True, is_regex=False).search(
              "filelist.py"
          )
      )
  
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 8 for calling the FileListTestCase obj's underlying member method code with example usage: obj.test_translate_pattern() without return types