code: def hashable_filter(pytree: PyTree, filter_fn: Callable):
      leaves = jtu.tree_leaves(pytree)
      dynamic_leaves = tuple(
          x if filter_fn(x) else None for x in leaves
      )
      return dynamic_leaves
  
imports: import functools
  import types
  import warnings
  import weakref
  from collections.abc import Callable
  import jax
  import jax.tree_util
  from jaxtyping import PyTree
  from ._caches import internal_caches
  from ._module import Module
label_desc: Use image node_id 1 for calling a global function with example usage: hashable_filter(pytree, filter_fn) and returns: dynamic_leaves