def _choose_instance(self, timeout_time):
    with self._condition:
      while time.time() < timeout_time:
        for inst in self._instances:
          if inst.can_accept_requests:
            return inst
        self._condition.wait(timeout_time - time.time())
      return None
Returns an Instance to handle a request or None if all are busy.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/server.py/ManualScalingServer._choose_instance