code: def test_op_priority():
      from sympy.abc import x
  
      md = ImmutableDenseNDimArray([1, 2, 3])
      e1 = (1 + x) * md
      e2 = md * (1 + x)
      assert e1 == ImmutableDenseNDimArray(
          [1 + x, 2 + 2 * x, 3 + 3 * x]
      )
      assert e1 == e2
  
      sd = ImmutableSparseNDimArray([1, 2, 3])
      e3 = (1 + x) * sd
      e4 = sd * (1 + x)
      assert e3 == ImmutableDenseNDimArray(
          [1 + x, 2 + 2 * x, 3 + 3 * x]
      )
      assert e3 == e4
  
imports: from copy import copy
  from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray
  from sympy.core.containers import Dict
  from sympy.core.function import diff
  from sympy.core.numbers import Rational
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.matrices import SparseMatrix
  from sympy.tensor.indexed import Indexed, IndexedBase
  from sympy.matrices import Matrix
  from sympy.tensor.array.sparse_ndim_array import ImmutableSparseNDimArray
  from sympy.testing.pytest import raises
label_desc: Use image node_id 15 for calling a global function with example usage: test_op_priority() without return types