sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
369fdae3c3a8458f61ea5b43b32ec819705eebfe73d5be5f49549ff63753fb46
Python
6,439
160
# Script to run simulations to evaluate effect of time-step # on simulation accuracy and speed from os.path import join from get_paths import * import matplotlib.pyplot as plt import numpy as np import cell_esser import time as cookie import lib_neuronsim import multiprocessing import multiprocessing.conn...
cd45051aaa81dccca855ce47354bcd0c7d04a9d7860bedb75847833412dc59c2
Python
6,441
222
# Copyright (c) 2023-2024 Blue Brain Project/EPFL # 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 applicable law or agreed ...
1b98e1b0fceb59e5d07a3eba77a6f60006d82c8865b7aaf9311581f0ff04159e
Python
6,442
181
# 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...
7013d372b24e32fb3431bba62d623567bb0cadac0b800fd334e047453978775b
Python
6,442
120
"""Prepare an induced, directed FlyWire circuit with explicit provenance.""" from __future__ import annotations import hashlib import json import urllib.request from datetime import datetime, timezone from pathlib import Path import numpy as np import pandas as pd from scipy import sparse from scipy.sparse.csgraph im...
9abadaca7651923efbead9a2bb48a58ef87225518e4d3d9e3d168219e4859c4f
Python
6,442
164
import os import numpy as np 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 #Digital data was collected at 40,000 samples per second signal_size = ...
4eca804542610f64b2a7230f2f45de66ee61886c7c96d8a0bc3235058aa3836b
Python
6,445
118
"""Neural interfaces: the mathematics between language-model activations and the reservoir. Contract (duck-typed; see docs/PLUGINS.md, "Neural interface"): hidden_size: int model hidden size the interface was built for reservoir_neurons: int reservoir state dimension it reads features: int ...
e5afe1067963b305caecc0d62a8e7de3b76a638a408f7460d340ef716eca1482
Python
6,445
187
from __future__ import annotations from functools import cached_property from typing import Literal import numpy as np import pandas as pd from numpy._typing import NDArray from scipy.stats import false_discovery_control from sklearn.base import BaseEstimator from sklearn.feature_selection import chi2 from cuppa.com...
3b854f68f6f55b1f5668541813fe0ec51bc7c3b18e60cf50693a1ec10299a1cf
Python
6,448
225
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
3ec6d2c4b745a8adce22f7ced25b03613b19d9b1e17c941caf3a198bed44f1a7
Python
6,448
207
# -*- coding: utf-8 -*- # # Syncopy object concatenation # # Builtin/3rd party package imports import numpy as np import h5py import dask.distributed as dd # Local imports from syncopy import __acme__ from syncopy.datatype.continuous_data import ContinuousData from syncopy.shared.parsers import data_parser from synco...
a6f24a9f71b16c95d142157e1bc7a87c09839caa6eab1c276423f1fefb06d727
Python
6,448
208
# 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...
6b71b171992033c14aff064aad82cec88fa4e59c6743949959dbd1c2112f288b
Python
6,449
202
# 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...
abad71717ab8b668889abbdc4952d36c5c82883d85f8bffe8562866f3e32f2f8
Python
6,449
157
""" requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :param method: method for the ...
56e804cf891a44e65a8956eccbb451299440428360e1e749b957f9bddf4fbe59
Python
6,450
184
# # 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,...
e955595ac9042383630dfb0b4757250c12cae765af604792bcdd0055a243faca
Python
6,450
191
# 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...
f8bf3680aa48bc8ed22c94e8ec9b7082da14c5a59546eace74d6baf649eb8cf2
Python
6,450
175
# 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 queue import Queue from threading im...
bfd01aac4f22e6a3c24e196221fbe096cc6fe17ca294e5110e01e96cdac9bfdc
Python
6,451
189
from pathlib import Path import sys,os import argparse import logging import sys import typing as T from pathlib import Path from timeit import default_timer as timer import torch import esm from esm.data import read_fasta logger = logging.getLogger() logger.setLevel(logging.INFO) formatter = logging.Formatter( ...
e5f131914daf44a41fc1b689cdb6b5d60653ac62fa4b9b4d063fcaa557e33504
Python
6,451
124
import torch import torch.nn as nn class TSCeption(nn.Module): r''' Continuous Convolutional Neural Network (CCNN). For more details, please refer to the following information. - Paper: Ding Y, Robinson N, Zhang S, et al. Tsception: Capturing temporal dynamics and spatial asymmetry from EEG for emotion r...
e820382f5631c7dd6e07ff540627057116d3e9c36da9319a0b63713977b3572e
Python
6,451
229
""" This script computes the scores for the initial questionnaires according to the each test's instructions. Inputs: - excel file with the answers Outputs: - excel file with the computed scores @author: ana.trianahoyos@aalto.fi Created: 07.06.2023 """ import pandas as pd from datetime import datetime #########...
e97427526a0e8f9e0f579ded1d4a671db98315a7284b20b7f5540de37057de39
Python
6,453
179
##### Useful functions used in the script ##### # Libraries import numpy as np import math import operator import functools from scipy.stats import beta as betalib import matplotlib.pyplot as plt from scipy.special import gammaln from scipy.stats import gamma, norm, invgamma # Gamma pdf with parameters alpha, and an ...
bac5a6b456113ac825c49ffcc01a6c4667534e351b326b368e27534eb2c91a5c
Python
6,454
157
import argparse import json import os from openmm import XmlSerializer, unit from openmm.app import PDBFile, StateDataReporter from colabmda.openmm.modular.utils import ( add_solute_heavy_atom_restraints, fresh_seed, load_stage_state, make_sim, offset_seed, save_stage_artifacts, save_stage...
5df4ff3dd3a05e5a2a7da86a7735625578448ccf1ae1e401f146dd3ee730c4bb
Python
6,455
198
from __future__ import annotations import os from logging import INFO from pathlib import Path import pytest from ase.build import bulk from ase.calculators.emt import EMT from quacc import JobFailure, change_settings, get_settings from quacc.runners.prep import calc_cleanup, calc_setup, terminate def make_files()...
d236df17c8a431f6f894fbb3d93bb74627806df2165d848b069738ac1fbc40ba
Python
6,455
132
import numpy as np import os import pandas as pd from tabulate import tabulate from constants import DATA_DIR, SCORE_COLUMNS from src.preprocessing2.process_ratings import merge_rating_files from src.utils import map_to_score_grid ID_LENGTH = 24 def main(): ratings_clinicians = pd.read_csv(os.path.join(DATA_DIR...
36293d3f24a61785782384fbf58392e9003af40b81ef63051a390368b8dbbf8d
Python
6,457
162
# -*- coding: utf-8 -*- """ Created on Mon Jun 13 09:57:27 2022 @author: Administrator """ import numpy as np import os import bigfish.stack as stack import bigfish.detection as detection import bigfish.multistack as multistack import bigfish.plot as plot from bigfishUI import * from matplotlib import p...
0ff06beae789a90768f6ffeefd852b8db963a9c45671c28f2b53d92e677c7195
Python
6,459
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...
b1bae1c72867b0e4d77d7c8c7167ae47c003e3137e44ce188e9bf301b9d561c2
Python
6,461
134
import numpy as np import numba def simulateBOLD(Z, dt, voxelCounts, X=None, F=None, Q=None, V=None, rho=None, alpha=None, V0=None, k1_mul=None, k2=None, k3_mul=None, gamma=None, k=None, tau=None): """ Adopted function from neurolib, added parameters for the shape of bold activation to the argume...
f60e59081b7765008d4cb3399a5f60a660017caae2dd2877fcc5d8b5ea02671b
Python
6,461
138
import numpy as np import random import pickle import warnings warnings.filterwarnings('ignore') import numpy as np from torch.utils.data import Dataset class NetDataset_new(Dataset): def __init__(self, mode, mech, args, min=None, max=None, ori_test=False): super(NetDataset_new, self).__init__() ...
aec71de8ecce1984ec8249934160f105c356c0ec92539f0001ae4083b2d464af
Python
6,463
192
""" Config file class authors: Thomas Delemontex and András Ecker; last update 04.2023 """ import os import yaml class Config(object): """Class to store config parameters about the simulations and analysis""" def __init__(self, config_path): """YAML config file based constructor""" self._con...
f2e4de7d9efe8d1564edc72991d16483cee1526721682306b7448a560b049ee3
Python
6,465
99
"""DELETION_ANATOMY.py 2026-09-30. Pre-registration: 04-NOTES/PREREG-2026-09-30t-DELETION-ANATOMY.md Where the synapses of Santos's antennal-lobe deletion lie (neuropil, sister projection neurons), and whether the deletion as described (antennal lobe only, between glomeruli) does what the whole one does. usage: pyt...
4c7bd507074e60c9140d1307ac8c511a35194f313feaa692498ffc2791afbe68
Python
6,467
186
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 10 18:49:13 2021 @author: tom, tong, melissa """ # TODO: Correct M1, M3, M5 (probably just scale by 43/401) # TODO: Test and verify import numpy as np import cochlea from mne.filter import resample from joblib import Parallel, delayed import ic_cn20...
958aae47f594af74a0ae331e709f7708430bdb653480e850f3633cfa07088563
Python
6,467
153
import sys import inspect import torch # from torch_geometric.utils import scatter_ from torch_scatter import scatter,scatter_add special_args = [ 'edge_index', 'edge_index_i', 'edge_index_j', 'size', 'size_i', 'size_j' ] __size_error_msg__ = ('All tensors which should get mapped to the same source ' ...
292878de2a983496bd06f88c0deb0c6e91373b1c2566aac26c079ae6143bfce1
Python
6,472
202
import click import einops import torch import torchvision import matplotlib.pyplot as plt import segm.utils.torch as ptu import torch.nn.functional as F from pathlib import Path from PIL import Image from segm import config from segm.data.utils import STATS from segm.model.decoder import MaskTransformer from segm.mo...
f6ca9a1aab309fa147c1edc861b308b19ce5ddefda5ee52e88bbe98bad491637
Python
6,472
168
# -*- coding: utf-8 -*- r"""This file implements a combination of the atomic charge (AC) and the atomic dipole (AD) dipole model resulting in the AC+AD dipole model. Atomic vectorial property predictions from the network are interpreted as atomic dipoles while the atomic scalar predictions are interpreted as atomic ...
48f29c9a36457bfc09c4a96b7f3518cac58e5c7a68744ab8aa10f594f070bdde
Python
6,473
156
#!/usr/bin/env python3 # Python standard libraries import os, sys, filecmp, difflib, time, traceback, subprocess # os.system('head -n 26 test_results.html> test_results.html.tmp && mv test_results.html.tmp test_results.html') w=""" <html> <head> <title>Example tests results table</title> <style> th { color: whit...
7e9c4a6bae0a5ed1a17742437f76e3a5e20a0f9239f6e91c343e9af5de7b8690
Python
6,474
174
import numpy as np import random from control_tools.common import adjust_trajectory, get_arm_prefix, generate_times from pybullet_tools.utils import set_joint_positions, get_extend_fn, get_joint_positions, is_circular, \ joints_from_names, get_difference_fn from pybullet_tools.pr2_utils import get_arm_joints, get_...
2e51253b928b5f701fd5820e1621c2ea46076a1318e93408a49e885941507848
Python
6,475
155
#!/bin/env python3 """ Topology -------- This submodule contains lots of functions to find the intersection of different kinds of sets. """ import numpy as np from itertools import groupby from typing import List, Tuple, Union from scipy.interpolate import RegularGridInterpolator from intersect import intersection fr...
0929d7f0f99fd683c29ddee3edb9f5fdfe7c1bd28736201b96f549e73ca437e0
Python
6,476
183
import logging import os import shutil from optparse import Values from typing import List from pip._internal.cache import WheelCache from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import RequirementCommand, with_cleanup from pip._internal.cli.status_codes import SUCCESS from pip._internal...
a9fe6809096a343cc5406f4358d17f4826f8244e981a6ff06309f13088777711
Python
6,476
155
#!/bin/env python3 """ Topology -------- This submodule contains lots of functions to find the intersection of different kinds of sets. """ import numpy as np from itertools import groupby from typing import List, Tuple, Union from scipy.interpolate import RegularGridInterpolator from .intersect import intersection f...
cae0f6b236ed141cfb9a61f822192bfa3dfda0ca1a35f313d8fdf37f1624bd07
Python
6,476
198
import argparse import os, random, gc import numpy as np from numpy import * import torch import pickle as pkl import time import torch.nn as nn import torch.nn.functional as F from torch_geometric.utils import remove_self_loops, add_self_loops, subgraph from utils.logger import Logger, save_result from utils.dataset...
fd2c40428fa4c6c2d4d09f88f45094305342dad97fdd9493da4f814e8b95f9ab
Python
6,477
127
from itertools import cycle from control_tools.execution import ArmTrajectory, Detach, GripperCommand from plan_tools.common import Control, Conf, Pose, get_reference_pose, is_obj_type from plan_tools.samplers.generators import solve_inverse_kinematics, plan_waypoint_motion, \ compute_forward_reachability, check_i...
6fcefdebea9f8e0fc5d58712b7b9703ff8e2668663c194af106201ef55ef5cb7
Python
6,479
153
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Mar 21 16:47:06 2023 @author: deeperthought """ import os import numpy as np import matplotlib.pyplot as plt import sys MODEL_WEIGHTS_PATH = '/model/pretrained_model_weights.npy' T1_POST_PATH = "/data/Breast_MRI_001/T1_axial_02.nii.gz" DC...
1c9c5fda4caeb5d4c04b41d41e25c1d9a0471f4a69716df5551554863a2e028f
Python
6,481
150
# Copyright (C) 2024 by mao jiashun and wang jianming # Copying and distribution is allowed under AGPLv3 license # This script implements the training of a WGAN (either WGAN-CP or WGAN-GP) on molecular data, # leveraging graph neural networks (GNN) for 3D molecular structure representations and SMILES-based data. # Th...
2d7f72916871f98ac0cb9774380f99bdb51d3f8a0c7640fd6a6d364ac0cab71c
Python
6,481
183
# 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...
ff68fa50931290a3ce69cedc754cacca75accf9ec165f1120700e32da50f5def
Python
6,484
172
"""Smoke + signature tests for previously-untested cell_counting_legacy. The module is deprecated for new development but process_counts and update_summary_structures are still imported by point_registration. load_summary_structures is already covered in test_cell_counting_legacy_count_labels.py; this file adds...
e45660123d05f81eabf2a6910495c12a8e7de02be1a864bffd58f640aff66710
Python
6,485
168
"""Regression guards for the batch-2D improvements: hard cancel, per-image timeout, stop-on-failure, retry/resume, deterministic progress, real Align template, and log-capturing .bat lines. """ import os os.environ.setdefault("QT_QPA_PLATFORM", "offscreen") import numpy as np import pytest from unittest.moc...
a9e413ea34265a233c67007dac86e74cffb640b0f808022e16bc3fa6d602d47a
Python
6,487
233
# 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...
2d5d4136e36166e7574d7f72c88f2820fcc5b204fb8aa80215fcf23baae6e762
Python
6,488
157
# Copyright 2021 DeepMind Technologies Limited # # 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 applicable law or agr...
4f9da2effee7d9b184a0f56027d2e5dd9e7619f996c99b891d922fe14f6f0375
Python
6,488
241
"""Data type definitions for the sleeplab format.""" import numpy as np import zarr from collections.abc import Callable from datetime import datetime from enum import Enum from functools import cached_property from pydantic import BaseModel, Field, model_validator from pydantic.functional_validators import AfterValid...
c2f1d5c5c3606be1739b0c57f6c04882c26e899ea5dccd34f2d8af76be8e2c5e
Python
6,488
181
import pandas import rtree import networkx import numpy as np import cv2 from skimage.measure import regionprops from functools import reduce from merlin.core import analysistask from merlin.util import imagefilters """ A module for sequential round analysis Latest Update: Rongxin Fang 11/12/2022 """ class SumSignal...
f4a7bc7e84642c3fcac8ae4170b8cfe90f6b5d43818da4344d581270712689ac
Python
6,488
134
""" SIZE_MATCHED_BOOTSTRAP.py - written 2026-09-14. WHY THIS EXISTS. V-66 ticked the figures and then said, in its own words: "LIMITATION, stated: these ratios have no confidence interval yet. ... a bootstrap over neurons is still owed before they go in print." This is that bootstrap. It pays the debt...
1415bdd868fa6beb5c74a9240e86b6305b11f9e2226f7675845e7a459c3650e6
Python
6,489
197
import os import shutil from pathlib import Path from time import sleep import elasticai.experiment_framework.remote_control as eaixp_rc import pytest from elasticai.experiment_framework.synthesis.vivado_synthesis import ( _run_synthesis, ) from hypothesis import HealthCheck, given, settings from hypothesis import...
a4e396f25c943722f28951edc7886a4845f97cd3e26084c361f62b3cda268afa
Python
6,489
213
# -*- coding: utf-8 -*- """ Created on Jun 05 2023 @author: Jonas A. Thiele """ ###Read results of models trained with network-specific links on the main sample (610 subjects) via 5-fold cross-validation import numpy as np import scipy.stats from sklearn.metrics import mean_squared_error from sklearn.m...
a3319619ab0623bcc9e0cc5bd7fc4641c56a81f9b283fe3bc0b404b8c2e79b55
Python
6,491
286
from .extend import ( Box, SparseObject, VSpace, defjvp, defjvp_argnum, defvjp, defvjp_argnum, notrace_primitive, primitive, vspace, ) from .util import subvals isinstance_ = isinstance isinstance = notrace_primitive(isinstance) type_ = type type = notrace_primitive(type) tupl...
425d7df5130199db250ae6d3a8d4be3c69cb2f4541fdb92ec036068b8b1b275f
Python
6,492
141
from elasticai.creator.file_generation.savable import Path from elasticai.creator.file_generation.template import ( InProjectTemplate, module_to_package, ) from elasticai.creator.nn.integer.LUT.design import LUT as LUTDesign from elasticai.creator.vhdl.auto_wire_protocols.port_definitions import create_port fro...
239cbc848b87fff7cbf4e86ab84cb58d981c3df1fa59ba525851f7c2d996e103
Python
6,493
227
import time from tqdm import tqdm import numpy as np from scipy.stats import spearmanr from sklearn.metrics import roc_auc_score import torch import torch.nn as nn from torch import Tensor from torch.optim import Adam from .ptgwas import PTGWAS from .predictor import get_predictor def lowrank_plus_diag_solve(W, d,...
cb0c0fed48f3c52febbf849f880203104d20699e873888341cb83fe67232c11f
Python
6,493
130
# Import the necessary packages import argparse import anndata import pandas as pd import numpy as np import os import random from collections import Counter from pybiomart import Dataset import re # Define argument parser parser = argparse.ArgumentParser(description="Process arguments.") parser.add_argument("--inputP...
041b92ca6e1232834fa81a9bebd6a095a33dcd97c382a4d6733888d1ee4e751d
Python
6,494
173
# Node-group asset "Color VMD" (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, Li...
26b20c57f96d924b466bc97c4615adcf5dc2df775a5a980f5db75ac766399cb8
Python
6,494
194
"""Headless threading tests: effort/overrides reach ants.registration kwargs. ants.registration is monkeypatched to a recording stub, so no real registration runs. Verifies the 2D kernel merges resolve_ants_kwargs output into the reg_kwargs dict it passes to ANTs. The kernel does ``import ants`` at function sco...
49005d91ab574a280a186fd2683d14d29d49c1d7eb836e9408d7078245d97dd0
Python
6,494
150
import logging from typing import Iterable, Set, Tuple from pip._internal.build_env import BuildEnvironment from pip._internal.distributions.base import AbstractDistribution from pip._internal.exceptions import InstallationError from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata i...
6597b7a7a7f9455d3350c4ed0270a20847886fdadc39b2c3eba122b2c108ed5f
Python
6,496
200
# 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...
51f8537afe8e8283350b9a7a119004e3f1c649f7e7915706bfbf2027076fea71
Python
6,497
194
import torch import torch.nn as nn import torch.nn.functional as F from ..initializer import create_initializer from ..functions.shake_shake_function import get_alpha_beta, shake_function class ResidualPath(nn.Module): def __init__(self, in_channels, out_channels, stride): super().__init__() sel...
96c42cc897b5d4604d23229829cb91c7fef172c6108a0322fc4632f2c1bbecb8
Python
6,497
178
##### Useful functions used in the script ##### # Libraries import numpy as np import math import operator import functools from scipy.stats import beta as betalib import matplotlib.pyplot as plt from scipy.special import gammaln from scipy.stats import gamma, norm, invgamma # Gamma pdf with parameters alpha, and an ...
a236cc323bf5926a293c4c7d2027a0e7b2b96eaf0f7449cfceb35bc24c8fc9c9
Python
6,499
195
import warnings from collections import defaultdict from contextlib import contextmanager from typing import ClassVar import numpy as np import autograd from .util import subvals, toposort from .wrap_util import wraps def trace(start_node, fun, x): with trace_stack.new_trace() as t: start_box = new_box...
511b77000f9fde50cef4e430f13b936a7869ff8fdcf292303ee91550525f090b
Python
6,500
134
import importlib.resources from sitetack.app.alphabet import Alphabet from sitetack.app.kmer import Kmer from sitetack.app.predict import Predict, SitePrediction, SequencePrediction, SequencePredictions from pathlib import Path from sitetack.app.enums import PtmKind, OrganismKind, LabelKind from sitetack.app.sequence i...
a0e73d7cfc26bf2f7f4d40751babdcc1c254071103748ac40593fc043b26044b
Python
6,501
176
### # This file will: # 1. Generate and save Alexnet features in a given folder # 2. preprocess Alexnet features using PCA and save them in another folder ### import glob import torch import InternVideo import numpy as np import urllib import torch import cv2 import argparse import time import random fro...
cd7a46487e9817ebc4c6645cf7944f1fb9593ec5920a5e60e64f84b76b29c673
Python
6,505
150
import argparse from loader import MoleculeDataset from dataloader import DataLoaderMasking #, DataListLoader import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tqdm import tqdm import numpy as np from model import GNN from sklearn.metrics import roc_auc_score from ...
0877e61fd6a45bfcb9c43f48d565c387dfe30677ac2c6af51eafda8fea2900c5
Python
6,506
128
import os import pickle as pkl from typing import Any, Callable, Dict, Tuple, Union from ..base_dataset import BaseDataset class MemoryAgeDataset(BaseDataset): r''' Args: root_path (str): raw data files in pickled python/numpy formats # ----- for IO ----- io_path (str): The path to g...
00fbef853db2e43b22107577ed9edfe0efc1d8393e16a0c55fef9e68b59661b7
Python
6,507
202
# -*- coding: utf-8 -*- """ Created on Thu Dec 8 20:46:46 2022 @author: Dustin Garner """ import os import math import numpy as np import pandas as pd from matplotlib.colors import ListedColormap from fafbseg import flywire import flycode.utils as utils def import_file(file_name, sheet_name=0, usecols=None, ...
ddc233f49ed7427338561f7791a588749325b92554251c4c527b5ed453d34e7e
Python
6,508
201
# 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...
4b75ee3d957b99489bc47b3982d4dd45229b03b9afe0e8b70ab2a6aeaf14a112
Python
6,509
165
import warnings import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np import pytest from SurvivalEVAL import IntervalCenEvaluator, SurvivalEvaluator from SurvivalEVAL.evaluations.calibration.distributional import ( coverage_ic, create_censor_hist, create_interval_c_h...
8ad1eaa276cb2de738ea9007c021559815f097e4221ab7704b314651aa07a069
Python
6,510
134
# -*- coding: utf-8 -*- import torch from supar.models.dep.biaffine.model import BiaffineDependencyModel from supar.structs import DependencyCRF, MatrixTree class CRFDependencyModel(BiaffineDependencyModel): r""" The implementation of first-order CRF Dependency Parser :cite:`zhang-etal-2020-efficient,ma-...
9210a25ca60e6129428bf3b5b28e09bab6f56bb8c9f813e6ecbb9d028e21c77d
Python
6,517
206
# 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...
fd4c1a8f10ec08d85b02870d4f2daba821e3b39fe10c0352f3567a8dfd31032a
Python
6,518
167
import numpy as np from elasticai.creator.file_generation.savable import Path from elasticai.creator.file_generation.template import ( InProjectTemplate, module_to_package, ) from elasticai.creator.nn.integer.ram.design import Ram from elasticai.creator.vhdl.auto_wire_protocols.port_definitions import create_p...
74e0e83387c2074098d7608f0db4299c492de710aba4d421fe6993ee5b3df56a
Python
6,519
221
"""Computes the extraction efficiency in 3D and cylindrical coordinates. Verifies that the extraction efficiency of a point dipole in a dielectric layer above a lossless metallic ground plane computed in two different coordinate systems agree. """ import matplotlib.pyplot as plt import meep as mp import numpy as np ...
5de5847042842112a1b9db8ae7eb824fdc2e966b6db8c5bc09a09aa2e052f1b7
Python
6,520
147
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...
b651fba6416303641528aaa1a773885c61fd8b0c21081524c30f60f85e0eb93d
Python
6,520
179
import numpy as np from matplotlib import cm import matplotlib.pyplot as plt def plot_cycle_timeOfday (time_x, time_x_names, daily_var_dayAvg, roi_names, ylabel, fig_title, is_avg_plotted = True,tick_Hfreq = 2, ax=None, ylim = None, outcome_clrs=None, clr_avg = None): [n_roi, n_win] = daily_var_dayAvg.shape # ...
b2794f5ff46221a66ad3e28e13a1ea0f8291c7834592bff1cae077c9b8e916b3
Python
6,522
205
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bff0645ca7d355f34f435659fcff2bf79cf51a4c15ef68df90a5d94bda36929e
Python
6,522
179
# 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...
9b3cfdb4da184bb40ee83fa321a83d225b0f8b0df00597a164aef0d9760558a1
Python
6,524
183
# 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...
5492adc29d61adb332b40080f56fe65d246b0312f9e65c72fa709fdc02dba778
Python
6,525
213
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
418fd2afbaa74f1f37b11334fe6fa7a7aac0d21b7bdde658fa5dff428d683823
Python
6,526
160
# Node-group asset "Offset Point Along Curve" (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 TY...
83820212bd94d149fd7db416ab302062035a375427be8c5b1eedc1778da59787
Python
6,527
214
## # \file niftyreg.py # \brief Class to use registration method NiftyReg # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date Aug 2017 # # Import libraries import os import numpy as np import SimpleITK as sitk from abc import ABCMeta, abstractmethod import pysitk.python_helper as ph import ...
f0bcc7f9c26bacf3af580e88e5c3e3fd83a39cd3bc96f79f02639f2baae63be7
Python
6,535
157
"""``axisAlignData`` now finds the midsagittal plane by reflection symmetry (``regtools.hemisphere.fit_from_image``) instead of Hough-line fissure detection. These checks pin the new seam: the plane->normal conversion plus the rotation must (1) be a no-op when the moving volume already matches the template, and (2)...
f56ddeb2a10d4c909f4a2b5b3a43d881270940564231ec67c41463fe05af2408
Python
6,535
188
# gff class import pickle def extract_region_by_attri(gff3_eles, attri_name, attri_val): outstrs = [] for gff_ele in gff3_eles: if attri_name in gff_ele.get_attr_keys() and gff_ele.get_attrs()[attri_name] == attri_val: outstrs.append(gff_ele.print_str()) print("extract {} regi...
1ceda0ecf571492e5409c0e8bf781e668e6d08c8365d033a852796a98729d855
Python
6,536
247
import numpy as np from numpy.testing import assert_array_almost_equal def unbiased_edge(x, y, p_minus, p_plus): z = (y - (p_minus - p_plus)) * x return z / (1 - p_minus - p_plus) def unbiased_mean_op(X, y, p_minus, p_plus): return np.array([unbiased_edge(X[i, :], y[i], p_minus, p_plus) ...
73941240a2af0f7afe18274be293302cf8a02e84ce1afb3baa6456dcb8d7a9ad
Python
6,536
186
# -*- coding: utf-8 -*- """ Created on Wed Aug 2 14:43:18 2023 @author: ashwin.bhandiwad """ import os, subprocess import pandas as pd import numpy as np import json import matplotlib.pyplot as plt import requests import SimpleITK as sitk import pathlib import anndata def plot_section( xx, yy, cc=None, val=None, fi...
77edcc949f1ec0889b5dd670c05054cc0cafdb179e46fed23f2b8eab71ab0237
Python
6,536
197
from __future__ import annotations import os.path import pandas as pd from cuppa.logger import LoggerMixin from cuppa.misc.utils import check_required_columns class CuppaFeaturesDir(LoggerMixin): def __init__(self, directory: str): self.directory = directory FILE_PATTERNS = dict( snv="cupp...
81d8c57f9f22d8315ea322b91df6c8c793dca60dba3a41c88c898eb15ba3800c
Python
6,537
149
import numpy as np import pytest from regtools.tilt_slice.oblique import extract_oblique_planes def test_zero_tilt_equals_plain_coronal_slice(): rng = np.random.default_rng(0) vol = rng.random((60, 40, 50)).astype(np.float32) idx = 25 inten, labels = extract_oblique_planes(vol, None, idx, 0.0...
53c80b9b58bdf50706cd7c5a704b9fb0878daa10ed1dfc0a2e1369920a885c8d
Python
6,538
147
############################################################################### # This code generates the missing data plots for behavioral data. # # # # If plotting data from the first pilot, use the following values: # ...
54bd229afa34cd3ea0e29860ba5fec4829bdabcd4e8e93b2bf9aeee5b883dc39
Python
6,541
138
# 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...
3576343621b6c17e58a5dfc93f8d335e035f6283b7e83aa49d133b4b32cc9b84
Python
6,542
147
import argparse import random import sys import numpy as np import os import pandas as pd from pathlib import Path from tabulate import tabulate import json import torch from constants import * from src.dataloaders.rocf_dataloader import get_dataloader from src.models import get_classifier from src.training.train_uti...
90c67ebd99e61c0157399c03b193ddbd36c6e5575d6f226b4125f8a6518d4c49
Python
6,542
174
import sys import os import json import neo4j import pandas as pd from ckg import ckg_utils from ckg.graphdb_builder import builder_utils def read_config(): try: ckg_config = ckg_utils.read_ckg_config() cwd = os.path.dirname(os.path.abspath(__file__)) path = os.path.join(cwd, 'connector_co...
6eba6cc7e128ea5a6b30c9a05c183fe8a0b6fd5012dc9013b8f390704de8259f
Python
6,543
150
#!/usr/bin/env python # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ Collection of traffic scenarios where the ego vehicle (hero) is making a left turn """ from six.moves.queue import Queue # pylint: disable=relative-import import py_trees...
14f628c9572a6f66dd629b5ed59c423024d328fb6778d71d07ae0fe4172eecf0
Python
6,545
173
from __future__ import division, print_function import numpy as np __author__ = "Marcos Duarte, https://github.com/demotu/BMC" __version__ = "1.0.4" __license__ = "MIT" def detect_peaks(x, mph=None, mpd=1, threshold=0, edge='rising', kpsh=False, valley=False, show=False, ax=None): """Detect pea...
8327ad343b17512be371ebcf2ea0cca7c09add5cfab278f8b6529441511f1de8
Python
6,546
155
from __future__ import print_function import os import sys import time import math import random import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.backends.cudnn as cudnn from torchvision import datasets, transforms from datasets import list_dataset from datas...
cef14fb0c2b4b05691825d3eb34fe0a45c6c6b3a5b1b76e51eeca5f62bde7de9
Python
6,546
199
# 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...
d56d25a947a3e8c6775b3363ed5e2d0a7c23fb397ecf82dc236434cc1380b444
Python
6,546
198
# 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...
7e074c63d15a3ddf7d0a6e2bcba5fee76d41f2bc295c4be67ee2fe7532cf695f
Python
6,547
151
import unittest from hed.errors.error_reporter import ErrorHandler class TestFilterIssuesByCount(unittest.TestCase): def test_empty_issues_list(self): issues = [] result, result_counts = ErrorHandler.filter_issues_by_count(issues, 2) self.assertEqual(result, []) def test_all_below_li...
42b341889ba4736e04bea323e826342bc92c8a42cc17baac44e4cf75d6d1ac95
Python
6,548
187
import os import pickle import bct import numpy as np from time import process_time from strength_preserving_rand_rs import strength_preserving_rand_rs from strength_preserving_rand_sa import strength_preserving_rand_sa from strength_preserving_rand_sa_energy_thresh import strength_preserving_rand_sa_energy_thresh fr...
76257f849ce06f43e99d3f9423cbf8d11636aec98bb67f05c5a835f332676b61
Python
6,550
203
"""Run decoding pipeline. """ from __future__ import annotations import pathlib import time from collections.abc import Sequence from typing import Annotated, Literal import pte import pte_decode from pytask import Product import motor_intention.project_constants as constants PATHS_STIM_OFF = tuple( constants.D...
7829f61a03e6c79b28baade9625494dc0c8de9a8b625ccb39e7d4ce6e4030261
Python
6,551
225
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...