def load_yaml(data=None, path=None, name='NT'):
    """ Map namedtuples with yaml data. """
    if data and not path:
        return mapper(yaml.load(data), _nt_name=name)
    if path and not data:
        with open(path, 'r') as f:
            data = yaml.load(f)
        return mapper(data, _nt_name=name)
    if data and path:
        raise ValueError('expected one source and received two')
Map namedtuples with yaml data.