def _get_version(name, results):
    '''
    ``pkg search`` will return all packages for which the pattern is a match.
    Narrow this down and return the package version, or None if no exact match.
    '''
    for line in salt.utils.itertools.split(results, '\n'):
        if not line:
            continue
        try:
            pkgname, pkgver = line.rsplit('-', 1)
        except __HOLE__:
            continue
        if pkgname == name:
            return pkgver
    return None
dataset/ETHPy150Open saltstack/salt/salt/modules/pkgng.py/_get_version