code: def get_variable_ddi(
      name,
      shape,
      initial_value,
      dtype=tf.float32,
      init=False,
      trainable=True,
  ):
      """Wrapper for data-dependent initialization."""
      # If init is a tf bool: w is assigned dynamically at runtime.
      # If init is a python bool: then w is determined during graph construction.
      w = tf.get_variable(name, shape, dtype, None, trainable=trainable)
      if isinstance(init, bool):
          if init:
              return assign(w, initial_value)
          return w
      else:
          return tf.cond(
              init, lambda: assign(w, initial_value), lambda: w
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import scipy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.utils import contrib
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_probability
label_desc: Use image node_id 10 for calling a global function with example usage: get_variable_ddi(name, shape, initial_value, dtype, init, trainable) and returns: w, tf, assign