sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f6dfb8c31348d0bc6350672135eca7ac4a560ea5297993f91f61cb838a77e9f8
Python
8,472
203
#! /usr/bin/env python3 """Smoke-test a pose-estimation environment/image end to end. Runs the mmpose top-down demo on a fixed input image and compares the rendered result to a known-good target image, passing/failing accordingly. On success the rendered output image is deleted; on failure it is left for inspection. ...
b84b33df89550996d2f44874af52ca67e72f757a25f34a0335d174b86d731f03
Python
8,474
278
# 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...
d7b266080cfa7e0feaecfe6bfef6fb762d3a4a6a55510703fd88b249fc3e8fb9
Python
8,477
175
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 r...
155fb5f650d4691e38a0ddbb82d362ee757d9d046ede22e002a52bacfc2ecbff
Python
8,478
211
# -*- coding: utf-8 -*- """ Created on Tue Nov 10 14:17:59 2020 @author: asong """ from layers.DiffractiveLayer import Diffractive # from layers.DiffractiveLayer import Diffractive , DiffractiveLayer from layers.MaskLayer import PhasePlate, OpticalElement, AmpPlate, SuperPlate #, PhasePlateScaled # from layer...
4d3f2c6fd3d39ec9ca861ac6b8790b3748dd37476d2a1b4f904afd0a27436cf3
Python
8,478
274
import colorsys import io from time import process_time from pip._vendor.rich import box from pip._vendor.rich.color import Color from pip._vendor.rich.console import Console, ConsoleOptions, Group, RenderableType, RenderResult from pip._vendor.rich.markdown import Markdown from pip._vendor.rich.measure import Measure...
92a7f3e145c88cf1b73f047717b2cb4ce51b4236d3b604d80f4ae88edd2723ea
Python
8,480
268
# IMPORTS import os from argparse import ArgumentParser import pytorch_lightning as pl import torch import collections.abc as container_abcs from pl_bolts import _HTTPS_AWS_HUB from pl_bolts.models.autoencoders.components import (resnet18_decoder, resnet18_encoder, ...
e5733c961aaf21616b3550ca03b59614d5e5c727c021fad4f5db3a428b3680a4
Python
8,481
295
import numpy as np import scipy.special as sp from .from_gpaw.spherical_harmonics import Y ''' Real spherical harmonics follow the definition: https://en.wikipedia.org/wiki/Table_of_spherical_harmonics#Real_spherical_harmonics Work functions for generating spherical harmonics are adapted from GPAW ''' def sp...
b8593d5850979e07a06201466ce1e172263f066dfa7d9db6a97d8144ca1143ca
Python
8,482
241
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import pathlib import string import torch from esm import Alphabet, FastaBatchedDataset, ProteinBertModel, pretrained, MSATr...
2a3325c8315d80cbf68085978b929b13843f4172fe13553c4c5eb8c84b4a1fc2
Python
8,484
202
import os import argparse import lxml.etree as ET import numpy as np import carla from utils import ALL_TOWNS, \ parse_annotations_file, interpolate_trajectory, scan_route_for_scenarios ID_START = 0 PRECISION = 2 SAMPLING_DISTANCE = 30 def main(args): scenarios_list = parse_annotations_file(args.sc...
030f33350ef2bc7683a4556d232640b8e8584c8c620c41a64540c670c93b9d55
Python
8,486
230
# 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...
4bb1608914587d46f25985fa5849f67c366fae4b5fd0d46e3f354812c2537777
Python
8,488
221
""" Shared QMainWindow base class for all Xu Lab pipeline launcher GUIs. Eliminates ~120 lines of duplicated boilerplate per launcher by providing: - Window geometry, icon, and stylesheet setup - Standardized header/footer labels - QApplication bootstrap with font and taskbar icon """ import os import sys ...
fa5453b1ce6a8d3f179a123d0643f9332a012d6274bbd7a635af806344112782
Python
8,488
252
""" Script for segmenting the filaments in a tomogram without assuming any geometric constrain (old version because it does not use MCF classes) Input: - Original tomogram (density map) - Mask tomogram (0-fg, otherwise-bg) Output: - vtkPolyData with the filaments - Segmentati...
08ad4c6c35b7190983be2a4708c35eedc4a10fb64d065b6a76332af9147cb01b
Python
8,491
185
import pickle from neuron import h from abstract_circuit import AbstractCircuit, AbsCell, AbsSegment, AbsConnection import os import json import copy def load_json(file_name): with open(file_name, 'r+') as f: data_dic = json.load(f) return data_dic def pkl_new2old(config_file, src_file, dst_file): ...
d8c6903adb950e64ec1c68ddf1dd5c47d01ad4a658e3a2b54bdbcb58ab7ecef0
Python
8,491
241
# 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...
01008758de04abdc6ed8f808334ea891eca39dfe4b225948da2bf915c669cf56
Python
8,495
322
""" MatPES-compatible recipes !!! Important Make sure that you use the MatPES-compatible pseudpotential versions (i.e. v.64) """ from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING from monty.dev import requires from quacc import flow, job from quacc.ca...
4463198042aabd4f342c84012ad8dfcf856d781eda9526a3873ae4bedccb9c34
Python
8,498
232
import bpy import MDAnalysis as mda import numpy as np import pytest from databpy.object import LinkedObjectError import molecularnodes as mn from molecularnodes.entities.molecule import oxdna from .constants import data_dir pytestmark = pytest.mark.filterwarnings( "ignore:.*no reference attributes.*:UserWarning" ...
fba6f8da8ecd54d35f5b11f92c4906c03068ea1be641aecb3a6cd4373f8cb299
Python
8,498
211
import numpy as np import unittest import pyntbci FS = 120 N_TRIALS = 11 N_CHANNELS = 7 N_SAMPLES = 2 * FS N_CLASSES = 5 N_COMPONENTS = 3 class TestCCA(unittest.TestCase): def test_X2D_Y2D(self): X = np.random.rand(N_SAMPLES, N_CHANNELS) Y = np.random.rand(N_SAMPLES, N_CHANNELS - 1) cca...
8d55c0ff6e75d598977440dd3b20bbe48b0aef889bb15d3283d0cfd6125d4eeb
Python
8,501
214
from typing import Union, Dict import numpy as np from ..base_transform import EEGTransform import scipy from ...utils import LazyLoader class Downsample(EEGTransform): r''' Downsample the EEG signal to a specified number of data points. .. code-block:: python from torcheeg import transforms...
9608109a5325767d79a924849347042b727bae722d2bf55ddec251d94310f006
Python
8,502
249
# 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...
db06c2d8d5ef1039d8abf004028177dd6c01d4cb71ac12844fef94846d87986c
Python
8,503
279
# -*- coding: utf-8 -*- # # Test resampledata # # 3rd party imports import pytest import inspect import numpy as np import matplotlib.pyplot as ppl # Local imports import dask.distributed as dd from syncopy import resampledata, freqanalysis from syncopy import synthdata import syncopy.tests.helpers as helpers from s...
dc7b9c3279352e3f5322a7d0b6238a06d7357fbb5baa4376bb17d1c1f30b011d
Python
8,504
213
# try searchlight decoding to classify different task representations # based on https://nilearn.github.io/dev/auto_examples/02_decoding/plot_haxby_searchlight.html#sphx-glr-auto-examples-02-decoding-plot-haxby-searchlight-py import numpy as np import pandas as pd from nilearn import datasets from nilearn.image import...
a70d5ea4674c8f58431a20aed401eaab33847e35fc3157625bb3b50654fcf9e4
Python
8,505
225
######################## BEGIN LICENSE BLOCK ######################## # # Contributor(s): # Jason Zavaglia # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the ...
8fa3c73e611ad774f59c85c3eee2d516a2a9852cfaa010690f6d4c59aa6c8ee4
Python
8,507
194
import os import numpy as np from pandas import read_csv, DataFrame from pyrelimri.icc import sumsq_icc def triang_to_fullmat(corr_1darray, size: int): """ Convert a 1D array representing the lower triangular part of a correlation matrix (including diagonal) into a full NxN correlation matrix. Parame...
da6e7e05625849ac9737f3202c9b744342bf1b0502535852fdb3f3dfca52cf1f
Python
8,507
236
import os import sys import torch import numpy as np import cv2 import matplotlib.pyplot as plt from PIL import Image import re import csv # Set matplotlib backend import matplotlib matplotlib.use('TkAgg') # Use bfloat16 for the entire script torch.autocast(device_type="cuda", dtype=torch.bfloat16)._...
1089e54d89e1f6237efe74bd2e6bac5a35a19f964ebc7709c4d97d8641eb24f1
Python
8,509
289
import random import numpy as np import torch from wsilearn.utils.cool_utils import hwc_to_chw, is_iterable, set_seed class ImageRangeNormalizer(object): """ divides input by 255 if int """ def __call__(self, obj): if obj.dtype=='int': return obj/255 return obj class NumpyToTenso...
5ba13f38588c54a71aa326652612ec951ea71f483dac1638b02564f061f95e75
Python
8,510
299
# 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...
0d54fc3694fa49d31969236d4eed5c59b3fe11a2596489ea977ee5337b317ef2
Python
8,514
208
""" Clean close particles in a STAR file Input: - STAR file - Minimum scale Output: - A copy of input STAR file where some rows can be filtered """ __author__ = 'Antonio Martinez-Sanchez' ###### Global variables import numpy as np import pyseg as ps ####################################...
93b9f68b2d724d2c5f362ffd33e186e2985befdd3bc81395f96c02df13d2511c
Python
8,514
245
#!/usr/bin/env python # #===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------...
35540ed250d1e1db1bf8ee5ff27336ee62e5222189e4f90b8365d336200cc56c
Python
8,516
205
from collections import OrderedDict import csv from typing import List, Optional, Union import os import numpy as np from tqdm import tqdm from torch.utils.tensorboard import SummaryWriter from .predict import predict from chemprop.args import PredictArgs, TrainArgs from chemprop.data import get_data, get_data...
809b4d4e13509a5b034ad3100f4fccd6d7dd7d651b6f98c9be1cd9d74a3a5a82
Python
8,517
212
""" Generates subvolumes and a segmentation mask for lumminal and shell regions for every microtubule (the difference with previous versions is that this one allows the further direct particle reconstruction within pymtubes package) Input: - STAR file with the next columns: + CSV (fil...
b0f3d266ad9ca6ef3a93caf07e8f583dc26dba9061de261c9e705fecb3fe236e
Python
8,518
254
# -*- coding: utf-8 -*- import sys import numpy as np import pandas as pd from scipy import sparse def get_largest_component(func): """Decorator that extracts the largest connected component and ensures the adjacency matrix is symmetric and binary.""" def wrapper(*args, **kwargs): net, community...
aa1a941995134c7a8061adcd51af23622c39c1ac84e0e5602f52defc2bca3974
Python
8,520
257
# # 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,...
3d92d5e1e85ca3132e73ea82c483e279174c6276bac030905204b979eb373932
Python
8,521
199
from .utils import get_dataframe, get_classes_labels, train_test_split import random import imageio import numpy as np import albumentations as A import matplotlib.pyplot as plt from tensorflow.keras.utils import Sequence, to_categorical def train_augmentations(percent_resize=0.25): """ Train augmentations. ...
804427b92713bd852e63a0227ff4550309bdeeea03163961387e71eeebbca802
Python
8,521
131
# -*- coding: utf-8 -*- OPTIMAL = False CONFIGS = [ # add_lm_lazy_greedy (114, ["--evaluator", "hadd=add(transform=H_COST_TRANSFORM)", "--evaluator", "hlm=lmcount(lm_rhw(reasonable_orders=true),transform=adapt_costs(plusone))", "--search", "lazy_greedy([hadd,hlm],preferred=[hadd,hlm...
da5a1c917688829514e5fe0f13ee6e53934000d1a1cee90e48ca8d931842f4de
Python
8,524
217
from __future__ import print_function, division import numpy as np import time from collections import Counter from pybullet_tools.utils import elapsed_time from learn_tools.active_learner import ActiveLearner, format_x, THRESHOLD, tail_confidence from learn_tools.learner import rescale, DEFAULT_INTERVAL, TRANSFER_W...
57eac1c9558ba7f13790dc4045cd70a6f044d077628557d3b3a9ac10f0812180
Python
8,525
256
import torch.nn as nn import torch import math # from train_Customadc_noise import BITNUM ADCBITNUMBER=5 BITNUM_SIG=ADCBITNUMBER POINTNUMS=2**BITNUM_SIG print('adc bit number=',BITNUM_SIG) BITNUM_TANH=ADCBITNUMBER POINTNUMT=2**(BITNUM_TANH-1) noise_std=int(5) print('WEIGHT_NOISE',noise_std) def ramp_sigmoid_generati...
1b35dc44ef21fc1028c15b29dc9c1a595bd2529e9090747f9a423db9f06a1937
Python
8,526
209
import numpy as np from scipy.sparse import csr_matrix import networkx as nx from rdkit import Chem from collections import defaultdict # feature dim ATOM_DIM = 101 BOND_DIM = 11 FG_DIM = 73 FG_EDGE_DIM = ATOM_DIM ALLOWABLE_BOND_FEATURES = { 'bond_type': ['SINGLE', 'DOUBLE', 'TRIPLE', 'AROMATIC'], 'conjugate...
7606dc37b93720a0ecd6fd8a707dcc27f576ccf3c5ea1029ddf7dc19eb41bcc7
Python
8,527
308
# 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...
846a63c57cef0c5c3725d7036a50e278b8340c276f3eced8330f084438a88f22
Python
8,528
192
from Pose_mdn_joint import Pose_mdn_joint import tensorflow vv = [int(v) for v in tensorflow.__version__.split('.')] if (vv[0]==1 and vv[1]>12) or vv[0]==2: tf = tensorflow.compat.v1 else: tf = tensorflow import numpy as np class Pose_multi_mdn_joint(Pose_mdn_joint): def __init__(self,conf, name='deepnet...
0454615fbef3e991a265c15e8c556e8534d90226e6ca31c168fe05d211df6d7f
Python
8,531
210
import numpy as np from regtools.stitching.core.run_tissuecyte_stitching_classic import _visual_grid_cell from regtools.stitching.core.tissue_montage import ( SectionTissueMask, tile_mask, apply_masked_flatfield, TILE_SIZE, ) def test_visual_grid_cell_even_column_is_top_down(): # Even c...
680426f76eedaedba9b74d492510857c1f8237983675b7575192c50b981405c4
Python
8,532
257
#!/usr/bin/env python3 """ ------------------------------------------------------- getStimPoints.py Uses clean filter in vtk to extract x,y,z coordinates of points with a fixed inter-point distance. The points are used as stimulation ...
265355493b9c5b88bcb923bbd3daaa6f166bd355a7644deec90f3484171b6e9c
Python
8,534
224
""" Unified registration interface. Provides method-agnostic wrappers for running registration and applying transforms with either ANTs or Elastix backends. """ import os import gc from ..config import ( DEFAULT_REGISTRATION_METHOD, HAS_ANTS, C_WARN, C_RESET, ) from .ants import antsR...
a787494da0aa28034ad8170b3477c00253d28f6dac867e4a09c3caf8e50ba5e6
Python
8,539
229
# 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...
cdd8f0e8176ecf9c91196153b123ec35a5776e1d80fb2d8f69c79f79d04f9c6e
Python
8,539
190
import copy from monai.transforms import Transform, Compose import numpy as np import torch from torch.nn.functional import grid_sample from torch_geometric.data import Data from torch_geometric.transforms import FaceToEdge from gem_cnn.transform.gem_precomp import GemPrecomp from gem_cnn.transform.simple_geometry impo...
0b5964405cc4d9b5ef727dc266b0b2f4e5a22497acf115a2a616f5a7f2c128ab
Python
8,540
231
""" Created on Mon Dec 27 16:35:56 2021 @author: Haotian Teng """ import torch import torchaudio """ This script train a VQ-VAE style embedding network on Nanopore sequencing signal. @author: Haotian Teng """ import os import sys import torch import argparse import numpy as np from typing import Union,List from itert...
55dbc13af73ed34858329f32323992b881e1116702ab1b817f4c0a114336e163
Python
8,543
216
# -*- coding: utf-8 -*- import os from typing import Iterable, Union import torch from supar.config import Config from supar.models.dep.biaffine.parser import BiaffineDependencyParser from supar.models.dep.biaffine.transform import CoNLL from supar.models.dep.crf2o.model import CRF2oDependencyModel from supar.structs...
981c96978400a11b3bd0ea71560e78e86345c0936aa5ed6d77eefcffbf51e8ee
Python
8,543
228
import torch from torch import nn from torch.nn import functional as F from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule from elasticai.creator.nn.integer.math_operations.math_operations import MathOperations from elasticai.creator.nn.integer.pointconv1dbn.design import ( PointConv...
2aa63534b2ea247d5f05c5607732cf777e9aae15130becc5d64b564e6be90eb0
Python
8,544
259
# -*- coding: utf-8 -*- # # Syncopy PSTH frontend # import numpy as np from copy import deepcopy import logging import platform # Syncopy imports import syncopy as spy from syncopy.shared.parsers import data_parser, scalar_parser, array_parser from syncopy.shared.tools import get_defaults, get_frontend_cfg from synco...
87e4e965b3598d8e31c5e06f3aeb27907ce03f30de8275cf1f539e519ba2c1ec
Python
8,544
231
################################################################################################################ # torch profiling adapted from https://github.com/pytorch/pytorch/blob/master/torch/utils/bottleneck/__main__.py ### import torch import cProfile import pstats import sys from torch.autograd import profiler...
d69deaa97d8d5a74e091279929a1665d1b42194c0518fe0ec4ff31678f133a7b
Python
8,544
275
# -*- coding: utf-8 -*- """ Created on Thu Dec 8 16:09:31 2022 @author: Dustin Garner """ import numpy as np import pandas as pd from scipy.spatial import Delaunay import flycode.readfiles as readfiles region_dict = readfiles.import_regions() def remove_autapses(df): """Takes in a synapse df and removes all...
7859ebd6e89c7ad05cb46330c5b95d227da0c0f68e83385bffc390091ffc950a
Python
8,545
273
from math import ceil, log2 import cocotb import pytest from cocotb.clock import Clock from cocotb.triggers import ClockCycles, ReadOnly, RisingEdge from cocotb.types import LogicArray from cocotb.utils import get_sim_time import elasticai.creator_plugins.multipliers as multipliers from elasticai.creator.arithmetic i...
9492df02e2a2b95858bedb54b103a2ca49c340f6e0f9f94bf26b4518a912b6be
Python
8,546
171
# + import torch from transformers import get_constant_schedule_with_warmup import numpy as np from tqdm import tqdm from math import ceil from .evaluation_metrics import print_topl_statistics from .losses import binary_crossentropy_2d import pandas as pd def trainModel(model,fileName,criterion,train_loader,val_loader...
12da68629459ccf96063cf94c49adf794634387725b00caa210be59b3e745749
Python
8,547
244
""" Script to analyse tuning curves for both controls and controls vs glyt2+cno. Fit tuning curves and cluster putative neurons accordingly; used b-spline to fit tuning curves (default angle). Based on tc_fun from tc_module: function to calculate firing rate associated to each discrete wvar value; uses load_data, spi...
5cf868eb045b8aa8056f109a955743e7a13788339d5a61a556004e1f7e94f074
Python
8,548
484
from __future__ import annotations import numpy as np from scipy import ndimage as ndi from skimage.filters import threshold_otsu # ====================================================================== # LABEL-MAP VALIDATION # ====================================================================== def validate_ins...
f5e53f5665d17c5c2a9ba395d37ec8f7393778c9c0f3d12c0ce6e9ddf5f68267
Python
8,548
204
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """生成 game/data/pools.json —— 脑-游戏接口的神经元池定义(索引为"组排序后"空间)。 数据来源(只读): vendor/snedea-flybrain/data/connectome.bin.gz 二进制连接组(原始索引 = neurons.csv.gz 行序) vendor/snedea-flybrain/data/neurons.csv.gz root_id 列表,行序即原始索引 vendor/snedea-flybrain/data/coordinates.csv.gz ro...
16df65b5b54a18aa97683cc16b4b1db32e3ebd235b0879bb4f5f31d919bbe7a5
Python
8,549
184
import os import pickle import datetime import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm def save_scan_image( env, x_nm: float = 0, y_nm: float = 0, pixel: int = 128, scan_mvoltage: float = 1000.0, scan_speed: float = 500, scan_len_nm: float = 10, ...
e264558de56298d9487675d4914c49970905e7ee8ed32259b68562017b6984c5
Python
8,550
245
from __future__ import annotations from pathlib import Path import numpy as np import pytest from ase.atoms import Atoms from ase.build import bulk, molecule from ase.calculators.emt import EMT from ase.io import read from numpy.testing import assert_allclose from quacc.atoms.core import ( check_charge_and_spin,...
5b4d48ec7d2f04a64a0a9892260d85c77c237622074ef3c7646278d76e227490
Python
8,551
224
# -*- coding: utf-8 -*- import os.path from lab.environments import MaiaEnvironment from lab.steps import Step from downward.checkouts import Translator, Preprocessor, Planner from downward.experiments import DownwardExperiment from downward.reports.compare import CompareRevisionsReport from downward.reports.scatter...
8d2821b8296c75f379f56908289f053a2bb7c1c17d4cc2df0749a192a98dc009
Python
8,551
191
#! /usr/bin/env python from __future__ import print_function from collections import defaultdict import os import subprocess import sys DIR = os.path.dirname(os.path.abspath(__file__)) REPO_BASE = os.path.dirname(os.path.dirname(DIR)) sys.path.insert(0, REPO_BASE) from driver import returncodes BENCHMARKS_DIR = os...
b0759d72065e33b7c809f697ff1aff9f4b4ab9f1b3c50993f225d3443c9e9673
Python
8,551
350
#! /usr/bin/env python # -*- coding: utf-8 -*- import argparse import textwrap HELP = "Convert suite name to list of domains or tasks." def suite_alternative_formulations(): return ['airport-adl', 'no-mprime', 'no-mystery'] def suite_ipc98_to_ipc04_adl(): return [ 'assembly', 'miconic-fulladl', '...
0a641489a168a729c7df5a4e2de94465a836db2725e428f3b95c69b4830d50ec
Python
8,553
166
import os,copy import numpy as np import h5py import SimpleITK as sitk from ..io import imAdjust, imTrimBlack, readH5, writeH5 class sitkTile2Volume: # 1. estimate transformation between input volumes # 2. warp one volume with the transformation # xyz order def __init__(self, tiles_data, getVolume, ali...
ea0dc4bc719e1a8beecbdeb58caf63fd74f8e9245cea3c567e89e82bb9e702a7
Python
8,553
225
# 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...
2dae0d54c5409794f93212d8fb2012b39ce1067067a4383f9a4cc65d0ba7e467
Python
8,555
228
import torch from torch import nn from torch.nn import functional as F from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule from elasticai.creator.nn.integer.math_operations.math_operations import MathOperations from elasticai.creator.nn.integer.quant_utils import ( AsymmetricSignedQP...
d83a2c4b696a7d33ea20b075fd64dca89c628f0361424740e2df3a6c2ed8ea2c
Python
8,556
220
import os import os.path import warnings from glob import glob from typing import Any, Callable, Dict, Optional, Tuple from urllib.error import URLError import cv2 import numpy as np import pandas as pd import torch import torch.utils.data import torch.utils.data as data from sklearn.model_selection import train_test_...
5f0d9202d3c7172e2645650ee9a93063ae73e643099b52c71bd72dfa254621f6
Python
8,557
173
import torch from torch.utils.data import DataLoader import numpy as np from torch.autograd import Variable import time from src.Human.utils import normalize_range, un_normalize_range, check_cuda from src.Human.src_nn.Dataset import Dataset from src.Human.src_nn.Dataset import DatasetNOE from src.Human.src_nn.Network ...
a71ed1367fbe1f425b65dca166883a32105141ba18b4697b426909c255e47abc
Python
8,557
195
""" Script to run drug response classification experiments (sensitive/resistant) for all chosen drugs with stratified train/test sets. """ import sys import argparse import itertools as it from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm import pancancer_evaluation.config as cfg ...
b24bde93a6da00c0c76110c4aefdba0ad7f27291ccb2599ea4c4fb726edd18b8
Python
8,559
195
""" Script to run pan-cancer classification experiments for all chosen combinations of gene and cancer type. """ import sys import argparse import itertools as it from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm import pancancer_evaluation.config as cfg from pancancer_evaluation.d...
cf6ef967c27464b81a920215fb4a92168bcfb50ac72cd2aeccb5d082381408cd
Python
8,560
250
from collections.abc import Mapping from enum import Enum from functools import _find_impl, singledispatch from types import MappingProxyType from typing import Callable, Type, TypeVar from warnings import warn import numcodecs import numpy as np import pandas as pd import zarr from packaging import version from panda...
2204a742376889ad8d912551999db9fd355117786e0f7b1abb4e46a2de2ab918
Python
8,563
239
#!/usr/bin/env python3 # coding: utf-8 import os import os.path as osp from pathlib import Path import numpy as np import argparse import time import logging import torch import torch.nn as nn import torchvision.transforms as transforms from torch.utils.data import DataLoader import torch.backends.cudnn as cudnn cudn...
6245eacaa5ec5da9af14d0c0fbeaf7d2d767a3b6c0c3cd95d8b2d242d4d51b7c
Python
8,563
284
import os import pickle import bct import numpy as np import pingouin as pg from scipy.stats import spearmanr, mannwhitneyu, iqr import seaborn as sns import matplotlib.pyplot as plt import colorsys from strength_preserving_rand_sa import strength_preserving_rand_sa #general functions def pickle_load(file): r...
44064acd8634875a5468586769028c990c2e2ca234593612443e4bbd00e1f7e3
Python
8,569
406
#!/usr/bin/env python # coding: utf-8 # In[ ]: import sys sys.path.append("../scripts") # In[ ]: import os import Models_02 as models import Paths as paths import Preprocessing_01 as preprocessing import pytorch_lightning as pl import Utils_00 as utils from monai.utils import set_determinism from pytorch_lightn...
efc4c6c43a258d0c3fed03a1dc21007f9168bc6478a8d48e76b1ed3cd69467e5
Python
8,571
280
#!/usr/bin/env python # coding: utf-8 # ## Apply an image-based profiling pipeline using pycytominer # # As described fully in [Caicedo et al. 2017](https://doi.org/10.1038/nmeth.4397), an image-based profiling pipeline consists of three core steps: # # 1. Aggregation # 2. Normalization # 3. Feature selection # # [...
19ed657f0623cb161d3097617bef3a068e0ead39d97641e5e4663ad3b7a3ee56
Python
8,572
59
import os import random import math import sys # Check if the required arguments are passed if len(sys.argv) != 3: print("Usage: python script.py [sweep|neutral] <num_replicates>") sys.exit(1) replicate_type = sys.argv[1] num_replicates = int(sys.argv[2]) # Ensure num_replicates is an integer ...
26d308b5af09b859025d54c7bd98669de004748327a6c757f389ce58a176e2b9
Python
8,572
280
"""distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).""" import os from warnings import warn import sys try: import zipfile except ImportError: zipfile = None from .errors import DistutilsExecError from .spawn import spawn from .dir_util import mk...
0361836a766eac612ad45e6677b27e3c5864280a91a9d21df04c1273db89dda0
Python
8,574
272
# -*- coding: utf-8 -*- # # hybridLFPy documentation build configuration file, created by # sphinx-quickstart on Wed Apr 11 11:19:04 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
33e4b32053069944b99a97c0150af49927a17123cd52af9b760b1aed2c02c230
Python
8,584
266
# 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...
39e55921a9502e1a87abbc5bae5e228bc6daf7864e9632b07d474efff994bbf8
Python
8,588
284
import operator from collections.abc import Callable, Iterable, Sequence from functools import reduce from typing import Any, Protocol, TypeGuard, cast, overload from elasticai.creator import ir type ShapeTuple = tuple[int] | tuple[int, int] | tuple[int, int, int] def is_shape_tuple(values) -> TypeGuard[ShapeTuple]...
e744028e49070f1c5e966d483734a16a516d82898aed953051aa5100680a2203
Python
8,588
222
"""PointCloud-tracking smoke tests for transform_input_points. The function depends on a fully-formed registration output directory (ANTs transforms, axis alignment, optional Laplacian field). These tests mock the ANTs and Laplacian backends with identity transforms so they run quickly without external binaries....
0e26e48c601ef91a247283bdd5523922fd3a367c29a69f6bf251e0b22c484334
Python
8,589
243
import copy import logging import numpy as np import os import time from threading import Thread from queue import Queue from queue import Empty import carla from srunner.scenariomanager.carla_data_provider import CarlaDataProvider from srunner.scenariomanager.timer import GameTime def threaded(fn): def wrapper...
b6e9b46a08ef3f8a6e1fdbf17aec2525b986c2ee61e8448981e5ef61086c2abd
Python
8,590
213
# 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...
8d7619069034e32513b95c615f92dc358162a7abef908c5eb1aba97093c597e7
Python
8,591
214
# 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...
9a835ea51f8630c9638bc4e03caf57a1988fefd1a9c601270f7ee82bcf66e928
Python
8,594
212
#!/usr/bin/env python2.7 from __future__ import print_function from random import uniform from pddlstream.algorithms.search import solve_from_pddl from pddlstream.utils import read_pddl, irange, INF, randomize, Profiler from pddlstream.language.constants import get_length, PDDLProblem, print_solution, Exists, And, N...
2b9ba3723121f969da554d212e780171a59a9989f447df5c11e72b643cdbadf9
Python
8,595
249
import numpy as np import pandas as pd import h5py import json import re import os from mne_bids import BIDSPath from mne_bids.write import ( _participants_tsv, _participants_json, make_dataset_description ) import argparse SOURCE_DIR = 'logs' BIDS_ROOT = 'bids_dataset' DELAY_SAMPLES = 3 _stringify = lamb...
6934bad43cb274c518394ed06f6dad89b849d90358f02bb8ec41481fb12dec35
Python
8,595
267
import pandas as pd import numpy as np from tqdm import tqdm import pickle import joblib, os from joblib import Parallel, delayed from sklearn.model_selection import train_test_split from torch.utils.data import Dataset, DataLoader import torch from torch import nn from . import utils class MultiDS(Dataset): def ...
5d43b9661c2424093c761d90a49e01498c3f467b4d64386b963b9cbed5af683c
Python
8,597
188
from typing import Any, Callable, Dict, Tuple, Union import pandas as pd import mne import numpy as np import os from .base_dataset import BaseDataset from ...utils import get_random_dir_path def default_read_fn(file_path, **kwargs): # Load EEG file raw = mne.io.read_raw(file_path) # Convert raw to epoch...
dd59f1040756936c5c909f261706b3f76b755cfb0147a477bea1bc740c2f46c3
Python
8,597
219
""" Script to train pan-cancer mutation classification models using NN. """ import sys import argparse import itertools as it from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm import pancancer_evaluation.config as cfg from pancancer_evaluation.data_models.tcga_data_model import TCG...
db2e76d832f32816e8b8ec83f3f3dde4438d13449ccfbc2f31e4636f32ba09a8
Python
8,598
237
import pytest import numpy as np import pandas as pd import seaborn as sns import statsmodels.formula.api as lme from pyrelimri.similarity import image_similarity from pyrelimri.tetrachoric_correlation import tetrachoric_corr from pyrelimri.icc import sumsq_icc from hypothesis import given, strategies as st from hypoth...
d064913235e7972f0a06db647725a1dd7fadbd78f64d9712ff77c810a0d2e567
Python
8,599
229
import lightning.pytorch as pl import torch.nn as nn import torch import math import matplotlib.pyplot as plt import matplotlib from torchmetrics.regression import MeanAbsoluteError, MeanAbsolutePercentageError, MeanSquaredError, R2Score, PearsonCorrCoef from torchmetrics import MetricCollection import os #starts_to_lo...
8b7ae1714c8e66d12ea94581775ae15db6c6926b9030a77b33d5b74fab83c436
Python
8,600
247
# encoding: utf-8 import _init_paths import fire import time import pandas as pd import os import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torchvision import torch.nn.functional as F from tqdm import tqdm from collections import OrderedDict from torchvision import da...
def0ca706c4e03b97c8b4be9dfe641dc976cf6d7aa614f3e2802cfab1a2e93c5
Python
8,601
207
# coding=utf-8 # Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. 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/LIC...
db83167b0493c4f01fe69b29c523c8916e6ae39eb75893bd0f0215046d2b4dc8
Python
8,602
203
from collections import deque, Counter from pddlstream.algorithms.reorder import get_partial_orders from pddlstream.language.constants import is_plan from pddlstream.language.conversion import substitute_expression from pddlstream.language.function import FunctionResult from pddlstream.language.optimizer import get_cl...
288a66d59d8cde6b34f17101267ef302a2d608ba08b086f699c28b295457b15b
Python
8,603
206
from typing import List from typing import Union import numpy as np from skimage import transform from skimage import feature import cv2 from merlin.core import analysistask from merlin.util import aberration class Warp(analysistask.ParallelAnalysisTask): """ An abstract class for warping a set of images so...
3b99706caa9ec098b2776979d26d12eed0c1ddb0a1ba879c3531a0064582f996
Python
8,604
217
# Node-group asset "Symmetry Helical" (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. import math from typing impor...
a112c24ce73fa4a630d775ebeb36571586a69edc006d95a94b34042709c620d3
Python
8,605
251
# 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...
d419aad7b110534195029b0f7448d2d0f7b4898f15344e770bbbab43df15e625
Python
8,607
267
# 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...
7356a8a65efd729f30b6ece160ba17126db770fcadabbd9e3665eab336f9ffd0
Python
8,610
212
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/02_utils.ipynb. # %% auto 0 __all__ = ['group_extract', 'sample', 'to_np', 'generate_steps', 'set_seeds', 'config_hold_out', 'config_criterion', 'get_groups_from_df', 'get_cell_types_from_df', 'get_sample_n_from_df', 'get_times_from_groups'] # %% ../nbs/02...
aa7207e267b016ccdc79a5cab3f390a30fd06e2d083050ab893415bdd7d2e4df
Python
8,610
270
# 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...
d4bb2468bf24350bb92df17b2796cc173ebc38a4b80a959805dbb5c3d55da986
Python
8,610
269
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import json import math import anndata import scipy import scanpy as sc import os # %% import sys import numpy as np import pandas as pd from tqdm import tqdm import pickle import matplotlib.pyplot ...
e72b51a0fc84884beab484fe423c2c643e1572a710551f0e66ce174482767fe5
Python
8,610
262
""" Set of functions for generating DevCCF to CCFv3 mappings as a Sankey flow diagram Used to generate Fig 5c """ import nrrd, json import SimpleITK as sitk import numpy as np import pandas as pd from anytree import Node import plotly.graph_objects as go def read_metadata_excel(metadata_filename): dtype_ty...
a587d24204635504dca82c79533b2f545d8d0f2c5c3855ee1f65a0e2850d0359
Python
8,611
264
#!/usr/bin/env python3 import argparse import logging import os import shutil import sys from pathlib import Path import pandas as pd from Bio import SeqIO from Bio.Blast.Applications import NcbiblastnCommandline, NcbimakeblastdbCommandline from viper_clustering import viper_utilities as vu def parse_arguments(): ...