code: def cast_to_tuple_array(arr):
      """Cast an array to a nested tuple.
  
      Parameters
      ----------
      arr : array_like
          Array to cast.
  
      Returns
      -------
      tuple
          Tuple or nested tuple array.
      """
      arr = cast_to_ndarray(arr).tolist()
  
      def _to_tuple(s):
          return (
              tuple(_to_tuple(i) for i in s)
              if isinstance(s, list)
              else s
          )
  
      return _to_tuple(arr)
  
imports: import collections.abc
  import enum
  from itertools import product
  from typing import Optional, Tuple, Union
  import numpy
  import pyvista
  from pyvista.core import _vtk_core
  from pyvista.core._typing_core import Matrix, NumpyArray, TransformLike, Vector
  from pyvista.core.errors import AmbiguousDataError, MissingDataError
label_desc: Use image node_id 25 for calling a global function with example usage: cast_to_tuple_array(arr) and returns: _to_tuple, unknown