sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
67339064a51d3f84260d0a74e966e60b13b525db353d1d4184f1eb63e36268e0 | Python | 879 | 37 | 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),
)
msp.data_dir = "../data/canonical_and_gtex_dataset/"
... |
d995eb73e98eff855d1e8052bf9f490cedf737d78d00cc2b7c5e53fbad7378c3 | Python | 879 | 30 | import sys
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ._colorbar import ColorBar
from ._hoverlabel import Hoverlabel
from ._legendgrouptitle import Legendgrouptitle
from ._marker import Marker
from ._textfont import Textfont
from ._xbins import XBins
from ._ybins import YBins
... |
f27efb9a2289884f75a0f9c66ac96cd7ba641320c5e428f94c431038c47caa6b | Python | 879 | 23 | """Test functions for specparam.metrics.gof."""
from specparam.metrics.gof import *
###################################################################################################
###################################################################################################
def test_compute_r_squared(tfm):
... |
7adce9dfbc6e47ac284d376fbbd78ad16361dd2e9628fe12a69400faee5a063f | Python | 880 | 30 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-04 16:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biomedisa_app', '0025_auto_20181001_1631'),
]
operations = [
migrations.Al... |
db1c778371652d0d86f80a035f1a9fbee5a8be440cc8ea8cab87d8ce1e4af973 | Python | 880 | 30 | #!/usr/bin/env python
"""Simple tests for clustering tools."""
import unittest
import stlearn as st
from .utils import read_test_data
class TestTools(unittest.TestCase):
def setUp(self):
self.adata = read_test_data()
st.em.run_pca(self.adata, n_comps=50, random_state=0)
st.pp.neighbor... |
8d26d128d5319770707f2faf0e4b058ae26c1a1a6f5437239246686ce672f7c3 | Python | 881 | 20 | """Public-object-surface byte-identity oracle for the god-object re-plumbing.
This package snapshots every declared FIELD_ORDER field and every public
``@property`` on the primary record classes (``Trace``, ``Op``, ``Layer``,
``Module``, ``ModuleCall``, ``Param``, ``Buffer``, ``GradFn``, ``GradFnCall``,
``BackwardPass... |
ad17b438c423fe8c65ab0c908ffd58cee9e09475cc0a5566566f2029c202fc83 | Python | 881 | 32 | import sys
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ._annotation import Annotation
from ._aspectratio import Aspectratio
from ._camera import Camera
from ._domain import Domain
from ._xaxis import XAxis
from ._yaxis import YAxis
from ._zaxis import ZAxis
from . import ann... |
4590a2ca09fa886d8992024bd5918e842f694eb08b06ef7a41eb536e88e64804 | Python | 882 | 37 | from sys import argv
from msp import MSP, starting_point_for_different_number_motifs
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",
)
... |
872f4b11e9fb1482f35a6186eeeccd319e856ca3b638bba52d4904caa7fa2093 | Python | 882 | 31 | #!/usr/bin/env python
import sys
import pandas as pd
def tabular_to_csv(tabular_file, csv_file):
"""Convert tabular (TSV) to CSV"""
data = pd.read_csv(tabular_file, sep="\t")
if data.columns[0] == "" or data.columns[0].startswith("Unnamed:"):
data.columns = ["ID"] + list(data.columns[1:])
da... |
9908595320bdd511bd11e84a203554043ef49ee91cbf3d899e8d13b815a61159 | Python | 882 | 35 | from typing import Optional, Union
from anndata import AnnData
import pandas as pd
import numpy as np
from pathlib import Path
def add_deconvolution(
adata: AnnData,
annotation_path: Union[Path, str],
copy: bool = False,
) -> Optional[AnnData]:
"""\
Adding label transfered from Seurat
Parame... |
a2ab5b4ae9a9c8937659f56b50aa6f6a818b5a6a00ce93c5035866c66e3d8b57 | Python | 882 | 37 | from pathlib import Path
import pandas as pd
from anndata import AnnData
def add_deconvolution(
adata: AnnData,
annotation_path: Path | str,
copy: bool = False,
) -> AnnData | None:
"""\
Adding label transfered from Seurat
Parameters
----------
adata
Annotated data matrix.
... |
f08876a3f8df6e6c90098581cb533f1155c89d551ce50eb4a79d98dbdd5c7cb4 | Python | 882 | 39 | import ast
import numpy as np
def add(a,b):
return a+b
def sub(a,b):
return a-b
def mult(a,b):
return a*b
def div(a,b):
return a/b
''' Standard deviation '''
def std(*args):
return np.std(args)
operators = {ast.Add: add, ast.Sub: sub, ast.Mult: mult, ast.Div: div}
def evalnode(node, state):
... |
f6691585225ebb706ade725c5905107a824b09f43d8a04b783bfac4f083a9a38 | Python | 882 | 31 | from sys import argv
from msp import MSP
from msp_fly import fly_am
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
fly_am(msp)
msp.architecture["propagate_sparsity_spec"] = dict(
type="OnlyAllowInfluenceOnSplicesites"
)
msp.architecture["final_processor_spec"].update(
dict(
bottleneck_spec=... |
17e93ea6ccd98a47ff33fe5472328fc4e2c33527b5c341d6ede362ddf7aed51e | Python | 883 | 34 | """Utility functions for dataset management."""
import os
from pathlib import Path
def get_data_path(dataset_name=None):
"""Get the base path for pyRiemann datasets.
Resolves the root directory for dataset storage. Checks the
``PYRIEMANN_DATA_PATH`` environment variable first, then falls back
to ``~... |
24aa23812e958e9d634bf964a99e3064491af6fec60db1f4600be6b42885db37 | Python | 883 | 30 | import sqlite3
from .db import DB
class CriticalCaseInformation(DB):
def __init__(self):
super().__init__()
self.table_name = 'HR_critical_case_info'
self.table_desc = 'Haryana critical cases (patients on O2 support / ventilator) information'
self.cols = self.getcolumns()
de... |
6c748834cfd73b13148a053af1f3f7e39b0779a89677049540cc272a34ac4841 | Python | 883 | 30 | import pickle
import unittest
from os.path import join, abspath
from numpy.testing import assert_allclose
from tests.time_integration.chemistry_abc_implicit.rebless import run
class Test(unittest.TestCase):
def test(self):
output = run()
gold_file = abspath(join('tests',
... |
a661a2f74e5d6ac3c6ba9411d726f2ed47e1bb6a5d9bba74d696b9e1eaac7edf | Python | 883 | 31 | import json
from logging import getLogger
from .torque import Torque
log = getLogger(__name__)
class OpenPBS(Torque):
ERROR_MESSAGE_UNRECOGNIZED_ARG = "Unrecognized long argument passed to OpenPBS CLI plugin: %s"
def get_status(self, job_ids=None):
return "qstat -f -F json"
def get_single_stat... |
041c474142fd702dc6502ff26b8650b0407338b8b1c7eaa75c5a85e04b1ce762 | Python | 884 | 28 | from tensorflow.keras import backend as K
import tensorflow.keras.metrics as metrics
# Keras variant of dice coefficient
def dice_coef(y_true, y_pred, smooth=0):
y_true_f = K.flatten(y_true)
y_pred_f = K.flatten(y_pred)
intersection = K.sum(y_true_f * y_pred_f)
return (2. * intersection + smooth) / (K.sum(y_true_f... |
09e2facf7f764dbae7eced478bdcd50359b576976f5b2fdf2d5e6c60cb14c7bb | Python | 884 | 33 | #!/usr/bin/python
import pandas as pd
import numpy as np
import sys
import os
import re
def is_float(s):
try:
return float(s)
except ValueError:
return False
def main():
##### check argument #####
if len(sys.argv)<2:
sys.exit('ERROR: not enough arguments\nUSAGE ./allSNPs.py <filedir>')
##### add '/' to th... |
3d63aa67de4facab7ed023ad421136d26a3ec40b285355ebfa9ea85123f49bfa | Python | 884 | 28 | from .tmux_launcher import Options, TmuxLauncher
class Launcher(TmuxLauncher):
def common_options(self):
return [
# Command 0
Options(
dataroot="./datasets/grumpifycat",
name="grumpifycat_CUT",
CUT_mode="CUT"
),
... |
7f7cec2bdba4e3e8e94cf335882e1cbe91b7bc00c980f4ae2249c691644d9de2 | Python | 884 | 26 | import sqlite3
from .db import DB
class ContainmentZonesTable(DB):
def __init__(self):
self.table_name = 'PB_containment_zone'
self.table_desc = 'Details about larger containment zones, with population contained in each. Table starting from Page 4 or 5 and can extend over multiple pages'
... |
afd4b581329631ec59225566b08436417615dffcfc407e8868910601018b2db7 | Python | 884 | 31 | import sqlite3
from .db import DB
class CorporationInformation(DB):
def __init__(self):
super().__init__()
self.table_name = 'MH_corporation_caseinfo'
self.table_desc = 'Maharashtra daily municipal corporation level case information'
self.cols = self.getcolumns()
def getcolu... |
2271dcc299a98221fd0df2a32b79ed142afde7a18734425a504f382a484f7656 | Python | 885 | 33 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
num_motifs = 1
msp.architecture["num_motifs"] = 80 + 2
msp.architecture["channels"] = 200
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = di... |
a7d91d822a254582fb33013954fcd791ee455ce1e35646acbb03f25356b4b0ec | Python | 885 | 37 | from scipy.io import loadmat, savemat
from sklearn.model_selection import LeavePOut
from sklearn.preprocessing import StandardScaler
import numpy as np
norm_file = 'target_vectors.mat'
data = loadmat(norm_file)
vectors = data['vectors']
words = data['basic_words']
cv = LeavePOut(1)
train_mat=[]
test_mat=[]
for trai... |
2f58da1e9c2bdf75b38e91a1e5763f6d1a57ff22ee10ec918c8614bb079edde0 | Python | 886 | 35 | """
pyABF - A Python interface to files in the Axon Binary Format (ABF)
by Scott Harden
Documentation and code examples, and more can be found at:
https://github.com/swharden/pyABF
"""
__version__ = '2.3.8'
import sys
import os
from pyabf.abf import ABF
from pyabf.atf import ATF
def info():
"""display i... |
813b7765c6f33ca28585f2036224c2c424f90ebf71e5e2f514f283d3533cd3fb | Python | 886 | 37 | import socket
import time
import pytest
from caper.server_heartbeat import ServerHeartbeat, ServerHeartbeatTimeoutError
def test_server_heartbeat(tmp_path):
"""All methods will be tested here.
This willl test 3 things:
- can read from file
- can get hostname of this machine
- can ign... |
a4f5b9e8dfc7ec59d37525b735d90b0a49f9730045e4ff6ddf58117bac37dfeb | Python | 886 | 8 | import os
root = "/home/luketaylor/PycharmProjects/StackTP" # Specify path to project
dataset_path = "/home/datasets/natural" # Specify path to dataset
os.system(f"python {root}/scripts/train.py --root={root} --dataset_path={dataset_path} --filtered=False --loss_type=slowness --lam=1e-6 --lam0=1e-4 --detach_target=... |
b3017ae280a08ed3873a086fe3720f2b7c50c71d2279c3026a90fc0088468c18 | Python | 886 | 32 | from sys import argv
from msp import MSP
from msp_fly import fly_am
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
fly_am(msp)
msp.architecture["propagate_sparsity_spec"] = dict(
type="OnlyAllowInfluenceOnSplicesites"
)
msp.architecture["final_processor_spec"].update(
dict(
bottleneck_spec=... |
c6e25d3fbb2d361bd41eaf06412c2e8c3ccd5c6311bed891b57e244be5bc2e41 | Python | 886 | 33 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
num_motifs = 10
msp.architecture["num_motifs"] = 80 + 2
msp.architecture["channels"] = 200
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = d... |
27651ff228b1fe4505706738c0d95d0b149cae01a8c770aa695a74733530cc63 | Python | 887 | 28 | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2018 Braintech Sp. z o.o. [Ltd.] <http://www.braintech.pl>
# All rights reserved.
"""Module provides single class representing buffer."""
import numpy
from . import ring_buffer_base
class RingBuffer(ring_buffer_base.RingBufferBase):
"""Subclass 'RingBufferBase' repre... |
40bf4db91964f1a6f135297c34fb1fd5469065a82c502a6ac07f8a93ec490f01 | Python | 887 | 37 | from sys import argv
from msp import MSP, starting_point_for_different_number_motifs
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",
)
... |
9c04ae318c4a72c5a3de093d0c5e6e3ca60ec3dde827e5105168bdf45c379261 | Python | 887 | 34 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created in April 2020
@author: Nathan de Lara <nathan.delara@polytechnique.org>
"""
import unittest
import numpy as np
from scipy import sparse
from sknetwork.linalg import normalize
class TestNormalization(unittest.TestCase):
def test_formats(self):
... |
36bb7b06900e6abb2151ee3780700f92c042053b8fb79b43fa234c815d1f5dff | Python | 888 | 33 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
num_motifs = 1
msp.architecture["num_motifs"] = 80 + 2
msp.architecture["channels"] = 200
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = di... |
2b558fdac432587fadd4f978fd1278ddfc56f9b7910cad0143a7ca13bc1c607d | Python | 889 | 31 | import sqlite3
from .db import DB
class DistrictCasesTable(DB):
def __init__(self):
super().__init__()
self.table_name = 'UK_district_cases'
self.table_desc = 'Uttarakhand district wise case info'
self.cols = self.getcolumns()
def getcolumns(self):
cols = {
... |
a0fceb040e4dfa0558b8f2be3b1be57f5a5ea763bb4108b977824a303fcf2ef4 | Python | 889 | 32 | import h5py
import csv
def collect_names(h5obj, path=""):
rows = []
for key in h5obj.keys():
item = h5obj[key]
full_path = f"{path}/{key}" if path else key
# group or dataset
obj_type = "group" if isinstance(item, h5py.Group) else "dataset"
rows.append([obj_type, full_... |
dfcc245bc03138c009c7b9d9a57f39339e57d71d0956ccd191d2c6254fb5c0b4 | Python | 889 | 33 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
num_motifs = 10
msp.architecture["num_motifs"] = 80 + 2
msp.architecture["channels"] = 200
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = d... |
10aadb18b4dec6fa400a35a9b7951281285f1ada93fa9b2157ecc84e17b323e6 | Python | 890 | 34 | #!/usr/bin/env python
"""
Convert from VCF file to interval index file.
"""
import optparse
import galaxy_utils.sequence.vcf
from bx.interval_index_file import Indexes
def main():
# Read options, args.
parser = optparse.OptionParser()
options, args = parser.parse_args()
in_file, out_file = args
... |
3947d6fbe003041fd3f9924edd2c4470d105dec9693de7f61aa54adfbd398d95 | Python | 890 | 34 | import pandas as pd
import argparse
parser = argparse.ArgumentParser(description="Data preprocessing for MultiRBP")
parser.add_argument('--bed', type=str, help="Input bed file")
parser.add_argument('--filt', type=str, help="String to be filtered with (e.g. negative-1)")
args = parser.parse_args()
bed = args.bed
fi... |
18e34918b08ee079f1ab6dd7db078c09024aa0fb8c75b47ab352be662819282f | Python | 891 | 29 | """Spatiotemporal modeling of spatial transcriptomics"""
from .get_version import get_version
__version__ = get_version(__file__)
del get_version
# Use lazy loading to speed up imports
from ._lazy_loader import LazyLoader
# Lazy load submodules
align = LazyLoader("spateo.align", globals())
cs = LazyLoader("spateo.c... |
5a15f8469334570d1d5ce2547d5e6442eada39bfc078ea9a283a2c045d99d2f5 | Python | 891 | 26 | import math
from pytorch_lightning import Callback
class MocoLRScheduler(Callback):
def __init__(self, initial_lr=0.03, use_cosine_scheduler=False, schedule=(120, 160), max_epochs=200):
super().__init__()
self.lr = initial_lr
self.use_cosine_scheduler = use_cosine_scheduler
self.s... |
83ad493b000ccd9d861aedcd686ee71aeccb72a616fb724a0610c8151a5a3654 | Python | 891 | 25 | from collections import Counter
import nfp.preprocessing.crystal_preprocessor
import numpy as np
def test_pymatgen_preprocessor(structure_inputs):
preprocessor = nfp.preprocessing.crystal_preprocessor.PymatgenPreprocessor()
inputs = preprocessor(structure_inputs[0], train=True)
for val in Counter(inputs... |
f7997f8af1d9f201d0e8cf533e6429ba7f8f9b35be48a968cbfb7725a76598a2 | Python | 891 | 27 | import hashlib
import os
def sha1OfFile(filepath):
sha = hashlib.sha1()
with open(filepath, "rb") as f:
while True:
block = f.read(2**10) # Magic number: one-megabyte blocks.
if not block:
break
sha.update(block)
return sha.hexdigest()
def... |
3d29602e94c2409392c13dc9b85a55d6deea46855ec94684003413e2e542a49d | Python | 892 | 30 | # -----------------------------------------------------------------------------
# Copyright (c) 2015, 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.
# -------------------------------------------------... |
3e07729c87539cb368bc1a4abff6b3a1e51fba1dbe96141536f10c892448c93e | Python | 892 | 21 | # Copyright (c) 2026, Tri Dao.
"""Detect device-to-host synchronization inside a warmed kernel call."""
from torch.utils._python_dispatch import TorchDispatchMode
class RejectHostScalarExtraction(TorchDispatchMode):
"""Fail on aten._local_scalar_dense, the op behind .item()/int()/bool() on a tensor.
Wrap a ... |
c6164c6fd4cc670e6685f0d980ba1a16559b28c0943ccdc5562bf87848a60d2d | Python | 892 | 37 | from sys import argv
from msp import MSP, starting_point_for_different_number_motifs
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",
)
... |
2a38af7018d0a323c84034bd642d2d2451ef2334d7a5074f7b1dabef2d2ecff3 | Python | 893 | 26 | import sqlite3
from .db import DB
class ContainmentInfoTable(DB):
def __init__(self):
self.table_name = 'PB_micro_containment_zone'
self.table_desc = 'Details about micro containment zones in a district, with population contained. Table starting on page 4 or 5 and can extend over multiple pages.'... |
8fefe6baac6ccecf5f3db41d90736e99735d2dae6b877885febaf5100a07f7b8 | Python | 893 | 31 | from database import CategoryModel, upsert
category1 = {
"name": "Upsert Category",
"color": "white"
}
class TestCategoryUpsert:
def test_create_category(self):
query = { "name": category1.get("name") }
create_category1 = upsert(CategoryModel, query=query, update=category1)
ass... |
8883f0faadafd7af196dfa68c68f835e4b86cdd62bc09236070f8ffa325cdd4a | Python | 894 | 25 | #!/usr/bin/env python3
'''Go through the files in the current directory and remove and caffemodel/solverstate
files where there is a higher iteration available'''
import glob,re,sys,collections,os
prefixes = sys.argv[1:]
if not prefixes:
prefixes = ['.']
for dirname in prefixes:
for suffix in ['caffemodel',... |
ea8b197110ae539b9c36218d773f0e349373cca518a0bf6398f9477a59adc3fa | Python | 894 | 29 | import xtensor_example_extension as m
from unittest import TestCase
import numpy as np
class ExampleTest(TestCase):
def test_example1(self):
self.assertEqual(4, m.example1([4, 5, 6]))
def test_example2(self):
x = np.array([[0., 1.], [2., 3.]])
res = np.array([[2., 3.], [4., 5.]])
... |
1b309e8c42affdff011e5135bf9c04432f1bf9d3fda574540e4885ea5e1ce2ad | Python | 895 | 38 | import os, json
def check_file_exist(path):
if not os.path.exists(path):
raise RuntimeError('Cannot open file. (', path, ')')
def read_txt_to_list(file):
output = []
with open(file, 'r') as f:
for line in f:
entry = line.rstrip()
output.append(entry)
return ou... |
2c9d794f2a153f9c951b64a6ec7d96f7c88705702c2aada67ede859f064c3c08 | Python | 895 | 34 | from typing import List, Sequence, Union
from PIL.Image import Image
from torch import Tensor
from lightly.transforms.torchvision_v2_compatibility import torchvision_transforms as T
class MultiViewTransform:
"""Transforms an image into multiple views.
Args:
transforms:
A sequence of tra... |
465c900f8eefd72cfa9620f0ec5973369ac4108e978ec6994b68668071b98411 | Python | 895 | 22 | from itertools import chain
import timm
from timm.data import resolve_data_config, create_transform
def get_image_model(model_config, only_transforms=False):
if model_config['IMAGE_MODEL'] == False:
return None
image_model = timm.create_model(model_config['IMAGE_MODEL'], pretrained=True, num_classes=... |
6833127e8c89316fc68cf53ba0bcebc8a74e0f93dda4acb916e1e07a8f74e0f7 | Python | 895 | 32 | ####### data_importing #######
## Dataset_videos
from face_rhythm.data_importing import Dataset_videos
class test_Dataset_videos:
def __init__(self):
pass
## Test if type checking works
def test_type_checking(self):
import pytest
## test if paths_videos is a list of string... |
6d6492209f014d962c78d5895a33f03608929a01119c459575d5e3856a3ec5f9 | Python | 895 | 16 | """ Attention and normalization modules """
from bioseq2seq.modules.util_class import Elementwise
from bioseq2seq.modules.gate import context_gate_factory, ContextGate
from bioseq2seq.modules.conv_multi_step_attention import ConvMultiStepAttention
from bioseq2seq.modules.multi_headed_attn import MultiHeadedAttention
... |
05f74858c0cc27a0ef8aaa5224442ffe40e2e65253dbc71673110c453f6a9453 | Python | 896 | 27 | import unittest
from os.path import join, abspath
from numpy.testing import assert_allclose
from tests.tabulation.adiabatic_unreacted.rebless import run
from spitfire.chemistry.library import Library
from spitfire.chemistry.ctversion import check as cantera_version_check
if cantera_version_check('atleast', 2, 5, No... |
1a19cfcf8a637902aef77bc517100138522afcd30046d329afd017619606290d | Python | 896 | 34 | 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["num_motifs"] = 82
msp.arch... |
1ade7cebe71856a3be7cfad2d2ed832ef3fe036f02942c9f647d78498458fb6e | Python | 896 | 34 | 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["num_motifs"] = 82
msp.arch... |
42ba26e14985b49400a6563ac49ef115ffd511e99992b25c86b1589e2bce5282 | Python | 896 | 35 | import os
from pypet import Environment
from add_parameters import add_params
from model_network import run_net
def main(name, explore_dict, run_path):
print('Preparing trajectory... '.format(name))
output_folder = os.path.join(run_path, 'output')
os.mkdir(output_folder)
filename = os.path.join(run_pa... |
469427a87a8ce4666a948a4ce407835366c0616ff563d41342c4916b6670052f | Python | 896 | 33 | """Single-threaded execution pool."""
import os
from celery import signals
from .base import BasePool, apply_target
__all__ = ('TaskPool',)
class TaskPool(BasePool):
"""Solo task pool (blocking, inline, fast)."""
body_can_be_buffer = True
def __init__(self, *args, **kwargs):
super().__init__(... |
4f238445ce70a7773900abe2bb9efdadf3bb9ee8aa0d74afe963bea3834286f3 | Python | 896 | 25 | import sqlite3
from .db import DB
class AirportSurveillanceTable(DB):
def __init__(self):
self.table_name = "TN_airport_surveillance"
self.table_desc = "Tamil Nadu 4 airports domestic flights passenger testing details till previous day, table number 2 from the top on third last page"
self.c... |
5c6cecdbbc552fcfd626ffed73bb88b8853d2bf2566721665602322e210b2f0e | Python | 896 | 33 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
num_motifs = 1
msp.architecture["num_motifs"] = 80 + 2
msp.architecture["channels"] = 200
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = di... |
688cac562bb6c0cebd5093f9798d5e2582f3dc88fb6a3bc8b65c7c3d9b839489 | Python | 896 | 27 | """Shared tiny models for the capture-outcome test family.
``ThreeStageModel`` and the relu halt predicate were defined verbatim in four
capture-outcome test files (settlement, gates, characterization, matrix); this
module is the single definition. Models that differ per file (exploding, NaN,
parametrized-failure vari... |
6d919dde3ec21b1c7f1376369318f13de231b12b9f2e29b8ba41f37c785e7c6b | Python | 896 | 34 | 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["num_motifs"] = 82
msp.arch... |
857c820bf1dc1642c9c63c5927c6b5eb7682c9f976c83f65deb69dee54da8136 | Python | 896 | 34 | 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["num_motifs"] = 82
msp.arch... |
a67b0610d12dbe65027c141e245434eee97f3c1953cfbf9d6f5a1eb692415e3a | Python | 896 | 53 | import torch
from constants import get_args
from spliceai_torch import (
load_model,
SpliceAIDataset,
evaluate_model,
)
def main(
window,
CL_max,
bs,
data_dir,
SL,
data_file,
path,
):
torch.set_num_threads(1)
skip_to_step, m = load_model(path)
# print(... |
cb00ac08a99860b5621093e4bdd6f78afb3f5f9159705b4afa81600d50256044 | Python | 896 | 34 | 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["num_motifs"] = 82
msp.arch... |
44d6072138c357b51d534376ebff54e8d11f47a621672a3229f065c4ebba2630 | Python | 897 | 34 | from models.basic import DeepLearningGenerator, DeepLearningModel, DeepLearningRelayModel
from models.doublegan import DoubleGAN
from models.owm_net import OWMNet
from models.resnet import *
from models.resnet_s import *
from models.unet import UNet
__all__ = ['all_models', 'DeepLearningModel', 'DeepLearningGenerator'... |
7514ff3abc6120a61051d5086e41c88b93d5ba42240bd15e6544134de0f02528 | Python | 897 | 27 | import unittest
from os.path import join, abspath
from numpy.testing import assert_allclose
from tests.tabulation.adiabatic_slfm.rebless import run
from spitfire.chemistry.library import Library
from spitfire.chemistry.ctversion import check as cantera_version_check
if cantera_version_check('atleast', 2, 5, None):
... |
a648448376fae8c0282b139c6a579fdc3ccaab6b0df130eedcd109a28722bf98 | Python | 897 | 33 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
num_motifs = 10
msp.architecture["num_motifs"] = 80 + 2
msp.architecture["channels"] = 200
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature_extractor_spec"] = d... |
b83b50324b42e5cba803a28a226468d2424a7f9b7a53d2357f12f1245d8f4a62 | Python | 899 | 39 | import argparse
import tomllib
def read_pyproject(path):
with open(path, 'rb') as fh:
pyproject = tomllib.load(fh)
return pyproject
def extract_dependency(pyproject, dependency):
res = []
for item in pyproject['project']['dependencies']:
if item.startswith(dependency):
re... |
e0b5f7cafd5c7bfcd2e32509b04c611e609e26b5b4f2a8b489cef74b0913b448 | Python | 899 | 26 | import copy
import numpy as np
import open3d as o3d
from helpers.configurations import DEPTH_SCALING, OBJECT_COLOR_MAP
def get_object_poses(registered_objects):
poses = []
names = []
for object_scan_path, transformation in registered_objects.items():
transformation[:3, 3] = transformation[:3, 3]... |
2642500150d39081751f5cada2953dd3bee6aaafa9573c4d20ab4657cf4b38bc | Python | 900 | 32 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 82
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"]["motif_width"] = 17
msp.architecture["motif_model_spec"]["motif_feature... |
5211c869d9ce4752b6e9f5512bf1c3a41f1f3adfce694a74c4c798419a25d0b5 | Python | 900 | 28 | """
This module create TransformerWithProjProt
"""
# pylint: disable=W0223
import torch.nn as nn
import torch
class TransformerWithProjProt(nn.Module):
"""
This class allow to load the pretrained weight for the projection in order
to predict amino acid from corrupted sequence.
transformer lm retrain b... |
61ed114450f34b8c6e3bbd75b75bc0043602b17aa4b91e27aa531d85d8928d12 | Python | 900 | 32 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 82
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature... |
b9822eeb54e51ed0174c29f870f5ee915b1b14983cfd69bda1f09d32a307319f | Python | 900 | 29 | import sys
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ._colorbar import ColorBar
from ._contours import Contours
from ._hoverlabel import Hoverlabel
from ._legendgrouptitle import Legendgrouptitle
from ._lighting import Lighting
from ._lightposition import Lightposition
from . ... |
d3a25f729667ffb918377441687d8867ffc79af85114b42b65f4a726e2953196 | Python | 900 | 32 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 82
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"]["motif_width"] = 17
msp.architecture["motif_model_spec"]["motif_feature... |
36602de2172985ced4f1a0afa896ef0f73942489a5237d0d9e561314668db3e8 | Python | 901 | 35 | from typing import Tuple, Union
import xarray as xr
def _filter_by_exact_dims(ds: xr.Dataset, dims: Union[str, Tuple[str, ...]]):
if isinstance(dims, str):
dims = (dims,)
else:
dims = tuple(dims)
selector = []
for name, arr in ds.data_vars.items():
if arr.dims == dims:
... |
7c873a1ca254f205fd93525d5c230c6bdd2c9022955edca3ab7ee3f52a515316 | Python | 901 | 33 | """
Test ABFs with invalid date codes
"""
import glob
import os
import sys
import matplotlib.pyplot as plt
try:
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/")
DATA_FOLDER = os.pat... |
93f844f3caa7c0b29e75812c7078c834f35240dc8137662934363e89c1493027 | Python | 901 | 30 | import logging
from typing import Union
from imgaug.augmenters.meta import Augmenter
class MultiSiteDataset:
task: str = None
num_classes: int = None
task_id: int = None
task_name: str = None
aug_pipe: Augmenter = None
num_samples: int = None
def __init__(self, train: bool, task: str =... |
bc011e6848f39b9c5ac885deb16017267a945aa57f97b81f9c6085ef2f1fa685 | Python | 901 | 24 | """
Folders to be used in data processing
author: obanmarcos
"""
main_folder = "/home/nhattm/ToMoDL/datasets/DataOPT/"
f140114_5dpf = main_folder+'140114_5dpf' # 5 days post-fertilization
f140117_3dpf = main_folder+'140117_3dpf' # 3 days post-fertilization
f140115_1dpf = main_folder+'140315_1dpf' # 1 days post-f... |
0b2f876c76a1925518badcd6f0fba9e061efb6a4ebe680bda2c358c7ce193134 | Python | 902 | 23 | # SPDX-License-Identifier: LGPL-2.1-or-later
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
ecohab_loc = os.path.dirname(os.path.abspath(__file__))
data_path = os.path.join(ecohab_loc, 'data')
sample_data = os.path.join(data_path, "BALB_VPA_data_cohort_1")
from .Loader import Loader, Merger
from .Timeline imp... |
1f11408cafbe631e095d33041561a97fb282f36eaf6da562751e3861ae08a7e6 | Python | 902 | 32 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 82
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"]["motif_width"] = 13
msp.architecture["motif_model_spec"]["motif_feature... |
52f6e8177e1e275ec874a2d965b56c502d7683773b7f5c55dd1f38f721998c2a | Python | 902 | 19 | """Plotting for data-objects"""
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from .._colorspaces import two_step_colormap, unambiguous_color
from ._base import reset_rc, subplots
from ._colors import ColorBar, ColorGrid, ColorList
from ._decorations import figure_outline, mark_difference
from ._figure imp... |
79a52ee4fe46bc3dca101131e9f95c07e1534fbfb25dce3e3ad8fb192229f831 | Python | 902 | 20 | import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection.mask_rcnn import MaskRCNNPredictor
def get_instance_segmentation_model(num_classes):
# load an instance segmentation model pre-trained on COCO
model = torchvision.models.detection.maskrc... |
7c171d06720d36de107bcc4e519af0200cd681224339b1caf658d180eac9f06d | Python | 902 | 34 | """Signal Handlers for the smoke test."""
from celery.signals import (task_success, worker_init, worker_process_init, worker_process_shutdown, worker_ready,
worker_shutdown)
@worker_init.connect
def worker_init_handler(sender, **kwargs):
print("worker_init_handler")
@worker_process_... |
c984ec93307f07a3a80e1aad75f6220b19483a0fc94586a15310d24df7717891 | Python | 902 | 32 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 82
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"]["motif_width"] = 11
msp.architecture["motif_model_spec"]["motif_feature... |
feda3b57c30d2b68a700a16d2a35a576471226a285d520342970cca5db52312c | Python | 902 | 32 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 82
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"]["motif_width"] = 21
msp.architecture["motif_model_spec"]["motif_feature... |
64792a030ea9870ee5610563cc63d1ac64bb8a2e68691b45750fd1f8b9482151 | Python | 904 | 30 | import sys
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ._hoverlabel import Hoverlabel
from ._legendgrouptitle import Legendgrouptitle
from ._line import Line
from ._marker import Marker
from ._selected import Selected
from ._unselected import Unselected
from . import hoverlabel
... |
294632b0010362a69899d49ab7fdc45e61c570a5ccb5407e060f6ea8108010bd | Python | 905 | 26 | import re
import unittest
from parameterized import parameterized
import numpy as np
from modular_splicing.utils.sequence_utils import draw_bases
from working.synthetic_data.splicing_mechanism.motif.psam_motif import PSAMMotif
class MotifTest(unittest.TestCase):
@parameterized.expand([(x,) for x in range(10)])... |
3d41f79fa508e76fbd73b3546fed86dfac7223439fef78fa44d13b2c7d383333 | Python | 905 | 29 | import pandas as pd
import pytest
from codecarbon.viz import units
@pytest.mark.parametrize(
["data", "expected_unit"],
[
(pd.DataFrame({"emissions": [0.05, 0.564]}), units.EmissionUnit.GRAM),
(pd.DataFrame({"emissions": [0.1, 2]}), units.EmissionUnit.KILOGRAM),
(pd.DataFrame({"emissi... |
b515de7dd3c855437964c9b316f431f3f44d8f693929788ff9020842d3bcbb01 | Python | 905 | 32 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 82
msp.architecture["motif_model_spec"] = dict(
type="PSAMMotifModel",
motif_spec=dict(type="rbns"),
exclude_names=("3P", "5P"),
)
msp.architecture["sparse_spec"] = dict(type="S... |
11e7b8218d2661a74b5cea771000f1a52a9924583502d90264ef15ee386fa0cb | Python | 906 | 34 | import torch
import sys
sys.path.append("../models_architectures/")
sys.path.append("../")
model = torch.load(
"data/models/fine_tune_models/ProtBert_EC40_layer_norm_proba_r1/classif_EC_pred_lvl_2.pth",
map_location=torch.device("cpu"),
)
vocab = torch.load(
"data/models/pre_trained_models/30_layer_unipar... |
183b18ac4e1f37ff55711a20b20d3c22dff5fa3516bcc99bdbb6567057799fe2 | Python | 906 | 35 | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath("."))
from ripser import __version__
from sktda_docs_config import *
project = "Ripser.py"
copyright = "2019, Christopher Tralie and Nathaniel Saul"
author = "Christopher Tralie and Nathaniel Saul"
version = __version__
release = __versio... |
2ddf086ed11f8859b111d7bca9a651f346fea0ed6ad75817cb0122c6de0e7e2c | Python | 906 | 37 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 4 + 2
msp.architecture["motif_model_spec"] = dict(
type="PSAMMotifModel",
motif_spec=dict(
type="grouped",
original_spec=dict(type="rbns"),
group_motifs_path... |
484081e493c7b8c90f08d4513eb676ef80b2d6a44f788ab39966476ba46c32bc | Python | 906 | 21 | from mirp.deep_learning_preprocessing import deep_learning_preprocessing, deep_learning_preprocessing_generator
from mirp.extract_features_and_images import extract_features, extract_features_generator, extract_images, \
extract_images_generator, extract_features_and_images, extract_features_and_images_generator
fr... |
4a0875973f61fdb9e087ade9106b30e7122435a61b4a89128b78ca42dffacbd6 | Python | 906 | 30 | """
Coverage datatypes
"""
import logging
from galaxy.datatypes import metadata
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes.tabular import Tabular
log = logging.getLogger(__name__)
class LastzCoverage(Tabular):
file_ext = "coverage"
MetadataElement(name="chromCol", default... |
cd811634efca010743e16fe0c8540954167465cd827665a549bc1b1cfc7c2ad0 | Python | 906 | 30 | import re
from .torque import Torque
__all__ = ("SlurmTorque",)
class SlurmTorque(Torque):
"""A CLI job executor for Slurm's Torque compatibility mode. This differs
from real torque CLI in that -x command line is not available so job status
needs to be parsed from qstat table instead of XML.
"""
... |
3e705634e39e0a01689150a73f9d888b06057633dedd1bd4801056cb0a1e0593 | Python | 907 | 26 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... |
b6859795e17f1cfb94ac2bd2356632061c2ce130f669074a424013716adcdf6e | Python | 907 | 23 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 58
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"] = dict(
type="AdjustedMotifModel",
model_to_adjust_spec=dict(
... |
c79afd8b1e2d59568f86db369829b61646170a52f8d6418cce56f8b09492335c | Python | 907 | 39 | import os
import matplotlib.pyplot as plt
import pytest
import larvaworld
from larvaworld.lib import reg
pytestmark = [pytest.mark.integration, pytest.mark.heavy]
def xx_test_plots():
gIDs = reg.conf.Ref.RefGroupIDs
gID = gIDs[0]
dcol = reg.conf.Ref.loadRefGroup(gID)
assert dcol.dir is not None
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.