<commit_before># Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for `neural_tangents/_src/utils/rules.py`."""

import itertools
import logging
import random
from typing import Optional, Sequence
from typing import Tuple
import warnings

from absl.testing import absltest
from absl.testing import parameterized
import jax
from jax import lax
from jax.config import config
from jax.core import Primitive, ShapedArray
from jax.interpreters import ad
import jax.numpy as np
import more_itertools
from neural_tangents._src.utils import rules
from tests import test_utils
import numpy as onp


config.parse_flags_with_absl()
config.update('jax_numpy_rank_promotion', 'raise')


_PRECISIONS = [
    None,
    # lax.Precision.HIGHEST,
    # lax.Precision.HIGH,
    # lax.Precision.DEFAULT
]<commit_msg>Fix random seed in rules_test<commit_after># Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for `neural_tangents/_src/utils/rules.py`."""

import itertools
import logging
import random
from typing import Optional, Sequence
from typing import Tuple
import warnings

from absl.testing import absltest
from absl.testing import parameterized
import jax
from jax import lax
from jax.config import config
from jax.core import Primitive, ShapedArray
from jax.interpreters import ad
import jax.numpy as np
import more_itertools
from neural_tangents._src.utils import rules
from tests import test_utils
import numpy as onp


config.parse_flags_with_absl()
config.update('jax_numpy_rank_promotion', 'raise')


random.seed(1)


_PRECISIONS = [
    None,
    # lax.Precision.HIGHEST,
    # lax.Precision.HIGH,
    # lax.Precision.DEFAULT
]
{'fraction_non_alphanumeric': 0.06721128852580766, 'fraction_numerical': 0.0063126624582250275, 'mean_word_length': 4.671578947368421, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4360032', 'n_tokens_mistral': 793, 'n_tokens_neox': 765, 'n_words': 317}