sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
3012f41bd9ec26326898836f3e16146967f9b423b44c86bbffb450966fd48e5f | Python | 179 | 12 | import numpy as np
def fit_gene_model(gene_counts, umi_counts):
N = gene_counts.size
mu = np.zeros(N)
var = np.ones(N)
x2 = np.ones(N)
return mu, var, x2
|
84846d14872e09bfe2413c49e712ef5dcc18305414e042971d9f1648e90420db | Python | 180 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""aihwkit tests."""
|
a8c68ac513eb54510d8d99907ddf365e729de0471d53fd2ba50017420f0bfae8 | Python | 180 | 6 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the LICENSE
file in the root directory of this source tree.
"""
|
e4f63b4fc66de9658b3be73de419553736f7864f4965d2870d7a30531363824e | Python | 180 | 6 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
|
e60c3f0026433dcd2167c9c18cf9ebcaa9edefe5d4d4d4f71eae026fd09a50c0 | Python | 181 | 6 | # Replaced with the current commit when building the wheels.
commit = "{{RAY_COMMIT_SHA}}"
version = "3.0.0.dev0"
if __name__ == "__main__":
print("%s %s" % (version, commit))
|
15a96ff6bcc8d12f928dcfadfaf092f6750f70ac01a6d99d35d7ab63d2a8939d | Python | 184 | 8 | # encoding: utf-8
"""
The *pathspec.patterns* package contains the pattern matching
implementations.
"""
# Load pattern implementations.
from .gitwildmatch import GitWildMatchPattern
|
2785635b879f07fa900bd3a143bcfbc726a84013d27edbbcdd2e4be908edec9d | Python | 184 | 10 | r"""
TOSICA (Transformer for One-Stop Interpretable Cell-type Annotation)
"""
from . import train, pre, TOSICA_model
from .train import fit_model
from .pre import predict
import os
|
5622c450a786f88f4cc2fb0d39fd0214e8970799e3b86155cbb3ee43ca224c81 | Python | 184 | 3 |
from .rewards import (RewardCalculator, MORewardCalculator, SumRewardCalculator,
BoundedRewardCalculator, MultiplyRewardCalculator, NanodomainsRewardCalculator)
|
a6bb99f59a6656f03c749735ce91cb97edef661b5dc8cacb43fae28277b244f7 | Python | 185 | 9 | from ray import serve
@serve.deployment
class MyDeployment:
def __call__(self, model_path):
from my_module import my_model
self.model = my_model.load(model_path)
|
21b5f3e2a96134ecd68fb367980d5eb328612473af24e45104731939af69f4e3 | Python | 186 | 7 | # -*- encoding: utf-8 -*-
from __future__ import division, print_function
from . import model, scoring, utils
from .core import callers
from .model import SegModel
__version__ = "0.2.0" |
321520530d69c8f52f5f11d100f974754698e09c58be9a32ce976f77082d86c4 | Python | 186 | 4 | from timescoring.annotations import Annotation
from timescoring.scoring import EventScoring, Scoring, SampleScoring
__all__ = ["Annotation", "Scoring", "SampleScoring", "EventScoring"]
|
748a16bd4083a633b805c727695ba2301f52e80183308b1f9b53810deef95069 | Python | 186 | 11 | import random
import numpy as np
import torch
def setup_random_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
|
ea5f107fb1f68a16e3e4d47133b0b8c54cb46957b6812386a875585ea7ed1399 | Python | 186 | 9 | """
AVA package for organizing different kinds of data
Contains
--------
`ava.data.data_container`
DataContainer class for linking directories containing different sorts of
data.
"""
|
6c5047bd26b31c550da64997b83691eea22e4aa292df753407210a18c0300548 | Python | 188 | 6 | from .vae_model import VAE
from .annot_vae_model import AnnotVAE
from .atac_reg_model import ATACRegModel
from .refine_model import RefineODE
from .velocity_field import VelocityFieldReg
|
798d074f0a3e1f8567c10322a7af5362e33781159f51c40c04585be28e6804e3 | Python | 189 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Neural network modules."""
|
08a23c8a984bf4d9d808e5d54a59c1735cda767e4c8297706297f97b67363e44 | Python | 190 | 10 | # -*- coding: utf-8 -*-
"""
Freeze pytest.main() with vtkplotlib included.
"""
import sys
import vtkplotlib
import pytest
sys.exit(pytest.main(sys.argv[1:] + ["--no-cov", "--tb=native"]))
|
38aef772d7bf27d2f28c4bd90b778e5deb8a978d51acd2ae2aa9082197f374c2 | Python | 190 | 10 | import torch
from ..base import Transform
class Reverse(Transform):
"""Reverse the signal in time."""
def apply(self, x, generator=None):
return torch.flip(x, dims=[-1])
|
fe4db4bd603471f04123dd67f602be5a9eb0a1a52dc3c62991db243109050b13 | Python | 190 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Experiments for aihwkit."""
|
d4b6f40d567c214f052972276c5d7892d8f985699ed70a4329314626c0207f0d | Python | 191 | 9 | # Copyright (C) 2018-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from cvat.utils.version import get_version
VERSION = (2, 80, 1, "alpha", 0)
__version__ = get_version(VERSION)
|
ddadb75cb2fc6e43e0c0078ae120c71f4e7fc5ce8810ed8fdbb7a1e930bdad0c | Python | 191 | 9 | """Vendored graph neural network helpers used by gsMap latent learning."""
from .model import gat_model
from .train import model_trainer
__all__ = [
"gat_model",
"model_trainer",
]
|
3318d61b731624adbaf6e2455a141ae4822fa12f755651db8b79b0ff12e276b5 | Python | 192 | 8 | """
Reporting code for tedana
"""
from .html_report import generate_report
from .static_figures import comp_figures, pca_results
__all__ = ["generate_report", "comp_figures", "pca_results"]
|
ccd535076a9fd082f7e622a9722c77d7c53913b6a5094dc9e4e1ff0fce984cba | Python | 192 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Helpers for aihwkit tests."""
|
6e5932b3fa22ac65faf99a6953530ead8640b70557a528102c34428e95cbcca8 | Python | 193 | 9 | import GR_pKa.data
import GR_pKa.features
import GR_pKa.models
import GR_pKa.train
import GR_pKa.args
import GR_pKa.constants
import GR_pKa.interpret
import GR_pKa.nn_utils
import GR_pKa.utils
|
77561fc55ca08cd8a0175b358e6af37f82878a29a6b64e8f0a918883a708364e | Python | 193 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Analog RNN related modules."""
|
8b0b5cbe46d8047749c568513e37c24bff331cc0e97178c3b0605d1dad1b6f99 | Python | 193 | 8 | r"""
Core functions of SLAT model
"""
from .utils import *
from .loaddata import load_anndata, load_anndatas
from .preprocess import Cal_Spatial_Net, scanpy_workflow
from .prematch import icp
|
25d64b28ff9f7838a30db27d5e3a48c245557c172693fba02fb263cde6fa1850 | Python | 196 | 8 | class Faker:
"""Mock Faker class to test fake_email_creator.py.
Meant to mock https://github.com/joke2k/faker package.
"""
def email(self) -> str:
return "fake@fake.com"
|
a7455c9358aae3deea23dfc234cb73cd50e487b14ea88621d984284816750736 | Python | 196 | 4 | from epilepsy2bids.annotations import Annotation, Annotations, EventType, SeizureType
from epilepsy2bids.eeg import Eeg
__all__ = ["Annotation", "Annotations", "SeizureType", "EventType", "Eeg"]
|
318dc585daf5aaa92f3c495b9e4afcf52096b481d4f1ec155d1636674e9977aa | Python | 198 | 7 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
# Utility scripts
|
48689d3874fa40a3978c688a9ed94a02ce5743fac6b6fec0119833dc26173807 | Python | 198 | 6 | from django import template
register = template.Library()
@register.simple_tag
def get_verbose_field_name(instance, field_name):
return instance._meta.get_field(field_name).verbose_name.title() |
fa4dfa8b19af0180419a9fbd0c031b027a66194d4ecea01eecf711adc76a392c | Python | 198 | 7 | _base_ = 'faster-rcnn_r50_fpn_2x_ruod.py'
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained',
checkpoint='torchvision://resnet101')))
|
7701fcae95d9ad77b6c1e6c13249b85cce31581465fbf569d74f99294b450458 | Python | 199 | 5 | from .breakpoint import Breakpoint
from .pesr_test import PESRTest
from .sr_test import SRTest, SRTestRunner
from .pe_test import PETest, PETestRunner
from .pesr_test import PESRTest, PESRTestRunner
|
3df854298372f4226fd7708444ea41a83a4681d84654a0503ef1d4ed775b8465 | Python | 200 | 12 | from .operator import Operator
from .site_operator import (
sigma_x,
sigma_y,
sigma_z,
sigma_p,
sigma_m,
)
from .common_operators import (
Heisenberg,
Ising,
)
|
af372d3d0a8cfffaa3512128faf5760f9b075494d762ecd46bfc7ad6391ec1c8 | Python | 200 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Utilities and helpers for aihwkit."""
|
58090d1566d961332268aeb719e056609f8711c2b05ce976a53b664137ce2392 | Python | 201 | 6 | # Ultralytics YOLO 🚀, GPL-3.0 license
from .track import register_tracker
from .trackers import BOTSORT, BYTETracker
__all__ = 'register_tracker', 'BOTSORT', 'BYTETracker' # allow simpler import
|
517a391c48001615afababdf35dd36220804cff6679fb5b1c7990e7629ba3560 | Python | 202 | 8 | from importlib.metadata import version as _version
__all__ = ["__version__"]
__version__ = _version("flowsig")
from . import preprocessing as pp
from . import tools as tl
from . import plotting as pl
|
24ce0445fe2ba4c1b4edba3824068536bd33b473e95dc74791ef83b4608c57d3 | Python | 203 | 7 | _base_ = 'faster-rcnn_r50_fpn_2x_urpc-coco.py'
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained',
checkpoint='torchvision://resnet101')))
|
8eda7bb345e0db7954cf5856c2de1eb52a29d3de597aa6c588597843b103d1f0 | Python | 203 | 5 | """Compatibility import for historical validation scripts."""
import sys
from pathlib import Path
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
from mothra_runtime import DeduplicatingAdam
|
9a930b99f96a8c311c864e8634633e570ae04f0e769c35f975f4134213639cba | Python | 203 | 7 | _base_ = 'faster-rcnn_r50_fpn_1x_urpc-coco.py'
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained',
checkpoint='torchvision://resnet101')))
|
670260c9189e3dec9396141471c16bb58a2454b6077e639a3e23b492647176a9 | Python | 204 | 2 | from gym_tasks.envs.VisualOlfactoryAttentionSwitchEnv import VisualOlfactoryAttentionSwitchEnv
from gym_tasks.envs.VisualOlfactoryAttentionSwitchNoBlankEnv import VisualOlfactoryAttentionSwitchNoBlankEnv
|
f3f8f9bdfa4fbf77e4336384153d8259187b5dec3464c5ab42dc0d933343bbb8 | Python | 206 | 5 | """Jarvis persistent memory — SQLite-backed, FTS5-searchable knowledge store."""
from .store import MemoryStore, MemoryDocument, MemoryFolder
__all__ = ["MemoryStore", "MemoryDocument", "MemoryFolder"]
|
456df1861e1dcd2d7c41d8954352cdfa44d3d8ba8c2139bf7f5f7b09685fbb60 | Python | 208 | 5 | import sys
from pathlib import Path
# make hippunfold/workflow/lib importable as `lib`, as it is for workflow scripts
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "hippunfold" / "workflow"))
|
26d0fd3d94bde5baa3432d508cada336e9a669633e71d0d55a991b10440ade98 | Python | 209 | 8 | from .directories import *
from .network import *
from .network_view import *
from .dynamics import *
from .initialization import *
from .ensemble_view import *
from .ensemble import *
from .stimulus import *
|
52ca2cc7670cf36a048bdd348475b4f8a09d780d87f39dbafc2fe0fc10e513fd | Python | 209 | 3 | # Add lecun_normal weight initialization for networks in pytorch
from pfrl.initializers.chainer_default import init_chainer_default # NOQA
from pfrl.initializers.lecun_normal import init_lecun_normal # NOQA
|
c84d6b6de8e8684ded9943887bb0439a5bfe6514045e0aafabf0814672505134 | Python | 209 | 11 | from bazel.gen_extract import gen_extract
if __name__ == "__main__":
gen_extract(
[
"cpp/ray_cpp_pkg.zip",
],
clear_dir_first=[
"ray/cpp",
],
)
|
6cb2bd5452ed132d096f75d102ef642850a8c7979824f94be79ed93c03e248f3 | Python | 210 | 10 | """Animations."""
from .activations import *
from .animations import *
from .hexflow import *
from .hexscatter import *
from .imshow import *
from .traces import *
from .sintel import *
from .network import *
|
a55e5c8edce9611498659ce55132f03e8055177d8a62f24eb3ea1f5f3b484f02 | Python | 210 | 6 | import setuptools
if __name__ == "__main__":
with open('requirements.txt') as f:
required = f.read().splitlines()
setuptools.setup(name="ImputeHiFI",version="0.1.3",install_requires=required,)
|
0bbd044652e48f06453e0223b0bdb85dad13156a9325f18e8cf15bbefc4f82ad | Python | 211 | 10 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='fMRI BOLD auto-regression',
author='FrancoisPgm',
license='MIT',
)
|
bbbbf5d89d5107081cf10d0f59f4ae066fc22987e98eff0e74028df2f1e1927b | Python | 211 | 6 | # 导入 YOLOv8
from ultralytics import YOLO
# 载入预训练权重
model = YOLO("last.pt")
# 指定 opset=11 并且使用 onnx-sim 简化
ONNXsuccess = model.export(format="onnx", opset=11, simplify=True) |
64e586251c2ca9e3252758c589d1dfd8d2bdacd571aa8a62d37c6ac51a94e2f6 | Python | 212 | 11 | from bazel.gen_extract import gen_extract
if __name__ == "__main__":
gen_extract(
[
"java/ray_java_pkg.zip",
],
clear_dir_first=[
"ray/jars",
],
)
|
782e244e2a0d50c76896135d4f874124b77e3fe62eec30198f693d7d66b000a8 | Python | 212 | 3 | brats_preprocessed_folder = "/media/fabian/DeepLearningData/BraTS2017_preprocessed"
brats_folder_with_downloaded_train_data = "/media/fabian/DeepLearningData/Brats17TrainingData"
num_threads_for_brats_example = 8 |
b8ff203ec0533fce6fac7f765a7485994cef2fddafa084f0a30642daf0ff5461 | Python | 212 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Helpers for the AIHW Composer API (version 1)."""
|
d533fa1c2318958f978786d09c00fc78b528396ecfb40a1c2f37f5d9b53c878b | Python | 212 | 10 | from setuptools import find_packages, setup
setup(
name='language',
packages=find_packages(),
version='0.1.0',
description='language cort project',
author='Maedbh King',
license='MIT',
)
|
133aaa5df0f4ade79d5bf6a9f9d4a8239b1d8c4ec5e5f3bff05d1ca0bf0a6e60 | Python | 213 | 5 | # This work is licensed under Attribution-NonCommercial 4.0 International License. # noqa
from .zero_dce import ZeroDCE
from .zero_dce_generator import ZeroDCEGenerator
__all__ = ['ZeroDCEGenerator', 'ZeroDCE']
|
57f2b232deb6f0e2a37a6762821b33c4263b39baae7ed3aab4e474ddccf0e3ca | Python | 213 | 5 | from .bioprocessor import BioProcessor
from .diseaseprocessor import DiseaseProcessor
from .chemicalprocessor import ChemicalProcessor
from .geneprocessor import GeneProcessor
from .class_entities import Entities
|
76afacb7e6102cff32c25f0f83105aaf9695197324724459ec367a5f1b1d6f12 | Python | 213 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Protobuf definitions for the AIHW Composer API."""
|
81d230486ee42baa1428dc425121e6236392a90e1d34ea2db5d17ef1b5d09ed3 | Python | 213 | 5 | # Default max_concurrency option in @ray.remote for async actors.
DEFAULT_MAX_CONCURRENCY_ASYNC = 1000
LOGGING_ROTATE_BYTES = 512 * 1024 * 1024 # 512MB.
LOGGING_ROTATE_BACKUP_COUNT = 5 # 5 Backup files at max.
|
62732d76e39da12f91a5cba90b277c35ec039bbed9c5a491d7660b628bf885ac | Python | 214 | 9 | import matplotlib
from nilearn import plotting
matplotlib.use("Agg")
# 3D surface
# requires `snakemake.input.surf`
fig = plotting.plot_surf(snakemake.input.surf, view="dorsal")
fig.savefig(snakemake.output.png)
|
75503b3d3e99daa47dea6329ea33c51eb2ee48dc857fa90af6357d8d86f71843 | Python | 216 | 10 | import sys
import pytest
if __name__ == "__main__":
exit_code = pytest.main(sys.argv[1:])
if exit_code is pytest.ExitCode.NO_TESTS_COLLECTED:
exit_code = pytest.ExitCode.OK
sys.exit(exit_code)
|
a0be3fb76e77e071db36270fb93dec0b93c7b688958b80b86991e5f38920311b | Python | 216 | 8 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
|
a661e3ac2ff22f42ab1c54485505dbe3342edc3e59616b32218073bb5ce3a363 | Python | 216 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Helpers for version 1 of the AIHW Composer format."""
|
6948f990594eb1d45eb95a78673333009f33d9fba132bba3af22b11e5898736f | Python | 217 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Client for connecting to the the AIHW Composer API."""
|
9218f5551a1afdc569420d5910ce63d00c2bb8b6becd7af2199c40b896219ee6 | Python | 217 | 9 | from .core import *
__all__ = ['scTenifoldNet', 'scTenifoldKnk',
"sc_QC", "make_networks", "manifold_alignment", "d_regulation",
"compare_networks", "virtual_knockout"]
__version__ = "0.2.0"
|
85a60ebf775cfd4289e3726535f50ce0ddd66f997d967159a6df3eb186a5a152 | Python | 218 | 6 | from ._SimpleTwoArmBandit import SimpleTwoArmBandit
from ._ContextualBandit import ContextualBandit
from ._Polynomial import Polynomial
from ._MixedCSW import MixedCSW
from ._CSW import CSW
# from ._Waves import Waves
|
a412f185499adb9b2f27e727ad1ca097186de507c4ad660cacf88dfa9dfca118 | Python | 218 | 5 | # from .losses import
from .utils import criterions, datasets
from .print_model import print_model, print_flops
from .data_tools import DataAugment, FeatAugment, MedianAge
from .config_handler import YamlHandler
|
83684dd3e1d38fac1e41d9d7792314ee148182c2bed3abd3895edb461bf1c748 | Python | 220 | 4 | from .cmbFormer import CmbFormer_S, CmbFormer_B
from .resnet3D import resNet3D_18, resNet3D_50, resNet3D_101
from .uniformer import uniformer_xxs, uniformer_xs
from .uniformerv2 import UniFormerv2_b16, UniFormerv2_114 |
bf7b9e975baa152fbee2c908e0d801efd21f34734674255b22bcf3e1c3aae969 | Python | 220 | 9 | from . import Bayes_fun
from . import Extract_raw_data
from . import GUI
from . import Metrics_fun
from . import Overlord
from . import Param_fun
from . import Save_utils
from . import utils
from . import AssignUniqueID |
16e7ec3c3d886c7eaed8e0935819d9ba1b67f6a1b8c1cec45fb31a609b3bdc58 | Python | 221 | 3 | # List of files to exclude from the Ray directory when using runtime_env for
# Ray development. These are not necessary in the Ray workers.
RAY_WORKER_DEV_EXCLUDES = ["raylet", "gcs_server", "cpp/", "tests/", "core/src"]
|
26fe2c5483c802d20ba67a3b0c65cbb834e45ad503de33796ca4e054745a2689 | Python | 221 | 9 | from .auxiliary import vcorrcoef
from .graph import gene_graph
from .correlation import correlation
from .modules import scdemon
# Make the modules class
__version__ = "0.0.3"
__author__ = "Carles Boix, Benjamin James"
|
346c715ef6d69c9c908c591d81ad795c6edf3b9884815676d3ed33d53fc093ef | Python | 221 | 10 | import rlexp
from repetition_config import config
# set random seeds
rlexp.utils.seed(config)
# run experiment
agent, log = rlexp.exp.continual.run_experiment(config=config)
log.config.numpy_log_mode = 'npz'
log.save()
|
4d45304c0b36db52bac662c5d58591ded3a709d72dfc8e1594ceff6f8d68b0e4 | Python | 221 | 7 | __author__ = "Benoit Turcotte, Albert Michaud-Gagnon, Anthony Bilodeau, and Audrey Durand"
__major__ = "0"
__minor__ = "0"
__revision__ = "2"
VERSION = ".".join((__major__, __minor__, __revision__))
__version__ = VERSION |
7aa2ce45bf1c40030e0a348820d65a012f8859bab4669a79f7eb0da6e5f94623 | Python | 221 | 8 | from ocpmodels.tasks.task import BaseTask
from ocpmodels.common.registry import registry
@registry.register_task("compute_stats")
class ComputeStatsTask(BaseTask):
def run(self):
self.trainer.compute_stats() |
c032a820f1158b1365e945f511abdea897af28563dc1abda3c0a315e21757de9 | Python | 221 | 2 | from ._plot_tensor import plot_tensor,plot_tensor_single,plot_tensor_pathway,plot_pathway
from ._plot_utils import plot_genes_list,plot_top_genes,plot_para_hist,plot_sankey,plot_landscape,infer_lineage,plot_tensor_heatmap |
d3593ac63c2cccd0c50088c2a6c747b3073ca752740a3f54e96a09557fb5d1d4 | Python | 221 | 13 |
from abc import abstractmethod, ABC
class BaseForwardModel(ABC):
@abstractmethod
def update_params(self, params):
pass
@abstractmethod
def compute_forward_model(self, q):
pass
|
5f05fdae66bf24a67456f6cd171ec24b2cca945011c02b88e7930b4ceaa84edd | Python | 222 | 5 | from samri.manipulations import flip_axis
def test_flip_axis():
nii_path = '/usr/share/samri_bidsdata/bids_collapsed/sub-4007/ses-ofM/func/sub-4007_ses-ofM_task-JogB_acq-EPIlowcov_run-0_bold.nii.gz'
flip_axis(nii_path)
|
d7370a20fefc5b3a274c057f0d07e98eb3641bac13fdd2679bee91ca63daf860 | Python | 222 | 7 | __author__ = "Benoit Turcotte, Albert Michaud-Gagnon, Anthony Bilodeau, and Audrey Durand"
__major__ = "0"
__minor__ = "0"
__revision__ = "4"
VERSION = ".".join((__major__, __minor__, __revision__))
__version__ = VERSION
|
43c9d6f849e4bcf7665e1c79f665dbcd60e454f92df6a7948252b69300f08590 | Python | 223 | 3 | # Trigger pytest hook to automatically zip test cluster logs to archive dir on failure
from ray.tests.conftest import pytest_runtest_makereport # noqa
from ray.tests.conftest import _isolate_token_auth_state # noqa: F401
|
d06ed47b1133ea41bfc8c6dd42ab7dd1bae64b4d94c7aae9dcc259ca05fe1ced | Python | 223 | 9 | # query_cache.py
from collections import OrderedDict
from ttl_cache import TTLCache
import os
class QueryCache(TTLCache):
def __init__(self, maxsize=1000, ttl=3600):
super().__init__(maxsize=maxsize, ttl=ttl)
|
8552cd0c6c765a0dd29d8302c39086ea7524ff16ab096b4b09067c1339b66f47 | Python | 224 | 7 | import numpy as np
from siapy.entities import SpectralImage
# Create a SpectralImage from a numpy array - mostly for testing
array = np.zeros((100, 100, 10)) # height, width, bands
image = SpectralImage.from_numpy(array)
|
cc0dae8e2aea5fb137cc4034da6f6387a3780143fed7cc708a2bf54771b41bbc | Python | 224 | 15 | # -*- coding: utf-8 -*-
from .figure import Figure
from .figure_manager import (
gcf,
scf,
auto_figure,
show,
save_fig,
screenshot_fig,
close,
reset_camera,
view,
zoom_to_contents,
)
|
8556ce10a7ec62fa1eed59ad0ed938bfb4dc20cccc491c88b45011330476ac44 | Python | 226 | 8 | def test_crop2d():
import torch
from sinabs.layers import Cropping2dLayer
sinabs_layer = Cropping2dLayer(((2, 3), (3, 1)))
inp = torch.zeros((2, 2, 10, 10))
assert sinabs_layer(inp).shape == (2, 2, 5, 6)
|
e54c38de27ca457bcc4764235a902df39a3ea026195960ea2ccebc1a4200fc9b | Python | 226 | 5 | from ...utils import is_torch_available, is_transformers_available
if is_transformers_available() and is_torch_available():
from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline
|
bb7dac6d587a92a0dd2dd2e1007be7ebced9df415de4946307e5905c9576bf67 | Python | 227 | 8 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
Tests for the OMat24 data processing modules.
"""
|
9479556cf586c36c0bc5d97384da2dfaf2004d07515ff3e8639bd900a477909f | Python | 228 | 7 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
# Workflow orchestration and processing scripts
|
0444762d84ad6ae33d009ebc475aa6fb22cff47e77a598ed1a08510bc404ca55 | Python | 229 | 9 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Linear Algebra functionality."""
from .matrix import AnalogMatrix
|
7d1111a0e7dc6dcfe810c0054879b2c01b115624cf07da7364e21d743150a46c | Python | 229 | 10 | from typing import Any
from multimethod import multimethod
from data_profiling.config import Settings
@multimethod
def get_table_stats(config: Settings, df: Any, variable_stats: dict) -> dict:
raise NotImplementedError()
|
a403f0c76b544b094e80693b7e78c0a68a3f7976a37429d496376b1707d79a55 | Python | 229 | 7 | import pkgutil
__all__ = []
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__):
__all__.append(module_name)
module = loader.find_module(module_name).load_module(module_name)
exec('%s = module' % module_name)
|
c0c1f5370c18257a3ec7975e8f47c09f6a97511ec70d683e56193b0b2d3bb0b4 | Python | 229 | 3 | from rising.random.abstract import AbstractParameter
from rising.random.continuous import ContinuousParameter, NormalParameter, UniformParameter
from rising.random.discrete import DiscreteCombinationsParameter, DiscreteParameter
|
c1e96c88ea848cd7f589ab597e5c993a5cd86d935102d487236bc33af878bc1d | Python | 229 | 4 | from .main import CAST_STACK, CAST_MARK, CAST_PROJECT
from .CAST_Stack import reg_params, region_detect, corr_dist, CAST_STACK_rough
from .visualize import kmeans_plot_multiple, plot_mid, dsplot, plot_mid_v2
from .utils import *
|
00d3e863b8c5c4bfb3bd5c27ddec3e66f5c43359e9c2b08dd6ad2c6757725a7c | Python | 230 | 7 | def ask_yes_no(question):
while True:
choice = input("{} [y/N]: ".format(question)).lower()
if choice in ["y", "ye", "yes"]:
return True
elif choice in ["n", "no"]:
return False
|
0d8bcf64a8456c356696126c280fafb7c5ca4abdbe12da776c95706dbca883dc | Python | 230 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Conversion utilities for interacting with the AIHW Composer API."""
|
ca4f76a62de19bc3fef40abc4429b72a76d8a23075275b832065ed073d8a3051 | Python | 230 | 7 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Functionality related to the cloud client for AIHW Composer API."""
|
0742161acd190e5bc931530d0d82b88127736fc13dbd836a258d94c624592a28 | Python | 231 | 10 | from .ualign_training import calc_trans_loss, preeval, pretrain
from .ualign_training_ddp import ddp_preeval, ddp_pretrain
__all__ = [
'calc_trans_loss',
'preeval',
'pretrain',
'ddp_preeval',
'ddp_pretrain',
]
|
12bb6637c3ae28d3ca0f99bcfe4457648be91997fa04723ebaba6c0bdf18b1b3 | Python | 231 | 6 | from .utils import *
from .bgzipfile import BgzipFile
from .helpers import reciprocal_overlap, overlap_frac
from .multi_tabixfile import MultiTabixFile
from .genotype_merging import update_best_genotypes
from .rdtest import RdTest
|
d48ae63631ad07c8d1cd0f5e2e1a3c9e66c0b1398aa1adf83fe23e980f5789cf | Python | 232 | 15 | from .graph import (
EventData,
NIRGraphData,
NIRNodeData,
TimeGriddedData,
ValuedEventData,
)
__all__ = [
"EventData",
"NIRGraphData",
"NIRNodeData",
"TimeGriddedData",
"ValuedEventData",
]
|
1e7e98b2f13fbf2f43f87ada5167dd7ba6c150346073798468855400601f8f34 | Python | 233 | 11 | from bazel.gen_extract import gen_extract
if __name__ == "__main__":
gen_extract(
[
"ray_redis.zip",
],
clear_dir_first=[
"ray/core/src/ray/thirdparty/redis/src",
],
)
|
8cc03a338b6c2e0e85f50ddb555e218b91e1e03df3c9b524639784f254cfc391 | Python | 234 | 9 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
VERSION = "1.0.0"
|
55ed7f2d85776a32acf2e245004ee66acb4e62b79417033f5bffea69e8968fac | Python | 236 | 4 | """The model module handles all logic/calculations, e.g. calculate statistics, testing for special conditions."""
from data_profiling.model.description import BaseAnalysis, BaseDescription
__all__ = ["BaseAnalysis", "BaseDescription"]
|
62d58bf44dee7efc20ac810096b92d6220d3498b252f7db7eaadf857cc8a1df9 | Python | 236 | 8 | """This module defines the base class for object scanning and gets rid of
reference cycles."""
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class DAGNodeBase:
"""Common base class for a node in a Ray task graph."""
|
c3831e43db06f1a232b704b522e7018caf5ea8d430ab1fca6089104936fd578b | Python | 236 | 9 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Analog hardware library for PyTorch."""
from .version import __version__
|
2294537636897593551b738fb2433b9e4bd9031178c4c2c2bf647fcf750687e0 | Python | 237 | 8 | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
from deep_sdf.data import *
from deep_sdf.mesh import *
from deep_sdf.metrics.chamfer import *
from deep_sdf.utils import *
from deep_sdf.workspace import *
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.