code: def test_inference_with_untrained_model_and_sample_text(
      model_name, test_file
  ):
      with open(test_file, "rb") as f:
          response = requests.post(
              url=f"http://localhost:8080/predictions/{model_name}",
              data=f,
          )
  
      assert response.status_code == 200
  
      result_entries = json.loads(response.text)
  
      assert "Negative" in result_entries
      assert "Positive" in result_entries
  
      # We're using an untrained model for the unit test, so results do not make sense but should be consistent
      assert (
          float(result_entries["Negative"])
          == EXPECTED_RESULT_SAMPLE_TEXT[0]["0"]
      )
      assert (
          float(result_entries["Positive"])
          == EXPECTED_RESULT_SAMPLE_TEXT[0]["1"]
      )
  
imports: import importlib
  import json
  import os
  import shutil
  import sys
  import time
  from argparse import Namespace
  from pathlib import Path
  import pytest
  import requests
  import test_utils
  import torch
  from model_archiver import ModelArchiverConfig
  from test_utils import REPO_ROOT
  from ts.torch_handler.unit_tests.test_utils.mock_context import MockContext
label_desc: Use image node_id 9 for calling a global function with example usage: test_inference_with_untrained_model_and_sample_text(model_name, test_file) without return types