code: def asdict(obj):
      """Convert an object to its dictionary representation recursively.
  
      <Added version="2.4.0"/>
      """
  
      # Implementation based on https://docs.python.org/3/library/dataclasses.html#dataclasses.asdict
  
      def _is_dataclass_instance(obj):
          # https://docs.python.org/3/library/dataclasses.html#dataclasses.is_dataclass
          return is_dataclass(obj) and not isinstance(obj, type)
  
      def _asdict_inner(obj):
          if _is_dataclass_instance(obj):
              result = {}
              for f in fields(obj):
                  value = _asdict_inner(getattr(obj, f.name))
                  if (
                      not f.init
                      or value != f.default
                      or f.metadata.get(
                          "include_in_asdict_even_if_is_default", False
                      )
                  ):
                      result[f.name] = value
              return result
          elif isinstance(obj, tuple) and hasattr(obj, "_fields"):
              # obj is a namedtuple
              return type(obj)(*[_asdict_inner(v) for v in obj])
          elif isinstance(obj, (list, tuple)):
              # Assume we can create an object of this type by passing in a
              # generator (which is not true for namedtuples, handled
              # above).
              return type(obj)(_asdict_inner(v) for v in obj)
          elif isinstance(obj, dict):
              return {
                  _asdict_inner(k): _asdict_inner(v)
                  for k, v in obj.items()
              }
          else:
              return copy.deepcopy(obj)
  
      if not isinstance(obj, dict) and not _is_dataclass_instance(obj):
          raise TypeError(f"{obj} is not a dict or a dataclass")
  
      return _asdict_inner(obj)
  
imports: import copy
  import functools
  import itertools
  import multiprocessing.pool
  import os
  import queue
  import re
  import types
  import warnings
  from contextlib import contextmanager
  from dataclasses import fields, is_dataclass
  from multiprocessing import Manager
  from queue import Empty
  from shutil import disk_usage
  from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, TypeVar, Union
  from urllib.parse import urlparse
  import multiprocess
  import multiprocess.pool
  import numpy
  from tqdm.auto import tqdm
  from ..None import config
  from ..parallel import parallel_map
  from .None import logging
  from .None import tqdm
  from ._dill import Pickler, dump, dumps, pklregister
label_desc: Use image node_id 5 for calling a global function with example usage: asdict(obj) and returns: _asdict_inner, unknown, result, type, type, unknown, copy