sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a199f4a163604d71fb0397a86187d648d01a2add5000692687f98de54abdec05
Python
17,507
380
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/hyperclovax_vision_v2/modular_hyperclovax_vision_v2.py. # Do NOT edit this file manually as any edits will be ove...
bed2014c7f170200bf92bcab3e2374340a5d9dc2cd9e0188a06e73527489a56b
Python
17,512
384
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/fast_vlm/modular_fast_vlm.py. # Do NOT edit this file manually as any edits will be overwritten by the generation...
1457a42a189c0fa409c94aac6723d10e26bbb24bdc99d6a5274342f6e6578eba
Python
17,516
503
import os import sys import struct import math import matplotlib.pyplot as plt import numpy as np import random import pandas as pd import seaborn as sns from sklearn.linear_model import Lasso, LassoCV from sklearn.model_selection import train_test_split from sklearn.utils import parallel_backend from vtk import vtkX...
a8a9f41f9a91bdd71e6eec80eefafb01c048c887ad5919f7faae968d5b7c27f3
Python
17,524
445
""" Build annotation_viewer.html for round 3 with inlined base64 images. """ import json, base64 import pandas as pd from pathlib import Path BASE = Path(__file__).resolve().parent.parent R3_DIR = BASE / 'data' / '_archive' / 'pd_round3' IMG_DIR = R3_DIR / 'images' def main(): manifest = pd.read_csv(R3_DIR / 'ma...
acd1905bf0b583f2dbf9fe04827242d107763aeae5545d5d4fb41fe285ecbc40
Python
17,547
461
# harmonypy - A data alignment algorithm. # Copyright (C) 2018 Ilya Korsunsky # 2019 Kamil Slowikowski <kslowikowski@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ...
737bf23291969e9a81208c86d27a6c4d9280720b3a439b9f2027a54f31b2461b
Python
17,548
517
# repo originally forked from https://github.com/Confusezius/Deep-Metric-Learning-Baselines ##################################### LIBRARIES ########################################### import warnings warnings.filterwarnings("ignore") import csv import pickle as pkl import time import auxiliaries as aux import matp...
d6436c80f602a2ac3799b3ac1d36ed06a7cbcb49f0800b7b0193278e3bacdf43
Python
17,552
641
# Use python 3.5 or higher # obsolete: conda install -c auto cbor=0.1.4 from __future__ import print_function import cbor import itertools import typing PageId = str PageName = str class Page(object): """ The name and skeleton of a Wikipedia page. .. attribute:: page_name :rtype: PageName ...
a90ece1916b8e6370626d6a114e942da371adece20bc0dea80e0595f46012261
Python
17,568
425
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/glm5_next/modular_glm5_next.py. # Do NOT edit this file manually as any edits will be overwritten by the generati...
1b40e150eca244e11d86cecd24b50eb4086ff219fefab5a07d608042d6ca7498
Python
17,599
533
# repo originally forked from https://github.com/Confusezius/Deep-Metric-Learning-Baselines """to do: clean all of the files - particularly the main.py and also the losses and dataset files and the file for doing the dataloading -- fast loading etc need to change all of the copyrights at the top of all of the files...
c4f8a005dd7bcb725fd88e0a9a7641ec2170024b1165678d32e47c78e8f2746f
Python
17,599
475
""" =========================== Visuospatial working memory =========================== """ from bci_framework.extensions.stimuli_delivery import StimuliAPI from bci_framework.extensions.stimuli_delivery.utils import keypress from bci_framework.extensions.stimuli_delivery.utils import Widgets as w from bci_framework....
55cfffcd563fa7fe2a41866b89cc2743812db0420c4bb83a93f4f692649b0cc8
Python
17,606
573
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 import json from pathlib import Path from typing import Any, cast import numpy as np import pyscf.gto import pyscf.lib import pyscf.scf import pytest from click.testing import CliRunner from jax import numpy as jnp from up...
859a1e00b619ec77c0dc182e8fbe15c6659ad021e3e75f80a6400fa04844a957
Python
17,606
525
""" ============= Binary to EEG ============= A transformer for Kafka that reads binary data and stream EEG data. Binary -> Kafka-Transformer -> EEG For examples and descriptions refers to documentation: `Data storage handler <../A1-raw_cleaning.ipynb>`_ """ import sys import pickle import struct from functools imp...
501f2eb4bae19f3a3f546d43c1db69e8b50d2f0702c8ec433bbc0cc8ce7b3e22
Python
17,610
482
""" This script demonstrates node classification with GraphSAGE on large graphs, merging GraphBolt (GB) and PyTorch Geometric (PyG). GraphBolt efficiently manages data loading for large datasets, crucial for mini-batch processing. Post data loading, PyG's user-friendly framework takes over for training, showcasing s...
3db00790735894ebf8268752de0126842cf011757037dece68a01ba7db27c29d
Python
17,620
600
def distance_to_adult( adata_adult, adata_embryo, top_genes, title_self, title_other, category_adult="our_groups", category_embryo="leiden", scale=1, ylim=[-5, 30], color_adult=["#D61B1A", "#F9C061", "#E4007F"], color_embryo=["#00FF00", "#FF5500", "#0000FF"], ): groups = ...
8bd947a75dfe5ade0c2905146cb80cb92a9da547e052ef1ff22aa4cf5516049f
Python
17,629
481
""" T4: Spike-based frequency estimation experiments. Tests a spike-interval frequency approach for low-frequency PDs where FFT/Ridge fail due to only 2-5 discharges in a 10-second window. Experiments: t4_spike_only - f_spike standalone t4_ridge_with_spike_a5 - Ridge(9 feats + f_spike), alpha=5 t4_ri...
8d96022e810cb39316c7d147f725b54f3cb4c498cd2cd3a60dab7765c023583c
Python
17,646
549
"""Functions for IO of Triangle Meshes. Should be called via the TriaMesh member functions. """ import logging from typing import TYPE_CHECKING import numpy as np if TYPE_CHECKING: from .tria_mesh import TriaMesh logger = logging.getLogger(__name__) def read_fssurf(filename: str) -> "TriaMesh": """Load tr...
ef5dfc6077c3b6d87b580cbe5b95527ecc1453fed4fccd132e00fcb89a325af7
Python
17,647
461
""" Improvement #3: Iterative frequency refinement. After initial detection with CNN frequency, compute IPI from detected discharges, use that as a refined frequency estimate, and re-run the DP. Also tests combining CNN freq with ACF freq for a better initial estimate. Usage: conda run -n foe_dl python code/cet_...
c9e03022fdddfb01c91226254f7dc618aa275f349bdfad91b6cd5909ac2b2025
Python
17,650
450
""" Round 4 Combiner: Type-specific approaches + matched-filter envelope FFT + ML. Combinations tested: 1. r4_type_specific_best: LPD=ACF+peakcount+Bayesian, GPD=FFT_pointiness+peakcount 2. r4_type_specific_v2: LPD=matched-filter envelope FFT, GPD=FFT+peakcount 3. r4_type_specific_v3: LPD=median(envelope_fft, ac...
22d273c827ab73e027a5e89ca89249065584da19844873a2459b9cca3186077d
Python
17,651
519
""" Auto-label RDA wave peaks using bandpass filtering + peak detection. For each of the 549 RDA cases with expert-verified frequency annotations: 1. Load 18-channel bipolar EEG segment 2. Bandpass filter around the known frequency (f ± bandwidth) 3. Average filtered signal across involved channels per hemispher...
f998946e4418779102891b9dd0c730d8d686e095e94638beb2b454248b14b240
Python
17,673
438
""" ================================================ :mod:`replacers` -- Survivor replacement methods ================================================ This module provides pre-defined replacers for evolutionary computations. All replacer functions have the following arguments: - *...
121af33044b9abb3ff5bb1d57558c9abf8cff5370fdb13ca8d800045e18ca484
Python
17,689
549
import datetime import math import os import sys import time from collections import defaultdict import numpy as np import torch import torch.multiprocessing as mp import torch.nn as nn import torch.nn.functional as F from numpy import random from torch.nn.parallel import DistributedDataParallel from torch.nn.paramete...
66fddcd68a60f236836e73e34067336d4b0f6f26404f7812a8d14519fd1b2f34
Python
17,695
376
# Copyright 2025 The HuggingFace Inc. team. 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 appl...
718885a8ca12603c906feaa0021659e7cb9d24b8038fe0930aef3b11ba6908e0
Python
17,697
491
"""Polygon class for open and closed polygon paths. This module provides a Polygon class for processing 2D and 3D polygon paths with various geometric operations including resampling, smoothing, and metric computations. """ import logging import sys import numpy as np from scipy import sparse logger = logging.getLog...
19941a61264f8ddb97aeecda081968a961eb072d10f6e76d0e674eb62ca862f5
Python
17,718
496
# import libraries and packages import os import pandas as pd import numpy as np import deepdish as dd import scipy import h5py from SUITPy import flatmap import nibabel as nib # Import module as such - no need to make them a class import connectivity.constants as const import connectivity.io as cio import connectivit...
d89366e4f751ccae2231a14eb11da85dddb288846abab02e1267e4e749d975ac
Python
17,719
389
#!/usr/bin/env python3 """Build the GROND reproducibility data bank: grond_data.h5. Self-contained .h5 file pairing each EEG segment with all of its labels, algorithm predictions, cohort flags, and metadata. Schema: /segments/{segment_id}/ eeg (19, 2000) float32 monopolar referential EEG at 200 ...
19e8a5d6111cb264cd75fb37824e77597fd971822907eca9c1dd6809ce56c34d
Python
17,721
393
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/lighton_ocr/modular_lighton_ocr.py. # Do NOT edit this file manually as any edits will be overwritten by the gene...
d8b137e6be3667ed0885dc8c3b503461992043e17d408437be92522fdb444f1e
Python
17,722
502
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 # mypy: disable-error-code="operator" """Numerical stability tests for the source-sampled LIT error factor.""" from functools import reduce from operator import itemgetter import jax import numpy as np from jaqmc_contrib_...
30c5bab3388cdc82f6dcc9e49e027d95f209ddb6a40b461584e09a8646252a30
Python
17,725
387
# Copyright 2026 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 law or agreed ...
3e66eeeba23882a4544c45a3baaf69ac87844dd9afd2b24c8aad4809be08548e
Python
17,731
559
# This program predicts Ki values in the form of pCHEMBL/MW values of molecules for the target protein coagulation factor F11a with Shannon entropies, fractional Shannon entropy, ligand BEI and MW as descriptors # import the necessary packages import os import numpy as np import pandas as pd from KiNet_mlp import KiN...
09ca9fc4f2745032665fc9ed920b2ede89fd04062a1e3cb8b02cb50035b8b445
Python
17,747
360
import dgl import dgl.graphbolt as gb import dgl.sparse as dglsp import torch def test_integration_link_prediction(): torch.manual_seed(926) indptr = torch.tensor([0, 0, 1, 3, 6, 8, 10]) indices = torch.tensor([5, 3, 3, 3, 3, 4, 4, 0, 5, 4]) matrix_a = dglsp.from_csc(indptr, indices) seeds = tor...
251b4c1fb47ee74c63a54fd2dfa932e4b412a97568c469fa060553ab4a608bbe
Python
17,765
539
import itertools import time from collections import defaultdict as ddict import numpy as np import pandas as pd import torch import torch.nn.functional as F from catboost import CatBoostClassifier, CatBoostRegressor, Pool, sum_models from sklearn import preprocessing from sklearn.metrics import r2_score from tqdm imp...
59962b0b19023d78e2fa19fb10d560a7ee821b39380b009b663ff1850caef1fa
Python
17,779
500
""" Experiment: New laterality feature engineering for laterality classification. Computes 4 new asymmetry features from raw EEG segments: - ve_asymmetry: Variance-explained asymmetry (narrowband 0.5-3 Hz / total) - peak_amp_asymmetry: Peak amplitude asymmetry (lowpassed signal) - coherence_asy...
1f3ca78470de3e3dcd9ebcf6266a6a5b68fb8f4672150ebfb7f4d9922a93a868
Python
17,782
488
# Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 """Tests for Hall wavefunctions and their building blocks.""" from typing import cast import jax import numpy as np import pytest from jax import numpy as jnp from jaqmc.app.hall.data import HallData from jaqmc.app....
08a6bec28e732a8dcb0a56ed66cb99c3f440630c15d3ad5118eb0b38713667f5
Python
17,803
558
import mxnet as mx import numpy as np from mxnet import nd from ..._sparse_ops import ( _bwd_segment_cmp, _csrmask, _csrmm, _csrsum, _gsddmm, _gspmm, _scatter_add, _segment_reduce, ) from ...base import ALL, dgl_warning, is_all from ...heterograph_index import create_unitgraph_from_csr...
aa8d9a285c8818466195f89a0439f84c3bd62e354d8eb90f6744225130ea4715
Python
17,819
456
# Copyright 2026 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 law or agreed t...
9994b9bdddcda46f2d81b11e24b151e8c5cd1302512c759eaa5853e06894ef97
Python
17,844
466
# Copyright 2024 Google Inc. HuggingFace Inc. team. 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 requir...
b7364d185400556c782290cb11a5a2dd5031aca8debabdd44d2bfd558a9f6f3d
Python
17,857
350
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 16 2021 @author: martin """ import numpy as np import pandas as pd import os #import json import re import glob import time import nibabel as nib from nilearn import image #from nilearn import plotting from nilearn.input_data import NiftiLabelsMas...
bc873242a84ed9b028b36fcaa1bc79eb1f8ef094229f48ead942d0804214b500
Python
17,874
447
#!/usr/bin/env python3 """ Implementation of Brzonko et al. Elife (2017) using NEST. The code structure is adapted from Microcircuit example on NEST website authored by Hendrik Rothe, Hannah Bos, Sacha van Albada; May 2016 Code author: Mohammad M. Nejad """ import os import json from copy import deepcopy import nest ...
bab8a71623c225c0da6d2fa09ce2299422f4f2dda01a6f2edb96603708649b66
Python
17,880
310
""" Script to analyse and collect data from sensitivity analysis simulations """ __author__ = "Nils A. Koch" __copyright__ = "Copyright 2022, Nils A. Koch" __license__ = "MIT" import numpy as np import h5py import pandas as pd import os from ast import literal_eval import json import scipy.stats as stats # folder to...
77b4c57c8356fc55c52dc03ce13f817b4defc12f36e7747a08e15aa89e29c92a
Python
17,889
339
# Copyright 2026 The HuggingFace Team. 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 applicabl...
4945d97df36de31e11737c600775cfda995e774d2680246990dc72f6932baf55
Python
17,893
486
# Copyright 2019 The Open AI Team Authors and 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...
e783c73588b87f789643744210f3cc0002596c0dd9f38d56577aee0d50f5fcba
Python
17,898
406
# Copyright 2022 Meta Platforms authors and The HuggingFace Team. 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 # # U...
ed6c12f5155882a5cb0a68d2eb6b51d92818dafad67bf3dad33a88fcb7fe82e1
Python
17,905
568
from __future__ import division, print_function from repli1d.expeData import replication_data import pandas as pd import numpy as np from scipy import stats # %load ./../functions/detect_peaks.py """Detect peaks in data based on their amplitude and other features.""" import numpy as np __author__ = "Marcos Duarte...
51d9a23ba95ee7b45d75451017964c0f782932463f59896cd879b01b4c288d5f
Python
17,908
453
""" Generate Fig 5: Spatial Agreement (4 rows: LPD, GPD, LRDA, GRDA). LPD/GPD rows: full inter-rater analysis (3 raters + model). LRDA/GRDA rows: model vs single rater (SZ only). Layout: 4 rows × 3 columns Col 1: Jaccard matrix heatmap Col 2: Bar chart (rater-rater vs model-rater) Col 3: All pairwise agreements...
a14e284015f3f3d1c0cab7a1ac378afae258a8bede3739e377ccb7603c27d1d6
Python
17,912
529
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: example.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pb2 from google.protobuf import message as _message from...
6dc3a4509d4688524a8e4896bc5f070ff9c5a0bda0b621b8c7fe4c88988e558e
Python
17,919
449
# Copyright 2026 SK Telecom and the HuggingFace Inc. team. 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 r...
e533f35931a02cf270f69fbf3bbde91375fef8aba0676ca090649e518430549a
Python
17,929
426
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/ijepa/modular_ijepa.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
7f4df894b34b94e528b4e842acddac8afbfe7ddabcd01d8524bddfa0d91713db
Python
17,932
497
#!/usr/bin/env python3 """ Data cleanup script for IIIC Frequency Functions project. Steps A-G as specified. """ import os import json import shutil import pandas as pd from collections import defaultdict BASE = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) LABELS = os.path.join(BASE, '...
f39a9db34838a7f83eaad461060019d728213e6e0a5de954cb2e459bf4dd7737
Python
17,958
370
# Copyright 2024 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 law or agreed ...
f7eb4ca6bd8a7be1552f88af90707bd262270b4cea24815fa008cf2ad825d6a9
Python
17,976
363
import ast import os import unittest import numpy as np import pandas as pd from automatchnames import get_genus_from_full_name from logan_metabolite_vars import logan_alkaloid_hits_output_csv from metabolite_vars import rub_apoc_alkaloid_hits_output_csv from pkg_resources import resource_filename from import_trait_d...
857aedb8f565377c8ff8995a198def6d95a5c4c9c3086e143b72d7c771ee6de2
Python
17,979
484
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """Structured sparse Jacobian storage types for Forward Laplacian. Theory-to-storage overview ========================== The dense Jacobian layout in this package has shape ``(prod(input_shape), *result_shape)``. The lea...
f153a98ce66fcef724b667025f4b5f0e6efb87368520933e33d57a644f50167b
Python
17,984
349
# Copyright 2026 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 law or agreed t...
425eecd9cc9ee89ef6b03c1efae89ef4400f40469201e70eefb057748c4e9d53
Python
17,993
486
# scientific library imports import dask.array as da import matplotlib.pyplot as plt import numpy as np import scipy.io as sio import seaborn as sns from matplotlib.collections import LineCollection # neuro base class imports from .base.ts_data import _TsData from .base.utils.base import _is_iterable from .base.utils....
81121afac48ea2cc5ba630db8c25b0af84f1c98569cbc2f4f88d820cd591f8a6
Python
18,010
505
"""Training GCMC model on the MovieLens data set by mini-batch sampling. The script loads the full graph in CPU and samples subgraphs for computing gradients on the training device. The script also supports multi-GPU for further acceleration. """ import argparse import logging import os, time import random import stri...
93fd6a1e53bea1326c0aa097c1270c891e6db094ed8ff01f92bf3ef02610e06f
Python
18,055
427
#!/usr/bin/env python3 """Build segment_labels.csv — the single canonical label file. One row per EEG file on disk, consolidating all label sources: - segments.csv (file registry — metadata merged into output) - annotations.csv (per-segment per-rater labels) - patients.csv (patient-level labels — laterality, exclusion...
84f041bdc3333f58cb9566a3ae615b8e7b18c753ff1930287888b2ccfd858639
Python
18,056
410
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/minicpm_ocr/modular_minicpm_ocr.py. # Do NOT edit this file manually as any edits will be overwritten by the gene...
4f05be86390b1bff4d9343d57a2ba945385ab80b23d32a6230bfdda8cf15e00c
Python
18,062
447
""" Build a channel-level PD (periodic discharge) dataset. For each patient, loads first segment, extracts each of 18 bipolar channels, and assigns a binary PD label per channel based on subtype and laterality. Label logic: - GPD: all 18 channels = positive (1), subsampled to max 6 per patient - LPD with laterali...
fc013a2f4b61164e39422e62083d74049b215298aea865de7cd3784cfb1dfb3b
Python
18,072
423
# Copyright 2026 The HuggingFace Team. 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 applicabl...
4bb3d627a6d3efa04ac4a41d01e745a3c4f21887411d0f974c932f2ac9635a69
Python
18,074
511
"""Spatial Localization Contest Harness — data loading, evaluation, leaderboard.""" import sys import json import time import warnings import numpy as np import pandas as pd import scipy.io as sio from pathlib import Path from collections import defaultdict from sklearn.metrics import f1_score, jaccard_score, roc_auc_s...
6efe9d7c17850ffca5dbb3b39d0ac028304c87f74fa246aa6334d1a36f9d6c53
Python
18,078
507
#!/usr/bin/env python3 """Generate LRDA side-labeling viewer. Selects LRDA cases that are confirmed by our best model, plus additional IIIC cases with strong LRDA vote majority. Generates an HTML viewer for MW to label each case as Left or Right dominant. Usage: conda run -n morgoth python code/lateralization_con...
2095bb6f2bc8955694026c37ccd70e1b7d341ab709a1e0bb132a63f70de4bbc8
Python
18,103
499
"""CPU cached feature for GraphBolt.""" from typing import Dict, Optional, Union import torch from ..base import get_device_to_host_uva_stream, get_host_to_device_uva_stream from ..feature_store import ( bytes_to_number_of_items, Feature, FeatureKey, wrap_with_cached_feature, ) from .cpu_feature_cach...
f8a00683d6077c50b9c55e42bb36529a1886685ae772ddb0b95db61b7b16cb68
Python
18,117
540
""" This example references examples/graphbolt/pyg/labor/node_classification.py """ import argparse import time from copy import deepcopy import dgl.graphbolt as gb import dgl.nn as dglnn import torch import torch.nn as nn import torch.nn.functional as F from tqdm import tqdm def accuracy(out, labels): assert ...
dd8baa13b47f6355a30dde1a2ccd7b061dad6db32c66f93e716f4cdbc5c0c1f3
Python
18,119
438
""" Controller: upload_listen ================================= Description: A template controller for upload + listen workflows. It accepts a csv file containing paths to files to be uploaded to the Blackboard. It listens for results and processes them. This file is expected to be customiz...
c61135a38e3b65e3742fa55efff5ccbee017b50e455a757139b4815024332a1a
Python
18,140
463
# Copyright 2025 HuggingFace Inc. team. 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 applicable...
7965f8b339005d3e39eeeee7aed89705a10e6abc282f38a1ef946a9cce0a4bc5
Python
18,146
447
# Copyright 2023 Alibaba Research and The HuggingFace Inc. team. 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 # # Un...
5640a689708b3268103d379c53bf986f149dd4cf4f2ca1464cbc9b20d98a643a
Python
18,151
433
#!/usr/bin/env python3 """Independent-expert IRR bar-plot figure (Fig 5): paired EE vs EA with CIs + significance. Two-row layout: Row 1: Canonical 4-rater independent-expert cohort (MW, SZ, TZ, AS) under the canonical majority-accept consensus rule (V14 algorithm). Panel A: Frequency Spearman rho ...
672772dccb3193bf0ffc3ece56c80facc5a937aabbfef38a5e0babeb0724f274
Python
18,151
493
""" This script trains and tests a GraphSAGE model for link prediction on large graphs using efficient and tailor-made neighbor sampling. Paper: [Inductive Representation Learning on Large Graphs] (https://arxiv.org/abs/1706.02216) While node classification predicts labels for nodes based on their local neighborhoods...
d55b1ed51a00c3a700dfa904c7bf4927d37dd63ee057f4fdcc2588385104bbce
Python
18,172
556
"""Utilities for pytorch NN package""" # pylint: disable=no-member, invalid-name import torch as th import torch.nn.functional as F from torch import nn from ... import DGLGraph, function as fn from ...base import dgl_warning def matmul_maybe_select(A, B): """Perform Matrix multiplication C = A * B but A could ...
4cb57da86adca1c39ca2d324efb6d023c7ad29b9f4d7a7e8e4594834e24fcfd7
Python
18,175
426
# Copyright 2020 The HuggingFace Team. 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 applicabl...
2e060e8fe4e6b7187e2eb16b673d9c312c405f12ccf311bc4744a9bc5b03f276
Python
18,195
341
# Copyright 2026 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 law or agreed t...
6eea51094375ebef4120b30b7c5d2334fcfa39a03fcae3c7b1462c51d2adfeb9
Python
18,213
532
from __future__ import absolute_import import os import numpy as np from .. import backend as F from ..convert import graph as dgl_graph from .dgl_dataset import DGLBuiltinDataset from .utils import load_graphs, load_info, loadtxt, save_graphs, save_info class LegacyTUDataset(DGLBuiltinDataset): r"""LegacyTUD...
36973e9c0d7240f4d2b1841b4db3df6398eb84aa2ff299f5da82dcdcff819d03
Python
18,215
588
"""Provide tests for MultipleDataGrabber.""" # Authors: Federico Raimondo <f.raimondo@fz-juelich.de> # License: AGPL from copy import deepcopy from pathlib import Path import pytest from pydantic import AnyUrl from junifer.datagrabber import ( BaseDataGrabber, MultipleDataGrabber, PatternDataladDataGrab...
1ae443f473e87dae7b5208fe32ca8d4c026062dde4d99cd34791a079432f73b6
Python
18,220
413
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 10 01:18:52 2023 @author: nelab """ import os import scipy.io as scio import numpy as np import random from skimage.util import random_noise import pytorch_lightning as pl from torch.utils.data import Dataset, DataLoader import torch.utils.data as ...
db16c6c3685ef22fad24dd3919490db9a40214de9022a3f0661d544bc9dfd5ab
Python
18,228
333
""" Script to analyse and collect data from simulations """ __author__ = "Nils A. Koch" __copyright__ = "Copyright 2022, Nils A. Koch" __license__ = "MIT" import pandas as pd import h5py import json import os import numpy as np from ast import literal_eval import string import matplotlib.cm as cm # %% rheo_{}_ex.csv...
441e1550f238af1b1b8a2b5ef4381437254c3006c7c64bdd6749311c24ac83d4
Python
18,230
569
import argparse import time from copy import deepcopy from functools import partial import dgl.graphbolt as gb import torch # For torch.compile until https://github.com/pytorch/pytorch/issues/121197 is # resolved. import torch._inductor.codecache torch._dynamo.config.cache_size_limit = 32 import torch.nn as nn imp...
f5e77b9658b60542266e34ee56fe41d34b11d3851e77080387eb6daa855403ba
Python
18,242
407
""" ================================================ :mod:`observers` -- Algorithm monitoring methods ================================================ This module provides pre-defined observers for evolutionary computations. All observer functions have the following arguments: - *...
e0679cbc2f8c2c287653b204227084d20e178b64c6ff5b78b92d7fba95c28600
Python
18,249
553
import math from itertools import product from typing import Tuple import numpy as np import pandas as pd from numba import jit from scipy import linalg, signal def merge_bouts(bouts, min_dist): bouts = list(bouts) i = 1 while i < len(bouts) - 1: current_dist = bouts[i + 1][0] - bouts[i][1] ...
d01eec1a581a897d20817c1753a65c2a749d991b5ec57ed3eba7d541de7a29d6
Python
18,285
416
import numpy import matplotlib.pyplot as plt def avg_and_rms(x): N = len(x) avgx = numpy.mean(x) rmsx = 0 for i in range(N): rmsx += (avgx-x[i])**2 rmsx = numpy.sqrt(rmsx/(N-1)) return avgx,rmsx def manual(filename,idelay,idur,spikedurat): """Manual approach""" ...
263f09b384084a513b085c4ecaa1f4c70ad3dbf21fcc93d4d28c31db47c13b6a
Python
18,291
501
""" LPD Laterality Labeling Tool. For each unlabeled LPD case: - Runs CNN+Attention PD detector to predict laterality - Shows EEG with predicted side in blue, other side in black - Channel layout: left hemi | right hemi | midline (same as BIPD viewer) Controls: Enter = accept model prediction, advance Space...
f56df2723aeac85ff25fa4a7b58a849b586b29b77ae5da9dd1621e4380497bc4
Python
18,298
492
import numpy as np from multiprocessing import Pool # Process pool from multiprocessing import sharedctypes from itertools import groupby import sys import ctypes as ct RED = "\033[1m\033[91m" GREEN = "\033[1m\033[92m" END = "\033[0m" # # # # # # # ...
488d9ea91145570e61a3c33f43b506faa3e17dcc59075081f93804e0758e9c1e
Python
18,301
565
import unittest import backend as F import dgl import pytest from dgl.base import ALL from utils import check_graph_equal, get_cases, parametrize_idtype def check_equivalence_between_heterographs( g1, g2, node_attrs=None, edge_attrs=None ): assert g1.ntypes == g2.ntypes assert g1.etypes == g2.etypes ...
063f3a92c0e2e04a79380f0873bb3efc344e66163ceeac37abe5c38cc945d540
Python
18,325
493
import numpy as np from multiprocessing import Pool # Process pool from multiprocessing import sharedctypes from itertools import groupby import sys import ctypes as ct RED = "\033[1m\033[91m" GREEN = "\033[1m\033[92m" END = "\033[0m" # # # # # # # ...
31eb483b1cd7f56458dcc1ff453b6164c8b4a6d2f4b61a270477dbbe32cf5759
Python
18,327
492
""" Distributed Node Classification =============================== In this tutorial, we will walk through the steps of performing distributed GNN training for a node classification task. To understand distributed GNN training, you need to read the tutorial of multi-GPU training first. This tutorial is developed on to...
121307e137d2b4c184aa3aa71e673e709b51d7c341d64564ac17262ec6d27fc0
Python
18,336
521
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 """Adaptive continuation and durable-state helpers for LIT.""" from __future__ import annotations import hashlib import json import logging from collections.abc import Callable, Mapping from dataclasses import asdict from...
16c8e37b877216527f84e2c79bfe7f14222dd752f14deb47f7b16bbd5395a649
Python
18,336
490
"""PyTorch model utility functions.""" import types from types import SimpleNamespace from typing import Dict, Generator, Iterable, List, Tuple, Union, Optional import torch import numpy as np import slideflow as sf import contextlib from packaging import version from pandas.core.frame import DataFrame from scipy.spe...
16b5b07d3db05fe81826581ed07dd91f769cbd4bc10465106bf2aa023838b892
Python
18,342
489
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/hgnet_v2/modular_hgnet_v2.py. # Do NOT edit this file manually as any edits will be overwritten by the generation...
c36c7223562a63c14d6779034b9d771fe809583583d07ce83e0083ec7bfc4ec0
Python
18,343
489
import argparse import json import logging import os from typing import Any import torch from huggingface_hub import hf_hub_download, upload_folder from safetensors.torch import load_file, save_file from tokenizers import Tokenizer, decoders, pre_tokenizers, processors from tokenizers.models import BPE from transform...
db9e192f4514bd6a2fa9a6f5f748144c6a19036f387aa1c5292298e32fcbbd53
Python
18,351
469
import abc import copy import random from typing import Dict, List, Optional, Tuple, Union import numpy as np from rl_nav import constants from rl_nav.environments import base_env class EscapeEnv(base_env.BaseEnvironment, abc.ABC): """Grid world environment with multiple rooms. Between each room is a door, t...
c7285a911c68070606cea8be3057ceb0f4d50bc4b664d386ec92a3fc4c6298fe
Python
18,354
387
import sys import argparse import logging import os import numpy as np import torch from datetime import datetime from torch import float32 from sklearn.metrics import f1_score from tensorboardX import SummaryWriter from torchvision.transforms import Normalize, Compose, Resize, RandomAffine from torch.utils.data impor...
9548632784628926c6ef9bcc7f3451bc9e65240fb13104962c0ffd48ca1e556d
Python
18,366
431
from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier, RandomForestClassifier, RandomForestRegressor from sklearn.preprocessing import StandardScaler, OneHotEncoder from sklearn.linear_model import LogisticRegression, SGDRegressor, LinearRegression from sklearn.neural_network import MLPClas...
760c9da9588f4905fcf18634bdd30563fe5b5bc70a5210a8b05206a89f1f3b75
Python
18,367
423
#!/usr/bin/env python3 """ Reproduce the key results from: Tautan et al. 2025, J. Neural Eng. 22, 066027 This script reproduces: - Table 1: MAE between mean expert annotations and algorithm outputs - Figures 5 & 6: ICC (expert-expert and expert-algorithm) for segments with 100% agreement on pattern classification ""...
22258a65dfe6a19299b5a2a748ea9df019d974001e2caaab9d84ee2a56206733
Python
18,370
533
""" Discharge timing detection for LPDs and GPDs. Detects individual discharge times on each channel using: 1. Per-channel event evidence (pointiness + TKEO) 2. Aggregate evidence by subtype (GPD vs LPD) 3. Dynamic programming for optimal discharge sequence Usage: from discharge_timing import detect_discharge_tim...
7b66716676b7c837fc4c717358e07bc9620d9cc78429807910d12129de7ab05e
Python
18,376
518
# coding=utf-8 # Copyright 2020 The SimCLR 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 applicable law or...
e108d58e9e5a3230d4a3d4200b172d4d079ba488dd63168e3fa39ec2a34a6fcb
Python
18,388
497
""" ================= :mod:`crossovers` ================= .. Copyright 2012 Aaron Garrett .. 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,...
88bf55d09bf68b2f990e88179007664642e674343e7b737401dee482b70490c6
Python
18,390
416
import numpy as np import pandas as pd # Add progress bar to apply method from getting_logan_malarial_regions import logan_taxa_in_malarial_countries_csv from logan_climate_vars import logan_compiled_climate_vars_csv from logan_common_name_vars import output_logan_common_names_csv from logan_manually_collected_data imp...
88bbbcc449261bbe47b29dab37c86464e41fc339af614470f6c155ddb8d656a0
Python
18,411
507
""" =============== Stream handlers =============== """ import os import sys import json import pickle from datetime import datetime from typing import Optional, List, Callable, TypeVar from collections.abc import Sequence from PySide6.QtUiTools import QUiLoader from PySide6.QtCore import QTimer, Qt, QRect from PySid...
a94fbc6683fb3e187599f5e6ead41124bdd36f91e0871982ccc43b71525ba874
Python
18,413
510
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec # change the default font family plt.rcParams.update({'font.family':'Arial'}) plt.rc('xtick',labelsize=14) plt.rc('ytick',labelsize=14) plt.rc('legend', fontsize=14) def reldiffs(fother,f1,iother,i1): iout = [] ...
6b82d481f4aefd8e18406be024dee391c9084bbd4634f154a3ca152e093cf92c
Python
18,443
484
#!/usr/bin/env python3 import typer from pathlib import Path from datetime import datetime, timedelta import scipy.io as sio import json from rich.console import Console from rich.table import Table from launchcontainers.utils import atomic_rename_pairs, parse_subses_list app = typer.Typer() console = Console() # --...
542092abc116e7ff2386b921c6683df20520db8de3f48416bb1611ce5b7309e5
Python
18,444
409
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/aya_vision/modular_aya_vision.py. # Do NOT edit this file manually as any edits will be overwritten by the genera...
e2c33dfd6c2bb97046d213b113ece280111862936e059570a0364180e6c3a2a1
Python
18,449
520
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...