<commit_before>import pytest
import numpy as np
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
from nnabla.testing import assert_allclose

from nnabla.normalization_functions import _get_axes_excluding


@pytest.fixture("function")
def rng():
    nn.clear_parameters()
    yield np.random.RandomState(313)
    nn.clear_parameters()


def ref_weight_standardization(w, channel_axis, eps, output_stat):
    axes = tuple(_get_axes_excluding(len(w.shape), channel_axis))

    w_mean = w.mean(axis=axes, keepdims=True)
    w_var = w.var(axis=axes, keepdims=True)

    norm = (w - w_mean) / (w_var + eps) ** 0.5

    if output_stat:<commit_msg>pass keyword argument to pytest.fixture to fix PytestDeprecationWarning<commit_after>import pytest
import numpy as np
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
from nnabla.testing import assert_allclose

from nnabla.normalization_functions import _get_axes_excluding


@pytest.fixture(scope="function")
def rng():
    nn.clear_parameters()
    yield np.random.RandomState(313)
    nn.clear_parameters()


def ref_weight_standardization(w, channel_axis, eps, output_stat):
    axes = tuple(_get_axes_excluding(len(w.shape), channel_axis))

    w_mean = w.mean(axis=axes, keepdims=True)
    w_var = w.var(axis=axes, keepdims=True)

    norm = (w - w_mean) / (w_var + eps) ** 0.5

    if output_stat:
{'fraction_non_alphanumeric': 0.09537166900420757, 'fraction_numerical': 0.0070126227208976155, 'mean_word_length': 4.872427983539095, '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': '7243957', 'n_tokens_mistral': 509, 'n_tokens_neox': 484, 'n_words': 116}