code: def multi_match(name, patterns, mode=any, regex=False):
      
      if not regex:
          return mode(fnmatch.fnmatch(name, pattern) for pattern in patterns)
      else:
          return mode(re.match(pattern, name) for pattern in patterns)
docs: Compares *name* to multiple *patterns* and returns *True* in case of at least one match (*mode*
      = *any*, the default), or in case all patterns matched (*mode* = *all*). Otherwise, *False* is
      returned. When *regex* is *True*, *re.match* is used instead of *fnmatch.fnmatch*.