code: def _is_np_ndarray(x) -> bool:
      if x is None:
          return False
      return tree_all(
          tree_map(
              lambda y: isinstance(y, (np.ndarray, jnp.ndarray)), x
          )
      )
  
imports: from functools import partial
  from typing import Any, Callable, Iterable, Optional, TypeVar, Union
  import warnings
  import jax
  from jax import device_put
  from jax import devices
  from jax import jit
  from jax import pmap
  from jax import random
  import jax.numpy
  from jax.tree_util import tree_all
  from jax.tree_util import tree_flatten
  from jax.tree_util import tree_map
  from jax.tree_util import tree_unflatten
  import numpy
  from .utils import utils
  from .utils.kernel import Kernel
  from .utils.typing import KernelFn
  from .utils.typing import NTTree
label_desc: Use image node_id 11 for calling a global function with example usage: _is_np_ndarray(x) and returns: tree_all, False