def METHOD_NAME(A):
    """Convert SparseMatrix to scipy.csr_matrix.
    Compressed Sparse Row matrix, i.e., Compressed Row Storage (CRS)
    Parameters
    ----------
    A: pg.matrix.SparseMapMatrix | pg.matrix.SparseMatrix
        Matrix to convert from.
    Returns
    -------
    mat: scipy.csr_matrix
        Matrix to convert into.
    """
    #optImport(scipy.sparse, requiredFor="toCRS_matrix")
    from scipy.sparse import csr_matrix
    if isinstance(A, pg.matrix.CSparseMapMatrix):
        C = pg.matrix.CSparseMatrix(A)
        return csr_matrix((C.vecVals().array(),
                           C.vecRowIdx(),
                           C.vecColPtr()), dtype=complex)
    if isinstance(A, pg.matrix.SparseMapMatrix):
        C = pg.matrix.SparseMatrix(A)
        return csr_matrix((C.vecVals().array(),
                           C.vecRowIdx(),
                           C.vecColPtr()))
    elif isinstance(A, pg.matrix.SparseMatrix):
        return csr_matrix((A.vecVals().array(),
                           A.vecRowIdx(),
                           A.vecColPtr()))
    elif isinstance(A, pg.matrix.CSparseMatrix):
        csr = csr_matrix((A.vecVals().array(),
                           A.vecRowIdx(),
                           A.vecColPtr()), dtype=complex)
        return csr
    elif isinstance(A, pg.matrix.BlockMatrix):
        M = A.sparseMapMatrix()
        return METHOD_NAME(M)
    return csr_matrix(A)