sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
e54021ca1abd94d2decd5246e9b7d514fe507111eea926f5d0aaf7c88d7a6550
Python
47,812
826
import numpy as np import matplotlib.pyplot as plt import pandas as pd from HierarchiaPy import Hierarchia import matplotlib matplotlib.style.use("seaborn-v0_8-whitegrid") import igraph as ig import networkx as nx import os import sys import seaborn as sns from weighted_rc_coeff import weighted_rich_club from scipy imp...
8bb8bc7d3657fb3952d19adfff9bd9992b8f09071e30f7013bafbb6f2ba9c091
Python
47,818
1,218
from __future__ import annotations import math import os import shutil from collections.abc import Callable, Mapping from dataclasses import dataclass from typing import Any, Self, overload import networkx as nx import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from jaxtyping impor...
46b9f49c099cb43e1b6755db16cfa32683ea391cd63b488048abeec64fc44158
Python
48,058
1,241
from __future__ import annotations import logging import warnings from functools import partial from typing import TYPE_CHECKING import numpy as np import pandas as pd import rich import torch import torch.distributions as dist from anndata import AnnData from tqdm import tqdm from scvi import settings from scvi.dat...
cf1295ae38b6dbd298d82cfa6916345e23f2f5d3082764272d8bd29964ab9439
Python
48,089
1,235
""" This is a module that contains functions generally useful for the gmx_MMPBSA script. A full list of functions/subroutines is shown below. It must be included to insure proper functioning of gmx_MMPBSA List of functions and a brief description of their purpose -remove: Removes temporary work files in this directory...
4c661233c17d57730a7e46f3af4f7b6bdc58ced0844970b40856e82b77a65190
Python
48,152
1,061
import logging from dataclasses import dataclass from typing import Dict, List, Optional 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 logger = logging.getLogger(__name__) @dataclass class...
3386ef6b239ee4a363863b4516b6ee752b2b0c3e4ceea4a6b99822f1414b906b
Python
48,394
999
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors 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 L...
0e36b1e3c652250b2193dee75a9f542f531220eac59ae8895b4bff3171e0633a
Python
48,415
1,177
import functools import json import time import traceback from pathlib import Path from typing import Callable, Tuple, Union import polars as pl import yaml from PyQt6 import QtCore, QtGui, QtWidgets from rnalysis import __version__ from rnalysis.exceptions import InvalidValueError from rnalysis.gui import gui_style,...
1ede934a70c79d28688859f8448f7c0518a6ebfde9c1ad0b35fe9daf81e3324c
Python
48,422
1,122
# Copyright (C) 2025 ETH Zurich, Moritz Thürlemann, and other AMP contributors import json from openmmforcefields.generators import SMIRNOFFTemplateGenerator from openmm.app import PDBFile, Modeller, PME, Simulation import sys import os from abc import abstractmethod import time import numpy as np import openmm as mm...
53de0cbf1b645443103a324e37dd820b5418fed24461a277a4e330d1f6194843
Python
48,466
1,041
# coding=utf-8 # Copyright 2019-present, 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 # # Un...
627133634b4a4719310a98d560d86af87dc8cd69b419ec025ad8550a1b98be5f
Python
48,467
1,042
# coding=utf-8 # Copyright 2019-present, 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 # # Un...
7a98528e12e01d36031beb3b2af3ac3ad4b6ec7831f8996f3a6a6b39f73e622f
Python
48,508
1,245
"""DIAGVI model for multi-modal integration with guidance graphs.""" from __future__ import annotations import logging import os import warnings from typing import TYPE_CHECKING, Literal import numpy as np import scipy.sparse import torch from mudata import MuData from scvi import REGISTRY_KEYS, settings from scvi....
002ef0b24be7aeec97888842d0003a4b8876015007c2184440fb39a7487108aa
Python
48,586
1,178
import abc import enum import inspect import itertools import math import types import typing import warnings from datetime import date, datetime from functools import lru_cache from pathlib import Path from typing import Callable, Dict, Optional, Tuple, Union import joblib import lazy_loader as lazy import matplotlib...
9ad9b9c90de54e70bd7d0f59fe72566aef8db1f2ac4ae8aaf4724bea6902a87f
Python
48,643
1,340
""" This module builds secondary structure prediction. Author: wangning(wangning.roci@gmail.com) Date : 2023/2/25 15:08 """ import math import time import pickle import os.path as osp from collections import defaultdict import numpy as np from tqdm import tqdm import paddle import paddle.nn as nn from paddle.nn im...
c8bd15a932bc52e9d10f2e9a4b9f73b1b36ecec0b042dd249211b7d8cb91fbac
Python
48,792
1,429
"""`precompute-embeddings` embeds what it was asked to, and stores it all. Everything here is about the bookkeeping around the embedding, which is stubbed out: that every document reaches the LMDB, that every flag reaches the embedder, that a run which stopped early cannot look finished, that the store records what wr...
09dd8bffb8888f27e0242f6cce3b76a9335b729f8753497aea0e69f3f78b59bd
Python
48,931
1,066
# important first import import torch import torch.nn.functional as F import os import re import sys import glob import configparser import numpy as np import datetime import logging import random import threading import time import shutil import sounddevice as sd from scipy.signal import lfilter, butter, lfilter_zi, ...
bf6ae6824b7d78e5f0f53fc8b86f4c14ac88640ada901473b9581d246bd0f060
Python
48,986
1,061
"""Old plotting tools. Deprecated. .. warning:: This module is deprecated and will be removed in 6.0.0. """ import math import numpy as np import h5py import pysam import pyBigWig import pybedtools # You must install bpreveal with conda develop in order to import bpreveal tools. from bpreveal.internal.con...
23e32127f217e07e6d93d132677c1a3b84f0c285247f3f049f30da582f983ab8
Python
49,162
1,113
""" Holdout Training Script for HIPPIE - WAVEFORM + ISI ONLY (Bimodal) This script trains HIPPIE using only two modalities: - Waveform (wave): Spike waveforms - ISI Distribution (isi): Interspike interval histograms The ACG (autocorrelogram) modality is excluded from this version. This is the inductive/holdout ev...
ec02f59c250762d1aad059b42b647bafadf8b960d1a9e53220abaa340140db90
Python
49,180
1,216
"""Controller for telemetry plotting, overlays, and aligned temp/act extraction.""" from __future__ import annotations import logging import math import re from datetime import datetime, timedelta import matplotlib.pyplot as plt import numpy as np import pandas as pd from PySide6.QtWidgets import QInputDialog, QMess...
cf7d7806a897a54ca7994f14b7051b35b2dc3d33b10dc4a8a56f5fbad9dc4f08
Python
49,184
1,240
import copy import warnings warnings.filterwarnings('ignore') 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.typing import Adj, OptTensor, Size from torch_geometric.util...
893e127f94077bd5d09e940ee20d9f28a877cfbc81de9c0bd1090f16dd3244bb
Python
49,268
1,077
"""Useful tools for creating sequences with a desired property.""" from __future__ import annotations import ast import random from typing import TypeAlias, Literal from collections.abc import Callable import numpy as np import matplotlib.axes import matplotlib.colors import numpy.typing as npt from bpreveal import uti...
a169c910a800682eca26ef602eec360019a7b7cb7f28bbaf6de116e05f36e069
Python
49,334
923
import os import sys import argparse from typing import Dict, Tuple import numpy as np import torch import torch.nn.functional as F from torch.utils.data import DataLoader, random_split import time import math import torch.distributed as dist from torch.nn.parallel import DistributedDataParallel as DDP from typing imp...
bf2d76ebe9a77d6bcde080ae4be6b554354dbb43dfc4577dc64563e0ba653c0c
Python
49,372
901
###主要功能:在已经获得的组内叠加平均数据的基础上进行时间窗叠加平均和组间叠加平均 ###首先在第29行设置需要保存结果的日期文件夹 ###时间窗叠加平均:1)先选择视觉刺激或电流刺激 ### 2)在visualresults或者/electricalresults中选择已经被组内叠加平平均的数据组 ### 3)按顺序依次处理完所有数据组 ###组间叠加平均:1)选择视觉刺激还是电流刺激(处理对象是已经进行过时间窗叠加的数据组) ### 2)选择起始数据和终止数据(就是确认哪些组是要进行叠加平均的) ###20210915 将组间叠加的数据添...
11289dc5abd214b794f46d9869dd540deb012550c2627bb7475e405f4a7f4406
Python
49,407
910
###主要功能:在已经获得的组内叠加平均数据的基础上进行时间窗叠加平均和组间叠加平均 ###首先在第29行设置需要保存结果的日期文件夹 ###时间窗叠加平均:1)先选择视觉刺激或电流刺激 ### 2)在visualresults或者/electricalresults中选择已经被组内叠加平平均的数据组 ### 3)按顺序依次处理完所有数据组 ###组间叠加平均:1)选择视觉刺激还是电流刺激(处理对象是已经进行过时间窗叠加的数据组) ### 2)选择起始数据和终止数据(就是确认哪些组是要进行叠加平均的) ###20210915 将组间叠加的数据添...
8998d346da85d4a7a06b7baae720b314d1961259120ae9b450e645e5f5ef99aa
Python
49,492
1,041
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors 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 cop...
9ec73220e7bcc227467dd7d5d8917026c87ef54d1717b5296f9b019dfe3149a7
Python
49,658
992
# ############################################################################## # GPLv3 LICENSE INFO # # # # Copyright (C) 2020 Mario S. Valdés-Tresanco and Mario E. Valdés-Tresanco ...
1467762da2db64d2707189aa81bf99ed22832ee73f39f6ba0e4f722353a3db3c
Python
49,742
1,372
#!/usr/bin/env python """ src/global_prototypes_splitfit.py --------------------------------- Train global prototypes on TRAIN segment embeddings, then assign VALID/TEST segments to nearest train prototype. Sweeps K over a list and produces publication-ready stats + plots. Expected directory structure: segments/<mod...
91aabb8ba7a6aa57a3cea85777c51f29d78db5d6b61ccac6badf1bd0e2a43a44
Python
49,817
1,329
"""Main module.""" from collections.abc import Callable, Iterable from typing import Literal import numpy as np import pyro import torch import torch.nn.functional as F from pyro.distributions import ( Categorical, Delta, Dirichlet, Exponential, Gamma, Independent, LogNormal, Multinomi...
48aa191c7cfd90cdd07d9ed027bf4197f647e6347188899448cd7a1e982416b2
Python
49,990
1,299
"""The linking block `evaluate` logs, and what keeps two authorities apart. An evaluation reports one linking score per outside authority — NCBI's taxids for the organisms, ENZYME's numbers for the enzymes, the collections' deposit numbers for the strains — and `score_linking` refuses to put two authorities in one rep...
6660f95cb1d6a3348fdec491767e386d83ad9643db5a1e347d95f1ea94834a04
Python
50,308
1,504
import os from unittest.mock import Mock, patch import pytest import statsmodels.stats.multitest as multitest from rnalysis.enrichment import * from rnalysis.enrichment import _fetch_sets from rnalysis.exceptions import InvalidTypeError from tests import __attr_ref__, __biotype_ref__, is_ensembl_available, is_uniprot...
8e7dd7eef2efc8479a15836dec00e7abad14aae2c198b1a7f47d11f1b21d0974
Python
50,337
1,220
import h5py import numpy as np import os import pandas as pd import pickle import scipy.io import skfda # NOTE: calculateMeanCoefficients was previously imported from BOTH auxFuncChPt # and sharedUtils (the second import silently overwriting the first, since # both modules define an identical, byte-for-byte-matching ...
e101e5b1ffad0e42893db1af62bfec109fd817968a67100645f71fcedb06e909
Python
50,602
1,007
import argparse import logging import os import pysam import medaka.common import medaka.export import medaka.features import medaka.labels import medaka.models import medaka.options import medaka.prediction import medaka.rle import medaka.smolecule import medaka.stitch import medaka.tandem.tandem import medaka.train...
8478cec48b78b025787eab286c5db57590024e2ba70025a7be03364e378d3c2c
Python
50,620
1,084
import torch import torch.nn as nn import torch.nn.functional as F from dropblock import DropBlock2D, LinearScheduler from modelR.layers.convolutions import Convolutional, Deformable_Convolutional from modelR.layers.shuffle_blocks import Shuffle_new, Shuffle_Cond_RFA, Shuffle_new_s import config.cfg_lodet as cfg ...
9d43a0dd3a832d6d92166741051cbc64bf0bce3bbd3f68eb43fb7d0478acb8c8
Python
50,624
1,282
from __future__ import annotations import logging import warnings from collections.abc import Iterable as IterableClass from functools import partial from typing import TYPE_CHECKING import numpy as np import pandas as pd import torch from mudata import MuData from scipy.sparse import csr_matrix, vstack from torch.di...
fd5de0c7a1feb49c98f241c71f2dc7d4db6db97e5434834718e5ef688ceede5e
Python
50,860
1,935
from __future__ import annotations import json import logging import os import re import sys import tempfile import uuid from hashlib import sha256 from pathlib import Path from typing import TYPE_CHECKING from typing import Any from typing import Literal import pytest from packaging.utils import canonicalize_name ...
f75d0712e3b13bebd8daa0a15e4eb32c9e3034a933f4fcccf65b1e999a7ae066
Python
51,024
1,387
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
fb5e2c23a8f6602e782a300c1a45f7415ec0f53933c4b6e33aec37670eb4df71
Python
51,111
1,077
import os import numpy as np import matplotlib.pyplot as plt """ requires the data structure to be raw data = /derivatives/sub01/ses01/eeg/preprocessed/pat1_preprocessed.edf spindle data frame = /derivatives/Group/spindles/SP_events.csv SO data frame = derivatives/Group/slow_waves/SO_events.csv """ def epoc...
984c87bda0dc348ac907b6ce8a2316f90eb3923d891cadf3f75543a5f0504650
Python
51,214
800
#!/usr/bin/env python import argparse import collections import json import numpy as np import os import pandas as pd import random import scipy.io as sio import sys import intervaltree import scipy from datetime import datetime from pathlib import Path from scipy.sparse import csr_matrix, coo_matrix import common.u...
7f77286d510ac4d7e7f34cdd16f9450949496e76e03763c647a243c55d7b4741
Python
51,334
1,190
# -*- coding: utf-8 -*- """ Standalone benchmark utilities for reviewer-oriented CNN reconstruction checks. This script intentionally avoids importing the Streamlit app. The numerical formulas mirror the physics helpers in app.py, while the command-line defaults point at the existing processed output folder. """ from...
d3fc436d5f5649026874e3e0a1d01876843c5c08f36e9ece260635ef760bf10a
Python
51,432
1,437
""" phreeqc_simulator.py ==================================== 致密砂岩多组分气体溶解度模拟器 — Lattice Boltzmann 前处理工具 基于 PHREEQC + phreeqpy 实现鄂尔多斯盆地深层水环境下的气体溶解度计算 作者: Claude AI 功能: 1. 单点计算器 (T/P 单次查询) 2. 2D 溶解度-温度多压交会图 3. 3D T-P-Solubility 互动相图 (Plotly) """ import os import sys import gc import time import warnings import su...
d7bb24331de809353726c9e6a6fe594bec3ad1b2aadce7107f0059794fee9790
Python
51,493
1,499
# 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. import math from dataclasses import dataclass, field from typing import List, Tuple import numpy as np import torch import torch.nn as nn imp...
9a19529f874b82ab098db21898bfddfd2d5fde936b286dcbd373383de4b39f4a
Python
51,549
1,324
"""Schemes to encode and decode truth labels and network outputs.""" import abc import collections from copy import copy import functools import importlib import itertools from operator import attrgetter import intervaltree import numpy as np import pysam import libmedaka import medaka.common import medaka.rle import...
4a3c4fbb4d60ae023dcf7c0d97ef7af943c8c4d14b379178481955f240fb4bf1
Python
51,688
1,231
import itertools import unittest import numpy as np import numpy.testing as np_test from skbase.utils.dependencies import _check_soft_dependencies from pgmpy import config from pgmpy.example_models import load_model from pgmpy.factors import factor_product from pgmpy.factors.discrete import DiscreteFactor, TabularCPD...
fe39e7e47256d270f5d00319c8ffba3fb037e9440e7aa55eea2a541da9db418e
Python
51,726
1,268
""" Phage competition sequencing analysis. Stages: 1. QC + Alignment: fastp filtering -> minimap2 alignment (primary only) 2. SNV-based Read Assignment: score reads at variable positions, windowed chimera detection 3. Fold Change Calculations: cumulative log2 proportion FC, signed AUC, T0->Tfinal comparison 4....
7fc08d392b886b81928d180a12faff62cdb51f737cf45955224b6b99c7f50b1e
Python
51,869
1,240
#!/usr/bin/env python3 """ NEMO Benchmark Evaluation Script for HIPPIE Pipeline This script runs NEMO (Neural Multi-modal Embedding) evaluation on C4 database H5 files using the same CV protocol as HIPPIE and PhysMAP for fair comparison. IMPORTANT: NEMO requires data in H5 format with: - Waveforms: (N, 90) interpolat...
f82a9a934f539c97d4ea30145e3a5b8c6cc8b6f1fee8d6c1b3150aee26cab57c
Python
52,041
1,344
import logging import os import sys import numpy as np import math import torch import torch.nn as nn import torch.nn.functional as F current_dir = os.path.dirname(os.path.abspath(__file__)) # 将当前目录添加到 Python 路径中 sys.path.append(current_dir) from ernie_rna_utils import multi_head_attention_forward from torch.autogr...
546906bbbddf377f301b7799596890e8064304a4cd18d428a810b0e68a76baa1
Python
52,153
1,053
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ============================================================================= Physarum polycephalum: History x Test-substance reanalysis at test phase 1 ============================================================================= DATA Boisseau, R. P., Vogel, D. & D...
65dceeeab7d63b0dd8b4b2575033a8546155b69aabdc0d37d7d35c526fde2d1e
Python
52,192
976
import os from pathlib import Path import joblib import numpy as np import pandas as pd from joblib import Parallel, delayed from sklearn.linear_model import LogisticRegression, LogisticRegressionCV from sklearn.model_selection import ShuffleSplit from sklearn.model_selection import StratifiedKFold from sklearn.pipeli...
6b3e130ed99b2813f882147e5fd2b03f9133bfa08635ed3929911960c9ec541a
Python
52,297
1,403
"""Reading and writing of Variant Call Format files.""" import collections import contextlib from copy import deepcopy import itertools import os from threading import Lock import intervaltree import numpy as np import parasail import pysam import libmedaka from medaka import __version__ as medaka_version import med...
c9c88819c7485e5619974f532a89e29a06d6f32092e408b6d6ed9b4d62f3b8ac
Python
52,627
1,252
import os import io import pkgutil import scanpy as sc import anndata as ad from anndata import AnnData from muon import MuData import numpy as np import pandas as pd import scipy from scipy.sparse import csr_matrix from scipy.sparse import issparse, csr from sklearn.preprocessing import MaxAbsScaler ...
58623f5d89d0c849ad8d67f08fe3ca3e682570cd97ec3a65e29558382ab77925
Python
52,691
1,333
import typing from collections import defaultdict from dataclasses import dataclass from itertools import chain, combinations import networkx as nx import numpy as np import pandas as pd from pgmpy import config from pgmpy.base import DAG from pgmpy.factors.discrete import TabularCPD from pgmpy.utils import compat_fn...
f71b73729ff9d0c46c6797930646e2f8a226eef27a59cd7792ed86b193bc6ea9
Python
52,866
1,119
from __future__ import print_function import json, time, os, sys, glob import shutil import numpy as np import torch from torch import optim from torch.utils.data import DataLoader from torch.utils.data.dataset import random_split, Subset import copy import torch.nn as nn import torch.nn.functional as F import random ...
2773a059fd59039a23e08c5e0a6f3385c2e69d5637133f3e95d2693a7b6e1493
Python
52,960
1,494
import argparse import dataclasses import functools import logging import os import re import subprocess import sys import threading import time from collections import OrderedDict, namedtuple from collections.abc import Callable from dataclasses import dataclass from functools import wraps from pathlib import Path fro...
e27afd49c0838731a65be316f0138696727bb6dec3b5b504ffbf3889c59e3f7f
Python
53,655
938
# -*- coding: utf-8 -*- """ Created on Tue May 20 16:30:53 2025 @author: HT_bo """ import numpy as np import scipy.io import scipy.signal from scipy.stats import zscore import pandas as pd import matplotlib.pyplot as plt # from open_ephys.analysis import Session # Bypassing for manual load import os ...
5f9011a17a79cae01ac7191fd9f1035d443e60298699d996682b3bf7ed6c3ca4
Python
53,732
947
# -*- coding: utf-8 -*- """ Created on Thu Mar 23 13:32:45 2023 @author: fbigand """ # -*- coding: utf-8 -*- """ Created on Wed Sep 14 17:15:46 2022 @author: fbigand """ #%% ############################################################## ############ IMPORT LIBRARIES AND SET PARAMETERS ############...
b2d8a1dff1c93c435a413a1e4707f9cc781f2858932424093164ba1033c0e0c0
Python
54,047
1,721
# -*- coding: utf-8 -*- # 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 require...
4674f22773d352c790411d507e61aa2aad858a575bc8001127aab7fc7c9d7188
Python
54,473
1,226
import itertools import os import warnings from glob import glob from typing import List, Union import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import ruptures as rpt import scikit_posthocs as skph import scipy import seaborn as sns import statsmodels.api as sm from matp...
db7e1340fcc91f4a6a8b7f48f5c7ba1e39368d2aef0b2b85f99093ce0a6ffa82
Python
54,563
1,425
#!/usr/bin/env python3 import os import unittest import networkx as nx import numpy as np import pandas as pd from skbase.utils.dependencies import _check_soft_dependencies import pgmpy.tests.help_functions as hf from pgmpy.base import DAG from pgmpy.ci_tests import Pearsonr from pgmpy.example_models import load_mod...
13631a9ddad1fb7c90451df1007f17f8808531b9240f2df73252a527c146df4b
Python
54,693
1,217
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors 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 cop...
3ddb60726f2743a05fa6e7e7303f370ead80aec7e168a1a9bf6057951ae84b65
Python
54,710
1,350
# analysis_kernels.py import torch import torch.nn.functional as F import numpy as np import math from pathlib import Path from typing import Dict, Tuple, Callable from scipy import stats import matplotlib.pyplot as plt import seaborn as sns from einops import rearrange #!/usr/bin/env python # %% from einops.layers.t...
ca92c329be679a77bb097f5b45ac47092d52bfdbe356a61c5768bb78d8e7a66b
Python
55,318
1,610
import pandas as pd import pdb # sys.path.append("../../corecode/") from build import * import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.stats import gaussian_kde import matplotlib.colors as colors import matplotlib.pyplot as plt plt.switch_backend('agg') from pathlib import Path from...
aade15b75c1cdc1c1f1addfb9a9e013ccb09e7e6975c42aff5cd9f8d921ee961
Python
55,387
1,335
""" This module contains all implementation of windows in UI. There are adjustment window, hardware window, control window, animal window, e-mail window, sensors window and analysis window. """ """ Copyright (c) 2019, 2022 [copyright holders here] This file is part of NoSeMaze. NoSeMaze is free software: you can red...
1dba47bb9033dc97561a74fbeaffba9a622fa2056375f46780e2b2420ff647bd
Python
55,505
1,011
"""LBM extraction-coefficient diagnostics for Scientific Reports revision. The script is intentionally standalone. It does not modify the Streamlit LBM applications. If exported final 2D fields are unavailable, it constructs lattice-normalized post-processing proxy fields from phi_total.npy plus the multi-slice summar...
a35c3fa65e90f5247fafb3653d72f95784c853549191f41b32ce49d2583c9b3d
Python
55,549
1,284
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors 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 cop...
7e4365f195c681923ce2ef420db365469e545566d4a89a04e5e4e3842d9c4ba6
Python
55,750
918
import inspect import multiprocessing import os import traceback from copy import deepcopy from time import sleep from typing import Tuple, Union, List, Optional import numpy as np import torch from acvl_utils.cropping_and_padding.padding import pad_nd_image from batchgenerators.dataloading.multi_threaded_augmenter im...
ab0e3572b821331ded32dbe581f91e5d95e9852c4f2dd0a59fcbb8c0fa3c247b
Python
55,874
1,584
# src/segment_characterize.py # ----------------------------------------------------------------------------- # Purpose # Characterize discovered units (segments/clusters) from residue assignments. # Reports: # - size + contiguity + fragmentation metrics # - label usage inequality (gini/entropy) # - OPT...
4aaa9b736871e18597ebeb157c19d5cfa098a6f5821b07b8e9ffa14495b38ca8
Python
56,355
1,162
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors 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 cop...
af0c38e169f5c819f60e04a50d92413de0eb091f3b39e7e6b4b6a7debc9c9486
Python
56,356
1,163
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors 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 cop...
826fa39b4aa6b583637599ed7bacee481e8fc78a2991d006c72b93936286f71e
Python
56,408
1,409
# Copyright (c) 2022, Tri Dao. # Inspired by / adapted from https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import math import re from collections import OrderedDict from copy import deepcopy ...
4a633c1d759239fce4de9ebe069a1835bb26124e6eaeefd2653b1d33ae9e6659
Python
56,432
1,214
import torch import torch.nn as nn import torch.nn.functional as F from dropblock import DropBlock2D, LinearScheduler from modelR.layers.convolutions import Convolutional, Deformable_Convolutional from modelR.layers.shuffle_blocks import Shuffle_new, Shuffle_Cond_RFA, Shuffle_new_s import config.cfg_lodet as cfg ...
122cae1876a73ebddc4022ddff87e893967a94426ecef3489c61b90f0e6c0d52
Python
56,500
1,277
# # Copyright 2017-2023 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with # Sandia Corporation, the U.S. Government retains certain rights in this software. # # See LICENSE for full license details # import time import numpy as np import pickle from .activate import Activate, RECTLINEAR,...
a0acebbebac7c7a01691e3c3fbbfc7f68077d10a0b85caacf1ec7a1d208e5589
Python
56,626
1,775
import simplejson as json from ..globals import BMapType from .global_options import TooltipOpts from .series_options import ( BasicOpts, ItemStyleOpts, JSFunc, LabelOpts, LineStyleOpts, Numeric, Optional, Sequence, TextStyleOpts, Union, AreaStyleOpts, ) # Chart Options cl...
d87b51680f86fa04e85c395582f252020bc8e6eba71491d7f05d845c6c5d8b81
Python
57,020
981
import click import os import subprocess import re import functools from trogon import tui from .source.utils.decorators import debug_handler, timing_handler timeit = False LOG_FILE = "runs.log" STATUS_FILE = "runs.status" @tui() @click.group() def cli(): pass @cli.command() def version(): """Prints version.""" c...
78017ffe14d03b76ec740651c44420347b7180396d10efb347776d21d4049c2c
Python
57,156
871
#!/usr/bin/env python import argparse import collections import json import numpy as np import os import pandas as pd import scipy.optimize import scipy.io as sio import time import sys import random from datetime import datetime from pathlib import Path from scipy.sparse import csr_matrix, coo_matrix from common.l...
5d087541548b0e05e1f670b6df4bf2afc76b36732e4f777718adb8a90de614af
Python
57,358
1,401
"""Evolutionary Bayesian Optimization and MCMC explorers. Ported from D_Peptide_BO/bo_evolutionary.py and mcmc_evolutionary.py, with fasthit dependencies removed. Uses local Encoder/Model/Landscape interfaces. """ import json import math import time from datetime import datetime from typing import Optional import num...
b839f11e5d4747701637e986ca1cf67f6075a0bf48ee605853c7c6ae2c6ab657
Python
57,448
1,996
from __future__ import annotations import sys from pathlib import Path from typing import TYPE_CHECKING import pytest import tomlkit from packaging.utils import canonicalize_name from poetry.core.constraints.version import Version from poetry.core.packages.package import Package from poetry.console.commands.instal...
21dae85b09a5ac06f4642ee29fe75227de661a9a44dca4344ca83971105a52a6
Python
57,813
1,426
import math import os from typing import Optional, Any, Literal import logging from dataclasses import dataclass import torch from torch import nn import torch.nn.functional as F from einops import rearrange from .import_utils import is_flash_attn_2_available if is_flash_attn_2_available(): from flash_attn import ...
be441719d43c249e2588a9b2ba67a14f8721aec0845a4ac566a32690e15bb50d
Python
58,130
1,401
""" Transductive Training Script for HIPPIE - WAVEFORM ONLY This script trains HIPPIE using only one modality: - Waveform (wave): Spike waveforms The ISI Distribution and ACG (autocorrelogram) modalities are excluded from this version. Usage: python train_multimodal_transductive_waveonly.py \\ --config...
3dd9e3290aed70f08f7a00ae15ed2e82a4ec2e187466a51b218872063748b12f
Python
58,450
1,498
"""Creation of neural network input features.""" import abc from collections import defaultdict import concurrent.futures from contextlib import contextmanager import importlib import itertools import os import queue import time from timeit import default_timer as now import numpy as np from numpy.lib import recfuncti...
3f0248e1b4bb909fa833928f251607ababe268694b84753c53edbc654dd4d282
Python
58,599
1,355
#!/usr/bin/env python3 """ ═══════════════════════════════════════════════════════════════════════════════ MS2 EIF2S1 DEFINITIVE PIPELINE — Google Colab (12GB RAM) — FIXED v2 ═══════════════════════════════════════════════════════════════════════════════ MANUSCRIPT: "EIF2S1 Co-expression Network Reveals a Closed-Loop...
991807744484b4dea6be426bf01dba131b27fa6944189b035926f0d10d9a767d
Python
59,003
1,288
"""A bunch of helper functions for making plots.""" import math from typing import Literal import pysam import pyBigWig import pybedtools import numpy as np import matplotlib.pyplot as plt import matplotlib.figure from matplotlib.transforms import Bbox, Affine2D from matplotlib.font_manager import FontProperties from ...
157f1f1050b634afcaff0ccf38421bf9e1c16e578c3fb4b7313f3ac5caac7b5a
Python
59,107
1,196
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors 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 Lice...
c4575352fe6ff348eb626e9dc9332751d42f00e3d9f3ed6a66509ee32ff1faca
Python
59,108
1,197
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors 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 Lice...
9ee9736a8262106ea9727b8c5d49205b57ff673af07261c8b562a7eabcebb4ac
Python
59,212
1,704
#!/usr/bin/env python2 # Daniel Kim, CS Foo # 2016-03-28 # Script to run ataqc, all parts import matplotlib matplotlib.use('Agg') import os import sys import pysam import pybedtools import metaseq import subprocess import multiprocessing import timeit import datetime import gzip import numpy as np import pandas as p...
a9a8703b4fb32b19a168bc6b3ac34731ab4db096540ddb9c31449d63d33f001d
Python
59,242
1,378
#!/usr/bin/env python3 """ ═══════════════════════════════════════════════════════════════════════════════ MS2 EIF2S1 DEFINITIVE PIPELINE — Google Colab (12GB RAM) ═══════════════════════════════════════════════════════════════════════════════ MANUSCRIPT: "EIF2S1 Co-expression Network Reveals a Closed-Loop Translation...
5d8c369cf64ba50d071372dd5f491acbbf2856a1b63595bd4cecfc6fd605027f
Python
59,697
1,691
""" Random bar width stimulus analysis pipeline. Analyzes fish behavioral responses to random-width bar stimuli by constructing spatiotemporal image representations of the stimulus in the fish's reference frame, then filtering for periods of active following behavior. Produces per-trial and per-experiment summary plo...
591b07968a288c65fb3ffd1219eeb35c7472ae246994e22c4f5c0f27695191b3
Python
59,711
1,381
from npyx.c4.dataset_init import ( N_CHANNELS, WAVEFORM_SAMPLES, extract_and_check, get_paths_from_dir, prepare_classification_dataset, ) from torch.utils.data import Dataset import npyx import torch import numpy as np import os import pandas as pd import math from math import pi from celltype_ibl.p...
a1b21e7ebefc584b4186156201d5149ad036902e947e6ef4c5815ce5145d0afd
Python
59,902
1,996
# @license # Copyright 2017 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
a21e2653f5d55a4543b33c426823f0e846173ef6785389dca5aaaec7ac5012ad
Python
59,978
1,735
#!/usr/bin/env python2 # Daniel Kim, CS Foo # 2016-03-28 # Script to run ataqc, all parts import matplotlib matplotlib.use('Agg') import os import sys import pysam import pybedtools import metaseq import subprocess import multiprocessing import timeit import datetime import gzip import numpy as np import pandas as p...
91391492ae861f686961f838d0c62e9d80de16671ae0233b6dd8186652b35c94
Python
60,004
1,314
import sys import os import time code_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'hippie')) sys.path.append(code_dir) # Now import directly from the modules (no 'code.' prefix) from dataloading import MultiModalEphysDataset, none_safe_collate from multimodal_model import MultiModalCVAE, Multi...
93eb26c3ad745fa595769618a388ff43ed03a39f28d1ab392615727e680ba806
Python
60,102
1,564
""" utils.py — Drosophila Body Orientation Predictor Utilities Consolidated utility module for the full prediction pipeline: - Data loading and merging (HDF5 → CSV) - Feature augmentation (groundspeed, airspeed, thrust, etc.) - Heading correction (naive unwrap and convex-optimization variants) - Trajectory fil...
5bd41a023831d1d3d0d9773358674a4b5cb16a29a9fda31aaacfd6b342b7606a
Python
60,123
1,521
from __future__ import annotations import os from typing import TYPE_CHECKING import numpy as np import torch from lightning.pytorch import LightningDataModule from scipy.sparse import issparse from sklearn.preprocessing import LabelEncoder from torch.utils.data import DataLoader import scvi from scvi.model._utils i...
e2abd39014e40519a512d91fa41c8025347e3e69959d03b14a8ef6836010b0e4
Python
60,194
908
"""Build the revised MDPI manuscript for foods-4481855 from the submitted .docx. Works on the original submission in place-preserving fashion: every edit is applied through python-docx against the real MDPI styles, so the template formatting survives. All new or changed text is coloured dark red so editors and reviewe...
153135a01b684403c340efa445938ee03355e76919059e4729c48d04a49c1e6a
Python
60,209
1,471
#!/usr/bin/env python3 """ Evaluate distortion correction methods on the synthetic test set. This script compares: 1. FSL FUGUE simulation (single-direction unwarp using known VDM) 2. FSL TOPUP simulation (bidirectional field estimation and correction) 3. Our diffusion model (CNN + Diffusion refinement) Metrics compu...
52511e66ae824a81a4688bb4b297aa95e1be5cea67099bd1ad3032aab455cf56
Python
61,065
1,465
""" Transductive Training Script for HIPPIE - WAVEFORM + ISI ONLY This script trains HIPPIE using only two modalities: - Waveform (wave): Spike waveforms - ISI Distribution (isi): Interspike interval histograms The ACG (autocorrelogram) modality is excluded from this version. Usage: python train_multimodal_t...
bd4b316e0d794d8fd5ac37cfb8420510a67e7bc78719877ac6fc366ea16aada1
Python
61,071
1,175
""" This module provides a means for users to take advantage of gmx_MMPBSA's parsing ability. It exposes the free energy data (optionally to numpy arrays) so that users can write a simple script to carry out custom data analyses, leveraging the full power of Python's extensions, if they want (e.g., numpy, scipy, etc.) ...
3f7c0d8312ab9c5caf71cf9764f7396f1464b18625ba5622307234b3481d9e2b
Python
61,077
1,678
"""Pure unit tests for `d3text.models.base`. The shared `Model` base class and the module-level helpers — pooling, telemetry, metrics, embeddings-store plumbing. Everything runs on CPU with tiny synthetic tensors through the `stub` fixture, which supplies only the attributes each method reads. """ import logging impo...
4dbf53582bc58a1d50170d8b1e709752ef42d40a21d018cfdb27237a16c79558
Python
61,161
1,391
""" This module contains calculation classes that call the necessary programs for running MM/PBSA calculations. Methods: run_calculations(FILES, INPUT, rank) : Determines which calculations need to be run, then sets up the calculations and runs them Classes: Calculation: Base calculation class Energy...
f1142e44e2c88233d10a1bf66bbe97a20e9e17f337f9bfea81f4f0b6e76cd1dc
Python
61,227
1,396
import os import json import warnings from concurrent.futures import BrokenExecutor from pathlib import Path from pickle import PicklingError from joblib import Parallel, delayed import numpy as np import matplotlib.pyplot as plt try: from mtscomp import Reader MTSCOMP_AVAILABLE = True except ImportError: ...
7b08ca5b95670e255883fe69a36103beb6b131107cfd64ae2f232a57a9830ce2
Python
61,238
1,608
# Authors: Christian O'Reilly <christian.oreilly@sc.edu> # Scott Huberty <seh33@uw.edu> # James Desjardins <jim.a.desjardins@gmail.com> # Tyler Collins <collins.tyler.k@gmail.com> # # License: MIT """Classes and Functions for running the Lossless Pipeline.""" from copy import deepcopy from ...
02720756f05b0245fd9c9962419e868b4d7a5c11d9728a9908d921c250186dc1
Python
61,857
1,536
import shutil import time import datetime import inspect import yaml import numpy as np import pandas as pd from scipy import optimize from sklearn.cluster import MiniBatchKMeans from sklearn.decomposition import PCA, FastICA from sklearn.metrics import mutual_info_score, normalized_mutual_info_score, adjusted_rand_sco...