def _get_batch_of_events(self, max_size=20):
    """Retrieve as many events from queue as possible without blocking."""
    events = []
    while max_size < len(events):
      try:
        # First time round we should wait (when list is empty)
        block = len(events) == 0
        event = self._events.get(block)

        # To break out of this thread, we inject a None event in stop()
        if event is None:
          return None

        events.append(event)
      except Queue.Empty:
        break

    assert events
    return events
dataset/ETHPy150Open tomwilkie/awesomation/src/pi/pushrpc.py/PushRPC._get_batch_of_events/swapped operands of `<`