original_docstring: A threaded imap that does not produce elements faster than they
      are consumed
docstring: A threaded imap that does not produce elements faster than they
  are consumed
docstring_tokens: A threaded imap that does not produce elements faster than they are consumed
code: def rate_limited_imap(f, l):
      """A threaded imap that does not produce elements faster than they
      are consumed"""
      pool = ThreadPool(1)
      res = None
      for i in l:
          res_next = pool.apply_async(f, (i[0], i[1], ))
          if res:
              yield res.get()
          res = res_next
      yield res.get()
      pool.close()
      pool.join()
code_tokens: def rate_limited_imap ( f , l ) : pool = ThreadPool ( 1 ) res = None for i in l : res_next = pool . apply_async ( f , ( i [ 0 ] , i [ 1 ] , ) ) if res : yield res . get ( ) res = res_next yield res . get ( ) pool . close ( ) pool . join ( )
short_docstring: A threaded imap that does not produce elements faster than they
  are consumed
short_docstring_tokens: A threaded imap that does not produce elements faster than they are consumed
comment: """A threaded imap that does not produce elements faster than they
      are consumed"""