def densify(A: Union[LinearOperator, Array]):
    """ Convert a linear operator to a dense array if it is not already one. """
    if isinstance(A, LinearOperator):
        return A.to_dense()
    else:
        return A
 Convert a linear operator to a dense array if it is not already one. 
cola/fns.py