code: def tree_pformat(
      pytree: PrettyPrintAble,
      *,
      width: int = 80,
      indent: int = 2,
      short_arrays: bool = True,
      struct_as_array: bool = False,
      follow_wrapped: bool = True,
      truncate_leaf: Callable[[PrettyPrintAble], bool] = _false,
  ) -> str:
      """Pretty-formats a PyTree as a string, whilst abbreviating JAX arrays.
  
      (This is the function used in `__repr__` of [`equinox.Module`][].)
  
      As [`equinox.tree_pprint`][], but returns the string instead of printing it.
      """
  
      return tree_pp(
          pytree,
          indent=indent,
          short_arrays=short_arrays,
          struct_as_array=struct_as_array,
          follow_wrapped=follow_wrapped,
          truncate_leaf=truncate_leaf,
      ).format(width=width)
  
imports: import dataclasses
  import functools
  import sys
  import types
  from collections.abc import Callable, Sequence
  from typing import Any, Optional, Union
  import jax
  import jax._src.pretty_printer
  import jax.tree_util
  import numpy
  from jaxtyping import PyTree
  from ._doc_utils import WithRepr
label_desc: Use image node_id 15 for calling a global function with example usage: tree_pformat(pytree) and returns: tree_pp