def takeSomeFromQueue(self):
    """Use self.queue, which is a collections.deque, to pop up to
    settings.MAX_DATAPOINTS_PER_MESSAGE items from the left of the
    queue.
    """
    def yield_max_datapoints():
      for count in range(settings.MAX_DATAPOINTS_PER_MESSAGE):
        try:
          yield self.queue.popleft()
        except __HOLE__:
          raise StopIteration
    return list(yield_max_datapoints())
dataset/ETHPy150Open graphite-project/carbon/lib/carbon/client.py/CarbonClientFactory.takeSomeFromQueue