sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8e92efc3dc73eeac37111c6ba1c19d040e462c843f88da5606df88aed12238de
Python
2,621
83
"""A setuptools based setup module. See: https://packaging.python.org/guides/distributing-packages-using-setuptools/ https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages from os import path from io import open as io_open TEST_REQUIRES = [ # testing and coverage 'pyte...
da57f7e861c170cd5f51dd227b3e3d115b087db78908dcf4bfa80660bb463eba
Python
2,621
73
#!/usr/bin/python # ## @file # # For running modules outside of HAL. # # Hazen 03/14 # # Add current storm-control directory to sys.path import imp imp.load_source("setPath", "../sc_library/setPath.py") import importlib import sys from PyQt5 import QtWidgets import storm_control.sc_library.parameters as params def ...
e5f7f55d2eac381a72f9ebe0846a8e27ad7b6f91dfd663b55cc16a00693c5fff
Python
2,621
73
################## PURPOSE ################# # This script removes duplicated coordinates that resulted from Bedtools merging # and removes NULLs if they are not stand-alone values in a cell ################# ASSUMPTION ############### ############################################ # Imports in the pep8 order https:/...
f1d98ac2ab1eeab3712f90fe0f8e9bf6db6aa828d7c2f2eeef4fc3a244e584d0
Python
2,621
79
from qtpy.QtCore import Qt from qtpy.QtWidgets import ( QApplication, QDialog, QHBoxLayout, QLabel, QMessageBox, QPushButton, QSizePolicy, QSpacerItem, QStyle, QTextEdit, QVBoxLayout, ) class WarningDialog(QDialog): def __init__(self, text: str, title: str = "Warnings",...
5c3e352ba0ee400bc0fde64dd886a786c50f7015462354bfa9954b9e628ad390
Python
2,622
73
# # load the necessary modules # from dmipy.core import modeling_framework # from dmipy.core.acquisition_scheme import acquisition_scheme_from_bvalues # from os.path import join # import numpy as np # from dmipy.signal_models import cylinder_models # # the HCP acquisition parameters are saved in the following toolbox ...
8c7f8bc33ad0755da1a24d247b2b363242110c4f142d56024e012e5ae04a7cc2
Python
2,622
49
import torch from torch import nn from .local_channel_attention import LocalChannelAttention from .global_channel_attention import GlobalChannelAttention from .local_spatial_attention import LocalSpatialAttention from .global_spatial_attention import GlobalSpatialAttention class GLAM(nn.Module): def __init__...
b46e0b0d6dec141c630c8cdac520a2829d9ff102c572d2136fdf8ceca64c3389
Python
2,622
82
import logging from ..config import ObservableCollection from ..qt import * from .. import thalamus_pb2 from ..task_controller.util import create_task_with_exc_handling LOGGER = logging.getLogger(__name__) class LuaWidget(QWidget): def __init__(self, config, stub): super().__init__() if "Equations" not in...
ccffc59467cac412e8b7af6ad86e8353ffff589ce004b6fa9fa086da5964b2e1
Python
2,622
83
################## PURPOSE ################# # This script removes duplicated coordinates that resulted from Bedtools merging # and removes NULLs if they are not stand-alone values in a cell ################# ASSUMPTION ############### ############################################ # Imports in the pep8 order https:/...
e4fff149fd9d9975cb9baa86f3276e65247299ca81b0deda4476927fba4efd67
Python
2,623
72
import os import os.path as osp import torch import numpy as np import scipy import pandas as pd import argparse import os import torch_geometric.transforms as T from torch_geometric.utils import to_networkx from torch_geometric.data import Data parser = argparse.ArgumentParser(description='display graph features and ...
fcefe68be5bf0a5943195f3a8ad6b9f934c8bba94f163003950456b31c7bfb3e
Python
2,623
69
# @SNTService snt # @UIService ui """ file: Scripted_Tracing_Demo.py author: Tiago Ferreira, Cameron Arshadi version: 20260731 info: Exemplifies how to programmatically perform A* tracing between two points without GUI interaction, which allows for automated tracing of relatively simple struct...
01e4c31ed69a0baf2b0e323a36c2260e6deecded2e0ba54c6740b89d666b4153
Python
2,624
82
#!/usr/bin/env python3 # Copyright (C) 2025 Paolo Vincenzo Fioretti, Michela Roccuzzo, Enrico Saccon, # Maria Pennuto, Manuela Basso # 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 vers...
1b81c93f9646eeb71fc93a3cd0fcb9b91affe0fe2ede3a44e488e8ef7329f4d8
Python
2,624
66
#!/usr/bin/env python3 """Record a synthetic grayscale video stream into a Thalamus capture file. Thalamus stores camera data as ``image`` records. Each record carries the raw frame bytes plus its width, height, pixel format, and frame interval. This example writes a short ``Gray`` (8-bit) clip of a vertical bar swe...
2f1584c2fc8c0a2f9f2553e49e6b24e0735c94b8a7ab4538d13f429b3301456d
Python
2,624
63
import functools from torchvision.models import densenet121 from brainscore_vision.model_helpers.activations.pytorch import load_preprocess_images from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.check_submission import check_models def get_model(name...
af5ddd6610b969d01b3ff5f18df5c105ff32563dab1c4921782e30fecfbb38ec
Python
2,624
78
"""Functions to handle task data.""" import numpy as np def epoch( data: np.ndarray, time_index: np.ndarray, pre: int, post: int, pad: bool = False ) -> np.ndarray: """Transform (time, channels) data to (epochs, time, channels) data. Given a series of triggers given by :code:`time_index`, spit a continu...
fc6f3f955d971a8a602eb928282ebdf596d344decb3bc040f835ee0dddaeda21
Python
2,624
63
import functools from torchvision.models import densenet169 from brainscore_vision.model_helpers.activations.pytorch import load_preprocess_images from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.check_submission import check_models def get_model(name...
1596a6d07f4d50b52ae58f333c0eed99892c0b5e3e09d206516a16a2e9674d6c
Python
2,625
63
import argparse import os import pandas as pd from tqdm import tqdm from utils.utils import load_coords if __name__ == "__main__": parser = argparse.ArgumentParser(description='make single mutant tsv') parser.add_argument("-d", "--dataset", type=str, default=None) parser.add_argument("--pdb_file", type=st...
c13d365bd36e999c0d18f435680acc44390638a83c56023e03c6f3cd7262d45d
Python
2,625
56
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'infoBox.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_infoBox(object): def setupUi(self, infoBox): infoBox.setObje...
4099d712d1b9544a0641ceba16dfdeb01129307953a4e39b4fd914d95d077a9e
Python
2,626
82
# -*- coding: UTF-8 -*- # Copyright (c) 2019 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 # ...
aba3d567d87f92b031bd4cc320a45d38a5b180c855bbe3b4102d42d0d025bf81
Python
2,626
68
import traits from nipype.interfaces import utility from PUMI.engine import FuncPipeline, NestedNode as Node @FuncPipeline(inputspec_fields=['ts_files', 'fd_files', 'scrub_threshold'], outputspec_fields=['features', 'out_file']) def calculate_connectivity(wf, **kwargs): def calc_connectivity(ts_fil...
5e1f75d4f3ce0500c852d20c1328fccc668305f7c3f8d9f6ee1bb67c6eb00b67
Python
2,627
78
import pandas as pd from abc import ABC, abstractmethod class SurvivalBase(ABC): """ Interface class for causal survival analysis with fixed baseline covariates. """ @abstractmethod def fit(self, X: pd.DataFrame, a: pd.Series, t: pd.Series, y: pd.Ser...
9e4306ccb1965f15c9d7258f611247ab7b634d50dfc2950bc1e4813bfa18b594
Python
2,627
81
import os import json from nipype.interfaces.base import ( CommandLineInputSpec, TraitedSpec, CommandLine, ) from traits.api import Str, Int, Bool class SynthSRInputSpec(CommandLineInputSpec): input = Str(mandatory=True, argstr="--i %s", position=0, desc="Image(s) to super-resolve.") output = Str(...
0571bec9c72b0b6f7405a5683c9ef013990be4134f11d02bd2080c35224081a9
Python
2,628
87
# Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved import logging from contextlib import contextmanager from functools import wraps import torch __all__ = ["retry_if_cuda_oom"] @contextmanager def _ignore_torch_cuda_oom(): """ A context which ignores CUDA OOM exception from pytorch. ...
11fc7df56af279935a631b7ae98e1e936239f00e1ca332af93165bb08bb102dd
Python
2,629
76
from .base import WaveformBenchmarkDataset class LFEStacksCascadiaBostock2015(WaveformBenchmarkDataset): """ Low-frequency earthquake stacks underneath Vancouver Island, Cascadia, Canada/USA based on the catalog by Bostock et al (2015). Compiled to SeisBench format by Münchmeyer et al (2024). """ ...
2db69625801c005b1cae38008b134da613fd922036b3e3afb791267f74684917
Python
2,629
87
#!/usr/bin/env python3 import vtk import vtk.util.numpy_support as VN import numpy import argparse from pathlib import Path #command line interface parser = argparse.ArgumentParser() parser.add_argument('file0') parser.add_argument('file1') parser.add_argument('output', nargs='?') args = parser.parse_args() if not Pa...
30118ac6ea8f40940b3407159c5f5145ee75f665a412546e92166742e4f66198
Python
2,629
70
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations from pathlib import Path import numpy as np import torch from ultralytics.utils import LOGGER from .base import BaseBackend class DeepXBackend(BaseBackend): """DEEPX NPU inference backend for DEEPX hardware...
3cec1aaf4e90a7cff1e1b5e1ba8e004f0e031d3a5761bfc3ff8a2ae52bf93d7f
Python
2,629
53
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'adjust_contrast_dialog.ui' # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dial...
591092838467ad1189081cd0e304f5b752e0d2d6232f1915ef0034d966003b17
Python
2,629
81
#!/usr/bin/python # ## @file # # Test communiction with Nikon TI microscope. # # Hazen 04/14 # import MMCorePy import time mmc1 = MMCorePy.CMMCore() mmc1.loadDevice('TIScope', 'NikonTI', 'TIScope') mmc1.loadDevice('TITIRF', 'NikonTI', 'TITIRF') mmc1.loadDevice('TIFilterBlock1', 'NikonTI', 'TIFilterBlock1') mmc1.initi...
71b477d5e0c2bbc78fc090e9e76c33eac7ea8e39ec15b8b6d568a8fd8ab9b777
Python
2,629
100
from pathlib import Path import subprocess import sys from typing import ClassVar, Optional from argclz import argument, int_tuple_type from neuralib.rastermap import RasterMapResult from neuralib.util.verbose import fprint from .cli_core import CommonOptions __all__ = ['RasterMapOptions'] class RasterMapOptions(C...
9e7ba5dd5058c7c30fbd1f70d217e8cfbfba5aa788aa8a48b833c9b53a22169f
Python
2,629
87
from typing import Any import pandas as pd from gamma.utils import association as gamma_association from .base import AbstractAssociator class GammaAssociator(AbstractAssociator): def __init__(self, config: dict[str, Any], **kwargs) -> None: super().__init__(**kwargs) self.config = self._adjust...
cb6e7fd1d2bc9a0386386138102900cdf93121c1697e24069a46591692e7401e
Python
2,629
75
#!/usr/bin/env python # -*- coding: utf-8 -*- import math import numpy as np allShapes = { "square" : [[1.2602,0],[0,1.2602], [1.2602,1.2602],[0.6301,0.6301]], # noqa "rectangle" : [[1.5,0], [0,1], [1.5,1], [0.75,0.5]], # noqa "isoTrapezoid" : [[0.7445,0],[-0.3648,...
6db22707bdc0f18012596d91e631882de6e29d54e8a77f7ec2610a28a72b97a7
Python
2,632
80
from skeleton_keys.cmds.depth_profiles_from_aligned_swcs import ( ProfilesFromAlignedSwcsParameters, main as depth_profile_main, ) from skeleton_keys.cmds.process_morphology_features import ( ProcessMorphologyFeaturesParameters, main as morph_feat_main, ) import argschema from taskqueue import queueab...
9883e18072851730d668602348f3198ff16986549910d1e52f94fa1b9848b63f
Python
2,632
83
import pytest from eir.setup.config_validation import validate_no_duplicate_columns def test_validate_no_duplicate_columns_no_duplicates(): columns = ["col1", "col2", "col3"] validate_no_duplicate_columns( columns=columns, config_type="Tabular input", config_name="test_input", ) ...
9a73ee17f7b0d35252bbd451c58e549e5499d786ede483cb501203c2c6ac3ff0
Python
2,632
89
import pandas as pd import numpy as np import json from stg_PopPK.main_utils import run_train import argparse import os from pathlib import Path ROOT_PATH = Path(__file__).resolve().parent.parent DATA_PATH = ROOT_PATH / "data" def read_data(scenario): csv_data_train = pd.read_csv(DATA_PATH / scenario / "train.cs...
dac465fe86466be400063765d186559c6cfd7c56204895d5b71f627190c69e63
Python
2,633
67
import functools import torch from brainscore_vision.model_helpers.activations.pytorch import load_preprocess_images from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.check_submission import check_models def get_model(name): """ This method fet...
430258c025fbb0d8b2aa3bc1fa9d09e5635fea6338b7c46a90ba75e2c76c54d4
Python
2,634
61
import os from scipy.io import loadmat, savemat """ Usage: good_listen_subjects, good_motor_subjects,good_error_subjects,musicians,nonmusicians = load_subject_lists_LME() """ all_subjects = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21'] ...
540e72468df62156a467fe6763be4a02b7da5e765b00dcd39313151839be728e
Python
2,634
58
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import torch from ultralytics.engine.results import Results from ultralytics.models.yolo.detect.predict import DetectionPredictor from ultralytics.utils import DEFAULT_CFG, ops class OBBPredictor(DetectionPredict...
6f403206cb62ba285b3608f90c570bde5f94204dbbd266c266e593724fe39288
Python
2,634
89
from typing import Type import numpy as np from neuron import h from ..cells.neuron_cell import NeuronCell from .simulation import WaveformType from .spike_simulation import SpikeSimulation from neuron.units import ms, mV class ThresholdFactorSimulation(SpikeSimulation): """A NEURON simulation with the function...
8b625a70ee3761a52a313c59a5e7c0f70a5a2bd7241feb284b31b9b3d387eec6
Python
2,634
101
# coding=utf-8 """ Module to download additional data and resources that are not included in releases via command line interface. """ import argparse import os from io import BytesIO from urllib.request import urlopen from zipfile import ZipFile from deepreg import log logger = log.get(__name__) def download(dirs...
e16917252759ede3023d1839abf6e555b47dbf153ed7391b8823fb8a29456efa
Python
2,634
59
import gc import runpy from pathlib import Path from unittest.mock import patch import pytest from qtpy.QtCore import QCoreApplication, QEvent from qtpy.QtWidgets import QApplication EXAMPLES_DIR = Path(__file__).parent.parent / "docs" / "examples" EXAMPLES = sorted(EXAMPLES_DIR.rglob("*.py")) @pytest.mark.parametr...
d5caa8f75d0b9b63015974cf96e34dfd43c5d89cef919b892013609e2d338977
Python
2,635
95
""" This is ported from Matlab code from the original TDR codebase. """ import numpy as np def tdrMeanAndStd(data, avgpars=None): """ tdrMeanAndStd compute mean and std of responses Inputs: data: population response (sequential or simultaneous, see 'help tdr') avgpars.trial: logical indices of t...
ffd9cdbf658998b241e7452e33bfd2b0982ff798b98787615dd2a06f6f0bf749
Python
2,635
48
"""A collection of tools for representing sound waveforms with spectrograms. The contents of this package were derived from the gammatone toolkit, which is licensed under the 3-clause BSD license. The full copyright disclaimer can be found below, or at the following URL: https://github.com/detly/gammatone/blob/master/...
2e38af0be816f57f19310e550eac0a8b33dd0af6bfdabc7fbcd62895e1e14f2f
Python
2,636
74
import numpy as np from src.wrappers.OsipiBase import OsipiBase from src.original.fitting.OJ_GU.ivim_seg import seg class OJ_GU_seg(OsipiBase): """ Segmented fitting algorithm by Oscar Jalnefjord, University of Gothenburg """ # I'm thinking that we define default attributes for each submission lik...
72c904d924a2948b0a77e7212e4a96eab86d6986f0d59389704fd737391affec
Python
2,636
85
import pandas as pd import time import ijson import content_feature as cf import csv import spacy import copy nlp = spacy.load('en_core_web_lg') def get_content_vector(tweets): links = cf.count_urls(tweets) mentions = cf.count_mentions(tweets) content_vector = { "links_ratio":links[0], "uni...
b5b14184468015d5f0772ab1992b3542266c702cf3e35e95dbd737dd809c6c10
Python
2,636
57
import numpy as np from numpy.random.mtrand import RandomState from sklearn.model_selection import StratifiedShuffleSplit from brainscore_core.supported_data_standards.brainio.fetch import get_assembly from brainscore_core.supported_data_standards.brainio.packaging import package_data_assembly, package_stimulus_set ...
38eda9c3e6be1d34cd08096d1eebae72b4e312c27e93e05e608f7ead707b04b3
Python
2,637
77
############################################################################# # Copyright (C) 2020-2026 MEmilio # # Authors: Maximilian Betz # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
7ca89213daa8e3522a62d3b9a157aade218992b8ae8e4dfa11ad6b8a467f5503
Python
2,637
72
# -*- coding: utf-8 -*- import numpy as np from dipy.io.stateful_tractogram import StatefulTractogram from scilpy.tractanalysis.streamlines_metrics import compute_tract_counts_map from scipy.sparse import dok_matrix from scilpy.tractograms.tractogram_operations import union_robust, \ intersection_robust def filt...
0f678dc3560e44bd557341535f08b2bd30d6366c146c504cb3dfe2bea9dd8e00
Python
2,638
68
from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_preprocess_images import ssl import functools import timm from brainscore_vision.model_helpers.check_submission import check_models ssl._create_default_https_context = ssl...
36b1f59d92d60f000b73995560a22052b44ff2bb6feb2da7fbf4b6358ee7306a
Python
2,638
93
import os from typing import Dict, List, Union import yaml from deepreg import log from deepreg.config.v011 import parse_v011 logger = log.get(__name__) def update_nested_dict(d: Dict, u: Dict) -> Dict: """ Merge two dicts. https://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionar...
5563ed067f6d0c1d2e2d83dca8ee253b03e34715d52607bae0974aa0c7710c54
Python
2,638
91
from seisbench.data.base import WaveformBenchmarkDataset class VCSEIS(WaveformBenchmarkDataset): """ A data set of seismic waveforms from various volcanic regions: Alaska, Hawaii, Northern California, Cascade volcanoes. """ def __init__(self, **kwargs): citation = ( "Zhong, Y., &...
656e8556c992bd59144edb9293c26adaf8d37928c309d4ebe4463011d39b4a9a
Python
2,638
65
import csv import pathlib import matplotlib.pyplot as plt import numpy as np NANO_FACTOR = 1e9 STEADY_STATE_CURRENT = 1.09e-10 # Amperes from helper_functions import __file__ MODULE_BASE = pathlib.Path(__file__).parent.parent DEFAULT_DATA_PATH = MODULE_BASE.joinpath('reference_data/Miller_2026/dendritic_current') def...
75960ccfb46f1ac1ced0bbb9e79b80c1e920e59e9fb9fd5d0316c9106345a25a
Python
2,638
74
_base_ = ['RepLKNet-31L_22Kpretrain_upernet_160k_ade20k_640.py'] model = dict( backbone=dict( large_kernel_sizes=[27,27,27,13], channels=[256, 512, 1024, 2048], drop_path_rate=0.5, small_kernel=None, dw_ratio=1.5, norm_intermediate_features=True ), decode_hea...
6a112aec211fe4887ed014ff24069e37f99ef31be15a9d04290c191838a850c9
Python
2,639
81
from dataclasses import dataclass from pathlib import Path from typing import TYPE_CHECKING, Literal from eir.experiment_io.configs_io import load_configs from eir.experiment_io.io_utils import check_version from eir.experiment_io.label_transformer_io import load_transformers from eir.experiment_io.output_object_io im...
826ed7b0d902b21bf26b5c03eadfd965fe4a65152ed3264a2a72bcbc6f7602dc
Python
2,639
84
# -*- coding: utf-8 -*- """ Created on Sat Dec 19 04:29:29 2015 @author: ckirst """ import os import ClearMap.Settings as settings filename = os.path.join(settings.ClearMapPath, 'Test/Data/ImageAnalysis/cfos-substack.tif'); import ClearMap.Visualization.Plot as plt import ClearMap.IO as io data = io.readData(filename...
8e634a082df3cb59299755ae52bf5474b10845604252e510871afe2e972c9e92
Python
2,639
77
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import os from datetime import timedelta from pathlib import Path from tempfile import TemporaryDirectory from django.conf import settings from django.test import SimpleTestCase from django.utils import timezone from cvat.apps.dataset_manager.cron ...
0463cc93903790830887d9f4d03454b58e5de83266e4c62a82d84712c7e7a675
Python
2,640
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
46718fddc1abcc9fe7c3457a363d17f2d89b1635c03a4994e90620b794b1c204
Python
2,640
66
############################################################################# # Copyright (C) 2020-2026 MEmilio # # Authors: Maximilian Betz # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
48ea75192a101a353435c208519e2ec2efd07fb9a1743bd8d75e692d7c506054
Python
2,640
63
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'delete_stream_dialog.ui' ## ## Created by: Qt User Interface Compiler version 6.4.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ######...
51bd23d4f67e234e9327738d94217f0180f0816d7b145ac3391fadc6c2eb20af
Python
2,640
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
7c2b5847cad627fb40fee9097f55a320151795e96a308610e66f2570dd9db15a
Python
2,640
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
b41bdda4917e49db924f38bec089845c47efc6a57d4e3021a06ef515824d489b
Python
2,640
68
from train_gtex import * def main(): parser = argparse.ArgumentParser(description="Run a training experiment") parser.add_argument("--config_path",type=str) parser.add_argument("--fold",type=int) parser.add_argument("--seed",type = int) parser.add_argument("--train_gene",type = str) parser.add...
be357ab45df2a3b6d9260ff8a9169ce06176aca6b1888ca47a5a9a80e7b5b6ce
Python
2,640
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
be6d1d23f4b0d18f2840e07c8c35aaf99d8fe4c7f083125d2710bc63799e095c
Python
2,640
34
from testsetclass import TestsetClass class ISOL24(TestsetClass): def __init__(self): self.weak = 1.0 self.molecules = ['i5p', 'i12e', 'i18p', 'i24p', 'i22e', 'i8p', 'i9e', 'i19e', 'i22p', 'i23p', 'i12p', 'i15e', 'i8e', 'i9p', 'i2e', 'i7e', 'i21p', 'i16p', 'i18e', 'i24e', 'i5e', 'i6e', 'i4e', 'i4p...
f8877bfffe598013a947fef793b2b5eb0b95528507be642e0aa6bf17ea2f6af1
Python
2,640
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
fb42b445e55966e6272181711013342b5d5809544f0cf2d4149ed564468f1717
Python
2,640
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
063e2b8775889a56cbf0da5a3345425d3e0f146864cbda6def135815268d639f
Python
2,641
68
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations from pathlib import Path import numpy as np import torch from ultralytics.utils.checks import check_requirements from .base import BaseBackend class AxeleraBackend(BaseBackend): """Axelera AI inference back...
47ae6ccf99446f16cd3329a6c92290c7b14152b1774e9662110e54c7a723fef5
Python
2,641
73
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT # Generated by Django 4.2.21 on 2025-10-14 14:50 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ mi...
7f1667f1be714c5e7711c08996523ab19e7f51a6442f16b066a8c30638a946c7
Python
2,641
135
#!/usr/bin/python3 # import os import sys import argparse import numpy as np from uac import utils # Create the parser my_parser = argparse.ArgumentParser(description="Calculation of old atrial coordinates") # Add the arguments my_parser.add_argument("target_path", metavar="path", type=str, help="Path for the new ta...
10810e8c834d5491fad7f63768da87248e6d1876c8696a731f554e67c5ed611c
Python
2,642
69
import logging try: import faiss except ModuleNotFoundError: logging.warning( """The pytorch-metric-learning testing module requires faiss. You can install the GPU version with the command 'conda install faiss-gpu -c pytorch' or the CPU version with 'conda install faiss-cpu -c p...
d66f9b2c930066e91cf3fcfdf1fe7d8bf387a3a06ca4eb8263960c430f484434
Python
2,642
69
from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.check_submission import check_models import functools from brainscore_vision.model_helpers.activations.pytorch import load_preprocess_images import ssl from .helpers.hmax import HMAX from .helpers.pytorch...
a91f9a9a27f9a1cd95a96c9adcab3e32e50cf9a87938fb9f3886f83211869e1a
Python
2,643
54
import pytest import brainscore_vision from brainscore_vision import load_stimulus_set @pytest.mark.private_access class TestMarques2020V1Properties: @pytest.mark.parametrize('identifier,num_neuroids,properties,stimulus_set_identifier', [ ('Cavanaugh2002a', 190, [ 'surround_suppression_index',...
ea3482d926ca9712ac57232ff54f71b9a7c107cf2ec9454ec91480ef02c41bfd
Python
2,643
85
import torch from torch import sin, cos, atan2, acos def rot_z(gamma): return torch.tensor([ [cos(gamma), -sin(gamma), 0], [sin(gamma), cos(gamma), 0], [0, 0, 1] ], dtype=gamma.dtype) def rot_y(beta): return torch.tensor([ [cos(beta), 0, sin(beta)], [0, 1, 0], ...
8743e58661d4ff5433532e29de9b08f49a1e6806a8d7f38114ad7f2ba45ef5ee
Python
2,644
74
""" A dataset reader that reads single tarfile based datasets This reader can read datasets consisting if a single tarfile containing images. I am planning to deprecated it in favour of ParerImageInTar. Hacked together by / Copyright 2020 Ross Wightman """ import os import tarfile from timm.utils.misc import natural...
3c4934d663fcc219c1959bf57b7726c116e5a46f533cf1bc695d3a49686328c1
Python
2,645
92
from abc import abstractmethod from typing import Any import tensorflow as tf from tensorflow.keras.layers import ( Activation, BatchNormalization, Conv3D, Dropout, GlobalAveragePooling3D, GlobalMaxPooling3D, Input, MaxPooling3D, Reshape, ) from tensorflow.keras.models import Model ...
f030df4a4d5e9f8c80103f875f0aa5ab9c2a5bb2b3ce38e690aa20eb7c85dad8
Python
2,645
68
"""Test Qsci.""" import pytest from qtpy import PYSIDE2, PYSIDE6 from tests.utils import pytest_importorskip, using_conda @pytest.mark.skipif( PYSIDE2 or PYSIDE6 or using_conda(), reason="Qsci bindings not available under PySide 2/6 and conda installations", ) def test_qsci(): """Test the qtpy.Qsci name...
0670a017506824b87ccb17c4afcc11d5d15a1bec17e3084e0eaf70fe6fadeaad
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
1bad800d2a385c3bb2ffe6cd53ddbbb779b7cca07dfe51ad24ae94ee3827b260
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
233cb0f14ed0239826c5c18f11b8c69cc76e54fc0542f3f58aa2dd65883035b0
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
47a3d8eb62e03fd9b59c0b3de7dce67fd1d467f4b8fc053a8f3f264f723f8f4b
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
607c966d6b64627f61ef5be053b366a93c19d9e922463c3bf536c07785411210
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
6c3ffbe2897fb4d752d0312a5889c06b559a0f10f4b566562b1cfedad0eeece1
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
96d842bb63d3f41ef2b6e75b9b44a0d2be51ce057b72e10b496a3926ded68370
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
9d3a0293117640d02890207906ccd27c013af9487a75537c69844e4f992af157
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
b19a2140b4b438879fb61bb277dd39592e69a633a1a173fb447571408e494cae
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
bd106ca45fa85211469940227e92248f2b630478c2da80dfbd9881c40d41bc90
Python
2,646
77
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
f64264794573cb73a458903c7c191a6310fd473dfa31d21d2b06374e12d24562
Python
2,646
76
import skimage.io as skio import numpy as np import napari import tifffile import argparse def load_image(path): ''' Load .tif file which is generated from Amira with skimage.io Args: path: path of .tif file ''' tif_stack = skio.imread(path, plugin='tifffile') #tif_stack = tifffile.imre...
51d7a884030c9aeee4c2b38ca19c0d69b71aa6a094f95641f3a49f788ccd26e9
Python
2,647
79
### Cloned from github milesial/pytorch Unet """ Parts of the U-Net model """ import torch import torch.nn as nn import torch.nn.functional as F class DoubleConv(nn.Module): """(convolution => [BN] => ReLU) * 2""" def __init__(self, in_channels, out_channels, mid_channels=None): super().__init__() ...
608dd22d15be54821341573bd6ad6ac8d7ff0fd428449b59cd5dfaf95b79ad89
Python
2,647
84
from unittest.mock import MagicMock from flair.data import Sentence, Span, Token from flair.embeddings import FlairEmbeddings from flair.visual import * from flair.visual.ner_html import render_ner_html, HTML_PAGE, TAGGED_ENTITY, PARAGRAPH from flair.visual.training_curves import Plotter def test_highlighter(resourc...
277d8513501fadef410689b17046f8b6a5df6edafeba1ba534b105aa8945baa2
Python
2,648
103
# -*- coding: utf-8 -*- # external inputs import numpy as np from numpy.fft import fftshift def filter_bold_2d(nx, ny, fovx, fovy, fwhm, beta): """Filter BOLD 2D. This defines the BOLD blurring in 2D. It is defined as modulation transfer function in spatial frequency space. The filter is the Fourier tr...
bde8bd2c8d57521ec766e8e35b751c877101cb19d8fc3066780a1973a2c02d9b
Python
2,648
83
# The ImpedanceFitter is a package to fit impedance spectra to # equivalent-circuit models using open-source software. # # Copyright (C) 2018, 2019 Leonard Thiele, leonard.thiele[AT]uni-rostock.de # Copyright (C) 2018, 2019, 2020 Julius Zimmermann, julius.zimmermann[AT]uni-rostock.de # # This program is ...
5e91cdcb13086b5212d0e8c374e69304c1a87f209faae9655141696a056a0f8a
Python
2,649
62
from brainscore_vision.model_helpers.check_submission import check_models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_preprocess_images import torchvision import antialiased_cnns import functools import torch import ...
b383ab0d87cdd87e202929df5ac04cfd984410c0f3ea02242289f3e5085f4763
Python
2,649
71
# Requirements (tested with TensorFlow 2.16.1): # pip install numpy tensorflow import numpy as np import os from tensorflow.keras.models import load_model # === PARAMETERS === NUM_OUTER_FOLDS = 9 NUM_INNER_FOLDS = 8 MODEL_DIR = "saved_models" # Change if your directory is different MODEL_PREFIX = "model" ...
e45ed685e29565c505b842abc257974e7b5f50863c7fa4bc2cd17e8c3f78f253
Python
2,649
83
""" Code adopted from https://github.com/SuperElastix/elastix_napari Author: Viktor van der Valk, v.o.van_der_valk@lumc.nl """ import tempfile from pathlib import Path from typing import Optional import itk import numpy as np _ELASTIX_PARAM_FILES = [ # Path(__file__).parent / "Par0033similarity.txt", # Path(_...
94d4e3afa260296777869e206e52918aa0da585f3dcc9261a2af9c09f07a2e48
Python
2,650
93
import torch import numpy as np import pickle as pkl import networkx as nx import scipy.sparse as sp #below code was adapted from https://github.com/nairouz/R-GAE/tree/master/GMM-VGAE here. We thank for the authors to make it publicly available def parse_index_file(filename): """Parse the index file path Ar...
13d8a19b8b119bc132956359411d048dd0b1831e74e5e12ff05775548b34d2d7
Python
2,651
78
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
1f653b104f3fbeb058bcb7d5a28aebe6724ecf5b1d454563b9af191e9d7ec38a
Python
2,651
78
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
637757e2f361e4988ef63caf382a78036ba029c803bfd8ea1ecfd469bbe682c2
Python
2,651
78
from brainscore_vision.model_helpers.check_submission import check_models import functools import os from urllib.request import urlretrieve import torchvision.models from brainscore_vision.model_helpers.activations.pytorch import PytorchWrapper from brainscore_vision.model_helpers.activations.pytorch import load_prepro...
2966a4018e3f105f393fabffdf32bd3dee190beec03d031d2927e2efcff43a94
Python
2,652
77
from abc import ABC, abstractmethod from typing import Any class Registrator(ABC): # TODO probably the init here should be removed? # def __init__(self, backend): # self.backend = backend @abstractmethod def register( self, fixed_image_path: Any, moving_image_path: Any...
462cbff20005320673e306abaaf57e8a54b6ec988f8786cd315e13986d19f263
Python
2,652
136
#! /usr/bin/env python # aponteeduardo@gmail.com # copyright (C) 2017 '''' Automatically generate the necessary functions. ''' def gen_code_n_states(f, p): fname = 'c_{0:s}_n_states_{1:s}.c'.format(f, p) code = '''/* aponteeduardo@gmail.com */ /* copyright (C) 2018 */ #include "mexutils.h" void mexFu...
5f8cc1d0e5e633c3cea323daa6752bc20b4103d2c7424f99f1d22ea4470b52b0
Python
2,652
59
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 27 10:53:04 2020 @author: Cristian """ import numpy as np import pandas as pd # (not used below, but kept if you need it elsewhere) # Pattern duration: 2 seconds (informational only; not used by the code) # Number of EC neurons in the p...
83476dc75b514980e3db0d903b30cd239d2af73612952a6d20555b0569bf7b95
Python
2,652
122
#!/usr/bin/env python # coding: utf-8 # In[1]: import celldancer as cd import anndata TLS_path = '/data/processed/TLS.h5ad' # In[6]: TLS = anndata.read_h5ad(TLS_path) TLS.obs_names_make_unique() N, G = TLS.shape # In[10]: data_path = '/VeloVAE/celldancer/data' # In[11]: dataset='TLS' # In[12]: df ...