code: def _deep_type_frozenset(obj):
      if not obj:
          return typing.FrozenSet
      tp = deep_type(next(iter(obj)))
      for x in obj:
          if not deep_isinstance(x, tp):
              tp = get_origin(tp)
          if not deep_isinstance(x, tp):
              raise NotImplementedError(
                  f"TODO handle inhomogeneous frozensets: {str(obj)}"
              )
      return typing.FrozenSet[tp]
  
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 3 for calling a global function with example usage: _deep_type_frozenset(obj) and returns: typing, typing