def get_prior_import_or_install_required_dict(app, tsr_ids, repo_info_dicts):
 prior_import_or_install_required_dict = {}
 for tsr_id in tsr_ids:
  prior_import_or_install_required_dict[tsr_id] = []
 for repo_info_dict in repo_info_dicts:
  (repository, repository_dependencies) = get_repository_and_repository_dependencies_from_repo_info_dict(app, repo_info_dict)
  if repository:
   encoded_repository_id = app.security.encode_id(repository.id)
   if (encoded_repository_id in tsr_ids):
    prior_import_or_install_ids = get_repository_ids_requiring_prior_import_or_install(app, tsr_ids, repository_dependencies)
    prior_import_or_install_required_dict[encoded_repository_id] = prior_import_or_install_ids
 return prior_import_or_install_required_dict

def get_prior_import_or_install_required_dict ( app , tsr_ids , repo_info_dicts ) : prior_import_or_install_required_dict = { } for tsr_id in tsr_ids : prior_import_or_install_required_dict [ tsr_id ] = [ ] for repo_info_dict in repo_info_dicts : ( repository , repository_dependencies ) = get_repository_and_repository_dependencies_from_repo_info_dict ( app , repo_info_dict ) if repository : encoded_repository_id = app . security . encode_id ( repository . id ) if ( encoded_repository_id in tsr_ids ) : prior_import_or_install_ids = get_repository_ids_requiring_prior_import_or_install ( app , tsr_ids , repository_dependencies ) prior_import_or_install_required_dict [ encoded_repository_id ] = prior_import_or_install_ids return prior_import_or_install_required_dict
this method is used in the tool shed when exporting a repository and its dependencies .