code: def _is_named_tuple(x: Any) -> bool:
      """Return True if x is an instance of NamedTuple."""
      t = type(x)
      b = t.__bases__
      if len(b) != 1 or b[0] != tuple:
          return False
      f = getattr(t, "_fields", None)
      if not isinstance(f, tuple):
          return False  # pragma nocover
      return all(isinstance(n, str) for n in f)
  
file_path: Ax/ax/utils/common/serialization.py
imports: from __future__ import annotations
  import inspect
  import pydoc
  from types import FunctionType
  from typing import Any, Callable, Dict, List, Optional, Type
label_desc: Use image node_id 2 for calling a global function with example usage: _is_named_tuple(x) and returns: all, False, False