# Path: scheduler/time_utils.py
# def parse_time(datetimestring: str):
#     ret = parser.parse(datetimestring, tzinfos=dict(gen_tzinfos()))
#     ret = ret.astimezone(pytz.utc)
#     return ret
# 
# def parse_timedelta(argument: str) -> Optional[timedelta]:
#     matches = TIME_RE.match(argument)
#     if matches:
#         params = {k: int(v) for k, v in matches.groupdict().items() if v}
#         if params:
#             return timedelta(**params)
#     return None


import argparse
import dataclasses
from datetime import datetime, timedelta, timezone
from typing import NamedTuple, Optional, Tuple
from redbot.core.commands import BadArgument, Context
from .time_utils import parse_time, parse_timedelta
            argument = " -- ".join(arguments)
        else:
            command = None

        parser = NoExitParser(description="Scheduler event parsing", add_help=False)
        parser.add_argument(
            "-q", "--quiet", action="store_true", dest="quiet", default=False
        )
        parser.add_argument("--every", nargs="*", dest="every", default=[])
        if not command:
            parser.add_argument("command", nargs="*")
        at_or_in = parser.add_mutually_exclusive_group()
        at_or_in.add_argument("--start-at", nargs="*", dest="at", default=[])
        at_or_in.add_argument("--start-in", nargs="*", dest="in", default=[])

        try:
            vals = vars(parser.parse_args(argument.split(" ")))
        except Exception as exc:
            raise BadArgument() from exc

        if not (vals["at"] or vals["in"]):
            raise BadArgument("You must provide one of `--start-in` or `--start-at`")

        if not command and not vals["command"]:
            raise BadArgument("You have to provide a command to run")

        command = command or " ".join(vals["command"])

        for delta in ("in", "every"):
            if vals[delta]:

# Path: scheduler/time_utils.py
# def parse_time(datetimestring: str):
#     ret = parser.parse(datetimestring, tzinfos=dict(gen_tzinfos()))
#     ret = ret.astimezone(pytz.utc)
#     return ret
# 
# def parse_timedelta(argument: str) -> Optional[timedelta]:
#     matches = TIME_RE.match(argument)
#     if matches:
#         params = {k: int(v) for k, v in matches.groupdict().items() if v}
#         if params:
#             return timedelta(**params)
#     return None


# Path: scheduler/converters.py
import argparse
import dataclasses
from datetime import datetime, timedelta, timezone
from typing import NamedTuple, Optional, Tuple
from redbot.core.commands import BadArgument, Context
from .time_utils import parse_time, parse_timedelta

            argument = " -- ".join(arguments)
        else:
            command = None

        parser = NoExitParser(description="Scheduler event parsing", add_help=False)
        parser.add_argument(
            "-q", "--quiet", action="store_true", dest="quiet", default=False
        )
        parser.add_argument("--every", nargs="*", dest="every", default=[])
        if not command:
            parser.add_argument("command", nargs="*")
        at_or_in = parser.add_mutually_exclusive_group()
        at_or_in.add_argument("--start-at", nargs="*", dest="at", default=[])
        at_or_in.add_argument("--start-in", nargs="*", dest="in", default=[])

        try:
            vals = vars(parser.parse_args(argument.split(" ")))
        except Exception as exc:
            raise BadArgument() from exc

        if not (vals["at"] or vals["in"]):
            raise BadArgument("You must provide one of `--start-in` or `--start-at`")

        if not command and not vals["command"]:
            raise BadArgument("You have to provide a command to run")

        command = command or " ".join(vals["command"])

        for delta in ("in", "every"):
            if vals[delta]:

                parsed = parse_timedelta(" ".join(vals[delta]))