sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
5b2a37b2495084f291cafb33046b6c0ab4f0f298ddc4b5da551af883c73467cb | Python | 6,253 | 177 | # -*- coding: utf-8 -*-
"""
Created on 15 october 2023
@author: divyoj
"""
## importing libraries:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.animation import FuncAnimation
import os
# # note that this must be executed before 'import numba'
# os.environ... |
a0233e57a007105169138ec042428b1e28c493112a3861e2a9377d3d953100c0 | Python | 6,253 | 215 | from collections.abc import Iterable
from typing import override
import pytest
from elasticai.creator_plugins.lutron_filter.rules import (
FilterParameters,
PrecomputationStrategy,
make_precompute_rule,
)
from elasticai.creator_plugins.lutron_filter.rules import _ir as ir
import elasticai.creator.ir.datag... |
b00ab1754c6a78cb3436a2dbbd49f2087dbf15b9daca63bea3c49d03049d3b4c | Python | 6,255 | 148 | import numpy as np
list_attributes_session_to_edit = ['dF_F', 'name_roi', 'S_noisy','S','activations','kept_cells','roi_mask',
'rate_f','rate_n','selectivity','rate_f_discrete','rate_n_discrete',
'selectivity_discrete', 'rate_f_continuous','rate_n_c... |
0b8ab2a09ad44e4abe395de23bef15cf752d598a49c124dd879fef94608674d4 | Python | 6,257 | 197 | """
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.token import Token, STANDARD_TYPES
# Default mapping of ansixxx to RGB colors.
_ansimap = {
# dark
... |
6727de6035bdac6c088c26e1cf53019676fcb688889f4f35f40a9a45a59c8191 | Python | 6,257 | 166 | # 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... |
c7d6ddf798ef03015d1ded51ba80222f14e1e147d26b2f492a4c932d07f776f8 | Python | 6,257 | 210 | """Base jobs for ORCA."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ase.calculators.orca import ORCA, OrcaProfile, OrcaTemplate
from quacc import get_settings
from quacc.runners.ase import Runner
from quacc.schemas.cclib import CclibSummarize
from quacc.utils.dicts import recursive_di... |
a6677f9c8fca188f7124dffd64073802459c4814ab90a1e40ff3717f5ba93981 | Python | 6,258 | 144 | import sys
import scanpy as sc
import anndata
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import pickle as pickle
import cell2location
import scvi
from matplotlib import rcParams
rcParams['pdf.fonttype'] = 42 # enables correct plotting of text
import seaborn as sns
... |
12b283188102350c908becbc32d556110d83cf3b78d9d45346ca0efc342a3baa | Python | 6,259 | 248 | """
Test working properly with ufuncs in presence of other, non-differentiable array-like-containers.
Specifically, xarray.DataArray is tested.
"""
import numpy as onp
import pytest
import autograd.numpy as np
from autograd import grad
from autograd.test_util import check_grads
try:
import xarray as xr
except Im... |
5d99641f542df177a077dbb310664a6ec9c2b256abeccdb45d06dbaa3a714c46 | Python | 6,259 | 232 | """
https://github.com/MIPT-Oulu/Collagen/blob/master/collagen/core/_model.py
"""
from abc import abstractmethod
from typing import Tuple, Dict
import torch
import torch.nn as nn
class Module(nn.Module):
"""
Generic building block, which assumes to have trainable parameters within it.
This extension ... |
5f81e3776ba0ad28097910b95ffccffd666d17bda83815a9e2c04e7941516ca7 | Python | 6,259 | 74 | #! /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
BENCHMARKS_DIR=os.path.expanduser('~/repos/downward/benc... |
10cfa6efa3cdd1bdc9793a762b1038ea87b79d0f23fa479c6146c822cb0a1650 | Python | 6,263 | 189 | import os
import cv2
import sys
import time
import math
import random
import numpy as np
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, cv2_transform
fro... |
c0f8ef490b542c71c161025a64961e3d74cd37e998b6e57a956fe259666665a6 | Python | 6,264 | 150 | import numpy as np
import pandas as pd
import mne
from mne.preprocessing import ica
def default_events_fun(events):
''' Default event function. Returs same type of event as input '''
event_id = {str(eo): eo for eo in np.unique(events[:,2])}
return events, event_id
def WM_epoching(data_path, ica_path, tmin... |
5ac4bc61eec60b86f264ed25f7fa66b4a9f782e21a11c09f280d51a9cab79d3b | Python | 6,265 | 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... |
9e0a22cbd1d0cb5a8f135aa2589d57ea8b4f8ec0f11ddae360e010b4fa5cbb3d | Python | 6,265 | 177 | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
import numpy as np
from scipy.linalg import block_diag
from torch.autograd import Function
"""
DIFFPOOL:
Z. Ying, J. You, C. Morris, X. Ren, W. Hamilton, and J. Leskovec,
Hierarchical graph representation learning with di... |
01208b6bbacd94a2d21a35ffb547353db9c18115d20e284f622a5ef21a0c3b2d | Python | 6,267 | 237 | # 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... |
a69e96582338b9dd84d6985e80fba834424e4815663e6c97baaaf33c8786b349 | Python | 6,267 | 154 | """
@author: Haotian Teng
"""
import torch
from torch import nn
from functools import partial
from typing import List
Conv1dk1 = partial(nn.Conv1d,kernel_size = 1)
RevConv1dk1 = partial(nn.ConvTranspose1d, kernel_size = 1)
class AttentionNormalize(nn.Module):
##TODO: this module makes the model hard to converge,... |
b4e2448e7905723b845bec1516eea9e43fae600b216efcac4abef4bc489250b3 | Python | 6,268 | 145 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from typing import Any, Dict, Optional
from models.model import Model
class M1DCNN_Net(nn.Module):
@staticmethod
def weight_init(m):
# [All the trainable parameters in our CNN should be initialized to
... |
4731db8493d4cdd1dffd4aaad9d738fce59b74620abad7c8817abcca00f41fc2 | Python | 6,269 | 146 | # 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... |
04ad0085de6755feb49f3fbe3d591551575a4925ee3d4a972493726ac2fad055 | Python | 6,270 | 193 | import torch
import torch.nn as nn
import torch.nn.functional as F
# from .linear import Linear_gaussian_init
class ScaledSiLU(nn.Module):
def __init__(self, inplace=False):
super(ScaledSiLU, self).__init__()
self.inplace = inplace
self.scale_factor = 1.6791767923989418
def forward(s... |
5ce07fcb83569e0ac08a89bb5097c4a7b12613fc3fc7f22cd46d2dff03996337 | Python | 6,270 | 162 | # 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... |
d58dbf812025da05d817ead5b7fef788b03a85ea20861a6246046359c129c7cb | Python | 6,270 | 153 | import os
import argparse
import numpy as np
import pandas as pd
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from xgboost import XGBClassifier
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score, roc_auc_score, f1_score, average_precision_s... |
3695c6c8075dc835ea26a5154724ab1cb93ffc2daad5074175310e48fb8cf28c | Python | 6,271 | 176 | import sys
import random
import os
import argparse
import sys
import pwd
import time
import subprocess
import re
import shutil
from sklearn import metrics
import re
from sklearn.metrics import roc_curve,roc_auc_score
import numpy as np
import glob
import logging
import io
import tensorflow as tf
#from callbacks import... |
580344eb2c7a2144a10ad1b8f138ea79a94e1f40675fc941bc38333a8460e7bc | Python | 6,271 | 157 | """
Script for plotting clouds from different groups
Input: - Path to the input SetCloudP pickles
Output: - Plot graphs with the statistical comparison
- Store a CloudPlotter object in pickle file
"""
__author__ = 'Antonio Martinez-Sanchez'
################################################... |
ab07c988dc7d30dafcbbea7f6bd5bc23175a24870d2f29e23b19be789a694e12 | Python | 6,271 | 182 | import os
from importlib import resources
from time import sleep
from typing import Any
import yaml
from jinja2 import Template
from pydantic import BaseModel, TypeAdapter
from .inputmodels import ComponentInput, InputPath, JobInput, SimulationInput
def model_defaults(model: type[BaseModel]) -> dict[str, Any]:
... |
e48b7196c8f4a3766a8bb39d451f73e56610a2ee03ff64c10ce9e4c557d3a89c | Python | 6,271 | 218 | from datetime import datetime
from pytest import raises
from wonambi import Dataset
from wonambi.attr import (Annotations,
create_empty_annotations,
)
from wonambi.attr.annotations import create_annotation
from wonambi.utils.exceptions import UnrecognizedFormat
fro... |
52b303932de56b494054be7f2839371ad2c318f7eadd360117ac570b605f1cde | Python | 6,272 | 147 | # Re-run simulations for particles for D+ and D- runs
# that have similar network strength values to find unified model
try:
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
nhost = comm.Get_size()
except ModuleNotFoundError:
rank = 0
nhost = 1
from os.path import join
from ... |
f6b41a9e11dd489f57cc860dc5d5057256e970b57bb08efd43c26e9b951aaa7a | Python | 6,274 | 151 | from typing import List, Tuple, Union
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from torch.utils.data import DataLoader
from ..classifier import ClassifierTrainer
class LALoss(nn.Module):
def __init__(self, class_frequency: List[int], tau=1.0, eps=1e-12):
... |
bde4a02b1aeec2fd609e53491367aa56e6b51563760cf69dc914778bee7504d2 | Python | 6,275 | 175 | """Convert DOD data from h5 files to sleeplab format."""
import argparse
import h5py
import logging
import numpy as np
import sleeplab_format as slf
from datetime import datetime as dt
from datetime import timedelta
from datetime import timezone
from functools import partial
from pathlib import Path
from zoneinfo impo... |
123912f5c8bda66d5362554decca1c758f2c86a9c84d735f8ca67d7a919d9c89 | Python | 6,276 | 177 | ##
# \file toolkit_executor.py
# \brief generates function calls to execute other reconstruction toolkits
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date Jan 2018
#
import os
import pysitk.python_helper as ph
EXE_IRTK = {
"workstation": "/home/mebner/Development/VolumetricReconstruct... |
22f7dbf92ad24862336793069d535980c59e9545aba7c127f5f3ec9347b938fe | Python | 6,276 | 166 | """
Script for extracting the graphs for clustering an acting network
Input: - GraphMCF af an acting network
- Parameters for clustering algorithm (Affinity propagation)
Output: - A clusterd graph
"""
__author__ = 'Antonio Martinez-Sanchez'
# ################ Package import
import os
imp... |
8e89f8f17df9b675425046294795379409c87581acd423a75b36c8cca18d73e7 | Python | 6,278 | 129 | #! /usr/bin/env python
"""
calculate modification frequency at genome level
"""
import argparse
import os
import sys
import gzip
from txt_formater import ModRecord
from txt_formater import SiteStats
from txt_formater import split_key
def calculate_mods_frequency(mods_files, prob_cf):
sitekeys = ... |
be118875876c2497959d0ef1f6fe110e030b82e29f7a9291fdfd8f54013af716 | Python | 6,280 | 102 | """ALL_GLOMERULI.py 2026-09-28. Pre-registration: 04-NOTES/PREREG-2026-09-28b-ALL-GLOMERULI.md
Test A: AL_FIX's four conditions (published, best guess, laboratory prior, excitatory LNs silenced) in all 50 glomeruli.
Test B: 40 more draws from the classifier's probabilities on DL5.
usage: python ALL_GLOMERULI.py [run|an... |
ecf61d7f96f61916d680ef689236d755be480be41bd0853bd0dad8eec8e0027f | Python | 6,280 | 242 | import os
import pylink
import sys
from psychopy import visual, logging, core, event
import rtPupil_config
import numpy as np
def set_up_directories( behavioral_folder, eyelink_folder):
"""
Set up directories to save real-time data. If directories do not exist, make them.
Parameters
----------
b... |
a1bdf89b4b2c221c5f20424b01517b03217b641ec7401ac6c1f9782d12762c40 | Python | 6,282 | 174 | from collections.abc import Callable, Iterator
from elasticai.creator.ir import AttributeMapping, attribute
from elasticai.creator_plugins.grouped_filter import FilterParameters
from ._ir import (
DataGraph,
FilterDecorator,
NameRegistry,
Node,
NodeConstraint,
Registry,
Rule,
node,
... |
b548b7a3ee506e13cfe0a8cdaa60390d02861580afb2b5073f70c97d425a8eac | Python | 6,282 | 150 | import os
import sys
import pdb
import argparse
import glob
import h5py
import json
import time
import resource
import pickle
import pandas as pd
import numpy as np
import tensorflow as tf
import util_tfrecords
import util_stimuli
import util_misc
def get_display_str(itr, n_itr, n_skip=0, t_start=None):
"""
... |
52509fc83272968002dcbe0945dc51da148b185b14131a5cc3bd5ae76b2b7229 | Python | 6,283 | 147 | import matplotlib.pyplot as plt
import pickle
import numpy as np
import pandas as pd
import os
import seaborn as sns
import copy
def analysis():
# construct result dict
split = 'species'
parent_result_path = 'result'
result_dict = {}
for seed_result_path in ["finetune_seed" + str(i) for i in ran... |
5876775ef878fcbdee35323e0063254ec72e7e04d4a9832f3b7c65c2544f41d1 | Python | 6,284 | 191 | import warnings
from typing import Optional, Union, Dict, Any
import numpy as np
from scipy.linalg import eigh
from ase import Atoms
from ase.io.trajectory import Trajectory, TrajectoryWriter
from ase.optimize.optimize import Optimizer
from sella._ase_compat import disable_logfile_if_none
from sella.peswrapper impor... |
898b553dd8b2b5a4d071204237f7c893e5abba3973014634a372845755290f9d | Python | 6,285 | 163 | """
Abstract base class for HedSchema and HedSchemaGroup, showing the common functionality
"""
from abc import ABC, abstractmethod
from hed.schema.hed_schema_constants import HedKey, HedSectionKey
from hed.schema.schema_io import schema_util
class HedSchemaBase(ABC):
"""Baseclass for schema and schema group.
... |
50a72788dc975ff40e4bab8ff0784fab07a046e8ab951e434621597f66524095 | Python | 6,288 | 140 | import dsmil as mil
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torchvision.models as models
import torchvision.transforms.functional as VF
from torchvision import transforms
import sys, argparse, os, glob
import pandas as pd
import numpy as np
from PIL import Image
from collecti... |
8bc1bb677dff36367deefea234cbfceda67b9aa4672470a859d134295f3a4824 | Python | 6,289 | 149 | """
DeepLabCut2.0 Toolbox (deeplabcut.org)
copyright A. & M. Mathis Labs
https://github.com/AlexEMG/DeepLabCut
Please see AUTHORS for contributors.
https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS
Licensed under GNU Lesser General Public License v3.0
"""
from __future__ import print_function
import wx
import... |
e4cbc318e61630bc6c63ee1448c86f351028675da123ba88552032b22e93a8c8 | Python | 6,289 | 178 | """Manager for definitions associated with a type such as condition-variable."""
from hed.models.definition_dict import DefinitionDict
from hed.models.hed_tag import HedTag
class HedTypeDefs:
"""Manager for definitions associated with a type such as condition-variable.
Properties:
def_map (dict): k... |
cbfb10d21271bb6306f9f096f81fedf9c6f4a9ed0753090bfee658ddb2dd1ec6 | Python | 6,290 | 111 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from SFC_backprop.load_mnist import load_mnist, load_fmnist
def relu(x):
ret = np.asarray(np.maximum(np.asarray(x), 0))
return ret
def generate_input_data(num_trials, input_data='MNIST10', add_bias=False, threshold=0.5):
print('input data... |
c64541049931b06e6953a43cb642b2877238d62492abde27ddcdb894bc6ff496 | Python | 6,291 | 238 | import networkx as nx
from collections import defaultdict
import pandas as pd
import pickle
# === load protein-protein interactions === #
def load_dataset(dir_net, header = False):
with open(dir_net, mode='r') as f:
if header:
next(f)
net_nA = []
net_nB = []
for line in... |
15bfea5b659fbb79b88fb3829ee72985d6ba1fe3c317b3df955ad53b51cbc341 | Python | 6,292 | 168 | """Save / load resumable edit sessions for the CCF boundary editor.
A session captures every per-slice contour edit so the user can stop, close
the tool, and resume later. This is distinct from the final export, which
writes the modified annotation and quantification CSVs.
"""
from __future__ import annotation... |
5f801504d4d1fff7f0701559351cf34cf19f5defa7132b245073b60cae589f57 | Python | 6,295 | 238 | import networkx as nx
from collections import defaultdict
import pandas as pd
import pickle
# === load protein-protein interactions === #
def load_dataset(dir_net, header = False):
with open(dir_net, mode='r') as f:
if header:
next(f)
net_nA = []
net_nB = []
for line in... |
22708f2a56fb74eb14450df47daa0f9a967c729797ac5641201406556e887a2d | Python | 6,296 | 238 | from __future__ import absolute_import, print_function
from typing import Any, Tuple
import numpy as np
import struct
from collections import namedtuple
#int nx
#int ny
#int nz
fstr = '3i'
names = 'nx ny nz'
#int mode
fstr += 'i'
names += ' mode'
#int nxstart
#int nystart
#int nzstart
fstr += '3i'
names += ' nxstar... |
b0445358d1dd509023992dfd3f4d3a8287444ed8278f709fb2bf602ddd7718fe | Python | 6,296 | 159 | #!/usr/bin/env python
import boto3
client = boto3.client('batch')
def create_compute_environment():
resp = client.create_compute_environment(
computeEnvironmentName = 'convnet-inference',
type = 'MANAGED',
state = 'ENABLED',
computeResources ... |
dc564e128eb038ec79e87d929f0c9ef40840dcfd1dbff96deed1b18a694ad366 | Python | 6,297 | 141 | """
network.py
~~~~~~~~~~
A module to implement the stochastic gradient descent learning
algorithm for a feedforward neural network. Gradients are calculated
using backpropagation. Note that I have focused on making the code
simple, easily readable, and easily modifiable. It is not optimized,
and omits many desirab... |
5793c5f74f9e17ad0a22861ff36ccd7b333447584888087a6361bb91e4e03297 | Python | 6,298 | 184 | # gaussian_info_extractor.py
# Created by Ayesh Madushanka
# Created on: May 16, 2024
import os
import pandas as pd
class GaussianInfoExtractor:
"""
Class to Extract Qm parameters from Gaussian16 input file
Args:
current_dir_path (str): path for optimized compounds(each are inside a folder named Z... |
46849a60a7cc85189cf6b5ac62b3f135004862ce6a96540a81c95ef6fbc4dc3e | Python | 6,299 | 227 | # don't import any costly modules
import sys
import os
is_pypy = '__pypy__' in sys.builtin_module_names
def warn_distutils_present():
if 'distutils' not in sys.modules:
return
if is_pypy and sys.version_info < (3, 7):
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
... |
1ce37261298577330a4b36719b1dd932cc9324cce4a8d83fd0035ba0964a2535 | Python | 6,302 | 249 | import torch
import numpy as np
from torch import nn
import matplotlib.pyplot as plt
from tqdm import tqdm
torch.manual_seed(1)
np.random.seed(1)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Autoencoder(nn.Module):
'''
A simple symmetric autoencoder with 3 hidden layers
'''
... |
1ca2e8e98ef5925e87b5086694bfe537be350eed39b7590274a7579af00faea9 | Python | 6,303 | 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... |
bd634480e9da95a817920625e09523956ab3a23c19dbd596ba4c32ba7636fe12 | Python | 6,303 | 182 | # 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... |
7ae03d5ab1615737297d0ed868000710973ad59da09ba697da4987bd0dd40b3e | Python | 6,305 | 180 | # 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... |
2bd4e10717ab1283e6e340cab95dae1b6e227ae69c0c34167682d99959140839 | Python | 6,306 | 171 | # Node-group asset "Curve Endpoint Values" (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_... |
6d41d3640e96212c5b8de3930b6cd2de8d6fb1379deb7b493da08da54dc3c675 | Python | 6,306 | 167 | """I/O helpers for the tissue-masking tool.
Three jobs:
1. Discover ``stitched_chN/`` subfolders inside a stitching-output
directory and report their TIFF counts.
2. Group cross-channel TIFFs by their shared section identifier so a
single mask can be computed once and applied to every channel.
3. Save u... |
8b787d89662b021fb3833932ea765fc0d3f2f7c3e2420202a6d73d7429811d1c | Python | 6,306 | 176 | """
OXASL - ASL data preprocessing
Copyright (c) 2008 University of Nottingham
"""
from __future__ import print_function
import sys
import fsl.wrappers as fsl
from fsl.data.image import Image
import scipy
import numpy as np
from oxasl import Workspace, image
from oxasl.options import AslOptionParser, OptionCategor... |
3fff02c5c95e2ae7973fa524c810b6fd248298e8b7376da1fb0a82c4a9007f89 | Python | 6,307 | 174 | """VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](
https://arxiv.org/abs/1409.1556) (ICLR 2015)
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from .. import get_submodules_from... |
909d8620af65ceb9ccefb8a5025ff4258f5a13a7b794a1a32e9cf9754d75ad6d | Python | 6,307 | 167 | 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... |
fb7235988792c2812d17b5ae2c8144539aa26ff886e0e6501d5e081a812d7339 | Python | 6,308 | 174 | """VGG19 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](
https://arxiv.org/abs/1409.1556) (ICLR 2015)
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from .. import get_submodules_from... |
0b4d9907ecbc0ea2edf6125eb0cb65d2a66ce7767a42151974061a018f02c026 | Python | 6,310 | 174 | """NumPy format loader (.npy, .npz) for volume_io."""
from __future__ import annotations
import logging
from pathlib import Path
import numpy as np
_log = logging.getLogger(__name__)
from regtools.utils.io.volume_io import (
VolumeData,
_error_volume,
_FORMAT_NUMPY,
)
# Dict keys we... |
25f3e661a6b3eb73cf4c30c68cbe724959ea593574cd16fa99b2e85959f298ba | Python | 6,310 | 195 | # 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... |
1d5cafea311260f7b0f2e3a860ddcccba13153376ea5810c8eb8251e9e5e61fa | Python | 6,312 | 178 | """Each encoder should have following attributes and methods and be inherited from `_base.EncoderMixin`
Attributes:
_out_channels (list of int): specify number of channels for each encoder feature tensor
_depth (int): specify number of stages in decoder (in other words number of downsampling operations)
_... |
2dbee08ab859ad8738a0d352608e8d081da1ffc3a752b1d3bcd6f9ab69ea797e | Python | 6,312 | 195 | """Fixture runs that exercise every report state.
The report has four shapes, and three of them only appear when something is
missing or wrong - exactly the cases that rot silently if CI never builds them.
This writes throwaway output directories that make each one reachable without a
real registration:
co... |
3a8b49af239831a4d9c5d3a15597a100cd0d7aa7c61b71e05540dbf88da3fa65 | Python | 6,312 | 143 | from collections import defaultdict, deque
from pddlstream.algorithms.downward import literal_holds, get_derived_predicates, apply_action
from pddlstream.algorithms.instantiate_task import get_goal_instance
from pddlstream.algorithms.scheduling.recover_axioms import extract_axioms
class SuccessorNode(object):
de... |
770c0130658df5f3c80709b5995c4d44ec04c9514c3940b41e904e41ec1cc6aa | Python | 6,313 | 157 | # System Utils
import time
import os
import h5py
# Math and Sci Utils
import numpy as np
import scipy.signal as sig
# Grapic Utils
import matplotlib.pyplot as plt
# NI Stuff
import nidaqmx
from nidaqmx.constants import AcquisitionType, TaskMode
from nidaqmx.constants import Edge, TerminalConfiguration
from nidaqmx.... |
fdba1d05a928ae40eec0cbdcc6377c2834765dd2aae4acb7c005fbd28f8b27a5 | Python | 6,313 | 193 | #
# Configuration file for the Sphinx documentation builder.
#
# Copyright © 2020-2025 Ernst Strüngmann Institute (ESI) for Neuroscience
# in Cooperation with Max Planck Society
# Copyright © 2026 Ernst Strüngmann Institute (ESI) of the Max Planck Society
#
# SPDX-License-Identifier: BSD-3-Clause
#
# This file only con... |
865b4f49f65d83b9669c1767afabd7040e4e18c7b44e39f09db104ab6b1e83c3 | Python | 6,317 | 110 | # 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... |
51474d88a3e40f95ba4fe225e477daf2aed4dbc848710ffd137191ff6f889df5 | Python | 6,319 | 63 | """FIG_DOMINANT.py 2026-10-02. Report figure F16 (dominant inputs): (a) the largest single input neurons of the left uPNs,
(b) every population's largest input: share of the population's input against its lead over any other type, (c) the same
populations in a second fly (BANC), (d) how often the largest inputs are i... |
349d167097086b3f7c248e47a8532f82aa279ad5db1e3b5e6d08718112dcce91 | Python | 6,320 | 161 | import matplotlib.pyplot as plt
from Functions.f_AnalysisFunctions import *
from Functions.f_AnalysisStatistics import *
from Functions.f_AnalysisGraphs import *
import os
import pandas as pd
import scipy.io
import numpy as np
import scipy as sci
import matplotlib
matplotlib.use('TkAgg')
Data_dir = './..... |
f99561b66efaa1f236b73444d4603119cda1cde2da4b6610eff697cc60b2dd0e | Python | 6,320 | 149 | """Molecular dynamics recipes for universal machine-learned interatomic potentials."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ase.md.npt import NPT
from ase.units import bar, fs
from quacc import Remove, job
from quacc.recipes.mlip._base import pick_calculator
from quacc.runners.as... |
18fb49610300395cfd36b64ab61003353c9f22c9a861f6e71974299881025121 | Python | 6,321 | 189 | import torch
import lightning.pytorch as pl
from datamodule import SeqDataModule
from test_predict import save_predict
from trainer import LitModel, TrainingConfig
from utils import set_global_seed, parameter_count
from lightning.pytorch.callbacks import ModelCheckpoint
from pathlib import Path
cell_types = ['He... |
2d8e7a83048d4050fd24250ce3cb4cd4f3fbbd197bafdfbcc9091069b9054540 | Python | 6,322 | 193 | # 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... |
c22dc1bfe3e84c1f3065f076a720838beb3576542eb0d9ec9d3efe36c1380ee4 | Python | 6,322 | 175 | """Two clicks become a midline, for atlases nothing can fit.
A custom template has no shipped plane and often no second hemisphere for the symmetry
objective to score, so ``fit_plane``'s accept gate cannot even be evaluated. There the
user is the ground truth.
These cover the geometry and the state machine, del... |
8aaf2ce87a2072bb8fede17008b422fea623810f3d7307fc7fc447be1fb1714d | Python | 6,323 | 142 | #!/usr/bin/env python
"""
toposampling - Topology-assisted sampling and analysis of activity data
Copyright (C) 2020 Blue Brain Project / EPFL & University of Aberdeen
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as
published by the Fr... |
3c22f48a61261123eb2a55fd7505b6c4671c8fda4209b7fceda4fd826cf58b85 | Python | 6,325 | 213 | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import os
import random
import shutil
import torch
import torch.distributed as dist
import torch.autogra... |
f5c20f95994119169cb38b803494f51535c46a994574b65423f69bcd866656a2 | Python | 6,325 | 219 | ##################################################################################################
# Prepare the spikes30, signal30 and signal100 datasets, divided by train, test and validation files
##################################################################################################
#load the packages
... |
ee02909ad09c64ff82cb84763663f966616cd128c622c8c35058b545568296c9 | Python | 6,327 | 170 | """Pure-math tests for regtools.ccf_boundary_editor.alignment.
No Qt needed - the helper functions are framework-free.
"""
import numpy as np
import pytest
def _identity_params():
return {
"transpose": False,
"flip_h": False,
"flip_v": False,
"scale": 1.0,
... |
0904af6e56420b8916d46e173b7572572a378a42ee5341eca80ad86bec82f1a0 | Python | 6,328 | 211 | #!/usr/bin/env python3
"""
m6a_semi_supervised_cnn_predict.py
Author: Anupama Jha <anupamaj@uw.edu>
This script runs the m6A model to
generate predictions and find score
threshold corresponding 95% precision
for the downstream fibertools pipeline.
"""
import torch
import argparse
import numpy as np
import configparser
... |
c71e4343fecf35d6e2701c8c151f7546c0d465f7f86c96978897191f313d85db | Python | 6,330 | 171 | import pytest
import torch
from elasticai.creator.nn.integer.quant_utils.calculate_quant_params import (
calculate_asymmetric_quant_params,
calculate_symmetric_quant_params,
)
@pytest.fixture
def eps():
return torch.tensor(torch.finfo(torch.float32).eps)
@pytest.fixture
def asymmetric_signed_setup(eps)... |
c33ebbbcb8abaf6137f6274b82d67a13aa81601b914d0d2c0d2b9e02d0b8965f | Python | 6,331 | 213 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
f6cd2eeb7f7b3e5593de2db6c767af7b8c4b2da57447296a045810dc759175e6 | Python | 6,331 | 211 | #!/usr/bin/env python3
"""
m6a_semi_supervised_cnn_predict.py
Author: Anupama Jha <anupamaj@uw.edu>
This script runs the m6A model to
generate predictions and find score
threshold corresponding 95% precision
for the downstream fibertools pipeline.
"""
import torch
import argparse
import numpy as np
import configparser
... |
1bf06ffbf3e8dcadc6215735d6d42d8700d901b5af25697515d299e418ab4500 | Python | 6,332 | 156 | """Read-only compare window for the CCF Boundary Editor.
A standalone :class:`QMainWindow` that mirrors the editor's current
slice with the **pristine** annotation - the unedited atlas labels -
so the user can drag the window to a second monitor and keep the
original reference visible while editing in the main wi... |
209c3321adc6e27ea98834bd74e8520155281e60f8b02242bc61c7d59e05ff4a | Python | 6,332 | 191 | from __future__ import annotations
# built-in
from collections import Counter
from contextlib import suppress
from typing import Sequence, TypeVar
# app
from ..libraries import prototype
from ..utils import find_ngrams
libraries = prototype.clone()
libraries.optimize()
T = TypeVar('T')
class Base:
def __init_... |
8619d8ab910ff373d03f388b2fa7b54dace3b81d9f3b899b4e5296000fb28253 | Python | 6,332 | 176 | #
# 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,... |
3f7d703a3c014571399a2a138c2ee35884cd9a8447753d56f1c18165e61fb711 | Python | 6,333 | 119 | import numpy as np
from control_tools.execution import ArmTrajectory
from plan_tools.common import Control, parse_fluents, get_liquid_quat, COLLISION_BUFFER, \
get_pr2_safety_limits, get_weights_resolutions
from plan_tools.samplers.generators import set_gripper_position, Context
from plan_tools.samplers.grasp impo... |
7b7b1ec7c61f5696deda401ae0f7ee164f047343d7bc34e2d7535e3b2b27ecf7 | Python | 6,334 | 173 | import numpy as np
import torch
from utils.gcn_utils import preprocess_features
from sklearn.model_selection import StratifiedKFold
from node import get_node_feature
import csv
import os
import argparse
from networkx.convert_matrix import from_numpy_matrix
import networkx as nx
from torch_geometric.utils import remove_... |
2229947b33d6a92875340ad40dd30c9de465acd3893a5a570f972418876670dc | Python | 6,335 | 174 | import os, sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import zscore, mode
import torch
from torch import nn
from rastermap import Rastermap , utils
from rl_zoo3.utils import ALGOS
from stable_baselines3.common.preprocessing import preprocess_obs
from stable_baselines3.common.env_util impor... |
517ae4c90c4bc8b3987a7fdfb8f372b9b76d629e71fcd1ad7884615bfe09062b | Python | 6,335 | 150 | import os
import re
from copy import copy
from typing import Dict, Tuple, Union
import numpy as np
import pandas as pd
from sklearn import model_selection
from torcheeg.datasets.module.base_dataset import BaseDataset
class KFoldCrossSubject:
r'''
A tool class for k-fold cross-validations, to divide the train... |
71f974360698108cac386098b40dd9391b8e0ec767e12b1dbb59041b78acec5f | Python | 6,338 | 211 | #!/usr/bin/env python3
"""
m6a_semi_supervised_cnn_predict_ont.py
Author: Anupama Jha <anupamaj@uw.edu>
This script runs the m6A model to
generate predictions and find score
threshold corresponding 95% precision
for the downstream fibertools pipeline.
"""
import torch
import argparse
import numpy as np
import configpar... |
2cf7e2c7b5c19a56cfd94df032a9ada93d38d31291c60e2dda558fc233ab98bd | Python | 6,339 | 82 | """BANC.py 2026-09-30. The second fly: BANC v888 (Bates, Phelps, Kim, Yang et al.; Harvard Dataverse doi:10.7910/DVN/7WTH1N,
CC BY 4.0; files and sha256 in 02-DATA/banc/SHA256SUMS.txt). Builds the antennal-lobe cut-out of BANC with the same
rule as AL_SUBNET does for FlyWire (receptor, projection and local neurons of... |
55028539c35d82b45e974c39db58bf74ebe0bdc6fe7ed838cfb940365fcff4f5 | Python | 6,341 | 140 | import os
import scanpy as sc
import anndata
import pandas as pd
import numpy as np
import time
import tracemalloc
import cell2location
import scvi
from cell2location.utils.filtering import filter_genes
from cell2location.models import RegressionModel
def run_cell2location(st_counts_path, sc_counts_path, sc_labels_... |
4bb55f45a76e171577a050f3c5bbcca84817398d0f52a57b2973802da4abae3a | Python | 6,342 | 182 | # 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... |
995bd9e4f10bd1d317668a3c2ebf96549ab54ce7d3dd242d827fbd5dcfde53af | Python | 6,342 | 129 | from copy import deepcopy
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from constants import RESULTS_DIR, N_ITEMS
from src.inference.preprocess import load_and_normalize_image
from src.inference.utils import assign_score
RESULTS_DIR = os.path.join(RESULTS_DIR, 'scans-2018-116x150-a... |
f1435bf17ab844d733a4a7eb20e34e1b23ce7ae369c8fd423b4448032c1cb7b5 | Python | 6,343 | 104 | """DELETION_SOURCE.py 2026-09-30. Pre-registration: 04-NOTES/PREREG-2026-09-30l-DELETION-SOURCE.md
Which part of Santos's deletion (excitatory LN->PN and PN->PN synapses) removes the olfactory runaway? Antennal-lobe cut-out
of Shiu et al.'s v783 file, published signs, four deletion sets; 50 glomeruli + Seki et al. real... |
2c32448af68d96caf84b180d97324d3080cb7031a66a0e1c9fe6a1a22c1f335e | Python | 6,345 | 171 | # from options.opt import opt
import pdb
import torch
import random
import anndata
import numpy as np
import scanpy as sc
import pandas as pd
from scipy import sparse
import torch.utils.data as data
class customDataloader(data.Dataset):
def __init__(self, opt):
self.opt = opt
train = sc.read(self.o... |
24a1f9fe6504112df3f0ca11b676735a120b907a3f6a97fdbb5c876f9c10fdad | Python | 6,347 | 199 | import pytest
import numpy as np
from scipy.sparse.linalg import LinearOperator, aslinearoperator
from sella.eigensolvers import exact, rayleigh_ritz
from sella.linalg import NumericalHessian
from test_utils import poly_factory, get_matrix
@pytest.mark.parametrize("dim,order,eta,threepoint",
... |
2c3c11e424e78cdbbab7fc032fc89953be3c3cb1278ea151a98289a070978fa3 | Python | 6,347 | 130 | """l1_lif —— Banana Quest 的 postsynaptic L1 归一化 LIF,移植为 flybench 模型接口。
与 game/src/sim-core.js 的等价关系(逐条声明,详见
game/docs/flybench-report.md §等价性声明):
完全一致:
* 权重拓扑:同一批 FlyWire Codex connections(snedea/flybrain 再分发);
* 递质符号规则:与 snedea/flybrain 打包一致的 NT_SIGN
{ACH:+1, GLUT:+1, DA:+1, OA:+1, SER:+1, GABA:−1; 无 histami... |
59f416bc268f27dfb0c86e48d50a6748db37fcd3d71c09a06fce4c9e937ab340 | Python | 6,350 | 181 | """
Secondary script to calculate correlation of short/long pathways in the SC and FC
Akin to paper:
1. Kulik SD, Nauta IM, Tewarie P, et al.
Structure-function coupling as a correlate and potential biomarker of cognitive impairment in multiple sclerosis.
Netw Neurosci. 2022;6(2):339-356. doi:10.1162/netn_a_00226
"... |
11c4e7e09740cadc0789385c72290876698d0466bd6ac5d211fd67a0e8cab0f8 | Python | 6,351 | 153 | import os
import warnings
from pandas import concat, DataFrame
import numpy as np
from nilearn import image
from itertools import combinations
from nilearn.maskers import NiftiMasker
from scipy.stats import spearmanr
from pyrelimri.tetrachoric_correlation import tetrachoric_corr as tet_corr
def image_similarity(imgfi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.