def html_report(outdir, modules, excludes=None, errors=None):
    test_timestamp = time.strftime('%a %Y-%m-%d %H:%M %Z')
    m_subdirname = 'modules'
    m_dir = os.path.join(outdir, m_subdirname)
    if not os.path.exists(m_dir):
        os.makedirs(m_dir)

    total_lines = 0
    total_executed = 0
    total_excluded = 0
    total_stmts = 0
    module_stats = list()
    m_names = list(modules.keys())
    m_names.sort()
    for n in m_names:
        m_vars = ModuleVars(n, modules[n])
        if not m_vars.total_count:
            excludes.append(m_vars.module_name)
            del modules[n]
            continue
        m_vars.module_link = p2url(os.path.join(m_subdirname, m_vars.module_name + '.html'))
        module_stats.append(module_index.MODULE_STAT %m_vars.__dict__)
        total_lines += m_vars.total_count
        total_executed += m_vars.executed_count
        total_excluded += m_vars.excluded_count
        total_stmts += len(m_vars.stmts)
    module_stats = os.linesep.join(module_stats)
    if total_stmts:
        overall_covered = float(total_executed)/total_stmts*100
    else:
        overall_covered = 0.0

    m_names = list(modules.keys())
    m_names.sort()
    i = 0
    for i, n in enumerate(m_names):
        m_vars = ModuleVars(n)
        nav = dict(up_link=p2url(os.path.join('..', 'index.html')),
                   up_label='index')
        if i > 0:
            m = ModuleVars(m_names[i-1])
            nav['prev_link'] = os.path.basename(m.module_link)
            nav['prev_label'] = m.module_name
        if i+1 < len(modules):
            m = ModuleVars(m_names[i+1])
            nav['next_link'] = os.path.basename(m.module_link)
            nav['next_label'] = m.module_name
        html_module_detail(
            os.path.join(m_dir, m_vars.module_name + '.html'), n, nav)

    fo = open(os.path.join(outdir, 'index.html'), 'w+')
    fo.write(module_index.TOP)
    fo.write(module_index.CONTENT_HEADER %vars())
    fo.write(module_index.CONTENT_BODY %vars())
    if excludes:
        _file = 'excludes.html'
        exceptions_link = _file
        exception_desc = "Excluded packages and modules"
        fo.write(module_index.EXCEPTIONS_LINK %vars())
        html_module_excludes(os.path.join(outdir, _file), excludes)
    if errors:
        _file = 'errors.html'
        exceptions_link = _file
        exception_desc = "Error packages and modules"
        fo.write(module_index.EXCEPTIONS_LINK %vars())
        html_module_errors(os.path.join(outdir, _file), errors)
    fo.write(module_index.BOTTOM)
    fo.close()

    if settings.COVERAGE_BADGE_TYPE:
        badge = open(os.path.join(
            os.path.dirname(__file__),
            'badges',
            settings.COVERAGE_BADGE_TYPE,
            '%s.png' % int(overall_covered)
        ), 'rb').read()
        open(os.path.join(outdir, 'coverage_status.png'), 'wb').write(badge)
Creates an ``index.html`` in the specified ``outdir``. Also attempts to create
dataset/ETHPy150Open kmike/django-coverage/django_coverage/utils/coverage_report/html_report.py/html_report