code: def test_step_with_greedy_embedding_helper():
      batch_size = 5
      vocabulary_size = 7
      cell_depth = (
          vocabulary_size  # cell's logits must match vocabulary size
      )
      input_depth = 10
      start_tokens = np.random.randint(
          0, vocabulary_size, size=batch_size
      )
      end_token = 1
  
      embeddings = np.random.randn(vocabulary_size, input_depth).astype(
          np.float32
      )
      embeddings_t = tf.constant(embeddings)
      cell = tf.keras.layers.LSTMCell(vocabulary_size)
      sampler = sampler_py.GreedyEmbeddingSampler()
      initial_state = cell.get_initial_state(
          batch_size=batch_size, dtype=tf.float32
      )
      my_decoder = basic_decoder.BasicDecoder(
          cell=cell, sampler=sampler
      )
      (
          first_finished,
          first_inputs,
          first_state,
      ) = my_decoder.initialize(
          embeddings_t,
          start_tokens=start_tokens,
          end_token=end_token,
          initial_state=initial_state,
      )
      output_size = my_decoder.output_size
      output_dtype = my_decoder.output_dtype
      assert (
          basic_decoder.BasicDecoderOutput(
              cell_depth, tf.TensorShape([])
          )
          == output_size
      )
      assert (
          basic_decoder.BasicDecoderOutput(tf.float32, tf.int32)
          == output_dtype
      )
  
      (
          step_outputs,
          step_state,
          step_next_inputs,
          step_finished,
      ) = my_decoder.step(tf.constant(0), first_inputs, first_state)
  
      assert len(first_state) == 2
      assert len(step_state) == 2
      assert isinstance(step_outputs, basic_decoder.BasicDecoderOutput)
      assert (batch_size, cell_depth) == step_outputs[0].shape
      assert (batch_size,) == step_outputs[1].shape
      assert (batch_size, cell_depth) == first_state[0].shape
      assert (batch_size, cell_depth) == first_state[1].shape
      assert (batch_size, cell_depth) == step_state[0].shape
      assert (batch_size, cell_depth) == step_state[1].shape
  
      expected_sample_ids = np.argmax(step_outputs.rnn_output, -1)
      expected_step_finished = expected_sample_ids == end_token
      expected_step_next_inputs = embeddings[expected_sample_ids]
      np.testing.assert_equal(
          np.asanyarray([False, False, False, False, False]),
          first_finished,
      )
      np.testing.assert_equal(expected_step_finished, step_finished)
      assert output_dtype.sample_id == step_outputs.sample_id.dtype
      np.testing.assert_equal(
          expected_sample_ids, step_outputs.sample_id
      )
      np.testing.assert_equal(
          expected_step_next_inputs, step_next_inputs
      )
  
file_path: addons/tensorflow_addons/seq2seq/tests/basic_decoder_test.py
imports: import numpy
  import pytest
  import tensorflow
  from tensorflow_addons.seq2seq import attention_wrapper
  from tensorflow_addons.seq2seq import basic_decoder
  from tensorflow_addons.seq2seq import sampler
label_desc: Use image node_id 3 for calling a global function with example usage: test_step_with_greedy_embedding_helper() without return types