code: def args_to_kwargs(
      self, *, args, from_dict=False, outer_tuple=False, is_outer=True
  ):
      if self.is_singleton():
          spec = self.singleton()
          if isinstance(spec, self.value_type):
              assert isinstance(
                  args, (tf.IndexedSlices, tf.Tensor, tf.Variable)
              ), (self, args)
              assert spec.is_compatible_with(spec_or_tensor=args), (
                  spec,
                  args,
              )
              kwargs = args
          else:
              kwargs = spec.args_to_kwargs(
                  args=args, from_dict=from_dict, is_outer=False
              )
          if outer_tuple and is_outer:
              return kwargs
          else:
              return TensorDict(singleton=kwargs)
  
      else:
          if is_outer:
              assert isinstance(args, (dict, list, tuple))
          elif from_dict:
              assert isinstance(args, dict), (self, args)
          else:
              assert isinstance(args, (list, tuple)), (self, args)
          kwargs = TensorDict()
          index = 0
          for name, spec in super(NestedDict, self).items():
              if from_dict and isinstance(args, dict):
                  arg = args.get(name)
              elif index < len(args):
                  assert not from_dict or is_outer
                  arg = args[index]
              else:
                  arg = None
              if isinstance(spec, self.value_type):
                  assert isinstance(
                      arg, (tf.IndexedSlices, tf.Tensor, tf.Variable)
                  )
                  if isinstance(arg, tf.IndexedSlices):
                      # TODO: why does IndexedSlicesSpec not work?
                      # spec = tf.IndexedSlicesSpec(
                      #     shape=spec.shape, dtype=spec.dtype, indices_dtype=arg.indices.dtype
                      # )
                      # assert spec.is_compatible_with(spec_or_value=arg), (name, spec, arg)
                      assert tf.TensorSpec(
                          shape=((None,) + spec.shape[1:]),
                          dtype=spec.dtype,
                      ).is_compatible_with(spec_or_tensor=arg.values)
                      assert tf.TensorSpec(
                          shape=(None,), dtype=arg.indices.dtype
                      ).is_compatible_with(spec_or_tensor=arg.indices)
                  else:
                      assert spec.is_compatible_with(
                          spec_or_tensor=arg
                      ), (name, spec, arg)
                  kwargs[name] = arg
                  index += 1
              elif len(spec) == 0:
                  # Recover empty arguments
                  # (False incompatible with TensorDict, so ensures it is never called)
                  kwargs[name] = spec.fmap(
                      function=(lambda: False), cls=TensorDict
                  )
              else:
                  kwargs[name] = spec.args_to_kwargs(
                      args=arg, from_dict=from_dict, is_outer=False
                  )
                  index += 1
          if outer_tuple and is_outer:
              return tuple(super(NestedDict, kwargs).values())
          else:
              return kwargs
  
imports: from collections import OrderedDict
  import numpy
  import tensorflow
  from tensorflow.python.training.tracking.tracking import AutoTrackable
  from tensorflow.python.training.tracking.data_structures import sticky_attribute_assignment
  from tensorforce.core.utils import NestedDict
label_desc: Use image node_id 7 for calling the SignatureDict obj's underlying member method code with example usage: obj.args_to_kwargs() and returns: kwargs, TensorDict, tuple, kwargs