sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
36bba2c9b4daed7e6de7f76e72fa35fad1cfefa3ce5cc2c836b29b9fca08e053 | Python | 34,936 | 756 | # Copyright 2025 Sesame 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 requi... |
936ad0a1d0474b05ebb087633623a17d7e2f797cc5a617ec9042487c009871c3 | Python | 34,983 | 958 | """
Train a 1D CNN with temporal attention for channel-level PD detection
+ multi-task frequency estimation, then evaluate as a patient-level
frequency estimator to compare with Ridge/RF handcrafted methods.
Uses 5-fold patient-stratified CV. Multi-task loss:
loss = BCE(pd_pred, pd_label) + alpha * MSE(freq_pred, lo... |
2dcd7d68711e80b76c38c6593a6f376bdd709802f23405f2a6e62cdece045651 | Python | 34,987 | 606 | ############################################################################
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/l... |
2768c0aa19af9987f46414732812eff1473c6e206c18a38f58d9973c668c6c62 | Python | 35,059 | 886 | """
Generate misclassification review viewer for subtype, laterality, and frequency.
Runs LOPO classification/regression, identifies errors, generates EEG images,
and builds an HTML viewer where MW can review and update labels.
Must run with: conda run -n foe python code/generate_misclass_reviewer.py
"""
import sys,... |
936108b9b2e21a0bc100f5eb6fe3ecb50a0f0e4aad41ab1f80e6c5083ab0266e | Python | 35,077 | 996 | """
show_bids_acqtimes.py
---------------------
For each sub/ses, read AcquisitionTime from ALL modality JSON sidecars
(anat / func / dwi / fmap) and print a table sorted by time.
When --labnote / -l is supplied, compares BIDS against the lab-note
spreadsheet (VOTCLOC_subses_list.xlsx) and reports mismatches.
Output ... |
20fe5968979c61a67141b9e7fae901616fcbb5b023ede9737e1c806c83d38d6f | Python | 35,148 | 894 | # pylint: disable=global-variable-undefined, invalid-name
"""Multiprocess dataloader for distributed training"""
import inspect
from abc import ABC, abstractmethod
from collections.abc import Mapping
from .. import backend as F, transforms, utils
from ..base import EID, NID
from ..convert import heterograph
from .dist... |
e247bce34e4caaa02e22487177ee9596dc4b5a8690f81e932cb00481427ec1b6 | Python | 35,171 | 827 | """
HemiNet: U-Net with Transformer bottleneck for single-hemisphere discharge detection.
Design A (Experiment 1.1):
Input: (B, 8, 2000) — 8-channel hemisphere EEG, z-scored
Output: event_logits (B, 1000) — discharge center logits at 100 Hz
active_logits (B, 1000) — active-regime logits at 100 Hz... |
c459663ebc012f678c76bcef0a756fe98fd31efdb9fae3a18734c2f3b2736e72 | Python | 35,195 | 1,099 | import os
from black import err
import pandas as pd
import numpy as np
import seaborn as sns
import glob
from pathlib import Path
import matplotlib.image as mpimg
from PIL import Image
import matplotlib.pyplot as plt
from nilearn.surface import load_surf_data
from nilearn.image import math_img
from matplotlib.colors im... |
596e38424e41f2d01d720f48ff01f79373e86cc943640a8cdb72574bd2b20d05 | Python | 35,215 | 926 | # """
# MIT License
# Copyright (c) 2020-2025 Garikoitz Lerma-Usabiaga
# Copyright (c) 2020-2022 Mengxing Liu
# Copyright (c) 2022-2023 Leandro Lecca
# Copyright (c) 2022-2025 Yongning Lei
# Copyright (c) 2023 David Linhardt
# Copyright (c) 2023 Iñigo Tellaetxe
# Permission is hereby granted, free of charge, to any per... |
84ce6b0ebefe7ecb13f98cffdabbde0ed8a3791f670600bf5642433caec3805f | Python | 35,262 | 865 | """
Domain Adversarial Neural Network (DANN) for purifying CNN embeddings.
Problem: CNN backbone captures patient identity rather than generalizable discharge features.
Solution: Gradient reversal layer forces backbone to learn features useful for classification
but NOT useful for identifying the patient.
A... |
8e406368623f05a477dcc94e9e25a18753d2b77bde86279df215d16d2e26604a | Python | 35,322 | 901 | # Copyright 2018 The Google AI Language 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
#
# Unle... |
8b5198239676c33d188f45bb9288602230edb3fad38b67154f964dee1f2e6622 | Python | 35,383 | 827 | # 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... |
18863df4434d0995e4b91f5a0c2ef4059c6c8af2d857822c2cd72bb0e010e7a7 | Python | 35,474 | 1,000 | # 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... |
108de1448da68581e9c4e49fa8cb265598af4b432e741a259aab55787058381d | Python | 35,496 | 734 | # Copyright 2026 The HuggingFace Inc. team. All rights reserved.
# Modifications Copyright (C) 2025, Advanced Micro Devices, Inc. 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 Lic... |
513ac5d3478d797b8d6943dc34dd10bf39e8d7fe0cd09da9595b2957d918a2e8 | Python | 35,595 | 988 | """
Generate HTML viewer for reviewing auto-labeled RDA wave peaks.
Features:
- Pre-rendered EEG images with wave peak markers + filtered signal overlay
- Accept/Reject buttons for en-bloc review
- Interactive add/delete mode for manual peak editing (click to add, right-click to delete)
- Filter by review tier... |
55252f02dfcede3da863b4424cb9fe392c966c68317b38de5109a6739fc9e81f | Python | 35,726 | 1,147 | """Provide tests for JuniferConnectivityMeasure class."""
# Authors: Synchon Mandal <s.mandal@fz-juelich.de>
# License: AGPL
import copy
import sys
import warnings
from math import cosh, exp, log, sinh, sqrt
from typing import TYPE_CHECKING, Optional
import numpy as np
import pytest
from nilearn.connectome.connectiv... |
87c8116817c9f8bebefde3424226dbdeeb0cdce76fc3c1eca4b2cb2aa08b2a78 | Python | 35,758 | 926 | # 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... |
111053c0ce1350cba7f17747c846af58560bb14a2c124dfcba30cf9605300431 | Python | 35,792 | 1,082 | """
Generate interactive HTML viewer for cases where gold standard frequency
and IPI-derived frequency disagree by > 0.3 Hz.
MW reviews each case and can:
- Update the gold standard frequency
- Edit discharge timing markers (add/delete/move)
- Accept both as-is
Sorted by error magnitude (largest first) so worst... |
34fd344de2ebe07c60aa1b176cd7d0545983636b13c31f369a35b3eedc7cefd3 | Python | 35,808 | 922 | #!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Copyright (c) Yongning Lei 2025-2026
# Apache-2.0 license
# -----------------------------------------------------------------------------
"""
project_to_spaces.py
Project tedana outputs (native BOLD space) to other... |
de038689f8d999faef4fa5ab77c547c3c93b13d809d329e1a5a613f54da755aa | Python | 35,865 | 705 | # 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 ... |
c66895509084a0a142db6102628c9e52c46a5f5991d93ff78430833c1e1ddf61 | Python | 35,872 | 762 | """
Error pattern analysis for max(HPP,CET)+CNN_freq+optimized_DP method.
Analyzes per-case TP/FP/FN breakdown, frequency estimation quality,
subtype performance, and comparison between HPP-only and max_combine.
Usage:
conda run -n foe_dl python code/analyze_error_patterns.py
"""
import sys
import json
import ti... |
4e18ec0f769f22790e824202bcc64602f4e760dd6a8fec1248dd86b85ab14096 | Python | 35,880 | 925 | # Copyright 2025 Westlake Representational Learning Lab (Fajie Yuan Lab) 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:... |
4d4e763be2b9cf592c49c93715870643c09c8b140cac46f02d0c48668a69ea2a | Python | 35,887 | 915 | # Copyright 2023 Microsoft 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
#
# ... |
12faee4e893591c809258792daa08d869339d92fe119ebb3949a0ea2ed96e009 | Python | 35,900 | 983 | # 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... |
e54492b4fb88292e87b7e08191fe2802fcdb5338488e974b56b045c62c1634f3 | Python | 35,973 | 826 | # Copyright 2021 The OpenAI Team Authors 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 a... |
9be7a56cf8670c17d78c9315e49e4ad9e9b3122c09f392c076f0e9c7d1939ab1 | Python | 36,026 | 792 | # 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... |
edf06c7f3f183170fe47b7f8a2ed9759b14170bcfc464f66575010faf141c04f | Python | 36,026 | 816 | # Copyright 2024 The ggml.ai team and The HuggingFace Inc. team. and pygguf author (github.com/99991)
# https://github.com/99991/pygguf
#
# 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
#
# ... |
de5719828551e7817c56221e16d839b74b6e7bd402acf278b97e633db4346750 | Python | 36,062 | 818 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/doge/modular_doge.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
d6078a45757a2b7c6968c6921a1b3ddc4fcd774e4a57d30352964d784972360c | Python | 36,088 | 879 | """
Automated Periodic Discharge Detection from Raw EEG
Self-contained implementation of the best-performing method for detecting
periodic discharges (LPD/GPD) in 10-second EEG segments. No gold standard
labels are used as input — the system operates from raw EEG only.
Method: product-boosted max(HPP, CET-UNet) + CNN... |
a74851cf594d66aafdf9aa42464c7b5c8eaddc5ef824c9ae63d42f4b8891707d | Python | 36,099 | 1,214 | """RDF datasets
Datasets from "A Collection of Benchmark Datasets for
Systematic Evaluations of Machine Learning on
the Semantic Web"
"""
import abc
import itertools
import os
import re
from collections import OrderedDict
import networkx as nx
import numpy as np
import dgl
import dgl.backend as F
from .dgl_dataset i... |
ba39f0c14ab29291aa0d9cd13b8b4570f25d1a49786c045b5d761a94cd9de2de | Python | 36,161 | 910 | # Copyright 2022 Microsoft Research Asia 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 ... |
f47c0f603ae9ac9fd71f21cf8c87fe1a7728b14c6c220fb0aeefc09e0a0bfbcb | Python | 36,168 | 720 | """Estimate vertebral heights from fitted endplate support planes."""
import asyncio
from itertools import permutations
import numpy as np
from sm_image import SMImage
from sm_sample_id import SMSampleID
from sm_sample_processor import SMSampleProcessor
def _spatial_array(input_mask: SMImage) -> np.ndarray:
ar... |
cb3fd0e8b772675a8dbed4cdf9711a6c17c33f6781cb7af8f09a18f515b0f454 | Python | 36,178 | 1,091 | """
Generate HTML viewer comparing 3 evidence methods:
1. HPP handcrafted (pointiness + TKEO)
2. Old CET (CETModel encoder-decoder, no skip connections)
3. New CET-UNet (CETUNet with skip connections)
Shows ALL 593 LPD+GPD patients (sorted by gold_standard_freq).
For each case:
- Canvas EEG rendering (18 bipol... |
1034ec3b85c14da178bd324e4a27bdef6dd6b8633242704e84584c32b6c97aa4 | Python | 36,233 | 942 | # Copyright 2018 Google AI, Google Brain 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 ... |
688d8019e1090a00ae8cf20d067ee5ce82ad61345c5fb797fc273de3a7eaa364 | Python | 36,261 | 893 | import abc
import copy
import os
import random
from typing import Any, Dict, List, Optional, Union
import numpy as np
from rl_nav import constants
from rl_nav.environments import (
escape_env_cardinal,
escape_env_diagonal,
hierarchy_network,
visualisation_env,
escape_env_diagonal_hierarchy,
)
from ... |
b1a713f6c83757447ebfc3c998f93d19d7bb5d313731581f770b15ab6756cb2f | Python | 36,263 | 855 | # Copyright 2021 The EleutherAI and HuggingFace Teams. 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 requi... |
6de420fc0a21dfa1d1858fb443e40711d854e295905770dafe634518737b4277 | Python | 36,295 | 853 | # 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... |
cf978cb706708e6e84ce5dd452be16dfa399b088579785f742bb865b65c932e6 | Python | 36,384 | 872 | # 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... |
541eb333ac23705edf13493f14c2d4eebae1b75f331399860854c406fc467f50 | Python | 36,411 | 819 | # -*- conding: UTF-8 -*-
# version: 0.3.0
# edited by: Zhou Zhanhong
import os
import sys
import time
import datetime
import glob as glob
import copy
from collections import OrderedDict
from tqdm.auto import trange, tqdm
import argparse
import random
import math
import numpy as np
import scipy
import scipy.signal
... |
490fae0462d90b2d74e83605dcd409cd262a823a228510d0acc76d8221cbfe29 | Python | 36,426 | 1,326 | # 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... |
547f11b104ed1a14018a92d0b25e0a32c122d1b1c59e09ab1454be7e57fd197b | Python | 36,431 | 1,082 | import hashlib
import os
import pickle
import pandas as pd
from ogb.utils import smiles2graph as smiles2graph_OGB
from tqdm.auto import tqdm
from .. import backend as F
from ..convert import graph as dgl_graph
from .dgl_dataset import DGLDataset
from .utils import (
download,
extract_archive,
load_graphs... |
f3d10b463761effe81da28550c6d91e7eae6fed2186c026389abab0467b8cbc6 | Python | 36,436 | 862 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/internvl/modular_internvl.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation... |
96d73cdf1b2f8eef1f565739028e09e8754eddfb0776652b759f3fcfbd708374 | Python | 36,484 | 1,124 | # 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... |
0d82350f14c03ee30105ab36efd7b4831eedebe8b5c4ea5686b56aa60bfbb762 | Python | 36,539 | 808 | import warnings
import os
from math import pi
import torch
from torch import nn
import torch.nn.functional as F
from torch_scatter import scatter
from e3nn.nn import Gate, Extract
from e3nn.o3 import Irreps, Linear, SphericalHarmonics, FullyConnectedTensorProduct
from .from_nequip.cutoffs import PolynomialCutoff
from ... |
d02a7d86a0e0e09b7c1c9e38f28d09d535c63897a5c2bb4021d9492effd96924 | Python | 36,774 | 851 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/dia/modular_dia.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
71f7ed72966363ed147d27211743f853a3c11df16da8e6039bba68ee2eb3e4a8 | Python | 36,834 | 852 | # 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 ... |
d6c4cf5ae5e3f09689b194a3b2b0ec47a9d3e49b52a06a3f962d36f2f99914b8 | Python | 36,858 | 1,178 | """Internal utilities."""
from __future__ import absolute_import, division
import glob
import os
from collections import defaultdict
from collections.abc import Iterable, Mapping, Sequence
from functools import wraps
import numpy as np
from .. import backend as F, ndarray as nd
from .._ffi.function import _init_api
... |
cf39655e3973b4a8316143c1fac1c928dbde514f46a4680c5399f5d491ece613 | Python | 36,872 | 967 | """
MIT License
Copyright (c) 2020-2023 Garikoitz Lerma-Usabiaga
Copyright (c) 2020-2022 Mengxing Liu
Copyright (c) 2022-2024 Leandro Lecca
Copyright (c) 2022-2023 Yongning Lei
Copyright (c) 2023 David Linhardt
Copyright (c) 2023 Iñigo Tellaetxe
Permission is hereby granted, free of charge,
to any person obtaining a ... |
c0168715963620d7b9a7e7542a40a13c258b103735b7d239c1d683559dde0904 | Python | 36,918 | 991 | # detect peak
from repli1d.analyse_RFD import detect_peaks, compare, smooth, mapboth, get_codire, cut_larger_than
from repli1d.fast_sim import get_fast_MRT_RFDs
from repli1d.expeData import replication_data
from repli1d.single_mol_analysis import compute_info, compute_real_inter_ori ,compute_mean_activated_ori
from r... |
98d51803088eebbca22be62db39a46c1bc94bd8dab255dfc6628cc25af2defd1 | Python | 36,999 | 944 | from math import sqrt
from random import random
from functools import partial
from contextlib import contextmanager, nullcontext
from typing import List, Union
from collections import namedtuple
from tqdm.auto import tqdm
import torch
import torch.nn.functional as F
from torch import nn
from torch.amp import autocast
... |
920c5884bef1e73176d647dfae3d24134538c4159223c903b54c1bba07ae5666 | Python | 37,087 | 932 | # Copyright 2024 state-spaces/mamba2 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 a... |
3e5fdd4d36cea34eb62b14b86b5505614de58a569b950873b03d9f3904f3c5d2 | Python | 37,189 | 982 | #!/usr/bin/env python
"""
Phase 1: Confidence-Weighted Fusion of CNN + ACF Frequency Estimates
====================================================================
No retraining required. Uses existing model weights and adds an adaptive
fusion layer based on estimator confidence proxies.
Variants tested:
V1_Inverse... |
d4f2a8ea9f5456c0153755861e5f621944b082c49fe1bb0c15df3d3356b263fc | Python | 37,270 | 1,060 | """
=======
Montage
=======
"""
import os
import json
import logging
from typing import List, TypeVar, Dict, Optional
from PySide6.QtGui import QCursor
from PySide6.QtCore import QTimer, QSize, Qt
from PySide6.QtWidgets import (
QLabel,
QComboBox,
QTableWidgetItem,
QApplication,
QCheckBox,
QHe... |
226f5a24b6aa15eca90bcc74e6bf1e2e887687ccfeb0d1ae28da4bf4c216038f | Python | 37,275 | 806 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glm_moe_dsa/modular_glm_moe_dsa.py.
# Do NOT edit this file manually as any edits will be overwritten by the gene... |
89458610148bc275a5fb0bf71e1efaa3b1974b5b9ac63e4c21bef66f0f8c42bf | Python | 37,354 | 923 | #import uuid
#import datetime
import sys
import numpy as np
import inspect
import csv
import os
import time
from typing import Any, Dict, Optional, Tuple, Iterable, Union, get_type_hints, get_args, get_origin
import types
import argparse
import json
import asyncio
from abc import ABC, abstractmethod
import zlib
import ... |
ce63534cb3740798c8a3511934d5c14e79b1c89f7056db76ea3ccf2873f59163 | Python | 37,442 | 848 | # 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
#
... |
1a04c609c3646cdaa7d4e70eeb571eb23d6c7226edb198beb37d98db07e7f059 | Python | 37,449 | 941 | """Torch Module for GNNExplainer"""
# pylint: disable= no-member, arguments-differ, invalid-name
from math import sqrt
import torch
from torch import nn
from tqdm.auto import tqdm
from ....base import EID, NID
from ....subgraph import khop_in_subgraph
__all__ = ["GNNExplainer", "HeteroGNNExplainer"]
class GNNExpl... |
fe18aa35920ed4c8e0dcf081e564a95290c2af400092eb6fc211770f119e13d6 | Python | 37,460 | 895 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/minicpmv4_6/modular_minicpmv4_6.py.
# Do NOT edit this file manually as any edits will be overwritten by the gene... |
554f705c8dccd668bd7bb3cd842824539dd342e639451975788d9443ded6fd1b | Python | 37,475 | 1,008 | # Collection of functions for reconstruction of 3D embedding of structures
# from a given distance matrix
# Import
import numpy as np
import sys
import os
import matplotlib.pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
import hicutils as hcu
#import plotutils as plu
#import networkx as nx
#import seaborn as ... |
ef35da233c42150342f1988a589c34b9005a685ce4e70cf567fabcda51e1a418 | Python | 37,478 | 1,039 | """Neighbor sampling APIs"""
import os
import torch
from .. import backend as F, ndarray as nd, utils
from .._ffi.function import _init_api
from ..base import DGLError, EID
from ..heterograph import DGLBlock, DGLGraph
from .utils import EidExcluder
__all__ = [
"sample_etype_neighbors",
"sample_neighbors",
... |
a67562c87abc451856ba5b7f129ea7c010e7570ee79940c27645fb0f09ab64a4 | Python | 37,493 | 901 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# 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... |
7903c01837cd9f8fb6f1ad97ed3dd4bc9aa134e9829cc5c30ffed3cf20432931 | Python | 37,523 | 1,434 | """RPC components. They are typically functions or utilities used by both
server and clients."""
import abc
import os
import pickle
import random
import numpy as np
from .. import backend as F
from .._ffi.function import _init_api
from .._ffi.object import ObjectBase, register_object
from ..base import DGLError
from ... |
882356a1fd1ed6a53d740faec330b1853f2aa631ed6ff3159fd1d24bf77a4de8 | Python | 37,545 | 982 | #!/usr/bin/env python3
"""
Check DICOM file counts in raw data directories.
"""
from pathlib import Path
from typing import List, Dict, Tuple, Optional, Set
from dataclasses import dataclass, field
from collections import defaultdict
from concurrent.futures import ProcessPoolExecutor, as_completed
import re
import typ... |
6a335a12950936462c67b1409b63feb5cf679705bfda9745ad633842eedefd40 | Python | 37,698 | 883 | # Standard library imports
import functools
import glob # for file and directory handling
import io
import itertools
import mmap
import multiprocessing
import os
import warnings
from collections import defaultdict
from contextlib import redirect_stdout
from typing import List, Optional
import dask
import dask.array a... |
22368f3137c18ba333613974f7c9e8ce5744812da3c64aea08e8148409f584d4 | Python | 37,766 | 815 | # Copyright 2026 IBM 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
#
# Unless required by a... |
03921970aa0073cb8505a1250e02a4341f55b19ab90450fe313522bd89cfc166 | Python | 37,822 | 888 | """
.. _model-transformer:
Transformer as a Graph Neural Network
======================================
**Author**: Zihao Ye, Jinjing Zhou, Qipeng Guo, Quan Gan, Zheng Zhang
.. warning::
The tutorial aims at gaining insights into the paper, with code as a mean
of explanation. The implementation thus is NOT ... |
91aeaa95edb64d3c25bc0accd127c3c31f55f71df97f04e867bb4d9bc60602f4 | Python | 37,864 | 864 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/kimi_k25/modular_kimi_k25.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation... |
691a64fb3b81c83721e2f6e3a5974bd2ea314414b03ae47887ccca3c241bec87 | Python | 37,873 | 979 | # Copyright 2021 AlQuraishi Laboratory
# 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
#
# U... |
e989677db5faf63bc242c48bf9f62087142a46df5107ef2163be2d6e985f1cf7 | Python | 37,885 | 952 | # Copyright 2021 Microsoft 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
#
# ... |
1490d0845bc37fad016ab2683a56d082779bc643108c85b4f94f31028ad665fb | Python | 37,892 | 792 | """
Tool Name: torch_segmentation_learn
=================================
Description:
Trains a deep convolutional neural network (CNN) for segmentation.
Currently single-channel only, but there is no reason for this to be inherently the case (the internal libraries can support multi channel).
Parameters:... |
2a908dcc8a7805f950ff54113066843e2154f75bab7742127745fa15bda4cf82 | Python | 38,032 | 1,050 | # MIT License
# Copyright (c) 2018 Preferred Networks, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modi... |
3c66f426701018e589dfb294908b91abc3271ac5b9186c029d317cb29efc9828 | Python | 38,078 | 1,010 | # 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... |
6f7cfd859e3f785dcc845d9d2e97067f087b526483338bc2c3cb9a37a6e0fb77 | Python | 38,087 | 1,063 | #!/usr/bin/env python
"""
GPD Frequency Estimation Contest — 25 methods
==============================================
Evaluates 25 different approaches to GPD frequency estimation.
LPD path is never modified (always uses baseline PDProfiler result).
Usage:
nohup /opt/homebrew/Caskroom/miniforge/base/envs/morgoth... |
a05656033e0b77ad4f66593676e1ec5d46d563f5d8d9c68502cfb68bac68677c | Python | 38,099 | 851 | # Copyright 2024 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... |
dd1c8404f621b827069756a03c5d523b218cc3addea4c8fdcf085b155dd796dc | Python | 38,125 | 1,366 | """Module for graph index class definition."""
from __future__ import absolute_import
import networkx as nx
import numpy as np
import scipy
from . import backend as F, utils
from ._ffi.function import _init_api
from ._ffi.object import ObjectBase, register_object
from .base import dgl_warning, DGLError
class BoolFl... |
5ab42311a122bd33dba2b2360339ba59077a0b37961178497efcd1973ffb5d55 | Python | 38,136 | 1,080 | """
=====
Cyton
=====
The OpenBCI Cyton PCBs were designed with Design Spark, a free PCB capture
program.
Cyton Board Specs:
* Power with 3-6V DC Battery ONLY
* PIC32MX250F128B Micrcontroller with chipKIT UDB32-MX2-DIP bootloader
* ADS1299 Analog Front End
* LIS3DH 3 axis Accelerometer
* RFduino BLE radio
* Micro S... |
6aea8e959ebdffa7a6225a70ca87d8d88b4ae517607ff44323226a6b49a454ef | Python | 38,182 | 913 | # Copyright 2021 The Eleuther AI and 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 ... |
3dfb325103be351ee44ff1dbe9ae43d24e2b1f83655cfd06ec5fa9f441d2ba26 | Python | 38,244 | 824 | # Copyright 2022 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... |
d1f280e7642d1d4a6bf6c1c2ac895cd898a4f08e7c7772e2836534454058eb64 | Python | 38,382 | 921 | # Copyright 2021 The Fairseq Authors 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
#
#... |
26ce61dc8843aa6913c85d7248882a3b63672add816fd3fdd05d37e91b9946b8 | Python | 38,407 | 919 | # Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.
#
# 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/LICE... |
56aaf650cf063e1782cc25aca365029df494605a5d225f4ffa0886d5ede8ad12 | Python | 38,424 | 830 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/deepseek_v32/modular_deepseek_v32.py.
# Do NOT edit this file manually as any edits will be overwritten by the ge... |
a37af1cd047b805488c11727bc0b999837fd9d2ce876f4c19e03657462b8a332 | Python | 38,613 | 796 | # Copyright 2023 Amazon 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 requi... |
68fce8736c948a193923b1d209e26b02b972a1f2f8d6c6c00dce58b2c34468e4 | Python | 38,636 | 737 | import argparse
import gc
import io
import json
import os
import re
import torch
from tokenizers import AddedToken, processors
from tqdm import tqdm
from transformers import (
GenerationConfig,
Llama4Config,
Llama4ForConditionalGeneration,
Llama4ImageProcessorFast,
Llama4Processor,
Llama4TextC... |
84984dab26bb06dcabec04044fa91cceba2a85607698330042fa0ec93be0c2c3 | Python | 38,650 | 1,180 | import multiprocessing as mp
import os
import tempfile
import time
import unittest
import uuid
import backend as F
import dgl
import numpy as np
import pytest
import torch as th
from dgl.data import CitationGraphDataset
from dgl.distributed import (
DistDataLoader,
DistGraph,
DistGraphServer,
load_part... |
1ca830174f88d220f5fb1c5c987a70cd8fc455986a9014830c9c4bf2027ae249 | Python | 38,721 | 862 | # 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... |
4a14a47bca2d2da2824c0315cf1e96da7323fbbb4275c4602ac79413df5f8302 | Python | 38,750 | 813 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/llava_onevision/modular_llava_onevision.py.
# Do NOT edit this file manually as any edits will be overwritten by ... |
dbbe158209cc353be823f0d79e9c6456ffd85a54c2b5e860856a688488e3ad8c | Python | 38,758 | 1,001 | """Classification, regression, and survival metrics for predictions."""
import multiprocessing as mp
import warnings
import numpy as np
import pandas as pd
from pandas.core.frame import DataFrame
from sklearn import metrics
from os.path import join
from types import SimpleNamespace
from typing import (TYPE_CHECKING, A... |
54016f444345f46e4532978e228cd8f78a30c504ad0fef8c7b1e2c25ce8b218c | Python | 38,766 | 1,084 | """Differential Geometry Functions for meshes.
This module includes gradient, divergence, curvature, geodesics,
mean curvature flow etc.
Note, the interface is not yet final, some functions are split into
tet and tria versions.
"""
import logging
from typing import TYPE_CHECKING, Union
import numpy as np
from scipy... |
52b437ad5b0c4f9b87ad7c847e9c466808885d8dfe41db1e7596a6dca141ba89 | Python | 38,786 | 953 | """Utility for an efficient, tiled Whole-slide image viewer."""
import time
import imgui
import numpy as np
import shapely.affinity as sa
from shapely.geometry import Polygon, Point
from rasterio.features import rasterize
from contextlib import contextmanager
from typing import Tuple, Optional, TYPE_CHECKING, Union, ... |
40a7711124291686d567fe6d8994c970eb47c179c45cdda247c4a192e35663e9 | Python | 38,800 | 872 | # Copyright 2024 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... |
3fb94849225a98c057bc38c088afcdc84ed486eb662a4ffaa18dd9cf7511a9ff | Python | 38,852 | 802 | # 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... |
74e2ac8ce2e6e9a2f5ff71df084855f6699f1e2bf7844ca27a5de328b75fa254 | Python | 38,865 | 688 | # 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 ... |
abad649269a78ab3398fe92bdc1ddf5dc7cb91e300286d17cc92080448fa8e41 | Python | 38,900 | 1,015 | # Copyright 2021 The OpenAI Team 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
#
# ... |
24194020e2519327b1547a365e1db071c753a4f67740a2524648fd5a961d84b6 | Python | 38,922 | 1,315 | """Provide tests for HDF5 storage interface."""
# Authors: Synchon Mandal <s.mandal@fz-juelich.de>
# Federico Raimondo <f.raimondo@fz-juelich.de>
# License: AGPL
from copy import deepcopy
from pathlib import Path
import h5py
import numpy as np
import pytest
from h5io import read_hdf5
from numpy.testing impo... |
00047dbac0e6f7b02f641d3604459eb39f3d42f254adc68684307a70b127b2e1 | Python | 38,966 | 1,039 | """
Evaluation harness v2 for the unified patient dataset.
Uses the unified data structure:
- data/labels/patients.csv (patient list with gold_standard_freq, subtype)
- data/labels/segments.csv (segment list with .mat file references)
- data/eeg/ (.mat files: bipolar 18ch or monopolar 20ch)
Pr... |
e5082accdb24f4d1ade8cf9045d74f173e81bc18ab352b17cef9d826023dd102 | Python | 38,984 | 1,128 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Nipype interfaces core
......................
Defines the ``Interface`` API and the body of the
most basic interfaces.
The I/O specifications corresponding to these base
interfaces are found in the ``s... |
574154b997961950043df94f8a4327f88d17b971903d2b02a67ee5b2b27fc06b | Python | 39,022 | 959 | """Node embedding optimizers"""
import abc
from abc import abstractmethod
import torch as th
from ...cuda import nccl
from ...nn.pytorch import NodeEmbedding
from ...partition import NDArrayPartition
from ...utils import (
create_shared_mem_array,
gather_pinned_tensor_rows,
get_shared_mem_array,
pin_m... |
89152f5e2e83ac4f73161e01a02a5cfd3638906fade1fbc8d775ef2778c5c645 | Python | 39,027 | 894 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtknetworkeditor.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.3 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is dis... |
b564f44a9cee647cfd8a71cdc0e3b8bc0e4ba07ec00b38f51cc37d0a374a9516 | Python | 39,191 | 968 | """
BIPD Detection Pipeline — Two-Stage BIPD vs GPD Classification.
Stage 1: Run HemiCET+DP independently on each hemisphere to get
per-hemisphere discharge times and frequencies.
Stage 2: Compute timing-sequence features, train GBT classifier
on synthetic data, evaluate on real BIPD/GPD cases.
Usag... |
fb000e4fa259957e123e7d06b86fc1c07c784bdcb98c408aa560d09800a09ec3 | Python | 39,210 | 1,098 | 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)
fig = plt.figure(figsize=(15,17),dpi=300)
gs = gridspe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.