sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
17k
content
stringlengths
1
200k
7737910cfb3596f272573e9778bbbfca73c31784841468e92212dd9883247fde
Python
52,379
1,675
""" ================================================== Laguerre Series (:mod:`numpy.polynomial.laguerre`) ================================================== This module provides a number of objects (mostly functions) useful for dealing with Laguerre series, including a `Laguerre` class that encapsulates the usual arit...
273f9e9b41831e37b187c16254461c700315e31079069f6441550c335b8135c6
Python
52,484
1,552
""" C declarations, CPP macros, and C functions for f2py2e. Only required declarations/macros/functions will be used. Copyright 1999 -- 2011 Pearu Peterson all rights reserved. Copyright 2011 -- present NumPy Developers. Permission to use, modify, and distribute this software is given under the terms of the NumPy Lice...
459efb0279b3d9f39f67b2aeb62d7de7c9989d38344ec571207b476163c57ba6
Python
52,694
1,194
"""Independent Component Analysis by Entropy Bound Minimization (ICA-EBM). This code is based on :cite:t:`Li2010A` and converted matlab versions provided by the MLSP Lab at the University of Maryland, which is available here: https://mlsp.umbc.edu/resources.html. (:cite:t:`yang2025flexible`) H. Yang, T. Vu, Ehsan Ah...
c6c6286b0bf32b8100d9021876d9392b2ac591409ee244ade703ad5c29bfbf5b
Python
52,820
1,499
""" Implementation of optimized einsum. """ import itertools import operator from numpy._core.multiarray import c_einsum from numpy._core.numeric import asanyarray, tensordot from numpy._core.overrides import array_function_dispatch __all__ = ['einsum', 'einsum_path'] # importing string for string.ascii_letters wou...
cdc142e4e15119903daf9de05ca985654415d28fd3d4191d4d72d9f2f1b460b0
Python
52,890
1,229
import itertools import pytest import numpy as np from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_raises, suppress_warnings, assert_raises_regex, assert_allclose ) # Setup for optimize einsum chars = 'abcdefghij' sizes = np.array([2, 3, 4, 5, 4, 3, 2, 6,...
cceec66063ab17d266fba34149e9a11907ba5ebbe0edbd50524e95bd478ccbdf
Python
53,176
1,342
#!/usr/bin/env python """ Segmentation Leakage Robustness Analysis for Cytocraft Algorithm This script models a realistic tissue scenario where: - Multiple cell types exist with DIFFERENT chromosome structures (e.g., epithelial, fibroblast, immune cells each with distinct chromatin organization) - Only Type 0 cells...
37fdc3e527496a38cab129aa323de4d988977333cf55b8249333e542c6110658
Python
53,177
1,406
"""Tests for matrix-function spectral observables.""" import numpy as np import pytest from pytest_lazyfixture import lazy_fixture as lf import tensorcircuit as tc def _problem(): energies = np.array([-1.0, 0.2, 1.1]) hamiltonian = np.diag(energies).astype(np.complex64) probes = np.eye(3, dtype=np.compl...
3ef3f46cad052c40d08f5e2edf8d0726eee08734bfd96971846429274cdb3101
Python
53,254
1,517
"""Fortran/C symbolic expressions References: - J3/21-007: Draft Fortran 202x. https://j3-fortran.org/doc/year/21/21-007.pdf Copyright 1999 -- 2011 Pearu Peterson all rights reserved. Copyright 2011 -- present NumPy Developers. Permission to use, modify, and distribute this software is given under the terms of the Nu...
88decbca5d059438e5136dddb92e984bf884a164523cff2dc9d40b76648c5ac2
Python
53,344
1,418
import warnings import pytest import inspect from functools import partial import numpy as np from numpy._core.numeric import normalize_axis_tuple from numpy.exceptions import AxisError, ComplexWarning from numpy.lib._nanfunctions_impl import _nan_mask, _replace_nan from numpy.testing import ( assert_, assert_equa...
d726a1b9d281f41b0e07fa5431cb5af9bafb5c0f26ae589a45d815dcd389ef37
Python
53,771
1,122
# -*- coding: utf-8 -*- # Time : 2023/4/19 14:58 # Author : Regulus # FileName: main.py # Explain: # Software: PyCharm import argparse import time import timm.models import yaml import os import logging from collections import OrderedDict from contextlib import suppress from datetime import datetime from...
bf18e7d5c38772520a24ac68ca206c41363ae461db919b5946e290d8054229ac
Python
53,853
1,201
""" pygments.lexers.python ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Python and related languages. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import keyword from pip._vendor.pygments.lexer import DelegatingLexer, RegexLexer, include, \ ...
3d94b6adbbed9d84d88428c60eea857562e492da3c2115c07bf17e69bc63430f
Python
53,937
1,493
import logging from typing import Dict, Optional, Union import numpy as np import pytorch_lightning as pl import torch import torch.nn as nn from torch.optim import Optimizer from torch.optim.lr_scheduler import LRScheduler from torch_geometric.data import Data from torch_geometric.nn import radius_graph from torch_sc...
7ccb6a17a244c2e6ac05bc35d9d06fdc9647b511b89a87b487baf6cfcdd036c1
Python
53,980
1,174
#!/usr/bin/env python3.7 """Defines FiberSet class. The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ import csv import os...
33a6e3717aff9ba7242ccd68a04415de55cf41e751883611138e198ea34cd389
Python
54,034
1,562
from __future__ import annotations from typing import TYPE_CHECKING, Literal import numpy as np import tifffile from scipy.ndimage import gaussian_filter1d from skimage import filters, morphology from sqlmodel import Session, col, select from cali.logger import cali_logger from cali.sqlmodel import FOV, ROI, DataAna...
30d03bd1488f17d062b17546a6f413b754a3653323efe279a7fe3705a67ee00a
Python
54,256
1,733
from datetime import datetime import warnings import numpy as np import pytest from pandas.core.dtypes.dtypes import CategoricalDtype import pandas as pd from pandas import ( DataFrame, MultiIndex, Series, Timestamp, date_range, ) import pandas._testing as tm from pandas.tests.frame.common import...
d2e0c7bbd7521fd4cc34e3bf84f805ed05283d91e90e036f4ce26cda44325934
Python
54,326
1,128
# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt, # and (in the case of viridis) Eric Firing. # # This file and the colormaps in it are released under the CC0 license / # public domain dedication. We would appreciate credit if you use or # redistribute these colormaps, but do not impose any legal r...
a756d7d7c2fe7d4c1616d9aed09e059da84107d7162c2b1458b91722d43bcc1d
Python
54,466
1,740
""" ============================================================== Hermite Series, "Physicists" (:mod:`numpy.polynomial.hermite`) ============================================================== This module provides a number of objects (mostly functions) useful for dealing with Hermite series, including a `Hermite` clas...
6a1f2950b4c5f2e629bcbd20d82fd01e1ded8b727adbe2a44a6b5c86b6157cdf
Python
54,654
1,564
""" Built-in pipeline """ import time import logging import logging.config import shutil import os import matplotlib matplotlib.use('Agg') # supress PCA unpickle userwarning # Cat: TODO: this is dangersous, may wish to fix the problem in cluster.py # import warnings # warnings.filterwarnings("ignore", category=UserWa...
d6995a216a6f460019e25ac5c8caf19d5eda6ddff6106e440cded2b67c4645e2
Python
54,823
1,642
"""Evoked experiment correlation and synchrony plots. Sorted combined plots where stimulated ROIs are shown first, followed by non-stimulated ROIs, to visualize network clustering. """ from __future__ import annotations import contextlib from typing import TYPE_CHECKING import numpy as np import pyqtgraph as pg fro...
cf49c22bd75b17cc30dd1a00dcc870657e7f044f9617c00017cebbd9ed989d5b
Python
54,859
1,606
from datetime import ( date, datetime, ) import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, bdate_range, ) import pandas._testing as tm from pandas.tests.groupby import get_groupby_method_args def test_apply_func_that_appends_g...
b9dcc54ab8bed3b417815d2ffb11c9dc2c7cc0abc925aa02072c80c30220ea03
Python
54,899
1,511
from datetime import ( date, datetime, timedelta, ) from functools import partial from io import BytesIO import os import re import numpy as np import pytest from pandas.compat import is_platform_windows from pandas.compat._constants import PY310 from pandas.compat._optional import import_optional_depende...
3ded31374bf51f860fcf9e56219b39b7257acc9c1192b2da93fc75c571fa7414
Python
54,906
1,425
import operator import numpy as np import pytest from pandas.errors import ( NumExprClobberingError, UndefinedVariableError, ) import pandas.util._test_decorators as td import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, date_range, ) import pandas._testing as t...
f04350a435a233411287c1191275f3c3f5ed6d45221688ef162ecc399135e9d6
Python
55,181
1,747
""" Generic data algorithms. This module is experimental at the moment and not intended for public consumption """ from __future__ import annotations import decimal import operator from textwrap import dedent from typing import ( TYPE_CHECKING, Literal, cast, ) import warnings import numpy as np from pan...
3d0fc481df67f634a0b671906321782b98f69d8c21508ba584f9f28a691dafe9
Python
55,212
1,873
"""Built-in template filters used with the ``|`` operator.""" import math import random import re import typing import typing as t from collections import abc from inspect import getattr_static from itertools import chain from itertools import groupby from markupsafe import escape from markupsafe import Markup from m...
c632461eeede653fca5ff2c02fef14053153c6a17066825465eb5056b6e327b8
Python
55,297
1,444
import sys import warnings import functools import operator import pytest import numpy as np from numpy._core._multiarray_tests import array_indexing from itertools import product from numpy.exceptions import ComplexWarning, VisibleDeprecationWarning from numpy.testing import ( assert_, assert_equal, assert_raise...
de754e70c03e20565df4d6390111110693dedfa9ce583245454ce0eacd9a7ea6
Python
55,350
1,702
"""Tests for correlation plot mouse event handlers. This module tests that: 1. Hover handlers accept pg.Point directly (not via event.scenePos()) 2. Click handlers accept MouseClickEvent with ev.scenePos() method 3. All correlation plots emit roiSelected signal on click 4. Handlers are properly connected/disconnected ...
806accc82a7d61a699ea6fe14ed9b514d2ba60af2607412ba51f23f9602a0809
Python
55,369
1,257
import numpy as np import contextlib import os import inspect import pandas as pd import warnings from typing import Literal from causarray.DR_estimation import AIPW_mean, cross_fitting from causarray.gcate_glm import loess_fit, ls_fit import causarray.gcate_glm as _gcate_glm # for _backend_override from causarray.DR_...
e7af4963b3e3978e778973ffb71ae592d5725321f5091ff7ebbeddb9edac7f05
Python
55,511
1,567
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for numeric dtypes from __future__ import annotations from collections import abc from datetime import timedelta from decimal import Decimal import operator import numpy as np import pytest import pandas as p...
e12e8f10abd1824d142d2a339f7edc3ac87aa219c41d9df2692184a740e687d9
Python
55,554
1,672
""" test .agg behavior / note that .apply is tested generally in test_groupby.py """ import datetime import functools from functools import partial import re import numpy as np import pytest from pandas.errors import SpecificationError from pandas.core.dtypes.common import is_integer_dtype import pandas as pd from ...
fee0f40f4955c99e0e4d90e6cb535e64ccf021f251c655dbae96589d27b81902
Python
55,584
1,220
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import contextlib import glob import hashlib import json import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading...
052746ab0181f04210a4b99368fe47f42e1e3f5200466cb8a9b1370eb8b19f21
Python
55,621
1,316
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import os import re from pathlib import Path import scipy.stats as sts from statsmodels.stats.multitest import multipletests from collections.abc import Iterable from scipy.optimize import curve_fit from matplotlib.ticker impor...
815269c68884698e6471af2e980911b7a033d8bd062b77dfc2307adc42c6eb63
Python
55,634
1,650
from __future__ import annotations from typing import ( TYPE_CHECKING, Any, Callable, Literal, overload, ) import warnings import numpy as np from pandas._libs import ( lib, missing as libmissing, ) from pandas._libs.tslibs import is_supported_dtype from pandas._typing import ( ArrayL...
8f663326268c5867cfd486d1e5d8d0c803df5324417ea2cf4dd75bc14fb31180
Python
55,739
1,476
""" SMI: Standard Model Imaging class """ import os import sys from math import comb import numpy as np import itertools import scipy.ndimage as snd import scipy.cluster.hierarchy as sch import scipy.special as scp import scipy.linalg as scl import scipy.io as sio import scipy.optimize as sco import warnings class S...
9de3504e38104048b8e8dcc1e16aa1849c4c556658a264c8751495d7e7d97df0
Python
55,890
1,307
import os import warnings import random import torchvision.datasets import braincog.datasets.ucf101_dvs try: import tonic from tonic import DiskCachedDataset except: warnings.warn("tonic should be installed, 'pip install git+https://github.com/FloyedShen/tonic.git'") import torch import torch.nn.function...
57b8f3ffa1969221e4fa9d6a363e175fe7fee1b259337436efc68f472d6ad7d0
Python
56,015
1,754
from typing import Any import numpy as np import pytest from pytest_lazyfixture import lazy_fixture as lf import sympy import tensornetwork as tn import tensorcircuit as tc from tensorcircuit.simplify import _full_light_cone_cancel from tensorcircuit.symbolgates import ( sym_cphase, sym_cr, sym_crx, s...
3ee0dddecef0febe7807620b5ca421785314c649729473cdfaf1d5abf9868e4f
Python
56,064
1,416
"""Tests for the array padding functions. """ import pytest import numpy as np from numpy.testing import assert_array_equal, assert_allclose, assert_equal from numpy.lib._arraypad_impl import _as_pairs _numeric_dtypes = ( np._core.sctypes["uint"] + np._core.sctypes["int"] + np._core.sctypes["float"] ...
5b157155d5cbd568a741dc6e2a9dd905bd853ecac778cdf0cebdd0605620b87c
Python
56,211
1,621
""" Methods for abstract circuits independent of nodes, edges and contractions """ # pylint: disable=invalid-name import json import logging from copy import deepcopy from functools import reduce from operator import add from typing import ( Any, Callable, Dict, List, Optional, Sequence, T...
062b28098fe2ffa30b075987c45a2fd5b121cddc9792a11addec469b1ed2f79e
Python
56,693
1,461
from __future__ import division import torch import math import random import numpy as np import numbers import collections import warnings import PIL from . import functional as F Sequence = collections.abc.Sequence Iterable = collections.abc.Iterable __all__ = [ "Compose", "ToTensor", "ToCVImage", "Normalize",...
998f3eb668b96ea067817c217d3352db1ff57f09dc2cfde2a344f01f04fe9f99
Python
56,862
1,657
from collections.abc import Iterator from functools import partial from io import ( BytesIO, StringIO, ) import os from pathlib import Path import re import threading from urllib.error import URLError import numpy as np import pytest from pandas.compat import is_platform_windows import pandas.util._test_decor...
d2b1b9fcb99af0c108b3f97f192f20d1e0e100bb24e7fc28920f48bb346f491b
Python
57,218
1,702
""" test with the .transform """ import numpy as np import pytest from pandas._libs import lib from pandas.core.dtypes.common import ensure_platform_int import pandas as pd from pandas import ( Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, concat, date_range, ) import ...
6d6993d179198a1cad890d55f3e5cde2d9649af190c3f9c176f552c0a24dbc94
Python
57,249
609
{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "9f14ea5c", "metadata": {}, "outputs": [], "source": [ "import math\n", "import random\n", "import h5py\n", "import copy\n", "import os \n", "import numpy as np\n", "import keras\n", "import tensorflow a...
c0fe12b6106b2a14ffc3ad9032efddbd8e48eccd0020120ad03da582b9b1a855
Python
57,271
1,277
7# -*- coding: utf-8 -*- """ All the main models and architectures used as classes. This code is planned for NEST 3.2 """ import nest import numpy as np import pandas as pd import os, sys import time sys.path.append(os.path.dirname(__file__)) import tools nest.Install('mymodule3') # nest.Install('mymoduleSOM') class...
b43a772e7aca8cbdb0b3e2700126eccf990a00070d6afef45ec7104a0b30cee7
Python
57,394
1,825
import concurrent.futures import itertools import os import pickle import string import sys import tempfile import numpy as np import pytest from numpy.dtypes import StringDType from numpy._core.tests._natype import pd_NA from numpy.testing import assert_array_equal, IS_WASM, IS_PYPY @pytest.fixture def string_list...
cbfd2e8d8257e078b17c772aa094b63754461e4501b5d762eeb46b7bf86173c4
Python
57,395
1,782
"""module containing integration tests for the distance generatio/comparison workflows""" # from python from unittest import TestCase from unittest.mock import MagicMock from click.globals import push_context from pathlib import Path from itertools import combinations # from dependencies from Bio.SeqFeature import Se...
2828e79f3be795ae88cac2a56ef50ef1b5d2677871c6a7ec91cf42c1e0ddd623
Python
57,446
1,673
from datetime import ( datetime, timedelta, ) from decimal import Decimal import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, DatetimeIndex, Index, NaT, Period, PeriodIndex, RangeIndex, Series, Timedelta, TimedeltaIndex,...
0c2a5e5fef7633a81423182c67cc7cf2109155f8eb18eb548b394dfdfc4630ae
Python
57,450
1,348
import os import warnings import random import torchvision.datasets import braincog.datasets.ucf101_dvs try: import tonic from tonic import DiskCachedDataset except: warnings.warn("tonic should be installed, 'pip install git+https://github.com/FloyedShen/tonic.git'") import torch import torch.nn.function...
52679f6435217478d6b516d6715c2745aec91772f8f8de0d4b13b8214ef08a8b
Python
57,475
1,444
""" Physics-facing density-of-states, thermal, and response estimators. The module separates physical quantities from the numerical reductions in ``tensorcircuit.matrixfunc``. A reader can therefore start from a Hamiltonian, an observable, and a few probes without choosing a recurrence implementation. The lower-level ...
0b4e32916de65b35bea0435febfac5c3f0da084f0aa1247cb7ef9199588a19d6
Python
57,498
1,450
import os import numpy as np import matplotlib.patches as mpatches import matplotlib.pyplot as plt import tqdm import parmap import scipy import networkx as nx import logging import datetime as dt from statsmodels import robust from scipy.signal import argrelmin from sklearn.discriminant_analysis import LinearDiscrimi...
d98984c1fc9774ddc7718054b60f56b2cacf76ac099b3c769a1250b481276c18
Python
57,710
1,494
"""Various hierarchical models for hand movements.""" from itertools import product import numpy as np from scipy.integrate import solve_ivp from src import utils from src.model import single def get_crho(num_neurons, seq_length, clusters): """Set the values for the interneuron connections. The sequences ...
c7bafcfa786761d89fc3f3e3a294f46b8b7df4c4c6ce5381bfe837f07387c629
Python
58,095
1,588
import contextlib import copy import re from textwrap import dedent import numpy as np import pytest from pandas import ( DataFrame, IndexSlice, MultiIndex, Series, option_context, ) import pandas._testing as tm jinja2 = pytest.importorskip("jinja2") from pandas.io.formats.style import ( # isort...
d0fed9047291d26234b5ab72a83087c277dec04122438f1dc2bcd52f63d0024d
Python
58,137
1,754
""" Create the numpy._core.multiarray namespace for backward compatibility. In v1.16 the multiarray and umath c-extension modules were merged into a single _multiarray_umath extension module. So we replicate the old namespace by importing from the extension module. """ import functools from . import overrides from . ...
826aa63e8304e7f0e2e3c36ddbcfc26bec1a6e3325b488e906ed2091595b744a
Python
58,726
1,504
""" Fermion Gaussian state simulator """ from typing import Any, Dict, List, Optional, Sequence, Tuple, Union import numpy as np try: import openfermion except ModuleNotFoundError: pass from .cons import backend, dtypestr, rdtypestr, get_backend from .circuit import Circuit from . import quantum Tensor = A...
093f9f3d99455108f4173c9012c6261c69c3db86b895b3017e437226de05cf3f
Python
58,788
1,156
#SCENIC+ PIPELINE from current Seurat+Singac processed datasets (using un-paired data) export LD_LIBRARY_PATH="/opt/R/3.5.2/lib64/R/lib:$LD_LIBRARY_PATH" import os os.environ['R_HOME'] = "/opt/R/3.5.2/lib64/R/" #Quality control - required for later run SCENIC+ import pybiomart as pbm dataset = pbm.Dataset(name='hsapi...
ee494377289c92c401fd7825fb7500981c33098a2bd40219aa4948713e9d1fff
Python
58,796
1,613
# -*- coding: utf-8 -*- """ This module offers a generic date/time string parser which is able to parse most known formats to represent a date and/or time. This module attempts to be forgiving with regards to unlikely input formats, returning a datetime object even for dates which are ambiguous. If an element of a dat...
4ee68078680c36f3e334b625cb4c2b56007808349f9f4badb4efb4f8d874c033
Python
58,824
1,740
from pathlib import Path from typing import Any from unittest.mock import MagicMock, Mock, patch import pytest import useq from pytestqt.qtbot import QtBot from qtpy.QtCore import Qt from qtpy.QtGui import QStandardItemModel from qtpy.QtWidgets import QApplication, QMessageBox from sqlmodel import Session, create_engi...
9f298c8f533d61eb5016923c7ae56cdc73428f9daff61ae6cefa47e1db68a9bb
Python
58,972
1,217
import numpy as np from pathlib import Path import os from collections import defaultdict import matplotlib.pyplot as plt import pandas as pd import csv import re import librosa from running_mean import RunningStatsArray class CrossCorrelationProcessor: """Class to process cross-correlation data for statistical an...
b44041e66dcb70bf191efeb62afec6e1497d30496bd97f09ae45ef69dca9cc2e
Python
59,073
1,659
from __future__ import annotations from collections.abc import ( Hashable, Iterable, Mapping, Sequence, ) import datetime from functools import partial from io import BytesIO import os from textwrap import fill from typing import ( IO, TYPE_CHECKING, Any, Callable, Generic, Lite...
3ff0518e744a42fcbda7cc1ebeab8049e11fce612771d78249030e56bab16300
Python
59,158
1,627
# pylint: disable=invalid-name import itertools import importlib import os import sys from functools import partial import numpy as np import pytest import tensornetwork as tn from pytest_lazyfixture import lazy_fixture as lf thisfile = os.path.abspath(__file__) modulepath = os.path.dirname(os.path.dirname(thisfile)...
bb1764acf22930cec15942a6c25a15882104d49b4eb3191728275fc4b43a1350
Python
59,617
1,675
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for Period dtype import operator import numpy as np import pytest from pandas._libs.tslibs import ( IncompatibleFrequency, Period, Timestamp, to_offset, ) from pandas.errors import PerformanceW...
e5f6e0d1a32e0db80ea5f6260d307286534a65680d902543740f01438cd95f30
Python
59,654
1,685
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ import itertools import numpy as np import numpy.ma as ma import numpy.ma.mrecords as mrec from numpy._core.overri...
f42c82b448bef5b1e6a7958d15b5d495279ff5f45fcc9b00d06feee0be614d83
Python
59,759
1,502
# encoding: utf-8 # Author : Floyed<Floyed_Shen@outlook.com> # Datetime : 2022/4/10 18:46 # User : Floyed # Product : PyCharm # Project : braincog # File : node.py # explain : 神经元节点类型 import abc import math from abc import ABC import numpy as np import random import torch from torch import nn from ...
0dd6928ea217d2c4dcfb35c5bf775bbaad0a45cab8a9cc4971911b96076d2328
Python
60,265
1,855
from datetime import ( date, datetime, ) from decimal import Decimal import os import numpy as np import pytest from pandas.compat.numpy import ( np_version_gt2, np_version_gte1p24, ) from pandas.errors import IndexingError from pandas.core.dtypes.common import is_list_like from pandas import ( ...
09473696453e5f9f6655d19f8cc0819197a218f2f7bb174e36384d245d93ef06
Python
60,408
1,715
from __future__ import annotations import io import typing import warnings from abc import ABC, abstractmethod from collections import deque from dataclasses import dataclass, field from datetime import timedelta from io import RawIOBase, UnsupportedOperation from math import ceil from mmap import mmap from operator i...
4defaba61f1ba3d83d957b1c084b157ac693e9262ed8e07ff23201395b123794
Python
60,624
1,737
from collections import defaultdict from datetime import datetime from functools import partial import math import operator import re import numpy as np import pytest from pandas.compat import IS64 from pandas.errors import InvalidIndexError import pandas.util._test_decorators as td from pandas.core.dtypes.common im...
bee55edde249d7f7c1a093600e82dd4d80a2a9784c9921f9a871ac7774fb2360
Python
61,257
2,097
from __future__ import annotations from io import ( BytesIO, StringIO, ) from lzma import LZMAError import os from tarfile import ReadError from urllib.error import HTTPError from xml.etree.ElementTree import ParseError from zipfile import BadZipFile import numpy as np import pytest from pandas.compat._optio...
d821021fc7ce6143fb2f1caa95e8441d599eda848de19bc49778631fcb7e4c36
Python
61,363
1,721
""" test date_range, bdate_range construction from the convenience range functions """ from datetime import ( datetime, time, timedelta, ) import re import numpy as np import pytest import pytz from pytz import timezone from pandas._libs.tslibs import timezones from pandas._libs.tslibs.offsets import ( ...
f6786b3fb0a1f8d6c65f4d30bf2af8cb2fae84d1ead8e09ceb48201ab9e2fdf9
Python
61,513
1,672
"""Classes for managing templates and their runtime and compile time options. """ import os import typing import typing as t import weakref from collections import ChainMap from functools import lru_cache from functools import partial from functools import reduce from types import CodeType from markupsafe import Mark...
184ed0384fcdf531c38eeccac7481423d685e212e1d31c010daee12d5b23cbea
Python
61,725
1,536
from __future__ import annotations import collections.abc as cabc import os import sys import typing as t import weakref from datetime import timedelta from inspect import iscoroutinefunction from itertools import chain from types import TracebackType from urllib.parse import quote as _url_quote import click from wer...
50917a7a929819f1aaf5096b47d62e03b10afe623c010da8b1d038521b21d66b
Python
61,824
1,497
from __future__ import annotations from typing import Any import numpy as np SEED_NONE = None SEED_INT = 4579435749574957634658964293569 SEED_ARR: np.ndarray[Any, np.dtype[np.int64]] = np.array([1, 2, 3, 4], dtype=np.int64) SEED_ARRLIKE: list[int] = [1, 2, 3, 4] SEED_SEED_SEQ: np.random.SeedSequence = np.random.SeedS...
9de08511eaacd9de84227e114090e279b4f37544998385d4d2a31dbf15f46579
Python
62,034
1,698
from __future__ import absolute_import from __future__ import division from __future__ import print_function from smac.env.multiagentenv import MultiAgentEnv from smac.env.starcraft2.maps import get_map_params import atexit from warnings import warn from operator import attrgetter from copy import deepcopy import num...
dc09a42fc8dd1450415730e33f7ce8dbbce2de48d72ad06970afa3eb59711d15
Python
62,146
1,843
import os from collections import abc from cycler import Cycler, cycler import numpy as np import pandas as pd from pandas import Index from scipy import stats from scipy.sparse import issparse import matplotlib.pyplot as pl import matplotlib.transforms as tx from matplotlib import patheffects, rcParams from matplot...
527cbd79a643d631917d69a1ea9ebfeb91d27af98d9b5eaf3f406f4f3bc7e614
Python
62,164
1,970
""" Routines for casting. """ from __future__ import annotations import datetime as dt import functools from typing import ( TYPE_CHECKING, Any, Literal, TypeVar, cast, overload, ) import warnings import numpy as np from pandas._config import using_pyarrow_string_dtype from pandas._libs imp...
53c3e5d2bf65dc057deb121299a0e36fe6ef6c2553eb5ae6ef35a24f92fcff08
Python
62,165
2,003
""" ==================================================== Chebyshev Series (:mod:`numpy.polynomial.chebyshev`) ==================================================== This module provides a number of objects (mostly functions) useful for dealing with Chebyshev series, including a `Chebyshev` class that encapsulates the us...
db794b7bdbc7b48c6aab5ac7fba119eaaa8875c27b340b35f7b1e8a88600373e
Python
62,259
1,951
import marimo __generated_with = "0.18.2" app = marimo.App() @app.cell def _(): # Load the files import numpy as np # Load the data files PV_mTCOff = np.load("PV_mTCOff.npy", allow_pickle=True) PV_mTCOn = np.load("PV_mTCOn.npy", allow_pickle=True) SST_mTCOff = np.load("SST_mTCOff.npy", allow...
428cede225607195e9f314af8bf6ac4cc67862e7feef64a9eb3eade5ff95657a
Python
62,553
1,918
import warnings import numpy as np import pandas as pd from scipy.sparse import issparse from scipy.stats.distributions import chi2, norm import matplotlib as mpl import matplotlib.pyplot as pl from matplotlib import gridspec, rcParams from scvelo import logging as logg from scvelo.core import clipped_log, invert, S...
6331c22cd9126bb49a1197221f2604969122a3081083c56fcbf71a70681699fa
Python
62,639
1,813
"""Solver for the image reconstruction problem.""" import hashlib import logging from abc import ABC, abstractmethod from pathlib import Path from typing import Literal import h5py import numpy as np import pint import scipy.stats import xarray as xr from scipy.sparse import csr_array from scipy.spatial import KDTree...
43a2798a75f5d283c1b57fa56e53e5604c6ecf2728bc6afe2c5313ed061ef697
Python
62,692
1,687
""" Discrete Fourier Transforms Routines in this module: fft(a, n=None, axis=-1, norm="backward") ifft(a, n=None, axis=-1, norm="backward") rfft(a, n=None, axis=-1, norm="backward") irfft(a, n=None, axis=-1, norm="backward") hfft(a, n=None, axis=-1, norm="backward") ihfft(a, n=None, axis=-1, norm="backward") fftn(a, ...
1149c474c7de4e15e263a978b21f7205a6d9eb7fcf3b3cb4d734ac87db619f5a
Python
62,855
1,849
# -*- coding: utf-8 -*- """ This module offers timezone implementations subclassing the abstract :py:class:`datetime.tzinfo` type. There are classes to handle tzfile format files (usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ environment string (in all known formats), given ranges (with h...
942dd0718141b738ef990ca0638dc18549a7370e4e9eb697596c363b4eeaa8c0
Python
62,905
1,514
import os, warnings import torchvision.datasets try: import tonic from tonic import DiskCachedDataset except: warnings.warn("tonic should be installed, 'pip install git+https://github.com/BrainCog-X/tonic_braincog.git'") import torch import torch.nn.functional as F import torch.utils import torchvision.data...
121393a85637334517e5d40696d8739050b46fe4799c2561e124f8b69d2c9856
Python
62,938
1,578
""" 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 if (successful) { ...
5a18050b04b1ef3ae84bdad4a03271c22aedf0bec0411dff0ee56a248ae3d129
Python
63,170
1,340
#!/usr/bin/env python3.7 """Defines FiberSet class. The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ import csv import mat...
ae8fd63dc53397158a8e87062e012c7847258db0489e3ceb97cc8f382b7cec6d
Python
63,176
1,917
from __future__ import annotations import operator from operator import ( le, lt, ) import textwrap from typing import ( TYPE_CHECKING, Literal, Union, overload, ) import warnings import numpy as np from pandas._libs import lib from pandas._libs.interval import ( VALID_CLOSED, Interva...
427f0be3584a74eff6c64a533418b67aaa54c7438057705fa9e50aa123a7d1a3
Python
63,198
1,751
from __future__ import annotations from datetime import ( datetime, time, ) from functools import partial from io import BytesIO import os from pathlib import Path import platform import re from urllib.error import URLError from zipfile import BadZipFile import numpy as np import pytest from pandas._config i...
6a5fbfac17a646e1af8a7b2b33a6ad36c1d3989e8351bc36e2ad8ed91bb57017
Python
63,208
153
""" pygments.unistring ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. ...
bd99e0f2bd0f5ad2956fbe23734365122a56cae7afaae7915ad3a102df31eb10
Python
63,884
1,929
""" SparseArray data structure """ from __future__ import annotations from collections import abc import numbers import operator from typing import ( TYPE_CHECKING, Any, Callable, Literal, cast, overload, ) import warnings import numpy as np from pandas._libs import lib import pandas._libs.sp...
f6755d3992a5ae6f2c99545b7c739c99d89e5054b9f10871eb79fb36f9497a33
Python
64,742
2,060
"""Tests for _RunsPanel — runs list, saved-segmentations, and keep-detection flows.""" from __future__ import annotations import gc from pathlib import Path from typing import TYPE_CHECKING import pytest from qtpy.QtCore import QEvent, QPointF, Qt from qtpy.QtGui import QMouseEvent from qtpy.QtWidgets import QDialog...
b3994c2efdd6cbf7dade10753aa51a33887525af5207f5fedf3024416d53bb81
Python
64,812
1,756
"""Array printing function $Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $ """ __all__ = ["array2string", "array_str", "array_repr", "set_printoptions", "get_printoptions", "printoptions", "format_float_positional", "format_float_scientific"] __docformat__ = 'restructuredtext' # #...
216d0ccb59c00c50a96e48cc14b59f5d3dfa3716dcb3d9bb1528a4b121cce237
Python
64,846
1,726
from __future__ import annotations from datetime import datetime import re import numpy as np import pytest from pandas._config import using_pyarrow_string_dtype import pandas as pd from pandas import ( DataFrame, Index, Series, Timestamp, date_range, ) import pandas._testing as tm @pytest.fix...
0b58a5fa6d33b799ec709a9ad1fd0d93a55c1eb5caddf2eb0755dee79325c7ee
Python
65,326
1,526
"""Takes segmented nerve/fascicle, preprocesses the images, creates the perineurium, generates a connectivity map, and creates fibersets.""" # edit to use threedmodel TODO max importance # also may need to move over cuff models from 3D? to see #TODO import argparse import gc import glob import json import math import ...
69694f16a0e4d06d537ce939f845989d4f94e76459c647fd7ae687dcdef3e2be
Python
65,433
1,469
## ........................................................................... ## ## PIMMS (Polymer Interactions in Multicomponent Mixtures) ## Alex Holehouse, Pappu Lab, Holehouse Lab ## Copyright 2015 - 2026 ## ........................................................................... """ Regression tests for the c...
e40e6139b7fbb52bf6dc4d9edf5215845e04d02db60965310cd9337ded43271d
Python
65,614
1,445
#!/usr/bin/env python3.7 """Defines Query class. The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ import cProfile import f...
3c402156deba134b13e1bc92f555982b9db5e5570e8c4f8c0897f5ff10c4fbc7
Python
65,891
1,461
import numpy as np import sys, os, math import datetime as dt import scipy, scipy.signal import parmap from scipy.interpolate import splrep, splev, make_interp_spline, splder, sproot from tqdm import tqdm # doing imports inside module until travis is fixed # Cat: TODO: move these to the top once Peter's workstation wo...
14f78a5b85004a338b07e37bdc77d565656f8aa51b0cfa01a152c24318492631
Python
66,127
2,058
""" Internal module for formatting output data in csv, html, xml, and latex files. This module also applies to display formatting. """ from __future__ import annotations from collections.abc import ( Generator, Hashable, Mapping, Sequence, ) from contextlib import contextmanager from csv import QUOTE_N...
688750eac063f2a5c483de2e5ceee260e830936a8a5b0784ef32b4018f1292d3
Python
66,450
1,463
"""Analysis GUI for configuring analysis settings.""" from __future__ import annotations import os from dataclasses import dataclass from datetime import datetime from typing import TYPE_CHECKING, cast from qtpy.QtCore import Qt from qtpy.QtWidgets import ( QCheckBox, QComboBox, QDoubleSpinBox, QGrid...
26fb2a76faff48aaddce0458c284e5349792fcd58c4930f5f37b1017e950300b
Python
66,544
1,760
""" Test cases for time series specific (freq conversion, etc) """ from datetime import ( date, datetime, time, timedelta, ) import pickle import numpy as np import pytest from pandas._libs.tslibs import ( BaseOffset, to_offset, ) from pandas._libs.tslibs.dtypes import freq_to_period_freqstr ...
289cca95a09dd6311bbb8037f1996db256a801487d9d26dd6ce15d8e9ef429ec
Python
66,557
1,737
# -*- coding: utf-8 -*- """ The rrule module offers a small, complete, and very fast, implementation of the recurrence rules documented in the `iCalendar RFC <https://tools.ietf.org/html/rfc5545>`_, including support for caching of results. """ import calendar import datetime import heapq import itertools import re imp...
04b2330eb45c6830d80695e3f277f0dda21769ba2ce989703e3a277589a1e882
Python
66,558
1,946
from __future__ import annotations import importlib from typing import ( TYPE_CHECKING, Callable, Literal, ) from pandas._config import get_option from pandas.util._decorators import ( Appender, Substitution, ) from pandas.core.dtypes.common import ( is_integer, is_list_like, ) from pand...
bcc3c6bec4b88fd845e98f64dd3ca89b569a1cb6f4ac5999004cb378075e97dc
Python
66,682
1,984
# # Copyright (C) 2012-2023 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl ...
2edbc31b2f065819a5c17f79afdb07a673f16dc46b5d338ee580a84c750e687a
Python
66,696
1,863
# pylint: disable=invalid-name import sys import os from functools import partial os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true" import numpy as np import pytest from pytest_lazyfixture import lazy_fixture as lf import scipy import tensorflow as tf thisfile = os.path.abspath(__file__) modulepath = os.path.dirname...
4dec5994c0e9f8b9b194245e42e1c1e20fe308cf821ca0fe351f45cbf7793547
Python
67,345
2,062
from __future__ import annotations import abc from collections import defaultdict import functools from functools import partial import inspect from typing import ( TYPE_CHECKING, Any, Callable, Literal, cast, ) import warnings import numpy as np from pandas._config import option_context from pa...