code: def _asdict_inner(obj, dict_factory):
      if dataclasses._is_dataclass_instance(obj):
          return dict_factory(
              (
                  f.name,
                  _asdict_inner(getattr(obj, f.name), dict_factory),
              )
              for f in dataclasses.fields(obj)
          )
      elif isinstance(obj, tuple) and hasattr(obj, "_fields"):
          return type(obj)(
              *[_asdict_inner(v, dict_factory) for v in obj]
          )
      elif isinstance(obj, (list, tuple)):
          return type(obj)(_asdict_inner(v, dict_factory) for v in obj)
      elif isinstance(obj, dict):
          if hasattr(type(obj), "default_factory"):
              result = type(obj)(obj.default_factory)
              for k, v in obj.items():
                  result[
                      _asdict_inner(k, dict_factory)
                  ] = _asdict_inner(v, dict_factory)
              return result
          return type(obj)(
              (
                  _asdict_inner(k, dict_factory),
                  _asdict_inner(v, dict_factory),
              )
              for k, v in obj.items()
          )
      else:
          return copy.deepcopy(obj)
  
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 12 for calling a global function with example usage: _asdict_inner(obj, dict_factory) and returns: dict_factory, type, type, type, copy, result