code: def test_show_source_link_true(tmp_path, plot_html_show_source_link):
      # Test that a source link is generated if :show-source-link: is true,
      # whether or not plot_html_show_source_link is true.
      parent = Path(__file__).parent
      shutil.copyfile(
          parent / "tinypages/conf.py", tmp_path / "conf.py"
      )
      shutil.copytree(
          parent / "tinypages/_static", tmp_path / "_static"
      )
      doctree_dir = tmp_path / "doctrees"
      (tmp_path / "index.rst").write_text(
          """
  .. plot::
      :show-source-link: true
  
      plt.plot(range(2))
  """
      )
      html_dir = tmp_path / "_build" / "html"
      build_sphinx_html(
          tmp_path,
          doctree_dir,
          html_dir,
          extra_args=[
              "-D",
              f"plot_html_show_source_link={plot_html_show_source_link}",
          ],
      )
      assert len(list(html_dir.glob("**/index-1.py"))) == 1
  
file_path: matplotlib/lib/matplotlib/tests/test_sphinxext.py
imports: import filecmp
  import os
  from pathlib import Path
  import shutil
  import sys
  from matplotlib.testing import subprocess_run_for_testing
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_show_source_link_true(tmp_path, plot_html_show_source_link) without return types