sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f616b1c5b2c1fad304fd05b5b0cce1d17ff158c47da6945dfc0c80a84fad8214
Python
5,537
121
""" Small python script to extract read counts from illumina NovaSeq X demultiplexing and display them in a table and bar chart. """ import argparse import matplotlib.pyplot as plt import numpy as np import seaborn as sns import pandas as pd def parse_args(): parser = argparse.ArgumentParser(description="Script...
05327929944d168e81a938cdbde5f5b93bb9007e5ab6c865cbae07e59fd3b199
Python
5,541
176
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' usage: python <name.py> --v root.vtk --folder '/Users/jiangshengdian/Desktop/Daily/PhD_project/Platform/fullmorpho/data/morpho_showdata_for_clusters/3/*' python full_morpho/analyses/viz_swc_in_vtk_ccfbrain.py --v full_morpho/analyses/root.vtk --folder 'D:/mygitcode/ful...
7f4ee042016722f09009f289368d8c6e0277d2b6d80470f7dc57c7ff79d4d151
Python
5,541
180
# Computes the Purcell enhancement factor of an in-plane dipole in a planar # dielectric cavity with lossless metallic walls. The result is computed in # cylindrical and 3D coordinates and compared with the analytic result from: # I. Abram et al., IEEE J. Quantum Electronics, Vol. 34, pp. 71-76 (1998). # tutorial refe...
5d1b70a1f4531eaaf61cd48a63451c75a5999c8af87444fef0dd305e79b19a69
Python
5,542
171
''' author: @emma compute importance scores for each brain ROI based on a saliency map importance score = (#salient voxels in region)/(#total voxels in region) x 100% JMI paper code modified to SimBA data 2023/07/04 ''' import os import vtk import argparse import pandas as pd import numpy as np ...
923842ef8606096330b5b6d815cac063dbe085b6bdab17ff92959711dcaa0ea9
Python
5,545
136
import os import pandas as pd from scipy.io import loadmat from sklearn.model_selection import train_test_split from datasets.SequenceDatasets import dataset from datasets.sequence_aug import * from tqdm import tqdm signal_size = 1024 ADBdata_source=[['KA05'],['KA03'],['KI03']] ADBdata_target=[['KA01',...
c0e42f141cf52f42cfe5ceb201e7ce9c992c3c94cfb78b1c10ec12cc9fb38c0c
Python
5,546
107
#!/usr/bin/env python # relion_run_topaz # This is to run Topaz-Denoise training (https://github.com/tbepler/topaz) from Relion as an External job type # Rafael Fernandez-Leiro 2020 - CNIO - rfleiro@cnio.es # Alex J. Noble 2020 - NYSBC - anoble@nysbc.org # Run with relion external job # Provide executable in the gui...
117db25dfa39a926d2ab112aa5e34860dcff6b54bb22cde53b9248ef23446258
Python
5,547
180
from __future__ import annotations import pandas as pd import numpy as np from numpy._typing import NDArray from typing import Iterable, Optional import logging logger = logging.getLogger(__name__) def max_col(X: pd.DataFrame | NDArray) -> NDArray: max_col_index = np.argmax(X, axis=1) if not isinstance(X, pd...
82a5ac4b62255144c1d430a9f93e0179ab729a668e9144ef930bcd2d5a50f6c3
Python
5,547
149
import torch import torch.nn as nn from elasticai.creator.nn.integer.concatenate.design import ( Concatenate as ConcatenateDesign, ) from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule from elasticai.creator.nn.integer.math_operations.math_operations import MathOperations from elasti...
0de653ddee24297caa53ef35004522c47b4b736ad3b44687ad93b757d41b3799
Python
5,548
158
"""Model inversion for stimulus estimation from photocurrent. Port of EstimateStmFromPhotocurrent.m """ from dataclasses import dataclass import numpy as np from scipy.signal import lfilter from scipy.signal.windows import gaussian @dataclass class InversionResult: """Results from model inversion.""" esti...
13f7ffe469fb0a978d97da597989a4ddd5812b6d2a12745b61105eecc779518d
Python
5,551
189
# 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...
0a811068be7bbce7c7a4aad4f84d0882b1046cc9c642d0a4f0e4de7ef179f14d
Python
5,552
153
import numpy as np import matplotlib.pyplot as plt from hippo.environments.w_maze import get_wmaze from hippo.environments.action_perception import action_perception_loop from hippo.environments.sequences import EvaluationSequences3x3WMaze from hippo.visualization import visualize_trajectories, plot_B from hippo.agent...
8b6c9224edf2d179751e0caf583c1911f647abda2760fdd799532f49d584e765
Python
5,552
126
import numpy as np import jax import jax.random as jr import jax.numpy as jnp import pandas as pd import pickle import os from matplotlib import pyplot as plt from dynamax.hidden_markov_model import GaussianHMM, DiagonalGaussianHMM from BEBE.models.preprocess import static_acc_filter, load_wavelet_transformed_data fr...
602d40c890937b49cd5ab9d56f72d6a43e201006b5bcea22010041b67fcf1ca7
Python
5,553
150
"""Compare two CCF-editor sessions and summarise where they differ. A session JSON captures every dragged contour polygon per slice; two sessions over the same pristine annotation produce two modified annotations that may differ slice-by-slice. The diff helper here surfaces: * slices touched in A but not B (an...
8d191c5d34536bf237ff11f722c36586238a44797a72594ad68dad42105ad41c
Python
5,553
117
import os from typing import Tuple, Union import numpy as np import pandas as pd from sklearn import model_selection from torcheeg.datasets.module.base_dataset import BaseDataset from ..utils import get_random_dir_path from .utils import create_subset, ensure_cache, read_indices, write_indices def train_test_split_...
2ed7777d9f21b04f97805cf164f9347d69b43eae55f2635b37474912ebaba354
Python
5,554
133
import argparse from datetime import datetime from pathlib import Path from warnings import filterwarnings import lightning.pytorch as pl import pandas as pd import torch import yaml from tqdm import tqdm from dataset import TCGA_Program_Dataset from datasets_manager import TCGA_Balanced_Datasets_Manager, TCGA_Datase...
df7745aabd88ebb6cd537ca4ece107e15c3b09eb531fd2c18a42d632df69901d
Python
5,554
77
#! /usr/bin/env python # -*- coding: utf-8 -*- #! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, MaiaEnvironment from lab.reports import Attribute, geometric_mean from common_setup import IssueConfig, IssueExperiment, DEFAULT_OPTIMAL_SUITE, is_test_run BENCHMAR...
f5a0f3a2b3848c1ea2a40977cb1b5b91b653f627eb7f791b4ff35f5f2c78afa6
Python
5,554
137
import torch import logging import os import Models.model_func as Model_Func import pickle from tqdm import tqdm class ScikitFeatBaseline_Model(torch.nn.Module): def __init__(self, dataset:str, device:torch.device, input_dim:int, classes:int, lr=0.001): super().__init__() assert isinstance(input_d...
00ea4376607af824f8355937b8b74f5b47478aad9bfaefb9fd08e9ab92552621
Python
5,555
152
""" (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2020 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. ------------------------------------...
7322584fdbcfc99209ce4c5913864883ca19b89f2c68090003f8213302c44cfa
Python
5,556
159
from scipy.integrate import solve_ivp import matplotlib.pyplot as plt import numpy as np import math as m from mpl_toolkits.mplot3d import Axes3D import torch import torch.optim as optim from Rosenbrock import Rosenbrock_func from Quadratic import Quadratic_func from Rastrigin import Rastrigin_func def ...
6e881605bdfe6f23082febfbe997fc2a0e9bda6e515055771a97179eef920631
Python
5,557
161
import io from collections import deque from uuid import uuid1 import bl_ext.blender_org.molecularnodes as mn # type: ignore import bpy import matplotlib import matplotlib.pyplot as plt from MDAnalysis.core.groups import AtomGroup from PIL import Image matplotlib.use("Agg") # Annotations are auto-registered # Unregi...
5570bcb57a7b1f6360ce1aee969c561918184e502bacb2938021890da080a0ec
Python
5,558
191
#!/usr/bin/env python # coding: utf-8 # ## p53 feature stability analysis # # How stable (in terms of performance, and eventually coefficients) are TP53 mutation prediction models fit on the same dataset? We're particularly interested in how they generalize across domains (in our case tissues/cancer types): can model...
c9773f9aff27acbe10b1ce54a698ffbdf32456bc3200a111809897ecff6e45da
Python
5,558
124
# 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 * # app specific libraries import control.widgets as widgets import control.camera as camera import control.core as core import control.c...
108a5ce24c4fbd7906f58bdb0ed758918915100176ad3d14ee5212b2bbc19922
Python
5,559
149
import matplotlib.pyplot as plt import numpy as np from skimage.color import rgb2gray from skimage.io import imsave from cv2 import imread import os from config import DATA_DIR import shutil import preprocess from dataloader import DATA def visualize_labels(dataset): n, bins, patches = plt.hist(x=dataset.labels...
107c14d5e8e2a23058d2f3541a8279fd53fab1cf04afa3b8180db571bdd67d4c
Python
5,560
151
from typing import List import numpy as np import pandas as pd from pandas.tseries import offsets from pandas.tseries.frequencies import to_offset class TimeFeature: def __init__(self): pass def __call__(self, index: pd.DatetimeIndex) -> np.ndarray: pass def __repr__(self): retur...
69f69cf685d2eebcf2e558738e77f694706e7045e6f18386a41cf696ee5232ed
Python
5,561
174
# 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...
5894801f33b579418e4a82f6c4508efe306a9364486079c617661dc9bbcef055
Python
5,562
181
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Fig4b usage: python Fig4b_cell_viz.py --folder "/Users/jiangshengdian/Desktop/Daily/PhD_project/Platform/fullmorpho/data/morpho_showdata/0/*" ''' import pandas as pd import numpy as np import os import math import argparse import vtk import vtkmodules.vtkInteractionSt...
7851fb71a70be8dd12afd5b91f13266d7872d61910ce1d5cec3ed2095af4fb1a
Python
5,562
158
from typing import cast import numpy as np from scipy.optimize import minimize from scipy.stats import gaussian_kde from .block_tools import FloatArray, blocking, check, fblocking class BlockAnalysis: """Estimate statistically reliable errors from correlated samples. The input series may represent one or m...
e359636519e8c749802a1abd0701fc3474025dbf889526f9731446dc9482219d
Python
5,562
188
from nose.tools import * from pyccg.chart import * from pyccg.lexicon import Lexicon from pyccg.logic import * def _make_lexicon_with_derived_category(): lex = Lexicon.fromstring(r""" :- S, NP the => S/NP {\x.unique(x)} foo => NP {\x.foo(x)} bar => NP {\x.bar(x)} baz => NP {\x.baz(x)} """, include_se...
b05d42b77cd0339ffe55011c9f2fd4103be4bd729b5846fce8cb850f74a5137e
Python
5,563
94
"""NORMALISATION.py 2026-10-01. Pre-registration: 04-NOTES/PREREG-2026-10-01a-NORMALISATION.md Divisive normalisation (Olsen, Bhandawat & Wilson 2010) in the antennal-lobe cut-out of Shiu et al.'s file: a test input to DL5 or VM7d with and without a mask on every other glomerulus, five sign/deletion conditions, fit of ...
4f185fe34885214833cdd782d5fb403b19200b3333be2b3bb861140569efe355
Python
5,564
131
#! /usr/bin/env python3 import os import subprocess import logging #import APT_interface import pickle import numpy as np import torch from argparse import Namespace import random import time import mmcv import mmpose.utils class cd : """Context manager for changing the current working directory, and automagica...
8940621743f03743e53d3a908c5281c406981f029b1ae131d51013549d47fbd9
Python
5,564
154
# 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...
04d6956dbebd54ae95ba32cc2f51a317c1aef42f45f11fda2ec57d42d20de275
Python
5,565
160
# ---------------------------------------------------------------------- # Copyright (C) 2016, 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 redistribute it and/or mo...
82bb5ce4ae8463e7974cfddd53f2d5dd35a8566ea46607148587cd8fbc8ac600
Python
5,565
138
import lightning.pytorch as pl import torch.nn as nn import torch from lightning.pytorch.utilities import grad_norm from torchmetrics.classification import BinaryAccuracy, BinaryAUROC, BinaryRecall, BinaryPrecision, BinaryF1Score from torchmetrics import MetricCollection from hicdiffusion_encoder_decoder_model import H...
748f34f3cb8eee11d9d49f6792768f9e74a20a7b250e0a600c41005e32529161
Python
5,566
152
# pylint: disable=too-many-statements, too-many-locals, invalid-name, unbalanced-tuple-unpacking, no-value-for-parameter """Script for running experiments: tuning and testing hypertuned models""" import os from copy import deepcopy from omegaconf import OmegaConf, DictConfig import hydra import pandas as pd import nu...
e95afee5d0b883312d6769328cb17a4b7d92163a7e4a3bae3ea3c17fbd0cc8db
Python
5,566
156
from typing import List import numpy as np import pandas as pd import statsmodels.api as sm import scipy.stats as st class UVMRbased: def __init__(self, pv_iv: float = 5e-8, min_ivs: int = 5, fwer_exp: float = 0.05): """ Initialize the UVMRbased instance with parameters for the analysis. ...
dd82124968e6f1d851a4f0a9056aae0638d050dfb829a14ce7ac6ece7f6189b0
Python
5,567
161
import numpy as np from neurolib.utils.collections import dotdict params = dotdict({}) params.LIMIT_DIFF = 1e-4 params.LIMIT_DIFF_ID = 1e-12 params.TEST_DURATION_6 = 0.6 params.TEST_DURATION_8 = 0.8 params.TEST_DURATION_10 = 1.0 params.TEST_DURATION_12 = 1.2 params.TEST_DELAY = 0.2 params.ITERATIONS = 10000 params.LO...
55ec2c5c003df1a1752049c17e295305976137a534886c2fc8081834f5f4aa3a
Python
5,568
160
# 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...
5c4ae39c51e41d71dd98abaee4615bb740141e06d35de1e2b5a923d431dd6322
Python
5,568
134
import json import os import pandas as pd import scipy.sparse import tiledb from anndata import AnnData from cirrocumulus.abstract_dataset import AbstractDataset class TileDBDataset(AbstractDataset): def get_suffixes(self): return ["cxg"] def get_schema(self, filesystem, path): # path is to...
1b4aad541b9415f41326a76534d78bc19fb17a0d8eac4cb58a0516eff4ee88c9
Python
5,569
123
import os import sys import glob import argparse import numpy as np import torch from inference import WSIInference def evaluate_dataset(pipeline, test_dir, output_dir=None): """Evaluate model performance on a dataset of WSI slides. Args: pipeline: Initialized WSIInference pipeline test_di...
5d590b8bc5c37abd801c93848566af06b107e046fabc7bbd6a747923741b8b73
Python
5,569
92
"""KEYSTONE_ROBUST.py 2026-10-02. Pre-registration: 04-NOTES/PREREG-2026-10-02-KEYSTONE-ROBUST.md (parts R2-R4) R2: the flip of v2LN30 root 720575940635945919 (the left one; the prereg calls it "right") across synaptic weight x receptor drive (rate theory). R3: excitatory only onto projection neurons, or only onto ev...
86ab73e90e8a2394706b656d6473d378b1f5808dc2e1db954867c500ba0028b1
Python
5,571
200
"""Core recipes for Q-Chem.""" from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING from quacc import job from quacc.recipes.qchem._base import run_and_summarize, run_and_summarize_opt from quacc.utils.dicts import recursive_dict_merge has_sella = bool(find_spec("...
23c64afe605606a3b39ae841d0556b7bf09513e1633f53044210abbc0c04b444
Python
5,572
129
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """build_flywire_variant.py —— 从 FlyWire 源 CSV 重建连接组二进制(含等价性自检), 并生成"谷氨酸抑制"变体(符号必要性实验)。 背景:复审 R1/伸展项——MaleCNS 的正向符号翻转(glut 抑制→兴奋)已证明充分性, 本脚本提供 FlyWire 一侧的必要性检验(glut 兴奋→抑制)。 管线(复现 vendor/snedea-flybrain/scripts/build_connectome.py 的聚合逻辑): 1. neurons.csv.gz 行序 = 原始索引(与 s...
7e2982ee5c302e59ed8b0b1e7a46feff5a7772e20ab2c1721d0ad4a4bccaa9eb
Python
5,573
124
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Statistical comparison of listening and imagination, and of sound1 and sound3 in source space ''' import mne import numpy as np from matplotlib import pyplot as plt from stormdb.access import Query from pickle import load from scipy import stats from mne.datasets impor...
2e31235f366524e63a14478a253d4fe53a5d418abb63eec3e8f6a63e88f7d860
Python
5,574
160
# 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...
4bcecd6d15cb23074e58c7ed94b40add9d19dddb9b3845bb8b17d5485315075e
Python
5,574
161
""" Stimulus optimization ===================== This script shows how to optimize the stimulus presentation by means of selecting the optimal subset of stimuli from a set of candidate stimuli and how to select an optimal layout to allocate them to a stimulus grid. For more information on the optimization of such subset...
5db61cc03ec6a08cc837d75fe1a79238aae4a3da69967ffcfd89bfb9dbc53d59
Python
5,577
136
import os import glob import pandas as pd import re import matplotlib.pyplot as plt import numpy as np from sklearn.metrics import mean_absolute_error, r2_score # Dir directory = "Results_files/KMER_gamma_free_0.1-1-10/" files = glob.glob(os.path.join(directory, "KMER_prediction_*.txt")) # Leer el archivo de caracte...
34b2b19221efa7606c197fdd7d36530a259d37cd6aa2f77e84597be0a69d604e
Python
5,578
133
import os import unittest import hed from hed.errors import HedFileError from hed.models import HedTag from hed.schema import HedKey, HedSchemaGroup, get_hed_xml_version, load_schema, load_schema_version class TestHedSchema(unittest.TestCase): @classmethod def setUpClass(cls): cls.hed_xml_3g = os.pat...
956c6a2b4239e0f0c5c997ae31eef9dde664a4e6864510e6875fe1679357f057
Python
5,578
173
from wonambi import Wonambi from PyQt5.QtWidgets import QAction from os.path import basename, splitext import csv from pytest import approx from .test_scroll_data import (channel_make_group, find_in_qt, screenshot, ) from .pa...
3f17eb4ec2f74475802cf08f17f2c659a70938de0f2da60966a5822e090d6e70
Python
5,579
126
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """export_sign_tables.py —— 为对照实验(probe_controls.mjs)导出"按递质拆分"的中间表。 背景:v5.1 的符号干预翻转的是整条递质规则。要回答"起作用的是谷氨酸身份,还是任何 同等规模、同等位置的符号改变",需要能按神经元、按递质任意组合地重新赋号。本脚本 把两份数据导出为可在 Node 里快速重新赋号的中间表(产物已 .gitignore,随时可重建)。 输出(game/data/derived/): 1. flywire-pair-nt.bin.gz —— FlyWire 源表 c...
9ae30b1bb1c73641a22a4a27d3089b8eee68a345384f3a92cf3e5149ba22a5f2
Python
5,579
184
""" Various utilities for neural networks. """ import math import torch as th import torch.nn as nn # PyTorch 1.7 has SiLU, but we support PyTorch 1.5. class SiLU(nn.Module): def forward(self, x): return x * th.sigmoid(x) class GroupNorm32(nn.GroupNorm): def forward(self, x): return super(...
cd8e2e2d63ce0db587d7bc31dafaf82d3ffe6ca972f5c769c3350dfd7f665a78
Python
5,579
142
import numpy as np import random from collections import OrderedDict from examples.pybullet.utils.pybullet_tools.utils import add_data_path, load_pybullet, set_point, Point, create_box, \ stable_z, HUSKY_URDF, load_model, TURTLEBOT_URDF, joints_from_names, \ set_joint_positions, get_joint_positions, link_from_...
131788a1db1fcff73bc56ffbf7a69f59d221181b3e1dc4975dc02ac408793398
Python
5,581
154
"""Embedded, colour-preserving log view for GUI tabs. Registration runs write ANSI-coloured output to ``<output>/console.log`` while executing in a detached process. :class:`AnsiLogView` tails that file into an in-GUI black-background monospace widget, translating ANSI SGR colour codes into Qt text formatting - s...
2ef81e37f97b2229a9beb8826f241e09dc54ab162c4b54d3d4801c7ccb636461
Python
5,583
153
from collections import deque from typing import Generator, Optional import cv2 import torch from torch import Tensor from torch.nn import Module from torchvision import transforms import random def resize(vid, size, interpolation='bilinear'): # NOTE: using bilinear interpolation because we don't wor...
c20e358e2e3748fbc4fd6c94eaee4d3c624bc9b14269072e6f86e667eef3360d
Python
5,583
124
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 from elasticai.c...
5c382402c329fe32d7f668fee8449d7fb18affc46e5fd93020bc173a137519a3
Python
5,584
152
"""distutils.command.build Implements the Distutils 'build' command.""" import sys import os from ..core import Command from ..errors import DistutilsOptionError from ..util import get_platform def show_compilers(): from ..ccompiler import show_compilers show_compilers() class build(Command): descrip...
e8314e435bd54eeca783b6d3520667b769745d1b638c62183a304433fc932a7a
Python
5,584
181
import h5py import click import numpy as np import seaborn as sns import matplotlib.pyplot as plt from basenji import plots from basenji import dna_io @click.command() @click.option('--score', 'score_files', required=True, multiple=True, type=click.Path(exists=T...
03fed26f1b33f667a2f7f121e2c7dc4fc14a5d683c5a39fd5eb9d31fd03a6559
Python
5,585
183
"""Utility functions for dealing with defects.""" from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING from monty.dev import requires from pymatgen.core.periodic_table import DummySpecies from pymatgen.entries.computed_entries import ComputedStructureEntry from pym...
3ab546b764a83e9d28034e724cc2705ef605f21438d0893e83097c056f41b664
Python
5,585
153
''' This code is modefied based on a TCN impelemtation by https://github.com/locuslab/TCN ''' import csv import json import math import joblib import argparse from pathlib import Path from collections import OrderedDict import numpy as np import torch import torch.nn as nn from torch.nn.utils import we...
82db9c67147d403ce094f558ea4eb37b6db43bbafc14a7d10992929f0d845355
Python
5,585
123
#!/bin/env python """ OXASL - Registration for ASL data Michael Chappell, IBME QuBIc & FMRIB Image Analysis Groups Copyright (c) 2008 University of Nottingham """ from __future__ import unicode_literals import os import numpy as np import fsl.wrappers as fsl from oxasl import reg from oxasl.reporting import LineG...
db4badb5f0be0630bc41ee17ba7530d6b68b271ca986f54f7d6fa5d13f3efbe8
Python
5,587
154
# 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...
ac9a31937e0bfd2f04b1323bf1bb9d643824b97b94b0b293ead941b37d176e67
Python
5,588
181
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Fig4b usage: python Fig4b_cell_viz.py --folder /Users/jiangshengdian/Desktop/Daily/PhD_project/Platform/fullmorpho/py/morpho_showdata/0 ''' import pandas as pd import numpy as np import os import math import argparse import vtk import vtkmodules.vtkInteractionStyle im...
3be62e2ae190a4acfb99a9abf12b859fae4e04a8558897421bbd38e389a5ea9a
Python
5,589
148
# Build an index dictionary for sequence position -> reference position & signal position import re import pysam import pod5 import pickle import zlib import lmdb from collections import defaultdict from tqdm import tqdm import numpy as np DATA_TYPE = np.int32 START_H_PATTERN = re.compile(r'^(\d+)H') END_H_PATTERN = r...
4fb586fa247746e62ec9cea0118d3ee2f78631790561056e8f9ca6b7284432d3
Python
5,589
129
import itertools import numpy as np import pytest from MDAnalysis.tests.datafiles import DCD, GRO, PSF, XTC import molecularnodes as mn from molecularnodes.nodes.geometry import StyleRibbon, StyleSpheres from .constants import codes, data_dir from .utils import GeometrySet formats = ["pdb", "cif", "bcif"] @pytest.ma...
ae97c0da6c0abf0ca476cfae92adfe36eacd5c85829b2497f649a3834ed9eab7
Python
5,589
136
#! /usr/bin/env python # -*- coding: utf-8 -*- import itertools 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 RelativeScatterP...
8731269642ca04b11e7bbbacc8ee3eb96f68393e72b7fa001503485ae5a29fba
Python
5,590
118
import inspect from typing import Any, Callable, Dict, Optional, Text, Union, Iterable import numpy as np import tensorflow.experimental.numpy as tnp import tensorflow as tf #tnp.experimental_enable_numpy_behavior(prefer_float32=True) from tensorflow.keras import layers as kl @tf.keras.utils.register_keras_serializab...
9764adc9c31a91bc6932c5b8118a27804d877da388267d2b92d5e4b98fbb5042
Python
5,590
168
"""Poincare ball manifold.""" import torch import numpy as np from manifolds.base import Manifold from utils.math_utils import artanh, tanh class PoincareBall(Manifold): """ PoicareBall Manifold class. We use the following convention: x0^2 + x1^2 + ... + xd^2 < 1 / c Note that 1/sqrt(c) is the Poin...
8d9f600343e1a30f886ef52ccf8419818239be03ee15ead880ca545f7b8d494c
Python
5,591
156
# Acquisition helper functions from PySpin import PySpin import numpy as np import scipy.ndimage from matplotlib import pyplot as plt from PIL import Image from Library import pyspin_helper as psh import time class app_variables(): def __init__(self,cam): self.cam = cam self.image_result = self.cam...
8e9b00750bc2042900baf9845d823dd1357890d18ed98d7736a0ebfcfaef7610
Python
5,591
148
import re import functools import distutils.core import distutils.errors import distutils.extension from .monkey import get_unpatched def _have_cython(): """ Return True if Cython can be imported. """ cython_impl = 'Cython.Distutils.build_ext' try: # from (cython_impl) import build_ext ...
0ee367da760ba79da0d01b4f727d60da74f69890e391bfa378292b9a0f3b5d90
Python
5,593
117
import unittest from unittest import mock import os import pandas as pd from sklearn.decomposition import PCA import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../src") from hornet.uml import create_pca_dataset class TestCreatePcaDataset(unittest.TestCase): def setUp(self): sel...
3e70e523a75074be0c98fa366774a1e5d9e080fb8983a7436cb208b82d9323a6
Python
5,593
123
import torch from torch.optim.optimizer import Optimizer, required class PIDAccOptimizer_SI_AAdRMS(Optimizer): r"""Implements stochastic gradient descent (optionally with momentum). Nesterov momentum is based on the formula from `On the importance of initialization and momentum in deep learning`__. Ar...
9cf447b32a7580e3081cdb10b09ce9d78b30afb3c617682a405c7e775ded18fb
Python
5,594
171
from typing import Iterable, List, Literal import bpy from bpy.types import GeometryNodeTree, Node from databpy.nodes import append_from_blend, get_output, swap_tree from nodebpy import TreeBuilder, arrange from nodebpy import geometry as g from .. import color from ..assets import MN_DATA_FILE from . import geometry a...
529be11099e7e3f77783a34b5cbe4517e98e4be0976b3b36b5893b2c4a577b04
Python
5,595
121
import collections import gc from typing import Tuple, List import numpy as np import scanpy as sc import scipy.stats import sklearn.linear_model import sklearn.svm from sklearn.cluster import KMeans from tqdm.auto import tqdm from . import types def get_pca(adata: types.AnnData, n_comps: int = 50) -> np.ndarray: ...
f762eb2d131aa3463172c7aa5d2f0dd6f1898f7e6d3b94ab5e0bfd108f53be03
Python
5,596
116
import os import glob import math import numpy as np import torch from torchdrug import core, data from torchdrug.layers import functional from torchdrug.core import Registry as R from siamdiff import rotamer # the function to create conformers for the siamese diffusion scheme # a commonly used scheme for sampling...
dc0373bbeb5ad6b2bf0fd5546b021bf80af641860e0c336c5f39d600ae297b14
Python
5,597
221
# -*- coding: utf-8 -*- # # Helpers to generate correct data, labels etc. for the plots # from Syncopy dataypes # # Builtin/3rd party package imports import numpy as np from copy import deepcopy import re import functools def revert_selection(plotter): """ To extract 'meta-information' like time and freq a...
5e0d8b94e053511c31682afb67cedb4ac7ff128ad5f5d623390c2a16eed0faaf
Python
5,598
151
# 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...
75ff2f6e1f97e02655881e08c7e060ade915ad3728911124f8d9f2fb7aee054d
Python
5,599
160
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from skorch import NeuralNet class LogisticRegression(nn.Module): """Model for PyTorch logistic regression.""" def __init__(self, input_size): super(LogisticRegression, self).__init__() # one output for bina...
6df28079546ec7fd90c1c8821d0d072266d6f2e79847de4b9474f4dc10afba1d
Python
5,600
139
from nnunetv2.training.nnUNetTrainer.variants.network_architecture.nnUNetTrainerNoDeepSupervision import \ nnUNetTrainerNoDeepSupervision from nnunetv2.utilities.plans_handling.plans_handler import ConfigurationManager, PlansManager from nnunetv2.training.lr_scheduler.polylr import PolyLRScheduler from torch import...
78388a3b6922f26d63132d14f7f8a2102c1a953a98b1d46fe2476e6255974ae2
Python
5,600
166
""" Script for filter a MbGraphMCF object by extracting a filament network with cross-linkers between to segmented regions Input: - MbGraphMCF (pickle file) - Cross-linkders setting Output: - A filtered version of the input MbGraphMCF with the cross-linkers - A VTP file with ...
d2e93fab02ec947654f169111a9d2c056fc34b5b8d64e1d0c53686e89e356a83
Python
5,600
132
"""Read cell-point coordinates from an AnnData ``.h5ad`` with an explicit field->axis mapping. See ``docs/superpowers/specs/2026-08-13-h5ad-points-registration-design.md``. AnnData has no universal spatial-coordinate convention, so the caller must state which ``obsm`` matrix or ``obs`` columns hold the coordinate...
90dd49b5da5bd6561deacfbd0ecdc18c14776966352720408dbeb38eaddab922
Python
5,603
122
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2024 Clinic for Diagnositic and Interventional Radiology, University Hospital Bonn, 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 ...
d812743204bff2a953e255243a61cc57a165d0e4805dcb6d1f159e5c0ee37b26
Python
5,603
115
import os from copy import copy from typing import Union import numpy as np import pandas as pd from sklearn import model_selection from torcheeg.datasets.module.base_dataset import BaseDataset def train_test_split_cross_trial( dataset: BaseDataset, test_size: float = 0.2, shuffle: bool = Fal...
729e968974da11df0b5b0c62ce99c54a66c23928b33cb725007145b2ac51aaab
Python
5,604
172
"""distutils.command.build_scripts Implements the Distutils 'build_scripts' command.""" import os import re from stat import ST_MODE from distutils import sysconfig from ..core import Command from ..dep_util import newer from ..util import convert_path from distutils._log import log import tokenize shebang_pattern =...
6fea55e7fc2a8716f85cd1ad284ccfd667e5bf90f37f06423ecd24cb9c34006d
Python
5,605
174
# Copyright (c) 2021, Ko Sugawara # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
e9d1a2cb690edbb725e8737eaa9f56ea86a0ca9aefb22f36078a0c1f836a5d69
Python
5,605
148
# # 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,...
f2e4259fbd072ee81a572f53ce7cb687b2a6a19afa5eef07aea58e55a73cdfb2
Python
5,605
116
''' Average node properties at nodes using the simplicial structure Author(s): Daniela Egas S. Last update: 02.2024 ''' # General import numpy as np import pandas as pd import pickle # Connectomes and network analysis import conntility from connalysis.network import stats as nstats # Specific to this project impor...
2c7b71a0ca8f88a0258d69d49e597ecc9e79fc9ba0cb4538faf99c6766ef6cb4
Python
5,606
185
# # 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,...
bd8fc03ce541fb701660530dff6c980b765bdf09e0ce858ee465db18a901f18d
Python
5,606
175
# 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...
0488491406259b1c9769a0dbe22874492db233da7c1f6e0fb46c523c033f7476
Python
5,607
149
# Node-group asset "oxDNA Vectors" (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_CHECKING...
33a5291f6f14ac69000890bee404e99670579ea32dc987d8c37eb32b0a453909
Python
5,608
190
# Node-group asset "Visualize Angle" (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_CHECKI...
58b17f7a37f6653e4924eb22ca73df324e28d1a827693867f77ddf446d6831fa
Python
5,608
220
from __future__ import annotations import pytest ct = pytest.importorskip("covalent") from ase.build import bulk, molecule from quacc import flow, job, subflow from quacc.recipes.emt.core import relax_job, static_job # skipcq: PYL-C0412 from quacc.recipes.emt.slabs import bulk_to_slabs_flow # skipcq: PYL-C0412 ...
681239d4a3d6453561e76425e5cf1f343e6ec06969d7a94c5194710aa44d1d4d
Python
5,608
139
from nnunetv2.training.nnUNetTrainer.variants.network_architecture.nnUNetTrainerNoDeepSupervision import \ nnUNetTrainerNoDeepSupervision from nnunetv2.utilities.plans_handling.plans_handler import ConfigurationManager, PlansManager from nnunetv2.training.lr_scheduler.polylr import PolyLRScheduler from torch import...
b8358553a5b8a44bd4f71eccd7a03cab2ba2766c6341131d07eff1446fd78542
Python
5,609
139
from nnunetv2.training.nnUNetTrainer.variants.network_architecture.nnUNetTrainerNoDeepSupervision import \ nnUNetTrainerNoDeepSupervision from nnunetv2.utilities.plans_handling.plans_handler import ConfigurationManager, PlansManager from nnunetv2.training.lr_scheduler.polylr import PolyLRScheduler from torch import...
c0104e97183deb3053a6e9883e2644b6a17c30fff68debfa36f5a53ddaa7a9ce
Python
5,609
170
"""Class to import straight text records. """ from logging import getLogger from numpy import empty, float64, floor from os import listdir from os.path import splitext from pathlib import Path from .utils import DEFAULT_DATETIME lg = getLogger(__name__) class Text: """Class to read text format records. The reco...
c7060c47948cf4f38d83f5b2442687cdd9b7a5f49508739f250e0a4b5b1c7597
Python
5,610
123
""" Class to handle synapse nearest neighbour distance results (and storage) last modified: Michael Reimann 01.2023 """ import h5py import numpy as np import pandas as pd class SynNNDResults(object): """ An object to hold results of synapse Nearest Neighbour Distance (NND) and read/write them from/to an HDF5...
65d1f00128c36487de0414fdc1d95ca97b613bef694ecad5302236bdc4fd1930
Python
5,612
143
"""Custom quartodoc renderer for the node class pages. The node groups are documented twice: GUI pages under `docs/nodes/` (generated by `docs/generate.py`, holding the long-form prose and demo videos) and the quartodoc class pages this renderer produces. For each node class this renders the Inputs / Outputs docstring...
50b162bfca216628d1f8be047e38b3ad762a910d5b563e6ed8d5d41885c5a21c
Python
5,613
106
#!/usr/bin/env python import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from nltools.data import Brain_Data, Adjacency from nltools.mask import expand_mask, roi_to_brain from nltools.stats import threshold from nilearn import plotting as nplot from sklearn.metrics import pairwise_distan...
11d6866d9101042d745a37e6594dea120e84b2b66a62c9d9d3b3efd08ce8ada5
Python
5,615
172
# 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...
48be5d9b1fd9f68e6c471edf184e8d17e3dd519981ab76fa6ec23a2ef8d86192
Python
5,615
175
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Example plot for LFPy: Single-synapse contribution to the LFP Copyright (C) 2017 Computational Neuroscience Group, NMBU. Execution: python example_anisotropy.py This program is free software: you can redistribute it and/or modify it under the terms of the GNU Ge...
730ade3ac012cac59647d1ce9716c85251cabd3441f92dd175ddeff0a240dcd1
Python
5,615
182
from io import BytesIO import matplotlib.font_manager as font_manager import matplotlib.pyplot as plt import numpy as np import seaborn as sns from PIL import Image class Colors: def __init__(self): """ Constructs all the necessary attributes for the DataPreSetting object. ...
ed2c84abbc5636cfd9c21f02d16434e0a293a8991a115cb7bc5a4a74c63d0a60
Python
5,615
136
#! /usr/bin/env python # ============================================================================== # Copyright (c) 2021, Ko Sugawara # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Re...