sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
7d758b1a6fd9a00126ed9698548cc3f420457c44017a7bfc40ad782055137092
Python
6,839
201
# Copyright 2024 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...
89c99e0928bd831cf97913b67cd59ff44ff6e15389f6ba81f562538b8b46e668
Python
6,840
181
import logging import os import subprocess import time import click import dotenv as de import pandas as pd import parallel as par de.load_dotenv(de.find_dotenv(usecwd=True)) def __subprocess_run(cmd): try: logging.debug(cmd) subprocess.check_output( cmd, universal_newlin...
3f378ec4f7890f798fc109424ab9c40fb00a7fb05e48e56b80a8b3f2b67312e0
Python
6,841
166
""" This scripts generates figure 5a : Cumulative histogram of visual left/right selectivity Internal notes: from the notebook : naive-vs-proficient-mice-passive-prop-sig-neurons """ import pandas as pd import pickle as pkl import numpy as np import os import glob import matplotlib.pyplot as plt import matplotlib as m...
05f3116cc9c1a28618a27bbda1b524275d30cb6efc71f3c9e9a42f2e6c4082e6
Python
6,843
169
import torch from onmt.translate.decode_strategy import DecodeStrategy def sample_with_temperature(logits, sampling_temp, keep_topk): """Select next tokens randomly from the top k possible next tokens. Samples from a categorical distribution over the ``keep_topk`` words using the category probabilities ...
4ca7eb24326823cab8720cd37faaabf9a8a59b0c3c835e5a3e1f5867f3c7e7e4
Python
6,844
218
#!/usr/bin/python """ Run all gbc IV's as a batch """ import matplotlib matplotlib.use("Qt5Agg") from matplotlib import rc rc("text", usetex=True) matplotlib.rcParams["pdf.fonttype"] = 42 matplotlib.rcParams["ps.fonttype"] = 42 import sys from pathlib import Path from collections import OrderedDict import datetime ...
d9197a9b5d4df532ac8d7f2b8e5288cd77a43abb2f15e096974a8f2b2f471e87
Python
6,845
212
import numpy as np import pandas as pd from matplotlib.colors import to_rgba, to_rgba_array import pytest from numpy.testing import assert_array_equal from seaborn._core.plot import Plot from seaborn._marks.bar import Bar, Bars class TestBar: def plot_bars(self, variables, mark_kws, layer_kws): p = P...
08b0ff4627d9302d8cc68fa54caf43101c4792e2f967ba82c0750e604ea4bb4b
Python
6,847
171
import re import shutil # for removing and creating folders from pathlib import Path # import genomic_benchmarks.utils.datasets as datasets import pandas as pd from genomic_benchmarks.utils.datasets import ( _check_dataset_existence, _download_url, _fastagz2dict, _get_dataset_name, _get_reference_...
8a73c53b80c8ed88149bdd53b054de17e7a7f0acb5f9fc1ba5b43d5f4c81563f
Python
6,847
176
""" Translation main class """ from __future__ import unicode_literals, print_function import torch from onmt.inputters.text_dataset import TextMultiField from onmt.utils.alignment import build_align_pharaoh class TranslationBuilder(object): """ Build a word-based translation from the batch output of tra...
5c7428c0eac1e958e46598d07b455cdddeca1141460d45ee99c787254786e1fe
Python
6,849
208
#!/usr/bin/env python """Train models.""" import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.misc import set_random_seed from onmt.utils.logging import init_logger, logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentPa...
8b9e3014487c6a3860b7d8b5b5e659b8d0a6c291744287dc929ef7e91fabdbf0
Python
6,849
202
# Copyright (c) OpenMMLab. All rights reserved. import random import warnings import numpy as np import torch import torch.distributed as dist from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import (DistSamplerSeedHook, build_optimizer, build_runner, get_di...
a8642c917bb9249707dea8a4cacbf14013dfaeafb0efe462bf0bf4f1af3ba97f
Python
6,850
188
from ray.rllib.env.multi_agent_env import MultiAgentEnv from ray.tune.registry import register_env import random from gym.spaces import Discrete, Box, Dict import copy import numpy as np from open_spiel.python.rl_environment import TimeStep, Environment from mprl.rl.envs.opnspl.valid_actions_mask_env import ValidAction...
0ede6fe4676e9c223c009c132ef0f17543fd8265c3f53ef0b75a5f563785aa56
Python
6,853
195
from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple import numpy as np import logging from ray.rllib.utils.annotations import override from ray.rllib.policy.policy import Policy from ray.rllib.models.catalog import ModelCatalo...
dffa2fe7e376a01ceba184a9a550d52d3ac84616a7c7a5763abb0e46c457cec2
Python
6,855
169
# -*-coding:utf-8-*- import torch import torch.nn as nn import torch.nn.init as init import torch.nn.functional as F from torch.autograd import Variable import math import sys import numpy as np import os def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=...
c7d2fc5e493a6b9a2ae3f58cf416528afbc03185e8f50b614aeab559dee72880
Python
6,856
207
""" This scripts generates figure 3c : Example Choice neuron """ import pandas as pd import pickle as pkl import numpy as np import os import glob import matplotlib.pyplot as plt import matplotlib as mpl from tqdm import tqdm # Plotting import sciplotlib.polish as splpolish import sciplotlib.style as splstyle imp...
d479f3604c0373f128be3030dba9ee76aa3b205604805a33a2db7b0bbdbdae24
Python
6,857
206
""" This scripts generates figure 3b : Example Visual R-L neuron """ import pandas as pd import pickle as pkl import numpy as np import os import glob import matplotlib.pyplot as plt import matplotlib as mpl from tqdm import tqdm # Plotting import sciplotlib.polish as splpolish import sciplotlib.style as splstyle ...
276b4ab9b47f3369fd104423e4033b796b45388f167dc0349d412f3a34242e93
Python
6,858
202
import torch import torch.nn as nn from torch import Tensor from torch.nn.parameter import Parameter from spikingjelly.clock_driven import neuron, layer from .blocks import SeparableSEWResBlock ############### ### SCALING ### ############### class MultiplyBy(nn.Module): def __init__(self, scale_value: float...
ad4affa5a0549239fba763eabaa2b12b231f6337114534062aa2df08b6b3afe9
Python
6,858
216
""" Test synaptic connections between two different cell types. usage: test_synapses.py [-h] [-t {simple,multisite}] [-c] {sgc,tstellate,dstellate,tuberculoventral} {bushy,tstellate,dstellate,octopus,tuberculoventral,pyramidal} Compute AN only PSTH in postsynaptic cell...
2c95206b17d532a2b1aedc2fd0c1cc8c50cf487f40ce7c8ba13bd4eec22dcac8
Python
6,861
213
import numpy as np import pandas as pd import pytest from numpy.testing import assert_array_equal, assert_array_almost_equal from seaborn._core.groupby import GroupBy from seaborn._stats.density import KDE, _no_scipy from seaborn._compat import groupby_apply_include_groups class TestKDE: @pytest.fixture de...
b757f6d4bd4aebb8b8f1ce5c2509d8b8d251d9e976b7e9f6ced91e75590a6316
Python
6,861
207
# SPDX-License-Identifier: LGPL-3.0-or-later """Build and export compressed pt_expt inference models.""" import logging from typing import ( TYPE_CHECKING, ) from deepmd.pt_expt.utils.serialization import ( deserialize_to_file, serialize_from_file, ) if TYPE_CHECKING: from deepmd.pt_expt.model.model ...
65c136b49b271a2e0961809d0ad926fe55a1a32aa4fd06fad79353bc1bc77be9
Python
6,862
207
""" This scripts generates figure 3c : Example Auditory R-L neuron """ import pandas as pd import pickle as pkl import numpy as np import os import glob import matplotlib.pyplot as plt import matplotlib as mpl from tqdm import tqdm # Plotting import sciplotlib.polish as splpolish import sciplotlib.style as splstyle...
48f5db1609c84354a7f1a9b935f2ec8a8bc618c4fc075c9f2159dc3cb6ecbd54
Python
6,865
164
# coding: utf-8 from itertools import chain, starmap from collections import Counter import torch from torchtext.data import Dataset as TorchtextDataset from torchtext.data import Example from torchtext.vocab import Vocab def _join_dicts(*args): """ Args: dictionaries with disjoint keys. Return...
490255da405f80cbb57365f6bcda73bf644fc8dcc61a5985800a122a6b2c2c25
Python
6,865
167
from __future__ import division import os import pandas as pd import numpy as np from helper_lib import filelib from SPHARM.classes.surface import Surface from SPHARM.classes.moving_surface import MovingSurface from SPHARM.lib import transformation as tr def compute_spharm(**kwargs): """ Compute spherical ha...
e456d8c3daaeeb77428065bfb8d34135805868c5fa7529d7839cd050464659e9
Python
6,865
120
""" Convert to h5 utility. Sample command to create new dataset - python3 utils/convert_h5.py -dd /home/masterthesis/shayan/nas_drive/Data_Neuro/OASISchallenge/FS -ld /home/masterthesis/shayan/nas_drive/Data_Neuro/OASISchallenge -trv datasets/train_volumes.txt -tev datasets/test_volumes.txt -id MALC -rc Neo -o COR -df ...
4f015cc66d429dcc8044d484136909a830f0cdcff15017e14ce0f4bf32652d25
Python
6,871
198
"""BOSS classifier, from pyts.""" # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) __all__ = ["BOSSVSClassifierPyts"] from sktime.base.adapters._pyts import _PytsAdapter from sktime.classification.base import BaseClassifier class BOSSVSClassifierPyts(_PytsAdapter, BaseClassifier): """Bag...
fb78552ed28e2ecbf758a93b9cdbfea6d407f4bb721ebb73a036a0374b98e722
Python
6,873
168
import argparse import os, sys, pickle from datetime import datetime from math import inf, log, log2, exp, ceil import torch from torch.utils.data import DataLoader import torch.optim as optim import torch.optim.lr_scheduler as sched from cormorant.engine.args import setup_shared_args, BoolArg, Range import logging ...
654aeb7bb05f37b560f4537bf88209599132b4bcb18ce67f70a32d0d45bd9efe
Python
6,877
212
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Creates Figure 3 from Wang et al. (2023) Temporal stability of intracranial EEG abnormality maps for localizing epileptogenic tissue. Calculates time-varying D_RS from abnormalities before plotting. Gabrielle M. Schroeder CNNP Lab, Newcastle University May 2023 """ ...
585ff47f16543ad7438b3eac6827290561f3dec45a8081efbaeeedfd6c7734fe
Python
6,885
252
"""This module implements spectral weighting filters for the sound pressure level (SPL) in air according to [IEC-61672]_. Spectral weighting is part of aucoustic measurements. It is used by sound level meters for example. The weighting functions are derived from different equal loudness contours of human hearing. The w...
8aad30fc8068930b792966bc82a59b1a68e5e2f28d7b15e2bc3f526c7856a0a1
Python
6,887
206
"""Forecasting Datasets.""" __author__ = ["jgyasu"] __all__ = ["ForecastingData"] import warnings from inspect import signature import pandas as pd from sktime.datasets import load_forecastingdata from sktime.datasets.base._base import InvalidSetError from sktime.datasets.forecasting._base import BaseForecastingDat...
ccf0be6f0318edf7c0149ca6435374dc78d0e088b4eb89dfc7e7e43882a7680e
Python
6,891
226
#!/usr/bin/env python import click from click_option_group import optgroup import json import numpy as np import os import pandas as pd from sklearn.metrics import average_precision_score, roc_auc_score import sys sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), ...
f00abafd9a837f5b841cd958958dfb925d53348de63ebd657e6473eb170d693a
Python
6,894
186
#!/usr/bin/env python3 # Copyright (C) 2019 Christoph Gorgulla # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # This file is part of VirtualFlow. # # VirtualFlow is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
c13c1f84466033dc053416c444f9ff009d23c970ce7beb2ccc3de214850669c2
Python
6,897
233
from __future__ import division import os import numpy as np import pandas as pd from skimage import io import warnings from multiprocessing import Process import time import sys def _print_progress(procdone, totproc, start): donepercent = procdone*100/totproc elapse = time.time() - start tottime = totp...
c8d97d1188810e4057afae08ef4a03ab2ff137633e906b91dd04422760ab9672
Python
6,898
142
import pickle import numpy as np def get_data(config): print('Reading data') if config.transfer_learning: dir_path = f'../DeepCRISTL2/data/{config.pre_train_data}/' # TODO - use tl data conf = False else: dir_path = f'../DeepCRISTL2/data/pre_train/{config.pre_train_data}/' ...
53d70f692d22e31787abaa4442753b717a1707bbaf093e823f778cdb8e497816
Python
6,906
194
# -*- coding: utf-8 -*- from functools import partial import six import torch from torchtext.data import Field, RawField from onmt.inputters.datareader_base import DataReaderBase class TextDataReader(DataReaderBase): def read(self, sequences, side, _dir=None): """Read text data from disk. Args:...
f8f200fcb8ab1e2df024200427a42ce2b185ef34168d697bf08ad5e8ae7ae23f
Python
6,910
232
#!/usr/bin/env python import click from click_option_group import optgroup from functools import partial import json from multiprocessing import Pool import numpy as np import os import pandas as pd from pandas.errors import EmptyDataError import sys sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), os.par...
829bbb164e77cdec37b4bd832661adbabbb4112ecc20e279c58d8607cae354b2
Python
6,912
187
"""evaluate_precipitation.py""" """ Author: Yimin Yang Last revision date: Jan 18, 2022 Function: Run this to evaluate the trained model Ref: https://github.com/HansBambel/SmaAt-UNet """ import torch from torch import nn import numpy as np import os import pickle from tqdm import tqdm from Models.AA_TransUNet import ...
e5419b55daa991148790615ae2616e148e7d241588c73e6a0426bd128d341655
Python
6,914
214
import os.path import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import networkx as nx import pyvista # from VesselGen.utils.graph_modelling import * from collections import OrderedDict from VesselGen.preprocessing.read_to_networkx import VtkNetwork from matplotlib import rc...
bf46ab931ed400ab562386749f9f8ed05007cd34ccb93ad940a3c2b465b8f211
Python
6,915
191
from __future__ import annotations # for ArrayLike type in docs from typing import Dict, Union, Tuple from numpy.typing import ArrayLike import numpy as np # for calculating jet features quickly, # TODO: replace with vector library when summing over axis feature is implemented import awkward as ak from coffea.nanoev...
5014e0a96126d0495017348796a4b8297af961b4d22c7ee75972a3ca7e41d0f3
Python
6,917
174
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import tensorflow.compat.v1 as tf import internals.modeling as modeling from tensorflow.python.framework.ops import disable_eager_execution disable_eager_execution() flags = tf.flags ...
c32c1eaddf424e5efaca4d0e10a7717aca1788be9406efddc4946f58619ec2ff
Python
6,917
244
# 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...
5421f4156343a3c6f8ac43b5e466a248ff94e820ab4710c9521a573be3166c45
Python
6,918
212
# 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...
028a93e2b52a73bb9ebd71f7f6b21c8babb3ce11ba75d32ea93407fda9cac998
Python
6,919
178
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Unittests for starting a job ''' import unittest from openbabel import openbabel from src import JobConfig from src.gaapi import operator_types from src.gaapi import generators from src.gaapi import Individual import main as main_program import shutil import os fr...
701dcbe9e46e2f75c62b9d185e41df4c496fec9e856467c3f4cac3d371fed906
Python
6,924
248
""" Toolbox for simulating compositional data from ScRNA-seq This toolbox provides data generation and modelling solutions for compositional data with different specifications. This data might e.g. come from scRNA-seq experiments. The covariates are represented by ``X``, the cell count matrix is denoted ``Y``. To sta...
5978f33c321008755e118f6897c2384d8152d28079217bed21bf54146e1ce1a9
Python
6,926
186
import os import os.path as osp import shutil import sys import warnings from setuptools import find_packages, setup def readme(): with open('README.md', encoding='utf-8') as f: content = f.read() return content def get_version(): version_file = 'mmcls/version.py' with open(version_file, 'r'...
ee834b9de8bcc4a0eb867f9588f1c5b96f54380fcdc5d30aee6ed460f30aabd7
Python
6,926
136
import torch import torch.nn as nn from cormorant.models import CormorantAtomLevel, CormorantEdgeLevel from cormorant.nn import MaskLevel, DotMatrix from cormorant.nn import CatMixReps from cormorant.cg_lib import CGProduct, CGModule import logging class ENN(CGModule): """Base equivariant neural network archit...
4d14d886eed3ee13aa0ef861bf2792c9d2f250e0e5db0aaf0b24f3fb1f202d91
Python
6,929
199
# 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...
c4e0570ba1f9536d9f363bf22a181c850214248f4d248d94dec2557df5408d53
Python
6,929
209
# 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...
0bf85eece4559c6c08855bcc64a9c3ce31a57dba47e04ae1ac7559fbce23f3be
Python
6,931
206
# 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...
2c6525b8599ec1d727ca39ef87dcda35f5fbcfc9547c6777c92e7c2089b4bcc7
Python
6,935
212
# 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...
559a01ccd710c29424084b39d55eed38814bd28bfee379dceb69ed37720f3c5e
Python
6,935
199
# 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...
abb2b1edce5676dadd77ab48d1e3cb4652da66461a87fc63efccf5cddcf9b4f2
Python
6,937
198
from __future__ import annotations import functools import textwrap from typing import Any from typing import TYPE_CHECKING from typing import TypeVar import warnings from packaging import version from optuna._experimental import _get_docstring_indent from optuna._experimental import _validate_version if TYPE_CHEC...
a52bfef5dba8395b963793f3bb59e88869c78aa6a3c91e3215378469944f2dc8
Python
6,939
169
"""Benchmarking for classification estimators.""" __author__ = ["jgyasu"] __all__ = ["ClassificationBenchmark"] from collections.abc import Callable from typing import Any from sktime.benchmarking._benchmarking_dataclasses import ( FoldResults, TaskObject, ) from sktime.benchmarking.benchmarks import ( B...
236eb6656c82f055edf11d27d0d4e0eb06a9e4f16b110d42c4f4961756535df2
Python
6,942
83
""" Data structures for model_run XM13 with cooperative nacn channels XM13A: reduce channel density to match input resistance with more complex cells from SBEM data (original densities were based on soma-alone assumption) """ ChannelData = u""" This table describes the REFERENCE ion channel densities (and voltag...
07854246013a32990bc9be2ffd9a0c2e7e53f5a3e80fc4f9a81191b4aee80e92
Python
6,943
189
# 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...
8159315d82aae07b4028bf5701281d9c8795cd263f512c99525d708b7793e63f
Python
6,947
266
# -*- coding: utf-8 -*- """ Created on Tue Oct 25 20:39:04 2016 @author: daniel """ #from math import sqrt results_directory = './results' #-----------------------------------------------------------# # 1. General recording and simulation parameters # #------------------------------------------------------...
d0cd97a131c6a45f3d2ff3781868355dc00fd0328521d6cf2b537757a5be1414
Python
6,947
170
import numpy as np import torch from transformers import BertTokenizer, BertModel, logging from Bio import SeqIO import time import pandas as pd import tqdm import scipy import pickle def embed_proteins(species_dict, model_path="Rostlab/prot_bert", max_length=2500, # truncate se...
2f6088979efe3be9324a1bc4df880da9fbcd5674e66fa2a0a77da939bebbcbd8
Python
6,948
179
__author__ = ["chrisholder", "TonyBagnall"] from typing import Any import numpy as np from sktime.dists_kernels._numba_distances.base import ( DistanceAlignmentPathCallable, DistanceCallable, NumbaDistance, ) class _ErpDistance(NumbaDistance): """Edit distance with real penalty (erp) between two ti...
dd0a81db9086e22a8f352f48b8750b4684a2a46ad486abdddc3f47d769493cf7
Python
6,952
165
import argparse import shutil import glob import os from multiprocessing import Pool class DrugScreenSorterTool: """ A class to sort images into the right directory structure for using EmbryoNet in the analysis of images taken in different wells of multiter plates. The prerequisites for this scri...
845151cd5a55c11f48f3a63817cb4c4763c1123af9bde52ee0306618546fff13
Python
6,957
167
# 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...
b26e13b5f0b9d64257a19f264b41cf09fd9c6e88b6af1bb141b35bbbed56fe97
Python
6,957
191
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 7 2023 @author: swcanner Current settings for B Factor visualization: `BFactor = 0.0` : Nonbinder `BFactor = 40.0` : CAPSIF:G Predicted Binder `BFactor = 59.9` : CAPSIF:V Predicted Binder `BFactor = 99.9` : CAPSIF:V and CAPSIF:G Predicted Bin...
91d599861f071c20ae89e4370e8ba0f18df79864f2edf3ec24ecf1deb40834a9
Python
6,963
203
# 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...
02a44d8467502d6244a5200a37cd41ad0da4d3d9834c014e0e7ed7c17cd113e2
Python
6,964
185
# 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 # # ...
dd48a250ba1a11733bd9508c5b5db826e6eee8ebfe0152e3c16a3f6787046cce
Python
6,965
173
# 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...
8dc552fe94291ab0781393b52bdd5237b30c3e6c144969ae107eb980febb1d9c
Python
6,967
211
# 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...
eb50fd57735cee142bbc2be433b29a7d2e7df7c55d067815434847238df2f3f1
Python
6,968
154
import json import math import os from pathlib import Path import cv2 import numpy as np import torch from vp_suite.utils.utils import most from vp_suite.base import VPDataset, VPData from vp_suite.defaults import SETTINGS class SynpickMovingDataset(VPDataset): r""" Dataset class for the Videos of the datas...
08a5d239629f1897b35fdcaef552fc886567dc7da2f62349455dd504cf5f61b3
Python
6,972
210
''' Replacers are used to modify a population after crossover and mutation have occured .. codeauthor:: Nicholas Browning ''' from __future__ import print_function from __future__ import absolute_import from builtins import range import numpy as np from . import Individual import pygmo as pg from src import outproces...
11cd95914fefa922afd6a6955c67a83d76e31e8e274d75df8569b26627846593
Python
6,973
175
# Functions for sampling points from a 2D segmented image import os import warnings from typing import List, Iterator, Tuple import numpy as np import numpy.typing as npt from skimage import measure import tifffile from scipy.spatial.distance import pdist import itertools as it from pathos.pools import Proces...
00c1c3c443836fc8ed639850676025318d3f9b79279b96b77256af09b756985b
Python
6,974
197
# 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...
911756b3599b79f62012bdda726710d9aa844098e30cfb6a43a4d1fce7faae60
Python
6,977
220
import os import copy import time import math import random import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import auc, precision_score, classification_report, plot_confusion_matrix, f1_score, confusion_matrix from sklear...
293b1d5dc9ffd4075afd66b59b736acffc78bc9329c4666bfcda88b3a68bafe7
Python
6,979
154
import numpy as np import torch from torchvision.datasets import MNIST from vp_suite.base import VPDataset, VPData from vp_suite.defaults import SETTINGS class MovingMNISTOnTheFly(VPDataset): r""" Dataset class for the dataset "Moving MNIST", as firstly encountered in "Unsupervised Learning of Video Repr...
38dc705c95358bef2f5060f9acd32d77a7c97aa53231d8cdbc8b21445c4ad2ff
Python
6,981
178
# BASILISK: A generative, probabilistic model of side chains in proteins # # Copyright (C) 2010 Tim Harder and Jes Frellsen # # BASILISK is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
c946a559c2c6664353a9b1a4626136746554acd7b6eaf11d585e709af7b1adff
Python
6,982
224
import numpy as np import seaborn as sns from matplotlib import patches import matplotlib.pyplot as plt from scipy.signal import gaussian from scipy.spatial import distance XY_CACHE = {} STATIC_DIR = "_static" plt.rcParams["savefig.dpi"] = 300 def poisson_disc_sample(array_radius, pad_radius, candidates=100, d=2, ...
c4c514a1b0ff4f147199930bf4d4aa33feedde4f5a1474717301cdebfa05a597
Python
6,984
210
import torch import torch.nn as nn from torchvision import datasets from torchvision import transforms import numpy as np import torch.nn.functional as F import torch.optim as optim import sys class ConvBlock(nn.Module): def __init__(self, in_channels, out_channels, kernel_width, stride=1, pool_size=0): ...
aa901eb858d5b5d5c55a7974630c7d249ce19c0115474d799ba78e8d44a51570
Python
6,986
181
#!/usr/bin/env python from __future__ import print_function import sys,os import re import argparse import logging from collections import OrderedDict # 3rd party from intervaltree import Interval, IntervalTree desc = 'Adding "contigs_report_contigs_filtered.mis_contigs.info" to feature table' epi = """DESCRIPTION: Ad...
ef231ed335aea809c3e3045ead370144c6d546bdcb5c61759f7cbf0c1cbc1be9
Python
6,988
196
# 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...
24275d5a941a3a8c8ee18f28075ef236ce9bbf6b53a001c1ee137a0ec6b54315
Python
6,989
261
""" snapshot_comparison.py This module performs learning rotations with different cue conditions to determine effects on the R to E-PG mapping. """ import argparse import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes from extended_ring_model import * from dic...
4d0cb5f1d6ce7c5b8e4bab2241ec25ccd951e1f4da7f9b001dc79f8f08561568
Python
6,991
221
#!/usr/bin/env python3 from pathlib import Path import rdflib from pyontutils.utils import rowParse, relative_path from pyontutils.namespaces import ilxtr from neurondm.lang import * from neurondm.phenotype_namespaces import BBP class NeuronMarkram2015(NeuronEBM): owlClass = ilxtr.NeuronMarkram2015 shortname...
4c2b0a32bdcc2c4f1af51e16889985d8b9b6bacba860d61c70c843f9f05e2ab0
Python
7,004
229
""" Implements bootstrap-based inference methods for model given in Urban et al. (2023) Implements methods for performing nonparametric bootstrap as well as parametric likelihood-ratio bootstrap for various inferential objects of interest. """ from multiprocessing import Pool from functools import partial import num...
5fe6029eef5ed1a90bca2ebd4f7b8b36bcbc6e46bdb9a632a97410b301a463d4
Python
7,004
208
# 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 # # ...
c8ad7d02fe2813acf9b91792400fc75102b0f90846917efda4047e479c3654ad
Python
7,007
215
# 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...
19e547e13f95c5c4eaaf9289acdf8106ae75ffab09ff9f274bb2a71349db567e
Python
7,010
223
# Copyright 2019-2021 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...
bedf2422369afb2798329aff3e880a63da0e104908087b623e3da34b18ee3674
Python
7,012
227
from __future__ import print_function from itertools import repeat import collections import math import torch import torch.nn as nn from torch.nn import functional as F __all__ = ['Model'] WIDTH = [16,32,64,128,256,512] def _ntuple(n): """ Copied from the PyTorch source code (https://github.com/pytorch)...
f7654d31bd01a418f95a72008cc09e74d25c654d7aef8490001ea636fc529cad
Python
7,013
187
import os import sys import matplotlib.pyplot as plt import torch from torch.utils import data from flow_solver import * from update_surface_shape import * cwd = os.getcwd() def build_dt(n,device): re = torch.zeros([n,n],device=device) re[0,:3] = torch.tensor([-1.5,2,-0.5],device=device) lr...
ee7aea48c70d0c0ca9aa731622d3163ac002dcfc9f28c5f6cf31bad3de1d4014
Python
7,014
155
import os import sys import stat from os.path import join as pjoin, exists as pexists, realpath import numpy as np import pickle import networkx as nx from neuropredict import run_workflow from pyradigm import MLDataset from graynet import parcellate """#---------------------------------#-----------------------------...
44c090ca36b31a9f768ccb9834ea8d21987fed22b0d9a55facaa800c43ffe4b9
Python
7,015
178
import logging from pathlib import Path from typing import Any, Optional, Union import torch import flair.embeddings import flair.nn from flair.data import Relation, Sentence from flair.file_utils import cached_path log = logging.getLogger("flair") class RelationExtractor(flair.nn.DefaultClassifier[Sentence, Relat...
4fe0143e231eb054fab8a21950df39f4ce3ea193651f29eb418022191ee0d993
Python
7,018
180
# 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...
fa8d533587008071ca689ff8986c7cdd34a938892f3d7f04016ae5ff20a19f07
Python
7,018
188
#!/usr/bin/env python ''' Example python script using anlffr functions, meant to be called from the command line. This was originally created to analyze data from a Brainvision EEG system that was already preprocessed in Matlab. There were three conditions with two polarities each, stored in files of the form 'subjec...
10c9b89c3f16f6ba63dd0d0362cd156a8aba0e7b8087ad41d0ff873cb266cb51
Python
7,020
233
# 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 # # ...
a04b715b4717c4ba961c75767e7af9113efe663556da84bc8eeb6b37dfd9692e
Python
7,025
182
# 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...
2a30db78097ba59041ab15f3ec6b6294651ee738abd69a997e0e279abfc4683c
Python
7,026
223
"""NIfTI header inspection utilities (``fslinfo`` / ``fslhd`` / ``fslval`` equivalents).""" import os from pathlib import Path from typing import Any, Dict, List, Optional, Tuple import numpy as np import nibabel as nib from bcblib.imaging._types import NiftiLike from bcblib.imaging.io import load_nifti # --------...
00f0eb1876a21d431f40b98c9b2074557a3622d5f9c2968d0d5a69de53feee60
Python
7,029
133
import numpy as np from numba import types, jit, prange from stratego_env.game.stratego_procedural_impl import _get_state_from_player_perspective, _get_valid_moves_as_1d_mask, \ _get_partially_observable_observation, _get_fully_observable_observation, \ _get_action_1d_index_from_player_perspective, _get_next_s...
b50d4e581154b07de55846b99082164cc12f2c212a8145caece3e0c3147a9742
Python
7,030
187
# Copyright 2015 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...
dface173b235c521d60f2b2c44826fc9f993bdbad48c74fd4608e9fc25c9f967
Python
7,030
187
# 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...
a3e691924f0bfd27038fb7aac36cad26c1e6244b9256d2599bd6783d403d21b2
Python
7,034
196
# 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...
c5f438c0a0e90ad6c12b0fcfed665a879e52d5556ecd6d262e8743f6c96dd444
Python
7,035
157
"""Compute cycle-by-cycle features.""" import warnings import numpy as np import pandas as pd from bycycle.utils.checks import check_param_range from bycycle.utils.dataframes import drop_samples_df from bycycle.features.shape import compute_shape_features from bycycle.features.burst import compute_burst_features from...
49c50ecf74c52ee2673c35dcbcc09f3463af6b04273908102da81017b5ed898e
Python
7,036
192
from __future__ import annotations import pathlib import pytest import optuna from optuna.artifacts import FileSystemArtifactStore from optuna.artifacts import get_all_artifact_meta from optuna.artifacts import upload_artifact from optuna.artifacts._protocol import ArtifactStore from optuna.testing.storages import S...
b924f0dfbc9cbeeb7318bcde7e47c1f9bc2d620e9558726b7739dd27d59032c3
Python
7,037
202
import numpy as np import math from numba import jit import os import hdf5plugin os.environ["HDF5_PLUGIN_PATH"] = hdf5plugin.PLUGINS_PATH import h5py from typing import Dict, Tuple # CODE BORROWED AND ADAPTED FROM THE DSEC GIT REPOSITORY # (https://github.com/uzh-rpg/DSEC) def rectify_events(x: np.ndarray, y: n...
4ba4e9835a76826bb96f21d5aac5df92e8144ad2ddd45bbde04aac0f380453d1
Python
7,047
222
# 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...
a4dcfb3def06d63e047ff92169a6ac841b5aedd33fbbcda132a83d68e00e9384
Python
7,052
151
# SAFE TEAM # # # distributed under license: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) # # import argparse import time import sys, os import logging def getLogger(logfile): logger = logging.getLogger(__name__) hdlr = logging.FileHandler(logfile) formatter = logging....
bd0cd18fc4ad76b8e84629d0eeec7a03a2039d6ec3e24804cf32dbf9047923d2
Python
7,054
189
from matplotlib import colormaps import matplotlib.cm as cm import matplotlib.colors as pltcol import numpy as np import pandas as pd def _colorarray_from_string(cmap, ncolors): """Get colormap array from string that loops through colors.""" if cmap in pltcol.ColorConverter.colors.keys(): colors = pl...
4e83c697eea7d4954f54e7540a8bce0bd6528109f2b193b59817b7f1dd0b27d8
Python
7,055
185
""" 5. Running Bycycle on 3D Arrays =============================== Compute bycycle features for 3D organizations of timeseries. Bycycle supports computing the features of 3D signals using :class:`~.BycycleGroup`. Signals may be organized in a different ways, including (n_participants, n_channels, n_timepoints) or (n...