sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c16b2dee725d96fa8ef684b36190fe57bd3cbf83ac1c68cbde3664c055a97ed8
Python
10,241
278
#!/usr/bin/env python3 """Calculates the Frechet Inception Distance (FID) to evalulate GANs The FID metric calculates the distance between two distributions of images. Typically, we have summary statistics (mean & covariance matrix) of one of these distributions, while the 2nd distribution is given by a GAN. When run...
7aadbce39cfce90fe05ccd64875728c522f3081b661056e3dfbaaf13755fe5cd
Python
10,244
245
''' Models to create diameters of synthesized cells ''' import numpy as np from tns.morphio_utils import STR_TO_TYPES, TYPE_TO_STR from tns.morphio_utils import section_filter, root_section_filter def sample(data): """Returns a value according to the input data""" return np.random.choice(data) def section_l...
56ac8c2fcc955f311eba2a28667069f74ba882d112ee841c21918fc818689f1b
Python
10,245
229
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
c4422d0ba40d209a085925c7e99b7cd8da6185e6bee660378c81937ddfc30013
Python
10,249
256
import logging import shlex from pathlib import Path import pytest from pyrosm import OSM, enable_logging, get_data from pyrosm import _log from pyrosm.utils import progress @pytest.fixture def pyrosm_logger(): """The ``pyrosm`` logger, with its handlers, level and propagation, and the progress setting of e...
921dd74df42377b9c07045c8e3e0de856b97d77226551c6182c8e3f0c6b6a0be
Python
10,252
228
#!/usr/bin/env python3 # Tractor script to extract out ancestry segments from each reference population from admixed samples. # The original ExtractTracts.py has been modified to work with FLARE output wherein ancestry calls # are saved within the VCF file itself, and no MSP file is generated. # Several changes were m...
42f19706732ceead2632af0369df36dbf3afd747511a4bd2e17c26ab12d37ed9
Python
10,254
296
from abc import ABC, abstractmethod import math import geopandas as gpd from shapely.geometry import MultiPolygon, Polygon, Point from shapely.ops import cascaded_union from ..utils import constants, utils import numpy as np import h3.api.numpy_int as h3 import warnings class TessellationTilers: def __init__(sel...
fc327ea847eda210e4cae88a7a9c4b701f9fbfb6a57739bf45344ff13c15bf8b
Python
10,254
310
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from opt_einsum import contract as einsum import copy import dgl from util import base_indices, RTs_by_torsion, xyzs_in_base_frame, rigid_from_3_points def init_lecun_normal(module, scale=1.0): def truncated_normal(uniform, mu=0....
0232829430f1d5b033426cb37bb517214b700256a9be59ad1f6300ea47a90b5e
Python
10,255
354
from tempfile import NamedTemporaryFile from permacache import permacache, stable_hash import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from PIL import Image from modular_splicing.motif_names import get_motif_names from modular_splicing.utils.construct import construct from modular_splicin...
93ad150e6bc3d5b9bc9edaf0b1c4e183560368d4cb3a4e13b27ed432ad77fb91
Python
10,256
314
"""Aproximate joint diagonalization algorithms.""" import numpy as np from .utils import check_weights def _check_init_diag(init, n): if init.shape != (n, n): raise ValueError( 'Initial diagonalizer shape must be %d x % d (Got %s).' % (n, n, init.shape,)) return init def rjd...
114a1dcae637190992f755b35e7e1f3ad0d998c38acea5a28ec7d81155a0c77f
Python
10,257
250
#!/usr/bin/env python3 """ File: correlate_align_metrics_with_genes.py Created: 2021/11/09 Last Changed: Author: M.Vochteloo Copyright (C) 2020 University Medical Center Groningen. A copy of the BSD 3-Clause "New" or "Revised" License can be found in the LICENSE file in the root directory of this ...
6ec20fc9e0a7d091d83861d065e09be45c28c8cc54b79afabda70334b2572059
Python
10,257
274
"""Regression tests for the capture-cache path (r19c hardening). Covers a previously-uncovered gap: nothing combined ``cache=True`` with an activation/grad transform (F2) or exercised a capability-option cache collision (F3), and a pre-forward setup failure leaked capture-global state (SOL-A5-002). The ``trace()`` doc...
676e8bf2ce3a75d10aca8e1c8ec8ffe1e9813b1fae6293edaeb6754869b3ba6d
Python
10,258
262
"""Event dispatcher sends events.""" import os import threading import time from collections import defaultdict, deque from kombu import Producer from celery.app import app_or_default from celery.utils.nodenames import anon_nodename from celery.utils.time import utcoffset from .event import Event, get_exchange, gro...
43521e6c58413f6545a91109ef47f17b5938e7835a4d3565295c867bca2bdb0c
Python
10,260
277
"""B1-18: the H2 hot-AST release is a TOTAL postprocess epilogue. ``ast_branches`` keeps a process-wide, 256-file-bounded ``_file_cache`` split into a cold tier (spans, projected calls, retained source) and a hot tier (``_HeavyAst``: parsed module AST, parent map, scope nodes) for whole source files -- including torch...
fb7695191ab70395c567882a3fe44a3ceeab9fba83268618da6d168a3119c03a
Python
10,260
273
"""Preflight fetcher for the real-model artifact cache (testing MEMO 4.3, A2). No pytest body reaches the network, ever. This script runs BEFORE pytest: it fetches exactly the registry blobs for the requested venue/rows into an isolated cache, verifies size and SHA-256 for every file (including every cache-restored fi...
6aa38b0bb7890d801336fbeef28f44cdbbc4d7d60b6f81155036368c93469676
Python
10,261
307
import numpy as np import torch from chemical import INIT_CRDS PARAMS = { "DMIN" : 2.0, "DMAX" : 20.0, "DBINS" : 36, "ABINS" : 36, } # ============================================================ def get_pair_dist(a, b): """calculate pair distances between two sets of points Par...
50f930b1944994db83d52a2450c237f1696bb3af53d4d4c07193f97861ec6426
Python
10,262
103
"""4. Computing FLOPS, latency and fps of a model ======================================================= It is important to have an idea of how to measure a video model's speed, so that you can choose the model that suits best for your use case. In this tutorial, we provide two simple scripts to help you compute (1) ...
34cbdeb3dfef9a2ed13d55e94f700ce3c53bf513c2dbe2f7030a1635607d9ebc
Python
10,264
301
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Dimension(_BaseTraceHierarchyType): _parent_path_str = "parcats" _path_st...
ed53d997401193cab27e598b29783ab374a30fdc878af6cadc7123fd973c0ae1
Python
10,264
244
"""MNASNet model definition, adapted from https://pytorch.org/docs/stable/torchvision/models.html, to take single channel instead of 3-channel images. """ import warnings import torch import torch.nn as nn _BN_MOMENTUM = 1 - 0.9997 class _InvertedResidual(nn.Module): def __init__(self, in_ch, out_ch, kernel_...
fd30a658126e768ad44afb8a8c95ec583371e9f438f0bbf9c3b466c935a48cd6
Python
10,265
198
import os import argparse import mxnet as mx class MonodepthOptions: def __init__(self): self.parser = argparse.ArgumentParser(description="Monodepthv2 options") # PATHS self.parser.add_argument("--data_path", type=str, hel...
9b74570191ffcf9b4db0e6a2f9e774aad350abbb16aa9873f234e0f4133ace9a
Python
10,266
269
import argparse from .tools import folder import os if int(os.environ.get("NOTEBOOK_MODE", 0)) == 1: from tqdm import tqdm_notebook as tqdm else: from tqdm import tqdm as tqdm import shutil import time import numpy as np import torch as ch import torch.utils.data from torch.utils.data import DataLoader from ...
d73c37a0daa69f3b455dfba6a4d9e88711ca8a622e894e59e0f9b19f006eda1e
Python
10,266
290
#!/usr/bin/env python3 """ File: visualise_cmv_violinplot.py Created: 2020/11/24 Last Changed: Author: M.Vochteloo Copyright (C) 2020 University Medical Center Groningen. A copy of the BSD 3-Clause "New" or "Revised" License can be found in the LICENSE file in the root directory of this source tre...
9fbe3432c474706df812ebc658ccdd565d2e200dd4218c75ffde4552c4e4b4dd
Python
10,272
306
from __future__ import absolute_import import json import logging from pip._vendor import six from pip._vendor.six.moves import zip_longest from pip._internal.cli import cmdoptions from pip._internal.cli.base_command import Command from pip._internal.exceptions import CommandError from pip._internal.index import Pac...
2d65da9f1c1b98c21fbe499125e39265d6b85d1fc9f49871ce1856ea0c9e552b
Python
10,275
285
from pyrosm.graph_export import _create_igraph, _create_nxgraph, _create_pdgraph, generate_directed_edges from pyrosm.graph_connectivity import get_connected_edges from pyrosm.utils import validate_edge_gdf, validate_node_gdf from pyrosm.config import Conf def get_directed_edges(nodes, edges, ...
5d7d2564a3c43be24b7de06b592e1be68853facfd347a4cb5f8e7894e6e7ade0
Python
10,278
256
"""One-backward reads on real checkpoints (F04 gate rows RG06/RG11-flavored). Real ``openai-community/gpt2`` (the literature's model, RG06's artifact) and torchvision PRETRAINED ResNet-18 (RG11's artifact): the substrate census, target-kind-keyed reachability, split-slot discipline on the fused QKV, the mid-stack line...
d41f7f265acc040e27e5a403b82a57e9beea3849e16a6f34170196cc0357ea66
Python
10,278
311
"""L5 M4 pins: checked suppression of redundant constructor-arg rows (DEFAULT-ON). Covers the design-memo sec-5 contract: the closed candidate table (both directions per row — suppresses on PROVEN equality, survives on mismatch, including a deliberately-lying func_config), the never-candidate set, the input-side singl...
52d20a8c5babfd930e70cc3920fbc4d34a8b94d50a67e455f7f3a683ede84362
Python
10,281
273
"""Variational inference implementation of a negative binomial mixture model using Pyro. """ from typing import Dict, Optional, Tuple, Union import numpy as np import pyro import pyro.distributions as dist import torch import torch.nn.functional as F from pyro import poutine from pyro.infer import SVI, TraceEnum_ELBO ...
bb8691ac486518dca045dbaa1f48fe0f3f3fdfc58985428203fbad88b1ef8d77
Python
10,281
228
__author__ = 'Aaron Gudmundson' __email__ = 'agudmund@uci.edu' __date__ = '2020/12/05' __version__ = '10.0.0' __status__ = 'beta' from scipy.optimize import curve_fit, minimize # Optimization import matplotlib.patches as mpatches ...
e29e10addb9f7a078557bf3b12157bf1f0e80193811990dc0a17041df6bd7219
Python
10,283
271
import os import pytest import numpy as np from mirp import extract_images from mirp.settings.import_config_parameters import import_configuration_settings from mirp._masks.base_mask import BaseMask # Find path to the test directory. This is because we need to read datafiles stored in subdirectories. CURRENT_DIR = os...
7adfb4a2e68d2d3c6c84e0ee78b44eb3c9ab7d65d73ce7e6b7e43b3c56ed59ad
Python
10,284
321
import os import numpy as np import torch import torch.distributed from torch.distributed import tensor as torch_distributed_tensor from keras.src.backend.torch.ops import core as torch_core from keras.src.backend.torch.ops.core import _parse_device_input from keras.src.backend.torch.ops.core import convert_to_tensor...
24d59d5c9f66781021def7b3a331c6e619c50f00e1b6f26925db6653ad6f1a1c
Python
10,285
262
"""Functions for building the input features for the HelixFold model.""" import json import pickle import os from typing import Any, Mapping, MutableMapping, Optional, Sequence, Union from absl import logging from helixfold.common import residue_constants from helixfold.data import msa_identifiers from helixfold.data i...
94800d26870ac04f179cd62900ca291f30a9cc2be4d5d642cee819796997f756
Python
10,288
303
#!/usr/bin/env python3 """Diagnostic N — Tier 3.2: nonlinear classifiers. Tests whether the 0.751 LOCO ceiling reflects a classifier-shape limit or a data-scale limit. All on HC-anchored per-cohort normalization. Classifiers: - LDA baseline (our current best) - QDA (class-specific covariance) - Logistic Regress...
7200a1c3b61f0e53ddbb5956a70698b987b489bd83dd459e0ac2687d5d6b6add
Python
10,289
214
from __future__ import division from __future__ import print_function import argparse import logging logging.basicConfig(level=logging.INFO) import time import sys import numpy as np import mxnet as mx from tqdm import tqdm from mxnet import nd from mxnet import gluon import gluoncv as gcv gcv.utils.check_version('0.6...
2ab7d8936d7c2c9fa5a0a2737dc5803e706747596ddb44ed61eebb3e683bfcff
Python
10,290
233
import argparse import logging import os import sys from jbrowse2 import JbrowseConnector as jbC logging.basicConfig(level=logging.DEBUG) log = logging.getLogger("jbrowse") if __name__ == "__main__": parser = argparse.ArgumentParser(description="", epilog="") parser.add_argument("--sessName", help="Session ...
ee30a6957e0b0f24873bd2efc10a45b0e3cccacf4cbd2f63e12434f0a04f1dd5
Python
10,290
238
"""Written by @Jinerhal, adapted by @Xiaojieqiu. """ import random from typing import Any, List, Optional, Tuple, Union import cv2 import numpy as np from anndata import AnnData from skimage import morphology from ..configuration import SKM from ..logging import logger_manager as lm @SKM.check_adata_is_type(SKM.AD...
9d152b94777aaa4f63015dd24628d7acd51298fcba4f22069ac5fd06ca27a1b4
Python
10,293
267
"""Dead-model persistent-buffer universe for NON-TENSOR-STATE models (r77 F2). Round-76 (free-roam) found the r75 F2 gc-independent-save closure one model class short: ``snapshot_capture_state`` deliberately returns ``None`` when ANY ``state_dict()`` value is non-tensor (``get_extra_state()``, packed/quantized entries...
cdc093a5daf24c323e9138cd982262b209fb1f7fefec60ad3590814e8eeba15e
Python
10,294
328
"""Optimization for rotations on Grassmann manifold""" import warnings import numpy as np from ..geometry.base import invsqrtm, logm, sqrtm from ..geometry.distance import distance from ..utils._check import check_weights def _project(X, U): """Projection. Project U on the tangent space of orthogonal matr...
4793a4e9614c467bcacd5606f904ff293be487ded6e6868797aa975f1e412777
Python
10,296
279
import os import nitorch as ni from nitorch.mesh import mbf import glob import torch import json import os root = '.' stain = 'calb' odir = root + f'/warp2surf/{stain}' os.makedirs(odir, exist_ok=True) mri = root + '/mri/mri.mgz' mri_samseg_600 = root + '/mri/samseg/mri.600.mgz' lsfm_stain = root + f'/lsfm/init_oct/{...
3047ec7be2aaf16793460c89f25da92767b3da15e15ca40a549a05a97c4c1b41
Python
10,297
297
"""Differential property tests: native R=2 Ragged vs awkward oracle. Each property test draws a random nested R=2 structure and checks that the native implementation agrees with an awkward-array oracle built from the same raw buffers. Empty groups (outer_counts == 0) and empty inner segments (inner_lens == 0) are exe...
e488c7b9db61a8dd533fa2c33ff789072fbe90a86a5202c48d4f04e1287ea7e0
Python
10,299
293
from contextlib import nullcontext as does_not_raise import numpy as np import pytest import pynapple as nap from .helper_tests import MockArray class TestTsArray: @pytest.mark.filterwarnings("ignore") @pytest.mark.parametrize( "time, expectation", [ (MockArray(np.array([1, 2, ...
f8d887b6bf7b731700674e17c84352cb7f06d51c0064c1ceb9bface6459bbf28
Python
10,299
267
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Multi-view test a video classification model.""" import os import pickle import numpy as np import slowfast.utils.checkpoint as cu import slowfast.utils.distributed as du import slowfast.utils.logging as logging import ...
9d63bc4602b4cb39b63de4701a00dd64fa3d2c102382c27375a2e828817a701a
Python
10,300
272
from . import InvertibleModule import warnings from copy import deepcopy import numpy as np import torch import torch.nn as nn import torch.nn.functional as f class InvAutoActTwoSided(InvertibleModule): '''A nonlinear invertible activation analogous to Leaky ReLU, with learned slopes. The slopes are le...
b518dcc47989dbf2c4341a9c4a99a218e1692f38094962e2c7ff215c149d45a7
Python
10,300
271
"""This module defines the job metrics collection framework for Galaxy jobs. The framework consists of two parts - the :class:`JobMetrics` class and individual :class:`JobInstrumenter` plugins. A :class:`JobMetrics` object reads any number of plugins from a configuration source such as an XML file, a YAML file, or a ...
bac4cd506bd246a59195eb65cbbb09d3d9b25d60c497e613339bd3a14e3b752c
Python
10,302
297
"""Tests for TorchLens private ``._tl`` metadata helpers.""" from __future__ import annotations import copy import pickle from dataclasses import replace from typing import Any import pytest import torch from torch import nn from torchlens.backends.torch._tl import ( DecorationTag, ModuleMeta, ParamMeta...
9b46e95c27d8f1975a25616c7f6b71759b0cb650dfd20c82f42110251547f53f
Python
10,304
278
#!/usr/bin/env python3 """ File: Correlate_correlations_with_smartseq.py Created: 2021/05/25 Last Changed: Author: M.Vochteloo Copyright (C) 2020 University Medical Center Groningen. A copy of the BSD 3-Clause "New" or "Revised" License can be found in the LICENSE file in the root directory of thi...
5466aef66fb73dd7312229457e8654f2fcd1e5fb116331b260fff29b3f600e06
Python
10,306
202
import random import os from re import I from agents.model_1d import * from envs.int_discrim import IntervalDiscrimination import numpy as np import torch import matplotlib.pyplot as plt from datetime import datetime import argparse from tqdm import tqdm import re import sys sys.path.insert(1,'/home/mila/l/lindongy/dee...
9cc1d9255433942b683565da9496eda44eaa0d062be6652c0a1cc9a9697dfb21
Python
10,306
339
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): _parent_path_str = "carpet" _path_str = "c...
070d599b68239bccf1730978f439fb8233fd0b956fae786c54b7f8d8290e53e6
Python
10,308
239
"""Lane W051-HONESTY: live ``run()`` output-contract honesty (AUD-HONESTY H1/H2/H3). The review-5.1 audit found that every tuple/dict/HF-container model settled ``unverifiable`` + poisoned on a DEFAULT-capture live ``run()`` with a remedy-less ``output_structure_mismatch`` (H2; closed for good by W051-CAPT2, which reg...
9c131452107026e2edc6eb6147022c4118dc7973f832e0724ee9c1e7ee20048b
Python
10,309
276
#!/usr/bin/env python import argparse import json from cp_common_functions import (get_json_value, get_pipeline_lines, get_total_number_of_modules, INDENTATION, update_module_count, ...
ccc5d8e1c974e673528921100112b51d7b6194bb93019d138e7d32af8e37af20
Python
10,310
301
import os from os import PathLike from typing import Dict, List, Type, Union, Literal, Optional import seqdata as sd import xarray as xr from ..models import SequenceModule from pytorch_lightning import LightningModule, Trainer, seed_everything from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_light...
7428cd0ac7280947685ec81c3795d250d1d1e227b18bc746f2e2b718d40e5062
Python
10,311
234
"""r7 R80 (fable b10 MED x2): freeze the sprint-token test-naming namespace. Two naming diseases grew unchecked through six rounds: 1. **rN-token filenames**: 141 test files carry a bare sprint-round token (``test_r55_*``, ``*_r10r60``), and 32 distinct tokens appear in MORE THAN ONE file under DIFFERENT number...
b518048171d33f80a08db7aa779f337186e47f0822b1db4a96ad3aec4ca61662
Python
10,312
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.title" _path...
75b8cfb79a6504bd8f37231d7d473352ceaf43e9c65be07a2725feb772a8c73e
Python
10,313
317
from pathlib import Path from typing import Any, Dict, List, Literal, Optional, Union, cast import joblib import numpy as np import polars as pl import pyBigWig import zarr from more_itertools import split_when from numcodecs import ( Blosc, Delta, VLenArray, VLenUTF8, blosc, # type: ignore ) from...
2322e1364675f6fae54005df5a79a99f8d9153bda87b5cd3870b4e8280322f5f
Python
10,315
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): _parent_path_str = "heatmap" _path_str...
92e407bfbcc9333ae4901456b9948d77831f7105cea4f0539f793a4d95eeb75f
Python
10,315
234
from . import InvertibleModule from typing import Union import numpy as np import torch import torch.nn as nn from torch.nn.functional import conv2d, conv_transpose2d from torch.cuda.amp import autocast class ActNorm(InvertibleModule): '''A technique to achieve a stable initlization. First introduced in Kin...
b17b00a2a10b978dde5f4b0470dbfba130c10d2d443630af1c84091881d84b8c
Python
10,320
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): _parent_path_str = "sankey" _path_str ...
1be480bf6b13adc2bf8f2261a882a04ccc1d6694d579625e41d286e8e239eabf
Python
10,321
256
#!/usr/bin/python3 # -*- coding: utf-8 -*- """Workflow for gridsearching parameters for training a graphical model on neuronal spiketrain data. """ import time import sys import os import logging import crf_util from workflow import Workflow class GridsearchTrial(Workflow): """Class to gridsearch parameters ...
5307e5c41a0593ca72edd7cf828836539d823075e6874af1652de9ed5d304929
Python
10,322
222
# 均匀采样效果较差 import json import numpy as np import os, sys from collections import Counter from sklearn import preprocessing from sklearn.metrics import f1_score from sklearn.metrics import confusion_matrix import torch import torch.nn as nn import torch.nn.utils.rnn as rnn_utils import torch.nn.functional as F from torc...
1e45eafdd80820270ad3f0566611edfabed6d1aa7428a90edec85579acc93ccb
Python
10,323
302
""" Process an input dataset into a format suitable for machine learning. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import gzip import pandas as pd import numpy as np import csv import numbers import tempfile from rdkit.Chem import rdmolf...
349f58e8a0e5f0458d87caa3593da0efce6d02e055a22466f51f39bc468f13c7
Python
10,325
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): _parent_path_str = "histogram" _path_s...
1de07f92f0f924b244f16fa0ba38ad70da9655c9f0b7844aff79eef3e046bbc7
Python
10,329
288
#!/usr/bin/env python3 """ File: compare_gene_expression_per_pic.py Created: 2022/05/03 Last Changed: Author: M.Vochteloo Copyright (C) 2020 University Medical Center Groningen. A copy of the BSD 3-Clause "New" or "Revised" License can be found in the LICENSE file in the root directory of this sou...
559ace1362fcea2f7abd5cdba49f038b2c9e84c0bbb8635bacb10506d59d7f81
Python
10,332
254
import os import numpy as np import pandas as pd from abc import ABC, abstractmethod from rdkit.Chem import Mol from typing import List, Sequence, Dict, Tuple from torch.utils.data import Subset from tqdm import tqdm from bioconfpred.data.split import DataSplit from bioconfpred.conf_ensemble import ConfEnsembleLibrary...
e484d71d34bf11716a2e5b1419289a359f306fc327a9e501f80802aa8da27244
Python
10,333
229
import os import torch from collections import OrderedDict from abc import ABC, abstractmethod from . import networks class BaseModel(ABC): """This class is an abstract base class (ABC) for models. To create a subclass, you need to implement the following five functions: -- <__init__>: ...
217ade9fbad2aed838150bfb05948e5ff83ebe9b0c354d31857dc938ba5f0293
Python
10,334
270
import sys import os import glob import numpy as np import nibabel as nib from sklearn.linear_model import LinearRegression import warnings warnings.simplefilter('ignore') subject = sys.argv[1] funcDir = sys.argv[2] labelDir = sys.argv[3] parcDir = sys.argv[4] # check if surface directory exist; exit if false if os....
3d754789f9543a5e41e94b8cd3c1117629ca54f0345e70ef07995d92aeab470c
Python
10,334
306
from argparse import ArgumentParser from copy import deepcopy from typing import Any, Union import torch from pytorch_lightning import LightningModule, Trainer, seed_everything from torch.nn import functional as F from torch.optim import Adam from pl_bolts.callbacks.byol_updates import BYOLMAWeightUpdate from pl_bolt...
6060c459156d564e7c6900bdfdecad383f7a88b03365c2862821532d7b2a26b8
Python
10,335
327
import math import jax import jax.numpy as jnp from keras.src.backend.common import standardize_dtype from keras.src.backend.jax.ops.core import convert_to_tensor from keras.src.utils.module_utils import scipy def segment_sum(data, segment_ids, num_segments=None, sorted=False): if num_segments is None: ...
e588ad8a05e3d66f323026f316d6fba842a890adf73beafd0fcd29749e471f44
Python
10,335
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): _parent_path_str = "histogram2d" _path...
651bef8cdbd1e242afa9d678d348c50e90617e8da1db96f00b69f7903685f569
Python
10,336
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tickfont(_BaseTraceHierarchyType): _parent_path_str = "parcats" _path_str...
053fe5ed677121312bcb62b653beafccc4c95898cb0d05eb594463bb422d630f
Python
10,337
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.slider" _pat...
9b54572d2bf2d997ffe3e9c808ff471c75cc783988f25002ff7a5e02e3a4573a
Python
10,338
292
"""Round-3 security regression: torch-namespace RCE / arbitrary-file-write. A crafted ``.tlspec`` bundle op keyed ``("torch", "load")`` or ``("torch", "save")`` historically resolved ``torch.load`` / ``torch.save`` through the untrusted callable resolvers (filtered only by ``callable(...)``), giving RCE (unpickle) or ...
a9c3e9a9bf6ad473ac62957cec13e8b304e68d9cf1a846a3231fbcf5c5cf0ed0
Python
10,338
277
"""Surface punch-list pins: List-C removals and the zero-evidence demotions. The 2026-08 completeness audit (E1 + E1-r2, adopted by RULINGS Batch-8 as the funded punch list) classified the advertised public surface into REMOVE rows (dead renames, duplicate exports -- deleted outright) and DEMOTE rows (zero-external-ev...
3c6daea7d90f1aa544b0aec60d45e6ab85fcd26a3d3eb68f00a81f335ce5e55b
Python
10,340
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tickfont(_BaseTraceHierarchyType): _parent_path_str = "carpet.aaxis" _pat...
7bf55d821acc8f6958850f544688b99e7f1cc44adcf3125fb036cb02b226fe6e
Python
10,340
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tickfont(_BaseTraceHierarchyType): _parent_path_str = "carpet.baxis" _pat...
9267671e1b54af65e9d0c62b2ff44c23a172d03853a7f0903942fd5178d0533e
Python
10,341
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.legend" _pat...
ab17b53f1f07f53859717f34b50b4348850822c0efc4f8fb25f3ec342923d317
Python
10,341
380
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 24 17:48:18 2021 This scripts contains little helper functions to do with data paths, binning labels, sorting data and circular statistics methods. @author: emilia """ import numpy as np import os.path from pathlib import Path import torch import pi...
34bf1028b8217803b2586fa871a713bda7a3cc73dc162ab2d4dddcbf1e1c055a
Python
10,342
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): _parent_path_str = "indicator.delta" _path...
4a5039550e143b8d01d8d2d6541f0a7f77bc093078160de824bcff07f893a67f
Python
10,342
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): _parent_path_str = "indicator.title" _path...
787415fb6134cbd3efd6499f36c0b92d41b64164c26acc6855172ef6cb62a354
Python
10,343
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Tickfont(_BaseLayoutHierarchyType): _parent_path_str = "layout.xaxis" _...
975d00bf6d568211a4da74362da0c1b8c00f2751431735df7e36b13a6ea11ef5
Python
10,343
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Tickfont(_BaseLayoutHierarchyType): _parent_path_str = "layout.yaxis" _...
36f81f1ceaae2c6dd49b7d5d00a3b51bfd3333359fd2e6afcdbd186fbbb1a765
Python
10,344
268
# Copyright (c) 2025, Tri Dao. import os from typing import Tuple from functools import lru_cache import torch from torch._subclasses.fake_tensor import FakeTensor try: from triton.tools.disasm import extract except ImportError: extract = None import cutlass import cutlass.cute as cute from cutlass.cutlass_...
aa5871f69098277b0b0b4b630bf9298089ac1ae85b8192894cead0d3a09f754a
Python
10,345
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Labelfont(_BaseTraceHierarchyType): _parent_path_str = "parcats" _path_st...
1dd10533c8d67fdcea95a6607fa038e67f75596f59d4796f558d60c3fd6b993c
Python
10,346
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): _parent_path_str = "carpet.baxis.title" _p...
5d8ad057bc32e8fca8aff04149d1477671932f5ef7936a047154f6d300df4584
Python
10,346
196
import os import voxcell import json import numpy # from .parcellation_levels import AibsLevel from . import parcellation_levels class ParcellationProject(object): _path_config = "input/configuration/config.json" def __init__(self, root, resume=False): """ root: Path to project root. A confi...
809af771d0cadae285e922b6e5527bc94f940c880ec6574cfd1b8eacbe23a987
Python
10,346
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): _parent_path_str = "carpet.aaxis.title" _p...
757c5c0c9bd675a763dcd57ad509311caea3dee5879d5971a943a69cfa411684
Python
10,347
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.annotation" ...
2ef096fe6ab33ea8ee2dd23781ab034fe0c2d88036542b7d15012429bc300cc5
Python
10,349
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.xaxis.title" ...
832e5eea23eef007ecb2b3d74ad162b66298b5b8b81ffdc9b67bee047b590697
Python
10,349
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): _parent_path_str = "indicator.number" _pat...
fb2432161918b91773d498e663d40a9035362b1c45600c1c9c45846efaff734f
Python
10,349
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.yaxis.title" ...
eaa6f87abc05e8f5053a6dc0ee6f3e448b488d405df4c74b8444da645b633267
Python
10,350
255
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pandas as pd import os import time import pdb import csv import re from dcCustom.trans import undo_transforms import dcCustom from collections import OrderedDict ...
6649412269901597bbfa64ac67851183c71abebb6370a7cf76aa8d6a0b33b898
Python
10,351
250
""" Fitting Power Spectrum Models Across 3D Arrays ============================================== Fitting power spectrum models across 3D arrays of power spectra. """ ################################################################################################### # Running Across 3D # ----------------- # # Most of...
df9c5c60947e2ec656a8b1f41f6645622251ac789addc31b0f60ff03adcf3a63
Python
10,352
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tickfont(_BaseTraceHierarchyType): _parent_path_str = "parcoords" _path_s...
7a5a7a892b6685789ec47e7728ad4506362b0e7b82defb11a22de003813c878a
Python
10,353
240
__doc__ = """ Compute log likelihood values for crossvaldiation. In order to run this file, you will need to first run the "analysis*.py" scripts. This will generate backup files in the folder sim_backup. This code was adapted from Fründ, Wichmann, Macke (2014): Quantifying the effect of inter-trial dependence on per...
add8e188e6912042585a8470e85f971101e7ec601ae712dec58d90e3aa6ac16f
Python
10,353
262
#!/usr/bin/env python """Tests for `stlearn` package.""" import os import unittest import numpy as np from numba.typed import List import stlearn as st import scanpy as sc from tests.utils import read_test_data import stlearn.tools.microenv.cci.het_helpers as het_hs import stlearn.tools.microenv.cci.het as het g...
ca94043844019a8316be902167169e515e9553713f596a9c63f96ecbd2549fd5
Python
10,353
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.shape.label" ...
193700b8682f650ddf9f7df7e801b87e9d498ec0a1ba7b79761c4755c632f50f
Python
10,354
361
import h5py import numpy as np import torch from torch.utils.data import DataLoader import torch.nn as nn import os # from motifs import read_motifs, motifs_for from utils import clip_datapoint, modify_sl, print_topl_statistics class ResidualUnit(nn.Module): """ Residual unit proposed in "Identity mappings...
49b2c35aaf8976a26332b2ccd4d5a8038c3922c7cda15abec9d4a77638c34ec7
Python
10,355
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Labelfont(_BaseTraceHierarchyType): _parent_path_str = "parcoords" _path_...
5c6b763ddead2928554b6980b53dc79e0525c223bf0f0168b12a108a0231232d
Python
10,355
294
"""Datamodules for RL models that rely on experiences generated during training Based on implementations found here: https://github.com/Shmuma/ptan/blob/master/ptan/experience.py.""" from abc import ABC from collections import deque, namedtuple from typing import Callable, Iterator, List, Tuple import torch from torch...
1b298cf4c82d49dfdbbabaa9d4410c4063b444905d0dafc4c658892f18c1b575
Python
10,357
340
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): _parent_path_str = "cone.colorbar.title" _...
716eb6139238d464a871ee483272fbfb967aaf608f9ed90a264fde5d742a00cf
Python
10,358
334
from ..utils import constants, gislib import pandas as pd import geopandas as gpd import shapely import os import errno import requests import numpy as np distance = gislib.getDistance def diff_seconds(t_0, t_1): return (t_1 - t_0).total_seconds() def is_multi_user(data): if constants.UID in data.columns: ...
5fdf61cfdd014ed35cb2db530bbd5960b438da1d67ecb892615c8aa11e744091
Python
10,359
223
# 均匀采样效果较差 import json import numpy as np import os, sys import random from collections import Counter from sklearn import preprocessing from sklearn.metrics import f1_score from sklearn.metrics import confusion_matrix import torch import torch.nn as nn import torch.nn.utils.rnn as rnn_utils import torch.nn.functional ...
2427549143081ca9ae8f87d0763d5b18a7aa7e265b9dee5ca92ae9ac6688a175
Python
10,360
221
import numpy as np import pandas as pd import time import pickle import os from PCAfold import preprocess from PCAfold import analysis from PCAfold import __version__ as PCAfold_version print('numpy==' + np.__version__) print('pandas==' + pd.__version__) print('PCAfold==' + PCAfold_version) # Select one dataset: data...