def add_job(self, data, persist=True):

        # we don't do any checking here besides making sure its a dict.
        # eval() already does for us and raises errors accordingly
        if not isinstance(data, dict):
            raise ValueError('Scheduled jobs have to be of type dict.')
        if not len(data) == 1:
            raise ValueError('You can only schedule one new job at a time.')

        # if enabled is not included in the job,
        # assume job is enabled.
        for job in data.keys():
            if 'enabled' not in data[job]:
                data[job]['enabled'] = True

        new_job = next(six.iterkeys(data))

        if new_job in self.opts['schedule']:
            log.info('Updating job settings for scheduled '
                     'job: {0}'.format(new_job))
        else:
            log.info('Added new job {0} to scheduler'.format(new_job))

        self.opts['schedule'].update(data)

        # Fire the complete event back along with updated list of schedule
        evt = salt.utils.event.get_event('minion', opts=self.opts, listen=False)
        evt.fire_event({'complete': True, 'schedule': self.opts['schedule']},
                       tag='/salt/minion/minion_schedule_add_complete')

        if persist:
            self.persist()
Yields the sqlite3.Connection object.
dataset/ETHPy150Open saltstack/salt/salt/utils/schedule.py/Schedule.add_job--crossover with--dataset/ETHPy150Open clips/pattern/pattern/server/__init__.py/Database.connection