def _unit_quat_constraint(x):
    """Constrain our 3 quaternion rot params (ignoring w) to have norm <= 1"""
    return 1 - (x * x).sum()
dataset/ETHPy150Open mne-tools/mne-python/mne/chpi.py/_unit_quat_constraint/original