Set schedule record config.
        cmd: setScheduleRecordConfig
        args: See docstring of meth::get_schedule_record_config
499481
def set_schedule_record_config(self, is_enable, record_level,
                                   space_full_mode, is_enable_audio,
                                   schedule0 = 0, schedule1 = 0, schedule2 = 0,
                                   schedule3 = 0, schedule4 = 0, schedule5 = 0,
                                   schedule6 = 0, callback=None):
        '''
        
        '''

        params = {'isEnable'     : is_enable,
                  'isEnableAudio': is_enable_audio,
                  'recordLevel'  : record_level,
                  'spaceFullMode': space_full_mode,
                  'schedule0'    : schedule0,
                  'schedule1'    : schedule1,
                  'schedule2'    : schedule2,
                  'schedule3'    : schedule3,
                  'schedule4'    : schedule4,
                  'schedule5'    : schedule5,
                  'schedule6'    : schedule6,
                  }
        return self.execute_command('setScheduleRecordConfig', params, callback=callback)
1313034
def _process_noop_timeperiod(self, job_record):
        
        job_record.state = job.STATE_NOOP
        self.job_dao.update(job_record)

        time_grouping = context.process_context[job_record.process_name].time_grouping
        msg = 'Job {0}@{1} with time_grouping {2} was transferred to STATE_NOOP' \
              .format(job_record.process_name, job_record.timeperiod, time_grouping)
        self._log_message(INFO, job_record.process_name, job_record.timeperiod, msg)
829510
def _get_schedule(self,
                      include_opts=True,
                      include_pillar=True,
                      remove_hidden=False):
        '''
        
        '''
        schedule = {}
        if include_pillar:
            pillar_schedule = self.opts.get('pillar', {}).get('schedule', {})
            if not isinstance(pillar_schedule, dict):
                raise ValueError('Schedule must be of type dict.')
            schedule.update(pillar_schedule)
        if include_opts:
            opts_schedule = self.opts.get('schedule', {})
            if not isinstance(opts_schedule, dict):
                raise ValueError('Schedule must be of type dict.')
            schedule.update(opts_schedule)

        if remove_hidden:
            _schedule = copy.deepcopy(schedule)
            for job in _schedule:
                if isinstance(_schedule[job], dict):
                    for item in _schedule[job]:
                        if item.startswith('_'):
                            del schedule[job][item]
        return schedule
1295780
def setup_schedule(self):
        ""

        log.info("SQLAlchemyScheduler.setup_schedule called")

        if 'celery.backend_cleanup' not in self._schedule:
            self._schedule['celery.backend_cleanup'] = ScheduleEntry(
                name='celery.backend_cleanup',
                task='celery.backend_cleanup',
                schedule=crontab('0', '4', '*'),
                options= {'expires': 12 * 3600}
            )
16719
def manage_schedule(self, tag, data):
        '''
        
        '''
        func = data.get('func', None)
        name = data.get('name', None)
        schedule = data.get('schedule', None)
        where = data.get('where', None)
        persist = data.get('persist', None)

        funcs = {'delete': ('delete_job', (name, persist)),
                 'add': ('add_job', (schedule, persist)),
                 'modify': ('modify_job',
                            (name, schedule, persist)),
                 'enable': ('enable_schedule', ()),
                 'disable': ('disable_schedule', ()),
                 'enable_job': ('enable_job', (name, persist)),
                 'disable_job': ('disable_job', (name, persist)),
                 'postpone_job': ('postpone_job', (name, data)),
                 'skip_job': ('skip_job', (name, data)),
                 'reload': ('reload', (schedule,)),
                 'list': ('list', (where,)),
                 'save_schedule': ('save_schedule', ()),
                 'get_next_fire_time': ('get_next_fire_time',
                                        (name,))}

        # Call the appropriate schedule function
        try:
            alias, params = funcs.get(func)
            getattr(self.schedule, alias)(*params)
        except TypeError:
            log.error('Function "%s" is unavailable in salt.utils.scheduler',
                      func)
821487
function setRecord(state, record) {
  Object.defineProperty(state, 'record', {value: record, writable: true, configurable: true, enumerable: false});
}
1042297
public function recordEventStart()
    {
        try {
            $this->scheduler = Scheduler::firstOrNew(['mutex' => $this->mutexName()]);

            if (! $this->scheduler->exists) {
                $this->scheduler->fill([
                    'schedule' => $this->expression,
                    'command' => $this->getCommandName(),
                    'timezone' => $this->timezone,
                    'run_in_background' => $this->runInBackground,
                    'without_overlapping' => $this->withoutOverlapping,
                    'on_one_server' => $this->onOneServer,
                    'next_run_due' => $this->getNextRunDue($this->expression, $this->timezone),
                    'next_check_due' => $this->getNextCheckDue($this->expression, $this->timezone),
                ]);
            } else {
                $this->scheduler->fill([
                    'last_run' => date("Y-m-d H:i:s"),
                    'next_run_due' => $this->getNextRunDue($this->expression, $this->timezone),
                    'next_check_due' => $this->getNextCheckDue($this->expression, $this->timezone),
                ]);
            }
            $this->scheduler->save();

            $this->history = History::create([
                'scheduler_id' => $this->scheduler->id,
                'expected_completion' => $this->determineExpectedCompletion($this->scheduler),
            ]);
        } catch (Exception $e) {
            app(Eye::class)->logger()->error('Unable to track scheduler',
                                             $e->getMessage(),
                                             ['expresison' => $this->expression,
                                              'command_name' => $this->getCommandName()]);
        }

        $this->start = microtime(true);
        $this->exitcode = 1;
    }
