sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4ed85a715fcc8bdfa73496270addbf2705d6eb97a03906661b71bbc0f87e21bd
Python
16,303
379
import pandas as pd import numpy as np import os, torch, pickle from tqdm.auto import tqdm from torch.utils.data import DataLoader from sklearn.decomposition import PCA from sklearn.random_projection import SparseRandomProjection from .feature_extraction import prep_model_for_extraction from .feature_extraction impo...
61dc49e885da3603bb94e594847caf9896904847cf60b34b3b19dd71d2a03a51
Python
16,314
381
from __future__ import absolute_import, division, print_function, unicode_literals import argparse import logging import os import sys import glob import re import tensorflow as tf tf.keras.backend.clear_session() from callbacks import CallBacks from model_factory import GetModel from preprocess import Preprocess, for...
c27487a743655471d0226a4186b5a4caf6b3d2aa6f9c22c21900858d0090ecdd
Python
16,324
527
"""Partial autoinformation module for segmented data. Code from https://github.com/Frederic-vW/AIF-PAIF F. von Wegner, Partial Autoinformation to Characterize Symbolic Sequences Front Physiol (2018) https://doi.org/10.3389/fphys.2018.01382 """ from __future__ import annotations # c.f. PEP 563, PEP 649 import itertoo...
d8d1f7139ee1cd1867d0157d6e8501be03ecc654ea2c9788d04a5842836f1a2d
Python
16,326
564
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. """ .. testsetup:: from packaging.version import parse, Version """ import collections import itertools import re from typing import A...
e4e52928f24b66fffd33f9a063973a6b21b9d480d43413d173a7db2e38566d94
Python
16,334
422
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu. """ import matplotlib.pyplot as plt from matplotlib import patches import os import numpy as np from fig_utils import * def panel_neuron_pos(fig, grid1, il, yratio, xpos0, ypos0, isort, brain_img): xpos, ypos =...
ec111b3a113e9773ec4a3a519ebb23823fa7fcda9c7150afaa2560dcb2413761
Python
16,336
472
# 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...
4fd35f1e93a95f4ead04615047ac807646bfbb57e720c38d3251c4a9b8f9577e
Python
16,340
352
#!/usr/bin/env python # coding: utf-8 import dgl import torch from torch import nn, optim import numpy as np from ..model.scHetG import scHetG from ..model.MLP_model import MLP_model from ..data.data_utils import make_graph, mnn_edges_svd, knn_edges, precluster, precluster_negative_paris,mnn_edges_pca from ..t...
9764b3c82ad4c038cc6eb4ae54e444fa42f5d8bda3e8a8ab7c658e05519ed941
Python
16,343
440
""" Script for PSD segmentation Input: - Pickle files with MbGraphMCF for post- and pre-synaptic membranes - Membranes segmentation files - xml file with mb_slice definitions Output: - Cloud files - Segmentations """ __author__ = 'Antonio Martinez-Sanchez' ########...
9c2f82c5ed2129bdc19f8c26f58c52ec9c675fc31287582ef3dedcdf26d27638
Python
16,347
433
## # \file rsfmri_estimate_motion.py # \brief Estimate motion in resting-state fMRI volumes # # \author Michael Ebner (michael.ebner@kcl.ac.uk) # \date July 2019 # import os import numpy as np import pysitk.python_helper as ph import pysitk.simple_itk_helper as sitkh import niftymic.base.stack as st i...
a832c6194e340fb6c888c26c29d169b43466f550387d485e3241f4f1a2fa7c44
Python
16,353
414
# Copyright (c) MONAI Consortium # 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 to in writing, so...
57d2b69edbeb1d012e5278f30541dd3d261bfa41532210ec7b36132f802510cf
Python
16,357
290
# 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...
f02c64072b46a08d4668ccf2cf0b2d75d605381a5700e7a88c638234724c8d97
Python
16,367
456
#!/usr/bin/env python # -*- coding: utf-8 -*- import scipy.signal as ss import pickle as pickle from hybridLFPy import CachedNetwork, helpers import analysis_params from cellsim16popsParams_modified_spontan import multicompartment_params from plot_methods import (getMeanInpCurrents, getMeanVoltages, plot_population, ...
3acd6ebde4890624d760c0f0f0fc7448dc42297d3284e006645b1706949c3c21
Python
16,368
423
# lightning related imports from collections import defaultdict from copy import deepcopy, copy import torch, sys import pytorch_lightning as pl import torchmetrics # from pytorch_lightning.metrics.functional import accuracy from wsilearn.utils.cool_utils import is_dict, is_string, is_iterable, is_list from wsilearn....
b04fb6ac6435f8b61aceae4416b41f365447bf60ff1b300d24d4e80edef7d875
Python
16,369
380
import sys import os import multiprocessing as mp import numpy as np import pandas as pd from Bio import motifs, SeqIO, Seq from scipy.stats import ttest_1samp, wilcoxon def load_motifs(motif_dir, pseudocounts=0.05, key='full'): ''' read in motifs; motifs have to be in jaspar format as below: ...
9df59cfe1bb63ff04dd08414415612b50a90441c4035ad40cb926a4e25c4e6d0
Python
16,376
406
import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch import autograd import time as t import matplotlib.pyplot as plt import sys plt.switch_backend('agg') sys.path.append('/home/jmwang/WorkSpace/GENiPPI/gPPMol/models_3d') import os from itertools import chain fro...
bc099b0f2d64fb12f0ef779547566dada50140ad232e53cd3be033585a4c16d8
Python
16,376
491
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 4 12:38:46 2024 @author: felipe 'DMD simplified' """ import numpy as np from pydmd import DMD, BOPDMD from pydmd.preprocessing import hankel_preprocessing import sys import os sys.path.append(os.path.abspath('../')) import analysis.control as ctr...
c0999d24115e853b817ce9112fa326076ec4e1411c099adcbf8e6959ccb2bbc0
Python
16,388
467
"""Tests for regtools.utils.io.points_io.""" import numpy as np import pandas as pd import pytest class TestLoadPoints: def test_legacy_txt(self, tmp_path): from regtools.utils.io.points_io import load_points p = tmp_path / "pts.txt" p.write_text("index\n3\n10 200 300\n11 201...
3b65e552f1bcca1e922bb285fa1b04c7be75f9dfab6b110b707a407f0ba87c77
Python
16,390
457
import site from typing import Callable, List, Dict, Optional, Literal, Tuple import torch from torch import nn from hotpp.layer.radial import ChebyshevPoly from .base import AtomicModule from ..layer import EmbeddingLayer, RadialLayer, ReadoutLayer from ..layer.utils import ElementLinear from ..layer.equivalent impor...
ea60417ccf7be613248db2bb376f6cb03826a4d53ece8ca9811d35e333525835
Python
16,392
565
# 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...
3e310b30bc4a1bf8aedc75a328039d2a1b8dac77d68297531764389ce6ec65e3
Python
16,397
408
import email.feedparser import email.header import email.message import email.parser import email.policy import sys import typing from typing import Dict, List, Optional, Tuple, Union, cast if sys.version_info >= (3, 8): # pragma: no cover from typing import TypedDict else: # pragma: no cover if typing.TYPE_...
235880f4abd219242c8b3d4e96e28f76f4b79c9beea3ba28503537a1a4c92f70
Python
16,399
461
""" This script contains supplementary functions for dFIC project data analysis, written by J.Stasinski unless stated otherwise. documented with help if Chat GPT 3.5 """ import numpy as np import scipy.io as sio import scipy.signal as sig import csv from scipy.stats import ks_2samp, ks_1samp from scipy.stats import sk...
424aa230df337dd85540a7324e5c9356e2a9bcb03e095829c8628d107e77b29f
Python
16,399
352
import matplotlib.pyplot as plt import matplotlib.pylab as pl from Functions.f_SignalProcFuncLibs import * from Functions.f_ECGAnalysis import * import matplotlib.colors as colors import numpy as np def PlotBandEvolutionAllPaths(m_Data, m_DataStd, s_windStep, v_FreqBands_Names, v_FreqBands, v_ChanNames, ...
8a49542ec53c28a31a552378f30ff13e05479730653f4772df721aa5fca49b83
Python
16,399
459
import copy import sys import numpy as num # from wx import AboutDialogInfo # from version import DEBUG, __version__ DEBUG = False __version__ = '0' # KB 20190424: long is int in python 3 if sys.version_info >= (3,): long = int class ShapeParams: def __init__(self,major=0,minor=0,area=0,ecc=0): sel...
9683a77b2f59e77d81bf6942ad9a4ba24591d2f60c66b5c3a2d56cefa74b6391
Python
16,401
463
"""Utility functions to expand configuration directives or special values (such glob patterns). We can split the process of interpreting configuration files into 2 steps: 1. The parsing the file contents from strings to value objects that can be understand by Python (for example a string with a comma separated ...
3124281777431cda64bcf99aa173fdff314e20b18f0a604740c49012a42763a3
Python
16,416
395
# -*- coding: utf-8 -*- # Este archivo se encarga de analizar los resultados obtenidos por cnn2_load_and_test.py from math import e from re import T from unittest import result import pandas as pd from scipy.stats import spearmanr, ttest_ind import matplotlib.pyplot as plt import sys import os import numpy as np solo...
6c062bb7bc7f547e2da0da48d3ae8b4316c7a581a9635331c6664086ca6996fc
Python
16,416
439
# SPDX-FileCopyrightText: 2015 Eric Larson # # SPDX-License-Identifier: Apache-2.0 """ The httplib2 algorithms ported for use with requests. """ import logging import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import...
efc7b78adf8c254a43ec3bc73dd80950af731338e33c9810f981d2f07bba646b
Python
16,422
528
# 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...
becbf23df3e6f758388543bac0940965dee38f8b08bf18f11571a42441b18f9f
Python
16,426
413
from . import _c_louvain from .VertexPartition import LinearResolutionParameterVertexPartition from collections import namedtuple from math import log, sqrt import sys # Check if working with Python 3 PY3 = (sys.version > '3') class Optimiser(object): """ Class for doing community detection using the Louvain algori...
cf8145653d8d486b81c3e777b18265dacce08e4d20c2d3ff8c20d6436eec2e27
Python
16,427
397
# -*- coding: utf-8 -*- """ Created on Mon Jun 15 11:28:26 2020 @author: David Quiroga """ #################### Load libraries and set directories ####################### from random import shuffle from psychopy import prefs prefs.hardware['audioLib'] = ['PTB'] #prefs.hardware['audioLib'] = ['pyo'] from psychopy impor...
758e938ff2598fed59e65607315337a93a98910d8c94039de67b2f2bcc143246
Python
16,429
372
"""CCF-to-brain alignment behaviours for the viewer, packaged as a mixin so the alignment surface (param changes, drag-align, lock, corner markers) lives in its own file instead of the 4000-line viewer.py. The mixin assumes the consuming class declares these instance attributes in its ``__init__`` BEFORE any mix...
9f550b690fd7d72a2a8fccafd1ec58e6bee340a2134578c11ad96fb0f5c1711c
Python
16,431
669
from __future__ import annotations """Fast image-shape preflight and 2D binary storage canonicalization.""" from dataclasses import dataclass from pathlib import Path from typing import Iterable import numpy as np import tifffile from PIL import Image PREFLIGHT_VERSION = "MG_2D3D_PREFLIGHT_V1" @dataclass(frozen=T...
769d8f636d1099290b5a81a78cc2cf14c022390152ed0f45247932b9ef3b42bb
Python
16,439
330
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 21 12:34:05 2023 @author: daltonm """ # import toolboxes import numpy as np import re import pynwb from pynwb import NWBHDF5IO, TimeSeries from pynwb.epoch import TimeIntervals import glob import datetime import pytz import matplotlib.pyplot as plt...
dfd0c6818c484407548fd5e78933f2a1c759168fe2752c71e7c7d35cf2a91c31
Python
16,439
368
import torch import torch.nn.functional as F from prettytable import PrettyTable import numpy as np import random from sklearn import metrics import wandb from tqdm import tqdm from utils import * import os def normalized_laplacian(A): """ Input A: np.ndarray :return: np.ndarray D^-1/2 * ( D - A ) * D^-1...
e75831333b755a46232bfe979fde2e4a48c5723604818da40221256b95431cb3
Python
16,439
451
# 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...
9642bd4b1af57f8ef0daf26fa8c32192cca2f59dd1048c60ef232913392930be
Python
16,441
401
r"""Test Ketcher KET (JSON) format using the OpenBabel Python bindings. Mirrors the structure of testcdjsonformat.py. Covers: - reading a single-molecule KET file - reading multi-molecule KET files - reading a reaction KET (arrow + plus -> OBReaction) - writing valid JSON output - minified -xm output option - SMILES <...
1ab876e2ac2ff398630ee0d467d2cb80279a2ccdc027461b6fc76b1ad457073a
Python
16,445
357
import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import warnings warnings.simplefilter("ignore") import time import tqdm import util import pprint import random import torch import scipy.stats import numpy as np import pandas as pd from datetime import datetime from torc...
4bb6995cbb62932ce779edefc998deb7d69e822ce7f7c9bcb78a00234133efe6
Python
16,448
439
import numpy as np import torch from torch.nn import init from torch_geometric.nn import MessagePassing from torch_geometric.utils import degree import torch.nn.functional as F from torch_geometric.nn.inits import uniform from torch_geometric.nn import global_mean_pool, global_add_pool #import dgl ### GIN convolution ...
6b942d5f63965bf46a2c229172a981b708758a37b21a0ac961ce41489f88c9f2
Python
16,448
331
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 21 12:34:05 2023 @author: daltonm """ # import toolboxes import numpy as np import re import pynwb from pynwb import NWBHDF5IO, TimeSeries from pynwb.epoch import TimeIntervals import glob import datetime import pytz import matplotlib.pyplot as plt...
b91501db1631ce5061533a25098b57d8fd31e464b5ffdae40671a3948891bc90
Python
16,465
515
import os os.environ["OMP_NUM_THREADS"] = "4" # export OMP_NUM_THREADS=1 os.environ["OPENBLAS_NUM_THREADS"] = "4" # export OPENBLAS_NUM_THREADS=1 os.environ["MKL_NUM_THREADS"] = "4" # export MKL_NUM_THREADS=1 os.environ["VECLIB_MAXIMUM_THREADS"] = "4" # export VECLIB_MAXIMUM_THREADS=1 os.environ["NUMEXPR_NUM_THREA...
d366dfbb2716ca815661d314ca38d994d2301d534e87cf8be8db52e881ad45b9
Python
16,465
367
""" Pre-processing for mb_graph_batch.py of un-oriented and oriented membranes from TomoSegMemTV output Input: - STAR file with 3 columns: + _rlnMicrographName: tomogram original + _rlnImageName: TomoSegMemTV density map output + _psSegLabel: (optional) label f...
b0ca9a7c6a923746ba06d36008ea9166ad8350462f1e5206b048a1d48807049f
Python
16,468
479
import torch import numpy as np import torch.nn.functional as F from PIL import Image # Global Flags PIXELS_PER_METER = 5 class Renderer(): def __init__(self, map_offset, map_dims, data_generation=True): self.args = {'device': 'cuda'} if data_generation: self.PIXELS_AHEAD_VEHICLE =...
b2cc59330f34c53a68a6eba2f743fa82fd79dd9944d56cbb13801e28950306ce
Python
16,469
378
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'dgn_preprocz_ctrl.ui' ## ## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #...
14204181cabe05db2d735284e69ebf5531b28e41170c59dc28c24933ddce5243
Python
16,470
318
""" 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 """ import pandas as pd import numpy as np from pathlib im...
23e95a83a5e1cc78505e4cbf18c6c58448397b70075009662c122c64f45c75ad
Python
16,470
507
from rdkit.Chem.rdmolfiles import MolToPDBBlock, MolToPDBFile import rdkit.Chem from rdkit import Geometry from collections import defaultdict import copy import numpy as np import pandas as pd import torch from utils.affine import T from scipy.spatial.transform import Rotation as R from Bio.PDB import PDBIO, MMCIFIO, ...
857c17c4383c41d4ad2a0d69da0f8f8af70ee5450654c94c66fc1e36dc920ad0
Python
16,473
426
# # 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,...
378c83c9e013c3ff1e753aae320e3ff6cc05beba5ca71a5331e0a3dac4996b81
Python
16,474
302
""" OPTIC_LOBE_TISSUE.py written 2026-09-22. "Is the choir the cell or the tissue?" Pre-registration: 04-NOTES/PREREG-2026-09-22d-OPTIC-LOBE-TISSUE.md (written before this ran). ERROR_OR_STRUCTURE.py arm N cleared classifier tissue-context only in the hemibrain, which has no lamina. This redoes it in FlyWire, wher...
fa2555733c13a270fa22632ca922389016b383db7eb8ac6acb10f0163f80d9c1
Python
16,475
374
""" Generates a ListTomoParticle object from a input STAR file (translocon project version) Input: - STAR file for pairing STAR files with particles and particles shapes Output: - A ListTomoPaticles pickled object for every STAR file row """ ################# Package import import os import vtk impor...
2327719df6ab3729cb4ab450a7d1ce059da4919f0c1bf76dd70a8b296f10a436
Python
16,476
529
#!/usr/bin/env python3 # -*- coding: utf-8 -*- try: import analysis.Wavelets as Wavelets except ModuleNotFoundError: import KuramotoNetworksPackage.analysis.Wavelets as Wavelets import numpy as np import numpy.linalg as linalg import scipy.signal as signal import scipy.ndimage as ndimage def effectiveFrequen...
352574c97a014bffa92b0d6254192874a34508743c86ce6bb25110730451bb77
Python
16,493
520
import sys import os import time import numpy as np import numpy.ma as ma from scipy.fftpack import rfft, irfft, rfftfreq from scipy.signal import hilbert from scipy.stats import zscore from scipy.io import loadmat, savemat import matplotlib.pyplot as plt try: import pyfftw pyfftw.interfaces.cache.enable() e...
7435de98962717b6202f65278788c8ee81331225bd5177b9d754a50992831208
Python
16,500
379
# MEGIT zoomview preprocess GUI import os import cv2 as cv from ..data import get_frm, brt_con, draw_text from PySide6 import QtCore, QtGui, QtWidgets from .dgn_preprocz_ctrl import Ui_ControlViewer from .dgn_preproc_frmv import Ui_FrameViewer from .dgn_preproc_load import Ui_MainLoader # Global definitio...
4b917c18847ef246b8dce5fa48bd0108eedd127d97dff0d643077cc0344f64ac
Python
16,504
407
import logging, time, yaml, os, shutil import numpy as np import torch from torch import nn import pytorch_lightning as pl from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateMonitor import torch.nn.functional as F from torch.optim.swa_utils import AveragedModel from ase.data import atomic_numbers from...
dce998677b42a113c63ab10b4a04161bed3733e6d01dadbe54203747f9c901a5
Python
16,504
505
""" The main purpose of this module is to expose LinkCollector.collect_sources(). """ import collections import email.message import functools import itertools import json import logging import os import urllib.parse import urllib.request from html.parser import HTMLParser from optparse import Values from typing impor...
5fd32655f332c13b598f39b5bd8afe473737fad0283f71aaa0f8b6044e05e3e6
Python
16,517
498
from typing import Callable, Dict, Optional, Sequence, Union import schnetpack as spk import schnetpack.nn as snn import torch import torch.nn as nn import torch.nn.functional as F from schnetpack import properties import spainn from spainn.properties import SPAINN __all__ = ["Atomwise", "Nacs", "Forces", "Dipoles",...
582024ec0f948c5bb637700cfa6aee67ffe5707aeb390982430a0ed852d53d3a
Python
16,529
336
def update_param(name, param): if name in ('alpha', 'lambda'): param['ptype'] = 'numeric, [numeric]' param['dtype'] = 'Union[float, List[float]]' return param return None # param untouched def class_extensions(): def get_regression_influence_diagnostics(self, predictor_size=None):...
5d5b6e1628ba73805f70bc6faea3f97de09ea31974ea6fb6ff7cdfe2ed726674
Python
16,533
333
""" Script to run pan-cancer/cross-cancer classification experiments (i.e. train on one gene across all but one cancer types, test on another gene in another cancer type). """ import sys import argparse import itertools as it from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm import...
f8738a9dc2a0814067eb5159ac92df6fb7bcc09c327c7abde486265e89560f11
Python
16,533
443
"""Functions to transform the input data and the estimates.""" import multiprocessing as mp from typing import Callable import numpy as np import xarray as xr from numpy.random import RandomState from pandas import MultiIndex def _check_sf_consistency(epoch_data, estimates): if epoch_data.sfreq != estimates.sfr...
2cafe5ff982716fe83d3662dc89441a79904dd25a61d5102ec26c129edad8e4f
Python
16,537
406
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" import os import importlib.util import sys import glob from ..core import Command from ..errors import DistutilsOptionError, DistutilsFileError from ..util import convert_path from distutils._log import log class build_py(Command): d...
9f7ffa12dcfa5766cc74609ac9ead20cb5a8c4d1bda7e4de2dbdbc2959389a16
Python
16,539
480
"""Classes for AGFusion database objects """ import logging import sqlite3 import sys from os.path import abspath, exists, join from agfusion import utils logger = logging.getLogger("AGFusion") try: import mysql.connector except ImportError: logger.debug("Could not import mysql.connector.") class AGFusion...
57bfe16667d2dc8d92ac9d98a73843dca303facbe64d63056c088b4a9df25c44
Python
16,547
540
""" goodness_of_fit: Function set for goodness of fit measure between two signals. ================================================ Documentation is available in the docstrings Contents -------- goodness_of_fit require numpy. The package provides the following measure : - Mean Error : m...
231025f5be41ece88995dec3222bca375ee7df4bef30b38551e77c47a7777407
Python
16,549
415
import pandas as pd import numpy as np import os import sys import warnings warnings.filterwarnings("ignore") # os.environ['PATH'] = '/gxr/jixian/anaconda3/envs/refine/bin:/rhome/jixian.zhang/.local/UCSF-Chimera64-1.16/bin:/rhome/jixian.zhang/.local/bin:/gxr/jixian/anaconda3/bin:/gxr/jixian/anaconda3/condabin:/gxr/jixi...
0b47933ca566ffb1b4d58712ffa358cda415fe0f84150d5ff367fb6d7b6db31b
Python
16,554
420
from functools import reduce try: import binutil # required to import from dreamcoder modules except ModuleNotFoundError: import bin.binutil # alt import if called as module from bin.rational import RandomParameterization from dreamcoder.domains.arithmetic.arithmeticPrimitives import ( f0, f1, fpi, real...
7274afb19e316e993826526208aefc6cd168e929c774e20a135ec8ae61996ae4
Python
16,555
315
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 21 09:30:55 2022 This script create the figure 5. It first loads subjects results (with fitted priors and reports), the weights of generative priors in T1 (on all trials) and the weights of fitted priors and of explicited priors in T2 on trials af...
63fb7f7203fe762712e05cba641651b1afe7accd2edbb1727cefff07b334a128
Python
16,559
464
"""setuptools.command.bdist_egg Build .egg distributions""" from distutils.dir_util import remove_tree, mkpath from distutils import log from types import CodeType import sys import os import re import textwrap import marshal from setuptools.extension import Library from setuptools import Command from .._path import...
b2a7d2a7797e9dffeecc2339d576c94a1420f590b2584bfa101acac86147e81e
Python
16,562
356
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 9 07:09:45 2022 @author: heavens """ from faulthandler import dump_traceback_later import os import sys import toml import random import argparse import itertools from typing import List from xron.utils.seq_op import Methylation_DP_Aligner from xro...
60562a413742fcf78148c9a535376bef019f199941dcf2f3be3d27653e14c82d
Python
16,566
396
""" Multiclass test for unsupervised and deterministic classification of membrane-bound particles Input: - The STAR file with the particles to classify - Classification parameters Output: - A set of STAR files with the new classes - 2D rotational averaged around membrane normal e...
98cc0fe1689a10c75a517dc0501c121520603ff0a2be870b56f8ebfd63790b1b
Python
16,570
453
import re import anndata import fsspec import h5py import numpy as np import pandas as pd from cirrocumulus.ot.population import Population from cirrocumulus.ot.util import chain_transport_maps, find_path, unique_timepoint from cirrocumulus.util import get_scheme class TransportMapModel: def __init__(self, tmap...
bb48bea0d4f50cc5a560b8b6516c24ff2572e8d0d1aae4cb1906431b5abd3b02
Python
16,572
260
import os import argparse import numpy as np import pickle import rtPupil_config from EventCollector import EventCollector from EventCollector import get_data, find_string_time, pull_pupil_sample, plot_mean_timecourses from StimulusDecider import StimulusDecider def main(subject_list, plot_timecourses, baseline_du...
12627c09adca8e7f9ca4b629ef604218e3d26416aadbe32c5487f6c5bb46a249
Python
16,577
488
""" Accuracy metrics for comparing detected cell centroids against ground truth. Provides functions to compute precision, recall, F1 score, and visualize match quality between two sets of 2D or 3D point coordinates using distance-threshold matching with the Hungarian algorithm. Typical usage ------------- >>...
79d252a802879db54b3332059301ba7b59049299ed5c646903acdb7e48891954
Python
16,586
423
import logging, re # from logging import info import functools from copy import deepcopy import torch import torch.nn as nn import torch.nn.functional as F import torchvision from torch.nn.modules.padding import ReflectionPad2d, ZeroPad2d from torch.optim.lr_scheduler import ReduceLROnPlateau, CyclicLR from wsilearn...
64954d27142d7f0de42d9e30c52fe6a2ad6e6c52fa733aed47d713b15821d5b9
Python
16,589
513
"""Module contains the different types of data formats. The main class is Data, all the other classes should depend on it. The other classes are given only as convenience, but they should not overwride Data.__call__, which needs to be very general. """ from collections import OrderedDict from collections.abc import It...
e6e5c227a9bbc7bae3bc741de2b43d6dcd6f7ca947468b77687bd51eaa2670e5
Python
16,589
474
# -*- coding: utf-8 -*- # # Test connectivity measures # # 3rd party imports import pytest import itertools import numpy as np import matplotlib.pyplot as ppl # Local imports import syncopy as spy from syncopy import synthdata import syncopy.tests.helpers as helpers from syncopy.shared.errors import SPYValueError, SP...
7bb0778352713bee8fd2407e5d13b1e961984eb484966c1a8a63732ead89bce4
Python
16,591
268
import os from warnings import warn import math import numpy as np from matplotlib import pyplot as plt import pandas as pd from io_functions import read_dictionary, read_pandas from postprocess_functions import visualise_tornado_sa, visualise_scatter_sa, visualise_heatmap_sa from path_config import get_path_mapping ...
45a9416f6ad14475ecdb518e26570fb0dc145740909c5e61e55b36abbf7df7a0
Python
16,599
402
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from scipy.sparse import load_npz import os import json from torch_geometric.nn import SGConv, GCNConv, global_mean_pool, Sequential, graclus, max_pool_x from torch_geometric.nn.pool.pool import pool_batch, pool_edge from torch_geomet...
0f0fbdbd42c5a0d23d08e5da8e19a0272f41c0e1c2e9ca11c27db4a97f9f36b1
Python
16,602
352
""" Script for extracting particles from a filament network of a unoriented single membrane graph Input: - A STAR file with a list of graphs (MbGraphMCF) as it is returned by by mb_fils_network.py script: + Density map tomogram + Segmentation tomogram +...
e181c90a0439bdca2fc1228c0ee3b51b90fecd7a763d7e9dbafc54c9b09c4fac
Python
16,602
485
# TODO # resnet # Now segment_coo have some bug in getting second-order derivative # https://github.com/rusty1s/pytorch_scatter/issues/299 # from torch_scatter import segment_coo # Different channel for different order? # parameterdict cannot be scripted # https://github.com/pytorch/pytorch/issues/128496 # parameters o...
c9a23d821f2b0cf39a26ddf1e0291073ec30e60fb797218cd4788d9da386e0d3
Python
16,603
387
""" Generates a ListTomoParticle object for the statistical spatial analysis of particles Input: - A STAR file with particles - A STAR file for paring picked particles and (sub-)volumes segmentations (Volume Of Interes, VOI) Output: - A STAR file with the pickled ListTomoPaticles objects ""...
575bec79da42ceb9a3577947dc2ffd4e1f916d9a85b6638f6f1ebddc6362f8f7
Python
16,604
281
class ElementLookUpTable(): '''Class for looking up atomic numbers and element identifiers.''' element_identifiers = ['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn'...
f1813e78d5cc499d6582c25983e1e7228f0475a19f88e336b7711a2e52c3e4e8
Python
16,610
506
"""Backing implementation for InstallRequirement's various constructors The idea here is that these formed a major chunk of InstallRequirement's size so, moving them and support code dedicated to them outside of that class helps creates for better understandability for the rest of the code. These are meant to be used...
566feb4964fdbdf2a529ae74777d8b09d6211a733d84096112d8d00c3e293466
Python
16,612
388
import itertools from math import pi import numpy as np from scipy.stats import qmc import uptake.multiprocessing.utils as mputils from uptake.model.system_definition import Fixed_Mechanical_Properties, MembraneGeometry, ParticleGeometry, Wrapping def params_tester_qMC_cstsigma(expected_sample_size, CPUs,...
5ebff95311dfdf1e800ab04c53b51d44285611d33f4397a097c991d3c7a4e671
Python
16,613
511
# 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...
3b0d21225f7622d179b8ffc64475b5d63ceeea598c39cb26d637020da6e6fb4b
Python
16,634
426
import os os.environ.setdefault("QT_QPA_PLATFORM", "offscreen") import numpy as np import pytest from unittest.mock import MagicMock pytest.importorskip("PySide6") from PySide6.QtWidgets import QApplication from regtools.registration.gui.batch_2d_tab import Batch2DTab from regtools.registration.gui.batch_2d...
764bc176974b50a537276a0aa68d1c80947581cea2a4a484822f1e1a0a636159
Python
16,650
394
import numpy as np import utils import scipy as sp from scipy.stats import truncnorm class SubspaceModel: def __init__(self, translation_vector, basis, eigenvalues, base_mesh=None): self.translation_vector=translation_vector self.basis=basis self.eigenvalues=eigenvalues self.base_m...
37a4b39c8ca89dbb00b69b8b1cd34a18fc566b86af50d00d4569d1ec3f8af322
Python
16,654
529
# demulitplex.py import re import sys import hdbscan import numpy as np import pandas as pd import scipy.sparse import statsmodels.api as sm import matplotlib.pyplot as plt import seaborn as sns from pyclustering.cluster.kmedoids import kmedoids from sklearn.preprocessing import StandardScaler from pathlib import Path...
3b2cf13a993d639a26c3bd345e8ad54ee912d89de4cb2acebf95f9302a4ac44c
Python
16,656
467
# 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...
a438fa3beb5f43bf97c0497c50e949aa7fb126dfc001d238150a419ebdcdbb2c
Python
16,657
473
#!/usr/bin/env python3 from __future__ import annotations import argparse import csv import re from dataclasses import dataclass from datetime import datetime, timedelta from pathlib import Path @dataclass class PhaseResult: run_label: str run_path: Path phase_name: str output_dir: str exit_code:...
8338451156934e579bf8630318922f017eee98e73778bae28994410fd7e3746c
Python
16,664
395
import numpy as np import pca_utils as utils import scipy as sp from scipy.stats import truncnorm class SubspaceModel: def __init__(self, translation_vector, basis, eigenvalues, base_mesh=None): self.translation_vector=translation_vector self.basis=basis self.eigenvalues=eigenvalues ...
cd21af6506a3698d5d2733d72351f7291e72bf59d7466777999be5bd8e0a73c8
Python
16,667
545
""" Bonito Input/Output """ import os import sys import csv import pandas as pd from threading import Thread from logging import getLogger from collections import namedtuple from contextlib import contextmanager from os.path import realpath, splitext, dirname import mappy import numpy as np from pysam import Alignmen...
6dbe28374a7e06e24894fc2b4f44a5643a69f2060f9311c63c39edeeae3d8158
Python
16,676
356
# %% import numpy as np import pandas as pd import pickle from pathlib import Path from plotnine import * import copy import math # https://github.com/neudorf/PLS_wrapper from PLS_wrapper import pls ATLAS = '220' BEHAVIOURAL_DATA_DIR = Path('../../../data/Cam-CAN/data_processing/behavioural_data') BEHAVIOURAL_DATA_FI...
c62ec565e5b3d63068b8cb0cf849caf572218d98c1568c10bab591d053209019
Python
16,676
405
#!/usr/bin/env python from __future__ import print_function import argparse import cProfile import pstats import numpy as np from examples.continuous_tamp.primitives import get_value_at_time from pddlstream.language.temporal import get_end, compute_duration from examples.pybullet.namo.stream import BASE_RESOLUTIONS,...
df9ff0e35a6eeea0053a10549a6ff1ac68c0ed245307bf961ddea2f3baea8e8f
Python
16,677
372
list()#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 14 01:23:05 2021 Generate text transcript from the time-aligned TextGrid data annotations. This allow us to compute word-level feature in line with the annotations when using an LSTM or Transformer model on the text. @author: hugwei """ impo...
8a8764eb9eecdb684e2149bcc4611c8d35c998a6239287271aaaf9f61400c881
Python
16,682
367
#!/usr/bin/env python from __future__ import division, print_function import argparse import multiprocessing import os import sys import time from typing import List, Union, Iterator, TextIO, Iterable, Tuple import numpy as np import pandas as pd import topaz.cuda import topaz.predict import topaz.utils.files as fil...
23bcefa3c2ccd9d2ccd909236e43b11d7832ca1ae0d04f49a7b181242f7a288e
Python
16,683
324
import os import pickle as pkl from typing import Any, Callable, Dict, Tuple, Union from ..base_dataset import BaseDataset class DEAPDataset(BaseDataset): r''' A multimodal dataset for the analysis of human affective states. This class generates training samples and test samples according to the given parame...
d91470c9fa31c312ba3c2b29024bdad980988f835d4d50c945f3012ef8672255
Python
16,686
392
"""Shared utilities for schema validation, sorting, and format conversion used by CLI scripts.""" import os.path from collections import defaultdict from hed.errors import HedFileError, get_printable_issue_string, separate_issues from hed.schema import HedKey, from_dataframes, from_string, load_schema from hed.schema...
bac250b38cf5c27c7525d6d2921f1c51caa314613bc9b7dfe15b408efcc1a2ac
Python
16,687
468
"""Morphology reconstruction data structure.""" import math from collections import deque import numpy as np from treem.tree import Tree from treem.io import SWC, load_swc, save_swc from treem.utils.geom import rotation_matrix, norm class Node(Tree): """Morphology data storage.""" def __init__(self, valu...
c8e3004d2826a4f3214c968bb7e827c1b637fc8442f3bc78986ed4d38f05d68f
Python
16,689
494
import copy import datetime import numpy as np import os import pandas as pd import torch import torch.optim as optim import torch.nn as nn import torch.utils.data as udata from abc import ABC, abstractmethod from torcheval.metrics import MulticlassAccuracy from tqdm import trange, tqdm from typing import Dict, Iterab...
10fc1c04e388862672ba3389ef264ead56601b29419e7c64441016291e1998ef
Python
16,697
523
import numpy as np import pandas as pd from os.path import join from moabb.datasets import ( Zhou2016, BNCI2014004, BNCI2014001, MunichMI, Weibo2014, Cho2017, ) from preprocess import ( load_sub, apply_preprocessing, Dreyer2023, ) from help_funcs import load_exp_variables # -----...
479d70daae74b01c8f620e139f3c08eca14d99014d439e431a62d4ca72b34eb1
Python
16,697
351
import logging import glob import os import numpy as np import h5py import scipy.io from . import functions as func from .collections import dotdict class Dataset: """ This class is for loading empirical Datasets. Datasets are stored as matrices and can include functional (e.g. fMRI) and structural (e....
547d859f55c8703ad9f47e38c165bbe0a0384d83de930e5fe37b76df56b9e32e
Python
16,701
364
import numpy as np import nibabel as nib from pandas import DataFrame from sklearn.preprocessing import minmax_scale from pyrelimri.icc import sumsq_icc from nilearn import image from nilearn.maskers import (NiftiMasker, NiftiMapsMasker, NiftiLabelsMasker) from nilearn.datasets import ( fetch_atlas_aal, fetch_a...
cd7f87f20c2b1a3a879c882d557947c1e930ec0bda8a309fc577752c6199e6f7
Python
16,703
427
""" Hidden pyrophosphorylation page. This module adds a self-contained, *unlisted* page to the Sitetack webserver that runs ONLY the pyrophosphorylation models that are in development (the four models in the PyroPhos_prediction project folder): 1. Without labels - trained on raw sequence, no known sites ...
f017c4d9dbf6548635d330c135f35a899b86ea5264f159d3f0f939ecf98bc026
Python
16,711
411
''' 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 Loader structure adapted from DeeperCut by Eldar Insafutdin...