def latest_version(*names, **kwargs):
    if len(names) == 0:
        return ''
    ret = {}

    # Initialize the dict with empty strings
    for name in names:
        ret[name] = ''
    jail = kwargs.get('jail')
    chroot = kwargs.get('chroot')
    pkgs = list_pkgs(versions_as_list=True, jail=jail, chroot=chroot)

    if salt.utils.compare_versions(_get_pkgng_version(jail, chroot), '>=', '1.6.0'):
        quiet = True
    else:
        quiet = False

    cmd_prefix = _pkg(jail, chroot) + ['search']
    for name in names:
        # FreeBSD supports packages in format java/openjdk7
        if '/' in name:
            cmd = [_pkg(jail, chroot), 'search']
        else:
            cmd = [_pkg(jail, chroot), 'search', '-S', 'name', '-Q', 'version', '-e']
        if quiet:
            cmd.append('-q')
        cmd.append(name)

        pkgver = _get_version(
            name,
            sorted(
                __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='trace').splitlines(),
                reverse=True
            ).pop(0)
        )

        if pkgver is not None:
            installed = pkgs.get(name, [])
            if not installed:
                ret[name] = pkgver
            else:
                if not any(
                    (salt.utils.compare_versions(ver1=x,
                                                 oper='>=',
                                                 ver2=pkgver)
                     for x in installed)
                ):
                    ret[name] = pkgver

    # Return a string if only one package name passed
    if len(names) == 1:
        return ret[names[0]]
    return ret


# available_version is being deprecated
Check a real general matrix for invalid entries
dataset/ETHPy150Open saltstack/salt/salt/modules/pkgng.py/latest_version--crossover with--dataset/ETHPy150Open lebedov/scikit-cuda/skcuda/cula.py/culaDeviceSgeNancheck