code: def _typecheck_param(prim, param, name, msg_required, pred):
      if not pred:
          msg = (
              f"invalid {prim} param {name} of type {type(param).__name__}, "
              f"{msg_required} required:"
          )
          param_str = str(param)
          # Avoid using os.linesep here to have the same multi-line error message
          # format on different platforms.
          sep = (
              os.linesep
              if "\n" in param_str or "\r" in param_str
              else " "
          )
          msg = sep.join([msg, param_str])
          raise core.JaxprTypeError(msg)
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import os
  from functools import partial
  from typing import Any, Callable
  from jax._src import core
  from jax._src import linear_util
  from jax._src.lax import lax
  from jax._src import effects
  from jax._src import ad_util
  from jax._src import state
  from jax._src import util
  from jax._src.util import cache, weakref_lru_cache, safe_map, unzip3, partition_list
  from jax.api_util import flatten_fun_nokwargs
  from jax._src.interpreters import partial_eval
  from jax.tree_util import tree_map, tree_unflatten
label_desc: Use image node_id 2 for calling a global function with example usage: _typecheck_param(prim, param, name, msg_required, pred) without return types