code: def deep_type(obj):
      """
      An enhanced version of :func:`type` that reconstructs structured :mod:`typing`` types
      for a limited set of immutable data structures, notably ``tuple`` and ``frozenset``.
      Mostly intended for internal use in Funsor interpretation pattern-matching.
  
      Example::
  
          assert deep_type((1, ("a",))) is typing.Tuple[int, typing.Tuple[str]]
          assert deep_type(frozenset(["a"])) is typing.FrozenSet[str]
      """
      # compare to pytypes.deep_type(obj)
      return type(obj)
  
imports: import functools
  import sys
  import typing
  import weakref
  import typing_extensions
  from multipledispatch.variadic import Variadic
  from multipledispatch.variadic import isvariadic
label_desc: Use image node_id 1 for calling a global function with example usage: deep_type(obj) and returns: type