sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
55807c7017081daae82df288720af6caa7e31f7b524c449ad8223dd4b2402038
Python
9,563
265
"""Machine type checkers for Proba scitype. Exports checkers for Proba scitype: check_dict: dict indexed by pairs of str 1st element = mtype - str 2nd element = scitype - str elements are checker/validation functions for mtype Function signature of all elements check_dict[(mtype, scitype)] Parameters ----------...
a55ac3d2945d8326e5b489a281311dd097f3cabe74f00bcdb780b6c3ef647207
Python
9,564
259
from __future__ import division from __future__ import print_function import warnings warnings.filterwarnings("ignore") import time import argparse import pdb import pickle import os import shutil import glob import pandas as pd import itertools import numpy as np import matplotlib.pyplot as plt from tools import vide...
12f731f050be6c19d0cc726d2b788ba3d4431235ceb5197dcbf83270940bd7a8
Python
9,566
286
import torch from lgn.g_lib import rotations as rot import warnings from lgn.g_lib import g_tau, g_tensor from lgn.g_lib import g_vec, g_scalar, g_weight, g_wigner_d from lgn.g_lib.cplx_lib import mul_zscalar_zirrep, mul_zscalar_zscalar from lgn.g_lib.cplx_lib import mix_zweight_zvec, mix_zweight_zscalar GTau = g_tau...
cd7d1deeeccb3b5b2e26a66d5e12b0a11ba9396f21770e97f4f464d2270c0caf
Python
9,568
233
# Copyright (C) 2022-2025 Shijiazhuang Xianyu Digital Biotechnology Co., Ltd # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any la...
331786394f00da97df686f1ae745d637d47ffe8e741750b0bf35de484fcf60e9
Python
9,575
252
# This is a BrainVISA process, to use it you have to install it as a “personal” # BrainVISA process: # # mkdir -p ~/.brainvisa/processes # cp SegmentationOfCorpusCallosum.py ~/.brainvisa/processes/SegmentationOfCorpusCallosum.py # # After this is done, it will become available in the brainvisa user interface # ...
188a4e7361d1fb36d6aea14944a03762d6b4b07832a2c23c223370319acc13c9
Python
9,576
261
from typing import List import numpy as np import torch from torch.autograd import Variable from torch.nn import Linear as Lin from torch.nn import ModuleList, ReLU from torch.nn import Sequential as Seq from torch_geometric.nn import ( BatchNorm, GATConv, GENConv, GINEConv, NNConv, global_add_...
e25a78d11c14074f26637ba75dd2d9aa2d6f69ef7122b5ed6990d96cfcb5fd44
Python
9,578
286
from __future__ import annotations from concurrent.futures import FIRST_COMPLETED from concurrent.futures import ThreadPoolExecutor from concurrent.futures import wait import copy import datetime import gc import itertools import os import sys from typing import TYPE_CHECKING import warnings import optuna from optuna...
7ac8d3a14c5db6af2275a44d4a5348c3bcb34ce122ea16f201309d3e17b714bf
Python
9,580
310
import os from shutil import copyfile from pathlib import Path import numpy as np import pytest from asreview.models.classifiers import list_classifiers from asreview.state import open_state from asreview.review.factory import get_reviewer ADVANCED_DEPS = {"tensorflow": False} try: import tensorflow # noqa ...
f3232b378fd2114e9587c95bd3fce534f18efe5a2ec5d60e682c61b3b60fa8df
Python
9,585
271
# Copyright 2019 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
3daa4dc48ad363fdc8669b415958d68f006f5b04043a2dcb8d8d938292bd6b44
Python
9,587
326
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from typing import Any import numpy as np import onnx from onnx.backend.test.case.base import Base from onnx.backend.test.case.node import expect class RNNHelper: def __init__(self, **params: An...
69624cd4206a2c675e8983337d725c8de18862cff17b610c2034bf87b5f6ede1
Python
9,588
264
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from torch.nn.modules.batchnorm import _BatchNorm from mmcls.models.utils import make_divisible from ..builder import BACKBONES from .base_backbon...
3c6becd635c82ec86835ab8ce921b56958a289bd7c63847382ae2eb0db7a48d2
Python
9,591
290
#!/usr/bin/env python import click from click_option_group import optgroup, RequiredMutuallyExclusiveOptionGroup import copy import json import numpy as np import os import pandas as pd import pickle import shutil import sys sys.path.insert(0, os.path.join(os.path.abspath(os.path.dir...
81638f4ace0b754b3e1299c1863690f1074e10c9570154e2cafa96603a810bf9
Python
9,592
250
import torch from torch import nn torch.cuda.empty_cache() import datasets import transformers from transformers import activations import pandas as pd import numpy as np from transformers import DistilBertTokenizer, \ DistilBertForSequenceClassification, DistilBertModel, DistilBertPreTrainedModel, Trainer, TrainingArg...
e700ce5c149d96fd658510494c1c4f73b0f97e7348395aad3c74d1a8c419fefc
Python
9,593
223
# Copyright 2019 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
e73c5735b381766c7a0ab8467a64730fe80496ad30a63bdfcea2c4d953151045
Python
9,598
282
"""Windowed local outlier factor.""" __author__ = ["Alex-JG3"] import datetime import numpy as np import pandas as pd from sklearn.neighbors import LocalOutlierFactor from sktime.detection.base import BaseDetector class SubLOF(BaseDetector): """Timeseries version of local outlier factor. The LOF models a...
3d7556ae2e5e8b80f790fc7c22c95c6638b105e838410f1d3270b16d96b679a2
Python
9,604
248
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved. # # 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/licenses/LICENSE-2.0 # # Unless required by appl...
f933b496515f3e29bfb0cd857c8c00ceaf4ee843c2ce2b53ee297a4085cf4429
Python
9,605
236
"""Functions to cluster structures. functions: get_rmsd: Computes the rmsd matrix of the conformers in a list of rdkit mol objects. get_labels_affty: Clusters data in affinity matrix form by assigning labels to data points. get_labels_vector: Clusters data in vectorial form by assigning labels to data poin...
15602859257280ffaa3b839dc8308ec2b0e3e37faeda451fe01c8f1ad6dce23b
Python
9,610
173
from socket import socket, AF_INET, SOCK_STREAM import struct import numpy as np from datetime import datetime, timedelta from collections import defaultdict from functools import reduce from fileManagement import selectClassifierID from classifierClient import ClassifierClient from sampler import up_or_down_sa...
ca9031091b3196ca5f9989bb180f74ff037409863152f4c7d2564fb4817c8cf1
Python
9,611
307
import os import os.path as osp import time import dill import numpy as np import pandas as pd import torch from sklearn.model_selection import train_test_split from torch.optim.lr_scheduler import ReduceLROnPlateau from torch_geometric.data import DataLoader from molucn.dataset.pair import get_num_features from molu...
d941912a07d39fbfa0008f77b16b8a493a16a490a46bd1d48de669e6a7aabf17
Python
9,611
293
# 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
3f6a20207fc3c57b7a5a29144da97c1106d9e9ab7a4dcf6e69d416fcde14fc37
Python
9,612
242
"""Time series kmeans.""" __author__ = ["chrisholder", "TonyBagnall"] from collections.abc import Callable import numpy as np from numpy.random import RandomState from sktime.clustering.metrics.averaging import _resolve_average_callable from sktime.clustering.partitioning import BaseTimeSeriesLloyds from sktime.dist...
def3ff873109673d8c23eecc703337f91fa4812589a529a7d0c1d4c02541d582
Python
9,612
258
""" precision.py This routine generates the simulated precision data which is designed to mimic our behavioural experiment (testing the precision of two cues against one). """ import json import numpy as np import dict_key_definitions as keydefs from extended_ring_model import * from dict_key_definitions import rmke...
d2e448d23596b6442217d58be427dbc3b71408c254b01056b498aae63ee40302
Python
9,614
295
# -*- coding: utf-8 -*- # # seaborn documentation build configuration file, created by # sphinx-quickstart on Mon Jul 29 23:25:46 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
ec9600f2884d112257743c11bf388be2b09df197849ff05e2adfe737bb76e271
Python
9,617
352
#%% [markdown] # # Connectome data #%% import datetime import time import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from pkg.data import load_split_connectome from pkg.io import OUT_PATH from pkg.io import glue as default_glue from pkg.io import sav...
a0d4b59fc58479f5e6988c42783a5185a73870d58207b3e50d52cf070ef195f0
Python
9,619
250
__author__ = ["chrisholder", "TonyBagnall"] from collections.abc import Callable from typing import Any import numpy as np from sktime.dists_kernels._numba_distances.base import ( DistanceAlignmentPathCallable, DistanceCallable, NumbaDistance, ) DerivativeCallable = Callable[[np.ndarray], np.ndarray] ...
a5dcecf07222b61deacf51d74ceed013a92f62c0542d0f0ee298b7a78f17bb79
Python
9,622
290
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
4ba01def50b4ea08df32b4293ed8f203e70092bc1f379f2b79f56a78140ea040
Python
9,623
215
import itertools import math import numpy as np import pandas as pd import scipy.stats from sklearn.linear_model import LinearRegression from figures.figure1 import find_leaves from figures.util import produce_figure, main_regions, get_subplots, plot_grid, \ plot_annotations, plot_scatter CORRELATION_THRESHOLD =...
0c5ef18872c30077befe651b8c1586a5fbbb671fcd917c0824d5f7abea9e6544
Python
9,624
279
from copy import deepcopy from itertools import compress import colorednoise as cn from mne.time_frequency import tfr_array_morlet import numpy as np import pytorch_lightning as pl from sklearn.preprocessing import QuantileTransformer, StandardScaler import torch from torch.utils import data from .feature_extraction ...
310b579690f309235399f72d2ca5019571f7a3175ec2e08e3bd0675117173775
Python
9,636
278
"""Multi Channel Deep Convolutional Neural Classifier (MCDCNN).""" from copy import deepcopy import numpy as np from sklearn.utils import check_random_state from sktime.classification.deep_learning.base import BaseDeepClassifier from sktime.networks.mcdcnn import MCDCNNNetwork class MCDCNNClassifier(BaseDeepClassi...
23d2c3e63d7bdeec6b3ea9d8cf128e46b366696ae41897a724f10eb606b58e4d
Python
9,637
279
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
aeca90ad39031f353bffbbb4bbaf39bb1cf4b0be8e265340788490708c4ce542
Python
9,638
330
"""Atlas loading: format detection and region weight extraction.""" import re import xml.etree.ElementTree as ET from dataclasses import dataclass from pathlib import Path from typing import Dict, Optional import numpy as np import nibabel as nib from bcblib.imaging.io import is_nifti @dataclass class AtlasSpec: ...
9e44082de7cbdedcd5871d4822f692a1472e4489ea8c530b332ce235b8040c8d
Python
9,653
239
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved. # # 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/licenses/LICENSE-2.0 # # Unless required by appl...
94bb789f126fcd2efad946eb63128b32ad397782393d6d2ea9834efb29da21fe
Python
9,658
251
"""Test suite for numba distances.""" __author__ = ["chrisholder"] from collections.abc import Callable import numpy as np import pytest from numpy.testing import assert_almost_equal from skbase.utils.dependencies import _check_soft_dependencies from sktime.dists_kernels._numba_distances._distance import ( _MET...
e3aa30660d8602720f074c4634a4c69512fecdfcb56007331a42abf1be9fc76e
Python
9,668
275
# Pytorch Geometric class - Aggregation operator for GNNs # SOURCE CODE FOR TORCH_GEOMETRIC.NN.AGGR.BASE from typing import Optional, Tuple import torch from torch import Tensor from torch_geometric.nn.inits import reset from torch_geometric.utils import softmax, to_dense_batch from torch_scatter import scatter, segm...
85d6e516da3770a30d5950b05bb095b47115413fb7ede33323fdfce4e2d2f805
Python
9,669
282
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import dataclasses import numpy as np from onnx.reference.op_run import OpRun @dataclasses.dataclass class PrepareContext: boxes_data_: np.ndarray | None = None boxes_size_: int = 0 score...
cf73fd04680d3e880985f3c8bf1d881d2bbca1e29623a8235f0f0e69e7d97d10
Python
9,672
274
"""Multi Layer Perceptron Network (MLP) for classification.""" __all__ = ["MLPClassifier"] from copy import deepcopy from sklearn.utils import check_random_state from sktime.classification.deep_learning.base import BaseDeepClassifier from sktime.networks.mlp import MLPNetwork class MLPClassifier(BaseDeepClassifie...
bec06c40016f48e51b21bb693b4bfca5c5487ce2cae96babce4506a34ba472c2
Python
9,678
321
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
89d718208e007077cc76b2ea684165f0daabb46a3bccc1f4a7b0a7a6a68df16f
Python
9,679
232
import csv import os import math import yaml import logging import datetime from shutil import copyfile import torch import wandb from src.utils.ensure_dir import ensure_dir from src.utils.visualization import WriterTensorboardX class BaseTrainer: """ Base class for all trainers """ def __init__(se...
d8866c55cd934f8b625e45d9241ce5c4e67559e5f4f764f865b0bde78f26109c
Python
9,681
251
""" This plots figure 6h of the paper. This is the psychometric fit of the behaviour output of the trained model after inactivating MOs neurons Internal notes: This is from notebook 21.21c-simulate-inactivation-MOs-hemisphere-unilateral-model Note that it currently requires xarray == 0.16.2 TODO: there are some pickl...
d652857a277af62ffca0876cde6a20fdb5cf53759f93849a54dfd21d8a125411
Python
9,698
217
# Copyright 2019 Martin Haesemeyer. All rights reserved. # # Licensed under the MIT license """ Module to parse experimental file structure extracting relevant acquisition information """ from datetime import datetime from os import path, listdir from typing import Any, Dict, List, Tuple, Optional class LineParse...
de5e5624c063626544604f788ce11f784e1b7fc814cbfe196fbdbbf40595892d
Python
9,699
233
import os import h5py import nibabel as nb import numpy as np import torch import torch.utils.data as data from torchvision import transforms import utils.preprocessor as preprocessor # transform_train = transforms.Compose([ # transforms.RandomCrop(200, padding=56), # transforms.ToTensor(), # ]) class Imdb...
5715bd5f61d2a89e090228f9122c40ddc6b354532ab7f80798f09fd81f6b97b7
Python
9,700
284
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 Google Inc. # # 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/licenses/LICENSE-2.0...
369396bcc816ba044c7b633bbbcccb2d20b6ddb69e7d01f5685f61f433ba425a
Python
9,701
230
""" Module for all network models with tensorflow dependency """ import numpy as np import tensorflow as tf import tensorflow.keras as keras from tensorflow.keras import layers, regularizers, initializers from typing import Optional, Union, Tuple from sklearn.linear_model import LinearRegression class NotInitialized(...
749b9f8e5c4cde5d4e8ab7b0718e6df113c31e863681537fb5c0580cd4c3e995
Python
9,704
227
# -*- coding: utf-8 -*- import unittest from onmt.inputters.audio_dataset import AudioSeqField, AudioDataReader import itertools import os import shutil import torch import torchaudio from onmt.tests.utils_for_tests import product_dict class TestAudioField(unittest.TestCase): INIT_CASES = list(product_dict( ...
41f814b559478c1094baadf80b577b782ef6614d84dbce01eb9ffd7b6294a0a8
Python
9,709
255
import logging import typing from pathlib import Path from typing import Any, Optional, Union import torch from torch import nn from torch.utils.data.dataset import Dataset from tqdm import tqdm import flair import flair.embeddings from flair.data import Corpus, Dictionary, Sentence, _iter_dataset from flair.datasets...
7e7ca2224ee1c1b21e4b6487256da5d98805c1643ab98f8ed5ca4d0188e2e29d
Python
9,713
283
''' Functions for visualising abnormalities and D_RS in continuous iEEG data. Gabrielle M. Schroeder CNNP Lab, Newcastle University May 2023 ''' import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.axes_grid1.inset_locator import inset_axes import sklear...
74a41eee2bb943fd5728cf790bcdc07baef9ae59ef777bde0ce7a8a7b548bb74
Python
9,729
244
from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging from types import FunctionType from ray.rllib.utils.annotations import DeveloperAPI from ray.rllib.evaluation.rollout_worker import _validate_multiagent_config from mprl.rl.common.shared_pol_ro...
a9ea90ffb25b5afebb3ce3a4c342b5d3697b59afe358359944f93145db10ef75
Python
9,732
251
__author__ = ["chrisholder", "TonyBagnall"] from typing import Any import numpy as np from sktime.dists_kernels._numba_distances.base import ( DistanceAlignmentPathCallable, DistanceCallable, NumbaDistance, ) class _WddtwDistance(NumbaDistance): """Weighted derivative dynamic time warping (wddtw) d...
39b96d6e2679d1561c43b58ee7e36341fd0888f0db5435cf54b69d4a1d4ef083
Python
9,738
307
# -*- coding: utf-8 -*- # # wordsegment documentation build configuration file, created by # sphinx-quickstart on Tue Aug 11 10:46:02 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
11c61cc4f598ffae6a1094cc82ec826ccb57eb37e17bcbcc6a653efe70bba6c8
Python
9,741
297
""" resnet for 1-d signal data, pytorch version Reference https://github.com/hsd1503/resnet1d/blob/master/resnet1d.py """ import numpy as np from collections import Counter from tqdm import tqdm from matplotlib import pyplot as plt from sklearn.metrics import classification_report import torch import torch.nn as n...
30598f4cf3b1ffb039ffe4accae206f21b09307ade0b6e5e9166355e1e9f327f
Python
9,742
308
# SPDX-License-Identifier: LGPL-3.0-or-later """DeePMD training entrypoint script. Can handle local training. """ import logging import time from typing import ( Any, ) from deepmd.dpmodel.train import ( AbstractTrainEntrypoint, TrainEntrypointOptions, TrainingTaskConfig, iter_training_task_confi...
03505a42681268a8cca853f3fcae553bde6c0eecd459d070bfdd627b17b5bc8c
Python
9,745
236
from typing import Callable, List, Set, Union, Optional, Tuple import numpy as np import logging from .dataset import JetDataset from .utils import ( checkConvertElements, checkDownloadZenodoDataset, firstNotNoneElement, getOrderedFeatures, checkStrToList, checkListNotEmpty, getSplitting,...
c58e873db4485194889a5f0bd6183fd7bdd4cd6f497aa0c320a3f044168beaa7
Python
9,745
274
import argparse import datetime import json import os import time import tqdm import numpy as np import pandas as pd import sklearn.metrics as sm import torch import torch.nn as nn from torch.utils.data import DataLoader from atom3d.datasets import LMDBDataset from scipy.stats import spearmanr from model import CNN...
7b6be98aba7369c208cafb34ee1e8117616c7ac738d22fab258553a8245f811f
Python
9,747
229
import os import copy import logging import numpy as np import scipy as sp import scipy.spatial import pandas as pd import torch from torch.utils.data import Dataset, DataLoader from atom3d.datasets import LMDBDataset, extract_coordinates_as_numpy_arrays from utils import batch_stack, drop_zeros label_names = ['A','B...
c0eeb63eb23bddfdec298aa8008c7bddb552010acb798ce139801efb1fdf5a87
Python
9,748
219
# -*- coding: utf-8 -*- """ Created on Thu December 10 11:41:02 2022 @author: Pawan Panwar, Quanpeng Yang, Ashlie Martini PyL3dMD: Python LAMMPS 3D Molecular Dynamics/Descriptors Copyright (C) 2022 Pawan Panwar, Quanpeng Yang, Ashlie Martini This file is part of PyL3dMD. PyL3dMD is free software: you ...
345ae146717053beb1f40779adf57b9d8abd31cd1ff44f120537c7428da67d68
Python
9,756
291
import torch import torch.nn as nn from lgn.nn.generic_levels import BasicMLP from lgn.nn.position_levels import RadPolyTrig from lgn.nn.mask_levels import MaskLevel from lgn.g_lib import GTau, GVec class InputLinear(nn.Module): """ Input linear layer. This module applies a simple linear mixing matrix t...
f985c1e850281dffbad1d3973578995b1d7b97bab3f081e2157d80f5b84b52be
Python
9,757
292
import torch import torch.nn as nn from lgn.nn.generic_levels import BasicMLP from lgn.nn.position_levels import RadPolyTrig from lgn.nn.mask_levels import MaskLevel from lgn.g_lib import GTau, GVec class InputLinear(nn.Module): """ Input linear layer. This module applies a simple linear mixing matrix t...
ac7d632d6e58cca95099a79f49582e0859449be0667acd2ffcd8251ea27ac3a2
Python
9,759
271
# SPDX-License-Identifier: LGPL-3.0-or-later """Vesin graph builders for differentiable and compact deployment inputs. Generic graphs recompute displacements from local neighbor pairs and periodic image shifts, preserving coordinate and cell derivatives. Compact canonical graphs use Vesin's detached displacements for ...
091d66acc1c597c0af1e56dc03e58ba03d465839c6f9503011d4a2ba5e511bad
Python
9,764
279
# Copyright 2018-2026 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # 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/licenses/LICE...
53e73dcd7acb86dc7dbf296df17e7f40a25ac1740c3d77ebefb49639aefb948b
Python
9,766
250
# Copyright 2019 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
8dfbf69fedab77aa490fb055de7c255bced9944dced72c3ee20131c0374a15f1
Python
9,766
280
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
7c3abd50832373f23707d52dbcacdcf5e132724b56e867c13c91583d53af8836
Python
9,767
233
# coding = utf-8 import os import math import random import numpy as np import pandas as pd import torch from .utils.data_utils import data_generator from .base.model import SASA class SASA_Classiffer(object): """ SASA Classiffer References ---------- [1]: https://arxiv.org/abs/2205.03554 P...
49f5dd1574b8a38d7b1ceb8c677baf11f6c33e79d6dbba0baeb3bcb0ea0bc969
Python
9,770
263
""" vector_strength.py - calculate standard vector strength Calculates vector strength and related parameters from a spike train, for the specified frequency Also included are the rate modulation transfer function (rMTF) and the entrainment index (using a standard 0.5/f to 1.5/f window on the ISI distribution) This ...
e61aca288fd2714c6970ed7c6394ab97cbd5bc33a51f20a4f8eb7a2d3f4a19d2
Python
9,770
302
"""Spike time tiling calculation from: Cutts, C.S. and Eglen, S.J., "Detecting Pairwise Correlations in Spike Trains: An Objective Comparison of Methods and Application to the Study of Retinal Waves", The Journal of Neuroscience, October 22, 2014, 34(43):14288-14303 Implementation by P.B. Manis, Ph.D., UNC Chapel Hill...
55babcc619c0e94b8c48196007b2e05975039f1481d2a84b35e0a867e26be4b8
Python
9,779
231
"""PyTorch Lamb optimizer w/ behaviour similar to NVIDIA FusedLamb. This optimizer code was adapted from the following (starting with latest) * https://github.com/HabanaAI/Model-References/blob/ 2b435114fe8e31f159b1d3063b8280ae37af7423/PyTorch/nlp/bert/pretraining/lamb.py * https://github.com/NVIDIA/DeepLearningExampl...
cba57529198ee1008c3e803e699b5f8a4b6b7730b65c2f905da1c9f689fe2b46
Python
9,782
238
import torch.nn as nn import torch, math import torch.nn.functional as F import matplotlib.pyplot as plt import numpy as np import pylab from PIL import Image def calc_mean_std(feat, eps=1e-5): # eps is a small value added to the variance to avoid divide-by-zero. size = feat.size() assert ...
c90344f599741a6ad353db138bde5628f45b04b88dd1ff4bfb94fc642c939ac3
Python
9,786
208
from __future__ import print_function import json import multiprocessing import os import sys import numpy as np import pandas as pd import rdkit.Chem as Chem import rdkit.Chem.AllChem as AllChem from joblib import Parallel, delayed from rdkit import DataStructs, RDLogger from tqdm import tqdm from rdchiral.main imp...
e232f1aa080e5832ee06dff997ec1376464602f19f088866e505dafa63ef974d
Python
9,797
246
"""versatile shortcuts for quick typing in an (i)python shell, or even using ``from cma.s import *`` in interactive sessions. Provides various aliases from within the `cma` package, to be reached like ``cma.s....`` Do not use this module for stable code developments! This may not be actively maintained. """ import...
a9ca0fa2287e92e7f52b0bfa68fb98ac2dd138ff92e423662a16ef8a22409879
Python
9,800
239
from __future__ import annotations import warnings import networkx as nx import numpy as np import pandas as pd import pytest from scipy.sparse import csr_matrix, csgraph, find from sklearn.metrics import pairwise_distances from sklearn.neighbors import NearestNeighbors from numpy.random import BitGenerator, SeedSequ...
6e09a21146c6b7974909ae7d650b02bf0a91ee675fa3944b03e787bdec8266c6
Python
9,803
233
import numpy as np from rdkit import Chem from typing import Set, Any, List, Union idxfunc = lambda a: a.GetAtomMapNum() - 1 bond_idx_fn = lambda a, b, mol: mol.GetBondBetweenAtoms(a.GetIdx(), b.GetIdx()).GetIdx() # Symbols for different atoms ATOM_LIST = ['C', 'N', 'O', 'S', 'F', 'Si', 'P', 'Cl', 'Br', 'Mg', 'Na', '...
a74eb6e7f29fd4d98e663d69cc28a4a12cec1b9281774556f9076fcf59065029
Python
9,807
307
import diversipy as dp import matplotlib.gridspec as grsp import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import iqr from Historia.shared.design_utils import get_minmax from Historia.shared.indices_utils import diff, whereq_whernot from Historia.shared.jsonfiles_utils import loa...
f0eee54ee2f0231a9cfa7f2a907cbd4d57fe664c450ad8838aacddf468fe1d1a
Python
9,810
229
"""This module aims to provide the necessary tools to identify defects and position candidates at bulks and slabs""" from collections import namedtuple import numpy as np from shapely.geometry import Point from shapely.geometry.polygon import Polygon Position = namedtuple('Position', 'type dcoords coords') Atom_A = na...
ba0c071a0d8709b2234c6b8aa28dd2a290a0839bc5e6abb77a880e1a4cf98594
Python
9,816
280
"""Wrappers to convert distance to kernel or kernel to distance.""" __author__ = ["fkiraly"] import numpy as np from sktime.dists_kernels.base import BasePairwiseTransformerPanel SUPPORTED_MTYPES = ["pd-multiindex", "nested_univ", "df-list", "numpy3D"] def _trafo_diag(fun): """Obtain a function which returns ...
f8199da2d3ec9abada45e4d6a43b7b88402f8462087b907634233e3b74e35803
Python
9,827
283
from typing import List, Tuple import os import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['svg.fonttype'] = 'none' # Takes care that texts show up when # importing pdf-plots into Inkcape import numpy as np import pandas as pd import seaborn as sns from src.definitions import RESULTS_DIR, okabe_it...
beb33da53f8313e89b04055bc49b314772b13fce8a2bb81ed6c5ff920dd5ebe4
Python
9,838
147
# create the training data for mention disambiguation from SemEHR from sent_bert_emb_viz_util import load_df, retrieve_section_and_doc_structure from rare_disease_id_util import umls2prefLabelwithDict from collections import defaultdict import pickle import sys import argparse if __name__ == '__main__': ...
54aa4002af10a78c67b8b45cd69e75004a79e282680c00fcf8c07be52a2b2195
Python
9,840
170
from socket import socket, AF_INET, SOCK_STREAM import struct import numpy as np from datetime import datetime, timedelta from collections import defaultdict from functools import reduce from fileManagement import selectClassifierID from classifierClient import ClassifierClient from sampler import up_or_down_sa...
d0463fde8cc209266b1e7a37a5fd9182580d2a93fd4205be6c932cc081d81735
Python
9,843
275
from rdkit import Chem import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix, accuracy_score from sklearn.metrics import roc_auc_score, roc_curve, precision_score, recall_score from torch.optim.lr_scheduler import _LRScheduler #from torch.optim import Adam,...
5c9bcc6c78b48735cc27cffeb55a364ae9d58967f43dc0c3702a36f737a7b256
Python
9,844
328
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
6e2666fcd184d4bf0eee923b85e5e4c9662f576156b180a90e3e1c34aeed1646
Python
9,845
225
import sys from pyontutils.core import Source, LabelsBase, Collector, build from pyontutils.utils import Async, deferred from pyontutils.namespaces import makePrefixes, NCBITaxon, UBERON, nsExact from pyontutils.namespaces import NIFRID, ilx, ilxtr, TEMP, DKT, DKTr, DKTs, MNDBGL, FSCL from pyontutils.combinators import...
351602b477e0ad594c8239c6934760dd057e1f97150415c11f8d7e43201862c7
Python
9,864
225
import sys from pyontutils.core import Source, LabelsBase, Collector, build from pyontutils.utils import Async, deferred from pyontutils.namespaces import makePrefixes, NCBITaxon, UBERON, nsExact from pyontutils.namespaces import NIFRID, ilx, ilxtr, TEMP, DKT, DKTr, DKTs, MNDBGL, FSCL from pyontutils.combinators import...
3e74052127f5878e195eeb51c496c2f6113186758c0415a14ae48090fb73ca92
Python
9,869
214
import os import warnings from datetime import datetime from joblib import Parallel, delayed import numpy as np import pandas as pd import torch from h5py import File with warnings.catch_warnings(): warnings.simplefilter('ignore', category=UserWarning) from joblib import Memory, delayed from torch.utils.data i...
6d53a18a5f597443e06f48f05b76d2aeff417cd406834a221a442563d388fcad
Python
9,870
188
#coding:utf-8 import os import keras os.environ['CUDA_VISIBLE_DEVICES'] = '1' import numpy as np from keras.models import * from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, UpSampling2D, Dropout, Cropping2D from keras.optimizers import * from keras.callbacks import ModelCheckpoint, LearningRateSchedu...
9ef0eab03dbf78535e5080f0e1245d5c28455a1968885a5c282dcde00c8708ca
Python
9,870
336
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
6c9b3e731b77a985e5abf86b006ef1f72a070048b65986372fda05bafc96483c
Python
9,872
269
from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Dict, List, Optional, Sequence, Tuple import anndata as ad import numpy as np import pandas as pd import scipy.sparse as sp import torch from sklearn.model_selection import train_test_split from sklearn.pr...
f163c3a5ec79bf1ecc7650bc2c2af37bbf1e20ef2a5e7a1be0aa0eddb17893e7
Python
9,878
257
import argparse import sys import time from dataclasses import dataclass import numpy as np import pylsl import pyxdf def _create_info_from_xdf_stream_header(header): new_info = pylsl.StreamInfo( name=header["name"][0], type=header["type"][0], channel_count=int(header["channel_count"][0]...
4b6fafe362f6f563ad64ac7acc454f15576aa918498133e993621ba272db37c1
Python
9,882
299
import json from pathlib import Path def get_delim(c): """ Gets the right delimiter from the c node :param c: the c node json object :return: delimiter of the transcription """ if "delim" in c: return c["delim"] else: return None def parse_tran(c, chars, key, add_three_do...
608efc22dac1c79016a4ac260f169638a5bbf38598875f30e639cff8c10ad78d
Python
9,882
297
# -*- encoding: utf-8 -*- from __future__ import print_function from collections import OrderedDict import re # Unified collection point for all empirically-determined biophysical # values. Each value is a tuple (val, source). DATA = OrderedDict() def get(*args, **kwds): """ Get a single value from the database...
a959f9361e37306e4e56468ab9834456bd9a5b5aaf99d94f545700a3ee25e7d7
Python
9,891
246
import ray import numpy as np from trueskill import Rating, quality_1vs1, rate_1vs1 import random from mprl.utility_services.cloud_storage import connect_storage_client, upload_file, get_default_path_on_disk_for_minio_key, maybe_download_object from mprl.rl.common.util import save_model_weights_to_disk_tmp_and_minio, l...
74d4197cb0ee931269ca685876e130d5f2ed5d638464526348d36391cde07151
Python
9,895
287
# This code is an implementation of the model presented in Halnes et al. 2013 # with minor adjustments. import dolfin as df default_init_parameters = {"Na_i": "15.474585472970270", "K_i": "99.892102216365814", "Cl_i": "5.363687689337043", ...
a5ff6ba70273a3c0d188eb9d8e157bc0476c46df01395bb605cd6e8f60b90c16
Python
9,908
315
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
eeb8b6c43ec907dc29bd87fd63b40bb85dfc58c816cdead08ca50438722e1efa
Python
9,919
270
"""Checkpoint resolution and loading for the Tabby backbone. Two on-disk layouts are supported, and every entry point in the repository goes through :func:`load_backbone` so they accept the same things: ``config.json`` + ``model.safetensors`` A Hugging Face snapshot -- what ``save_pretrained`` writes, what ``...
aac5080c4eff0620e8a68047b02bc9107ebcc3a3de8abf894e8253baba7839a9
Python
9,923
262
import argparse from tqdm import tqdm from torch.utils.data import DataLoader from torch.optim.lr_scheduler import MultiStepLR from data import * from model.gat import * # from util.misc import CSVLogger import random import torch import numpy as np import os from typing import Optional parser = argparse.ArgumentPar...
363dcd1b5fdfb49f9488a86890cb12259815a53658fca76d10a18abb4834dc7d
Python
9,934
307
# Copyright 2026 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
6fc21883bf36ef3bc67e74dfc452d33ddb348a9535980783c06f4c1f7fc69ac5
Python
9,936
234
"""BaseEstimator interface to sktime dtw distances in distances module.""" __author__ = ["fkiraly"] import numpy as np from sktime.dists_kernels._numba_distances import pairwise_distance from sktime.dists_kernels.base import BasePairwiseTransformerPanel class DtwDist(BasePairwiseTransformerPanel): r"""Interfa...
816ed2e6190a0f85f902967234369482d9833a81610c4eecc5aa94305617b868
Python
9,939
257
"""Per-region overlap statistics and subject map descriptive stats.""" from typing import Dict import nibabel as nib import numpy as np import pandas as pd from bcblib.imaging.stats import _fraction_covered_array, _weighted_region_mean_array _EMPTY_COLUMNS = [ "region_name", "n_voxels_region", "n_voxels_overla...
052384ac32991b191be0dfe0a6c5e3d907bd8cc96e1793c95c4ed6cbf87665d0
Python
9,943
232
import pandas as pd import numpy as np import tensorflow as tf from tqdm import tqdm import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import LabelEncoder import os import runner def save_runner_result(runner, result, output_dir): model_and_log_path_filepath = os.path.join(output_...
88460bcd1577de397a997b3f732d18650487f0268c5e9bed0778dc58e9e2dc29
Python
9,946
268
# Copyright 2019 DeepMind Technologies Limited # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
faf91f200c023c0b8665047d2018f6740b889c78ea14fa0a8883b005ff42729f
Python
9,952
259
"""Arithmetic with distances/kernels, e.g., addition, multiplication.""" __author__ = ["fkiraly"] import numpy as np from sktime.base import _HeterogenousMetaEstimator from sktime.dists_kernels.base import BasePairwiseTransformerPanel SUPPORTED_MTYPES = ["pd-multiindex", "nested_univ", "df-list", "numpy3D"] class...
73afc1f019e8c3c2dc6d4235450fa89bbd907731104cae90f373d2d06e6418c6
Python
9,955
253
""" @file: shuffle_netv2.py Created on 02.05.19 @project: CrazyAra @author: queensgambit Incorporation of shuffling as in ShuffleNetV2 into the RISE architecture. ShuffleNet V2: Practical Guidelines for EfficientCNN Architecture Design - https://arxiv.org/pdf/1807.11164.pdf """ from mxnet.gluon.nn import HybridSeque...
d756e856f18b4bd0b6eabe91f7314cd1e2b4d62a74242816c6bbe86092ba7d29
Python
9,960
372
"""NIfTI statistical utilities: summary stats, centre of gravity, histograms.""" from typing import Any, Dict, Optional, Tuple, Union import numpy as np import nibabel as nib from scipy.spatial.distance import euclidean from scipy.ndimage import center_of_mass from bcblib.imaging._types import NiftiLike from bcblib....