sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
147757a60ada80370603a4662440fdab2756c55e8272f54e85f58519eb7ba879
Python
1,647
49
"""Batch-2D DeepSlice auto-fill: predicts each row's CCF index into the table.""" import os os.environ.setdefault("QT_QPA_PLATFORM", "offscreen") import pytest pytest.importorskip("PySide6") from unittest.mock import MagicMock from PySide6.QtWidgets import QApplication _app = QApplication.instance() or...
2aebd6d0b77939c11e476471bb00ea5692c22c242a5b6a8a659b2da65a5d52a1
Python
1,647
62
#! /usr/bin/env python # -*- coding: utf-8 -*- from downward import suites from common_setup import IssueConfig, IssueExperiment REVS = ["issue648-base", "issue648-v1"] SUITE=suites.suite_satisficing() SUITE.extend(suites.suite_ipc14_sat()) CONFIGS = [ # Test lazy search with randomization IssueConfig("laz...
5ac136caf735f0fcd6f59ff861bfd37ec7e5b7c810b172a71c14ada9cd4e0f78
Python
1,647
59
def update_param(name, param): if name == 'weak_learner_params': param['type'] = 'KeyValue' param['default_value'] = None return param return None # param untouched extensions = dict( __imports__=""" import ast import json from h2o.estimators.estimator_base import H2OEstimator from...
d305790a2b5d1c2a8f15d6758050ba8c986845e81a4bfe4dfa4f0c6b10e63837
Python
1,647
46
#! /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...
425f62c27b7df00bbefb7075f3cbe13d9b04ad154008285405a2adb7b5cd99ce
Python
1,648
54
from elasticai.creator import graph as gr from elasticai.creator.graph.vf2.state import State def test_update_in_nodes(): state = State(graph=gr.BaseGraph().add_edge("a", "b")) state.add_pair("a", "first") state.next_depth() in_nodes = [state.order_back[i] for i, d in enumerate(state.in_nodes) if d ==...
8ead6eb653fc72fba301f1ea8f169f1c918009daaefb5a6f0e3bfc398d314696
Python
1,648
52
from contextlib import suppress from .util import subvals def unary_to_nary(unary_operator): @wraps(unary_operator) def nary_operator(fun, argnum=0, *nary_op_args, **nary_op_kwargs): assert type(argnum) in (int, tuple, list), argnum @wrap_nary_f(fun, unary_operator, argnum) def nary_...
04830ac3d11ed68e3d0e942cfbeabcec5689afedc4b8af0537b273a4f62cee68
Python
1,650
51
# 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...
1f23f1845f318879b72771cfc3767ed5441bab283051b6cb85e18ee48fc587be
Python
1,650
41
""" Automatically create all the behavioral files @author: trianaa1 """ import pandas as pd import sys, os sys.path.append('/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/src/analysis') from utils import get_behav_data, get_behav_data_15days, get_behav_data_tasks, get_behav_data_movie be...
3db40516bb58e7036b99bf27240b51e05fb8629ea94c2270acd4a492555a5afb
Python
1,650
47
"""Auto-generated registration output folder names must be ANTs-safe. Microscope exports often name files after a comma-separated channel list (e.g. "..._DAPI, FITC, ORNG_06_ORNG_05"); commas in the resulting output path break ANTs point transformation (ITK mis-parses the [transform,invert] bracket argument). _sa...
688867eb71bf5744fd75ae9ba46c2ff9768102f14aa80329436a73d5a5d15124
Python
1,650
37
# Create a list of all possible pairs of participants, # and indicate if the pair is real or pseudo based on the real pair list. import pandas as pd from itertools import combinations, permutations # Load the CSV file containing real pairs real_pairs_df = pd.read_csv("/project/3011157.03/Simon/proj_2022_CABB_movie/MRI...
f2c641b13989949a0c28ef9f50484a08267570221a66aab07d3a4c45b05a17dd
Python
1,651
17
"""posthoc_dominant_in_census_2026-10-02.py — POST HOC, descriptive (2 Oct night). The dominant inputs (DOMINANT_INPUTS) of populations inside the two censuses' circuits (receptor neurons, projection neurons, Kenyon cells): is a wrong sign harmful?""" import pandas as pd R = 'D:/eucys'; D = pd.read_csv(f'{R}/06-OUTPUT/...
f401a71f56e767842af60d33f7b751d20a5c2f134df6c842c49cc250644683d2
Python
1,651
58
# 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...
3fef6f2c630f16a2738c19d15da23ff94348217f7685a64af81190f23b3230c4
Python
1,652
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...
4ea89f471efeb0ba28c819da3c2fc93ca1a989984b893e730bbb8cb62b99896b
Python
1,652
51
import os from torch.utils import data as torch_data from torchdrug import data, utils from torchdrug.core import Registry as R @R.register("datasets.BetaLactamase") @utils.copy_args(data.ProteinDataset.load_lmdbs, ignore=("target_fields",)) class BetaLactamase(data.ProteinDataset): """ The activity values ...
5d05657b13dab5a467c1fd1a95de6aac77188d90b24326667e352b4f8a19052b
Python
1,652
52
import numpy as np import yacs.config class Cutout: def __init__(self, config: yacs.config.CfgNode): aug_config = config.augmentation.cutout self.p = aug_config.prob self.mask_size = aug_config.mask_size self.cutout_inside = aug_config.cut_inside self.mask_color = aug_confi...
69f1da372c78a6ad96d260a999cafb375d3740bc59f16973bb0b765999f8fe61
Python
1,652
56
#!/usr/bin/env python import sys, os, subprocess, platform, re from glob import glob from utils import execute BIOSHELL_DIR = "./" BUILD_DIR = "./build" if sys.platform.startswith("linux"): # Ubuntu settings CMAKE_C_COMPILER = "clang-6.0" CMAKE_CXX_COMPILER = "clang++-6.0" elif sys.platform == "darwin": #MacO...
7e94f5beae3dbab2964740c140b6d716e95183af12df992c8ec6ad38446fafbd
Python
1,652
48
import numpy as np import os import time import torch from skimage import color, filters, io from constants import DEFAULT_CANVAS_SIZE from src.preprocessing.helpers import cutdown, resize_padded def preprocess_image_v0(image, simulate_augment=False): # convert to grayscale image_preprocessed = color.rgb2gra...
216465ef47954535b0e8a7b18fa4b4cd4e8b4995432ac590e9acb4baa7878285
Python
1,653
44
#============================================================ # # Artifact reduction from ECG # Download datasets # # author: Ahmed Shaheen # email: ahmed.shaheen@oulu.fi # github id: AhmedAShaheen # #=========================================================== import os import zipfile import argparse import numpy...
0f8313dd36e55e1e485232ab2c1d02d930179f15061a5b0071aecc949e66095d
Python
1,655
57
#! /usr/bin/env python # -*- coding: utf-8 -*- from downward import suites from lab.reports import Attribute, gm from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport def main(revisions=None): suite = suites.suite_optimal_with_ipc11() configs = { ...
cbaa6ae6a3adab062a6d22f5a3f3d197618e98897a6565dee3c9db25b3325400
Python
1,655
43
"""Arrange multiple single-page PDFs into a grid on one page (replaces pdfjam --nup).""" import argparse from pypdf import PageObject, PdfReader, PdfWriter, Transformation def arrange_pdfs_in_grid(input_files, output_file, cols, rows): """Read the first page from each input PDF and tile them into a cols x rows ...
120b721e5cd5aa0af93ab5d77cb3285d89a17533d3092f9393cf8e42df8f4c24
Python
1,656
60
import contextlib from importlib import import_module from importlib.util import find_spec from ._base import LinearModelBase, MethodBase from ._edger import EdgeR from ._simple_tests import PermutationTest, SimpleComparisonBase, TTest, WilcoxonTest def __getattr__(name: str): deps = { "PyDESeq2": ["pyde...
6be8dfd67a9fa10c0a80ecc6ece5cc79b45b323819d6ace29cd1434a432555b5
Python
1,657
32
# 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...
a3cc445a342ea6b6888a5d7dea3cba1cb3ae395e047a23e75630203f99ca23cf
Python
1,657
46
# EyeNED OCT-ONH segmentation and feature extraction # Copyright (C) 2024 Erasmus MC # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your optio...
b4f9a11f52a57de5492329f5dc926bffe2794844505cdbc5b424c183b10e558c
Python
1,657
43
import os.path import gzip from ckg.graphdb_builder import builder_utils ######################### # PathwayCommons # ######################### def parser(databases_directory, download=True): config = builder_utils.get_config(config_name="pathwayCommonsConfig.yml", data_type='databases') url = config['p...
b6c38dd11f765d1624b0cff7858552eebc277316e873fbb60c78a534591d0a71
Python
1,657
40
import numpy as np from pertpy._types import CSBase def check_is_numeric_matrix(array: np.ndarray | CSBase) -> None: """Check if a matrix is numeric and only contains finite/non-NA values. Args: array: Dense or sparse matrix to check. Raises: ValueError: If the matrix is not numeric or ...
e7f646b8833b86eddc869b8b3bf2bee5f0ac5261c29534b5712475c855f2e81f
Python
1,657
55
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from downward import suites from lab.environments import LocalEnvironment, MaiaEnvironment from common_setup import IssueConfig, IssueExperiment, is_test_run REVS = ["issue551-base", "issue551-v4"] BENCHMARKS = os.path.expanduser('~/downward-benchmarks') SUI...
bc568ccd6ed242124e5be8ef7c0d81dfe67669fe9bffa9fdd7386096acb1dadd
Python
1,658
46
from typing import cast from elasticai.creator.arithmetic import FxpArithmetic, FxpParams from elasticai.creator.base_modules.leaky_relu import LeakyReLU as LeakyReLUBase from elasticai.creator.nn.design_creator_module import DesignCreatorModule from elasticai.creator.nn.fixed_point.math_operations import MathOperatio...
007697c2d3e4c6eed2eae376c3c9876b2eac4d24a5db09a51152c490b4f05e41
Python
1,659
49
# 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...
d0d72940c166ee9a0457122345f5ac3ff7aff55b264eabf2ab86e485d7c110c9
Python
1,659
49
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment from downward.reports.compare import ComparativeReport import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport DIR = ...
f521b1401945be435f8042704ef429e11a1ae6678b8c67dffa5264d46bf4da12
Python
1,659
49
#!/bin/env python3 """ Example script to test ithildin.filament """ import ithildin as ith import ithildin.filament as fil import matplotlib.pyplot as plt import sys from itertools import chain # filaments = fil.read_filaments("results/pdl2D_6_tipdata.txt") # filaments = fil.read_filaments("results/ratchet_20_tipdata...
50b0a18cf2b49b04c041415d98fd942aab2c5dccfb9817a358a2ee63046a4423
Python
1,661
44
import pickle # - ((CancerMedian - cutoff)/CancerSD) * ((NormalMedian - cutoff)/NormalSD) cutoff = 0.3 for tissue in ["Bladder", "Kidney", "Prostate"]: #tissue = "Prostate" with open("/home/fruitdragon/workspace/NeuralClassifier/old/data/MIXED/"+tissue+"_Tree10.pkl", 'rb') as cancerFile: patients = p...
9195ce5e027bb0a01391f79ba67df418675cfb5e8f813a22bf55918ff3adbc8a
Python
1,661
56
# 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...
058c8402b2ae2af096085e486da8e7535c6a9f0c9f03693f8d3c686e42236ea0
Python
1,662
44
from torch.utils.data import DataLoader, Dataset import torch import numpy as np class Dataset(Dataset): def __init__(self, root, train=True,to_tensor=True, preprocess_data = False): self.preprocess_data = preprocess_data if preprocess_data: self.Atmax, self.Atmin, self.Stmax,...
c0e2a2e2315aacab6a028aa3540c6cfde63fba8788b2eabf65ce2595ea792518
Python
1,664
51
# 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...
4ac9528333b39a600c1ebd2735d6b2c1efcec44d93227ebd3b2a68ff2919f70c
Python
1,665
62
import cv2 import numpy as np import random import merlin.util.deconvolve as deconvolve import merlin.util.matlab as matlab decon_sigma = 2 decon_filter_size = 9 def decon_diff(image, gt_image): on_gt = np.sum(image[(gt_image > 0)]) off_gt = np.sum(image[gt_image == 0]) return (on_gt/(on_gt + off_gt))...
b3081c4ca3a6ddd68b7974d6eafe41512d938b646f1271914181ffc835e4940a
Python
1,665
52
""" This code wraps the vendored appdirs module to so the return values are compatible for the current pip code base. The intention is to rewrite current usages gradually, keeping the tests pass, and eventually drop this after all usages are changed. """ import os import sys from typing import List from pip._vendor ...
c66ee9968bf89fc691a36ff4cd5faed4edd6c2591d94f1a591684d59e2844e51
Python
1,665
50
from matplotlib import pyplot as plt import pytorch_lightning as L import sys sys.path.append("../..") from shapelearningtheory.datasets import make_dataset L.seed_everything(0) def normalize_image(img): minimum = min(img.min(), 0.) maximum = max(img.max(), 1.0) return (img - minimum) / (maximum - minimum...
e08242b52c7050446c372e8de0c80cafb02708080d8b69065c3a49ad19bb651a
Python
1,665
42
""" This script reads organizes the scores given in the post-scanner scores. Inputs: file Outputs: csv file @author: trianaa1 """ import os, glob, sys import pandas as pd import numpy as np file = "/m/cs/archive/networks-pm/behavioral/questionnaires/post-scanner.xlsx" save_file = "/m/cs/scratch/networks-pm/eff...
5e6852e888def08632da7741b952d8a8a899ce89eb5e473e3e037518bed95ee2
Python
1,666
60
import numpy as np from pymdp.maths import ( softmax_obj_arr, spm_MDP_G, spm_log_single, compute_accuracy, spm_dot, ) from pymdp.utils import to_obj_array def free_energy(qs, prior, likelihood=None): free_energy = 0 # Neg-entropy of posterior marginal H(q[f]) negH_qs = qs.dot(np.log(q...
0351de12a46b080ed4aec38ec1e152b7ce7fec2c16747529dda668ebad36e150
Python
1,667
48
import numpy as np import pandas as pd from anndata import AnnData from sklearn.metrics import silhouette_score import pertpy as pt def _blobs(rng): labels = np.array(["control", "target1", "target2"]).repeat(8) centers = {"control": 0.0, "target1": 10.0, "target2": 30.0} X = np.vstack([rng.normal(center...
8610e0ed0b2a95d35e7ba8cf4f41270596bb72fc8a7f9caa48a4cf84aba86336
Python
1,667
53
from __future__ import annotations from shutil import which import pytest from quacc import get_settings pytestmark = pytest.mark.skipif( which(str(get_settings().VASP_CMD)) is None, reason="VASP not installed" ) import numpy as np from ase.build import bulk from numpy.testing import assert_equal from quacc.r...
798de5f81353c9d9da44dad73edfebafe26132da582bd19b382b1d25a07ae62a
Python
1,668
36
# Perform Signal Space Projection # Mainly working from tutorial https://mne.tools/stable/auto_tutorials/preprocessing/50_artifact_correction_ssp.html # SSP uses singular value decomposition to create the projection matrix # Apply SSP to anteriorly rereferenced data import os import mne import numpy as np import panda...
478d886b00173d262a43f5cd423b9739ca29bc99b0d228828718313d6c01a512
Python
1,669
56
from os.path import exists from pathlib import Path import torch from elasticai.creator.arithmetic import ( FxpArithmetic, ) from elasticai.creator.file_generation import find_project_root from elasticai.creator.file_generation.on_disk_path import OnDiskPath from elasticai.creator.testing import ( build_repor...
5261894978b595c634a1b0eef0506ec7b5726bb7d0163898c3b85b0b09b45d72
Python
1,670
49
from typing import cast import torch from elasticai.creator.base_modules.conv1d import MathOperations as Conv1dOps from elasticai.creator.base_modules.linear import MathOperations as LinearOps from elasticai.creator.base_modules.lstm_cell import MathOperations as LSTMOps from .round_to_float import RoundToFloat cl...
7802115c66a65aca20d4f4c3216400cf45cbdc1c49d57893fe208a881713500d
Python
1,670
69
import numpy as np from .basic_euclidean import eucl_dist from .basic_spherical import great_circle_distance ###################### # Euclidean Geometry # ###################### def e_dtw(t0, t1): """ Usage ----- The Dynamic-Time Warping distance between trajectory t0 and t1. Parameters ----...
cff74cc5acd3ea188855add590bf6e03681142a59cad2d1f5bd55d878e96643b
Python
1,670
67
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',nargs='?',required=True,type=str) args = parser.parse_args() cwd = os.getcwd() sysname = f'{args.name:s}' # se...
d0c6cf7babda3b24b0071e31ad4bb881cbd1d45b25d8a66b2ada3e03d1c857aa
Python
1,670
64
import os import tempfile # see tests/conftest.py, this has to be set before bpy is first imported os.environ.setdefault( "BLENDER_USER_EXTENSIONS", tempfile.mkdtemp(prefix="mn-benchmark-extensions-") ) import subprocess # noqa: E402 import sys # noqa: E402 from argparse import Namespace # noqa: E402 from path...
e11c31b946bfbdf4fafe66794abd77d74d87f56d48b64204263135c1dbbe76bb
Python
1,670
46
from typing import Any from torch import Tensor from torch.nn import BatchNorm2d as TorchBatchNorm2d from torch.nn import Module from torch.nn.utils import parametrize as P class BatchNorm2d(TorchBatchNorm2d): """A BatchNorm2d. The output of the batchnorm is fake quantized. The weights and bias are fake quan...
43c4765c266c847a11ac568fc0be92d64dbe399d01c6ffbb2103f8819f25354b
Python
1,671
48
import torch from torch_geometric.data import InMemoryDataset,Data from os.path import join, isfile from os import listdir import numpy as np import os.path as osp from imports.read_abide_stats_parall import read_data class ABIDEDataset(InMemoryDataset): def __init__(self, root, name, transform=None, pre_transfor...
925b1669ee5bb36378f9723f949093b374d94e77ac16874268dec287ea442e45
Python
1,671
52
from __future__ import annotations from pathlib import Path import pytest from ase.build import bulk, molecule from monty.json import MontyDecoder, jsanitize from pymatgen.io.ase import AseAtomsAdaptor from quacc.schemas.atoms import atoms_to_metadata @pytest.fixture() def test_cifs(): file_dir = Path(__file__...
941083921114c0c4670768c7727fcb786529e58941033336b1de9163b4230409
Python
1,671
47
""" Created on Wed Jan 26 12:55:10 2022 @author: Haotian Teng """ import os,sys,argparse from tqdm import tqdm import h5py import numpy as np from xron.utils.seq_op import fast5_iter from pathlib import Path def retrive_fastq(seq_h): try: seq = np.asarray(seq_h['BaseCalled_template']['Fastq']).tobytes()....
9e0122632c10519af940302b91622cd9b85ad9f9015a40297e513f8d3d2dbe86
Python
1,671
48
#! /usr/bin/env python # -*- coding: utf-8 -*- from downward import suites, configs from downward.reports.compare import CompareConfigsReport import common_setup REVISIONS = ["issue425-base", "issue425-v1"] exp = common_setup.IssueExperiment( search_revisions=REVISIONS, configs=configs.default_configs_satis...
c3eb237d5f10fdad99407e1cd8feb815bc9f833bfacba0e765fbd0f4b6fd2c8d
Python
1,671
54
import os from opentelemetry.context import Context from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import ReadableSpan, Span, SpanLimits, TracerProvider from opentelemetry.sdk.trace.export import ( Bat...
62b47b6222ba93aa1b4bb8ee0f667b09d82b0f6bd672a46f7ffa47f49edcf280
Python
1,672
67
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',nargs='?',required=True,type=str) args = parser.parse_args() cwd = os.getcwd() sysname = f'{args.name:s}' # se...
45f2fe043df3f9c1170a234af54a63053450c1dbed51388b4010dfca3d6642cb
Python
1,673
47
# # 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,...
067c5179107af0fcd709fee5a166d5ade5e239fa42b15c6d78e283dfe4e404e4
Python
1,674
73
import argparse from pathlib import Path def add_run_mito_arguments(parser: argparse.ArgumentParser) -> None: parser.add_argument( "--mesh-file", type=Path, default=Path("mito_mesh.h5") ) parser.add_argument( "--curv-file", type=Path, default=Path("mito_curv....
71f990f579105a14f18aec398dfe10f1440795e31cd672634134c9ed1cffeca5
Python
1,674
52
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import suites from lab.reports import Attribute, gm from common_setup import IssueConfig, IssueExperiment try: from relativescatter import RelativeScatterPlotReport matplotlib = True except ImportError: print 'matplotlib not available, scatter plots...
83ad183cd88e6c308ec4ccb51f5e752c682f8e53a10a8fc0335b2bc7ffda2f72
Python
1,674
63
# Node group ".MN_mask_transparent" (ShaderNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # Shared by several assets, which import it; not an asset itself. # _build_group() is the source of truth: the docstring, __init__ and accessors are regen...
47c4b88922a4da879aa933afd498028eee665a851fc88ddcc2f870826a49f1a7
Python
1,675
65
import autograd.numpy as np import autograd.numpy.random as npr from autograd import grad from autograd import isinstance as ag_isinstance from autograd import tuple as ag_tuple from autograd.test_util import check_grads npr.seed(1) def test_getter(): def fun(input_tuple): A = np.sum(input_tuple[0]) ...
d851fd272969ba447f1f4c4f2e057ea6a5561d2cf17c3325e7e88a711657febf
Python
1,675
71
import matplotlib.pyplot as plt import numpy as np import meep as mp # set up the geometry eps = 13 w = 1.2 r = 0.36 d = 1.4 N = 3 sy = 6 pad = 2 dpml = 1 sx = (2 * (pad + dpml + N)) + d - 1 fcen = 0.25 df = 0.2 nfreq = 500 cell = mp.Vector3(sx, sy, 0) blk = mp.Block(size=mp.Vector3(mp.inf, w, mp.inf), material=mp....
f2bd6bb56e94a8dccb8c2120b85cfb48c4b4c06912b1ddbd80a7442d43489755
Python
1,675
54
#! /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_D...
45336220cba617bdf17e7c18bf897041777e35a30909fc3da7344a844a665e3a
Python
1,676
48
from __future__ import (absolute_import, division, print_function, unicode_literals) import json import os import argparse parser = argparse.ArgumentParser(description="Setup all parameters for slice time correction file generation for FSL") parser.add_argument("jsonfile",help="location of json...
75fe98a2c8395f9b8f1989543d07d7b93c57e38c3d8f619e8d54c15559c32030
Python
1,676
52
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import suites from lab.reports import Attribute, gm from common_setup import IssueConfig, IssueExperiment try: from relativescatter import RelativeScatterPlotReport matplotlib = True except ImportError: print 'matplotlib not available, scatter plots...
39e1f50fc1d05daf395d41e43d8d5c8585bfec07d3c53ff859c5aa6e730eebca
Python
1,678
54
# 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...
4176fc0357af9b3381a929e8592cc06e72d385d184034a14ad0360afa4e57560
Python
1,678
53
def update_param(name, param): if name == 'weak_learner_params': param['default_value'] = None return param return None # param untouched extensions = dict( skip_default_set_params_for=['training_frame', 'ignored_columns', 'response_column', 'max_confusion...
68058dec8688d4293cbc5827b440e8874a8d930547ae0bd81e61384b67443503
Python
1,678
17
"""Post hoc (6 Oct, after FLYVIS_CENSUS F2 PARTLY): the pre-registered predictor pooled input over all 8 T4/T5 types, which dilutes inputs that reach only T4 (Mi4, Mi9) or only T5. Here: a source type's largest share onto any single T4/T5 type.""" import json, os, numpy as np, pandas as pd from scipy.stats import rankd...
cf840e022cdbd2ac64eeb3783fbfdaa430915b3c7f51a7485a2eed3d938b605f
Python
1,678
43
""" toposampling - Topology-assisted sampling and analysis of activity data Copyright (C) 2020 Blue Brain Project / EPFL & University of Aberdeen This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation...
e1a124d082ee08a693c05bbf33e8dd5ddcf8063e21204c7de35007f4e0d60340
Python
1,678
56
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment import common_setup from common_setup import IssueConfig, IssueExperiment DIR = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] REVISIONS = ["i...
37f00a260d1d8bc581bb525e1f886fed1c049c6f63c524de9faa7b076fa2713f
Python
1,679
82
"""This file doesn't import the numpy wrapper, to check if core works on basic operations even without numpy.""" import warnings from autograd.core import make_vjp from autograd.wrap_util import unary_to_nary @unary_to_nary def grad(fun, x): vjp, _ = make_vjp(fun, x) return vjp(1.0) # Non-numpy gradient c...
807b36e2b54b2ff6ff2c5940fa6c2e7033f0f12cb58881c3f2824290bea8101b
Python
1,679
52
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import suites from lab.reports import Attribute, gm from common_setup import IssueConfig, IssueExperiment try: from relativescatter import RelativeScatterPlotReport matplotlib = True except ImportError: print 'matplotlib not available, scatter plots...
98995d76ccc6aa07b59f600b2ef27553bb08dd60579e913dc47e06fa139b89ae
Python
1,679
52
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import suites from lab.reports import Attribute, gm from common_setup import IssueConfig, IssueExperiment try: from relativescatter import RelativeScatterPlotReport matplotlib = True except ImportError: print 'matplotlib not available, scatter plots...
d2808c7b820f5fc5fa4f8204a8937a298b016ad566d4b4f9397dee4a6323bc02
Python
1,679
52
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import suites from lab.reports import Attribute, gm from common_setup import IssueConfig, IssueExperiment try: from relativescatter import RelativeScatterPlotReport matplotlib = True except ImportError: print 'matplotlib not available, scatter plots...
74425e295ea7f6a30e8e856f2a6b65f972c84e6f23c378eeb54f629269403482
Python
1,680
54
# 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...
c77fba02fa3a54a2978d2802861088a791e2a5e1eee016aed0f99cbdb7c57cfe
Python
1,680
61
# ****************************************** # # SHARC Program Suite # # Copyright (c) 2023 University of Vienna # # This file is part of SHARC. # # SHARC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software ...
fed1def235f2c66cf4a9f67eb7b294ac4bdbb6e8fc4febb2c1ecc0d14d04591f
Python
1,680
54
"""Download Dreem datasets. Modified from https://github.com/Dreem-Organization/dreem-learning-open/blob/master/download_data.py """ import argparse import boto3 import tqdm from botocore import UNSIGNED from botocore.client import Config from pathlib import Path def download_data(dst_dir: Path): client = boto3....
998403db95d480777d089d1fbc32ddeb39425a45cf976f65d74c8532505df137
Python
1,681
65
# -*- coding: utf-8 -*- # # Simple script for testing Syncopy w/o pip-installing it # # Builtin/3rd party package imports import numpy as np import os import sys # Import package import syncopy as spy # Import artificial data generators from syncopy import synthdata # Prepare code to be executed using, e.g., iPytho...
b59088e04e02be4885bc0ea51e000803bee47d2b857044f14819925ad9986833
Python
1,681
59
import tensorflow as tf import tensorflow_addons as tfa import os import numpy as np import matplotlib.pyplot as plt from skimage.morphology import area_closing # from tensorflow.kera import utils # Specify entire folder, not saved_model.pb loaded = tf.keras.models.load_model(r'C:\Users\leroy.volmer\PycharmProjects\Bo...
ead8a25243c6bffc8e977f04660a5233eebe917be4ec5028d5cad87091660eea
Python
1,681
46
from elasticai.creator.arithmetic import FxpArithmetic, FxpParams from elasticai.creator.base_modules.leaky_relu2 import LeakyReLU2 as LeakyReLU2Base from elasticai.creator.nn.design_creator_module import DesignCreatorModule from elasticai.creator.nn.fixed_point.math_operations import MathOperations from .design impor...
4b934221249c3de22b2b021e5d1c1d265de457d4389ea65f9cd3c3c7a1dffff8
Python
1,682
51
# Copyright 2016 Julien Danjou # Copyright 2016 Joshua Harlow # Copyright 2013-2014 Ray Holder # # 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 #...
9889a30debf1b5c64880506bb310d53d07f7d831abb31da4fa4a2d640e06bd41
Python
1,682
48
#! /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...
a96c9778485d4e9a7e5dbec1fcdfd0fb78008c4e93275e409dc48f82467b8f83
Python
1,682
64
import random import unittest import torch import torch.nn as nn from torch.utils.data import Dataset from torch.utils.data.dataloader import DataLoader from torcheeg.trainers import SimCLRTrainer, BYOLTrainer class DummyDataset(Dataset): def __init__(self, length: int = 101): self.length = length ...
20c43b3d7aaf8fd324a9aeaae604fa0bd370824ed825d1eb7197a4eff8640a47
Python
1,683
59
#! /usr/bin/env python # -*- coding: utf-8 -*- from downward import suites from downward.experiment import FastDownwardExperiment from downward.reports.compare import CompareConfigsReport from relativescatter import RelativeScatterPlotReport import common_setup REPO = common_setup.get_repo_base() REV_BASE = 'issue58...
4f3102899a0228d32a83053be9c3c278a58506a696bc074b31ebf9fdb0a4858f
Python
1,683
85
""" All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) """ from enum import Enum, Flag class InputState: """ This enum represents the different states a universal detector can be in. """ PURE_ASCII = 0 ESC_ASCII = 1 HIGH_BYTE = 2 ...
7f36cdedfe9fd763346ff2244b6eb09c9af2adca17ec362ed92b4f9d76277e47
Python
1,683
43
import torch from torch import nn from torch.nn import functional as F from wsilearn.dl.models.model_utils import create_bn_act_drop_conv, create_conv_bn_act, create_conv, create_activation #https://d2l.ai/chapter_convolutional-modern/resnet.html class ResBlock(nn.Module): def __init__(self, in_channels, out_chan...
c9990002e087186be9101a87b2862ee4750234c06dc9e822ce099f104adfc357
Python
1,684
42
#------------------------------------------------------------------------------------------------------------------ # Author: Brandon S Coventry Purdue University/Wisconsin Institute for Translational Neuroengineering # Date: 05/21/24 Nice Cloudy Day today # Purpose: Setup file for SpikerNet #------...
f8689d3123afa6711643dae280d67dae7b0e67424debb5613a42d7b9c04f2298
Python
1,684
70
from focal_aug import get_unet import glob from cv2 import imread from PIL import Image from skimage.transform import resize import numpy as np from matplotlib import pyplot as plt from skimage.morphology import label from pycocotools import mask as maskUtils from tqdm import tqdm import os import cv2 from keras.layers...
5110eefc86fb0a499bdb283feb9fe5e21e32745d02e007116a2206f9289b1924
Python
1,686
49
# SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL # # SPDX-License-Identifier: AGPL-3.0-or-later ''' Compute correlations of (sub)population Last updated: 12.2023 ''' import conntility from scipy.spatial import distance import numpy as np import json import sys sys.path.append('../../../library') from preproce...
6a003f454dd1fc7c54bc3d3fc7917b0dcce44f2d82c0a9da951f6144826d894e
Python
1,686
56
r"""Test OpenBabel executables from Python Note: Python bindings not used On Windows or Linux, you can run these tests at the commandline in the build folder with: "C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake -R pytest -VV You could also "chdir" into bu...
6eae3c8b176d851b291a6eecdb8ebf0416f033b311f99b97e27b6f96a5fd47b7
Python
1,686
37
from setuptools import setup import versioneer LONG_DESCRIPTION = """Converts nifti files (raw and mask) and mrtrix tck files to DICOM format readable by Brainlab surgical planning and navigation systems. Tck files are converted to 3D objects that can be manipulated by Brainlab tools. Label images are converted to a d...
b5f0175c8383facf77f461d95c82a23c0001fd29aa2b37c3c2936ebc8252f22e
Python
1,686
53
# import logging # import warnings # import datetime # import numpy as np # # -------------------------------------------- # # report software running logging # # -------------------------------------------- # # # -------------------------------------------- # # MAIN FUNCTION # # --------------------------------------...
c5b76956c19934f4ead2329df960332ede4554c4851d080c820eef663ca57d9b
Python
1,686
44
import os import numpy as np import argparse from cmdstanpy import CmdStanModel from datetime import datetime parser = argparse.ArgumentParser(description="index for the mouse id") parser.add_argument('mouse_idx', type=str, help='index for the mouse id, starting from 0') args = parser.parse_args() mouse_idx = int(args...
e819c09a4d9740b3c0b1fcdb9b6dc92366bf269ee7cbe18d35245805a0001ebc
Python
1,686
50
from setuptools import setup, find_packages import re VERSIONFILE = "cocoa/__version__.py" verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: verstr = mo.group(1) else: raise RuntimeError("Unable to find version string in %s." ...
5b75d889d862a98d59256ecf47d07497ddfcbf1a5622c9a281988b731834c362
Python
1,687
60
import scanpy as sc import numpy as np import pandas as pd import scvi from scvi.model import CondSCVI, DestVI import sys import os scrna_path = sys.argv[1] spatial_path = sys.argv[2] celltype_key = sys.argv[3] output_path = sys.argv[4] sc_adata = sc.read_h5ad(scrna_path) st_adata = sc.read_h5ad(spatial_path) # f...
b5585f94d9b627ec25e295f954c9b2cf7d17f8062ac5fcee21002cb75477a6e0
Python
1,687
49
""" Optuna example that runs optimization trials in parallel using Dask. In this example, we perform hyperparameter optimization on a RandomForestClassifier which is trained using the handwritten digits dataset. Trials are run in parallel on a Dask cluster using Optuna's DaskStorage integration. To run this example: ...
f5e551add83428bae30f4790d48ee2f5d0c4c6be4bc3b6172214a4d7c1a982d2
Python
1,687
46
#!/usr/bin/env python from IlluminaBeadArrayFiles import GenotypeCalls, BeadPoolManifest, code2genotype import sys import os import glob import argparse parser = argparse.ArgumentParser("Generate a final report from a directory of GTC files") parser.add_argument("manifest", help="BPM manifest file") parser.add_argume...
5022cc1c4779cd7fd7bdce2b9bb2d20791a1cd85eb72ac11853b9b40313c84fa
Python
1,688
54
"""Preprocess empatica data. Reads all empatica data splitted in days, aggregates them by day, and saves them in the given savepath. The input should be done in the following order: Parameters ---------- path : str path where the raw data is stored savefile : str """ ...
eeebb896bd0145a6957babb3976fddff01f9b6d26bf0ce82f00bd4d8166d6940
Python
1,688
56
###################################################################### # # wgtRotorSrch.py: weighted rotor search (conformer search) # ###################################################################### from __future__ import print_function from openbabel import openbabel import sys # Make sure we have a filename ...
dfaca3f7445e3ef2551e145c982a102fc56f016b650593b0f6d49e0d13f171b9
Python
1,689
22
"""posthoc_uncalled_share_2026-10-08.py (POST HOC, descriptive). Where do the neurons that FlyWire leaves uncalled sit: in the circuits the laboratory checked (the 106 SEZ types of the optogenetic screen, the named taste neurons) or in the antennal lobe's local neurons? Output: 06-OUTPUT/posthoc_uncalled_share.txt""" i...
4f5e32dd8d27fcf87bc5d7a58da0bcfea8527acca0e8ce6a04e4850d9af4ee32
Python
1,690
57
"""Python port of geometry-processing-mouse-brain. Original MATLAB implementation by Agarwal et al., "Geometry Processing of Conventionally Produced Mouse Brain Slice Images" (Journal of Neuroscience Methods, 2018). """ from .atlas import atlas_segmentation from .edges import ( canny_edge_magnitude, ...
b1f3056c51aad2c5d19d2a8b2cc0c2852dd021bdef0b0a9948d50688526b1f99
Python
1,690
69
import numpy as np import scipy.io as sio import torch import torchvision from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from models import UNetSAR import pickle import os import matplotlib.pyplot as plt import json # config = { # "batch_size...