sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
f0c285a1a549082730bdfa441081cc71d6a0635214f69162f1a57c141f34ccbd
Python
220
10
import gl ksteps = 100 gl.resetdefaults() gl.meshload('stroke.mz3') gl.trackload('stroke.trk.gz') gl.trackprefs(15, 3, 0.5) for i in range(1, ksteps): gl.clipazimuthelevation(( (0.8*i)/ksteps ), 0, 130) gl.wait(20)
ae0070a0e6804908788d788db05d64d6385d9d0236ed19abc22371ad3d774ac3
Python
221
6
# 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 .utils import quantize_model_ # NOQA
0948a8c06f0e653ced4d36b53e1ede6bbd08872a455d2691fe9cfa0960d02992
Python
222
8
import pytest from scgpt import __version__ @pytest.mark.skip(reason="Legacy version pin for 0.1.0 tutorials; package is now 0.2.5+") def test_version(): # legacy package name check assert __version__ == "0.1.0"
d7d3b3b2617bf466bddf6766dad96dbd73c380c1e221267141ec9ed74f70c78b
Python
222
9
#this is the NFT package! # from modules import NFTDetector # from nft_datasets import ROIDataModule, GutmanROIDataModule # # __all__ = [ # # 'NFTDetector', # # 'ROIDataModule', # # 'GutmanROIDataModule' # # ]
0fd159ccc5ab9050a9c748f5372cf641cacabd78dbbdf85947dd1745e0c5b237
Python
224
11
from .crossentropy import CrossEntropyLoss from .dice import DiceLoss, dice_loss from .umap import UmapLoss, umap_loss __all__ = [ "CrossEntropyLoss", "DiceLoss", "dice_loss", "UmapLoss", "umap_loss", ]
4d070b84eb7e4a7b9999cb51dc7d809f889556583ec7c10b3cda11145c94dddd
Python
224
6
# 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 .models import linformer_roberta # noqa
11e8bede9b8aedbcbd00967b3adc79dd3610c907d78fc167b36e6c89e4bd1417
Python
226
6
# 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 tasks, criterions, models # noqa
dee9d646980fcc335c68ae62239c09073a62486b94a2b23b93d25b9863b45ae9
Python
227
6
# # 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 #
0017a446c8fcbc713896ea7e74614a7d92cb94540588a1ecf7fabb4d5ddce7ae
Python
228
6
# 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 criterions, models, modules # noqa
9059819a560e325074e2697cc91f79b459d4be424d9ca1d3a8c8058cf9797b1c
Python
228
7
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tools to classify pyknotic nuclei""" from .transformer import LinearTransformer, get_features_multiple_cells # noqa F401 from .classifier import PolygonClassifier # noqa F401
c382257fec41061b4d207c88797c8455de9430e888bde295aeee24d58388fdb0
Python
228
5
from .construct_model import construct_model from .model_train import train from .input_data_from_mesh import prep_input_data from .utils import DistanceFunction from .plotting import plot_mesh, plot_field, img_plot, plot_energy
dff5ed3dc2e3eaf06f788192a8e5f4f8f7ebc88ca158b960425d4928daeb09b5
Python
228
8
from paper2.detect import choose_threshold from paper2.loaders import load_coffee def test_threshold_in_scan_range(): ds = load_coffee() t = choose_threshold(ds, preprocess="snv", seed=0) assert 85.0 <= t <= 100.5
f91c196ce737ab762c980e56a4eda5667aeb7a4cc5a5b9880898233c95bf2ee9
Python
228
6
from . import constants, helper from .infer_datapipe import InferDatapipe from .metadata import Metadata from .train_datapipe import TrainDatapipe __all__ = ["constants", "helper", "Metadata", "InferDatapipe", "TrainDatapipe"]
98f51a1d95df7b96c574de4a6bfb35cfae230751786c4125e1e2ed584b4b23d1
Python
229
7
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit import trimap class Trimap3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=trimap.TRIMAP(n_dims=3), name="Trimap")
553b3cadc233c0785a75bd0ea90d1971b9d2a8526ab2f33a5f119c753d6e4d44
Python
230
7
import os from tractseg.experiments.base_legacy.tract_seg_lowres_legacy import Config as TractSegConfig_LowRes class Config(TractSegConfig_LowRes): EXP_NAME = os.path.basename(__file__).split(".")[0] INPUT_DIM = (80, 80)
6398926a6b31e9f85038b27d4329940adbf81c7d8e9d6edf15e70e69d2356619
Python
230
6
# 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 .lightconv_layer import LightconvLayer # noqa
2b06b221403abb412f807b04996f7f4a62b0186438b221bfdcf752ae8ee12da9
Python
232
4
from pytorch_grad_cam.utils.image import deprocess_image from pytorch_grad_cam.utils.svd_on_activations import get_2d_projection from pytorch_grad_cam.utils import model_targets from pytorch_grad_cam.utils import reshape_transforms
1166e4cdfc3f9692e413b3161310a270b2a93d56c4dc85383c57d9a49da5b896
Python
233
6
# 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 .multichannel_sequence_generator import * # noqa
65b9ef29e99ab9f4c639ba0cede733fd9b7a9e34e325ba4eed345baa255e0b5a
Python
234
6
# 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 .dynamicconv_layer import DynamicconvLayer # noqa
83037e0df5e09a6a848d008cffb59ad783e14f50e81fe5847067a23806f1d086
Python
234
2
from .special_metrics import jensen_shannon_distance, jensen_shannon_divergence, kullback_leibler, multinomial_distance, multinomial_subspace_distance, stabilized_minkowski, minkowski10 from .poisson_proximity import PoissonProximity
e4c05c112baf50e24438ee2387809f0767f28df921fec31b09a3e9c9c3f23565
Python
235
9
from .base import BayesianModelInference, _return_samples from .Sampling import BayesianModelSampling, GibbsSampling __all__ = [ "BayesianModelInference", "_return_samples", "BayesianModelSampling", "GibbsSampling", ]
90e2b52d267aa1cda6007ea4134afb3fe43624d8c2a377652ca43597bb255856
Python
236
12
from mdt import CompartmentTemplate __author__ = 'Robbert Harms' __date__ = "2015-06-21" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class Dot(CompartmentTemplate): parameters = () cl_code = 'return 1.0;'
f042f38def442c3623801206209a34be76a15f516f55e85d238a0defd86c71e9
Python
236
14
from ._base import ( BaseDataset, list_datasets, load_dataset, ) __all__ = [ "BaseDataset", "BaseCovarianceDataset", "BaseSimulatedDataset", "BaseTubingenDataset", "load_dataset", "list_datasets", ]
84ca8a1a68e6e4766d155dcf54b9b1f93505f02ef9b2cce89cc2a4a10cfb7a68
Python
237
11
import torch class ModuleListInfo(torch.nn.ModuleList): def __init__(self, info_str, modules=None): super().__init__(modules) self.info_str = str(info_str) def __repr__(self): return self.info_str
1f620b0a34853f0d10cb2abbf0e23eac2678e025fdb0eeef1d7ad25d9c8e4a79
Python
238
8
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" NR_OF_GRADIENTS = 1
f5fb702e7d964d844237bda2e39a1870358439c5615336d50df4f2155a5c565d
Python
238
6
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit from sklearn.manifold import MDS class MDS3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=MDS(n_components=3), name="MDS3D")
9545b35a656c07b55fa3c8874e8dd290b5bc409ab671cd5b55b807c6bea92b9f
Python
239
12
from mdt import CompartmentTemplate __author__ = 'Robbert Harms' __date__ = "2015-06-21" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class S0(CompartmentTemplate): parameters = ('s0',) cl_code = 'return s0;'
c4805c6f30f5f9b807aafc199e9e646e13cfdd7cc561974dabf358f724357fba
Python
239
13
"""command-line interface functions for training, creating learning curves, etc.""" from . import cli, eval, learncurve, predict, prep, train __all__ = [ "cli", "eval", "learncurve", "predict", "prep", "train", ]
0a39f7d82b1186eefd02cfb92e94e7962487752eadbf51395a2ddeb3717fc017
Python
241
9
import os from tractseg.experiments.base_legacy.endings_seg_legacy import Config as EndingsSegConfig class Config(EndingsSegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] NUM_EPOCHS = 500 DATA_AUGMENTATION = True
95c999b94a89151603eab038f53bfb50d8fd3f8c910660cd57c7b53bd3bc9866
Python
241
5
from neurovfm.data import CacheManager data_dir = "/nfs/turbo/umms-tocho-snr/exp/akhilk/torchmr/raw_data/mri" # the same as data.data_dir cache = CacheManager(data_dir) cache.build_cache(num_workers=8) # or more, depending on your machine
92c3f6bc8fceea5f85d26b4584e87d2f2618ca3dafda9e3a12c70bcc41a3d7dd
Python
242
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. from .hubert import * # noqa from .hubert_asr import * # noqa
d2a1788b9ecd34ad86a8e3db928cf8aa2686e1a491b087c6ec79343dfe90fe9e
Python
242
6
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit from sklearn.manifold import TSNE class TSNE3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=TSNE(n_components=3), name="TSNE3D")
e2e0fca50e2de8345d550ef78403e1c3b503f27f802f38ad448908b2b54de30f
Python
242
11
import random import numpy as np # from theano.tensor.shared_randomstreams import RandomStreams def set_random_seeds(random_seed): # srng = RandomStreams(seed=random_seed) random.seed(random_seed) np.random.seed(random_seed)
45c03d8221be761728c67d74e0f668dd372088f223312c000bb47154e93996c9
Python
243
5
from ._graph import _domains_hierarchy, paga, connectivities from ._spatial import domains, spatially_variable_genes from ._heatmap import _weights_clustermap, pathway_scores from ._bar import domains_proportions from ._line import loss_curve
a1358e7a9495e136e8b2bb5304d7cb9241d779502ac977bfbfc6f2308ed0c86c
Python
244
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 .wav2vec_u import Wav2vec_U __all__ = [ "Wav2vec_U", ]
a8f068425a889de384c31e47569bf1f30de149105870b3a171cc274d98f827bf
Python
244
9
from __future__ import annotations pytest_plugins = [ "tests.repositories.fixtures.distribution_hashes", "tests.repositories.fixtures.legacy", "tests.repositories.fixtures.pypi", "tests.repositories.fixtures.python_hosted", ]
fc1af84e95eaf03c37436558eb896441a28a0c5fc4226b37806c3b6ff149c6d9
Python
244
12
from . import learncurve from .annot import annotation, plot_labels, plot_segments from .spect import spect, spect_annot __all__ = [ "annotation", "learncurve", "plot_labels", "plot_segments", "spect", "spect_annot", ]
fde6f7d38d106cd84f4fc20a2cbd10b6f859c748db1eafc4280bf1f9f6582381
Python
244
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. from .hub_interface import * # noqa from .model import * # noqa
354dc16ee6525efa9b847bf278f65d07528fabe6217557e24204cc0cf4a5a8ba
Python
245
10
import pytest @pytest.fixture def events_path(generated_results_data_root): events_paths = sorted( generated_results_data_root.joinpath("train").glob("**/*events*") ) assert len(events_paths) > 0 return events_paths[0]
46e8cb99dff8bea09ce79deb354520dfb321e8c3629ce5c0b84b769e48067ad7
Python
245
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. from . import wsc_criterion # noqa from . import wsc_task # noqa
a57eca0edf6f075d2fa89e8232623cf691f61f21e45dba7975c3cbd5a400dc4d
Python
245
6
# 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 transformer_xl_model, truncated_bptt_lm_task # noqa
32c2ff64e7d367859e3da19761bf7bdb8ca0f7f7c6069d3067460d0130e752ee
Python
247
9
import os from tractseg.experiments.base_legacy.peak_reg_legacy import Config as PeakRegConfig class Config(PeakRegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] FEATURES_FILENAME = "270g_125mm_peaks" NUM_EPOCHS = 150
9cf87b9f5028a930e0cf000d621fdafcc066b62a3090dae26894a66ee43bddd1
Python
247
8
# # 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 .dnn.dnn import DNN
050ceacff0756a78c8c02607e2c167384b2cb32ebd07cab51821910d04de116b
Python
248
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 .asr_dataset import AsrDataset __all__ = [ "AsrDataset", ]
13cd784edcab32644886f325241d6029f53b81559eced6400f153ff15f5e166d
Python
248
10
from .energy import HARTREE_TO_KCAL, get_errors, relative_energy, variance_extrapolation from .h5_io import read_result __all__ = [ "read_result", "variance_extrapolation", "relative_energy", "get_errors", "HARTREE_TO_KCAL", ]
537caa25265c2ec0f3207781d8347586f0875091c6acc9bf2ffbd95dde5af116
Python
248
6
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit from sklearn.manifold import Isomap class Isomap3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=Isomap(n_components=3), name="Isomap")
53d5e7fcc373cb28304f0be24c8f164cc7daa2036e6a92f0f788d992c644fc3d
Python
248
16
""" All loss functions here """ import torch def simple_MSE_loss(pred, label): """ Simple MSE loss """ loss = torch.nn.MSELoss() return loss(pred, label) def sparsity_loss(activations): return torch.norm(activations, 1)
015eedddc503366e9ae89b4e7314d290ecbb39a3f32945b644e512b9f43bc1c7
Python
249
7
name = 'fissa' path = name version = '0.7.dev0' author = "Sander Keemink & Scott Lowe" author_email = "swkeemink@scimail.eu" description = "A Python Library estimating somatic signals in 2-photon data" url = "https://github.com/rochefort-lab/fissa"
1b4dae94924afcdb5360bb75ae02aee3d64e1707bdbe57a08d791a2a008fa4b2
Python
249
9
__version__ = "0.1.0" import logging import sys logger = logging.getLogger("scGPT-spatial") from . import model, tokenizer, utils, tasks from .data_collator import DataCollator from .data_sampler import SubsetsBatchSampler from .preprocess import *
3402d038ed18d230672cb12b0bc526d02fd0e5e2ad299eea1bc067c3316eeaaf
Python
249
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. from .speech_dlm import * # noqa from .hub_interface import * # noqa
54be84fa19ded249cd4d232fef8cabce101d8fa8955adb863ac839851ed0e78a
Python
249
7
from .surface_plotting import build_plotter, plot_surf, plot_cortical, plot_subcortical, plot_hippocampal __all__ = ['build_plotter', 'plot_surf', 'plot_cortical', 'plot_subcortical', 'plot_hippocampal']
ff5d3bf7ba9efa9765f7f372eb4a02c151da5064572a9c39570adfff30f878f6
Python
249
13
from . import cmacbench from .cmacbench import CMACBench, SplitsMetadata from .get import get __all__ = [ "cmacbench", "CMACBench", "get", "SplitsMetadata", ] # TODO: make this a proper registry DATASETS = {"CMACBench": CMACBench}
f3a2cc28e4f8e2ac0d258bcb6b742589f499a81a35ae2cdfcf0e605c8a1e344d
Python
251
9
# -*- coding: utf-8 -*- # Copyright (C) 2017-2023 Phillip Alday <me@phillipalday.com> # License: BSD (3-clause) """Philistine: a collection of Phillip's utility functions""" __version__ = '0.2.0' from . import mne from ._base import (invert_dict, )
69a0ae5a1cb661c861fc146517a2a71528883c8b7d3e46fb4450a1b25f809a2e
Python
252
14
#!/usr/bin/env python # -*- coding: utf-8 -*- from vlpp.operation import maskFromAtlas def main(): output = "${participant}_roi-${refName}${suffix.mask}" maskFromAtlas("${atlas}", ${indices}, output) if __name__ == '__main__': main()
7ec215134db2349e0cb1869b34d2255ca301111c814f9cc322d86b6e33b62785
Python
252
9
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from tractseg.data import dataset_specific_utils from tractseg.experiments.dm_reg import Config as DmRegConfig class Config(DmRegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0]
068b92f3e347930b1649f82bd5714ba683f6bc858f3ba916bdf64dd4cf3e198c
Python
253
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. from .model import * # noqa from .transformer_layer_xmod import * # noqa
7b2d7e3160e331cc129902a8456fd6cb31b2a7e63efe838877d41dcb07fe7883
Python
253
12
from mdt import CompartmentTemplate __author__ = 'Robbert Harms' __date__ = "2015-06-21" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class Ball(CompartmentTemplate): parameters = ('b', 'd') cl_code = 'return exp(-d * b);'
5a22b99c8b6e3ea1db9bdf6318733db3a6152214b1e5c2ee9fe55197d2ab373a
Python
254
11
from pyro.infer import Predictive from ._decorators import auto_move_data class AutoMoveDataPredictive(Predictive): """Auto move data.""" @auto_move_data def forward(self, *args, **kwargs): return super().forward(*args, **kwargs)
8da691efbf00f1022fffd2a1cf73f0b88c533873aea81141665ea9bfd38c9d4b
Python
254
12
"""Utility to set random seeds for reproducibility.""" import random import numpy as np import torch def set_seed(seed: int = 42) -> None: random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed)
c1cfab44f8cf7bbbcba294cb50316623905e34b08c6656abc047bcf192f004f4
Python
254
11
import pytest from click.testing import CliRunner from chromas import cli def test_version_command(): runner = CliRunner() result = runner.invoke(cli, ["version"]) assert result.exit_code == 0 assert "Chromas version" in result.output
e6b9ecbf6e9c7d4ca68f9c517035e5978907c3e2fb498a268c8e558960889ad0
Python
254
7
from lucent.optvis.param.images import image from lucent.optvis.param.spatial import * from lucent.optvis.param.lowres import * from lucent.optvis.param.cppn import * from lucent.optvis.param.color import * from lucent.optvis.param.gan import upconvGAN
88619d8d2f7c33ce88dc2e113a2cb76059461b6d84d37d9bb8e0c4682bfef9a7
Python
255
9
from .DoubleMLRegressor import DoubleMLRegressor from .NaiveAdjustmentRegressor import NaiveAdjustmentRegressor from .NaiveIVRegressor import NaiveIVRegressor __all__ = [ "NaiveAdjustmentRegressor", "NaiveIVRegressor", "DoubleMLRegressor", ]
e254c5f7ca666bef73ef65d3bf6e44453b22b762ceabba855303ae53cdbb1e4c
Python
255
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 .mm import * try: from .expmm import * except ImportError: pass
78b93133f6a8149321dd4bd2da3d6305e710ccae35ad6bda4bc63a4762cde7db
Python
257
8
# # 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 .device import Device
bb5e4fde1c76be4785a66710057a335f4b63d669fc738bf0f42717aa145322c7
Python
257
6
# 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 .utils import SizeTracker, get_param, attrsetter, quantize_model_ # NOQA
086e9cad60c878f885b2f523eec1202997aeb20d797da3fe098db35c08afe8b8
Python
258
7
"""OCE — Orbital Cluster Expansion. Cluster expansion adapted to molecular systems where the configuration variable on each "site" is the atomic-orbital eigenenergy ε_μ^Z, and figures are subgraphs of the molecular bond graph. """ __version__ = "0.1.0"
20bfba1739d09f0275efbbc2cf9f56f14926cefc975b57017a459df9b4adecc2
Python
258
10
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] NUM_EPOCHS = 500 DATA_AUGMENTATION = True USE_DROPOUT = True
5edb6875fb8959b7877fe5eb54a4fb6bac2e4ea19580e5174156bc2fe57371bd
Python
258
6
# 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 label_smoothed_cross_entropy_r3f, sentence_prediction_r3f # noqa
dd656c9aa61145c26bb14390237cde0f56ffdea37f15f6fa2682801c3214b42d
Python
258
8
# # 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 .backend import ComputeBackend
628b707b9149e6bff5b363c49da8213ac465b0c60b4b12ecaf3eb6f89d3ebd6a
Python
259
6
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit from sklearn.decomposition import FastICA class FastICA3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=FastICA(n_components=3), name="FastICA3D")
f8b86a46cb08bdf2cc819eaa27d09748e942b9fd4fe9112d3abc47399aeeed29
Python
259
7
"""Module that contains datapipe classes, used to load inputs and targets for neural network models from datasets prepared by :func:`vak.prep.prep`""" from . import frame_classification, parametric_umap __all__ = ["frame_classification", "parametric_umap"]
3ab305ef213961dc986b087188557b8f79d600339487728c7222378b99e37f7f
Python
260
13
from . import conv_encoder, ed_tcn, tweetynet from .conv_encoder import ConvEncoder from .ed_tcn import ED_TCN from .tweetynet import TweetyNet __all__ = [ "conv_encoder", "ConvEncoder", "ed_tcn", "ED_TCN", "tweetynet", "TweetyNet", ]
d32af8712e47989d334b7bcfa321d3f90445178ab4f29481fc385edc5bcd38f1
Python
260
15
"""Module providing utilities for brenda_references""" from .utils import ( CachingMiddleware, abbreviate_bacteria, fuzzy_find_all, ratio, ) __all__ = [ "CachingMiddleware", "abbreviate_bacteria", "fuzzy_find_all", "ratio", ]
a3b71c7ed6de0be5d1d92be9e92e4696b167f6bd36aca7180b2ed2928402c325
Python
261
11
import pandas as pd dat = pd.read_csv("./beta.csv") all_seqs = [] for i in range(len(dat)): seq = dat["cdr3b"][i] all_seqs.append(">Sequence" + str(i) + "\n" + seq) f = open("./tcrdb_tcrs.fasta", 'w') f.write("\n".join(all_seqs)) f.close()
601655a013ce5c6d28884216dd0528ba4f62e8e5ef7c326d4295e4a22085f477
Python
262
8
from __future__ import annotations from poetry.installation.operations.install import Install from poetry.installation.operations.uninstall import Uninstall from poetry.installation.operations.update import Update __all__ = ["Install", "Uninstall", "Update"]
e6bb254a5140127f26da9bc660b0d9d3076e1c2fbd44725dc8e495f50f90a6c3
Python
262
4
# Tools for managing data in The GOA database: Gene Ontology annotation (GOA) # resource (http://www.ebi.ac.uk/GOA) resource (http://www.ebi.ac.uk/GOA) # https://academic.oup.com/nar/article/43/D1/D1057/2437623/The-GOA-database-Gene-Ontology-annotation-updates
c1a4a7f7048bd8f0627d08ce463b4eb01cac2394a2afb2e959e1dff2c751c160
Python
263
8
from __future__ import annotations def get_request_title(request: str, implementation: str, free_threaded: bool) -> str: add_info = implementation if free_threaded: add_info += ", free-threaded" return f"<c1>{request}</> (<b>{add_info}</>)"
a31540ebfb54a0a28e318d09cfaff5dac45be5d16dd0d8c83521cf7169c61f3c
Python
264
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. try: from fairseq.version import __version__ # noqa except ImportError: pass
c6c154af24ec3782adad7e066b2e4607c69ddc6be13f15a86fec84e31d273300
Python
265
11
from .metrics import eval_metrics, plot_eval_metrics from .trainer import GarfieldTrainer from .utils import EarlyStopping, print_progress __all__ = [ "eval_metrics", "plot_eval_metrics", "GarfieldTrainer", "EarlyStopping", "print_progress", ]
59790b35d1d6664ef79ef22cbf966895d73db2eccc924a24819d1f785966798a
Python
266
10
# -*- coding: utf-8 -*- import os import sys def entrypoint_exists(entry_point): if sys.platform == "win32": entry_point += ".exe" executable_dir = os.path.dirname(sys.executable) return os.path.exists(os.path.join(executable_dir, entry_point))
f0ed30569cb5907807cd91a220736bafcb3b22efe074a6bcab00bc36d8755c01
Python
267
11
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. class IncompatibleSampler(ValueError): # Raised when sampler type and SDE are incompatible. pass class AmbiguousConfig(ValueError): # Raised when the config is ambiguous pass
6ce46deb11331c55f6d6fbcb1da8027dfcc9ad53b2197d93346f3dc84f82acb6
Python
268
12
import gl gl.resetdefaults() gl.meshload('BrainMesh_ICBM152.rh.mz3') gl.overlayload('motor_4t95vol.nii.gz') gl.overlayminmax(1,2,12) gl.overlaycolorname(2, 'Red-Yellow') gl.azimuthelevation(110, 15) gl.shadername('MatCap'); gl.meshcurv() gl.overlaytranslucent(2, 1)
daebacf2d5f40a4d8946a0451a55c25a149c544d4b92b06929079082e87a9904
Python
269
9
"""Tasks for GOTerms in obo dag.""" def get_all_parents(go_objs): """Return a set containing all GO Term parents of multiple GOTerm objects.""" go_parents = set() for go_obj in go_objs: go_parents |= go_obj.get_all_parents() return go_parents
a62b8c18ebb65a2da7f39235c4960381bca1cb49ecb0d523fb841d9ecbba5bb5
Python
270
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 .unpaired_audio_text import UnpairedAudioText __all__ = [ "UnpairedAudioText", ]
e96fd00a1c898023bd706bacbd2122ee0aefc34198a1bd3cbaa5e50ee9706183
Python
270
9
from datetime import datetime from .constants import STRFTIME_TIMESTAMP def get_timenow_as_str(): """Returns current time as a string, with the format specified by ``vak.constants.STRFTIME_TIMESTAMP``""" return datetime.now().strftime(STRFTIME_TIMESTAMP)
a189d81a494ffb24185fb56f0a36c114630efa5d7db38277a30d9ea2aba84074
Python
272
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 # from .dac.dac import DAC from .adc.adc import ADC
fe748d4f6ba81557d9484bb748a6b837e46210d5245a957ff380c3764fc87597
Python
272
12
__all__ = [ "ATOMIC_RADII", "KHOT_EMBEDDINGS", "CONTINUOUS_EMBEDDINGS", "MAX_ATOMIC_NUM", ] from .atomic_radii import ATOMIC_RADII from .continuous_embeddings import CONTINUOUS_EMBEDDINGS from .khot_embeddings import KHOT_EMBEDDINGS MAX_ATOMIC_NUM = 100
3ed16f27e1850704b306abe9dd07fc4d6e59aa2ea4595545f4d4872fdc7f7846
Python
273
12
"""Checkpoint save/load utilities.""" import torch def save_checkpoint(model, path: str) -> None: torch.save(model.state_dict(), path) def load_checkpoint(model, path: str, device): model.load_state_dict(torch.load(path, map_location=device)) return model
452dcde0ed8beac250884aa4c9b1b2ce89350a9d3816d73fabd0fb120f5a388c
Python
273
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 .mmdataset import * try: from .fairseqmmdataset import * except ImportError: pass
a0d16c486b9d5babd88c979cb31e7e1656d24bdaad508bb5b2e1046e036f8792
Python
273
8
import importlib import os for file in sorted(os.listdir(os.path.dirname(__file__))): if file.endswith(".py") and not file.startswith("_"): task_name = file[: file.find(".py")] importlib.import_module("examples.speech_recognition.tasks." + task_name)
b7ceaeefb739aa5cbe549da0bcbfe3f7c3c853eab00a77a3f830499fd202adae
Python
273
8
from __future__ import annotations from poetry.packages.dependency_package import DependencyPackage from poetry.packages.locker import Locker from poetry.packages.package_collection import PackageCollection __all__ = ["DependencyPackage", "Locker", "PackageCollection"]
2decec83a5765fe86f967cdd60356590b488884402a8139f9caac9251755d856
Python
274
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. from . import sequence_generator # noqa from . import sequence_generator_multi_decoder # noqa
515faab836d99df6e4d8cca5299f8b3cb11059e7a06e04b121788343524247ed
Python
276
8
import importlib import os for file in sorted(os.listdir(os.path.dirname(__file__))): if file.endswith(".py") and not file.startswith("_"): model_name = file[: file.find(".py")] importlib.import_module("examples.speech_recognition.models." + model_name)
8939a98cac8e59f2368cd57aa5676ec42a7c69a2c6d2a74b8c667b96036da44f
Python
276
6
from msi_visual.base_dim_reduction import BaseDimReductionWithoutFit from sklearn.manifold import LocallyLinearEmbedding class LLE3D(BaseDimReductionWithoutFit): def __init__(self): super().__init__(model=LocallyLinearEmbedding(n_components=3), name="LLE3D")
9d912a97828bd801dcb0ce71b41059afe7a161418708d9ea27375c4089f8c4cc
Python
277
11
from .model import ( TransformerModel, FlashTransformerEncoderLayer, GeneEncoder, AdversarialDiscriminator, MVCDecoder, ) from .generation_model import * from .multiomic_model import MultiOmicTransformerModel from .dsbn import * from .grad_reverse import *
56a7629c768585433793ea0bc417f0c8f2200027295bb1b8ff7ff3c644044583
Python
278
11
import gl gl.resetdefaults() gl.azimuthelevation(240, 15) gl.meshload('AICHAhr.lh.mz3') #gl.atlashide(0,1, 2, 3) gl.atlasstatmap('AICHAhr.lh.mz3','surficetemp.mz3',(4,5,6),(7,3,4)) gl.meshload('lh.pial'); gl.overlayload('surficetemp.mz3'); gl.shaderxray(1.0, 0.3);
6e39f0a977eb8dd72fb43f81a4103a1d9a2a48cfb401404fa938147e8a309253
Python
278
8
"""DGR — distortion-guided restoration for prostate diffusion MRI. Two halves: * ``dgr.physics`` — forward susceptibility-distortion simulator (B0 -> EPI warp) * ``dgr.models`` / ``dgr.inference`` — the reverse (restoration) network stack """ __version__ = "0.1.0"
30b9594e92d569342c294ee428eac5535f3c23ffbe15150dd057bc2983dd36f7
Python
280
10
import os from tractseg.experiments.endings_seg import Config as EndingsSegConfig class Config(EndingsSegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] DAUG_ROTATE = True SPATIAL_TRANSFORM = "SpatialTransformPeaks" DAUG_ROTATE_ANGLE = (-0.4, 0.4)
657c8b53b320f847e5c53868a0ed934288587659e75406e29def92918b224323
Python
280
12
import asyncio import sys from multiprocessing import freeze_support if sys.platform == 'win32': asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) from rnalysis.gui import gui if __name__ == '__main__': freeze_support() asyncio.run(gui.run())
f41d37650643a9bff6ff48807db839b102688662995bf12421ab1c06487c3f42
Python
281
13
from typing import Union, Optional import numpy as np from scipy import stats def angular_difference( angle1: Union[float, np.ndarray], angle2: Union[float, np.ndarray], ): diff = angle1 - angle2 diff = np.mod(diff + np.pi, 2*np.pi) - np.pi return diff