def tuple_count(self, stream, count, exact=True):
_logger.debug("<STR_LIT>", count, stream)<EOL>name = stream.name + '<STR_LIT>'<EOL>if exact:<EOL><INDENT>cond = sttrt._TupleExactCount(count, name)<EOL>cond._desc = "<STR_LIT>".format(stream.name, count)<EOL><DEDENT>else:<EOL><INDENT>cond = sttrt._TupleAtLeastCount(count, name)<EOL>cond._desc = "<STR_LIT>".format(stream.name, count)<EOL><DEDENT>return self.add_condition(stream, cond)<EOL>
Test that a stream contains a number of tuples.

        If `exact` is `True`, then condition becomes valid when `count`
        tuples are seen on `stream` during the test. Subsequently if additional
        tuples are seen on `stream` then the condition fails and can never
        become valid.

        If `exact` is `False`, then the condition becomes valid once `count`
        tuples are seen on `stream` and remains valid regardless of
        any additional tuples.

        Args:
            stream(Stream): Stream to be tested.
            count(int): Number of tuples expected.
            exact(bool): `True` if the stream must contain exactly `count`
                tuples, `False` if the stream must contain at least `count` tuples.

        Returns:
            Stream: stream