code: def update_task_schedule(self, record):
      # calculate next run
  
      if record.next_run_at > dt.datetime.now():
          # do nothing, it is already planned in future
          return
  
      if record.schedule_str is None:
          # not need to run it anymore
          self._delete_record(record)
          return
  
      next_run_at = calc_next_date(
          record.schedule_str, base_date=record.next_run_at
      )
  
      if next_run_at is None:
          # no need to run it
          self._delete_record(record)
      elif record.end_at is not None and next_run_at > record.end_at:
          self._delete_record(record)
      else:
          # plan next run, but not in the past
          if next_run_at < dt.datetime.now():
              next_run_at = dt.datetime.now()
          record.next_run_at = next_run_at
  
imports: import re
  import datetime
  from dateutil.relativedelta import relativedelta
  import sqlalchemy
  from mindsdb_sql import parse_sql, ParsingException
  from mindsdb.utilities.context import context
  from mindsdb.utilities.exception import EntityNotExistsError, EntityExistsError
  from mindsdb.interfaces.storage import db
  from mindsdb.interfaces.database.projects import ProjectController
  from mindsdb.interfaces.query_context.context_controller import query_context_controller
  from mindsdb.utilities import log
label_desc: Use image node_id 2 for calling the JobsExecutor obj's underlying member method code with example usage: obj.update_task_schedule(record) without return types