<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def batch_query_event_records( self, batch_size: int, filters: List[Tuple[str, Any]] = None, logical_and: bool = True, ) -> Iterator[List[EventRecord]]: """Batch query event records with a given batch size and an optional filter This is a generator function returning each batch to the caller to work with. """

        limit = batch_size
        offset = 0
        result_length = 1

        while result_length != 0:
            result = self._get_event_records(
                limit=limit,
                offset=offset,
                filters=filters,
                logical_and=logical_and,
            )
            result_length = len(result)
            offset += result_length
            yield result