def get_next_prior_import_or_install_required_dict_entry(prior_required_dict, processed_tsr_ids):
 for (key, value) in prior_required_dict.items():
  if (key in processed_tsr_ids):
   continue
  if (not value):
   return key
 for (key, value) in prior_required_dict.items():
  if (key in processed_tsr_ids):
   continue
  all_contained = True
  for required_repository_id in value:
   if (required_repository_id not in processed_tsr_ids):
    all_contained = False
    break
  if all_contained:
   return key
 for (key, value) in prior_required_dict.items():
  if (key in processed_tsr_ids):
   continue
  return key

def get_next_prior_import_or_install_required_dict_entry ( prior_required_dict , processed_tsr_ids ) : for ( key , value ) in prior_required_dict . items ( ) : if ( key in processed_tsr_ids ) : continue if ( not value ) : return key for ( key , value ) in prior_required_dict . items ( ) : if ( key in processed_tsr_ids ) : continue all_contained = True for required_repository_id in value : if ( required_repository_id not in processed_tsr_ids ) : all_contained = False break if all_contained : return key for ( key , value ) in prior_required_dict . items ( ) : if ( key in processed_tsr_ids ) : continue return key
this method is used in the tool shed when exporting a repository and its dependencies .