Given a a list of functions and a schedule to execute them,
        setup up regular execution.
188065
def schedule(self):
        
        events = self.stage_config.get('events', [])

        if events:
            if not isinstance(events, list): # pragma: no cover
                print("Events must be supplied as a list.")
                return

        for event in events:
            self.collision_warning(event.get('function'))

        if self.stage_config.get('keep_warm', True):
            if not events:
                events = []

            keep_warm_rate = self.stage_config.get('keep_warm_expression', "rate(4 minutes)")
            events.append({'name': 'zappa-keep-warm',
                           'function': 'handler.keep_warm_callback',
                           'expression': keep_warm_rate,
                           'description': 'Zappa Keep Warm - {}'.format(self.lambda_name)})

        if events:
            try:
                function_response = self.zappa.lambda_client.get_function(FunctionName=self.lambda_name)
            except botocore.exceptions.ClientError as e: # pragma: no cover
                click.echo(click.style("Function does not exist", fg="yellow") + ", please " +
                           click.style("deploy", bold=True) + "first. Ex:" +
                           click.style("zappa deploy {}.".format(self.api_stage), bold=True))
                sys.exit(-1)

            print("Scheduling..")
            self.zappa.schedule_events(
                lambda_arn=function_response['Configuration']['FunctionArn'],
                lambda_name=self.lambda_name,
                events=events
            )

        # Add async tasks SNS
        if self.stage_config.get('async_source', None) == 'sns' \
           and self.stage_config.get('async_resources', True):
            self.lambda_arn = self.zappa.get_lambda_function(
                function_name=self.lambda_name)
            topic_arn = self.zappa.create_async_sns_topic(
                lambda_name=self.lambda_name,
                lambda_arn=self.lambda_arn
            )
            click.echo('SNS Topic created: %s' % topic_arn)

        # Add async tasks DynamoDB
        table_name = self.stage_config.get('async_response_table', False)
        read_capacity = self.stage_config.get('async_response_table_read_capacity', 1)
        write_capacity = self.stage_config.get('async_response_table_write_capacity', 1)
        if table_name and self.stage_config.get('async_resources', True):
            created, response_table = self.zappa.create_async_dynamodb_table(
                table_name, read_capacity, write_capacity)
            if created:
                click.echo('DynamoDB table created: %s' % table_name)
            else:
                click.echo('DynamoDB table exists: %s' % table_name)
                provisioned_throughput = response_table['Table']['ProvisionedThroughput']
                if provisioned_throughput['ReadCapacityUnits'] != read_capacity or \
                    provisioned_throughput['WriteCapacityUnits'] != write_capacity:
                        click.echo(click.style(
                            "\nWarning! Existing DynamoDB table ({}) does not match configured capacity.\n".format(table_name),
                            fg='red'
                        ))
645004
def run(self):
        """"""
        self.api = self.context.get("cls")(self.context)
        self.context["inst"].append(self)  # Adapters used by strategies

        for call, calldata in self.context.get("calls", {}).items():
            def loop():
                """Loop on event scheduler, calling calls"""
                while not self.stopped.wait(calldata.get("delay", None)):
                    self.call(call, calldata.get("arguments", None))

            self.thread[call] = Process(target=loop)
            self.thread[call].start()
699640
def execute(self):
        
        func_params = []
        exec_str = self.func.__name__ + '(' 
        for p in self.params:
            if p[0][0:2] != '__':   # ignore custom param names
                exec_str += p[0] + '="' + self._force_str(p[1]) + '", '
                func_params.append(p[1])
        exec_str = exec_str[:-2]
        exec_str += ')  # task' + str(self.task_id) + ': ' + self.name
        
        
        self.result = self.func(*func_params)
        print(exec_str + ' loaded ', self.result)
560185
function execute(req, res) {
  ScriptManager.eval(req, res, '' + req.args[0], req.args.slice(1));
}
90092
def _schedule(self):
        ''''''
        if self._running:
            _logger.debug('')
            self._call_later_handle = self._event_loop.call_later(
                self._timeout, self._check)
