code: def globfilter(filenames, patterns, *, flags=0):
      
  
      matches = []
  
      flags = _flag_transform(flags)
      unix = _wcparse.is_unix_style(flags)
      obj = _wcparse.compile(_wcparse.split(patterns, flags), flags)
  
      for filename in filenames:
          if not unix:
              filename = util.norm_slash(filename)
          if obj.match(filename):
              matches.append(filename)
      return matches
docs: Filter names using pattern.