code: def __search_fn(html, text):
      """
      Find the beginning and ending indices of case insensitive matches of "text"
      within the text-data of the HTML, searching only in its body and excluding
      text in the HTML tags.
  
      :param html: an HTML document
      :param text: a search string
      :return:
      """
      start_match = re.search(r"<\s*body[^>]*?>", html, re.IGNORECASE)
  
      if start_match is None:
          start = 0
      else:
          start = start_match.end()
  
      end_match = re.search(r"<\\\s*body", html, re.IGNORECASE)
  
      if end_match is None:
          end = len(html)
      else:
          end = end_match.start()
  
      escaped_text = re.escape(text)
  
      if " " in escaped_text:
          #
          # Many problems here:
          # <b>Groups</b> module
          # Some\ntext
          #
          # For now, just solve the multiple space problems
          #
          escaped_text = escaped_text.replace("\\ ", "\\s+")
  
      pattern = "(<[^>]*?>|%s)" % escaped_text
  
      return [
          (x.start() + start, x.end() + start)
          for x in re.finditer(pattern, html[start:end], re.IGNORECASE)
          if x.group(1)[0] != "<"
      ]
  
imports: import os
  import re
  import wx
  import wx.html
  from cellprofiler_core.preferences import get_plugin_directory
  from cellprofiler_core.utilities.core.modules import instantiate_module, get_module_names
  import cellprofiler.gui
  import cellprofiler.gui.help.content
  import cellprofiler.gui.html.utils
  import cellprofiler.gui.utilities.icon
  import cellprofiler.modules
label_desc: Use image node_id 1 for calling a global function with example usage: __search_fn(html, text) and returns: unknown