code: def test_smith_normal():
      m = Matrix(
          [
              [12, 6, 4, 8],
              [3, 9, 6, 12],
              [2, 16, 14, 28],
              [20, 10, 10, 20],
          ]
      )
      smf = Matrix(
          [[1, 0, 0, 0], [0, 10, 0, 0], [0, 0, -30, 0], [0, 0, 0, 0]]
      )
      assert smith_normal_form(m) == smf
  
      x = Symbol("x")
      with warns_deprecated_sympy():
          m = Matrix(
              [
                  [Poly(x - 1), Poly(1, x), Poly(-1, x)],
                  [0, Poly(x), Poly(-1, x)],
                  [Poly(0, x), Poly(-1, x), Poly(x)],
              ]
          )
      invs = 1, x - 1, x**2 - 1
      assert invariant_factors(m, domain=QQ[x]) == invs
  
      m = Matrix([[2, 4]])
      smf = Matrix([[2, 0]])
      assert smith_normal_form(m) == smf
  
file_path: sympy/sympy/matrices/tests/test_normalforms.py
imports: from sympy.testing.pytest import warns_deprecated_sympy
  from sympy.core.symbol import Symbol
  from sympy.polys.polytools import Poly
  from sympy.matrices import Matrix
  from sympy.matrices.normalforms import invariant_factors, smith_normal_form, hermite_normal_form
  from sympy.polys.domains import ZZ, QQ
  from sympy.core.numbers import Integer
label_desc: Use image node_id 1 for calling a global function with example usage: test_smith_normal() without return types