code: def test_make_input_from_valid_json_string_restrict_lexicon():
      sentence_id = 1
      text = "this is a test"
      translator = mock_translator()
  
      lexicon1 = Mock(sockeye.lexicon.RestrictLexicon)
      lexicon2 = Mock(sockeye.lexicon.RestrictLexicon)
      translator.restrict_lexicon = {
          "lexicon1": lexicon1,
          "lexicon2": lexicon2,
      }
      assert (
          translator.restrict_lexicon["lexicon1"]
          is not translator.restrict_lexicon["lexicon2"]
      )
  
      restrict_lexicon1 = "lexicon1"
      inp1 = sockeye.inference.make_input_from_json_string(
          sentence_id,
          json.dumps(
              {
                  C.JSON_TEXT_KEY: text,
                  C.JSON_RESTRICT_LEXICON_KEY: restrict_lexicon1,
              }
          ),
          translator,
      )
      assert inp1.restrict_lexicon is lexicon1
  
      restrict_lexicon2 = "lexicon2"
      inp2 = sockeye.inference.make_input_from_json_string(
          sentence_id,
          json.dumps(
              {
                  C.JSON_TEXT_KEY: text,
                  C.JSON_RESTRICT_LEXICON_KEY: restrict_lexicon2,
              }
          ),
          translator,
      )
      assert inp2.restrict_lexicon is lexicon2
  
      assert inp1.restrict_lexicon is not inp2.restrict_lexicon
  
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 10 for calling a global function with example usage: test_make_input_from_valid_json_string_restrict_lexicon() without return types