code: def grep(text, io=None, flist=None):
      """Open the Find in Files dialog.
  
      Module-level function to access the singleton GrepDialog
      instance and open the dialog.  If text is selected, it is
      used as the search phrase; otherwise, the previous entry
      is used.
  
      Args:
          text: Text widget that contains the selected text for
                default search phrase.
          io: iomenu.IOBinding instance with default path to search.
          flist: filelist.FileList instance for OutputWindow parent.
      """
      root = text._root()
      engine = searchengine.get(root)
      if not hasattr(engine, "_grepdialog"):
          engine._grepdialog = GrepDialog(root, engine, flist)
      dialog = engine._grepdialog
      searchphrase = text.get("sel.first", "sel.last")
      dialog.open(text, searchphrase, io)
  
file_path: cpython/Lib/idlelib/grep.py
imports: import fnmatch
  import os
  import sys
  from tkinter import StringVar, BooleanVar
  from tkinter.ttk import Checkbutton
  from idlelib.searchbase import SearchDialogBase
  from idlelib import searchengine
label_desc: Use image node_id 1 for calling a global function with example usage: grep(text, io, flist) without return types