668620
function schedule(fn) {
		// Add or replace.
		nextBatch[ tag(fn) ] = fn;
		// Request only if needed.
		if (!pendingFrame) {
			pendingFrame = true;
			requestAnimationFrame(frame);
		}
	}
288690
def _initialize_cfg(self):
        

        self.kb.functions = FunctionManager(self.kb)

        self._jobs_to_analyze_per_function = defaultdict(set)
        self._completed_functions = set()
243380
def run(self, **kwargs):
        
        if not super().run(**kwargs):
            return

        if kwargs['list']:
            self.log.info('--- List of Scheduler Modules ---')
            for name, scheduler in list(self.scheduler_plugins.items()):
                if self.active_scheduler == name:
                    self.log.info('{} (active)'.format(name))
                else:
                    self.log.info(name)
            self.log.info('--- End list of Scheduler Modules ---')
            return

        scheduler = self.scheduler_plugins[self.active_scheduler]()
        scheduler.execute_scheduler()
621180
function genScheduler (initQueueSize, fn) {
        /**
         * All async promise will be scheduled in
         * here, so that they can be execute on the next tick.
         * @private
         */
        var fnQueue = Arr(initQueueSize)
            , fnQueueLen = 0;

        /**
         * Run all queued functions.
         * @private
         */
        function flush () {
            var i = 0;
            while (i < fnQueueLen) {
                fn(fnQueue[i], fnQueue[i + 1]);
                fnQueue[i++] = $undefined;
                fnQueue[i++] = $undefined;
            }

            fnQueueLen = 0;
            if (fnQueue.length > initQueueSize) fnQueue.length = initQueueSize;
        }

        return function (v, arg) {
            fnQueue[fnQueueLen++] = v;
            fnQueue[fnQueueLen++] = arg;

            if (fnQueueLen === 2) nextTick(flush);
        };
    }
1172431
def execute_schedule(day, sched, popt, initial_temperature):
    
    output = []
    actions = []
    prev_temp = initial_temperature
    weather = predict_weather(day)
    print len(sched), len(weather)
    for idx, epoch in enumerate(sched):
        if prev_temp < epoch[0]: # hsp
            next_temp = next_temperature(popt, prev_temp, 1, weather[idx]) # 1 is heat
            actions.append(1)
        elif prev_temp > epoch[1]: # csp
            next_temp = next_temperature(popt, prev_temp, 2, weather[idx]) # 2 is cool
            actions.append(2)
        else:
            next_temp = next_temperature(popt, prev_temp, 0, weather[idx]) # 0 is off
            actions.append(0)
        print prev_temp, weather[idx], actions[-1], next_temp
        output.append(next_temp)
        prev_temp = next_temp

    return output, actions
1306852
def setup(self):
        
        if not self.networks():
            super(FunctionLearning, self).setup()
            for net in self.networks():
                self.models.SinusoidalFunctionSource(network=net)
214622
public void executeWithDelay() {
        long now = Clock.currentTimeMillis();
        if (delay + now > hardLimit) {
            scheduleNewExecution(now);
        } else if (!tryPostponeExecution()) {
            scheduleNewExecution(now);
        }
    }
