def deploy_whitelist_to_constraints(deploy_whitelist):
    """Converts a whitelist of locations into marathon appropriate constraints
    https://mesosphere.github.io/marathon/docs/constraints.html#like-operator

    :param deploy_whitelist: List of lists of locations to whitelist
    :returns: List of lists of constraints
    """
    if len(deploy_whitelist) > 0:
        (region_type, regions) = deploy_whitelist
        regionstr = '|'.join(regions)

        return [[region_type, 'LIKE', regionstr]]
    return []
dataset/ETHPy150Open Yelp/paasta/paasta_tools/utils.py/deploy_whitelist_to_constraints/original