@stream_session
def list_dataset_replicas_vp(scope, name, deep=False, session=None, logger=logging.log):
    '\n    List dataset replicas for a DID (scope:name) using the\n    Virtual Placement service.\n\n    NOTICE: This is an RnD function and might change or go away at any time.\n\n    :param scope: The scope of the dataset.\n    :param name: The name of the dataset.\n    :param deep: Lookup at the file level.\n    :param session: Database session to use.\n\n    :returns: If VP exists and there is at least one non-TAPE replica, returns a list of dicts of sites\n    '
    vp_endpoint = get_vp_endpoint()
    vp_replies = ['other']
    nr_replies = 5
    if (not vp_endpoint):
        return vp_replies
    try:
        vp_replies = requests.get('{}/ds/{}/{}:{}'.format(vp_endpoint, nr_replies, scope, name), verify=False, timeout=1)
        if (vp_replies.status_code == 200):
            vp_replies = vp_replies.json()
        else:
            vp_replies = ['other']
    except requests.exceptions.RequestException as re:
        logger(logging.ERROR, 'In list_dataset_replicas_vp, could not access {}. Error:{}'.format(vp_endpoint, re))
        vp_replies = ['other']
    if (vp_replies != ['other']):
        accessible_replica_exists = False
        for reply in list_dataset_replicas(scope=scope, name=name, deep=deep, session=session):
            rse_info = rsemgr.get_rse_info(rse=reply['rse'], vo=scope.vo, session=session)
            if (rse_info['rse_type'] == 'TAPE'):
                continue
            for prot in rse_info['protocols']:
                if ((prot['scheme'] == 'root') and prot['domains']['wan']['read']):
                    accessible_replica_exists = True
                    break
            if (accessible_replica_exists is True):
                break
        if (accessible_replica_exists is True):
            for vp_reply in vp_replies:
                (yield {'vp': True, 'site': vp_reply})
List dataset replicas for a DID (scope:name) using the
Virtual Placement service.

NOTICE: This is an RnD function and might change or go away at any time.

:param scope: The scope of the dataset.
:param name: The name of the dataset.
:param deep: Lookup at the file level.
:param session: Database session to use.

:returns: If VP exists and there is at least one non-TAPE replica, returns a list of dicts of sites
@stream_session
def list_dataset_replicas_vp(scope, name, deep=False, session=None, logger=logging.log):
    '\n    List dataset replicas for a DID (scope:name) using the\n    Virtual Placement service.\n\n    NOTICE: This is an RnD function and might change or go away at any time.\n\n    :param scope: The scope of the dataset.\n    :param name: The name of the dataset.\n    :param deep: Lookup at the file level.\n    :param session: Database session to use.\n\n    :returns: If VP exists and there is at least one non-TAPE replica, returns a list of dicts of sites\n    '
    vp_endpoint = get_vp_endpoint()
    vp_replies = ['other']
    nr_replies = 5
    if (not vp_endpoint):
        return vp_replies
    try:
        vp_replies = requests.get('{}/ds/{}/{}:{}'.format(vp_endpoint, nr_replies, scope, name), verify=False, timeout=1)
        if (vp_replies.status_code == 200):
            vp_replies = vp_replies.json()
        else:
            vp_replies = ['other']
    except requests.exceptions.RequestException as re:
        logger(logging.ERROR, 'In list_dataset_replicas_vp, could not access {}. Error:{}'.format(vp_endpoint, re))
        vp_replies = ['other']
    if (vp_replies != ['other']):
        accessible_replica_exists = False
        for reply in list_dataset_replicas(scope=scope, name=name, deep=deep, session=session):
            rse_info = rsemgr.get_rse_info(rse=reply['rse'], vo=scope.vo, session=session)
            if (rse_info['rse_type'] == 'TAPE'):
                continue
            for prot in rse_info['protocols']:
                if ((prot['scheme'] == 'root') and prot['domains']['wan']['read']):
                    accessible_replica_exists = True
                    break
            if (accessible_replica_exists is True):
                break
        if (accessible_replica_exists is True):
            for vp_reply in vp_replies:
                (yield {'vp': True, 'site': vp_reply})