code: def initialize_by_shape(shape_to_value):
      """Create an initializer with values specified by tensor shape."""
  
      def initialize(shape, dtype):
          shape = tuple(shape)
          if shape not in shape_to_value:
              raise ValueError(
                  "Shape {} not found in shape to value map.".format(
                      shape
                  )
              )
          return tf.reshape(
              tf.constant(shape_to_value[tuple(shape)], dtype=dtype),
              shape,
          )
  
      return initialize
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import mesh_tensorflow
  from mesh_tensorflow.transformer import vocab_embeddings
  import mock
  import numpy
  import scipy.special
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: initialize_by_shape(shape_to_value) and returns: initialize, tf