code: def _unpack_remotedata_inner(
      o: Any, byte_keys: bool, found_futures: set[WrappedKey]
  ) -> Any:
      """Inner implementation of `unpack_remotedata` that adds found wrapped keys to `found_futures`"""
  
      typ = type(o)
      if typ is tuple:
          if not o:
              return o
          if type(o[0]) is SubgraphCallable:
              # Unpack futures within the arguments of the subgraph callable
              futures: set[WrappedKey] = set()
              args = tuple(
                  _unpack_remotedata_inner(i, byte_keys, futures)
                  for i in o[1:]
              )
              found_futures.update(futures)
  
              # Unpack futures within the subgraph callable itself
              sc: SubgraphCallable = o[0]
              futures = set()
              dsk = {
                  k: _unpack_remotedata_inner(v, byte_keys, futures)
                  for k, v in sc.dsk.items()
              }
              future_keys: tuple = ()
              if (
                  futures
              ):  # If no futures is in the subgraph, we just use `sc` as-is
                  found_futures.update(futures)
                  future_keys = (
                      tuple(f.key for f in futures)
                      if byte_keys
                      else tuple(f.key for f in futures)
                  )
                  inkeys = tuple(sc.inkeys) + future_keys
                  sc = SubgraphCallable(dsk, sc.outkey, inkeys, sc.name)
              return (sc,) + args + future_keys
          else:
              return tuple(
                  _unpack_remotedata_inner(
                      item, byte_keys, found_futures
                  )
                  for item in o
              )
      elif is_namedtuple_instance(o):
          return _namedtuple_packing(
              o,
              partial(
                  _unpack_remotedata_inner,
                  byte_keys=byte_keys,
                  found_futures=found_futures,
              ),
          )
  
      if typ in collection_types:
          if not o:
              return o
          outs = [
              _unpack_remotedata_inner(item, byte_keys, found_futures)
              for item in o
          ]
          return typ(outs)
      elif typ is dict:
          if o:
              return {
                  k: _unpack_remotedata_inner(
                      v, byte_keys, found_futures
                  )
                  for k, v in o.items()
              }
          else:
              return o
      elif issubclass(typ, WrappedKey):  # TODO use type is Future
          k = o.key
          found_futures.add(o)
          return k
      else:
          return o
  
imports: from __future__ import annotations
  import asyncio
  import logging
  import random
  from collections import defaultdict
  from collections.abc import Callable, Collection, Coroutine, Mapping
  from functools import partial
  from itertools import cycle
  from typing import Any, TypeVar
  from tlz import concat, drop, groupby, merge
  import dask.config
  from dask.optimization import SubgraphCallable
  from dask.typing import Key
  from dask.utils import is_namedtuple_instance, parse_timedelta
  from distributed.core import ConnectionPool, rpc
  from distributed.utils import All
label_desc: Use image node_id 2 for calling a global function with example usage: _unpack_remotedata_inner(o, byte_keys, found_futures) and returns: typ, o, unknown, tuple, _namedtuple_packing, o, unknown, o, k, o