code: def get_next_tasks(self):
      # filter next_run < now
      query = (
          db.session.query(db.Jobs)
          .filter(
              db.Jobs.next_run_at < dt.datetime.now(),
              db.Jobs.deleted_at == sa.null(),
              db.Jobs.active == True,  # noqa
          )
          .order_by(db.Jobs.next_run_at)
      )
  
      return query.all()
  
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 1 for calling the JobsExecutor obj's underlying member method code with example usage: obj.get_next_tasks() and returns: query