sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1b8716ebcdadbe4af93c95d2bfd2a3dec9b29d518d91848c68c3ac37c39890a2
Python
16,736
474
# Mildred A. Herrera, Wojciech Ambrosiak # Jan Siemens lab # University of Heidelberg import matplotlib.pyplot as plt #library for plotting import numpy as np #numeric library import pyabf #library to open *.abf files from scipy.signal import medfilt from scipy.signal import convolve from scipy.signal import savgol_fi...
1cf52293e385a585d108fe9b09e6c8c6585dc1162750a2db542b77750e02278d
Python
16,738
348
""" Script for extracting particles from a filament network in a single membrane graph Input: - A STAR file with a list of graphs (MbGraphMCF) as it is returned by by mb_fils_network.py script: + Density map tomogram + Segmentation tomogram + MbGraphMCF...
859676b4adb21f1389cf2ec070ae0cf7255c3711809e1ba5006d3e7d7d7b6030
Python
16,740
358
# 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 control.tracking as tracking from control.core import * from queue imp...
be1d8b4a10164b108f50be52009e4f10475b804cfb21561fb4efbac4e447944c
Python
16,743
410
# 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...
f8f0e58e819532373237926128b3165399203f776cd45db90d93c9222cbcf151
Python
16,745
491
#! /usr/bin/env python # ---------------------------------------------------------------------- # Copyright (C) 2018, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can re...
64d3063e72dfe1ff5dbcb4996cbacb60ac98eb6998c1a14b607461bb0364df70
Python
16,748
336
import os import unittest from unittest.mock import patch import pandas as pd from hed.errors.exceptions import HedFileError from hed.tools.analysis.key_map import KeyMap from hed.tools.util.data_util import get_new_dataframe from hed.tools.util.io_util import get_file_list class Test(unittest.TestCase): @class...
5e993d9adb407e731f2daa2d12a3e5bcd6f36e6b497cd679834291b873c18805
Python
16,752
433
# # Test module for ACME validation functions # # Copyright © 2026 Ernst Strüngmann Institute (ESI) of the Max Planck Society # # SPDX-License-Identifier: BSD-3-Clause # # Builtin/3rd party package imports import pytest import numpy as np import os import tempfile import types import datetime import time # Local impo...
8a6e0eb7a5006f24b658e681d2273d185d95682584bb8eafd7899a17a215974e
Python
16,760
232
import numpy as np import copy import torch from torch_geometric.loader import DataLoader from utils.diffusion_utils import modify_conformer, set_time from utils.torsion import modify_conformer_torsion_angles from scipy.spatial.transform import Rotation as R from utils.affine import T from utils.geometry import axis_...
b3aa98be1518a9206c5a7f22c0e21d7c2cfae965f0aa2060414ab044f510b528
Python
16,769
348
""" Script for extracting particles from a filament network in a single membrane graph Input: - A STAR file with a list of graphs (MbGraphMCF) as it is returned by by mb_fils_network.py script: + Density map tomogram + Segmentation tomogram + MbGraphMCF...
16f8b7518ffd2ce39a8cd2d92632ca334b28639cba06797c39a82e2409740caa
Python
16,770
484
# 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...
d3491449d0874b0c70ec08d543084d232ceedac383f4ca311e56d2f51af0eae2
Python
16,776
442
# -*- coding: utf-8 -*- """ Created on Fri Jun 7 17:07:42 2024 @author: mpolonen """ import numpy as np import pathlib import scipy.signal as sig from expyfun.io import read_hdf5, write_hdf5 import matplotlib.pyplot as plt import pandas as pd import seaborn as sns plt.ion() src = pathlib.Path(__fi...
4b379d22caeeca798cabd9e25a418380acef8f54807968a2b59481515bb87285
Python
16,781
379
from itertools import product import numpy as np from examples.drake.iiwa_utils import open_wsg50_gripper, get_box_grasps, get_top_cylinder_grasps, \ get_close_wsg50_positions, get_open_wsg50_positions from examples.drake.motion import plan_joint_motion, plan_waypoints_joint_motion, \ get_extend_fn, interpola...
12948ae262a9f137424b6cbb3ec2b96377fcdae2e9b29b8642c9770b6d3c4863
Python
16,783
337
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from RNNs import recurrent_networks import sys, os, scipy.signal #################################################################################### #Used to initialize weights for policy and value output layers def normalized_columns_i...
b1974f76f40745a7e5c2abccccd2e1ea862aa6d996ce50d1058bedfb98fb587c
Python
16,783
474
import os import time import logging import math import argparse import numpy as np from PIL import Image, ImageOps from collections import Counter, OrderedDict, defaultdict import torch import torch.nn as nn from torch.autograd import Variable import torch.backends.cudnn as cudnn import torchvision from t...
0da6760afc6461defe9bbbf5700d4721da839021971326baf6d7e5b39d8a6048
Python
16,794
417
"""Smoke + signature tests for untested public registration functions. These functions are part of the registration pipeline but had zero direct test coverage per audit: - register_ndim (the unified 2D/3D dispatcher) - transform_input_data (volume-transform analogue of transform_input_points) - count_registered_...
ef27b1b054928e48aff0c3d3daf8002f0058732ca3046a11131e86ef60125722
Python
16,794
424
### Define a few global variables import os import numpy as np # Path for figures, data figure_path = "../figures/" data_path = "../data/" # Random state rng = np.random.RandomState() ### Plotting # Fontsize fs = 12 # Figure labels flbs = ["(%s)"%s for s in "abcdefghijkl"] flbs = ["%s"%s for s in "ABCDEFGHIJKL"] #...
299c18cf8a6bd382e797ed4375b26aa40abc088904aee7fb42719b8d436675a5
Python
16,803
458
# 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...
cd845ab8578df83393d8c4b18d7efe5cb24c72afa06706e0a68538ea5ee17de0
Python
16,803
396
"""Compare PyPREP results to MATLAB PREP.""" from urllib.request import urlopen import mne import numpy as np import pytest import scipy from pyprep.find_noisy_channels import NoisyChannels from pyprep.reference import Reference from pyprep.removeTrend import removeTrend # Define some fixtures for things that will b...
331b4a7170121edccd8ff1f65264a6dc74993e7bcd67d36b095e82b8eb3ea584
Python
16,815
539
import os import torch import yaml import numpy as np from PIL import Image import torch.nn.functional as F def clear(x): x = x.detach().cpu().squeeze().numpy() return normalize_np(x) def clear_color(x): x = x.detach().cpu().squeeze().numpy() return normalize_np(np.transpose(x, (1, 2, 0))) def no...
9ade7af61463b05c6c3506091b32e53242b4702e73e9fad8f4a3529c9407dffd
Python
16,817
390
# -*- coding: utf-8 -*- # modified from:https://github.com/murufeng/FUIR/blob/main/basicsr/models/archs/SCUNET_arch.py import math import torch import torch.nn as nn import numpy as np from einops import rearrange from einops.layers.torch import Rearrange, Reduce from timm.models.layers import trunc_normal_, ...
dba91750908b946a697f9c6d9ee09d80fbbdd8f359cac96c12df5a66cdc9c23c
Python
16,828
488
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 26 13:05:23 2021 @author: joaquin """ import matplotlib.pyplot as plt import seaborn as sns import numpy as np import scipy.io import pandas as pd import os import mat73 from scipy import signal from scipy import stats from statsmodels.tsa.stattoo...
3c9e61373267e364591a1cc2e5a5b0b6f509bb9d43a0701e3b0dfd4b0dd2c2ad
Python
16,836
485
""" Measures distance from STAR files particles to segmentations and splits them according their distance Input: - STAR files - Segmentation - Distance parameters - Particle template preprocessing settings Output: - The splited STAR files """ __author__ = 'Antonio M...
2c565ef702bf8cfeb72650a7b3afe8001339861620564415dbd63b2f9075ea83
Python
16,841
380
from math import log import pickle import os from random import shuffle, randint, seed import time import sys METHYLATION_CUTOFF = 0.3 class DTNode(): def __init__(self, cancerDataSet, healthyDataSet, locations, remainingQuestions, forbiddenQuestions, healthyRatio, NA_VALUE = -1): myPrint("Starting analys...
08ad20c70043ffc59d18c0b16e9aed64f08ad0ef8cbc4aca2adc5897324d2deb
Python
16,844
341
# -*- coding: utf-8 -*- from typing import List, Tuple import torch import torch.nn as nn from supar.config import Config from supar.model import Model from supar.models.const.aj.transform import AttachJuxtaposeTree from supar.modules import GraphConvolutionalNetwork from supar.utils.common import INF from supar.util...
4cef59ad687996404acfd3c0c1518a314cc25c287c01c825b9e32a2e235823b6
Python
16,859
430
# \file TestRegistration.py # \brief Class containing unit tests for module Stack # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date September 2016 import unittest # Import libraries import SimpleITK as sitk import itk import numpy as np import os # Import modules import niftymic.base.stack as st im...
11f34e94b01d5e16c376afb8066236607461f790b1b56fb6e902f31d0c6c5ca4
Python
16,861
407
# 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...
3b00c50cecf73a9e47ab8756c08364aa372c223e5f0a619271342a222093a107
Python
16,874
365
import argparse import numpy as np import os import pandas as pd import random import sys from tabulate import tabulate from typing import Tuple import torch from constants import BIN_LOCATIONS1, BIN_LOCATIONS2, N_ITEMS from src.models import get_reyclassifier, get_reyregressor from old_code.dataloaders.dataloader_ite...
a4ecbbcc1ee885720973fd5e9fe5b0850e1507c1b5b396e1f1995e17405901c5
Python
16,891
426
# Adopted from optical_nls.py from all-optical-neural-networks https://github.com/tomdbar/all-optical-neural-networks import torch from utils.complex_utils import complex_utils as Z from utils.optics_utils import super_gaussian, gaussian, gaussian_beamlets class PhaseReset(torch.nn.Module): def __init__(...
6c387661a3304d92ea6636120bfd09361ab9a80f4e20d90435b4fefff01580bb
Python
16,892
508
import argparse import cv2 import time import numpy as np import threading from control._def import * from ids_peak import ids_peak from ids_peak_ipl import ids_peak_ipl from ids_peak import ids_peak_ipl_extension def get_sn_by_model(model_name): ids_peak.Library.Initialize() device_manager = ids_peak.Device...
1d9bbbaa55aa46c6743f20d5cf7df7f5cd430d7131ff823f5619b19297ede36f
Python
16,893
540
# # 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,...
a877a57e2867b5a5db26f525974d8e35a470c6c7203496ccd4ebe1d626a0c547
Python
16,893
406
""" PyQt5 dialog widgets for the stitching GUI. Owns: - ``StitchingPreviewWorker`` - QObject/QThread worker that stitches a single section preview in the background and emits results via signals. - ``PreviewWindow`` - QDialog that lets the user scrub through sections and open per-section napari pre...
14efbb5b7781be63c8d205dcf64bc62abd344d5bbd637d12cc96c2a0b4912aa7
Python
16,895
543
import jax import jax.numpy as jnp import numpy as np from functools import partial import functools from typing import (Optional, Sequence) # from jax.scipy.special import logsumexp import matplotlib.pyplot as plt from jax.scipy.special import gammaln from netket.utils import mpi import tqdm import flax import jax im...
d4d6a3f73e6e4a4287fc0073f55008661a2697a53c9ba83e697975704e2a6beb
Python
16,895
476
"""Schemas for molecular DFT codes parsed by cclib.""" from __future__ import annotations import logging import os from inspect import getmembers, isclass from pathlib import Path from typing import TYPE_CHECKING import cclib from ase.atoms import Atoms from cclib.io import ccread from quacc import QuaccDefault, ge...
3603479a5c742c57063b07ccb98b1301c69d31fc68fe953bea82a3107cf706dc
Python
16,897
428
from collections import OrderedDict from typing import Tuple import torch import torch.nn as nn import torch.nn.functional as F class SSTEmotionNet(nn.Module): r''' Spatial-Spectral-Temporal based Attention 3D Dense Network (SST-EmotionNet) for EEG emotion recognition. For more details, please refer to the f...
8aee6f913e21d9b5769d7bba825f48b8a578c25677dc91a18f1ddc957c623856
Python
16,898
427
# 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...
e110f4fa34721551106df8f3cf096472da4e959f8264765816b54ca7e548d164
Python
16,910
398
import argparse import cv2 import glob import mimetypes import numpy as np import os import shutil import subprocess import torch from basicsr.archs.rrdbnet_arch import RRDBNet from basicsr.utils.download_util import load_file_from_url from os import path as osp from tqdm import tqdm from realesrgan import RealESRGANe...
30e889e09f7cbbdd82042fcd09acb51407c23f6444d7ab6bd32740ebd1733ed5
Python
16,911
476
# 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...
f859f9f44edf490e41d68a99213e57ccec457a56737cd8b5f5008e18cdc31bfc
Python
16,918
429
import os, argparse, math import numpy as np from glob import glob from tqdm import tqdm import sys import time import logging import shutil from medpy import metric import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.optim as optim from medpy.metric.binary import hd, dc, assd, ...
53ea8f60a7554bf5dd04bf674af827db38c2fe7266b3993c080dc8686467f2a3
Python
16,920
360
# -*- coding: utf-8 -*- # @title Emulate configuration file similarly to fpga # @file emulate_fpga.py # @author Romain Beaubois # @date 06 Oct 2023 # @copyright # SPDX-FileCopyrightText: © 2022 Romain Beaubois <refbeaubois@yahoo.com> # SPDX-License-Identifier: GPL-3.0-or-later # # @brief ...
7513a0e0076568d6db1c017c07afdc1f9611a4d71d4e08c6de0e6fb47ef08f49
Python
16,926
292
import os import time import numpy as np from geometry_functions import EikonalGeometry from propagation_models import EikonalDjikstraTet, PrescribedLAT from cellular_models import CellularModelBiomarkerDictionary from ecg_functions import PseudoEcgTetFromVM from electrophysiology_functions import ElectrophysiologyAPD...
00bf980b38a5fb2f3ea803f8da58e06a80191aadb08f7927b27ac432601053ac
Python
16,931
367
import concurrent.futures import multiprocessing as mp import os import tempfile import threading from pathlib import Path from unittest.mock import patch import numpy as np import pandas as pd import unittest from torcheeg import model_selection from torcheeg.datasets import BaseDataset from torcheeg.io import EEGS...
3a1b0d884255d5ddd5f16e9ecc396efc5d7bf2ea68ca915a390fd38840008855
Python
16,939
331
import argparse import os import os.path as osp import torch import torch.nn as nn import torch.optim as optim import network import loss import pre_process as prep from torch.utils.data import DataLoader import lr_schedule from data_list import ImageList import multiprocessing def image_classification_test(loader, m...
04cffd127a693271b3ab10887299427b5ec429c3db5aa1fd7197a8174c288702
Python
16,946
537
# 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...
470a2eeb90469ce8a9a1617a9aa73fbfe6804f0a1213c9ad33e8312c0fb90197
Python
16,947
390
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 16 08:00:51 2020 @author: daltonm """ #%matplotlib notebook import numpy as np import matplotlib.pyplot as plt import dill import os import time import glob from sklearn.metrics import auc import statsmodels.api as sm from scipy.fft import rfft, r...
ad0ae5c789ece83f0581d4faeefcba5b0cbd41c45781e2837b3b24de5183f019
Python
16,950
351
"""Shared test fixtures for the regtools test suite. Provides a suite-wide autouse guard (``_no_real_window_spawn``) that keeps a test run from putting a real window on the developer's screen: no terminal launches through ``_TerminalJobMixin``, no tkinter modals, headless matplotlib. See that fixture's docstring ...
54a3b9c24e48dac6b09a0b9461e272c56db95d5988ea5b2a2e86a8aacac19559
Python
16,959
428
# MIT License # # Copyright (c) 2020 Mehran Maghoumi # # 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, mer...
cc2d92dbaec250226351fe60645d118860e6e3311c1959b4a9c7f2b5accf3715
Python
16,967
428
"""Tests for cog._adt module (FieldType, PrimitiveType).""" from typing import Annotated, Any, Dict, List, Optional, TypedDict import pytest from typing_extensions import TypedDict as ExtensionsTypedDict from cog import Opaque from cog._adt import FieldType, PrimitiveType, Repetition class ExampleTypedDict(TypedDi...
2d4a613ccf75dd28c3b3107221f54f1abd6d109d5eff7cf8149c3aee6d676e4e
Python
16,973
485
"""Morphology reconstruction data structure.""" import math from collections import deque import numpy as np from treem.io import SWC, load_swc, save_swc from treem.tree import Tree from treem.utils.geom import norm, rotation_matrix class Node(Tree): """Morphology data storage.""" def __init__(self, value...
3078c150a86e567c1449bcc2d066b7e2d1459ca7a9a7dcdeaa83bced2e4bddda
Python
16,974
370
import argparse import collections import gzip import math import os import random import shutil import subprocess import sys import time import numpy as np import pandas as pd import utils import tabix as tb import tensorflow as tf import pybedtools as pybt import pyximport; pyximport.install() import cython_fxn f...
8ff0c2793f0d911d2e052eb09f602e1cf47d8c13279ad3967f7d50179429a8ad
Python
16,975
368
import argparse import collections import gzip import math import os import random import shutil import subprocess import sys import time import numpy as np import pandas as pd import utils import tabix as tb import tensorflow as tf import pybedtools as pybt import pyximport; pyximport.install() import cython_fxn f...
10b4b0bfa699fc536e2a386a4189d15fd0d9a8567ab351dede26334a5d7d1818
Python
16,986
481
# 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...
569b867857699fc054ebd1919ee5920ad4fba0d070d393646ca157418b454782
Python
16,995
478
# 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...
637dca0c18364755633364b3c2706c2456c5715a95f9869599a8ba467653826f
Python
17,002
461
# 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...
8af2a54c668d220616b93f5f7808aaa0c7951cc3dc763338976e6335014879b4
Python
17,006
499
""" @Mariellapanag Created on March 2023 @author: mariella Functions for computing abnormalities from continuous iEEG data. Includes load_atlas load_patient_channel_json get_info_from_parc_scale match_most_common_channel_set keep_consensus_chan subset_channel_df map_chan2rois map_c...
4710188776d4711920fd50f763bd2196b24e38cac681295f4a17a4558c9bebd3
Python
17,007
504
""" Logic for template building Execute using the 'bifrost' executable installed by setuptools """ import logging import os import shutil import sys from glob import glob import ants import numpy as np import scipy from skimage.exposure import equalize_adapthist from skimage.filters import threshold_triangle as tria...
77c8481f0c0d37495518937b443eb322e74daa19724daae7f23a4c9f479983ee
Python
17,015
316
##### MODEL AND DATA LOADING import time start = time.time() import torch # torch.cuda.empty_cache() import torch.utils.data import torchvision.transforms as transforms import torchvision.datasets as datasets from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt import cv2 from PIL imp...
e65181a96b283f6f9c78bf8d4908c592fc6657bb7652350254c444a68d2009e0
Python
17,017
460
import numpy as np import csv from cv2 import imread from preprocess import preprocess, preprocess_basic import os from helpers import File, create_directory from sklearn.utils import shuffle import time import math from collections import defaultdict from restore_predict import restore from config import DATA_DIR, DE...
d8d9efb75e6b963c00274d64006d5d915d1b482ef76c0fd2a89d7fefa5fe4cf1
Python
17,018
380
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """flyb_to_bin.py —— 把 MaleCNS v1.0 的 FLYB v1 二进制转换为本项目 sim-core 的格式三件套。 输入(只读):vendor/fly-brain-minecraft/src/main/resources/connectome/malecns-v1.0.flyb.gz FLYB v1 格式规范见 vendor/fly-brain-minecraft/PROVENANCE.md 第 4 节(本解析器按其实现)。 输出(写 game/data/): 1. connectome-malecn...
7e7b9ed7d8a21459e1a4593ae3ed47023f9a163a11021dd0014a80232501a005
Python
17,026
410
# -*- coding: utf-8 -*- # # Load data from NWB file # # Builtin/3rd party package imports import os import sys import h5py import subprocess import numpy as np from tqdm import tqdm # Local imports from syncopy.datatype.continuous_data import AnalogData from syncopy.datatype.discrete_data import EventData, SpikeData ...
8e82ac99a875d3df2585b9586dd7ad174852a95d2e2b850d69e516a07bc26601
Python
17,027
454
from __future__ import annotations import os from copy import deepcopy from pathlib import Path from types import SimpleNamespace import numpy as np import pytest from ase.build import bulk, molecule from ase.calculators.emt import EMT from ase.io import Trajectory, read from ase.mep import NEB from ase.optimize impo...
f7671810e801feccc27d62da1706a6ca2645a7ab0e86f8eafb351c770852ae42
Python
17,030
318
"""Context construction and Clean/Fly isolation regressions. Random tiny weights: these are software tests of what reaches the model, not evidence about language behavior. Tests using `qwen_engine` exercise the genuine Qwen3 tokenizer, chat template and special tokens. """ from threading import Event import numpy as ...
9066b0b6c3afd68a2e1fc98085e3be6684ab994d5e3ce144c3a5c4cfa7b45d7f
Python
17,036
398
""" Generates a ListTomoParticle object for the statistical spatial analysis of particles Input: - A STAR file with particles - A STAR file for paring picked particles and (sub-)volumes segmentations (Volume Of Interes, VOI) Output: - A STAR file with the pickled ListTomoPaticles objects ""...
517815b15eb4153e1ad553a13bb91bb8b9b8946b283e5529738237e102c0c90c
Python
17,047
398
""" Generates a ListTomoParticle object for the statistical spatial analysis of particles Input: - A STAR file with particles - A STAR file for paring picked particles and (sub-)volumes segmentations (Volume Of Interes, VOI) Output: - A STAR file with the pickled ListTomoPaticles objects ""...
9837087d79d13264e04958e329504c14c6044bec589d314fedd93f66d338ee28
Python
17,047
390
"""Re-quantification of cell counts and region volumes against a (possibly modified) CCF annotation volume. The cell points are never moved - counts change only because region boundaries moved in the annotation. """ from __future__ import annotations import logging import numpy as np import pandas as pd...
e51b4ef9d0836494ecaa3ca59364700caf17e52def159b3392d3851297d5e108
Python
17,047
452
"""Data utils functions for pre-processing and data loading.""" import os import pickle as pkl import sys # from config_debug import parser import networkx as nx import numpy as np import scipy.sparse as sp import torch import pandas as pd from scipy.linalg import block_diag from torch.utils.data import Dataset, DataLo...
545707b21e5a366c5d8498d185a9222e60a0dd9df83f674e0b53f3b14d3ef74b
Python
17,051
438
import numpy as np from skimage.filters import threshold_otsu from functools import cached_property import tempfile import torch import tifffile import logging from typing import Dict, List, Optional, Tuple from .utils import get_cosine_similarity_with_sequence_np from .features import OptopatchGlobalFeatureContainer ...
d8afc33ee47b40438b202145dbf83284a53876297b61f99cf8acc073b94bb626
Python
17,051
382
# Node-group asset "Orient to Best View" (GeometryNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump. from typing import TYPE_CH...
0a85f6646d3b493a8639e8b46459b885d67d959f9e313c00ccc377f18e800ecf
Python
17,054
446
import warnings warnings.filterwarnings("ignore") import torch import torch.nn as nn from torch_geometric.nn import HypergraphConv from torch_geometric.data import Data import anndata as ann import numpy as np import scanpy as sc import pytorch_lightning as pl import torchvision.transforms as tf from sklearn.cluster im...
3d4c9af87fba16c48bd48d78b2176b50dd68489902214be2d1c49f15deb906cf
Python
17,066
453
# 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...
0a204f88128301319f28d208aa588c97fb9dec215142ee77e1203262aafb7ac4
Python
17,070
463
# 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...
fd1d5a76d4469ca647b064f13744b0b28fbe12219cc2f32097f65c48a0c82ec3
Python
17,075
364
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 6 09:17:37 2022 This script calls every script necessary to analyse the differences between contexts. PATHS['ScriptsPathRoot'] should correspond to the GitHub folder of the Bayesian Battery. If not, it can be changed in the first lines of this scrip...
7349819c7b949d01543ed40fe8a5ba805782f706c90eef14b4efa213384ea8ce
Python
17,080
384
from torch.utils.data import Dataset import torch import pandas as pd import numpy as np from typing import Tuple, Optional, Union from mnp.molecular_featurizer import MolecularFeaturizer from tqdm import tqdm tqdm.pandas() class MolecularGraphMetaDataset(Dataset): """ Pytorch dataset to represent molecula...
992593d486a53fbefad92a130d796c8ca5bb23726c1e08e7e2d90bccb8069654
Python
17,081
407
""" Unit tests for regtools/stitching/core/tile.py and stitcher.py Covers: - Tile: trim, apply_average_tile, get_image_region, initialize_image - Stitcher: initialize_images """ import numpy as np import pytest # =========================================================================== # Tile # ...
b9187d430227dbab36376d6ef7711b35b226c55abfe450db3c5860d281d44766
Python
17,087
624
# 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...
96a4bc1c072bb1c901ca926701f236f88fee9d15986874ca275ed4c12a290100
Python
17,088
387
import copy import gc from collections import OrderedDict from multiprocessing import pool, cpu_count from operator import itemgetter import model from torch.utils.data import DataLoader from tqdm.auto import tqdm from .models import * from .client import Client from .utils import * logger = logging.getLogger(__name...
b3bb51d0d1968011df8f182749242cbb0176a71a37e37c51e24f0fab840932b9
Python
17,090
462
#!/usr/bin/env python # -*- coding: utf-8 -*- '''plotting script for figure 4 in manuscript preprint on output of example_parallel_network.py Copyright (C) 2018 Computational Neuroscience Group, NMBU. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Lic...
518988fba91c4feb1385f787a2c4e6633c04ba8d6b680f2f6d02bc7d86078b4b
Python
17,095
455
import gzip import os from pathlib import Path import bpy import databpy import numpy as np from gridData import Grid from ...blender import coll from ...nodes.geometry import ( DensityStyleISOSurface, DensityStyleSurface, DensityStyleWire, ) from .base import Density def cell_vectors(lengths, angles) -> ...
417f5f06e5daac73e9a94d24c3b6c8313a409320763ab806beb9b48210a5b733
Python
17,099
439
# Copyright (C) 2019 Computational Science Lab, UPF <http://www.compscience.org/> # Copying and distribution is allowed under AGPLv3 license # # This script implements conditional Generative Adversarial Networks (cGANs) for 3D molecular structure generation, # as well as graph-based neural networks (GNNs) for learning ...
d6c5c414f61a2171c9ac3beddc241b99f7952b8ab2501b3a7f7fd1be238728c2
Python
17,102
471
#!/usr/bin/env python # -*- coding: utf-8 -*- """Demonstrate extracellular electric stimulation of a LFPy.Network instance, using the LFPy.Network.enable_extracellular_stimulation() method. Here a simple model of neuron ball-and-stick is used to populate two morphologies with active HH channels inserted in the somas a...
cc73e18d4970ae6ff477c20d99e630ce8378d0243297fcccb22e84aba871c553
Python
17,103
434
# 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...
3a628fb2071b9d6900346faf1f6528dfb06dcda97c7291b08fd2f8929a7999a7
Python
17,104
453
"""Data utils functions for pre-processing and data loading.""" import os import pickle as pkl import sys # from config_debug import parser import networkx as nx import numpy as np import scipy.sparse as sp import torch import pandas as pd from scipy.linalg import block_diag from torch.utils.data import Dataset, DataLo...
38f89082f28b9527ca673f7f9dbabf3423e32d2e8e51461c1535d631163a8e9d
Python
17,107
331
import mne import scipy import glob import numpy as np import pandas as pd from scipy.stats import zscore from scipy.io import loadmat, savemat def castToList(x): # Casts x to a list if isinstance(x, list): return x elif isinstance(x, str): return [x] try: return list(x) ex...
3ead347c71bee8372688c34154c8030d8b361497677c6d94ee54c42540594f49
Python
17,110
449
#!/usr/bin/env python import argparse import pathlib import time try: import apex except ImportError: pass import numpy as np import torch import torch.nn as nn import torch.distributed as dist import torchvision from fvcore.common.checkpoint import Checkpointer from pytorch_image_classification import ( ...
ec5d3e6b18c94a22d135666e3fa1a7587ea2c0406956dbd23c393029356f2696
Python
17,110
452
import argparse import logging import os import anndata import h5py import numpy as np import pandas as pd import scipy.sparse from pandas import CategoricalDtype from cirrocumulus.anndata_dataset import read_adata from cirrocumulus.anndata_util import dataset_schema, get_scanpy_marker_keys from cirrocumulus.io_util ...
3aa7c1ba0ccb58a9eb8d30238f31c24bf3c342d5d19513540f6979960b649c1f
Python
17,118
406
"""Compare PyPREP results to MATLAB PREP.""" # Authors: The PyPREP developers # SPDX-License-Identifier: MIT from urllib.request import urlopen import mne import numpy as np import pytest import scipy from pyprep.find_noisy_channels import NoisyChannels from pyprep.reference import Reference from pyprep.removeTrend...
0a650240dcd415d600043de5d7393a63b6d102877e855eedd6c3a1ad2c0a4a9a
Python
17,121
513
# -*- coding: utf-8 -*- """ Created on Fri Sep 15 10:31:15 2023 @author: Dustin Garner """ import math import itertools from enum import Enum import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter from fafbseg import flywire import flycode.reduction as reduct...
eea38afd0950438a8a991ba3260e02067c00857246d65302cda15db6deca8b20
Python
17,129
518
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 17 11:55:01 2025 @author: deeperthought """ GPU = 1 import tensorflow as tf if tf.__version__[0] == '1': config = tf.ConfigProto() config.gpu_options.allow_growth = True config.gpu_options.visible_device_list="0" tf.keras.backend.s...
8a1b524e0eb355293b46875266361dbb787333bda207249505b071ac204446c9
Python
17,133
354
""" Script for extracting particles from a filament network of a unoriented single membrane graph Input: - A STAR file with a list of graphs (MbGraphMCF) as it is returned by by mb_fils_network.py script: + Density map tomogram + Segmentation tomogram +...
efb3a8dcd74dc6695ccc3470e6a5ecc4643b453514a05a3f5da73cc0b335272d
Python
17,134
405
"""Fill-based label rewrite for the CCF boundary editor. Converts a slice's edited contour polygons into a new label slice by rasterising each polygon and reassigning orphan pixels to the nearest pristine non-region label. No deformation field, no smooth warp, no RBF backend - the polygon *is* the new boundary. ...
9ff823c4bf5c61d8b1cc492db4599800b29b2d63ca6cf2310a94744cfcf8faeb
Python
17,136
412
import pandas as pd import itk import SimpleITK as sitk import os import sys import json import argparse import logging class AllenDatasetBuilder: downsample = 8 # downsample = 2^3 #path="/Users/jtduda/projects/Allen/Downsampled/example_batch_with_alignment" #atlasPath="/Users/jtduda/projects/Allen/Downsa...
a51ac4cb36954c184db2cea817b66f264fd9f48f2a3459699fe6f550a1b709ce
Python
17,137
533
#!/usr/bin/env python # coding: utf-8 # ### LASSO parameter range experiments, summary across all genes # In[1]: import os import itertools as it from math import ceil import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import Normalize from scipy.stats import pearsonr, sp...
a744a3092b72794acc4af992b3a32ad120cca358efd0ef254020b9b823b2e3ce
Python
17,137
383
"""Format templates for HED schema error messages.""" from hed.errors.error_reporter import hed_error from hed.errors.error_types import ErrorSeverity, SchemaAttributeErrors, SchemaErrors, SchemaWarnings @hed_error(SchemaErrors.SCHEMA_DUPLICATE_NODE) def schema_error_hed_duplicate_node(tag, duplicate_tag_list, secti...
f5bfc537b7ca3fb55ff20e0a52ff0de2646513e00c097e683999f77fa7b4e2bd
Python
17,140
418
# 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...
fa2b25c37e0d219078ae712c9eed7778e63a955ed1e6bcf55335ac86deb29a12
Python
17,141
535
# qc.py import dnaio import matplotlib.pyplot as plt import numpy as np import pandas as pd from pathlib import Path from itertools import cycle from itertools import islice from fba.levenshtein import ( create_index, query_index, select_query ) from fba.utils import open_by_suffix, get_logger logger = g...
219d49e86cd05d2fda27ffa054b3ac08aee07209e12c8bf3eb290ac132383d38
Python
17,142
492
import torch import h5torch import numpy as np from maldi_nn.utils.drug import ( SmilesToIndex, SmilesToECFP, SmilesToAlphabet, SmilesToDEEPSmilesAlphabet, SmilesToSelfiesAlphabet, SmilesToImage, SmilesToLINGOKernel, ) import re from maldi_nn.spectrum import SpectrumObject from lightning imp...
1113e24c80f2c27743b59432446d640eb2cc3d0aff77ebc54a5417ba941ba7e4
Python
17,145
292
""" TRANSCRIPTOME_TEST.py written 2026-09-23. Pre-registration: 04-NOTES/PREREG-2026-09-23b-TRANSCRIPTOME.md (sha256 71be79d5...), Addenda 1 and 2. Inputs frozen before this ran: 06-OUTPUT/FROZEN-2026-09-23-DELTA-ALL-TYPES.csv, 06-OUTPUT/transcriptome_type_map.csv. Output: 06-OUTPUT/transcriptome_test.txt, 06-OUT...
e8ff8f952ac3d11ec5fd94ad88dd91c17e658b7f91d01dcdeacc7e534032a762
Python
17,155
540
# -------------------------------------------------------- # Based on BEiT, timm, DINO and DeiT code bases # https://github.com/microsoft/unilm/tree/master/beit # https://github.com/rwightman/pytorch-image-models/tree/master/timm # https://github.com/facebookresearch/deit # https://github.com/facebookresearch/dino # --...
fff5dc2be20d9467645ed0dc9e0c399de6c262533a56d0d4a07b9beaeff254c9
Python
17,156
479
"""Custom Espresso calculator and template.""" from __future__ import annotations import logging import os import re from pathlib import Path from typing import TYPE_CHECKING import numpy as np from ase.atoms import Atoms from ase.calculators.espresso import EspressoProfile from ase.calculators.espresso import Espre...
5f8f80a96f756983e13f1ebec5b7faeb21c540a6eaa9f0bfe59b785a42d7d477
Python
17,177
495
from __future__ import absolute_import import hmac import os import sys import warnings from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import ( InsecurePlatformWarning, ProxySchemeUnsupported, SNIMissingWarning, SSLError, ) from ..packages import six fr...
648760d59f00dd1c86eec796e67b9016cc5650f62a94ea7d657533a193e1c326
Python
17,178
400
""" Generates a ListTomoParticle object for the statistical spatial analysis of particles Input: - A STAR file with particles - A STAR file for paring picked particles and (sub-)volumes segmentations (Volume Of Interes, VOI) Output: - A STAR file with the pickled ListTomoPaticles objects ""...