sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
95f0b9a8e55418f3df993b295be064c1a7698eb51cb9fcaab58ecb84cba00648
Python
30,483
824
import sys import os import pandas as pd from segment import * import numpy as np import h5py import sys layer = str(sys.argv[1]) kernel = str(sys.argv[2]) strict = 1 if len(sys.argv) > 3: strict = 0 #layer = '10' #kernel = '1130' motif_ppms = {} with h5py.File('layer' + str(layer)+ '/kernel-'+str(ker...
739659621d70ee4d10f55dd086ce33cc20b61c4494f473c09419af7c8b75f708
Python
30,484
824
import sys import os import pandas as pd from segment import * import numpy as np import h5py import sys layer = str(sys.argv[1]) kernel = str(sys.argv[2]) strict = 1 if len(sys.argv) > 3: strict = 0 #layer = '10' #kernel = '1130' motif_ppms = {} with h5py.File('layer' + str(layer)+ '/kernel-'+str(ker...
524161b3f8d2892346a09c2b6d2db6f8f524a5ba60f6e8cbd5346991827ac6e7
Python
30,538
655
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/mimo_v2_flash/modular_mimo_v2_flash.py. # Do NOT edit this file manually as any edits will be overwritten by the ...
a8546fe12e246c87cf7c649fba58032cffd17c4535fc75c03abbc457f77b38f7
Python
30,594
1,023
import json import os import tempfile import dgl import dgl.backend as F import dgl.graphbolt as gb import numpy as np import pyarrow.parquet as pq import pytest import torch from dgl.data.utils import load_graphs, load_tensors from dgl.distributed.partition import ( _etype_str_to_tuple, _etype_tuple_to_str, ...
b02b975c4a25a6c91000cab6e9c7deb7c8e2bc3d31a38ada6ee9c6bb1ee35435
Python
30,612
632
# Copyright 2024 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...
c68f5bbf4fdf8442e032d3345c6105b814e580eb1947529d8b6e61d516fd0c1a
Python
30,612
818
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
f6c260c7c2326adc3b5a4c9993158d4e841907ddbd51e48dd02060fcf7a065a8
Python
30,645
837
""" Fully automated EEG-only discharge detection pipeline. No gold-standard frequency is used anywhere. The system estimates frequency from EEG using ACF bootstrap and/or CNN+Attention models. Methods evaluated: 1. HPP (handcrafted evidence, bootstrap freq) 2. CET-UNet+HPP (CNN evidence, bootstrap freq) 3. HPP ...
7ad83b29454c38b0a3b150f301b667d172fdb493b9a79aaae7ff83307c213bb7
Python
30,655
808
""" Train the unified multi-task CNN for joint PD/RDA analysis. Tasks: 1. 4-class subtype classification (LPD=0, GPD=1, LRDA=2, GRDA=3) 2. Frequency estimation (log Hz, masked for cases without labels) 3. Per-channel PD detection 4. Per-channel RDA detection Multi-task loss: L = lambda_sub * CE(subtype) + l...
e1f75911d41f18c7b1982369c31bdd49043447abfd20447ddd36994fc0620419
Python
30,665
926
from __future__ import annotations import math from typing import Any import gymnasium as gym import numpy as np from gymnasium import logger, spaces from gymnasium.core import ActionWrapper, ObservationWrapper, ObsType, Wrapper from minigrid.core.constants import COLOR_TO_IDX, OBJECT_TO_IDX, STATE_TO_IDX from minig...
7642bac43ad19352370d01b32e991652c73132baa4adc7a1e89a1de425725631
Python
30,666
807
# Copyright 2024 state-spaces/mamba org and 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 ap...
c535b1df996690cd528733e1aabe9b8fef6aeeca9b5c2bd620b7f2275153d670
Python
30,667
815
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
57f2b9e16e008deed3f61e6d78ffa5d19e431ee9d06fe972aa50983d6b6e35d0
Python
30,735
823
"""H&E stain normalization and augmentation tools.""" from __future__ import absolute_import import os import sys import multiprocessing as mp from io import BytesIO from functools import partial from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union import cv2 import numpy as np import slideflow as sf ...
fe1c820fd074041f73dfdbdf88b3a46c04a40eeebf9bb6351d10af183ac0cfe7
Python
30,765
688
# Copyright 2021 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 ...
6a4bac9f625bb382817877a25622d43a42720bb29c3420ab1eae54fca57c10c3
Python
30,780
696
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/canary/modular_canary.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of ...
2669351f28445235fe9f100c1affbc00fd2ffbeab317d00f99a3eb46c56a02f9
Python
30,792
655
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/beam/modular_beam.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
c5a746ae783e95a27c2040d9f7578df4f305374df960ab0785affa788937a96b
Python
30,839
897
""" Spatial Extent Labeling Viewer for PD and RDA EEG Segments. Generates HTML viewers where MW can label spatial extent (% channels involved). The algorithm predicts a default using optimized thresholds, and MW can accept or override with a different percentage via N/18 channel buttons. For LPD/GPD: PDProfiler chann...
c541c2d8d226cce46eba54a064bd0577a711ec215030ffbcf1dc0d32de58fd63
Python
30,909
854
#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Copyright (c) Yongning Lei 2024-2025 # MIT License # ----------------------------------------------------------------------------- """ Link fLoc events.tsv files from sourcedata into the BIDS func directories. For ...
8edb61e419ffefeb9d2945fb8c8eb64456bf10c8e8ecbf37875296b280ee5193
Python
30,955
730
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/lasr/modular_lasr.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
39a3cbea769482be86a38cacbc456f59332b469c5767bad692ca3696a0d1b418
Python
30,991
834
""" RDA Optimization Harness — frequency estimation, channel identification, and GRDA/LRDA classification via Leave-One-Patient-Out cross-validation. Training data: 222 multi-expert RDA segments (GRDA + LRDA) from 24 patients. Gold labels derived from median of expert raters (LB, PH, SZ, +MW if present). Run baseline...
fd8d8d8425e0db02d35211b93eac63d307b156cf0fbe8390107e1223e3c1cea3
Python
31,017
843
import os import torch import slideflow as sf import imgui import glfw import segmentation_models_pytorch as smp from typing import Optional, List from os.path import join, dirname, abspath, exists from threading import Thread from tkinter.filedialog import askopenfilename, askdirectory from slideflow.segment import Ti...
63c8d5016dfc1030775b49a3461a5e8e87a2a38b42bbed9e9a25ad17327011c6
Python
31,030
925
""" Module containing different generative models """ import numpy as np from scipy import stats from basic_functions import * def oneTauOU(theta, deltaT, binSize, T, numTrials, data_mean, data_var): """Generate an OU process with a single timescale. Parameters ----------- theta : 1d array ...
7686ede9b8498e071e45a9273ec1522735cf508efe428cfe21167ab5d7d587c4
Python
31,038
856
""" Core OpenBCI object for handling connections and samples from the Ganglion board. Note that the LIB will take care on its own to print incoming ASCII messages if any (FIXME, BTW). EXAMPLE USE: def handle_sample(sample): print(sample.channels_data) board = OpenBCIBoard() board.start(handle_sample) TODO: suppo...
393b136a47470424b4a446a4b6097448dd62547f546c97572db6a71a5790fc24
Python
31,039
959
"""Wave tracking by connected components This module contains tools for tracking waves in binary neural activity data estimated from 2-dimensional calcium imaging data. """ __version__ = '0.1' __author__ = 'Michael H McCullough' __status__ = 'Development' import os import numpy as np from scipy import ndimage from s...
b86e6a607bc73f2cda3679ccc4aaf8c34e71069c4e643ecb0c3215877454d54b
Python
31,089
660
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/cosmos3_omni/modular_cosmos3_omni.py. # Do NOT edit this file manually as any edits will be overwritten by the ge...
4077067624008724e5b41d391c67aeb63bd1eb636ef1bb2f81041d2f698f89a5
Python
31,183
708
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/ernie4_5_moe/modular_ernie4_5_moe.py. # Do NOT edit this file manually as any edits will be overwritten by the ge...
810ab9ea8bb8b873709f3615448be5d57796c2785ea5685a99e3d0528fd360d6
Python
31,218
869
"""Computes spherical conformal mappings of triangle meshes. Functions are adopted from Matlab code at https://github.com/garyptchoi/spherical-conformal-map with this Copyright (c) 2013-2020, Gary Pui-Tung Choi https://math.mit.edu/~ptchoi and has been distributed with the Apache 2 License. Notes ----- If you use thi...
aad7f016450e198c1d5a4f9bab840ee92aa175fbcfc5ed3b421a9524ef86f123
Python
31,221
682
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/flint/modular_flint.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
ec646d11294c5abfec8ba9aec2d52f40d2ed4569294f221020212fc5bd002b69
Python
31,335
835
# Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 import difflib import inspect import logging import sys from collections.abc import Callable, Iterable, Mapping, Sequence from dataclasses import dataclass, fields, is_dataclass from functools import wraps from typing ...
63b1b0bed132a725edb1b8d5eb73668f7b1d5d27de2e8f1bbdd5f254f4ce0de6
Python
31,338
737
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/deformable_detr/modular_deformable_detr.py. # Do NOT edit this file manually as any edits will be overwritten by ...
46701547efd5abbab06ef3a6b5b989a417da75f59c21419cf17d44754dc6d83d
Python
31,357
812
""" HPP parameter sweep for discharge detection (FAIR / EEG-only setting). Uses CNN-estimated frequency as the period prior. Tests different evidence types (hpp, cet, and combinations) and DP parameters in a staged sweep. Stage 1: Compare evidence types with current best DP params Stage 2: Sweep DP params independent...
43b781f311288c1de095691b91f58f4cf976b7cc2ae4bd2b7c40653cfc83d657
Python
31,416
708
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/granitemoeshared/modular_granitemoeshared.py. # Do NOT edit this file manually as any edits will be overwritten b...
7f3b3b42ce9e9c8f24b263bafdbf73de6f3aa8c2443e66b871a9e1a503511e24
Python
31,474
707
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/florence2/modular_florence2.py. # Do NOT edit this file manually as any edits will be overwritten by the generati...
b068ec7d71a49c17433d83a0de1cbcf0da5cffe32d9b458e996d456a1d73ba9b
Python
31,492
713
# Copyright 2022 The Salesforce Team Authors and The HuggingFace Team. All rights reserved. # # Licensed under the BSD-3-clause license (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD-3-Clause # # U...
aa19e50c79c8ea6ae7cc8a2b3b7846034c6378a171dfebfcc588752ab6015520
Python
31,494
925
__author__ = "Giovanni Sirio Carmantini" __version__ = 0.1 """ """ import itertools as itt from collections import Counter from copy import copy from typing import List, Union, Tuple import numpy as np def as_list(arg): """Convenience function used to make sure that a sequence is always represented by a l...
682028fd62f04e7bd708686745d0d9a22bbb082d2775c699ee4ed07a70ee53b5
Python
31,589
727
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/deformable_detr/modular_deformable_detr.py. # Do NOT edit this file manually as any edits will be overwritten by ...
042ecca60a62c6861962456ab03480d4c228747251b77be9fe9511a00b0e9fd1
Python
31,629
643
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/glm46v/modular_glm46v.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of ...
077463499b4170a3ae8506a555bb2da919353764f610f628dbda04e871c7cef9
Python
31,705
711
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/longcat_flash/modular_longcat_flash.py. # Do NOT edit this file manually as any edits will be overwritten by the ...
f5d98dfff239d98befec5bad48aac7257975319ff8604a0f174df8b28442813f
Python
31,727
697
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/mellum/modular_mellum.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of ...
5b83655ff773413b5a25e5db3b3b782b5b2e105fae88c0ed92727195963174d5
Python
31,730
904
"""Model and trainer configuration for MIL models.""" import numpy as np import os import torch import slideflow as sf import pandas as pd from torch import nn from typing import Optional, Union, Callable, List, Tuple, Any, TYPE_CHECKING from slideflow import log, errors, Dataset from ._registry import get_trainer, b...
16610e739deb9aafa177d34a1240b262a21a2664c219de861f04d9e65666828b
Python
32,069
785
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/jina_embeddings_v3/modular_jina_embeddings_v3.py. # Do NOT edit this file manually as any edits will be overwritt...
ddad19bde0791b8a7d556290fc9b65a8996866709582102b7d44857fcba68319
Python
32,079
796
import numpy as np import scipy.ndimage import skimage.morphology import matplotlib.pyplot as plt import pandas as pd from sklearn.mixture import GaussianMixture import skimage.measure import matplotlib as mpl from plotly import figure_factory as FF from plotly.offline import download_plotlyjs, init_notebook_...
9cbd8dcb690fe13108dbcbf7fc0499cdf252450d6a100bdcfe29d127fb2b9e6f
Python
32,109
1,031
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
1c5c5adcedc3007c10d13c44b611a5baca588cd5f7c8bda6afa66c73518373eb
Python
32,147
724
# Copyright 2022 Meta Platforms, Inc. 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 # ...
6ad4883ec78fe3c0b46a56267ff86c340e64f1854dfddfe4d706d6a54b4db444
Python
32,166
782
# Copyright 2022 The OpenBMB Team 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...
b6685bc202805fb9598422c12753ee2f692cd0ee958c8522d5470d084fa6ac30
Python
32,200
887
""" Discharge-locked topographic localization viewer. For each PD segment with discharge timing labels: 1. Load 19-channel monopolar EEG (200 Hz) 2. Bandpass filter 0.5-20 Hz 3. At each discharge time, extract GFP-aligned peak voltage across 19 channels 4. Average the aligned voltage vectors -> mean discharge ...
617f1f7bd6c75a8f09bad4001cf4fe2f556497be632625c9a86c7ca6497315f2
Python
32,221
738
import sys import math import numpy import tensorflow as tf # ModuleNotFoundError is new in 3.6; older versions will throw SystemError if sys.version_info < (3, 6): ModuleNotFoundError = SystemError try: from .beam_search_sampler import BeamSearchSampler from . import mrt_utils as mru from .random_sa...
7cb19adfe187889124e1479db221d4e4d87c95fd47f2908007a02ef5ad8a1ed1
Python
32,309
708
# Copyright 2026 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...
fac755282f38f17c127d91dbaad5488284dec9388277d4bed4a5c654a2df7262
Python
32,318
730
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/deepseek_v3/modular_deepseek_v3.py. # Do NOT edit this file manually as any edits will be overwritten by the gene...
3d3fa81ad9a6fd5478354515b4056829a3cad9d2cd9e6d8398f7f4a7d9558231
Python
32,336
859
from __future__ import annotations import os import sys import argparse import ast import json from typing import Any, Dict, Tuple, Sequence # TUNABLE_KEYS = {"value", "apt_list"} def _single_plan_context( plan_path: str, json_plan_suffix: str = "_plan.json", ) -> tuple[str, Dict[str, Any]] | None: """...
357e6076b1e91c28edc74f1be8aa16eb67cada132a39576ea321a1ac23c6f91f
Python
32,436
727
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/axk1/modular_axk1.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
fb81fc6ff9eb182e72e255f075b31789a8f8c17ec9e5cb7fbb6541bcc90b09dc
Python
32,461
856
import logging import os import time import traceback import unittest from os.path import exists, join from typing import Optional from rich import print import slideflow as sf import slideflow.test.functional from slideflow import errors from slideflow.test import (dataset_test, slide_test, stats_test, norm_test, ...
3fb006441e2ef5e72ff0566958af240f46eeee384441b836b2ecb04f43679091
Python
32,507
758
# Copyright 2025 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 ...
9a929b5bd951df5fb227d078f87f1e3f5f09864b7524999df81d7cfd044af4b1
Python
32,529
741
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/got_ocr2/modular_got_ocr2.py. # Do NOT edit this file manually as any edits will be overwritten by the generation...
8725ee0b88a743226c5eaad1b6f68c6efd9691b59007a493ea36a37ef259dbe3
Python
32,550
768
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/grounding_dino/modular_grounding_dino.py. # Do NOT edit this file manually as any edits will be overwritten by th...
976eb573bd581135ca920500dbfe60b261125d77c3ae9b6744650f986e8672da
Python
32,626
779
# Copyright 2021 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...
9d267668ae8ba7f39fa52817be3524e44cbf39132244063218f6180e37f4066d
Python
32,726
727
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/glm4_moe_lite/modular_glm4_moe_lite.py. # Do NOT edit this file manually as any edits will be overwritten by the ...
241d718719c67a542f0ce7f973c0f99839310c566dfbd586b33fb778de98797d
Python
32,737
859
""" Controller: upload_dataset ================================= Description: A Core dataset uploader. It accepts a csv file containing paths to files to be uploaded to the Blackboard. The CSV format uses named columns; column order does not matter. Optional image label-mask column: ...
8a77ccd0a94b313b6cf15037360b6b537b2e20be0d6d608af73d9199ce08b6dc
Python
32,800
758
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/grounding_dino/modular_grounding_dino.py. # Do NOT edit this file manually as any edits will be overwritten by th...
41c531185a6d98a01414d0e37324de91bd5c8ced7e790c096d4a04ed194ec24c
Python
32,827
1,038
"""Module for sparse matrix operators.""" # pylint: disable= invalid-name from __future__ import absolute_import from . import backend as F, ndarray as nd from ._ffi.function import _init_api from .base import DGLError def infer_broadcast_shape(op, shp1, shp2): r"""Check the shape validity, and infer the output ...
b507ae999e12ae7aa99694c523646b32e73b93f7a7586268118128e77d382fc1
Python
32,848
834
"""Iterable-style TFRecord interleavers for PyTorch. Includes support for streaming data from whole-slide images, as well as StyleGAN2 compatibility. """ import multiprocessing as mp import random import threading import numpy as np import pandas as pd import torchvision import torch from queue import Queue from typ...
e2a9742b444110556519aa5144a9c727a93701f40b29d6957345a3f8ad8bc15a
Python
32,937
627
# Copyright 2025 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 ...
370288f267bf6698bf712860ecbc1b207837c7978335655809d3946aea6194ca
Python
32,971
922
import copy import gc import logging import os import constants import dgl import dgl.backend as F import dgl.graphbolt as gb import numpy as np import torch as th import torch.distributed as dist from dgl import EID, ETYPE, NID, NTYPE from dgl.distributed.constants import DGL2GB_EID, GB_DST_ID from dgl.distributed.p...
1ce8617127037a9799518cf1944c81f25f518f75996ccc41f121b9edb4aed4a6
Python
33,010
890
# repo originally forked from https://github.com/Confusezius/Deep-Metric-Learning-Baselines ################## LIBRARIES ############################## import warnings warnings.filterwarnings("ignore") import csv import datetime import os import pickle as pkl import faiss import matplotlib.pyplot as plt import nump...
56e20c64cb25eb439f40c3ebe4f129dd4734a5a178410c56424ae3856dd88650
Python
33,025
868
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=12) def reldiffs(fother,f1,iother,i1): iout = [] ...
54f439b8be2427af235a1488bb4516c2bce18665d3631895c734303dd4334738
Python
33,080
672
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 19 05:27:06 2022 @author: nelab """ import os import wandb import torch import numpy as np from easydict import EasyDict as edict import uuid import shutil import pytorch_lightning as pl from pytorch_lightning.loggers.wandb import WandbLogger from...
3e5bce0190b6db4888dcea51b1f9730a1d3d3ba6420ff3da1b3b4ce309521eb0
Python
33,108
922
#!/usr/bin/env python3 """ BIDS Functional Run Order Checker with Cross-Validation This script uses PyBIDS to read functional MRI data from a BIDS dataset, extracts acquisition times from multiple sources (NIfTI metadata, scans.tsv, JSON sidecars), cross-validates them, sorts runs by acquisition time, and validates wh...
2c0d9df29f5b5a1e24e8463a87d57a8ca920ff7ca3550ec1a8897a5bd11514be
Python
33,110
982
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 """SPRING, SR, and held-out selection numerics for LIT.""" from __future__ import annotations import logging import operator from collections.abc import Mapping import jax import numpy as np from jax import numpy as jnp ...
e730b28b65d0587461e802b801d8241e382391cc6f2e4e0f02c767a8531ba61e
Python
33,116
942
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 19 10:27:05 2019 @author: Kai Sandbrink """ from sklearn.metrics import r2_score, mean_squared_error from sklearn.model_selection import train_test_split from scipy.optimize import minimize import numpy as np import pandas as pd import pickle, os,...
525eb4f1df444160939413362621783d314b0712277bd54fb18dd9a99d51f5c3
Python
33,139
872
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=12) def reldiffs(fother,f1,iother,i1): iout = [] ...
7156b50517dd731f4695b18d40629bdc5ef1a8af7bd33effa0d7b578a8078185
Python
33,204
876
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=12) def reldiffs(fother,f1,iother,i1): iout = [] ...
6d43c084bbce0ec5292754257768cc90b63a7ba8dc8ddfc98d1faccd173e52a1
Python
33,210
916
""" 00_merge_split_ses_reording_runs.py ------------------------------------ Two related tasks in one script: 1. Merge split BIDS sessions (e.g. ses-02 + ses-02part2) into one. 2. Fix run-number gaps or non-1 starting indices in a single session. Both are solved by the same mechanism: sort ALL files per group (mo...
13e872c5db6eb3443336c3a19c5ba6db86b3e34dcae14de2eb7074f877317f80
Python
33,273
868
""" Generate RDA labeling application with algorithm frequency estimates and sine wave overlays. Uses Alexandra's FOOOF-based RDA detector (fcn_rdafooof_enhanced from rda1b_fft.py) for frequency estimation, with fallback to simple FFT when FOOOF fails. For 200 RDA candidates (100 GRDA + 100 LRDA): 1. Run FOOOF-based ...
49b252d1fbebd18c1763864bd99163da1e16134eb045f1c80fcd317db6c0e32e
Python
33,336
762
# Copyright 2025 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 ...
9c4960ad369f38ae8478a0357ac689bc4c30a680236691bd38b069fd6d3a12ac
Python
33,398
754
""" Last updated Tue Apr 12 2022 @author: nsauthier@gmail.com This file create and does most of the analysis on the AutoEncoder and the two classifiers. """ ## for Model definition/training from keras.models import Model, load_model from keras.layers import Input, Dense, concatenate, Dropout,Add from keras.layer...
43096280ec5f0f201acd20d64092d31fe0ae141b2ccab66f479d788378e2791d
Python
33,455
841
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/falcon_mamba/modular_falcon_mamba.py. # Do NOT edit this file manually as any edits will be overwritten by the ge...
eb6d492eb0298bb2f51bdff65ea8595d5218d0aaf2338e4aa9b9643706235c94
Python
33,610
742
# 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...
accd21392f63b674ea9b1b5dbda85fb0834d532357fb29943e273a9320b4dd0a
Python
33,707
730
# Copyright 2025 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...
00f920e1b9de5aa379ee3562d678348d17634762c5639dde7b81043b523b1fad
Python
33,713
1,038
"""Utility functions and classes. This file largely consists of the old _utils.py file. Over time, these functions should be moved of this file. """ from __future__ import annotations import importlib.util import inspect import re from contextlib import suppress from functools import partial, reduce, singledispatch,...
5ae0c1a3e5c71ffa9c4267ca12483b49d281e3ff46eedfb9edad085816a7a32d
Python
33,716
989
import os from math import ceil from contextlib import contextmanager, nullcontext from functools import partial, wraps from collections.abc import Iterable import torch from torch import nn import torch.nn.functional as F from torch.utils.data import random_split, DataLoader from torch.optim import Adam from torch.op...
ebf08b45177cfc4870064c00888f55e00eea78e477acfa0451dd1a350bc278fa
Python
33,788
833
import imgui import numpy as np import slideflow as sf import slideflow.mil import threading import importlib import traceback from functools import partial from tkinter.filedialog import askdirectory from os.path import join, exists, dirname, abspath from typing import Dict, Optional, List, Union from slideflow.util ...
20f71311e308f21580cb2fd447b725eeac937121cdd4893b65a5d03a7f2728bf
Python
33,811
1,029
"""Columnar storage for DGLGraph.""" from __future__ import absolute_import from collections import namedtuple from collections.abc import MutableMapping from . import backend as F from .base import dgl_warning, DGLError from .init import zero_initializer from .storages import TensorStorage from .utils import gather_...
117cf2477336a5c8b58571206baf7939263c7115a87ca4d56992fa600961b86b
Python
33,816
737
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/laguna/modular_laguna.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of ...
1c9631135a4182cc28d4acf5b8440db0b73adca48014f13ff7eff7135d35ac70
Python
33,905
811
# ----------------------------------------------------------------------------- # Copyright (c) Yongning Lei 2024-2025 # All rights reserved. # # This script is distributed under the Apache-2.0 license. # You may use, distribute, and modify this code under the terms of the Apache-2.0 license. # See the LICENSE file for...
867e2d7c02ada69074bdd01e27ff29aec143002fe39d773d50df461538b8ac9b
Python
33,916
701
# Copyright 2023 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...
ab29078b3dd7d6ef3bfc4d5815bc490dc7bdab18b7df5558e33900c0a5d6b49d
Python
33,949
752
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/granitemoe_swa/modular_granitemoe_swa.py. # Do NOT edit this file manually as any edits will be overwritten by th...
a48df7d7fa357913d385b754102fb49d54e1d3fd939243d2c954fbe4e9410820
Python
33,965
792
# Copyright 2023 The Bigcode team and 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...
3f88a89ef57f91a14217deb57fd99ea71244a981335983acae43411937989335
Python
33,971
846
""" Select 100 GRDA and 100 LRDA patients from the external drive, stratified by estimated frequency, for annotation round 1. Run: conda run -n foe python code/select_rda_candidates.py """ import sys, os, ast, json, base64, warnings, traceback import numpy as np import pandas as pd import matplotlib matplotlib.use('A...
1fc23e8bab9a3e1bc304f1bd636cebd0edae5d678c464ea4f4e24e15cf41be15
Python
34,035
959
"""Utility functions and constants for slide reading.""" import slideflow as sf import cv2 import csv import io import numpy as np import shapely.validation as sv import shapely.geometry as sg import shapely.affinity as sa import xml.etree.ElementTree as ET from shapely.ops import unary_union, polygonize from PIL imp...
6a01af6e2399c18e70cecc98a81661f5f6251836172455a475aaf02050407555
Python
34,120
754
""" =============================================== :mod:`ec` -- Evolutionary computation framework =============================================== This module provides the framework for creating evolutionary computations. .. Copyright 2012 Aaron Garrett .. Permission is hereby granted, free ...
6df0241e0d5a3cf93a4a16439367d763acc04982c28a14e07d315fd59db7339c
Python
34,146
801
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/jetmoe/modular_jetmoe.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of ...
300a330aa4d8943d322d46a65c6c9a68cde3f4c6a5d9cf93c9f2502601434d88
Python
34,158
905
#!/usr/bin/env python """ Collection of TPT-related functions and utilities for Hi-C analysis Part of ChromaWalker package """ import numpy as np import copy from numpy.linalg import solve import plotutils as plu import hicFileIO as hfio import dataFileReader as dfr import msmBasics as mb import msmBookKeeping as mbk...
c9aac2ce0260a64d1d8493eeba4f31216b479f3d90269d1fe5719959a6083bf0
Python
34,161
695
# coding: utf-8 # Author: C.J. Hutto # Thanks to George Berry for reducing the time complexity from something like O(N^4) to O(N). # Thanks to Ewan Klein and Pierpaolo Pantone for bringing VADER into NLTK. Those modifications were awesome. # For license information, see LICENSE.TXT """ If you use the VADER sentiment a...
ad2f8292ff6642a691650e25ee72b033d4d80df5fcfc1282caafe10154ca0e21
Python
34,174
944
""" ==== Core ==== """ import os import sys import time import json import psutil import pickle import platform import subprocess from datetime import datetime from typing import TypeVar, Optional from PySide6.QtUiTools import QUiLoader from PySide6.QtCore import Qt, QTimer, QSize, Signal, QThread, Slot from PySide6....
467ee7d1a9a824297c1461dec9d3884fa5800322ece24146ddc873c973c1ef25
Python
34,274
633
import json import time import warnings from abc import ABC from collections import OrderedDict from copy import deepcopy import numpy as np import torch from torch.nn import functional as F from ..tokenization_utils_base import PreTrainedTokenizerBase from ..utils import add_start_docstrings, logging logger = logg...
ae74900d7d811312942cc22556188ee061ea8daf946bc985e004af92984bd32f
Python
34,277
800
# Copyright 2025 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...
a023f655a64a2cc70f732c885c8b8c40ef251c1900b5f4a9231360785297a0a8
Python
34,362
775
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/higgs_audio_v2/modular_higgs_audio_v2.py. # Do NOT edit this file manually as any edits will be overwritten by th...
1f6400cddf499a43e6bd661ccf70259e6c98358f73ff0487eee8de69daa57662
Python
34,444
837
# Copyright 2026 OpenBMB 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 requ...
e58354d5c52eab81b1f05c09f97fb17f4917ad6c1d7e9dd8e03108e5ad78629d
Python
34,604
836
# Copyright 2022 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 ...
d5eaa228bbcf235b89eb5b186caf34894ceb97c9f9420479c2c8ebd34824e21f
Python
34,661
811
# Copyright 2023 Meta Platforms, Inc. and affiliates, 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/license...
1e5c345e1e422cf176691ff24779128a86ff15bb4579eb87230988745bc56b4a
Python
34,760
996
"""Utility functions for slideflow.Project.""" import re import os import requests import tempfile import logging import pandas as pd from collections import defaultdict from functools import wraps from os.path import dirname, exists, join, realpath, isdir from types import SimpleNamespace from typing import Any, Call...