def get_repository_ids_requiring_prior_import_or_install(app, tsr_ids, repository_dependencies):
 prior_tsr_ids = []
 if repository_dependencies:
  for (key, rd_tups) in repository_dependencies.items():
   if (key in ['description', 'root_key']):
    continue
   for rd_tup in rd_tups:
    (tool_shed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td) = common_util.parse_repository_dependency_tuple(rd_tup)
    if (not util.asbool(only_if_compiling_contained_td)):
     if util.asbool(prior_installation_required):
      if is_tool_shed_client(app):
       tool_shed = common_util.remove_protocol_from_tool_shed_url(tool_shed)
       repository = get_repository_for_dependency_relationship(app, tool_shed, name, owner, changeset_revision)
      else:
       repository = get_repository_by_name_and_owner(app, name, owner)
      if repository:
       encoded_repository_id = app.security.encode_id(repository.id)
       if (encoded_repository_id in tsr_ids):
        prior_tsr_ids.append(encoded_repository_id)
 return prior_tsr_ids

def get_repository_ids_requiring_prior_import_or_install ( app , tsr_ids , repository_dependencies ) : prior_tsr_ids = [ ] if repository_dependencies : for ( key , rd_tups ) in repository_dependencies . items ( ) : if ( key in [ 'description' , 'root_key' ] ) : continue for rd_tup in rd_tups : ( tool_shed , name , owner , changeset_revision , prior_installation_required , only_if_compiling_contained_td ) = common_util . parse_repository_dependency_tuple ( rd_tup ) if ( not util . asbool ( only_if_compiling_contained_td ) ) : if util . asbool ( prior_installation_required ) : if is_tool_shed_client ( app ) : tool_shed = common_util . remove_protocol_from_tool_shed_url ( tool_shed ) repository = get_repository_for_dependency_relationship ( app , tool_shed , name , owner , changeset_revision ) else : repository = get_repository_by_name_and_owner ( app , name , owner ) if repository : encoded_repository_id = app . security . encode_id ( repository . id ) if ( encoded_repository_id in tsr_ids ) : prior_tsr_ids . append ( encoded_repository_id ) return prior_tsr_ids
this method is used in the tool shed when exporting a repository and its dependencies .