class_docstr: Test getting and setting global print options.
class_docstr_tok: ["Test","getting","and","setting","global","print","options","."]
code: def test_edgeitems(self):
      np.set_printoptions(edgeitems=1, threshold=1)
      a = np.arange(27).reshape((3, 3, 3))
      assert_equal(
          repr(a),
          textwrap.dedent(
              """\
              array([[[ 0, ...,  2],
                      ...,
                      [ 6, ...,  8]],
  
                     ...,
  
                     [[18, ..., 20],
                      ...,
                      [24, ..., 26]]])"""
          ),
      )
  
      b = np.zeros((3, 3, 1, 1))
      assert_equal(
          repr(b),
          textwrap.dedent(
              """\
              array([[[[0.]],
  
                      ...,
  
                      [[0.]]],
  
  
                     ...,
  
  
                     [[[0.]],
  
                      ...,
  
                      [[0.]]]])"""
          ),
      )
  
      # 1.13 had extra trailing spaces, and was missing newlines
      np.set_printoptions(legacy="1.13")
  
      assert_equal(
          repr(a),
          textwrap.dedent(
              """\
              array([[[ 0, ...,  2],
                      ..., 
                      [ 6, ...,  8]],
  
                     ..., 
                     [[18, ..., 20],
                      ..., 
                      [24, ..., 26]]])"""
          ),
      )
  
      assert_equal(
          repr(b),
          textwrap.dedent(
              """\
              array([[[[ 0.]],
  
                      ..., 
                      [[ 0.]]],
  
  
                     ..., 
                     [[[ 0.]],
  
                      ..., 
                      [[ 0.]]]])"""
          ),
      )
  
imports: import sys
  import gc
  from hypothesis import given
  from hypothesis.extra import numpy
  import pytest
  import numpy
  from numpy.testing import assert_, assert_equal, assert_raises, assert_warns, HAS_REFCOUNT, assert_raises_regex
  from numpy.core.arrayprint import _typelessdata
  import textwrap
label_desc: Use image node_id 20 for calling the TestPrintOptions obj's underlying member method code with example usage: obj.test_edgeitems() without return types