def quaternion_from_axis_rotation(angle, axis):
out = np.zeros(<NUM_LIT:4>, dtype=float)<EOL>if axis == '<STR_LIT:x>':<EOL><INDENT>out[<NUM_LIT:1>] = <NUM_LIT:1><EOL><DEDENT>elif axis == '<STR_LIT:y>':<EOL><INDENT>out[<NUM_LIT:2>] = <NUM_LIT:1><EOL><DEDENT>elif axis == '<STR_LIT:z>':<EOL><INDENT>out[<NUM_LIT:3>] = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>out *= math.sin(angle/<NUM_LIT>)<EOL>out[<NUM_LIT:0>] = math.cos(angle/<NUM_LIT>)<EOL>return Quaternion(out)<EOL>
Return quaternion for rotation about given axis.

    Args:
        angle (float): Angle in radians.
        axis (str): Axis for rotation

    Returns:
        Quaternion: Quaternion for axis rotation.

    Raises:
        ValueError: Invalid input axis.