code: def register_custom_call_handler(platform: str, handler: Any) -> None:
      """Registers a custom handler and use it to register existing custom calls.
  
      If a custom call handler for the platform already exist, calling this method
      is a no-op and it will not register a new handler.
      Args:
        platform: the target platform.
        handler: the function to register a custom call.
      """
      xla_platform_name = xla_platform_names.get(platform, platform)
      with _custom_callback_lock:
          if xla_platform_name in _custom_callback_handler:
              logger.debug(
                  "Custom call handler for %s is already register. Will not register a"
                  " new one",
                  xla_platform_name,
              )
              return
          _custom_callback_handler[xla_platform_name] = handler
          if xla_platform_name in _custom_callback:
              for name, fn in _custom_callback[xla_platform_name]:
                  handler(name, fn, xla_platform_name)
              del _custom_callback[xla_platform_name]
  
imports: from __future__ import annotations
  import atexit
  import contextlib
  import enum
  import gzip
  import inspect
  import logging
  import os
  import threading
  from typing import Any, List, Mapping, Optional, Sequence, Tuple, Union
  import ml_dtypes
  import numpy
  from .None import xla_extension
label_desc: Use image node_id 21 for calling a global function with example usage: register_custom_call_handler(platform, handler) without return types