sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
a8fd493fcec0f38104c55ea3df9b9f5aa0e804af08aae861b174ecd21170d9bc | Python | 368 | 15 | from .._base import BaseExampleModel, BIFMixin
class Softwarelogs3(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/softwarelogs3",
"n_nodes": 14,
"n_edges": 13,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False,
... |
b598c64cb60266d2b4f9d21c7cb89ba2f0cdde97cc7c86ecacd7206956f5fe1f | Python | 368 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Building(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/building",
"n_nodes": 24,
"n_edges": 32,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid": Fal... |
e1bb3aa0b25121dab70a0afbd9fbb28d16edb6a197609d7f9f1e3bf44baf8917 | Python | 368 | 15 | from .._base import BaseExampleModel, BIFMixin
class Airegulation3(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/airegulation3",
"n_nodes": 19,
"n_edges": 37,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False,
... |
e81318668b69076281327e2a7ddc6ccfba2f2750d78b7ee9f19a4a3daa88b079 | Python | 368 | 15 | from .._base import BaseExampleModel, BIFMixin
class Agropastoral1(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/agropastoral1",
"n_nodes": 15,
"n_edges": 12,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False,
... |
ea733e53e4c5d0d625f50435b617be49467b5a148a693283e3fa5a7a26338f84 | Python | 368 | 15 | from .._base import BaseExampleModel, BIFMixin
class Softwarelogs2(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/softwarelogs2",
"n_nodes": 40,
"n_edges": 67,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False,
... |
f48c8cf847cb8755cd45fa02bf5decb23443d0bdb5b7630f20591d24c4115bf2 | Python | 368 | 17 | from .._base import BaseExampleModel, DAGMixin
class Sebastiani2005(DAGMixin, BaseExampleModel):
"""
References
----------
- :footcite:t:`sebastiani_2005`
"""
_tags = {
"name": "dagitty/sebastiani_2005",
"n_nodes": 36,
"n_edges": 60,
"is_parameterized": False,
... |
2faf51e95a7c0733165aa22c567385b1f6ddac1da82159a278bb57252d9448cb | Python | 369 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Cachexia1(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/cachexia1",
"n_nodes": 6,
"n_edges": 8,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid": Fal... |
309ce4beee3e6f032eb49dc1cec624ecafc01efe5f460929b7373172aa204286 | Python | 369 | 15 | from .._base import BaseExampleModel, BIFMixin
class Corticosteroid(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/corticosteroid",
"n_nodes": 3,
"n_edges": 3,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False,
... |
42c298bb5272798107715317c67348ffbd24d3c581bab556f321421c1e749191 | Python | 369 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Cachexia2(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/cachexia2",
"n_nodes": 6,
"n_edges": 8,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid": Fal... |
5ae06d38c8056a2341be48d0f35df4b4f6a54feeb8a20183c67a9f1fb1789a0e | Python | 370 | 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 .extracted_features_dataset import ExtractedFeaturesDataset
from .random_input_dataset import RandomInputDataset
__all__ = [
"Extra... |
94753dcc9db37ea22aa1afa0ec22d712b61dc1dead7d005017baa634229b5bcd | Python | 370 | 15 | from .._base import BaseExampleModel, BIFMixin
class Algalactivity2(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/algalactivity2",
"n_nodes": 8,
"n_edges": 15,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False,... |
ea5d0ae4826508405120072680dfb289959d1a1b63abca7d20321d434fd2d69f | Python | 370 | 15 | from .._base import BaseExampleModel, BIFMixin
class Algalactivity1(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/algalactivity1",
"n_nodes": 8,
"n_edges": 10,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False,... |
44623bc85f1e28741e8a1957f89db4c72969892e87cbb733434498c5aeff2c12 | Python | 371 | 15 | from .._base import BaseExampleModel, BIFMixin
class Nanomaterials1(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/nanomaterials1",
"n_nodes": 49,
"n_edges": 48,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False... |
65cff5ba5aa40b936a3a7ee26cc56f211f5a48899e2d529a14eb1dd049897818 | Python | 371 | 15 | from .._base import BaseExampleModel, BIFMixin
class Nuisancegrowth(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/nuisancegrowth",
"n_nodes": 19,
"n_edges": 24,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False... |
91a32360300139862adc8b672cae9890b09913dcba1241fd6b416765750cd211 | Python | 371 | 10 | import neuroglancer
def test_visible():
layer = neuroglancer.ManagedLayer("a", {"type": "segmentation", "visible": False})
assert layer.name == "a"
assert layer.visible is False
assert layer.to_json() == {"name": "a", "type": "segmentation", "visible": False}
layer.visible = True
assert layer.... |
9c2322282dc0420cb536042cc4f979a24ab2b07bb52640807b75434d7a865ba3 | Python | 371 | 15 | from .._base import BaseExampleModel, BIFMixin
class Cardiovascular(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/cardiovascular",
"n_nodes": 13,
"n_edges": 40,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False... |
9de9be29685761a74cf4397af1640e6171595ba998fe5d510d075e472b8764d8 | Python | 371 | 15 | from ._version import __version__
from .annotation import *
from .clustering import *
from .decomposition import *
from .embedding import *
from .enrichment import *
from .manifold import *
from .metrics import *
#from .pipeline import *
from .preprocessing import *
from .postprocessing import *
from .species import *
... |
c54cfdec7e5ddb332f8aa50c9a82343e2573c9085a4ce6e7e5ffd5abd2a282b1 | Python | 371 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Diagnosis(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/diagnosis",
"n_nodes": 16,
"n_edges": 15,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid": F... |
ccc2931f80bcd6340b748cac58356933cc1dcfef5a1e444ca7a55aa16cd664b1 | Python | 371 | 15 | from .._base import BaseExampleModel, BIFMixin
class Aerialvehicles(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/aerialvehicles",
"n_nodes": 39,
"n_edges": 41,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False... |
cf9e563c694d4924a3cf30d71f3e54c1f63fae83025711d3266d73ef709a3bb8 | Python | 371 | 15 | from .._base import BaseExampleModel, BIFMixin
class Nanomaterials2(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/nanomaterials2",
"n_nodes": 46,
"n_edges": 45,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False... |
db86872cc93c1b2c70501c5b45b0f355d997a192f003af6a2b197deca8f949e0 | Python | 371 | 18 | # Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
x = {'a': 37, 'b': 42, 'c': 927}
y = 'hello ' 'world'
z = 'hello ' + 'world'
a = 'hello {}'.format('world')
class foo(object):
def f(self):
return 37 * -+2
def g(self, x, y=42):
ret... |
f6aa081f8b6ac40c741eb45ba5b496ccc454727f6b3d10c588b8e9cce04c56e1 | Python | 372 | 15 | from .._base import BaseExampleModel, BIFMixin
class Hydraulicsystem(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/hydraulicsystem",
"n_nodes": 4,
"n_edges": 3,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": False... |
2fa8b8c6d00d5114ab58afafbb746f309d4f30739b01859afde57becb9232cca | Python | 373 | 14 | from mdt import CompositeModelTemplate
__author__ = 'Robbert Harms'
__date__ = "2015-06-22"
__maintainer__ = "Robbert Harms"
__email__ = "robbert@xkls.nl"
class Kurtosis(CompositeModelTemplate):
"""The standard Kurtosis model with in vivo defaults."""
model_expression = '''
S0 * KurtosisTensor
''... |
e1c33e0ed5c8097e60b736d501e5e83b848701ab4956b3d076731322f9e72544 | Python | 373 | 19 | # Written by Nanbo Sun and CBIG under MIT license:
# https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
x = {'a': 37, 'b': 42, 'c': 927}
y = 'hello ' 'world'
z = 'hello ' + 'world'
a = 'hello {}'.format('world')
class foo(object):
def f(self):
return 37 * -+2
def g(self, x, y=42):
r... |
1b39c5a09a98f6bd01e68795b7b674e8bc691ea37e2b8b637e842810c259b5de | Python | 374 | 15 | from .._base import BaseExampleModel, BIFMixin
class Intensification(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/intensification",
"n_nodes": 16,
"n_edges": 29,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": Fal... |
5e9bfb537673c7d1492c211b16ad12b70b3a1fd257d18f6dd4402270b2a1149b | Python | 374 | 7 | from .model.model import MulanConfig, scMulanModel
from .model.model_kvcache import scMulanModel_kv
from .utils.hf_tokenizer import scMulanTokenizer
from .scMulan import model_inference
from .scMulan_npu import model_inference_npu
from .reference.GeneSymbolUniform.pyGSUni import GeneSymbolUniform
from .utils.utils imp... |
dfe8e1c3063c1ba355381f8f17e820c52945d35d48bae88f0784cd327e0c4969 | Python | 374 | 15 | from .._base import BaseExampleModel, BIFMixin
class Electricvehicle(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/electricvehicle",
"n_nodes": 23,
"n_edges": 22,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": Fal... |
f16b1f9d3607f0e95a123a027a6b94a178df6795b696cae5d9cd9b8ae82967d1 | Python | 374 | 16 | from __future__ import annotations
from poetry.core.masonry.builders.sdist import SdistBuilder
from poetry.core.masonry.builders.wheel import WheelBuilder
from poetry.masonry.builders.editable import EditableBuilder
__all__ = ["BUILD_FORMATS", "EditableBuilder"]
# might be extended by plugins
BUILD_FORMATS = {
... |
1a41bdfa6b1d44ae99cdc7314dff57c571661c366760c3e6c5bea90f1526eadc | Python | 375 | 13 | from typing import Union, Tuple, List
import numpy as np
import torch
def no_resampling_hack(
data: Union[torch.Tensor, np.ndarray],
new_shape: Union[Tuple[int, ...], List[int], np.ndarray],
current_spacing: Union[Tuple[float, ...], List[float], np.ndarray],
new_spacing: Union[Tuple[f... |
60ae80b921316e8855a01bf2aeff6a326ed8b5990385c0d785121d453d3592ae | Python | 375 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Algorithms1(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/algorithms1",
"n_nodes": 4,
"n_edges": 3,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid":... |
8315dc357d2db54435a02973fd2da6f0ec44c9f9de8608f2bb746c7cc728ba75 | Python | 375 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Algorithms2(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/algorithms2",
"n_nodes": 4,
"n_edges": 4,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid":... |
957683ea772a9304e6d39cc8c368faecd30416793e6cd8fcbe60e366304dea8d | Python | 375 | 13 | import os
def check_golden_contents(path, expected_contents, write=None):
if write is None:
write = os.getenv("NEUROGLANCER_GENERATE_GOLDEN") == "1"
if write:
with open(path, "wb") as f:
f.write(expected_contents)
else:
with open(path, "rb") as f:
contents =... |
7c28f53435b0b84727b4284d3f11654c26592f8173b88ddc8d07c9bb641ec778 | Python | 376 | 12 | from cookiecutter.main import cookiecutter as cc
import ruamel.yaml as yaml
import os
settings_fname = os.path.join(os.path.dirname(__file__), '.cookiecutter.yaml')
settings = yaml.safe_load(open(settings_fname, 'r'))['default_context']
cc(settings['_template'],
output_dir="../..",
config_file=".cookiecutter.... |
5dbf8595f49a5cbe11513ae702ab289234d23fae529d1804fce7cd8b9c2e5965 | Python | 377 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Expenditure(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/expenditure",
"n_nodes": 12,
"n_edges": 20,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid... |
6af763e02fce053877d4fc451fb242a069fb14da081abe3dab3f84c24ba4d462 | Python | 377 | 15 | from .._base import BaseExampleModel, BIFMixin
class ConsequenceCovid(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/consequenceCovid",
"n_nodes": 15,
"n_edges": 34,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": F... |
e66d64ac483e4b60088052e596b14cdf61c0e5794e2a741fb0ee77c9a33224d5 | Python | 377 | 10 | from .parcellation import (relabel_consecutive, parcel_to_surface, surface_to_parcel, subcorticalvertices)
from .useful import (zscore_matrix, reorder_sctx)
__all__ = ['relabel_consecutive',
'parcel_to_surface',
'parcel_to_surface',
'surface_to_parcel',
'subcorticalvertices'... |
ecbc1e3e106bbd90a11d418282df9b7f06ea5cd3a2b83a2a0051bf2366786c4c | Python | 377 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Suffocation(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/suffocation",
"n_nodes": 35,
"n_edges": 34,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid... |
2892b299d8e1a3dedef96c8c6aa9d11dca939615c4181085c2e2a5ff0dd407b6 | Python | 378 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Foodsecurity(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/foodsecurity",
"n_nodes": 4,
"n_edges": 4,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybrid... |
602f3c04c17b5e7f15d7975bc2107dcca97587173fff029bda6f4e6aa72a4960 | Python | 378 | 8 | FRAMES_PATH_COL_NAME = "frames_path"
MULTI_FRAME_LABELS_EXT = ".multi-frame-labels.npy"
MULTI_FRAME_LABELS_PATH_COL_NAME = "multi_frame_labels_path"
ANNOTATION_CSV_FILENAME = "y.csv"
SAMPLE_IDS_ARRAY_FILENAME = "sample_ids.npy"
INDS_IN_SAMPLE_ARRAY_FILENAME = "inds_in_sample.npy"
WINDOW_INDS_ARRAY_FILENAME = "window_in... |
620249103d010235517014651bb4200034f690892f3466d8bead50bafb2a2256 | Python | 378 | 15 | from .._base import BaseExampleModel, BIFMixin
class Soilliquefaction1(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/soilliquefaction1",
"n_nodes": 7,
"n_edges": 6,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": F... |
6d750ea6c29322d2427f68685e68d1188da3d916bd061f090eb5a70c21b1df92 | Python | 378 | 15 | from .._base import BaseExampleModel, BIFMixin
class Soilliquefaction2(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/soilliquefaction2",
"n_nodes": 7,
"n_edges": 6,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": F... |
cb6976921204f02c4012df541c33520afea9e1cd3ab32e20136fdb377f9f57c3 | Python | 378 | 15 | from .._base import BaseExampleModel, BIFMixin
class Soilliquefaction4(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/soilliquefaction4",
"n_nodes": 7,
"n_edges": 6,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": F... |
8bc3a63c44326d99f339ada9c97d1e7ba4fcc98d35d0637a971c1b281e8d4b1e | Python | 379 | 17 | from .annot import *
from .audio import *
from .config import *
from .csv import *
from .das import *
from .dataframe import *
from .dataset import *
from .device import *
from .trainer import *
from .model import *
from .path import *
from .source_files import *
from .spect import *
from .split import *
from .test_dat... |
bb19b8d6e4858eac3fd65f575af77be44c24921d1634ca38178b916eec91361c | Python | 379 | 15 | from .._base import BaseExampleModel, BIFMixin
class Soilliquefaction3(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/soilliquefaction3",
"n_nodes": 7,
"n_edges": 12,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid": ... |
09f0508d493d2b6ba7f85592eccca9d6dcd10facc26b90d6299250fab23e12a4 | Python | 380 | 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 . import multilingual_translation_latent_depth # noqa
from .loss import latent_depth # noqa
from .models import latent_multilingual_tra... |
52e91bab7413a3c81fdff2a708e58388600fbd4c6a11f0832243dd80028921d3 | Python | 380 | 15 | from .._base import BaseExampleModel, ContinuousMixin
class Liquefaction(ContinuousMixin, BaseExampleModel):
_tags = {
"name": "bnrep/liquefaction",
"n_nodes": 10,
"n_edges": 15,
"is_parameterized": True,
"is_discrete": False,
"is_continuous": True,
"is_hybr... |
af88d41e801da34d62e7b174fc13c5cc2b6d8095b36a61f83ff1d8032977f1f9 | Python | 380 | 15 | from .._base import BaseExampleModel, BIFMixin
class Projectmanagement(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/projectmanagement",
"n_nodes": 26,
"n_edges": 35,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid":... |
da47d3a2c380bfece622c1ab706157b7621d6099f473f1daeb6a84fa47e68b49 | Python | 380 | 15 | # Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
x = { 'a':37,'b':42,
'c':927}
y = 'hello ''world'
z = 'hello '+'world'
a = 'hello {}'.format('world')
class foo ( object ):
def f (self ):
return 37*-+2
def g(self, x,y=42):
r... |
6cfee84d2b1a68ed7c4b4a0239e868e26c0d1c24f0c2a7b3a3bba34694f57e5f | Python | 381 | 16 | from .models.SOFA import SOFA
from . import plots as pl
from . import utils as tl
import toml
from pathlib import Path
def get_version():
path = Path(__file__).resolve().parents[1] / 'pyproject.toml'
print(path)
pyproject = toml.loads(open(str(path)).read())
return pyproject['tool']['poetry']['version']
... |
73aaee9d7f3469e1058dc288b66ab7009edc77b8ef55001e5e71ab2e3fd0827b | Python | 381 | 12 | import importlib
def test_package_imports():
assert importlib.import_module("paper2") is not None
def test_data_files_present():
from kanfood._paths import data_path
d = data_path("KAN2_DIR", "data", "kan2")
for fn in ["zeytinyağı tağşiş.xlsx", "Kahve_Tağşiş.xlsx", "meyve suyu tağşiş.xlsx"]:
... |
af4403c7bc24d5d8b8511d6bb3bb34c85c340c99e071a8dd6cd78464da4c5d6f | Python | 381 | 15 | from .._base import BaseExampleModel, BIFMixin
class Intentionalattacks(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/intentionalattacks",
"n_nodes": 8,
"n_edges": 7,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid":... |
22b6844b66f355db49ad84114079bab5515d8df00113f785f05cd629ea437b92 | Python | 382 | 16 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='ambiguous',
version='0.0.0',
description='Describe Your Cool Project',
author='',
author_email='',
# REPLACE WITH YOUR OWN GITHUB PROJECT LINK
url='https://github.com/ABL-Lab/ambiguous-dataset',
#install_req... |
ba7f916b331c7c59eafb977978dbf99d9658aeaed9f1648d29528393099a060c | Python | 383 | 8 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Default threshold (eV/atom above hull) we use to consider a structure stable
DEFAULT_STABILITY_THRESHOLD = 0.1
# Increased RMSD threshold used for structure matching in the context of RMSD metrics
# This increased cutoff is needed to get an ato... |
3a290637a607361b47d0aa32bc6f66b2bf31a5fdf760178f4b7ecc6d4bbdf796 | Python | 384 | 15 | from .._base import BaseExampleModel, BIFMixin
class Adversarialbehavior(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/adversarialbehavior",
"n_nodes": 4,
"n_edges": 4,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
"is_hybrid... |
9598650791f9577f2036d8351dd7889ea38846c56515cfbcee88efda87bf794f | Python | 384 | 21 | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from poetry.poetry import Poetry
from poetry.utils.env import EnvManager
@pytest.fixture
def venv_name(
manager: EnvManager,
poetry: Poetry,
) -> str:
return manager.generate_env_name(
p... |
f400005f3f47f575b85211112efe6367c6f7c71c3d0829c14c99a631b2d409e6 | Python | 385 | 15 | from line_profiler import LineProfiler
from functools import wraps
# 查询接口中每行代码执行的时间
def func_line_time(f):
@wraps(f)
def decorator(*args, **kwargs):
func_return = f(*args, **kwargs)
lp = LineProfiler()
lp_wrap = lp(f)
lp_wrap(*args, **kwargs)
lp.print_stats()
ret... |
60c107177919ea6ba0ad31caa583f27c09b583e26c3a6727d5ad61277c3dbe8f | Python | 386 | 11 | # 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 .hub_interface import * # noqa
from .model import * # noqa
from .enc_dec import * # noqa
from .model_camembert import * # noqa
from .... |
b8c5e5055bb3db56156be0202be1bba32dc71498dc1cc2e5c8624fdc2b40be34 | Python | 387 | 15 |
import numpy as np
from sklearn.decomposition import PCA
def effective_dim(eigvals: np.ndarray) -> float:
squared_sum = np.sum(eigvals) ** 2
sum_of_squares = np.sum(eigvals ** 2)
effective_dim = squared_sum / sum_of_squares
return effective_dim
def compute_eigvals(features: np.ndarray) -> np.ndarra... |
34d29fd7c7a28282c3cf05a160bf3902d05981ce1eb748dc5041de275b29899b | Python | 389 | 14 | import numpy as np
def metric(pred_data, pred_path):
"""
INPUT: a tuple of (predict, label)
output prob_file
"""
pred_label = pred_data
for id, y_pred in pred_label:
y_pred = y_pred.cpu().numpy() # GPU data to CPU
y_pred = np.squeeze(y_pred)
pred_file = pred_path + "{}... |
28019c2851890d42a11fdae6855838e160f3c034138004e6e08b2d3a140dc841 | Python | 390 | 16 | from mdt import CompartmentTemplate
__author__ = 'Robbert Harms'
__date__ = "2015-06-21"
__maintainer__ = "Robbert Harms"
__email__ = "robbert@xkls.nl"
class Stick(CompartmentTemplate):
parameters = ('g', 'b', 'd', 'theta', 'phi')
dependencies = ['SphericalToCartesian']
cl_code = '''
return exp... |
389bfed7e33aa96724a33aa834828cedc3addf9be7e1033d706ab6b509b1eedf | Python | 390 | 11 | __author__ = 'heroico'
from . import DataSet
class DataSetSNP(DataSet.DataSet):
"""" A dat aset form an snp """
def __init__(self, name=None, index=None, data=[], position=None, ref_allele=None, eff_allele=None):
super(DataSetSNP, self).__init__(name, index, data)
self.position = position
... |
5281ca11dc978f47ec1fdcb49c248e97162692d5e3b691baac84f934b5e46381 | Python | 390 | 8 | # file for storing variables
filepath = ''
conditions = ['AS', 'brain_tumours', 'celiac', 'CHD', 'colon_cancer', 'COPD', 'IBD', 'lung_cancer', 'lyme', 'MS', 'ovarian_cancer', 'pancreatic_cancer', 'parkinsons', 'PCOS', 'RA', 'SBE', 'schizophrenia', 'TB']
# sql schemas/tables that are called
sql_schema = 'atlas_eme... |
af0c3b5ac6136b5643e5dd99dd9f26ef2a2fd26ed18defd409ab158889060ad1 | Python | 390 | 15 | from ._constants import VIVS_REGISTRY_KEYS
from ._model import VIVS
from ._module import ImportanceScoreNet, VIVSModule
from ._plotting import plot_hier_importance
from ._utils import select_architecture, select_genes
__all__ = [
"VIVS",
"VIVSModule",
"ImportanceScoreNet",
"VIVS_REGISTRY_KEYS",
"se... |
fed3d3f222c35adc4d8b769852ec22745da95c06b695457fd7a44b4e5a3d6ed9 | Python | 392 | 16 | import cv2 as cv
import numpy as np
def combine_masks_union(masks):
united_mask = masks[0]
for i in range(1, len(masks)):
united_mask = cv.bitwise_or(united_mask, masks[i])
return united_mask
def combine_masks_soft_voting(masks, threshold = 128):
avg_mask = np.mean(masks, axis=0)
avg = (... |
741375a2c5cf51201315313adb8e63cf80e242af517de0ae5deeece52ca5ceed | Python | 393 | 20 | import numpy as np
# Colours and types
Types = np.array(["T4", "T5"])
Type_colours = np.array(["#17becf", "#ff7f0e"])
Subtypes = np.array(["T4a", "T4b", "T4c", "T4d", "T5a", "T5b", "T5c", "T5d"])
Subtype_colours = np.array(
[
"#1f77b4",
"#9edae5",
"#98df8a",
"#bcbd22",
"#d6... |
98a2539bc2f079b30426b2b5149b8a9736b332027886b6ec4aa271a64206e3d3 | Python | 394 | 14 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from enum import Enum, auto
clas... |
9effe895f7e43d75454d0511c565eae0ee6b055b2804637708c4e237c1dfcd50 | Python | 394 | 12 | # 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.
try:
# fairseq user dir
from .datasets import FairseqMMDataset
from .losses import FairseqCriterion
from .models import Fairseq... |
0b59ad613e052bc817a76155ff6e2f6ac9d0a8d19172be6a753287959ae406ec | Python | 395 | 17 | # 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 .mmfusion import *
from .transformermodel import *
from .mmfusionnlg import *
try:
from .fairseqmmmodel import *
except ImportError:
... |
3edd0a7d8d840e2e404cae109cd4e102de8db4a79c6b25cfa27f8d177f451d4e | Python | 395 | 14 | """Register dynamic_segmentation_CID task (standalone Simulation + CID package)."""
from __future__ import annotations
from dlbase.registry import register_task
def _register_builtin_tasks() -> None:
from tasks.dynamic_segmentation_CID import DynamicSegmentationCIDTask
register_task("dynamic_segm... |
d1cd78eaa495102eb65f290f629a9e5da39d37e6726c7e284616e4c4ca4b60ca | Python | 395 | 3 | from .plots import plot_factor_metadata_cor, plot_fit, plot_top_loadings, plot_variance_explained, plot_variance_explained_view, plot_variance_explained_factor, plot_loadings, plot_enrichment
__all__ = ['plot_factor_metadata_cor', 'plot_fit', 'plot_top_loadings', 'plot_variance_explained', 'plot_variance_explained_vi... |
78b95a758b4f5d00e11304793a43345e7fcce6b751dd432a9ee0b9bd2da976ae | Python | 396 | 6 | from .multimodal_model import MultiModalCVAE, MultiModalCVAETrainModule, CVAEConfig, ExperimentConfigs
from .dataloading import MultiModalEphysDataset, EphysDatasetLabeled, none_safe_collate
from .augmentations import AugmentedMultiModalEphysDataset
from .backbones import ResNet18Enc, ResNet18Dec
from .inference import... |
b5f1ec60aca1ff058ecd91bcdedd33696c5239900b5af3e85bb4a3df33860d09 | Python | 397 | 15 | from ._constants import CYTOVI_REGISTRY_KEYS
from ._model import CYTOVI
from ._module import CytoVAE
from ._plotting import plot_biaxial, plot_histogram
from ._preprocessing import (
mask_markers,
merge_batches,
register_nan_layer,
scale,
subsample,
transform_arcsinh,
)
from ._read_write import ... |
1d0138cc7f01ba9693399f476783f57ee0ee9d2919cac4a356a114e91c2730fc | Python | 398 | 18 | from rinalmo.utils.download import download_spot_rna_bprna, download_archiveII_fam_splits
from pathlib import Path
data_root = Path('../data')
TRAIN_DIR_NAME = "train"
VAL_DIR_NAME = "valid"
TEST_DIR_NAME = "test"
download_spot_rna_bprna(
data_root/"bpRNA", train_dir_name=TRAIN_DIR_NAME,
... |
03b6e0d1d49edc26e943116f87094fdb873acf2f9b901903b8f57b3a25c943ae | Python | 399 | 15 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from tractseg.experiments.tract_seg import Config as TractSegConfig
class Config(TractSegConfig):
EXP_NAME = os.path.basename(__file__).split(".")[0]
DAUG_ROTATE = True
SPATIAL_TRANSFORM = "SpatialTransformPeaks"
# rotation: 2*np.pi = 360 degre... |
59832ca8a435fe7b3f1eac69d0492226de55b268332a832b08d7d2994f5c6e71 | Python | 399 | 15 |
# You can also put your plugins in ~/.phy/plugins/.
from phy import IPlugin
# Plugin example:
#
# class MyPlugin(IPlugin):
# def attach_to_cli(self, cli):
# # you can create phy subcommands here with click
# pass
c = get_config()
c.Plugins.dirs = [r'/home/julie/.phy/plugins']
c.TemplateGUI.plugi... |
478e6334be5cd7bfae106a7e576849f46eb872fc95ecfd31f2f453e7d49471eb | Python | 400 | 13 | import logging
from os.path import join
def save_prediction(directory, info, y_pred, y_test, model_name, training=False):
if training:
file_name = join(directory, model_name + '_traing.csv')
else:
file_name = join(directory, model_name + '_testing.csv')
logging.info("saving : %s" % file_na... |
da4b865b60c3c1259678bc7147ce9917ff9191d8ef2d1a0a6e7d7428e33fc7be | Python | 400 | 10 | # 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 .version import version as __version__ # noqa
from .data import Alphabet, BatchConverter, FastaBatchedDataset # noqa
from .model imp... |
e50e9cfec78fa6eb13a851f332f1e29842ab5e88a4f138dd01504d978b9681fa | Python | 400 | 16 | import pytest
import numpy as np
import os
#rom ecephys_spike_sorting.modules.extract_from_npx.create_settings_json import create_settings_json
#import ecephys_spike_sorting.common.utils as utils
#DATA_DIR = os.environ.get('ECEPHYS_SPIKE_SORTING_DATA', False)
def test_extract_from_npx():
pass
#input_xml = os.... |
4102fd923220583ede84ff4ef99a21b999bf296ec191a045e18b896654e7431d | Python | 401 | 15 | from .._base import BaseExampleModel, BIFMixin
class Constructionproductivity(BIFMixin, BaseExampleModel):
_tags = {
"name": "bnrep/constructionproductivity",
"n_nodes": 18,
"n_edges": 19,
"is_parameterized": True,
"is_discrete": True,
"is_continuous": False,
... |
afb3624a240783c9fdd549cf5dfc8837243b871b60c394b3c2ab5064b1cd0bb5 | Python | 402 | 18 | from __future__ import annotations
from setuptools import find_packages
from setuptools import setup
setup(
name="namespace_package_one",
version="1.0.0",
description="",
long_description="",
author="Python Poetry",
author_email="noreply@python-poetry.org",
license="MIT",
packages=fin... |
4d76cbf6644c6efb6daa00c32fc45da8c31dec2dccd2d80e03cf627cd6e6e68e | Python | 404 | 17 | # 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 FairseqDataset
class NumSamplesDataset(FairseqDataset):
def __getitem__(self, index):
return 1
def __len__(se... |
5f9d9455b28bc798ab8c241dd57b611ac8ccaff5588edf42cd3347d6a0c45a47 | Python | 406 | 15 | import xarray as xr
import click
def print_dataset(ds: xr.Dataset):
chunking = xr.open_zarr(ds, 'chunking')
nr_chunks = chunking.sizes['chunk']
click.echo(f"Number of chunks: {nr_chunks}")
for chunk in range(nr_chunks):
click.secho(f"\nChunk {chunk}:", bold=True)
chunk = xr.open_zarr(... |
428ca46a2347614ed1a92b6412d2ece616b8bb559cad38eef48a1a1fb91c1d95 | Python | 407 | 19 | from __future__ import annotations
import re
wheel_file_re = re.compile(
r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d[^-]*))"
r"(-(?P<build>\d[^-]*))?"
r"-(?P<pyver>[^-]+)"
r"-(?P<abi>[^-]+)"
r"-(?P<plat>[^-]+)"
r"\.whl$",
re.VERBOSE,
)
sdist_file_re = re.compile(
r"^(?P<namever>(?P<name>... |
44968ebd1ca1e0120841c1fda2e62ee9d5544cb22d74990535660b39bfb6895d | Python | 407 | 20 | from pgmpy.datasets._base import BaseCovarianceDataset
class Lead(BaseCovarianceDataset):
_tags = {
"name": "lead",
"n_variables": 7,
"n_samples": 221,
"is_continuous": True,
}
base_url = "real/lead"
data_url = "data/lead.cov.txt"
ground_truth_url = None
expe... |
7bac39082e1bc575c601007455488b8fd50c764589617f5adf49f2d2e66e9cd7 | Python | 407 | 16 | """GUI file-dialog helpers."""
from __future__ import annotations
from PySide6.QtWidgets import QFileDialog, QWidget
def select_csv_file(parent: QWidget | None = None) -> str:
"""Open a file dialog and return the selected CSV file path."""
file_path, _ = QFileDialog.getOpenFileName(
parent,
... |
0fa1faee32daa34555f4487715988d17af16d70dbea7308b3e1aaff7957e7eaf | Python | 410 | 12 | """Unpack dataloader batches: Simulation adds ``ground_truth_instance`` as 14th element."""
from __future__ import annotations
def unpack_seg_batch(batch_data):
"""Support Simulation 14-tuple (``ground_truth_instance``) vs 13-tuple for other datasets."""
bl = list(batch_data)
if len(bl) == 14:
... |
1e8298d7d2384545360f8a53e00fac76928f4c9fe5aacd091228a43bfaf142ee | Python | 413 | 14 | from mdt.component_templates.compartment_models import CompartmentTemplate
__author__ = 'Robbert Harms'
__date__ = "2015-06-21"
__maintainer__ = "Robbert Harms"
__email__ = "robbert@xkls.nl"
class SphereGPD(CompartmentTemplate):
parameters = ('G', 'Delta', 'delta', 'd', 'R')
dependencies = ('VanGelderenSpher... |
887deda162f6033e94a68620bc0120fb81f7ac1dd72c9088223fe9d9adefc336 | Python | 413 | 12 | from ml_collections.config_dict import FrozenConfigDict
class attrdict(FrozenConfigDict):
"""A dictionary that allows for attribute-style access.
Dummy class that allows for backwards compatibility with the previous custom ``attrdict``.
Inherits from :class:`~ml_collections.config_dict.FrozenConfigDict`.... |
2862a976d4d7be33559cd71d36d2ea6320d6e3c53a1d4c3b34c4606723704da9 | Python | 414 | 16 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from tractseg.experiments.base_legacy.tract_seg_legacy import Config as TractSegConfig
#todo: remove this model when CSD+BX input properly integrated
class Config(TractSegConfig):
EXP_NAME = os.path.basename(__file__).split(".")[0]
DATASET_FOLDER = "HC... |
6f24830e2061ac05a153bd9d107d7b650194ad65eb6c36e2a190d9062f179387 | Python | 414 | 21 | """Preprocessing"""
from ._utils import (
get_centroids,
summarize_clustering,
drop_zero_variability_columns,
robust_svd,
svd_embedding,
tfidf,
GeneScores,
gene_scores,
)
from ._graph import get_nearest_neighbors
from .preprocess_utils import (
preprocessing_rna,
preprocessing_... |
6f9f23f4fd7931674b1b046a5ab064f4c5b03efbb4cca6c0b353c16324950974 | Python | 415 | 14 | import gl
gl.resetdefaults()
gl.meshload('lh.pial')
gl.overlayload('boggle.lh.annot')
#make contour at border of atlas
gl.contour(0)
#reduce atlas salience:
gl.atlassaturationalpha(0.2, 0.5)
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(gl.overlaycount(),-2,-3)
#hide statistical map:
gl.overlayopac... |
3c762da95a57de68d94f7cac4799e843278516107bb4ef9a4db089c08059a2d0 | Python | 416 | 19 | from __future__ import annotations
from setuptools import setup
kwargs = dict(
name="project-with-setup",
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=["my_pac... |
f898773e05ef979ecab6d2eaa10fcd9ae69c5989fd0f6a803a649f4c9375d5ca | Python | 416 | 20 | import dask.bag as db
from ..dask_config import get_dask_client
def evenly_parallelize(input_list: list) -> db.Bag:
"""
Return a Dask bag from the input list using configured Dask client.
Parameters
----------
input_list : list
List of input elements.
Returns
-------
db.Bag
... |
771f918c97b494186cead8da5e9890f6cbbda0c8fb801ee06f78bbd9eb60b352 | Python | 417 | 9 | MP20_NATOM_DIST = [0, 66, 590, 557, 4177, 1312,
2328, 596, 2154, 955, 2738,
361, 2573, 585, 1746, 389,
1731, 264, 1416, 287, 2311]
ALEXMP20_NATOM_DIST = [0, 129, 1681, 11741, 99388, 28323,
47379, 16528, 69814, 29748, 76579,
... |
a783385a7e9114dbb573978e4d672ec4205fade39c5d181c8195d95dfbddd194 | Python | 418 | 17 | from pgmpy.datasets._base import BaseTubingenDataset
class Tubingen(BaseTubingenDataset):
"""
Tubingen Cause-Effect Pairs Dataset.
A benchmark collection of independent cause-effect pairs.
"""
_tags = {
"name": "tubingen",
"n_variables": 2,
"has_ground_truth": True,
... |
e2ca798ff17e2ad5852969afba11d9e01171d24251edca7301fb080bf29fbedd | Python | 419 | 14 | import os
import os.path as op
from glob import glob
from tqdm import tqdm
base_dir = '/media/lukas/goliath/MVCA/ID1000/derivatives_tbss'
out_dir = op.join(base_dir, 'eddy_corrected')
files = sorted(glob(op.join(base_dir, 'raw', '*.nii.gz')))
for f in tqdm(files):
new_fn = op.basename(f.split('.')[0]) + '_eddyco... |
eb077aed2ed3a8239b7d5a84f06ca69ac8a86ff3adb13f4c21b31189ab96016b | Python | 420 | 13 |
from tractseg.experiments.base import Config as BaseConfig
class Config(BaseConfig):
EXPERIMENT_TYPE = "endings_segmentation"
CLASSES = "All_endpoints"
LOSS_WEIGHT = 5
LOSS_WEIGHT_LEN = -1
BATCH_SIZE = 28 # for all 72 (=144) classes we need smaller batch size because of memory limit
FEATURE... |
4e65f11c07de4a199b11943db4c5af06b7884ba21f319d6098b076b3485c1dd3 | Python | 422 | 15 | from __future__ import annotations
import os
# Name of Poetry's own system project used by `poetry self` commands.
POETRY_SYSTEM_PROJECT_NAME = "poetry-instance"
# Timeout for HTTP requests using the requests library.
REQUESTS_TIMEOUT = int(os.getenv("POETRY_REQUESTS_TIMEOUT", "15"))
RETRY_AFTER_HEADER = "retry-af... |
851e0ea8bd2c43e3da430e6ccc1cdc817e138edc3da7c4729af831f8fe6c8f17 | Python | 423 | 19 | # 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 torch
from . import FairseqDataset
class IdDataset(FairseqDataset):
def __getitem__(self, index):
return index
def ... |
01668535560f2283a058d5f5d701d03a084189b5460150e3d33896578ffdcfc7 | Python | 424 | 21 | from __future__ import annotations
from abc import ABC
from abc import abstractmethod
class BasePlugin(ABC):
"""
Base class for all plugin types
The `activate()` method must be implemented and receives the Poetry instance.
"""
PLUGIN_API_VERSION = "1.0.0"
@property
@abstractmethod
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.