sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
53ad083b48a3ce35493048e6eb720b5fb8cf7ebe14615ffd92ebbe5b2a7243ee
Python
3,662
128
import os import imageio import numpy as np from .event2frame import EventSlicer from .event2frame import rectify_events, cumulate_spikes_into_frames import h5py from tqdm import tqdm def generate_files(root: str, sequence: str, num_frames_per_ts: int = 1): flow_path = os.path.join(root, 'train', sequence, ...
8cbe159bb5148c29b210ee8976f7fded894fc203f58f3c8bde3ca90d46411345
Python
3,663
112
# 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...
0160e30201decf02b2a5a583efd405d7c2f4e0b2d3c479e2438789a1ac922868
Python
3,665
109
# coding=utf-8 # Copyright (C) 2022. 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 # # ...
3a987e6d239d015f99671d811d9b4af95152139ad114e1ec72eee80909357b6f
Python
3,666
97
# 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...
7860bfa8bdcb06131f0403342a1382782307d922a685d111b9105dd9ec401668
Python
3,666
100
#!/usr/bin/env python3 ''' Created on Aug 9, 2017 @author: arnon The MIT License (MIT) Copyright (c) 2015 Acrisel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including w...
17c32e7b83b4eb4b8d85eee94b85249847e16ca27344ca3d551ad42fc1d55894
Python
3,668
101
import copy import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from torch.autograd import grad from torch.optim import Optimizer import sys import glob import os import numpy as np from CloMu import * #Prediction of causal relations on Simulation I-a for R in r...
1fcf2c107ebaee7ca8206b2229ec7923e48bdf61e6a559e2b1137ef0bec4f634
Python
3,668
98
# 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...
39c12fa76ac02df24f3656e03657702f98f58a1108eb5998d1731ab35a76600e
Python
3,668
100
# 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...
0cc7c3cc5f8e351297a9924376369f70a1fb3c1ce6e70d3a04d83ab915492f25
Python
3,669
102
import os import subprocess import glob import dxpy import dx_utils BIONANO_ROOT = '/Solve3.2.1_04122018/' SCRIPTS_DIR = os.path.join(BIONANO_ROOT, 'PIPELINE', 'Pipeline') HYBRID_DIR = os.path.join(BIONANO_ROOT, 'HybridScaffold', '04122018') TOOLS_DIR = os.path.join(BIONANO_ROOT, 'RefAligner', '7437.7523rel') os.env...
ce539c410580e3d5c98806341b7c9b98584502a3ad6fa314b05745397ff96a8e
Python
3,672
95
""" This script generates figure S6d from the paper : This is the decoding accuracy after movement onset Internal notes: """ 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.pol...
d70f1c2b8353e4b1f08a8d5bb26c667cb2e42abbe83f480391d756761cafb9bd
Python
3,676
101
"""Unit tests common to all catalogues.""" __author__ = ["jgyasu"] __all__ = [] import pytest from sktime.tests.test_all_estimators import BaseFixtureGenerator, QuickTester class CatalogueFixtureGenerator(BaseFixtureGenerator): """Fixture generator for catalogue tests. Fixtures parameterized: --------...
73e191213ea8bcb6e0fc317e86f6055094d9b28b1ac6f06b54d1a82231953b65
Python
3,677
99
#------------------------------------------------------------------------------- # elftools tests # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- import unittest from io import BytesIO from random import randint fr...
45f07fd2c637d111dae4f859a288b304f729f9623737bcc6dee72bcd9562e773
Python
3,680
100
import pytest import flair from flair.data import Sentence from flair.embeddings import TransformerWordEmbeddings from flair.models import TARSTagger from tests.model_test_utils import BaseModelTest class TestTarsTagger(BaseModelTest): model_cls = TARSTagger train_label_type = "ner" model_args = {"task_n...
7311d3ecd83ba971cf9e5581bf05700b81e2de27734929fb84ca8592a2aff2da
Python
3,680
116
import logging logger = logging.getLogger('DockOnSurf') def tail(f, lines=20): """Returns the specified last number of lines of a file. @param f: The file to retrieve the last lines from. @param lines: The number of lines to be retrieved. @return str: The last number of lines """ total_lines...
088e3a22b91719e522ae49684d06b361d1642e105cae113cb736188b718c5795
Python
3,681
114
# 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...
c4a80d50ae2fa3cee66cfb8427835db1a28a024b0f2abc5550a01fe3111fe3d6
Python
3,682
107
#!/usr/bin/env python # salsa 0.0.1 # Generated by dx-app-wizard. # # Basic execution pattern: Your app will run on a single machine from # beginning to end. # # See https://wiki.dnanexus.com/Developer-Portal for documentation and # tutorials on how to modify this file. # # DNAnexus Python Bindings (dxpy) documentation...
03da48e16ebb01873b553afd9d51bd788118e8ce0ae5392dc6cd71e3bdd91cfd
Python
3,684
92
from copy import deepcopy import sys, os import torch import torch.nn as nn import numpy as np from vp_suite.model_blocks import ConvLSTM as OurConvLSTM from vp_suite.utils.models import state_dicts_equal REFERENCE_GIT_URL = "https://github.com/Hzzone/Precipitation-Nowcasting.git" REPO_DIR = "Precipitation-Nowcastin...
44eef06d3d6993ce9903c00585e6fba6092696abf2f33a9d6d2e2981ee6eb57b
Python
3,684
130
from __future__ import annotations from dataclasses import dataclass from typing import ClassVar, Callable import pandas as pd from pandas import DataFrame from seaborn._core.scales import Scale from seaborn._core.groupby import GroupBy from seaborn._stats.base import Stat from seaborn._statistics import ( Estima...
462639d3f7b28c2aedda98b42c837dcd718fa7d252ec34bba371e5e5e311e6d3
Python
3,685
113
import pytest from flair.data import Sentence from flair.models.entity_mention_linking import ( Ab3PEntityPreprocessor, BioSynEntityPreprocessor, EntityMentionLinker, load_dictionary, ) from flair.nn import Classifier def test_bel_dictionary(): """Check data in dictionary is what we expect. ...
6786d8b5199cfd8d73c04cfc791cb5152597d3881ceb509da3e811117e7fbb59
Python
3,685
110
""" @file: input_representation.py Created on 13.02.20 @project: CrazyAra @author: queensgambit Input representation for which is compatible to all available lichess variants and passed to the neural network """ import DeepCrazyhouse.src.domain.variants.input_representation as variants from DeepCrazyhouse.src.domain....
afd8299afee7bb3d5f334dde2ea8586392511bdb91a418778b201edb9695a09a
Python
3,687
104
# 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...
74c9ef371932db410c4ebbb87eeafaf8cfe0265d329057d842650251eaa320f3
Python
3,689
114
# Copyright (c) OpenMMLab. All rights reserved. import torch.utils.checkpoint as cp from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from .se_layer import SELayer # class InvertedResidual(nn.Module): class InvertedResidual(BaseModule): """Inverted Residual Block. Args: in_channels ...
d4495e84c66a0d1e8c43a0d79195bb16077fbd38f244f838ea3199b2d308e80d
Python
3,689
129
""" Test routine for pytest Vector Strength routine testing 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 development) Copyright 2021- Paul B. Manis Di...
11aea5bb093d732629901f48824f63bc974bf39bba4a2bf73be1c9888778c853
Python
3,692
155
"""Figure 7 Supplement 1 Replot of VS-SAM-AN-BUcnmodel-test.pzfx Just plot the ANF data, 100% modulation, all on one plot vs frequency """ import io from pathlib import Path import matplotlib.pyplot as mpl import matplotlib.patches import numpy as np import pandas as pd import seaborn as sns import pylibrary.plottin...
be5d156dd0acd71cb558201ce02782bf6c887c2bfb33c2c88ddb573a3a2b3e86
Python
3,692
112
# -*- coding: utf-8 -*- """ Created on Thu Dec 15 17:48:41 2016 @author: daniel """ import pandas as pd import json import matplotlib.pyplot as plt import seaborn as sns import numpy as np def mg_block(mg, alpha, v, eta = 1/3.57, x_offset = 0): block = 1 / (1 + mg * eta * np.exp(-alpha * (v + x_offset)) ) ret...
df2947b3cd0f4eb4623afe014605a403617cd8189f160b17317abcf7b6cf4237
Python
3,693
122
from __future__ import annotations import json from pathlib import Path from typing import Any import pyarrow as pyarrow import pyarrow.parquet as pyarrow_parquet from graynet.domain import RunConfig RAW_EDGE_FILE_NAME = "edges_raw.parquet" SUMMARY_EDGE_FILE_NAME = "edges_summary.parquet" ROI_STATS_FILE_NAME = "roi...
3245b28c24d4dc837ea887d9e61562f9526fb3c1182b8d522db75f3900fd6787
Python
3,694
99
from flair.data import Sentence from flair.models.prefixed_tagger import EntityTypeTaskPromptAugmentationStrategy, PrefixedSentence def test_entity_type_task_prompt_augmentation_single_type(): strategy = EntityTypeTaskPromptAugmentationStrategy(["genes"]) sent = Sentence("This is a test sentence.") aug_s...
af502af4d3eba100eac78b8b69a9f9eb885916e2492f7568326c2e237d5784fb
Python
3,695
108
# 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...
ac677c2c6c844780df6c953bd48268e37152c0ea057231741fb8f56f4b10cd66
Python
3,699
119
from __future__ import annotations from argparse import ArgumentParser from multiprocessing import cpu_count from pathlib import Path from svgbit import load_10X, load_anndata_h5, load_table, run, plot from svgbit.filters import low_variance_filter, quantile_filter from svgbit.normalizers import logcpm_normalizer, cpm...
161b9ca5de5e1cdb3796d329cce943466fa75d2e6e54bbe8f80ad7ee77ad1316
Python
3,701
114
# 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 # # ...
fe089c02772a65b354fdb8541e49659b15c9585655b13e840f1bcbe2e96eac1d
Python
3,702
110
""" @file: input_representation.py Created on 13.02.20 @project: CrazyAra @author: queensgambit Input representation for which is compatible to all available lichess variants and passed to the neural network """ import DeepCrazyhouse.src.domain.variants.input_representation as variants from DeepCrazyhouse.src.domain....
7bdadfab5cb4b0318f3c699db45ec317b6160eb6561e9f11b5877c1724caae5f
Python
3,703
110
# 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...
48edc68a8e92efbe278a60c30701df187b12d9715831a6ac4c1b9bd676774739
Python
3,704
124
# 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...
0e2f89eb15e382006a242628ec9c977e77c89bb1ac699df1a9f364fceeb532d0
Python
3,706
99
"""Test for distance path functionality.""" import numpy as np import pytest from skbase.utils.dependencies import _check_soft_dependencies from sktime.dists_kernels._numba_distances._distance import ( _METRIC_INFOS, distance, distance_alignment_path, ) from sktime.dists_kernels._numba_distances.tests._ut...
dec533d0287109a8e18a5271491aab743180145b4c723213692c832c96e04450
Python
3,706
111
# Copyright (c) OpenMMLab. All rights reserved. from argparse import ArgumentParser, Namespace from pathlib import Path from tempfile import TemporaryDirectory import mmcv try: from model_archiver.model_packaging import package_model from model_archiver.model_packaging_utils import ModelExportUtils except Imp...
1403718ee5a5e027054b8b485877efcf964196ac08a604a2f713bdbf1cc07f2f
Python
3,707
81
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn from mmcv.cnn import build_conv_layer, build_norm_layer from ..builder import BACKBONES from .resnet import ResNet @BACKBONES.register_module() class ResNet_CIFAR(ResNet): """ResNet backbone for CIFAR. Compared to standard ResNet, it uses...
3a8641840c780e7c269089bf2684f4c76a8e9dacb47aac3a528b6c81fa12165b
Python
3,707
102
# 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...
98006a1692dddd0bc78977e880c2bbb31a1d3ef79659fc8c1ed61a8b16680973
Python
3,707
108
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.op_run import OpRun _MIN_REFLECT_AXIS_LENGTH = 2 def _pad_impl(data, raw_pads, mode, constant_values=0.0, axes=None): input_rank = data.ndim if axes is ...
9ce59a16329957f3051e4c6a81e11e2942a8e214aa8f75b2bb5b1f9cdfdd95de
Python
3,708
83
from collections import namedtuple import pytest from model_archiver.manifest_components.engine import EngineType from model_archiver.manifest_components.manifest import RuntimeType from model_archiver.model_packaging import generate_model_archive, package_model from model_archiver.model_packaging_utils import Mode...
ad93e87996eefdc2bcb5de49e0b571671b288e3c13a1dac77b8d8fd9d7b6f3f6
Python
3,708
105
# 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...
298912292709480d5a844dfe202b51e8b74e89127bb127e4fc85d08c3eb2f2ab
Python
3,709
119
import numpy as np from tqdm import tqdm from sklearn.metrics import accuracy_score, sensitivity_score, specificity_score from sklearn.metrics import confusion_matrix from sklearn.model_selection import StratifiedKFold import torch from torch.utils.data import TensorDataset, DataLoader from torch.autograd import Vari...
8812c21e575b56cda9cd9bd12b33c3620e26e5ec01d924121738917c8b9e8667
Python
3,714
93
# 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...
af3fe6e89cb561d7bbd636b3e96d62f3440908cd582104dbcc9131698058342f
Python
3,714
136
# 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...
e8d8ff2d4020e0b4c6e2e43a9ca7f7bc3330ea2073a544eb0950f08eb89cdd34
Python
3,715
111
# 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...
ae139c37061e15bcf5b878f154ad30c8823aa33a76b451d15c89a0cc8a771c15
Python
3,718
137
"""Hyperbolic distances implemented in pytorch. This module was copied from the repository the following repository: https://github.com/asappresearch/dynamic-classification It contains the code from the paper "Metric Learning for Dynamic Text Classification". https://arxiv.org/abs/1911.01026 In case this file is mo...
c55ce5d6c57bd277bcadf6591960c43678e537f2825c6ae50c0e6dafca215435
Python
3,719
90
# 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 class MelWeightMatrix(Base): @staticmethod def export() -> None: ...
3c2e5976c1c93f30cf654915e8135026a2c4d8d2eb20b7686a15577cb7ce158c
Python
3,720
111
""" SNS-Toolbox version 1.5 has expanded the capabilities of Spiking Neurons and Synapses. This tutorial explores these new features. """ """Imports""" # Import packages and modules for designing the network from sns_toolbox.networks import Network from sns_toolbox.connections import SpikingSynapse from sns_toolbox.ne...
3bfd61ed2bf9e7a05c37aabda036d2c231d0d74ebfdd035da8f64fd07f04c04b
Python
3,721
98
# 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...
5dd69a904072b0796e064f1ab8c4c410d8159754e3afd4daa843d10d383a225f
Python
3,723
102
from typing import List, Tuple import numpy as np from torch_geometric.data import HeteroData from molucn.utils.utils import get_common_nodes, get_positions, get_substituents EPS_ZERO = 1e-8 def get_imp_substituent(site, subs, pos_sub, color_pred): """Returns the importance of the substituent at the given site....
556d91cbc89f40b7e68810caa8876f68decad58ccc10d194f762e79b8c00f0fd
Python
3,724
109
# 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...
aaec9d9af45c4494065aad6863e02215f72b67f012593aca53ac4ec38f9c9b24
Python
3,725
84
""" Converts owl or ttl or raw rdflib graph into a pandas DataFrame. Saved in .pickle format. Usage: allen_transgenic_lines [options] Options: -h --help Display this help message -v --version Current version of file -r --refresh Update local copy -i ...
12ad37f3436eaa4c97e8f0a2afb986c9287f86eeebfc83ba34a77e71ca94d466
Python
3,726
124
import random import matplotlib.pyplot as plt import numpy as np import torch from gpytGPE.gpe import GPEmul from gpytGPE.utils.metrics import R2Score from Historia.history import hm from Historia.shared.design_utils import get_minmax, lhd SEED = 8 def f(x): # elliptic paraboloid: y = x1^2/a^2 + x2^2/b^2, a=b=1 ...
22cb9b83a1fb7f12adff81d68653e566d8a37505250232eef15b26364fbc3b8d
Python
3,728
100
# 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...
36cddacbf2e9a49ba623d9945cb06ab5c01a6e5dde6e19754b31a637a7fa5f41
Python
3,728
86
# 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...
3ca2cce01c957fbe555e8a34d6c6023cff089d8621128e430ef0ec62742dcd8c
Python
3,728
112
import numpy as np import pandas as pd from sklearn.cross_decomposition import CCA from sklearn.utils import check_array from sklearn.utils.validation import check_is_fitted, FLOAT_DTYPES from sklearn.metrics import silhouette_samples class CCA_extended(CCA): def __init__(self,*args,**kwargs): super()....
5154bc9bce2b41aa80d9aa0e4d2ab0c58f3d392bd3b098525e453699274b482f
Python
3,729
108
# 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...
2f05affaf4455e295d684b7e1e9994c35d9481d1485692adc54536ac78dc9307
Python
3,731
111
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) # Ported from skchange (BSD-3-Clause), original authors: johannvk """Rank-based multivariate cost function.""" __author__ = ["johannvk"] import numpy as np from sktime.detection.costs._base import BaseCost def _rank_cost(segment_starts, segmen...
9c765365ed71baabbd2c010c360a842ba24688a2d511ef43220c2fed09294804
Python
3,735
91
import matplotlib.pyplot as mpl import numpy as np from pathlib import Path from scipy.io import loadmat from lmfit.models import LinearModel from scipy.stats import linregress import pylibrary.plotting.plothelpers as PH # sns.set_style(rc={"pdf.fonttype": 42}) mpl.style.use("~/.matplotlib/figures.mplstyle") diskpath...
f54dd2788ea0b72b792ccec78bdfa99c703d9ffc50d7c493ade5b462c7d75581
Python
3,738
129
# 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...
b594141079d9ad47a2dab917173b5c8f22a8370eae288e6b7dca98cf669d102c
Python
3,739
94
import argparse from biom import load_table import pandas as pd import numpy as np from q2_matchmaker._stan import _case_control_single if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( '--biom-table', help='Biom table of counts.', required=True) parser.add_argumen...
c87583da2751c91e4f4ca5624e3eaf700142337d26e71b6d2c0f3982f31de33a
Python
3,739
118
from __future__ import annotations import logging import time from typing import TYPE_CHECKING from optuna.artifacts.exceptions import ArtifactNotFound _logger = logging.getLogger(__name__) if TYPE_CHECKING: from typing import BinaryIO from optuna.artifacts._protocol import ArtifactStore class Backoff:...
9d26e3b6c12a9c1242f60332f8961e4de7e2c67e5dba44e1437fac80d3c4a9a1
Python
3,740
101
# 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...
d8e49480127f5a5dfd1bdd6b79f1f601e745f97cb7084d212af997e1e9e89b1e
Python
3,744
127
#!/usr/bin/env python import click from functools import partial import gzip from multiprocessing import Pool import os import pandas as pd import re from sklearn.preprocessing import quantile_transform import subprocess as sp import sys sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), ...
ed4de428cd163274a0aeb32d91d4cc0ac13bf98701ace822591cd70b47122c36
Python
3,744
111
""" Author: Yifan Jiang (yifanyifan.jiang@mail.utoronto.ca) and Peidi Xu (peidi@di.ku.dk) Description: Given a bifurcation, finds the optimal position of the branching point and the optimal radii. """ import numpy as np from scipy.optimize import minimize class GD_OptimizerUnit: def __init__(self, locs, rad...
d0dba2c56ec9817580f30cfd96dfaf33e28378491b0b61cf56122097d462eff2
Python
3,747
116
# 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 from onnx.defs import AI_ONNX_PREVIEW_TRAINING_DOMAIN def apply_adagrad(r, t...
ad1afd3ee809fed0ecabddaef0b0eb4d324d80420ddd5a6757881838c0f8bb44
Python
3,750
94
from docopt import docopt from IPython import embed from ilxutils.cli import Client import json import os import requests as r from sys import exit import time import unittest VERSION = '0.0.2' # ILX:0108124 == "Organ" | term # ILX:0101431 == "brain" | term # ILX:0107497 == "Neuron" | term # ILX:0112772 == "Afferent pr...
1e81e7f46d889cc2662ea9f30128b5cdc921303c0a1c94fd4095e903b48f82e9
Python
3,753
121
# 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...
2b42f14fb346dd4c22e353fe827d76fb1b4b90e9e508010f0a33db91e1973fc2
Python
3,756
122
# 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...
b4c0b87bf4c8e8221e1a58f60e79a78dc5d3600ffcddfc24b6bb12b2e058d833
Python
3,756
103
''' Pure-python implementation of UCSC "liftover" genome coordinate conversion. LiftoverChain test. Copyright 2013, Konstantin Tretyakov. http://kt.era.ee/ Licensed under MIT license. ''' import os import sys if sys.version_info < (3, 0): from cStringIO import StringIO else: from io import BytesIO as StringIO...
b9d53956425c2fcd1c1f1d2d4bee4f91e48e49f1d8e6edb61907c47c2e60382a
Python
3,757
100
#------------------------------------------------------------------------------- # elftools example: dwarf_lineprogram_filenames.py # # In the .debug_line section, the Dwarf line program generates a matrix # of address-source references. This example demonstrates accessing the state # of each line program entry to retr...
0c7b6965f499167ad25c8f51769bd0dbabcd57cca255356dc0c775a95f665369
Python
3,758
87
# Copyright 2023 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...
902997654fb160ea28dc18aa24fa8702ee25c14fe396a7ef839f78da344e7018
Python
3,759
107
import h5py import numpy as np import os class anidataloader(object): ''' Contructor ''' def __init__(self, store_file): if not os.path.exists(store_file): exit('Error: file not found - '+store_file) self.store = h5py.File(store_file) ''' Group recursive iterator (iterate thr...
85d8841aa996bfd58b40e7b8bd434b18e6d9a4ccdbe95991a417becaa19e634a
Python
3,760
108
""" Functions to extract the cell boundaries """ import pandas as pd import numpy as np from multiprocessing import Pool, cpu_count from multiprocessing.dummy import Pool as ThreadPool # All that below is to avoid diplib to show a welcome msg on import. If hasattr(sys,'ps1') return True, then # import diplib will prin...
300df905a53f81492b548fcb148dfcf8923815f880704265586f982e158db680
Python
3,761
116
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Dec 12 13:56:45 2017 @author: tpisano """ import numpy as np from math import sqrt, exp from skimage.morphology import disk, dilation, binary_dilation, ball from tools.imageprocessing.target_arrays import generate_target_array_selem, apply_dilation #...
4bea19a8f4bd10c0707d32742d4d16f676f8b089e8e2503e0d65eeec136c0942
Python
3,761
94
from genomic_benchmarks.data_check import is_downloaded from genomic_benchmarks.loc2seq import download_dataset from genomic_benchmarks.utils.paths import CACHE_PATH from torch.utils.data import Dataset class GenomicClfDataset(Dataset): """ A class to represent generic genomic classification pytorch dataset. ...
f0b2c0528427ec315b4c906dbdfcfe572c8b29e1c1acfecdd0f0c936c15bbd54
Python
3,763
133
# 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...
5e2f4620c0c491b8a5dbb6f568b48359b49af61821a5ffdf51f04fddf494e166
Python
3,764
113
# 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...
981c5ee47f7220139082ac48e8315c03558cb4e7e7d90b8e206f9fe3c3212f09
Python
3,765
101
# 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...
cd6062970ad76839e199ab1b482e826396757eddb29669b043e01cb833ef026a
Python
3,765
112
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Description: # Testing code of DIAM-CNN # # Copyright @ Yanqiu Feng # Laboratory for Medical Imaging and Diagnostic Technology # Southern Medical University # email: foree@163.com # import sys sys.path.append("/public/siwenbin/DLQSM_YH/") from utils import * from c...
11dde09fd58980675da0f799c9960dcf365bef125ecdeb079dc1a748368d1030
Python
3,766
74
""" @file: mixture_net.py Created on 17.02.20 @project: CrazyAra @author: queensgambit Experimental network which combines the output of multiple singular networks by a weighted sum of a learnable weighting parameters. Proposed by Arseny Skryagin and Johannes Czech """ import mxnet as mx from DeepCrazyhouse.src.doma...
431c92723d0aa2f2991a968c0dc1e0785048046d7f2990fc789ef9f8236ed11c
Python
3,766
118
# 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...
bf075d589f1da4a64d7ebf370e90018122bae782c6485cb0342bb1b57e634ec0
Python
3,767
74
""" @file: mixture_net.py Created on 17.02.20 @project: CrazyAra @author: queensgambit Experimental network which combines the output of multiple singular networks by a weighted sum of a learnable weighting parameters. Proposed by Arseny Skryagin and Johannes Czech """ import mxnet as mx from DeepCrazyhouse.src.doma...
d37ad85fb61dfd0f8b3199299b2e572b1a754262b87f9492698bdeb62f58d214
Python
3,768
98
from IPython.core.debugger import set_trace import numpy as np import tensorflow as tf from src.utilities.findiff.findiff_general import solver_arguments from src.solvers.findiff.findiff_solver import fd_solve ######################################################## """ Common along with testcase specific arguments...
42006f29c19027c264464aa94ec2b56328d16864be17108f39cc6ddcc7618730
Python
3,769
114
# coding=utf-8 # Copyright (C) 2022. 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 # # ...
fefe1902e12c31833b064697feb098ec35350389501480eac6c614104fbdf6ee
Python
3,769
131
import pandas as pd import numpy as np import joblib import seaborn as sns import matplotlib.pyplot as plt # Need this line so text is text in svg export plt.rcParams['svg.fonttype'] = 'none' import wrangle_data as wd import rf_auxililary_functions as rf_aux # Utilities from sklearn.model_selection import train_test...
8f712346aa069220827d1fc57f3483356acdff4c40a4e24159acfbed364a49c0
Python
3,771
160
import torch import torchvision.transforms as TvT import random import numpy as np class Random_horizontal_flip: def __init__(self, p = 0.5): self.p = p def __call__(self, x): events, flow, mask = x if torch.rand(1).item() <= self.p: events = TvT.functional.hflip(ev...
0edf0a7ec44aa2eac308c11bb20da87f3a3b005d3de7d3c538c6ad501b172a27
Python
3,772
111
# 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...
2de82ef40188d6cb447a2e584ce45467dc0712f3c64ac83cc2838968deef839a
Python
3,772
110
"""Compact GA minimal implementation""" from __future__ import division, print_function import numpy as np # to replace 'inf' with np.inf and vice versa class CompactGA(object): """Randomized search on the binary domain {0,1}^n. cGA samples two different solutions per iteration. Minimal example:: ...
047ff8981fe15a1686978146bc95ce31f2f1289717ac7293a37b6aa56034987e
Python
3,773
106
"""Interpolated phase, using cyclepoints.""" import numpy as np ################################################################################################### ################################################################################################### def extrema_interpolated_phase(sig, peaks, troughs, r...
0935f4821fca909ce99b4184bf320ce3bdc282929905efd2b04bbe0431440fde
Python
3,774
117
# 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...
743a755653d6ce7d843c80b133d79d34162b22b6486ac603d91a8a040a4a06b2
Python
3,775
102
#!/usr/bin/env python # show traces from simulation run (current-voltage - IV) # from __future__ import print_function import os import sys from pathlib import Path import pickle import matplotlib.pyplot as mpl import toml def main(): with open("wheres_my_data.toml", "r") as fh: config = toml.load(fh) ...
180d2238dac1beae5062c7a95d2f15acdf65b4c7d9890e2d33cb20cf07f4d830
Python
3,777
108
import dataclasses from typing import Dict, List import numpy as np import pandas as pd import torch from torch.utils.data import Dataset from preprocessing.features import AudioFeatures from utils.arguments import AudioArguments class AudioDataset(Dataset): def __init__( self, samples_df: pd.Da...
ae6dacf71dd614cd2428d441ba53d6ade65be6346098cfcf0c1be26520f24910
Python
3,777
79
# 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...
d0f1c56fe775f2609ad4fa612d783ca45a7dca72b972e41725c4a19837f5541f
Python
3,777
81
from __future__ import print_function from freqAnalysisTools import band from os import listdir from os.path import isfile, join, splitext import sys import pickle import math import numpy as np from sklearn import linear_model, svm, ensemble, neural_network from parameterSetup import ParameterSetup from evaluationCrit...
e982ef3b39954dce87ba41971405e70bdbbabac68d538200cddd37b721f0fedf
Python
3,779
107
# 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...
dad7b0ff314a11fc391a1b12c116842e600c3051b9a3a77b797b0081feb4e5b2
Python
3,781
104
""" @file: change_onnx.py Created on 30.10.21 @project: CrazyAra @author: queensgambit Allows changing the batch size of an already existing ONNX-model. Based on https://github.com/onnx/keras-onnx/issues/605 https://github.com/sitting-duck/stuff/blob/32b77388c54c5ca5f5039365824b15483fc22fc2/ai/onnxruntime/edit.py ""...
8b206891061427a405b705ec187bbc5efc861e0b7af7c33b630dc3f365320122
Python
3,782
98
""" This script generates figure S6c from the paper : This is the decoding accuracy before movement onset, removing unreliable trials (movement before main movement onset) Internal notes: """ import pandas as pd import pickle as pkl import numpy as np import os import glob import matplotlib.pyplot as plt import matplo...
53b1035883f6f6a3a5844ae8127cd144d9a1ec4faad8a79e397ab36d6814bb19
Python
3,783
118
# 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...
97165ef65e3fc01f2b9663a77bd710dd527d1f8fa78137a221bb64de739e9a36
Python
3,783
98
import numpy as np def rolling_window(a, window, step): """ Make an ndarray with a rolling window of the last dimension with a given step size. Parameters ---------- a : array_like Array to add rolling window to window : int Size of rolling window step : int Size o...
e0536813d1a7573f8ec033fff072506c4d88d9920d53a4a8d3eaedf135676864
Python
3,783
102
# ---------------------------------------------------------------------------- # Copyright (c) 2017-2026, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...