code: def test_mnist_model_register_and_inference_on_valid_model():
      """
      Validates that snapshot.cfg is created when management apis are invoked.
      """
      test_utils.start_torchserve(no_config_snapshots=True)
      test_utils.register_model("mnist", "mnist.mar")
      files = {
          "data": (data_file_mnist, open(data_file_mnist, "rb")),
      }
      response = run_inference_using_url_with_data(
          TF_INFERENCE_API + "/predictions/mnist", files
      )
  
      assert (json.loads(response.content)) == 1
      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 9 for calling a global function with example usage: test_mnist_model_register_and_inference_on_valid_model() without return types