Search is not available for this dataset
repo_id
stringlengths
12
110
file_path
stringlengths
24
164
content
stringlengths
3
89.3M
__index_level_0__
int64
0
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/philox/philox-test-data-gen.c
/* * Generate testing csv files * * cl philox-test-data-gen.c /Ox * philox-test-data-gen.exe * * gcc philox-test-data-gen.c -o philox-test-data-gen * ./philox-test-data-gen * * Requires the Random123 directory containing header files to be located in the * same directory (not included). * */ #include "...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/philox/philox-benchmark.c
/* * Simple benchmark command * * cl philox-benchmark.c /Ox * * gcc philox-benchmark.c -O3 -o philox-benchmark * * Requires the Random123 directory containing header files to be located in the * same directory (not included). */ #include "Random123/philox.h" #include <inttypes.h> #include <stdio.h> #include ...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/philox/LICENSE.md
# PHILOX Copyright 2010-2012, D. E. Shaw Research. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions, an...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/randomkit.c
/* Random kit 1.3 */ /* * Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org) * * The rk_random and rk_seed functions algorithms and the original design of * the Mersenne Twister RNG: * * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, * All rights reserved. * * Redistribution...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/randomkit.h
/* Random kit 1.3 */ /* * Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org) * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limita...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/mt19937-jump.c
#include "mt19937-jump.h" #include "mt19937.h" /* 32-bits function */ /* return the i-th coefficient of the polynomial pf */ unsigned long get_coef(unsigned long *pf, unsigned int deg) { if ((pf[deg >> 5] & (LSB << (deg & 0x1ful))) != 0) return (1); else return (0); } void copy_state(mt19937_state *target...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/mt19937-jump.h
#pragma once #include "mt19937.h" #include <stdlib.h> /* parameters for computing Jump */ #define W_SIZE 32 /* size of unsigned long */ #define MEXP 19937 #define P_SIZE ((MEXP / W_SIZE) + 1) #define LSB 0x00000001UL #define QQ 7 #define LL 128 /* LL = 2^(QQ) */ void mt19937_jump_state(mt19937_state *state); void se...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/mt19937-test-data-gen.c
/* * Generate testing csv files * * cl mt19937-test-data-gen.c randomkit.c * -IC:\Anaconda\Lib\site-packages\numpy\_core\include -IC:\Anaconda\include * Advapi32.lib Kernel32.lib C:\Anaconda\libs\python36.lib -DRK_NO_WINCRYPT=1 * */ #include "randomkit.h" #include <inttypes.h> #include <stdio.h> #define N ...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/mt19937.c
#include "mt19937.h" #include "mt19937-jump.h" void mt19937_seed(mt19937_state *state, uint32_t seed) { int pos; seed &= 0xffffffffUL; /* Knuth's PRNG as used in the Mersenne Twister reference implementation */ for (pos = 0; pos < RK_STATE_LEN; pos++) { state->key[pos] = seed; seed = (1812433253UL * (...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/mt19937.h
#pragma once #include <math.h> #include <stdint.h> #if defined(_WIN32) && !defined (__MINGW32__) #define inline __forceinline #endif #define RK_STATE_LEN 624 #define N 624 #define M 397 #define MATRIX_A 0x9908b0dfUL #define UPPER_MASK 0x80000000UL #define LOWER_MASK 0x7fffffffUL typedef struct s_mt19937_state { u...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/LICENSE.md
# MT19937 Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org) The rk_random and rk_seed functions algorithms and the original design of the Mersenne Twister RNG: Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, w...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/mt19937/mt19937-benchmark.c
/* * cl mt19937-benchmark.c mt19937.c /Ox * Measure-Command { .\mt19937-benchmark.exe } * * gcc mt19937-benchmark.c mt19937.c -O3 -o mt19937-benchmark * time ./mt19937-benchmark */ #include "mt19937.h" #include <inttypes.h> #include <stdio.h> #include <time.h> #define Q 1000000000 int main() { int i; uint32...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/legacy/legacy-distributions.c
/* * This file contains generation code for distribution that have been modified * since Generator was introduced. These are preserved using identical code * to what was in NumPy 1.16 so that the stream of values generated by * RandomState is not changed when there are changes that affect Generator. * * These fun...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/logfactorial.c
#include <math.h> #include <stdint.h> /* * logfact[k] holds log(k!) for k = 0, 1, 2, ..., 125. */ static const double logfact[] = { 0, 0, 0.69314718055994529, 1.791759469228055, 3.1780538303479458, 4.7874917427820458, 6.5792512120101012, 8.5251613610654147, 10.604602902745251, ...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/ziggurat_constants.h
static const uint64_t ki_double[] = { 0x000EF33D8025EF6AULL, 0x0000000000000000ULL, 0x000C08BE98FBC6A8ULL, 0x000DA354FABD8142ULL, 0x000E51F67EC1EEEAULL, 0x000EB255E9D3F77EULL, 0x000EEF4B817ECAB9ULL, 0x000F19470AFA44AAULL, 0x000F37ED61FFCB18ULL, 0x000F4F469561255CULL, 0x000F61A5E41BA396ULL, 0x000F707A755...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/distributions.c
#include "numpy/random/distributions.h" #include "ziggurat_constants.h" #include "logfactorial.h" #if defined(_MSC_VER) && defined(_WIN64) #include <intrin.h> #endif #include <assert.h> /* Inline generators for internal use */ static inline uint32_t next_uint32(bitgen_t *bitgen_state) { return bitgen_state->next_u...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/random_hypergeometric.c
#include "numpy/random/distributions.h" #include "logfactorial.h" #include <stdint.h> /* * Generate a sample from the hypergeometric distribution. * * Assume sample is not greater than half the total. See below * for how the opposite case is handled. * * We initialize the following: * computed_sample ...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/logfactorial.h
#ifndef LOGFACTORIAL_H #define LOGFACTORIAL_H #include <stdint.h> double logfactorial(int64_t k); #endif
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/LICENSE.md
## NumPy Copyright (c) 2005-2017, NumPy Developers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions a...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/random_mvhg_marginals.c
#include "numpy/random/distributions.h" #include <stdint.h> #include <stddef.h> #include <stdbool.h> #include <math.h> #include "logfactorial.h" /* * random_multivariate_hypergeometric_marginals * * Draw samples from the multivariate hypergeometric distribution-- * the "marginals" algorithm. * * This versi...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/distributions/random_mvhg_count.c
#include "numpy/random/distributions.h" #include <stdint.h> #include <stdlib.h> #include <stdbool.h> /* * random_multivariate_hypergeometric_count * * Draw variates from the multivariate hypergeometric distribution-- * the "count" algorithm. * * Parameters * ---------- * bitgen_t *bitgen_state * P...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/splitmix64/splitmix64.orig.c
/* Written in 2015 by Sebastiano Vigna (vigna@acm.org) To the extent possible under law, the author has dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. See <http://creativecommons.org/publicdomain/zero/1.0/...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/splitmix64/splitmix64.h
#include <inttypes.h> typedef struct s_splitmix64_state { uint64_t state; int has_uint32; uint32_t uinteger; } splitmix64_state; static inline uint64_t splitmix64_next(uint64_t *state) { uint64_t z = (state[0] += 0x9e3779b97f4a7c15); z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9; z = (z ^ (z >> 27)) * 0x94d049...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/splitmix64/splitmix64.c
/* Written in 2015 by Sebastiano Vigna (vigna@acm.org) To the extent possible under law, the author has dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. See <http://creativecommons.org/publicdomain/zero/1.0/...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/splitmix64/LICENSE.md
# SPLITMIX64 Written in 2015 by Sebastiano Vigna (vigna@acm.org) To the extent possible under law, the author has dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. See <http://creativecommons.org/publicdomain...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/sfc64/sfc64.c
#include "sfc64.h" extern void sfc64_set_seed(sfc64_state *state, uint64_t *seed) { /* Conservatively stick with the original formula. With SeedSequence, it * might be fine to just set the state with 4 uint64s and be done. */ int i; state->s[0] = seed[0]; state->s[1] = seed[1]; state->s[2] = seed[2]; ...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/sfc64/LICENSE.md
# SFC64 ## The MIT License Adapted from a C++ implementation of Chris Doty-Humphrey's SFC PRNG. https://gist.github.com/imneme/f1f7821f07cf76504a97f6537c818083 Copyright (c) 2018 Melissa E. O'Neill Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated document...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/sfc64/sfc64.h
#ifndef _RANDOMDGEN__SFC64_H_ #define _RANDOMDGEN__SFC64_H_ #include "numpy/npy_common.h" #include <inttypes.h> #ifdef _WIN32 #include <stdlib.h> #endif typedef struct s_sfc64_state { uint64_t s[4]; int has_uint32; uint32_t uinteger; } sfc64_state; static inline uint64_t rotl(const uint64_t value, unsigned in...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/pcg64/pcg64.c
/* * PCG64 Random Number Generation for C. * * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> * Copyright 2015 Robert Kern <robert.kern@gmail.com> * * 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 cop...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/pcg64/pcg64.orig.c
#include "pcg64.orig.h" extern inline void pcg_setseq_128_srandom_r(pcg64_random_t *rng, pcg128_t initstate, pcg128_t initseq); extern uint64_t pcg_rotr_64(uint64_t value, unsigned int rot); extern inline uint64_t pcg_output_xsl_r...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/pcg64/pcg64.orig.h
/* * PCG Random Number Generation for C. * * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> * * 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 * * http://www.apache.org/lice...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/pcg64/pcg64-benchmark.c
/* * cl pcg64-benchmark.c pcg64.c ../splitmix64/splitmix64.c /Ox * Measure-Command { .\xoroshiro128-benchmark.exe } * * gcc pcg64-benchmark.c pcg64.c ../splitmix64/splitmix64.c -O3 -o * pcg64-benchmark * time ./pcg64-benchmark */ #include "../splitmix64/splitmix64.h" #include "pcg64.h" #include <inttypes.h> #inc...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/pcg64/LICENSE.md
# PCG64 ## The MIT License PCG Random Number Generation for C. Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, incl...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/pcg64/pcg64.h
/* * PCG64 Random Number Generation for C. * * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> * Copyright 2015 Robert Kern <robert.kern@gmail.com> * * 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 cop...
0
public_repos/numpy/numpy/random/src
public_repos/numpy/numpy/random/src/pcg64/pcg64-test-data-gen.c
/* * Generate testing csv files * * GCC only * * gcc pcg64-test-data-gen.c pcg64.orig.c ../splitmix64/splitmix64.c -o * pgc64-test-data-gen */ #include "pcg64.orig.h" #include <inttypes.h> #include <stdio.h> #define N 1000 int main() { pcg64_random_t rng; uint64_t state, seed = 0xDEADBEAF; state = seed...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_regression.py
import sys from numpy.testing import ( assert_, assert_array_equal, assert_raises, ) from numpy import random import numpy as np class TestRegression: def test_VonMises_range(self): # Make sure generated random variables are in [-pi, pi]. # Regression test for ticket #986. for mu ...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_seed_sequence.py
import numpy as np from numpy.testing import assert_array_equal, assert_array_compare from numpy.random import SeedSequence def test_reference_data(): """ Check that SeedSequence generates data the same as the C++ reference. https://gist.github.com/imneme/540829265469e673d045 """ inputs = [ ...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_randomstate_regression.py
import sys import pytest from numpy.testing import ( assert_, assert_array_equal, assert_raises, ) import numpy as np from numpy import random class TestRegression: def test_VonMises_range(self): # Make sure generated random variables are in [-pi, pi]. # Regression test for ticket #986...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_smoke.py
import pickle from functools import partial import numpy as np import pytest from numpy.testing import assert_equal, assert_, assert_array_equal from numpy.random import (Generator, MT19937, PCG64, PCG64DXSM, Philox, SFC64) @pytest.fixture(scope='module', params=(np.bool_, np.int8, np.int16, np.int32,...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_extending.py
from importlib.util import spec_from_file_location, module_from_spec import os import pathlib import pytest import shutil import subprocess import sys import sysconfig import textwrap import warnings import numpy as np from numpy.testing import IS_WASM try: import cffi except ImportError: cffi = None if sys...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_generator_mt19937.py
import sys import hashlib import pytest import numpy as np from numpy.exceptions import AxisError from numpy.linalg import LinAlgError from numpy.testing import ( assert_, assert_raises, assert_equal, assert_allclose, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppres...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_direct.py
import os from os.path import join import sys import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_array_equal, assert_raises) import pytest from numpy.random import ( Generator, MT19937, PCG64, PCG64DXSM, Philox, RandomState, SeedSequence, SFC64, defa...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_randomstate.py
import hashlib import pickle import sys import warnings import numpy as np import pytest from numpy.testing import ( assert_, assert_raises, assert_equal, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings, IS_WASM ) from numpy.random imp...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_generator_mt19937_regressions.py
from numpy.testing import (assert_, assert_array_equal) import numpy as np import pytest from numpy.random import Generator, MT19937 class TestRegression: def setup_method(self): self.mt19937 = Generator(MT19937(121263137472525314065)) def test_vonmises_range(self): # Make sure generated ran...
0
public_repos/numpy/numpy/random
public_repos/numpy/numpy/random/tests/test_random.py
import warnings import pytest import numpy as np from numpy.testing import ( assert_, assert_raises, assert_equal, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings, IS_WASM ) from numpy import random import sys class TestSeed: def...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/pcg64-testset-1.csv
seed, 0xdeadbeaf 0, 0x60d24054e17a0698 1, 0xd5e79d89856e4f12 2, 0xd254972fe64bd782 3, 0xf1e3072a53c72571 4, 0xd7c1d7393d4115c9 5, 0x77b75928b763e1e2 6, 0xee6dee05190f7909 7, 0x15f7b1c51d7fa319 8, 0x27e44105f26ac2d7 9, 0xcc0d88b29e5b415 10, 0xe07b1a90c685e361 11, 0xd2e430240de95e38 12, 0x3260bca9a24ca9da 13, 0x9b3cf2e92...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/philox-testset-2.csv
seed, 0x0 0, 0x399e5b222b82fa9 1, 0x41fd08c1f00f3bc5 2, 0x78b8824162ee4d04 3, 0x176747919e02739d 4, 0xfaa88f002a8d3596 5, 0x418eb6f592e6c227 6, 0xef83020b8344dd45 7, 0x30a74a1a6eaa064b 8, 0x93d43bf97a490c3 9, 0xe4ba28b442194cc 10, 0xc829083a168a8656 11, 0x73f45d50f8e22849 12, 0xf912db57352824cc 13, 0xf524216927b12ada 1...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/philox-testset-1.csv
seed, 0xdeadbeaf 0, 0xedc95200e2bd66a5 1, 0x581d4e43b7682352 2, 0x4be7278f5e373eab 3, 0xee47f17991a9e7ea 4, 0x38a7d2ae422f2e2c 5, 0xe2a6730a3b4a8a15 6, 0x1588b7a841486442 7, 0x13ad777246700504 8, 0x14d157e0f5e18204 9, 0xd87c22a7ee8c13f1 10, 0x30cc389ce3542ba1 11, 0xb8a53348955bb2e9 12, 0xc08802e3c454f74f 13, 0xb444f627...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/pcg64-testset-2.csv
seed, 0x0 0, 0xa30febcfd9c2825f 1, 0x4510bdf882d9d721 2, 0xa7d3da94ecde8b8 3, 0x43b27b61342f01d 4, 0xd0327a782cde513b 5, 0xe9aa5979a6401c4e 6, 0x9b4c7b7180edb27f 7, 0xbac0495ff8829a45 8, 0x8b2b01e7a1dc7fbf 9, 0xef60e8078f56bfed 10, 0xd0dbc74d4700374c 11, 0xb37868abbe90b0 12, 0xdb7ed8bf64e6f5f0 13, 0x89910738de7951f 14,...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/sfc64-testset-2.csv
seed, 0x0 0, 0x91959e5fb96a6332 1, 0x3c1dd8a25a7e9f21 2, 0x657bdffc99798d9e 3, 0x1a04de320b19e022 4, 0x65b92af0e5f3c61c 5, 0x9c84070ce8f743c0 6, 0xbb10e573693cdb25 7, 0xd65ea9e76b37fb6b 8, 0x503efd0e76c8ae66 9, 0xd711dcd04c26d0f 10, 0x12f53f435814ac8c 11, 0xb392cd402cfc82bd 12, 0x461764550e06c889 13, 0x716a48b3514e6979...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/pcg64dxsm-testset-2.csv
seed, 0x0 0, 0xd97e4a147f788a70 1, 0x8dfa7bce56e3a253 2, 0x13556ed9f53d3c10 3, 0x55dbf1c241341e98 4, 0xa2cd98f722eb0e0a 5, 0x83dfc407203ade8 6, 0xeaa083df518f030d 7, 0x44968c87e432852b 8, 0x573107b9cb8d9ecc 9, 0x9eedd1da50b9daca 10, 0xb33a6735ca451e3c 11, 0x72830d2b39677262 12, 0x9da8c512fd0207e8 13, 0x1fc5c91954a2672b...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/sfc64-testset-1.csv
seed, 0xdeadbeaf 0, 0xa475f55fbb6bc638 1, 0xb2d594b6c29d971c 2, 0x275bc4ece4484fb1 3, 0x569be72d9b3492fb 4, 0x89a5bb9b206a670c 5, 0xd951bfa06afdc3f9 6, 0x7ee2e1029d52a265 7, 0x12ef1d4de0cb4d4c 8, 0x41658ba8f0ef0280 9, 0x5b650c82e4fe09c5 10, 0x638a9f3e30ec4e94 11, 0x147487fb2ba9233e 12, 0x89ef035603d2d1fb 13, 0xe66ca57a...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/mt19937-testset-2.csv
seed, 0x0 0, 0x7ab4ea94 1, 0x9b561119 2, 0x4957d02e 3, 0x7dd3fdc2 4, 0x5affe54 5, 0x5a01741c 6, 0x8b9e8c1f 7, 0xda5bf11a 8, 0x509226 9, 0x64e2ea17 10, 0x82c6dab5 11, 0xe4302515 12, 0x8198b873 13, 0xc3ec9a82 14, 0x829dff28 15, 0x5278e44f 16, 0x994a7d2c 17, 0xf1c89398 18, 0xaf2fddec 19, 0x22abc6ee 20, 0x963dbd43 21, 0xc2...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/mt19937-testset-1.csv
seed, 0xdeadbeaf 0, 0xc816921f 1, 0xb3623c6d 2, 0x5fa391bb 3, 0x40178d9 4, 0x7dcc9811 5, 0x548eb8e6 6, 0x92ba3125 7, 0x65fde68d 8, 0x2f81ec95 9, 0xbd94f7a2 10, 0xdc4d9bcc 11, 0xa672bf13 12, 0xb41113e 13, 0xec7e0066 14, 0x50239372 15, 0xd9d66b1d 16, 0xab72a161 17, 0xddc2e29f 18, 0x7ea29ab4 19, 0x80d141ba 20, 0xb1c7edf1 ...
0
public_repos/numpy/numpy/random/tests
public_repos/numpy/numpy/random/tests/data/pcg64dxsm-testset-1.csv
seed, 0xdeadbeaf 0, 0xdf1ddcf1e22521fe 1, 0xc71b2f9c706cf151 2, 0x6922a8cc24ad96b2 3, 0x82738c549beccc30 4, 0x5e8415cdb1f17580 5, 0x64c54ad0c09cb43 6, 0x361a17a607dce278 7, 0x4346f6afb7acad68 8, 0x6e9f14d4f6398d6b 9, 0xf818d4343f8ed822 10, 0x6327647daf508ed6 11, 0xe1d1dbe5496a262a 12, 0xfc081e619076b2e0 13, 0x37126563a...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_build_utils/gitversion.py
#!/usr/bin/env python3 import os import textwrap def init_version(): init = os.path.join(os.path.dirname(__file__), '../../pyproject.toml') with open(init) as fid: data = fid.readlines() version_line = next( line for line in data if line.startswith('version =') ) version = versio...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_build_utils/tempita.py
#!/usr/bin/env python3 import sys import os import argparse from Cython import Tempita as tempita # XXX: If this import ever fails (does it really?), vendor cython.tempita def process_tempita(fromfile, outfile=None): """Process tempita templated file and write out the result. The template file is expected ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_build_utils/gcc_build_bitness.py
#!python """ Detect bitness (32 or 64) of Mingw-w64 gcc build target on Windows. """ import re from subprocess import run, PIPE def main(): res = run(['gcc', '-v'], check=True, text=True, capture_output=True) target = re.search(r'^Target: (.*)$', res.stderr, flags=re.M).groups()[0] if target.startswith('...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_build_utils/process_src_template.py
#!/usr/bin/env python3 import sys import os import argparse import importlib.util def get_processor(): # Convoluted because we can't import from numpy.distutils # (numpy is not yet built) conv_template_path = os.path.join( os.path.dirname(__file__), '..', 'distutils', 'conv_template.py' ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_build_utils/__init__.py
# Don't use the deprecated NumPy C API. Define this to a fixed version # instead of NPY_API_VERSION in order not to break compilation for # released SciPy versions when NumPy introduces a new deprecation. Use # in setup.py:: # # config.add_extension('_name', sources=['source_fname'], **numpy_nodepr_api) # numpy_nodep...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/einsumfunc.py
def __getattr__(attr_name): from numpy._core import einsumfunc from ._utils import _raise_warning ret = getattr(einsumfunc, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.einsumfunc' has no attribute {attr_name}") _raise_warning(attr_name, "einsumfunc...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/_dtype_ctypes.py
def __getattr__(attr_name): from numpy._core import _dtype_ctypes from ._utils import _raise_warning ret = getattr(_dtype_ctypes, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core._dtype_ctypes' has no attribute {attr_name}") _raise_warning(attr_name, "_...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/numerictypes.py
def __getattr__(attr_name): from numpy._core import numerictypes from ._utils import _raise_warning ret = getattr(numerictypes, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.numerictypes' has no attribute {attr_name}") _raise_warning(attr_name, "nume...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/_dtype.py
def __getattr__(attr_name): from numpy._core import _dtype from ._utils import _raise_warning ret = getattr(_dtype, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core._dtype' has no attribute {attr_name}") _raise_warning(attr_name, "_dtype") return re...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/_internal.py
from numpy._core import _internal # Build a new array from the information in a pickle. # Note that the name numpy.core._internal._reconstruct is embedded in # pickles of ndarrays made with NumPy before release 1.0 # so don't remove the name here, or you'll # break backward compatibility. def _reconstruct(subtype, sha...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/_utils.py
import warnings def _raise_warning(attr: str, submodule: str = None) -> None: new_module = "numpy._core" old_module = "numpy.core" if submodule is not None: new_module = f"{new_module}.{submodule}" old_module = f"{old_module}.{submodule}" warnings.warn( f"{old_module} is deprec...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/_multiarray_umath.py
from numpy._core import _multiarray_umath from numpy import ufunc for item in _multiarray_umath.__dir__(): # ufuncs appear in pickles with a path in numpy.core._multiarray_umath # and so must import from this namespace without warning or error attr = getattr(_multiarray_umath, item) if isinstance(attr,...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/shape_base.py
def __getattr__(attr_name): from numpy._core import shape_base from ._utils import _raise_warning ret = getattr(shape_base, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.shape_base' has no attribute {attr_name}") _raise_warning(attr_name, "shape_base...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/defchararray.py
def __getattr__(attr_name): from numpy._core import defchararray from ._utils import _raise_warning ret = getattr(defchararray, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.defchararray' has no attribute {attr_name}") _raise_warning(attr_name, "defc...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/umath.py
def __getattr__(attr_name): from numpy._core import umath from ._utils import _raise_warning ret = getattr(umath, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.umath' has no attribute {attr_name}") _raise_warning(attr_name, "umath") return ret
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/records.py
def __getattr__(attr_name): from numpy._core import records from ._utils import _raise_warning ret = getattr(records, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.records' has no attribute {attr_name}") _raise_warning(attr_name, "records") retur...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/numeric.py
def __getattr__(attr_name): from numpy._core import numeric from ._utils import _raise_warning sentinel = object() ret = getattr(numeric, attr_name, sentinel) if ret is sentinel: raise AttributeError( f"module 'numpy.core.numeric' has no attribute {attr_name}") _raise_warnin...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/overrides.py
def __getattr__(attr_name): from numpy._core import overrides from ._utils import _raise_warning ret = getattr(overrides, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.overrides' has no attribute {attr_name}") _raise_warning(attr_name, "overrides") ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/multiarray.py
from numpy._core import multiarray # these must import without warning or error from numpy.core.multiarray to # support old pickle files for item in ["_reconstruct", "scalar"]: globals()[item] = getattr(multiarray, item) # Pybind11 (in versions <= 2.11.1) imports _ARRAY_API from the multiarray # submodule as a pa...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/fromnumeric.py
def __getattr__(attr_name): from numpy._core import fromnumeric from ._utils import _raise_warning ret = getattr(fromnumeric, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.fromnumeric' has no attribute {attr_name}") _raise_warning(attr_name, "fromnum...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/function_base.py
def __getattr__(attr_name): from numpy._core import function_base from ._utils import _raise_warning ret = getattr(function_base, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.function_base' has no attribute {attr_name}") _raise_warning(attr_name, "f...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/arrayprint.py
def __getattr__(attr_name): from numpy._core import arrayprint from ._utils import _raise_warning ret = getattr(arrayprint, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.arrayprint' has no attribute {attr_name}") _raise_warning(attr_name, "arrayprint...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/__init__.py
""" The `numpy.core` submodule exists solely for backward compatibility purposes. The original `core` was renamed to `_core` and made private. `numpy.core` will be removed in the future. """ from numpy import _core from ._utils import _raise_warning # We used to use `np.core._ufunc_reconstruct` to unpickle. # This is...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/core/getlimits.py
def __getattr__(attr_name): from numpy._core import getlimits from ._utils import _raise_warning ret = getattr(getlimits, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.getlimits' has no attribute {attr_name}") _raise_warning(attr_name, "getlimits") ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/__main__.py
# See: # https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e from numpy.f2py.f2py2e import main main()
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/diagnose.py
#!/usr/bin/env python3 import os import sys import tempfile def run_command(cmd): print('Running %r:' % (cmd)) os.system(cmd) print('------') def run(): _path = os.getcwd() os.chdir(tempfile.gettempdir()) print('------') print('os.name=%r' % (os.name)) print('------') print('sys....
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/__init__.pyi
import os import subprocess from collections.abc import Iterable from typing import Literal as L, Any, overload, TypedDict from numpy._pytesttester import PytestTester class _F2PyDictBase(TypedDict): csrc: list[str] h: list[str] class _F2PyDict(_F2PyDictBase, total=False): fsrc: list[str] ltx: list[s...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/cfuncs.py
#!/usr/bin/env python3 """ C declarations, CPP macros, and C functions for f2py2e. Only required declarations/macros/functions will be used. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the Num...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/setup.cfg
[bdist_rpm] doc_files = docs/ tests/
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/common_rules.py
#!/usr/bin/env python3 """ Build common block mechanism for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date:...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/cb_rules.py
#!/usr/bin/env python3 """ Build call-back mechanism for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 2...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/__version__.py
from numpy.version import version
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/auxfuncs.py
#!/usr/bin/env python3 """ Auxiliary functions for f2py2e. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) LICENSE. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RI...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/f2py2e.py
#!/usr/bin/env python3 """ f2py2e - Fortran to Python C/API generator. 2nd Edition. See __usage__ below. Copyright 1999--2011 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRA...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/rules.py
#!/usr/bin/env python3 """ Rules for building C/API module with f2py2e. Here is a skeleton of a new wrapper function (13Dec2001): wrapper_function(args) declarations get_python_arguments, say, `a' and `b' get_a_from_python if (successful) { get_b_from_python if (successful) { callfortran ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/func2subr.py
#!/usr/bin/env python3 """ Rules for building C/API module with f2py2e. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RI...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/crackfortran.py
#!/usr/bin/env python3 """ crackfortran --- read fortran (77,90) code and extract declaration information. Copyright 1999-2004 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESS...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/_isocbind.py
iso_c_binding_map = { 'integer': { 'c_int': 'int', 'c_short': 'short int', 'c_long': 'long int', 'c_long_long': 'long long int', 'c_signed_char': 'signed char', 'c_size_t': 'size_t', 'c_int8_t': 'int8_t', 'c_int16_t': 'int16_t', 'c_int32_t': 'i...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/use_rules.py
#!/usr/bin/env python3 """ Build 'use others module data' mechanism for f2py2e. Unfinished. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. US...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/f90mod_rules.py
#!/usr/bin/env python3 """ Build F90 module support for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 20...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/symbolic.py
"""Fortran/C symbolic expressions References: - J3/21-007: Draft Fortran 202x. https://j3-fortran.org/doc/year/21/21-007.pdf """ # To analyze Fortran expressions to solve dimensions specifications, # for instances, we implement a minimal symbolic engine for parsing # expressions into a tree of expression instances. A...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/capi_maps.py
#!/usr/bin/env python3 """ Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 2005/05/06 10:57:33 $ Pearu Peterso...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/f2py/__init__.py
#!/usr/bin/env python3 """Fortran to Python Interface Generator. """ __all__ = ['run_main', 'compile', 'get_include'] import sys import subprocess import os from . import f2py2e from . import diagnose run_main = f2py2e.run_main main = f2py2e.main def compile(source, modulename='untitled', ...
0
public_repos/numpy/numpy/f2py
public_repos/numpy/numpy/f2py/_backends/_meson.py
from __future__ import annotations import errno import shutil import subprocess from pathlib import Path from ._backend import Backend from string import Template from itertools import chain import warnings class MesonTemplate: """Template meson build file generation class.""" def __init__( self, ...
0
public_repos/numpy/numpy/f2py
public_repos/numpy/numpy/f2py/_backends/_distutils.py
from ._backend import Backend from numpy.distutils.core import setup, Extension from numpy.distutils.system_info import get_info from numpy.distutils.misc_util import dict_append from numpy.exceptions import VisibleDeprecationWarning import os import sys import shutil import warnings class DistutilsBackend(Backend):...
0