def doChanservNotice(self, irc, msg):
        if self.disabled(irc):
            return
        s = msg.args[1].lower()
        channel = None
        m = self._chanRe.search(s)
        networkGroup = conf.supybot.networks.get(irc.network)
        on = 'on %s' % irc.network
        if m is not None:
            channel = m.group(1)
        if 'all bans' in s or 'unbanned from' in s:
            # All bans removed (freenode)
            # You have been unbanned from (oftc)
            irc.sendMsg(networkGroup.channels.join(channel))
        elif 'isn\'t registered' in s:
            self.log.warning('Received "%s isn\'t registered" from ChanServ %s',
                             channel, on)
        elif 'this channel has been registered' in s:
            self.log.debug('Got "Registered channel" from ChanServ %s.', on)
        elif 'already opped' in s:
            # This shouldn't happen, Services.op should refuse to run if
            # we already have ops.
            self.log.debug('Got "Already opped" from ChanServ %s.', on)
        elif 'access level' in s and 'is required' in s:
            self.log.warning('Got "Access level required" from ChanServ %s.',
                             on)
        elif 'inviting' in s:
            self.log.debug('Got "Inviting to channel" from ChanServ %s.', on)
        elif s.startswith('['):
            chanTypes = irc.state.supported['CHANTYPES']
            if re.match(r'^\[[%s]' % re.escape(chanTypes), s):
                self.log.debug('Got entrymsg from ChanServ %s.', on)
        elif ircutils.isChannel(msg.args[0]):
            # Atheme uses channel-wide notices for alerting channel access
            # changes if the FANTASY or VERBOSE setting is on; we can suppress
            # these 'unexpected notice' warnings since they're not really 
            # important.
            pass
        else:
            self.log.warning('Got unexpected notice from ChanServ %s: %r.',
                             on, msg)
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Services/plugin.py/Services.doChanservNotice/original