sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b73bcc1f078decb9c319b66c5186c32ab762dfa1e273c8d6eb06fd7dfe1b7985 | Python | 23,453 | 667 | """
HemiNet Training Script — Experiment 1.1
5-fold patient-stratified cross-validation.
Trains HemiNet (Design A: U-Net + Transformer bottleneck) on 8-channel hemisphere EEG.
Usage:
conda run -n foe_dl python code/hemi_detector/train.py
Saves:
data/hemi_cache/exp1_1/
fold{k}/best_model.pt
tr... |
eec9fd9b09613a7903056f828e58478efc94828584ef4d718edab700728e7c0d | Python | 23,497 | 533 | # 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... |
4cbec84b86ed746d75541498494680c9a07d7a7721448b79aff03d31d73632b4 | Python | 23,498 | 576 | #!/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... |
d0d8e2d5a73b7d32f6e0498ffcb23a7d5c8c80bec4ad408ecc3f711a82345390 | Python | 23,538 | 487 | # 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... |
80fe3f2f6cfb3ca374a3f72a190560354a5c480260270cc89cba708964bb8b4c | Python | 23,549 | 703 | ### This script runs RFR-based machine learning models based on SEF, Morgan fingerprints and SHED descriptors
# import the necessary packages
import pandas as pd
import numpy as np
import seaborn
import matplotlib.pyplot as plt
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection i... |
6328f43fc9ebb4491554fe5407d4e28d16ca950254c1b60380e73961062a23a5 | Python | 23,552 | 798 | import warnings
from collections import defaultdict as ddict
import backend as F
import dgl
import networkx as nx
import numpy as np
from utils import parametrize_idtype
D = 5
reduce_msg_shapes = set()
def message_func(edges):
assert F.ndim(edges.src["h"]) == 2
assert F.shape(edges.src["h"])[1] == D
re... |
666a0adbdbbbc3ae1b75abbaaf60614c482a831483b0b2dfc3af1cf1761b4ace | Python | 23,558 | 530 | # Copyright 2026 Mistral 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 r... |
00bb1fc61f5757619676094e65c706f96662967b670bd4fdb960cc63fe708569 | Python | 23,572 | 628 | # Copyright 2018 Salesforce and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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.apach... |
2c122586e350c8af0b38120176957e3e87f8d95caf34b0fa8187d90199338bba | Python | 23,584 | 648 | """Tensorflow model utility functions."""
import os
import tempfile
from typing import (TYPE_CHECKING, Any, Dict, List, Tuple, Union, Optional,
Callable)
import numpy as np
import slideflow as sf
from pandas.core.frame import DataFrame
from slideflow.stats import df_from_pred
from slideflow.util i... |
76899c11763ae3b3c15ff1f65a5e19770b54e61563b1680b9db92b94f212f74b | Python | 23,607 | 664 | # Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
# SPDX-License-Identifier: Apache-2.0
# ruff: noqa: DOC201,DOC501
r"""Host-side discovery of clamped-nuclei spatial symmetry operations.
A :class:`SourceSector` stores only immutable Python tuples, so the discovered
geometry can safely be captured by JAX-comp... |
6b7c8517eb17a124acddb51a20381d7e1b69f0eaab5dcad67de7cc1d3a6b34d8 | Python | 23,628 | 658 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
ca0728fc328957bf073bc14fae6ac58dd9cd5814edb8842446841f15aa685e37 | Python | 23,648 | 591 | """Subgraph samplers"""
from collections import defaultdict
from functools import partial
from typing import Dict
import torch
import torch.distributed as thd
from torch.utils.data import functional_datapipe
from .base import seed_type_str_to_ntypes
from .internal import compact_temporal_nodes, unique_and_compact
fr... |
ba4eab45d66e0c3e69feb4f0a253bdb0254ef359ac87c414f9ae2aa5a774e7ff | Python | 23,669 | 579 | """
Generate 100 test-case images (25 per pattern: LPD, GPD, LRDA, GRDA)
from expert-labeled segments in /Volumes/sanD_photos/IIIC/.
Each image shows the central 10 seconds of the recording (around the
expert-annotated event time), run through the appropriate detector,
and displayed with the verbal description banner.... |
406c287b44d89caccc4dfbf02a0cd94087c3debd42b27428a7e7e78225d69550 | Python | 23,686 | 597 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtksurfaceviewer.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.10 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENCE file for details.
## This software is di... |
a64ad98b2616ee1e50f214f063b10f6462b94062da2e64b2f32e76dd41de166e | Python | 23,708 | 492 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/gemma3n/modular_gemma3n.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation o... |
0624ed496bd15d60e701db3e1d79ef50a8ec377c5e3f84d0494b717caeb8e716 | Python | 23,735 | 554 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/dinov2/modular_dinov2.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
... |
2e4c69fc0d9dbfb2e2c752d6c8ad63bae4d153158bc331cbd4f5ccdc954972b8 | Python | 23,742 | 522 | #!/usr/bin/env python3
'''
Build a neural machine translation model with soft attention
'''
import collections
from datetime import datetime
import json
import os
import locale
import logging
import subprocess
import sys
import tempfile
import time
# Start logging.
level = logging.INFO
logging.basicConfig(level=level,... |
514d334295e426f636e8b4ac4cca0c70cfa4513d85e41307da42cb478ffeed68 | Python | 23,746 | 555 | # 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... |
24176d8988b9ae8605352e152d2219de6bdbd88771fa633c1a9a7c2918d68a49 | Python | 23,752 | 626 | import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from matplotlib import cm
class event():
'''
This class provides a way to store, read, write and visualize spike event.
Members:
* ``x`` (numpy ``int`` array): `x` index of spike event.
* ``y`` (numpy ``int`` array): `y` i... |
cef213845f00f02d98ecf8d273111e2e20404a2883a11a6afbac0414feeb9b20 | Python | 23,764 | 510 | # Copyright 2020 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 ... |
1db353ed670ce6cee7ba47a90ea7c5739aff7714f0b27f64c8fc2c1d637ef24b | Python | 23,767 | 668 | """Provide tests for fMRIPrepConfoundRemover."""
# 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 nibabel as nib
import numpy as np
import pandas as pd
import pytest
from nilearn.exception... |
fffffd8e42d56f46ffd131f2d6c93964f920198bbe2099e9991e31c1cca7447a | Python | 23,787 | 771 | """
Generate interactive HTML spatial review viewer for channel involvement predictions.
MW reviews which channels the CNN predicted as containing periodic discharges.
Channels are color-coded by PD probability (green=involved, gray=not involved).
Includes discharge timing markers and a channel probability bar chart.
... |
f0d7e387490407cffe383783be1d904c39cb448eb2a8dbe463f7acd8b6c505ac | Python | 23,800 | 581 |
"""
Upload multichannel 1024x1024 HRCT nodule samples to the blackboard.
This script reads a dataset CSV containing one nodule mask, one CRF JSON, and
five large-grid CT reconstructions per sample. For each row it:
* resamples the binary nodule mask onto the template series
* computes the mask centroid in the templa... |
4391716549cd58c6702688a22759c3ef4e2f2032caa890daae3974a6dba91505 | Python | 23,803 | 579 | #!/usr/bin/env python
# @license
# Copyright 2017 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... |
8fdcefc1561626f9e7d3b025398669250345ba72bc3ba75615095e3f02a4cb28 | Python | 23,824 | 565 | #!/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 figures/fig{6,7,8,9}_*_characterization.png at 300 DPI.
"""
import json
import os
import sys
import numpy as n... |
7f2b4af6e7d06293042956532a1272c194824d73de0effc3d65fd64f3ac9c089 | Python | 23,826 | 665 | """Torch-based feature store for GraphBolt."""
import copy
import textwrap
from typing import Dict, List
import numpy as np
import torch
from ..base import (
get_device_to_host_uva_stream,
get_host_to_device_uva_stream,
index_select,
)
from ..feature_store import Feature
from ..internal_utils import gb_w... |
c27e5e469b199665d4962b01f905b1e90a23ba1725feb8c701b574e9a23f2c40 | Python | 23,843 | 561 | # 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... |
db41c2ee582e054f6a5daf8772f4ac918c03a3a72cd3b1f8bc1ecb2d7e4a7e16 | Python | 23,850 | 600 | # Copyright 2024 JetMoe 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... |
984e94601b5c2e0836d85f72a568252a1b0178ca9dfe5d23b85b196f2032f0f3 | Python | 23,880 | 633 | """Dataset adapters for re-purposing a dataset for a different kind of training task."""
import json
import os
import numpy as np
from .. import backend as F
from ..base import DGLError
from ..convert import graph as create_dgl_graph
from ..sampling.negative import _calc_redundancy
from . import utils
from .dgl_data... |
7e6c217b276339442b5391373f8629c53b7f3b80d4eea4228dfd2d0a3fb2bad6 | Python | 23,920 | 602 | # Copyright 2022 EleutherAI and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
d7bc2528779a6677135ec152ab8c9d70e57813e099a92bdb512544e857f30d34 | Python | 23,920 | 636 | from config_manager import config_field, config_template
from rl_nav import constants
def get_template():
template_class = RLNavConfigTemplate()
return template_class.base_template
class RLNavConfigTemplate:
def __init__(self):
self._initialise()
def _initialise(self):
self._dyna_t... |
6f6cfb3dd9c378d80d7139e4db966bd03d08ab6b2d81e29695da0f209a5c6935 | Python | 23,927 | 559 | '''Submodule that includes base classes to be extended by framework-specific implementations.'''
import json
import pandas as pd
import warnings
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from pandas.api.types import is_float_dtype, is_integer_dtype
import numpy as np
import slideflow as sf
fr... |
5fbe8e2cfb1c00f6d3debd8ef6052867af9b9e2b0b939d45be5874a94a7cd152 | Python | 23,970 | 785 | import json
import logging
import os
from itertools import cycle
import constants
import dgl
import numpy as np
import psutil
import pyarrow
import torch
from dgl.distributed.partition import _dump_part_config
from pyarrow import csv
DATA_TYPE_ID = {
data_type: id
for id, data_type in enumerate(
[
... |
cf0c011bb0ba24b29609b2f94b7d54ad9dff3a41b372a95055206d3f8a91d344 | Python | 23,974 | 602 | #!${PYTHON_SHEBANG}
## Program: Pype Pad
## Module: $RCSfile: pypepad.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:36:30 $
## Version: $Revision: 1.6 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is distributed... |
6ffec4ca331a8356298bfba7752528543c14e383b8917f7a9bc70662f0337534 | Python | 23,978 | 815 | """
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission, with the `Go to` instruction.
"""
from __future__ import annotations
from minigrid.envs.babyai.core.levelgen import LevelGen
from minigrid.envs.babyai.core.roomgrid_level import RejectSampling, RoomG... |
cb354deb232227c0cf7d8fc7095d3f189932c39e826ef8f7d64bf59e1e036f7b | Python | 24,011 | 655 | """
Generate annotation package for 30 patients MW has not yet scored.
Selects 1 segment per patient (highest variance), generates EEG images,
builds annotation viewer HTML, and saves manifest.
Must run with: conda run -n foe python code/generate_mw_catchup.py
"""
import sys, os, json, base64
import numpy as np
impor... |
23731f696941a33e2ccd651240c6b8339d0aeb0422db7607de08ab3786937ef7 | Python | 24,035 | 691 | # """
# 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... |
6d37a7c7aa1621631c1982c3f314d020069311be727f09399a1748ac62cc159d | Python | 24,040 | 730 | # Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass
from typing import Any, cast
import flax.linen as nn
import jax
import jax.numpy as jnp
import kfac_jax
import pytest
from jaqmc.app.hall.data import HallData
from jaqmc.app.hall.wav... |
0fb300329c966b4ac0678965ea60944fd96fe8a6953e25106d2df58e35761c7c | Python | 24,055 | 521 | # Copyright 2025 Kyutai 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... |
d8905c5e7fb383a2fdf9896a33f821c3021aa4996721b2a3cae74db422ed73b6 | Python | 24,112 | 576 | # 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... |
49e1624a8dcc8099d1e6d82b513251701acebeb9f33aadeaf46561e0e6542c79 | Python | 24,132 | 779 | from __future__ import absolute_import
import os, sys
import pickle as pkl
import networkx as nx
import numpy as np
import scipy.sparse as sp
from .. import backend as F
from ..convert import graph as dgl_graph
from ..utils import retry_method_with_fix
from .dgl_dataset import DGLBuiltinDataset
from .utils import ... |
52bd9cf8eeace4dbff690c947882b45d762340701bf649ddfe3dcd475f3d9d6d | Python | 24,143 | 588 | # Copyright 2022 ABEJA, 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
#
# Unless ... |
3812714da53b83c2d64116d609eab6b05dfac2a1c0c5c64de68fd9075077de69 | Python | 24,145 | 660 | # Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
# Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
#
# This file has been modified by ByteDance Ltd. and/or its affiliates. on 2025.
#
# Original file was released under Apache-2.0, with the full lice... |
52ab05ebce7b7ba97c0db6f5bddcb8a5974b9ba94d63f281eb65a6365304587e | Python | 24,148 | 578 | # Copyright 2024 AI21 Labs Ltd. and the HuggingFace Inc. team. All rights reserved.
#
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
# and OPT implementations in this library. It has been modified from its
# original forms to accommodate minor architectural differences compared
# to GPT-NeoX and... |
22284ed51280909b66a5ce2520be91361d72d50f99eb05c65cd37af8dd91aeb6 | Python | 24,179 | 658 | """Base classes and functionalities for dataloaders"""
import inspect
from collections.abc import Mapping
from .. import backend as F
from ..base import EID, NID
from ..convert import heterograph
from ..frame import LazyFeature
from ..transforms import compact_graphs
from ..utils import context_of, recursive_apply
d... |
d5623769122ecd312c0f9c699504492dbceb226234212b52d2af0ffac079c9af | Python | 24,187 | 625 | """
Round 12: Full evaluation of all signal processing methods.
Loads ALL patients from the unified data structure:
- data/labels/patients.csv (patient list with gold_standard_freq, subtype)
- data/labels/segments.csv (segment -> .mat file mapping)
- data/labels/annotations.csv (per-rater frequency annotations... |
3bda3244d50c71c3d57469d847ca3c8f0ad49588b2bf8de6a69fe39cb475bc21 | Python | 24,221 | 613 | from collections.abc import Callable
import torch
from torch import nn
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache
from ...generation import GenerationMixin
from ...masking_utils import create_causal_mask
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...m... |
7efd6e4c461a6e879e469001db23fb4c1369ee89aab91cfae5d8bc35ecf1ea1b | Python | 24,221 | 589 | #!/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... |
2137f6f1cf034f851fd3911fc2c8ed9d265c187a4a4c02eacfe624188b2725dc | Python | 24,223 | 556 | # Copyright 2026 Alibaba DAMO Academy 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
#
... |
ca2ad4f67c87e43cc8debe616dfb1064a851d3e942deb6059de8fc8329cb61cd | Python | 24,235 | 629 | # 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... |
c359c8b9c19774140f435c172e08d32656fa3b00344fdc4784f691929f2af0b8 | Python | 24,237 | 623 | """
Optimize L/G classification using peak synchrony (PD) and bilateral scores (RDA).
Compares the current spatial_extent > 0.80 method against:
- PD: synchrony-based (are left/right peaks time-locked?)
- RDA: bilateral score (does the weaker hemisphere exceed a threshold?)
Evaluates on 100 expert-labeled test ca... |
5189502985b5f342ef9e198f9e69939bbe5459ac3f53744cbdd0871d3d586ceb | Python | 24,243 | 482 | """Adapted from Nematode: https://github.com/demelin/nematode """
import sys
import tensorflow as tf
from tensorflow.python.ops.init_ops import glorot_uniform_initializer
# ModuleNotFoundError is new in 3.6; older versions will throw SystemError
if sys.version_info < (3, 6):
ModuleNotFoundError = SystemError
try... |
1268a34971930840014c300b3cb1fb5084e95a6d0ccb290f536255300ad792f7 | Python | 24,285 | 616 | """
This script contains all classes for the evaluation of raw AFM and LM files and the geometric properties of the extracted cells
"""
# libraries
import cv2
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
from PIL import Image
import sys
from tkinter import *
import scipy
from scip... |
708af9e87ef0c396d94a905b575501750f164910e578fae94440f8e72406432e | Python | 24,293 | 595 | """
Interactive EEG segment browser with laterality analysis results.
Usage:
python browse_results.py [--event lrda|grda|lpd|gpd] [--start N]
Controls:
Right arrow / N → Next segment
Left arrow / P → Previous segment
Q / Escape → Quit
"""
import argparse
import sys
import numpy as np
import ... |
823b9b29f4ae2a8417ab690d68d302b0a134bbc862ed766bc2cd117d808fd1da | Python | 24,313 | 711 | """
01_drop_duplicated_sbref_and_fmaps.py
--------------------------------------
Drop/rename orphaned or mismatched sbrefs.
Pre-requisite
-------------
Run ``00_merge_split_ses_reording_runs.py`` first to consolidate split session
directories (ses-02 + ses-02part2 → ses-02). This script assumes a single
session dir.
... |
5c30df4b2621187e92a240c4097c4fb05ee373455176c44da4ad9e5d38812ea9 | Python | 24,335 | 677 | """
Train CET-UNet (CNN Evidence Trace with U-Net architecture) for frame-level
discharge detection.
Training targets: Sharp Gaussian bumps (sigma=2 samples = 10ms) at
MW-reviewed discharge times.
- Involved channels get discharge-peak targets
- Uninvolved channels get all-zeros target
Loss: weighted BCE + sharpness ... |
d9cb5303d16009065dcdff5d243dbc648682e1ef5441aaf2259bf857d2476226 | Python | 24,364 | 666 | #!/usr/bin/env python3
"""
Check fMRIPrep preprocessing outputs for completeness.
"""
from __future__ import annotations
from collections import defaultdict
from dataclasses import dataclass
from pathlib import Path
import typer
from rich.console import Console
from rich.table import Table
app = typer.Typer()
consol... |
09c4903ad43047123e0c7e68598342cd3a692fd78401ed38d7993ec2543e71da | Python | 24,368 | 512 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/colmodernvbert/modular_colmodernvbert.py.
# Do NOT edit this file manually as any edits will be overwritten by th... |
3898373ed7150143b43966c9b44f59470ad04b864e58603e6b65e709ec95e7b9 | Python | 24,377 | 737 | # import libraries
import os
from matplotlib.pyplot import get
import numpy as np
import nibabel as nib
from numpy.core.fromnumeric import repeat
import pandas as pd
from pathlib import Path
from collections import defaultdict
import glob
from random import seed, sample
import deepdish as dd
from scipy.stats import mod... |
be02a3d610372325a5196b35fb0470cb0b46d9caf2ea1bb3cfba181120080520 | Python | 24,390 | 656 | """
Generate publication-ready figure for M3_HilbertCV method.
Shows the algorithm applied to two example cases:
GRDA: 112884455 (100% agreement, Q=0.500, 1.94 Hz, 6 experts)
LRDA: sub-S0001118052161_20161130100657 (100% agreement, Q=0.400, 1.53 Hz, 9 experts)
Panels per case:
A: Raw EEG (18 channels, 10 second... |
81777b66ce3fb320fed1dc252bab3fb8a85fd3fd40426045c6144397efb94e44 | Python | 24,396 | 698 | # Copyright (c) 2020, VinAI Research and the HuggingFace Inc. team.
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... |
32871ce7f0f365b5442fa607e6f6ef1dafca530028a4a293eb09e69d1f64a76a | Python | 24,416 | 526 | #!/usr/bin/env python3
import sys
import os
import json
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Wedge
from matplotlib.cm import ScalarMappable
from matplotlib.colors import Normalize
from matplotlib.animation import FuncAnimation, writers
from .SpikefileNest import Spikefile... |
f18fe0f2242819f9638d5c6bcdf70b1b1aa11f729df253546b885a874b8ab5fc | Python | 24,432 | 635 | """Module for graph partition utilities."""
import os
import re
import time
import numpy as np
from . import backend as F, utils
from ._ffi.function import _init_api
from .base import EID, ETYPE, NID, NTYPE
from .heterograph import DGLGraph
from .ndarray import NDArray
from .subgraph import edge_subgraph
__all__ = [... |
2b82ba81ec8930b0f349c7b196d3cd523bd552fdd67c0d856cb9a7a72550a079 | Python | 24,434 | 606 | from __future__ import annotations
import argparse
import csv
import html
import math
from collections import Counter
from pathlib import Path
from statistics import mean, pstdev
COMPONENTS = [
{
"name": "trachea",
"metric": "dice",
"direction": "higher",
"old_metric": "trachea_ds... |
a51648ca64dab1d23c356667f70fe22534ef519150c687e8d2c1d25da2a0bacc | Python | 24,458 | 1,052 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# import modules
import os, glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import rasterio
import rasterio.features
import rasterio.mask
from rasterio.plot import show
from rasterio.merge import merge
from rasterio.enu... |
ad519f42d46572691f081cc051f628a0126ad54cff0d2fd4f7b5121766696445 | Python | 24,508 | 715 | # Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates
# SPDX-License-Identifier: Apache-2.0
import copy
from dataclasses import dataclass
from typing import Any
import h5py
import jax
import numpy as np
import pytest
from jax import numpy as jnp
from jaqmc.app.hydrogen_atom import hydrogen_atom_train_workfl... |
0630fff425da83f8783f61be8a528e14d888caca92a95aae2f263555c1ead304 | Python | 24,518 | 569 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtksurfaceclipper.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.9 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is di... |
2ad4696d95b9316c4c2ec285f6410e80c9ce10014b86633b4fd19c9292e1187b | Python | 24,537 | 636 | """Item Sampler"""
from collections.abc import Mapping
from typing import Callable, Iterator, Optional, Union
import numpy as np
import torch
import torch.distributed as dist
from torch.utils.data import IterDataPipe
from .internal import calculate_range
from .internal_utils import gb_warning
from .itemset import He... |
96998e7a9159d9575265eb18011eb625886c76826492b03e3cea43889eea0fe7 | Python | 24,567 | 586 | """V3 Feature Extraction — comprehensive feature families for LRDA vs GRDA.
Feature families:
1. Focality / spatial concentration
2. Homologous channel pairs (PLV, coherence, power ratio)
3. Connectivity / synchrony
4. Rhythmicity / morphology (inc. Hilbert frequency estimation)
5. Waveform shape
6. Time-f... |
029eac652c772a8ae69d65aeb7933a948e83b12d42b6d9724759b2aba2208e49 | Python | 24,623 | 660 | import re
import dgl
import pytest
import torch
from dgl import graphbolt as gb
def test_ItemSet_names():
# ItemSet with single name.
item_set = gb.ItemSet(torch.arange(0, 5), names="seeds")
assert item_set.names == ("seeds",)
# ItemSet with multiple names.
item_set = gb.ItemSet(
(torch.... |
b1a4d14b75cf24eb5efa6dc962aa135ed0df20d9e81205c83c781cf7d48e03ae | Python | 24,654 | 795 | from __future__ import annotations
import hashlib
import math
from abc import abstractmethod
from typing import Any, Iterable, SupportsFloat, TypeVar
import gymnasium as gym
import numpy as np
import pygame
import pygame.freetype
from gymnasium import spaces
from gymnasium.core import ActType, ObsType
from minigrid.... |
0c63b9193a4a81c5b76b81aa764d872d83172d510772364505150fe8a30c7c8b | Python | 24,660 | 570 | # -*- coding: utf-8 -*-
"""
Script to plot rheobase correlations - Figure 5
"""
__author__ = "Nils A. Koch"
__copyright__ = "Copyright 2022, Nils A. Koch"
__license__ = "MIT"
import pandas as pd
import numpy as np
from numpy import ndarray
import string
import textwrap
import json
import seaborn as sns
import matplot... |
5c8bd32101e5707e67119bb25dd4f96fcda451a14ded417294da109f81e73e08 | Python | 24,660 | 646 | """
Round 5 experiment: Expanded template banks and better matched-filter envelopes.
Builds multiple template banks from annotated data (with more permissive
selection: expert freq std < 0.3), then evaluates matched-filter envelope FFT
frequency estimation across all banks and combinations.
Template Banks:
Bank C16... |
9537442af8db94dd90c2881a346b1ca573d0e312745eb3ee9729ccaa8df61e3b | Python | 24,668 | 558 | """
Round 5: Target-transform experiments for frequency prediction.
The dominant errors are multiplicative underestimates (algorithm says 0.5 when
expert says 1.0, or 0.75 when expert says 1.5). Predicting period or log-frequency
should linearize these errors.
Variants:
a) r5_predict_logfreq: target = log(exp... |
b7514e46c16fec30de02c9a8afb1f843c51b8679e212b9f9d81c27236c1075e4 | Python | 24,678 | 727 | import numpy as np
import networkx as nx
import pandas as pd
from scona.make_graphs import assign_node_names, \
assign_node_centroids, anatomical_copy, threshold_graph, \
weighted_graph_from_matrix, anatomical_node_attributes, \
anatomical_graph_attributes, get_random_graphs, is_nodal_match, \
is_anatom... |
24487ee3ec9df84192bfa909c167560ddc486793479a295a3ca244165cbb5f5b | Python | 24,679 | 571 | # -*- coding: utf-8 -*-
"""
Script to plot AUC correlations - Figure 4
"""
__author__ = "Nils A. Koch"
__copyright__ = "Copyright 2022, Nils A. Koch"
__license__ = "MIT"
import pandas as pd
import numpy as np
from numpy import ndarray
import string
import textwrap
import json
import seaborn as sns
import matplotlib
i... |
9f98a7bb158c6162040be223061b96c86ee187732ae205ce9505f0d3b1117304 | Python | 24,719 | 672 | """Provide concrete implementation for pattern-based DataGrabber."""
# 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 glob
import re
from collections import defaultdict
from copy import de... |
f30ce3dc9471ac680fa35ef31e72c61bdb8dc2b68d4ce675000b4f6820dfd773 | Python | 24,729 | 640 | """
Round 6: Mega Combiner — all frequency estimators + ridge regression.
Computes EVERY available frequency estimator per segment, then trains
multiple ridge regression models with LOO-CV.
"""
import sys
import os
import numpy as np
import warnings
import time
warnings.filterwarnings('ignore')
CODE_DIR = os.path.d... |
702875e5a332b360286e4bc207f399467484ccafac7c67f688bd6eb0963b3167 | Python | 24,731 | 650 | #!/usr/bin/env python3
"""
Regenerate figure data JSONs for figures 1-3b with discharge-locked topographic
localization (PD) and narrowband amplitude topography (RDA).
Reads existing figure_*_examples_data.json to reuse the same segment_ids,
then recomputes:
- topo_img_mono / topo_img_lap: MNE topoplot PNGs (base64,... |
89f86ce7baac11c513800f295d8e1be464de0b12a4506f826d25815e07be613b | Python | 24,769 | 670 | # Copyright 2026 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... |
96a3227278f23339d70f37902023fc684de4262613e13f542aee26d180bc925b | Python | 24,791 | 602 | from __future__ import annotations
import argparse
import csv
import html
import json
import math
import os
import shutil
from collections import Counter
from pathlib import Path
RESULT_CSV = "ett_tip_to_carina_results.csv"
IMAGE_COLUMNS = ("overlay_path", "lineage_overlay_path", "reference_overlay_path")
NUMERIC_CO... |
27dc5dc0af9b38e2371df15bdcc538f3453ee586d08f1225ff45ac7a34282a9f | Python | 24,864 | 655 | # 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
#
... |
e6b8563bd8067859b9ffb4863126bd9739c945f758f41ebc675d083b65907af2 | Python | 24,870 | 570 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/dinov2_with_registers/modular_dinov2_with_registers.py.
# Do NOT edit this file manually as any edits will be ove... |
676e6522496396bf61155ae5bf2483e9390e0dfd933f0f4a3b6299e0b665fe9a | Python | 24,875 | 550 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/granite_swa/modular_granite_swa.py.
# Do NOT edit this file manually as any edits will be overwritten by the gene... |
d56d281ca4a9ac7e2c01adb2f7a7d7ff0bc4e410562b95374286187764c8bbdc | Python | 24,930 | 566 | # Copyright 2026 OpenBMB and the HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
8fe06eebfb8436ad41dc3db799f571c94f79e1ed4f5209fbeb48de7296d1d422 | Python | 24,939 | 554 | # 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... |
a5925d8c1860cc3bcb22521bd09ea26851a4856e5c0d03417e5b167f212d08bc | Python | 24,946 | 591 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glmasr/modular_glmasr.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
... |
6e8e76dcbcc0349c89c9d5c9fba8f12447c5600c0beb2ed3e2c854c931212b4c | Python | 24,951 | 534 | # 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... |
e513380ad3edb667a5425f0d49eac489237b8502cad347628e1e47d7b0106a4d | Python | 24,959 | 643 | """
Round 7: Expert-distribution training & spatial-extent channel selection.
Approaches:
A. Per-expert ridge models (train to each expert, average predictions)
B. Soft-label training (target = mean of log expert freqs)
C. Spatial-extent-guided channel selection (only detected channels)
D. Laterality-aware cha... |
32a98f10968f1aa2977ad1c360cfb26afcda3c25ff86c8c954662f0dc833ed3d | Python | 25,009 | 602 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/lfm2/modular_lfm2.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
a3eeae4f4868b925c69e57a0bcb58192008a8faf23cc60cd70d09018ab37388e | Python | 25,019 | 735 | #!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Copyright (c) Yongning Lei 2025-2026 — Apache-2.0 license
# -----------------------------------------------------------------------------
"""
compute_tsnr_votc.py
Compare tSNR across ME_denoised, ME_optcom, and S... |
37956a028d0afa974641628599f782471718bf830397467ed54559e72a9da2ee | Python | 25,065 | 690 | """
Phase 4: Validate whether the CNN's PD probability predicts frequency estimation accuracy.
Hypothesis: patients with clearer PD patterns (higher CNN PD probability) should have
more accurate frequency estimates, because the periodic discharge signal is stronger
and easier to measure.
For each patient:
- Compute... |
d2e01be06c7c32c2a654af4bb2c355461cef08370c6666539c8207ed468e5224 | Python | 25,067 | 673 | # Copyright (c) 2024-2026 ByteDance Ltd. and/or its affiliates
# SPDX-License-Identifier: Apache-2.0
from typing import Tuple
import chex
import jax
import jax.numpy as jnp
import ml_collections
from jaqmc_legacy.loss import utils
DEFAULT_SPIN_PENALTY_CONFIG = ml_collections.ConfigDict({
# Whether to enbale the... |
53d6d41c91e9cc27b7e131525e50d93b4ab56dde9d5a375f44bfeac4d684653a | Python | 25,069 | 606 | #!/usr/bin/env python3
"""Build a JSON workflows graph for explorer from workflow and retained-plan records."""
from __future__ import annotations
import argparse
import json
import re
import subprocess
import sys
from pathlib import Path
from typing import Any
import yaml
TOOL_REFERENCE_PATTERN = re.compile(r"\bfr... |
9ffc0872ddc3339c7aae610ed8ac751e313edfc8787ce2e1d93e735525271e3e | Python | 25,072 | 573 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/diffllama/modular_diffllama.py.
# Do NOT edit this file manually as any edits will be overwritten by the generati... |
7728368261b2a95c789c452869299f13c361dcf8b3a7fac1679cbad37e5f22f2 | Python | 25,079 | 652 | import warnings
import numpy as np
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from nilearn import plotting
from scona.visualisations_helpers import save_fig
from scona.visualisations_helpers import create_df_sns_barplot
from scona.visualisations_helpers import grap... |
411be30582e7aa4acf2925ead18900612bd4b37396842d5f1a589afc62ed2cd2 | Python | 25,105 | 575 | import tensorflow as tf
import numpy as np
from tensorflow.keras import Input
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LayerNormalization
from tensorflow.keras.layers import BatchNormalization
class alpha_nes_full(tf.Module):
def __init__(self,physics_layer,force_layer,num_l... |
62109203e572ccae7df65b30832abcf1b1c657621a27ae164d027f9d37ba811e | Python | 25,105 | 718 | # -*- coding: utf-8 -*-
"""
Contains functionality for running spatial null models
"""
import os
import tempfile
import nibabel as nib
import numpy as np
from scipy import ndimage
from scipy.spatial.distance import cdist
from packaging import version
try:
import brainsmash
from brainsmash.mapgen import Base, S... |
1bdcf69fb44410834003b6ac71431fa29b03a0ac47e8541b81f420df2fe3465f | Python | 25,108 | 559 | # Copyright 2024 The HuggingFace Inc. team and Google DeepMind.
#
# 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 appli... |
18729a87d2dd0541a13b32d293a0c2232b91d3a92a1b234c478edcc029dcf173 | Python | 25,117 | 661 | """
Round 9: Leave-One-Patient-Out (LOPO) evaluation experiments.
Experiments:
1. r9_lopo_sp_only - LOPO with 8 SP features (baseline)
2. r9_lopo_strict_gpd - LOPO excluding abn2147 entirely
3. r9_lopo_quick_wins - LOPO with 10 features (8 + ratio_fft_to_peaks + eigenvalue_spread)
4. r9_knn_cross_patient - Cr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.