code: def _astuple_inner(obj, tuple_factory):
      if _is_dataclass_instance(obj):
          result = []
          for f in fields(obj):
              value = _astuple_inner(
                  getattr(obj, f.name), tuple_factory
              )
              result.append(value)
          return tuple_factory(result)
      elif isinstance(obj, (list, tuple)):
          return type(obj)(
              _astuple_inner(v, tuple_factory) for v in obj
          )
      elif isinstance(obj, dict):
          return type(obj)(
              (
                  _astuple_inner(k, tuple_factory),
                  _astuple_inner(v, tuple_factory),
              )
              for k, v in obj.items()
          )
      else:
          return copy.deepcopy(obj)
  
imports: import re
  import sys
  import copy
  import types
  import inspect
  import keyword
label_desc: Use image node_id 28 for calling a global function with example usage: _astuple_inner(obj, tuple_factory) and returns: tuple_factory, type, type, copy