code: def matches_extension(path, extension):
      
      _, ext = os.path.splitext(path)
      if ext == '':
          # If there is no extension, grab the file name and
          # compare it to the given extension.
          return os.path.basename(path) == extension
      else:
          # If the is an extension, drop the leading period and
          # compare it to the extension.
          return fnmatch.fnmatch(ext[1:], extension)
docs: Returns True if path has the given extension, or if
      the last path component matches the extension. Supports
      Unix glob matching.
  
      >>> matches_extension("./www/profile.php", "php")
      True
      >>> matches_extension("./scripts/menu.js", "html")
      False
      >>> matches_extension("./LICENSE", "LICENSE")
      True