code: def check_jaxlib_version(
      jax_version: str, jaxlib_version: str, minimum_jaxlib_version: str
  ) -> tuple[int, ...]:
      # Regex to match a dotted version prefix 0.1.23.456.789 of a PEP440 version.
      # PEP440 allows a number of non-numeric suffixes, which we allow also.
      # We currently do not allow an epoch.
      version_regex = re.compile(r"[0-9]+(?:\.[0-9]+)*")
  
      def _parse_version(v: str) -> tuple[int, ...]:
          m = version_regex.match(v)
          if m is None:
              raise ValueError(f"Unable to parse jaxlib version '{v}'")
          return tuple(int(x) for x in m.group(0).split("."))
  
      _jax_version = _parse_version(jax_version)
      _minimum_jaxlib_version = _parse_version(minimum_jaxlib_version)
      _jaxlib_version = _parse_version(jaxlib_version)
  
      if _jaxlib_version < _minimum_jaxlib_version:
          msg = (
              f"jaxlib is version {jaxlib_version}, but this version "
              f"of jax requires version >= {minimum_jaxlib_version}."
          )
          raise RuntimeError(msg)
  
      if _jaxlib_version > _jax_version:
          raise RuntimeError(
              f"jaxlib version {jaxlib_version} is newer than and "
              f"incompatible with jax version {jax_version}. Please "
              "update your jax and/or jaxlib packages."
          )
      return _jaxlib_version
  
imports: from __future__ import annotations
  import gc
  import pathlib
  import re
  from typing import Any
  import jax.version
  from jax.version import _minimum_jaxlib_version
  import jaxlib.cpu_feature_guard
  import jaxlib.utils
  import jaxlib.xla_client
  import jaxlib.lapack
  import jaxlib.ducc_fft
  import jaxlib.gpu_solver
  import jaxlib.gpu_sparse
  import jaxlib.gpu_prng
  import jaxlib.gpu_linalg
  import jaxlib.hlo_helpers
  import jaxlib.gpu_rnn
  import jaxlib.gpu_triton
  import jaxlib.mosaic.python.tpu
label_desc: Use image node_id 1 for calling a global function with example usage: check_jaxlib_version(jax_version, jaxlib_version, minimum_jaxlib_version) and returns: _jaxlib_version, tuple