def row_split(A, *indices):
    """
    returns a list of rows corresponding to the passed indices
    """
    if not indices:
        indices = list(range(A.shape[0]))
    res = [ A[i, :] for i in indices ]
    return res