def wait_for_status_change(self, parameters, conn, state_requested, \
                              max_wait_time=60,poll_interval=10):
    time_start = time.time()
    instance_ids = parameters[self.PARAM_INSTANCE_IDS]
    instances_in_state = {}
    while True:
      time.sleep(poll_interval)
      reservations = conn.get_all_instances(instance_ids)
      instances = [i for r in reservations for i in r.instances]
      for i in instances:
        # instance i.id reports status = i.state
        if i.state == state_requested and \
           i.key_name == parameters[self.PARAM_KEYNAME]:
          if i.id not in instances_in_state.keys():
            instances_in_state[i.id] = 1 # mark instance done
      if len(instances_in_state.keys()) >= len(instance_ids):
        return True
      if time.time() - time_start > max_wait_time:
        return False
Convert a dict to a SimpleNamespace. If you feed in {'key':'val'},
dataset/ETHPy150Open AppScale/appscale-tools/lib/agents/ec2_agent.py/EC2Agent.wait_for_status_change--crossover with--dataset/ETHPy150Open erkyrath/tworld/lib/twcommon/wcproto.py/namespace_wrapper