Updates the probes dictionary with different levels of default values.

def _expand_probes(probes, defaults):

    '''
    Updates the probes dictionary with different levels of default values.
    '''

    expected_probes = {}

    for probe_name, probe_test in six.iteritems(probes):
        if probe_name not in expected_probes.keys():
            expected_probes[probe_name] = {}
        probe_defaults = probe_test.pop('defaults', {})
        for test_name, test_details in six.iteritems(probe_test):
            test_defaults = test_details.pop('defaults', {})
            expected_test_details = deepcopy(defaults)  # copy first the general defaults
            expected_test_details.update(probe_defaults)  # update with more specific defaults if any
            expected_test_details.update(test_defaults)  # update with the most specific defaults if possible
            expected_test_details.update(test_details)  # update with the actual config of the test
            if test_name not in expected_probes[probe_name].keys():
                expected_probes[probe_name][test_name] = expected_test_details

    return expected_probes