code: def max_symbols_setup():
      from nemo.collections.asr.modules.rnnt_abstract import (
          AbstractRNNTDecoder,
          AbstractRNNTJoint,
      )
      from nemo.collections.asr.parts.utils.rnnt_utils import Hypothesis
  
      class DummyRNNTDecoder(AbstractRNNTDecoder):
          def predict(
              self,
              y: Optional[torch.Tensor] = None,
              state: Optional[List[torch.Tensor]] = None,
              add_sos: bool = False,
              batch_size: Optional[int] = None,
          ) -> Tuple[torch.Tensor, List[torch.Tensor]]:
              if batch_size is None:
                  batch_size = 1
              if y is not None:
                  assert len(y.shape) == 2
                  assert list(y.shape) == [batch_size, 1]
              if state is not None:
                  assert len(state) == 1
                  assert len(state[0].shape) == 3
                  assert list(state[0].shape) == [
                      1,
                      batch_size,
                      self.vocab_size + 1,
                  ]
              if y is not None:
                  # boost blank
                  output = F.one_hot(
                      y, num_classes=self.vocab_size + 1
                  ) + torch.tensor(
                      [0] * self.vocab_size + [1], dtype=torch.float32
                  )[
                      None, None, :
                  ].expand(
                      [batch_size, 1, -1]
                  )
              if y is not None and state is not None:
                  return (output + state[0].transpose(0, 1)) / 2, [
                      output.transpose(0, 1) * state[0]
                  ]
              elif state is not None:
                  return (
                      torch.tensor(
                          [0] * self.vocab_size + [1],
                          dtype=torch.float32,
                      )[None, None, :].expand([batch_size, 1, -1]),
                      state,
                  )
              elif y is not None:
                  return (
                      output,
                      [
                          torch.tensor(
                              [0] * self.vocab_size + [1],
                              dtype=torch.float32,
                          )[None, None, :].exand([1, batch_size, -1])
                      ],
                  )
              # y, state - None (initial call)
              return (
                  torch.tensor(
                      [0] * self.vocab_size + [1], dtype=torch.float32
                  )[None, None, :].expand([batch_size, 1, -1]),
                  [
                      torch.tensor(
                          [0] * self.vocab_size + [1],
                          dtype=torch.float32,
                      )[None, None, :].expand([1, batch_size, -1])
                  ],
              )
  
          def initialize_state(
              self, y: torch.Tensor
          ) -> Optional[List[torch.Tensor]]:
              return None
  
          def score_hypothesis(
              self, hypothesis: Hypothesis, cache: Dict[Tuple[int], Any]
          ) -> Tuple[torch.Tensor, List[torch.Tensor], torch.Tensor]:
              return torch.tensor(), [torch.tensor()], torch.tensor()
  
          def batch_select_state(
              self, batch_states: Optional[List[torch.Tensor]], idx: int
          ) -> Optional[List[List[torch.Tensor]]]:
              if batch_states is not None:
                  states = [batch_states[0][:, idx]]
                  return [states]
              else:
                  return None
  
          def batch_copy_states(
              self,
              old_states: List[torch.Tensor],
              new_states: List[torch.Tensor],
              ids: List[int],
              value: Optional[float] = None,
          ) -> List[torch.Tensor]:
              if value is None:
                  old_states[0][:, ids] = new_states[0][:, ids]
  
              return old_states
  
          def mask_select_states(
              self, states: Optional[torch.Tensor], mask: torch.Tensor
          ) -> Optional[List[torch.Tensor]]:
              if states is None:
                  return None
              return [states[0][:, mask]]
  
      class DummyRNNTJoint(AbstractRNNTJoint):
          def __init__(self, num_outputs: int):
              super().__init__()
              self.num_outputs = num_outputs
  
          @property
          def num_classes_with_blank(self):
              return self.num_outputs
  
          def project_encoder(
              self, encoder_output: torch.Tensor
          ) -> torch.Tensor:
              return encoder_output
  
          def project_prednet(
              self, prednet_output: torch.Tensor
          ) -> torch.Tensor:
              return prednet_output
  
          def joint_after_projection(
              self, f: torch.Tensor, g: torch.Tensor
          ) -> torch.Tensor:
              return f.unsqueeze(dim=2) + g.unsqueeze(dim=1)
  
      setup = {}
      setup["decoder"] = DummyRNNTDecoder(
          vocab_size=2, blank_idx=2, blank_as_pad=True
      )
      setup["decoder_masked"] = DummyRNNTDecoder(
          vocab_size=2, blank_idx=2, blank_as_pad=False
      )
      setup["joint"] = DummyRNNTJoint(num_outputs=3)
      # expected timesteps for max_symbols_per_step=5 are [[0, 0, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1]],
      # so we have both looped and regular iteration on the second frame
      setup["encoder_output"] = torch.tensor(
          [
              [[1, 0, 0], [0, 1, 0], [0, 0, 1]],
              [[0, 0, 1], [2, 0, 0], [0, 0, 0]],
          ],
          dtype=torch.float32,
      ).transpose(1, 2)
      setup["encoded_lengths"] = torch.tensor([3, 2])
      return setup
  
imports: import copy
  from typing import Any, Dict, List, Optional, Tuple
  import pytest
  import torch
  import torch.nn.functional
  from omegaconf import DictConfig, ListConfig
  from nemo.collections.asr.models import EncDecRNNTModel
  from nemo.collections.asr.modules import HATJoint, RNNTDecoder, RNNTJoint, SampledRNNTJoint, StatelessTransducerDecoder
  from nemo.collections.asr.parts.submodules import rnnt_beam_decoding
  from nemo.collections.asr.parts.submodules import rnnt_greedy_decoding
  from nemo.collections.asr.parts.utils import rnnt_utils
  from nemo.core.utils import numba_utils
  from nemo.core.utils.numba_utils import __NUMBA_MINIMUM_VERSION__
  from nemo.utils.config_utils import assert_dataclass_signature_match
label_desc: Use image node_id 1 for calling a global function with example usage: max_symbols_setup() and returns: setup, torch,  list, None, torch,  list,  torch, old_states, list, self, encoder_output, prednet_output, unknown, unknown,  list, list, None, None, torch,  state, output,  list