code: def is_typed_named_tuple(cls):
      """Return True if cls is probably a subtype of `typing.NamedTuple`.
  
      Unfortunately types created with `class T(NamedTuple):` actually
      subclass `tuple` directly rather than NamedTuple.  This is annoying,
      and means we just have to hope that nobody defines a different tuple
      subclass with similar attributes.
      """
      return (
          issubclass(cls, tuple)
          and hasattr(cls, "_fields")
          and (
              hasattr(cls, "_field_types")
              or hasattr(cls, "__annotations__")
          )
      )
  
imports: import codecs
  import copy
  import dataclasses
  import inspect
  import platform
  import sys
  import typing
  from functools import partial
  from typing import Any, ForwardRef, get_args
label_desc: Use image node_id 6 for calling a global function with example usage: is_typed_named_tuple(cls) and returns: unknown