code: def _named_in_axes(fun, in_axes, args):
      if isinstance(in_axes, dict):
          in_axes = dict(in_axes)
          new_in_axes = []
          default = if_array(0)
          params = inspect.signature(fun).parameters
          # We may have that len(args) < len(params) due to default arguments.
          # Truncate to considering just the argments that have been passed.
          #
          # (If len(args) > len(params) then we'll get the usual error later when
          # attempting to call with the wrong number of arguments.)
          for _, param_name in zip(args, params):
              new_in_axes.append(in_axes.pop(param_name, default))
          if len(in_axes) != 0:
              raise ValueError(
                  "The following `in_axes` did not correspond to any argument: "
                  f"{tuple(in_axes.keys())}"
              )
          # Note that this requires all named arguments to be passed; they cannot take
          # default values. That is, we deliberately don't allow something like
          # ```python
          # @eqx.filter_vmap(in_axes=dict(foo=0))
          # def fn(foo=default_value):
          #     ...
          #
          # fn()
          # ```
          # This is because it is ambiguous whether the default value is vectorised or
          # not.
          in_axes = tuple(new_in_axes)
      return in_axes
  
imports: import dataclasses
  import functools
  import inspect
  import warnings
  from collections.abc import Callable, Hashable
  from typing import Any, Literal, Optional, overload, Union
  import jax
  import jax._src.traceback_util
  import jax.core
  import jax.interpreters.batching
  import jax.interpreters.pxla
  import jax.numpy
  import jax.tree_util
  import numpy
  from jaxtyping import PyTree
  from ._compile_utils import compile_cache, hashable_combine, hashable_partition, Lowered
  from ._custom_types import sentinel
  from ._deprecate import deprecated_0_10
  from ._doc_utils import doc_remove_args
  from ._filters import combine, filter, is_array, is_array_like, partition
  from ._module import Module, module_update_wrapper, Partial, Static
label_desc: Use image node_id 6 for calling a global function with example usage: _named_in_axes(fun, in_axes, args) and returns: in_axes