214518
def build_schedule_item(name, **kwargs):
    '''
    
    '''

    ret = {'comment': [],
           'result': True}

    if not name:
        ret['comment'] = 'Job name is required.'
        ret['result'] = False
        return ret

    schedule = {}
    schedule[name] = salt.utils.odict.OrderedDict()
    schedule[name]['function'] = kwargs['function']

    time_conflict = False
    for item in ['seconds', 'minutes', 'hours', 'days']:
        if item in kwargs and 'when' in kwargs:
            time_conflict = True

        if item in kwargs and 'cron' in kwargs:
            time_conflict = True

    if time_conflict:
        ret['result'] = False
        ret['comment'] = 'Unable to use "seconds", "minutes", "hours", or "days" with "when" or "cron" options.'
        return ret

    if 'when' in kwargs and 'cron' in kwargs:
        ret['result'] = False
        ret['comment'] = 'Unable to use "when" and "cron" options together.  Ignoring.'
        return ret

    for item in ['seconds', 'minutes', 'hours', 'days']:
        if item in kwargs:
            schedule[name][item] = kwargs[item]

    if 'return_job' in kwargs:
        schedule[name]['return_job'] = kwargs['return_job']

    if 'metadata' in kwargs:
        schedule[name]['metadata'] = kwargs['metadata']

    if 'job_args' in kwargs:
        schedule[name]['args'] = kwargs['job_args']

    if 'job_kwargs' in kwargs:
        schedule[name]['kwargs'] = kwargs['job_kwargs']

    if 'maxrunning' in kwargs:
        schedule[name]['maxrunning'] = kwargs['maxrunning']
    else:
        schedule[name]['maxrunning'] = 1

    if 'name' in kwargs:
        schedule[name]['name'] = kwargs['name']
    else:
        schedule[name]['name'] = name

    if 'enabled' in kwargs:
        schedule[name]['enabled'] = kwargs['enabled']
    else:
        schedule[name]['enabled'] = True

    if 'jid_include' not in kwargs or kwargs['jid_include']:
        schedule[name]['jid_include'] = True

    if 'splay' in kwargs:
        if isinstance(kwargs['splay'], dict):
            # Ensure ordering of start and end arguments
            schedule[name]['splay'] = salt.utils.odict.OrderedDict()
            schedule[name]['splay']['start'] = kwargs['splay']['start']
            schedule[name]['splay']['end'] = kwargs['splay']['end']
        else:
            schedule[name]['splay'] = kwargs['splay']

    if 'when' in kwargs:
        if not _WHEN_SUPPORTED:
            ret['result'] = False
            ret['comment'] = 'Missing dateutil.parser, "when" is unavailable.'
            return ret
        else:
            validate_when = kwargs['when']
            if not isinstance(validate_when, list):
                validate_when = [validate_when]
            for _when in validate_when:
                try:
                    dateutil_parser.parse(_when)
                except ValueError:
                    ret['result'] = False
                    ret['comment'] = 'Schedule item {0} for "when" in invalid.'.format(_when)
                    return ret

    for item in ['range', 'when', 'once', 'once_fmt', 'cron',
                 'returner', 'after', 'return_config', 'return_kwargs',
                 'until', 'run_on_start', 'skip_during_range']:
        if item in kwargs:
            schedule[name][item] = kwargs[item]

    return schedule[name]
675460
def on_finish(self, func):
        '''
        '''
        if self._done.is_set():
            if self._failure is None:
                backend.schedule(func, args=(self._value,))
        else:
            self._cbacks.append(func)
1313594
def with_fork_context(self, func):
    """"""
    res = self._native.lib.scheduler_fork_context(self._scheduler, Function(self._to_key(func)))
    return self._raise_or_return(res)
723983
function executeScheduledCall() {

	var call = scheduledCall;
	scheduledCall = undefined;

	if (call._step === 1) {
		reprocess();
	}
	else if (call._step === 2) {
		reparse();
	}
	else {
		reevaluate(call._clearContainerCache, undefined, call._contexts);
	}

}
701104
def setup_function(self):
        """"""
        log.options.LogOptions.set_stderr_log_level('google:INFO')
        if app.get_options().debug:
            log.options.LogOptions.set_stderr_log_level('google:DEBUG')
        if not app.get_options().build_root:
            app.set_option('build_root', os.path.join(
                app.get_options().butcher_basedir, 'build'))
        self.buildroot = app.get_options().build_root
        if not os.path.exists(self.buildroot):
            os.makedirs(self.buildroot)
        if app.get_options().disable_cache_fetch:
            self.options['cache_fetch'] = False
        if app.get_options().disable_hardlinks:
            base.BaseBuilder.linkfiles = False