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)
  
file_path: scikit-optimize/doc/conf.py
imports: import warnings
  import os
  import re
  from packaging.version import parse
  import sys
  import skopt
  from github_link import make_linkcode_resolve
  import sphinx_gallery
label_desc: Use image node_id 2 for calling a global function with example usage: filter_search_index(app, exception) without return types