def METHOD_NAME(q):
    """Converts a quaternion into a canonic form if needed.
    Parameters
    ----------
    q : [float, float, float, float] | :class:`~compas.geometry.Quaternion`
        Quaternion or sequence of four floats ``[w, x, y, z]``.
    Returns
    -------
    [float, float, float, float]
        Quaternion in a canonic form as a list of four real values ``[cw, cx, cy, cz]``.
    Notes
    -----
    Canonic form means the scalar component is a non-negative number.
    """
    if q[0] < 0.0:
        return [-x for x in q]
    return q[:]