def METHOD_NAME(q, qd, qdd):
    qdd_full = np.zeros(robot.GetDOF())
    active_dofs = robot.GetActiveDOFIndices()
    with robot:
        # Temporary remove vel/acc constraints
        vlim = robot.GetDOFVelocityLimits()
        alim = robot.GetDOFAccelerationLimits()
        robot.SetDOFVelocityLimits(100 * vlim)
        robot.SetDOFAccelerationLimits(100 * alim)
        # Inverse dynamics
        qdd_full[active_dofs] = qdd
        robot.SetActiveDOFValues(q)
        robot.SetActiveDOFVelocities(qd)
        res = robot.ComputeInverseDynamics(qdd_full)
        # Restore vel/acc constraints
        robot.SetDOFVelocityLimits(vlim)
        robot.SetDOFAccelerationLimits(alim)
    return res[active_dofs]