code: def default_deserialise_filter_spec(f: BinaryIO, x: Any) -> Any:
      """Default filter specification for deserialising saved data.
  
      **Arguments**
  
      -   `f`: file-like object
      -   `x`: The leaf for which the data needs to be loaded.
  
      **Returns**
  
      The new value for datatype `x`.
  
      !!! info
  
          This function can be extended to customise the deserialisation behaviour for
          leaves.
  
      !!! example
  
          Skipping loading of jax.Array.
  
          ```python
          import jax.numpy as jnp
          import equinox as eqx
  
          tree = (jnp.array([4,5,6]), [1,2,3])
          new_filter_spec = lambda f,x: (
              x if isinstance(x, jax.Array) else eqx.default_deserialise_filter_spec(f, x)
          )
          new_tree = eqx.tree_deserialise_leaves("some_filename.eqx", tree, filter_spec=new_filter_spec)
          ```
      """  # noqa: E501
      if isinstance(x, (jax.Array, jax.ShapeDtypeStruct)):
          return jnp.load(f)
      elif isinstance(x, np.ndarray):
          # Important to use `np` here to avoid promoting NumPy arrays to JAX.
          return np.load(f)
      elif is_array_like(x):
          # np.generic gets deserialised directly as an array, so convert back to a scalar
          # type here.
          # See also https://github.com/google/jax/issues/17858
          out = np.load(f)
          if isinstance(x, jax.dtypes.bfloat16):
              out = out.view(jax.dtypes.bfloat16)
          return type(x)(out.item())
      else:
          return x
  
imports: import functools
  import pathlib
  from collections.abc import Callable
  from contextlib import contextmanager
  from typing import Any, BinaryIO, Optional, Union
  import jax
  import jax.numpy
  import jax.tree_util
  import numpy
  from jaxtyping import PyTree
  from ._filters import is_array_like
label_desc: Use image node_id 3 for calling a global function with example usage: default_deserialise_filter_spec(f, x) and returns: jnp, np, type, x