sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
2cf69985c4f6409ddad0112c352639b99a962342a000e3f4aab0668419c39ddd
Python
7,764
241
import numpy as np import pandas as pd import pytest from joblib.externals.loky import get_reusable_executor from skbase.utils.dependencies import _check_soft_dependencies from pgmpy import config from pgmpy.factors import FactorDict from pgmpy.factors.discrete import TabularCPD from pgmpy.models import DiscreteBayesi...
a76fef88c2948f05513c489b75dd508f247af27c4569b6f1fa4cc2e6da13a4ae
Python
7,767
223
#!/usr/bin/env python """Did the store get built with the guarded dictionary, and what came out? **When this was written, nothing in the store recorded which dictionary produced it** — it now records a `token_labels.IndexStamp` — so a run pointed at a stale one trained on precisely the mislabelled targets the guard ex...
aaa5ccf1be1c98b824bb2ba80c9c537f43425070a755ef3d068bb2b8f51b63ec
Python
7,769
173
"""tests for vak.config.prep module""" import copy import pytest import vak.config.prep class TestPrepConfig: @pytest.mark.parametrize( 'config_dict', [ { 'annot_format': 'notmat', 'audio_format': 'cbin', 'data_dir': './tests/data_for_t...
c490a15eb3e45e3f2fb6a17acaac50727ce3245b12af221dd10ab0b05c1c0110
Python
7,771
224
"""`LayerBoundaryStore` reading back what `precompute-embeddings` wrote. The windowed codec's round trip and header layout are pinned in `test_embeddings_store.py`. This file mirrors `test_embeddings_store_reader.py` for this store — refusing a store stamped at another `frozen_layers` or not stamped at all, and turnin...
1b483294eba23721e239119d3af879081c6940a2933282f708594faf984bcbcd
Python
7,780
238
""" Metadata Management for Medical Image Datasets This module provides utilities for creating, loading, and managing metadata for medical image datasets. Metadata tracks study information, modalities, sequences, and processing status. Example Usage: >>> from neurovfm.data.metadata import DatasetMetadata >>> ...
4f4dc77196551d0c94ffa57a5acdfe876ee2e5a55b8469227fe470c0d0de946e
Python
7,782
214
#!/usr/bin/env python # ENCODE DCC bowtie2 wrapper # Author: Jin Lee (leepc12@gmail.com), Daniel Kim import sys import os import re import argparse import multiprocessing from encode_common_genomic import * def parse_arguments(): parser = argparse.ArgumentParser(prog='ENCODE DCC bowtie2 aligner.', ...
8e8c215b9f352a78b685331589a4fdc5e1239d1eb48366ccef54ac09c9477b50
Python
7,785
224
import sys import tempfile import numpy as np import pytest from scvi.data import synthetic_iid from scvi.utils import attrdict # the whole file should only run on macOS pytestmark = pytest.mark.skipif( sys.platform != "darwin", reason="This test file runs only on macOS" ) @pytest.mark.parametrize("n_latent", ...
19c3579273954191288a72c9ce821276654300f22d04162395e91bbcf043d9ea
Python
7,787
146
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'save_image_dialog.ui' # # Created by: PyQt5 UI code generator 5.10.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SaveImageDialog(object): def setupUi(self, SaveImageDialo...
3570da30f49773d2603681f08c33aa37acb4f87d2327d9a6136a2c4b66cc3873
Python
7,790
227
"""SIESTA SZP runner for periodic halide perovskites. Targets ABX3 cubic Pm-3m primitives (5 atoms) and 2x2x2 supercells (40 atoms) with elements in {Cs, K, Pb, Sn, Ge, I, Br, Cl, F}. Pseudopotentials: Pseudo-Dojo NC PBE stringent PSML, located in data/perovskites/pseudos/. Uses Monkhorst-Pack k-mesh sized by cell s...
1ec3c7ab2105c3269a82aa587527c64a82c3ebe98f13a8bad227c18c57e8e808
Python
7,794
186
import os import logging import loompy import numpy as np from scipy.cluster.hierarchy import cut_tree import matplotlib.pyplot as plt from ..plotting.colors import colorize from ..pipeline import Tempname import networkx as nx import community from sknetwork.hierarchy import Paris def calc_cpu(n_cells): n = np.a...
81d0d745ddcdcd9a742abb9e20b9516941b25b100876d35c2b2e49f4a0620024
Python
7,794
206
import matplotlib.pyplot as plt def plot_surf_stat_map(coords, faces, stat_map=None, elev=0, azim=0, cmap='jet', threshold=None, bg_map=None, mask=None, bg_on_stat=False, alpha='auto', vmax=None, symmetric_cbar="auto", returnAx=False, figsize=(14,11), lab...
2bb5ff678ad2300817853a65f7b68e4017059e71b407f691421f65c89fa3a355
Python
7,795
173
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn from utils import * from self_calibration import * from torch.fft import fftshift, ifftshift, ifft2, fft2 from fft_conv_pytorch import fft_conv, FFTConv2d dtype = torch.float32 class forward_model_lsm(nn.Module): def __init__(se...
a44248bd43ebda04d4990977a387b9149b610842517dcfb04d866fd7b08fe3e3
Python
7,796
267
#!/usr/bin/env python # -*- coding: utf-8 -*- """Finds distinct regions""" from time import time from typing import Optional import numpy as np from skimage.segmentation import flood from tqdm import tqdm from utils.decorators import timer_s from utils.models import Region def _loc_to_flat(loc: tuple[int, int], N...
ad3eab3a842941bd5f376899f560a83d91a4c88f518a83578771f577fc9963c0
Python
7,798
173
#!/usr/bin/env python3 """A little tool to shift pisa values in hdf5 files.""" import argparse import numpy as np import numpy.typing as npt import h5py from bpreveal.internal.constants import IMPORTANCE_T, IMPORTANCE_AR_T, PRED_AR_T, PRED_T def shiftPisa(dats: IMPORTANCE_AR_T, offset: int) -> IMPORTANCE_AR_T: ""...
f4869cb217437695d244818e5efd56158036d8c586c2c111f85595b54c47129e
Python
7,800
173
from copy import deepcopy import numpy as np from scvi import REGISTRY_KEYS from . import _constants from .fields import ( CategoricalJointObsField, CategoricalObsField, LabelsWithUnlabeledObsField, LayerField, NumericalJointObsField, ProteinObsmField, ) LEGACY_REGISTRY_KEY_MAP = { "X": ...
52efe4f80c9e7a90e632abaaf1c0b87dfcf4c24fdd867ec6ee7806f3b103656c
Python
7,807
247
""" Tests for Dask configuration functionality. """ import pytest import tempfile import os from pathlib import Path import yaml import time # Add src to path for imports import sys sys.path.insert(0, str(Path(__file__).parent.parent / "src")) from voluseg.dask_config import DaskConfig from voluseg.dask_config impor...
ebeb0af61a7d5a8f5af12c8feae27916f95e7f6620a0a1722d3b60c525f77945
Python
7,808
210
"""Shared Local Preview/STL mesh pipeline with Lite-compatible slice interpolation.""" from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Callable, Iterable, Sequence import numpy as np from mask_postprocessing import signed_distance_for_label SUPPORTE...
27795d027b72b35b853fe252baaea4f1b444c85f9f9ad46ad635f12c0d57614f
Python
7,809
205
from __future__ import annotations from typing import TYPE_CHECKING from typing import Any from typing import ClassVar from cleo.helpers import option from poetry.console.commands.command import Command if TYPE_CHECKING: from pathlib import Path from cleo.io.inputs.option import Option class CheckComman...
32b9736ff01794cdb5526725808134294c4a54ca4f4a89aecaac7c79928040c0
Python
7,809
222
import hashlib import json import os from pathlib import Path import numpy as np import pytest import torch from huggingface_hub import hf_hub_download from transformers import ( AutoModel, AutoModelForMaskedLM, AutoModelForSequenceClassification, AutoTokenizer, ) from gpn import register_auto_classes...
b2046d2b5b6f1431a7af2594e427f8e89bc72d1fc2974b907d22186aa812f4be
Python
7,811
212
import numpy as np import os import glob import xarray as xr import pandas as pd import warnings from .waveform_metrics import calculate_waveform_metrics from ...common.epoch import Epoch from ...common.utils import printProgressBar def extract_waveforms(raw_data, spike_times, ...
64ae24c63c09a909482754bf2d2a4d9029901da7d14cb462f0225352e3446bd1
Python
7,821
207
import os import sys from argparse import ArgumentParser from getpass import getpass from typing import List, Union from requests.exceptions import HTTPError from transformers.commands import BaseTransformersCLICommand from transformers.hf_api import HfApi, HfFolder UPLOAD_MAX_FILES = 15 class UserCommands(BaseTran...
20640751070ef8680fa211704d822c9e321eb05edad230d425e69a77be887dbc
Python
7,823
199
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import hashlib import logging import math import numpy as np from fairseq.data import SampledMultiDataset from .sampled_multi_dataset impor...
4ee6b7277d8c86344c058dd78577428e7a6f9a4499cf823da796ac7c5066b5c8
Python
7,823
209
import os import sys from argparse import ArgumentParser from getpass import getpass from typing import List, Union from requests.exceptions import HTTPError from transformers.commands import BaseTransformersCLICommand from transformers.hf_api import HfApi, HfFolder UPLOAD_MAX_FILES = 15 class UserCommands(BaseTr...
adf286b5c6f9a907454d146508a1c22a5e33043a7dbc8c84c387ce54653a353d
Python
7,824
194
#!/usr/bin/env python3 """Scans for motifs given importance scores. This program scans over the contribution scores you calculated with :py:mod:`interpretFlat<bpreveal.interpretFlat>` and looks for matches to motifs called by modiscolite. It can be run with a quantile JSON from :py:mod:`motifSeqletCutoffs<bpreveal.mot...
409e56b7b363929fded0f7788f42f0018f33e1b32af319931bac890f73247a2e
Python
7,828
191
"""Command-line script to print a GO term's lower-level hierarchy. Usage: goatools wr_hier [GO ...] [options] Options: -h --help show this help message and exit -i <gofile.txt> Read a file name containing a list of GO IDs -o <outfile> Output file in ASCII text format -f Writes resul...
501d114fa6afd0aab1a538462c05dce4fb2c244972a651ffa14742d0a4c403b4
Python
7,828
198
class CounterbalancedStratifiedSplitRandom(object): def __init__(self, X, y, c, n_splits=5, c_type='categorical', metric='corr', use_pval=False, threshold=0.05, verbose=False): self.X = X self.y = y self.c = c self.z = None self.n_splits = n_splits ...
9de0217583d0e906ca58722e3f7f8fbae0e2c87e88478626850ac50684622e1c
Python
7,829
211
"""Deliberately refresh the committed outputs of the three demos.""" from __future__ import annotations import argparse import ast import json import os import re from pathlib import Path import nbformat from nbclient import NotebookClient from docs.prepare_notebooks import MODEL_DEMOS, NOTEBOOKS, REPOSITORY_ROOT, ...
1d8ae6480d0bd9dd1b22ec79d631cde0a95f5fdefefbd0cd8ca93ad156f186a3
Python
7,832
214
""" Shared drawing helpers for BEELINE heatmap plotters. Provides the cell-drawing primitive (_flat_square), the section renderer (_draw_section), and the axis-setup utility (_setup_heatmap_axes) used by both PlotSummaryHeatmap and PlotEPRHeatmap. """ import math from typing import List import matplotlib.patches as p...
cfa0fcb14701299ab2cefbac3f49b31fe190ffcdd852ff8c92553b01ccbc6d4d
Python
7,832
206
# Load required packages import os import sys import pandas as pd import json from absl import flags from absl import app from glob import glob import subprocess from anarci import anarci from scripts import seq_utils,pdb_utils,tcr_utils,parse_tcr_seq # input flags.DEFINE_string('output_dir', "experiments/", 'Path t...
6e62b1bc176c30c26c630d5753c11ed86a7e40e3a6807e909782f448942d07f1
Python
7,835
200
import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from matplotlib.widgets import Slider from scipy.stats import norm import matplotlib.mlab as mlab import numpy as np __author__ = 'Robbert Harms' __date__ = "2016-09-02" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class Sampl...
1acae956fd367baed7664b1b86874568163c3abf7b61a131c6ec83a3f1aace6b
Python
7,836
173
# This function written by Kimberly Siletti and is based on doubletFinder.R as forwarded by the Allen Institute: # # "Doublet detection in single-cell RNA sequencing data # # This function generates artificial nearest neighbors from existing single-cell RNA # sequencing data. First, real and artificial data are merged....
606c35ad8e3e5970322ceb49f91f3873bd67141c03f6543525935da50ab7a594
Python
7,837
187
#!/usr/bin/env python3 """Encode A1, S1, and CellExplorer cells into the 16-D HIPPIE latent space for cross-technology latent-space flow visualisation. Label normalisation maps each dataset's native labels to canonical cell-type names: A1 (a1data_remove_undef): PV → Parvalbumin, SOM → Somatostatin, EXC → Ex...
180b7ddb7b565027fe2960709a6654808e385cf58e3c943b8704f1e88a40fcb7
Python
7,841
185
from DataSynthesizer.DataDescriber import DataDescriber from DataSynthesizer.DataGenerator import DataGenerator from DataSynthesizer.ModelInspector import ModelInspector from DataSynthesizer.lib.utils import read_json_file, display_bayesian_network import pandas as pd import matplotlib.pyplot as plt from tqdm import ...
442f145d4b1871f2a01e105a0092bf8f7efb01c086d7030be177f265d0c96fc7
Python
7,841
252
# train_c1.py # Standalone LKIS-style training for C1: # - loads all ses*_task-*_pairs.npz from DATA_DIR # - trains one model per (session, task) NPZ # - saves outputs per system under OUT_ROOT/<npz_base>/ # # Requires: numpy, torch # Your conda env already imports torch OK. import os, glob, json, time ...
a4ca12787a5a59554162a5b0d4ad8381266dc9d5f203177f800e344fcaba73b9
Python
7,841
172
import os import time import torch import argparse import numpy as np from src.ernie_rna.tasks.ernie_rna import * from src.ernie_rna.models.ernie_rna import * from src.ernie_rna.criterions.ernie_rna import * from src.utils import ErnieRNAOnestage, read_text_file, load_pretrained_ernierna, prepare_input_for_ernierna ...
0b14e9a9acebeae402e42a7cefe68a64c301684d1e9bbb8f290c6574106a6117
Python
7,846
155
"""Run notebook orchestration with real ZIP/geometry/backend I/O and synthetic masks. Colab file UI, installation/network calls, and TotalSegmentator inference are mocked. This checks cell ordering and file preservation, not real GPU/model execution. """ import io import json from pathlib import Path import subprocess...
ad77aa56913997d59b4d73d515b577822810939267fa5a805e947cfacb02d7cb
Python
7,851
152
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'UI/SensorsWindow.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 import QtC...
626fe0a542908af1ad5d49ad09052d5bcad68a2d6f48dbebf2d3fcffd9ea15d8
Python
7,855
224
import os import zarr import numpy as np import tskit import yaml import ray import argparse parser = argparse.ArgumentParser("Plot posteriors after rescaling parameters by fitting theta analytically") parser.add_argument("--configfile", type=str, help="Path to config file", default="npe-config/DroMel_CO_FR_rnn.yaml")...
f9b7f13f7c161799d9e5ce2896ed56f15d522521b21feb8e98d8f91009f6be96
Python
7,855
182
import os import tempfile import torch class ModelCheckpoint(object): """ ModelCheckpoint handler can be used to periodically save objects to disk. This handler expects two arguments: - an :class:`~ignite.engine.Engine` object - a `dict` mapping names (`str`) to objects that should be saved...
b3cf9c2c55b5d781c22a1d8fa83574f3b33d5865450ae3e74b0a59c6a04250c0
Python
7,863
211
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import copy import logging from typing import Dict, List import numpy as np import torch import torch.nn as nn import torch.nn.functional as ...
f512b38dc7e7300ae83022808aab5e9673eda36ddcb9d09fd8709d5b105ca0f0
Python
7,866
246
import argparse import h5py import nibabel.freesurfer.mghformat as mgh import numpy as np from spacestream.core.constants import SUBJECTS from spacestream.core.paths import BETA_PATH, DATA_PATH, RESULTS_PATH from spacestream.utils.get_utils import get_indices from spacestream.utils.mapping_utils import traditional_ma...
de2c6e03ae2259c5f71aba726da58e70d87cec365d6f562576a8dc1b0801b782
Python
7,871
229
import argparse import os import random import time from copy import deepcopy import h5py import numpy as np import torch import torch.nn as nn import torch.optim as optim from torchdiffeq import odeint from torch.utils.data import Dataset, DataLoader learning_rate = 0.001 num_epochs = 500 device = torch.device("cpu...
f2ebdf6452a47a846ca393900dea3e2fd4f77c399c561b5952af16a01c934f51
Python
7,871
296
import os import torch import torch.nn as nn import numpy as np from tqdm import tqdm from torch_geometric.loader import DataLoader from sklearn.metrics import mean_absolute_error, mean_squared_error from sklearn.model_selection import KFold from scipy.stats import pearsonr from model import GeometryAwareGNN class P...
f92a98c1e8e2fe19f538dd14b758f0708ad3f27bd08a89f2f0330364c1db502a
Python
7,874
209
# Copyright (C) 2025 ETH Zurich, Moritz Thürlemann, and other AMP contributors import argparse import yaml from Simulator_calibration import (ForcefieldBuilder, SimulationBuilder, AmpConfigurator, SystemBuilder, PDBReader) import openmm as mm from openmm.unit import * from openmm.app import ForceField from openff.tool...
86040d3692a833881e191d51e00194bd7a23b79446ae1b9204c4448154b2f203
Python
7,878
184
import numpy as np import pandas as pd import pytest from pgmpy.base import PDAG from pgmpy.causal_discovery import ExpertKnowledge class TestExpertKnowledge: def test_repr_and_str_empty(self): ek = ExpertKnowledge() assert repr(ek) == ( "Expert Knowledge: 0 required edges, 0 forbidde...
cfde4633e1f2125f796c6b922a9f0f3c272f651bdf1b1782c2d6c83ea0e530ee
Python
7,879
191
import os import sys import json import logging import argparse import numpy as np import pandas as pd from tqdm import tqdm import torch.nn as nn from torch.optim import AdamW from datasets import load_dataset from pooling import PoolingWithDropout from torch.utils.data import DataLoader from dataset import CreateFine...
6407d32e16bec7e2361f21820b9ed4f4280cbccf67ad94611353e9733bc7f017
Python
7,880
243
#!/usr/bin/env python # Author_and_contribution: Niklas Mueller-Boetticher; created template # Author_and_contribution: Zaira Seferbekova; wrote the code for SOTIP import argparse # TODO adjust description parser = argparse.ArgumentParser(description="Method ...") parser.add_argument( "-c", "--coordinates", hel...
1b941b6b5e1ab22cb16e7403cc98cb7cdffaa41bcca7352d14dd2e6d37d08805
Python
7,885
200
# _*_ coding: UTF-8 _*_ # Version information START -------------------------------------------------- VERSION_INFO = \ """ Author: ZHANG YUBO Version-01: 2020-01 Post-processing and visualization of the ERICA results Version-02: 2020-08 Processing both four-taxon and five-taxon resu...
6b895e045ee6d6eae426cec656a95ffe344ff7bd1e7ce31a80c26090ae1d31ed
Python
7,886
230
"""PyTorch RNN/LSTM models for full latent trajectory prediction and sequence classification.""" from abc import ABC, abstractmethod from collections.abc import Callable import torch import torch.nn as nn import torch.optim as optim from latent_model.loaders.sequence_loader import SequenceLoader class TemporalMode...
ce0c423d2a0b629bfcff7e2de3a988507aa176b67777ed0617ea9bc62cb7e8b3
Python
7,886
210
"""Raw sheet helpers for telemetry workbook exports.""" from __future__ import annotations import logging import pandas as pd logger = logging.getLogger(__name__) def populate_raw_data_sheet(exporter, writer, sheet_name, cluster_number): cluster_data = exporter.app.mean_cluster_data.get(cluster_number) wo...
06a48308c7189a5ab3f0418b57522e121fd3709c7bf5f133b24c0a19a0a64809
Python
7,890
201
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import itertools import numpy as ...
728089f951ee7f15b1efc856fe8980ae63711927641c2e352202c6857e84e317
Python
7,890
213
""" Area Clustering Module. This module provides functionality for clustering chromatophores based on their area time series and for visualizing the resulting clusters. The clustering is performed by computing a correlation matrix between chromatophore time series and then applying a clustering algorithm (e.g., Affini...
4a218e22164be7ac3c6fb47295512b850b4b39b2b7bc807be4df617a9f5de1dd
Python
7,893
264
from fairseq import tasks import numpy as np import logging import random from fairseq import options import torch import os import soundfile as sf from fairseq.data.audio.audio_utils import ( get_waveform, parse_path, ) logging.basicConfig() logging.root.setLevel(logging.INFO) logging.basicConfig(level=loggi...
f0e487761d0fd1f42a4518e7355f96af2add5c68c5e91d28fda839c5d6407afe
Python
7,894
138
import shutil from typing import List, Type, Optional, Tuple, Union import nnunetv2 from batchgenerators.utilities.file_and_folder_operations import join, maybe_mkdir_p, subfiles, load_json from nnunetv2.experiment_planning.dataset_fingerprint.fingerprint_extractor import DatasetFingerprintExtractor from nnunetv2.exp...
d4ed3844951360ec35ef7c0d5f95c526248d73198a5b816bcebafa9c5ae36347
Python
7,895
183
import numpy as np import scipy.sparse as sp import sys def AMI_Stergiou(data, L, to_matlab = False, n_bins = 0): """ inputs - data, column oriented time series - L, maximal lag to which AMI will be calculated - bins, number of bins to use in the calculation, if empty an ...
77a2f00374a847b0291d334ea21a3af4983f28a563051ded16fe68575f21d1dc
Python
7,897
147
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'UI/CorrRandomFrequency2UI.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): For...
b6b147c7834f9da5c5d0e29c5983b5039dfd4462803adcd47fa5999bb71e3cc4
Python
7,902
192
"""Engine-agnostic parallel batch wrapper for energy engines. Maps any `(atoms, **kw) → (E_eV, atoms_opt)` callable over a list of Atoms in parallel. Originally written for `oce.xtb_runner.xtb_energy`; now also used for `oce_carbon.runners.dftbplus.dftbplus_energy`. Both engines (xtb / DFTB+) are CPU-bound subproces...
f778dfbf89c06c8417d1e33c854a1f963f8e8fa5be430959e2a4465c34e65a34
Python
7,902
190
import collections import numpy as np import PIL.Image as Image import PIL.ImageColor as ImageColor import PIL.ImageDraw as ImageDraw import PIL.ImageFont as ImageFont _TITLE_LEFT_MARGIN = 10 _TITLE_TOP_MARGIN = 10 STANDARD_COLORS = [ 'AliceBlue', 'Chartreuse', 'Aqua', 'Aquamarine', 'Azure', 'Beige', 'Bisque', 'Bl...
4d6ff7809b30c61e52c0ff928222b0f2f796bd058e9e18b33022a75a2409a2e5
Python
7,907
235
import json import unittest from unittest.mock import patch from pyecharts import options as opts from pyecharts.charts import Scatter, Grid from pyecharts.commons.utils import JsCode from pyecharts.faker import Faker class TestScatterChart(unittest.TestCase): @patch("pyecharts.render.engine.write_utf8_html_file...
65d5fcc70963a8a995d9fe7c362619425c405e122213aa4a67369c49d245a2bd
Python
7,908
270
from __future__ import annotations import json import re import shutil import subprocess import sys from typing import TYPE_CHECKING from typing import ClassVar from typing import cast import pytest from cleo.testers.application_tester import ApplicationTester from poetry.console.application import Application fro...
983b3e25d110eb8e9f87825531866720201a5ade07bc3b83f1111c3f986cad5e
Python
7,912
212
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn.modules.module import Module from torch_geometric.nn import GCNConv class AttentionMechanism(nn.Module): """ Implements an attention mechanism to compute attention scores over input embedding...
1dd464354acab96a99842bc9d062d317d56933492d1a02f076e8dd27a4dec6a6
Python
7,913
226
"""enzymeNER: PMC sentences whose enzyme mentions are marked but not named. The unit is the sentence, not the document, and the offsets are **half-open** — the opposite convention from S800, so the `+ 1` that corpus needs is a one-character error here. Three of the 2,274 rows address neither reading and are dropped ra...
267379003f49c3a19e358fc4022b2800a6ab0c3825dd7c516de552d9235b7e7c
Python
7,913
256
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from functools import partial from dataclasses import da...
f750c70c0808d3d1f1d4bff09b56f0dd19ee3cc8084a1b7478b7d93427f04a56
Python
7,913
223
""" Diagnostic Head Pipeline for NeuroVFM Loads trained diagnostic head (pooler + classifier) for multi-label classification. """ import torch import torch.nn as nn from typing import Dict, List, Optional, Tuple from pathlib import Path import logging from importlib.resources import files from neurovfm.models import...
5ea0c20f18c8cf81a1d59db582991985bce0a43e6a1b52e2a20482a614b7fd4a
Python
7,916
175
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
731670d88ad23f06354d7e6c662308bcaa79620b5c52d24435bebd1879ff5c11
Python
7,918
177
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
2c3acc76a215a9e15d34405fc44559f2c32e67da28317e0915f68bc76b497600
Python
7,919
193
import json import logging import pandas as pd import multiprocessing import requests from tqdm import tqdm from pathlib import Path from typing import Dict, Optional, List from src.data.manager import DatasetManager logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) class InterProManager(Data...
8e868260693717a9c728fe94660c9509d8dbadbc27864bab6198c39ea247966f
Python
7,920
214
import torch import torch.nn.functional as F from torch.utils.data import Dataset import numpy as np import random from typing import Dict, Any, Optional from scipy import ndimage class NeuralAugmentations: """Data augmentation methods for 1D neural electrophysiology signals.""" @staticmethod def add...
4760bdb6981a79a5cb4604481137983929a83277107ee1b4abbc4619c3a9e2c3
Python
7,921
157
"""Upload-first InferRef3D flow without Colab, network or GPU dependencies.""" import contextlib import io import json from pathlib import Path import sys import tempfile import types import unittest from unittest.mock import Mock, patch import zipfile NOTEBOOK = Path(__file__).resolve().parents[1] / "InferRef3D_v1_0....
0fab1653de516e8af9603fc86256221fbda916da118c6fe2169a05fe9a1ab238
Python
7,922
183
"""Phase 2 smoke — xtb optimisation + OCE on relaxed structures (L ≤ 6). Workflow: 1. Resample percolation clusters at p_c (small L). 2. Run xtb single-point at the AS-BUILT lattice geometry → E_xtb_sp. 3. Run xtb optimisation → E_xtb_relaxed. 4. Compare ΔE_relax = E_xtb_sp − E_xtb_...
2a3001b4e6867c60ca3e14824bc1384b8f88eebabbb5dee5caa3d2a6a421b6af
Python
7,923
215
import json import os import shutil import tempfile import unittest from unittest.mock import MagicMock from simulation_encoder.writer import Writer from simulation_encoder.dataclass.loss_data import LossData def _make_mock_dataset(name="ds1"): dataset = MagicMock() dataset.name = name dataset.channels =...
3b6f50eecfa42ec0c010a0cf2af26ec5b936f157eea940e32b02f3457d29fbe7
Python
7,927
188
from pathlib import Path from typing import Dict, Iterator, List import pandas as pd class RunResult: """ Predicted networks and ground truth reference for a single run. ranked_edges maps algorithm name to its ranked edge list DataFrame (columns: Gene1, Gene2, EdgeWeight). Algorithms whose rankedEdg...
2a8a9a425c1cbbb6e5a03819b8c71abe71828e6fffa0343366475ccd7b5d766c
Python
7,929
232
"""Supplemental Figure 3 — ISI+ACG dataset profiles. Two datasets: DANDI_000473 (Neuropixels mouse PFC, n=9213) and DANDI_000955 (mouse cortex, n=134). Both have waveforms.csv, isi_dist.csv, acg.csv, labels.csv under results/benchmark/cache_datasets/. Emits a 2-row panel per dataset: Row 0: mean waveform, mean IS...
194af18ff34ac30a4481a02f912eb686c542d59dacd279f62b322d5430e84e64
Python
7,933
163
#! /usr/bin/env python import metax import sys __version__ = "1.0x" + metax.__version__ import logging import re import os from metax import Logging from metax import Exceptions from metax import Utilities from metax.gwas import Utilities as GWASUtilities import SPrediXcan __author__ = 'heroico, Eric Torstenson' ""...
d1fb5a09967241939b9be6debcd26c2ba160137daa8efb03ed6798e30c91683c
Python
7,935
205
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 27 12:10:16 2024 @author: tower2 """ import torch from tqdm import tqdm import matplotlib.pyplot as plt from torch_geometric.utils import dense_to_sparse from .Semantic_layers import * from .preprocess import preprocess_adj # Define loss and optimi...
1f389b4f6fb26c6e166d327c352f5ad890cb500800d4f27b8e12d698c214b9ec
Python
7,936
171
import slicer import ctk import qt import numpy as np import vtk import StereotacticPlan class CustomCoordinatesWidget(ctk.ctkCoordinatesWidget): def __init__(self, name): super().__init__() self.name = name self._updatingCoordinatesFromMarkups = False self._updatingMarkupsFromCoor...
9ab170240bc2cf88208e1ecd7b4a15e6226f213fff4b32bd4b807ead095e48fd
Python
7,941
205
import os from pathlib import Path from tqdm import tqdm import numpy as np import shutil import zarr from numcodecs import Blosc #set this for multiple processing Blosc.use_threads = False #distributed processing of masks import dask from dask.distributed import Client from WSIAnnotation import load_annot #slicin...
3e4e9c94209ae5e4641c2d488c4e2b9d58792a4e7daf97a9a287c62b68b7e674
Python
7,943
258
# inspired by https://github.com/nathankong/robustness_primary_visual_cortex/blob/master/robust_spectrum/robustness_eval/imagenet_robustness.py import argparse import os import pickle import eagerpy as ep import torch import torch.nn as nn import torchvision from foolbox import PyTorchModel, accuracy from foolbox.atta...
29cf04a436a3dadbd129a68df4dbde4e809b197c632c5eafb2efbec093ed0d02
Python
7,945
231
import unittest import pickle from pathlib import Path from tempfile import TemporaryDirectory from types import SimpleNamespace from unittest.mock import MagicMock, patch import numpy as np from GMXMMPBSA import output_file from GMXMMPBSA.utils import EnergyVector class _Value: def __array__(self, dtype=None):...
4e58a0d5900d13e7d415c905eae6281721c4b69816a0dcb465c5b8fef10b6aa8
Python
7,945
243
#!/usr/bin/env python # Author_and_contribution: Niklas Mueller-Boetticher; created template # Author_and_contribution: Jieran Sun; Implemented method DeepST import argparse # description parser = argparse.ArgumentParser(description="Method DeepST: identifying spatial domains in spatial transcriptomics by deep learn...
18f89123dda81423a281850dd487a934066a20aaf46b69a39bc6c9a738da670a
Python
7,947
204
import warnings warnings.filterwarnings('ignore') from typing import Callable, Tuple, Union import math import torch from torch import Tensor import torch.nn as nn import torch_geometric.nn as gnn import torch.nn.functional as F from torch_geometric.nn.conv import MessagePassing from torch_geometric.nn.dense.linear im...
48515bc5b63e27c0f71388fe2ea47296494a7e487efc075867567bab9734b293
Python
7,949
217
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn.modules.module import Module from torch_geometric.nn import GCNConv class AttentionMechanism(nn.Module): """ Implements an attention mechanism to compute attention scores over input embedding...
a8be65016a41d40ba917d2946b7bfa2a4e4626efb6b532e4a245ae107665f65d
Python
7,949
213
## script for plotting boxplots and scatter plots of simple stats such as count of approaches, count of interactions, chasings etc... import matplotlib.pyplot as plt import numpy as np import igraph as ig import networkx as nx import pandas as pd import os import sys import pandas as pd import seaborn as sns from scip...
ab810ad89c86cb6355b39f27ed0c9566017b993bcfd19d39b68cff569fe00279
Python
7,949
178
#!/usr/bin/env python3 # Florian Bénitière 16/03/2025 # This script generates a, unfiltered annotated .parquet file by integrating variant effect predictor (VEP) annotations, # including all specified VEP plugins, and linking them to individual identifiers (SampleID). import os import sys import pandas as pd import ...
3425b2e57b3a39d2538b5a99af51efcb0db517023caf60d9eddc8b2eff608fb1
Python
7,951
203
# Copyright (C) 2025 ETH Zurich, Moritz Thürlemann, and other AMP contributors import os import json import csv import pickle import numpy as np import matplotlib.pyplot as plt from amp_bms.source.examples.examples_scripts.run_stable_protein_md import EXAMPLES_DIR, HERE from pymbar import MBAR, timeseries from tqdm i...
2fec2b134e4656c0a8f1151b787735b0b226bd84aa5e3a12250faebd3a00720a
Python
7,952
214
#!/usr/bin/env python # Author_and_contribution: Niklas Mueller-Boetticher; created template # Author_and_contribution: Brian Long; wrote code in file import argparse from pathlib import Path import json import numpy as np import pandas as pd import anndata as ad from scipy.io import mmwrite import tempfile import b...
38ed495e23aefdff4c2cd334c0f93813e073ad51dbea8c8f56e4fda313964742
Python
7,952
187
import torch import torch.optim as optim from torch.utils.data import DataLoader from dataloader.dataset import HTPDataset from training.train import train_model from training.test import test_model from visualize.plot_training import plot_logs from training import evaluation_metrics from utils.stats import get_max_mem...
7a1ae1d9c15a9de0b0cd43df58e6fd9ba783543b55d9aa29ecfbbcf2d8fc59ee
Python
7,955
147
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'UI/CorrOnsetDisruptUI.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): Form.se...
aaac06cb41f14d14fca94c4003e2796f7088cb2496cc8e3f3f7f05707d590f92
Python
7,957
210
scvi_pretext = """ ScVI is a variational inference model for single-cell RNA-seq data that can learn an underlying latent space, integrate technical batches and impute dropouts. The learned low-dimensional latent representation of the data can be used for visualization and clustering. scVI takes as input a scRNA-seq g...
cbe1298b42b21277133cf1479bfc68680c380c0e7bece722c2889e2e105779e4
Python
7,958
175
"""Cross-language equivalence: python/ must agree with matlab/. The Python directory is a PORT. Two implementations of one documented method are two chances to be wrong, and a port that has drifted is the worst case because both sides look maintained and neither is obviously the reference. Method: both languages read...
3eb95e55f68257b07315ff5843aed635da3585513690205a52d86388a29d92a8
Python
7,961
179
import torch import os from transformers import BertTokenizer, BertConfig, RobertaTokenizer, RobertaConfig from sample import Categorical from tqdm import tqdm import argparse from models.modeling_bert import BertForMaskedLM import diffusion_condition as diffusion import functools from torch.nn.utils.rnn import pad_seq...
9bb2bc5a3e412876bab62603387f7e51eda938808b9cfb3b92fd1180a3bc279e
Python
7,963
223
# Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
fcc107078b992bf6055a19e8ad222c549d37c101dac0e07dceb438f49bb397cc
Python
7,972
145
#!/usr/bin/env python3 """RNA-seq harmonization v3 — robust per-dataset gene-ID -> symbol + metadata-based MS/HC. Loads the 9 RNA-seq series from DEPOSITED supplementary files; assigns condition from series_matrix metadata where sample codes don't encode it.""" import os, re, gzip, io, tarfile import pandas as pd, nump...
270787a347c61e827bb83e67e42237b85f1972fcc32e3481ae25b074a1ab5997
Python
7,976
158
# -*- coding: utf-8 -*- """ Pipeline: STRING protein-protein interaction analysis for the EIF2S1-PELO panel Author: Drake H. Harbert (D.H.H.) Affiliation: Inner Architecture LLC, Canton, OH ORCID: 0009-0007-7740-3616 Date: 2026-06-30 Description: Queries the STRING database (v12, Homo sapiens) REST API for the EIF2...
fb1b6dd98207b1a75d33e01826e06deba05c3d157e42b7fea3d6d5ff265a91bb
Python
7,976
205
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from functools import partial from typing import Dict, List, Type import pytest import torch from mattergen.diffusion.corruption.corruption import Corruption from mattergen.diffusion.corruption.multi_corruption import MultiCorruption, apply fro...
2b832cddda498b45786ba5be48125e9dd1d774865bd0569c6613aed67f086553
Python
7,979
247
from lifelines.utils import concordance_index import numpy as np from sklearn.model_selection import StratifiedKFold from sklearn.preprocessing import StandardScaler from keras.models import Sequential from keras.layers import Dense from keras.regularizers import l2 #from keras.optimizers import adam_v2 from keras.opti...
3beef2352356da5ae1a7b34c7847664eb8062c641bc712ef94c9c5223fe129b8
Python
7,983
210
"""xtb GFN2 single-points for Δ-learning on perovskites. Two passes: (1) atomic references for {Cs, K, Pb, Sn, Ge, I, Br, Cl, F} (vacuum, --uhf as needed) (2) GFN2 single-point on each of 243 labeled supercells (periodic via --periodic) Output: data/perovskites/delta_learning/xtb_gfn2_results.json """ from __fut...
8074e4e537f06769a587093a0a7271e1704d81f733e0df2d5ad83f9cbad58f7c
Python
7,983
234
import argparse import os import subprocess import tempfile import time import Bio.PDB import Bio.PDB.Polypeptide import Bio.SeqIO import pdbfixer import simtk import simtk.openmm import simtk.openmm.app PDBIO = Bio.PDB.PDBIO() PDB_PARSER = Bio.PDB.PDBParser(PERMISSIVE=0) class NonHetSelector(Bio.PDB.Select): "...
652828d0ccf0d13482ef108b2ced54200d380227b7c6262caa3be0caa9a6f288
Python
7,985
147
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'UI/CorrDifficultySwitchCameraTriggerUI.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form)...
8da7fcc9aa466a6df788f02bc9f8a194e5291f762def5720354648f22bbd16a7
Python
7,985
246
import pandas as pd import numpy as np import cv2 from collections import Counter import json import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from mpl_toolkits.axes_grid1 import make_axes_locatable import os from helper_functions_image import create_heatmap_count, parse_det_file, transform_...