# Path: rep0st/framework/execute.py
# def execute(order: float = 0) -> Any:
# 
#   def decorator(function: Any):
#     function.__execute__ = _ExecuteConfiguration(order)
#     return function
# 
#   return decorator
# 
# Path: rep0st/framework/signal_handler.py
# def on_shutdown() -> Any:
# 
#   def decorator(function: Any):
#     function.__on_shutdown__ = _OnShutdownConfiguration()
#     return function
# 
#   return decorator


import calendar
import ctypes
import datetime
import logging
import sched
import threading
from threading import Thread
from typing import Callable, List
from crontab import CronTab
from injector import Module, inject, singleton
from prometheus_client.metrics import Gauge
from rep0st.framework.execute import execute
from rep0st.framework.signal_handler import on_shutdown
        name=f'Job {fun.__module__}.{fun.__name__}',
        target=self._run_task,
        kwargs={
            'schedule': schedule,
            'fun': fun
        },
        daemon=True)
    self.running_tasks.append(thread)
    thread.start()

  def _schedule_task(self, schedule: _Schedule, fun: Callable[[],
                                                              None]) -> None:
    if self.exit.is_set():
      return
    now = self._get_utc_time()
    next_run_time = schedule.next(now)
    log.debug(
        f'Scheduling job {fun.__name__} to be run at {datetime.datetime.utcfromtimestamp(next_run_time)}'
    )
    self.scheduler.enterabs(
        next_run_time,
        1,
        self._schedule_handler,
        kwargs={
            'schedule': schedule,
            'fun': fun
        })

  def schedule(self, timespec: str, f: Callable[[], None]) -> None:
    if not timespec:

# Path: rep0st/framework/execute.py
# def execute(order: float = 0) -> Any:
# 
#   def decorator(function: Any):
#     function.__execute__ = _ExecuteConfiguration(order)
#     return function
# 
#   return decorator
# 
# Path: rep0st/framework/signal_handler.py
# def on_shutdown() -> Any:
# 
#   def decorator(function: Any):
#     function.__on_shutdown__ = _OnShutdownConfiguration()
#     return function
# 
#   return decorator


# Path: rep0st/framework/scheduler.py
import calendar
import ctypes
import datetime
import logging
import sched
import threading
from threading import Thread
from typing import Callable, List
from crontab import CronTab
from injector import Module, inject, singleton
from prometheus_client.metrics import Gauge
from rep0st.framework.execute import execute
from rep0st.framework.signal_handler import on_shutdown

        name=f'Job {fun.__module__}.{fun.__name__}',
        target=self._run_task,
        kwargs={
            'schedule': schedule,
            'fun': fun
        },
        daemon=True)
    self.running_tasks.append(thread)
    thread.start()

  def _schedule_task(self, schedule: _Schedule, fun: Callable[[],
                                                              None]) -> None:
    if self.exit.is_set():
      return
    now = self._get_utc_time()
    next_run_time = schedule.next(now)
    log.debug(
        f'Scheduling job {fun.__name__} to be run at {datetime.datetime.utcfromtimestamp(next_run_time)}'
    )
    self.scheduler.enterabs(
        next_run_time,
        1,
        self._schedule_handler,
        kwargs={
            'schedule': schedule,
            'fun': fun
        })

  def schedule(self, timespec: str, f: Callable[[], None]) -> None:
    if not timespec:

      log.debug(f'Task {f} is is ignored as the timespec is empty')