<commit_before>import unittest


import mock
import numpy

import chainer
from chainer import links
from chainer import testing
from chainer.testing import attr


class accuracy_with_ignore_label(object):

    def __call__(self, y, t):
        return accuracy.accuracy(y, t, ignore_label=1)


@testing.parameterize(*testing.product({
    'evaluator': [accuracy_with_ignore_label(), None],
    'compute_accuracy': [True, False],
    'x_num': [1, 2]
}))
class TestClassifier(unittest.TestCase):

    def setUp(self):
        if self.evaluator is None:
            self.link = links.Classifier(chainer.Link())
        else:
            self.link = links.Classifier(chainer.Link(), evaluator=self.evaluator)
        self.link.compute_accuracy = self.compute_accuracy

        self.x = numpy.random.uniform(-1, 1, (5, 10)).astype(numpy.float32)<commit_msg>Fix import of accuracy function<commit_after>import unittest


import mock
import numpy

import chainer
from chainer import functions
from chainer import links
from chainer import testing
from chainer.testing import attr


class accuracy_with_ignore_label(object):

    def __call__(self, y, t):
        return functions.accuracy(y, t, ignore_label=1)


@testing.parameterize(*testing.product({
    'evaluator': [accuracy_with_ignore_label(), None],
    'compute_accuracy': [True, False],
    'x_num': [1, 2]
}))
class TestClassifier(unittest.TestCase):

    def setUp(self):
        if self.evaluator is None:
            self.link = links.Classifier(chainer.Link())
        else:
            self.link = links.Classifier(chainer.Link(), evaluator=self.evaluator)
        self.link.compute_accuracy = self.compute_accuracy

        self.x = numpy.random.uniform(-1, 1, (5, 10)).astype(numpy.float32)
{'fraction_non_alphanumeric': 0.11307824100513993, 'fraction_numerical': 0.011422044545973729, 'mean_word_length': 3.7223719676549867, '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': '6035443', 'n_tokens_mistral': 559, 'n_tokens_neox': 541, 'n_words': 129}