code: def _is_contiguous_view(
      curr: np.ndarray, prev: Optional[np.ndarray]
  ) -> bool:
      """Check if the provided tensor element is contiguous with the previous tensor
      element.
  
      Args:
          curr: The tensor element whose contiguity that we wish to check.
          prev: The previous tensor element in the tensor array.
  
      Returns:
          Whether the provided tensor element is contiguous with the previous tensor
          element.
      """
      if (
          curr.base is None
          or not curr.data.c_contiguous
          or (prev is not None and curr.base is not prev.base)
      ):
          # curr is either:
          # - not a view,
          # - not in C-contiguous order,
          # - a view that does not share its base with the other subndarrays.
          return False
      else:
          # curr is a C-contiguous view that shares the same base with the seen
          # subndarrays, but we need to confirm that it is contiguous with the
          # previous subndarray.
          if prev is not None and (
              _get_buffer_address(curr) - _get_buffer_address(prev)
              != prev.base.dtype.itemsize * prev.size
          ):
              # This view is not contiguous with the previous view.
              return False
          else:
              return True
  
imports: import itertools
  import json
  import sys
  from typing import Iterable, Optional, Tuple, List, Sequence, Union
  from packaging.version import parse
  import numpy
  import pyarrow
  from ray.air.util.tensor_extensions.utils import _is_ndarray_variable_shaped_tensor, create_ragged_ndarray
  from ray._private.utils import _get_pyarrow_version
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 3 for calling a global function with example usage: _is_contiguous_view(curr, prev) and returns: False, False, True