code: def test_translator_input(sentence_id, sentence, factors, chunk_size):
      tokens = sentence.split()
      trans_input = sockeye.inference.TranslatorInput(
          sentence_id=sentence_id, tokens=tokens, factors=factors
      )
  
      assert trans_input.sentence_id == sentence_id
      assert trans_input.tokens == tokens
      assert len(trans_input) == len(tokens)
      assert trans_input.factors == factors
      if factors is not None:
          for factor in trans_input.factors:
              assert len(factor) == len(tokens)
  
      chunked_inputs = list(trans_input.chunks(chunk_size))
      assert len(chunked_inputs) == ceil(len(tokens) / chunk_size)
      for chunk_id, chunk_input in enumerate(chunked_inputs):
          assert chunk_input.sentence_id == sentence_id
          assert (
              chunk_input.tokens
              == trans_input.tokens[
                  chunk_id * chunk_size : (chunk_id + 1) * chunk_size
              ]
          )
          if factors:
              assert len(chunk_input.factors) == len(factors)
              for factor, expected_factor in zip(
                  chunk_input.factors, factors
              ):
                  assert len(factor) == len(chunk_input.tokens)
                  assert (
                      factor
                      == expected_factor[
                          chunk_id
                          * chunk_size : (chunk_id + 1)
                          * chunk_size
                      ]
                  )
  
imports: import itertools
  import json
  from math import ceil
  from unittest.mock import patch, Mock
  import numpy
  import pytest
  import torch
  import sockeye.beam_search
  import sockeye.constants
  import sockeye.data_io
  import sockeye.inference
  import sockeye.lexicon
  import sockeye.model
  import sockeye.utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_translator_input(sentence_id, sentence, factors, chunk_size) without return types