code: def test_remove():
      """Test removing figures from a report."""
      r = Report()
      fig1, fig2 = _get_example_figures()
      r.add_figure(fig=fig1, title="figure1", tags=("slider",))
      r.add_figure(
          fig=[fig1, fig2], title="figure1", tags=("othertag",)
      )
      r.add_figure(fig=fig2, title="figure1", tags=("slider",))
      r.add_figure(fig=fig2, title="figure2", tags=("slider",))
  
      # Test removal by title
      r2 = copy.deepcopy(r)
      removed_index = r2.remove(title="figure1")
      assert removed_index == 2
      assert len(r2.html) == 3
      assert r2.html[0] == r.html[0]
      assert r2.html[1] == r.html[1]
      assert r2.html[2] == r.html[3]
  
      # Test restricting to section
      r2 = copy.deepcopy(r)
      removed_index = r2.remove(title="figure1", tags=("othertag",))
      assert removed_index == 1
      assert len(r2.html) == 3
      assert r2.html[0] == r.html[0]
      assert r2.html[1] == r.html[2]
      assert r2.html[2] == r.html[3]
  
imports: import base64
  import copy
  import glob
  import os
  import pickle
  import re
  import shutil
  from io import BytesIO
  from pathlib import Path
  import numpy
  import pytest
  from matplotlib import pyplot
  from mne import Epochs, create_info, pick_channels_cov, read_cov, read_events, read_evokeds
  from mne._fiff.write import DATE_NONE
  from mne.datasets import testing
  from mne.epochs import make_metadata
  from mne.io import RawArray, read_info, read_raw_fif
  from mne.preprocessing import ICA
  from mne.report import Report, _ReportScraper, open_report, report
  from mne.report import report
  from mne.report.report import _ALLOWED_IMAGE_FORMATS, CONTENT_ORDER, _webp_supported
  from mne.utils import Bunch
  from mne.utils._testing import assert_object_equal
  from mne.viz import plot_alignment
label_desc: Use image node_id 18 for calling a global function with example usage: test_remove() without return types