def METHOD_NAME(data):
    try:
        from pandas import DataFrame
        if isinstance(data, DataFrame):
            return np.ascontiguousarray(data.values)
    except Exception:
        try:
            from scipy.sparse import csr_matrix
            if isinstance(data, csr_matrix):
                return data.toarray()
        except Exception:
            return data
    return data