code: def all_terminated():
      
      instances_found = False
      for i in all_instances():
          instances_found = True
          if i.state not in (remote_dispatcher.STATE_TERMINATED,
                             remote_dispatcher.STATE_DEAD):
              return False
      return instances_found
docs: For each remote shell determine if its terminated