def modify_scheduler_job(self, job_id, **kwargs):

        # This is a BLOCKING operation
        job = self.get_job(job_id)

        # Handle args
        if 'job_class_string' in kwargs or 'pub_args' in kwargs:
            args = list(job.args)
            if 'job_class_string' in kwargs:
                args[0] = kwargs['job_class_string']
                # 'task_name' is not an argument for modify_job.
                del kwargs['job_class_string']
            if 'pub_args' in kwargs:
                args = args[:2] + kwargs['pub_args']
                del kwargs['pub_args']
            kwargs['args'] = args

        # Handle scheduling time
        if ('month' in kwargs or 'day' in kwargs or 'hour' in kwargs or 'minute' in kwargs or
                'day_of_week' in kwargs):
            trigger_kwargs = {}
            if 'month' in kwargs:
                trigger_kwargs['month'] = kwargs['month']
                del kwargs['month']
            if 'day_of_week' in kwargs:
                trigger_kwargs['day_of_week'] = kwargs['day_of_week']
                del kwargs['day_of_week']
            if 'day' in kwargs:
                trigger_kwargs['day'] = kwargs['day']
                del kwargs['day']
            if 'hour' in kwargs:
                trigger_kwargs['hour'] = kwargs['hour']
                del kwargs['hour']
            if 'minute' in kwargs:
                trigger_kwargs['minute'] = kwargs['minute']
                del kwargs['minute']

            # This is a NON-BLOCKING operation
            job.reschedule(trigger='cron', **trigger_kwargs)

        # This is a NON-BLOCKING operation
        job.modify(**kwargs)

        # apschedule has a "bug" or "feature":
        # Whenever you modify a job, it resumes the job, no matter whether
        # the job is paused or not originally.
        # So we need to manually pause it at the end.
        if not job.next_run_time:
            job.pause()
Modifies a job.
dataset/ETHPy150Open Nextdoor/ndscheduler/ndscheduler/core/scheduler/base.py/SingletonScheduler.modify_scheduler_job