

def _data_source_ref_search(job_configs, func, prune=(lambda x: x)):
    "Return a list of unique values in job_configs filtered by func().\n\n    Loop over the 'args', 'configs' and 'params' elements in\n    job_configs and return a list of all values for which\n    func(value) is True.\n\n    Optionally provide a 'prune' function that is applied\n    to values before they are added to the return value.\n    "
    args = set([prune(arg) for arg in job_configs.get('args', []) if func(arg)])
    configs = set([prune(val) for val in six.itervalues(job_configs.get('configs', {
        
    })) if func(val)])
    params = set([prune(val) for val in six.itervalues(job_configs.get('params', {
        
    })) if func(val)])
    return list(((args | configs) | params))

dataset/ETHPy150Open openstack/sahara/sahara/service/edp/job_utils.py _data_source_ref_search/original