code: def test_subArray():
      a = np.array(
          [
              0,
              0,
              111,
              112,
              113,
              0,
              121,
              122,
              123,
              0,
              0,
              0,
              211,
              212,
              213,
              0,
              221,
              222,
              223,
              0,
              0,
              0,
              0,
          ]
      )
      b = pg.subArray(a, offset=2, shape=(2, 2, 3), stride=(10, 4, 1))
      c = np.array(
          [
              [[111, 112, 113], [121, 122, 123]],
              [[211, 212, 213], [221, 222, 223]],
          ]
      )
      assert np.all(b == c)
  
      # operate over first axis; broadcast over the rest
      aa = np.vstack([a, a / 100.0]).T
      cc = np.empty(c.shape + (2,))
      cc[..., 0] = c
      cc[..., 1] = c / 100.0
      bb = pg.subArray(aa, offset=2, shape=(2, 2, 3), stride=(10, 4, 1))
      assert np.all(bb == cc)
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  import pyqtgraph
  from pyqtgraph.functions import arrayToQPath, eq
  from pyqtgraph.Qt import QtGui
label_desc: Use image node_id 5 for calling a global function with example usage: test_subArray() without return types