code: def test_potential_energy():
      m, M, l1, g, h, H = symbols("m M l1 g h H")
      omega = dynamicsymbols("omega")
      N = ReferenceFrame("N")
      O = Point("O")
      O.set_vel(N, 0 * N.x)
      Ac = O.locatenew("Ac", l1 * N.x)
      P = Ac.locatenew("P", l1 * N.x)
      a = ReferenceFrame("a")
      a.set_ang_vel(N, omega * N.z)
      Ac.v2pt_theory(O, N, a)
      P.v2pt_theory(O, N, a)
      Pa = Particle("Pa", P, m)
      I = outer(N.z, N.z)
      A = RigidBody("A", Ac, a, M, (I, Ac))
      Pa.potential_energy = m * g * h
      A.potential_energy = M * g * H
      assert potential_energy(A, Pa) == m * g * h + M * g * H
  
file_path: sympy/sympy/physics/mechanics/tests/test_functions.py
imports: from sympy import sin, cos, tan, pi, symbols, Matrix, S, Function
  from sympy.physics.mechanics import Particle, Point, ReferenceFrame, RigidBody
  from sympy.physics.mechanics import angular_momentum, dynamicsymbols, kinetic_energy, linear_momentum, outer, potential_energy, msubs, find_dynamicsymbols, Lagrangian
  from sympy.physics.mechanics.functions import center_of_mass, _validate_coordinates, _parse_linear_solver
  from sympy.testing.pytest import raises, warns_deprecated_sympy
label_desc: Use image node_id 4 for calling a global function with example usage: test_potential_energy() without return types