code: def validate_init_args_statically(distribution, batch_shape):
      """Helper to __init__ which makes or raises assertions."""
      if tensorshape_util.rank(batch_shape.shape) is not None:
          if tensorshape_util.rank(batch_shape.shape) != 1:
              raise ValueError(
                  "`batch_shape` must be a vector "
                  "(saw rank: {}).".format(
                      tensorshape_util.rank(batch_shape.shape)
                  )
              )
  
      batch_shape_static = tensorshape_util.constant_value_as_shape(
          batch_shape
      )
      batch_size_static = tensorshape_util.num_elements(
          batch_shape_static
      )
      dist_batch_size_static = tensorshape_util.num_elements(
          distribution.batch_shape
      )
  
      if (
          batch_size_static is not None
          and dist_batch_size_static is not None
      ):
          if batch_size_static != dist_batch_size_static:
              raise ValueError(
                  "`batch_shape` size ({}) must match "
                  "`distribution.batch_shape` size ({}).".format(
                      batch_size_static, dist_batch_size_static
                  )
              )
  
      if tensorshape_util.dims(batch_shape_static) is not None:
          if any(
              tf.compat.dimension_value(dim) is not None
              and tf.compat.dimension_value(dim) < 1
              for dim in batch_shape_static
          ):
              raise ValueError("`batch_shape` elements must be >=-1.")
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling a global function with example usage: validate_init_args_statically(distribution, batch_shape) without return types