sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
cf80af931b86b4b503c6fa2894b942fdeb78cfb609adec686a7a596a306ebb96
Python
9,888
171
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'accuracy_measurement_page.ui' # # Created by: PyQt5 UI code generator 5.15.9 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from qtpy im...
cc30b66355ccd538311a97dc868d8c77c8a5832adcf84e2d8109722dbdd9c8c7
Python
9,889
171
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'accuracy_measurement_page.ui' # # Created by: PyQt5 UI code generator 5.15.9 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 i...
644a65e17f8e0666704a32ecab4cf3785cc9439569bf5e57334d1007cc89ed99
Python
9,890
248
# Copyright (c) 2022, Kwanhyung Lee. All rights reserved. # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTI...
be533c025e9bcbbda6958e6588919b0a5f8e8d4efb24e787394d8c0297e66a29
Python
9,890
229
import timm import torch from torch import nn from collections import OrderedDict from .smp import ExternBase from ..util.util import get_device import re from typing import List, Tuple from warnings import warn __all__ = ['TimmEncoder'] def get_channels_strides(model, example_input=None, verbose=True) -> Tuple[List...
7b22ad7bb831645c0c87bb9ab5f17bebaf515e5a416a58864dd6b418419c2dc6
Python
9,891
234
import os, sys, csv import pandas as pd from math import ceil novascope_scripts = os.path.dirname(os.path.abspath(__file__)) sys.path.append(novascope_scripts) from bricks import create_symlink, create_symlinks_by_list #=============================================================================== # Table of Conten...
6aa37f5ec62343f14f19cc23f67bcfdc839c923c8a12638a6c029bdf0ab588e7
Python
9,892
274
# -*- coding: utf-8 -*- """ BBR The script calls the freesurfer bbr method. Inputs are not checked if they are valid. Two white surfaces are expected corresponding to left and right hemisphere. Therefore, the input should contain a list with two entries. The target volume is used as freesurfer orig file. A freesurfer ...
04f43cd5ede261fc770d51f6c54618e8720ea6e0503c5bc4a6f9dc7b45d24ba9
Python
9,894
296
from types import SimpleNamespace import pytest from langchain_core.messages import AIMessage from chemgraph.agent import llm_agent from chemgraph.agent.llm_agent import ChemGraph, PromptConfig from chemgraph.models.endpoints import PreparedModel def _fake_prepared(**_kwargs): """Mock ``load_chat_model_prepared...
731948074ede0f58319ea86fc8b164111047fbbd8610cf0616dedecf46bf98cb
Python
9,894
313
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 20 11:10:05 2024 @author: brainmappers """ def metric_regression(subjects_dir, subject, hemi, surface, mesh, rois, weights): import multiprocessing import os from concurrent.futures import ProcessPoolExecutor import nibabel as ni...
2537f04a22a1cb082250daa00ace97b614ed007b5cee866aca1a624722b421c9
Python
9,896
246
import numpy as np import torch from typing import Optional, Tuple from torch.nn import functional as F from copy import deepcopy from albumentations.pytorch import ToTensorV2 import albumentations as A import cv2 class SammedPredictor: def __init__(self, sam_model): super().__init__() self.model ...
401421a3876f4a836f40a65fe21eac5e592ce8e2bff4a1c183e80d82438561f6
Python
9,897
223
import os import pandas as pd import numpy as np import ipdb from scipy.stats import rankdata import subprocess import logging def cal_ndcg(scores, labels, rm_list, n=10): # ndcg topk denom = np.log2(np.arange(2, n + 2)) ndcgs = [] mrrs = [] p_topks = [] r_topks = [] hit_...
e73f87695c4c6fb22c90d4b48d701d2a3c6158ad2b4744e7ee0b86de08d19ddf
Python
9,898
253
"""PSTH computation + response metrics aligned to stimulation. Port of ``calculate_psth_metrics.m``, ``WithinRanges.m``, ``getSpikeLatencyRelStim.m``, ``getStimArtifactDuration.m`` and ``getFrAlignedToStim.m``. The **individual-electrode analysis** that produces ``StimActivity_NodeLevel.csv`` uses *gaussian* smoothin...
5de76f4f6dc8066537c765ecfd7f16e0d0da1d4a65aac4e92840ea12aa137e22
Python
9,900
241
from transformers import T5EncoderModel, T5Tokenizer import torch import numpy as np import pandas as pd from read_data import * device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') def get_max_len_index(data): train_length_frame = data.str.len() max_len_index = train_length_fra...
28ab850f049b7e8c06e595add1c4e968431e1faceb6e479629788dcb6b39afcf
Python
9,902
244
#!/usr/bin/env python # author: Jannes Spangenberg # github: https://github.com/JannesSP # website: https://jannessp.github.io import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib matplotlib.use('Agg') from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace ...
e19e56ab0bb6c35635392ecd48e3ec2f976509ac77a66b52f71de62838edd180
Python
9,902
236
import logging import numpy as np import pandas as pd import pyranges from kipoi.data import SampleIterator from mmsplice.exon_dataloader import ExonDataset from mmsplice.vcf_dataloader import SplicingVCFMixin from kipoiseq.dataclasses import Interval, Variant logger = logging.getLogger('mmsplice') def junction_df_j...
8c0f27ac4f7d9c20c554aaa4f6682207484d316e71d47e641ccefe0fba991cfe
Python
9,904
322
"""Functions for reading and writing data.""" import os import logging from pathlib import Path from typing import Dict, List, Optional, Union import h5py import mat73 import mne import numpy as np import scipy.io _logger = logging.getLogger("osl-dynamics") _allowed_ext = [".npy", ".mat", ".txt", ".fif"] def valid...
61c2c447841f6db04cce2af5d39f9846a857b2b9012222e9d11bfc731865d6dc
Python
9,905
283
"""Data rescaling utilities.""" import logging import torch from mcmlnet.utils.logging import setup_logging from mcmlnet.utils.tensor import TensorType, tensor_conversion_decorator setup_logging(level="info") logger = logging.getLogger(__name__) class DataRescaler: """ Rescales data using different method...
da4f10ea2fd40bf8673543b220e192af65e185fbb00be9f0bc4cff0aa44d52d3
Python
9,905
313
#!/usr/bin/env python """ This script generates simulated RNA-Seq reads (in .bed format) from known gene annotations. USAGE gensimreads.py {OPTIONS} <BED-File|-> PARAMETER BED-File\tThe gene annotation file (in BED format). Use '-' for STDIN input OPTIONS -e/--expression [expression level file] \tSpecify ...
5b620409f0d67f1cb53c11754a5dab4874c57cb2202af00197237b2d04b4f312
Python
9,908
332
# Copyright 2025 BrainX Ecosystem Limited. All Rights Reserved. # # 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 appli...
a2b2666ad267ecab71caa3e386b3f70a4646a557717740360bb7bd26e8fa7a61
Python
9,910
315
# %% import os import glob import random from os import listdir, makedirs from os.path import join, exists, isfile, isdir, basename from tqdm import tqdm, trange from copy import deepcopy from time import time import numpy as np import torch from torch._dynamo import OptimizedModule from torch import multiprocessing as...
96a69f34f73eabb8325737691fa331f0e08746eb2bd079c78fb3c48b543a96c8
Python
9,911
286
import unittest import logging import numpy as np import pandas as pd import diffxpy.api as de class _TestFit: def _test_model_fit( self, n_cells: int, n_genes: int, noise_model: str ): """ Test if de.wald() generates a uniform p-value distribu...
2208d2b9257395079d328949ad85e97fc419aaf199f2348abd3501ba9b053c52
Python
9,918
224
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import tempfile import numpy as np from scilpy import SCILPY_HOME from scilpy.io.fetcher import fetch_data, get_testing_files_dict # If they already exist, this only takes 5 seconds (check md5sum) fetch_data(get_testing_files_dict(), keys=['tracking.zip']) tmp...
9541b196b9f8987afc5c85d916df9434b12a457604ca128d7995139536d7275c
Python
9,919
257
# -*- coding: utf-8 -*- """TODO""" import numpy as np import core.core_global as core from core.core_definitions import simulation_timestep from core.mc_neuron_group import McNeuronGroup class McLifGroup(McNeuronGroup): """TODO""" def __init__(self, size, num_branches, params={}): """TODO""" ...
d361d0bf147b7d5207f98ac293dfb4abfe11d7f7a04100711c14044444bb662c
Python
9,925
199
import os import time import mlflow import torch import torch.nn as nn import torch.optim as optim from model_optim.validate import eval_model from utils.metrics import standard_metrics, prediction_refactoring, label_refactoring, compute_confusion_matrix from utils.env_config import path_check_and_join, path_dissect_an...
67a04f42c17be6a2666c9d9797e5015223baae5a23d50a29d34b794360a1dc60
Python
9,931
314
# -*- coding: utf-8 -*- # This file is part of Eigen, a lightweight C++ template library # for linear algebra. # # Copyright (C) 2009 Benjamin Schindler <bschindler@inf.ethz.ch> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed wit...
da5c502259ba78e31663c6bbbc0f8df05df32557bf85e217a1831d60a7a3d847
Python
9,936
298
from argparse import Namespace from collections.abc import Sequence from pathlib import Path from typing import TYPE_CHECKING import numpy as np import pandas as pd import torch from aislib.misc_utils import ensure_path_exists from sklearn.preprocessing import LabelEncoder, StandardScaler from eir.data_load.data_util...
9dc6e23b84edb5494dab1c15f7ca546ec271b7cc9b42369729112c547294b0a7
Python
9,938
236
"""What this computer is, and what a run will do with it. Two questions keep coming back, and neither has been answerable from inside MEA-NAP: *which of our computers should run the big batch*, and *why is it slow on mine*. Both need the same three things — what the hardware is, what the pipeline decided to do with it...
d1e34f6b8a2478a2a6266c2917b92efd51288f7b23f5de25e8aedccf4780eeb7
Python
9,939
278
""" Copyright 1999 Illinois Institute of Technology 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, publis...
080befdd8f9006e8995d59173b8f507a1291244ccda48f650348d27804f6a61a
Python
9,940
225
from .libs import * def scale_data(to_transform, pd_cols, pd_index): scaler = MinMaxScaler((0,1)) data_scaled = scaler.fit_transform(to_transform) data_scaled_df = pd.DataFrame(data_scaled, columns = pd_cols, index = pd_index) return data_scaled_df, scaler def inverse_scale(scaler, myyield_tanh, verbo...
4fc99d7150c797d8ced9afd145bcf5e69461a7add4080d88fc22dcb12120c21f
Python
9,943
245
#!/usr/bin/env python # author: Jannes Spangenberg # e-mail: jannes.spangenberg@uni-jena.de # github: https://github.com/JannesSP # website: https://jannessp.github.io import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib matplotlib.use('Agg') from argparse import ArgumentDefaults...
89b916736107f4e919e2ce37f2527c02b706e6469fd8c5f8e4d1d40ac008f80e
Python
9,945
298
from argparse import Namespace from collections.abc import Sequence from pathlib import Path from typing import TYPE_CHECKING import numpy as np import pandas as pd import torch from aislib.misc_utils import ensure_path_exists from sklearn.preprocessing import LabelEncoder, StandardScaler from eir.data_load.data_util...
8bc34671cc5ea7e43f0a349f3cfdfa1539fbb14bf6cd82e2b770ddfb87da2ad6
Python
9,945
255
from typing import Tuple, Union from sklearn.ensemble import VotingRegressor from sklearn.utils.validation import check_is_fitted from sklearn.base import BaseEstimator, RegressorMixin from sklearn import metrics import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow...
c6674bd19ce9ff6ed8b27f89beaf90fd1ffdc24e2c03a022125721b0028b8972
Python
9,945
250
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmcv.cnn import ConvModule, build_upsample_layer, UPSAMPLE_LAYERS from depth.ops import Upsample import torch.utils.checkpoint as cp class BasicConvBlock(nn.Module): """Basic convolutional block for UNet. This module consi...
c659e4cfba0c7c118d2c0a63ab94c2bfa349fe5d6a3ee0aa3aab2a8b1205afc6
Python
9,948
211
''' N2O ''' import numpy as np import sys def intro(): print(""" SHORT List of potential energy surfaces for N2O: P: potential energy, G: Gradient, D: Nonadiabatic coupling vector This is listed at the end of description to show the availability. For example: P/G means both potential energy and g...
4e485d803f4f8c3ff381be3f3486ebb4ac5cc599255af890fd36dcd99aba5620
Python
9,949
245
"""Prepare the NSD-synthetic betas in fsaverage space. Parameters ---------- subject : int Number of the used NSD subject. zscore : int Whether to z-score [1] or not [0] the fMRI responses of each vertex across the trials of each session. project_dir : str Directory of the project folder. nsd_dir : str Directory ...
6c5be7c66d3a4df8a6ae4e0ad0d5ba23a867706b227da74de5f3a39036b4f78b
Python
9,949
135
class BH76(): """ A class to store molecular data and corresponding calculations for BH76 dataset. Attributes ---------- molecules : list[str] List of molecule identifiers used in test calculations. exp_values : dict[str, float] Dictionary mapping test identifiers to their expe...
b4923027687bf30b443e328f70b50f77d15e2255304cb92b3b4c90a6201dab01
Python
9,955
225
#This script will create an index (.ndx) file that contains the atoms needed to calculate improper angles for chirality. #Then the index file is input for the GROMACS command "gmx angle", which will calulate the improper angles #and output a .xvg file containing the angles for each residue for each frame in the trajec...
4c33bed19805dbff4815057dc611d490c2ac9073acf0de779a1ee48f5dbb60e7
Python
9,958
311
""" This class defines the basic imagestack and instructs lasagna as to how to handle image stacks. """ import numpy as np import pyqtgraph as pg from PyQt5 import QtGui, QtCore from lasagna.ingredients.lasagna_ingredient import lasagna_ingredient from lasagna.io_libs.image_stack_loader import save_stack class ima...
2630695a0515f7cc9d82fa02954362974e68cadcc1125ad362a95fd1e6f2692d
Python
9,959
204
# This code extract document level features of transformer models import os import h5py import pdb from typing import List import flair from flair.data import Dictionary, Sentence, Token, Label #from flair.datasets import CONLL_03, CONLL_03_DUTCH, CONLL_03_SPANISH, CONLL_03_GERMAN import flair.datasets as datasets fr...
712cb407c401befd268037e16cc5669aa8ea5991c21d9020aa243efe947e0c2a
Python
9,964
303
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import argparse import logging import pytest from cvat_sdk.core.auth import ( CVAT_ACCESS_TOKEN_ENV_VAR, DEFAULT_SERVER, AuthStore, AuthStoreError, ClientAuthParameters, ProfileEntry, configure_client_auth_arguments, ...
45650fe3577fdc60e235b154274fb0836fd90374eebec9963147c4b933bfd826
Python
9,967
243
###################################################################################### ### Recursively moves through directories to extract parameters, firing rates, and ### ### the recall quality measures Q and MI from spike raster data ### ###########################################################...
c51a5948fcb130bceea8975fe8438826a7769bd903569c9c8ad01f57e2f91ac0
Python
9,968
317
# 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 logging from functools import partial from typing import List, Tuple, Union import torch import torch.nn as nn imp...
9e2677d09d09198a047fba5d2c217ffb44de1db1ad40b90ca85f607b88feec9b
Python
9,976
168
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'camera-display.ui' # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Frame(object): def setupUi(self, Frame): Frame.setObjec...
a970bbe3b93cc31c28983488f27156a22dc8b507a1148e4bd0a60d3b7c0d5927
Python
9,977
302
import re from types import SimpleNamespace from dataclasses import dataclass import numpy as np import pandas as pd MAX_ENTRIES_STR = 10 class ClassifyOutput(SimpleNamespace): """ A general container to hold the outputs of the classify function of SeisBench models. This allows each model to provide a d...
ad4b3a2f9657b41f66980e57a7981e4fe8347b3f467d2e2eabea2c7b17338db0
Python
9,977
272
from __future__ import annotations import pandas as pd import os import warnings import numpy as np import pingouin as pg import os.path as op from glob import glob from pathlib import Path from tqdm.notebook import tqdm # Visualization settings import seaborn as sns import matplotlib.pyplot as plt sns.set_theme(styl...
4866fbddabe9ac942dabe3e1c07417c79615d59ce86a19c2361a589060075457
Python
9,981
270
import json import os import Levenshtein import numpy as np import torch from sklearn.model_selection import train_test_split from torch.utils.data import Dataset import my_setup from data_processing import tokenization from data_processing.sequence_utils import mask_tokens, prepare_sequence class Sequences: d...
f8ed81771e2259ccb385b7a828c060e89905d45a9bab91f6bd06e79ebc4bb502
Python
9,981
337
# -*- coding: utf-8 -*- """Illustrate nifti images.""" import datetime import os import shutil as sh import imageio as io import matplotlib.pyplot as plt import nibabel as nb import numpy as np from ..segmentation.flat import orthographic_projection from ..surface.filter import mris_fwhm __all__ = ["get_gif", "get_...
186a1e14281e0147818a435e231433454d077e3986a8c4578df400d43a200bac
Python
9,982
278
import json from collections.abc import Sequence from copy import copy from pathlib import Path from typing import TYPE_CHECKING from aislib.misc_utils import ensure_path_exists from eir.experiment_io.io_utils import ( check_version, dump_config_to_yaml, save_dataclass, ) from eir.experiment_io.output_obj...
958930de47fb32b1c1eab3d769d738bbec4e8d4db0babd49db2ec469e5862210
Python
9,984
271
from collections import defaultdict import numpy as np import pandas as pd from sklearn.base import BaseEstimator from sklearn.inspection import permutation_importance from sklearn.model_selection import StratifiedGroupKFold, GridSearchCV from sklearn.pipeline import Pipeline from sklearn.preprocessing import Standar...
18d4eefa68a59cf3c2bcc17180316dfefc05f0d70260789ada2ff10b4abd0f3a
Python
9,986
230
#Aidan Fike #July 21, 2019 #File with function to parse command line arguments and extract relevant information. Also #informs the user if they make a mistake import sys import os import dihedDir usage = "\nUSAGE: To use this program run:\n\n\ \n\ python main.py [-flag argument] [-flag argument] [-flags]\n\ \n\ ...
ec9443ee7b5f2597c6dc727b600a849481b6087ec5dd55cda739aeda328260a4
Python
9,988
228
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This script matches the TIFF image files (donor, acceptor, and FRET channels) in each folder, performs background correction, fluorescence leakage correction, FRET efficiency calculation, and outputs the results to CSV files. """ import json import os import sys impor...
0a2860be9e9f20db8a15513c505b599e4a4004e7e0b574d6c78fa9437f64d34f
Python
9,992
286
from __future__ import annotations from typing import Final from typing import NamedTuple import numpy as np import scipy.ndimage import scipy.spatial import skimage from loguru import logger from numpy.typing import NDArray from .._shape import CIRCLE_POINT_COUNT from .._shape import MIN_POLYGON_POINT_COUNT from .....
f0edc2200f3fb18b5b7dd278234ada5158c734468f11194f08d74bd4f501d4de
Python
9,995
278
from __future__ import annotations import os import tempfile from pathlib import Path from typing import List import numpy as np from auxiliary.runscript import ScriptRunner from auxiliary.turbopath import turbopath from auxiliary.io import read_image from brainles_preprocessing.registration.registrator import Regis...
1ac09ac6b0d3ab82dfdb80a573e1043cdca00cff9381b89b848af35ad6df7091
Python
9,996
250
import torch import os import argparse import datetime import numpy as np import random from torch.utils.data import DataLoader from tqdm import tqdm import pandas as pd from brainCT.networks.gen_model import GUNet from monai.transforms import ( Compose, ToTensord, RandAffined, ScaleIntensityd, Ran...
4e1956b716b97f3711795cd36a543e51b2f8b7ad5592eac0286dc8a7253a0c05
Python
9,996
314
from collections.abc import Callable from typing import Any import torch from torch import nn from torch.nn import functional as F from eir.models.layers.attention_layers import SwiGLU, Transformer from eir.models.layers.norm_layers import LayerScale from eir.models.tensor_broker.projection_modules.sequence import ( ...
927b3a6ec4dee0ad57fb753fdc236cd0ed24118d6a760cf57090d2126b30f455
Python
9,998
266
import os import pandas as pd import numpy as np from sklearn.metrics import cohen_kappa_score from util.config_vars import config def rater_comparison_workflow(): """ Coordinates the multi-step comparison and reconciliation of manual ratings between two raters. Step 1: Identifies discrepancies in init...
5e612e2921272a74e5e8c037fbc2fe185b017017266ccab009cfdd986858ecbe
Python
10,002
279
# -*- coding: utf-8 -*- """ Created on Tue Mar 15 15:37:12 2016 @author: ajaver """ import glob import os import numpy as np import pandas as pd import tables import warnings from scipy.signal import savgol_filter from tierpsy.analysis.ske_orient.checkHeadOrientation import isWormHTSwitched from tierpsy.helper.misc...
ab338ab470b45ecaef7d90632a8e9d8628a2fc40c3186cca0b9d09c21fbbdc12
Python
10,002
317
import numpy as np from paraview.util.vtkAlgorithm import ( VTKPythonAlgorithmBase, smdomain, smhint, smproperty, smproxy, ) from vtkmodules.numpy_interface import dataset_adapter as dsa from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid import os paraview_plugin_version = '0.1' alg_inpu...
f2113ab3c6e01675d44abc395e10a66f9755d19b169cb1b9ade1a661e3295f15
Python
10,003
186
import re from pathlib import Path import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from Switching.SwitchingHelper import parseAllData, getZoneLDA from sklearn.decomposition import PCA FolderPath = Path(r'D:/Data/Lobster/FineDistanceDataset') outputData = [] pbar = tqdm([p for p in FolderPath.gl...
61bb05fc8c7eba0ea37a54c89345d6ad0577852bd30527c16b5e067023b8a8d5
Python
10,004
196
from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, roc_auc_score from layer import SimpleHGN import pytorch_lightning as pl from torch import nn import torch from Dataset import BotDataset from torch.utils.data import DataLoader import argparse from torch.optim.lr_scheduler import Cosi...
64c4264ac40f03a2e75eb8a0bfdacee61d6620c7fea5dcd34361ec2186279231
Python
10,004
215
import os import random import numpy as np from scipy.sparse import coo_matrix import torch from pytorch3d import transforms from torch.utils.data import Dataset from MDAnalysisData import datasets import MDAnalysis as mda from MDAnalysis import transformations from MDAnalysis.analysis import distances class MDAnaly...
e2745d5c3e5483e35c9db3689e40f6acbf9a8f2cc231355b0ed33256f3eee7b0
Python
10,005
169
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/media/lg/disk2/PycharmProjects/ISAT_with_segment_anything/ISAT/ui/category_edit.ui' # # Created by: PyQt5 UI code generator 5.15.10 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this...
0ecf43096c37321469af594100571c8c21eb08ae629ad9763a8e49f718e9efbf
Python
10,007
268
import sys import yaml import os import numpy as np import h5py import git import pandas as pd precut = 3. ttags = ['prestim'] postcut = 0 block_licking = True savepattern = '%s__TSEL%s{}__STATE%s%s.h5'.format(int(precut)) #% (aRec.id, ttag, statetag,reftag) active_buff = np.array([-1,1]) quiet_buff = np.array([0,0])...
85f159b9639235bfb0eb2dfbd91d9a342d09855d9f72940eb347ce87b4f3aa3c
Python
10,007
231
import argparse from os.path import join import pickle import keras from keras.optimizers import Adam from keras.callbacks import EarlyStopping, ReduceLROnPlateau import utils from model_zoo import ResidualBind_heteroscedastic import plotting import pandas as pd import wandb from wandb.integration.keras import WandbMet...
1821cb6720d9295a9f008bcf7dfc8894133e55372a30f18610e6f56e93ea538b
Python
10,009
350
""" Module for performance profiling """ import os import json import time import queue import typing import datetime import threading import contextlib import multiprocessing import grpc #from . import trace_event_grpc_pb2 ...
92102cc6762cd395cefbccaa6f38eae4cc12aff23f37a18ef1e07fc02219a5f1
Python
10,009
240
"""Model of gene-expression matrix. One slice_dataframe object corresponding to one gem file """ import time import numpy as np import pandas as pd from sklearn import preprocessing """Model for manipulate the coordinate of spots in one slice One slice_xyz object corresponding to one gem file """ class slice_xyz: ...
6bd906bbe0b75580e51ab2b35828f5fb550eaa528eceadc18c1cf11cc53816e7
Python
10,012
210
# (C) Copyright 2019 IBM Corp. # # 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,...
bdfaa4eb92eadeec2107d88b34be603591f02c4703b1b9feb2fb5b3a66327387
Python
10,012
270
""" UDysRS dataset loader: JSON pose exports → COCO-17 (T, 17, 2) clips + scores. Three tasks, each with its own JSON file and joint schema: Drinking / Communication — 15 joints: head, neck*, face*, Lsho, Rsho, Lelb, Relb, Lwri, Rwri, Lhip, Rhip, Lkne, Rkne, Lank, Rank (* neck and face dropped; not in C...
1284fd53322304aa90ca19d3655aa9771e888ef5e01f77b20dd56b0245efd7de
Python
10,015
200
""" PyVISAScope provides an interface to different scopes. Copyright (C) 2016 Ye-Sheng Kuo <yesheng.kuo@gmail.com> Copyright (C) 2019 Julius Zimmermann <julius.zimmermann@uni-rostock.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
6461b18c50537394f1acfef6ff29f7c9f7f28aa218790fe179d81ab4ecc60167
Python
10,016
347
from __future__ import annotations import base64 import json from pathlib import Path import numpy as np import pytest from PySide6.QtCore import QMimeData from PySide6.QtCore import QPointF from PySide6.QtCore import Qt from PySide6.QtGui import QDropEvent from pytestqt.qtbot import QtBot from labelme import _utils...
379d71804bc7ea13a6c2f923be15bc83abe10968bb28db9d69a64e2a7ec9ba97
Python
10,017
224
import os import sys, time, json, traceback import numpy as np import nibabel as nib from nipype.interfaces.base import BaseInterface, BaseInterfaceInputSpec, TraitedSpec, File, Directory, traits from dipy.io.image import load_nifti from dipy.io.gradients import read_bvals_bvecs from dipy.core.gradients import gradient...
c51f8ec5e430f0b2b5183b45c968f0549c8678df06463e5123bfd24688e9b942
Python
10,024
231
""" This file contains several functions that help in the first analysis of the FMCW radargram dataset. The functions find_h5_files(), extract_data_from_h5_file() and collect_extracted_data() are jointly used to find and extract all relevant information from the raw dataset which was initially stored in a folder of HDF...
d06c194f64cc08477786aeceb1b3c43e989fd5c9c83bef509cca33f212200ac2
Python
10,025
271
# torch imports import torch import torch.nn as nn def get_bond_length_ABA(pos, nintdist): """ function that calculates the interatomic distances of a molecule with ABA symmetry (such as HeH2+ or H2O) This function does not take permutational invariance into account. the numbering is (fo...
2c27ce13fa35b263525ebdcc94170ad23d7c79331ff635296602d032a0aa28cb
Python
10,031
275
import pandas as pd import numpy as np from typing import List, Optional, Union import uuid from collections import Counter def get_person_time_df(t: pd.Series, y: pd.Series, a: Optional[pd.Series] = None, w: Optional[pd.Series] = None, X: Optional[pd.DataFrame] = None, return_individual_series...
cad006b94164437bcce0a3c39cf7e60d83f740ccdeb8fc615b20482dda223622
Python
10,032
297
#!/usr/bin/python # ---------------------------------------------------------------------------------------- # A basic class for the control of the PSD4 syringe pump from Hamilton # ---------------------------------------------------------------------------------------- # Jeff Moffitt # 11/20/21 # jeffrey.moffitt@child...
9364763aab761511af941f0ad8de106cb986dd24016f28e5ec7fa573166c8464
Python
10,033
257
from __future__ import division import numpy.ma as ma import numpy as np import scipy as s import math from mofapy2.core.utils import * from mofapy2.core import gpu_utils from time import time # Import manually defined functions from .variational_nodes import BernoulliGaussian_Unobserved_Variational_Node from .varia...
f11e83d7ff065e120102d931188eb46670ab5392de9bdaf5f85b546d93b0949b
Python
10,034
295
import ftplib import os import time from pathlib import Path import requests from lxml import etree from tqdm import tqdm import seisbench def download_http( url, target, progress_bar=True, desc="Downloading", precheck_timeout=3 ): """ Downloads file from http/https source. Raises a ValueError for non-2...
1e972eeabfde7dd6ab352ac3daa7a94a13e3e295cc84fff91bb494c99adb7b9c
Python
10,037
196
from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, roc_auc_score from layer import SimpleHGN import pytorch_lightning as pl from torch import nn import torch from Dataset import BotDataset from torch.utils.data import DataLoader import argparse from torch.optim.lr_scheduler import Cosi...
9a247dd8aee384308855a9be645dcf675c64f6eacf21b3dc8aee12d8d2d29a4f
Python
10,038
277
from collections.abc import Sequence from copy import copy from dataclasses import dataclass from functools import partial from pathlib import Path from random import sample from typing import TYPE_CHECKING, Literal, Union import polars as pl from aislib.misc_utils import ensure_path_exists from lightning.fabric impor...
78a9fa541ab859f911ff1378ccfdd764eb5f421907a142135adca677e8f1c650
Python
10,040
238
# (C) Copyright 2020 IBM Corp. # # 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...
0deefb80a1fee091af4bdf5b4651ece5c4c9c877297ac86bbe76ade1ab54b9bc
Python
10,043
304
""" Implementation of Moran spectral randomization. """ # Author: Oualid Benkarim <oualid.benkarim@mcgill.ca> # License: BSD 3 clause import numpy as np import scipy.sparse as ssp from scipy.spatial.distance import cdist from sklearn.utils import check_random_state from sklearn.base import BaseEstimator from ..mes...
2f221a4bdd24942cc92cd14303408b9af5401504d7896a972ee322c648b116f1
Python
10,045
248
"""Command-line interface for privacy analysis and anonymisation.""" from __future__ import annotations import argparse import json from pathlib import Path from typing import Any, Sequence import numpy as np import pandas as pd from .corelogic import ( add_noise, bin_numeric_values, calculate_k_combine...
994cadc52448a7e8e77680dff9a66897b82f68dcd79f67aa0c0f72b1bb1baf81
Python
10,045
220
# Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved """Triton kernel for euclidean distance transform (EDT)""" import torch try: import triton import triton.language as tl HAS_TRITON = True except (ImportError, ModuleNotFoundError): HAS_TRITON = False triton = None tl = No...
e1bb49991a2388c92387a92f0d741de361e834f5dc96c3257a9512cc3ac0d32c
Python
10,045
274
""" Copyright 1999 Illinois Institute of Technology 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, publis...
178b470c0ab4897145b054f1b58d10207b7b3ea695000f5c746f1afb9a61574d
Python
10,047
247
import os import cv2 import sys import matplotlib.pyplot as plt sys.path.append("/LiNet") import torch import numpy as np from torch.autograd import Variable import argparse import random from lib_alban.utils_analyse import def_masks_extract import os.path as osp os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1" import ...
ab613154531938d501741a7fd8fbf3758aa6cd12984cac09811381381cbbb995
Python
10,048
196
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import tempfile from scilpy import SCILPY_HOME from scilpy.io.fetcher import fetch_data, get_testing_files_dict fetch_data(get_testing_files_dict(), keys=['btensor_testdata.zip']) tmp_dir = tempfile.TemporaryDirectory() def test_help_option(script_runner): ...
462412a16a66af992babf2db88fd6866863a201085c058144bd4653078af1d12
Python
10,049
276
import pandas as pd import numpy as np import scanpy as sc from sklearn import linear_model from itertools import combinations from .stats import * import random as rand ### from stats import * def csRenameOrth(adQuery,adTrain,orthTable,speciesQuery='human',speciesTrain='mouse'): _,_,cgenes=np.int...
433d24b3d5a6be882f4951c372c57ffa847dcad22aa9bca19875d63f29b821c1
Python
10,053
237
# -*- coding: utf-8 -*- """ Created on Fri Apr 11 19:03:57 2025 @author: axthi """ import os import shutil import numpy as np import pickle import datetime from copy import deepcopy from .preparation import create_cereb_surface, get_central_gm_with_mask, get_center_pos, _relabel_internal_air from .simulation import _...
5c9f8ef343f8dfb57a017084311d11b34a0a9e132ee02f3bb0f9eeef5b87a10e
Python
10,053
265
import sys import yaml from glob import glob import os import numpy as np import h5py import git import pandas as pd precut = 2. postcut = 0.7 ttag = 'psth' block_licking = True savepattern = '%s__TSEL%s{}to{}__STATE%s%s.h5'.format(int(precut),int(postcut*10)) #% (aRec.id, ttag, statetag,reftag) active_buff = np.arr...
33089f15d8b177cca522be260c65971884ac67664edfebfb082af5e951df1c1f
Python
10,054
203
# -*- coding: utf-8 -*- """ Created on Thu Jun 18 14:35:49 2020 @author: Yoshi """ import os import shutil import numpy as np from polar_coordinates_calculator import * from best_angle_calculator import * def arrow_coordinate_calculator(path,cell_flags,cell_locations,map_type,mode,width,height,scale): # ...
12fe3baf5d0b3641faea3d676e44cbd7f4ed451b27ad4ada45c0ad97f93895a3
Python
10,055
269
import warnings import torch.nn as nn import torch from torch import Tensor from typing import List, Tuple, Optional, Union from bism.modules.unet_block import Block2D, Block3D from bism.modules.concat import ConcatConv2D, ConcatConv3D from bism.modules.upsample_layer import UpSampleLayer3D, UpSampleLayer2D from fun...
8c411face8f7026a22ce8252ba09ea0537ca7c8c5c7b78830fa0e1e485f35d60
Python
10,058
221
# @String(visibility="MESSAGE",value="<html>This script merges Sholl profiles from multiple files into a single table and plot,<br>obtaining Mean&plusmn;StdDev profiles for groups of cells. It assumes that files share<br>the same structure and the same (case-sensitive) column headings.<br>&nbsp;") MSG # @File(label="In...
c6fce9f1a8d27fe8a118097a3763f9f00c5505a302f85b8cf1ef5f08bf9e8901
Python
10,063
417
import numpy as np from matplotlib import pyplot as plt import pandas as pd from scipy.optimize import curve_fit import os from Tissue_compartment_modeling import CM_vB_wrap if "Users" in os.getcwd(): # Local runtime with data from Example_data folder print("Local runtime") WDIR = "./Example_data/" elif "...
f5c180c1feed3d15d2ff8d7d1606f74cd276b41198e92f3848dfd19d54252070
Python
10,066
240
import os.path import unittest import tests.base_test import tests.output_parser as output_parser import tests.test_config import tests.util class Alternative5SpliceSiteNovelBaseTest(tests.base_test.BaseTest): def setUp(self): super().setUp() self._test_base_dir = tests.test_config.TEST_BASE_DIR...
225a51062829e0d5a83229a7215138e50862a51a4e30a8dc0af743610ed0454d
Python
10,070
298
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from collections.abc import Callable, Iterator from functools import wraps from itertools import islice from typing import Any, TypeVar, overload import attrs from attr import field T = TypeVar("T", bound=int | float | str) def _parse_self_and_ot...
2b5bc3964c02828215fecec7a7e74a3d7a265018998f74002095b4cfa34c25d1
Python
10,071
251
import h5py from glob import glob import os import yaml import numpy as np import matplotlib.pyplot as plt import sys from scipy.stats import sem import pandas as pd varnames = ['B_mean','M_mean','rate_mean'] pfc_only = True sg_on = True pathpath = 'PATHS/filepaths_carlen.yml' pathpath2 = 'PATHS/filepaths_IBL.yml'...
b808ab8b329a0e97109372d067bfb89278218767e4b5a5dff258d794da1f842b
Python
10,071
211
#!/usr/bin/env python3 """Stage 5 -- ablation studies. Six axes, all evaluated under the same nested leave-one-subject-out protocol as the main comparison: modality blink-only / EDA-only / both gating reliability gate on / off fuzzy layer type-2 warning layer vs raw thresholding (post hoc) ...
8eb4baad01b562ecf748d7e0b40e8e2262197445bd0a3b29672c1e2be6587313
Python
10,072
242
# -*- coding: utf-8 -*- import logging import os import sys import nibabel as nib import numpy as np from scilpy.image.volume_math import concatenate from scilpy.io.image import load_img from scilpy.io.utils import get_acq_parameters from scilpy.reconst.mti import adjust_B1_map_intensities, smooth_B1_map, \ proce...
f81b022ed1d46477565436b18df078c4cd7015bf7645b1cb49e1b9a8332840fa
Python
10,074
240
import os.path import unittest import tests.base_test import tests.output_parser as output_parser import tests.test_config import tests.util class Alternative3SpliceSiteNovelBaseTest(tests.base_test.BaseTest): def setUp(self): super().setUp() self._test_base_dir = tests.test_config.TEST_BASE_DIR...
41df148f49e7611dcba3847546b78f34f7e064292c3fdaf83405522fbe87d429
Python
10,075
253
from __future__ import annotations import pandas as pd import csv import gzip import os.path import pickle import datetime from tqdm import tqdm from metaphlan.utils.merge_metaphlan_tables import merge from .utilities import run_cmd, ReadsData, check_conda_qiime2 import json import shutil import tarfile import os impo...
66ac4d14415c89f64979427b9cc7f7b6b91fa7fc805d1f592e86be97655d6b9d
Python
10,076
254
from __future__ import annotations import pandas as pd import csv import gzip import os.path import pickle import datetime from tqdm import tqdm from metaphlan.utils.merge_metaphlan_tables import merge from .utilities import run_cmd, ReadsData, check_conda_qiime2 import json import shutil import tarfile import os impo...