code: def generator_setup(
      self,
      trg_vocab,
      beam_size,
      use_gold_length,
      beam_ranking_algorithm,
      config,
  ):
      self.trg_vocab = ScriptVocabulary(
          list(trg_vocab),
          pad_idx=trg_vocab.get_pad_index(),
          bos_idx=trg_vocab.get_bos_index(-1),
          eos_idx=trg_vocab.get_eos_index(-1),
          mask_idx=trg_vocab.get_mask_index(),
      )
      self.length_beam_size = beam_size
      self.use_gold_length = use_gold_length
      self.beam_ranking_algorithm = get_beam_ranking_function(
          ranking_algorithm=beam_ranking_algorithm
      )
      self.clip_target_length = config.clip_target_length
      self.targetlen_cap = config.targetlen_cap
      self.targetlen_a = config.targetlen_a
      self.targetlen_b = config.targetlen_b
      self.targetlen_c = config.targetlen_c
  
imports: from enum import Enum
  from typing import Dict, Optional, Tuple
  import torch
  from pytext.common.constants import TORCH_VERSION
  from pytext.config import ConfigBase
  from pytext.models.module import Module
  from pytext.torchscript.vocab import ScriptVocabulary
  from torch import Tensor
label_desc: Use image node_id 3 for calling the MaskedSequenceGenerator obj's underlying member method code with example usage: obj.generator_setup(trg_vocab, beam_size, use_gold_length, beam_ranking_algorithm, config) without return types