code: def basic_test_array_shape_dynamic_checks(
      static_shape, dynamic_shape, batch_size, beam_width, is_valid=True
  ):
      @tf.function(
          input_signature=(
              tf.TensorSpec(dynamic_shape, dtype=tf.float32),
          )
      )
      def _test_body(t):
          beam_search_decoder._check_batch_beam(
              t, batch_size, beam_width
          )
  
      t = tf.random.uniform(static_shape, dtype=tf.float32)
      if is_valid:
          _test_body(t)
      else:
          with pytest.raises(tf.errors.InvalidArgumentError):
              _test_body(t)
  
imports: import numpy
  import pytest
  import tensorflow
  from tensorflow_addons.seq2seq import attention_wrapper
  from tensorflow_addons.seq2seq import beam_search_decoder, gather_tree
label_desc: Use image node_id 8 for calling a global function with example usage: basic_test_array_shape_dynamic_checks(static_shape, dynamic_shape, batch_size, beam_width, is_valid) without return types