sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
32f800abefe2bd0a58e4278fdd58ded9623bc5865646d2ef48f381306f4b8b41
Python
21,495
393
# Copyright 2026 The HuggingFace Inc. team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
45064db40ee273994b1583451bd055cfd8838572bf55ab1970a4297d7d234281
Python
21,496
468
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 layers from . import model_inputs from .sampling_utils import SamplingUtils except (ModuleNotFoundError, Impo...
22c63e545252496ac05116669a5e2f34d38f727ea32c30a8939e62c45c6a4026
Python
21,497
503
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/ministral/modular_ministral.py. # Do NOT edit this file manually as any edits will be overwritten by the generati...
9d9aae8a27c933376dff9f58dc26eb92c2136298b6d2b4fe644c509c68f4a1f5
Python
21,528
571
from __future__ import annotations import copy import json import os from dataclasses import dataclass from pathlib import Path from typing import Any import joblib import numpy as np import pandas as pd from sklearn.ensemble import AdaBoostClassifier, GradientBoostingClassifier, RandomForestClassifier from sklearn.f...
963e979411c15cf78dc1f49061af26c39d577a87dab84aadf796efc5e48b8d3c
Python
21,534
403
# 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 ...
684c1c30b8695f4276ab280d264adf80b71e510b7fd1889a56495057234ff711
Python
21,542
613
# Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 """Tests for molecular wavefunction implementations. Backbone-specific tests are in backbone_test.py. """ from dataclasses import replace from typing import Any, cast import h5py import jax import jax.numpy as jnp i...
c282ae62316e9891e520e82c75633124b28673999e290b41fb26b743086c5b8c
Python
21,555
499
# Copyright 2026 Reflection 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 # # Unles...
c7c45875526e65a956dc2f1fbd12978adb30c9abb700e34e110043b3a7a9ce6c
Python
21,566
529
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QMainWindow, QAction, QStackedLayout, QApplication, QMessageBox from PyQt5.QtGui import QIcon from PyQt5.QtCore import QThread, QObject, pyqtSignal as Signal import subprocess import threading import time import signal import os import sys import json import re import n...
3d6c52bec2ca0d2bc446818e6fe47b47b0c1e515236b41c5c3661353745db9b1
Python
21,652
488
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/cohere2/modular_cohere2.py. # Do NOT edit this file manually as any edits will be overwritten by the generation o...
0319f57d1bb230d1efff19a8c2221f734346a2ca2b733dc233049842c876e2cf
Python
21,664
543
# Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates # SPDX-License-Identifier: Apache-2.0 import math from dataclasses import field from typing import Literal import jax import numpy as np from flax import linen as nn from jax import numpy as jnp from jaqmc.array_types import Params from jaqmc.geometry.p...
32b7ba55490d21d0a7b6f2a6628449cf2050c82527103bbbfca63e1457d884bb
Python
21,672
409
# 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 t...
4b12e88c139682301924240e42217358e512af68d73f3b2c02b7bd23f160be51
Python
21,691
654
#!/usr/bin/env python from optparse import OptionParser import copy, os, pdb, random, shutil, subprocess, time import h5py import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import spearmanr import seaborn as sns from sklearn import preproc...
08291d59c5b7e684aff9d6f7ae0aaf78977baffe9c97f8f34244471954e486dc
Python
21,707
574
# Copyright 2018 DPR Authors, The Hugging Face 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 o...
f2d51e7e9ce6ad7f0024321292a97b0c367ca5331a921d9403da92531bb11cc0
Python
21,713
501
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/granite/modular_granite.py. # Do NOT edit this file manually as any edits will be overwritten by the generation o...
a8d73305c2292530901724950fcfb05c63a0f0596d78fba81c774f6014db333d
Python
21,716
565
#!/usr/bin/env python3 """Brain-Folding Simulator — Adaptive Bento Scientific Dashboard (PySide6). A single lightweight PySide6 app: a slim header, a responsive bento grid of the six parameter categories (reflowing 3 → 2 → 1 columns), a contextual Parameter Guide (right side on wide windows, docked below on narrow one...
befe74a4a396a5dab31a575d6317d1f2622f9b9931c239665ba8d37d6e874ae6
Python
21,717
585
from turtle import title import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np import pandas as pd import seaborn as sns import torch import os from matplotlib.colors import LogNorm folder = '../data/' models_name = { '30K': "f2_30k", '100K': "f2_100k", 'Local': "f1_local_...
d2d960d1d81dcd42e51bcb57211f6d65053c487693c447be53447dbfa867aa40
Python
21,717
555
""" Dataset utilities for MST classifier training and inference. `MSTDataset` adapts a list of `SMImage` objects into the dictionary format expected by the MST data modules. Optional TorchIO preprocessing and augmentation steps can be applied before tensors are returned. TorchIO preprocessing reference: https://docs....
7989723cd5c2ec1e0072cdebedfb212e18e29c82e47f0ffcf38239dbc2180bd2
Python
21,742
562
""" Evaluate CET FP reduction improvements: Stage A: Threshold CET before max() combination Stage B: PD-weighted channel selection for evidence aggregation Uses parameter_sweep infrastructure for parameterized DP. Usage: conda run -n foe_dl python code/cet_model/eval_improvements.py """ import sys import jso...
bdd71046bc3e34c02e4b4eedc86822a45b97e08f9be127347d29a3e6cf97f940
Python
21,743
593
import json import logging import os import dgl import numpy as np import torch from distpartitioning import array_readwriter from distpartitioning.array_readwriter.parquet import ParquetArrayParser from files import setdir def _chunk_numpy_array(arr, fmt_meta, chunk_sizes, path_fmt, vector_rows=False): paths = ...
11714ea1148d470811ea64f6804581ea49fe7738d4e72c575feca55317619426
Python
21,754
710
from matplotlib.widgets import Button from pathlib import Path from scipy import ndimage from skimage.registration import phase_cross_correlation from matplotlib.patches import Rectangle import numpy as np import tifffile import pandas as pd import matplotlib.pyplot as plt import re def to_uint8(a): """ Dete...
5ed70ac0fefa1f88afcff3fb2b7dbada583509c18a79c43138f232cd4ed76781
Python
21,765
485
import gc import json import logging import os import pathlib import re import tempfile import time from datetime import datetime from queue import Queue from typing import Any import torch from datasets import Dataset from huggingface_hub import HfApi from tqdm import trange from transformers import ( AutoModelF...
da1d3e0c181b183d2cbbde6646730b1222ffa4ac3c86875b327cb8b2e32e7ec7
Python
21,765
460
"""Adapted from Nematode: https://github.com/demelin/nematode """ # TODO: Add an attention visualization component - very important (~easy) """ Layer implementations. """ import sys import numpy as np import tensorflow as tf from tensorflow.python.ops.init_ops import glorot_uniform_initializer try: from . impor...
3273eb9c1b74099033230adcd457f28431919b08ebfbf644f1086aab67ada28a
Python
21,785
534
# Copyright 2025 Meta 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 requ...
acce6aa7f84bc0db0d8b0287cd256f244288fffe4d5a5ec4169b1cd11d9351df
Python
21,816
626
### This script could run MLP only model for pchembl/MW prediction (of IC50 of Tissue Factor Pathway Inhibitor) using combination of Shannon entropies (SMILES Shannon, SMARTS Shannon, InChiKey Shannon and SMILES partial/ fractional Shannon) and MW as descriptors # import the necessary packages from imutils import pat...
1f814580b3df2574be5ded5af7b0c1061805a5021d30d31c9608dc931fa2358e
Python
21,837
511
# 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 ...
ff002a14ab0150041104df19c3678aff187100b3dedf9809bf1bf0dcc9119fda
Python
21,838
503
# 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...
9a8678f7134f3e4941df83037bad88ce143b0a5d499fab55bcca62968fd5f0e1
Python
21,842
549
import zarr import slideflow as sf import imgui import numpy as np import cellpose import cellpose.models from os.path import join, dirname, abspath from functools import partial from threading import Thread from slideflow.slide.utils import draw_roi from slideflow.cellseg import segment_slide, Segmentation from ._uti...
599d24996f5ad3fa21d9fdfcaaed14de87d0572b310c2d075d287263e5a14288
Python
21,887
533
import argparse import os import shutil import sys import time import warnings from random import sample import numpy as np import torch import torch.nn as nn import torch.optim as optim from sklearn import metrics from torch.autograd import Variable from torch.optim.lr_scheduler import MultiStepLR from cgcnn_ads_onl...
93e61306fd74127bc7cc1cf15823596608e983df2c4f664a9811110eb2ec6d76
Python
21,894
533
import argparse import os import shutil import sys import time import warnings from random import sample import numpy as np import torch import torch.nn as nn import torch.optim as optim from sklearn import metrics from torch.autograd import Variable from torch.optim.lr_scheduler import MultiStepLR from cgcnn_ads_onl...
b2ef7a474974488f432ca62fd9c519d6e62037eccda29af72a9c9169851a9875
Python
21,906
629
""" Module for Approximate Bayesian Computations """ from abc import ABCMeta, abstractmethod # Abstract Base Classes import multiprocessing as mp import numpy as np from scipy import stats from numpy.lib.recfunctions import stack_arrays from numpy.testing import assert_almost_equal import time class ABCProcess(mp.Pro...
08fbf4d31b7279e0204d9173bc5e37966d8a91ddbd26713f7ee5a69e65c8c7fb
Python
21,916
480
""" Calculate a set of outcomes summarizing the quality of a set of generated molecules. """ import argparse import os import numpy as np import pandas as pd import scipy.stats import sys from fcd_torch import FCD from itertools import chain from rdkit import Chem from rdkit.Chem import Descriptors from rdkit.Chem imp...
0310ab8c921b14294b61dbf0a7d6e393eca4f86df612686afab91e7e4300b284
Python
21,976
477
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py. # Do NOT edit this file manually as any edits will be overwritt...
d775791656a5805dbb68e4287f720b8aa3d170fc92809142006bc3d81b8f31bd
Python
22,007
469
# 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...
bf1b086e79d2c86c9521e0501e8b43cf3aa14fd8b05ee7f49999bd805da98be9
Python
22,023
520
#!/usr/bin/env python3 """ Render publication-quality EEG characterization figures from JSON data. Self-contained: only requires matplotlib, numpy, scipy, json. Reads figure_*_examples_data.json and produces figure_*_examples.png at 300 DPI. """ import json import os import sys import numpy as np import matplotlib ma...
57e438f2f1cf1305d34e578d75e37ddb8e06e9baca03ee3eba87ded432f63fba
Python
22,055
624
#!/usr/bin/env python3 """ Build Fig 2 composite: swap Panel B (with real topoplot) into the figure. Renders draw_panel_b.py with a real Laplacian topoplot computed from the EEG segment, then pastes the updated Panel B into the existing composite figure (preserving Panels A and C untouched). To change the example seg...
4321346738f0e3a808642e381d92e0703306da501e17beec730e83660aeb6b55
Python
22,060
570
"""CycleGAN-based stain normalization. Modified from: https://github.com/Boehringer-Ingelheim/stain-transfer Pretrained weights from: https://osf.io/byf27/ Original license: BSD 2-Clause License Copyright (c) 2023, Boehringer Ingelheim Redistribution and use in source and binary forms, with or without modification,...
eed8fdabb4d39d5243b0aff5d017c5ae6e5f5cab2c29d79a706f3dee9c2c17ce
Python
22,069
472
# Copyright 2025 The Nari Labs 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 re...
a514a3d47e0159ce56fffe4eb0c01e5ba7d0e29dfadda17f6839f798a52eb0dd
Python
22,074
665
""" CET+HPP pipeline: CNN Evidence Trace + HPP Dynamic Programming. Replaces the handcrafted pointiness+TKEO evidence in HPP with learned CNN evidence, then runs the same DP algorithm for discharge detection. Evaluates three methods: 1. HPP-only (handcrafted evidence) 2. CET+HPP (old CETModel, no skip connections...
f05fdd28773f61693332bbd51760d58d1f62560c56ecca30a155efe16ca545ef
Python
22,087
675
""" This script is a GraphBolt counterpart of ``/examples/core/rgcn/hetero_rgcn.py``. It demonstrates how to use GraphBolt to train a R-GCN model for node classification on the Open Graph Benchmark (OGB) dataset "ogbn-mag" and "ogb-lsc-mag240m". For more details on "ogbn-mag", please refer to the OGB website: (https://...
51efc39d9f5575574d15c8094e7b0773adf8cb154c6d70e6301d291bda328c24
Python
22,090
602
import os import sys import json import numpy as np import matplotlib.pyplot as plt from .PlotHelper import add_goal_zone, add_obstacles, add_tmaze class RepresentationVisualization: """Plotting a representation of firing maps.""" def __init__(self, data_path, flname, ...
4c5ab416799701d9ffe5452cd53fbe6a2bb66909640c4de58b7bf22f7369c268
Python
22,130
478
""" Generate HTML viewer for reviewing cases where HemiCET disagrees with GT labels. Prioritizes high-yield cases: 1. Cases where HemiCET finds many more discharges than GT (possible label FNs) 2. Cases where HemiCET finds fewer discharges (possible label FPs) 3. Cases with large frequency disagreement 4. hpp_labeler ...
eac2dd5ca58562039f42c1aa36d2b69449b0baaa11636e0c536717690eea0988
Python
22,153
683
"""Provide API functions.""" # Authors: Federico Raimondo <f.raimondo@fz-juelich.de> # Leonard Sasse <l.sasse@fz-juelich.de> # Synchon Mandal <s.mandal@fz-juelich.de> # License: AGPL import atexit import importlib import importlib.util import os import shutil import sys from pathlib import Path imp...
4ab7e6271afb4149cfc75f94749c63f437be62a54c0711c8b57c2c6f4a88c9b9
Python
22,188
539
# 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...
9737d1ca5ac93da8d9f50021388c2752019804469d59eb9dcf38549e54a943f2
Python
22,220
624
#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Copyright (c) Yongning Lei 2025-2026 # Apache-2.0 license # ----------------------------------------------------------------------------- """ compute_tsnr.py Compare tSNR between ME_denoised, ME_optcom, and SE data...
35ff153574007321f8fbdd338b2579279131ef8eef7f60382087a0b6cb18aad5
Python
22,233
586
# Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
6aeaab74090a0cda394b7fbf1f6a8a45cf955a2fc72fbd51d43309b5e98f7f3f
Python
22,275
581
#!/usr/bin/env python3 """PDProfiler Optimization Contest — preprocessing/postprocessing variants. Runs PDProfiler with different pre- and post-processing on all labeled LPD segments. No retraining — uses existing trained weights. Evaluates laterality, frequency, and discharge timing metrics. Generates an HTML leaderb...
b48c4bbd94402369126456e5d00d60c6b81379517cb5882676035ce7d879cc10
Python
22,291
445
# 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 app...
fb6deb188c2b484be9ac2e00d8296d6dda68e3d7bbd34ce212b8204fc37b834d
Python
22,308
510
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/cohere/modular_cohere.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of ...
d3f887ff14e15d9c7842b36e3d25436ed4dbfbb7f1e3a59d2ed1cc456a62de3b
Python
22,314
683
"""Dataset utilities.""" from __future__ import absolute_import import errno import hashlib import os import pickle import sys import warnings import networkx.algorithms as A import numpy as np import requests from tqdm.auto import tqdm from .. import backend as F from .graph_serialize import load_graphs, load_labe...
d06015b0a529a2a8556378284292183d8dec21e3de9a57c23f8f228388bffe20
Python
22,321
641
# -*- coding: utf-8 -*- """ Functionality for transforming files between spaces """ import os from pathlib import Path import nibabel as nib from nilearn import image as nimage import numpy as np from scipy.interpolate import interpn from neuromaps.datasets import (ALIAS, DENSITIES, fetch_atlas, ...
4383aad8b47d4be63bb36cbb78c44ce82cea61c54df4c0e033063ad18b76a692
Python
22,357
662
import argparse import math import os import random import sys import time import dgl import numpy as np import torch import torch.nn.functional as F from dgl.dataloading import DataLoader, Sampler from dgl.nn import GraphConv, SortPooling from dgl.sampling import global_uniform_negative_sampling from ogb.linkproppre...
4c7e950f4c2ecf333f7ed7be94b8c4c1172d077bbd1f81fa3b4404db2aa67343
Python
22,366
531
import os from sched import scheduler import shutil import sys import random import numpy as np import torch from torch import nn from torch.optim.lr_scheduler import ReduceLROnPlateau from e3nn.o3 import Irreps, Irrep from .from_nequip.tp_utils import tp_path_exists from .tr_modules import TRIrreps def set_random...
05229945d63763431491142ef341dea0f117d5ec33fdbfe025bd299f1e9503a8
Python
22,387
703
### This script could run a MLP-based deep neural network model comparing SEF, Morgan Fingerprint and SHED descriptors # import the necessary packages import numpy as np import pandas as pd from KiNet_mlp import KiNet_mlp from tensorflow.keras.optimizers import Adam from tensorflow.keras.optimizers import SGD from...
c7045eea8cbc50a3c58ca23fafeb3caae4b55dace26fb6b05ef377140d8c40aa
Python
22,389
547
# Copyright 2025 MiniMaxAI and HuggingFace Inc. 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 req...
790cfbad9e84637602be42741425f88b260e72e26464a6d624c7acd8a5d31496
Python
22,424
628
""" Generate laterality annotation viewer for LPD cases. For each LPD patient: 1. Estimate frequency using pre-trained Ridge model 2. Auto-detect laterality using variance-explained per hemisphere 3. Generate clean EEG image 4. Build HTML viewer sorted by confidence (ambiguous first) Must run with: conda run -n foe p...
ecb4e4e529f650bee63b04d108109906f59175a3b466c6ca97badad8440e4b0b
Python
22,445
472
# Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
b42bfaab97f7d257069ad1e5e4499bec4964e99d481af9cc7058e88cd63b9c5b
Python
22,462
488
import time import webbrowser from collections import namedtuple from pathlib import Path from typing import Tuple, List, Optional, Set, Union, NamedTuple import numpy as np from PyQt5.QtWidgets import QApplication from napari.utils.colormaps import low_discrepancy_image from numpy import ndarray from seg2link.seg2dl...
17f45608362ae91e571ea613613ea623a7800323cdaebb654fc2f19d63b0d9f5
Python
22,468
626
"""Provide concrete implementation for feature storage via SQLite.""" # Authors: Federico Raimondo <f.raimondo@fz-juelich.de> # Synchon Mandal <s.mandal@fz-juelich.de> # License: AGPL import json from enum import StrEnum from typing import TYPE_CHECKING, Any, Optional import numpy as np import pandas as pd ...
bfa69b1acbd011bd2d9b2dfeee7ca6e73ea77b6f0289e3e8f9a080ff51cc0330
Python
22,475
562
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtkimageinitialization.py,v $ ## Language: Python ## Date: $Date: 2006/05/31 10:51:21 $ ## Version: $Revision: 1.19 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENSE file for details. ## This software...
b6802fbeb734119238d8634ad430ab094f4fde30740801d32e1033ffa8846854
Python
22,483
644
""" Module for Approximate Bayesian Computations """ from abc import ABCMeta, abstractmethod # Abstract Base Classes import multiprocessing as mp import numpy as np from scipy import stats from numpy.lib.recfunctions import stack_arrays from numpy.testing import assert_almost_equal import time class ABCProcess(mp.Pro...
79c401913edebd9a192da3da40d7666b96e44750d62eae77f0d777982aa9f88c
Python
22,498
566
#!/usr/bin/env python3 """ Generate Fig 2: PD Characterization Pipeline composite figure. Three-panel horizontal layout: Panel A (left): Input 19-channel EEG (average reference, 10s) Panel B (center): Architecture flowchart (matplotlib boxes/arrows) Panel C (right): Output visualization (EEG + discharge marke...
15c8c0e9f0728f045f6f61775ee99f3ff7898935e98b1ba41f79d74c29c74627
Python
22,524
635
""" Core OpenBCI object for handling connections and samples from the board. EXAMPLE USE: def handle_sample(sample): print(sample.channel_data) board = OpenBCIBoard() board.print_register_settings() board.start_streaming(handle_sample) NOTE: If daisy modules is enabled, the callback will occur every two samples, ...
6589cb0cfbb97874271cfe8721d745483e4d914718a674ee5339af44d0347d56
Python
22,528
508
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/hyperclovax/modular_hyperclovax.py. # Do NOT edit this file manually as any edits will be overwritten by the gene...
0857d1b6ad9d4b937e3bfa81295f9b8d615c31fff4a8922ab99c0eddc80cc0ab
Python
22,531
518
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/hunyuan_v1_dense/modular_hunyuan_v1_dense.py. # Do NOT edit this file manually as any edits will be overwritten b...
9516b3eb647ad937c766109bfe1792aa936326414ec88787447f43a10c52271e
Python
22,542
563
# 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...
a1ccace101c445b3c5e3e4efb8fbd4b0448d694f81d14fe6d0597e7c0bbe2ea3
Python
22,566
599
from PyQt5.QtWidgets import QVBoxLayout, QWidget from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.animation import FuncAnimation import matplotlib.pyplot as plt import socket import threading import pickle import os import time import ...
ffc1bccd31e4c0868cbefb13428cf03f0cbcc38a40f67cda179e59ffe29e7b8f
Python
22,566
474
# 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...
58c9e0ed97fc4217f77a7f43e4acab25e425d0af60a568e0a5d77b19870cdb5f
Python
22,624
530
#!/usr/bin/env python3 """ML-based LRDA vs GRDA classification — unconstrained approaches. Balanced data (subsample GRDA to match LRDA), 10-fold stratified CV. Tries multiple feature sets × classifiers, reports AUC for each. """ import sys import json import time import warnings import numpy as np import pandas as pd ...
e849ed4dfeeda6f2d6e1ea532df58baf562673cff7bca55b5bd11cab30d7bf9a
Python
22,626
578
# Copyright 2025 Baidu Inc 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 by applicable ...
0222a23c1e07c6068b52e71e2751cdc19f2ed07f4502b092ba15565a9a829f6b
Python
22,637
653
#!/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,...
2798be6413d5bb99de695ab90ae48634a57b764ae09363366124af82e562c98c
Python
22,662
522
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/exaone4/modular_exaone4.py. # Do NOT edit this file manually as any edits will be overwritten by the generation o...
6714e45b131695f18720b45425e44d53e2d40fa57e481ae0debb0b829dca67b8
Python
22,677
701
# Written by Alexandria D'Souza and Birgit Schilling # # All publications that utilize this software MS1Probe # should provide acknowledgement to the Buck Institute for Research on Aging, # the Gibson Laboratory/Chemistry Core # and refer to the following website link # http://www.gibsonproteomics.org/resources/MS1Prob...
3a781497f7d1e648fbec2cfbcee3c252b4628a981f9dd0afdd34c8122ceb3e56
Python
22,689
587
#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Copyright (c) Yongning Lei 2025 # Apache-2.0 license # ----------------------------------------------------------------------------- """ run_tedana.py Run tedana multi-echo ICA on fMRIprep per-echo T1w nifti output...
52764f5cd92019629c4ae173487e213358970f7aa6166eac920b15aa73891d02
Python
22,741
778
# import packages import os from pathlib import Path import nibabel as nib import numpy as np from pathlib import Path import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns from matplotlib.colors import LinearSegmentedColormap from SUITPy import flatmap from SUITPy import atlas as catlas from n...
76f03ac909f50c8f3119b117cca960b5428cc4d3adb5cf80055d42ad381e1341
Python
22,787
686
""" This script, `hetero_rgcn.py`, trains and tests a Relational Graph Convolutional Network (R-GCN) model for node classification on the Open Graph Benchmark (OGB) dataset "ogbn-mag". For more details on "ogbn-mag", please refer to the OGB website: (https://ogb.stanford.edu/docs/linkprop/) Paper [Modeling Relational ...
e5456d3a4ccec925f18914414177491d125669db028c605d5e3447a20d6e848d
Python
22,787
646
"""MovieLens dataset""" import os import numpy as np import pandas as pd from torch import LongTensor, Tensor from ..base import dgl_warning from ..convert import heterograph from .dgl_dataset import DGLDataset from .utils import ( _get_dgl_url, download, extract_archive, load_graphs, load_info,...
a49c92d428061a648e63f0da09bc4a08c0fa4ef2681ce27b8e83da72edb4d3cf
Python
22,795
636
""" BIPD vs GPD Reviewer — Review model predictions and relabel cases. Shows all GPD + BIPD cases sorted by model BIPD probability (highest first). For each case, displays: - EEG with channels grouped: L-lateral, L-parasag, midline, R-parasag, R-lateral - Left hemisphere discharge times (red vertical lines) - Ri...
183772fd4134a6735ca787e40576ef89ecf10a7760395766248605e3fac6d7bb
Python
22,870
652
""" Train CNN+Attention v3: Use v1 CURATED dataset (815 patients, 9310 channels) with UPDATED expert frequency labels from segment_labels.csv. Changes from v1: - Loads channel_dataset.npz from pd_channel_cache_backup_v1/ (curated 815 patients) - Updates frequency labels from current segment_labels.csv expert_freq_...
bb2b2079e93bf65a01d40341982dc708c9217c32689db186b766fdc5583735bf
Python
22,881
572
""" Tool Name: torch2d_point_heatmap_learn ====================================== Train a Gaussian-heatmap Carina localizer on the legacy trachea-centered crop. """ from __future__ import annotations import asyncio import csv import json import os import random import matplotlib matplotlib.use("Agg") import matplot...
53b7fff985d6bf3b4898397ccda70257cc8624175ffd4cea9f77c3485aff0aab
Python
22,887
593
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 15 14:16:41 2020 This module provides a set of functions to create non-randomized alternating sequences of events and add realisitic components similar to the data obtained from a fMRI experiment. It also provides tools to calcuate optimality ...
2b64931fa89739c2c14e7ea4baa565b63ac233d43638c05b33284090fb3db2f9
Python
22,888
669
import argparse import datetime import os import sys import time import dgl import torch from dgl.data.utils import load_graphs, save_graphs from dgl.dataloading import GraphDataLoader from ogb.linkproppred import DglLinkPropPredDataset, Evaluator from torch.nn import BCEWithLogitsLoss from torch.utils.data import Dat...
4982ac0bf8ce42efa44ffb35f87d50c3f9e3b1fba105e96541a1054b8ebaba0e
Python
22,898
629
import sys import os sys.path.append("../utils") import time from datetime import timedelta from contextlib import redirect_stdout from datetime import datetime from sklearn.svm import SVC from WDKernel import wdkernel_gram_matrix, get_K_value, parallel_wdkernel_gram_matrix from sklearn.metrics import roc_curve, auc, r...
2a56ffe9a3cec3ea228c936cc845f34ff1e979c5a2c12053b2742bcd22b9f023
Python
22,913
629
"""Provide JuniferNiftiSpheresMasker class.""" # Authors: Synchon Mandal <s.mandal@fz-juelich.de> # License: AGPL from collections.abc import Callable from typing import TYPE_CHECKING, Union import numpy as np from nilearn import image, masking from nilearn._utils.niimg import img_data_dtype, safe_get_data from nile...
b6fdb42338357530e73c54943679c7e13a65fc246a7cf0c49aa36a5d5c433949
Python
22,915
548
#!/usr/bin/env python3 """ Render publication-quality EEG characterization figures from JSON data. Self-contained: only requires matplotlib, numpy, scipy, json. Reads figure_*_examples_data.json and produces figure_*_examples.png at 300 DPI. """ import json import os import sys import numpy as np import matplotlib ma...
0196e6807de8e6f87b9f3bf19961fd96c2855a68c2a9a59315fc61f79dcdabcd
Python
22,926
633
"""Utility functions for MIL.""" import os import inspect import slideflow as sf import numpy as np from os.path import exists, join, isdir from typing import Optional, Tuple, Union, Dict, List, Any, TYPE_CHECKING from slideflow import errors, log from slideflow.util import path_to_name from slideflow.model.torch_uti...
1f6589fb939ae4d152d51a58c96dc8ae7ac5b660a911d40b9ab36e2e0ef37cd0
Python
22,929
729
"""Functions for plotting Tet and Tria Meshes with overlays. For visualizing results in a juypter notebook use this:: .. code-block:: python import plotly plotly.offline.init_notebook_mode(connected=True) ... """ import re from bisect import bisect import numpy as np import plotly impor...
54e0cb2c155ed6dcd1365ef4c3226c3b40a32fd923d2a6e4a045f6d516c4c089
Python
22,933
568
#!/usr/bin/env python3 """ Generate Fig 2: PD Characterization Pipeline composite figure. Three-panel horizontal layout: Panel A (left): Input 19-channel EEG (average reference, 10s) Panel B (center): Architecture flowchart (matplotlib boxes/arrows) Panel C (right): Output visualization (EEG + discharge marke...
e153c9b4e9b9ac9c94cb1510c22696829a5e1134f9d0a199304286e41d834f2a
Python
22,935
575
#!/usr/bin/env python3 """Train a whole-image Carina heatmap model with a trachea-probability channel.""" from __future__ import annotations import argparse import csv import json import re import sys import traceback from pathlib import Path import matplotlib import numpy as np import SimpleITK as sitk import torch...
9e43f64e047a62707d7b1a1bc1362a1c2c179c1f4e537ac913e0f6e08e3b9f28
Python
22,945
571
#!/usr/bin/env python3 """ Generate Fig 2: PD Characterization Pipeline composite figure. Three-panel horizontal layout: Panel A (left): Input 19-channel EEG (average reference, 10s) Panel B (center): Architecture flowchart (matplotlib boxes/arrows) Panel C (right): Output visualization (EEG + discharge marke...
1cd743c526c2693433815576f10917296edbd0655d7beea496d6f3d39562a350
Python
22,957
568
"""Utility functions for sampling.""" from collections import defaultdict from typing import Dict, List, Optional, Tuple, Union import torch from ..base import CSCFormatBase, etype_str_to_tuple, expand_indptr def unique_and_compact( nodes: Union[ List[torch.Tensor], Dict[str, List[torch.Tensor]...
f7daca8a6a0209511f837a3ecd10692ec6b033ceb25c29e35aa58d5a467bd1d1
Python
22,978
687
""" Copyright 2020 Google LLC. This software is provided as-is, without warranty or representation for any use or purpose. Your use of it is subject to your agreement with Google. """ import pandas as pd import string from collections import Counter from .AutoViz_Utils import save_image_data pd.set_optio...
1fcadc5991c9f44a9184e8149b1fd0c2338f160568b788a283b35d303a7a16bd
Python
22,988
608
import numpy as np import numba # with NUMBA to make it faster !!! import argparse import matplotlib.pyplot as plt ### ================================================ ### ========== Reformat parameters ================ ### ======= for single cell simulation ============= ### =================================...
bd67622123e365b7dc801380d3a5fa856050c4b226a46ab257e4715a0c310fd7
Python
22,999
675
#!/usr/bin/env python from optparse import OptionParser import copy, os, pdb, random, shutil, subprocess, time import h5py import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import spearmanr import seaborn as sns from sklearn import preproc...
83d8cf90abda66427eb00c58896d1c231f995cb4b09adc4de32f49e037f7661d
Python
23,177
677
""" Visualize frame-level discharge detections on EEG plots. For each patient: 1. Load segment(s), run each channel through DischargeDetector 2. Peak-pick discharge times per channel 3. Generate EEG plot (morgoth style) with overlays: - Standard black EEG traces - RED DOTS at detected discharge times p...
d3c5634af3bcdd5c9b899f6704acc770fb218aefed5be6c53bb8c14d9eff0291
Python
23,177
518
"""Adapted from Nematode: https://github.com/demelin/nematode """ 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 exception from . import rnn_inference from...
377427ee6c72c985a009f60b60ff5ece6088c77774a1f51fd861cc47afa9d26c
Python
23,201
449
# 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 ...
616f4d3340b986499ce43d0823190baecfa39fb7e47ee1d31c0d54557c73a79c
Python
23,224
623
# Copyright 2022 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 # # ...
b5e2ec79864a1155ef4b6ec860d887d4a78d1d413cc7aeb3555ac62fdf93ec6b
Python
23,224
540
#!/usr/bin/env python3 """ Render publication-quality EEG characterization figures from JSON data. Self-contained: only requires matplotlib, numpy, scipy, json. Reads figure_*_examples_data.json and produces figure_*_examples.png at 300 DPI. """ import json import os import sys import numpy as np import matplotlib ma...
9d3ac67224d6f19ec8fcd66498749d0d2f202b71c4bd0b23b73c1be44df880ea
Python
23,361
550
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/gemma2/modular_gemma2.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of ...
e0997f1d02637e59a42820b0700732a71b9374bf6c83de43b7cb204040914366
Python
23,410
600
# Copyright 2025 The HuggingFace Inc. team and Google LLC. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...