

def _queryCallback(self, data):
    LOGGER.info(('Fetched %s jobs.' % len(data)))
    self.querying_for_jobs = False
    self.last_job_query_count = len(data)
    for uuid in data:
        if ((uuid in self.active_jobs) or (uuid in self.queued_jobs)):
            continue
        kwargs_raw = {
            
        }
        reserved_arguments = {
            
        }
        for key in data[uuid]:
            if (key in self.reserved_arguments):
                reserved_arguments[key] = data[uuid][key][0]
            else:
                kwargs_raw[key] = data[uuid][key][0]
        if ('reservation_function_name' not in reserved_arguments):
            LOGGER.error(('Reservation %s does not have a function name.' % uuid))
            self.deleteReservation(uuid)
            continue
        function_name = reserved_arguments['reservation_function_name']
        if (function_name not in self.functions):
            LOGGER.error(('Unable to process function %s for UUID: %s' % (function_name, uuid)))
            continue
        if ('reservation_created' not in reserved_arguments):
            LOGGER.error(('Reservation %s, %s does not have a created time.' % (function_name, uuid)))
            self.deleteReservation(uuid, function_name=function_name)
            continue
        if ('reservation_next_request' not in reserved_arguments):
            LOGGER.error(('Reservation %s, %s does not have a next request time.' % (function_name, uuid)))
            self.deleteReservation(uuid, function_name=function_name)
            continue
        if ('reservation_error' not in reserved_arguments):
            LOGGER.error(('Reservation %s, %s does not have an error flag.' % (function_name, uuid)))
            self.deleteReservation(uuid, function_name=function_name)
            continue
        if (function_name in self.functions):
            exposed_function = self.functions[function_name]
        else:
            LOGGER.error(('Could not find function %s.' % function_name))
            continue
        kwargs = {
            
        }
        for key in kwargs_raw:
            if (key in exposed_function['required_arguments']):
                kwargs[key] = kwargs_raw[key]
            if (key in exposed_function['optional_arguments']):
                kwargs[key] = kwargs_raw[key]
        has_required_arguments = True
        for key in exposed_function['required_arguments']:
            if (key not in kwargs):
                has_required_arguments = False
                LOGGER.error(('%s, %s does not have required argument %s.' % (function_name, uuid, key)))
        if (not has_required_arguments):
            continue
        self.queued_jobs[uuid] = True
        job = {
            'exposed_function': exposed_function,
            'kwargs': kwargs,
            'function_name': function_name,
            'uuid': uuid,
        }
        if ('reservation_cache' in reserved_arguments):
            LOGGER.debug(('Using reservation fast cache for %s, %s on on SimpleDB.' % (function_name, uuid)))
            job['reservation_cache'] = reserved_arguments['reservation_cache']
        else:
            job['reservation_cache'] = None
        self.job_queue.append(job)
    self.job_count = 0
    self.query_start_time = time.time()
    self.executeJobs()

dataset/ETHPy150Open wehriam/awspider/awspider/servers/execution.py ExecutionServer._queryCallback/original