code: def _create_variable_from_spec_nest(specs, batch_size):
      def create_variable(spec):
          return common.create_variable(
              name=spec.name,
              dtype=spec.dtype,
              shape=[batch_size] + spec.shape.as_list(),
          )
  
      return tf.nest.map_structure(create_variable, specs)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import gin
  import tensorflow
  from tf_agents.bandits.environments import bandit_tf_environment
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
label_desc: Use image node_id 1 for calling a global function with example usage: _create_variable_from_spec_nest(specs, batch_size) and returns: tf, common