sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c456980d7a44104a86fa1dddf6953295af6711753d05a8c52ba2ee3bbe9a7541
Python
6,642
147
# assumes run from parent directory from plumbum import local, FG import os import yaml import numpy as np def main(): # Harnet ablations model_types = ['CRNN', 'harnet', 'harnet_unfrozen', 'harnet_random', 'RNN', 'rf'] low_data = [False, True] dataset_names = ['baglione_crows', ...
dd3b7a6bccdb3f4254bd82f2a043946474f94194ec69418e91e008bee952fed8
Python
6,642
145
#!/usr/bin/env python import sys import argparse import os import csv import re from datetime import datetime from IlluminaBeadArrayFiles import GenotypeCalls, BeadPoolManifest, code2genotype, NormalizationTransform delim = "\t" #get commandline parameters parser = argparse.ArgumentParser("Generate a final report fr...
067db26c70e624dfadf67868208af3204e4a1ac45330c56e7162f3166a0a3bf9
Python
6,643
188
import json from dreamcoder.program import Primitive import os import numpy as np import re import arckit def load_task(task_id): return arckit.load_single(task_id)#.dreamcoder_format() # def load_task(task_id, task_path='data/ARC/data/training/'): # filename = task_path + task_id + '.json' # with open(...
b05f4cc4e22417dbb68e8a6cec92f984cf1bd0403be5647f028c9a34cabe1f51
Python
6,643
147
#!/usr/bin/env python import sys import argparse import os import csv import re from datetime import datetime from IlluminaBeadArrayFiles import GenotypeCalls, BeadPoolManifest, code2genotype, NormalizationTransform delim = "\t" #get commandline parameters parser = argparse.ArgumentParser("Generate a final report fr...
24a604d936f9fbe7b749f6c31d3de7e8743411f4a055999ebd329c74bb62ebea
Python
6,644
211
import numpy as np import pytest from openmm import openmm, unit from calvados import interactions def _particle_parameter_names(force: openmm.CustomNonbondedForce) -> list[str]: return [ force.getPerParticleParameterName(i) for i in range(force.getNumPerParticleParameters()) ] def _bond_pa...
446372254f6bd008e859321b0fec48de6b32732863c3fd8b537992c56a70b0a3
Python
6,645
155
import os import re from copy import copy from typing import Tuple, Dict import pandas as pd from torcheeg.datasets.module.base_dataset import BaseDataset class Subcategory: r''' A tool class for separating out subsets of specified categories, often used to extract data for a certain type of paradigm, or for...
d0fb5c2b5504c4474e95cc98edc2e71b0ec065af851ac102beb8bcdb894d28ee
Python
6,645
231
from __future__ import annotations from dataclasses import dataclass import numpy as np import pandas as pd from .config import FeaturePreparationConfig @dataclass class FeaturePreparationResult: """ Output of the unsupervised MorphoGlia Feature Selection stage. """ data: pd.DataFrame analytic...
18b10e72ffb55040c6ea6b3fe24c393249db04697cb3e7fa1eb1c13b50ec024a
Python
6,647
189
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
7a55c01155ee5c455fe782b8233b367228c4084b6d4bf5d4c8494d3e3225f9de
Python
6,649
190
import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D import torch import torch.optim as optim import sys sys.path.append("..") from PIDAO_SI import PIDAccOptimizer_SI from PIDAO_Sym_Tz import PIDAccOptimizer_Sym_Tz from PIDAO_SI_AAdRMS import PIDAccOptimizer_SI_AAdRM...
43884ac2e6437392588ebad9efd68698fde5b054ace1521a90558e6b08a2c47f
Python
6,650
192
import sys import numpy as np import gzip import random # params vcf_path = sys.argv[1] sample_path = sys.argv[2] # list of samples to keep outname = sys.argv[3] # with .vcf min_read_depth = int(sys.argv[4]) # min read depth, DP field min_sample_prop = float(sys.argv[5]) # min proportion of samples with data seed ...
cd1e63a5ef6048b097500615ab7bd0ad5874210de200665e97317d8b10e758a6
Python
6,653
186
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
07bd9751e0e6cd8874a889fecd1101bd1ec4b1d2ba970bd6a804568f7320b539
Python
6,654
170
import argparse import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import random from dataloaders.data_loader_general_equ import NetDataset_new from torch.utils.data import DataLoader from model.resinf import ResInf from engine import * import wandb parse...
3bb94f62d9e9042fc8593873303aa1882899424d0cc712139b713c335b0ac408
Python
6,654
172
# Plots metrics used to identify ideal time-step to balance accuracy and speed # for Fig 8 from os.path import join from get_paths import * import matplotlib.pyplot as plt import numpy as np import pickle from kneed import KneeLocator from colors_paultol import cset_high_contrast if __name__ == "__main__...
518b87832ea3f22b634d661ca3bd102e3cbd4edf80330f9bd319199d04106d9b
Python
6,656
147
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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 # # ht...
3b770deaab6e1f297c5a6d3b125e677522d6321aee530cb1c9b4d88d1a7788dd
Python
6,657
257
import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from burst_space import BurstSpace from help_funcs import load_exp_variables # ----- # # Hyperparameters. metric = "rocauc" if metric == "rocauc": metric_str = "score" elif metric == "accuracy": metric_str = metric band = ...
566277948875e4e00fa71d51c7a2014e36de92d88e57ac1c6bfa978776c11c35
Python
6,657
160
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
f485188e9df32c36f60a299e4f453a418e241e2cfdb975244a85c8559c1c4902
Python
6,657
181
# Node-group asset "Point Edge Angle" (GeometryNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump. from typing import TYPE_CHECK...
44b0ebdec7235699c8b9b3ebd7c51b6fc2a4a34f30f6c7700c2cb212408d0e60
Python
6,658
181
from collections.abc import Iterable, Iterator, Sequence from dataclasses import dataclass from itertools import chain from typing import Any, TypeVar @dataclass(eq=True, frozen=True) class DataFlowNode: dsts: tuple[str, ...] sources: tuple[str, ...] name: str @classmethod def top(cls, name: str)...
d71fd09544b0615db18620d2587630fc93ecdb6ec01dd7fcab9bbbf699962281
Python
6,659
184
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
1191275b012b85b3a9ad35bd016848c627c2428d4f8f9e87f27459fa3e5b85e4
Python
6,661
185
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
b31e8dae3da3f29c379316d39f5b7bb7a7673bf4770125760f17d884cec4b34f
Python
6,661
186
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
302ae004faa96a18f2ae8cd723688f41c1d89d9bdb70e6252b51c268297a63ee
Python
6,662
144
import os import numpy as np import pandas as pd import anndata as ad import scanpy as sc import scvi #from util.utils_B import set_seed from time import time #from memory_profiler import profile #os.environ['PYTHONHASHSEED'] = '0' #os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE" from memory_profiler impor...
708b4226a27e125a61f5578c647810d2e5c9693bce272b57d7f79ad603b90888
Python
6,662
185
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
e7a81e44fb8f210497b4cbc3c50baffd2b35d66581346c406f360b0accbdfb2c
Python
6,662
166
import numpy as np import unittest from sklearn.base import clone from sklearn.discriminant_analysis import LinearDiscriminantAnalysis import pyntbci FS = 120 PR = 60 SHIFT = 2 v = pyntbci.stimulus.make_m_sequence() V = pyntbci.stimulus.shift(v, SHIFT) V = np.repeat(V, FS // PR, axis=1) LAGS = np.arange(0, v.shape...
160ba9f99268bd646dfca7faaa82218ae0d1f2e55957e622bb5fd400599dc807
Python
6,663
176
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
8448ac1c376c8256ba54be790cc6d63a83dd90aef40ff90f28160745f6ed7bbd
Python
6,663
152
import os from scipy.io import loadmat import numpy as np import pandas as pd import torch from sklearn.model_selection import train_test_split from datasets.SequenceDatasets import dataset from datasets.sequence_aug import * from tqdm import tqdm from itertools import islice #Digital data was collected...
6eee07686de4555188a86034a95863fac11654c2b6b4d53406186d7a1ea4e76f
Python
6,665
185
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
8b5fba2b48bc708f4f8863983e29700c4f0ff53093c95ad7c6b92abcc56ec9b3
Python
6,665
185
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
a5d6ec822d089c37b76e88b7c241f352edddeb67775442866973d6ecba1f65c0
Python
6,665
185
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
b6270aaf5e6649eae59ef563e9989d1ccc1a230b0fcdbd25ce87c772fc7966c1
Python
6,665
185
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
381ca2fb71e4faa2f9d5a5750c7912838e5ddb56f4de21c9157cef30e720f9a9
Python
6,667
137
# ------------------------------------------------------------------------ # # 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 # # Unle...
a0891ad20b8e4f082775814eb9eea64a1c4846e9ddc8e6815b59959dec26671f
Python
6,667
185
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (3): 785-806. doi: ...
ffca6e10a5cd1fd1e52fc9ccbd43380292ebc24a3d11649723be7f53e8e9975e
Python
6,667
174
"""napari reader plugin for XuLab-RegTools. Bridges napari's file-open / drag-and-drop machinery to the unified ``load_volume()`` I/O layer so the standalone napari viewer (``12_run_napari.bat``) and every regtools :class:`NapariViewer` can open formats napari has no built-in reader for: **NIfTI, NRRD, DICOM, VSI...
c73df2a0dbd70071435be7b85d4888deeb3d3057e853a0716bc467326a0e79e0
Python
6,670
164
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
c1baa51b8a7a4eb3702d27bbdc88f693579365469df0e212732fd62c9b85870c
Python
6,671
196
import json from pathlib import Path import numpy as np import torch import tqdm from scipy.stats import pearsonr, spearmanr from .prix_fixe_net import PrixFixeNet from .dataprocessor import DataProcessor from typing import Any from abc import ABCMeta, abstractmethod # default metrics to compute DEFAULT_METRICS = ...
c55593a1bcdad2bc420e36f256dd0ec7b1f6ce68c7046acecb2f267ad610a7b3
Python
6,672
227
# %% import sys import os sys.path.append(os.path.abspath("../..")) sys.path.append(os.path.abspath("..")) sys.path.append(os.path.abspath(".")) # %% import torch import torch.nn as nn import pandas as pd from tqdm import tqdm from pathlib import Path from prosper_nn.models.ecnn import ECNN from prosper_nn.models.e...
51027d77e445c146785e230df984ac558c423073ce8f78c11b1a2d3bb1c7ff18
Python
6,674
184
# -*- coding: utf-8 -*- # # General, CR agnostic, JackKnife implementation for trial statistics # import h5py import numpy as np # Syncopy imports import syncopy as spy from syncopy.shared.computational_routine import propagate_properties from syncopy.shared.errors import SPYValueError, SPYError def trial_avg_replic...
5699d40331b159aad6432dd4767fb89c2f0dabda0ec6833fd75bef98e4556289
Python
6,674
216
from itertools import cycle import torch import torch.nn as nn from torch.optim.lr_scheduler import StepLR device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def train(Epoch, train_labeled_loader, test_loader, model, eval, loss, optimizer, weight): # passing optional arguments as dictionary step_si...
bdc0cd02e9053dd8206f71f8d23092168902c25eb87d56ba142c94995d338978
Python
6,675
175
# By Shuran Liu, 2023 import argparse import yaml import math import matplotlib.pyplot as plt from tqdm import tqdm from PIL import Image import os from skimage.metrics import structural_similarity as ssim parser = argparse.ArgumentParser(description='Input a config file.') parser.add_argument('--config', help='Config ...
9883ee1d99571509878d4c73fa410767ad4dd701dfe8ee863883903a7765ce10
Python
6,676
87
= # Batch parameters sleep_time = 0.2 logs_folder = "./logs/" output_folder = ["../output"] args_file = "./arguments.dat" args_lock = "./arguments.lock" lock_timeout = 300 jobs_count_tars = 12 # 132+12 jobs_count_t_bayes = 132 jobs_count_onsager = 1 jobs_count_chloe = 2 manager_script = "job_manager.py" DETACHED_PRO...
aa55aa99d5b7a26605947f77ecfbca03ce7c247c47d5d60fc7712687900a65d6
Python
6,676
205
# -*- coding: utf-8 -*- """ Created on Fri Jan 12 11:27:20 2018 @author: Laure Spieser and Boris Burle Laboratoire de Neurosciences Cognitives UMR 7291, CNRS, Aix-Marseille Université 3, Place Victor Hugo 13331 Marseille cedex 3 This file is part of Myonset. Myonset is free software: you can redistribute it and/or m...
c18d893d96361238b5be147b6d5a3ec8204f27d2c2cba3fcd223808590f5562f
Python
6,676
171
"""Logic that powers autocompletion installed by ``pip completion``. """ import optparse import os import sys from itertools import chain from typing import Any, Iterable, List, Optional from pip._internal.cli.main_parser import create_main_parser from pip._internal.commands import commands_dict, create_command from ...
cdc4969230d3dd4b990fa1765aa34bb0727e3e72d693b8719a7df8a42026deab
Python
6,676
207
import itertools from typing import Callable, Generator, Iterable, List, Tuple, TypeVar, Union import editdistance import numpy as np import scipy.stats as st from numpy.typing import ArrayLike Message = str Messages = List[Message] Meaning = Tuple[int, float] Meanings = List[Meaning] def form2meaning_ratio(meanin...
13a0ebcffb76985f6d2c3175aa43e201d3790b68193ba065512ab079829f8d78
Python
6,677
152
#!/usr/bin/env python import argparse import random import time from pybullet_tools.pr2_utils import set_arm_conf, get_other_arm, arm_conf, REST_LEFT_ARM, \ get_carry_conf, get_gripper_link, GET_GRASPS, IR_FILENAME, get_database_file, DRAKE_PR2_URDF, \ set_group_conf, get_group_conf, get_base_pose from pybull...
d499f7a1b44e5d86636fe835fc61ed88170ce7f3aef4ff3a666197990d01b185
Python
6,677
114
"""TIPPING_POINT.py 2026-09-29. Pre-registration: 04-NOTES/PREREG-2026-09-29m-TIPPING-POINT.md Random type-level LN sign sets at 10-70% excitatory LN output: smell code (whole brain, DL5 + DA1) and fit to the real fly (Seki, AL cut-out). Where does the model tip over, and where do the published / best-guess / probabili...
fca34eddfc521c7b3a37089d8f81308aa5a98e393ec65ebff71037653d6ad816
Python
6,678
169
# trace generated using paraview version 5.11.0-RC1 #import paraview #paraview.compatibility.major = 5 #paraview.compatibility.minor = 11 import os,glob from paraview.simple import * #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset() # get the material library ...
85f27d9ef7431c54643b4afacc12542503557b36829396bc6cbade0f0d905c65
Python
6,679
277
# Node-group asset "Switch Residue Name" (GeometryNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump. from typing import TYPE_CH...
eea2accddb52366a740b30e694e80ca54cc66666c1e68dd8ae8f0a267ee12fd6
Python
6,679
197
import argparse from datetime import datetime import random import numpy as np import os import time from utils import * from utils.dataloader_utils import load_data_graphalg,load_dataset, analyze_dataset_hyperbolicity,relations_to_degree_analysis from params import * import sys from datetime import date import pickle ...
43d3cd4f88c5aac23538a5baf2974a44029b02dcbd7d1ab909cafa1fc9409063
Python
6,680
164
""" Behavioural tests for the itk-elastix library backend. Elastix runs entirely in-process; the command-line ``elastix``/``transformix`` binaries were retired. These cover the three operations the pipeline needs - registration, image transformation, and POINT-SET transformation - all against the project's own p...
9068763071a7ed7192f2d2ab801e8765f3c473887a9449b11a0491c15682dd8b
Python
6,680
268
from scconfluence import dataset_utils, unimodal import numpy as np from torch.utils.data import DataLoader from context import ( create_synthetic_adata, create_synthetic_mdata, run_unimodal_ae, run_scconfluence, ) def test_umodal_dataset(): adata = create_synthetic_adata(n_obs=100, n_features=200...
216314d449594aa07a5b8e0c15903103147198e2fb58675fc0ca9aac7efe2f0a
Python
6,684
160
#!/usr/bin/env python from __future__ import print_function import cProfile import pstats from examples.pybullet.utils.pybullet_tools.pr2_primitives import Pose, Conf, get_ik_ir_gen, get_motion_gen, \ get_stable_gen, get_grasp_gen, Attach, Detach, Clean, Cook, control_commands, State, apply_commands from example...
702c162eff3330bfbea12117ee90012f253d095dcdc085dfa271993bf9aa7593
Python
6,685
148
"""Read the shipped midsagittal plane; fit one for the maintainer's tool. ``plane_for_atlas`` is what everything on the registration hot path calls. It reads the parameters committed in ``regtools/hemisphere/planes.json`` and validates them against the user's annotation HEADER - it never fits, and never reads vox...
3f9af5ea56dbe4a63e16f48e6a1222a041773f834711f0e0c7d646df63095e06
Python
6,688
148
# flake8: noqa # This file is used for deploying replicate models # running: cog predict -i img=@inputs/00017_gray.png -i version='General - v3' -i scale=2 -i face_enhance=True -i tile=0 # push: cog push r8.im/xinntao/realesrgan import os os.system('pip install gfpgan') os.system('python setup.py develop') import cv...
651c234604e64a336b242b9570107ff5a5f18c7f6b1ff94a15773a0c027dae67
Python
6,692
178
# part of this script was taken from https://github.com/jocicmarko/ultrasound-nerve-segmentation import argparse from glob import glob import numpy as np from PIL import Image from keras import backend as K from keras import losses from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau from kera...
609927d2a7229173f6020092b13b197e9c6a86971ceeeb769b259f85715e7491
Python
6,696
187
# -------------------------------------------------------- # DaSiamRPN # Licensed under The MIT License # Written by Qiang Wang (wangqiang2015 at ia.ac.cn) # -------------------------------------------------------- import numpy as np from torch.autograd import Variable import torch.nn.functional as F from control.DaS...
d29e857a841413bcb04c7c4f0bd38c9db0f63a1cc420774b6ffcd68198fce70a
Python
6,696
111
#!/usr/bin/env python import itertools from SCanSNP.VCFUtils import * from sklearn.linear_model import LogisticRegression from SCanSNP.DBLsutils import * from SCanSNP.GenUtils import * def LocusSpecNoisCalc(DropToDBLDict,Doublet,SingularLociScoreDF,GenotypesDF,vcf,HomozlociList,RefHetLoci,AltHetLoci): comp1 = Double...
0ddd8fa2020dab4a61542c9bb598bd15befe04ebe8ec68d7e38beb826a36aab5
Python
6,697
189
''' A colections of points Point() are correlated in a manner that creates a perimeter Perimeter(). Every perimeter should be nice, i.e.: 1) Not self-intersecting; 2) No overlaping points; 3) Have a prefered orientation. If we can garantee this properties, than we proceed to stitch a...
f159f3e80a060df5229a61157b1f8cd72a04561559b3577b93080365a8ade7c5
Python
6,697
117
from iblutil.util import Bunch import numpy as np import pandas as pd from one.api import ONE import os one=ONE(base_url='https://openalyx.internationalbrainlab.org/', password='international') def bleach_correct(nacc, avg_window=60, fr=25): """ Correct for bleaching of gcamp across the session. Cal...
653d8c108c6b908cc49676fc3dc7adddfa5f55df078197b862475e72b91ae135
Python
6,700
191
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Example plot for LFPy: Single-synapse contribution to the EEG Execution: python example_EEG.py Copyright (C) 2017 Computational Neuroscience Group, NMBU. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General P...
10c05e8060153b4c6b829514021b7883a4b69a562ca9c8286490ac0ec10b81db
Python
6,702
167
# Copyright 2022 HYBRID Team INCIA, UMR5287, CNRS, Université de Bordeaux # 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 b...
2b89fb0188180472e27e23bb0664c4187d86136f9883f50200a063455febfe25
Python
6,702
177
# basic import os, random import numpy as np from tqdm.auto import tqdm from joblib import Parallel, delayed try: from .ModelData import * except: from ModelData import * def get_mixed_loader(bag_data, label_data, size_data = None, site_data = None, split = True, signal_only = False): ### datalo...
9df5c2bbb38759d5df239e5c57531b839900166e768e4235a3b6d9280af403c4
Python
6,703
125
#!/usr/bin/env python # relion_run_topaz # This is to run Topaz picker (https://github.com/tbepler/topaz) from Relion as an External job type # Rafael Fernandez-Leiro 2020 - CNIO - rfleiro@cnio.es # Alex J. Noble 2020 - NYSBC - anoble@nysbc.org # Run with Relion external job # Provide executable in the gui: ...
60f167cd0d846578964fa850fee789062f61e0f824417312832ca7acabd808ee
Python
6,704
185
# -*- coding: utf-8 -*- """ Created on 15 october 2023 @author: divyoj """ ## importing libraries: import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.animation import FuncAnimation import os # # note that this must be executed before 'import numba' # os.environ[...
bb52d31717061269eeecdd282faefaa88bfa330fba2f3f2e232e095fa0aea197
Python
6,704
158
from __future__ import print_function try: from Tkinter import Tk, Canvas, Toplevel except ImportError: from tkinter import Tk, Canvas, Toplevel # NOTE - this will overwrite (but remember) existing drawings # TODO - try PyGame, PyCairo, or Pyglet SUCTION_WIDTH = 1.5 # 1.01 | 1.5 STEM_WIDTH = 1. STEM_HEIGHT =...
71cadc75e5b417cbe3a600878af84779aa9de4d250bfa63bad3e7b32afc4811d
Python
6,705
182
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
7919690c1410281cc8101b795b8bd783b07b4e598efab1890b094a4947220d39
Python
6,708
168
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models class AudioResNet152(nn.Module): def __init__(self, num_classes): super(AudioResNet152, self).__init__() # Load pre-trained ResNet-152 model self.resnet = models.resnet152(mod...
97847138bc23377220ea1e2f2cc347aeea0693db2f535715f513570acba100c8
Python
6,708
191
import warnings import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np import pytest from SurvivalEVAL import IntervalCenEvaluator, SingleTimeEvaluator, SurvivalEvaluator from SurvivalEVAL.evaluations.calibration.single_time import ( integrated_calibration_index, one_cal_...
1cb367da92fbe563eae48b373976e47a5f8f62ab2ddaccaa8b86c9a1df321a68
Python
6,709
201
# import libraries import torch import numpy as np def Cosine4AIF_ExtKety_deep(t, aif, ke, dt, ve, vp, device='cpu'): # offset time array t = t - aif[0] - dt ct = torch.zeros(np.shape(t)).to(device) shapes = t.size() ke = ke.repeat(1, shapes[1]) ve = ve.repeat(1, shapes[1]) vp = vp.repeat(...
8f6a67a5b6f30293a1e5c9647ecab7475242a63203c5d544e4a29c93d5982320
Python
6,710
222
# # MIT License # # Copyright (c) 2022 GT4SD team # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
aaecb82f3dc471473b07da1e07d53571e962d5d89cebd04338619ea9c13b71da
Python
6,710
165
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 15 00:04:58 2021 @author: haotian teng """ import os import sys import umap import torch import argparse import numpy as np import torch.utils.data as data from itertools import islice from typing import List,Union from torchvision import transforms...
98db6e25d978a69386ac9a0a448d06dc24dda7b6b31aa58bef34fd54801c9d93
Python
6,711
139
import unittest import numpy as np from torcheeg.datasets import constants from torcheeg.datasets.constants.utils import format_channel_location_dict from torcheeg.transforms import Compose, ToGrid class TestGrid(unittest.TestCase): def test_location_helper_omits_channels_absent_from_grid(self): channel...
e4386f2b12e15a2d2709c3a60de71dd3e991f129e41372102ed62a28ec5080f3
Python
6,711
162
import os import torch import torch.nn as nn import torch.autograd as autograd import torch.nn.functional as F class PaddingAutoencoder(nn.Module): def __init__(self, input_len, input_dim, encoding_dim): super(PaddingAutoencoder, self).__init__() self.input_dim = input_dim self.input_len =...
5d1805430227bfeb4d7a3c9346b043245705f999037d7bbb12e58152d236b328
Python
6,712
170
import numpy as np import math from collections import namedtuple from itertools import islice from control_tools.common import get_arm_prefix from plan_tools.common import get_reference_pose, is_obj_type, get_type, CUP_WITH_LIP from plan_tools.samplers.generators import TOOL_FRAMES, TOOL_POSE, set_gripper_position f...
223617f3ec59263b9c716ac0940b7c2c0577d3596ccf99e49dc8eca7d8c788fd
Python
6,716
177
""" Bonito Basecaller """ import os import sys import numpy as np from tqdm import tqdm from time import perf_counter from functools import partial from datetime import timedelta from itertools import islice as take from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from bonito.aligner import align_ma...
4d069543ef427fbb9ff3e1a1c95ef6e6d91f035f73bca4f8b94b2c5a8aaede6b
Python
6,717
161
""" FREEZE_CANDIDATES.py - written 2026-09-17. WHY A FREEZE. The method now produces a list of cell types it says carry chemistry the six-class vocabulary does not contain. Some of those will turn out to be in the literature already. If the list is compared with the literature BEFORE it is fixed in place, then ...
c402576c3667f9bc735535a8e98480fe181fea99916860ef27898767f8f854a9
Python
6,717
217
import os from collections import defaultdict import torch import torch.nn.functional as F import numpy as np from scipy import sparse as sp from sklearn.metrics import roc_auc_score, f1_score, cohen_kappa_score, precision_score, \ recall_score, balanced_accuracy_score, adjusted_rand_score, normalized_mutual_info_...
c61e301502581b7d575184c883dcf93b74dd2558bfe2b0233f22655fead08368
Python
6,717
260
from matplotlib.colors import LinearSegmentedColormap _CM_DATA = [[0.2422, 0.1504, 0.6603], [0.2444, 0.1534, 0.6728], [0.2464, 0.1569, 0.6847], [0.2484, 0.1607, 0.6961], [0.2503, 0.1648, 0.7071], [0.2522, 0.1689, 0.7179], [0.254, 0.1732, 0.7286], [0.2558, 0.1773, 0.7393], [0.2576, 0.1814, 0.7501], [0.2594, 0.1854, 0.7...
e4560cb032eea6cd570046fc1f5bafcedfc4c3bc4c590e30d1ee02310b65e159
Python
6,717
147
from __future__ import annotations import os from pathlib import Path from ase.build import bulk, molecule from quacc import change_settings from quacc.recipes.gulp.core import relax_job, static_job def test_static_job(tmp_path, monkeypatch): monkeypatch.chdir(tmp_path) atoms = molecule("H2O") output...
e64d9988ca0ebf8d3e16dd5d1ed5218c934fe9437097c9ce26e4b0db877365e0
Python
6,717
235
"""Recipes for slabs.""" from __future__ import annotations from typing import TYPE_CHECKING from quacc import flow, job from quacc.recipes.common.slabs import bulk_to_slabs_subflow, slab_to_ads_subflow from quacc.recipes.vasp._base import run_and_summarize from quacc.wflow_tools.customizers import customize_funcs ...
5ca351968a41ce5890595c798a3812082cdef7360752360b8bcea0ce249ffd16
Python
6,719
226
import numpy as np from os.path import join from burst_space import BurstSpace from help_funcs import load_exp_variables # ----- # # Dataset selection. datas = ["zhou2016", "2014004", "2014001", "munichmi", "cho2017", "weibo2014", "dreyer2023"] # Number of repetitions. reps = 30 # Components to use. cta = [2, 3, ...
740448e08342dabf312b05ef0e1efcaf448a9a845a6ac2ea74c83d660b5bc652
Python
6,719
211
"""Test various helper functions.""" import numpy as np import pytest from numpy.random import RandomState from pyprep.utils import ( _correlate_arrays, _eeglab_create_highpass, _get_random_subset, _mad, _mat_iqr, _mat_quantile, _mat_round, _print_progress, ) def test_mat_round(): ...
86f6a23ed4bff902d947e8a1f6c8cfe801a42d953b4fd76efc301870d409989e
Python
6,722
188
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os import glob import io from setuptools.command.easy_install import easy_install from setuptools import _path from setuptools import namespaces import setuptools class develop(namespaces.Develo...
51c74b810e9aac9eb1f191b7fcf1d0cd3a354b85fd900323401ccd255ec30578
Python
6,723
177
''' 4SM/model.py Copyright (C) 2021 Sharif Amit Kamran, Hussein Moghnieh 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 2 of the License, or (at your option) any later version. This ...
70d5fc609ffe7c8bbac09dd08a5a0b7668cdf4c0289fc05733037aa633b63008
Python
6,724
156
""" Created on Tue Aug 3 23:24:39 2021 @author: Haotian Teng """ import numpy as np import os import sys import pandas as pd import argparse import itertools from typing import Tuple,Iterable def load_data(prefix:str,renorm = False,read_meta = False)->Tuple[np.array,Iterable,np.array,np.array,np.array]: """ L...
74c8b039ba204d486e2b1d5c468f4a0480ae8e9ea796baf2970763624a90299d
Python
6,724
206
# Node-group asset "Ensemble Instance" (GeometryNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump. from typing import TYPE_CHEC...
bc2453481b0d6b79361289b373086b99d88623a68886563d654ed138aa9c2e44
Python
6,724
182
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
253e39edec0877707c8aaf10a7355b3894c9be75585456886b65a8411d73b83c
Python
6,725
170
from typing import Tuple import torch import torch.nn as nn class BGenerator(nn.Module): r''' TorchEEG provides an EEG feature generator based on CNN architecture and GAN for generating EEG grid representations of different frequency bands based on a given class label. .. code-block:: python g_...
eab3f9d362f18d8363e7ce125159a65676c430e243a48aaebd2908028bac6fe4
Python
6,725
163
import os import numpy as np import PIL import cv2 import tifffile from scipy.signal import convolve2d import merlin from merlin.core import dataset from merlin.data import codebook as cb class MERFISHDataFactory(object): """ A class for simulating MERFISH data sets. """ def __init__(self): ...
7bb3f96cb1198edfe28b7ef12753655c40f7f8398e5348be0e5778bb828d00e0
Python
6,726
221
## for debug.. import os os.environ["CUDA_VISIBLE_DEVICES"] = '0' import PoseUNet from poseConfig import aliceConfig as conf import h5py import multiResData import tensorflow as tf import numpy as np import PoseTools import pickle from scipy import io as sio import math self = PoseUNet.PoseUNet(conf, name='pose_unet_...
2acbbcf1bbe088a75f40eb03d1fd43f3584989e47355090a806aa0efac5ba79e
Python
6,727
171
import numpy as np import networkx as nx from eval_metrics import roc_auc_score def minkowski_dist(x, y, c=1): """Minkowski separation between x and y, c = speed of light parameter""" d0 = -c**2 * (x[0] - y[0])**2 d1 = np.sum((x[1:] - y[1:])**2) return d0 + d1 def LorentzMDS(M, d): """Performs Lor...
5e578050f3176a18bee00e40b37885736f19e02145bf6b861f907a0bb38915e4
Python
6,727
123
"""REAL_ODOURS.py 2026-09-25. Pre-registration: 04-NOTES/PREREG-2026-09-25c-REAL-ODOURS.md Real ORN responses (Hallem & Carlson 2006, via DoOR) drive Shiu's LIF model; can the PN layer tell 110 odours apart better than the ORN layer (the known answer in real flies, Bhandawat et al. 2007)? usage: python REAL_ODOURS.py [...
e320aac3b7b52c503a84a25dcac0744318e12f3325126761582510fcc3d66225
Python
6,727
90
"""ONE_INEQUALITY.py 2026-10-02. Pre-registration: 04-NOTES/PREREG-2026-10-02o-ONE-INEQUALITY.md One inequality for one wrong sign and for many: a set of sign changes breaks the lobe iff it moves s_U, the excitatory share of the local neurons' synapses onto uniglomerular PNs, past one value s_break. L1: s_break from th...
3ce1970c155ad6216764f18f002b20dcebf211e638131bfc39517bb2e964e830
Python
6,729
164
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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 # # ht...
70a0d05784d5ed9cc2c53f3ef47c475582e73d6c8e9d5070165002ad20ac3dda
Python
6,731
122
"""Helper functions to parse and create a hyperparameter object.""" import os import json import tensorflow as tf DEFAULT_DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'data')) def add_arguments(parser): """Helper function to fill the parser object. Args: parser: Parse...
c21df1ce51ed105e3597916513ed258ba9bb12159b2c9ac34ff1dc44449e5384
Python
6,733
214
""" Script that applies the CONN pipeline to a set of subjects Uses the same structure as run_pipeline_prime.py COPY script/Base_batch.m to the CONN base directory for this to work! For each subject: - Create new output directories - Moves the necessary data to the new directories - Converts the label generated b...
1b357ea9de4ce0413eafdb41d44bbf8bc35155d5f35d86c860fabdf9ed980622
Python
6,734
143
import torch import numpy as np import argparse import utils import time from tqdm import tqdm from engine_train import Trainer def arg_option(): parser = argparse.ArgumentParser("The required parameters of the model") parser.add_argument('--device', default=None, type=str) parser.add_argument...
69d32672c3cff854ffa496c3f54003296f9997144d16d731dbfb3d3f532c5827
Python
6,734
176
import numpy as np import pytest from lifelines import AalenJohansenFitter, KaplanMeierFitter from SurvivalEVAL.nonparametric_estimator.competing_risks import ( AalenJohansenCompetingRisks, ) @pytest.fixture def no_cross_ties(): """Disjoint cause timelines allow a deterministic comparison with lifelines.""" ...
94395e51254bf926a8c02423e35b3e04e31b10e0a1668e43d76caf0379df6311
Python
6,734
168
from typing import Tuple, Final from schnetpack.data import AtomsDataModule import torch from spainn.multidatamodule import calculate_multistats __all__ = ["SPAINN"] class SPAINN(AtomsDataModule): """ Adapted AtomsDataModule class of SchNetPack 2.0 for calculating statistics (mean and standard deviation...
9e8e570364be94be8e613c5a9753c004aeca087e7eee2d18030d0b12e436fa42
Python
6,734
177
""" Classes for parsing command line options for ASL tools Copyright (c) 2008 University of Nottingham """ import sys from optparse import OptionGroup, OptionParser, Option, OptionValueError from collections import defaultdict from copy import copy import tempfile import numpy as np from fsl.data.image import Image ...
08cd74f859286bf68008cd737d5c85304c46c6958a09522910dc60dad8e234c7
Python
6,736
164
import os import cv2 import numpy as np from merlin.core import analysistask from merlin.util import deconvolve from merlin.util import aberration from merlin.util import imagefilters from merlin.data import codebook class Preprocess(analysistask.ParallelAnalysisTask): """ An abstract class for preparing da...