@staticmethod
def strip_Nones(x):
    """
        Takes a 1D or 2D list, or a 1D or 2D numpy array.
        If x is 1D, when None is encountered, we return everything
        encountered before None.
        If x is 2D, we replace None with -1 and return.

        Parameters
        ----------
        x: list or numpy array

        Returns
        -------
        list
        """
    accum = []
    for val in x:
        if val is None:
            return accum
        if not isinstance(val, list):
            accum.append(val)
        else:
            for i, v in enumerate(val):
                if v is None:
                    val[i] = -1
            accum.append(val)
    return accum
