code: def _calc_next_run(self, prev_timestamp, weekday):
      # make sure that if we have a specific day we zero the minutes/hours/seconds
      if self.year:
          prev_timestamp = datetime(
              year=prev_timestamp.year,
              month=self.month or prev_timestamp.month,
              day=self.day or 1,
          )
      elif self.month:
          prev_timestamp = datetime(
              year=prev_timestamp.year,
              month=prev_timestamp.month,
              day=self.day or 1,
          )
      elif self.day is None and weekday is not None:
          # notice we assume every X hours on specific weekdays
          # other combinations (i.e. specific time at weekdays, is covered later)
          next_timestamp = datetime(
              year=prev_timestamp.year,
              month=prev_timestamp.month,
              day=prev_timestamp.day,
              hour=prev_timestamp.hour,
              minute=prev_timestamp.minute,
          )
          next_timestamp += relativedelta(
              years=self.year or 0,
              months=0 if self.year else (self.month or 0),
              hours=self.hour or 0,
              minutes=self.minute or 0,
              weekday=weekday if not self._last_executed else None,
          )
          # start a new day
          if next_timestamp.day != prev_timestamp.day:
              next_timestamp = datetime(
                  year=prev_timestamp.year,
                  month=prev_timestamp.month,
                  day=prev_timestamp.day,
              ) + relativedelta(
                  years=self.year or 0,
                  months=0 if self.year else (self.month or 0),
                  hours=self.hour or 0,
                  minutes=self.minute or 0,
                  weekday=weekday,
              )
  
          return next_timestamp
  
      elif self.day is not None and weekday is not None:
          # push to the next day (so we only have once a day)
          prev_timestamp = datetime(
              year=prev_timestamp.year,
              month=prev_timestamp.month,
              day=prev_timestamp.day,
          ) + relativedelta(days=1)
      elif self.day:
          # reset minutes in the hour (we will be adding additional hour/minute anyhow)
          prev_timestamp = datetime(
              year=prev_timestamp.year,
              month=prev_timestamp.month,
              day=prev_timestamp.day,
          )
      elif self.hour:
          # reset minutes in the hour (we will be adding additional minutes anyhow)
          prev_timestamp = datetime(
              year=prev_timestamp.year,
              month=prev_timestamp.month,
              day=prev_timestamp.day,
              hour=prev_timestamp.hour,
          )
  
      return prev_timestamp + relativedelta(
          years=self.year or 0,
          months=0 if self.year else (self.month or 0),
          days=0
          if self.month or self.year
          else ((self.day or 0) if weekday is None else 0),
          hours=self.hour or 0,
          minutes=self.minute or 0,
          weekday=weekday,
      )
  
imports: import json
  import logging
  from datetime import datetime
  from threading import Thread, enumerate
  from time import sleep, time
  from typing import List, Union, Optional, Callable, Sequence, Dict
  from attr import attrs, attrib
  from dateutil.relativedelta import relativedelta
  from .job import ClearmlJob
  from .controller import PipelineController
  from ..backend_interface.util import datetime_from_isoformat, datetime_to_isoformat, mutually_exclusive
  from ..task import Task
label_desc: Use image node_id 5 for calling the ScheduleJob obj's underlying member method code with example usage: obj._calc_next_run(prev_timestamp, weekday) and returns: unknown, next_timestamp