code: def test_imap_max_outstanding(self):
      view = self.view
  
      source = count()
  
      def task(i):
          import time
  
          time.sleep(0.1)
          return i
  
      gen = view.imap(task, source, max_outstanding=5)
      # should submit at least max_outstanding
      first_result = next(gen)
      assert len(view.history) >= 5
      # retrieving results should submit another task
      second_result = next(gen)
      assert 5 <= len(view.history) <= 10
      self.client.wait(timeout=self.timeout)
  
imports: import time
  from itertools import count
  import pytest
  import ipyparallel
  from ipyparallel import error
  from .clienttest import ClusterTestCase, crash, raises_remote
label_desc: Use image node_id 10 for calling the TestLoadBalancedView obj's underlying member method code with example usage: obj.test_imap_max_outstanding() and returns: i