<commit_before>## account.py
# Account system support.
from pydle import async
from pydle.features import rfc1459

class AccountSupport(rfc1459.RFC1459Support):

    ## Internal.

    def _create_user(self, nickname):
        super()._create_user(nickname)
        if nickname in self.users:
            self.users[nickname].update({
                'account': None,
                'identified': False
            })

    def _rename_user(self, user, new):
        super()._rename_user(user, new)
        # Unset account info to be certain until we get a new response.
        self._sync_user(new, { 'account': None, 'identified': False })
        self.whois(new)


    ## IRC API.

    def whois(self, nickname):
        future = super().whois(nickname)

        # Add own info.
        if nickname in self._whois_info:
            self._whois_info[nickname].setdefault('account', None)
            self._whois_info[nickname].setdefault('identified', False)

        return future


    ## Message handlers.

    @async.coroutine
    def on_raw_307(self, message):
        """ WHOIS: User has identified for this nickname. (Anope) """
        target, nickname = message.params[:2]
        info = {
            'identified': True
        }

        if nickname in self.users:
            self._sync_user(nickname, info)
        if nickname in self._pending['whois']:
            self._whois_info[nickname].update(info)

    @async.coroutine
    def on_raw_330(self, message):
        """ WHOIS account name (Atheme). """
        target, nickname, account = message.params[:3]
        info = {
            'account': account,
            'identified': True
        }

        if nickname in self.users:
            self._sync_user(nickname, info)
        if nickname in self._pending['whois']:
            self._whois_info[nickname].update(info)
<commit_msg>Fix missing coroutine in pydle.features.account.<commit_after>## account.py
# Account system support.
from pydle import async
from pydle.features import rfc1459

class AccountSupport(rfc1459.RFC1459Support):

    ## Internal.

    def _create_user(self, nickname):
        super()._create_user(nickname)
        if nickname in self.users:
            self.users[nickname].update({
                'account': None,
                'identified': False
            })

    def _rename_user(self, user, new):
        super()._rename_user(user, new)
        # Unset account info to be certain until we get a new response.
        self._sync_user(new, { 'account': None, 'identified': False })
        self.whois(new)


    ## IRC API.

    @async.coroutine
    def whois(self, nickname):
        info = yield from super().whois(nickname)
        info.setdefault('account', None)
        info.setdefault('identified', False)
        return info


    ## Message handlers.

    @async.coroutine
    def on_raw_307(self, message):
        """ WHOIS: User has identified for this nickname. (Anope) """
        target, nickname = message.params[:2]
        info = {
            'identified': True
        }

        if nickname in self.users:
            self._sync_user(nickname, info)
        if nickname in self._pending['whois']:
            self._whois_info[nickname].update(info)

    @async.coroutine
    def on_raw_330(self, message):
        """ WHOIS account name (Atheme). """
        target, nickname, account = message.params[:3]
        info = {
            'account': account,
            'identified': True
        }

        if nickname in self.users:
            self._sync_user(nickname, info)
        if nickname in self._pending['whois']:
            self._whois_info[nickname].update(info)

{'fraction_non_alphanumeric': 0.11065573770491803, 'fraction_numerical': 0.01092896174863388, 'mean_word_length': 2.177951388888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1520393', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1034, 'n_words': 264}