def virtual(opts, virtualname, filename):
    '''
    Returns the __virtual__.
    '''
    if ((HAS_NAPALM and NAPALM_MAJOR >= 2) or HAS_NAPALM_BASE) and (is_proxy(opts) or is_minion(opts)):
        return virtualname
    else:
        return (
            False,
            (
                '"{vname}"" {filename} cannot be loaded: '
                'NAPALM is not installed: ``pip install napalm``'
            ).format(
                vname=virtualname,
                filename='({filename})'.format(filename=filename)
            )
        )