<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _index_verify(index_file, **extra_kwargs):
 """Populate the template and compare to documentation index file. Used for both ``docs/index.rst`` and ``docs/index.rst.release.template``. Args: index_file (str):
 Filename to compare against. extra_kwargs (Dict[str, str]):
 Over-ride for template arguments. One **special** keyword is ``side_effect``, which can be used to update the template output after the fact. Raises: ValueError: If the current ``index.rst`` doesn't agree with the expected value computed from the template. """

    side_effect = extra_kwargs.pop("side_effect", None)
    with open(TEMPLATE_FILE, "r") as file_obj:
        template = file_obj.read()
    template_kwargs = {
        "code_block1": SPHINX_CODE_BLOCK1,
        "code_block2": SPHINX_CODE_BLOCK2,
        "code_block3": SPHINX_CODE_BLOCK3,
        "testcleanup": TEST_CLEANUP,
        "toctree": TOCTREE,
        "bernstein_basis": BERNSTEIN_BASIS_SPHINX,
        "bezier_defn": BEZIER_DEFN_SPHINX,
        "sum_to_unity": SUM_TO_UNITY_SPHINX,
        "img_prefix": "",
        "extra_links": "",
        "docs": "",
        "docs_img": "",
        "pypi": "\n\n|pypi| ",
        "pypi_img": PYPI_IMG,
        "versions": "|versions|\n\n",
        "versions_img": VERSIONS_IMG,
        "rtd_version": RTD_VERSION,
        "revision": REVISION,
        "circleci_badge": CIRCLECI_BADGE,
        "circleci_path": "",
        "travis_badge": TRAVIS_BADGE,
        "travis_path": "",
        "appveyor_badge": APPVEYOR_BADGE,
        "appveyor_path": "",
        "coveralls_badge": COVERALLS_BADGE,
        "coveralls_path": COVERALLS_PATH,
        "zenodo": "|zenodo|",
        "zenodo_img": ZENODO_IMG,
        "joss": " |JOSS|",
        "joss_img": JOSS_IMG,
    }
    template_kwargs.update(**extra_kwargs)
    expected = template.format(**template_kwargs)
    if side_effect is not None:
        expected = side_effect(expected)
    with open(index_file, "r") as file_obj:
        contents = file_obj.read()
    if contents != expected:
        err_msg = "\n" + get_diff(
            contents,
            expected,
            index_file + ".actual",
            index_file + ".expected",
        )
        raise ValueError(err_msg)

    else:
        rel_name = os.path.relpath(index_file, _ROOT_DIR)
        msg = "{} contents are as expected.".format(rel_name)
        print(msg)