<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetParserFromFilename(self, path):
 """Returns the appropriate parser class from the filename."""

    # Find the configuration parser.
    handler_name = path.split("://")[0]
    for parser_cls in itervalues(GRRConfigParser.classes):
      if parser_cls.name == handler_name:
        return parser_cls

    # Handle the filename.
    extension = os.path.splitext(path)[1]
    if extension in [".yaml", ".yml"]:
      return YamlParser

    return ConfigFileParser