code: def match_filenames(filenames, pattern):
      
      matching = []
  
      for filename in filenames:
          if fnmatch(get_filebase(filename, pattern), globify(pattern)):
              matching.append(filename)
  
      return matching
docs: Get the filenames matching *pattern*.