sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
173bb39cc5bd84cd8c331034136ba6761be5abe702d220544c00c5fb301841ca | Python | 653 | 28 | """Merge head revisions
COMMENT: After merging 23.0 into dev in 0ac48236df7984ae2c74d6d0470a6b0aec8e9cc6,
the gxy branch was split at revision c29f into 2 conflicting branches, each
having 2 revisions on top of c29f. This revision merges the diverged branches
back into one branch.
Revision ID: 460d0ecd1dd8
Revises: c... |
8c1cdf5c267e43ce7e106b40280e38da7b92928f107243ed1e2d0a43133ece35 | Python | 653 | 19 | from __future__ import absolute_import
from . import *
import os
if 'OV_DATA_BASE' not in os.environ:
OV_DATA_BASE = os.path.join(os.path.dirname(__file__), 'ov_data_base')
print('No environment variable OV_DATA_BASE specified. Model weights, '
'the resulting segmentations etc. will be stored at '
... |
cdfbb93e42d0bccd8cdd96a41429bc5cfe5c4dcc388a8cdd0b4dbc70b247f544 | Python | 653 | 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... |
c8c3278502d67918be0a5d50bdb325134f29569128b932ac0e907672b65de1d8 | Python | 654 | 26 | # Generated by Django 3.2.6 on 2024-09-05 04:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biomedisa_app', '0113_rename_name_recommended_specimen_name'),
]
operations = [
migrations.RemoveField(
model_name='repository',... |
f646bd3f03423b65455e96333222fb8f11d18ee80cec1a31212b4aaacc1cb92e | Python | 654 | 25 | #!/usr/bin/env python
"""
convert a ref.taxonomy file to a seq.taxonomy file
Usage:
%python ref_to_seq_taxonomy_converter.py <ref.taxonom> <seq.taxonomy>
"""
import re
import sys
assert sys.version_info[:2] >= (2, 4)
def __main__():
with open(sys.argv[1]) as infile, open(sys.argv[2], "w") as outfile:
fo... |
5620d48e26ec0f452e8d67aa8d97ed3c733b885251fd24622d9b3d8f9527f427 | Python | 655 | 30 | #!/usr/bin/env python
import os
import sys
import zipfile
os.chdir(sys.argv[2])
o = open("results.html", "w+")
o.write("<html> <body> <h1> ExpaRNA Result </h1>")
for filename in os.listdir(sys.argv[2]):
if os.path.isfile(os.path.join(sys.argv[2], filename)) and False == (
filename.endswith("epm")
... |
2b66cb1a2c72620261d16eb4d874645952638ff2566c401099521ce6918234f7 | Python | 656 | 7 | from ._experiment.mne_experiment import MneExperiment
from ._experiment.preprocessing import RawSource, RawFilter, RawICA, RawMaxwell, RawReReference, RawApplyICA
from ._experiment.epochs import ContinuousEpoch, EpochCollection, PrimaryEpoch, SecondaryEpoch, SuperEpoch
from ._experiment.groups import Group, SubGroup
fr... |
4a5e43ba44fe923b37326989aa505a5ab3d14c763ef1bf5b92bc19c173bd0c43 | Python | 656 | 25 | """
Code here makes it easy to glance at a header item from every demo ABF file.
"""
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
i... |
7cf083045b45760d72ca9aa0a3ede87f42064d952c6daf92bb9cc57f5ff94f86 | Python | 656 | 23 | """Tests for the minimal TorchLens examples loader."""
from __future__ import annotations
import pytest
import torchlens as tl
from torchlens.intervention.types import InterventionSpec
def test_examples_load_returns_trace() -> None:
"""torchlens.examples.load should return a supported TorchLens artifact."""
... |
b6163c54ecdfeb5fecd238d7b95312ba667f210bdcd28cc5af4b9ce605eae31c | Python | 656 | 18 | import scanpy as sc
from .._settings import settings
from pathlib import Path
from anndata import AnnData
def example_bcba() -> AnnData:
"""\
Download processed BCBA data (10X genomics published data).
Reference: https://support.10xgenomics.com/spatial-gene-expression/datasets/1.1.0/V1_Breast_Cancer_Block... |
c87c69db1283f85ec4fb97c5284ff6b7378a5a92ce637367c7c4a2a53aeaa406 | Python | 656 | 25 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-22 13:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biomedisa_app', '0020_auto_20180518_1549'),
]
operations = [
migrations.AddFi... |
d30153bf20e47d6b67ed972d9b90f0a8e2a24af48e752208f064957754285fb5 | Python | 656 | 23 | # Generated by Django 3.2.6 on 2023-07-04 02:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biomedisa_app', '0100_auto_20230222_1811'),
]
operations = [
migrations.AlterField(
model_name='upload',
name='epoch... |
6b6b4701b3da5f5d1a9618dd698af4e694a8f8e0386a941b90879d471325ad69 | Python | 657 | 28 | import torch.nn as nn
import torch.nn.functional as F
from brainbox import models
class Readout(models.BBModel):
def __init__(self, n_in, n_out):
super().__init__()
self._n_in = n_in
self._n_out = n_out
self._linear = nn.Linear(n_in, n_out)
self.init_weight(self._linear.we... |
de55ac1f2216e409a37b03cfdbb677e52b4289cf6d7aab1466698a817f8a083a | Python | 657 | 24 | """
I got an email indicating this ABF wouldn't load properly.
It seems to be a gap-free protocol, but is being loaded as >1000 sweeps!
This ABF demonstrated the problem and the issue was fixed.
"""
import os
import sys
import glob
import time
import numpy as np
import matplotlib.pyplot as plt
PATH_HERE = os.path.abs... |
b0ff6cb31d43e98e830a21b7b54da4bfa2d3510fd69f39f028b95d93e35294b7 | Python | 658 | 29 | import numpy as np
from .annotation import Annotation
class Constituitive(Annotation):
"""
Represent a constituitive annotation cluster, which is a site
that should always included in a transcript.
"""
@classmethod
def patterns(self):
return ["A", "D"]
def compatible_with_ove... |
ddf914aaca491c0fbf80c4ea9270d2fda91117108538d22f4f0b1f239412b46e | Python | 658 | 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... |
20b98bc9abf2bfc772e57d6ed48a7c04f77eeaaed0d5bcc43cc3d258045c81e6 | Python | 659 | 17 | from gymnasium.spaces import Box, Discrete, MultiDiscrete
from angorapy.common.policies import get_distribution_by_short_name
def autoselect_distribution(env):
"""For a given environment, select a compatible default distribution."""
if isinstance(env.action_space, Box):
distribution = "gaussian"
... |
4ea2c390384224cf5f49b4103700128d99474e8354ee65e6577b2243a6a3baec | Python | 659 | 22 | import os
from celery import Celery
# Set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')
app = Celery('proj')
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - namespace='... |
5aa2427bb70d27816cab83bf5e062a5df9aca45bdd6a39c4e6ed210307c9f0f8 | Python | 659 | 17 | import unittest
from carbontracker.emissions.conversion.co2eq import convert
class TestConversion(unittest.TestCase):
def test_convert(self):
expected = [(2.3408239700374533, 'km travelled by car')]
actual = convert(250)
self.assertAlmostEqual(expected[0][0], actual[0][0], places=5)
... |
df91e0df09227eba8c1535cdce21a0387884a2a8fb372bff6a7ec5fe5adcaa19 | Python | 659 | 24 | import argparse
def parse_bed(bed):
with open(bed) as f:
for line in f:
row = line.strip().split('\t')
chrom, start, end, name, score, strand = row[:6]
if strand == '+':
row[2] = str(int(start) + 1)
elif strand == '-':
... |
e273cb9ed4e87e531c45c8c0dc2e65ad62c90ef2df877ce39f6c426ad10a1ba3 | Python | 659 | 31 | import logging, logging.config
from lib.utils.log import LOG_CONFIG
logging.config.dictConfig(LOG_CONFIG)
from lib.utils.cli import CustomCli
import sys
sys.path.append("..")
from lib.models import *
from lib.datasets import *
def main():
logger = logging.getLogger()
cli = CustomCli(
... |
31eb796fa20c2f00439e359453571b157902753687571e01131e740b901d0de1 | Python | 660 | 29 | import contextlib
from pathlib import Path
import pytest
from llspy.exceptions import CUDAbinException
from llspy.gui.exceptions import MissingBinaryError
from llspy.gui.mainwindow import main_GUI
TEST_DATA = Path(__file__).parent / "testdata"
SAMPLE = TEST_DATA / "sample"
@pytest.fixture
def main_window(qtbot):
... |
35b4fa46478b126ded7842d8db27425debdc371a2dcc2cf0bff407fa5fd46dc8 | Python | 660 | 24 | import subprocess
def get_tm(pdb1, pdb2):
"""
Caclulate the tm score of pdb1, pdb2.
Args:
pdb1 : model pdb file path, str
pdb2 : native pdb file path, str
Returns:
tm score, float
"""
cmd = 'tmscore'+' '+ pdb1 +' ' + pdb2
p = subprocess.Popen(cmd,
... |
cec1bd7525edd8d0457ef013041be653f7798419cd731605f4175b038cb005da | Python | 660 | 15 | import detectron2, cv2, os, json
from detectron2.data.catalog import DatasetCatalog
from detectron2.data.datasets import register_coco_instances
from detectron2.data import MetadataCatalog
from detectron2.utils.visualizer import Visualizer
register_coco_instances('test', {}, 'annot_COCO.json', '')
dataset_dicts = Data... |
d260d394605b768e592ddaf31d6264d58cb010e78ac44b6888ab9f454a0067bf | Python | 660 | 19 | import os
def gpu_sel(local_rank):
os.system('nvidia-smi -q -d Memory |grep -A4 GPU|grep Free >gpu_info')
memory_gpu=[int(x.split()[2]) for x in open('gpu_info','r').readlines()]
if memory_gpu:
gpu_queue=sorted(range(len(memory_gpu)), key=lambda k: memory_gpu[k],reverse=True)
str_queue=''
... |
18388be9a2842916e7d74665725dfecba7eb286d3e73f0a7c49c7d4193ee2ed1 | Python | 661 | 23 | """
Plot time course of single-trial history bias estimates for one example participant
and block from the Neutral condition
"""
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("Figure 1-Source Data 5.csv", sep="\t")
max_val = max(df.single_trial_bias_neutral.values)
min_val = min(df.single_trial... |
4f57ae815c237a46f1f4bc696f5a6dcef294195024e8f008f999bfa5370f1cf7 | Python | 661 | 16 | import matplotlib.pyplot as plt
def render_motif_saliency_map(realization):
mech = realization.splicing_mechanism
true_splice = realization.real_splicing_pattern
plt.figure(figsize=(6, 6), dpi=200)
motifs = mech.predict_motifs(realization.rna)
salience = mech.motif_saliency_map(motifs, true_splice... |
73f30caa95a1ae77eea5f0660ac81a3bb7e50b4a813ac0299fac2bf507ca3fcd | Python | 661 | 27 | #from pkg_resources import get_distribution, DistributionNotFound
__project__ = 'image-funcut'
# __version__ = None # required for initial installation
# try:
# __version__ = get_distribution(__project__).version
# except DistributionNotFound:
# VERSION = __project__ + '-' + '(local)'
# else:
# VERSION ... |
c01d94e20254b75578b6defe8411fb9f6622d3c0ae64c8e6acb5416f58b832bb | Python | 661 | 22 | """Tests for Workbench interfaces."""
import pytest
from PIL import Image
from xcp_d.interfaces.workbench import _check_image_is_nonempty
def test_check_image_is_nonempty(tmp_path):
"""A uniform Workbench capture is treated as a failed render."""
blank_file = tmp_path / 'blank.png'
Image.new('RGB', (5, ... |
3ec1688fe9d28960b7bf781c3463d953584b9e355346043ce13216ba0ee2c7b6 | Python | 662 | 33 | """Add when_expression column
Revision ID: 518c8438a91b
Revises: 59e024ceaca1
Create Date: 2022-10-24 16:43:39.565871
"""
from sqlalchemy import Column
from galaxy.model.custom_types import JSONType
from galaxy.model.migrations.util import (
add_column,
drop_column,
)
# revision identifiers, used by Alembi... |
41b92faff8bfcd5fb6048e95de834c77256ef5e2e314c1b9cd4ba00a318d5927 | Python | 662 | 13 | from gym.envs.mujoco.mujoco_env import MujocoEnv, MuJocoPyEnv # isort:skip
from gym.envs.mujoco.ant import AntEnv
from gym.envs.mujoco.half_cheetah import HalfCheetahEnv
from gym.envs.mujoco.hopper import HopperEnv
from gym.envs.mujoco.humanoid import HumanoidEnv
from gym.envs.mujoco.humanoidstandup import HumanoidSt... |
5143f5db94b92bb687b7f7a4fca9dec1ac000658827ef65e4ff4de806e805660 | Python | 662 | 36 | import fire
import numpy as np
import tqdm
from shelved.single_perturbed.analysis import (
spm_models,
perturbations_for_model,
single_perturbed_models,
)
NUM_SPLITS = 4
sl = 1000
def get_params():
for _, original, path in spm_models():
yield from dict(single_perturbed_models(path)).values... |
59b705019cd3bc827439d310cab16924e276d728fc6c6a44da7af2e4676fd346 | Python | 662 | 35 | """drop job_state_history.update_time column
Revision ID: 186d4835587b
Revises: 6a67bf27e6a6
Create Date: 2022-06-01 17:50:22.629894
"""
from sqlalchemy import (
Column,
DateTime,
)
from galaxy.model.migrations.util import (
add_column,
drop_column,
)
from galaxy.util import now
# revision identifi... |
6f9bec6750a5e7580d55df88f51ecc9d797580d5c5c58198d717b9db6b951432 | Python | 662 | 14 | """Shared Literal aliases for public TorchLens option strings."""
from typing import Literal
OutputDeviceLiteral = Literal["same", "cpu", "cuda"]
BufferVisibilityLiteral = Literal["never", "meaningful", "always"]
CollapseLiteral = Literal["none", "auto", "max"] | float
FoldRepeatsLiteral = Literal[None, True, False]
... |
91facc51aa1047fd386e61e2e7f732c2218a212f91f39f4c790f4ccadefe1aeb | Python | 662 | 26 | from concurrent.futures import Future
import pytest
from stardist_napari import NOPERSIST, NOTHREADS
skip_if_threads = pytest.mark.skipif(
not NOTHREADS, reason="STARDIST_NAPARI_NOTHREADS not set"
)
skip_if_persist = pytest.mark.skipif(
not NOPERSIST, reason="STARDIST_NAPARI_NOPERSIST not set"
)
@skip_if_p... |
200c99f58719fa1733f652a3dbdf3975e909c4f174506eb094ca9d47c297d6ac | Python | 663 | 25 | """
BoAmps output support for CodeCarbon.
Provides first-class support for generating BoAmps (Boavizta) standardized
JSON reports from CodeCarbon emission tracking data.
"""
from codecarbon.output_methods.boamps.mapper import ( # noqa: F401
map_emissions_to_boamps,
)
from codecarbon.output_methods.boamps.models ... |
f78aadc10f0da29171ac324fd650d90e60008e99f2e2643888ddf455011bd13a | Python | 663 | 25 | import sqlite3
from .db import DB
class CumulativeTable(DB):
def __init__(self):
super().__init__()
self.table_name = 'DL_cumulative'
self.table_desc = 'Delhi state cumulative positive, recovered, fatalities data'
self.cols = self.getcolumns()
def getcolumns(self):
... |
009d69d843a45d16cb796e0dcf2fb42f6308a3cf2478eba751faded9fa9c3dab | Python | 664 | 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... |
7db680d6ddedb43e6f1d35e46d41775ee752168e3b57a6c7426bfbccf2a9b19a | Python | 664 | 17 | import os
root = "/home/luketaylor/PycharmProjects/NeuralPred"
def build_dataset(dataset, ntau, nlat, nspan, scale, model, layer, n_pca):
os.system(f"python build_pca.py --root={root} --dataset={dataset} --ntau={ntau} --nlat={nlat} --nspan={nspan} --scale={scale} --model={model} --layer={layer} --n_pca={n_pca}"... |
8f0c351ce06abf243d6fa714e619fc34712153cda73662c0f3ff8cebb6949b90 | Python | 664 | 19 | """The lightly.models package provides model implementations.
Example implementations for all models can be found here:
`Model Examples <https://docs.lightly.ai/self-supervised-learning/examples/models.html>`_
The package contains an implementation of the commonly used ResNet and
adaptations of the architecture which... |
00893aaac274851d8e1f40b6d6da57467f3ceeb44583bf5c53ea4fe8f1f3c27b | Python | 665 | 23 | import numpy as np
import pandas as pd
from SERGIO.sergio import sergio
import time
sim = sergio(number_genes=5000, number_bins = 3, number_sc = 1500, noise_params = 1, decays=0.8, sampling_state=15, noise_type='dpd')
sim.build_graph(input_file_taregts ='5000.gene.3ct.reg.1.txt',
input_file_regs='5000... |
adf6ede7d75a2dabaa33c4715842203e47741e2c5d177c61322c3dbba6677383 | Python | 665 | 25 | import os
import matplotlib.pyplot as plt
import seaborn as sns
from agent.ppo_agent import PPOAgent
AGENT_ID = 1582658038
os.chdir("../../../")
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
agent = PPOAgent.from_agent_state(AGENT_ID, "b", path_modifier="")
# stats = StatBundle(10, 10, [3,6,3,8,6,7,4,3,6,7,4], [], None... |
597927fdc271dae7ede7cdada03c5d8ccd4d3741621ca3abfce9858b89f532d2 | Python | 666 | 27 | import numpy as np
from numpy import testing as npt
from tns.astrocyte import context as tested
TARGET_POINTS = np.array([
[0., 1., 2.],
[2., 3., 4.],
[5., 6., 7.]
])
def test_constructor():
targets = tested.EndfeetTargets(TARGET_POINTS)
npt.assert_allclose(targets.points, TARGET_POINTS)
npt... |
63a6d2dfa599e7e614a6b2d1c1f4925461d25a136d43893c1c8589ebd1cee224 | Python | 666 | 26 | import time
from codecarbon import track_emissions
@track_emissions(
# api_endpoint="http://your api if you want",
# experiment_id="3a202149-8be2-408c-a3d8-baeae2de2987",
api_key="",
save_to_api=True,
)
def train_model():
"""
This function will do nothing during (occurrence * delay) seconds.
... |
654193ca39c2257b5295c0fdbd409d8704258b69b9f1a7d97cb1da45b3092151 | Python | 666 | 29 | from __future__ import division
import unittest
import numpy as np
from wyrm.processing import lfilter_zi
class TestLFilterZi(unittest.TestCase):
COEFFS = 10
def setUp(self):
self.b, self.a = np.ones(self.COEFFS), np.ones(self.COEFFS)
def test_lfilter_1d(self):
"""Output has the corr... |
7c551bbf3977a550ee768ce2ea7d5560657ba101e1a0f942c6232b38f10145c9 | Python | 666 | 28 | from sys import argv
from msp import MSP
msp = MSP()
msp.batch_size = 2 * msp.batch_size // 3
msp.lr = float(msp.lr) * 2 / 3
msp.file = __file__
msp.seed = int(argv[1])
donor_seed = msp.seed % 1000
msp.architecture["splicepoint_model_spec"]["donor"] = f"model/msp-262da5_{donor_seed}"
msp.architecture["motif_model_... |
c0743f9aac77a11e72e65a701bfbc0fa13e0b7d84188b4f986abc6f8370c8604 | Python | 666 | 33 | """add workflow.source_metadata column
Revision ID: b182f655505f
Revises: e7b6dcb09efd
Create Date: 2022-03-14 12:56:57.067748
"""
from sqlalchemy import Column
from galaxy.model.custom_types import JSONType
from galaxy.model.migrations.util import (
add_column,
drop_column,
)
# revision identifiers, used ... |
c63fb3590257d9c79b65f3f1ad4e248fba40006cf6bd5f276c8afcfc2079564a | Python | 666 | 26 | """
Test the new ABF.userList property
"""
import glob
import os
import sys
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.path.join(PATH_SRC, "../data/abfs/... |
1ba7956aad564c2ba59a87e6f45be33607c853fdc921383d7306cdb421996367 | Python | 667 | 17 | """
Gathers all datasets in one place for convenient imports
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from dcCustom.data.datasets import pad_features
#from deepchem.data.datasets import pad_batch
from dcCustom.data.datasets import Datase... |
aaa608aacde41fa83a19c7b407c1a51c30fc1db4ff28f8594b6aa20231d35d3f | Python | 667 | 13 | # Copyright (c) 2024 PaddleHelix Authors. All Rights Reserved.
#
# Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0
# International License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://creativecommo... |
aaf737981d846e3e0175f0fd9c01b1eed09d6ff91dc066b7b41bc2966bbbf921 | Python | 667 | 18 | import os
root = "/home/luketaylor/PycharmProjects/NeuralPred"
def build_dataset(dataset, ntau, nlat, nspan, scale, model, layer, n_pca):
os.system(f"python build_pca.py --root={root} --dataset={dataset} --ntau={ntau} --nlat={nlat} --nspan={nspan} --scale={scale} --model={model} --layer={layer} --n_pca={n_pca}"... |
b1e3c006d0d5f4b951e0692bc8d478312bbb974a31a09c4f8b27fb6f0fac66d3 | Python | 667 | 24 | """Phase 5a tests for experimental multi-input sessions."""
from __future__ import annotations
import torch
import torchlens as tl
def test_session_invoke_and_bundle() -> None:
"""Experimental sessions should capture multiple invocations."""
model = torch.nn.Linear(2, 2)
session = tl.experimental.sess... |
cc922103809109e8581ea051f0c28e04c5502ce0494c8280b43691a7a658f132 | Python | 667 | 23 | """
This module define TrainingFactory
"""
from training_manager.training_fine_tune import TrainingFineTune
from utils.utils import function_not_implemented
from config_manager.config_manager import ConfigManager
class TrainingFactory:
"""
this class define a factory for the training object
"""
def _... |
221af05883def347eeceaa9a99a7a584b36baeaf62988fc2b688906cd7dcfcba | Python | 668 | 26 | from skimage.morphology import disk, square
configs = {
"img_glob": "*.tif",
"seg_glob": "*.npy",
"default_output_directory_name": "protein_localization_analysis",
"tracking_features": [
"centroid",
"area",
"major_axis_length",
"minor_axis_length",
"perimeter",
... |
bfe4cf20b3e518953bf2b9bd7e66e63996f1182f6fb9429f05e244540c92ffc7 | Python | 668 | 24 | """
Test loading 2015_09_10_0001.abf which reportedly crashes...
"""
import glob
import os
import sys
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.path.joi... |
ff0222280676869323350dffd93b8ee73d312633d0e356b3d145c99cf6a2e30d | Python | 668 | 28 | """
This module define a
"""
# pylint: disable=W0223
import torch
import logging
from utils.utils import select_output_lm
import torch
class SumLossJustWeights(
torch.nn.modules.loss._Loss
): # pylint: disable=protected-access
"""
This class define a specific loss :
"""
def __init__(self):
... |
1ac575e42a709761a0a304690513721e14364c896d7c9a793e821233234bf189 | Python | 669 | 18 | """
CREaTor
Copyright (C) 2023 Microsoft Research
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed... |
1c62635bce2db639c4e07b29e28a7d78a630695fa2ecf5156e66414a1c1ff345 | Python | 669 | 22 | import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument('fasta')
parser.add_argument('-k', type=int, default=3)
parser.add_argument('--label', required=True)
parser.add_argument('--output', required=True)
args = parser.parse_args()
with open(args.output, 'w') as f_out:
print('sequence\tla... |
17f59c1e61979e47bf3c7706b7365744b2eae91f32cd00f5d1b194f01bf3c066 | Python | 670 | 24 | import sys
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ._colorbar import ColorBar
from ._contours import Contours
from ._legendgrouptitle import Legendgrouptitle
from ._line import Line
from . import colorbar
from . import contours
from . import legendgrouptitle
else:
from _... |
21b70eb4c31b6b8e5ba291cedc813456ebbc1c556f40502524edc06c4c66c8c5 | Python | 670 | 15 | # ruff: noqa -- harvest-time provenance script, committed as run (lint header added at import)
from torchlens.data_classes._state_adapter import state_new, state_restore
from torchlens.data_classes.op import Op
print("Op has __dict__?", "__dict__" in dir(Op), "| __slots__ present:", hasattr(Op, "__slots__"))
o = state... |
0b30b245a1bf9830a1f343a72733778658f9202d6666a6a2b3e9919356dc25d3 | Python | 671 | 19 | import numpy as np
def perm_test( a, b ):
nsamples = 10000
permutation_a_b = np.zeros( [np.size(a), 2] )
over_a_b = 1
delta_a_b = np.nanmean(a) - np.nanmean(b)
if np.isnan(delta_a_b):
p_value_a_b = 1
else:
for k in range(nsamples):
for i in range(0,np.size(a)):
... |
a593018e2aee7f68a89242b6c4d93dfb537138d12336f548e9005691f1bfec02 | Python | 672 | 23 | # Generated by Django 3.2.6 on 2023-01-11 10:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biomedisa_app', '0094_auto_20221004_1509'),
]
operations = [
migrations.AddField(
model_name='upload',
name='filters... |
0db38653f6390563407a29259a52678e8f4a6253cf789f129e59557735c5c0d3 | Python | 673 | 31 | # -*- coding: utf-8 -*-
"""**Lightly Version:** Show the version of the installed package.
Example::
# show the version of the installed package
$ lightly-version
"""
# Copyright (c) 2021. Lightly AG and its affiliates.
# All Rights Reserved
import hydra
import lightly
from lightly.cli._helpers import fix_... |
269d0c24a7297c909164efcdcf5f20d49a9814c303d51cfcccb867aa580eeed8 | Python | 673 | 33 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created in May 2023
@author: Thomas Bonald <bonald@enst.fr>
"""
class Dataset(dict):
"""Container object for datasets.
Dictionary-like object that exposes its keys as attributes.
>>> dataset = Dataset(name='dataset')
>>> dataset['name']
'dataset'
... |
2d261efbef3e088e1382b306a970cdb45da9877f0a91fe4b9e86e31809981911 | Python | 673 | 34 | from collections import OrderedDict
import imageio
import numpy as np
def load_img(path):
"""Load image files
Pixel size is set to 1µm.
Please see :func:`impose.formats.load` for more information.
"""
img = imageio.imread(path)
# Data
channels = OrderedDict()
if len(img.shape) == ... |
6c6df4c76834dd507875bb5b4298503af682e202ece31ad2968cd1a73de67cd1 | Python | 673 | 28 | """Tests for specparam.reports.options."""
from specparam.reports.options import *
###################################################################################################
###################################################################################################
def test_check_algorithms():
... |
5eb8266c43f0b58427fa52c60043d56076ecf7eb894d14a503b3e7710b499fb8 | Python | 674 | 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... |
60d59e00dfd543bee89579644b7eea3b7dde598d075a8b1e9a97354698b849c1 | Python | 674 | 31 | import os
from tools.hash_value.make_hash import *
"""
Hash keys for morphologies
"""
def swc_file_to_hash_key(swc_filename):
with open(swc_filename, "r") as k:
whole = k.read()
hash_value = make_hash_name(whole)
hash_key = hash_identifier(hash_value=hash_value, length=8, prefix="m")
... |
786363838aec8283a593a4c0013d2aad66825cac9167962d48fd6fa68fb237db | Python | 674 | 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... |
b9e0d2d7f06df4a9c42471e42f1217f13be1909b2bd5bf7f9795f18b0a9b8eef | Python | 674 | 25 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-19 11:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biomedisa_app', '0028_auto_20181106_1330'),
]
operations = [
migrations.Ad... |
d410b37d8e5525a2d8141aa78ad3f0d5d178ccad12f6012115e9d90879d05f57 | Python | 674 | 21 | import logging
import galaxy.jobs.runners.state_handlers
from galaxy.util.submodules import import_submodules
log = logging.getLogger(__name__)
def build_state_handlers():
return _get_state_handlers_dict()
def _get_state_handlers_dict():
state_handlers = {}
for module in import_submodules(galaxy.jobs.... |
5b3ca67f144b4cd47486d3236729268e05bc2073d5e26413b8027c716718c4bb | Python | 675 | 12 | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from dcCustom.molnet.load_function.davis_dataset import load_davis
from dcCustom.molnet.load_function.metz_dataset import load_metz
from dcCustom.molnet.load_function.kiba_dataset import load_kiba
from dcCusto... |
5f87bae4658a386b9052f0caece6a7ded569a5e714844f5639af5518a65b6650 | Python | 675 | 32 | """create celery_user_rate_limit_table
Revision ID: 987ce9839ecb
Revises: b855b714e8b8
Create Date: 2023-05-17 15:08:28.467938
"""
import sqlalchemy as sa
from galaxy.model.migrations.util import (
create_table,
drop_table,
)
# revision identifiers, used by Alembic.
revision = "987ce9839ecb"
down_revision ... |
e0ce548331ff929c1f40bab547f535d6da1c6ec86f046bf17f962ce7f1816298 | Python | 675 | 23 | import sys
import pathlib
try:
PATH_HERE = pathlib.Path(__file__).parent
PATH_ABFS = PATH_HERE.joinpath("../../data/abfs/").resolve()
PATH_SRC = PATH_HERE.joinpath("../../src/").resolve()
print(PATH_SRC)
sys.path.insert(0, str(PATH_SRC))
import pyabf
import pyabf.tools.memtest
except:
r... |
8d3b21fb6b30e94d49996db8f62a8615dac246ddd4fe73fc2c68372293a46148 | Python | 676 | 25 | import pytest
from larvaworld.lib import sim
from larvaworld.lib.process import LarvaDataset
# NOTE : This test requires the box2d-py package
pytestmark = [pytest.mark.integration, pytest.mark.heavy, pytest.mark.optional_dep]
pytest.importorskip("Box2D")
def xtest_box2d_experiments():
try:
import B... |
9db81b4788caf7dc97f5f8d01d15f6b57467f08a2e2993e3e436116fc8566a50 | Python | 676 | 23 | 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"] = dict(
type="AdjustedMotifModel",
model_to_adjust_spec=dict(
... |
2cb3a5a393ed0a742c982bc6997258c1fd4b12d6365223797e17bfc78e2fdca9 | Python | 677 | 19 | import torch
import torch.nn.functional as F
import torch.nn.modules.loss
def loss_function(preds, labels, mu, logvar, n_nodes, norm, pos_weight):
cost = norm * F.binary_cross_entropy_with_logits(preds, labels, pos_weight=labels * pos_weight)
# Check if the model is simple Graph Auto-encoder
if logvar is... |
7e99259a01567f4b2fb01d6c9dcca617df8a8cf608e29a54ddff743bf3c9e0df | Python | 677 | 23 | from sys import argv
from msp import MSP
msp = MSP()
msp.file = __file__
msp.seed = int(argv[1])
msp.architecture["num_motifs"] = 146
msp.architecture["sparse_spec"] = dict(type="SpatiallySparseAcrossChannels")
msp.architecture["motif_model_spec"] = dict(
type="AdjustedMotifModel",
model_to_adjust_spec=dict(
... |
afefb25367b93eb9f6bee6d3ba2b20b67c9fdd35b23844269915975b8276d064 | Python | 677 | 26 | import sqlite3
from .db import DB
class TestingCumulative(DB):
def __init__(self):
super().__init__()
self.table_name = 'KL_cumulative_tests'
self.table_desc = 'Cumulative number of samples tested'
self.cols = self.getcolumns()
def getcolumns(self):
cols = {
... |
add2bd28fb2192a022b707815b498a677d01a5da83f38a3565d3e0b73bd905a1 | Python | 678 | 17 | from celery_http_gateway.tasks import hello_world
from django.conf.urls.defaults import handler404, handler500, include, patterns, url # noqa
from djcelery import views as celery_views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns... |
b98a4977b363bc45e8e905c33076a321bfb2e637c2284649e41dff5ccf579ab4 | Python | 678 | 19 | # fix problems with pythons terrible import system
import os
import sys
file_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(file_dir, '../'))
import prob2020.console.count_frameshifts as cf
def test_tp53_main():
opts = {'mutations': os.path.join(file_dir, 'data/tp53_fs_mutations.tx... |
3b98b8a92655e58e8591438255f88398ea29493971ff72e0cb6feed8d91c67ff | Python | 679 | 34 | """add_wue_to_emissions
Revision ID: 3212895acafd
Revises: 2a898cf81c3e
Create Date: 2025-10-19 21:29:36.800401
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "3212895acafd"
down_revision = "2a898cf81c3e"
branch_labels = None
depends_on = None
def upgrade():... |
89b2fc1822e5da7e0d9782be4cca8e0ee7993e14a41d813e50c4fd0ebeff4ef6 | Python | 679 | 23 |
import time
from ethoscope.hardware.interfaces.interfaces import BaseInterface
from ethoscope.stimulators.odour_stimulators import DynamicOdourSleepDepriver
from ethoscope.tests.integration_api_tests.old.utils import test_stimulator
class MockSDInterface(BaseInterface):
def send(self,channel, stimulus_duration... |
d54d9fc43c6ea611e721fab89d71106faaa9ef184430cd06a499cccf7cfea4e3 | Python | 679 | 28 | """
This class is just a regression test to ensure that the models can be loaded.
It does nothing if you haven't trained any models yet.
"""
import unittest
import os
import torch
from parameterized import parameterized
from modular_splicing.utils.io import load_model
if os.path.exists("model"):
models = [f"m... |
dc12710b8a3b99acc85c20d37c269e9c5254df2610882203f8b6f40c082a0e23 | Python | 679 | 20 | """Tests for specparam.models.base."""
from specparam.models.base import *
###################################################################################################
###################################################################################################
def test_base_model():
tbase = BaseMo... |
72448dffb59241718a2dc14fd6c316dba8058c8341929b1d00dc25aaaadedda3 | Python | 680 | 26 | import sqlite3
from .db import DB
class CaseInfoTable(DB):
def __init__(self):
super().__init__()
self.table_name = 'UK_case_info'
self.table_desc = 'Uttarakhand daily and cumulative state-level case information'
self.cols = self.getcolumns()
def getcolumns(self):
co... |
91e49a59d40b4ea423d98f31c26f87b51873b456104d609f1197e652e2920091 | Python | 680 | 22 | import glob
from setuptools import setup
import versioneer
setup(
name='vampire',
description='🧛 Deep generative models for T cell receptor protein sequences 🧛',
url='https://github.com/matsengrp/vampire',
author='Matsen group',
author_email='ematsen@gmail.com',
packages=['vampire', 'vampire.... |
9c8dbafe5797fe54d0875787fcd8451b61a8adffbd27a57f967d3b903ff470ed | Python | 680 | 25 | import os
import pytest
import logging
import tempfile
from pathlib import Path
@pytest.fixture(scope="session", autouse=True)
def configure_logging():
"""Configure logging for all tests."""
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
... |
f41e768b3a20385b3f3dcc4b8e8833d6f190358d01afaf81d938f7a2700c3c0f | Python | 681 | 31 | import numpy as np
from neuron import h, gui
from neuron.units import ms
def simulate(method, rtol, dt=None):
nseg = 1
s = h.Section()
s.insert(f"{method}_scalar")
s.nseg = nseg
x_hoc = h.Vector().record(getattr(s(0.5), f"_ref_x_{method}_scalar"))
t_hoc = h.Vector().record(h._ref_t)
h.s... |
034149686567e988d0b1ecf78bd6bbfc7adaa9222e9df74d089dd4af08b12acf | Python | 682 | 26 | from modular_splicing.dataset.h5_dataset import H5Dataset
def basic_dataset(
path,
cl,
cl_max,
*,
iterator_spec=dict(type="FastIter", shuffler_spec=dict(type="DoNotShuffle")),
post_processor_spec=dict(
type="FlattenerPostProcessor", indices=[("inputs", "x"), ("outputs", "y")]
),
... |
0def5d7146d44b8e686bdfec7f9ad95b259f6d47ce950a683cfec369622a36a1 | Python | 682 | 23 | import torch
import torch.nn as nn
from prodict import Prodict
import utils
class Reducer(nn.Module):
def __init__(self, dims: Prodict, device=torch.device("cpu")):
super(Reducer, self).__init__()
self.input_dim = dims.INPUT_DIM
self.output_dim = dims.OUTPUT_DIM
self.net = nn.Seque... |
b1ab9b427a8e5df2065a01033fc6f785931cb737e1e5cd95a552004ff4b823d3 | Python | 684 | 35 | import numpy as np
from neuron import gui, h
from neuron.units import ms
nseg = 1
s = h.Section()
s.insert("hodhux")
ic = h.IClamp(s(0.5))
ic.delay = 0
ic.dur = 1e9
ic.amp = 10
s.nseg = nseg
v_hoc = h.Vector().record(s(0.5)._ref_v)
t_hoc = h.Vector().record(h._ref_t)
h.stdinit()
h.tstop = 100.0 * ms
h.run()
v = n... |
c31d0d5eefc0198ae1042bd614121868ac45b08869c420278c79868bacddde67 | Python | 684 | 25 | from setuptools import find_packages, setup
setup(name="seqdata", packages=find_packages())
with open("README.md", "r") as readme_file:
readme = readme_file.read()
requirements = []
setup(
name="seqdata",
version="0.1.2",
author="Adam Klie",
author_email="aklie@ucsd.edu",
description="Annota... |
2e4931d33ee9d68f6a9c703a7889940950134d26d3634223ae99cdcdfc53e347 | Python | 685 | 29 | #!/usr/bin/env python3
import os
import sys
import re
import json
dir = sys.argv[1]
chunks = sys.argv[2]
for n in range(0, int(chunks)+1):
seqs = []
cont = 0
# print (n)
with open (dir + "chunk" + str(n) + ".bed", 'r') as bedfile:
for line in bedfile:
seq = line.rstrip().split('\t')[0]
seqs.a... |
78b4564ae78e581b4bc8fa490e3bc7c519be93bac3203e50b4c5aa60ef12f85e | Python | 685 | 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=6),
)
msp.data_dir = "../data/canonical_and_gtex_dataset/"
... |
dfc9c54642b6e3004fd4dfa631a3889c9eb93ee7f7c7872e70c2942d5b270675 | Python | 685 | 12 | """God-object oracle: aliases-v1 identity/mutation matrix + artifact fixtures.
Companion to ``tests/surface_oracle`` (surface-v1 byte-identity goldens).
This package freezes the OBSERVABLE IDENTITY AND MUTATION-EFFECT contract of
the public record objects — the behaviors that value snapshots cannot prove:
repeated-loo... |
4937ed1f2c0558df24ee19babe4130ec955039642d1fa6c0f72e4c4a935f51bc | Python | 686 | 21 | from __future__ import print_function
import numpy as np
import gluoncv as gcv
from mxnet.gluon.nn import BatchNorm
def check_bn_frozen_callback(net, value):
if isinstance(net, BatchNorm):
assert value == net._kwargs['use_global_stats']
def test_block_freeze_bn():
net = gcv.model_zoo.get_model('resne... |
006de32494c5d5b16854ce9e9dfa768233db5d001cde0ba3c0f7ad1d7b3091fe | Python | 687 | 29 | #!/usr/bin/env python3
import sys
f_1 = open(sys.argv[1], "r", encoding = "utf-8")
o_1 = open("gene_transcript.txt", "w", encoding = "utf-8")
tmp_list = []
for file_1 in f_1:
line_1 = file_1.strip().split('\t')
if len(line_1) >= 3 and line_1[2] == "transcript":
gene_name = line_1[8].split(";")[0].sp... |
235b7908a5837f2c90cac69590f29f564fed75e16f31b4a9e72e798f6dce4c09 | Python | 687 | 28 | """
This module define a
"""
# pylint: disable=W0223
import torch
import logging
from utils.utils import select_output_lm
import torch
class SquaredSumLossJustWeights(
torch.nn.modules.loss._Loss
): # pylint: disable=protected-access
"""
This class define a specific loss :
"""
def __init__(self... |
315684595e9660c6f0ea98d5b4e1e4a7daebc7b3852b64561d93d633ad369dfc | Python | 687 | 21 | from PIL import Image
from lightly.transforms.vicreg_transform import VICRegTransform, VICRegViewTransform
from .. import helpers
def test_view_on_pil_image() -> None:
single_view_transform = VICRegViewTransform(input_size=32)
sample = Image.new("RGB", (100, 100))
output = single_view_transform(sample)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.