code: def dict_match(d, key, default=None):
      
  
      if key in d and "[" not in key:
          return d[key]
      else:
          for pattern, value in iteritems(d):
              if fnmatchcase(key, pattern):
                  return value
      return default
docs: Like __getitem__ but works as if the keys() are all filename patterns.
      Returns the value of any dict key that matches the passed key.
  
      Args:
          d (dict): A dict with filename patterns as keys
          key (str): A key potentially matching any of the keys
          default (object): The object to return if no pattern matched the
              passed in key
      Returns:
          object: The dict value where the dict key matched the passed in key.
              Or default if there was no match.