code: def test_kserve_mnist_model_register_and_inference_on_valid_model():
      """
      Validates that snapshot.cfg is created when management apis are invoked for kserve.
      """
      test_utils.start_torchserve(snapshot_file=snapshot_file_kf)
      test_utils.register_model("mnist", "mnist.mar")
  
      with open(input_json_mnist, "r") as f:
          s = f.read()
          s = s.replace("'", '"')
          data = json.loads(s)
  
      response = run_inference_using_url_with_data_json(
          KF_INFERENCE_API + "/v1/models/mnist:predict", data
      )
  
      assert (json.loads(response.content)["predictions"][0]) == 2
      test_utils.unregister_model("mnist")
  
imports: import ast
  import json
  import logging
  import os
  import numpy
  import pytest
  import requests
  import test_utils
  import torch
label_desc: Use image node_id 13 for calling a global function with example usage: test_kserve_mnist_model_register_and_inference_on_valid_model() without return types