def fnmatch(name, globs):
 globs = ((globs,) if isinstance(globs, str) else tuple(globs))
 if (len(globs) == 0):
  return True
 name = os.path.normcase(name)
 return any((compiled_pattern.match(name) for glob in globs for compiled_pattern in _compile_pattern(glob)))

def fnmatch ( name , globs ) : globs = ( ( globs , ) if isinstance ( globs , str ) else tuple ( globs ) ) if ( len ( globs ) == 0 ) : return True name = os . path . normcase ( name ) return any ( ( compiled_pattern . match ( name ) for glob in globs for compiled_pattern in _compile_pattern ( glob ) ) )
test whether filename matches pattern .