code: def filter_search_index(app, exception):
      if exception is not None:
          return
  
      # searchindex only exist when generating html
      if app.builder.name != "html":
          return
  
      print("Removing methods from search index")
  
      searchindex_path = os.path.join(
          app.builder.outdir, "searchindex.js"
      )
      with open(searchindex_path, "r") as f:
          searchindex_text = f.read()
  
      searchindex_text = re.sub(
          r"{__init__.+?}", "{}", searchindex_text
      )
      searchindex_text = re.sub(
          r"{__call__.+?}", "{}", searchindex_text
      )
  
      with open(searchindex_path, "w") as f:
          f.write(searchindex_text)
  
imports: import os
  import re
  import sys
  import warnings
  from datetime import datetime
  from io import StringIO
  from pathlib import Path
  from sklearn.externals._packaging.version import parse
  import sphinx_gallery
  from github_link import make_linkcode_resolve
  from sphinx_gallery.notebook import add_code_cell, add_markdown_cell
  from sphinx_gallery.sorting import ExampleTitleSortKey
  import sklearn
  from sklearn.experimental import enable_iterative_imputer
  from sklearn.experimental import enable_halving_search_cv
  from sklearn.utils.fixes import VisibleDeprecationWarning
label_desc: Use image node_id 4 for calling a global function with example usage: filter_search_index(app, exception) without return types