code: def named_tuple_to_dict(data: Any) -> Any:
      """Recursively convert NamedTuples to dictionaries."""
      if isinstance(data, dict):
          return {
              key: named_tuple_to_dict(value)
              for key, value in data.items()
          }
      elif isinstance(data, list):
          return [named_tuple_to_dict(value) for value in data]
      elif _is_named_tuple(data):
          return {
              key: named_tuple_to_dict(value)
              for key, value in data._asdict().items()
          }
      elif isinstance(data, tuple):
          return tuple(named_tuple_to_dict(value) for value in data)
      else:
          return data
  
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 1 for calling a global function with example usage: named_tuple_to_dict(data) and returns: unknown, unknown, unknown, tuple, data