def get_repository_dependency_tups_from_repository_metadata(app, repository_metadata, deprecated_only=False):
 dependency_tups = []
 if (repository_metadata is not None):
  metadata = repository_metadata.metadata
  if metadata:
   repository_dependencies_dict = metadata.get('repository_dependencies', None)
   if (repository_dependencies_dict is not None):
    repository_dependency_tups = repository_dependencies_dict.get('repository_dependencies', None)
    if (repository_dependency_tups is not None):
     for repository_dependency_tup in repository_dependency_tups:
      (toolshed, name, owner, changeset_revision, pir, oicct) = common_util.parse_repository_dependency_tuple(repository_dependency_tup)
      repository = tool_shed.util.repository_util.get_repository_by_name_and_owner(app, name, owner)
      if repository:
       if deprecated_only:
        if repository.deprecated:
         dependency_tups.append(repository_dependency_tup)
       else:
        dependency_tups.append(repository_dependency_tup)
      else:
       log.debug(('Cannot locate repository %s owned by %s for inclusion in repository dependency tups.' % (name, owner)))
 return dependency_tups

def get_repository_dependency_tups_from_repository_metadata ( app , repository_metadata , deprecated_only = False ) : dependency_tups = [ ] if ( repository_metadata is not None ) : metadata = repository_metadata . metadata if metadata : repository_dependencies_dict = metadata . get ( 'repository_dependencies' , None ) if ( repository_dependencies_dict is not None ) : repository_dependency_tups = repository_dependencies_dict . get ( 'repository_dependencies' , None ) if ( repository_dependency_tups is not None ) : for repository_dependency_tup in repository_dependency_tups : ( toolshed , name , owner , changeset_revision , pir , oicct ) = common_util . parse_repository_dependency_tuple ( repository_dependency_tup ) repository = tool_shed . util . repository_util . get_repository_by_name_and_owner ( app , name , owner ) if repository : if deprecated_only : if repository . deprecated : dependency_tups . append ( repository_dependency_tup ) else : dependency_tups . append ( repository_dependency_tup ) else : log . debug ( ( 'Cannot locate repository %s owned by %s for inclusion in repository dependency tups.' % ( name , owner ) ) ) return dependency_tups
return a list of of tuples defining repository objects required by the received repository .