def METHOD_NAME(self, stream):
    if not yaml:
        raise DataError('Using YAML variable files requires PyYAML module '
                        'to be installed. Typically you can install it '
                        'by running `pip install pyyaml`.')
    if yaml.__version__.split('.')[0] == '3':
        return yaml.load(stream)
    return yaml.full_load(stream)