code: def test_fetch_tensor_corner_data(setup):
      print_options = np.get_printoptions()
  
      # make sure numpy default option
      assert print_options["edgeitems"] == 3
      assert print_options["threshold"] == 1000
  
      size = 12
      for i in (2, 4, size - 3, size, size + 3):
          arr = np.random.rand(i, i, i)
          t = mt.tensor(arr, chunk_size=size // 2)
          t.execute()
  
          corner_data = fetch_corner_data(t)
          corner_threshold = (
              1000 if t.size < 1000 else corner_data.size - 1
          )
          with np.printoptions(
              threshold=corner_threshold, suppress=True
          ):
              # when we repr corner data, we need to limit threshold that
              # it's exactly less than the size
              repr_corner_data = repr(corner_data)
          with np.printoptions(suppress=True):
              repr_result = repr(arr)
          assert repr_corner_data == repr_result
  
file_path: mars/mars/tensor/tests/test_utils.py
imports: import numpy
  import pytest
  from ...None import tensor
  from ...lib.mmh3 import hash_from_buffer
  from ..utils import hash_on_axis, normalize_axis_tuple, fetch_corner_data
label_desc: Use image node_id 3 for calling a global function with example usage: test_fetch_tensor_corner_data(setup) without return types