# 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
            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]))
                if not parsed:
                    raise BadArgument("I couldn't understand that time interval")

                if delta == "in":
                    start = datetime.now(timezone.utc) + parsed
                else:
                    recur = parsed
                    if recur.total_seconds() < 60:
                        raise BadArgument(
                            "You can't schedule something to happen that frequently, "
                            "I'll get ratelimited."
                        )

        if vals["at"]:
            try:

# 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

            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]))
                if not parsed:
                    raise BadArgument("I couldn't understand that time interval")

                if delta == "in":
                    start = datetime.now(timezone.utc) + parsed
                else:
                    recur = parsed
                    if recur.total_seconds() < 60:
                        raise BadArgument(
                            "You can't schedule something to happen that frequently, "
                            "I'll get ratelimited."
                        )

        if vals["at"]:
            try:

                start = parse_time(" ".join(vals["at"]))