def _clean_probes(probes):
 probes = _ordered_dict_to_dict(probes)
 probes_copy = deepcopy(probes)
 for (probe_name, probe_tests) in six.iteritems(probes_copy):
  if (not probe_tests):
   probes.pop(probe_name)
   continue
  for (test_name, test_params) in six.iteritems(probe_tests):
   if (not test_params):
    probes[probe_name].pop(test_name)
   if (not probes.get(probe_name)):
    probes.pop(probe_name)
 return True

def _clean_probes ( probes ) : probes = _ordered_dict_to_dict ( probes ) probes_copy = deepcopy ( probes ) for ( probe_name , probe_tests ) in six . iteritems ( probes_copy ) : if ( not probe_tests ) : probes . pop ( probe_name ) continue for ( test_name , test_params ) in six . iteritems ( probe_tests ) : if ( not test_params ) : probes [ probe_name ] . pop ( test_name ) if ( not probes . get ( probe_name ) ) : probes . pop ( probe_name ) return True
will remove empty and useless values from the probes dictionary .