code: def register_runner(
      runner_cls: Type[Runner],
      runner_registry: Dict[Type[Runner], int] = CORE_RUNNER_REGISTRY,
      # pyre-fixme[2]: Parameter annotation cannot contain `Any`.
      # pyre-fixme[24]: Generic type `type` expects 1 type parameter, use
      #  `typing.Type` to avoid runtime subscripting errors.
      encoder_registry: Dict[
          Type, Callable[[Any], Dict[str, Any]]
      ] = CORE_ENCODER_REGISTRY,
      # pyre-fixme[24]: Generic type `type` expects 1 type parameter, use
      #  `typing.Type` to avoid runtime subscripting errors.
      decoder_registry: Dict[str, Type] = CORE_DECODER_REGISTRY,
      val: Optional[int] = None,
      # pyre-fixme[24]: Generic type `type` expects 1 type parameter, use `typing.Type` to
      #  avoid runtime subscripting errors.
  ) -> Tuple[
      Dict[Type[Runner], int],
      Dict[Type, Callable[[Any], Dict[str, Any]]],
      Dict[str, Type],
  ]:
      """Add a custom runner class to the SQA and JSON registries.
      For the SQA registry, if no int is specified, use a hash of the class name.
      """
      registered_val = val or abs(stable_hash(runner_cls.__name__)) % (
          10**5
      )
  
      new_runner_registry = {
          runner_cls: registered_val,
          **runner_registry,
      }
      new_encoder_registry = {
          runner_cls: runner_to_dict,
          **encoder_registry,
      }
      new_decoder_registry = {
          runner_cls.__name__: runner_cls,
          **decoder_registry,
      }
  
      return (
          new_runner_registry,
          new_encoder_registry,
          new_decoder_registry,
      )
  
file_path: Ax/ax/storage/runner_registry.py
imports: from logging import Logger
  from typing import Any, Callable, Dict, Optional, Tuple, Type
  from ax.core.runner import Runner
  from ax.runners.synthetic import SyntheticRunner
  from ax.storage.json_store.encoders import runner_to_dict
  from ax.storage.json_store.registry import CORE_DECODER_REGISTRY, CORE_ENCODER_REGISTRY
  from ax.storage.utils import stable_hash
  from ax.utils.common.logger import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: register_runner(runner_cls, runner_registry, encoder_registry, decoder_registry, val) and returns: new_runner_registry,  new_encoder_registry,  new_decoder_registry