code: def tree_all(
      pred: Callable[[Any], bool],
      tree: PyTree,
      is_leaf: Optional[Callable[[PyTree], bool]] = None,
  ) -> bool:
      flat_args = tree_leaves(tree, is_leaf=is_leaf)
      return all(map(pred, flat_args))
  
imports: import functools
  import warnings
  from typing import Any, Callable, Iterable, List, Optional, overload, Tuple, Type, TypeVar, Union
  import torch
  import optree
  from optree import PyTreeSpec
label_desc: Use image node_id 24 for calling a global function with example usage: tree_all(pred, tree, is_leaf) and returns: all