code: def _generate_sentence(vocab_size, max_len):
      sentence = np.zeros(max_len, dtype=np.int32)
      random_length = random.randint(1, max_len)
      sentence[:random_length] = [
          random.randint(0, vocab_size - 1)
          for _ in range(random_length)
      ]
  
      return sentence
  
imports: import random
  import numpy
  import pytest
  import torch
  from ludwig.constants import ENCODER_OUTPUT
  from ludwig.data.dataset_synthesizer import build_vocab
  from ludwig.encoders.base import Encoder
  from ludwig.encoders.image.base import MLPMixerEncoder, Stacked2DCNN
  from ludwig.encoders.sequence_encoders import ParallelCNN, SequenceEmbedEncoder, StackedCNN, StackedCNNRNN, StackedParallelCNN, StackedRNN
  from ludwig.utils.torch_utils import get_torch_device
  from tests.integration_tests.parameter_update_utils import check_module_parameters_updated
label_desc: Use image node_id 4 for calling a global function with example usage: _generate_sentence(vocab_size, max_len) and returns: sentence