<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parser_from_buffer(cls, fp):
 """Construct YamlParser from a file pointer."""

        yaml = YAML(typ="safe")
        return cls(yaml.load(fp))