sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
72569094ca08fbbcd70224785f23b1f420c9fee7655f272f04ddc02ed086a5a7
Python
14,217
425
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
356f25c9e59ac8f8e2e4629e335f1bae6836c73ea4eb8042164ca0efb6950949
Python
14,218
426
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
739b20ef78fe97ec4bbdf7c7f1afe318d117c71e337ed0d22120ddc23971b429
Python
14,222
374
import matplotlib.pyplot as plt import pandas as pd import os import numpy as np from upsetplot import UpSet, from_memberships import warnings from matplotlib_venn import venn3 warnings.filterwarnings("ignore", category=FutureWarning, module="upsetplot.plotting") warnings.filterwarnings("ignore", category=UserWarning, ...
8a651c16ef9589993fb3c6edc2dcda9907a8263c0abedd2c0eeef2743c51929d
Python
14,222
365
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 14 11:01:30 2026 @author: vbp """ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 26 16:21:46 2025 @author: vbp Figure S4I only: sensory preference index (senso_bias) by region. RPE value for punishment set to zero Data can...
ed135a96398dbe0adc2118ef9b40db4d7f26fa5f773a13dbc445ae938f04a985
Python
14,222
426
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
0b417d11b351462482cdeef8cd9866a96d41e168d681af7b2efaaa9157bb1f8d
Python
14,225
436
''' Tools for reading ImageJ files. Based on code originally written by Luis Pedro Coelho <luis@luispedro.org>, 2012, available at https://gist.github.com/luispedro/3437255, distributed under the MIT License. Modified - 2014 by Jeffrey Zaremba (@jzaremba), https://github.com/losonczylab/sima - 2015 by Scott L...
80af3904a0951949c0fb2176f7bab1b2af024c2bb164c4a654cc6f5c2841dbde
Python
14,225
268
##在线进行数据预处理,计算dR和组内叠加平均,现在第55/57行设置数据参数 # 定义视觉刺激参数设置的类 ##20210928,第一次读取相机的原始数据时,归一化到[-1,1]的范围内 from PyQt5.QtWidgets import * import os from PyQt5.QtGui import * import cv2 as cv import numpy as np import time import threading import gc import sys class Data_Preprocess(QWidget): def __init__(self): ...
3efb36bf2de4fa397d4eec06349a0ea519d56d07de1281c34674053dce7d07be
Python
14,229
483
from scipy.spatial import KDTree import numpy as np import matplotlib.pyplot as plt from matplotlib.lines import Line2D from matplotlib.patches import Patch from collections import Counter import jax import jax.numpy as jnp from graph_tool.all import Graph from graph_tool.topology import max_cardinality_matching from...
5d763751982ddbfb359da3e812f7dc3c0b1b316136e3f7a6d7d6123dc0165d12
Python
14,230
426
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
b7ee14c81b59bf9fdede6c19ec1b2f71ec4072e171d6501d04cf3ba07d849d90
Python
14,231
427
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
df5d567c9398c9c804b3e0d87c093c5bc7f2754ff2b0b873ddbdc9c199b3b0fa
Python
14,235
455
from __future__ import annotations from datetime import datetime from datetime import timezone from io import BytesIO from typing import TYPE_CHECKING from typing import Any import pytest from packaging.utils import NormalizedName from packaging.utils import canonicalize_name from poetry.core.constraints.version imp...
99dc70b2004fb296b8542b8a4d7eafdd7486e381fcdaf4263d7beceed51abbad
Python
14,238
428
import numpy as np import pandas as pd import statsmodels.formula.api as smf from . # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", ...
9fe00222b8dd9e03c05845036cfbed669fdc73ea5be91d712a38458ca6119737
Python
14,238
427
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
bdb3349fd1936ca86df36d990ae9fc1584a2c1450d96f177258733435f088936
Python
14,240
387
# %% # imports # autoreload # %load_ext autoreload # %autoreload 2 import torch import torch.nn as nn from torch import Tensor import math from torchsummary import summary from dataset import SzDatasetRegs import lightning as L import torch.optim as optim import torch.nn.functional as F from lightly.loss import SwaVLos...
994ea0efc7df4949b3322c91473cf0fd76b19b23d989be9598d2ebfd6f815e19
Python
14,244
427
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
4e333d2f3ce001d526208788dd8ad22c32d3c705749fc55f6c821bf8faf1ab73
Python
14,245
427
import numpy as np import pandas as pd import statsmodels.formula.api as smf # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f77b4", "#9...
f88fe66af6134dd620c8b93673f88c648bbe965bfb350b2620d929ec5d2a0279
Python
14,249
428
import numpy as np import pandas as pd import statsmodels.formula.api as smf from .paper_ANOVA # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ "#1f...
52b344303964ef1458e520ad8cc15a71d12dc450268ebb76ffcaa7446edbc519
Python
14,253
368
""" Copied and updated from squidpy (to not have squidpy as a dependency) Functions for building graphs from spatial coordinates. """ import logging import warnings from collections.abc import Iterable from enum import Enum from functools import partial from typing import Literal, get_args import numpy as np import p...
f246b739ce387edb06083f415d7d753d5273bce34b52c45f74bc1af6d5e21147
Python
14,257
428
import numpy as np import pandas as pd import statsmodels.formula.api as smf from .paper_ANOVA import # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [ ...
a40ee260ce55f5c064cdce9f453a53b1ceb627c77f02918078cb9a1701bb13f1
Python
14,262
428
import numpy as np import pandas as pd import statsmodels.formula.api as smf from .paper_ANOVA import ANOVA # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( [...
e3078261e61d9198a35aa883e335fdeb3947ea61bacdfe6eb621b8d81e88f0d4
Python
14,267
428
import numpy as np import pandas as pd import statsmodels.formula.api as smf from .paper_ANOVA import ANOVAModel # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( ...
249dc415a91aebdc87a605598964f960cba21b7882a7cf6313139e831e7e4a06
Python
14,268
483
from scipy.spatial import KDTree import numpy as np import matplotlib.pyplot as plt from matplotlib.lines import Line2D from matplotlib.patches import Patch from collections import Counter import jax import jax.numpy as jnp from graph_tool.all import Graph from graph_tool.topology import max_cardinality_matching from...
f40a47a510e28c471186afe2db654886f6c340c2bad4fb2a61c6705f873680e0
Python
14,270
343
"""Figure 7 — Brain region classification benchmark (Allen + IBL). Reads: results/benchmark/brain_region_benchmark.csv results/benchmark/benchmark_cache/hippie/{dataset}/fold_0/predictions/ transductive_predictions.csv (for region label counts) Emits in figures/figure_7/: allen_region_profile.{sv...
f9478ba2de849409a8b888f9ce1b8bf5b2f367d3440abadea0e3b73263ce5b5c
Python
14,288
358
""" File adapted and modified from stevolopolis/GrTrainer_paperspace """ import glob import torch import os import random import math import numpy as np from PIL import Image from torchvision import transforms import yaml import json from types import SimpleNamespace from tqdm import tqdm with open('config.yaml', '...
4937ef22d6286d99d1190515387d0ba695c945467d0ae2b4d2f2bb8d79ac4c38
Python
14,292
235
import numpy as np from copy import deepcopy from typing import Union, List, Tuple from dynamic_network_architectures.architectures.unet import ResidualEncoderUNet from dynamic_network_architectures.building_blocks.helper import convert_dim_to_conv_op, get_matching_instancenorm from torch import nn from nnunetv2.expe...
fb2c56be88cf6130a9d3fd2a9c8ab6133f8bd5e197f8ad2b2fbd4e546ff5a908
Python
14,297
380
from pathlib import Path import re import math import numpy as np import pandas as pd import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt FIGURE_LAYOUT_VERSION = "bottom-panel-labels-v2" BASE_DIR = Path(".") INDEX_2016_PATH = BASE_DIR / "dataset" / "index" / "v2016" / "INDEX_general_PL_data.2016...
ebd02054ceacb7b50c1aeea39dace1dc499f7c3bd22dd99eaeaa2cdc37953dff
Python
14,310
364
import re import random import numpy as np import pandas as pd import nibabel as nb import matplotlib.pyplot as plt from scipy.stats import mannwhitneyu from statsmodels.stats.multitest import multipletests from mpl_toolkits.axes_grid1.inset_locator import inset_axes from meld_classifier.meld_cohort import MeldCohort, ...
91b0f08746982c7be75eebfeb9f3036b5cd0a6488f3266e81a066709f23807cb
Python
14,312
482
import os from pathlib import Path import torch import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import seaborn as sns from torch_geometric.loader import DataLoader from sklearn.model_selection import KFold from sklearn.metrics import mean_absolute_error, mean_squared_error f...
1d7e19e31a683532c16f3fce0ac0399c75e4cd887b9066b1813dcb1362027b78
Python
14,321
436
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. __version__ = "2.5.0" # Work around to update TensorFlow's absl.logging threshold which alters the # default Python logging output behavior when pre...
6a92df3520b4a4b4f311f936e47a9daf0ae895baf9b18089787b1aab5e5ed711
Python
14,326
439
import numpy as np import pandas as pd import statsmodels.formula.api as smf from .paper_ANOVA import ANOVAModel # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( ...
08b430659a9c71b63770d9c6dedd6dd39e1f27a6c663a941e43f1329194a4766
Python
14,327
440
import numpy as np import pandas as pd import statsmodels.formula.api as smf from .paper_ANOVA import ANOVAModel # Colours and types Types = np.array(["T4", "T5"]) Type_colours = np.array(["#17becf", "#ff7f0e"]) Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"]) Subtype_colours = np.array( ...
5e5481dc817445b241dc3b5bed301673294e0e708e666245e4caeef445a9325e
Python
14,332
258
import contextlib import ast import io import json from pathlib import Path from unittest import mock import tempfile import unittest import zipfile import types import nibabel as nib import numpy as np import sys sys.path.insert(0, str(Path(__file__).resolve().parents[1])) import inferref3d_backend as infer import t...
1bb6410bdddeb32eae2cc8ec470f5873b5377ad40c9ce47d2ff805874601bd2a
Python
14,333
354
# Copyright (C) 2025 ETH Zurich, Moritz Thürlemann, and other AMP contributors import torch from datastructures.Graphs import Graph from utilities.Utilities import build_Rx2 class ForceModule(torch.nn.Module): def __init__( self, amp, simulator, n_nlist=64, pairlist_paddin...
b283edf6ddc05f1499bb7da0d42e3ddc95ad7e0cfd6cdcd2f40c5fb7abfec372
Python
14,340
317
#!/usr/bin/env python3 """ppi_analysis.py — protein-protein interaction analysis for MS_GEO candidates. Queries STRING (REST API, physical-only) and GeneMANIA (physical interaction attributes) for the union of our high-confidence candidates: - CO7 panel (LXN, SH3BP4, CHL1, CTSZ, RPAP2, PCNP, THRB) - Top 30 inverse...
1958ee751e8a2353a8ee6ecd2e71a3cea21c17a9d1acbb1f95ee07bf47c4490e
Python
14,352
363
""" Chromatophore Segmentation. Accurate identification and isolation of individual chromatophores in video frames are crucial for detailed analysis. \ The process of "segmentation" involves creating a binarized image where each pixel is classified as either part of a \ chromatophore or the background. Chromatophore c...
0b33fedfe42e5cd256ada8d9325900cfe747679ca1e6d6d98046ca8bf4cbb3cb
Python
14,362
322
import logging import pydantic.v1.utils as pu import yaml from bigstream.configure_bigstream import default_bigstream_config_str from bigstream.image_data import ImageData logger = logging.getLogger(__name__) def inttuple(arg): if arg is not None and arg.strip(): return tuple([int(d) for d in arg.split...
4e6540faed83fdd80b5da14e0efbdee7817d33b129dbb7e436d96323c3af7a0c
Python
14,366
334
# this file is generated by tests/repositories/fixtures/pypi.org/generate.py from __future__ import annotations import dataclasses from typing import TYPE_CHECKING import pytest if TYPE_CHECKING: from tests.types import DistributionHashGetter @dataclasses.dataclass class DistributionHash: sha256: str = "...
49ad8f1cdd52e35bc097bafdc3c4f47292ed1caaab064cf00758360f7c51e731
Python
14,375
337
# Copyright (C) 2025 ETH Zurich, Moritz Thürlemann, and other AMP contributors from utilities_calibration import scatter_sum as scatter import torch from datastructures_calibration import Graph from utilities_calibration import scalar_product, ff_module, build_Rx2 from torch import Tensor import numpy as np import os ...
53aa4dc6dfa32d71653721c2139fdabf2cbc32a045db392ca2a5b5a0cd31c877
Python
14,378
482
import os from pathlib import Path import torch import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import seaborn as sns from torch_geometric.loader import DataLoader from sklearn.model_selection import KFold from sklearn.metrics import mean_absolute_error, mean_squared_error f...
0731f2cbf45873edd6564dcb0c98ea1a8726b2cbc88f945f6dfa0d6cd6672e97
Python
14,381
405
from typing import Mapping, Any import torch from torch import nn from torch.optim.lr_scheduler import LinearLR import lightning.pytorch as pl from lightning.pytorch.loggers.wandb import WandbLogger from lightning.pytorch.callbacks import ModelCheckpoint from lightning.pytorch.callbacks.lr_monitor import LearningRateM...
3175614ece58fe57195ba8f0ade4605b9cd8a3da9257bfa67569197f21fc70b9
Python
14,386
433
from __future__ import annotations import pandas as pd import pytest from src.features.telemetry_alignment.exporters.export_frames import ( build_intercluster_interval_frame, build_native_signal_frame, get_standardized_native_window_bounds, ) def test_build_intercluster_interval_frame_orders_photometry_...
25285ee198e71ef55f7bd9a3923341895d2bbd2850780eb518d184eaf01f89d8
Python
14,388
523
""" Comprehensive benchmarking script for Garfield spatial data scalability. This script benchmarks all major tasks: 1. Dimension reduction (PCA) 2. Graph construction (KNN, Radius, mu_std, Squidpy) 3. Model training (embedding generation) 4. Label transfer (mapping) Runs experiments on datasets ranging from ~5k to 1...
34eb534e1f6763d0c4cbd650a9401bf22e95dbdc4e35c5289857935adab16d38
Python
14,388
384
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Dict, List, Optional import torch import torch.nn as nn from torch import Tensor from fairseq import utils from fair...
ab1e9aa9ae3216fddaa269e68e82a71098ccbe8eb0fa31171e74809368e2769a
Python
14,401
385
import json import os import subprocess import sys from glob import glob from absl import app, flags from scripts import pdb_utils, pmhc_templates, seq_utils, tcr_utils flags.DEFINE_string('output_dir', "experiments/", 'Path to output directory.') flags.DEFINE_string('pep_seq', None, 'Peptide se...
0238b52c8825c714094c1b4ace0b7a12cbd27ba48f1d0080aaf81d65f82f15c2
Python
14,405
432
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from collections.abc import Callable from typing import Literal import torch import torch.nn.functional as F from torch import nn from torch.distributions import Normal from scvi.module.base import auto_move_data def _ge...
709e67b0058b7f6cb0aca75002fab957f0a0b09439e48a732620f144418c27ac
Python
14,425
436
#!/usr/bin/env python3 import math from abc import ABC, abstractmethod import torch import torch.nn as nn from torch import Tensor from .utils import batched_outer class BaseSpikeBuffer(ABC, nn.Module): """ Base class for a rolling binary spike buffer. """ def __init__( self, num_n...
d109170c639f27256221cca2c82cf03f67ee298d46945428f408ae56c3d213a9
Python
14,430
286
""" This module contains classes that back up the state of the MM/PBSA calculation so that future post-processing of the output files can be done without re-supplying all of the information again. """ # ############################################################################## # GPLv3 LIC...
25baf5e506847196998591d39c9cfb670fc151ae08b96b9f589e6289ff4d202a
Python
14,434
386
""" Training Script for Vision-Language Model SFT This script trains VisionLanguageModel with supervised fine-tuning. Uses the ImageDataModule + VisionInstructionDataModule stack and FSDP. """ import warnings warnings.simplefilter(action="ignore", category=FutureWarning) import os import json import logg...
4e97396a78bd7a943fdf9bb6771f840b449d2b361094028f664d98bc12369345
Python
14,435
415
from __future__ import annotations import shutil from typing import TYPE_CHECKING import pytest from cleo.io.null_io import NullIO from poetry.factory import Factory from poetry.publishing.uploader import Uploader from poetry.publishing.uploader import UploadError if TYPE_CHECKING: from pathlib import Path ...
224eb74c4e8d29d069d5e3a01f5d1ecd69db5b9d2d8286ad4d082f74e3dee0c8
Python
14,457
337
# encoding: utf-8 """ @author: Jiayang Chen @contact: yjcmydkzgj@gmail.com """ import logging import torch import torch.nn as nn from ignite.engine import Engine, Events from ignite.metrics import Average import numpy as np import os import subprocess # for ct file graph visualization abs_file = __file__ work_di...
1f4c51686ef1245efebe769dc0644c8a62e46ea0387846188d44fe01dcd28895
Python
14,468
351
import os from collections import OrderedDict from PyQt5 import QtCore from PyQt5.QtCore import pyqtSlot, Qt, QObject from PyQt5.QtGui import QBrush from PyQt5.QtWidgets import QFileDialog, QTableWidgetItem, QAbstractItemView, QMenu, QMessageBox, \ QDialog, QDialogButtonBox from mdt.gui.model_fit.design.ui_generat...
be68d98a8943aa1b15056f66fa4324e4dbacb8ec084ab33f3cd321b40b21411c
Python
14,470
385
import logging import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import pytorch_lightning as pl from .backbones import ResNet18Enc, ResNet18Dec from pytorch_lightning.utilities import grad_norm from torch.nn.functional import normalize from .optimizers import AdamWScheduleF...
54439e7f60788fc7632cf3774244aa4330e36cfc3f1187c7726a9e0c5dc9e158
Python
14,484
308
#!/usr/bin/env python3 """Portao de entrada: reprova ANTES de gastar fila. Uso: python3 preflight_eos.py --threads 8 [--timeout 1800] [--skip-run] Existe por uma falha real de 2026-07-26 na campanha de producao: sem `LD_LIBRARY_PATH` o SIESTA morre em milissegundos com `error while loading shared libraries`, a fi...
dab7733d1fa948a0d163bfaee376f8c47f3c6771b8617625b28237390b0cd589
Python
14,495
345
import torch from torch import nn import torch.nn.functional as F import os __all__ = ['HRNet', 'hrnetv2_48', 'hrnetv2_32'] # Checkpoint path of pre-trained backbone (edit to your path). Download backbone pretrained model hrnetv2-32 @ # https://drive.google.com/file/d/1NxCK7Zgn5PmeS7W1jYLt5J9E0RRZ2oyF/view?usp=sharin...
e0e65533d2e2cba36223e8aa82ab78ef956b3a715217741b026017199c93446a
Python
14,512
310
import shutil import time from tqdm import tqdm from dataloadR.augmentations import * from evalR import voc_eval from utils.utils_basic import * from utils.visualize import * from utils.heatmap import Show_Heatmap current_milli_time = lambda: int(round(time.time() * 1000)) class Evaluator(object): def __init__(s...
f8e2fe3b4652ab5eccbf8bad38a9df56d69a01026dd7db5573569b60ed33d4e1
Python
14,525
361
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import json import os from collections.abc import Iterable, Sequence from functools import cached_property from inspect import getmembers, isclass from pathlib import Path from typing import Literal, Sequence, Type, TypeVar import numpy.typing i...
d0134ab65edb93781320e57306b8253b6ae756e3057c3a7b2552a7ba7f62bf78
Python
14,532
420
from neuron import h from neuron.units import mV, ms import cell_singlespine_randomloc as cellrl import cell_singlespine as cellaspine import numpy as np # from scipy.optimize import curve_fit # distance from soma vs somatic amplitude # does not include dendrite information # higher amplitude line from basal dendrit...
cf5a4577f5a8afefe4b65b5a0b306e6f735e819fc470f28262afa4b929c02fe3
Python
14,542
361
import torch import numpy as np import pandas as pd from sklearn.linear_model import TheilSenRegressor import torch.nn as nn import networkx as nx from tqdm import tqdm import pickle import sys, os import requests from torch_geometric.data import Data from zipfile import ZipFile import statsmodels.api as sm from skle...
8f53ef5f0ffb7075ac26558d80641eb5290cf3310e26ba9d7087d0f450ca1d5d
Python
14,557
307
# -*- coding: utf-8 -*- """ Cellular Automata Tractography: Fast Geodesic Diffusion MR Tractography and Connectivity Based Segmentation on the GPU Copyright (C) 2019 Andac Hamamci This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License...
7137bfafe0919eb9a434c8266373a79753e963c8889e959a9cc9ec20a512fb8f
Python
14,564
444
#!/usr/bin/env python3 """ Compute 3D Autocorrelograms from Spike Times for NEMO Benchmark This script computes 3D log-scale autocorrelograms (ACGs) from raw spike times, which are required for NEMO's bimodal embedding model. The 3D ACG has shape (N, 10, 101): - N: number of neurons - 10: frequency/firing rate bins -...
c04a9ccc6bef2cc69741f1179eca4a2b6a0b2b2bc3e704d446a58999e9ccdaa9
Python
14,570
291
from __future__ import annotations import argparse import json from pathlib import Path import numpy as np import pandas as pd from st_risk.paths import current_results_dir, ensure_results_layout, project_root, results_file, set_selected_run DEFAULT_RUN_ID = "2026-06-20-threshold-sensitivity-v2-donor-disjoint" DEF...
996f13c4d18a8d240b4ca2148b7ebe0f096f0082a844f725710ce9c560a41d90
Python
14,579
376
# -*- coding: utf-8 -*- from __future__ import print_function import json import os import struct import sys import platform import re import time import traceback import requests import socket import random import math import numpy as np import torch import logging import datetime from torch.optim.lr_scheduler import...
7030f8b4339c6b1a7ac7c1d54ea0172af166d9442b9d4ea1bd9246ebcaf94650
Python
14,607
423
from __future__ import annotations import copy import hashlib import io import logging import os import shutil import stat import sys import tarfile import tempfile import warnings import zipfile from collections.abc import Mapping from contextlib import contextmanager from pathlib import Path from typing import TYPE...
ccfa24b676fd3912bd1a4ce54d24450e19daf546627a00098646f1169518db9f
Python
14,608
401
import torch import abc import os import copy import pytorch_lightning as pl from utils.lr_scheduler import * from torch import distributed as dist class AbstractModel(pl.LightningModule): def __init__(self, lr_scheduler_kwargs: dict = None, optimizer_kwargs: dict = None, ...
deea87ea5ab2e39279f95279041e964921734fddcd1dc04fc726bc0e1f0d8c48
Python
14,613
455
from __future__ import annotations import dataclasses import json import logging import os import re from copy import deepcopy from json import JSONDecodeError from pathlib import Path from typing import TYPE_CHECKING from typing import Any from typing import ClassVar from packaging.utils import NormalizedName from ...
7948d9401daa03f2017bfa27d8637bb5dffb1a304cb91a41c987666ec16f1d7c
Python
14,616
244
#!/usr/bin/env python3 """figure4_proteomics.py — Figure 5 (proteomic validation), CORRECTED. KEY CORRECTION: the "timsTOF" dataset is CSF (Bader & Mann 2024, 2nd platform of the Astral CSF cohort; n=1,536 MS / 2,363 HC), NOT a separate "Wang & Julien brain" cohort. The genuine brain proteomics is Wang & Julien 2025 (...
4f44ffcca5e95674b2450a308a3252eb23eb3cba8d1a01071e60d992fe5e1a4d
Python
14,621
508
from __future__ import annotations import torch import pytest import vak.metrics.boundary_detection.functional from .conftest import FIND_HITS_TEST_CASES, PRECISION_RECALL_FSCORE_RVAL_TEST_CASES @pytest.mark.parametrize( 'test_case', FIND_HITS_TEST_CASES, ) def test_find_hits(test_case): (preds, t...
8f64b9d8508fd47de09dbbafbdc6159f775e6b4cb1a4a4b93a62a206872875bf
Python
14,622
351
import os import zarr import torch import shutil import argparse import numpy as np from pathlib import Path from einops import rearrange from torch.utils.data import Dataset, DataLoader from PIL import Image import torch.multiprocessing as mp from torch.utils.data.distributed import DistributedSampler from torch.nn....
60998b9fcc8082047a650364db957b3e5bb38f6647bc4f39eca31cf784a55cfa
Python
14,625
404
"""LAMMPS + AIREBO runner for carbon percolation clusters. Cheap, well-parameterised reactive force-field for pure-C clusters with arbitrary connectivity (handles dangling bonds gracefully — AIREBO was designed for radical hydrocarbons). Single-point and minimisation modes. Output: total potential energy in eV and t...
ae6341371f4cb4e021409f6f5ebcf5ad5577d9389c06867dc3913d70979cb42d
Python
14,659
339
from __future__ import annotations from typing import ClassVar from PySide6.QtWidgets import QGridLayout, QSizePolicy, QTabWidget, QVBoxLayout, QWidget from src.core.app_settings_manager import AppSettingsManager from src.features.behaviour_alignment.exporters.aligned_behaviour_exporter import ( AlignedBehaviour...
04c0f7d92baa6e4b852f953032e88170e7b24937a0f1979fc688925e9c5ecaae
Python
14,660
354
# Copyright 2015 Google Inc. 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 applicable law or a...
a199999a543d77c6e2439b6ef277eb21015e045e1584f591c1a75309251516da
Python
14,662
377
import numpy as np import pandas as pd import scipy.stats as stats import scipy.io as sio import os, sys, argparse, time, logging, getpass import matplotlib.pyplot as plt from GWAS_IO.summary_stats_Utils import * def read_sum_dat(sumFile, logger, kargs): ''' Read give summary statistics. Input: sumFil...
c1fdacfa434dc91475d066f2e38ee7c631aad04bc50c7170f4a9bb15a67325f4
Python
14,677
436
#!/usr/bin/env python3 -u # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Run inference for pre-processed data with a trained model. """ import ast import logging import math import os ...
d2cc1d975ed32bb2f0ecfaa6470914ef846b0a9c5b0d7d1e0318a625d837e5bf
Python
14,677
334
import json import tkinter as tk class AppSettingsManager: def __init__(self, app_type="default"): """ Initialize the settings manager with default settings. Parameters: - app_type (str): The type of app to initialize the settings for. """ self.app_type = app_type ...
c0eb4252967de2a9368ee46f49dfab16ee2c86d5fa82b555030a9d23e29564cd
Python
14,679
338
#三个头0414 import sys sys.path.append("..") import utils.gpu as gpu from modelR.backbones.mobilenetv3 import MobileNetV3 from modelR.backbones.mobilenetv2 import MobilenetV2 # from modelR.necks.conv_csa_drf_fpn_hbb import FC2_CSA_DRF_FPN from modelR.necks.Three_Head import FC2_CSA_DRF_FPN from modelR.head.dsc_head_hbb im...
ced6ff89b007e705f24be1d06b906a2d949c68602f0c93ed48c34c3915b5ac4e
Python
14,679
556
# -*- coding: utf-8 -*- """ Created on Sun Mar 2 21:23:46 2025 @author: hanna """ import os import pickle import numpy as np import pandas as pd from tqdm import tqdm import seaborn as sb import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.lines import Line2D # from scipy.optimize import cur...
55e4fbc65096a04f5c36b06bd315aac31bc96f9033dad105137625e6ac8ec3d1
Python
14,682
476
# %% # Standard imports import re from typing import Union import matplotlib.pyplot as plt import seaborn as sns # Third party imports import pandas as pd from scipy.signal import iirnotch, sosfiltfilt, butter, filtfilt import numpy as np # %% def _pull_iEEG(ds, start_usec, duration_usec, channel_ids): """ Pu...
ec23955b1d1ce1505f2dde456df84cfa6894b0222eb15fb62d59c32637fca9f8
Python
14,686
426
import torch import torch.nn as nn import torch.nn.functional as F from torch.optim.lr_scheduler import StepLR, CosineAnnealingWarmRestarts import numpy as np from celltype_ibl.utils.c4_vae_util import VAEEncoder, vae_encode_model, load_acg_vae from celltype_ibl.models.BiModalEmbedding import ( BimodalEmbeddingMode...
c6e6c0b9ac1a4bcb05909cf45a04db8761d7f5baea9eb9544e690f77f03fdbbf
Python
14,702
279
import torch import torch.nn as nn from ..layers.convolutions import Convolutional, Separable_Conv_dila, Separable_Conv, Deformable_Convolutional import torch.nn.functional as F from ..layers.attention_blocks import SELayer class SPP(nn.Module): def __init__(self, depth=512): super(SPP,self).__init__() ...
2dc684f863eecbf496847ae21b3e0d5695382a51cc09386789573091c7fbfe20
Python
14,711
367
import warnings warnings.filterwarnings('ignore') from typing import Callable, Tuple, Union import math import torch from torch import Tensor import torch.nn as nn import torch_geometric.nn as gnn import torch.nn.functional as F from torch_geometric.nn.conv import MessagePassing from torch_geometric.nn.dense.linear im...
d235aebe768de224e87e4210c98f2a9c68f15caccb31dbd1e69c8f15614363ed
Python
14,716
426
import torch import torch.nn as nn import torch.nn.functional as F from torch.optim.lr_scheduler import StepLR, CosineAnnealingWarmRestarts import numpy as np from celltype_ibl.utils.c4_vae_util import VAEEncoder, vae_encode_model, load_acg_vae from celltype_ibl.models.BiModalEmbedding import ( BimodalEmbeddingMode...
1407071e2725e8eda5b46de23a0b3b936a8e4bd9862f014b7e4bbe31a4c98884
Python
14,720
455
import os import warnings import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from scipy.spatial import ConvexHull from vedo import Cylinder from tqdm import tqdm import NeuRosetta as nr import HexCraft as hc def add_compass(ax, pos=(0.9, 0.1), size=0.05): """ ax : matplotlib axis...
891c8056d077ea29dc5c33472c9bcc71472de22299d1b3f788f6bcbb12625bdb
Python
14,722
393
"""Building a model from a config, and loading a checkpoint back into it. `train`, `tune` and `evaluate` each used to construct the model themselves with `getattr(models, config.model_class)`. That resolved any attribute of the package, checked nothing, and — because it ran after the dataset had loaded — reported a mi...
4bdf3a7e315d3bc34e3eca02d5125f492e2cefca8d00277c26073e40c8f970ec
Python
14,758
374
import torch, functools from torch import nn import torch.nn.functional as F from torch_geometric.nn import MessagePassing from torch_scatter import scatter_add def tuple_sum(*args): ''' Sums any number of tuples (s, V) elementwise. ''' return tuple(map(sum, zip(*args))) def tuple_cat(*args, dim=-1): ...
634c3e512c4274ac29ce7c2ccf29e5a5603de1d4a7bffe51f3eb76fd70a993c5
Python
14,762
313
# !/usr/bin/python # -*- coding: utf-8 -*- # Pytoolkit GeneSymbolUniform for hECA 2.0 # author: Yixin Chen, Haiyang Bian # date: 2023/09/25 import scanpy as sc import pandas as pd import sys import numpy as np from loguru import logger import scipy.sparse as sp import os from tqdm import tqdm from concurrent.futures i...
47b5aff37c10c6d93075099a665a8879a4f0b02f09b633a7c3b84b83e939a540
Python
14,763
314
from albumentations.augmentations.transforms import HueSaturationValue from batchgenerators.transforms.abstract_transforms import AbstractTransform import numpy as np from scipy import linalg from skimage.util import dtype from skimage.exposure import rescale_intensity # import os import pickle def write_pickle(obj, fi...
9c9dd3467d321f0bf571c878dc5636dc72edad73392c449fb20db29827d4f2e3
Python
14,770
383
""" GLS/LVEF estimation. """ from __future__ import annotations import argparse import os from pathlib import Path from glob import glob import copy import cv2 import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F from core.MOAv3 import MOAFlow from core.modeling....
8789f27c8f6b2ca0de75599843eb262d8ae6c38b1b4ff05a556cadcf535b6126
Python
14,771
434
from typing import Optional, Tuple, List from abc import ABC, abstractmethod import torch import torch.nn as nn import pytorch_lightning as pl import numpy as np import sklearn.linear_model from tqdm import tqdm from dataclasses import dataclass, field from utils.tokenization import Vocab from utils.metrics import rna...
3449fed93df4078b56fa04ab4267de83556004fad0852058aab0ccd44ec66132
Python
14,772
393
#Code from: https://gist.github.com/rockt/15ee013889d65342088e9260a377dc8f import re import torch import numpy as np def einsum(equation, *inputs): """A generalized contraction between tensors of arbitrary dimension. This function returns a tensor whose elements are defined by `equation`, which is written in ...
afc4af6bd47d87e02b5fb57457fe873c499ba9b2e217ed210c343938845bf976
Python
14,773
365
""" Pure Excel/CSV export helpers for telemetry/photometry/opto alignment. No UI framework dependencies. """ from __future__ import annotations import re import numpy as np import pandas as pd # --------------------------------------------------------------------------- # Cluster heading generation # -------------...
eccdbb112ec7a31ee4d8c9e111adc1c169520cf1a904afbcaacdc3c89bf6f2fa
Python
14,773
308
#!/usr/bin/env python3 """Some functions and classes for streaming predictions.""" import numpy as np import h5py import pybedtools import pysam from bpreveal import logUtils from bpreveal.logUtils import wrapTqdm from bpreveal.internal.constants import LOGIT_T, LOGCOUNT_T import bpreveal.internal.files class FastaRe...
fbea609edf99261b804479618ed3d7fb691fd49fc4f81c12d4995e0b6dbbb071
Python
14,774
446
"""Neural sampling implementation (Buesing et al. 2011).""" import time from datetime import datetime from typing import Any, Callable, TypeAlias import numba import numpy as np import numpy.typing as npt from .utils import ( bm_to_probs, distr_from_states, get_states_from_spikes, list_of_states, ...
611267d66ef4702b73f9ebe6ed680f54ed14069a49b5da4882bb2ff8713cc09f
Python
14,775
468
""" This module builds rna rna interaction functions. Author: wangning(wangning.roci@gmail.com) Date : 2022/12/7 7:41 PM """ import time import os.path as osp from collections import defaultdict import numpy as np import pandas as pd from tqdm import tqdm import paddle import paddle.nn as nn from paddlenlp.data im...
45e5054697ec904112e239dbb98e05136523db45cc825ced185b469b7eaf12e8
Python
14,777
319
# -*- coding: utf-8 -*- """ Cellular Automata Tractography: Fast Geodesic Diffusion MR Tractography and Connectivity Based Segmentation on the GPU Copyright (C) 2019 Andac Hamamci This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as p...
d49d3e139dc5e4b4a0209c216b02fca850aec1c16d18eb3e4314d5847d636e62
Python
14,777
372
# -*- coding: UTF-8 -*- """ @Project: iDCF @File : utils.py @IDE : PyCharm @Author : hjguo @Date : 2025/7/9 11:37 @Doc : Data processing and knowledge base loading code """ import os import pandas as pd import numpy as np import anndata as ad import scanpy as sc from tqdm import tqdm from sklearn.preprocessin...
b66cb4bd68a759734abd0fe1c5a96bf58b221b8e3d68d6077d88b69cc8d1cf20
Python
14,779
317
import torch import os import sys from .model.model import MulanConfig, scMulanModel from .model.model_kvcache import scMulanModel_kv import torch.nn.functional as F try: import torch_npu print('Using torch_npu') except ImportError: pass from .utils.hf_tokenizer import scMulanTokenizer import scipy.sparse import n...
c739a941951d7efbac71d6279a5a4e71aa6946ac36261967e3afe1a25e4149fa
Python
14,782
326
#!/usr/bin/env python3 # 12_celltype_4layer_master_py — generated from notebook spec # ============================================================ # # 12 — Cell-type-specific scRNA validation + 4-layer master summary # # For every gene of interest (CO7 panel + top inverse-concordant), produce: # # 1. **Cell-type...
f3d3dd2b74677266d9e5f496af4185dc7e0cce339fecce547b401a7afa362451
Python
14,794
308
from __future__ import annotations import argparse import json from pathlib import Path import numpy as np import pandas as pd from st_risk.paths import current_results_dir, ensure_results_layout, project_root, results_file, set_selected_run DEFAULT_RUN_ID = "2026-06-20-uncertainty-baseline-v1" RELIST_SCORES = ("r...
fd3984d6c0fe8e3ce93a40475472a4c8a227d2c88eab635cf0547fa88c2f9d0e
Python
14,807
352
# -*- coding: utf-8 -*- """ Created on Mon May 1 19:41:07 2023 @author: Sen """ import os import sys import subprocess import hashlib import warnings import platform import csv import numpy as np from tqdm import tqdm import argparse import torch from transformers import AutoTokenizer, GPT2LMHeadModel import shutil...
b5a82cd9f72bb6f923cb0cc2772b3139f2434e16656ce72bcc67ca0f2584c055
Python
14,816
484
from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING import pytest from packaging.tags import Tag from poetry.core.packages.package import Package from poetry.core.packages.utils.link import Link from poetry.console.exceptions import PoetryRuntimeError from poetry.installatio...