code: def check_spot_requests(self, requests, tags=None):
          
          instances = [None] * len(requests)
          ec2_requests = self.retry_on_ec2_error(self.ec2.get_all_spot_instance_requests, request_ids=requests)
  
          for req in ec2_requests:
              if req.instance_id:
                  instance = self.retry_on_ec2_error(self.ec2.get_only_instances, req.instance_id)[0]
  
                  if not instance:
                      raise EC2ManagerException('Failed to get instance with id %s for %s request %s'
                                                % (req.instance_id, req.status.code, req.id))
  
                  instances[requests.index(req.id)] = instance
  
                  self.retry_on_ec2_error(self.ec2.create_tags, [instance.id], tags or {})
                  logger.info('Request %s is %s and %s.',
                              req.id,
                              req.status.code,
                              req.state)
                  logger.info('%s is %s at %s (%s)',
                              instance.id,
                              instance.state,
                              instance.public_dns_name,
                              instance.ip_address)
              elif req.state != "open":
                  # return the request so we don't try again
                  instances[requests.index(req.id)] = req
  
          return instances
docs: Check status of one or more EC2 spot instance requests.
  
          :param requests: List of EC2 spot instance request IDs.
          :type requests: list
          :param tags:
          :type tags: dict
          :return: List of boto.ec2.instance.Instance's created, order corresponding to requests param (None if request
                   still open, boto.ec2.instance.Reservation if request is no longer open)
          :rtype: list