@staticmethod
    def _input_to_data(data, normalize):
        # May need to allow other formats as well.
        if not isinstance(data, np.ndarray):
            data = np.asarray(data)
        if normalize in (None, True):
            M = data.max()
            m = data.min()
            if normalize is None: 
                normalize = m < 0. or M > 1.
        if normalize:
            d = M - m
            if d == 0:
                d = 1.
            data = (data - m) / d
        shape = data.shape
        data  = data.reshape(-1)
        return data, shape
Normalize and get shape
dataset/ETHPy150Open yhat/ggplot/ggplot/utils/color.py/Color._input_to_data