code: def test_html_repr():
      """Test switching _repr_html_ between HTML and plain text."""
      key = "MNE_REPR_HTML"
      existing_value = os.getenv(key, None)
  
      os.environ[key] = "True"  # HTML repr on
      info = mne.create_info(10, 256)
      r = info._repr_html_()
      assert r.startswith("<details open")
      assert r.endswith("</details>")
      os.environ[key] = "False"  # HTML repr off
      r = info._repr_html_()
      assert r.startswith("<pre>")
      assert r.endswith("</pre>")
  
      del os.environ[key]
      if existing_value is not None:
          os.environ[key, existing_value]
  
file_path: mne-python/mne/utils/tests/test_misc.py
imports: import os
  import subprocess
  import sys
  from contextlib import nullcontext
  import pytest
  import mne
  from mne.utils import catch_logging, run_subprocess, sizeof_fmt
label_desc: Use image node_id 2 for calling a global function with example usage: test_html_repr() without return types