sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
381e7453c4fcec984261327188f3a37ab1d2fad46ef90ca5e15a98e858636c18
Python
8,394
193
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import onnx.shape_inference from onnx import ModelProto, TensorProto, TensorShapeProto, ValueInfoProto, helper from onnx.helper import make_model, make_tensor_value_info class TestSymbolicShape: de...
63835a868b44c7ef7661022d11a067e2d6cf6e2a55933a2f6de374e98c7fa7a6
Python
8,397
222
# SPDX-License-Identifier: LGPL-3.0-or-later """Import released Uni-Mol v1 checkpoints into deepmd. The released files (``mol_pre_all_h_220816.pt`` and ``mol_pre_no_h_220816.pt``, MIT licensed, from the Uni-Mol repository and its Hugging Face mirror) hold a single ``model`` entry with 211 float32 tensors and no traini...
ec097281cf83f53f3250201af3c7cf85325886e87701735f1355add143d92a93
Python
8,399
258
import os import re import sys import difflib import inspect import unittest import subprocess from io import BytesIO from random import shuffle from pathlib import Path from collections import defaultdict import rdflib from ttlser import CustomTurtleSerializer, SubClassOfTurtleSerializer from ttlser import CompactTur...
3a479d3c13c2e3b2118a1f775fac2ff5ed9e3a78aa27cb1db8bec69686b2589b
Python
8,400
229
#!/usr/bin/env python import sys import os import math import re from os.path import isfile, join, isdir from os import listdir import csv from kn_common import pipetools,pipedef from kn_pipeline_class import CPipeError,CPipeStep def get_injection_site_location(folder): allfiles_and_folders = listdir(folder) ...
4fff36f00cdc2a9a34a2e10468361dab004f4c691e6c56d8fe1eb7b55e3dd546
Python
8,403
255
import os import sys import time import math from datetime import datetime import random import logging from collections import OrderedDict import numpy as np import cv2 import torch from skimage.feature import peak_local_max from shutil import get_terminal_size import yaml try: from yaml import CLoader as Loader,...
b92f342fb373d760d1e5ed4a954fd086f52ef91fe8e7e9739a7278ed5b8606ac
Python
8,408
234
# Copyright 2022 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...
7aa2b6afe1f68caa223d56399af1855ec974ebec31bd2f9434335ed930604b34
Python
8,410
225
import pandas as pd import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import LinearRegression from sklearn.preprocessing import MinMaxScaler import CRISPRspec_CRISPRoff_pipeline as pipe import pickle def prepare_inputs(config):...
601116545f58b8d2ecc0446995cc104ae37e5beeec626b4a0a5e732d8525feac
Python
8,411
247
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from torch.nn.modules import AvgPool2d from torch.nn.modules.batchnorm import _BatchNorm from mmcls.models.backbones import SEResNet from mmcls.models.backbones.resnet import ResLayer from mmcls.models.backbones.seresnet import SEBottleneck, SE...
f37c0455016f7263ecbf6cd95f51b89ba66382bb20018766e71934259665f64c
Python
8,412
220
# coding=utf-8 # Copyright (C) 2021. Huawei Technologies Co., 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 # # ...
7e3fc29830b16f729bb0adc5585d63665f82fbcaf5ffd97bed99ac9e20a16919
Python
8,413
248
""" Utility methods for datasets. """ from __future__ import annotations import hashlib import sys from pathlib import Path from typing import Any import numpy as np import requests from numpy.typing import ArrayLike def download_progress_bar(file_url: str, file_dest: str): """ Download while outputting a ...
19246fbabf9c1553ff558a42979b1ca318c893d0d458e630b8d64311aa35d578
Python
8,419
214
# Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # import numpy as np from ..datasets import AmpligraphDatasetAdapter, SQLiteAdapt...
e7abda27e960d52b111bea9cedf2ef8718ffb129d566ebd035bd315fae6cdc49
Python
8,423
249
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """BoxCoxBiasAdjustedForecaster implementation.""" __author__ = ["sanskarmodi8"] import pandas as pd from scipy.special import inv_boxcox from sktime.forecasting.base import BaseForecaster from sktime.forecasting.base._delegate import _Delegate...
8ae631ec38e5ba3dfbb5abfa8db693b89d2906a1527b5a5023c03a01e601d2db
Python
8,424
228
import os import numpy as np import tensorflow as tf def create_callbacks( network_name, tensorboard=False, **update_parameters, ): CSVlogger_path = os.path.join( update_parameters["save_model_path"], "val_result.csv" ) # if os.path.isfile(self.CSVlogger_path): os.remove(self.CSVlogg...
b4c3b6491dbb62d6742dc74a524d153afea2b5eec82428ff0e0cd4fdf3478064
Python
8,429
173
import ray from ray.rllib.agents.trainer import with_common_config, with_base_config from ray.rllib.models.catalog import MODEL_DEFAULTS from ray.rllib.utils import try_import_tf import json import os import pandas as pd import multiprocessing from itertools import repeat from mprl.scripts.poker_parallel_algos.utils...
77a3e631a737b7ec5bc8ef3611c030cbda003b9b2bfc7f0d592749be3c321183
Python
8,433
244
# 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...
61534d9ddfbcc22d05476dd4bab731c69dd66f2bdf77601d3d0170bfe3c21f8d
Python
8,441
239
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Converter utilities between dask and pandas, with multiindex convention. Converts between: pd.DataFrames with ordinary (single-level) index or pd.Multiindex, and dask DataFrame If pd.DataFrame has ordinary index, converts using dask compute/fr...
0e4adec4e9facc915776ac2be8fd25d2b7ad24310054d0c5c47274133a3c0b32
Python
8,442
256
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np import onnx from onnx.backend.test.case.base import Base from onnx.backend.test.case.node import expect def argmin_use_numpy(data: np.ndarray, axis: int = 0, keepdims: int = 1) -> ...
b45c630bfaf284acb202a03ead6df116afd7d4593c7dce9e10702204a67c6c0c
Python
8,442
224
"""get_axon_lengths.py - measure lengths of varios axonal compartments from the morphology files. This module is part of *vcnmodel*. Support:: NIH grants: DC R01 DC015901 (Spirou, Manis, Ellisman), DC R01 DC004551 (Manis, 2013-2019, Early development) DC R01 DC019053 (Manis, 2020-2025, Later develop...
70b950d53db30a8200da23be839064030445c4b814b70fd213a6616655f5dec7
Python
8,446
257
# 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...
098af0e63b9830a451a666eaf51fa38782debd19b269adde7340fc044c02b7ad
Python
8,447
192
import argparse import torch import torch.nn.functional as F import torch.optim as optim from sklearn.model_selection import train_test_split import numpy as np import pandas as pd import cv2 import adabound from torch.optim import lr_scheduler from sklearn.metrics import confusion_matrix import seaborn as sns from mat...
d8e0094f16dec2aa243f7dad8b283ce607bf77a524027669c1899d88a5bcaaaf
Python
8,451
221
from functools import cached_property import logging from typing import List, Tuple import pandas as pd import numpy as np from sklearn.model_selection import train_test_split, RepeatedStratifiedKFold from sklearn.linear_model import LinearRegression from sklearn.preprocessing import RobustScaler from sklearn.feature_...
38444927c8a2dbd7ac0da498d8beb18b0d5b83b21b479b19a528d74752d98ac9
Python
8,459
222
# -*- coding: utf-8 -*- import os from tqdm import tqdm import torch from torchtext.data import Field from onmt.inputters.datareader_base import DataReaderBase # imports of datatype-specific dependencies try: import torchaudio import librosa import numpy as np except ImportError: torchaudio, librosa,...
5b4435dcae7e69418b9a337dee33db19756cf0b8fe65d310d5a9324f5c8cce96
Python
8,460
213
# SPDX-License-Identifier: LGPL-3.0-or-later import json import subprocess import sys import tempfile import unittest from pathlib import ( Path, ) import h5py import numpy as np import pytest from deepmd.dpmodel.utils.dist_check import ( compute_min_pair_margin_single, pair_half_thresholds, ) from deepmd...
063ec7083fd145303e6b3061b50a5b302ff4f824a39e04417705d84483827500
Python
8,466
241
from argparse import Namespace from typing import Optional, Tuple import torch import numpy as np from .jet_features import plot_jet_p_cartesian, plot_jet_p_polar from .particle_features import plot_p_cartesian, plot_p_polar from .jet_images import plot_jet_image from .utils import ( get_p_polar, get_p_cartesi...
0f115f866688e19c03e8d09d2fdec9da2757896e303af6433239a5669c3b4591
Python
8,467
178
""" @file: Node.py Created on 13.10.18 @project: crazy_ara_refactor @author: queensgambit Helper class which stores the statistics of all nodes and in the search tree. """ from copy import deepcopy from threading import Lock import chess import numpy as np QSIZE = 100 class Node: # Too many instance attributes (1...
fbbec0a1542fa7a96251260cbe7b0b32df47720678127e612581505ac19b6282
Python
8,467
256
""" Collect data about the speed of one backend (numpy) as we change the number of neurons and the number of components William Nourse December 15th 2021 """ import numpy as np import time import pickle from sns_toolbox.networks import Network from sns_toolbox.neurons import NonSpikingNeuron, SpikingNeuron from sns_to...
d67eb747b2457351c117f7d7528611eb370c4ceae9c82d62509e043bd6cc0e58
Python
8,468
181
import sys import numpy as np import torch import time import pickle from sns_toolbox.neurons import NonSpikingNeuron from sns_toolbox.connections import NonSpikingSynapse from sns_toolbox.networks import Network # Personal stuff to send an email once data collection is finished #sys.path.extend(['/home/sns']) #from ...
110fbf09c277b4814f1b300cfa41c666349e2b5ff4e8d60dc1280e98b1fbaf0a
Python
8,469
212
__author__ = ["chrisholder", "jlines", "TonyBagnall"] import numpy as np from sktime.dists_kernels._numba_distances.base import ( DistanceAlignmentPathCallable, DistanceCallable, NumbaDistance, ) class _MsmDistance(NumbaDistance): r"""Move-split-merge (MSM) distance between two time series. (M...
fccc2f7dffdc793f243a4ffd18c2319c86045cb79050e3503ae379fe728b927c
Python
8,470
222
""" @file: FullRoundTripTests.py Created on 22.08.18 @project: DeepCrazyhouse @author: queensgambit Loads the plane representation for the test dataset and iterates through all board positions and moves. """ import unittest from multiprocessing import Pool from copy import deepcopy import logging import chess import ...
dedcba436cc84d6c8b5ebb2d95de57133c64813ed203fb34ed56d857992f2cb3
Python
8,474
222
""" @file: FullRoundTripTests.py Created on 22.08.18 @project: DeepCrazyhouse @author: queensgambit Loads the plane representation for the test dataset and iterates through all board positions and moves. """ import unittest from multiprocessing import Pool from copy import deepcopy import logging import chess import ...
1d35bb43526bdf5a18ecca661fd3fc9efb704768ed3c37d3862ba946be0cb05b
Python
8,475
205
# 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...
658d7f1ff89e544a10c6db26a9b7637779b81a2f501bed21d6797b918bb2dedd
Python
8,475
256
# 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...
d057f6aae0fd628c40ac6faba26057284febfe1354f12e2fddd7886a2a75f0ea
Python
8,475
282
import torch from torch.nn import Module from lgn.cg_lib import CGModule from lgn.g_lib import g_torch, GWeight, GTau, GScalar, GVec class MixReps(CGModule): """ The module to linearly mix a representation. The input musst have predefined types tau_in and tau_out. Parameters ---------- tau_in...
644dc7193f4627c0da4a3c35e65f59ae784e58fb03bb9ff7b2803b8edc2f5490
Python
8,476
251
# -*- coding: utf-8 -*- """ Module for preprocessing utilities. These are supposed to complement the preproessing utilities that are available with MNE. """ import numpy as np from math import ceil from anlffr.utils import logger, verbose from mne import pick_channels from mne.filter import filter_data @verbose def...
d3c7606d13400b2aa5623f0704848111676bc33e32bbe70286c2d83a6d872bf8
Python
8,476
283
import torch from torch.nn import Module from lgn.cg_lib import CGModule from lgn.g_lib import g_torch, GWeight, GTau, GScalar, GVec class MixReps(CGModule): """ The module to linearly mix a representation. The input musst have predefined types tau_in and tau_out. Parameters ---------- tau_in...
c270256dd3086bbe794af91f3d11a8c846b856a9fac39a2e9a9e602aced582bf
Python
8,481
232
from __future__ import annotations from dataclasses import dataclass from typing import ClassVar import numpy as np import pandas as pd from pandas import DataFrame from seaborn._core.groupby import GroupBy from seaborn._core.scales import Scale from seaborn._stats.base import Stat from typing import TYPE_CHECKING i...
27c326c281f8940d79e0ddfc2acc96e620b3228448797c371a0c54ff8dbe4235
Python
8,482
219
from copy import deepcopy import numpy as np import pandas as pd from cplAE_TE.utils.compute import CCA_extended from cplAE_TE.utils.load_helpers import get_paths, load_dataset from cplAE_TE.utils.tree_helpers import get_merged_ordered_classes from scipy.linalg import sqrtm from sklearn.decomposition import PCA from s...
cc1cb4b71e5ca5313c4f9592a2d44ff8b9c56bca2209ad60ca842fae6858088e
Python
8,493
222
import anndata as ad import numpy import random import scanpy as sc import torch import torch.utils.data as D from src.constants import * import pickle class Dataset(D.Dataset): def __init__(self, modalities, labels): super().__init__() self.modalities = [ torch.tensor(modality, dtype=...
6cc6f8e2cb1032692da967af672db664a043ae84895572d140a954e851145fa6
Python
8,497
293
# 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...
b4800a26e067841c8070e7bdfad385ccaf8b048c03f45e1ee9d316c6610572df
Python
8,497
227
import argparse import logging import os import time import datetime import matplotlib.pyplot as plt import numpy as np import seaborn as sns import pandas as pd import torch import torch.nn.functional as F from torch_geometric.data import DataLoader from model import GNN_PSR from data import GNNTransformPSR from atom...
e750d91f18d6b49a0e549b831c5976eee750db1018ecae1dfeedb30333932780
Python
8,505
234
# Copyright (c) Rahil Gholamipoor # 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 agree...
c3554955017fa0253b5c2ff1895f060587dedc35fba9276dcad253330b73396b
Python
8,506
268
# 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...
29db7b379b80ea8188d483395329377bee6a79fac3a2820a7f18d0064e9d75f2
Python
8,507
266
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 15 18:28:33 2023 Script to plot single problems including lesion and noise plots (Fig. S3, S4) And gifs of units learning positions - Fig. S2 @author: robert.mok """ import os import sys import torch import matplotlib.pyplot as plt import imageio...
4ccecd9477822fc98d89951c90ebfb7dc3aae0c090d59875c9992263de9b7e8f
Python
8,510
204
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 19 13:51:33 2022 @author: sam """ import cv2 import pandas as pd import numpy as np import os from detectron2.config import get_cfg from detectron2.engine import DefaultPredictor from detectron2.utils.visualizer import Visualizer, ColorMode from det...
f7280cb10c91a19908d4fc43b3964d2c285b8cd0a5dfb9e498fc6ec0fc5be10f
Python
8,514
209
"""Zero-shot anomaly detector built on Tabby-Pretrain. The predictor is loaded once, frozen, and only used for forward passes: there is no per-series fitting, so the detector is genuinely zero-shot. Scoring happens in representation space. The frozen encoder embeds the series into per-patch latents (no forecasting), ...
c6c6c543d828c60de1998252bdcb216fa46ce2fce7e1fd9d4766dfc7bfeed578
Python
8,523
259
""" An interface for asynchronous vectorized environments. """ import multiprocessing as mp import numpy as np import ctypes import gym from collections import OrderedDict from rllib.env.vector_env import VectorEnv _NP_TO_CT = {np.float32: ctypes.c_float, np.int32: ctypes.c_int32, np.int8: ...
b3eb53fd573c75a9f7898762574e178c8ccea388f2092b9db8af38bb87217bef
Python
8,528
220
import json import os import pytest from collections import namedtuple from model_archiver.model_packaging_utils import ModelExportUtils from model_archiver.manifest_components.engine import EngineType from model_archiver.manifest_components.manifest import RuntimeType from model_archiver.model_archiver_error import ...
525579ff5e678065931ed0e702af3d76c94c017fea0e3a7b08192949378c8206
Python
8,534
259
#!/usr/bin/env python """CLI for damage_profile: compute overlap statistics between a subject map and one or more brain atlases. Usage (custom atlas directory):: bcb-damage-profile --map lesion.nii.gz --atlas /path/to/atlas --name jhu Usage (preset atlas):: bcb-damage-profile --map lesion.nii.gz --preset ro...
ebea9bf0dd1215084e2fe6a591441e08da146a529e0af7eb0e05050fbfcb228b
Python
8,536
219
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Mon Dec 10 12:39:16 2018 @author: wanglab """ import os, numpy as np, sys, multiprocessing as mp, zipfile from skimage.external import tifffile from skimage import filters import matplotlib.pyplot as plt import SimpleITK as sitk #add your clone of the brain...
27aba55c0f824b4189a1c8edb398ba3139dafbce6328af6296548867bb597e0d
Python
8,544
263
import os import sys import numpy as np from sklearn.cluster import KMeans import numpy as np from sklearn.cluster import KMeans import glob from torch_geometric.data import InMemoryDataset, DataLoader from torch_geometric import data as DATA import torch from rdkit import Chem from rdkit.Chem import MolFromSmiles imp...
1cdd9f11a5cb6cadc1d4b11da86450fcad6eb7ce51092623e875f05ee8b6419e
Python
8,545
136
#create context window and other metadata for a mention identified by NLP (WS or SS) for annotation #generates annotation files for each annotator and the k random samples for all annotators #input: brat files of NLP identified cohort, selected by using step14_select_cohort_brat_documents.py under the main project fo...
e9ecc01a23b5c477fa7cfb56f8ec6b7fc5f4b9d3cbf916a4d7639583faf67e2e
Python
8,546
205
from typing import cast import pytest from flair.data import Sentence from flair.training_utils import CharEntity, TokenEntity, create_labeled_sentence_from_entity_offsets @pytest.fixture(params=["resume1.txt"]) def resume(request, resources_path) -> str: filepath = resources_path / "text_sequences" / request.p...
026030dfba006efcb96589c788e7315dd96d7bb3a69af4032924b96b29f89f04
Python
8,547
268
# 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...
c0f8cd88955b19280a452214b4fb5311be32b724180e78738e6e87f6024bc98c
Python
8,548
185
import sys import numpy as np import torch import time import pickle from sns_toolbox.neurons import NonSpikingNeuron from sns_toolbox.connections import NonSpikingSynapse from sns_toolbox.networks import Network # Personal stuff to send an email once data collection is finished #sys.path.extend(['/home/sns']) #from ...
230aa071ff2c1bcfe22f89a5c3fe0dce2ec759547ec3160b112aa7212d02153c
Python
8,549
239
# Copyright 2018-2025 # 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...
8e64d614e120d838c4fe2cc0bce7b9f9493ee1d611d2047c61790c8873eea7ff
Python
8,549
254
""" Module containing core functions called by ***_runSFA 03 13 2023 Code by R.W. DiTullio and C Parthiban """ import numpy as np import matplotlib.pyplot as plt import soundfile as sf import scipy.ndimage.filters as filt from tqdm import tqdm import SFA_Tools.SFA_Sets as s import SFA_Tools.SFA_eigenspec_fun...
6687ac8e524555ed508634a2e28f837a10d1dd13789ff1faeb8a0b1036fb1c6a
Python
8,551
185
import sys import numpy as np import torch import time import pickle from sns_toolbox.neurons import NonSpikingNeuron from sns_toolbox.connections import NonSpikingSynapse from sns_toolbox.networks import Network # Personal stuff to send an email once data collection is finished #sys.path.extend(['/home/sns']) #from ...
a90d160a2502ad5f1be028928931cf87b1c4469233f1f039974c49282db1ad07
Python
8,551
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...
bab8d28f1d2a3e7303e9b09beb9752f9eaada0fa747c8cc8c5f3691c47152750
Python
8,551
230
# Copyright 2019-2020 The ASReview Authors. 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...
fc1d192c9242942a64752ef7347bc70e4f770d3befa7c0f9e2e33142973a104a
Python
8,551
183
import sys import numpy as np import torch import time import pickle from sns_toolbox.neurons import NonSpikingNeuron from sns_toolbox.connections import NonSpikingSynapse from sns_toolbox.networks import Network # Personal stuff to send an email once data collection is finished # sys.path.extend(['/home/will']) # fr...
975e7ab7010a1eb1ddd2cf37655f0ba085d019332302e8b4b623a5b8c033af1d
Python
8,553
185
import sys import numpy as np import torch import time import pickle from sns_toolbox.neurons import NonSpikingNeuron from sns_toolbox.connections import NonSpikingSynapse from sns_toolbox.networks import Network # Personal stuff to send an email once data collection is finished sys.path.extend(['/home/will']) from e...
cc04bc62dcfc510a0805197dbe979f239c42e3c3f6d28ac55408414905411c2b
Python
8,553
221
#!/usr/bin/env python """AxialTAD inference driver. Run a trained AxialTAD model on one or more `*_25kb.npy` Hi-C patch files and emit a single JSON file with per-file probabilities, binary predictions, and (optionally, when labels are present) precision/recall/F1. Usage: python scripts/predict.py \\ --ar...
22358e7fcb3f35d5d2a8060e8d1caaeff6b93d715ffc4977f9dba63186122717
Python
8,558
201
# 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...
86ee1e8b192da293fbe77a649288fc38723d3d05efabde53444abe8dc5fce0ec
Python
8,559
185
import sys import numpy as np import torch import time import pickle from sns_toolbox.neurons import NonSpikingNeuron from sns_toolbox.connections import NonSpikingSynapse from sns_toolbox.networks import Network # Personal stuff to send an email once data collection is finished #sys.path.extend(['/home/sns']) #from ...
8b9f78eefef60eae7cfe713720469e1150a9c5e8039f43a7a6391883f4621feb
Python
8,560
190
""" Compare the simulation speed of the different backends William Nourse September 9 2021 The correct term is Babes, sir """ import numpy as np import torch import time import pickle from sns_toolbox.neurons import SpikingNeuron from sns_toolbox.connections import SpikingSynapse from sns_toolbox.networks import Netw...
7c6191d4ca14410ff3c58255de9ef9ea7b1f21ddb9e826d98fc7f71f9186755e
Python
8,567
190
""" Compare the simulation speed of the different backends William Nourse September 9 2021 The correct term is Babes, sir """ import numpy as np import torch import time import pickle from sns_toolbox.neurons import SpikingNeuron from sns_toolbox.connections import SpikingSynapse from sns_toolbox.networks import Netw...
adffef8fe7944cf4667a6614f9ad28877619592eff6717fe5cff8cc3dc6e46df
Python
8,572
244
from typing import Callable, Iterable, Optional, Tuple, Union import torch import numpy as np import matplotlib.pyplot as plt from utils.utils import make_dir from .utils import NUM_BINS, PLOT_FONT_SIZE, find_fwhm, get_stats from scipy import stats import os.path as osp import logging import json FIGSIZE = (16, 4) LAB...
ead1d94bc2e9d12ba2ab0c92e5f9fec74c61fe4ec78f72c96800ac570e1e3308
Python
8,572
242
""" This file is for models creation, which consults options and creates each encoder and decoder accordingly. """ import re import torch import torch.nn as nn from torch.nn.init import xavier_uniform_ import onmt.inputters as inputters import onmt.modules from onmt.encoders import str2enc from onmt.decoders import s...
04163266defb04a4faf6766c56586d17f08e7bae9eb4cfb6863ec839e417fe98
Python
8,573
242
""" AQDnet CLI commands implementation """ import sys import os import glob import tempfile import json import logging # Add scripts to path for imports sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'scripts')) import pandas as pd import numpy as np import tensorflow as tf from tqdm import tqdm #...
23a27ea1b3683c14b609f015089f10c7902f24887be8206c211ecdfc8a05fc20
Python
8,573
247
# 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...
929560c71fdf54bfe09dc36d3f5337aa37a3ea89e5b51724ea4720d6041649db
Python
8,573
245
from typing import Callable, Iterable, Optional, Tuple, Union import torch import numpy as np import matplotlib.pyplot as plt from utils.utils import make_dir from .utils import NUM_BINS, PLOT_FONT_SIZE, find_fwhm, get_stats from scipy import stats import os.path as osp import logging import json FIGSIZE = (16, 4) LAB...
28b101e544ae2de83ecf7f3e69974b608391197c010cd5943d3de20224830987
Python
8,574
266
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from collections.abc import Sequence import numpy as np import onnx from onnx.backend.test.case.base import Base from onnx.backend.test.cas...
682e3f108f3c3ee9a9c9b23fde89698c6368dd222866d7975b401bbcfbad2cde
Python
8,576
187
r""" This module contains the building blocks for the video prediction models implemented in https://github.com/Hzzone/Precipitation-Nowcasting (Encoder-Forecaster-based prediction models based on ConvLSTM/TrajGRU). """ from collections import OrderedDict import torch import torch.nn as nn from vp_suite.base import ...
9bcaec18402ce73c08a7108ef7df7e2b45e2112a96dc8ba223c1122f577dfd44
Python
8,577
190
""" Compare the simulation speed of the different backends William Nourse September 9 2021 The correct term is Babes, sir """ import numpy as np import torch import time import pickle from sns_toolbox.neurons import SpikingNeuron from sns_toolbox.connections import SpikingSynapse from sns_toolbox.networks import Netw...
b77449ae79ea27342fb64380e69071d7a34e02bc5a61fc832d8afee150c2e55a
Python
8,577
190
""" Compare the simulation speed of the different backends William Nourse September 9 2021 The correct term is Babes, sir """ import numpy as np import torch import time import pickle from sns_toolbox.neurons import SpikingNeuron from sns_toolbox.connections import SpikingSynapse from sns_toolbox.networks import Netw...
eb9056742696f5a9da5b2c47fe29bc5ab11658313f1d971435b20f2f03883d13
Python
8,577
221
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Apr 9 15:39:25 2021 @author: sam """ import argparse import numpy as np from tqdm import tqdm import os.path import h5py import buffer_handle import cv2 import moving_least_squares from scipy import ndimage def warp_image(img, p, q, alpha, grid_siz...
e0f01faae2fae45c9f7b5dfec7b2736dead839408de44ce9713012a7d5ea1361
Python
8,582
223
# Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # import pytest from ampligraph.datasets.graph_partitioner import AbstractGraphPa...
c97898ac2c0b44105480acd6b1381b3086431b3fd17f0cee463ae74d2b78cfa4
Python
8,589
257
"""Tests for the pytorch deep learning adapter.""" import numpy as np import pytest from skbase.utils.dependencies import _check_soft_dependencies from sktime.tests.test_switch import run_test_module_changed KINDS = ["classifier", "regressor"] CASES = { "classifier": { "criterion": "nllloss", "c...
76eb2ae7ccfda37d252fc2108efaab340e46aecd4ab6a2db812e57fd3306987a
Python
8,593
188
""" Compare the simulation speed of the different backends William Nourse September 9 2021 The correct term is Babes, sir """ import numpy as np import torch import time import pickle from sns_toolbox.neurons import SpikingNeuron from sns_toolbox.connections import SpikingSynapse from sns_toolbox.networks import Netw...
0fc108ad4ad242b3ab24a29cac6bc519c1f9e976e43344d2dd6cd9285aa267e9
Python
8,597
173
from pathlib import Path import os import shutil from typing import Union, List import pandas as pd import numpy as np import nibabel as nib from nilearn.image import concat_imgs from bcblib.tools.spreadsheet_io_utils import import_spreadsheet import argparse from bcblib.tools.nifti_utils import is_nifti, file_to_lis...
69cb06d3dad679e4ee38c71757d3b04857112d0117b0089da68d636a280d53b8
Python
8,599
177
import os from collections import defaultdict from helper_functions import sortby, Make_folder_if_not_exists, load_fasta, convert_to_bases, clean_files # ---------------------------------------------------------------------------------------------------------------------------------------------------------------- #...
085deaf2f918dd16ac405b97c553265d12b123f5872e986b4375011ed6bd7955
Python
8,602
204
import argparse import logging import os import time import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.data import DataLoader as PTGDataLoader from torch.utils.data import DataLoader from model ...
6ebb12e3b16097db520ae6497cc4dcd5bbb411d47b23b406d7a59d2c8f3b7f46
Python
8,602
209
# 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...
257676178be499e3a4529ab83db100ed692a016bd91a4a106c3b85044f2784b9
Python
8,605
264
# 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...
785eeef39f0f02025097b4f184bb54f709b3940ed3826a34c7f3be447cded1dc
Python
8,615
238
import ctypes import logging import win32api #logging.console.setLevel(logging.CRITICAL) class _WinMonitor(ctypes.Structure): """Physical monitor structure from Windows API. hPhysicalMonitor : handle to physical monitor. zPhysicalMonitorDescription : Unicode descriptive string. It seems to always ...
f2b29692073792c48688feafef8ff1736937d7a6a7415acdb316179925fa422b
Python
8,615
264
# Author : Hari Bharadwaj hari@nmr.mgh.harvard.edu # License : BSD 3-clause # Parts of this code were copied from NiTime: # http://nipy.sourceforge.net/nitime # Some parts were coped from MNE import numpy as np from scipy import fftpack, linalg, interpolate import warnings def sum_squared(X): """Compute norm of...
5825525ed8d093ee348b6ca6eaadb6ae1996cce667ca2214102c5b028ec8990f
Python
8,617
249
# 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...
3da6c28f68b57c32e635863d9169d99d8094fa987e57a4780fd29c816da3ca29
Python
8,618
219
__author__ = ["chrisholder", "TonyBagnall"] from typing import Any import numpy as np from sktime.dists_kernels._numba_distances.base import ( DistanceAlignmentPathCallable, DistanceCallable, NumbaDistance, ) class _WdtwDistance(NumbaDistance): r"""Weighted dynamic time warping (WDTW) distance betw...
cb4b01c7d588d4f667bfc5b4bd3146d974ec1998b4844a163e61478dd495da9d
Python
8,619
185
# SAFE TEAM # # # distributed under license: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) # # import tensorflow as tf class NetworkLSTM: def __init__(self, features_size, embedding_size, max_lv, T_iterations,...
61186120697e8f4a447bfdf460b4512c46497162dc92461b375046ebb6449ff9
Python
8,620
199
from PyDAQmx import DAQmxCreateTask from PyDAQmx import DAQmxCreateAIVoltageChan from PyDAQmx import DAQmxCfgSampClkTiming from PyDAQmx import DAQmxStartTask from PyDAQmx import DAQmxReadAnalogF64 from PyDAQmx import DAQmxStopTask from PyDAQmx import DAQmxClearTask from PyDAQmx import TaskHandle from PyDAQmx import DAQ...
1104685a69352c3aadefc01af0a0207101ebb1ea5822be48c4fdd01f510f34c9
Python
8,624
194
from __future__ import print_function from freqAnalysisTools import band import sys import pickle from os import listdir from os.path import isfile, join, splitext import numpy as np import random from sklearn import linear_model, svm, ensemble, neural_network from sklearn.metrics import confusion_matrix from mpl_toolk...
7e9b66d744805281288caa02811b2bd4fb9f1f7b0e4c27e2619a1ccbca999d76
Python
8,625
245
import os import numpy as np import pandas as pd import logomaker import matplotlib.pyplot as plt import math from keras.models import load_model, Input, Model from keras.layers import SpatialDropout1D, LSTM, Bidirectional, Flatten, concatenate, Dense, Dropout import tensorflow as tf from see_rnn import ge...
4ef13e2f4a2454854b5cb1a21ec68a1eca7f3d308136e288f32de130b74373ad
Python
8,626
228
""" Defines: Functions: _validate_scalar_to_multi(value, size=3, dtype=float) _validate_ndarray(array, minimum_ndim=0, required_ndim=None, dtype=None, forbid_object_dtype=True, broadcast_to_shape=None) _validate_xyz_resolution(ndim, xyz_resolution) _compute_axes(shape, x...
9d57bcc1817d57a77136c979eb1db0dfcdc7a3f97b4f6d9139ed9db4f5e9eebb
Python
8,626
239
""" Module with handling the parcellation of different cortical atlases. """ from pathlib import Path import nibabel as nib import numpy as np from graynet import config_graynet as cfg from graynet.utils import check_atlas, check_atlas_annot_exist, roi_info def get_atlas_path(atlas_name=None): """Validates th...
97a0d58481c2026e80f4a7f7fadad663f975ef3573a70a5e7dcb7314b1efb9cb
Python
8,628
222
def plot_revcorr(p, ax, ax2, respike=False, thr=-20., width=4.0): d={} basepath = 'VCN_Cells/VCN_{0:s}/Simulations/AN'.format(p) h = open(os.path.join(basepath, fn[p]), 'rb') d[p] = pickle.load(h, ) h.close() seaborn.set_style('ticks') syninfo = SC.VCN_Inputs['VCN_{0:s}'.format(p)] if no...
76b65a5071e228b925d0ede0af925c475c3340f4e33a51296cf8ce01752f5af0
Python
8,629
197
# SAFE TEAM # # # distributed under license: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) # # import tensorflow as tf # structure2vec # DE-MF : discriminative embedding using Mean Field class Network: def __init__(self, features_size, embe...
8fc90a1612778a02c8a359f18b19b467bee772ebea2b7681a20d870e38ae9966
Python
8,632
158
# Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # from ampligraph.latent_features import loss_functions from ampligraph.latent_f...
321d3e5e593758505956e7b074fa6cf7be6ac9646b0eeb18980c74837923804a
Python
8,636
232
# Copyright 2022 The TensorFlow Authors. 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 applica...
e89c41daa5269eacc9090de3f58e5521fbcdd9282863dceec449d34fa740f2c7
Python
8,639
250
# 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...
c23734ecad71d7c9a4f503deab353c44b2be6e5789c0f63ebb34305aa17369a7
Python
8,641
205
from __future__ import annotations from copy import copy from typing import Callable import numpy as np from .dataset import JetDataset from .normalisations import NormaliseABC from .utils import ( checkConvertElements, checkDownloadZenodoDataset, checkListNotEmpty, checkStrToList, getOrderedFeat...