sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1f6645f6ef296e960c35ebb01891f743180bf53ebeccf3f999f33310f3b734fb
Python
2,014
52
#============================================================ # # Deep Learning Artifact Filtering # Data Generation # # author: Ahmed Shaheen # email: ahmed.shaheen@oulu.fi # github id: AhmedAShaheen # #=========================================================== import pickle import argparse import numpy as np f...
4361e7662cf0b8e858db061052f0ffea8e505db5eb53a530a17aa27242f609c6
Python
2,014
63
# 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...
0e2605144d716a52a786c3ddc7d564514779df60dd1eb4ab43cf83b1bb1df4a4
Python
2,015
83
from numpy import (append, arange, array, cumsum, empty, isnan, nan ) from numpy.testing import assert_array_equal from pytest import raises from wonambi.ioeeg.utils import _select_block...
16079ac2b0fbb4062bca79332cd1e5a31520b254b478bf6d1a4f9907d6e5bb12
Python
2,015
62
import boto.sqs from boto.sqs.message import Message import json import os import sys def get_connection(): secrets_subpath = ".cloudvolume/secrets/aws-secret.json" secret_path = os.path.join(os.path.expanduser('~'), secrets_subpath) with open(secret_path) as f: aws_secrets = json.load(f) return boto.sqs....
ad715d34b38b38930200911cf6fd4574d1ba56f659c6714c40e749c5bd57bf7b
Python
2,015
63
""" Quick python script to generate slicetimes.txt for milan acquired in descending order (“from head to foot”) and using a simultaneous multi-slice factor (multi-band)=2 So, slices were acquired in this order: 1 & 25 2 & 26 3 & 27 .. and so on till 24 & 48 1 25 2 26 3 27 4 28 From: [https://en.wikibooks.org/wiki/...
25c2582939bcaef6e91bbd92b81bbb7d938fbda24ff4457db554ce7ce9aac420
Python
2,016
153
import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import cv2 def plot(samples, X_dim, channel): fig = plt.figure(figsize=(4, 4)) gs = gridspec.GridSpec(4, 4) gs.update(wspace=0.05, hspace=0.05) dim1 = int(np.sqrt(X_dim)) samples = (samples + 1) / 2 for i...
9f7ab9f5b34e3489f6822eec3c1abdfc24e781f9436f1049a1b677efdf865019
Python
2,016
41
release32 = ["-DCMAKE_BUILD_TYPE=Release"] debug32 = ["-DCMAKE_BUILD_TYPE=Debug"] release32nolp = ["-DCMAKE_BUILD_TYPE=Release", "-DUSE_LP=NO"] debug32nolp = ["-DCMAKE_BUILD_TYPE=Debug", "-DUSE_LP=NO"] release64 = ["-DCMAKE_BUILD_TYPE=Release", "-DALLOW_64_BIT=True", "-DCMAKE_CXX_FLAGS='-m64'"] debug64 = ["-DCMAKE_BUIL...
3b9f4167ea380c06d62944e8ee6d5c88ee9ca8f486c86b9080e3f9a3fe15378a
Python
2,017
35
"""Shared defaults for the Laplacian refinement solve. A leaf module (no imports) so every caller - CLI, GUI, pipeline, both solvers - reads the same number instead of repeating a magic literal in nine places. """ #: Relative *residual* tolerance for the Laplacian CG/LGMRES solve. #: #: This is NOT a bound on...
59ce05d22a37330198fb2ebc34c7fbce21569bbc3eb42d8ba6c825037a11a4da
Python
2,017
70
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, MaiaEnvironment from lab.reports import Attribute, arithmetic_mean, geometric_mean import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport fr...
9a2c078bb58ca47dc5a288aedf26e51473cd238b7e757ad00993b585855e1baa
Python
2,017
48
# 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...
bab91f96f900ffcb75338be44800b5cdcd00486613cb9a877f850dae9027dab5
Python
2,017
53
"""No test may leave files in the source tree. A test that writes into ``regtools/`` pollutes the working copy, shows up as untracked noise in every ``git status``, and can leak state into a later run. This one was found by accident - a stray ``regtools/CANCELLED.txt`` after a full-suite run, because a cancel test...
30a2fc99739e7f2cae1f6fa5ec2d172dbe06e0ccb87a486251507362067fe792
Python
2,018
56
# # Copyright Bradley Lowekamp # # 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.txt # # Unless required by applicable law or agreed ...
691d1357a0ae69dfb4181382a897f44e44bcfb568dc6b2842effb020778becc3
Python
2,018
54
"""Tests for the report's 'View in napari' section (regtools.registration.report.analysis_figures._render_napari_launch) and its wiring into build_html_report.""" import json import os from regtools.registration.report import build_html_report from regtools.registration.report.analysis_figures import _render_...
8f54762fb2ce2a9a6b1f2542fb58db379c0874e01f97adf8a96545a7302d56b2
Python
2,018
52
# 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...
a5087addd110e17faa6b099ff9c3df594ddfc346735f68a988821dc37ad91e07
Python
2,018
48
from .base_converter import BaseConverter from ..operators import Conv2_5d from ..utils import _pair_same class Conv2_5dConverter(BaseConverter): """ Decorator class for converting 2d convolution modules to corresponding 3d version in any networks. Args: model (torch.nn.module): model that...
e1611280d75783259c02d6961694f0937e4b1ced41dc6b5a22b7192c159b94d2
Python
2,018
60
import matplotlib matplotlib.use("Agg") import torch device = torch.device("cuda" if torch.cuda.is_available() else "cpu") import yaml, io with open("./config/MNIST_config.yaml", 'r') as stream: config= yaml.safe_load(stream) config["default_path"]= str(config["default_path"]) config["cuda"]= str(config["cud...
f4602661854a72a74371134a1e2e1f747128e4a2ea2de7641095ad174fb0576a
Python
2,018
68
from collections import namedtuple import numpy as np from examples.discrete_tamp.viewer import MAX_COLS, MAX_ROWS from pddlstream.language.generator import outputs_from_boolean GRASP = np.array([0, 0]) def is_valid(p): return np.greater_equal(p, [0, 0]) and np.greater([MAX_COLS, MAX_ROWS], p) def get_length...
0de4dc7192b476b0c3e3e3dac57e1054a8a4bd073cce3e5d31d7651d3ed041ac
Python
2,019
81
# Node-group asset "OKLab to Color" (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_CHECKIN...
38a89636ac7165d0b9d0519b73d15b7d951384c836af7d9ceca81872db77cdb0
Python
2,019
72
"""Base functions for universal machine-learned interatomic potentials.""" from __future__ import annotations import logging from functools import lru_cache from typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Literal from ase.calculators.calculator import Calculator logger = logging.getLo...
60d00f025e948f9d7793a83e00c9c40689c523dd151bbe44a0adf724bb1cd4a4
Python
2,019
74
import numpy as np from scipy.fftpack import fft, dct import matplotlib.pyplot as plt from scipy.integrate import simps ############ fs = 1e-15 A = 1e-10 e = 1.6e-19 kb = 1.38064852E-23 # m^2 kg s^-2 K^-1 c = 299792458. # m s^-1 hbar = 1.05457180013E-34 # kg m^2 s^-1 ############# def load_lmps_dipole(filename): ...
69b5f35cde406cae2b817451ad0401310951ef915ff81ae73f42c01547946331
Python
2,019
62
import argparse import nibabel as nib import matplotlib.pyplot as plt import numpy as np from skimage.measure import marching_cubes from scipy.ndimage import zoom #SEEG0001img_T1_3D_AX_FSPGR_20121118083857_12.nii.gz # (x, y, z) = (256, 256, 172) # header.dims = [3 256 256 172 1 1 1 1] # header.pixdim = [1. 0.9766 0.97...
d78647f710537785811d037cb04fd3fa7e3583700bceccc9f6c88174ff490243
Python
2,019
55
import numpy as np from scipy.sparse import csr_matrix class PoissonBinomial(): def __init__(self, probabilities): """Initialize the class and calculate the ``pmf``. :param probabilities: sequence of success probabilities :math:`p_i \\in [0, 1] \\forall i \\in [0, N]` for :math:`N` inde...
35d58b79792c7ef846ac62c6162f725bd6d50d2ebe186017c6bb984ccab93351
Python
2,020
64
#! /usr/bin/env python2 # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment from lab import tools from downward.reports.compare import ComparativeReport import common_setup from common_setup import IssueConfig, IssueExperiment DIR = os.path.dirname(os.path.abspat...
f06dee8e0c191d76a947b6169feb67bddc9c455dfef4090bc87e8afefd1fe385
Python
2,020
54
import sys, math sys.path.append("../../../../../bin/") from pybioshell.core.data.basic import Vec3 from pybioshell.core.data.io import Pdb from pybioshell.core.data.structural.selectors import SelectResidueByName from pybioshell.core.protocols import copy_selected_atoms, copy_selected_coordinates from pybioshell.cor...
6f4069518e86662bd2db77e767ddf223f13b130151b994c735722948ec0d7313
Python
2,021
48
"""CLI script to add missing HED IDs to a prerelease schema in the hed-schemas repository. Maintainers run this once, at release time: ``hed_add_ids <hed-schemas> <standard|library> <version>``. It reads the prerelease TSV set, assigns the lowest free id in the schema's ``library_data.json`` range to every element wit...
f8f1b55717be4f3a9e0521ccabf21245a533e86d0385ecd2f9a84faaf76196cc
Python
2,021
60
# 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...
8a9fac77888f1cf5f0b5896d05ee3ea1cb48bb2aaf94e78b4b1ca8234b82b248
Python
2,022
52
import datetime def isbetween(time: datetime.datetime, time_range: tuple): r""" Function for finding if a certain datetime object exists in a specified datetime range. The boundaries of the time range are also included. Args: time: a datetime object time_range: a tuple depicting a tim...
aab846ed15f17416ff9b580da7d109ed5c6d76bb1c857000f76e14638a22ae6e
Python
2,023
57
### configs for next hyperparam trial import optuna from datetime import datetime # def train_fn(trial): # t=trial.suggest_uniform("t", .6, 1.5) # r=trial.suggest_uniform("r", t, t*2.4) # params = { # # 'lr_hyperbolic': trial.suggest_loguniform('lr_hyperbolic', .01, .1), # 'lr': trial.suggest_log...
2499a91b1e1259c3e0a3b5bdac2c678a10b7871e88c575cf5b24df37b717d424
Python
2,026
61
import hashlib import tarfile import urllib.request from pathlib import Path from fidnet import config def download_example_data(force: bool = False): example_files = [ config.example_file_non_deuterated, config.example_file_hnca, config.example_file_nus_reconstruct, config.exampl...
af7336a1149a4c37db94c4d4fa63eb90e3a3fa6fd35c790194ad0a4419722b54
Python
2,026
70
from random import random from .utils import irange, argmin, RRT_ITERATIONS class TreeNode(object): def __init__(self, config, parent=None): self.config = config self.parent = parent #def retrace(self): # if self.parent is None: # return [self] # return self.parent....
6549f5cd561602e5ae55cd8a0862e2fd08cd925bb0921d2258113915d2e8967e
Python
2,027
47
import random from PIL import ImageDraw from typing import Optional from .shape import Shape, calculate_short_side class Triangle(Shape): def __init__(self, x: int, y: int, width: int, height: int, tip_offset: Optional[float] = None, flip: Optional[bool] = None): super().__init__(x, y, wi...
695362c19cb95df7dcf020597971245bd8831e488218af1971f2ed5d497129d6
Python
2,028
81
"""""" import logging from concurrent.futures import Future logger = logging.getLogger(__name__) class Packet: """ A data packet with a timestamp and content. """ def __init__( self, stream_name, device_uid, timestamp, source_timestamp=None, source_timebase="m...
b1aac20813dda7d7dc96869a5a4ed101f143f73a8c2ebca4b2bf7f1c944218d6
Python
2,028
54
"""Tests for cellpose_sam.launch_helpers - pure-Python helpers, no Qt required.""" import pytest from regtools.cellpose_sam.launch_helpers import ( _BROWSE_MODEL_SENTINEL, _CUSTOM_MODEL_MIN_BYTES, _CUSTOM_MODEL_EXTS, discover_custom_cellpose_models, ) class TestConstants: def test_sen...
265a68ddcf957d7c413e5d8212a915f89dabdaa7aa218b9d575feaa2fd0a09f8
Python
2,030
80
# Node-group asset "Color to OKLab" (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_CHECKIN...
80260d62d65d82613911b014260f28cc3ad859d7b3c4046c2e0382054acecc11
Python
2,030
63
import torch class DecodeStrategy(object): def __init__(self, pad, bos, eos, batch_size, parallel_paths, min_length, max_length, return_attention=False, return_hidden=False): self.pad = pad self.bos = bos self.eos = eos self.batch_size = batch_size self.pa...
0d57eafc949a058450cdba96e42d2eb047873bfe5262a575f904b998df4195c0
Python
2,031
41
import argparse import glob import re import h5py import os from plantsegtools.utils.edit import parse_crop def main(): parser = argparse.ArgumentParser(description='Copy a dataset from one H5 to another. Files with identical time point in names will be matched.') parser.add_argument('--source_dir', type=str,...
136269ef49a25699d90eaea4a706ba29b1485e98697c9ef6037730b134bceadf
Python
2,031
77
import json try: import simplejson as json except ImportError: import json import requests import os.path def autodetect_proxy(): proxies = {} proxy_https = os.getenv('HTTPS_PROXY', os.getenv('https_proxy', None)) proxy_http = os.getenv('HTTP_PROXY', os.getenv('http_proxy', None)) if proxy_h...
5bbffd714e6df23a8ac96bd42e376ff2fc32f6402a619c349f3a7a7b4c10b39e
Python
2,031
62
#!/usr/bin/env python from __future__ import division, print_function import argparse import topaz.cuda from topaz.model.factory import load_model from topaz.model.utils import segment_images from topaz.torch import set_num_threads name = 'segment' help = 'segment images using a trained region classifier' def add...
b1e9a138651bcabd6fbfe3d3c23c6086f5f2f512e5a2d3c5dedbe78f13e24345
Python
2,031
63
from typing import cast from elasticai.creator.file_generation.in_memory_path import InMemoryFile, InMemoryPath from elasticai.creator.nn.fixed_point.hard_tanh.layer import HardTanh def test_vhdl_code_matches_expected_hardtanh() -> None: expected = """-- This is the hard_tanh implementation for fixed point data ...
56d095ab2e313f7f9790b0751b96938eae2ac876a3e570c8fd198e251f177f51
Python
2,032
58
"""Python function to smooth surface images Modified from BrainStat toolbox https://github.com/MICA-MNI/BrainStat/blob/master/brainstat/mesh/data.py -removed third dimension -removed printing of messages (messes up the R console) -remove edges in the medial wall -converted mesh units to mm -replace s...
6eb8e6795548ca74be68e3a64c2b782c20f6fb5483e08eed97a3af6af592cf7b
Python
2,032
68
# Meep Tutorial: Hz-polarized transmission and reflection through a cavity # formed by a periodic sequence of holes in a dielectric waveguide, # with a defect formed by a larger spacing between one pair of holes. # This structure is based on one analyzed in: # S. Fan, J. N. Winn, A. Devenyi, J. C. Chen, R. D. Meade...
b83fb2e561bbbf026bff6002c9489cd1d8232db8d4ccd8fc7ae5d6061f47d47c
Python
2,032
56
from setuptools import setup, find_packages setup( name="scpair", version="0.1.0", description="scPair: boosting single cell multimodal analysis by leveraging implicit feature selection and single cell atlases", long_description=open("README.md").read(), long_description_content_type="text/markdown...
d3ac631782f642fd09eb9f4a69a04784ebf5b0498735477ba7a30385f3d5df20
Python
2,032
80
# 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...
0e71b8e6c2a74c02fc511b8926ba58816cd397f60fafe21ee8300b06a2fdddb8
Python
2,033
67
"""Final registration with Laplace warping - port of final_registration.m.""" from __future__ import annotations from pathlib import Path from typing import Tuple import numpy as np from imageio.v2 import imwrite from .bb_alignment import _preprocess from .correspondence import final_point_correspondence...
8c3df58f6c198cada6fad14441cbd7aab0ee953b613f5dd4242a4e7dcb8d71f6
Python
2,033
71
from ase.io import read import numpy as np import torch from torch.utils.data import DataLoader from ..data import get_dataset from ..data.utils import atoms_collate_fn from tqdm import tqdm import os def eval(model, data_loader, properties, device): output = {prop: [] for prop in properties} target = {prop: ...
2fb61d80f3390403755751cb64ffb3aff1d18dbf2fcd2053344004248ee9148f
Python
2,034
71
import numpy as np from nilearn.image import smooth_img from nilearn.masking import apply_mask, unmask from os.path import join as pjoin from argparse import ArgumentParser from dimensions_encoding.sparseness import hoyer_sparseness def load_data(betasdir, sub): ndims = 66 betafiles = [ pjoin(betasdir...
cbe8757bf1afeb7d79483c5636d80eccd6b303d2890f653e590d46f9d9ed0a85
Python
2,035
82
"""Define some args.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse def str2bool(s): """Convert str to bool.""" return s.lower() not in ['false', 'f', '0', 'none', 'no', 'n'] parser = argparse.ArgumentParser() parser.add_argum...
d96436a7f9f1b0a59eb1eb6775af4a989119721549d9c54ce083d86de365bf9c
Python
2,035
76
import os import yaml def get_model_size(model): param_size = 0 for param in model.parameters(): param_size += param.nelement() * param.element_size() buffer_size = 0 for buffer in model.buffers(): buffer_size += buffer.nelement() * buffer.element_size() size_all_mb = (param_size +...
4281795786b385c9fcde06f1d1ba9572dbaca58d3aa3e901a5af82b498b86b63
Python
2,036
61
#!/usr/bin/env python3 """Inspect SEA-AD AnnData object without running biological analysis.""" from pathlib import Path import pandas as pd import scanpy as sc ROOT = Path(__file__).resolve().parents[1] RAW = ROOT / "data" / "raw" TABLES = ROOT / "results" / "tables" ADATA_PATH = RAW / "SEAAD_Immune_multiregion_f...
6c0394e79510a67b200a2a2eae55343ddb4fcb4f9a8ca6fe7f5ded9e8891e729
Python
2,036
59
from collections.abc import Callable, Iterator, Sequence from itertools import chain from elasticai.creator import ir from elasticai.creator.ir2vhdl import DataGraph, type_handler from .combinatorial import wrap_in_architecture from .language import Port, VHDLEntity from .vhdl_nodes.node_factory import InstanceFactor...
0a2c3f6e5062c1333aa85f85eb428930204fac14ec704a624f425e94c68ced64
Python
2,037
56
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
336652496acbff7529c4e4133b922fd2cb21137c9f58318c4ce72c67f03972b6
Python
2,038
58
# # 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,...
3f257d7001064201ef807e57b310e842b78f67ab2456f727960ba0a6710a6379
Python
2,038
67
import ctypes import ctypes.util import numpy as np from numpy.ctypeslib import ndpointer import os import sys import sysconfig def FwdBwdAlg_cpp(initPi, transPi, SoftEv, order='C'): if not hasEigenLibReady: raise ValueError("Cannot find library %s. Please recompile." % (libfilena...
6b028eb3caafe09ccef8da65a7ec0c4835131f9bea0342b95595328d20647ec9
Python
2,038
61
# 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...
a160246bf1c62a4f8d7041397fce376743913f9722babf0584d5876b103dec1b
Python
2,038
67
import torch import torch.nn as nn from torch import Generator from typing import Any from abc import ABCMeta, abstractmethod class FinalLayersBlock(nn.Module, metaclass=ABCMeta): """ Network final layers performing final prediction and (optionally) loss calculation """ @abstractmethod def ...
34e45ac3a31816241cfb95efc3157866505b8380febba2e0c4b266b9f46cacad
Python
2,040
68
import elasticai.creator_plugins.lutron_filter as lf import pytest from elasticai.creator_plugins.lutron_filter import remove_redundant_layers from elasticai.creator.ir import attribute @pytest.fixture def ir_repr(request): layer_type = request.param return lf.build_sequential_ir( dict( m...
8f4e63bd34f97721e4b678ce5f5b7a17197e2e7a5ce1b734df5079e1e2111cf0
Python
2,041
72
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' **hybridLFPy** ============== Provides methods for estimating extracellular potentials of simplified spiking neuron network models. How to use the documentation ---------------------------- Documentation is available in two forms: 1. Docstrings provided with th...
21046b21fdc3b80b55c3b7b9cf74ee8e3be843374581c041418b5dd0d2fb04ff
Python
2,042
56
import torch.nn as nn from monai.losses import DiceLoss, GeneralizedDiceLoss, FocalLoss # inspired by the NVIDIA nnU-Net GitHub repository available at: # https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Segmentation/nnUNet # loss computing makes use of the MONAI toolkit available at: # https://g...
53588cfc85b03bf278e389ac6f814d7b34c0a4d9e93671a331258f46062f9241
Python
2,042
63
#! /usr/bin/env python import os import shutil import subprocess import sys DIR = os.path.dirname(os.path.abspath(__file__)) REPO = os.path.dirname(os.path.dirname(DIR)) DOWNWARD_FILES = os.path.join(REPO, "src", "search", "DownwardFiles.cmake") TEST_BUILD_CONFIGS = os.path.join(REPO, "test_build_configs.py") BUILD =...
6633df3bb8f20cd6436a1f4258c66bfa50dcdcd76ade0b9df79c9726c85b8c2b
Python
2,042
64
# 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...
db209147cdee3c0456df21d8904f4ee118ffdf553a5e5b62021a67f9d8bca876
Python
2,042
61
#!/usr/bin/env python # Purpose: Find remaining volumes (post-censoring) for each session and for each participant overall. # # Input: Single-column motion outliers txt file for each bold image. These were generated using the CBIG2016 preproc pipeline. # Output: Total remaining volumes for each participant's session an...
ff334a966f968630b21ebb4c7dc48ce362cf1bbdfc8a7d7ec9827848b1cf3405
Python
2,042
66
import databpy as db import numpy as np from .utils import GeometrySet def test_get_set(fetch, snapshot): code = "1BNA" mol = fetch(code).add_style("ribbon") geom = GeometrySet(mol.object) assert snapshot == geom.summary() def test_spheres_style(fetch, snapshot): code = "1BNA" # the point cl...
66ab461696953634787c62c9d24dcc1361b72e49a709d211bdcf35168a297bc4
Python
2,043
68
#!/usr/bin/env python # Copyright (c) 2019-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ Simple freeride scenario. No action, no triggers. Ego vehicle can simply cruise around. """ import py_trees from srunner.scenar...
7ed2c233394455e7e711faee6a53435286d8ba179a278b00342f8d8fef8d5305
Python
2,043
72
import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np def plot_prop(prop): if "per_" in prop: x = np.load("target_{}.npy".format(prop[4:])) y = np.load("output_{}.npy".format(prop[4:])) n = np.load("n_atoms.npy") while len(n.shape) < len(x.shape): ...
a96bddc494efbe91d7cd8be28eb5c0b25bd2bea856d204eb59cab39b17e3280a
Python
2,043
61
import pandas as pd import itk import SimpleITK as sitk import os import sys import json import argparse import logging import numpy as np def main(): print("ExtractGenes.py has started") logging.basicConfig( format='%(asctime)s %(name)s %(levelname)-8s %(message)s', level=logging.DEBUG, ...
ee58a4baa4b45da737b4c4aeae82db7c729864e353110f822e8760fc2e795b01
Python
2,043
56
from matplotlib import pyplot as plt import numpy as np import os import pandas as pd from constants import REGRESSION_LABELS, DATA_DIR, TF_ROTATION, TF_PERSPECTIVE, TF_CONTRAST, TF_BRIGHTNESS from src.dataloaders.semantic_transforms_dataloader import get_dataloader from src.dataloaders.semantic_transforms_dataset imp...
f72aea0e551379fd010cd9c62e47fc61ad1d8c06584122a948fb9ee89db136bd
Python
2,043
61
#!/usr/bin/env python # Purpose: Find remaining volumes (post-censoring) for each session and for each participant overall. # # Input: Single-column motion outliers txt file for each bold image. These were generated using the CBIG2016 preproc pipeline. # Output: Total remaining volumes for each participant's session an...
3b1f44fd8a2a5a1a7785edff860af5367e7b66bd5a9a8b34f07359f93f0319f2
Python
2,044
56
from typing import Any from ._attribute import AttributeMapping, attribute from .datagraph import DataGraph, Edge, Node from .factories import IrFactory class IrDeserializer[N: Node, E: Edge, G: DataGraph]: def __init__(self, factory: IrFactory[N, E, G]) -> None: self._factory = factory def _node(se...
47930f4fb499589207abd6246195baa71d5cbb879e3bbbf96bea9fe8da774929
Python
2,044
60
import matplotlib.pyplot as plt import numpy as np # Function for visualization of orthogonal views def show_orthoslices(image, cross = None, figsize = (18,6), cmap = "gray", vmin = None, vmax = None, ...
dec7bfa9d969f395b46ba2fa192f48f729ec2ae7bd7e5645c38078e5bb2b06f3
Python
2,044
48
"""Testing for the python API of the C++ flagser `.flag` file I/O.""" import pytest import os import numpy as np from numpy.testing import assert_almost_equal from pyflagser import load_unweighted_flag, load_weighted_flag, \ save_weighted_flag, save_unweighted_flag from pyflagser._utils import _extract_unweighte...
fcef5a85a3e58f328e8d89b225639d283fe19f51b5a29bd00bfaa93d0e0eb5d2
Python
2,044
47
import os import sys import time datadir = sys.argv[1] # should point to the directory where the fast5 & reds dir exist sigmap_exe = sys.argv[2] model_name = 'sigmap' # Python Script Paths exedir = "../run_scripts/" # the path to HierarchyCall's test/run_scripts dir sigmap_script_path = "run_sigmap.py " extract_re...
151169d030edc77c97aefb2ebef2c6c79b883c39ff583b4ff53580b14e378b45
Python
2,045
76
import sys, os sys.path.append(os.path.abspath("..")) sys.path.append(os.path.abspath(".")) import torch import torch.nn as nn import torch.optim as optim from prosper_nn.models.hcnn_compressed import HCNN_compressed import prosper_nn.utils.generate_time_series_data as gtsd import prosper_nn.utils.create_input_ecnn_...
5f61971d1357ead995c8ede2557823ed52d3c647f1b2fd277964cdc11ada3094
Python
2,045
75
import os import pandas as pd from calvados.cfg import Config, Job, Components import subprocess import numpy as np from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('--name_1',nargs='?',required=True,type=str) parser.add_argument('--name_2',nargs='?',required=True,type=str) args = pars...
aa5bd44310b4136f4106de2cedee0fb4e3f6319658890499678de8c628330506
Python
2,045
75
import re import torch.nn as nn from pretrainedmodels.models.xception import pretrained_settings from pretrainedmodels.models.xception import Xception from ._base import EncoderMixin class XceptionEncoder(Xception, EncoderMixin): def __init__(self, out_channels, *args, depth=5, **kwargs): super().__init...
2ba08a73e60a769c940c4f0d118dbc25be71ec18f6be16f4b1e5960642e62997
Python
2,046
40
# This script uses output from mask_fuser.py (overll produced artifact mask) to create artifact free mask, later used by nonartifact_tiler.py to produce artifact-free regions. import numpy as np import os from PIL import Image import time from matplotlib import pyplot as plt def mask_deducer(listofmasks): ...
79087d476795946c1fc68349791487955e1170cb983e0e832d191b94ede6b9db
Python
2,046
52
#!/bin/env python3 """ Draw coloured grid lines using matplotlib """ import numpy as np import matplotlib.pyplot as plt import ithildin as ith from typing import List # load any simulation and calculate a phase sd = ith.SimData.from_stem("results/smooka_5") apd = sd.log.sources[1]['S2 stimulus delivered at t'] - sd.l...
a16763bdebd271d28a68c807bbc9430b0739886b1b8e85f1e5c5a5dc632c29ae
Python
2,046
60
import os import os.path as op from nimare.meta.ale import ALE from nimare.dataset import Dataset from nimare.correct import FWECorrector import sys sys.path.append('/home/miriedel/niconn') import pickle def macm(prefix=None, mask=None, output_dir=None, ns_data_dir=None): if mask is None or not op.isfile(mask): ...
bd79e684658375f285132281cdd059087111771a1599dab095392868d6d8929a
Python
2,046
69
from typing import Callable, List from ..base_transform import BaseTransform class Compose(BaseTransform): r''' Compose several transforms together. Consistent with :obj:`torchvision.transforms.Compose`'s behavior. .. code-block:: python from torcheeg import transforms t = transforms.C...
860b4e4a650ad4686e849497dce48ffa25bdd70be240b59715a7bfdb2633a3f4
Python
2,047
68
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport DIR = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS_DI...
8e7140f3c636b09889d99df65b9b7914e68b965773425b79c243ae265a37ab6a
Python
2,047
63
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport DIR = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS_DI...
f158e224eeb5d85b5d5e18065997096ea9d3d148ecccc2c28aa5d6858a089ea7
Python
2,047
72
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Docs here""" __author__ = "Mitchell R. Vollger" __credits__ = ["Mitchell R. Vollger"] __maintainer__ = "Mitchell R. Vollger" __email__ = "mrvollger@gmail.com" __status__ = "Development" import logging import argparse import pysam import sys from tqdm...
712dbf669ff854d601e7983024e5ed9d40b01e90497a82ae03996b70ece9db99
Python
2,048
65
#!/bin/bash # Setup of NanoDiP venv with Python 3.7.x # J. Hench, IfP Basel, 2021-2023 # for use with Ubuntu 20.04 x86_64 # jupyter notebook and minknow_api won't work togehter in python 3.8.8 # Ubuntu 18.04 / jetpack requirements: # sudo apt install python3.7 python3.7-dev python3.7-venv python3-pip venvname=nanodipV...
7c07cbe0e6a9277604071da5131dd5b26b4d4cc61582147e41c61ba9b5ea7b5d
Python
2,048
70
import json import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from pathlib import Path from ..prixfixe.predictor import Predictor from .utils import n2id, revcomp class AutosomePredictor(Predictor): def __init__(self, model: nn.Module, model...
8b55ddaf28178c4f7fb7218e00226cb04863ae44927154693aae6b36f56039e3
Python
2,048
66
import albumentations as A import numpy as np from albumentations.pytorch import ToTensorV2 from wsilearn.utils.cool_utils import is_ndarray, is_dict imagenet_mean = (0.485, 0.456, 0.406) imagenet_std = (0.229, 0.224, 0.225) def create_norm_transform(): return A.Normalize(mean=imagenet_mean, std=imagenet_std) de...
0cda9f23bd49e3dd601201ddd4d142d2bf9b6452a59ff7604151d5f01a01dd64
Python
2,049
76
import time import os import sys class LIDCEnv(): data = './data' # The lidc data location video_resnet18_pretrain_path = '.../resnet-18-kinetics.pth' mednet_resnet18_pretrain_path = '.../MedicalNet_pytorch_files/pretrain/resnet_18_23dataset.pth' class LIDCSegConfig(): batch_size = 8 n_epochs = ...
d04d57310b00b3d86cfffb41cfdf6c5c2ccbdc5971e6fc9de2a58535c7c92a2e
Python
2,049
61
#!/usr/bin/env python # Purpose: Find remaining volumes (post-censoring) for each session and for each participant overall. # # Input: Single-column motion outliers txt file for each bold image. These were generated using the CBIG2016 preproc pipeline. # Output: Total remaining volumes for each participant's session an...
1e996b5aa0e20af4740b0a94c52df393385b29f78f4f0c08279248ce794dc2e4
Python
2,050
50
import pandas as pd import numpy as np import os celltype_list = ['EX', 'IN', 'ASC', 'ODC', 'OPC', 'MG'] # Get DA-cCRE Set (Human) for temp_celltype in celltype_list: Human_df = pd.read_csv('Res/'+temp_celltype+'_Human.txt', sep='\t') Human_df = Human_df.loc[Human_df['padj']<0.05,] Human_df = Human_df.loc...
ccf210bd8740057af374b1f4141b4f941223c78f3efa30d33163a1f6ba9a7c15
Python
2,050
69
# set QT_API environment variable import os os.environ["QT_API"] = "pyqt5" import qtpy # qt libraries from qtpy.QtCore import * from qtpy.QtWidgets import * from qtpy.QtGui import * import control.utils as utils from control._def import * import time import numpy as np import cv2 class DisplacementMeasurementContr...
9abfa704e52b3f4dc2c4a8d6e1525a9fb702150eaf8f5eb6b5d2a2566cf27d2a
Python
2,051
52
from .functional import acs_conv_f from .base_acsconv import _ACSConv class ACSConv(_ACSConv): """ Vallina ACS Convolution Args: acs_kernel_split: optional, equally spit if not specified. Other arguments are the same as torch.nn.Conv3d. Examples: >>> import ACSConv ...
cf36f1710afe96b7434bf9b09d4baf0514b462e9c7db783059b6813075c21258
Python
2,052
85
import os import flask import flask_login app = flask.Flask(__name__, static_url_path="/", static_folder="_build/html/") app.secret_key = "super secret string" # Change this! login_manager = flask_login.LoginManager() login_manager.init_app(app) users = {"gt4sd-team": {"password": os.environ["GT4SD_DOCS_PASSWORD"]...
1510c0cc006c0ae5a213593bc15dd0c40405cb425fab63ed97c1ad3b8b42d225
Python
2,053
84
from __future__ import annotations from importlib.util import find_spec from pathlib import Path from typing import TYPE_CHECKING from monty.dev import requires from quacc.runners.ase import BaseRunner has_phonopy = bool(find_spec("phonopy")) has_seekpath = bool(find_spec("seekpath")) if TYPE_CHECKING: from n...
1a6a98e95ef674fcac3eefd5a301ad751d99a515a1e15db1b59afef78e9e8ca8
Python
2,053
60
# regtools/tests/test_ccf_canvas_lock.py import os os.environ.setdefault("QT_QPA_PLATFORM", "offscreen") import numpy as np import pytest pytest.importorskip("PySide6") from PySide6.QtWidgets import QApplication _app = QApplication.instance() or QApplication([]) def _two_region_volumes(tmp_path, shape...
2eea27df58b237418bb4d81042dbf49ad47a68a4c6b7f3d8141c32cfc56d828d
Python
2,053
36
from setuptools import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy ext_modules = [Extension("traj_dist.cydist.basic_geographical", ["traj_dist/cydist/basic_geographical.pyx"]), Extension("traj_dist.cydist.basic_euclidean", ["traj_dist/cydist/basic_...
749cee22543aeb0af0ffecf72a414a484e8a7d942f6adfa8025e9068569dea65
Python
2,053
53
# 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...
62543b3cc524f7361e10e7947fc6681d4d46d8e447ed64a0befd1c3ac023538e
Python
2,055
66
"""Testing CLI command measure.""" import subprocess import os def test_measure(): """Tests for morphometric mesurements.""" os.chdir(os.path.dirname(__file__) + '/data') proc = subprocess.Popen(['swc', 'measure', 'pass_simple_branch.swc'], stdout=subprocess.PIPE, ...
6613a0adfa068d4ed18e53a4ffb4a5c09e541a09ae4e1a76f11bbe31d79074d7
Python
2,057
79
"""Summarizer for phonopy.""" from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING, cast from monty.dev import requires from quacc import __version__ from quacc.schemas.atoms import atoms_to_metadata from quacc.utils.dicts import clean_dict from quacc.utils.files ...
a5f0dda6685c933c2a49cfb47c1aa7f1a4b941a936984b52338b04898602f8ff
Python
2,057
57
from elasticai.creator.file_generation.savable import Path from elasticai.creator.file_generation.template import ( InProjectTemplate, module_to_package, ) from elasticai.creator.vhdl.auto_wire_protocols.port_definitions import create_port from elasticai.creator.vhdl.design.design import Design, Port from elast...
d264ba84d9596e77d1662e0d9b727b0fb97ce5aeab50af79252f6599cf5243f5
Python
2,057
79
#!/usr/bin/env python3 import os import pandas as pd import numpy as np from sklearn.metrics import pairwise_distances # ------------------------------------------------------------------ # paths # ------------------------------------------------------------------ projpath = '/project/3011157.03/Simon/proj_2022_CABB_...
e7940ba2d4c2c649d07c6397511f4a470f1df9d6600820417e2a3212bd0ad8fc
Python
2,058
78
"""Common defect workflows.""" from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING from monty.dev import requires from quacc import subflow from quacc.atoms.defects import make_defects_from_bulk has_pmg_defects = bool(find_spec("pymatgen.analysis.defects")) has_...
0ccee3397a3e91e3fa0984ed8c03bc712d352b4ebbe64c47de24c219caa319de
Python
2,059
59
import torch import torch.nn as nn def get_module_names_dict(model): """Recursive walk to get names including path.""" names = {} def _get_names(module, parent_name=""): for key, m in module.named_children(): cls_name = str(m.__class__).split(".")[-1].split("'")[0] num_name...