def METHOD_NAME(fh):
    """
    serializes a YAML files into a pyyaml object
    :param fh: file handle
    :returns: `dict` representation of YAML
    """
    # support environment variables in config
    # https://stackoverflow.com/a/55301129
    path_matcher = re.compile(r'.*\$\{([^}^{]+)\}.*')
    def path_constructor(loader, node):
        env_var = path_matcher.match(node.value).group(1)
        if env_var not in os.environ:
            raise EnvironmentError('Undefined environment variable in config')
        return get_typed_value(os.path.expandvars(node.value))
    class EnvVarLoader(yaml.SafeLoader):
        pass
    EnvVarLoader.add_implicit_resolver('!path', path_matcher, None)
    EnvVarLoader.add_constructor('!path', path_constructor)
    return yaml.load(fh, Loader=EnvVarLoader)