<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def polynomial_sign(poly_surface, degree):
 r"""Determine the "sign" of a polynomial on the reference triangle. .. note:: This is used **only** by :meth:`Surface._compute_valid` (which is in turn used to compute / cache the :attr:`Surface.is_valid` property). Checks if a polynomial :math:`p(s, t)` is positive, negative or mixed sign on the reference triangle. Does this by utilizing the B |eacute| zier form of :math:`p`: it is a convex combination of the Bernstein basis (real numbers) hence if the Bernstein basis is all positive, the polynomial must be. If the values are mixed, then we can recursively subdivide until we are in a region where the coefficients are all one sign. Args: poly_surface (numpy.ndarray):
 2D array (with 1 row) of control points for a "surface", i.e. a bivariate polynomial. degree (int):
 The degree of the surface / polynomial given by ``poly_surface``. Returns: int: The sign of the polynomial. Will be one of ``-1``, ``1`` or ``0``. A value of ``0`` indicates a mixed sign or the zero polynomial. Raises: ValueError: If no conclusion is reached after the maximum number of subdivisions. """

    # The indices where the corner nodes in a surface are.
    corner_indices = (0, degree, -1)
    sub_polys = [poly_surface]
    signs = set()
    for _ in six.moves.xrange(_MAX_POLY_SUBDIVISIONS):
        undecided = []
        for poly in sub_polys:
            # First add all the signs of the corner nodes.
            signs.update(_SIGN(poly[0, corner_indices]).astype(int))
            # Then check if the ``poly`` nodes are **uniformly** one sign.
            if np.all(poly == 0.0):
                signs.add(0)
            elif np.all(poly > 0.0):
                signs.add(1)
            elif np.all(poly < 0.0):
                signs.add(-1)
            else:
                undecided.append(poly)
            if len(signs) > 1:
                return 0

        sub_polys = functools.reduce(
            operator.add,
            [subdivide_nodes(poly, degree) for poly in undecided],
            (),
        )
        if not sub_polys:
            break

    if sub_polys:
        raise ValueError(
            "Did not reach a conclusion after max subdivisions",
            _MAX_POLY_SUBDIVISIONS,
        )

    else:
        # NOTE: We are guaranteed that ``len(signs) <= 1``.
        return signs.pop()