# Path: cardinal/bot.py
# USER_REGEX = re.compile(r'^(.*?)!(.*?)@(.*?)$')
# UNLOCKED = 'unlocked'
# LOCKED = 'locked'
#     MINIMUM_RECONNECTION_WAIT = 10
#     MAXIMUM_RECONNECTION_WAIT = 300
# class CardinalBot(irc.IRCClient, object):
# class CardinalBotFactory(protocol.ClientFactory):
# class ChannelManager:
# class Channel:
#     def network(self):
#     def network(self, value):
#     def nickname(self):
#     def nickname(self, value):
#     def password(self):
#     def password(self, value):
#     def username(self):
#     def username(self, value):
#     def realname(self):
#     def realname(self, value):
#     def storage_path(self):
#     def __init__(self):
#     def signedOn(self):
#     def isupport(self, options):
#     def joined(self, channel):
#     def irc_RPL_CHANNELMODEIS(self, prefix, params):
#     def left(self, channel):
#     def kickedFrom(self, channel):
#     def lineReceived(self, line):
#     def irc_PRIVMSG(self, prefix, params):
#     def irc_NOTICE(self, prefix, params):
#     def irc_NICK(self, prefix, params):
#     def irc_TOPIC(self, prefix, params):
#     def irc_MODE(self, prefix, params):
#     def irc_JOIN(self, prefix, params):
#     def irc_PART(self, prefix, params):
#     def irc_KICK(self, prefix, params):
#     def irc_QUIT(self, prefix, params):
#     def irc_RPL_WHOREPLY(self, prefix, params):
#     def irc_RPL_ENDOFWHO(self, prefix, params):
#     def irc_INVITE(self, prefix, params):
#     def who(self, channel):
#     def config(self, plugin):
#     def sendMsg(self, channel, message, length=None):
#     def send(self, message):
#     def disconnect(self, message=''):
#     def disconnected(self):
#     def get_db(self, name, network_specific=True, default=None):
#         def db():
#     def get_user_tuple(string):
#     def reactor(self):
#     def __init__(self,
#                  network,
#                  server_password,
#                  server_commands,
#                  channels,
#                  nickname,
#                  password,
#                  username,
#                  realname,
#                  plugins,
#                  blacklist,
#                  storage):
#     def _sigint(self, signal, frame):
#     def clientConnectionLost(self, connector, reason):
#     def clientConnectionFailed(self, connector, reason):
#     def __init__(self, chanmodes, param_modes):
#     def __len__(self):
#     def __getitem__(self, key):
#     def __iter__(self):
#     def add(self, name):
#     def remove(self, name):
#     def set_modes(self, channel, modes, args):
#     def __init__(self, name):
#     def allows_color(self):
# 
# 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


import logging
from cardinal.bot import user_info
from cardinal.decorators import command, help
    def join(self, cardinal, user, channel, msg):
        if self.is_admin(user):
            channels = msg.split()
            channels.pop(0)
            for channel in channels:
                cardinal.join(channel)

    @command('part')
    @help("Parts selected channels. (admin only)")
    @help("Syntax: .join <channel [channel ...]>")
    def part(self, cardinal, user, channel, msg):
        if not self.is_admin(user):
            return

        channels = msg.split()
        channels.pop(0)
        if len(channels) > 0:
            for channel in channels:
                cardinal.part(channel)
        elif channel != user:
            cardinal.part(channel)

    @command('quit')
    @help("Quits the network with a quit message, if one is defined. "
          "(admin only)")
    @help("Syntax: .quit [message]")
    def quit(self, cardinal, user, channel, msg):
        if self.is_admin(user):
            cardinal.disconnect(' '.join(msg.split(' ')[1:]))


# Path: cardinal/bot.py
# USER_REGEX = re.compile(r'^(.*?)!(.*?)@(.*?)$')
# UNLOCKED = 'unlocked'
# LOCKED = 'locked'
#     MINIMUM_RECONNECTION_WAIT = 10
#     MAXIMUM_RECONNECTION_WAIT = 300
# class CardinalBot(irc.IRCClient, object):
# class CardinalBotFactory(protocol.ClientFactory):
# class ChannelManager:
# class Channel:
#     def network(self):
#     def network(self, value):
#     def nickname(self):
#     def nickname(self, value):
#     def password(self):
#     def password(self, value):
#     def username(self):
#     def username(self, value):
#     def realname(self):
#     def realname(self, value):
#     def storage_path(self):
#     def __init__(self):
#     def signedOn(self):
#     def isupport(self, options):
#     def joined(self, channel):
#     def irc_RPL_CHANNELMODEIS(self, prefix, params):
#     def left(self, channel):
#     def kickedFrom(self, channel):
#     def lineReceived(self, line):
#     def irc_PRIVMSG(self, prefix, params):
#     def irc_NOTICE(self, prefix, params):
#     def irc_NICK(self, prefix, params):
#     def irc_TOPIC(self, prefix, params):
#     def irc_MODE(self, prefix, params):
#     def irc_JOIN(self, prefix, params):
#     def irc_PART(self, prefix, params):
#     def irc_KICK(self, prefix, params):
#     def irc_QUIT(self, prefix, params):
#     def irc_RPL_WHOREPLY(self, prefix, params):
#     def irc_RPL_ENDOFWHO(self, prefix, params):
#     def irc_INVITE(self, prefix, params):
#     def who(self, channel):
#     def config(self, plugin):
#     def sendMsg(self, channel, message, length=None):
#     def send(self, message):
#     def disconnect(self, message=''):
#     def disconnected(self):
#     def get_db(self, name, network_specific=True, default=None):
#         def db():
#     def get_user_tuple(string):
#     def reactor(self):
#     def __init__(self,
#                  network,
#                  server_password,
#                  server_commands,
#                  channels,
#                  nickname,
#                  password,
#                  username,
#                  realname,
#                  plugins,
#                  blacklist,
#                  storage):
#     def _sigint(self, signal, frame):
#     def clientConnectionLost(self, connector, reason):
#     def clientConnectionFailed(self, connector, reason):
#     def __init__(self, chanmodes, param_modes):
#     def __len__(self):
#     def __getitem__(self, key):
#     def __iter__(self):
#     def add(self, name):
#     def remove(self, name):
#     def set_modes(self, channel, modes, args):
#     def __init__(self, name):
#     def allows_color(self):
# 
# 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/admin/plugin.py
import logging
from cardinal.bot import user_info
from cardinal.decorators import command, help

    def join(self, cardinal, user, channel, msg):
        if self.is_admin(user):
            channels = msg.split()
            channels.pop(0)
            for channel in channels:
                cardinal.join(channel)

    @command('part')
    @help("Parts selected channels. (admin only)")
    @help("Syntax: .join <channel [channel ...]>")
    def part(self, cardinal, user, channel, msg):
        if not self.is_admin(user):
            return

        channels = msg.split()
        channels.pop(0)
        if len(channels) > 0:
            for channel in channels:
                cardinal.part(channel)
        elif channel != user:
            cardinal.part(channel)

    @command('quit')
    @help("Quits the network with a quit message, if one is defined. "
          "(admin only)")
    @help("Syntax: .quit [message]")
    def quit(self, cardinal, user, channel, msg):
        if self.is_admin(user):
            cardinal.disconnect(' '.join(msg.split(' ')[1:]))


    @command('dbg_quit')