code: def ensure_requires_global_batch_size(
      trial_class: Type[det.LegacyTrial],
      hparams: Dict[str, Any],
  ) -> None:
      bad_hparams = dict(hparams)
      del bad_hparams["global_batch_size"]
  
      def make_workloads() -> workload.Stream:
          trainer = TrainAndValidate()
          yield from trainer.send(steps=1, validation_freq=1)
  
      # Catch missing global_batch_size.
      with pytest.raises(
          det.errors.InvalidExperimentException,
          match="is a required hyperparameter",
      ):
          _ = make_trial_controller_from_trial_implementation(
              trial_class,
              workloads=make_workloads(),
              hparams=bad_hparams,
          )
  
imports: import importlib
  import os
  import pathlib
  import re
  import unittest.mock
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type
  import numpy
  import pytest
  from mypy_extensions import DefaultNamedArg
  import determined
  from determined import core, gpu, workload
  from determined.common import util
label_desc: Use image node_id 16 for calling a global function with example usage: ensure_requires_global_batch_size(trial_class, hparams) without return types