'Get or generate and return an error message associated with an invalid repository dependency.'

def generate_message_for_invalid_repository_dependencies(self, metadata_dict, error_from_tuple=False):

    message = ''
    if metadata_dict:
        if error_from_tuple:
            invalid_repository_dependencies_dict = metadata_dict.get('invalid_repository_dependencies', None)
            if (invalid_repository_dependencies_dict is not None):
                invalid_repository_dependencies = invalid_repository_dependencies_dict.get('invalid_repository_dependencies', [])
                for repository_dependency_tup in invalid_repository_dependencies:
                    (toolshed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td, error) = common_util.parse_repository_dependency_tuple(repository_dependency_tup, contains_error=True)
                    if error:
                        message += ('%s        ' % str(error))
        else:
            message += 'The    complete    dependency    hierarchy    could    not    be    determined    for    this    repository,    so    no    required    '
            message += 'repositories    will    not    be    installed.        This    is    likely    due    to    invalid    repository    dependency    definitions.        '
            repository_dependencies_dict = metadata_dict.get('repository_dependencies', None)
            if (repository_dependencies_dict is not None):
                rd_tups = repository_dependencies_dict.get('repository_dependencies', None)
                if (rd_tups is not None):
                    message += 'Here    are    the    attributes    of    the    dependencies    defined    for    this    repository    to    help    determine    the    '
                    message += 'cause    of    this    problem.<br/>'
                    message += '<table    cellpadding="2"    cellspacing="2">'
                    message += '<tr><th>Tool    shed</th><th>Repository    name</th><th>Owner</th><th>Changeset    revision</th>'
                    message += '<th>Prior    install    required</th></tr>'
                    for rd_tup in rd_tups:
                        (tool_shed, name, owner, changeset_revision, pir, oicct) = common_util.parse_repository_dependency_tuple(rd_tup)
                        if util.asbool(pir):
                            pir_str = 'True'
                        else:
                            pir_str = ''
                        message += ('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>' % (tool_shed, name, owner, changeset_revision, pir_str))
                    message += '</table>'
    return message
