code: def test_einsum_fixed_collapsingbug(self):
      # Issue #5147.
      # The bug only occurred when output argument of einssum was used.
      x = np.random.normal(0, 1, (5, 5, 5, 5))
      y1 = np.zeros((5, 5))
      np.einsum("aabb->ab", x, out=y1)
      idx = np.arange(5)
      y2 = x[idx[:, None], idx[:, None], idx, idx]
      assert_equal(y1, y2)
  
imports: import itertools
  import sys
  import platform
  import pytest
  import numpy
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_raises, suppress_warnings, assert_raises_regex, assert_allclose
label_desc: Use image node_id 26 for calling the TestEinsum obj's underlying member method code with example usage: obj.test_einsum_fixed_collapsingbug() without return types