def _doGhost(self, irc, nick=None):
        if self.disabled(irc):
            return
        if nick is None:
            nick = self._getNick(irc.network)
        if nick not in self.registryValue('nicks'):
            return
        nickserv = self.registryValue('NickServ')
        password = self._getNickServPassword(nick)
        ghostDelay = self.registryValue('ghostDelay')
        if not ghostDelay:
            return
        if not nickserv or not password:
            s = 'Tried to ghost without a NickServ or password set.'
            self.log.warning(s)
            return
        if self.sentGhost and time.time() < (self.sentGhost + ghostDelay):
            self.log.warning('Refusing to send GHOST more than once every '
                             '%s seconds.' % ghostDelay)
        elif not password:
            self.log.warning('Not ghosting: no password set.')
            return
        else:
            self.log.info('Sending ghost (current nick: %s; ghosting: %s)',
                          irc.nick, nick)
            ghost = 'GHOST %s %s' % (nick, password)
            # Ditto about the sendMsg (see _doIdentify).
            irc.sendMsg(ircmsgs.privmsg(nickserv, ghost))
            self.sentGhost = time.time()
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Services/plugin.py/Services._doGhost/original