# Path: cardinal/decorators.py
# def command(triggers):
#     if isinstance(triggers, str):
#         triggers = [triggers]
# 
#     if not isinstance(triggers, list):
#         raise TypeError("Command must be a trigger string or list of triggers")
# 
#     def wrap(f):
#         f.commands = triggers
#         return f
# 
#     return wrap
# 
# def help(lines):
#     # For backwards compatibility
#     if isinstance(lines, str):
#         lines = [lines]
# 
#     if not isinstance(lines, list):
#         raise TypeError("Help must be a help string or list of help strings")
# 
#     def wrap(f):
#         # Create help list or prepend to it
#         if not hasattr(f, 'help'):
#             f.help = lines
#         else:
#             f.help = lines + f.help
# 
#         return f
# 
#     return wrap


from datetime import datetime
from pytz.exceptions import UnknownTimeZoneError
from cardinal.decorators import command, help
import pytz

        # handle common offset formats
        if (tz_input.startswith('UTC') or tz_input.startswith('GMT')) and \
                len(tz_input) > 3 and tz_input[3] in ('+', '-'):
            tz_input = tz_input[3:]

        offset = None
        try:
            offset = int(tz_input)
        except ValueError:
            pass

        if offset is not None:
            try:
                if offset < 0:
                    # for some reason the GMT+4 == America/Eastern, and GMT-4
                    # is over in Asia
                    user_tz = pytz.timezone('Etc/GMT+{0}'.format(offset * -1))
                elif offset > 0:
                    user_tz = pytz.timezone('Etc/GMT{0}'.format(offset * -1))
                else:
                    user_tz = utc
            except UnknownTimeZoneError:
                return cardinal.sendMsg(channel, 'Invalid UTC offset')
        else:
            try:
                user_tz = pytz.timezone(tz_input)
            except UnknownTimeZoneError:
                return cardinal.sendMsg(channel, 'Invalid timezone')


# Path: cardinal/decorators.py
# def command(triggers):
#     if isinstance(triggers, str):
#         triggers = [triggers]
# 
#     if not isinstance(triggers, list):
#         raise TypeError("Command must be a trigger string or list of triggers")
# 
#     def wrap(f):
#         f.commands = triggers
#         return f
# 
#     return wrap
# 
# def help(lines):
#     # For backwards compatibility
#     if isinstance(lines, str):
#         lines = [lines]
# 
#     if not isinstance(lines, list):
#         raise TypeError("Help must be a help string or list of help strings")
# 
#     def wrap(f):
#         # Create help list or prepend to it
#         if not hasattr(f, 'help'):
#             f.help = lines
#         else:
#             f.help = lines + f.help
# 
#         return f
# 
#     return wrap


# Path: plugins/timezone/plugin.py
from datetime import datetime
from pytz.exceptions import UnknownTimeZoneError
from cardinal.decorators import command, help
import pytz


        # handle common offset formats
        if (tz_input.startswith('UTC') or tz_input.startswith('GMT')) and \
                len(tz_input) > 3 and tz_input[3] in ('+', '-'):
            tz_input = tz_input[3:]

        offset = None
        try:
            offset = int(tz_input)
        except ValueError:
            pass

        if offset is not None:
            try:
                if offset < 0:
                    # for some reason the GMT+4 == America/Eastern, and GMT-4
                    # is over in Asia
                    user_tz = pytz.timezone('Etc/GMT+{0}'.format(offset * -1))
                elif offset > 0:
                    user_tz = pytz.timezone('Etc/GMT{0}'.format(offset * -1))
                else:
                    user_tz = utc
            except UnknownTimeZoneError:
                return cardinal.sendMsg(channel, 'Invalid UTC offset')
        else:
            try:
                user_tz = pytz.timezone(tz_input)
            except UnknownTimeZoneError:
                return cardinal.sendMsg(channel, 'Invalid timezone')


        now = user_tz.normalize(now)