code: def default_serialise_filter_spec(f: BinaryIO, x: Any) -> None:
      """Default filter specification for serialising a leaf.
  
      **Arguments**
  
      -   `f`: file-like object
      -   `x`: The leaf to be saved on the disk.
  
      **Returns**
  
      Nothing.
  
      !!! info
  
          This function can be extended to customise the serialisation behaviour for
          leaves.
  
      !!! example
  
          Skipping saving of jax.Array.
  
          ```python
          import jax.numpy as jnp
          import equinox as eqx
  
          tree = (jnp.array([1,2,3]), [4,5,6])
          new_filter_spec = lambda f,x: (
              None if isinstance(x, jax.Array) else eqx.default_serialise_filter_spec(f, x)
          )
          eqx.tree_serialise_leaves("some_filename.eqx", tree, filter_spec=new_filter_spec)
          ```
      """  # noqa: E501
      if isinstance(x, jax.Array):
          jnp.save(f, x)
      elif isinstance(x, np.ndarray):
          # Important to use `np` here so that we don't cast NumPy arrays to JAX arrays.
          np.save(f, x)
      elif is_array_like(x):
          # Important to use `jnp` here to handle `bfloat16`.
          jnp.save(f, x)
      else:
          pass
  
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 2 for calling a global function with example usage: default_serialise_filter_spec(f, x) without return types