sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
773071f729ba2267026f735cf8a21239bf5451bad27e0140d672bb5b6f4279cd | Python | 19,919 | 435 | import json
import numpy as np
import pandas as pd
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix, log_loss, make_scorer
from sklearn.preprocessing import LabelEncoder
from tensorflow.keras.losses import BinaryCrossentropy, CategoricalCrossentropy, SparseCategoricalCrossentropy
fro... |
5e5f85e6d82000ef73fd703f39d3dbbc54a763da60f6b716ec5311e67c943228 | Python | 19,921 | 470 | from __future__ import annotations
import copy
import datetime
import webbrowser
from collections import deque, OrderedDict, namedtuple
from pathlib import Path
from typing import Tuple, Optional, List, Union, Set
import napari
import numpy as np
from PyQt5.QtWidgets import QApplication
from magicgui import use_app
f... |
de179ac7299b73e14601d53fc41e96408878f3dced571c7f5d6dd87e62bb8f01 | Python | 19,949 | 466 | # 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... |
2adbc6114ddda3bbd92b1c46e81ae918585c45715e47965402d5756e6f34e7ba | Python | 19,961 | 561 | # Copyright 2023 Google Research, 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
#... |
219513bb1840aaf30b531f02d523a2ee73670f965c1605b468af3079ed66b35f | Python | 19,970 | 560 | # Copyright 2023 Microsoft Corporation
# Copyright (c) 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 2026.
#
# Original file was released under MIT, with the full license text
# available at licenses/folx_MIT.... |
a4697f85f139ee60d047e2fa2707efe342a91da31cecdfec6ab68f240f5b0bda | Python | 19,993 | 631 | # Copyright 2023 Microsoft Corporation
# Copyright (c) 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 2026.
#
# Original file was released under MIT, with the full license text
# available at licenses/folx_MIT.... |
2a8952933189a9bb93511f9b396dcde0b5fe6fb8297cad3b7f1db04d754f63ec | Python | 19,995 | 390 | # 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... |
8fdea4bb1a1b644f3e8e50d0ade5fd61ef729a8aa58586b1808a65d092d7e4bf | Python | 20,018 | 556 | """
PDNetV2 Training - 5-fold patient-stratified cross-validation.
Usage:
conda run -n foe_dl python code/pdnet_v2/train.py
Saves:
data/pdnet_v2_cache/fold{k}_best.pt - best model per fold
data/pdnet_v2_cache/training_progress.json - live training log
"""
import sys
import json
import time
import... |
71eeeead9d89d454b01df2ab4e973ee3aa64b0d613f4ab717f745847c2a7ba1a | Python | 20,020 | 568 | #!/usr/bin/env python
"""
reorganize_data.py — Reorganize ALL data into a clean unified structure.
Target:
data/
├── eeg/ ← ALL .mat files, uniform format
├── labels/
│ ├── segments.csv ← One row per segment
│ ├── annotations.csv ← One row per (segment, rater) rati... |
d9b8c358a364506dece8d69c5ef333999967bf3ee6690384c4466a563b540d70 | Python | 20,036 | 613 | ### This script could run an MLP only model for predicting BEI values of molecules (of IC50 of Tissue Factor Pathway Inhibitor) using combination of Morgan Fingerprint, Shannon entropies (SMILES Shannon and SMILES partial/ fractional Shannon) and MW as descriptors
# import the necessary packages
import numpy as np
im... |
fd278c83dea409a7ee9522831488b1367e25f2dbbcbe216b80c08525a51598cb | Python | 20,038 | 555 | """Training functions for various multi-instance learning (MIL) models."""
import os
import numpy as np
import slideflow as sf
import pandas as pd
from os.path import join, exists
from typing import Union, List, Optional, TYPE_CHECKING
from slideflow import Dataset, log
from slideflow.util import path_to_name
from os.... |
48d5639627f6125413cdb4ed9cb13a318536ac7ca9d80984e1dcbe35edeaabcf | Python | 20,046 | 546 | '''Functions for slide extraction reports (PDF).'''
from __future__ import absolute_import, division, print_function
import io
import os
import tempfile
import pandas as pd
import numpy as np
import cv2
from fpdf import FPDF, XPos, YPos
from PIL import Image, UnidentifiedImageError
from datetime import datetime
from... |
ac2df0e44e72abd4319504092bbdf2786582cb7a67658e8b1376cca849580f49 | Python | 20,047 | 487 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkmeshwriter.py,v $
## Language: Python
## Date: $Date: 2006/07/27 08:27:40 $
## Version: $Revision: 1.13 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is distr... |
81bcb71dc31dba5946f482eaac8fcf901dbf6edf8bde4fcc257c6a8eeff83929 | Python | 20,058 | 554 | # Copyright 2025 Apple Inc. 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 requir... |
4fff9bd56bf45767d0557f851a59e15f58b86eeebd8a68b195b00977668d260b | Python | 20,061 | 370 | """Utility functions and sample configuration spaces
for Bayesian hyperparameter searching with SMAC."""
from typing import Optional, List, Union, Tuple, TYPE_CHECKING
if TYPE_CHECKING:
from ConfigSpace import ConfigurationSpace
def broad_search_space(
*,
batch_size: Optional[List[int]] = [8, 16, 32, 64]... |
63b7ff41aee5d2cd4afc2805117762921adce9b40f1fee60f2107d21c8d70555 | Python | 20,093 | 653 | from copy import deepcopy
import backend as F
import dgl
import dgl.function as fn
import dgl.nn.tensorflow as nn
import networkx as nx
import numpy as np
import pytest
import scipy as sp
import tensorflow as tf
from tensorflow.keras import layers
from utils import parametrize_idtype
from utils.graph_cases import (
... |
0ffeb37dc244ffa3c460b089b1363bdf3371124b478520b8400d0dd6dca16ad9 | Python | 20,096 | 462 | # 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 ... |
a54f2b0dead8567f4209fe60a99d9c21906229cebe27f876a61b9a2241a23a11 | Python | 20,097 | 510 | import sys
sys.path.append("../utils")
import numpy as np
import re
import os
import pickle
import time
from Results import test_results, plot_train_history, recall_m, precision_m, f1_m
from datetime import datetime
from contextlib import redirect_stdout
import tensorflow as tf
from tensorflow.keras import layers
from ... |
dcb14f56348fcc2d6d87544d8265ab1a65243337045e48f91328d4eed69ca117 | Python | 20,100 | 527 | """
Generate images and an HTML viewer for annotated EEG segments where
the B+pnorm algorithm's frequency estimate disagrees with expert
consensus by more than 0.5 Hz.
Outputs to results/disagreement_cases/:
- EEG and pointiness PNG images for each disagreement case
- metadata.json / metadata.js with algorithm and... |
b6fee91dd0682cf391a9f1dbd98b806f054f90453fa2ce90caadb7c5d3352b10 | Python | 20,104 | 589 | """Submodule for tissue segmentation.
Tissue segmentation utilizes the ``segmentation-models-pytorch`` library, which
provides a number of pre-trained segmentation models across a variety of
architectures. The ``SegmentConfig`` class provides a convenient way to configure
a segmentation model, and the ``train`` functi... |
97296b66ed591429b0870e4bd00b9fee62b7fd8422cc0c8a4d4bc3ff2680ac8f | Python | 20,121 | 500 | # Copyright 2022 EleutherAI 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 OPT... |
82c95e6caf615eb8d64a05d08f4494af9e0d9b720e23e29cb20edb8be06a5c53 | Python | 20,126 | 504 | #!/usr/bin/env python3
"""
Generate Fig 3: RDA Characterization Pipeline composite figure.
Three-panel horizontal layout:
Panel A (left): Input 19-channel EEG (average reference, 10s)
Panel B (center): Architecture flowchart (W05 iterative narrowband refinement)
Panel C (right): Output visualization (EEG + na... |
bea2e659aa011f8527b561e6b1f69c139eb98af3b6a95bca906d10cf7d08aad3 | Python | 20,146 | 591 | # Copyright 2022 The BAAI Teams Authors and The HuggingFace Inc. team. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
826d3440296a2f27963b15ca15fa2ea87ae06d91895eed2bfca2ab52ce4b9e73 | Python | 20,157 | 472 | # Copyright 2026 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... |
f4ef5a1ecbe7ed9cedc3ade177b0b126550a878c8e6670d24a7a72c7e60b3e6f | Python | 20,160 | 490 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/helium/modular_helium.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
... |
e6913973a258d015a95df062e012077417926882df98746739015cc2e144d44c | Python | 20,177 | 587 | """
Harvest LPD segments from the morgoth1 S3 dataset to balance the frequency distribution.
For each 10-minute LPD file on S3:
1. Download it
2. Extract the central 10-second segment
3. Convert to bipolar montage
4. Estimate frequency using our pre-trained Ridge model
5. If the frequency bin needs more cases, keep th... |
b6b0d6a9ddbc83090c9225e3a9be9b1e4b94a63b428ac7f4335ab0e768aebd89 | Python | 20,180 | 501 | """
HemiNet Dataset (Experiment 1.1)
For each ground-truth case:
- LPD with laterality → 1 example (affected hemisphere)
- LPD without laterality → 1 example (hemisphere with stronger PD signal)
- GPD → 2 examples (left hemisphere + right hemisphere)
- GRDA / LRDA → 1 example (treate... |
17d80ecd3ba89ee49b2eee16e51da2e6af048d8e266261d8c5de3fdc77b537d6 | Python | 20,182 | 396 | import collections
import itertools
import os
import json
import warnings
import torch
from torch_geometric.data import Data, Batch
import numpy as np
import h5py
from .from_pymatgen.lattice import find_neighbors, _one_to_three, _compute_cube_index, _three_to_one
from .utils import flt2cplx
class Collater:
def ... |
77fc50530e5688f58da94ba67c99464cbafa16f995cfaaef1e5932c0bea752ef | Python | 20,188 | 590 | import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
from persist import layers
from copy import deepcopy
from tqdm.auto import tqdm
from torch.utils.data import DataLoader
def restore_parameters(model, best_model):
'''Copy parameter values from best_model to model.'''
for params,... |
2484836f5eaa4a9cb33e34c369215696877183edef8769f47da4579e1760e67d | Python | 20,221 | 539 | import sys
import cv2
import time
import traceback
import numpy as np
import slideflow as sf
import slideflow.grad
from scipy.special import softmax
from typing import Optional
from slideflow.util import model_backend
from rich import print
from .utils import EasyDict, _load_model_and_saliency
# ---------------------... |
21e7cb672eb94dfe4a57d957e6cb71320a7a590190af2ffebeed3250b63fe57f | Python | 20,235 | 485 | # Copyright 2022 Salesforce authors, The EleutherAI, and HuggingFace Teams. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
6ddf8bf7a13e4789ef6c5283b83ece24d8c8ff7c919275e07b1a9ba60c74aa21 | Python | 20,244 | 636 | from __future__ import annotations
import math
import warnings
import gymnasium as gym
import numpy as np
import pytest
from minigrid.core.actions import Actions
from minigrid.core.constants import OBJECT_TO_IDX
from minigrid.core.world_object import Goal
from minigrid.envs import EmptyEnv
from minigrid.wrappers imp... |
4fd797fedb8ed361f86605e644315696af76e718db3542a11d1167e4d2552c8e | Python | 20,252 | 500 | #!/usr/bin/env python3
"""
Generate Fig 3: RDA Characterization Pipeline composite figure.
Three-panel horizontal layout:
Panel A (left): Input 19-channel EEG (average reference, 10s)
Panel B (center): Architecture flowchart (W05 iterative narrowband refinement)
Panel C (right): Output visualization (EEG + na... |
855cb83880161eb90151a4da10b6b54f9a5e1d7032764e2719687cbff9fb9a5b | Python | 20,279 | 496 | # Copyright (c) 2022-2026 ByteDance Ltd. and/or its affiliates
# SPDX-License-Identifier: Apache-2.0
'''
Handling both ckpt and metric file saving / loading / rolling back
'''
from concurrent.futures import ThreadPoolExecutor
import itertools
import os
import re
import shutil
import tarfile
from typing import List, O... |
08c29bb9c97786ec51e70b2dd7ebc62073ffc05ea648bd723b6c0ab2efd9beb1 | Python | 20,285 | 456 | # Copyright 2026 Poolside 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... |
a63db5b86b74eee536466b13ff1d072717cdc258763610e5dd9962807793479b | Python | 20,354 | 693 | """Testing DataGrabbers."""
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
# Synchon Mandal <s.mandal@fz-juelich.de>
# License: AGPL
import tempfile
from collections.abc import Callable
from enum import Enum, StrEnum
from pathlib import Path
from typing import Any, ClassVar
from uuid import uuid4
i... |
86e9c4590110cb6ca69009cb4be6a411e04076bc9a18c93e1d4849bc469014f8 | Python | 20,355 | 451 | import copy
import logging
import os
import numpy as np
import pyarrow
import torch
from gloo_wrapper import allgather_sizes, alltoallv_cpu
from pyarrow import csv
from utils import map_partid_rank
class DistLookupService:
"""
This is an implementation of a Distributed Lookup Service to provide the following... |
f79a83b39a54aef884543af7533bd96a02524a631c76540249bc1bd2b5bf5037 | Python | 20,402 | 481 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/apertus/modular_apertus.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation o... |
6e0700b857fa395e7af39139392b1c40a095f24ce703cfc5f15d92e91aa8b60b | Python | 20,422 | 534 | #!/usr/bin/env python
from __future__ import print_function, absolute_import # NEED TO STAY AS TOP IMPORT
import vtk
import sys
import math
from vmtk import vtkvmtk
def ReadPolyData(filename):
reader = vtk.vtkXMLPolyDataReader()
reader.SetFileName(filename)
reader.Update()
return reader.GetOutput()
def ... |
5cb84f07a9a590faa3dc65f9914049c4f260ea47efbeaac6605d47b60dd0c49d | Python | 20,436 | 506 | """
This file helps in updating the MUSIC file or create a new MUSIC file from the JSON file.
It creates a dictionary from the JSON file and a list from the MUSIC file. Then it compares the corrosponding parameters
and updates the list. Then the list is printed as a new MUSIC file or it is updated to the old MUSIC fi... |
f566a7fc71e7bf2e768edc016e061898f4cc30cb2c71a046b3e5e53c271f7af5 | Python | 20,465 | 529 | # pylint: disable=not-callable
# pylint: disable=no-member
import numpy as np
import torch
import mnist_utils
import functions as F
def set_tensor(arr, device):
return torch.from_numpy(arr).float().to(device)
class QCodingNetwork(object):
def __init__(self, cf):
self.device = cf.device
sel... |
d5c51d447df752ebb798fc8e53842e5c656fdbb42590d20d40edf1bbbef78190 | Python | 20,476 | 472 | # 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... |
ed327d4ed511db9bc956f5db420843a78caaa533d9e76b72be5074802a7743b7 | Python | 20,481 | 470 | #!/usr/bin/env python3
"""LRDA laterality v2 -- rhythmicity features + peak-locked topographic centroid.
Evaluates two fixes for the LRDA laterality gap, head-to-head against
the V12/V1 baseline (pass-2 narrowband envelope rule).
Fix 1 (rhythmicity, addresses the 3-of-6 amplitude-vs-rhythmicity errors):
- spec_conc... |
78cc758187c297a1aac2cde9941e2a5501514e3f0065f1c3b3edfae352e33331 | Python | 20,482 | 538 | """
Round 7 Mega Combiner: combines best R6 features (TKEO, HPS, spectral coherence)
with best R7 features (multi-montage, per-expert training, spatial selection)
into one optimal model.
Target: beat r7_expert_spatial_ridge Spearman 0.471.
"""
import sys
import os
import numpy as np
from pathlib import Path
CODE_DIR... |
1d78e53148c90c44a6fafcd089df1e972aa8a65151526f2ae3dd790139fd00ee | Python | 20,511 | 481 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/cwm/modular_cwm.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
7887681ebe3b946352f997752d847adc4bdcce7e09b0152af935229bb7c5e020 | Python | 20,546 | 542 | #!/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... |
60ab358bb3b572dfeaf393608d8e8611567e0c3119bb6b68a99779b19e8a9fb1 | Python | 20,553 | 476 | import os
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset
import torchvision.transforms.v2 as T
from torchvision.transforms import InterpolationMode
import matplotlib.pyplot as plt
import sys
# Optional MONAI for 3D augmentation
try:
from monai.transforms import... |
e28c39d0060ca25994300fba589771d8ed688a5afd45a6fc9c3e5525e30ba1ed | Python | 20,553 | 603 | # This hybrid model architecture predicts Ki values in the form of pCHEMBL/MW values of molecules for the target protein coagulation factor F11a with fractional Shannon entropy and MW as descriptors for MLP-based deep neural network model and 2D images of molecules as inputs for CNN-based deep neural network model
# i... |
aed7d6d4ef5e2d1eb5e2455f51804224428c7d222564fb23ccf128ad068df36c | Python | 20,554 | 671 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import simplejson as json
import logging
import pytest
from unittest import mock
from .... import config
from ....testing import example_data
from ... import base as nib
from ....pipeline import... |
1c2701a7c4ddfbdc022cf364ff24e6df39602632a4fab806983f41c5252c8875 | Python | 20,558 | 523 | # Copyright 2024 Databricks Mosaic 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-... |
e33ca7efeef5680c1d32d21a698db22a56f43239042c53de6dcb062e359e2537 | Python | 20,587 | 476 | # Copyright 2024 Meta 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 re... |
9afe1e37f63add771e5e4ae34b8e1302a6bceac8302047335a4d9004c9fa7d93 | Python | 20,588 | 600 | from random import randint
#from enum import Enum
import math
import numpy as np
#global k1,l1,k2,l2,k3,l3,k4,l4,k,l,V_F,q_F,kk1,ll1,kk2,ll2,kk3,ll3,kk4,ll4,kk,ll,V_E,q_E
##########################
class Joint(object):
name = 'JointName'
maxJointAng = 0.0 # [Rad]
minJointAn... |
1308ef31f630b399f792cf515b211668de4ef7e211994c025849fb93cd2a638e | Python | 20,600 | 483 | """
Phase 2: Fine-tune pretrained backbone for frequency estimation with dual heads.
Run: conda run -n foe_dl python code/dl/train_phase2.py
"""
import sys
import os
import time
import warnings
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from pathlib import Path
from s... |
6735820c28d3c297c274b754b3d149d995cf4a2db43147e0ceef65cbc4466adb | Python | 20,650 | 501 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/arcee/modular_arcee.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
b9eb0bc8e6d3ae494bec5a6c4dcfd3b476ba897dc25ef875580cb014516eff3e | Python | 20,650 | 610 | # This program predicts Ki values in the form of pCHEMBL/MW values of molecules for the target protein coagulation factor F11a with Shannon entropies, fractional Shannon entropy, bond frequency and MW as descriptors
# import the necessary packages
import numpy as np
import pandas as pd
from KiNet_mlp import KiNet_ml... |
6b6445c2f4dc1599de326caa9d7138c2b56e12a81b8b34ac3386687bb21ada0b | Python | 20,689 | 473 | # 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 ... |
091416ad1c9b477ea6d59bbbbb5c2af111033bdd684de6a2e3928902cbef5eff | Python | 20,693 | 593 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... |
b926f50fb38fc73f724b101b3741175622699f1d940fa2eadd7175f64a21af02 | Python | 20,705 | 602 | ### This script could run an MLP only model for predicting BEI values of molecules (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 im... |
16f4f98225fb3a394583c1f4c9460ebbeb27446c3dccd0eb5bd8b000af984ee9 | Python | 20,713 | 575 | """
Round 6: Cross-channel phase coherence features for LPD frequency estimation.
Hypothesis: Experts use spatial propagation patterns — an LPD discharge "spreads"
from one electrode to the next with slight phase offsets. Channels showing the same
periodic discharge should be phase-coherent. This signal is currently u... |
bda90032ffa97ff45d558c84fbfdd744a5d602538f406969ac9f5e0bdcc9d76d | Python | 20,731 | 545 | """
.. _model-gat:
Understand Graph Attention Network
=======================================
**Authors:** `Hao Zhang <https://github.com/sufeidechabei/>`_, `Mufei Li
<https://github.com/mufeili>`_, `Minjie Wang
<https://jermainewang.github.io/>`_ `Zheng Zhang
<https://shanghai.nyu.edu/academics/faculty/directory/zh... |
377a58e61ba423013bccdd94870a0f6441e6a3e344d6d82ffa3162e85dc4c163 | Python | 20,763 | 579 | """
MIT License
Copyright (c) 2020-2023 Garikoitz Lerma-Usabiaga
Copyright (c) 2020-2022 Mengxing Liu
Copyright (c) 2022-2024 Leandro Lecca
Copyright (c) 2022-2023 Yongning Lei
Copyright (c) 2023 David Linhardt
Copyright (c) 2023 Iñigo Tellaetxe
Permission is hereby granted, free of charge,
to any person obtaining a ... |
d8fb68b02b79e530dbac8f9206653eebd285a7f91be74328e7873fd7ae5bb99f | Python | 20,809 | 546 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import tensorflow as tf
from scipy.ndimage import gaussian_filter
from PIL import ImageFilter, Image
from IPython.display import display
def plot_microstructure(microstructure, idx):
"""plots selected microstructure
:param ... |
49b9d574b83749edf4c57598bb65e5b1731016404e3a1e077b730cc739f26a8f | Python | 20,817 | 482 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/bitnet/modular_bitnet.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
... |
7a7700ae1c69b796e044bab8b94b60993b59071af6fab365cf4cbc17fea44ee2 | Python | 20,828 | 599 | """
HPP (Hidden Point Process) discharge marking algorithm.
MAP inference using dynamic programming over candidate peaks with an
approximately-periodic prior. Pure signal processing + DP (no deep learning).
Usage:
conda run -n foe python code/label_pipeline/hpp_discharge_marking.py
"""
import sys
import json
imp... |
e1d57829905a46a8b20147a22c679cb35f1feb57d31a4dbade04ee4db087719e | Python | 20,834 | 508 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glm/modular_glm.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
58c3e894f4b20ead87125b9971ddf8b74bb24f404c306582387aee9d90769778 | Python | 20,838 | 448 | # 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... |
d98441d607eef021a2875a1e648d5b59f6e46ef53279bb2222611f7c05b4c452 | Python | 20,843 | 501 | """
Continuous batching overall benchmark suite.
Runs CB in-process across many configurations: GSM8K-Platinum and IFEval (throughput + lighteval accuracy), raw
synthetic-data benchmarks, and RL-style rollouts.
Each entry records generation time, e2e wall-clock time, tokens, throughput, peak memory and optional accura... |
a55902244a7b589ba9be4db5c009685a6a42874fff8bd0cda1456bbf2671236b | Python | 20,851 | 606 | """
Train a frame-level discharge detector using bootstrap targets from
pointiness peaks. 5-fold patient-stratified CV.
Bootstrap target generation:
- PD-positive channels: compute pointiness trace, find peaks (PEAK_HEIGHT_FRAC=0.3),
place Gaussian bumps (sigma=5 samples = 25ms) at each peak
- PD-negative chan... |
772d0e2d4ec9908dbb32f8aa119f4532981f676795dc40c18346b6f803db3901 | Python | 20,852 | 398 | # 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... |
0a8733c902c82fe5c2e15d2e83bb6bdeb2f5df6bcaba03b624569e53676af580 | Python | 20,919 | 536 | # Copyright 2019-present CNRS, Facebook 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 requi... |
6ade2e7bf0ae595302117e692205e1d463c6d3a00dec3582381e3c9f672229ca | Python | 20,948 | 582 | import copy
import json
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
from rl_nav import constants
from rl_nav.environments import escape_env
from rl_nav.utils import env_utils
class EscapeEnvDiagonalHierarchy(escape_env.EscapeEnv):
def __init__(
self,
training: bool,
... |
c787355de91fb14e4aa7c5fafd9268d060b155f8327b1f65cbffa81a5f3b3931 | Python | 20,951 | 504 | #!/usr/bin/env python3
"""V13 -- rhythmicity-by-construction LRDA laterality rule.
Motivation: V12 lateralizes via amplitude (which hemisphere has more
narrowband envelope amplitude at the estimated rhythm frequency).
Amplitude-based laterality is fallible by construction:
- Single-channel artifact (electrode pop, ... |
6c4ad023f104d9fc33ec75ac5960e97688fb9039cd5cc3681c22711926891273 | Python | 20,954 | 550 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import tensorflow as tf
from scipy.ndimage import gaussian_filter
from PIL import ImageFilter, Image
from IPython.display import display
def plot_microstructure(microstructure, idx):
"""plots selected microstructure
:param ... |
251569587c5830150c368ec7a863f414f487538ba4560c6020a614db27ed8ef6 | Python | 20,956 | 486 | # Copyright 2026 The Sapient AI Authors and the HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... |
58cdb108dc57520fe0b6d2e8b5018d73a2c995e877901fc5afc27a7e23f4ffff | Python | 20,960 | 576 | """Provide JuniferConnectivityMeasure class."""
# Authors: Synchon Mandal <s.mandal@fz-juelich.de>
# License: AGPL
from collections.abc import Callable
from itertools import product
import numpy as np
from nilearn import signal
from nilearn.connectome import (
ConnectivityMeasure,
cov_to_corr,
prec_to_pa... |
ec1578f3e4e2f654cae0d06f54d01d2b017950e5b4483fd7cfb4724635801fb6 | Python | 20,993 | 536 | """
Generate publication-quality pairwise rater agreement scatterplots.
Panel A: Expert-Expert pairwise scatter (LB, PH, SZ, MW)
Panel B: Expert-Algorithm pairwise scatter (each expert vs Ridge LOPO)
Run: conda run -n foe python code/figure_pairwise_agreement.py
"""
import sys
import os
import warnings
import numpy ... |
59213d4f10b2f47b494eed8a8739e9d8b020d2db7297c41bf9741e536e51ae7f | Python | 21,011 | 478 | import os
import sys
import optparse
import xlsxwriter
# python modules from the $SUMO_HOME/tools directory
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("please declare environment variable 'SUMO_HOME'")
from sumolib import che... |
01d249d0deca930e569b58d77d728506ecc37e38b594323ac23341778f837bf0 | Python | 21,016 | 606 | #!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Copyright (c) Yongning Lei 2024-2025
# MIT License
# -----------------------------------------------------------------------------
"""
Generate rerun_check.tsv from the lab-note Excel file.
Background
----------
Th... |
dc2e7713ce4ece64490c17523f0456c550cf07399869282c729dfa994840e6b4 | Python | 21,053 | 606 | """
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... |
00c707ec4ecd18124650250b8696f2c0b49341f9f177c8836200ed139ce507ff | Python | 21,070 | 561 | """
Improvement #4: Learned evidence combination.
Instead of naive max(HPP, CET), train a small model to optimally combine
HPP and CET evidence at each time point.
Approaches tested:
A. Per-timepoint logistic: sigmoid(w1*hpp + w2*cet + b) — 3 params
B. Per-timepoint MLP: small network on [hpp, cet, hpp*cet, |hpp-... |
acb5ae8e6f62da7daf7f38ec7dbb1a7764ea121ef6061aa96750f71c506f04a1 | Python | 21,097 | 571 | from __future__ import annotations
from contextlib import contextmanager
import csv
import hashlib
import http.client
import io
import os
from pathlib import Path
import tempfile
import time
import urllib.error
import urllib.request
from urllib.parse import urlparse
import uuid
from dataclasses import dataclass
try:
... |
b86c0fe7ddefb47a27276ada1398e09687b438b8d9d7f7e19223ebc5d605519e | Python | 21,107 | 472 | # 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... |
e3195400d3e7c497eeca80228c5b440c6dd30b74bdf533a1b5de8eabb1f1874f | Python | 21,116 | 346 | # 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 ... |
55fd0ea53f1c79670fbfb1a087b4f6c9d7e5e25cac12dc4e1659c5c3ed63a473 | Python | 21,121 | 487 | # Copyright 2026 IBM and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
20ddde2232ed29bf417ef8f9aa39e90195e62f303e542e25668ed0a3c5700849 | Python | 21,123 | 528 | # Copyright 2026 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
#
... |
51d8f595ea591f2a901a7a0c630d56871cea713dad8e516f18b9284a48d9334b | Python | 21,195 | 577 | """cuCIM slide-reading backend.
Requires: cuCIM (...)
"""
import cv2
import numpy as np
from types import SimpleNamespace
from typing import Optional, Dict, Any, Tuple, List, TYPE_CHECKING
from slideflow.util import log
from skimage.transform import resize
from skimage.util import img_as_float32
from skimage.color i... |
68d394306b99d25dd106ae7968b25cd13ee22a17fc8f28c2bb62982b11a513d3 | Python | 21,258 | 504 | #!/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... |
5aa14f55c3d2f7ec18689712a91c864ca3e3df19d74637c9ca23ad5cf58d6b76 | Python | 21,260 | 613 | # ==================================================================================
# It icludes all the subfunctions
# @Author: Yina Wei, 2021
#==================================================================================
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy import st... |
760da58737aa7bae34e8880d18b59c96857865419c48e4c34a4f2907dcc6bcb1 | Python | 21,271 | 526 | '''
More complex plotting functions
'''
import numpy as np
import pandas as pd
import scipy.stats as stats
import os
import gzip
import shutil
from urllib.request import urlretrieve
import matplotlib as mpl
from matplotlib import lines
import seaborn as sns
import matplotlib.pyplot as plt
from stats_helpers import calc... |
f642cde6d7fa127cff20469eb34c76ccc83c71fbb5dd0e872753648f35d2e637 | Python | 21,274 | 512 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glm4/modular_glm4.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
96562055152ef7c49a287afb343866c0c418df4a9b2c3aa55283a1a2618ad8df | Python | 21,346 | 607 | import random
import numpy as np
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
from torch.multiprocessing import Queue
from torch.nn import init
def init_emb2neg_index(negative, batch_size):
"""select embedding of negative nodes from a batch of node embeddi... |
cabd2a124ad13c7c1cf5cf22a00f3a64b9431a53bfb24bd77e939aebfbf0266d | Python | 21,372 | 459 | #!/usr/bin/env python3
__doc__ = \
"""The Developmental Cognition and Neuroimaging (DCAN) lab Macaque fMRI
Pipeline [1]. This BIDS application initiates a functional MRI processing
pipeline built upon the Human Connectome Project's minimal processing
pipelines [2]. The application requires only a dataset conformed t... |
165bc2e52f85dd408fd56a035c0b1473d37430ec619d5947f69fc8be2c771bcb | Python | 21,377 | 521 | # 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... |
433968e030f74dc6435eba4579bea4db9cdd6a8cfd63b85be060100f62d76b14 | Python | 21,380 | 521 | # Copyright 2019 Inria, Facebook AI Research and the 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
#
#... |
47a6241b53b726d7e47497b120e312da79cb0d30be2c2e2f6cbb4faede0c6bb4 | Python | 21,388 | 571 | """
Python script to evaluate cell images
This script calculates cross-sections along the mos asymmetric profile of RBC images.
"""
# libraries
import math
import numpy as np
import scipy
def calc_asymcut(values, coord, ori, imgh, imgrh, imgw, imgrw, centre):
"""Determines the cross-section along the mos... |
22bfa317dfea29d9efb36482a56a38ab4620e0223a3791cd29aa05506ace261f | Python | 21,454 | 519 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/gemma/modular_gemma.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
0e431eb99e735fa9bf19172ea00438b4d657083e9aca269bf7bfc0da7babbcc0 | Python | 21,478 | 698 | import os
import unittest
import backend as F
import pytest
import torch as th
import torch.multiprocessing as mp
from dgl.nn import NodeEmbedding
from dgl.optim import SparseAdagrad, SparseAdam
@unittest.skipIf(os.name == "nt", reason="Do not support windows yet")
@pytest.mark.parametrize("emb_dim", [1, 4, 101, 10... |
8650ecdd877cddacf2c7b9171870a2cf5982fc7fd73077ab1bc0dd3db9783c12 | Python | 21,479 | 587 | import random
import numpy as np
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
from torch.multiprocessing import Queue
from torch.nn import init
def init_emb2pos_index(walk_length, window_size, batch_size):
"""select embedding of positive nodes from a batch... |
d2dd61b65d4ff83a87fb21e0e6a04a7e840f1807ea6099d39fc45ce89d0c1b09 | Python | 21,479 | 519 | #!/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... |
86974592f471918dae1e4176bca208fe310670cecc056d17ca09e1f6d73e907f | Python | 21,492 | 578 | # 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.