def compare_dataset_states(discovered_datasets, desired_datasets):
 for dataset_id in (set(discovered_datasets) | set(desired_datasets)):
  desired_dataset = desired_datasets.get(dataset_id)
  discovered_dataset = discovered_datasets.get(dataset_id)
  if (not compare_dataset_state(discovered_dataset=discovered_dataset, desired_dataset=desired_dataset)):
   return False
 return True

def compare_dataset_states ( discovered_datasets , desired_datasets ) : for dataset_id in ( set ( discovered_datasets ) | set ( desired_datasets ) ) : desired_dataset = desired_datasets . get ( dataset_id ) discovered_dataset = discovered_datasets . get ( dataset_id ) if ( not compare_dataset_state ( discovered_dataset = discovered_dataset , desired_dataset = desired_dataset ) ) : return False return True
compare discovered and desired state of datasets to determine if they have converged .