code: def search_module_help(text):
      """
      Search the help for a string
  
      :param text: find text in the module help using case-insensitive matching
      :return: an html document of all the module help pages that matched or None if no match found.
      """
      matching_help = []
  
      count = 0
  
      for menu_item, help_text in list(MENU_HELP.items()):
          help_text = cellprofiler.gui.html.utils.rst_to_html_fragment(
              help_text
          )
  
          matches = __search_fn(help_text, text)
  
          if len(matches) > 0:
              matching_help.append((menu_item, help_text, matches))
  
              count += len(matches)
  
      for module_name in get_module_names():
          module = instantiate_module(module_name)
  
          location = os.path.split(
              module.create_settings.__func__.__code__.co_filename
          )[0]
  
          if location == get_plugin_directory():
              continue
  
          prelim_matches = quick_search(module, text.lower())
          if prelim_matches:
              help_text = module.get_help()
              matches = __search_fn(help_text, text)
  
              if len(matches) > 0:
                  matching_help.append(
                      (module_name, help_text, matches)
                  )
                  count += len(matches)
  
      if len(matching_help) == 0:
          return None
  
      top = """\
  <html style="font-family:arial">
  <head>
      <title>{count} match{es} found</title>
  </head>
  <body>
      <h1>Match{es} found ({count} total)</h1><br>
      <ul></ul>
  </body>
  </html>
  """.format(
          **{"count": count, "es": "" if count == 1 else "es"}
      )
  
      body = "<br>"
  
      match_num = 1
  
      prev_link = """<a href="#match%d" title="Previous match"><img alt="previous match" src="memory:previous.png"></a>"""
  
      anchor = """<a name="match%d"><u>%s</u></a>"""
  
      next_link = """<a href="#match%d" title="Next match"><img src="memory:next.png" alt="next match"></a>"""
  
      for title, help_text, pairs in matching_help:
          top += """<li><a href="#match{:d}">{}</a></li>\n""".format(
              match_num, title
          )
  
          start_match = re.search(
              r"<\s*body[^>]*?>", help_text, re.IGNORECASE
          )
  
          # Some pages don't have in-line titles
          # Not matching "<h1>" here for cases that have "<h1 class='title'>", etc.
          if not help_text.startswith("<h1"):
              body += "<h1>{}</h1>".format(title)
  
          if start_match is None:
              start = 0
          else:
              start = start_match.end()
  
          end_match = re.search(r"<\\\s*body", help_text, re.IGNORECASE)
  
          if end_match is None:
              end = len(help_text)
          else:
              end = end_match.start()
  
          for begin_pos, end_pos in pairs:
              body += help_text[start:begin_pos]
  
              if match_num > 1:
                  body += prev_link % (match_num - 1)
  
              body += anchor % (match_num, help_text[begin_pos:end_pos])
  
              if match_num != count:
                  body += next_link % (match_num + 1)
  
              start = end_pos
  
              match_num += 1
  
          body += help_text[start:end] + "<br>"
  
      result = "{}</ul><br>\n{}</body></html>".format(top, body)
  
      return result
  
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 3 for calling a global function with example usage: search_module_help(text) and returns: result, None