code: def is_type(obj, typestr_or_type):
      """is_type(obj, typestr_or_type) verifies if obj is of a certain type. It
      can take strings or actual python types for the second argument, i.e.
      'tuple'<->TupleType. 'all' matches all types.
  
      TODO: Should be extended for choosing more than one type."""
      if typestr_or_type == "all":
          return True
      if type(typestr_or_type) == type:
          test_type = typestr_or_type
      else:
          test_type = typestr2type.get(typestr_or_type, False)
      if test_type:
          return isinstance(obj, test_type)
      return False
  
file_path: catboost/contrib/python/ipython/py3/IPython/utils/wildcard.py
imports: import re
  import types
  from IPython.utils.dir2 import dir2
label_desc: Use image node_id 2 for calling a global function with example usage: is_type(obj, typestr_or_type) and returns: False, True, isinstance