code: def test_angular_momentum_and_linear_momentum():
      """A rod with length 2l, centroidal inertia I, and mass M along with a
      particle of mass m fixed to the end of the rod rotate with an angular rate
      of omega about point O which is fixed to the non-particle end of the rod.
      The rod's reference frame is A and the inertial frame is N."""
      m, M, l, I = symbols("m, M, l, I")
      omega = dynamicsymbols("omega")
      N = ReferenceFrame("N")
      a = ReferenceFrame("a")
      O = Point("O")
      Ac = O.locatenew("Ac", l * N.x)
      P = Ac.locatenew("P", l * N.x)
      O.set_vel(N, 0 * N.x)
      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)
      A = RigidBody("A", Ac, a, M, (I * outer(N.z, N.z), Ac))
      expected = 2 * m * omega * l * N.y + M * l * omega * N.y
      assert linear_momentum(N, A, Pa) == expected
      raises(TypeError, lambda: angular_momentum(N, N, A, Pa))
      raises(TypeError, lambda: angular_momentum(O, O, A, Pa))
      raises(TypeError, lambda: angular_momentum(O, N, O, Pa))
      expected = (I + M * l**2 + 4 * m * l**2) * omega * N.z
      assert angular_momentum(O, N, A, Pa) == expected
  
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 2 for calling a global function with example usage: test_angular_momentum_and_linear_momentum() without return types