code: def test_permanent():
      M = Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
      assert M.per() == 450
      for i in range(1, 12):
          assert ones(i, i).per() == ones(i, i).T.per() == factorial(i)
          assert (
              (ones(i, i) - eye(i)).per()
              == (ones(i, i) - eye(i)).T.per()
              == subfactorial(i)
          )
  
      a1, a2, a3, a4, a5 = symbols("a_1 a_2 a_3 a_4 a_5")
      M = Matrix([a1, a2, a3, a4, a5])
      assert M.per() == M.T.per() == a1 + a2 + a3 + a4 + a5
  
imports: import random
  import pytest
  from sympy.core.numbers import I
  from sympy.core.numbers import Rational
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.polys.polytools import Poly
  from sympy.matrices import Matrix, eye, ones
  from sympy.abc import x, y, z
  from sympy.testing.pytest import raises
  from sympy.matrices.exceptions import NonSquareMatrixError
  from sympy.functions.combinatorial.factorials import factorial, subfactorial
label_desc: Use image node_id 9 for calling a global function with example usage: test_permanent() without return types