sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
dc31b13ac2d1cf62b66775f6a6f95e26096efcd8bd5b3a49772c3ff9c86fc069 | Python | 14,633 | 372 | import time
import struct
from openbci.utils.constants import Constants as k
class ParseRaw(object):
def __init__(self,
board_type=k.BOARD_CYTON,
gains=None,
log=False,
micro_volts=False,
scaled_output=True):
self.board_... |
366118643614094e29abe017b2521a352eaa39c223fd59baab9fea87c822af41 | Python | 14,634 | 352 | # 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... |
501284f33cb1bf4804b028bede632ced52318fbc90064ba13f5667b28acba2cf | Python | 14,634 | 481 | import os
import sys
import glob
import numpy as np
import json
import deepdish as dd
import pandas as pd
import copy
from collections import defaultdict
from sklearn.model_selection import cross_val_score
from sklearn.metrics import mean_squared_error
import connectivity.io as cio
from connectivity import data as cda... |
f6636d10fb7a3cb3cceb3a548ebb76892922634bd7dcc9c8f244b6adc83c0dc5 | Python | 14,638 | 381 | """
Round 2 annotation selection: 50 NEW patients targeting frequency diversity.
Computes consensus frequency per segment from cached external segments,
then selects 50 patients stratified by frequency bin to fill gaps in the
existing annotation set (especially extreme frequencies).
Run: conda run -n foe_dl python co... |
6dfbcd8997831839d1c98d53e5ce3ff7cf09b70e97087ae5d6175306afb0ae9c | Python | 14,642 | 288 | from typing import Union, Dict, Tuple, List
import os
import time
import tqdm
from pymatgen.core.structure import Structure
import numpy as np
import torch
from torch_geometric.data import InMemoryDataset
from pathos.multiprocessing import ProcessingPool as Pool
from .graph import get_graph, load_orbital_types
from .... |
5f8a4b1f62d85b54262a458cbfa1e960a432585fa4b68a0f681e5619beac91ae | Python | 14,651 | 429 | """Provide a class for centralized coordinates data registry."""
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
# Synchon Mandal <s.mandal@fz-juelich.de>
# License: AGPL
from collections import Counter
from pathlib import Path
from typing import Any
import numpy as np
import pandas as pd
import str... |
19c9697931124eaf2282ec1dd47411ed8d7bf85acf7ab355f38ed19f72952071 | Python | 14,675 | 345 | # Copyright 2026 Xiaomi Corporation 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
#
# ... |
b17780b1057a4db2103a74addf9235383b570906cc9ada3c5c3c4409a979977b | Python | 14,675 | 360 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glm46v/modular_glm46v.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
... |
1d0d8925315394641931fc3bf4386f9da97396bec1da891e67a120f5fe488cd8 | Python | 14,680 | 393 | """
Datasets used by PyTorch for language modelling of chemical structures.
"""
import numpy as np
import re
import selfies as sf
import torch
import torch.nn.utils.rnn as rnn_utils
from itertools import chain
from torch.utils.data import Dataset
from functions import read_smiles
class SmilesDataset(Dataset):
"""... |
c1186e218d2ecec01acd1f6218370eb225a15650ade7201c577bdc5b2b6f1ce5 | Python | 14,683 | 429 | """
Visualize discharge timing detection overlaid on EEG.
Generates JPEG images of EEG with detected discharge times marked as circles,
then builds a self-contained HTML viewer.
Usage:
conda run -n foe python code/visualize_discharge_timing.py
"""
import sys
import json
import base64
import warnings
import trace... |
1e37f960d3b943d11a9aa415017b811381eaf43f01276e0d219c31f7d54737de | Python | 14,689 | 282 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/minicpmv4_7/modular_minicpmv4_7.py.
# Do NOT edit this file manually as any edits will be overwritten by the gene... |
e1bb8364eaa01f555503303f654ef1331535cec24e13ae760c469a2a8f3606f5 | Python | 14,696 | 417 | from typing import List, Tuple, Union
from layers import *
import dgl.function as fn
import torch
import torch.nn
import torch.nn.functional as F
from dgl.nn.pytorch.glob import SortPooling
class GraphCrossModule(torch.nn.Module):
"""
Description
-----------
The Graph Cross Module used by Graph Cross... |
aefff5206690fd8d84ee260c2a76bbef69717e9666ab7e180b5e47c4d8a898d1 | Python | 14,700 | 391 | """
PD-Profiler: Unified PD Characterization Pipeline
Given a 10-second EEG segment labeled as LPD or GPD, this pipeline produces:
1. Lateralization (LPD only): left vs right (AUC 0.989)
2. Spatial localization: which brain regions are involved (Hybrid CNN+PLV)
3. Discharge timing: when each discharge occurs (He... |
9b4d808d557ad5aee2a0295dd1a74d0d8afbc046525f55b42a31cd6cbeae4790 | Python | 14,705 | 320 |
"""
Created Sept 2019
Last updated Tue Apr 12 2022
@author: nsauthier@gmail.com
This script uses custom functions defined in DataCleaningFunctions
in order to clean a list of labs extracted from CITADEL.
It outputs a cleaned file
In its second part it cleand a static file.
In the third part it clean a... |
8e0498f945e0af7361ec3ee22507a65677deec19298c8b74b206d6b987674322 | Python | 14,708 | 349 | import inspect
from ..core_model_loading import ConversionOps
from ..quantizers.quantizers_utils import get_module_from_name, should_convert_module
from ..utils import (
get_available_devices,
is_accelerate_available,
is_bitsandbytes_available,
is_torch_available,
logging,
)
if is_bitsandbytes_av... |
21151fdf9598ca50767574177c97f1362787bd335f20fea322e0db7d06fcd63e | Python | 14,772 | 317 | import numpy as np
import random
import torch
import torchvision
import torchvision.transforms as transforms
from torchvision import datasets
from torch.utils.data import DataLoader
from utils.utils import FastMNIST, FastFashionMNIST
from utils.logging_utils import initialize_logger
from utils.train import tra... |
1c8ed0ff980f039a55ea874e29f7f7eaacc70694e10ba977a8f4a43dd3d9ab72 | Python | 14,777 | 391 | """Lateralization Contest Harness — data loading, evaluation, leaderboard.
Ground truth:
- Subtype (LRDA vs GRDA) from patients.csv
- Laterality (left/right/bilateral) from patients.csv
- For evaluation: LRDA-left/right are clearly lateralized cases
Evaluation tasks:
Task A: LRDA vs GRDA classificatio... |
f44d68fadfa0808a13df7a141a5f6d7b76d1a467ab38e302b201c2d7cce11588 | Python | 14,781 | 528 | """Provide tests for CLI."""
# 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 pathlib import Path
import pytest
from click.testing import CliRunner
from ruamel.yaml import YAML
from ju... |
66d2325a4a5e47792bed7bb11c94ce7395c56b7731a867b5a3940b2de7520534 | Python | 14,804 | 367 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glmga/modular_glmga.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
# ... |
c47ee988599f9955006f23b7dcea2f02a4224417aebcde75dbe62d2d8a89fd50 | Python | 14,830 | 401 | """Lateralization Contest v2 Harness — IIIC data, LRDA vs GRDA discrimination.
Data: IIIC crowd-labeled cases with >=10 expert votes and >=50% agreement.
Primary metric: AUC of asymmetry score for LRDA vs GRDA classification.
"""
import sys
import json
import time
import pickle
import warnings
import numpy as np
impor... |
5f9c718a8a2f3cfada2dbb24d3a00e95bab9e8c62701bf0895677b436aeb4b4f | Python | 14,831 | 348 | import numpy
import matplotlib.pyplot as plt
def avg_and_rms(x):
N = len(x)
avgx = numpy.mean(x)
rmsx = 0
for i in range(N):
rmsx += (avgx-x[i])**2
rmsx = numpy.sqrt(rmsx/(N-1))
return avgx,rmsx
def manual(filename,idelay,idur,spikedurat):
"""Manual approach"""
... |
c0046aaa7a682d366cda211386efe7940b763c278eacc9874a59f07308a983bf | Python | 14,831 | 403 | # 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... |
92caf040e4de07df3438ef170aca975cf65dcaa95c0da357f47b50c17aa25fbe | Python | 14,839 | 327 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# 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
... |
bf23f468945e0b1fb5d39305ce463d7c43a75e600277e82c5dbb797ad52dc051 | Python | 14,842 | 426 | import time
import glfw
import imgui
import imgui.integrations.glfw
from typing import Tuple, Optional
from imgui.integrations import compute_fb_scale
from imgui.integrations.opengl import FixedPipelineRenderer
import OpenGL.GL as gl
from . import gl_utils
#-------------------------------------------------------------... |
d59240c7c31d7d3497f8fd4f5b06a5c76cc21591bc3a35d44f35cdbd54b20ad7 | Python | 14,865 | 424 | #!/usr/bin/env python
"""
Training script for E2E Discharge Detector.
Phase 1: Freeze backbone, train decoder + heads, 50 epochs, lr=1e-3
Phase 2: Unfreeze backbone (lr=1e-5), decoder lr=1e-4, 100 epochs
Usage:
python code/e2e_model/train_e2e.py --phase 1
python code/e2e_model/train_e2e.py --phase 2 --resume
... |
37ca3e329d0e243a55ee72f783fc0aab5efd816201715b234590370c2b8c8040 | Python | 14,875 | 333 | # Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
2886673eefe6d27b43d40b90975b57b3ecc31fa6b849845d318e9df94f1bbfa4 | Python | 14,879 | 424 | """
=====
Utils
=====
This module define usefull decorators to use with data analysis.
"""
import os
import json
import time
import logging
import random
from datetime import datetime, timedelta
from multiprocessing import Process
from threading import Thread
from typing import Callable
import re
import numpy as np
... |
f496b2a2f3ca886027df863c1c86961a4346c8a64866d258e2ab9ef8888d9790 | Python | 14,882 | 369 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Breath_Hold (BH)
Instructions are displayed to the participant in this order: Paced Breathing, Breath Hold, Exhale, Recover.
Change the timing of these instructions in the 'CHANGE PARAMETERS' section.
There is an option to start with a period of rest and end with a pe... |
fda22d158190a3b169a112215aa7b295e2256b3ace8420671781d8ab90158828 | Python | 14,890 | 327 | # Copyright 2023 The Suno 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
#
#... |
ed98f2565af010e63bc36bea9b8cddd6eace3f6a938cb7d4e348844ac3279f7f | Python | 14,898 | 283 | #!/usr/bin/env python3
#
# Pins ProteoWizard's monthly releases and publishes the monthly release metadata.
#
# The monthly release of Core Windows x86_64 (bt83) is the successful default-branch build that
# finished last in its month. On the first of the next month this script pins that build, which
# exempts its inst... |
52d7d5f4e62ded47ae2ae2ab86d9d47c3960338214b87093dda85e61fd266780 | Python | 14,902 | 356 | from __future__ import annotations
import copy
import itertools
import os
import pickle
import re
from collections import OrderedDict
from pathlib import Path
from typing import List, Tuple, Optional, Union, Set, TYPE_CHECKING, Iterable
import numpy as np
import skimage as ski
from numpy import ndarray
from skimage.s... |
45313044124fd404ad3b09520ee734ebc56ab61ba4113e70f6419d1a0a1996b4 | Python | 14,911 | 345 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/gemma4_unified/modular_gemma4_unified.py.
# Do NOT edit this file manually as any edits will be overwritten by th... |
d0e35c94dcce5bfc72ba4bad769d88e2ab7a3211739a60e91f563aec7d8f9268 | Python | 14,915 | 470 | import argparse
import os
import random
import time
import dgl
import numpy as np
import torch
import torch.multiprocessing as mp
from model import SkipGramModel
from reading_data import DeepwalkDataset
from torch.utils.data import DataLoader
from utils import shuffle_walks, sum_up_params
class DeepwalkTrainer:
... |
816fed1737f2ffd65cdec7e964ffb8d4e4999138a956601ded53f58dee6ae9be | Python | 14,921 | 417 | """
.. _model-rgcn:
Relational Graph Convolutional Network
================================================
**Author:** Lingfan Yu, Mufei Li, Zheng Zhang
.. warning::
The tutorial aims at gaining insights into the paper, with code as a mean
of explanation. The implementation thus is NOT optimized... |
0436c723c75f31ea60c20dfa6d5a73295e26a6ca8ec5c5944c067a739d583e27 | Python | 14,922 | 367 | """
Genetic Algorithm Optimizer
============================
This script implements a genetic algorithm to evolve chromosomes based on fitness values.
It takes chromosome/fitness pairs from the first generation and calculates the next generation
using selection, crossover, and mutation operations.
Usage:
python g... |
06ce8bffa6a2b331af056e84cba2aeeafc7c589de190454b5a0f33eabaf66006 | Python | 14,928 | 576 | """
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission.
The instructions are a synthesis of those from `PutNext`, `Open`, `GoTo`, and `Pickup`.
"""
from __future__ import annotations
from minigrid.envs.babyai.core.levelgen import LevelGen
class Synth(Le... |
2c000cfd0adc227c198526613eaf56123173b856a11cdbabe439dde69be8c543 | Python | 14,941 | 452 | """
This script trains and tests a GraphSAGE model for node classification on
multiple GPUs using distributed data-parallel training (DDP) and GraphBolt
data loader.
Before reading this example, please familiar yourself with graphsage node
classification using GtaphBolt data loader by reading the example in the
`exam... |
e2ec538c31fff55fdddf7f1f0d574fe3cd30e74fbdcfecef622f263e51cb612c | Python | 14,948 | 509 | """Provide tests for utils."""
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
# Synchon Mandal <s.mandal@fz-juelich.de>
# License: AGPL
from collections.abc import Iterable
import numpy as np
import pytest
from numpy.testing import assert_array_equal
from junifer.storage.utils import (
element... |
046d4b37a26ee06a35c835b25556efb7f4b8d95da2c43a63987acb7c362c94ed | Python | 14,962 | 327 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkimagevolumeviewer.py,v $
## Language: Python
## Date: $Date: 2018/04/02 12:35:13 $
## Version: $Revision: 0.1 $
## Copyright (c) Richard Izzo, Luca Antiga. All rights reserved.
## See LICENSE file for details.
## This software is d... |
d50ff4148b2747efe5112ebe8dc94455708166f07df2451ff49cf9c1d0933e43 | Python | 14,967 | 479 | """Provide abstract base class for feature storage."""
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
# Synchon Mandal <s.mandal@fz-juelich.de>
# License: AGPL
from abc import ABC, abstractmethod
from collections.abc import Sequence
from enum import StrEnum
from pathlib import Path
from typing impor... |
9e74e918b539b6e3f00476b2690c5037bb9ee303720e23f69084e6341a280f87 | Python | 14,977 | 418 | """
Recompute signal-processing features for the 77 new annotation candidates
from their raw .mat files on the external drive, using the EXACT same pipeline
as the original 43 patients in r10_expanded_evaluation.py.
This fixes the feature distribution mismatch: the original CSV features were
computed on pre-processed ... |
cb3beaecbb6e6562a24edad4a68385e38ced5f6cc335148ff46fa0cbe195d0ad | Python | 15,007 | 432 | # -*- coding: utf-8 -*-
"""
Functions for working with triangle meshes + surfaces
"""
from joblib import Parallel, delayed
import numpy as np
from scipy import ndimage, sparse
from neuromaps.images import load_gifti, relabel_gifti, PARCIGNORE
def point_in_triangle(point, triangle, return_pdist=True):
"""
Ch... |
e6edd18660f483129cdbe163a750b295044e8092a6c8053cdd75dc893c441a51 | Python | 15,012 | 323 | # 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... |
f6de35daff398235f354141e15247943c80a3ef28939325cf5c876f3012d8181 | Python | 15,016 | 359 | """
Concordance index calculation as provided by https://github.com/CamDavidsonPilon/lifelines
MIT License
Copyright (c) 2017 Cameron Davidson-Pilon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Softwa... |
dd9ff07cec9b8f4bd5fd8ed939b58e55327909410a5cfe8bda22f0621dd38229 | Python | 15,044 | 395 | # This code implements a multiscale toy model
# The model connects two large-scale populations
# with a small-scale functional circuit for decision-making
# and working memory.
# The large-scale model uses "ReducedWongWangDeco"
# neural mass models
# -> Deco et al., 2014, Journal of Neuroscience
# The functional circ... |
533527589cb9f8b4d687a8b006d1c28a78c0fb97b30daa185fcb19973b1fdb67 | Python | 15,048 | 367 | """Tests for lapy.topology: loops, surgery, handles and topology correction."""
import numpy as np
import pytest
from ...intersect import self_intersections
from ...solver import Solver
from ...topology import (
_nudge,
capped_surgery,
disk_cap,
essential_saddles,
find_handles,
fix_topology,
... |
1f18394c6ae238cadf5e7964c48467c5302f3dfe5f9e0638af80d673fbefd629 | Python | 15,060 | 354 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkmeshconnectorfsi.py,v $
## Language: Python
## Date: $Date: 2021/04/26 18:00:00 $
## Version: $Revision: 1.0 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENCE file for details.
## This software is ... |
d238803e610dc42f4d7768b2acb576b01bf07f306992512f7dba1a0151c1788a | Python | 15,091 | 421 | import argparse
import math
import time
import traceback
import dgl
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import numpy as np
import torch as th
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import tqdm
from dgl.data import Reddi... |
cd8f556991ed3ceef51021a5b2035d99874dff0aca553113ef60cd7ac3f33873 | Python | 15,094 | 387 | # Copyright 2025 The LG AI Research 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
#
# Un... |
549a25d5bb4cb6638279305b00249ac0aa1bda9d0d8f0093d6064ea1e3bc7097 | Python | 15,104 | 396 | from operator import index
import os
import time
import numpy as np
import pandas as pd
# import quadprog as qp
# import cvxopt
from scipy import sparse
from sklearn.base import BaseEstimator
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.linear_model import Lasso
... |
c91eba4acf9bafa5ec0af8cc5cdcd0f70c970ca3caa2e33c8c5a7a2afed1ba20 | Python | 15,108 | 392 | """
Round 4 Combiner v2: 4 focused type-specific + ML combinations.
Variants:
1. r4_type_specific_best: LPD=ACF+peakcount avg + Bayesian, GPD=FFT_pt+peakcount avg
2. r4_type_specific_v2: LPD=median(MethodA, ACF, peakcount) + Bayesian, GPD=FFT_pt+peakcount avg
3. r4_five_way_median: median of 5 freq estim... |
eaf81b19ed2572c8abbd591d186b8237be0b0c068d5d3a66af5cff47f7cd0bb5 | Python | 15,111 | 342 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtksurfaceresolution.py,v $
## Language: Python
## Date: $$
## Version: $$
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is distributed WITHOUT ANY WARRANTY; witho... |
0dcf85b18b39108b4e1b77750775424c38c5cc0f36c581d887eb809b7ee71054 | Python | 15,116 | 358 | # Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
e8615b941eacdd42970022f1a85c853566358e786eb427f968341facb1825192 | Python | 15,126 | 387 | """
"""
import os
import copy
import h5py
import yaml
import numpy as np
import tensorflow as tf
class Dataset():
"""Defines a dataset object with simple routines to generate batches."""
def __init__(self, path_to_data=None, data=None, dataset_type='train', key='spindle_firing', fraction=None):
""... |
06ff9947a65fdf12e89b3861274e0bdc0e7087cb508600aba0d935714015177d | Python | 15,130 | 389 | """
"""
import os
import copy
import h5py
import yaml
import numpy as np
try:
import tensorflow as tf
except:
print('working without TF, this will fail for many operations')
class Dataset():
"""Defines a dataset object with simple routines to generate batches."""
def __init__(self, path_to_data=No... |
9ed4ea58730664661a12a573875a25ad8ce2d684e2ae3bd9e3fcb9cfbef31d23 | Python | 15,138 | 387 | """
"""
import os
import copy
import h5py
import yaml
import numpy as np
import tensorflow as tf
class Dataset():
"""Defines a dataset object with simple routines to generate batches."""
def __init__(self, path_to_data=None, data=None, dataset_type='train', key='spindle_firing', fraction=None):
""... |
cbba488e0fa237ca452c19d9cb831e15351d7866fa82d8ed484a17c53e3d2ea1 | Python | 15,142 | 448 | # import libraries
import os, shutil
import click
import numpy as np
import pandas as pd
import nibabel as nib
from scipy.stats import mode
from random import seed, sample
from pathlib import Path
from SUITPy import flatmap
import connectivity.constants as const
import connectivity.io as cio
from connectivity import d... |
6704690db1501e0ca12d729c833c7c3f59ca757efdc7705d11c9737f3f6b56ea | Python | 15,149 | 422 | import numpy as np
from collections import defaultdict
from scipy.spatial.distance import cdist
from scipy.optimize import linear_sum_assignment
def track_tumor_cells2(cellsx, cellsy, properties):
"""
Kalman tracking.
Parameters
----------
cellsx : list of array-like
Frame-wise x-coordina... |
c474f1b577000a1599512fbed2bced040698bc3f75dfc64ce4526468be44b529 | Python | 15,154 | 370 | """Torch modules for graph attention networks(GAT)."""
# pylint: disable= no-member, arguments-differ, invalid-name
import torch as th
from torch import nn
from .... import function as fn
from ....base import DGLError
from ....utils import expand_as_pair
from ...functional import edge_softmax
from ..utils import Ident... |
4e90183b17ae51839151e23f6b2c2f4b6e134c69b4ff487e97b5193806f0ee58 | Python | 15,160 | 468 | # Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Source-pool batching, persistence, and reduction helpers for LIT."""
from __future__ import annotations
import logging
import operator
from collections.abc import Mapping
from typing import Any
import jax
import numpy... |
35baf9d49629c558159ccf9febbfbd637b14816a7be2055b95dd77fb649e3075 | Python | 15,163 | 370 | # 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... |
7757bb7fd317808582df335138ee555a39d81e849311f5de1bf4d82c9f88ea96 | Python | 15,166 | 456 | """
Datasets introduced in the 'A Critical Look at the Evaluation of GNNs under Heterophily: Are We
Really Making Progress? <https://arxiv.org/abs/2302.11640>'__ paper.
"""
import os
import numpy as np
from ..convert import graph
from ..transforms.functional import to_bidirected
from .dgl_dataset import DGLBuiltinDat... |
cafe79615777df9001a8bc161c1c60d6c94de4735c794aaa3ec9d87ff41a36be | Python | 15,167 | 363 | # Copyright 2023 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... |
74395d7ee0d8593841857989797093be98ed47e53c0c3ac1cf2f621b52bce43f | Python | 15,172 | 351 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/deepseek_ocr2/modular_deepseek_ocr2.py.
# Do NOT edit this file manually as any edits will be overwritten by the ... |
9786b3064cc0c7c7e765693ac7831cf9e334de05517eebe4d701c8b08a363d72 | Python | 15,173 | 468 | import argparse
import socket
import time
import dgl
import dgl.distributed
import dgl.nn.pytorch as dglnn
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import tqdm
class DistSAGE(nn.Module):
"""
SAGE model for distributed train and ev... |
b55e905d4412fa24e31391e014fbd086c52028749eac21166118b36203097740 | Python | 15,184 | 490 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import math
import random
import time
from collections import OrderedDict
import dgl.function as fn
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from dgl.dataloading import (
... |
d0cc4dc7211fc680c834184f238c4ee59f04a506a0b369859444a8a9500e1223 | Python | 15,202 | 529 | from mdc.MDCComponent import MDCComponent
from mdc.MDCButton import MDCButton
from mdc.MDCFormField import MDCFormField, MDCCheckbox, MDCForm
from mdc.MDCLinearProgress import MDCLinearProgress
from mdc.MDCTab import MDCTabBar, MDCTabScroller
from browser import document, html, timer
################################... |
5df4a93b0870a1634210ce8710e4c9cf0ba8050e244458271fea07801ba35d9d | Python | 15,209 | 387 | #!/usr/bin/env python
from __future__ import print_function
from optparse import OptionParser
import os
import subprocess
import sys
import h5py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.set(style="ticks")
from sklearn.decomposition import PCA
... |
64cadc472474bd4ec48d57b2339484e6e12d0e01319f3cdf5ed844d7300c61ff | Python | 15,212 | 388 | #!/gpfs/milgram/project/turk-browne/or62/conda_envs/myenv_multimem/bin/python
import warnings
import sys
import os
import time
import argparse
import nibabel as nib
from mpi4py import MPI
import numpy as np
import pandas as pd
from scipy import stats
from scipy.spatial.distance import squareform, pdist
from sklearn.pr... |
79ae22ef0142f67085299a8d356dc8d5aa267aee76bb361da942131a68cabc0b | Python | 15,212 | 411 | # Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Sparse metadata and constructor contracts for Forward Laplacian state."""
from typing import Any, cast
import jax.numpy as jnp
import numpy as np
import pytest
from jaqmc.laplacian import (
Local1Jacobian,
Lo... |
964e9d8ac2e3a2b452a8d918719ff6dc9500ec96787300d68912ceef8932c72d | Python | 15,214 | 372 | """
These functions/modules are mostly taken from the training code elsewhere in the repository.
"""
import os
import copy
import h5py
import yaml
import numpy as np
import tensorflow as tf
class Dataset():
"""Defines a dataset object with simple routines to generate batches."""
def __init__(self, path_... |
1d9861c5a6756deee16557941ac496a40da72cd275c8354b29656a4eeeccc6d2 | Python | 15,226 | 354 | # standard imports
import os
# to lock file for thread safe reading
import threading
import warnings
from itertools import compress
# scientific computing library imports
import numpy as np
from cached_property import ( # This can be removed in python 3.8 as they are adding cached properties as a built-in decorator
... |
931b2c8a14dc973d7e3f80ff43fa0b233e0dae9e0c5b4f8f83c23f25c015c143 | Python | 15,226 | 274 | #
# Pyserini: Python interface to the Anserini IR toolkit built on Lucene
#
# 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... |
0c261a87a78a1c3db2598050ca11ff3688d229b8161aaa7591a6e04fee638aa0 | Python | 15,231 | 479 | """Torch NodeEmbedding."""
from datetime import timedelta
import torch as th
from ...backend import pytorch as F
from ...cuda import nccl
from ...partition import NDArrayPartition
from ...utils import create_shared_mem_array, get_shared_mem_array
_STORE = None
class NodeEmbedding: # NodeEmbedding
"""Class for... |
8ab82356abc4bb4905d990559e784b52dc8bc966ef35da06f15a76b59f5ee81a | Python | 15,245 | 368 | #!/usr/bin/env python3
import argparse
import json
import torch
from huggingface_hub import hf_hub_download
from PIL import Image
from timm.models import create_model
from transformers import (
BeitImageProcessor,
Data2VecVisionConfig,
Data2VecVisionForImageClassification,
Data2VecVisionModel,
)
def... |
06b99a7ab399026b77df2e2253db68c801ca9675df95684ea67e40167aab29de | Python | 15,246 | 322 | """
Utility functions for appraise package and the demo notebook.
Author: Xiaozhe Ding
Email: xding@caltech.edu, dingxiaozhe@gmail.com
"""
import pandas as pd
import numpy as np
import scipy
import seaborn as sns
import matplotlib.pyplot as plt
import sys
from appraise.modeling_backends import extract_appraise_job_nam... |
8aa73c0a62e6608ddf52440dd1154cda94bd9030e8df41f7ccadf82aaab70a20 | Python | 15,264 | 444 | ### 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... |
826cd97c9f0b4cfd4449b10565fa6b070312bd351710db9134976197c98360f9 | Python | 15,265 | 364 | # Copyright 2023 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... |
90560d3f334668660643ef7ef9f566f6253e30615c9167f046a3389424313e12 | Python | 15,265 | 385 | #!/usr/bin/env python3
"""Generate LRDA laterality labeling viewer.
Shows EEG with symmetric channel layout. Default side from V22 model.
Sorted by predicted laterality (most left-dominant first → most right-dominant last).
Keys:
← (left arrow) = Left dominant
→ (right arrow) = Right dominant
Space = Not LRDA (... |
4c26681a1c2f9b9483b04b5d79decb582710070d1194d7aab5325de596401612 | Python | 15,296 | 382 | #!/usr/bin/env python
from __future__ import print_function
from optparse import OptionParser
import copy, os, pdb, random, subprocess, sys
import h5py
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from PIL import Image
import seaborn as sns
import dna_io
from seq_logo imp... |
f227a93b5c1086329cebd198936034b50ede29076f187e9e12d8c8d1184ec3fd | Python | 15,298 | 322 | # Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
53666594949107163c2fe5933b07e46fba1e72ecdf09920ffb37106dc320673a | Python | 15,310 | 389 | from __future__ import annotations
from collections import OrderedDict, defaultdict
from dataclasses import dataclass
from itertools import product
import networkx as nx
import numpy as np
from minigrid.core.constants import COLOR_TO_IDX, IDX_TO_OBJECT, OBJECT_TO_IDX
from minigrid.minigrid_env import MiniGridEnv
@... |
0cdb41dc1abc4bd66b35ed396eb40254690050ebc2f784c8a25246717ee42fc6 | Python | 15,316 | 450 | import deepsmiles
import numpy as np
import os
import pandas as pd
import random
import re
import warnings
from selfies import decoder
from tqdm import tqdm
from rdkit import Chem
from rdkit.Chem import AllChem, rdmolops
from rdkit.DataStructs import FingerprintSimilarity
from scipy import histogram
from scipy.stats im... |
10f68d022eeb7d2b4cbe85e0d51eec6eb267142f02e7d3cb0241e98054e596b7 | Python | 15,319 | 352 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkgeodesicsurfaceresolution.py,v $
## Language: Python
## Date: $$
## Version: $$
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is distributed WITHOUT ANY WARRANT... |
84138d9798ba87d33a0f6e32825aae20e4a30c6e0e3642e90bc19e8fd80a5eee | Python | 15,325 | 325 | # Copyright 2026 BioHub 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... |
1b1c074bfa7eab0e80c83e8f0740e14d3d0f738a615a3a4338ef341873684a1c | Python | 15,329 | 447 | ### This script could run MLP only model for pchembl/MW prediction (of IC50 of Tissue Factor Pathway Inhibitor) using Shannon entropy as descriptor along with the MW as the other descriptor
# import the necessary packages
from imutils import paths
import random
import os
import numpy as np
import pandas as pd
from ... |
a179a1d27e169cc8f5f7e3d88080c250ab019a89278ebe19ac914191a4fe2f26 | Python | 15,330 | 392 | """Evaluate RDA methods on expanded dataset (original 3-rater + MW LRDA).
Includes Alexandra's rda1b_fft (FOOOF-based) and all newer methods.
Reports results for ALL cases, and broken down by LRDA vs GRDA.
"""
import sys, json, warnings, numpy as np, pandas as pd, scipy.io as sio
from pathlib import Path
from scipy.si... |
9233b89b45922df465fd05052c72da728dd10b5fa7bd9a654a8879789f495bcd | Python | 15,350 | 434 | ### This script could run MLP only model for pchembl/MW prediction (of IC50 of Tissue Factor Pathway Inhibitor) using Shannon entropy as descriptor and also using other descriptor (Ligand Efficiency BEI) as part of tandem model
# import the necessary packages
import random
import os
import numpy as np
import pandas a... |
5a05084aa0d573db11d344436748c0732fdb482459e91fb77160d2795860673e | Python | 15,359 | 417 | import anndata
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import os
import mygene
from utils import load_annotations
from sklearn.model_selection import train_test_split
from torch.utils.data import Dataset, DataLoader
from datasets import RNASeqData
import argparse
from pat... |
3874887d4016cdb3eea850e88f2fb065f5b62b6866c1a1ffc81b883b2d6fb4b2 | Python | 15,378 | 454 | import argparse
import time
from contextlib import contextmanager
import dgl
import dgl.distributed
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import numpy as np
import sklearn.linear_model as lm
import sklearn.metrics as skm
import torch as th
import torch.nn as nn
import torch.nn.functional as F
impor... |
fdeb38405440862167897717118f7e80215ad2e5663b77b716168bdcdf7e4516 | Python | 15,379 | 452 | #!/usr/bin/env python3
# MIT License
# Copyright (c) 2024-2025 Yongning Lei
"""
Check phase-encoding direction of 3D-ME-EPI SWI DICOM series.
Sources tried in order:
1. Siemens CSA series header (0029,1020) → PhaseEncodingDirectionPositive
2. Siemens CSA image header (0029,1010) → PhaseEncodingDirectionPositive
... |
324cbc6fa4e4566082eac0ff4a75192b3e8b4e97e5b06cfc55ae77d5659012cb | Python | 15,380 | 406 | # Copyright (c) 2025-2026 ByteDance Ltd. and/or its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Tests for density histogram estimators and Kahan summation."""
import math
import jax
import numpy as np
from jax import numpy as jnp
from jaqmc.data import BatchedData, Data
from jaqmc.estimator.density import (... |
061152bf2534032032c0000ae91280752bdfa1ba1c3b57f31c570e1758bccf35 | Python | 15,381 | 361 | import numpy
import matplotlib.pyplot as plt
def avg_and_rms(x):
N = len(x)
avgx = numpy.mean(x)
rmsx = 0
for i in range(N):
rmsx += (avgx-x[i])**2
rmsx = numpy.sqrt(rmsx/(N-1))
return avgx,rmsx
def manual(filename,idelay,idur,spikedurat):
"""Manual approach"""
... |
83bf151a6a11536a98c5c6ebd099ac547aa81b65577aefab2f3476bdfa8ac1bd | Python | 15,383 | 489 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
def reldiffs(fother,f1,iother,i1):
iout = []
rdout = []
N1 = len(f1)
Nother = len(fother)
for i in range(Nother):
ithis = iother[i]
for j in range(N1):
ibasic = i1[j]
... |
7974464177eba13b2e434d626b02dac33ba13a728df9e1fc7530505fbfbba7a2 | Python | 15,387 | 481 | from pathlib import Path
from numbers import Real
import pandas as pd
from gliotrace.initalize_class.defaults import DEFAULT_HMM, DEFAULT_CHANNEL, DEFAULT_COL
from gliotrace.initalize_class.types import ValidatedInit
def merge_config(defaults: dict, overrides: dict | None, name="config"):
cfg = defaults.copy()
... |
7e1f2db5eb7c60c299121f1a8889709dc17de6d3ab4fbbd04efd8b929d622b81 | Python | 15,390 | 361 | import os
from typing import List
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score, precision_score, f1_score, fbeta_score, precision_recall_curve, \
average_precision_score, recall_score
from sklearn.metrics import make_scorer
from sklearn.mode... |
7e69305fa9518c34b00d2234b6f8413e08df5fd3b8d2922af46e79d946fedcdb | Python | 15,392 | 448 | #!/usr/bin/env python
from optparse import OptionParser
import gzip
import os
import re
import subprocess
import sys
import h5py
import numpy as np
################################################################################
# preprocess_features.py
#
# Preprocess a set of feature BED files for Basset analysis, p... |
669cb6b3f72826b07eadca44b86e6a6bfc629657f3ebd66fe7163b86744586a6 | Python | 15,403 | 378 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkrenderer.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.8 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is distribu... |
ebcde98b1b15e42d99915ad964d64f2e012f9a1e9aa8a65c5a70fd7d3e3f3c74 | Python | 15,431 | 359 | #!/usr/bin/python
###
# Author: Tyler Jang, Theo Kataras
# Date 5/19/2022
#
# Inputs: List of counted images, roi csv file with hand count represented
# Outputs: Statistical performance of selected classifier to csv
# Description: This file audits several resulting images from ACCT 2 for the
# sel... |
141cf57f8eef98d104d39455462ca1c3ab5a3ef45df4f5cd2e9811282c8e9341 | Python | 15,435 | 373 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.