code: def assert_valid_param(
      param_name: str, param_values: List[Any]
  ) -> None:
      try:
          for x in param_values:
              Trainer(**{param_name: x})
      except Exception as e:
          pytest.fail(
              f'Unexpected exception when initializing Trainer: "{e}"'
          )
          raise e
  
file_path: gluonts/test/mx/trainer/test_trainer.py
imports: from typing import Any, List
  import pytest
  from gluonts.mx.trainer import Trainer
label_desc: Use image node_id 5 for calling a global function with example usage: assert_valid_param(param_name, param_values) without return types