View test_benchmark.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pytest | |
from hypothesis import assume, given, strategies as st | |
from hypothesis.errors import InvalidArgument | |
from hypothesis.extra.array_api import DTYPE_NAMES, NUMERIC_NAMES | |
from tests.array_api.common import COMPLIANT_XP, xp, xps | |
from tests.common.debug import find_any, minimal | |
from tests.common.utils import fails_with, flaky |
View hypothesis-array-api.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View wip_hypothesis_array_api_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View health_check_problems.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View wip_hypothesis_array_api_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View unmute_all.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View mersenne_twister.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mersenne: | |
def __init__(self, seed=1234): | |
self.seed = seed | |
self.j = 2 ** 31 - 1 | |
self.k = 16807 | |
self.period = 2 ** 30 | |
def __iter__(self): | |
return self | |
View defaultlist.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from collections.abc import Sequence, MutableSequence | |
class defaultlist(MutableSequence): | |
def __init__(self, default_factory=None): | |
self._ddict = defaultdict(default_factory or defaultlist._none_factory) | |
@staticmethod | |
def _none_factory(): | |
return None |
View bins.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections.abc import MutableMapping | |
from bisect import bisect_left | |
class Bins(MutableMapping): | |
def __init__(self, intervals): | |
empty_bins = {interval: 0 for interval in intervals} | |
self._dict = empty_bins | |
def __getitem__(self, key): | |
interval = self._roundkey(key) |
View randtests_refimpl.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
from collections import defaultdict | |
from itertools import accumulate | |
from itertools import product | |
from math import erfc | |
from math import floor | |
from math import log | |
from math import log2 | |
from math import sqrt | |
from typing import Iterator |