class_docstr: Access the history database without adding to it.
  
  This is intended for use by standalone history tools. IPython shells use
  HistoryManager, below, which is a subclass of this.
class_docstr_tok: ["Access","the","history","database","without","adding","to","it",".","This","is","intended","for","use","by","standalone","history","tools",".","IPython","shells","use","HistoryManager",",","below",",","which","is","a","subclass","of","this","."]
docstr: Search the database using unix glob-style matching (wildcards
  * and ?).
  
  Parameters
  ----------
  pattern : str
      The wildcarded pattern to match when searching
  search_raw : bool
      If True, search the raw input, otherwise, the parsed input
  raw, output : bool
      See :meth:`get_range`
  n : None or int
      If an integer is given, it defines the limit of
      returned entries.
  unique : bool
      When it is true, return only unique entries.
  
  Returns
  -------
  Tuples as :meth:`get_range`
docstr_tok: ["Search","the","database","using","unix","glob-style","matching","(","wildcards","*","and","?",")",".","Parameters","--","--","--","--","--","pattern",":","str","The","wildcarded","pattern","to","match","when","searching","search_raw",":","bool","If","True",",","search","the","raw","input",",","otherwise",",","the","parsed","input","raw",",","output",":","bool","See",":","meth",":","`","get_range","`","n",":","None","or","int","If","an","integer","is","given",",","it","defines","the","limit","of","returned","entries",".","unique",":","bool","When","it","is","true",",","return","only","unique","entries",".","Returns","--","--","--","-","Tuples","as",":","meth",":","`","get_range","`"]
code: def search(
      self,
      pattern="*",
      raw=True,
      search_raw=True,
      output=False,
      n=None,
      unique=False,
  ):
      """Search the database using unix glob-style matching (wildcards
      * and ?).
  
      Parameters
      ----------
      pattern : str
          The wildcarded pattern to match when searching
      search_raw : bool
          If True, search the raw input, otherwise, the parsed input
      raw, output : bool
          See :meth:`get_range`
      n : None or int
          If an integer is given, it defines the limit of
          returned entries.
      unique : bool
          When it is true, return only unique entries.
  
      Returns
      -------
      Tuples as :meth:`get_range`
      """
      tosearch = "source_raw" if search_raw else "source"
      if output:
          tosearch = "history." + tosearch
      self.writeout_cache()
      sqlform = "WHERE %s GLOB ?" % tosearch
      params = (pattern,)
      if unique:
          sqlform += " GROUP BY {0}".format(tosearch)
      if n is not None:
          sqlform += " ORDER BY session DESC, line DESC LIMIT ?"
          params += (n,)
      elif unique:
          sqlform += " ORDER BY session, line"
      cur = self._run_sql(
          sqlform, params, raw=raw, output=output, latest=unique
      )
      if n is not None:
          return reversed(list(cur))
      return cur
  
imports: import atexit
  import datetime
  from pathlib import Path
  import re
  import sqlite3
  import threading
  from traitlets.config.configurable import LoggingConfigurable
  from decorator import decorator
  from IPython.utils.decorators import undoc
  from IPython.paths import locate_profile
  from traitlets import Any, Bool, Dict, Instance, Integer, List, Unicode, Union, TraitError, default, observe
label_desc: Use image node_id 11 for calling the HistoryAccessor obj's underlying member method code with example usage: obj.search(pattern, raw, search_raw, output, n, unique) and returns: cur, reversed