code: def test_server_shell(
      train_env: TrainEnv,
      static_server: "testutil.ServerFacade",
      caplog,
  ) -> None:
      caplog.set_level(logging.INFO)
      execution_parameters = static_server.execution_parameters()
  
      assert "BatchStrategy" in execution_parameters
      assert "MaxConcurrentTransforms" in execution_parameters
      assert "MaxPayloadInMB" in execution_parameters
  
      assert execution_parameters["BatchStrategy"] == "SINGLE_RECORD"
      assert execution_parameters["MaxPayloadInMB"] == 6
  
      configuration = {
          "num_samples": 1,  # FIXME: this is ignored
          "output_types": ["mean", "samples"],
          "quantiles": [],
          **train_env.hyperparameters,
      }
  
      for entry in train_env.datasets["train"]:
          forecast = static_server.invocations([entry], configuration)[
              0
          ]
  
          for output_type in configuration["output_types"]:
              assert output_type in forecast
  
          act_mean = np.array(forecast["mean"])
          act_samples = np.array(forecast["samples"])
  
          mean = np.mean(entry["target"])
  
          exp_mean_shape = (prediction_length,)
          exp_samples_shape = (num_samples, prediction_length)
  
          exp_mean = mean * np.ones(shape=(prediction_length,))
          exp_samples = mean * np.ones(shape=exp_samples_shape)
  
          assert exp_mean_shape == act_mean.shape
          assert exp_samples_shape == act_samples.shape
          assert equals(exp_mean, act_mean)
          assert equals(exp_samples, act_samples)
  
imports: import json
  import logging
  import sys
  from typing import ContextManager
  import numpy
  import pytest
  from gluonts.core.component import equals
  from gluonts.dataset.jsonl import encode_json
  from gluonts.model.trivial.mean import MeanPredictor
  from gluonts.shell.env import ServeEnv, TrainEnv
  from gluonts.shell.train import run_train_and_test
label_desc: Use image node_id 7 for calling a global function with example usage: test_server_shell(train_env, static_server, caplog) without return types