<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def all(A, ax=None):
 """Test if all values in A evaluate to True """

    if isinstance(A, Poly):
        out = numpy.zeros(A.shape, dtype=bool)
        B = A.A
        for key in A.keys:
            out += all(B[key], ax)
        return out

    return numpy.all(A, ax)