def METHOD_NAME(angles):
    """
    Normalizes angle(s) to the interval (-pi, pi]
    :param angles: (np.ndarray) Angle(s) to be normalized.
    :return: (np.ndarray) Angles normalized to (-pi, pi] interval
    """
    # Get the angles modulo 2pi. Angles are now in [0, 2pi] range
    tmp_angles = angles % (2 * np.pi)
    # Make angles greater than pi negative to be in (-pi, pi] range
    tmp_angles[tmp_angles > np.pi] -= 2 * np.pi
    return tmp_angles