sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2f7207a8179ab042d41efc32e424ff8b3544321335dadbdedbcf6abade3d0ef5
Python
623
19
from __future__ import absolute_import import os import sys # If we are running from a wheel, add the wheel to sys.path # This allows the usage python pip-*.whl/pip install pip-*.whl if __package__ == '': # __file__ is pip-*.whl/pip/__main__.py # first dirname call strips of '/__main__.py', second strips off ...
62d9ed2129817badc8ebb2735636b6d59bc20869cd3194517f138ca169b5c932
Python
623
28
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture = dict( type="PreprocessedSpliceAI", preprocessor_spec=dict(type="Identity"), spliceai_spec=dict( type="SpliceAIModule", output_size=3, spliceai_spec=dict( t...
93e124ef598e322e24eed6d4076390c02ffe5fce7f2394b8f827d035b7319471
Python
623
28
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture = dict( type="PreprocessedSpliceAI", preprocessor_spec=dict(type="Identity"), spliceai_spec=dict( type="SpliceAIModule", output_size=3, spliceai_spec=dict( t...
d3a14956597f8134ed7eb0269faf2b6c47fb5ca1b0195f3ddd569811884bf941
Python
623
29
import multiprocessing from time import sleep from codecarbon import EmissionsTracker def no_load_task(number): sleep(60) def cpu_load_task(number): a = 0 for i in range(1000): for i in range(int(1e6)): a = a + i**number tracker = EmissionsTracker( measure_power_secs=10, force...
d8dddff54268254bd97da5b1b7c144fa333487cfc0d8aff4f63b868aac0ebea1
Python
623
28
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture = dict( type="PreprocessedSpliceAI", preprocessor_spec=dict(type="Identity"), spliceai_spec=dict( type="SpliceAIModule", output_size=3, spliceai_spec=dict( t...
fe2c40cb71694b83af8aff3383c3957c0c065818d70cfa17940d48acede190c1
Python
623
14
# Copyright 2022 Deepfold Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
5c3971d321121d6a8a3d69cd3ebf6ae1ddeb873893346892fe1dc462e2906633
Python
624
17
#!/usr/bin/env python # ----------------------------------------------------------------------------- # Copyright (c) 2013, The Deblur Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # --------------------------...
9eb86c71273c53a538343db5c9019f580d02ed6cba24c4d745b65952f797be7a
Python
624
21
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 12 + 2 msp.architecture["motif_model_spec"] = dict( type="PSAMMotifModel", motif_spec=dict( type="grouped", original_spec=dict(type="rbns"), group_motifs_pat...
a27fd830b2998810ae5e0a669b2efa6c6699888e7dbbd9c08d3a104eaa379b2c
Python
624
29
#!/usr/bin/python import sys import time from murfi_activation_communicator import MurfiActivationCommunicator def main(argv): roi_names = ['active'] communicator = MurfiActivationCommunicator('localhost', 15001, 85, ...
a3c833086d6f626f257351d800b79fbf63ef66b236db0030943d000024bb394a
Python
624
18
import os import pandas as pd def get_add_two_numbers_dataset(num_examples: int= None): df = pd.read_csv(os.path.join( os.path.dirname(os.path.abspath(__file__)), 'add_two.csv' ), delimiter=',') df['output_strings'] = df['output_strings'].str.replace("'", "") if num_examples is not None...
abce5b056db18a562c8e3f690eb9f26d950a66baa3cfcfdd9a9fff3b1c185a1a
Python
624
21
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 80 msp.architecture["motif_model_spec"] = dict( type="PSAMMotifModel", motif_spec=dict(type="rbns"), exclude_names=("3P", "5P", "HNRNPA1", "RALY"), ) msp.architecture["sparse_sp...
ac2b1b06992f72bd046e54c77d78a21e37fa5846cdcff9ad1a216d90821096be
Python
624
18
import pytest import os from test.casestudy.Whitfield.reproduce_pseudotime_figures import reproduce_figures def get_load_dir(request, load_directory): file_path = os.path.join(request.fspath.dirname, load_directory) print(file_path) return file_path @pytest.mark.parametrize("configuration", [1, 2]) def ...
caca84d033f0025980a5a90de754ae71a46007be015fb6ceaaff082727605466
Python
624
24
import pytest from celery.utils import cached_property, chunks @pytest.mark.parametrize('items,n,expected', [ (range(11), 2, [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10]]), (range(11), 3, [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10]]), (range(10), 2, [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]), ]) def test_c...
b1e5d070336cc151e185578a581f9a28d86c235a3600e974e74fa154bf827381
Python
625
23
# Generated by Django 2.1.5 on 2019-05-22 12:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('biomedisa_app', '0040_remove_upload_inverse_steps'), ] operations = [ migrations.AddField( model_name='upload', name...
25211b77f8a2ec12b63bf3109378e2e2f556d89ce68aaf6506971d5b1bfc7df7
Python
626
23
# Generated by Django 3.2.6 on 2026-08-11 08:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('biomedisa_app', '0119_specimen_license'), ] operations = [ migrations.AddField( model_name='upload', name='separatio...
eb5097269aa5045ce40f9420ca9e9fd48f586cf59316648af7d63c983c2bbcc9
Python
626
20
""" Unit tests for OIDC authentication provider. """ from carbonserver.api.services.auth_providers.oidc_auth_provider import OIDCAuthProvider class TestOIDCAuthProvider: """Test OIDC authentication provider implementation.""" def test_oidc_provider_initialization(self): """Test that OIDCAuthProvider...
19efe13f4a397a4691d51cc8af85ced8b0e0e311deef7eac61d41e4d7e39bdcc
Python
627
22
import sys from typing import TYPE_CHECKING if TYPE_CHECKING: from ._colorbar import ColorBar from ._hoverlabel import Hoverlabel from ._legendgrouptitle import Legendgrouptitle from . import colorbar from . import hoverlabel from . import legendgrouptitle else: from _plotly_utils.importers...
2cf81dd129bbfc7b3d9ee460e1667499346e3c278bb8d28a899e67bf5bb4c1c7
Python
627
26
#!/usr/bin/env python # encoding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import os, sys, re import logging logger = logging.getLogger(__name__) def get_Trinity_gene_name(transcript_name): """ extracts the gene name from the Trinity...
6079959235de3ac000a02e195841e77dfa64b88249001564b94957d2ea79aeb6
Python
627
25
import sqlite3 from .db import DB class VaccinationTable(DB): def __init__(self): super().__init__() self.table_name = 'DL_vaccination' self.table_desc = 'Delhi state vaccination status' self.cols = self.getcolumns() def getcolumns(self): cols = { 'date'...
b67d5db241265a1e7421360096a9318a4534adffc0e45af7d19a0415db4afe4e
Python
627
27
# -*- coding: utf-8 -*- """ Created on Wed Dec 22 18:39:06 2021 @author: adrie """ import pynapple as nap import pandas as pd import numpy as np def raster_plot(spike, t_ref, t_start, t_end): # should either plot the firing of a single cell across trial # or of multiple cells around one particular time...
f7ecededa226f9b57e1a6186fd9d62880211c7569128d1077d8ac6d349786d51
Python
627
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 1 + 2 msp.architecture["channels"] = 10 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMoti...
05da30521d81115b78014c2ba55b6720f2047d128d8d3c00b0828dad50be4110
Python
628
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 1 + 2 msp.architecture["channels"] = 200 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMot...
3da84790ecac1bd3a7167bf16d4d57ca5b65486c14b59032b5221495f11a8b03
Python
628
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 2 + 2 msp.architecture["channels"] = 200 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMot...
7b841c072f03a7f115d66db6321d9fab7cc6665e7985c384f5d26e433e13de5c
Python
628
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 1 + 2 msp.architecture["channels"] = 200 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMot...
c6267a622d02b9f212e3c036dd4288b12cf5439f3e783799f7a02bd10ff59478
Python
628
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 1 + 2 msp.architecture["channels"] = 10 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMoti...
da3349707f8352535352d4281e699330eb784ab0ab39c50d5420157846cdf030
Python
628
19
#!/usr/bin/env python # -*- coding: utf-8 -*- from .__version__ import __version__ # import the segmentation model from .model import deepskin_model # import useful constant values from .model import MODEL_CHECKPOINT # import model checkpoint getter from .checkpoints import download_model_weights # import the wound se...
ec47e8a1aba410db00f1ea0e62c82c96b0632909aba3342960e4ca84d06a05db
Python
628
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 1 + 2 msp.architecture["channels"] = 200 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMot...
f188516a0d93a1e36cc0e2b94c8b5cd9875da3c98274ad27497118d621ed661f
Python
628
17
"""Define collection of fitting algorithms.""" from functools import partial from specparam.utils.checks import check_selection from specparam.algorithms.algorithm import Algorithm from specparam.algorithms.spectral_fit import SpectralFitAlgorithm #####################################################################...
2390cce106d6626eb294387a47703edad3da7db7e31e8fb5652fffec5f482c8f
Python
629
26
import matplotlib import numpy as np import pytest from anndata import AnnData from mudata import MuData import muon as mu matplotlib.use("Agg") @pytest.fixture def mdata() -> MuData: mdata = MuData( { "mod1": AnnData(np.arange(0, 100, 0.1).reshape(-1, 10)), "mod2": AnnData(np.ar...
8bce68689c655dc332d8836840b9a9b3ae13804abc1903303e1359a66777351d
Python
629
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 1 + 2 msp.architecture["channels"] = 200 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMot...
bfdd7288dc4e467c157b9f82d1c5d51b645b18d2f7ca5e5d8ba4ee7f2bb9073e
Python
629
22
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 2 + 2 msp.architecture["channels"] = 200 msp.architecture["motif_model_spec"]["motif_width"] = 9 msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = dict( type="FCMot...
d8e5cf41f0aaa597a2a96e41db1e17d432b91d1797cd06180079c2c389be1b49
Python
630
16
from nose import tools as nt import tns.morphmath.rotation as test_module import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal def test_vector_from_spherical(): assert_array_almost_equal(test_module.vector_from_spherical(1, 1), [0.454649, 0.70807...
1b4979a1aec82887332de6cef63c34cbb5cb706de148991fdff7d8ab67337540
Python
631
30
from neuron import h, gui def test_shared_counter(): nthreads = 32 nseg = 10 nsteps = 100 sections = [h.Section() for _ in range(nthreads)] for s in sections: s.insert("shared_counter") s.nseg = nseg pc = h.ParallelContext() pc.nthread(nthreads) for k, s in enumerate...
4485a716b723ca4336d33dd141f1c43b02bc8f7746d7e113bc42648fed636fe6
Python
631
32
from anndata import AnnData, concat, read_h5ad try: # anndata < 0.12 from anndata import read except ImportError: # anndata >= 0.12 removed `read` read = read_h5ad try: # anndata < 0.12 export these at top-level from anndata import ( read_csv, read_excel, read_hdf, ...
b1309cd1234e1bda765c995b57493e088edf5cf12231ad6cd1e023612426455d
Python
631
14
# Copyright 2022 Deepfold Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
c453b3e0f9eafc0afbc5f486ca09f292f6a5580f4446ee1d92c3140eaae763e4
Python
631
25
# %% import argparse import gzip # %% def main(): parser = argparse.ArgumentParser() parser.add_argument('fasta') parser.add_argument('--label', default=None) parser.add_argument('-o', '--output') args = parser.parse_args() with open(args.output, 'w') as f_out: print('sequence\tlabel',...
e12146e1037e70d8fc79b49ad305741d4b441105b099ba24d9ad2e93581810e3
Python
631
23
"""Handle reading and writing JSON in UTF-8, on Python 3 and 2.""" import json import sys if sys.version_info[0] >= 3: # Python 3 def write_json(obj, path, **kwargs): with open(path, 'w', encoding='utf-8') as f: json.dump(obj, f, **kwargs) def read_json(path): with open(path, '...
4b7c27fcd891a2af5b6d90a94be72e33202922717c4ee60f741587927d83f7fa
Python
632
29
import numpy as np from .annotation import Annotation class Other(Annotation): """ Represents an annotation cluster that is not one of the other types. Compatible with all junctions. """ @classmethod def patterns(self): return ["A", "D"] def compatible_with_overlapping_junction(...
cf7c332cc43f22166f3abfa01802a5ca21fd850447c105a89741fd0f38b6da64
Python
632
25
from celery.result import AsyncResult from galaxy.schema.schema import AsyncTaskResultSummary def async_task_summary(async_result: AsyncResult) -> AsyncTaskResultSummary: name = None try: name = async_result.name except AttributeError: # if backend is disabled, we won't have this ...
1db8c0b9d9853c4ec3e695396f16bb1beeea13efb50514244fcf196c69145a9c
Python
633
18
"""Import-time compatibility across nvidia-cutlass-dsl releases. Select implementations here, on the host at import time, so kernels use stable names. """ import re from importlib.metadata import version CUTEDSL_VERSION = tuple( int(part) for part in re.match(r"(\d+)\.(\d+)", version("nvidia-cutlass-dsl")).group...
475e5f7a3a16cae962d0ddbc6e393e7f31a55c47232495468c9f5066a45d30d8
Python
633
22
import sys from ij import IJ # Fiji Jython interpreter implements Python 2.5 which does not # provide support for argparse. input_file = sys.argv[-4] direction = sys.argv[-3] tmp_output_path = sys.argv[-2] output_datatype = sys.argv[-1] # Open the input image file. input_image_plus = IJ.openImage(input_file) # Crea...
5ec98094dc7f3b8a023db20e153378b20d38ba5cc9a780a2f4e791692754cade
Python
633
27
from .layers import * from .models import * from .preprocessing import * class MissingDependencyException(RuntimeError): pass custom_objects = { "RBFExpansion": RBFExpansion, "Gather": Gather, "Reduce": Reduce, "ConcatDense": ConcatDense, "Tile": Tile, "masked_mean_squared_error": masked...
a7e9a8f89c725dc75c9e3228d070239f6713945a896d20e116359d351cfaca84
Python
633
17
import pandas as pd import os here = os.path.abspath(os.path.dirname(__file__)) conversion_file = os.path.join(here, "co2eq.csv") CONVERSION_DF = pd.read_csv(conversion_file) def convert(g_co2eq,): """Converts gCO2eq to all units in range specified by CONVERSION_FILE.""" conversions = [] df = CONVERSION_...
3c83a94319fabbe10b857a497321f11f7f560742a120f64c358ef33b2f99f1e5
Python
634
27
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["splicepoint_model_spec"] = dict( type="BothLSSIModels", acceptor="model/splicepoint-model-acceptor-1", donor="model/splicepoint-model-donor-1", ) msp.architecture["motif_model_spec"] = dict(...
3dd3a0e005c1c07a280f90450af125c62b13953d5aa6f3b70710ba696c658a4a
Python
634
27
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["splicepoint_model_spec"] = dict( type="BothLSSIModels", acceptor="model/splicepoint-model-acceptor-1", donor="model/splicepoint-model-donor-1", ) msp.architecture["motif_model_spec"] = dict(...
547d5105819e12d726b44cf4391ad41d23c5ec14b97914c26178815c175b5ed0
Python
634
25
from angorapy.tasks.world_building.base import PhysicalWorld from angorapy.tasks.world_building.entities import Stage from angorapy.tasks.envs.dexterity.mujoco_model.robot import ShadowHand, ShadowHandReach class ShadowHandReachWorld(PhysicalWorld): def __init__(self): self._stage = Stage() self....
76202581eaa656855771f993ec503125ac646c2cbe0a1e0078fb16237946f217
Python
634
20
from models.basic import DeepLearningModel from strategies.baseline import Baseline from strategies.basic import MultiSiteLearningStrategy from strategies.owm import OWM from strategies.relay import Relay from strategies.si import SI __all__ = ['all_strategies', 'get_strategy'] all_strategies = { 'baseline': Base...
7bf8d70b0118978f32f3f003ba666cd2a77383fc4cc86398cadc13ffa801313c
Python
634
27
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["splicepoint_model_spec"] = dict( type="BothLSSIModels", acceptor="model/splicepoint-model-acceptor-1", donor="model/splicepoint-model-donor-1", ) msp.architecture["motif_model_spec"] = dict(...
989a6352da9fb224772058a4b3f516c6ca76a90cfe80cd059ae50f1152be0ce3
Python
634
24
import pytest import pickle import tempfile from rpy2 import robjects def test_pickle(): tmp_file = tempfile.NamedTemporaryFile() robj = robjects.baseenv["pi"] pickle.dump(robj, tmp_file) tmp_file.flush() tmp_file.seek(0) robj_again = pickle.load(tmp_file) tmp_file.close() assert isi...
a3cb8a90246cfc4ae77b43858ccffceb0c7bc5561a3a3257b8bd40ced09d5caf
Python
634
20
from pyabf.abf2.section import Section class SynchArraySection(Section): """ Contains start time (in fSynchTimeUnit units) and length (in multiplexed samples) of each portion of the data if the data are not part of a continuous gap-free acquisition. """ def __init__(self, fb): Sect...
ad58c5a7d167e5ec2025daad0e6a37f04d8ff7f8cf093969dd4ed2b902629b0f
Python
634
27
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["splicepoint_model_spec"] = dict( type="BothLSSIModels", acceptor="model/splicepoint-model-acceptor-1", donor="model/splicepoint-model-donor-1", ) msp.architecture["motif_model_spec"] = dict(...
b04447fdcc6f06fa54e9f3c097ccf4eeec310ac71837a887d5498d17f457bb98
Python
634
23
# Generated by Django 3.2.6 on 2022-05-27 12:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('biomedisa_app', '0088_auto_20220519_1705'), ] operations = [ migrations.AddField( model_name='upload', name='early_s...
d628d89a0bac0ea7ecb4737ba8b04c56ab00188e40eb7d63046561fccd62009b
Python
634
24
import sys from typing import TYPE_CHECKING if TYPE_CHECKING: from ._aaxis import Aaxis from ._baxis import Baxis from ._font import Font from ._legendgrouptitle import Legendgrouptitle from . import aaxis from . import baxis from . import legendgrouptitle else: from _plotly_utils.impor...
df3c9ce19f5d04135c97c5af299747a4dace9dddd9f98c9cba1815b6c99ddf7f
Python
634
27
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["splicepoint_model_spec"] = dict( type="BothLSSIModels", acceptor="model/splicepoint-model-acceptor-1", donor="model/splicepoint-model-donor-1", ) msp.architecture["motif_model_spec"] = dict(...
fbf7600cf4a8f56381171dc8de7bb237d002d8cc2d2a86d66f3b2d132a75588e
Python
634
21
"""Test functions for specparam.params.periodic.""" from specparam.params.periodic import * ################################################################################################### ################################################################################################### def test_compute_fwhm(): ...
26726696c0f14b44bab917195b95ad092445a602f53ec40cba033866d7c19b6b
Python
635
15
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # ------------------------------------------------------------------------------ from __future__ import absolute_import from __future__ import d...
fba54a456963dcabdd09866bb843579c3d4b412d6b249845032f472848837596
Python
635
22
# Default settings for image generation class _Defaults(object): """ Class to store default settings for image generation. """ def __init__(self): self.default_format = "png" self.default_width = 700 self.default_height = 500 self.default_scale = 1 self.mathjax...
ee547adcdefe580389914ed6c478cd43123530b6dd24d3900f0c40fd9425fd62
Python
636
24
# Generated by Django 3.2.6 on 2024-11-19 16:21 import biomedisa_app.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('biomedisa_app', '0117_alter_upload_epochs'), ] operations = [ migrations.AddField( model_name='profi...
f6435eb0bc13b531d7d4dc27f2f053a46ab7096881dc89b1f7b9c20b6160aa9c
Python
636
33
""" Minimal working example """ import matplotlib.pyplot as plt import numpy as np import pynapple as nap # LOADING DATA FROM NWB data = nap.load_file("A2929-200711.nwb") spikes = data["units"] head_direction = data["ry"] wake_ep = data["position_time_support"] # COMPUTING TUNING CURVES tuning_curves = nap.comput...
252886b8b8b5c1fbe42d5bf1a33d1a15de268b42fd0e9ef030247c1c559c0208
Python
637
25
import sqlite3 from .db import DB class TestingNew(DB): def __init__(self): super().__init__() self.table_name = 'KL_new_tests' self.table_desc = 'Details of new COVID-19 samples in the last 24 hours' self.cols = self.getcolumns() def getcolumns(self): cols = { ...
4060b1d1a9f324fc2fb89fd35501e25515a14f74e0b6912d8bf65b7f1f0fc4a7
Python
637
28
from setuptools import setup with open("README.md", "r") as f: long_description = f.read() DEPENDENCIES = [ "APScheduler", "pynvml>=5.6.2", "psutil", "py-cpuinfo", ] setup( name = 'eco2ai', author=["Vladimir Lazarev", 'Nikita Zakharenko', 'Alexey Korovin', 'Semyon Budyonny', 'Leonid Zhuko...
6f4905acf91cd6805a650b3cd39b74bd8587f5077012de173c4cc9f7e8b2add5
Python
637
15
# Copyright (c) 2022 PaddlePaddle 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 app...
a1f6b1c5dd93b37522f39d9d192d8c924b5b33512c6888243e54adb72919deef
Python
637
25
import sqlite3 from .db import Database from .MH_tables import MH_corporation_info, MH_district_info, MH_case_info class MaharashtraDB(Database): def __init__(self, datadir): super().__init__(datadir) self.init_tables() self.create_tables() def init_tables(self): """ ...
ab2eb8a33e3643337aac474a9e5134c4ebceeaff139ae364c14b5809d29ae2c7
Python
637
24
import sqlite3 from .db import Database from .KA_tables import KA_case_info, KA_district_cases, KA_individual_fatalities class KarnatakaDB(Database): def __init__(self, datadir): super().__init__(datadir) self.init_tables() self.create_tables() def init_tables(self): """ ...
dac5d53661598c9d2e5d20e2aa13544783f5c9d0100b5de7ebe15722e70ac72c
Python
637
18
from sys import argv from msp import MSP, rbnsp_split_90 msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 4 msp.architecture["motif_model_spec"] = dict( type="PSAMMotifModel", motif_spec=dict(type="rbns"), exclude_names=("3P", "5P") + tuple(x ...
ffa773de5a41d6d636d342f128f2cceea8304c271e38c81a58517e8d6dbea66d
Python
637
21
import distutils.command.bdist_wininst as orig class bdist_wininst(orig.bdist_wininst): def reinitialize_command(self, command, reinit_subcommands=0): """ Supplement reinitialize_command to work around http://bugs.python.org/issue20819 """ cmd = self.distribution.reinitiali...
4e0952e4e8ab7badb0573df80eec45c22129e4d0d8251db99d538c96842e6cfc
Python
638
13
import scipy.io as sio, glob, numpy as np p = sorted(glob.glob("data/figshare_stroke/sourcedata/**/*.mat", recursive=True))[0] eeg = sio.loadmat(p, struct_as_record=False, squeeze_me=True)['eeg'] d, lab = np.asarray(eeg.rawdata), np.asarray(eeg.label) print("labels:", lab[:12], " counts:", np.bincount(lab)) sd = d.st...
7257532d01293e32120235e5dfd5579e91d477f6b22aa8eb01c901dcc21204a4
Python
638
14
# Copyright 2022 Deepfold Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
60fe183b6d30a969d050d2abe4c1a082381d40939d36caf099db1bdade9969d6
Python
639
23
import numpy as np import sys,re,os def combine(parent,model_string): storage = {} print(parent) print(model_string) portions = [os.path.join(parent,x) for x in os.listdir(parent) if x.startswith(model_string)] print(portions) for portion in portions: print(f'loading {portion}') ...
93f38b64894b0d119abdff71cf71e9e4054415125d86234adc75e28e392baf3a
Python
639
20
"""Tests for specparam.plts.error.""" import numpy as np from specparam.tests.tutils import plot_test from specparam.tests.tsettings import TEST_PLOTS_PATH from specparam.plts.error import * ################################################################################################### #########################...
30750bb5850bc98d7ba730edeb5f101e61c9e3dda7736d9fd3b9cc2881af9276
Python
640
31
""" type_conversions.py Modules for converting between data types. """ ################################################################################################### ################################################################################################### def int_conv(value): """ Check if val...
d632cb6c75335a54299b40beef176379a9615e4bc95a2c2ee36fd38de5c29782
Python
640
23
# Generated by Django 2.2.2 on 2019-08-19 13:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('biomedisa_app', '0044_auto_20190803_1500'), ] operations = [ migrations.AddField( model_name='upload', name='stride_...
797577a33fe42717e240c38d8d71d8bbc97f10686b9aba34e07bb42848c5b863
Python
641
28
"""Celery worker app module declaring a queue selected by its alias. Used as the app module of a worker container to declare a queue topology with :class:`kombu.Queue` objects, which cannot be serialized through the worker configuration changes. """ from __future__ import annotations import json from kombu import Q...
af2bdf049107dc3794a3a08d2ea489d09714668dfb1299e90cbd31372f71de90
Python
641
20
""" monkey patched version of asynchat to allow map argument on all version of Python, and the best version of the poll function. """ from sys import version import asynchat import asyncore if float(version[:3]) < 2.5: from asyncore import poll2 as poll else: from asyncore import poll # monkey patch older versions...
84857e8c30a355ef02145757b64fc590b9cdb5dbf47ab1f148f9afc8a76175aa
Python
642
15
# Copyright 2022 Deepfold Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
95b264c33ee07d031bef358a5085de4484cbcde26ee571381ce8fe51e2d77f29
Python
642
25
from which_tissue import * import os folder = "/app" model = tf.keras.models.load_model("../../data/single_t/single_t") for file in os.listdir(folder): path = os.path.join(folder, file) data = pd.read_csv(path) data = data.reindex(columns=df_gtex.drop(columns="tissue").columns, fill_value=0) data = da...
a43b7b748004f5b809ee0c282729c98d5c73e444418289844065d251006efad8
Python
642
22
# -*- coding: utf-8 -*- # Copyright (c) 2016-2018 Braintech Sp. z o.o. [Ltd.] <http://www.braintech.pl> # All rights reserved. """ Module defines a single method get_logger that returns logger with set logging level. Change loggin.INFO lines to change logging level. Author: Mateusz Kruszyński <mateusz.kruszynski...
a95247166f198c57609025b5713d5abc27ff4c2c3ef2735eb22e11d64fe3dff0
Python
642
26
#!/usr/bin/env python3 import subprocess import os import tempfile def grab_sequence(*, ref_genome, splice_table, sequence_out, CL_max): _, temp_bed = tempfile.mkstemp(suffix=".bed") CLr = CL_max // 2 CLl = CLr + 1 # First nucleotide not included by BEDtools COMMAND = ( """cat %s | awk ...
4b84b8d39e939f7b17b2d6332e7b7baa56553650b634665cb2bf628277d0cb78
Python
643
31
# -*- coding: utf-8 -*- """ Created on Tue Apr 15 16:31:37 2025 @author: Rico's Account """ import numpy as np import math from matplotlib import pyplot as plt from scipy.integrate import solve_ivp, cumulative_trapezoid def integral(t, z, plot = False): if plot == True: plt.plot(t, z...
6c032e8f6fed0a91de071512743d35df9c6b44d07567f5fcfbb1edbe4df12a54
Python
643
18
""" Analyses ======== An analysis is a call that can be performed outside an acquisition period. It both takes and returns either data or preprocessed data. Analyses are mostly specific to a certain procedure. For example, there will be specific calls for analysis of data for the dry electrode assessment. There are ...
c7f9497077a197757ea6fd731f2d9d54408ddafd3d19de54839621244e6d5130
Python
644
26
""" demonstrate how to use the new pyabf.memtest module """ import os import sys PATH_HERE = os.path.abspath(os.path.dirname(__file__)) PATH_DATA = os.path.abspath(PATH_HERE+"../../../data/abfs/") PATH_SRC = os.path.abspath(PATH_HERE+"../../../src/") sys.path.insert(0, PATH_SRC) import pyabf import glob import numpy a...
028c2682a50966aed8a391774b4c00168f233a7f6ad2a309da2c4b4d5729bb3d
Python
645
15
# ----------------------------------------------------------------------------- # Copyright (c) 2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softw...
3239963ebb2a93e1d64b5b8fd90d5fb88b40f5691ef167901d629e8787e2a55e
Python
645
21
from dask import __version__ as dask_version from packaging.version import Version from .classes import OMEZarrImage, OMEZarrLabels, OMEZarrMultiscale, OMEZarrScene # Expose __version__ and fallback when _version.py doesn't exist. try: from ._version import version as __version__ except ImportError: __version...
c9b7c3a6729f139e2619583d60b10f27c6454cb6e1465f91b4bf425b2fc5e553
Python
645
15
# ----------------------------------------------------------------------------- # Copyright (c) 2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softw...
7f63db23d6339c6a8cc9e7ee22c79b2ff40da8fd7091299870bfd4f6998a5352
Python
646
36
"""add galaxy_url column to notifications Revision ID: 5924fbf10430 Revises: 303a5583a030 Create Date: 2024-04-11 09:56:26.200231 """ from sqlalchemy import ( Column, String, ) from galaxy.model.migrations.util import ( add_column, drop_column, ) # revision identifiers, used by Alembic. revision = ...
ac5ca8ee8402c7800c88f078610f835d80773eb7655829e4c0cfbe32ed1ce6c1
Python
646
22
import numpy as np import scipy def generate_closeness_pairs(a, b, *, delta): result = [] for i in range(a.shape[0]): b_index = np.searchsorted(b, a[i] - delta) for j in range(b_index, b.shape[0]): if b[j] - a[i] > delta: break assert not (a[i] - b[j] > ...
05c7826299dbf703a7d8a2cd5b523a2266bd6c4a1bcdf35f50037cc879cf998c
Python
647
23
# https://docs.pytest.org/en/latest/example/simple.html import pytest def pytest_addoption(parser): parser.addoption( "--runslow", action="store_true", default=False, help="run slow tests" ) def pytest_configure(config): config.addinivalue_line("markers", "slow: mark test as slow to run") def...
5d7e01d5048ffc5a089c2700172e48e232180e041ec65570a704195fba24ed51
Python
647
37
import numpy as np import scipy from neuron import h, gui from neuron.units import ms nseg = 1 s = h.Section() s.insert("X2Y") s.nseg = nseg t_hoc = h.Vector().record(h._ref_t) X_hoc = h.Vector().record(s(0.5)._ref_X_X2Y) Y_hoc = h.Vector().record(s(0.5)._ref_Y_X2Y) h.stdinit() h.tstop = 5.0 * ms h.run() t = np.a...
6ca69ec7b4813dfac97080cfb49b9c2d41acab44351e86620e337e1f25674604
Python
647
33
from __future__ import annotations from http import HTTPStatus from werkzeug.exceptions import BadRequest from werkzeug.exceptions import NotFound from flask import Flask app = Flask(__name__) @app.errorhandler(400) @app.errorhandler(HTTPStatus.BAD_REQUEST) @app.errorhandler(BadRequest) def handle_400(e: BadReque...
9efaa16c6f24e0992a4ea5b88dc8d0ef08a05d624532e12793bce8b0cf1a2258
Python
647
24
import torch def test(): N, Cin, Cout, L = 3, 5, 7, 11 r = 2 X = torch.randn(N, Cin, L) E = torch.randn(Cout, Cin, r * 2 + 1) fast_out = torch.nn.functional.conv1d(X, E, padding=r) direct_out = torch.zeros(N, Cout, L) for bidx in range(N): for i in range(Cout): for x i...
e031ea001545127484ae26e865752e62a7d514800385b1f7c57f69d7c6f7e069
Python
647
18
""" Making it easy to import in classes. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" #from dcCustom.feat.base_classes import ProtFeaturizer f...
ee6565585ac2184ed7b822cef681dae59f1ce073cb627134a2360e24787c2624
Python
647
21
import torch from typing import Callable def custom_amp_decorator(dec: Callable, cuda_amp_deprecated: bool): def decorator(*args, **kwargs): if cuda_amp_deprecated: kwargs["device_type"] = "cuda" return dec(*args, **kwargs) return decorator if hasattr(torch.amp, "custom_fwd"): # ...
4dbd73c0e907b1b47458875c1bb5d6e46d574cd6c7815f14e15e319197eadf2a
Python
648
24
from sys import argv from msp import MSP msp = MSP() msp.file = __file__ msp.seed = int(argv[1]) msp.architecture["num_motifs"] = 80 msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels") msp.architecture["motif_model_spec"] = dict( type="NeuralFixedMotif", path_format="model/rbns-binary...
a58f6e95e51fe0f3f88c04852d509608f1467488b26c488c1f69b4f18443025a
Python
649
19
import numpy as np import open3d as o3d from helpers.linemesh import LineMesh def human_pose_to_joints(p, limbs, radius=10): joint_points = o3d.utility.Vector3dVector(p) joint_colors = [[1, 0, 0] for _ in range(len(limbs))] joint_lines = o3d.utility.Vector2iVector(limbs) line_mesh = LineMesh(joint_poi...
ead1037bab02c480af14a92a7f0f15eb99e9e8e7373b91a9631f5856c6db53b9
Python
649
25
from setuptools import setup setup( name="cmkn", version="0.1", description="Implementation of the convolutional motif kernel network (CMKN) architecture.", author="Jonas Ditz", author_email="jonas.ditz@uni-tuebingen.de", packages=["cmkn"], python_requires=">=3.7, <3.10", install_requir...
0e8e42a1eba63e7d19eb61d06e9ac0f825e73de35f0c3d1cc242193b6a81677a
Python
651
14
# Copyright (c) 2022 PaddlePaddle 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 app...
1e2aa4805a4aa98fdd71081748afcdcef91c39c9d7fb0fa669e33d6f69f5a87e
Python
651
14
# Copyright (c) 2022 PaddlePaddle 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 app...
343ae9193899ddc0480926f390de2129c91779f73308a722fd1c46bc5400f04f
Python
651
24
import sqlite3 from .db import Database from .HR_tables import HR_caseinfo, HR_districtinfo, HR_critical_case_info class HaryanaDB(Database): def __init__(self, datadir): super().__init__(datadir) self.init_tables() self.create_tables() def init_tables(self): """ Ini...
348f4a424d04d4ab52b0cee4591811e07f361d8e0b6a03411e7714f8905862e8
Python
651
32
"""Add index on tool_id column of job table Revision ID: a4c3ef999ab5 Revises: 75348cfb3715 Create Date: 2025-02-05 14:55:13.348044 """ from galaxy.model.database_object_names import build_index_name from galaxy.model.migrations.util import ( create_index, drop_index, ) # revision identifiers, used by Alemb...
f5372d94c4f014d581267771b796b2a14e81ce40e85aee137430d653871fe221
Python
651
24
from anndata import AnnData def convert_scanpy( adata: AnnData, use_quality: str = "hires", ) -> AnnData | None: adata.var_names_make_unique() library_id = next(iter(adata.uns["spatial"].keys())) if use_quality == "fulres": image_coor = adata.obsm["spatial"] else: scale = ada...