1332047
def scheduler(broker=None):
    
    if not broker:
        broker = get_broker()
    db.close_old_connections()
    try:
        for s in Schedule.objects.exclude(repeats=0).filter(next_run__lt=timezone.now()):
            args = ()
            kwargs = {}
            # get args, kwargs and hook
            if s.kwargs:
                try:
                    # eval should be safe here because dict()
                    kwargs = eval('dict({})'.format(s.kwargs))
                except SyntaxError:
                    kwargs = {}
            if s.args:
                args = ast.literal_eval(s.args)
                # single value won't eval to tuple, so:
                if type(args) != tuple:
                    args = (args,)
            q_options = kwargs.get('q_options', {})
            if s.hook:
                q_options['hook'] = s.hook
            # set up the next run time
            if not s.schedule_type == s.ONCE:
                next_run = arrow.get(s.next_run)
                while True:
                    if s.schedule_type == s.MINUTES:
                        next_run = next_run.replace(minutes=+(s.minutes or 1))
                    elif s.schedule_type == s.HOURLY:
                        next_run = next_run.replace(hours=+1)
                    elif s.schedule_type == s.DAILY:
                        next_run = next_run.replace(days=+1)
                    elif s.schedule_type == s.WEEKLY:
                        next_run = next_run.replace(weeks=+1)
                    elif s.schedule_type == s.MONTHLY:
                        next_run = next_run.replace(months=+1)
                    elif s.schedule_type == s.QUARTERLY:
                        next_run = next_run.replace(months=+3)
                    elif s.schedule_type == s.YEARLY:
                        next_run = next_run.replace(years=+1)
                    if Conf.CATCH_UP or next_run > arrow.utcnow():
                        break
                s.next_run = next_run.datetime
                s.repeats += -1
            # send it to the cluster
            q_options['broker'] = broker
            q_options['group'] = q_options.get('group', s.name or s.id)
            kwargs['q_options'] = q_options
            s.task = django_q.tasks.async_task(s.func, *args, **kwargs)
            # log it
            if not s.task:
                logger.error(
                    _('{} failed to create a task from schedule [{}]').format(current_process().name,
                                                                              s.name or s.id))
            else:
                logger.info(
                    _('{} created a task from schedule [{}]').format(current_process().name, s.name or s.id))
            # default behavior is to delete a ONCE schedule
            if s.schedule_type == s.ONCE:
                if s.repeats < 0:
                    s.delete()
                    continue
                # but not if it has a positive repeats
                s.repeats = 0
            # save the schedule
            s.save()
    except Exception as e:
        logger.error(e)
998030
def scheduled():
    '''
    
    '''
    for job in sorted(schedulables(), key=lambda s: s.name):
        for task in PeriodicTask.objects(task=job.name):
            label = job_label(task.task, task.args, task.kwargs)
            echo(SCHEDULE_LINE.format(
                name=white(task.name.encode('utf8')),
                label=label,
                schedule=task.schedule_display
            ).encode('utf8'))
499888
def set_record_path(self, path, callback=None):
        '''
        
        '''
        params = {'Path': path}
        return self.execute_command('setRecordPath', params, callback=callback)
790042
def set_job(self, key, func, args):
        
        res, pk = key
        jobs, lock = self._jobs
        task = _tasks.UpdateTask(func(*args), key)
        with lock:
            job = jobs[res].get(pk)
            had = bool(job)
            if not job:
                job = task
                jobs[res][pk] = job
            else:
                task.cancel()
        self._log.debug('Scheduling: %s-%s (%s)', res.tag, pk,
                        'new task' if not had else 'dup')
        return job
591842
def get(self, record_id):
        
        record_url = self.record_url(record_id)
        return self._get(record_url)
489685
def prepare_schedule(schedule):
    
    ret = {}
    for room in schedule:
        ret[room] = []
        for event in schedule[room]:
            ret[room].append(((event[0].hour,
                                event[0].minute),
                             (event[1].hour,
                              event[1].minute),
                             event[2]))
    return ret
947474
async def set_record(self, *, chat: typing.Union[str, int, None] = None, user: typing.Union[str, int, None] = None,
                         state=None, data=None, bucket=None):
        
        if data is None:
            data = {}
        if bucket is None:
            bucket = {}

        chat, user = self.check_address(chat=chat, user=user)
        addr = f"fsm:{chat}:{user}"

        record = {'state': state, 'data': data, 'bucket': bucket}

        conn = await self.redis()
        await conn.execute('SET', addr, json.dumps(record))
356658
def update_record(self, record, data=None, priority=None,
            ttl=None, comment=None):
        
        return self.manager.update_record(self, record, data=data,
            priority=priority, ttl=ttl, comment=comment)
783404
def setCheckedRecords( self, records ):
        
        QApplication.sendPostedEvents(self, -1)
        indexes = []
        
        for i in range(self.count()):
            record = self.recordAt(i)
            if record is not None and record in records:
                indexes.append(i)
        
        self.setCheckedIndexes(indexes)
170674
def get_next_schedule_brok(self):
        
        data = {'uuid': self.uuid}
        self.fill_data_brok_from(data, 'next_schedule')
        return Brok({'type': self.my_type + '_next_schedule', 'data': data})