sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d7451de8427b45de4992e65f59a8c3be3273dfc33aa1a5a2c7094c7ed08eb15c
Python
27,925
872
#!/usr/bin/env python # encoding: utf-8 """ meshconvert.py A script to convert between tetrahedral mesh formats. Created by Bryan Klingner (stellar.b@overt.org) on 2006-12-07. """ from __future__ import print_function, absolute_import # NEED TO STAY AS TOP IMPORT import sys import getopt import os help_message = \ '...
f09087fd964d5cbb31b844edfaa8d913336322d70a4ea3c5c75eda7a6e044ab5
Python
27,950
820
# Copyright 2022 Google AI 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 re...
2b4e82d4d32772c052230556b98f69d960e5d54a8c1164f1716bd1e25fa3148d
Python
27,973
647
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/higgs_audio_v2_tokenizer/modular_higgs_audio_v2_tokenizer.py. # Do NOT edit this file manually as any edits will ...
d252b776d756f5f94618944916eb121bec6bc365f74d934b65d1fc1893904c68
Python
27,980
859
""" RDA Spatial Localization Viewer. For each RDA segment (LRDA/GRDA) with W05 frequency estimates: 1. Load 19-channel monopolar EEG (200 Hz) 2. Bandpass filter 0.5-20 Hz for EEG display 3. Compute narrowband filter at freq +/- 0.4 Hz 4. Per-channel amplitude envelope via Hilbert -> 19-element vector 5. Comp...
6452a0e325c6ac5f20318f6a44dd80fe1eef37c74e41036158803761687fde5c
Python
28,029
231
from Utils.Results_variables import * from Utils.Settings import Adapt_for_Nature_style from Utils.Utils import Naturize_text results = {"Distance explains most of the ripple strength correlation variability.": f"We studied ripple propagation along the hippocampal longitudinal axis in" \ " an ...
5af598e345980e9385a6eceff432330db62addba843bc8c8107f443502c157b8
Python
28,030
666
import gc import logging import os import array_readwriter import constants import numpy as np import pyarrow import pyarrow.parquet as pq import torch import torch.distributed as dist from gloo_wrapper import alltoallv_cpu from utils import ( DATA_TYPE_ID, generate_read_list, get_gid_offsets, get_idr...
ad8b09e43af9e2464e650dcf171319fda0d53917c0f17a0bd470ca7631ad447c
Python
28,077
723
""" Core OpenBCI object for handling connections and samples from the WiFi Shield 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) wifi = OpenBCIWifi() wifi.start(handle_sample) TODO: Cyton/Gangli...
35ddc90455d27393c9de68d0fe366f27a74588573b803400f78f362eee3a848c
Python
28,101
923
import backend as F import dgl import dgl.function as fn import dgl.nn.mxnet as nn import mxnet as mx import networkx as nx import numpy as np import pytest import scipy as sp from mxnet import autograd, gluon, nd from utils import parametrize_idtype from utils.graph_cases import ( get_cases, random_bipartite,...
2bad378e39807bcfe1ee5ef5f05fccbddb9796e23857d00aed39e779b4d54d18
Python
28,115
657
import os import numpy as np import random import cv2 import re import itertools from dataParameters import * # Versioning specific utils import pkg_resources as pkgs from packaging import version as pkg_version from platform import python_version tfversion = pkg_version.parse(pkgs.get_distribution('tensorflow').versi...
db4519174af9c0eb8626ab86cd3151fcf53f236b387778e623087be4ee026b69
Python
28,116
906
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec iamp = 0.5 def reldiffs(fother,f1,iother,i1): iout = [] rdout = [] N1 = len(f1) Nother = len(fother) for i in range(Nother): ithis = iother[i] for j in range(N1): iba...
61f699390f459980ae0e4eafa0a9f6bc92c53b0ba695d902e332f5297508d15f
Python
28,124
936
"""Provide tests for SQLite storage interface.""" # Authors: Federico Raimondo <f.raimondo@fz-juelich.de> # Synchon Mandal <s.mandal@fz-juelich.de> # License: AGPL from pathlib import Path import numpy as np import pandas as pd import pytest from numpy.testing import assert_array_equal from pandas.testing i...
ec19979c8b45c49753f1b0ee3b6ac9087a4385da3e3283e8f2aaeee92e3c1616
Python
28,195
570
from sklearn.preprocessing import OneHotEncoder from collections import Iterable from utils.dbms_utils import DBMSUtils import logging import random class OneHotEncoderSQL(object): """ This class implements the SQL wrapper for a Sklearn OneHotEncoder object. """ def __init__(self): self.param...
f7c9a049a21bdb874aad762985afe11dfa9e47271216555da1bf805ef0730554
Python
28,202
734
#!/usr/bin/env python3 """ Check HeuDiConv DICOM info files for completeness. """ from pathlib import Path from typing import List, Dict, Optional, Set, Tuple from dataclasses import dataclass, field from collections import defaultdict import csv import re import typer from rich.console import Console from rich.table ...
3806fbc8360ff19059e5e308ee4b51eb67dae4bb02b432f67f9c9f8ce3fad79f
Python
28,218
679
""" ======== Projects ======== """ import os import re import sys import json import pickle import shutil from typing import TypeVar from PySide6.QtGui import QIcon from PySide6.QtCore import Qt, QSize, QTimer from PySide6.QtWidgets import QListWidgetItem, QTreeWidgetItem, QDialogButtonBox, QWidget from PySide6.QtUiT...
58d40929513e87fdbc7f56a8a87d2f80c50e601e953a949894a7d55967098bfa
Python
28,231
854
"""Train Faster-RCNN end to end.""" import argparse import os # disable autotune os.environ["MXNET_CUDNN_AUTOTUNE_DEFAULT"] = "0" import logging import time import gluoncv as gcv import mxnet as mx import numpy as np from data import * from gluoncv import data as gdata, utils as gutils from gluoncv.data.batchify impo...
cbf00607af278e43674678ecbad5f816785da924af6f70bc950669dab2c85ca8
Python
28,275
760
""" Generate HTML viewer for reviewing HPP-detected discharge times. Binary review: MW marks each case as Correct (C) or Incorrect (I). Generates EEG images with discharge timing markers overlaid. Usage: conda run -n foe python code/label_pipeline/generate_timing_review_viewer.py """ import sys, json, base64, io...
21f58a18b064d9f06f6bb350ee188945f014ec084808a29d04dcb8b11faa8e65
Python
28,348
946
"""ANTs' utilities.""" import os from warnings import warn from ..base import traits, Tuple, isdefined, TraitedSpec, File, Str, InputMultiObject from ..mixins import CopyHeaderInterface from .base import ANTSCommandInputSpec, ANTSCommand class ImageMathInputSpec(ANTSCommandInputSpec): dimension = traits.Int( ...
4a1d5748c5376d5d62b56db2c9fd6631915498a04c5afd858191402f402dc0ca
Python
28,378
669
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/afmoe/modular_afmoe.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
191a06d660e974dde122d3e9197e3c9a30e0b0fac877b56a43ee397e3c4bd54f
Python
28,387
652
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtkmeshclipcenterlines.py,v $ ## Language: Python ## Date: $$ ## Version: $$ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENSE file for details. ## This software is distributed WITHOUT ANY WARRANTY; wit...
eb3c5d038921099af6c0be0470356df94d4af440060e5a6a3111dd85f863904b
Python
28,409
623
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/exaone_moe/modular_exaone_moe.py. # Do NOT edit this file manually as any edits will be overwritten by the genera...
8c807b695c6d3835b5035703d6def4a45dfa6296a2b35583064be5f937ee32ec
Python
28,444
654
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/deepseek_v2/modular_deepseek_v2.py. # Do NOT edit this file manually as any edits will be overwritten by the gene...
7f28a5e78d8784d9a183ee4428c93be4606dad452035aed2d90177043ddabae5
Python
28,499
632
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/granite_speech5/modular_granite_speech5.py. # Do NOT edit this file manually as any edits will be overwritten by ...
822f7795ac5b12b2592842b455a767522dff6b27ec86be377bf942c30f69d05b
Python
28,511
649
import re import os import imgui import glfw from os.path import basename from tkinter.filedialog import askopenfilename, askdirectory from .._renderer import CapturedException from ..gui import imgui_utils from ..utils import EasyDict, LEFT_MOUSE_BUTTON, RIGHT_MOUSE_BUTTON import slideflow as sf #------------------...
6edd380da3b0c657fc77cd81c9dc06abe1880a509bd6767dc231b5dd1b112b01
Python
28,521
785
#!/usr/bin/env python3 """Own the single per-user SimpleMind Explorer development server. The public ``start`` command launches a detached supervisor, transfers the per-user advisory lock to it, verifies page and BB-targeted run health, and then exits. The supervisor owns Next.js and the state record until an explicit...
bfdf3959a435b1518c157664a58bd9c848c0da20edc13bc94bedd0c1e2ba42a6
Python
28,527
707
""" Experiment R5: Advanced ensemble methods, stacking, and LPD-specific deep dive. The LPD gap is our main challenge (algorithm rs=0.425 vs expert 0.53). This experiment tries aggressive LPD-targeted approaches. Approaches: a) r5_stacked_ridge: Two-level stacking with 3 ridge models b) r5_lpd_aggressive: Max of ...
1473798d1f3e32dd52461c8ef2919a479131552c84e4090f23e32376fc305677
Python
28,536
815
""" ========== Cyton Base ========== """ import re import time import logging import pickle from threading import Thread from datetime import datetime from functools import cached_property from abc import ABCMeta, abstractmethod from multiprocessing import Process, Manager from typing import Optional, Union, Literal, ...
722b8d0573bd711be51bee4f304efe43893ab38f845371db71574297c80932d9
Python
28,553
747
"""Node embedding optimizers for distributed training""" import abc import warnings from abc import abstractmethod from os.path import exists import torch as th import dgl from .... import backend as F from ...dist_tensor import DistTensor from ...graph_partition_book import EDGE_PART_POLICY, NODE_PART_POLICY from ....
914f2b00a1f60fe73eea8cb9eb29d2e49928d8c2cd573ff7ae22babbdaf37e98
Python
28,561
772
""" =========== Connections =========== """ import sys import os import json import time import types import pickle import shutil import logging import requests from openbci_stream.acquisition import ( Cyton, CytonBase, wifi, restart_services, ) from PySide6.QtCore import Qt, Signal, QThread, Slot, QT...
2fc095b489dd7bbe9e2b8e9792c45bd736b99b7c8cffb774f8e14131b5d891c3
Python
28,592
657
# Viz functions """ miscelallaneous functions and classes to visualize simulation data """ """ Importage """ from scipy.io import loadmat # Suppress warnings; keeps things cleaner import warnings warnings.filterwarnings('ignore') # Standard scientific python import commands import os,sys,glob,numpy as np,pandas as...
bf52a2c235bcd2e16f762314dae5c7ccea62729815b9869e6e5c2e1260e646eb
Python
28,652
830
from django.http import HttpResponse, FileResponse, Http404 from django.core.files import File from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.parsers import FileUploadParser, MultiPartParser, FormParser import os import json...
ec5d773aa2322dccb440ec97101ce14f807656158821fcb523ea4bb6e95cea8a
Python
28,673
642
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/granitemoe/modular_granitemoe.py. # Do NOT edit this file manually as any edits will be overwritten by the genera...
22a4bd730f6721864670aff6957a3d6c3a6fa1d5ab94ef83ba10770b6b08076c
Python
28,689
687
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtktetringenerator.py,v $ ## Language: Python ## Date: $Date: 2006/07/27 08:27:40 $ ## Version: $Revision: 1.14 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENSE file for details. ## This software is ...
280b7bdf8b1a9967f2a4f2383c95f1085c1f1382d9310f0b8c3fb0f62dc10314
Python
28,691
953
"""Cora, citeseer, pubmed dataset. (lingfan): following dataset loading and preprocessing code from tkipf/gcn https://github.com/tkipf/gcn/blob/master/gcn/utils.py """ from __future__ import absolute_import import os, sys import pickle as pkl import warnings import networkx as nx import numpy as np import scipy.sp...
813d35020cac8bfd07cc0790d56b260e599fba52a52209eb1419a97cc7a08379
Python
28,735
918
""" Modeling Relational Data with Graph Convolutional Networks Paper: https://arxiv.org/abs/1703.06103 Code: https://github.com/tkipf/relational-gcn Difference compared to tkipf/relation-gcn * l2norm applied to all weights * remove nodes that won't be touched """ import argparse import gc, os import itertools import t...
3e2f5a926f507515cbf0d2269f5ad59472ca0cb216d510b06c4985bb011130dd
Python
28,753
854
import os import unittest from collections.abc import Iterator, Mapping from functools import partial import backend as F import dgl import dgl.ops as OPS import numpy as np import pytest import torch import torch.distributed as dist import torch.multiprocessing as mp from utils import parametrize_idtype @pytest.ma...
9f77c850161fd7c9eba6d4ba1b4f14179cb7779917ecf025aa3cdae3da9ef653
Python
28,799
704
import imgui import numpy as np import slideflow as sf import slideflow.grad as grad from typing import Union, List, Optional, Tuple from array import array from collections import defaultdict from slideflow.util import isnumeric from ..utils import EasyDict, LEFT_MOUSE_BUTTON from ..gui import imgui_utils # --------...
48eaee2d2b6476a01413ad62ed6a7b57f60eddc2d3c0df667dbd1d5b1a9dd636
Python
28,810
772
""" Train a 1D CNN for channel-level PD detection with multi-task frequency estimation. Uses 5-fold patient-stratified CV. Multi-task loss: loss = BCE(pd_pred, pd_label) + alpha * MSE(freq_pred, log_freq_target) * pd_mask Compares against logistic regression baseline (channel AUC 0.766, patient AUC 0.902). """ imp...
953f0a8193a7096177a2f6a9f62bfa1244fa9acd360019935e109f09157fe4c9
Python
28,817
885
""" HPP-Assisted Discharge Labeling Tool for Harvested Segments. Semi-automated labeling: user clicks a frequency button (0.25-4.5 Hz), HPP runs with that frequency as prior and shows inferred discharge times. User can accept, adjust frequency, or manually add/delete markers. The "cheating" HPP achieves Spearman >0.9...
9899faf14ed735b5ca5daa79d4a011ff57c19f1599145c34aa7f542152c1f1a1
Python
28,928
820
""" Reinhard normalization based on method of: E. Reinhard, M. Adhikhmin, B. Gooch, and P. Shirley, ‘Color transfer between images’, IEEE Computer Graphics and Applications, vol. 21, no. 5, pp. 34–41, Sep. 2001. """ from typing import Tuple, Dict, Optional, Union import torch import numpy as np from contextlib impor...
64f74c2a48aaea23611b133876b3870daec9805864726e9a3756f0d85d9206fd
Python
28,940
810
#!/usr/bin/env python from __future__ import print_function import argparse import collections import uuid import copy import heapq import json import re import sqlite3 import logging import os import numpy as np import six import neuroglancer import neuroglancer.cli debug_graph = False verbose_merging = False d...
632b9060d7552b67fc21c246147d1479222552d82ac877af3de8cd8d6d1ae7c3
Python
28,966
656
# Sumit Bam Shrestha 09/28/2020 5pm # ================================= # This is a wrapper code that generates feedforward slayerSNN network from a # network config file (*.yaml). This will also include modules to output a # network description file (*.hdf5) OR SOME OTHER FORMAT (TO BE DECIDED) which # will be direc...
f6821b89653982192a21817019ad5bb5a8018d387b604524234750cb21fbb4e9
Python
28,987
688
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtkcenterlines.py,v $ ## Language: Python ## Date: $Date: 2006/07/17 09:52:56 $ ## Version: $Revision: 1.20 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENSE file for details. ## This software is dist...
41732b9c806f292a0c09d7a2f57e2627c64040a7a666867b6a7df20af66b4dca
Python
28,995
640
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/cohere2_moe/modular_cohere2_moe.py. # Do NOT edit this file manually as any edits will be overwritten by the gene...
4dac38f94d20a64b8e666e4194f4a5adeae8aad74cda47b676ed1c51652dd8b9
Python
28,996
638
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/granite_speech_plus/modular_granite_speech_plus.py. # Do NOT edit this file manually as any edits will be overwri...
89bf7750ddc5e25642c09155165cd767cd240cb3ac441b24f5bf5bd0da0fc572
Python
28,996
766
# repo originally forked from https://github.com/Confusezius/Deep-Metric-Learning-Baselines ################# LIBRARIES ############################### import pickle import warnings from numpy.core.arrayprint import IntegerFormat warnings.filterwarnings("ignore") import copy import os import random import numpy as...
0ce60ce84eb93d644fc872c0792b7b7717cb7303b487d5b37b23cff317a62dce
Python
29,015
887
"""Classes and functions for batching multiple graphs together.""" from __future__ import absolute_import from . import backend as F from .base import dgl_warning, DGLError from .ops import segment __all__ = [ "readout_nodes", "readout_edges", "sum_nodes", "sum_edges", "mean_nodes", "mean_edge...
35c1127b605cee1c683f1955020161d5981cb0d6d4944d59ff92a2188041d364
Python
29,017
665
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/flex_olmo/modular_flex_olmo.py. # Do NOT edit this file manually as any edits will be overwritten by the generati...
67ca9f62c958280c4ffd39851a638c8bfa535e4e24c51a999470e89b8e29fc8e
Python
29,051
691
# Copyright 2024 Descript 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 req...
1454c47c7d0350ce39e6856e881deb1909acc2be7b6734eb99810ddacd6148ee
Python
29,060
733
import argparse import os import sys from pathlib import Path from bidsonym.defacing_algorithms import (run_pydeface, run_mri_deface, run_mridefacer, run_quickshear, run_deepdefacer, run_image_deface) from bidsonym.utils import (check_o...
da95fdba39b24d3452ea1249bf6612d7489279c36a5ed8869ab3402efd8a6fb9
Python
29,064
702
# Copyright 2025 Mobile Perception Systems Lab at TU/e 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/licens...
ad21f4eded5a61872ae6b6d5637eb7842835441926e0009bd0b65c89f9cb95ce
Python
29,128
927
""" Modeling Relational Data with Graph Convolutional Networks Paper: https://arxiv.org/abs/1703.06103 Code: https://github.com/tkipf/relational-gcn Difference compared to tkipf/relation-gcn * l2norm applied to all weights * remove nodes that won't be touched """ import argparse import gc, os import itertools import t...
aa612ac3e0f0a0e0601341555fc5e3998d1a6b9e8b7f25f74ad794f8b8c682ca
Python
29,131
737
# 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...
51ea453cfff799adf03a1011ed9d070ebd74b8e2f2c934ab6d6845ac92609db0
Python
29,137
625
# Copyright 2024 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 applicab...
aa9cff60314557b61d32ffe282e2ab81ee3cc0af9b684d1ec2443b33640077f5
Python
29,152
643
# 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...
27ed7f8406e2653c775ef635139c61418d55de21d59cc07d675397bbddf5d5d5
Python
29,215
653
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/minimax_m2/modular_minimax_m2.py. # Do NOT edit this file manually as any edits will be overwritten by the genera...
cecbc348992fe6119a51ae15480e8fbb0cd91b27b7acd6198616b072e09679d6
Python
29,255
799
""" Round 7: Within-segment candidate tracking with HMM-style decoding and comb-fit scoring. KEY INSIGHT: Instead of picking one global frequency from a single FFT/ACF peak, track frequency candidates across overlapping windows and decode the most consistent frequency using HMM/Viterbi logic. This directly targets sub...
fb16d369a26accf8ea1e6c34603b796aedbc1c402a36c442a531327c283409f5
Python
29,256
691
""" Layer definitions """ import sys 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 . import initializers except (ModuleNotFoundError, ImportError) as e: import initializers """C...
b3d1022f46265d2fc67e85077392b71a482f98203230c91afe39a29f1d2a2860
Python
29,267
1,144
from __future__ import annotations from gymnasium.envs.registration import register from minigrid import minigrid_env, wrappers from minigrid.core import roomgrid from minigrid.core.world_object import Wall from minigrid.envs.wfc.config import WFC_PRESETS, register_wfc_presets __version__ = "3.2.0" def register_mi...
5fb72f8743089e42ce38f2d40268dba29a59389edd6a6b1388043fba00553f00
Python
29,297
709
# Copyright 2020 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...
0e165e69618a68b77f2780ebead717bb11b761ff07d3b35c6d6e6fad341d612c
Python
29,345
772
# 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...
b79dc5ed5ce79279344d76840dd7d2e7272c3346050e566912f4b4dd0796db4b
Python
29,361
825
""" Reinhard normalization based on method of: E. Reinhard, M. Adhikhmin, B. Gooch, and P. Shirley, ‘Color transfer between images’, IEEE Computer Graphics and Applications, vol. 21, no. 5, pp. 34–41, Sep. 2001. """ from __future__ import division import numpy as np import tensorflow as tf from typing import Tuple, ...
d5be9bc2ca89896a028cf7b614118316ce777ecd7b08863e6be107d19178c070
Python
29,363
787
""" Round 7: Multi-montage inputs + event-vs-background GED spatial filtering. Key insight: We've been forcing everything into one longitudinal bipolar montage, but experts use multiple views. Different montages capture different aspects of epileptiform activity. Creates 3 montage views from raw referential data: a...
b91e1703b587d8213954603fdb8fc1c24f6fca66a9ffd8dc238aedadd8be6607
Python
29,378
677
# Copyright 2022 The HuggingFace Team 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...
d65f3183fe84ff48250202365c001d8e774335be70db51e64443b00bda3dc7c5
Python
29,378
613
#!/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 from torch import nn import pytorch_lightning as pl from pytorch_lightning.loggers.wandb im...
deafd71b1a099ccc80f07adaab169a972ee1e51ff1eb6e7c944aefe137349e49
Python
29,443
672
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/gpt_oss/modular_gpt_oss.py. # Do NOT edit this file manually as any edits will be overwritten by the generation o...
56b7b92bc2c4055f3d429d192426e46037bfea330df6a1b70b508b0a89cb2812
Python
29,455
800
#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Copyright (c) Yongning Lei 2025-2026 # Apache-2.0 license # ----------------------------------------------------------------------------- """ transform_common.py Shared helpers for the EPI vol2surf pipeline: 0...
61cd4f9bb4c32e3e693c141b14cdf556a30f78e208c4d2b64f5d819d09ea8943
Python
29,486
878
import unittest import warnings import backend as F import pytest import torch from dgl.sparse import ( diag, from_coo, from_csc, from_csr, from_torch_sparse, identity, to_torch_sparse_coo, to_torch_sparse_csc, to_torch_sparse_csr, val_like, ) from .utils import ( rand_coo...
6fa02b8d80bf2c03d7e6c2a1a724816994966ff8f23d44e290383c9dcd3ef0d9
Python
29,541
666
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/cohere_asr/modular_cohere_asr.py. # Do NOT edit this file manually as any edits will be overwritten by the genera...
8f4872a8c177b8538da697ab5a1c55da2fb398996f190b7294bd7f1d84fee2e2
Python
29,546
755
""" HemiNet Variant Training Scripts — Experiments 1.2, 1.4, 1.5 Trains and evaluates three HemiNet variants using 5-fold patient-stratified CV: - Exp 1.2: HemiNetB (Design B — Dilated Convolutions) - Exp 1.4: HemiNetD (Design D — Neural Wrapper Around Existing Pipeline) - Exp 1.5: HemiNetPretrained (Design A + ...
a4c05667f795a746575c16c419479e18ef477ada9aed3228ba77274cd7b2c3ba
Python
29,573
843
"""Provide test for parcel aggregation.""" # Authors: Federico Raimondo <f.raimondo@fz-juelich.de> # Synchon Mandal <s.mandal@fz-juelich.de> # License: AGPL import warnings from pathlib import Path import nibabel as nib import numpy as np import pytest from nilearn.image import math_img, new_img_like from n...
5816c5dcad136f31ff46830915c214d5fd5f1f3bc9646c7f42f6e1a88a232018
Python
29,586
807
"""Torch Module for SubgraphX""" import math import networkx as nx import numpy as np import torch import torch.nn as nn from .... import to_heterogeneous, to_homogeneous from ....base import NID from ....convert import to_networkx from ....subgraph import node_subgraph from ....transforms.functional import remove_no...
215f31a421595fc3d12e47fdd0fe5f4a3268eccef28b6db14b78844a0b8e93da
Python
29,598
646
# 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...
d61de2c65fc1bbe39bc066b98978d59c8d22d0ea1f8b8dbb6fd7cb361190e40b
Python
29,610
885
""" handle_reruns.py ---------------- Check and fix extra (rerun) BOLD acquisitions for the VOTCLOC experiment. Background ---------- When a subject has poor performance during a run, an extra run is acquired at the end of the session to compensate. The lab note records these in ``protocol_name`` with a format like::...
1a92cfc1511a95968fc9e4a26b543a77baf3aeb4c9228549c45c82eb9ab0a78e
Python
29,654
710
#!/usr/bin/env python # @license # Copyright 2020 Google 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/LICENSE-2.0 # # Unless required by applicab...
d995bdb0d552f01c668a8972c03d2f9049145cfcf4502da490559d9bff1e4648
Python
29,660
706
# 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...
638b4df5adbf50d16687830866d6a370d3e47b35549e9d0a6e6f69e38ae611ed
Python
29,700
688
# 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...
009c79f99abe45c078a70bf0de97b88622a51a34f487dffd9b49465c19d9f3fd
Python
29,739
679
# 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 # # ...
0b276d5056d8280ee93c07f823aacda78d9e4a88b3a13581f833dce2b2dc3fbc
Python
29,846
645
# Copyright 2023 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 ...
cdce5bb54c1352a56ca081551d81393afbffbd66bf3ae4e0182351e2437af987
Python
29,874
704
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/dbrx/modular_dbrx.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
4e246a55fbf87c4edf19d83a96e3370104c2511ac2876a90a27f338b5208aff2
Python
29,918
926
# -*- coding: utf-8 -*- """ Created on Mon Nov 23 21:06:13 2020 @author: ide2704 Effective brain connectivity functions Ivan De La Pava Panche, Automatics Research Group Universidad Tecnologica de Pereira, Pereira - Colombia email: ide@utp.edu.co """ # Import the necessary libraries import numpy as ...
35f133091b64d147a459bdddfc015efbd629708b4cfbac19f51a0c6c8ab0951b
Python
29,984
921
""" Generate interactive HTML timing correction viewer for cases needing review. Loads discharge_times.json and includes all cases where review_status is NOT 'ground_truth' (i.e., auto-detected cases that haven't been manually verified). MW can add, delete, and move discharge timing markers interactively. EEG is rende...
b603612ccc7c185e241d7c7d1b7124f60d523c77c18403ad3c5c9ee6cd459204
Python
29,986
828
""" Train ChannelPDNetAttention with augmented data including 376 harvested high-frequency LPD segments (>2.5 Hz) to improve frequency estimation at the high end of the PD frequency spectrum. Key differences from train_cnn_attention.py: 1. Loads 376 hi-freq harvested segments (bins 2.5-3.0, 3.0-3.5, 3.5+) 2. Uses ...
c4bcf27a912ea90b3f70235609e2945591dc63a1bc62f7f8bcff53082ee0a771
Python
29,987
859
# ----------------------------------------------------------------------------- # Copyright (c) Yongning Lei 2024 # 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 deta...
a61da0eb15f0a72c3998fd14770b6864bdf68cc7d063fe3a6236933f0b4e26ba
Python
29,996
819
# Copyright 2021 The I-BERT Authors (Sehoon Kim, Amir Gholami, Zhewei Yao, # Michael Mahoney, Kurt Keutzer - UC Berkeley) and The HuggingFace Inc. team. # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except ...
a6b14258015ef89ed21abae491c5bc54e1e14a9bc0a5503f859045f356956f23
Python
30,052
725
# Copyright 2025 Jingze Shi and the HuggingFace Inc. team. All rights reserved. # # The Doge family of small language models is trained by SmallDoge 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...
7c2d213bb68289a299cd7fa1dc11e445ef4479aec7465764dfb682c157cd03f5
Python
30,074
765
""" HPP-Assisted BIPD Discharge Labeling Tool. Like the LPD labeler but with separate timing for left and right hemispheres. Channels reordered: left lateral + left parasagittal | right lateral + right parasagittal | midline. Two sets of frequency buttons and markers (red=left, blue=right). Usage: conda run -n fo...
259d04a85176b87f61348a7717db2190046db23ed43d341aef772ea6034d466f
Python
30,077
697
# 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 ...
7a77e049b940f7fecddb383f1e76ca75ba95c34a8d6231d0d8d324bab35c2c83
Python
30,090
706
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/lfm2_moe/modular_lfm2_moe.py. # Do NOT edit this file manually as any edits will be overwritten by the generation...
c18962afa58e09380ac6bbc15a8211f737f90b759ed189d812f2532e0f99780d
Python
30,128
858
import unittest import backend as F import dgl import networkx as nx import numpy as np import pytest import scipy.sparse as ssp from utils import parametrize_idtype D = 5 def generate_graph(grad=False, add_data=True): g = dgl.graph([]).to(F.ctx()) g.add_nodes(10) # create a graph where 0 is the source...
7c050b6e80a16316fad0103474399dd4f51a8dda1836fb2a6d74a277e1119574
Python
30,241
806
#!/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 collections import defaultdict, Counter from concurrent.futures import ProcessPoolExecutor, as_completed import re import csv import sys import typer from ri...
5e8bbfa7c9ba1d4772dc50d8da18e5b4686d9a459c08e9a770d1da4ac2b36df8
Python
30,291
644
import torch from torch import nn import torch.nn.functional as F from torch_scatter import scatter from torch_geometric.utils import degree from e3nn.o3 import Irrep, Irreps, wigner_3j, matrix_to_angles, Linear, FullyConnectedTensorProduct, TensorProduct, SphericalHarmonics from e3nn.nn import Extract from .utils imp...
a7300d24660d9482500d3f632661f476341842d3ec5c6f59ba0a2948fab4e692
Python
30,294
686
# Copyright 2025 Deepseek AI 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 requi...
4a26efa031d415e891e75b3984d288556abcde8079d06a81e45f103df028de07
Python
30,312
689
#!/usr/bin/env python ## Program: PypeS ## Module: $RCSfile: pypescript.py,v $ ## Language: Python ## Date: $Date: 2006/05/26 12:36:30 $ ## Version: $Revision: 1.18 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENSE file for details. ## This software is distribu...
ad6182dcca65ac63a9b3596229415f01b23445555cd9ad50b65b28b165dd64df
Python
30,370
780
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/aimv2/modular_aimv2.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
30bfcf6b6c3e88d20f8a0a5048ed0ef8f3a35a6a04c5cd0359abd058bfb7f970
Python
30,371
856
"""API for julearn.""" # Authors: Federico Raimondo <f.raimondo@fz-juelich.de> # Sami Hamdan <s.hamdan@fz-juelich.de> # License: AGPL import inspect import numpy as np import pandas as pd import sklearn from joblib.parallel import get_active_backend from sklearn.base import BaseEstimator from sklearn.model_...
4cef573a3a93afe76be3e76fed740e27da9c4439966a8c2468a12c7e576b47cf
Python
30,389
932
""" check_bids_counts_vs_labnote.py -------------------------------- Compare BIDS acquisition counts and anchor times against the lab-note Excel WITHOUT relying on the per-row timing in the lab note. Strategy -------- Instead of matching individual lab-note rows to BIDS files (unreliable due to operator timing entries...
0893b47454bdb7345aa4b8e2353fc8a812aeb1a74343af3e0d9e70a69fdf45b3
Python
30,436
753
""" Functions to organize the data and plot """ import os import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sns from scipy.spatial.distance import jensenshannon from sklearn.metrics import pairwise_distances from sklearn.cluster import AgglomerativeClustering import scipy.clu...
65e79851276d1464cee9301ebe10a6ebb48e443b711a27262b2258b4a3d798fc
Python
30,446
650
import torch from torch import nn import torch.nn.functional as F from torch_scatter import scatter from torch_geometric.utils import degree from e3nn.o3 import Irrep, Irreps, wigner_3j, matrix_to_angles, Linear, FullyConnectedTensorProduct, TensorProduct, SphericalHarmonics from e3nn.nn import Extract from e3nn.util....
09c908810a37789e410a2bc7939556bb439e419c052d7130bc41eb7fbd588e09
Python
30,457
726
### This script could run hybrid MLP-GNN models sweeping over layer connections : (-2,-2), (-2,-3) and (-2,-4). The current setting is for (-2,-4) layer connections. # Importing necessary packages import time start_time = time.time() from openbabel import pybel import networkx as nx import pandas as pd imp...
e9c22e9359b6b91d6a2f9f08e4cc4533e23d72047775d630e25dc012a456dfdc
Python
30,477
786
# Copyright 2022 SHI Labs 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 req...