code: def clustdealer(pairdealer, optim):
      
      ccnt = 0
      chunk = []
      while ccnt < optim:
          ## try refreshing taker, else quit
          try:
              taker = itertools.takewhile(lambda x: x[0] != "//\n", pairdealer)
              oneclust = ["".join(taker.next())]
          except StopIteration:
              #LOGGER.debug('last chunk %s', chunk)
              return 1, chunk
  
          ## load one cluster
          while 1:
              try:
                  oneclust.append("".join(taker.next()))
              except StopIteration:
                  break
          chunk.append("".join(oneclust))
          ccnt += 1
      return 0, chunk
docs: return optim clusters given iterators, and whether it got all or not