<commit_before># -*- coding: utf-8 -*-
from i8c.exceptions import NameAnnotatorError

class Name(object):
    def __init__(self, provider, name):
        assert provider is None or provider
        assert name
        self.provider = provider
        self.name = name

    @property
    def is_shortname(self):
        return self.provider is None

    @property
    def is_fullname(self):
        return not self.is_shortname

    def with_provider(self, provider):
        assert self.is_shortname
        return Name(provider, self.name)

    def __eq__(self, other):
        return not (self != other)

    def __ne__(self, other):
        return (other is None
                or self.provider != other.provider
                or self.name != other.name)

    def __str__(self):
        if self.provider is not None:
            return "%s::%s" % (self.provider, self.name)
        else:
            return self.name

class NameAnnotator(object):
    def visit_toplevel(self, toplevel):
        for node in toplevel.functions:
            node.accept(self)<commit_msg>Add another "# pragma: no cover"<commit_after># -*- coding: utf-8 -*-
from i8c.exceptions import NameAnnotatorError

class Name(object):
    def __init__(self, provider, name):
        assert provider is None or provider
        assert name
        self.provider = provider
        self.name = name

    @property
    def is_shortname(self):
        return self.provider is None

    @property
    def is_fullname(self):
        return not self.is_shortname

    def with_provider(self, provider):
        assert self.is_shortname
        return Name(provider, self.name)

    def __eq__(self, other): # pragma: no cover
        # This comparison is excluded from coverage because it's
        # not currently entered (but it must be defined because
        # we've defined __ne__ below).
        return not (self != other)

    def __ne__(self, other):
        return (other is None
                or self.provider != other.provider
                or self.name != other.name)

    def __str__(self):
        if self.provider is not None:
            return "%s::%s" % (self.provider, self.name)
        else:
            return self.name

class NameAnnotator(object):
    def visit_toplevel(self, toplevel):
        for node in toplevel.functions:
            node.accept(self)
{'fraction_non_alphanumeric': 0.08836023789294817, 'fraction_numerical': 0.0016992353440951572, 'mean_word_length': 2.1953867028493894, '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': '447275', 'n_tokens_mistral': 669, 'n_tokens_neox': 649, 'n_words': 207}