def get_apns_conn(self):
        if not self.apnsconnections.has_key(self.app['shortname']):
            self.send_response(INTERNAL_SERVER_ERROR, dict(error="APNs is offline"))
            return
        count = len(self.apnsconnections[self.app['shortname']])
        # Find an APNS instance
        random.seed(time.time())
        instanceid = random.randint(0, count - 1)
        return self.apnsconnections[self.app['shortname']][instanceid]
dataset/ETHPy150Open airnotifier/airnotifier/api/push.py/PushHandler.get_apns_conn/original