sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
b3f516142067c64646faec5d6d35fcc6524be05275cc25a16f4696100bf46396
Python
282
16
SNP="snp" EFFECT_ALLELE="effect_allele" NON_EFFECT_ALLELE="non_effect_allele" ZSCORE="zscore" CHROMOSOME = "chromosome" POSITION = "position" DOSAGES="dosages" FREQUENCY="frequency" OR="or" BETA="beta" BETA_SIGN="beta_sign" SE="se" PVALUE="pvalue" GENE="gene" GENE_NAME="gene_name"
6a4c9716709bcefb4317aaa0798179a5d9321f3c6df0f7a2656623e4e7a07f9b
Python
283
12
import unittest from medaka import check_htslib_tool_version, report_binaries class TestHTSLibVersion(unittest.TestCase): def test_000_version_return_type(self): check_htslib_tool_version('samtools') def test_001_report_binaries(self): report_binaries()
73ee1fdd5833ec722d88654c1045f08e559e7b691742473b8383548b32e58fbc
Python
283
17
from __future__ import annotations import typing if typing.TYPE_CHECKING: from pathlib import Path import dulwich.repo class TempRepoFixture(typing.NamedTuple): path: Path repo: dulwich.repo.Repo init_commit: str middle_commit: str head_commit: str
314ad2a5a249c04bde516b49d0eddb3007ed02aad48fd7e414c851c5ac311f1d
Python
284
10
import os from tractseg.experiments.base_legacy.dm_reg_legacy import Config as DmRegConfig class Config(DmRegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] # CLASSES = "AutoPTX" # NR_OF_CLASSES = len(dataset_specific_utils.get_bundle_names(CLASSES)[1:])
dc7f09175b07123eba8b75af9b7150733246d15c70596384b6e220b612829bef
Python
284
8
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from pathlib import Path PROJECT_ROOT = Path(__file__).resolve().parent.parent GENERATED_CRYSTALS_ZIP_FILE_NAME = "generated_crystals_cif.zip" GENERATED_CRYSTALS_EXTXYZ_FILE_NAME = "generated_crystals.extxyz"
3a5777c541a71d2175f9e3c4591704aed70bff022daa970f11d46a6bf719499a
Python
285
5
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit from sklearn.decomposition import LatentDirichletAllocation class LDA3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=LatentDirichletAllocation(n_components=3), name="LDA3D")
66f786d7d21a131db631a314267c2adb5c9540bab868552ac8c947007c30ab91
Python
285
6
from .aggregator import Aggregator from .config import load_config, Config, merge_namespaces from .cytograph import Cytograph from .punchcards import Punchcard, PunchcardSubset, PunchcardDeck from .workflow import RootWorkflow, SubsetWorkflow, PoolWorkflow from .utils import Tempname
dc013ecc79d4c0519ecab6eb6df3a04f5f070056861a5255524ed42f2aa8d9ca
Python
285
6
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit from sklearn.manifold import SpectralEmbedding class Spectral3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=SpectralEmbedding(n_components=3), name="SpectralEmbedding3D")
73a25d118883b2786c2344032cad3cf70752fb4d188a5cb1b1bc1099bf5a9128
Python
286
11
import gl gl.resetdefaults() gl.meshload('BrainMesh_ICBM152.rh.mz3') gl.overlayload('motor_4t95mesh.rh.mz3') gl.overlaycolorname(1, 'red') gl.shaderxray(0.9, 0.5) gl.azimuthelevation(110, 15) gl.shadername('MatCap'); gl.shadermatcap('Cortex'); gl.meshcurv() gl.overlaytranslucent(2, 1)
b4d498c783903abb78386775a63b6f420ce2aef4feac3da79929193c88c81908
Python
286
13
""" Spatially variable gene selection. Installation: SpatialDE2 via https://github.com/PMBio/SpatialDE """ import SpatialDE def svg(adata_st): adata_st.X = adata_st.raw.X svg_full, _ = SpatialDE.test(adata_st, omnibus=True) return svg_full[svg_full.padj < 0.05].gene
1b3b69ebb6da574288ccb4f6212e9013ace1129fa2268b117720004f25ffb7f1
Python
287
8
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .laser_task import * # noqa from .laser_lstm import * # noqa from .laser_transformer import * # noqa
55881a88c3f9003ae01fc0c46922f6980a5d4f0f91b1f2a8f6714078276e844d
Python
288
10
from calm.sequence import CodonSequence def test_CodonSequence(): seq1 = CodonSequence('AUG GGA CGC UUU UAC CAA AUG GGA CGC UUU UAC CAA UAA') seq2 = CodonSequence('AUGGGACGCUUUUACCAAAUGGGACGCUUUUACCAAUAA') assert seq1.tokens == seq2.tokens assert seq1.seq == seq2.seq
36f72d232a75048fcb4f82603d02f44239e3b5791a17c4b29b5dee356c3108f1
Python
289
10
# # 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 # from pathlib import Path CONFIGS_BASE_DIR = Path(__file__).parent
9561cd478bbcb240d3ec656f63abe5916a4b7ac0762257c12c2bef45c82ece99
Python
290
11
import os from tractseg.experiments.base_legacy.tract_seg_legacy import Config as TractSegConfig class Config(TractSegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] FEATURES_FILENAME = "T1_Peaks12g90g270g" NR_OF_GRADIENTS = 10 NORMALIZE_PER_CHANNEL = True
e34452ddaca442f417e78c1a0bc6b5222b57dd6ff300befa6a70d7ab701e7572
Python
290
8
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .qconv import PQConv2d # NOQA from .qemb import PQEmbedding # NOQA from .qlinear import PQLinear # NOQA
0a341618903ddab22a070eac0a02429236a67ed15d8435a9055b0a6c78d8c25f
Python
291
15
from .ADMG import ADMG from .DAG import DAG from .MAG import MAG from .PDAG import PDAG from .SimpleCausalModel import SimpleCausalModel from .UndirectedGraph import UndirectedGraph __all__ = [ "ADMG", "UndirectedGraph", "DAG", "PDAG", "MAG", "SimpleCausalModel", ]
1f1d730f3fde81f65b5713332ad13a0dd32282cdbdd38fbf70bca09a562b90da
Python
291
6
"""The training loop: the epoch schedule, and the per-step weight update. Deliberately re-exports nothing. `d3text.models.base` imports `d3text.training.update`, so a re-export of `.trainer` here — which imports `d3text.models.base` in turn — would close that cycle at import time. """
6d5452cca31b5e652ae92b91fa509925d83c489f92fc10bab6c442e00f116a28
Python
294
13
from __future__ import annotations from typing import Literal import anndata import mudata import torch Number = int | float AnnOrMuData = anndata.AnnData | mudata.MuData Tensor = torch.Tensor LossRecord = dict[str, Tensor] | Tensor MinifiedDataType = Literal["latent_posterior_parameters"]
bac624d65a18ea77ca5a5d210a470adc0c25338e114d49794b8f38ffc5ebedce
Python
294
11
"""Dispatch ``cfg.task.name`` to a concrete task package.""" from __future__ import annotations from omegaconf import DictConfig def run_task(cfg: DictConfig) -> None: from dlbase.registry import get_task_plugin get_task_plugin(str(cfg.task.name)).task_class().run(cfg)
f1cfb71e078312839bce6581644c2b32a5c1ef38d5ab299a041042d11c6e2f4a
Python
294
13
import pandas as pd from neuron import h def get_segment_areas(): segments = [] areas = [] for sec in h.allsec(): for seg in sec.allseg(): segments.append(str(seg)) areas.append(seg.area()) return pd.DataFrame({'area': areas}, index=segments)
695c86492626b55b2c6daa56aed517a165e84cf78efcf812aaf54fdc92698b4a
Python
297
12
import os from tractseg.experiments.base_legacy.peak_reg_legacy import Config as PeakRegConfig #Name of original exp: Peaks20_12g90g270g_ALLoss class Config(PeakRegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] LOSS_WEIGHT = 10 LOSS_WEIGHT_LEN = 400 # nr of epochs
2eac687c3db69b101cc6b7b7ce396de8a8d7243e6c404333300ac2f9d9df0b93
Python
298
10
import novae def test_label_domains(): adata = novae.toy_dataset(n_panels=1, compute_spatial_neighbors=True)[0] prompt = novae.label_domains(adata, "domain", return_prompt=True) assert "messages" in prompt assert "output_schema" in prompt assert len(prompt["messages"]) == 2
424a86dae1e745bf9be75c855b8163e30e528a33200bba7df83da9ca40220404
Python
298
10
#!/usr/bin/env python3 -u # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import sys for idx, line in enumerate(sys.stdin): print(f"utt{idx:010d} {line}", end="")
3fc41765fb49b623fa5014b7badb4176f954db7dfb17b34691f1c4f95216c567
Python
299
15
from .data import ( EntityRelationDataset, collate_documents, TokenBudgetBatchSampler, compute_frequencies, get_batch_loader, ) __all__ = [ "EntityRelationDataset", "collate_documents", "TokenBudgetBatchSampler", "compute_frequencies", "get_batch_loader", ]
ee578226aef56b1b69bd8e672fff6e0c4ed877183b5474d1ca199faa6c2e463b
Python
299
9
from . import (array_operations, mesh_elements, mesh_correspondence, mesh_creation, mesh_operations, mesh_io) __all__ = ['array_operations', 'mesh_elements', 'mesh_correspondence', 'mesh_operations', 'mesh_creation', 'mesh_io']
54aa4acb7b9ca777a048691cdd084b147b0309b55c0479739daa5756d634a0d4
Python
300
11
#!/usr/bin/env python3 from setuptools import setup from Cython.Build import cythonize import numpy as np setup( ext_modules=cythonize(["./_encode_sequence.pyx", "_sequence_to_kmer_list.pyx", "./selene_custom/_genomic_features.pyx"]), include_dirs=[np.get_include()], zip_safe=False, )
b3886326b6cbcfd665f9e740e93706de9db351d4d808063950de4a803eea48b6
Python
301
13
""" Spapros gene selection. Installation: Spapros via https://github.com/theislab/spapros """ import spapros as sp def spapros(adata_sc): selector = sp.se.ProbesetSelector(adata_sc) selector.select_probeset() return selector.probeset.index[selector.probeset["selection"]].to_list()
c941834711456e5c1afd91d75a3ef810d8cf298ca4be37ca357139b9919fb4cf
Python
303
9
# -*- coding: utf-8 -*- # Copyright (C) 2017-2023 Phillip Alday <me@phillipalday.com> # License: BSD (3-clause) """MNE-based functions for manipulating EEG data.""" from ._base import (savgol_iaf, attenuation_iaf, abs_threshold, retrieve) from .io import (write_raw_brainvision, )
e17d21c3ec0e3bdf407507121064125c56bb681e61f44ab48c5d54df06f63a71
Python
303
7
# 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 models/tasks to register them from . import dummy_dataset, dummy_lm, dummy_masked_lm, dummy_model, dummy_mt # noqa
a9a382e58d99620c474beada9a98c366c06a4e0e0b0abc2fc55dea41c6f2dedc
Python
305
13
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .metric import * from .evaluator import * # experimental. try: from .expmetric import * except ImportError: pass
676ab6906314826a4ac9ccedc9f8d0326ddbe39005f0cc5fd20cd270d37f1f02
Python
308
13
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .configs import FairseqDataclass from .constants import ChoiceEnum __all__ = [ "FairseqDataclass", "ChoiceEnum", ]
befda1aee5dadcc0adfe38b96d909e2a6371960968ebd607559052b6a0b991a6
Python
308
10
from tractseg.experiments.base import Config as BaseConfig class Config(BaseConfig): EXPERIMENT_TYPE = "tract_segmentation" FEATURES_FILENAME = "12g90g270g_CSD_BX" # slightly less overfitting (but max f1_validate maybe slightly worse (makes sense if less overfitting)) USE_DROPOUT = True
d35edb124d6c5f61b3053115671ae55b9e7ed068a268319fd7cb20e7b33689d6
Python
308
13
import os # nose2 os.system( "nose2 --with-coverage --coverage pyecharts " "--coverage-config .coveragerc -s test" ) # pytest os.system("pytest -cov-config=.coveragerc --cov=./ test/") # flake8 for code linting os.system("flake8 --exclude=build,example,images --max-line-length=89 --ignore=F401")
61aa688fc83dd60f5c0a13e7d584bfe9d8f0964a09e17f52f417b94a38f5f4b9
Python
309
11
import sys from os import makedirs from os.path import join, dirname, realpath, exists current_dir = dirname(dirname(realpath(__file__))) sys.path.insert(0, dirname(current_dir)) from config_path import PLOTS_PATH saving_dir = join(PLOTS_PATH, 'figure3') if not exists(saving_dir): makedirs(saving_dir)
6476b24ed9e0678f546312b3e3ca707ea8b85186c7ee52b6aa9307cfbfb915ab
Python
309
11
import sys from os import makedirs from os.path import join, dirname, realpath, exists current_dir = dirname(dirname(realpath(__file__))) sys.path.insert(0, dirname(current_dir)) from config_path import PLOTS_PATH saving_dir = join(PLOTS_PATH, 'figure4') if not exists(saving_dir): makedirs(saving_dir)
6fcc581743dbe25d8161e7686929c5593ff95c409f35e4814574cc66ddf36fe4
Python
309
14
#!/usr/bin/env python3 # 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 fileinput import sacrebleu for line in fileinput.input(): print(sacrebleu.tokenize_zh(line))
d22056a445bd5c6f145bd67d6b8128e2c9df07652baf5851dd57f0940c1997f2
Python
309
11
import sys from os import makedirs from os.path import join, dirname, realpath, exists current_dir = dirname(dirname(realpath(__file__))) sys.path.insert(0, dirname(current_dir)) from config_path import PLOTS_PATH saving_dir = join(PLOTS_PATH, 'figure2') if not exists(saving_dir): makedirs(saving_dir)
f631060df170b4bc44c05dd89d0dfeeb9a938d133640fd0a01a2993e0b563a99
Python
309
9
""" This module contains classes and methods for target feature classes. These are classes which define a way to access a "target feature" such as a label or annotation on an input sequence. """ from .target import Target from .genomic_features import GenomicFeatures __all__ = ["Target", "GenomicFeatures"]
f82a8094e94b0bee141c77316cc66b8a29f9878e3ae846b5624e1195a7118410
Python
309
6
from .DiscreteFactor import DiscreteFactor, State # isort: skip # noqa: E402 from .CPD import TabularCPD from .JointProbabilityDistribution import JointProbabilityDistribution from .NoisyOR import NoisyORCPD __all__ = ["TabularCPD", "State", "DiscreteFactor", "JointProbabilityDistribution", "NoisyORCPD"]
215ddcc896cd3db2cd40d44c33406a668039d8c5f07c858c54342b2492d2f0eb
Python
310
14
from __future__ import annotations from poetry.layouts.layout import Layout from poetry.layouts.src import SrcLayout _LAYOUTS = {"src": SrcLayout, "standard": Layout} def layout(name: str) -> type[Layout]: if name not in _LAYOUTS: raise ValueError("Invalid layout") return _LAYOUTS[name]
8d2a0bacbe6fa881b09e430941b7f13f03a81805e5e68cc9e1986b28fa625443
Python
310
14
from .base import * from .helper import * from .input import * from .dense import * from .noise import * from .conv import * from .local import * from .pool import * from .shape import * from .merge import * from .normalization import * from .embedding import * from .recurrent import * from .special import *
d9aab080dd8c5f33f3e47cdfffb59ffed01d8927c845c97f077db42b22e854de
Python
310
7
"""Model architectures for medaka.""" # counts matrix models from medaka.architectures.gru import GRUModel # noqa F401 from medaka.architectures.majority_vote_model import MajorityVoteModel # noqa F401 # read level feature models from medaka.architectures.latent_space_lstm import LatentSpaceLSTM # noqa F401
53c89d14f10dc118d52ecc0122763b4a447325aed03354c70cc9d95cfed289b7
Python
311
5
from src.utils.instantiators import instantiate_callbacks, instantiate_loggers from src.utils.logging_utils import log_hyperparameters from src.utils.pylogger import RankedLogger from src.utils.rich_utils import enforce_tags, print_config_tree from src.utils.utils import extras, get_metric_value, task_wrapper
36da1fbd145454ff5fd5ff006fd851b21a9981c483a6efb72b27e2c7c406d289
Python
312
11
from ._contrastive_data_splitting import ContrastiveDataSplitter from ._contrastive_dataloader import ContrastiveDataLoader from ._model import ContrastiveVI from ._module import ContrastiveVAE __all__ = [ "ContrastiveDataLoader", "ContrastiveDataSplitter", "ContrastiveVAE", "ContrastiveVI", ]
b4cce40367c7a71ee293e283ed7c50e2e11718bca27a1c9aa47711924967bb36
Python
312
13
from tractseg.data import dataset_specific_utils from tractseg.experiments.base import Config as BaseConfig class Config(BaseConfig): EXPERIMENT_TYPE = "tract_segmentation" # CLASSES = "AutoPTX" # NR_OF_CLASSES = len(dataset_specific_utils.get_bundle_names(CLASSES)[1:]) LR_SCHEDULE = False
f8f91d62c016345bb0b10be41360260b0dec2a85105376374270b66e784cf7fa
Python
312
13
from . import functional, transforms from .functional import * # noqa : F401 from .transforms import ToLabels # noqa : F401 from .transforms import FromSegments, PostProcess, ToSegments __all__ = [ "functional", "transforms", "FromSegments", "PostProcess", "ToLabels", "ToSegments", ]
b9303d90e550fea78f7685a3bf0e3da70b50d4a05f0b162de00b08bb1a46dc12
Python
313
12
from mdt import CompositeModelTemplate __author__ = 'Robbert Harms' __date__ = "2015-06-22" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class S0(CompositeModelTemplate): """Models the unweighted signal (aka. b0).""" model_expression = 'S0' volume_selection = {'b': [(0, 250e6)]}
7a0a92d90298ca6c7af868851ee100088601aca872c9a5a2b2be5f2cb558224a
Python
314
12
import gl gl.resetdefaults() gl.azimuthelevation(70, 15) gl.meshload('BrainMesh_ICBM152.rh.mz3') gl.overlayload('motor_4t95vol.nii.gz') gl.overlayminmax(1,2,12) gl.overlayload('motor_4t95vol.nii.gz') gl.overlayminmax(2,-1,-2) gl.colorbarvisible(1) gl.overlaytransparencyonbackground(25) gl.meshcurv()
181423f332028516a7816d85838480807fe107e76c115eaec8900e609bf946e5
Python
315
13
from ._components import DirichletDecoder, NicheDecoder from ._constants import SCVIVA_REGISTRY_KEYS from ._model import SCVIVA from ._module import NicheLossOutput, nicheVAE __all__ = [ "SCVIVA", "nicheVAE", "NicheDecoder", "NicheLossOutput", "DirichletDecoder", "SCVIVA_REGISTRY_KEYS", ]
7971af32bcd6aa348359d5c34e809a2248f52f4d2a956380123856a770deffd1
Python
315
11
import sys from os import makedirs from os.path import join, dirname, realpath, exists current_dir = dirname(dirname(realpath(__file__))) sys.path.insert(0, dirname(current_dir)) from config_path import PLOTS_PATH saving_dir = join(PLOTS_PATH, 'supplementary') if not exists(saving_dir): makedirs(saving_dir)
1d40bc982ce97369e55548186c85db43e6b14892f374656f4181b14a201e8273
Python
316
13
from abc import ABC, abstractmethod from argparse import ArgumentParser class BaseTransformersCLICommand(ABC): @staticmethod @abstractmethod def register_subcommand(parser: ArgumentParser): raise NotImplementedError() @abstractmethod def run(self): raise NotImplementedError()
c0b5ab98c907f34ac83de02bca1b3c9dc871088370e453607554f54fde9ad9dd
Python
316
9
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .tacotron2 import * # noqa from .tts_transformer import * # noqa from .fastspeech2 import * # noqa from .vocoder import * # noqa
49de685f02faa8d85dabe520eb307c931678cc86ef620399cd3348126d38f3a4
Python
317
16
FEATURES = [ "protein_coding_gene", "lncRNA", "exon", "intron", "splice_donor", "splice_acceptor", "5UTR", "3UTR", "CTCF-bound", "polyA_signal", "enhancer_Tissue_specific", "enhancer_Tissue_invariant", "promoter_Tissue_specific", "promoter_Tissue_invariant", ]
c2eed0ca2a2409682fffbb3bd13dc9bf81213abd14ee455a9344de31a591e1fd
Python
317
12
import os from tractseg.experiments.base_legacy.peak_reg_legacy import Config as PeakRegConfig #Name of original exp: Peaks20_12g90g270g_ALLoss class Config(PeakRegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] LOSS_WEIGHT = 10 LOSS_WEIGHT_LEN = 400 # nr of epochs NUM_EPOCHS = 500
cd322f3e8f0af9170011449f6b2670895b304bc416b5e9dc37d655f9e30b5616
Python
317
12
import numpy as np import vak.common.timebins def test_timebin_dur_from_vecs(): timebin_dur = 0.001 time_bins = np.linspace(0.0, 5.0, num=int(5 / timebin_dur)) computed = vak.common.timebins.timebin_dur_from_vec( time_bins=time_bins, n_decimals_trunc=3 ) assert timebin_dur == computed
6da17bf296f0a0242134b2bb70104056a4751ccb531499ec11dc79a2784fc98c
Python
322
6
"""Garfield: Graph-based Contrastive Learning enable Fast Single-Cell Embedding""" from ._settings import settings from ._version import __version__ from . import data, model, modules, nn, preprocessing, trainer, plot, analysis __all__ = ["data", "model", "modules", "nn", "preprocessing", "trainer", "plot", "analysis"...
f52471c52be9fc7313c68089d918df6836c207a79e5dad8a41e95891e0a9cbe6
Python
322
9
from os.path import expanduser from data.pathways.gmt_pathway import get_KEGG_map input_genes = ['AR', 'AKT', 'EGFR'] filename = expanduser('~/Data/pathways/MsigDB/c2.cp.kegg.v6.1.symbols.gmt') mapp, genes, pathways = get_KEGG_map(input_genes, filename) print 'genes', genes print 'pathways', pathways print 'mapp', map...
71a50256b7725a8ae128eec0c9147479768868c6d5fba282ce304891f5435317
Python
323
15
from .._base import BaseExampleModel, DAGMixin class Paths(DAGMixin, BaseExampleModel): """ Paths DAG from the example_models repository. """ _tags = { "name": "dagitty/paths", "n_nodes": 17, "n_edges": 19, "is_parameterized": False, } data_url = "dags/paths.tx...
b5937f59a3e09bae8afe508fee42836b43efd320e35aa4ab356579bb7bcb5721
Python
323
13
#!/usr/bin/env python3 # 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 sys from pythainlp import word_tokenize for line in sys.stdin: print(" ".join(word_tokenize(line.strip())...
9682b07778e2abb2197300f7f29b457b6608fe107a70f6ca3aa836a4b7592ba7
Python
325
10
""" ViT-B/16 baseline using timm. """ from .common import TimmClassifier class ViTB16Classifier(TimmClassifier): def __init__(self, num_classes: int = 8, pretrained: bool = True, model_name: str = "vit_base_patch16_224"): super().__init__(model_name=model_name, num_classes=num_classes, pretrained=pretrai...
a0918101e873bb5218806b9936746e2a96f8592f8b8b21483b864006787a1206
Python
326
10
""" ViT-L/32 baseline using timm. """ from .common import TimmClassifier class ViTL32Classifier(TimmClassifier): def __init__(self, num_classes: int = 8, pretrained: bool = True, model_name: str = "vit_large_patch32_224"): super().__init__(model_name=model_name, num_classes=num_classes, pretrained=pretra...
ac4bfae716874c7ec82a4d2fb989cbf47205482e0edb5ac2f64105ccce937697
Python
326
10
from batchgenerators.transforms.abstract_transforms import AbstractTransform class RemoveKeyTransform(AbstractTransform): def __init__(self, key_to_remove: str): self.key_to_remove = key_to_remove def __call__(self, **data_dict): _ = data_dict.pop(self.key_to_remove, None) return data...
e1b811f324c6b1dc76f2534f58c431fe7cb9e502a6374f69de9e738d1f10bbd4
Python
326
14
import gl gl.resetdefaults() gl.azimuthelevation(240, 15) gl. azimuthelevation(240, 15); gl.meshload('AICHAhr.lh.mz3'); #format: atlashide(layer, (regions)) # gl.atlashide(0, (1, 2, 3, 12, 22, 44)); n = gl.atlasmaxindex(0) msk = () for i in range(n): msk = msk + (i,) gl.atlashide(0,msk) gl.wait(20); gl.atlashide(...
47511c1c3d52596c2e7477c9b022e655eece2dfeef89d3136924b1f44f9357d1
Python
329
18
from __future__ import annotations from setuptools import setup kwargs = dict( name="demo", license="MIT", version="0.1.2", description="Demo project.", author="Sébastien Eustace", author_email="sebastien@eustace.io", url="https://github.com/demo/demo", packages=["demo"], ) setup(**...
bc1f5b6260e80e78ce79f5fc8c47a4f25d6467f16941da50b498b7e4f896c7f4
Python
329
8
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from . import noisy_channel_translation # noqa from . import noisy_channel_sequence_generator # noqa from . import noisy_channel_beam_search...
e7118d9fdd80ffbebe5ad05190896ee163ceb4288c79de4949f4308c9494d407
Python
329
10
""" DeiT-Base baseline using timm. """ from .common import TimmClassifier class DeiTBaseClassifier(TimmClassifier): def __init__(self, num_classes: int = 8, pretrained: bool = True, model_name: str = "deit_base_patch16_224"): super().__init__(model_name=model_name, num_classes=num_classes, pretrained=pre...
605b4d57b6be42e02ad4d56d6f79764020bba4f3fb027f3d5bfb4ba36333991c
Python
330
9
# # 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 # # Path to the full size ImageNet validation JPEG images imagenet_val_path = "/path/to/Imag...
07c3bc2f1cbe4c94717b88853a638efb24c5cfdf90b54afbe80668f3701d8526
Python
332
15
from .._base import BaseExampleModel, DAGMixin class Mediator(DAGMixin, BaseExampleModel): """ Simple mediator DAG (X -> I -> Y, X <- Z -> I . """ _tags = { "name": "dagitty/mediator", "n_nodes": 4, "n_edges": 5, "is_parameterized": False, } data_url = "dags/me...
e1dc8e105a2d7ad47a16e6e4fcf82df518e08f0542462b395b24bce74abc5fcc
Python
333
10
""" MaxViT-Large baseline using timm. """ from .common import TimmClassifier class MaxViTLargeClassifier(TimmClassifier): def __init__(self, num_classes: int = 8, pretrained: bool = True, model_name: str = "maxvit_large_tf_224"): super().__init__(model_name=model_name, num_classes=num_classes, pretrained...
12b9264e05610c58089e4cd920dccdc27641c537e1c9bb11a76b5b342fdc0fe6
Python
335
23
#!/usr/bin/env python # -*- coding: utf-8 -*- from vlpp.realign import Realign def main(): pet = "${pet}" params = { "petPath": "${pet}", "dataset": "${dataset}", "ignore": "${realignParams.ignore}", } realign = Realign(**params) realign.run() if __name__ == '__main_...
069be8452b7c70ec6969df409d973efd67c80bd2e1c791fe9102c335d53a9767
Python
336
10
from __future__ import annotations from poetry.console.logging.formatters.builder_formatter import BuilderLogFormatter FORMATTERS = { "poetry.core.masonry.builders.builder": BuilderLogFormatter(), "poetry.core.masonry.builders.sdist": BuilderLogFormatter(), "poetry.core.masonry.builders.wheel": BuilderLo...
398c95c4c176cc284e5c2917baa43ce51fd83477acc2800b696da3f6c964949d
Python
336
21
""" Example ================================= One-line description """ import matplotlib.pyplot as plt import numpy as np x = 'hello_world' ######################################## # This is rendered text, and will break apart a notebook cell y = 'foo' print(x) plt.plot(np.random.rand(100), np.random.rand(100), ...
1047e9b18da733ba5e11f05253c6830581c8fd6c882b1034aafa197553bbddbf
Python
338
11
import pytest from pgmpy.structure_score import BDs class TestBDs: def test_score(self, bds_df, bds_models): m1, m2 = bds_models scorer = BDs(bds_df, equivalent_sample_size=1) assert scorer.score(m1) == pytest.approx(-36.82311976667139) assert scorer.score(m2) == pytest.approx(-45...
1445e924d70ec9e19b408e9392c131ab285b0963933fe98085bedc536fd52810
Python
338
15
from .._base import BaseExampleModel, BIFMixin class Cng(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/cng", "n_nodes": 86, "n_edges": 85, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_url ...
1f93767b9ff5d1a02a60afe9e4b095bd8a572a5b393f65e396dfc22886c19240
Python
338
15
from .._base import BaseExampleModel, BIFMixin class Tbm(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/tbm", "n_nodes": 10, "n_edges": 15, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_url ...
232239c72037776322532336e2f0b43bc1d5853bb1e6d50715da3a461b0e436c
Python
338
15
from .._base import BaseExampleModel, BIFMixin class Ets(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/ets", "n_nodes": 20, "n_edges": 32, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_url ...
3c79df6777b4d69922c67153be66236aa4b8ff751b3ce97b1e705f26bbe9c318
Python
339
15
from .._base import BaseExampleModel, BIFMixin class Soil(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/soil", "n_nodes": 6, "n_edges": 6, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_url ...
4639b494863af3a2901b5b4d20507ba031a87e14988c6e04432ee6a089246d2a
Python
339
17
"""Smoke tests: verify all four packages can be imported cleanly.""" def test_import_microcircuits(): import microcircuits # noqa: F401 def test_import_neuralsampling(): import neuralsampling # noqa: F401 def test_import_stddc(): import stddc # noqa: F401 def test_import_symmnet(): import sym...
572fac3576ab35ec887edb095940a152a4e7e61ccce211509c2a915de3b4028b
Python
339
9
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .qact import ActivationQuantizer # NOQA from .qconv import IntConv2d # NOQA from .qemb import IntEmbedding # NOQA from .qlinear import...
7844e39c3f38e090cb277b1cc9e0319b01dc18a69fb3199761856a34f723f636
Python
339
15
from .._base import BaseExampleModel, BIFMixin class Bank(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/bank", "n_nodes": 4, "n_edges": 5, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_url ...
8d9025a3797a7102d0e094d860ec9abe3f4a2e7b4390d17a7e01bbe4db1b45ad
Python
339
15
from .._base import BaseExampleModel, BIFMixin class Chds(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/chds", "n_nodes": 4, "n_edges": 3, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_url ...
fdcb4fcbe8c60773d9bec368053cd77ddc86c3c816fcafdbf5a0064fe2a00d80
Python
339
15
from .._base import BaseExampleModel, BIFMixin class Asia(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/asia", "n_nodes": 8, "n_edges": 8, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_url ...
1e4ac4700d97bb09a44933953fa6eea6c90ca00c6b975d699415c1ff6d1837fe
Python
341
15
from .._base import BaseExampleModel, BIFMixin class Fire(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/fire", "n_nodes": 11, "n_edges": 14, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
75613ce66cd289cd9df32b1f19a5628fcb8031b61e3b6dfb8b4c43c81bd379f8
Python
341
13
from .base import factor_divide, factor_product, factor_sum_product from .FactorDict import FactorDict from .FactorSet import FactorSet, factorset_divide, factorset_product __all__ = [ "FactorSet", "factorset_divide", "factorset_product", "factor_product", "factor_divide", "factor_sum_product",...
76a08484a79268a7b38e5faa17669654859ab980c015a0e09167061aa8af4275
Python
341
15
from .._base import BaseExampleModel, BIFMixin class Adhd(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/adhd", "n_nodes": 19, "n_edges": 18, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
f26cf382e4b4ab9de0fdd70c8977cefe01d42a92e5a2d35daa7f634f8c941123
Python
341
15
from .._base import BaseExampleModel, BIFMixin class Case(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/case", "n_nodes": 23, "n_edges": 35, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
46f8a3f9a031058eb9bc2fd12bc44713ae792991c58bdbc33f79fad84a04ba7d
Python
342
15
from .._base import BaseExampleModel, BIFMixin class Ricci(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/ricci", "n_nodes": 6, "n_edges": 6, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
53b7625b7c014d3f9df61e44d0b8b5db6564d76d32cc5186d7a0ad64fe566d1c
Python
342
15
from .._base import BaseExampleModel, BIFMixin class Metal(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/metal", "n_nodes": 8, "n_edges": 7, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
918330819aa50a2dc889beda139c73f37592e49d328f6afc0dbf0e6cd652257b
Python
342
15
from .._base import BaseExampleModel, BIFMixin class Beam2(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/beam2", "n_nodes": 6, "n_edges": 5, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
bbca7b3d90d6424f6f6dba92fc407a77a16387f2e999b5a764f1fa0772662e74
Python
342
15
from .._base import BaseExampleModel, BIFMixin class Lidar(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/lidar", "n_nodes": 9, "n_edges": 8, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
db9f36c2e1dc63f655bfef321a433f619131f33ad799021f4a4e76abcfb8446f
Python
342
15
from .._base import BaseExampleModel, BIFMixin class Wheat(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/wheat", "n_nodes": 5, "n_edges": 4, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
eb81c002a8f0ffd9ac718b1ce7d17a529b461766e5ddf4b3411ad285628611f7
Python
342
15
from .._base import BaseExampleModel, BIFMixin class Beam1(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/beam1", "n_nodes": 6, "n_edges": 5, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_ur...
f964d968623639bdbb7be8082a456e31e992ddde3069e106a5ffdd2e75d3ba38
Python
342
17
from .._base import BaseExampleModel, DAGMixin class MBias(DAGMixin, BaseExampleModel): """ References ---------- - :footcite:t:`acid_decampos_1996` """ _tags = { "name": "dagitty/m_bias", "n_nodes": 5, "n_edges": 5, "is_parameterized": False, } data_ur...
0afdafcad8f1eaaba5fb7a6b7a1fe8f58c466b811a98e27c8b71f29c9244992e
Python
344
15
from .._base import BaseExampleModel, BIFMixin class Flood(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/flood", "n_nodes": 22, "n_edges": 42, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_...
bb2236c6a6bf1497aa4eced9ef965474b199cd28b310cba7e449e697d1c02c1d
Python
344
15
from .._base import BaseExampleModel, BIFMixin class Pilot(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/pilot", "n_nodes": 42, "n_edges": 41, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_...
0dddc66706dc05c6df128545e3329211d0a46620dd789b43d7a7aead0d977e68
Python
345
15
from .._base import BaseExampleModel, BIFMixin class Theft1(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/theft1", "n_nodes": 4, "n_edges": 3, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_...
0f2d29fc6f5dc9633b294598095d560e37e6f739425ffa2e0f030d75f5fb6b0e
Python
345
16
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .loss import * from .nce import * try: from .fairseqmmloss import * except ImportError: pass try: from .expnce import * exce...
26d4d3773bc4645da8087db41a57ebde750766a28deaac7eb686fcfa91cda06a
Python
345
15
from .._base import BaseExampleModel, BIFMixin class Crypto(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/crypto", "n_nodes": 6, "n_edges": 4, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_...
493f8159b96f1e6e070acdf361efec3b87f0db15a34a64e88b1410621c7c27b6
Python
345
15
from .._base import BaseExampleModel, BIFMixin class Algal1(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/algal1", "n_nodes": 9, "n_edges": 9, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_...
7c5a39cd5b94d81ca53c968a8d9d368dc8c6684b09351923b33202a78e8d5314
Python
345
15
from .._base import BaseExampleModel, BIFMixin class Bullet(BIFMixin, BaseExampleModel): _tags = { "name": "bnrep/bullet", "n_nodes": 5, "n_edges": 7, "is_parameterized": True, "is_discrete": True, "is_continuous": False, "is_hybrid": False, } data_...