docstr: Search namespaces with wildcards for objects.
  
  Arguments:
  
  - pattern: string containing shell-like wildcards to use in namespace
    searches and optionally a type specification to narrow the search to
    objects of that type.
  
  - ns_table: dict of name->namespaces for search.
  
  Optional arguments:
  
    - ns_search: list of namespace names to include in search.
  
    - ignore_case(False): make the search case-insensitive.
  
    - show_all(False): show all names, including those starting with
      underscores.
  
    - list_types(False): list all available object types for object matching.
docstr_tok: ["Search","namespaces","with","wildcards","for","objects",".","Arguments",":","-","pattern",":","string","containing","shell-like","wildcards","to","use","in","namespace","searches","and","optionally","a","type","specification","to","narrow","the","search","to","objects","of","that","type",".","-","ns_table",":","dict","of","name-",">","namespaces","for","search",".","Optional","arguments",":","-","ns_search",":","list","of","namespace","names","to","include","in","search",".","-","ignore_case","(","False",")",":","make","the","search","case-insensitive",".","-","show_all","(","False",")",":","show","all","names",",","including","those","starting","with","underscores",".","-","list_types","(","False",")",":","list","all","available","object","types","for","object","matching","."]
code: def psearch(
      self,
      pattern,
      ns_table,
      ns_search=[],
      ignore_case=False,
      show_all=False,
      *,
      list_types=False,
  ):
      """Search namespaces with wildcards for objects.
  
      Arguments:
  
      - pattern: string containing shell-like wildcards to use in namespace
        searches and optionally a type specification to narrow the search to
        objects of that type.
  
      - ns_table: dict of name->namespaces for search.
  
      Optional arguments:
  
        - ns_search: list of namespace names to include in search.
  
        - ignore_case(False): make the search case-insensitive.
  
        - show_all(False): show all names, including those starting with
          underscores.
  
        - list_types(False): list all available object types for object matching.
      """
      # print 'ps pattern:<%r>' % pattern # dbg
  
      # defaults
      type_pattern = "all"
      filter = ""
  
      # list all object types
      if list_types:
          page.page("\n".join(sorted(typestr2type)))
          return
  
      cmds = pattern.split()
      len_cmds = len(cmds)
      if len_cmds == 1:
          # Only filter pattern given
          filter = cmds[0]
      elif len_cmds == 2:
          # Both filter and type specified
          filter, type_pattern = cmds
      else:
          raise ValueError(
              "invalid argument string for psearch: <%s>" % pattern
          )
  
      # filter search namespaces
      for name in ns_search:
          if name not in ns_table:
              raise ValueError(
                  "invalid namespace <%s>. Valid names: %s"
                  % (name, ns_table.keys())
              )
  
      # print 'type_pattern:',type_pattern # dbg
      search_result, namespaces_seen = set(), set()
      for ns_name in ns_search:
          ns = ns_table[ns_name]
          # Normally, locals and globals are the same, so we just check one.
          if id(ns) in namespaces_seen:
              continue
          namespaces_seen.add(id(ns))
          tmp_res = list_namespace(
              ns,
              type_pattern,
              filter,
              ignore_case=ignore_case,
              show_all=show_all,
          )
          search_result.update(tmp_res)
  
      page.page("\n".join(sorted(search_result)))
  
imports: from dataclasses import dataclass
  from inspect import signature
  from textwrap import dedent
  import ast
  import html
  import inspect
  import io
  import linecache
  import os
  import sys
  import types
  import warnings
  from typing import Any, Optional, Dict, Union, List, Tuple
  from typing import TypeAlias
  from IPython.core import page
  from IPython.lib.pretty import pretty
  from IPython.testing.skipdoctest import skip_doctest
  from IPython.utils import PyColorize
  from IPython.utils import openpy
  from IPython.utils.dir2 import safe_hasattr
  from IPython.utils.path import compress_user
  from IPython.utils.text import indent
  from IPython.utils.wildcard import list_namespace
  from IPython.utils.wildcard import typestr2type
  from IPython.utils.coloransi import TermColors, ColorScheme, ColorSchemeTable
  from IPython.utils.py3compat import cast_unicode
  from IPython.utils.colorable import Colorable
  from IPython.utils.decorators import undoc
  from pygments import highlight
  from pygments.lexers import PythonLexer
  from pygments.formatters import HtmlFormatter
label_desc: Use image node_id 19 for calling the Inspector obj's underlying member method code with example usage: obj.psearch(pattern, ns_table, ns_search, ignore_case, show_all) without return types