code: def test_kinetic_energy():
      m, M, l1 = symbols("m M l1")
      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))
      raises(TypeError, lambda: kinetic_energy(Pa, Pa, A))
      raises(TypeError, lambda: kinetic_energy(N, N, A))
      assert (
          0
          == (
              kinetic_energy(N, Pa, A)
              - (
                  M * l1**2 * omega**2 / 2
                  + 2 * l1**2 * m * omega**2
                  + omega**2 / 2
              )
          ).expand()
      )
  
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 3 for calling a global function with example usage: test_kinetic_energy() without return types