code: def test_make_input_whitespace_delimiter(delimiter):
      """
      Test to ensure we disallow a variety of whitespace strings as factor delimiters.
      """
      sentence_id = 1
      translator = mock_translator(num_source_factors=2)
      sentence = "foo"
      with pytest.raises(sockeye.utils.SockeyeError) as e:
          sockeye.inference.make_input_from_factored_string(
              sentence_id=sentence_id,
              factored_string=sentence,
              translator=translator,
              delimiter=delimiter,
          )
      assert (
          str(e.value)
          == "Factor delimiter can not be whitespace or empty."
      )
  
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 8 for calling a global function with example usage: test_make_input_whitespace_delimiter(delimiter) without return types