sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
503e2a53164d8e740a806f283c6ded5ac17e0784a94cb185e57b1043a9883fb2
Python
4,488
141
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Bar(_BaseTraceHierarchyType): _parent_path_str = "indicator.gauge" _path_...
67422d5a6db19c6537f2e459503cbe87fac3ae29c39d24925a5b8874930b8e7b
Python
4,488
143
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Z(_BaseTraceHierarchyType): _parent_path_str = "volume.slices" _path_str ...
bc3f87f3549a82586c864ca67d3b613b5245edbe3ac4c7ccb15094848dfc64e1
Python
4,488
142
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): _parent_path_str = "box.unselected" _pat...
ef5179b6d08f2070715e4a68b6425230217da119aebc3ebcb3ce54890007e747
Python
4,488
143
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class X(_BaseTraceHierarchyType): _parent_path_str = "volume.slices" _path_str ...
88ed98e293bc82a1d043bd54fbb391f9ee1d48c582607f7c4e33b5198b6b6c52
Python
4,489
129
"""Prepare your dataset in ImageRecord format ============================ Raw images are natural data format for computer vision tasks. However, when loading data from image files for training, disk IO might be a bottleneck. For instance, when training a ResNet50 model with ImageNet on an AWS p3.16xlarge instance, T...
c1775b57fe851c322ba57eda23fe88eca4301b3cb630bf3d16f865bab5126c48
Python
4,490
117
from typing import Optional, Any, List import numpy as np import torch import matplotlib.pyplot as plt from scipy.signal import find_peaks, peak_widths from sklearn.preprocessing import MinMaxScaler from rdkit import Chem import networkx as nx def plot_prediction(x_pred: torch.Tensor, y_pred: torch...
d5ceab4aceaf1aa3c19f04ac84c4ddb4fe936db9d5fc50295b9c996465817ade
Python
4,490
126
import os import pytest from mirp._images.pet_image import PETImage from mirp._masks.base_mask import BaseMask from mirp.extract_features_and_images import extract_features_and_images, extract_images CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) def test_basic_pet_feature_extraction(): data = extrac...
541f02dbd48fd4eced221ad305f189b41fd1e4f12ceb84ede182618ebbfd58d6
Python
4,491
94
from __future__ import division import tensorflow as tf tf.compat.v1.disable_eager_execution() class LossFunction(object): """ Set the loss function for the :class:`~psychrnn.backend.rnn.RNN` model. Arguments: params(dict): Dictionary of parameters including the following keys: :Diction...
8af5939d6dd71c45ab5989277fd83e4ee5c55647a634ca34a2a76cfbf8548cea
Python
4,491
155
""" > :warning: **DEPRECATED**: This will be removed in version 1.0.0. Check [nwbmatic](https://github.com/pynapple-org/nwbmatic) or [neuroconv](https://github.com/catalystneuro/neuroconv) instead. Class and functions for loading data processed with Phy2 @author: Sara Mahallati, Guillaume Viejo """ import importlib ...
509058ec5e2ea031ae0d524ad1c5b5260f17c11cac402e5d3a60d796caa1cf8b
Python
4,492
177
#!/usr/bin/env python3 """ Generate a closed triangulated cuboid surface mesh in OFF format. Last updated: 09.04.2026 Author: Laura Keto Description ----------- This script generates a watertight triangulated surface mesh for a cuboid aligned with the coordinate axes and writes the result in OFF format. The cuboid i...
af97125720cb27cd22af71dcbbd460930f7885ef5855131893b220d8d9cbd38e
Python
4,492
124
import pandas as pd import gzip import matplotlib.pyplot as plt import numpy as np import pandas as pd from Bio import SeqIO def match_rna2protein_ID(prefix): mRNA = set() cds = {} protein2rna = {} with gzip.open(prefix+"feature_table.txt.gz",'rt') as inFile: lines = inFile.readlines() ...
df33fca6086cca695ae3a96fe649c1a07d4cafadb42759be3a75ab4414084141
Python
4,492
103
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> import numpy as np from numpy.testing import assert_array_equal import pytest from eelbrain import Factor, datasets, epoch_impulse_predictor from eelbrain._trf.shared import DeconvolutionData def test_deconvolution_data_continuous(): ds = datasets._get_con...
e27813c14e99f7c3c7e6a3d3e712d87eaa7cfc8b9420fd65ddd6795ddaea4df6
Python
4,492
121
from typing import Any, Dict, Optional, Tuple, Union import numpy as np from pyvista import DataSet, PolyData, UnstructuredGrid from sklearn.neighbors import KernelDensity from spateo.logging import logger_manager as lm from spateo.tdr.models import add_model_labels def model_morphology( model: Union[PolyData, ...
003d3960ffa854e94f382e8d3d70c0ed48864f38217cf80648f34e74b3d7de22
Python
4,493
144
import numpy as np import tensorflow as tf import random as python_random import os import tensorflow_datasets as tfds from tensorflow.keras.models import load_model from gradient_accumulator.GAModelWrapper import GAModelWrapper from gradient_accumulator.GAModelWrapperV2 import GAModelWrapperV2 from tensorflow.keras im...
0ec25da1f9b0f3b1b1c56e535aa264fde674337cacb76dadb2a9a51fa57c024c
Python
4,493
86
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
55e0be2a9f9f797e1e5bc08f69f0049d564550696b2af82a6c254e9c21604d28
Python
4,493
127
from ._RL_agent import * from numba import njit @njit def latent_state_session_value(choices, second_steps, outcomes, n_trials, transition_type, params): # Unpack parameters. p_r, weight_inf = params[:2] good_prob = 0.8 V_s = np.zeros((n_trials, 2)) # Second step TD values. p_o_1 = np.array([[good_prob, ...
afd370d98d9384738fb7ec7ad7a376d9c03d9d2e293a02a0dcdd19cb6428ebe3
Python
4,493
115
""" help function for experiment. """ import time import subprocess from argparse import ArgumentParser VIDEO_LENGTH = ['1'] VIDEO_FRAME = ['8'] MAIN_FILE_PATH = '/workspace/Walk_Video_PyTorch/project/main.py' def get_parameters(): ''' The parameters for the model training, can be called out via the --h me...
d763e69d5a6e12582c86f5a0ea11538d889528c46ac2d1b7272b07f3c7098c38
Python
4,494
139
""" Plot best-fitting model orders for behavioral history bias """ import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import pylab as pl import seaborn as sns matplotlib.rcParams["pdf.fonttype"] = 42 sns.set( style="ticks", font="Helvetica", font_scale=1, rc={ ...
9d9a7c66b3e6abfe7bdb33e46ade2379489582691886c1f05127ce5dbaec0a04
Python
4,495
106
import torch import numpy as np import os from lammps_REANN.density import * from src.MODEL import * class PES(torch.nn.Module): def __init__(self,nlinked=1): super(PES, self).__init__() #========================set the global variable for using the exec================= global nblock, nl, ...
e7d8eb9f5ac66d859cef53298c3a255ae5852d0145057b1a63a5fdd1ea8f2274
Python
4,495
153
from __future__ import print_function from __future__ import division import os import mxnet as mx import numpy as np import gluoncv as gcv from gluoncv import data from .tiny_datasets import COCODetectionTiny, COCOInstanceTiny, VOCDetectionTiny, VOCSegmentationTiny import os.path as osp import unittest def test_pa...
0fad8592f917a26a67c7d1044e5c9d7aeeefb96bc1b6a06c2ce1c39e85eb72c1
Python
4,496
141
from typing import Tuple import numpy as np from CEST.src import matlab_style_functions # Water saturation shift referencing class WASSR: # Initialize the class with the maximum shift, ppm range, and initial values for the offset map and mask def __init__(self, max_offset: float, ppm: float): self.m...
190290dcf0e2ac40ef3d722a8a763b1e37d7bc968a08c5b43bb80f7c556fcbca
Python
4,496
116
import pandas as pd import numpy as np import random from collections import defaultdict from scipy.stats import spearmanr from scipy.cluster import hierarchy from sklearn.base import BaseEstimator, TransformerMixin from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler, RobustScaler fro...
9617bd94d9a3c39c8a4935f58f0af0c69fbd173994b9366d1481ccd81253fe27
Python
4,496
113
"""Episode join honesty surfaces (lane F40c): per-artifact claims only. The F40a claim-off switch flips WITH the measurement behind it, and every surface keys on THIS artifact's envelope: an absent envelope reads unmeasured, a measured break renders its break fact, and the build-level token never upgrades an artifact'...
a26e0c66725e9cbd829dba53f1635053db3751c5170e038f3cb10d534d9e532b
Python
4,496
129
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
bd95d169d822eb483b4850fa83ffd0c8dccd0e05832fd85a98d56a1cbe00f5d4
Python
4,496
118
# ------------------- # take an input file of (TCR, HLA) pairs and make prediction # ------------------- import os import sys import pandas as pd import numpy as np import tensorflow as tf import pkg_resources #from importlib import resources import argparse from DePTH import _utils def predict(test_file, hla_cl...
bf7b01bb8ca688bf14c0baea6550e8df879e1e4bfc8f67be2e1389c73ada5862
Python
4,496
138
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: pramod """ import sys import argparse import torch from torch import nn import numpy as np import pandas as pd import sklearn.metrics as skm from sklearn import preprocessing from torch.utils.data import TensorDataset, DataLoader from DeepGamiModel import Dee...
f872a865b5a7f45f86a1888ab630a5a45d905f9a2cafeb612d1f932b7a2d04c9
Python
4,496
152
# von Facbook Code übernommen # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import random from logging import getLogger import numpy as np from skimage.util import r...
43ece34469fb6757d229dad3197e53e567940912adb9daa48794f1137a3d002a
Python
4,497
103
import os import sys import click from src.utils import load_classes, sample_grid import src.phenexplain as phenexplain @click.command() @click.option('-m', '--method', default='3', show_default=True, type=click.Choice(['1', '2', '3']), help="Method for the interpolation. See paper for the...
5b03e0142da6a802ba0ed630aca5227ef5a8867e73a7956a66b83340574e7feb
Python
4,497
107
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # ------------------------------------------------------------------------------ import torch import torch.nn as nn from voxelpose_lib.core.pro...
88e064b560c1686ce5ff86c4cb41d3b5c1c3bf246fdb23bcc2b0094b836bbacd
Python
4,497
150
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
b6c22dd0278760b224ef8c4887f2c0a99570ff6be9d2baf2589943c61d8aee7c
Python
4,497
134
import os import numpy as np import pickle as pkl import nibabel as nib from os.path import join as pjoin from scipy.spatial.distance import cdist from magicbox.io.io import CiftiReader from cxy_visual_dev.lib.predefine import proj_dir, Atlas,\ get_rois, LR_count_32k anal_dir = pjoin(proj_dir, 'analysis') work_dir...
154045d224a9bd8be16c01a6c539e514ec4e025681766a8bff89612417a49fef
Python
4,498
94
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
e98b6230cf0320543978481e70f9beb84ef25f6763cc7a80d67f663292a161c7
Python
4,498
142
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): _parent_path_str = "splom.unselected" _p...
062e1ac7b69b9f99939db1197f25e7aea8ee8eba746f0d323363539d9c337cdc
Python
4,499
97
""" The learning rate scheduler. This implementation is adapted from https://github.com/chemprop/chemprop/blob/master/chemprop/nn_utils.py """ from typing import List, Union import numpy as np from torch.optim.lr_scheduler import _LRScheduler class NoamLR(_LRScheduler): """ Noam learning rate scheduler with ...
2c30ef1633f3af967a34e14a498a97459cf852071d0a3e707b0404dd7eb56c0d
Python
4,499
97
import sys sys.path.append('..') from src.utils import set_random_seed import argparse import torch from torch.utils.data import DataLoader from torch.optim import Adam from torch.nn import MSELoss, BCEWithLogitsLoss, CrossEntropyLoss from torch.utils.tensorboard import SummaryWriter from torch.utils.data.distributed ...
c7412520921ce7a28b77ce8ec2e84ddd5006b8b8095891ba9a8ca9442c696b43
Python
4,499
126
import os import torch from rdkit import Chem from tqdm import tqdm import seaborn as sns; sns.set(color_codes=True) import sys sys.setrecursionlimit(50000) import pickle torch.nn.Module.dump_patches = True import pandas as pd #then import my own modules from AttentiveFP import save_smiles_dicts, get_s...
ea20d69e32183ee3b43e1cb145e2f3b9cac8903bf77d867e0c1c8f0e9285e3eb
Python
4,500
158
#!/usr/bin/env python # encoding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import os, sys, re import logging import argparse import collections import numpy import time import TNode logger = logging.getLogger(__name__) class TGraph: ...
29417c02ae416ae78d4b5bdbbd9e84874aacb46a1cec2ff1751f735386934fe5
Python
4,501
95
#!/usr/bin/env python # Takes a .xml formatted blast results file as input and prints the query and hit ids # for sequences passing the thresholds passed via the command line arguments. For sequences # with no hits below the thresholds, the program returns "no hits below threshold" rather # than the hit id. import ge...
54709037b9bf66c5b0c7276735837ae4f87b0de1388f5c03613e8b1398140228
Python
4,501
126
#!/usr/bin/python import itertools import time import eego_sdk ############################################################################### def amplifier_to_id(amplifier): return '{}-{:06d}-{}'.format(amplifier.getType(), amplifier.getFirmwareVersion(), amplifier.getSerialNumber()) ##############################...
79c53ba2a09beba38667320433d30ff1c0171dc4651a912e2cb118c068e888c0
Python
4,501
121
import unittest from numpy import hstack, max, abs, ones, zeros, sum, sqrt from cantera import Solution, one_atm, gas_constant import numpy as np from spitfire import ChemicalMechanismSpec from os.path import join, abspath from subprocess import getoutput test_mech_directory = abspath(join('tests', 'test_mechanisms', ...
9f0155096dab5cf6311d30c7bcc1af6a3f18f945501482cd1d20359020c37233
Python
4,501
106
import torch import numpy as np import os from lammps.density import * from src.MODEL import * class PES(torch.nn.Module): def __init__(self,nlinked=1): super(PES, self).__init__() #========================set the global variable for using the exec================= global nblock, nl, dropou...
d9d528e20ac9ad456c947f4ce38e4eb281b79c508c8ef85e34218a9a110b1b11
Python
4,501
172
"""Smoke tests for receptive-field public data types.""" from __future__ import annotations from dataclasses import FrozenInstanceError from fractions import Fraction import pytest from torchlens.receptive_field import ( GridLayout, ReceptiveField, ReceptiveFieldAlignment, ReceptiveFieldAxis, Re...
d9085161edef23a274512af1a538c8d0cfb5896595d519e5c1eafa3fbda93f3d
Python
4,503
142
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): _parent_path_str = "violin.unselected" _...
2ad138ebe56747c037a909c10efb23bc54dbe94d2c83b9d1180a8d63c2dfda18
Python
4,504
116
"""r55 corr_1: an UNDRAWN ``random.SystemRandom`` must not ceiling a capture. ``random.SystemRandom`` is a ``random.Random`` subclass whose ``getstate()`` raises ``NotImplementedError`` BY DESIGN (stateless OS-entropy engine). The r53 inventory digested every ``random.Random`` and routed that exception through the gen...
bcd18e4a1722d907c73f76229f27c15bddf7adb9e55b7f8875e6f981f681c4fe
Python
4,504
112
import sys sys.path.append("../") import scipy import numpy as np import os from os.path import dirname, join import random import h5py import tensorflow import matplotlib.pyplot as plt from matplotlib import cm import nibabel as nib from tensorflow.keras.preprocessing.image import ImageDataGenerator import cv2 import ...
b1d1dd2f3a73ada7484c90c5ea3b37cf033679d0e17839318ac8ca7989cea0d2
Python
4,505
104
"""SQLAlchemy models for telemetry data in the CarbonServer API.""" import uuid from sqlalchemy import JSON, Boolean, Column, DateTime, Float, Integer, String from sqlalchemy.dialects.postgresql import UUID from carbonserver.database.database import Base class Telemetry(Base): __tablename__ = "telemetry" ...
989d3c297439fdf66976af520b0121b45f41d8206d9798639236cf6b88abe3c6
Python
4,506
139
#!/usr/bin/env python3 import os f_1 = open("Candidate_probes_annotated.txt", "r", encoding = "utf-8") f_2 = open("isoform_candidate.txt", "r", encoding = "utf-8") o_1 = open("tmp.txt", "w", encoding = "utf-8") i = 0 meth_list = [] meth_index_dict = {} for file_1 in f_1: line_1 = file_1.strip().split('\t') ...
14ecd4e58b068a4c559997de99e7a9f90932ca65599f1d15d9b11bcb2eb6aaad
Python
4,508
124
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
157c5ae8802e506722a25bfa457c9ef0b69999239880a94786b2915e2b57743f
Python
4,508
127
"""RDM widening, rdm_compare, and CKA placement oracles (F20 D-5/D-6/D-25). D-5: the existing ``rdm`` name widens with keyword-only options; the no-new-keyword call stays bit-identical. D-6: ``rdm_compare`` is the descriptive rank correlation over aligned upper triangles, diagonal excluded, with the silent hand-rolled...
33c2694fcb086cb4c7838223085419812beb953ffe04638fca60257c3377931d
Python
4,508
143
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class X(_BaseTraceHierarchyType): _parent_path_str = "isosurface.slices" _path_...
444de5fdd616daa3eaf0beafc6e432fa8a6e04952c49ed37d5eb9a9f4ef0fca3
Python
4,508
81
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
727c19df501b0eab3b7e76e1de1ae8b9d203b4868a35422c0387704a7d3dd3bb
Python
4,508
143
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Y(_BaseTraceHierarchyType): _parent_path_str = "isosurface.slices" _path_...
cdf02b89d00b8fa0b8d1dd6e947fdecf43a49e5525327ece6776fabd31774374
Python
4,508
143
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Z(_BaseTraceHierarchyType): _parent_path_str = "isosurface.slices" _path_...
fdee0b2d14f6b05c4d15ac1398986854ee84308b01d1fd7ada6125e7622fd345
Python
4,508
142
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): _parent_path_str = "scatter.unselected" ...
a0c34e7b1f61d8555e883e85f5cf96142887911a4212f596b2d50de47c17f841
Python
4,509
144
""" This module the language modeling dataset """ import logging import torch import numpy as np from datasets_pre_processing.generic_dataset import GenericDataset class LanguageModelingDatasetWeightMask(GenericDataset): """ class that define language modeling dataset """ def __init__( self, ...
a9c4c0901c967d76f96c92608031893ed65a8016664af5387b78f747bf3846cc
Python
4,509
123
from urllib.request import urlopen import torch from torch import nn import numpy as np from skimage.morphology import label import os from Phys_Seg.paths import folder_with_parameter_files def get_params_fname(sequence, physics_flag): if physics_flag: model_name = f"{sequence}_phys_NSS.pth" else: ...
2eccc70a7d9ea1e409e5e356ce07ab2f40ec83ea177534c74ee95774be684095
Python
4,510
116
from sklearn.preprocessing import MultiLabelBinarizer from sklearn.metrics import precision_score, recall_score, f1_score import numpy as np import torch import pandas as pd from tqdm import tqdm import sys sys.path.append("models_architectures/") #from models_architectures.ensembling_model import EnsemblingModel de...
7a6e56ef79be0e37b75f5977bca6afa64162d5855e5fa0e58f9ad98b3f246d80
Python
4,510
136
import threading from contextlib import contextmanager from unittest.mock import patch import pytest import celery.contrib.testing.worker as contrib_embed_worker from celery.app import backends from celery.backends.cache import CacheBackend from celery.exceptions import ImproperlyConfigured from celery.utils.nodename...
741a3155b09b2c8c77c3fc3bcc81c72059fd53abab8494a81a204f389c09631f
Python
4,511
72
"""General-purpose training script for image-to-image translation. This script works for various models (with option '--model': e.g., pix2pix, cyclegan, colorization) and different datasets (with option '--dataset_mode': e.g., aligned, unaligned, single, colorization). You need to specify the dataset ('--dataroot'), e...
ec8aac21c0634b2150602b64f99c51bf01b3154ab6c21a4d1f1a2c0c13d513ee
Python
4,511
134
"""r-b4 R27-4: model-OUTPUT container walkers are depth-bounded and cycle-guarded. A 3000-deep or self-referential forward output used to die mid-capture in a raw ``RecursionError`` (probe: 994 torchlens frames) from the unguarded output walkers (``_build_container_spec``, ``_walk_tensor_occurrences``, ``_walk_support...
dd913c630ad164daa968d3c418b6e15069252d1cf4e6e4283e85408aa1c71940
Python
4,512
109
import sys import os import pandas as pd import numpy as np from nilearn import image from nilearn.masking import apply_mask # input/output paths fmri_prep = sys.argv[1] ROIs_dir = sys.argv[2] first_input = sys.argv[3] # contrast files location roi_out = sys.argv[4] # fixed effect output location # List of Subjects ...
2f617bd7fef8012fbbbb951004de397a40b0106a2ab3af28de0bc14645b255d1
Python
4,513
116
import numpy as np import math import pdb import re # ------------------------------------------------------ # Neuronstudio check def neuronstudio_check(swc_matrix): # for i in commentline_numbers: # reurn_value = Lines[i].lower().find("neuronstudio") # if(return_value!=-1): # bifurc_c...
d341b4aafbd0d2a28b1f2c1047b4fe9ec29b6a91c9f53f1b0bc6c312cd88634b
Python
4,513
127
from __future__ import annotations import logging import socket import time import uuid from collections.abc import Iterable from typing import Any, Optional import bream4 import ont_certifi import requests from bream4.device_interfaces.devices.base_device import BaseDeviceInterface from bream4.toolkit.pings.ping_dum...
8fe2b818386cb38a187024cc7df006833675acb08dcf10621a723bfa1c550fb0
Python
4,515
122
import unittest from numpy import hstack, max, abs, sqrt from cantera import Solution, gas_constant import numpy as np from spitfire import ChemicalMechanismSpec from os.path import join, abspath from subprocess import getoutput test_mech_directory = abspath(join('tests', 'test_mechanisms', 'old_xmls')) mechs = [x.rep...
c2ae906a376e5f366201836fd2dc5fc16ae200540efb245d03cd873cc0f20221
Python
4,515
139
"""Written by @Jinerhal, adapted by @Xiaojieqiu. """ from typing import List, Optional, Tuple, Union import cv2 import numpy as np from anndata import AnnData from ..configuration import SKM from ..logging import logger_manager as lm from .contour import * from .utils_old import * def identify_boundary( adata:...
02d99004dc8fb799b466c8957479955c75953bdb9d869b723b243e40f570ad49
Python
4,516
104
""" These variables are reused across various plots for the Feather et al. 2023 Metamers paper. """ import numpy as np ## Audio model info audio_models_to_plot = ["kell2018","cochresnet50", "cochresnet50_l2_1_robust_waveform", "cochresnet50_l2_p5_robust_waveform", "cochresnet50_linf_p002_robust_...
8e6ca85b1b6052120c0d6267caa823e3c2d3403c1f0e7a027a1a18cb4cd90b9e
Python
4,516
129
from minknow_api.acquisition_service import MuxScanMetadata from bream4.device_interfaces.devices.base_device import BaseDeviceInterface COLOURS = { "single_pore": "00CC00", "reserved_pore": "EDE797", "multiple": "F57E20", "saturated": "333333", "other": "0084A9", "zero": "90C6E7", "unavai...
13a8e31e8ab2c208a92430824d28c9dbe4bd5ce235dcd89c5a274ee0f98ef1e2
Python
4,517
116
import spikeinterface.full as si import numpy as np from pathlib import Path from spikeinterface.preprocessing import highpass_spatial_filter from spikeinterface.sortingcomponents.motion_interpolation import interpolate_motion from spikeinterface.preprocessing.motion import load_motion_info from spikeinterface.preproce...
149b8cda7fcbbc2afd325ed237373034c77b920c27d85af569f7f5389be9a593
Python
4,517
135
from pathlib import Path, PosixPath import dill import json import scipy.sparse import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import FunctionTransformer from sklearn.pipeline import Pipeline from omop_learn.sparse.data import OMOPDatasetWindowed def _sparse_ufunc(...
665b6b4a21a19670f0468fd3cd93f98d9d9eab6b1e6893d2b791336b2072c2ff
Python
4,517
86
from pycobi import ODESystem import numpy as np import matplotlib.pyplot as plt from pyrates import CircuitTemplate # initialize mean-field model ik_mf = CircuitTemplate.from_yaml("ik/ik_mf") # define the model parameters var_values = {"C": 100.0, "k": 0.7, "v_r": -60.0, "v_t": -40.0, "b": -2.0, "g": 15.0, "tau_u": 3...
bcf93e92fc72ab9e909de5cf46d69a164120f007433d67a6708cb32dd9b1e0b6
Python
4,517
90
import argparse import os import random import time class Option(object): def __init__(self, d): self.__dict__ = d parser = argparse.ArgumentParser() parser.add_argument('--parser_name', type=str, default="dti") parser.add_argument('--cuda', type=bool, default=True) parser.add_argument('--model', type=st...
cf32b15d80c414ac7738757e73cf84b6c9e2f1d92cf23a8576d7d79f4962cade
Python
4,517
117
""" Normalization layers and wrappers Norm layer definitions that support fast norm and consistent channel arg order (always first arg). Hacked together by / Copyright 2022 Ross Wightman """ import torch import torch.nn as nn import torch.nn.functional as F from .fast_norm import is_fast_norm, fast_group_norm, fast...
0428161f2f4dc181a788d157169932b1ef5f224383bdf65001cf69c370dc1c1c
Python
4,518
144
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # ------------------------------------------------------------------------------ import torch.nn as nn import torch.nn.functional as F class B...
2d83f3e0058a6df02006546d62af942fd78717a78f98ff95728e61a41bf12f0c
Python
4,518
121
# pylint: disable=arguments-differ """Matchers for target assignment. Matchers are commonly used in object-detection for anchor-groundtruth matching. The matching process is a prerequisite to training target assignment. Matching is usually not required during testing. """ from __future__ import absolute_import from mxn...
2ee98f24448cccb1831515ed80bbea8676cb789c1e399d2e824894c9f2424288
Python
4,518
85
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
8555f4fcda1514b1d70372364a97caadcefbba142b9af8216ded25db6c797113
Python
4,518
142
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): _parent_path_str = "scattergl.unselected" ...
ddcdac0b66ef3be95ab40acb1b986ceb8316b4403ef3f1cd9fbadd44b6639650
Python
4,518
94
import os import pandas as pd from utils import parse_config, build_EDA_file_list if __name__ == "__main__": args, unknown_args = parse_config() test_file = os.path.join(args.data_dir,args.test_prefix+'.csv') train_file = os.path.join(args.data_dir,args.train_prefix+'.csv') val_file = os.path.joi...
7967131a52a4763dd2f200fbd5a7ac5553bd7d873d2ef8aa74a5f5308963bdc4
Python
4,519
79
"""Utils for auto YOLO estimator""" import os from mxnet import gluon from ....data import MixupDetection from ....data.batchify import Tuple, Stack, Pad from ....data.dataloader import RandomTransformDataLoader from ....data.transforms.presets.yolo import YOLO3DefaultTrainTransform from ....data.transforms.presets.y...
7a5003ea39d639ffae5dc2caf9b53dd6db1ee172cc7a5006a0fc4646411305e5
Python
4,519
138
"""auditory tone detection task.""" import numpy as np from neurogym.core import TrialEnv from neurogym.utils import spaces class ToneDetection(TrialEnv): """A subject is asked to report whether a pure tone is embeddied within a background noise. If yes, should indicate the position of the tone. The tone l...
ddf0c3c6327e2afe486e64687eb6d9cef7eb32a9ca9445354573354016321d3d
Python
4,519
123
import numpy as np from numpy import array import random import copy from gym import spaces class IntervalDiscrimination(object): ''' Interval discrimination, head-fixed agent. After an initiation cue, the agent pokes to initiate the task. Then two stimulus are shown sequentially, seperated by a delay per...
707deef4d0e9710410ca1857f5b331cef9a99d5e7bf96194f35a9781a14fc9b1
Python
4,520
108
# Copyright (c) 2025, Johnsonms. # We recommend locking GPU clocks before running the benchmark to ensure consistent results. # This can be done using the following commands (2619 MHz is the max clock for B200): # sudo nvidia-smi -i 0 -pm 1 # sudo nvidia-smi -i 0 --lock-gpu-clocks 2619,2619 # See more here: https://gi...
3cbdcd27e90f4c2e38c29f7bd867976c0a41015988d4c0afaffba80178cfdfa3
Python
4,521
85
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
aecca0c4abe5bdbd4c159e5c373ca9666c77229d2ca2e42337db541c517ddcc7
Python
4,521
116
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> import numpy as np from numpy.testing import assert_equal, assert_array_equal import pytest from eelbrain import datasets, Celltable, testnd from eelbrain._stats import t_contrast from eelbrain._stats.stats import t_1samp from eelbrain._stats.t_contrast import T...
18b414720146de28f9e2e5cdb509f4f808bb530bec6866e9347cee36c98aa22e
Python
4,523
143
import numpy as np by_strand = { "+": [ (b"N", b"\x00"), (b"A", b"\x01"), (b"C", b"\x02"), (b"G", b"\x03"), (b"T", b"\x04"), ], "-": { (b"N", b"\x00"), (b"T", b"\x01"), (b"G", b"\x02"), (b"C", b"\x03"), (b"A", b"\x04"), }, ...
7181211cddd7f5b82ead38c0cf30d118f24c33aee4b221f2af6c7e68629244d0
Python
4,523
142
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): _parent_path_str = "scattermap.unselected" ...
c62aaa1a9a5e4b44fa12dc2cd9207e8d32711eeeca7058b79487532b1848bf23
Python
4,523
142
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): _parent_path_str = "scattergeo.unselected" ...
e0b34ec163b98129a1c35b38717d5c93fd17ec68b541eee27d9f26ad497cacaa
Python
4,523
93
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
f4be9ba32329036649d4169cb5443cc955faa5444de7149dc9379703836e2e20
Python
4,524
123
# Given a list of MsCAVIAR files for a locus, reconcile them so that they # contain the same set of SNPs import argparse import subprocess import sys def reconcile_parseargs(): # handle user arguments parser = argparse.ArgumentParser(description="Given a list of MsCAVIAR " + " LD files for a locus, take out th...
68818c2c02cafddf2ab3f972cbc4bbe780587bca16cc1b44aae9173377535098
Python
4,526
150
"""3. Estimate pose from your webcam ==================================== This article will demonstrate how to estimate people's pose from your webcam video stream. First, import the necessary modules. .. code-block:: python from __future__ import division import argparse, time, logging, os, math, tqdm, cv...
81f75fd75da9e87cfdf91c0074c9d0ecd151a814282d7482c487f2ce77f7296e
Python
4,526
141
import numpy as np import os from custom_data_gen import DataGenerator from openpyxl import Workbook import json from matplotlib import pyplot as plt import tensorflow as tf from data_processing.genSplits import create_partitions keras = tf.keras from keras.layers import * from keras.callbacks import EarlyStopping, Mod...
d03b29b9dda0839bab2f4eb6591702b7d6c0b220b1bc2bb31765cf21d2fb2de8
Python
4,526
97
import pandas as pd import os import numpy as np import os import shutil AGE_FROM = 3 AGE_TO = 35+1 path = "/Volumes/kannlab_sfa$/Anna/TM_segmentation/data/pseudolabels_mris" def find_file_in_path(name, path): result = [] result = list(filter(lambda x:name in x, path)) if len(result) != 0: return ...
6dfbc924a0717ef47ef4b3bc6e6f9053b626c06d3e32fa967896fdc09b142791
Python
4,527
250
#!/usr/bin/env python '''Generate models for affinity predictions''' # variables: # kernel size: 3, 5, 7 # depth: 2, 3, 4 # width: 16, 32, 64, 128 # doubling of width: true/false (e.g, 128->256->512) modelstart = '''layer { name: "data" type: "MolGridData" top: "data" top: "label" top: "affinity" includ...
46dfbf1aee6f7b85353b9223b379841be4bbb512c0c638c604aa4acc3ea51b5a
Python
4,528
81
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
d5401fcfac4a78580cce4f5a6e669c42c8c14570767edad1f98a5e70a90aae88
Python
4,528
93
import sys import os # setting path sys.path.append('../TM2_segmentation') import numpy as np import pandas as pd import nibabel as nib from skimage.transform import resize, rescale from scipy.ndimage import zoom from settings import target_size_unet, scaling_factor import matplotlib.pyplot as plt from scripts.prep...
75658d710a92ae316885ce030da3719c3abae1ec61b4f570c04d2ba722a0007b
Python
4,529
114
"""Grouped backward attribution floor pins (L9 memo 1.1). Read-only per-site rollups over BACKWARD records keyed on the merged L1 site_key surface: per-site GradFn/GradFnCall aggregation (fire counts, per-fire timing once memo 1.3 evidence exists, pass coverage). Accessor-level only -- no persisted fields, no writes t...
781d7370f89cabddcd6df83c501e1d0833f3f599eefa939d4ce8a7a85f98a617
Python
4,529
137
import csv from collections import OrderedDict import matplotlib.pyplot as plt import numpy as np import torch import os class RunningMean: def __init__(self): self.mean = 0.0 self.n = 0 def __iadd__(self, value): self.mean = (float(value) + self.mean * self.n)/(self.n + 1) se...
27d412cb659df84472f7eeb7828ca44a7ea4f910d097e8dae3d72bd609793f8d
Python
4,530
99
import glob import h5py import numpy as np import os import pandas as pd from sklearn.linear_model import RidgeCV from sklearn.model_selection import GroupKFold from sklearn.linear_model import LinearRegression from sklearn import preprocessing import sys from scipy.stats import pearsonr """ This script will run ridge...
293171b3e4470009ba6247ca982fef4d0bfd5a0c53a606469373c30966d655b1
Python
4,530
161
import numpy as np import pandas as pd import networkx as nx from .global_level import global_level from .local_level import local_level from .utils import lambda_dist, resistance_distance from tqdm import tqdm def weight_optimizing_global( adata, use_label=None, list_clusters=None, step=0.01, k=1...
7f62d06d8b3e75d5b6a9d570b9e5bd87fe80dd9e938375ddcba7d86baa7a4a71
Python
4,530
133
"""CodeCarbon CLI - Monitor Command""" import os import subprocess import sys from typing import Optional import typer from rich import print from typing_extensions import Annotated def run_and_monitor( ctx: typer.Context, log_level: Annotated[ Optional[str], typer.Option(help="Log level (cr...
8f5d5a3822758688908348bcbea0bf70ec105d349f4b8ce6e111a273a0ab736f
Python
4,531
122
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Test classes in the ``tfep.app.cartesianmaf.py`` module. """ # ===============================================...