sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a44ad664b7ad4e59aca7da761c83b6c7829b4f24fa6c0723ab110a532c35e117
Python
308
12
from setuptools import setup setup( name="CEC2017", version="1.0", description="CEC 2017 single objective optimization suite", author="Duncan Tilley", url="https://github.com/tilleyd/cec2017-py", packages=["cec2017"], include_package_data=True, install_requires=["numpy"], )
b656aee9ae688409db3eb185392537cbad829004ca5ed4e0fc4173bcc46ccd1e
Python
308
20
# # A very simple test of zee-calibrator. # from PyQt5 import QtCore import time import pytestqt import storm_control.zee_calibrator.main as zcal def _test_zeecal_starts(qtbot): mainw = zcal.Window() mainw.show() qtbot.addWidget(mainw) # Run for about 0.5 seconds. qtbot.wait(500)
f50434744063723ee4c0794c36768c3d90e5ad4fe1feb2bd710e738555252cba
Python
308
12
"""Backend modules implementing applications and widgets.""" from __future__ import annotations BACKENDS: dict[str, tuple[str, str]] = { "Qt": ("_qtpy", "qtpy"), "ipynb": ("_ipynb", "ipynb"), } for key in list(BACKENDS): if not key.islower(): BACKENDS[key.lower()] = BACKENDS.pop(key)
32328701ab5c3e764f20e1ddb6434eaab615cc63ee9117d3c616f83bdf1c4010
Python
309
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['grcnn'] = \ lambda: ModelCommitment(identifier='grcnn', activations_model=get_model('grcnn'), layers=get_layers('grcnn'))
572f001cdb10f7375513b7c8601fd343e98d3a407ffeded0df9b38299cd42639
Python
309
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_ks_torevert'] = lambda: ModelCommitment( identifier='alexnet', activations_model=get_model(), layers=LAYERS)
69fdfa045e95ec78ed02b8ea87df35759c7b487ec2f22b16f0fc1f981301dea6
Python
309
17
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author: Yong Bai, yong.bai@hotmail.com @License: (C) Copyright 2013-2022. @File: __init__.py.py @Desc: """ from ._svgplot import svgplot # from ._setting import set_global_params, set_fontsize_dpi from ._venn import * from ._heatmapplot import gheatmap
6b5d28059919df4a0a791fa84464feccdeabda712ffa7c72ccd5b1633dcbed49
Python
312
13
import glob # EDIT SCRIPT TO HAVE RIGHT FILES outFile = open('Tasha_CanFam4.repeatmasker.cmds','w') fl = glob.glob('chunk-segments/*fa') print('have %i fl' % len(fl)) for f in fl: # EDIT to have write species cmd = 'RepeatMasker -species dog -e ncbi ' + f + '\n' outFile.write(cmd) outFile.close()
c483a0d7efd63fb880582c5310663c0da63bc233ddf3877663bbfe4fc33b3f67
Python
312
13
import torch from torch import nn def accuracy(output, labels): preds = output.max(1)[1].type_as(labels) correct = preds.eq(labels).double() correct = correct.sum() return correct / len(labels) def init_weights(m): if type(m)==nn.Linear: nn.init.kaiming_uniform_(m.weight)
50ecf68c5307643a04d58faf543022175f78a020ea171e39740b180c5d4301b7
Python
313
21
INFO = { "dtiplayground": { "version" : "0.8.1" }, "dmriplayground": { "version" : "0.8.1" }, "dmriprep": { "version" : "0.8.1" }, "dmriatlas": { "version" : "0.2.0b1" }, "dmriautotract" : { "version" : "0.0.2b1" }, "dmrifiberprofile" : { "version" : "0.8.1" } }
63eb10fe25b1e950ff165af6e0b058386f048928275ed78b38a5b9fafe5032cb
Python
313
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_testing'] = lambda: ModelCommitment( identifier='alexnet_testing', activations_model=get_model(), layers=LAYERS)
afbbd945f31227f4426e13d877e97516d627de3c36bfa33ddcbfd8b97d63e1a3
Python
313
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['AlexNet_SIN'] = lambda: ModelCommitment( identifier='AlexNet_SIN', activations_model=get_model(), layers=LAYERS)
b306b35b00151e9994e31c1c3a48846d1b4f33538889162d642873c5c9cc303c
Python
313
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_1_21_26'] = lambda: ModelCommitment( identifier='alexnet_1_21_26', activations_model=get_model(), layers=LAYERS)
35e7165ce689163709008b42d90c01f264333fb86b62d55e4dc5cd18ebe439c6
Python
314
9
# Created by David Coggan on 2024 06 25 from brainscore_vision import benchmark_registry from .benchmark import ( Coggan2024_behavior_ConditionWiseAccuracySimilarity) benchmark_registry['tong.Coggan2024_behavior-ConditionWiseAccuracySimilarity'] = ( Coggan2024_behavior_ConditionWiseAccuracySimilarity)
397669f5659dc98690d85994820b98bec68a7fcf7680b1cdf50d1f058b022090
Python
314
12
import json import numpy as np from nlp_features import * file='train' name='/data2/whr/lyh/project3/Twibot-20/'+file +'.json' data=np.load('Twibot-20/node_fea.npy') with open(name,'r') as f: users=json.load(f) for user in users: tweets=user['tweet'] sent=sentiment(tweets) print()
477dc18a31cbdadcb7f3c866604e913e03ab5ecec898811a40056d4ded754dc8
Python
314
9
"""Nottingham MEGUK: Save Training Data for Dynamic Network Analysis.""" from glob import glob from osl_dynamics.data import Data outdir = "data/preproc" files = sorted(glob(f"{outdir}/*/sflip-lcmv-parc-raw.fif")) data = Data(files, picks="misc", reject_by_annotation="omit") data.save("training_data/networks")
614a860a9524e2100092cb0d92bed68c785d662d1316a4a9f66e1095f6f3820d
Python
314
11
#!/usr/bin/env python import gzip import pandas as pd import sys cell_line = sys.argv[1] region = sys.argv[2] training_df = pd.read_hdf('{}/output-{}/training.h5'.format(cell_line, region), 'training') training_df.to_csv(gzip.open('{}/output-{}/training.csv.gz'.format(cell_line, region), 'wt'), index = False)
c0ab54956d3c4cbd148ec6d28bde395b4d65bc5eff74adbd4faddde75acb27ea
Python
314
23
class DMRIXInput(object): ## standard data def __init__(*args,**kwargs): self.inputs = [] pass class DMRIPlayground(object): def __init__(*args,**kwargs): pass def initialize(self): pass def preprocess(self): pass def process(self): pass def postprocess(self): pass
dac9cb1ef341b93f25ce43ef128e8b6a4c7839c2c4173a210430a0e80f776625
Python
314
15
import numpy as np from sklearn.linear_model import LinearRegression X = np.array([[1, 1], [1, 2], [2, 2], [2, 3]]) # y = 1 * x_0 + 2 * x_1 + 3 y = np.dot(X, np.array([1, 2])) + 3 reg = LinearRegression().fit(X, y) reg.score(X, y) print(reg.coef_) print(reg.intercept_) print(reg.predict(np.array([[3, 5]])))
0ec42f6c98f177f95bf8809d33668e4591f41bf6f32f46738a1279615156785a
Python
315
14
from ._version import get_versions __version__ = get_versions()['version'] del get_versions from .log_cfg import logger, unconfigure_logging, enable_logging __author__ = ', '.join([ 'David Sebastian Fischer', 'Florian Hölzlwimmer' ]) __email__ = ', '.join([ 'david.fischer@helmholtz-muenchen.de' ])
8194609200795387a3ed306603fc5088df3b2b19325148162c2464afe54ccffc
Python
315
8
from importlib.metadata import PackageNotFoundError, version try: __version__ = version("ccf_streamlines") except PackageNotFoundError: # package is not installed; use a PEP 440-parseable sentinel so consumers # calling packaging.version.parse(__version__) do not blow up __version__ = "0+unknown"
942b99428deeb69dae35851c1f4f2f50d7d190faa3844015ac1c6eb186b7fe78
Python
315
15
from typing import List import pytest import sh def run_command(command: List[str]): """Default method for executing shell commands with pytest.""" msg = None try: sh.python(command) except sh.ErrorReturnCode as e: msg = e.stderr.decode() if msg: pytest.fail(msg=msg)
b321768c9143cfa9a938b23dac15e6fd45ace1d5556e2dd9bec20c174faffa8f
Python
315
15
"""# Range slider widget A double ended range slider widget. """ from magicgui import magicgui @magicgui(auto_call=True, range_value={"widget_type": "RangeSlider", "max": 500}) def func(range_value: tuple[int, int] = (20, 380)): """Double ended range slider.""" print(range_value) func.show(run=True)
c8d13bf2ffb724d24e1c5dc97355c70472de9fdef9d0a005c825f39f21583385
Python
315
14
"""Utility modules for DHG-LGB framework.""" from .logger import setup_logger, get_logger from .io import load_config, save_pickle, load_pickle, save_numpy, load_numpy __all__ = [ 'setup_logger', 'get_logger', 'load_config', 'save_pickle', 'load_pickle', 'save_numpy', 'load_numpy', ]
f1c3671078d782fd5ff0f41fa792c27b3a679d7107b8a881fb94713a22ebc7e9
Python
315
2
#from func import * from func_ELA import ELA_MEM_check_accuracy, ELA_MEM_LM, ELA_MEM_plot_Energy_Ranking, ELA_Network_calc_E, ELA_Network_calc_majorSS, ELA_Network_calc_RA, ELA_Network_calc_SS, ELA_Network_calc_TP_onlySS, ELA_Network_calc_TP, ELA_Network_functions, ELA_Network_plot_DG, ELA_Network_plot_Graph_pyvis
51687661409c6d40333205f23f7dcec0251874d32730201e2cd6faafd15c6bb6
Python
316
9
# initilize all models, support dynamic import import os import importlib modules = os.listdir(os.path.join(os.path.abspath('.'),'models')) modules = [os.path.splitext(module)[0] for module in modules if '__' not in module] for module in modules: importlib.import_module('.' + module, package=__name__)
0ea5a5a6c47c576f73f6dd07b98b11e140d083f518198c1accebf988d96ede09
Python
317
17
# Generated by Django 3.1.1 on 2020-10-19 11:00 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("dataset_repo", "0004_rename"), ] operations = [ migrations.AlterModelTable( name="gitdata", table=None, ), ]
b3f7816b35d7a3511632287ff09c976d439fda57b2e1323f996c826d50705629
Python
318
14
#!/usr/bin/env python from storm_control.test.hal.standardHalTest import halTest def test_hal_tcp_nsm1(): halTest(config_xml = "none_tcp_config.xml", class_name = "NoSuchMessage1", test_module = "storm_control.test.hal.tcp_tests") if (__name__ == "__main__"): test_hal_tcp_nsm1()
f2f215686639181b4ee9a3f822e01f47fa9aac79193c92ed4b53537436d8eed9
Python
319
16
""" nelpy.examples ============== This module contains helper functions to load example data. """ from ._utils import ( download_example_dataset, get_example_data_home, load_example_dataset, ) __all__ = ["load_example_dataset", "download_example_dataset", "get_example_data_home"] __version__ = "0.0.1"
2213cdd46ed2484f22bfe2d5e2ee407692fb1f8c109b02fe54900d3711a26b7e
Python
320
5
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, get_layers model_registry['grcnn_109'] = lambda: ModelCommitment(identifier='grcnn_109', activations_model=get_model('grcnn_109'), layers=get_layers('grcnn_109'))
5ee1166c536486642d50a091a3a157953e1ad67ce199ae461435cc43bd0d6b02
Python
320
16
from torch.autograd import Function class ReverseLayerF(Function): @staticmethod def forward(ctx, x, alpha): ctx.alpha = alpha return x.view_as(x) @staticmethod def backward(ctx, grad_output): output = grad_output.neg() * ctx.alpha return output, None
8b6868c492154aa7bdeacb8f4d429a7ee216ff20d6af52c805941498aa3bf64f
Python
320
14
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT # pylint: disable=unused-import from cvat_sdk.api_client.exceptions import ( ApiAttributeError, ApiException, ApiKeyError, ApiTypeError, ApiValueError, OpenApiException, ) from cvat_sdk.core.exceptions import CvatSdkException
ccbcdea5bbef9698e145bb3723af500e22d0fea484403ddd060421a991636e16
Python
320
9
import unittest import base class Test(base.BaseScriptTest, unittest.TestCase): command_line = "./scripts/lzop_build_offset_table.py" input_stdin = base.TestFile(filename="./test_data/maf_tests/mm8_chr7_tiny.maf.lzo") output_stdout = base.TestFile(filename="./test_data/maf_tests/mm8_chr7_tiny.maf.lzot")
23ba133ab1b84b9c989f0a57c2a54204d541eb2d31877c52f3ba4d344d8b2fa2
Python
321
10
import sys from qtpy.QtWidgets import QApplication from probe_vis.view.ProbeVisualizer import ProbeVisualizer # sys.path.append("C:\\Users\\xiao\\GitHub\\probe4Xiao\\probe_vis") if __name__ == "__main__": app = QApplication(sys.argv) probeV = ProbeVisualizer() probeV.show() sys.exit(app.exec())...
513f7b0699dab75d621b3e0bb91c177c417415129e1fee9fa64d9a632a17d603
Python
321
15
from dataclasses import dataclass from eir.data_load.label_setup import al_label_transformers from eir.setup.schemas import InputConfig @dataclass class ComputedServeTabularInputInfo: labels: "ServeLabels" input_config: InputConfig @dataclass class ServeLabels: label_transformers: al_label_transformers...
5b485510a188d8e548a4d5e2e8a1a4bd2fd2c495c27f39ed2900267c3af68a65
Python
321
11
import cv2 import numpy as np def read_image(path): img = cv2.imread(path) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # opencv default color space is BGR, change it to RGB p = np.percentile(img, 90) q = np.percentile(img, 3) img = np.clip(img * 255.0 / p, 0, 255).astype(np.uint8) return img, q...
1c743dcb051fc115f0dc3b8811b463db5d965899084bf3b21340f38fdb0919b9
Python
322
6
from brainscore_vision import benchmark_registry from .benchmark import Hermann2020cueconflictShapeBias, Hermann2020cueconflictShapeMatch benchmark_registry['Hermann2020cueconflict-shape_bias'] = Hermann2020cueconflictShapeBias benchmark_registry['Hermann2020cueconflict-shape_match'] = Hermann2020cueconflictShapeMatc...
b498568c02b52e62dfaf3cb5eb3fc1c8d945e52a53e56ba6f2efecc7c794ad19
Python
322
10
from pytest import approx from brainscore_vision import load_metric, load_dataset def test_identity_circularvariance(): assembly = load_dataset('Ringach2002') metric = load_metric('ks_similarity', property_name='circular_variance') score = metric(assembly, assembly) assert score == approx(1, abs=0.05...
b6fb114e45e41a83be76b0a1f75fd79ef3945bf3fefb94ea5310a91fb4f80be2
Python
323
5
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, get_layers model_registry['model-lecs'] = lambda: ModelCommitment(identifier='model-lecs', activations_model=get_model('model-lecs'), layers=get_layers('model-lecs...
bdc318e662b5b43bcb65a6ec98378a205aae02d23b3e88b33034fa8bbf1f45dd
Python
323
10
import sys from PyQt5.QtWidgets import QApplication from probe_vis.view.ProbeVisualizer import ProbeVisualizer # sys.path.append("C:\\Users\\xiao\\GitHub\\probe4Xiao\\probe_vis") if __name__ == "__main__": app = QApplication(sys.argv) probeV = ProbeVisualizer() probeV.show() sys.exit(app.exec_...
cb32fc435029d9eb457af73960fb0fbf9ef30c55e57513345f6bd18c0ac53fb1
Python
323
7
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from .predict import SemanticSegmentationPredictor from .train import SemanticSegmentationTrainer from .val import SemanticSegmentationValidator __all__ = "SemanticSegmentationPredictor", "SemanticSegmentationTrainer", "SemanticSegmentationValidator"...
f3fcce9491c522f75116ca4067561e160268566fcf4a28dd70cab9f8c49023f6
Python
323
15
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from django.apps import AppConfig from health_check.plugins import plugin_dir class HealthConfig(AppConfig): name = "cvat.apps.health" def ready(self): from .backends import OPAHealthCheck plugin_dir.register(OPAHealthChec...
5d5edf8d58303bb501e9ad2096cfc0bf77a52a2a53dda2e14454d7bb397de7f5
Python
324
15
from importlib.metadata import version __version__ = version("napari-debcr") from ._reader import get_reader from ._writer import npz_file_writer #from ._sample_data import make_sample_data from ._plugin import DeBCRPlugin __all__ = ( "get_reader", "npz_file_writer", # "make_sample_data", "DeBCRPlugin...
f158f92243601e2abb49af164c782c9df30ac0a01e042c576be7bd166c7d2c79
Python
324
10
from tests.utils import pytest_importorskip def test_qtscxml(): """Test the qtpy.QtScxml namespace""" QtScxml = pytest_importorskip("qtpy.QtScxml") assert QtScxml.QScxmlCompiler is not None assert QtScxml.QScxmlDynamicScxmlServiceFactory is not None assert QtScxml.QScxmlExecutableContent is not N...
66ed72199709b7f8f899f0c077d10650b0715fb95a6dd49d4aa47dcca95b8d28
Python
325
12
color_scheme = { 'concrete-baseline': "#ffd700", 'concrete-subsective': "#ffb14e", 'concrete-privative': "#fa8775", 'abstract-baseline': "#cd34b5", 'abstract-subsective': "#9d02d7", 'abstract-privative': "#0000ff", 'baseline': "#8e8e8e", 'subsective': "#606060", 'privative': "#393939...
ab8eb7db9b2b83ed773208f736007d9e2d120383c1e715c409577db111ac05c6
Python
326
11
# Module initialization from .evaluation import compute_rmse, evaluate_model_with_nodes, log_to_csv, log_node_predictions_to_csv from .train import train_lipophilicity_model __all__ = [ 'compute_rmse', 'evaluate_model_with_nodes', 'log_to_csv', 'log_node_predictions_to_csv', 'train_lipophilicity_mo...
1352b7fd76bcee3de04a5b53c1d77006cdfc00ab82fd41fc170b5ee65b01e44c
Python
327
15
"""Capture utilities: dump in-flight ``model.fit`` invocations to disk.""" from .recorder import ( DEFAULT_CAPTURE_DIR, is_capture_enabled, maybe_record_equator_fit, maybe_record_fit, ) __all__ = [ "DEFAULT_CAPTURE_DIR", "is_capture_enabled", "maybe_record_equator_fit", "maybe_record_f...
528fa866f66b62cb148f825c8192e19b28da043822ca1d597ff718b9091d219b
Python
327
21
# -*- coding: utf-8 -*- """TODO""" import numpy as np class Trace: """TODO""" def __init__(self, size): """TODO""" self.size = size self.val = np.zeros(size) def inc(self, i): """TODO""" self.val[i] += 1 def set(self, i): """TODO""" self.val[...
1819ba225ed0e6fe2271a2d6f8349da4dbae231840cb37d629ddb9d7aff6fdf2
Python
328
10
def drop_first_line(in_file): import os with open(in_file, 'r') as fin: data = fin.read().splitlines(True) fname = os.path.split(in_file)[-1] with open(fname, 'w') as fout: fout.writelines(data[1:]) # don't write the first line into the new file return os.path.join(os.getcwd()...
991e519ae29a937000e9b223baf1a387e08093defb50c18501415df70710f5eb
Python
328
5
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, get_layers model_registry['hmax_v3_adj'] = lambda: ModelCommitment(identifier='hmax_v3_adj', activations_model=get_model('hmax_v3_adj'), layers=get_layers('hmax_v3...
bf30970373ac05dc2b6f5c305beba5f205bc07f18756704806991dfb0bcd6e97
Python
328
14
import numpy from setuptools import Extension, setup setup( ext_modules=[ Extension( "seisbench.ext.utils", sources=["seisbench/ext/utils.c"], include_dirs=[numpy.get_include()], extra_compile_args=["-O3", "-flto"], extra_link_args=[], ), ...
031218174d78b27f83b1b54c4885bac55d254226837fe31ea53a550b66f8c163
Python
330
10
import matplotlib.pyplot as plt from pathlib import Path current_path = Path(__file__).parent def apply_plotstyle(): style_path = current_path / 'paper.mplstyle' style_path = style_path.resolve() plt.style.use(str(style_path)) color_cycle = plt.rcParams['axes.prop_cycle'].by_key()['color'] return c...
7a246216d9c1f3fc606fe580ccc44bad53d5e891ac33ab3190bdc815aded1df2
Python
330
6
from brainscore_vision import benchmark_registry from .benchmark import Maniquet2024ConfusionSimilarity, Maniquet2024TasksConsistency benchmark_registry['Maniquet2024-confusion_similarity'] = lambda: Maniquet2024ConfusionSimilarity() benchmark_registry['Maniquet2024-tasks_consistency'] = lambda: Maniquet2024TasksConsi...
83b8b5ee499e068e5893e798d4ea890b0db73abfecb424fbf02ad416bd886a89
Python
330
12
#!/usr/bin/env python from storm_control.test.hal.standardHalTest import halTest def test_hal_gui(): halTest(config_xml = "none_classic_config.xml", class_name = "GUITest", test_module = "storm_control.test.hal.gui_test", show_gui = True) if (__name__ == "__main__"): test_...
311a7ca20c2e2574e25deed70fc6530233ee343ea149adc5047ec3c471d49a9b
Python
331
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_gated_submission'] = lambda: ModelCommitment( identifier='alexnet_gated_submission', activations_model=get_model(), laye...
4fc6d26c81e2d707712762bf510be5a26ea701c08f4c95fa148c49adfd894bee
Python
331
10
from tests.utils import pytest_importorskip def test_qtpurchasing(): """Test the qtpy.QtPurchasing namespace""" QtPurchasing = pytest_importorskip("qtpy.QtPurchasing") assert QtPurchasing.QInAppProduct is not None assert QtPurchasing.QInAppStore is not None assert QtPurchasing.QInAppTransaction i...
587de55161c32fb7d90857e0a8c43feee0276c003685187e3bd4d6f05971b2d4
Python
331
9
def run_matlab_script(script): import subprocess subprocess.run(f'matlab -nodisplay -nosplash -nodesktop -r "run(\'{script}\')"; exit;', shell=True) return script if __name__ == '__main__': script = '/mnt/f/BIDS/demo_BIDS/derivatives/sepia_qsm/sub-YCHC0001/ses-01/sepia_qsm_script.m' run_matlab_scr...
8076344a58957520f841506b27828b4f2fa79ab0c6c82e759f3e050422d6c074
Python
331
13
import torch import celldetection as cd import celldetection_scripts as cs from skimage.data import coins import pytest def test_inference(): accelerator = 'cpu' model = 'ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c' img = coins() print('Image:', img.shape) cs.cpn_inference(img, model, accelerator=ac...
83cb7cb308827a6449938f4e8dff4522f40cc792485eeb747c1fbce5ab216309
Python
331
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_pipeline_test_v1'] = lambda: ModelCommitment( identifier='alexnet_pipeline_test_v1', activations_model=get_model(), laye...
bb99a035c8b46b21b040c9d2ca35d9a98722fca44b629a739437c4e5f8a765e1
Python
331
21
# flake8: noqa from .link_pred import ( LinkPredPrecision, LinkPredRecall, LinkPredF1, LinkPredMAP, LinkPredNDCG, LinkPredMRR, ) link_pred_metrics = [ 'LinkPredPrecision', 'LinkPredRecall', 'LinkPredF1', 'LinkPredMAP', 'LinkPredNDCG', 'LinkPredMRR', ] __all__ = link_pr...
df34bf7d2548a9fc2a98fa64af182bb3547383a9218d9ddcfe1eae014eba2992
Python
331
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_workflow_trigger'] = lambda: ModelCommitment( identifier='alexnet_workflow_trigger', activations_model=get_model(), laye...
e5c4c7099d251ef863e1dcbb074bbefdffb8897ca8d12e464149ee6d57458dd4
Python
332
11
import brainscore_vision def test_has_identifier(): model = brainscore_vision.load_model('gabor_filter_entropy_4x4') assert model.identifier == 'gabor_filter_entropy_4x4' def test_has_default_layer(): model = brainscore_vision.load_model('gabor_filter_entropy_4x4') assert model.layers == ['gabor_ent...
05c2507583fdd421480f7f41b3fc01e592c34505af0bc6fec1f45b283acaed92
Python
333
13
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from django.http import HttpRequest from rest_framework.request import Request from cvat.apps.engine.middleware import WithUUID from cvat.apps.iam.middleware import WithIAMContext class ExtendedRequest(HttpRequest, Request, WithUUID, WithIAMContex...
354c610caa19e47191566b39cb1efb3d0cea6b752c233a207844cfc576c27aeb
Python
333
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['BiT-S-R50x1'] = \ lambda: ModelCommitment(identifier='BiT-S-R50x1', activations_model=get_model('BiT-S-R50x1'), layers=get_layers('B...
bfc270059f7a43ba7e97426fe4253a1d62d12f1462ce1a8754745e78a50e9f1b
Python
333
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['BiT-S-R50x3'] = \ lambda: ModelCommitment(identifier='BiT-S-R50x3', activations_model=get_model('BiT-S-R50x3'), layers=get_layers('B...
c7bcb0df08a43523ad4b46cf9a861a3690dbf74ed07c91553a9d4dbe1942f437
Python
333
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_gated_submission2'] = lambda: ModelCommitment( identifier='alexnet_gated_submission2', activations_model=get_model(), la...
3ee87341f4f32e3714d01d25ed3a808ef174fc6924a73f7adceae9bc5bace1bc
Python
334
12
import pytest from qtpy import PYSIDE2 @pytest.mark.skipif(PYSIDE2, reason="Not available in CI") def test_qtserialport(): """Test the qtpy.QtSerialPort namespace""" QtSerialPort = pytest.importorskip("qtpy.QtSerialPort") assert QtSerialPort.QSerialPort is not None assert QtSerialPort.QSerialPortInf...
7125cb2e6f878ad0bda31d8064d4402515d9a3b0a94c8ccf14486a7719cbcc6d
Python
334
8
from brainscore_vision import metric_registry from .ceiling import InternalConsistency from brainscore_vision.metric_helpers.temporal import PerTime metric_registry['internal_consistency'] = InternalConsistency metric_registry['internal_consistency_temporal'] = lambda *args, **kwargs: PerTime(InternalConsistency(*ar...
728a5aa9cb40c622c5b6e91e60697790d97c20c7c4ab8cc74dadcf7ecf4bf0d1
Python
334
11
#!/usr/bin/env python from storm_control.test.hal.standardHalTest import halTest def test_hal_lock_config1(): halTest(config_xml = "none_config_lock_check.xml", class_name = "LockConfigTest1", test_module = "storm_control.test.hal.config_tests") if (__name__ == "__main__"): test_hal_l...
40523aa8334d1d03fac599607ceab9fc3a62f59eb9aa4d800b3035c0f71b9ec7
Python
335
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['alexnet_private_submission'] = lambda: ModelCommitment( identifier='alexnet_private_submission', activations_model=get_model(), ...
8b2f7acbdc487e4b5fe41d0eb20489260dcf6a7553af6db5471dfb4baaca15c3
Python
335
14
import glob # NOTE !!! #edit dirs as needed outFile = open('trfDir/trfchunks.cmds','w') fl = glob.glob('/home/jmkidd/links/kidd-lab/jmkidd-projects/tasha/mask-repeats/chunk-segments/*fa') print('have %i fl' % len(fl)) for f in fl: cmd = 'trf %s 2 7 7 80 10 50 500 -h -d \n' % f outFile.write(cmd) # break ou...
d621fa8df5526f27c7c833a2871dd16cb1987cd7549488979b04619e899a8beb
Python
335
11
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import datetime MAX_EVENT_DURATION = datetime.timedelta(seconds=100) WORKING_TIME_RESOLUTION = datetime.timedelta(milliseconds=1) WORKING_TIME_SCOPE = "send:working_time" USER_ACTIVITY_SCOPE = "user:activity" COMPRESSED_EVENT_SCOPES = frozenset(("ch...
f409bfb783ad71c91f90bef4aeca9dc672bcf3ed671a2e67407678a9c29c79ca
Python
335
17
# This file is part of connectome-manipulator. # # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2024 Blue Brain Project/EPFL """Testing helpers""" import pytest @pytest.fixture def nodes(): class FakeNode: config = {"morphologies_dir": "/foo/bar"} _population = None return (FakeNode(...
194011a6ce597e8a6579c58184ea68a9c000abdf5f44e1547c426286c3cc32c2
Python
337
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['densenet-169'] = \ lambda: ModelCommitment(identifier='densenet-169', activations_model=get_model('densenet-169'), layers=get_layers...
331edf89923eb1ae8eb61e8441218b044711dd5739b36709ee118b55ed843bd2
Python
337
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['densenet-121'] = \ lambda: ModelCommitment(identifier='densenet-121', activations_model=get_model('densenet-121'), layers=get_layers...
43b2f85755187b49f1090aa0c190143eddfa7312f2a6fb5947842db8f7b9cf32
Python
337
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['BiT-S-R152x4'] = \ lambda: ModelCommitment(identifier='BiT-S-R152x4', activations_model=get_model('BiT-S-R152x4'), layers=get_layers...
4753c96843e026cb642bbdb5c98ba561124482554a4538c95bc8c73dcaa6a148
Python
337
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['inception_v1'] = \ lambda: ModelCommitment(identifier='inception_v1', activations_model=get_model('inception_v1'), layers=get_layers...
c3d94c1dda2eb46754ef3101614c0ea554ce2e00608b77d04955829a4ae07345
Python
337
10
import numpy as np from ivim.constants import ybar, y, Db # Test functions def test_y(): np.testing.assert_approx_equal(ybar, 42.58e6, 4) # Hz/T np.testing.assert_approx_equal(y, 268e6, 3) # rad/T/s def test_D(): np.testing.assert_allclose(Db, 1.75e-3, rtol = 0.1, atol = 0.1e-3) # Diffusion coefficie...
d936433a0ac7d46d3f82527b82bff2761c479a523cbb0d9a65c70ad1e8d43a98
Python
337
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['BiT-S-R101x3'] = \ lambda: ModelCommitment(identifier='BiT-S-R101x3', activations_model=get_model('BiT-S-R101x3'), layers=get_layers...
db1994ed995ef6951af7177ce615540e08ed1af39fa0931f0c1c7b870531698d
Python
337
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['BiT-S-R152x2'] = \ lambda: ModelCommitment(identifier='BiT-S-R152x2', activations_model=get_model('BiT-S-R152x2'), layers=get_layers...
e9ac08d1e86cb8a11151760b5f3ee6a999f880506f91fc2dccdafb9179cb195e
Python
337
7
from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from brainscore_vision import model_registry from .model import get_layers,get_model model_registry['BiT-S-R101x1'] = \ lambda: ModelCommitment(identifier='BiT-S-R101x1', activations_model=get_model('BiT-S-R101x1'), layers=get_layers...
f409e63d96161473825014a280980dbda3261f2bd5f4b8ecebd06f7cc296cb46
Python
337
8
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, LAYERS model_registry['cv_18_dagger_408_pretrained'] = lambda: ModelCommitment( identifier='cv_18_dagger_408_pretrained', activations_model=get_model(), ...
24455d98ff077abdb5901ed409552a3210d970204118d08d22b74d27d9da6d20
Python
338
13
import sys import subprocess from .resources import get_path EXECUTABLE_EXTENSION = '.exe' if sys.platform == 'win32' else '' BMBI_EXECUTABLE = get_path('native' + EXECUTABLE_EXTENSION) def main(): result = subprocess.run([BMBI_EXECUTABLE, 'hydrate'] + sys.argv[1:]) sys.exit(result.returncode) if __name__ == '__...
54c5f2469b01243b4b73b6748e62b9fab20f1efe84390d16931533450db65675
Python
338
14
""" Utility functions for the orientation-dependent qMRI project Author: florian.birk@tuebingen.mpg.de """ # Import main functions for easier access from . import paths from .io import * from .processing import * from .analysis import * from .models import * from .visualization import * from .simulation import * from ...
7760c236e08c765847dc191be0ad7994871c08c39df67459d42f0b0cf42ea5bc
Python
338
14
""" BIDS data handling. - Currently only implemented as a draft in the gui functions - Will be outsourced to this file in the future """ #import nibabel as nib #from bids import BIDSLayout #from nilearn import datasets, maskers #from nilearn.interfaces.fmriprep import load_confounds def load_fmriprep_outputs(bids_...
d14688f493da5ea88ad29c433c4bd19b99f2cc56e5b09a134c770289896ff591
Python
338
9
from Bio.PDB import PDBParser from Bio.PDB.DSSP import DSSP p = PDBParser() structure = p.get_structure("", 'dataset/Ago/sample_1.pdb') model = structure[0] dssp = DSSP(model, "dataset/Ago/sample_1.pdb",dssp='mkdssp') sec_structures = [dssp_res[2] for dssp_res in dssp] sec_structure_str = ''.join(sec_structures) print(...
0ccaa9cea930c86090505308a9309be133374bc47a5c043a8793c7ecdb1f13c4
Python
339
19
# general imports from .components import * from . import styles from . import colours # component imports from . import ribbon from . import dist from . import means from . import significance from . import cosmetics from . import graphs # modelling imports from . import model from . import link # maths imports fro...
844f35d53fb46d9d9616f4f4f9591270338c42c5b7a8f3eed2396c6e95e14a25
Python
339
12
from argclz.commands import parse_command_args from .main_concat_csv import ConcatCellCSVOptions from .main_dff_session import DffSesOption parse_command_args( usage='python -m rscvp.signal CMD ...', description='raw calcium signal information', parsers=dict( ds=DffSesOption, csv=ConcatCell...
c060e0da221ccecf1c572586bead1a084bba4004bf97f7dc1504b85fb527f8ea
Python
339
14
# yapf:disable log_config = dict( interval=50, hooks=[ dict(type='TextLoggerHook', by_epoch=True), dict(type='TensorboardImageLoggerHook', by_epoch=True), ]) # yapf:enable dist_params = dict(backend='nccl') log_level = 'INFO' load_from = None resume_from = None workflow = [('train', 1)] cudn...
54e2399f5f695a9b741bb9d35570c5515a0982d710bd339dcc071822fc67af14
Python
340
13
from .gnn import GraphUNet def initialize_GNN_model(size_hidden_layers=64): model = GraphUNet( in_channels=8, mlp_hidden_channels=256, out_channels=1, size_hidden_layers = size_hidden_layers, dim_enc = size_hidden_layers, mlp_depth = 4, bn_bool = True, ...
188cada56b0c50fd5243ca32b0b45ad586419f2379b435917b52dea8fa2778ed
Python
341
10
import pytest import brainscore_vision @pytest.mark.travis_slow @pytest.mark.parametrize('field_of_view', ['fov4', 'fov12', 'fov16']) def test_has_identifier(field_of_view): model = brainscore_vision.load_model(f'alexnet_training_seed_01_{field_of_view}') assert model.identifier == f'alexnet_training_seed_01_...
60ab809d4b037e7e577920a96a1dc2cb747387cbaf7a2a5dc9dade2f682d363a
Python
341
21
# -*- coding: utf-8 -*- """TODO""" import numpy as np class Trace2D: """TODO""" def __init__(self, size): """TODO""" self.size = size self.val = np.zeros(size) def inc(self, i, j): """TODO""" self.val[i, j] += 1 def set(self, i, j): """TODO""" ...
bced255d2ca3cb1c00e82884b397363a144140912fff21b2311595353677f7b5
Python
341
13
import dtiplayground.dmri.common as common import dtiplayground.dmri.common.dwi as dwi import dtiplayground.dmri.common.pipeline as pipeline logger=common.logger measure_time=common.measure_time Color=common.Color get_uuid=common.get_uuid object_by_id=common.object_by_id get_timestamp=common.get_timestamp dwi = dwi ...
c4aa1182af1b94d0c52998f7acccc7c7b186f4cb49d9c321090b121773cd29eb
Python
341
6
# flake8: noqa from deepreg.dataset.loader.grouped_loader import GroupedDataLoader from deepreg.dataset.loader.h5_loader import H5FileLoader from deepreg.dataset.loader.nifti_loader import NiftiFileLoader from deepreg.dataset.loader.paired_loader import PairedDataLoader from deepreg.dataset.loader.unpaired_loader impor...
d67787f932b5888b2aaf44097e0be4c2d9725afccdb587e7d2f738ba6bdb07f7
Python
341
16
from .key_dataset import KeyDataset from .conformer_sample_dataset import ( ConformationSampleDataset, ConformationExpandDataset, ) from .lmdb_dataset import LMDBDataset, StackedLMDBDataset from .pcq_dataset import ( PCQDataset, ) from .oc20_dataset import ( Is2reDataset, ) from .data_utils import nump...
4ffd1679938564726ef23e2552cab5ad491a208584b9a71fcff92051d4532395
Python
343
9
from brainscore_vision import model_registry from brainscore_vision.model_helpers.brain_transformation import ModelCommitment from .model import get_model, get_layers model_registry["mvimgnet_rf"] = lambda: ModelCommitment( identifier="mvimgnet_rf", activations_model=get_model("mvimgnet_rf"), layers=get_la...
7fadd52bd62e4108f414f6b2d9c1cd2c9219e8526c18e247f821819874f50c5f
Python
343
15
# config.py import os from connattractor import utils import glob ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) # This is your Project Root MIST122_NII = utils.get_MIST_nii_path() MIST122_LABELS_TSV = utils.get_MIST_labels_path() DEFAULT_ATLAS_NII = MIST122_NII DEFAULT_ATLAS_LABELS_TSV = MIST122_LABELS_TSV...
8b3b618f1488500a232e39f810f4072c6a2695bdbb2d14de12c5f4224d07436e
Python
343
8
from brainscore_vision import benchmark_registry from .benchmark import Bracci2019RSA # benchmark_registry['Bracci2019_RSA-V1'] = lambda: _Bracci2019RSA("V1") # benchmark_registry['Bracci2019_RSA-posteriorVTC'] = lambda: _Bracci2019RSA("posteriorVTC") benchmark_registry['Bracci2019.anteriorVTC-rdm'] = lambda: Bracci20...
92a78f6dd450b74a7ade0b9df6ebedc9d889a80dff6d2f08b251cfd8742b93c2
Python
343
13
"""Collection of sampling Distributions. Intended to serve as priors for `nems.layers.base.Parameter`. Modified from code by Dr. Brad Buran (github: bburan). """ from .normal import Normal from .half_normal import HalfNormal from .uniform import Uniform from .beta import Beta from .gamma import Gamma from .exponent...
a8e1d3c0dad87c26ed32991d5a3ed534f49c054cb3cd6ae10026254631556697
Python
343
13
""" This is a legacy schema that will no longer be used in the unified pipeline. It is provided here to support the migration process. """ import datajoint as dj from distutils.version import StrictVersion assert StrictVersion(dj.__version__) >= StrictVersion('0.2.5') schema = dj.schema('common', locals()) schema.s...
74f2549d6ea34c8fd2fef83bfedc08acb27a02be00f66092f424872bf37fcf7c
Python
344
14
""" Tools and data structures for working with genomic intervals (or sets of regions on a line in general) efficiently. """ # For compatiblity with existing stuff from bx.intervals.intersection import ( Intersecter, Interval, IntervalNode, IntervalTree, ) __all__ = ["Intersecter", "Interval", "Interva...