sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6a06b35d42fa2a95cf411529b1844d964728274be1b1a37e7b0b0e8c1ead8198
Python
239
20
import numpy as np import scipy.stats from topaz.stats import gmm_fit, gmm_fit_numpy, norm_fit, normalize def test_gmm_fit(): pass def test_gmm_fit_numpy(): pass def test_norm_fit(): pass def test_normalize(): pass
faffd9d0cd4b107e64f958520416eecffa43a779d2678af353d13b888b243c37
Python
239
12
import sys import importlib def bypass_compiler_fixup(cmd, args): return cmd if sys.platform == 'darwin': compiler_fixup = importlib.import_module('_osx_support').compiler_fixup else: compiler_fixup = bypass_compiler_fixup
66ba943c8cdb12b7cda3039d470f2d00d76c8538f98893fd65ad8cc0568b71aa
Python
240
4
"""Data and file handling utilities.""" from .data_util import get_new_dataframe, get_value_dict, replace_values, reorder_columns from .io_util import check_filename, clean_filename, extract_suffix_path, get_file_list, get_path_components
7f26bddb707281d3898745ba6d0eafefdb5700dfe1ca00234fe188d97c94f528
Python
240
8
import mmpose from packaging import version if version.parse(mmpose.__version__).major > 0: from Pose_multi_mmpose_new import Pose_multi_mmpose_new as Pose_multi_mmpose else: from Pose_multi_mmpose_old import Pose_multi_mmpose
8655ef21732ee36cbeabc4ee965c4faf9655772327a1f868d6098c8d475cdec6
Python
240
10
from .band import * from .concatenate import * from .normalize import * from .pick import * from .to import * from .spectrum import * from .coefficient import * from .correlation import * from .band_pyeeg import * from .downsample import *
ee08dab929814117265bcc245ef087fd36a03e980409eabe0a745beca871e44f
Python
240
9
#!/bin/env python3 ''' Print a table of quasi-particles ''' from pdlfeynman.particle import PARTICLES print('symbol', 'name', '2Q', '2P', sep='\t') for p in PARTICLES: print(p, p.name, f'{int(2*p.Q):+2}', f'{int(2*p.P):+2}', sep='\t')
29e54e033c41cb1dc1f372ba1e39fd0edc42aaa4e2ac2ac64f9c06781ad6b5e2
Python
241
7
from .multregconn import * from .pc_multregconn import * from .calcconn_parcelwise_noncircular import * from .calcactivity_parcelwise_noncircular import * from .corrcoefconn import * from .partial_corrconn import * from .combinedFC import *
7ac20ac3a88b5d8eb5e084257ba842a026bc7d562147001cbd42f571df26d9de
Python
241
6
from segm.data.loader import Loader from segm.data.imagenet import ImagenetDataset from segm.data.ade20k import ADE20KSegmentation from segm.data.pascal_context import PascalContextDataset from segm.data.cityscapes import CityscapesDataset
8f65c82e2b4c31d534004b5ec2320d7d350a7c3dd0bf63f6592086062cc899a0
Python
241
7
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..file_utils import requires_backends class Speech2TextFeatureExtractor: def __init__(self, *args, **kwargs): requires_backends(self, ["speech"])
9bc807244e5397217425611db70d1b59de0de3832b3624a9b128d637639ebbd0
Python
241
8
"""Loads a trained model checkpoint and makes predictions on a dataset.""" from chemprop.args import PredictArgs from chemprop.train import make_predictions if __name__ == "__main__": make_predictions(args=PredictArgs().parse_args())
53381582d99623deb273a6fa596e1e90358a477a0d6fea59249cf561a36e5942
Python
242
8
import os.path as osp class Paths: rhino_root = '/' freesurfer_bin = '/usr/global/freesurfer/bin' matlab_bin = '/usr/global/matlabR2015a/bin/matlab' ants_root = osp.join(osp.expanduser('~sudas'),'bin','ants') paths = Paths()
87ed5c5263b3ea684bb234e33ab27c88f7a3a4674b0b21b89734dfb5f199bcb8
Python
242
9
# SPDX-FileCopyrightText: 2015 Eric Larson # # SPDX-License-Identifier: Apache-2.0 from .file_cache import FileCache, SeparateBodyFileCache from .redis_cache import RedisCache __all__ = ["FileCache", "SeparateBodyFileCache", "RedisCache"]
c369b3fb59e34c166071e2179a75f342909b02e8573ee41f6d14102a10ce8116
Python
242
11
"""Useful utils """ from .misc import * from .logger import * from .visualize import * from .eval import * # progress bar import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), "progress")) from progress.bar import Bar as Bar
51e27c7141d3c1c7345fd5f04ac8c2c3325b4ab26915d360160a97f089187903
Python
243
10
""" Package for numerical implementation of differential geometry concepts # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 29.02.16 """ __author__ = 'Antonio Martinez-Sanchez' from .curve import SpaceCurve
6ed975d9b9f03f084b79d5aaa8ff5167071401849cbde950781784ee4512f9d5
Python
243
4
from .loss import bce_loss, bce_with_logits_loss, cross_entropy, nll_loss from .metric import (AUPRC, AUROC, accuracy, c_index, f1, precision, recall, sensitivity, specificity, youden_j) from .plot import confusion_matrix
a059d55fd88d4f3837afc21c0c4a2f53acfa7a736fbf58808f355f1f9ac5e470
Python
243
11
import os import glob import gc from os.path import basename files = glob.glob('audio_conversion/*.avi') for file in files: os.system('ffmpeg -i '+str(file)+' audio/'+str(basename(file))+'.wav') gc.collect() print('finished: '+str(file))
946b4973118ce38433e026e4e2b6db9ab2b19cdaf5fbded4db94da99e2de859c
Python
244
9
""" This module exists only to simplify retrieving the version number of chardet from within setuptools and from chardet subpackages. :author: Dan Blanchard (dan.blanchard@gmail.com) """ __version__ = "5.1.0" VERSION = __version__.split(".")
ee16fe95b6acc8650f16fd2ce95f8a7f26cadd3366915253cc61deaac504aa6b
Python
244
9
"""Test PDB utilities""" from eudockscore.utils.pdb import get_chain_sequence def test_sequence(): with open("seq.txt", "r") as f: correct_seq = f.read() seq = get_chain_sequence("2j0m.pdb", "A") assert seq == correct_seq
f18a01f3535c837a0f73086ec3c2e1d3f86a13ef9fb795e85a3e148fca37ddd4
Python
244
9
""" This file is a configuration file that contains default directories for saving data """ import os HDF_DIR = "./data/hdf/" FIGURES_DIR = "./data/figures/" PYPET_LOGGING_CONFIG = os.path.join(os.path.dirname(__file__), "pypet_logging.ini")
06a857d979918e14a706679c15c5d378f6b3678da3fb6b78df37607993b118db
Python
245
16
from __future__ import annotations from .config import ( SegmentationConfig, ) from .stage import ( SegmentationResult, run_segmentation, ) __all__ = [ "SegmentationConfig", "SegmentationResult", "run_segmentation", ]
6b0e1abb3cbd76ca714770fa18a840c3561d8c26c0795db1b352d5e071b81828
Python
245
8
from .graph_theory import * from .machine_learning import * from .information_theory import * from .visualisations import * from .data_splitting import * from .scoring import * from .deep_learning import * from .molecular_featurisation import *
2e2dd6f691e6c0d3dfbf3ccef01330f70173c8ba6d9c1c3eecc3a185fd823c86
Python
247
12
from cellmincer.datasets.datasets import \ build_datamodule, \ build_ws_denoising, \ MovieDataModule, \ wipe_temp_files __all__ = [ 'build_datamodule', 'build_ws_denoising', 'MovieDataModule', 'wipe_temp_files', ]
a56e04123ef64847b826b1b0182e44042a3b1541ef4b12ee626e0113ee7928ce
Python
247
11
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup # https://github.com/pypa/setuptools_scm use_scm = {"write_to": "napari_bil_data_viewer/_version.py"} setup( use_scm_version=use_scm, include_package_data=True )
5e328be3c6adf76a640656162e888cfe5c82b68e33a4f52a165bba8fe520d739
Python
248
11
# -*- coding: utf-8 -*- # # Populate namespace with preprocessing frontend # from .preprocessing import * from .resampledata import * # Populate local __all__ namespace # with the user-exposed frontend __all__ = ["preprocessing", "resampledata"]
e7653e047becfd0f3b24707b11b58cb8315752cd6023c7c13d2e452ee30bb09d
Python
248
13
from met_brewer.palettes import ( MET_PALETTES, COLORBLIND_PALETTES_NAMES, COLORBLIND_PALETTES, met_brew, export, is_colorblind_friendly ) MET_PALETTES COLORBLIND_PALETTES_NAMES COLORBLIND_PALETTES met_brew export is_colorblind_friendly
15e2b1be3894330a9ce085113a15effc119542baa51e381a2fd09a8710b5d299
Python
249
8
from cuppa.runners.args import RunnerArgParser from cuppa.runners.prediction_runner import PredictionRunner if __name__ == "__main__": kwargs = RunnerArgParser().get_kwargs_predict() runner = PredictionRunner(**kwargs) runner.run()
2e018ce3bf4e630f175d15a5980db4dbab900cde4ed657365356ca85c967ddc2
Python
249
5
from .methods.cluster_factory import cluster_factory from .methods.reducer_factory import reducer_factory from .methods.metric_factory import internal_factory, external_factory from .methods.tester import Tester from .methods.graph import CKNNGraph
90bef9248baebe74dbf518aad38db911b79e58dc78c6d976973ac57ce90435e2
Python
249
6
#! /usr/bin/env python # -*- coding: utf-8 -*- from main import main main(combinations=[("issue571-base", "issue571-base", "issue571-base-v2"), ("issue571-base", "issue571-base", "issue571-v7"), ("issue571-base", "issue571-base", "issue571-v8")])
4c1e555ff3ad750ef12d08037cafacff87e6292712df95e012825d42863c9308
Python
250
11
from HPRO import PW2AOkernel kernel = PW2AOkernel( lcao_interface='siesta', lcaodata_root='./aobasis', hrdata_interface='qe-bgw', vscdir='../scf/VSC', upfdir='../pseudos', ecutwfn=30 ) kernel.run_pw2ao_rs('./aohamiltonian')
c98ee4b207f3c8f450708e1354d731106d89c03e286b412d8571cab42e673489
Python
250
4
from .regression_evaluator import RegressionEvaluator from .multilabel_evaluator import MultilabelEvaluator from .semantic_multilabel_evaluator import SemanticMultilabelEvaluator from .semantic_regression_evaluator import SemanticRegressionEvaluator
11c709b2398d0b9f8f0e5e7fef59f17b259650a9fcd748d6b74bfd1a42dc8894
Python
251
7
from .base_dataset import BaseDataset from .emotion_recognition import * from .folder_dataset import FolderDataset from .mne_dataset import MNEDataset from .numpy_dataset import NumpyDataset from .personal_identification import * from .sspev import *
203c71c93db86c8e43fbad10b4203d867044d5d585821829de6c7e0f69164980
Python
251
7
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..file_utils import requires_backends class Speech2TextProcessor: def __init__(self, *args, **kwargs): requires_backends(self, ["sentencepiece", "speech"])
4323384e9c338ec25537522f700540a3b701357047d13ab9d3f0a2437cb9c0b7
Python
251
11
# -*- coding: utf-8 -*- # # Populate namespace with user exposed # connectivity methods # from .connectivity_analysis import connectivityanalysis # Populate local __all__ namespace # with the user-exposed frontend __all__ = ["connectivityanalysis"]
6c677f1ba512e3c9dbc1a659334d32a82731bba74751440ebddbcbb3ff9ebc6c
Python
251
11
from HPRO import PW2AOkernel kernel = PW2AOkernel( aodata_interface='siesta', aodata_root='../aobasis', hrdata_interface='qe-bgw', vscdir='../scf/VSC', upfdir='../pseudos', ecutwfn=30 ) kernel.run_pw2ao_rs('./aohamiltonian')
8d4036be91d2e0ebd8c0b8bf155485d899a7f9e9071ee942dba74d4d24bae198
Python
251
11
class ConfigurationError(Exception): def __init__(self, msg): self.msg = msg super().__init__(self.msg) class InitializationError(Exception): def __init__(self, msg): self.msg = msg super().__init__(self.msg)
8efd03a9659a8bfe13b256d0352de71f17a91db7d90d41469373eba84691add2
Python
251
16
# db = { # 'host': '127.0.0.1', # 'user': 'omnidev', # 'password': 'we8pizza', # 'database': 'omniweb', # 'port': 13306 # } db = { 'host': '127.0.0.1', 'user': 'root', 'password': 'root', 'database': 'omniweb', 'port': 3306 }
aca6a441db78a05c2c33f92079ef24f6aa353d360c30a6e0bd0c3c332ab35d17
Python
251
9
from cog import BaseRunner, Input class Runner(BaseRunner): def setup(self) -> None: self.prefix = "hello" def run(self, text: str = Input(description="Text to prefix with 'hello '")) -> str: return self.prefix + " " + text
9a6f7191dcb69da79e46c27b667c0a57320c07ad579cc336358aa4c8957c6760
Python
252
11
# -*- coding: utf-8 -*- # # Populate namespace with specest routines # # Import __all__ routines from local modules from .freqanalysis import freqanalysis # Populate local __all__ namespace # with the user-exposed frontend __all__ = ["freqanalysis"]
071e7fcb6254771884b736a946908e3c598e967d73981c1c523796def81c522a
Python
253
8
# -*- coding: utf-8 -*- # @Author: Sadamori Kojaku # @Date: 2022-10-14 14:27:10 # @Last Modified by: Sadamori Kojaku # @Last Modified time: 2023-06-15 12:02:59 from embcom.embeddings import * from embcom.samplers import * from embcom.utils import *
1d17ddefd31a1dd42a4741e1ac1359078c8172c7eea3a31643ceb60efa91079b
Python
253
9
from __future__ import absolute_import from __future__ import division from __future__ import print_function from .scVI_distribution import * from .loss import * from .utils import * from .pairedVAE import * from .model import * from .evaluator import *
747ff4d4fbf5a7aae7f75a9e9869a1f65102ae3eed0ec674c2c7cab7daada583
Python
253
9
import numpy as np hartree2ev = 27.211386024367243 bohr2ang = 0.5291772105638411 TWOCENTER_RGRID_DEN = 100. / 12. # 100 points at 12 bohr AOFT_QGRID_DEN = 1 / np.sqrt(500) * 2048 # 2048 points at 500 Hartree hpro_rng = np.random.default_rng(seed=42)
bc89f08935ce611fe2a0d818b961352f0622ec8d2b3770bb7146a74eb696c7e8
Python
254
12
from memory_profiler import profile @profile def test_with_profile(arg1): """dummy doc""" return None if __name__ == '__main__': assert test_with_profile.__doc__ == "dummy doc" assert test_with_profile.__name__ == "test_with_profile"
be8c162f43c013f6623eeec42a17d89c07430f20960958afb1af6790c879c834
Python
254
9
import pytest @pytest.fixture def config(top_level_datadir, validation_config_factory): file_path = (top_level_datadir / 'validation/file.csv') test_args = [str(file_path)] _, config = validation_config_factory(test_args) return config
76415e92b250ed553a84dc963588ea97c30ffbfe3a7ee972e3969b7528037c5e
Python
255
8
from Pose_mdn_joint import Pose_mdn_joint class Pose_mdn_joint_fpn(Pose_mdn_joint): def __init__(self, conf, **kwargs): conf.mdn_joint_use_fpn = True conf.mdn_use_unet_loss = False Pose_mdn_joint.__init__(self,conf,**kwargs)
94f5e2b88efc703ed7ddfeb498845ca6c8a1a22fa981234dbd2cd3b1dc5951c1
Python
255
9
from .logic import InfidelityOperator from .overlap import InfidelityOperatorUPsi, InfidelityUPsi from .infidelity_optimizer import InfidelityOptimizer # from netket.utils import _hide_submodules # _hide_submodules(__name__, hide_folder=["overlap",])
041b21b1f298416219081f0148740f40746eb1ec2c016ba3bf76c9244b5689cf
Python
256
7
"""Different methods for fitting events.""" from hmp.models.cumulative import CumulativeMethod from hmp.models.eliminative import EliminativeMethod from hmp.models.event import EventModel __all__ = ["EventModel", "EliminativeMethod", "CumulativeMethod"]
13fbb76ef55fc8594e6cf0ec9886dd5c7646e1a01ca0cf346bacfb74ab1b98e4
Python
256
11
# -*- coding: utf-8 -*- # # Populate namespace with plotting routines # # Importlocal modules, but only import routines from spy_plotting.py from .spy_plotting import * # Populate local __all__ namespace __all__ = [] __all__.extend(spy_plotting.__all__)
a1eb82ceef6206b26a4618f92d0e65627b47234fb2472649a77817adf9cd5fdd
Python
256
13
"""Tests for loading config files. Author: Seth Axen E-mail: seth.axen@gmail.com """ import os class TestConfig: def test_config_file_exists(self): from e3fp.config.params import DEF_PARAM_FILE assert os.path.isfile(DEF_PARAM_FILE)
da8cb9ebaf924c2311bd69bb6ca632a6e91b89634f9e6e7ae3db487afcf917d0
Python
256
12
from enum import Enum, auto class SopaResolutionMode(Enum): '''Enum class for the different ways of resolving multiple SOPA entries of the same atoms.''' FULL = auto() MAX = auto() MIN = auto() MIN_MAX = auto() AVERAGE = auto()
01919bf715bb2573f1d71e244232536cb24e9e496813a5e923e7c32b3c74e79a
Python
257
9
#!/bin/env python3 """ Feynman diagrams for PDL topology ================================= Python module to create Feynman diagrams for phase defect line (PDL) topology using NetworkX. """ from . import particle, pool, reaction, history, diagram, yamlrepr
40f0a21273cb66957f73276c9db76d5ae4ff5e27abbea1ad57469039e0fc0c5d
Python
257
8
import os import numpy as np root_folder = '/media/pjc/expriment/mdd_exam/pjc/EV_GCN-master/data/' data_folder = os.path.join(root_folder, 'ABIDE_pcp') subject_IDs = np.genfromtxt(os.path.join(root_folder, 'subject_IDs.txt'), dtype=str) print(subject_IDs)
733f5b3a10ffc02237bde9bfaeaab926611969f65ab8020b49f5911518b3f044
Python
257
13
from wonambi import Dataset from .paths import bci2000_file def test_bci2000_data(): assert bci2000_file.exists() d = Dataset(bci2000_file) assert len(d.read_markers()) == 0 data = d.read_data() assert data.data[0][0, 0] == 179.702
f86af4d8f182eb0990fa7d180edfaf62f83e8ee07c74788845bae7369f49380f
Python
257
9
from plotly.offline import plot from .paths import PLOTLY_PATH def save_plotly_fig(fig, name): div = plot(fig, include_plotlyjs=False, output_type='div', show_link=False) with (PLOTLY_PATH / (name + '.html')).open('w') as f: f.write(div)
0ecc6f8e1dc480f1996369fea896267f32d7339bceeeecbb20e1637da55dd5a9
Python
258
10
"""Evaluator scaffold for multi-state predictions.""" class MultiStateEvaluator: """ Placeholder for evaluating multi-state predictions. Input handling and evaluation methods will be defined as multi-state metrics are implemented. """
41edc61cf0d994d8f20a3e45fece22414e9485aaaddb90730494c96da2c3a752
Python
258
9
"""Trains a model on a dataset.""" from chemprop.args import TrainArgs from chemprop.train import cross_validate from chemprop.train import run_training if __name__ == '__main__': cross_validate(args=TrainArgs().parse_args(), train_func=run_training)
c2ef12125733205b6d5c54e513cbdcf00b8dfaaa22117ac6f30f21b817a6dccf
Python
258
16
import pandas as pd n_evaluate_targets = 19 past_horizon = 24 forecast_horizon = 3 train_test_split_period = pd.Period("2011-01-01", freq="M") # Model Training batch_size = 32 n_epochs = 50 patience = 10 # Model Parameters n_features_Y = 1 n_models = 25
1555adc7385b1fee159cfe9fe1aef0500f3d5193dfdfccdb92f8433d002a0dea
Python
259
6
"""Core algorithms for the tissue-masking tool. * :mod:`masking` - `compute_tissue_mask`, `process_group`. * :mod:`io` - folder discovery, channel grouping, atomic file writes. * :mod:`pipeline` - `MaskingParams` dataclass + `MaskingPipeline.run`. """
1ffee0c393fd393375d7e71b7f7a824217a5e5c48a57febf0485cb10f1a9c2bf
Python
259
7
"""Validation of HED tags.""" from .hed_validator import HedValidator from .sidecar_validator import SidecarValidator from .def_validator import DefValidator from .onset_validator import OnsetValidator from .spreadsheet_validator import SpreadsheetValidator
2f964bac05fdcecd8d37ef99fc2ed32c9ff2442ed98a0640e5fb13d7634104db
Python
259
8
from .data import AijData from .graph import Collater, get_graph, load_orbital_types from .model import Net from .utils import LossRecord from .e3modules import Rotate, e3TensorDecomp from .kernel import DeepHE3Kernel from .analyzer import testResultAnalyzer
e5d61eb2bcb9088b19bdbf31082e14851e3829deb672b93cfdcc5cffce24cf49
Python
259
10
""" Set of utilities for to extract topological and geometrical information from postsynaptic densities # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 09.10.14 """ __author__ = 'martinez' __version__ = "$Revision: 002 $"
17ee4a77e63a1d2b4ee8674f7dd93c35fb754414d71e5d74713bfd7bf2849f44
Python
260
10
from scbs import __version__ with open("pyproject.toml", "r") as toml: for line in toml: if line.startswith("version = "): toml_version = line.strip().split()[-1].strip('"') def test_version(): assert __version__ == toml_version
b81d2fd15e6c1ac4c4b3bbed5169ffb67fc357628367ca7c0f73948fa51a01db
Python
260
13
""" Directory with scripts for various high-level tasks. # Author: Vladan Lucic (Max Planck Institute for Biochemistry) $Id$ """ from __future__ import unicode_literals from __future__ import absolute_import __version__ = "$Revision$" from . import common
b71ed38c30be8fd7957c5ed2283a1f1ef16846e4eff92c0904fc6caa9050f668
Python
261
5
import os default_num_threads = 8 if 'nnUNet_def_n_proc' not in os.environ else int(os.environ['nnUNet_def_n_proc']) RESAMPLING_SEPARATE_Z_ANISO_THRESHOLD = 3 # determines what threshold to use for resampling the low resolution axis # separately (with NN)
4835098ce40d9f196193d8488c90420195771dba6b038b7ca72e5aaf08d4e301
Python
262
10
import pathlib import sys FILE = pathlib.Path(__file__).resolve() MODULE_DIR = FILE.parent # repository root REPO_ROOT_DIR = MODULE_DIR.parent MODEL_DIR = REPO_ROOT_DIR / 'models' if str(REPO_ROOT_DIR) not in sys.path: sys.path.append(str(REPO_ROOT_DIR))
b4207df58f1477d8fb91f6671dc3cfd8fd9b35f8ad018dacd0e3e9ad1b0ea15e
Python
262
13
try: from ._version import version as __version__ except ImportError: __version__ = "unknown" from .bil_data_loader_widget import napari_experimental_provide_dock_widget from .reader import napari_get_reader #from .dataset_info import get_datasets
9e0091da4e43a5d595645427a08964c629a69aec001a50eac9eca656b8848cc3
Python
263
8
DATA_SNAPSHOT_VERSION_DESCRIPTIONS = { "783": "Snapshot 783 - Oct 2023 [latest release]", } DATA_SNAPSHOT_VERSIONS = sorted(DATA_SNAPSHOT_VERSION_DESCRIPTIONS.keys(), reverse=True) DEFAULT_DATA_SNAPSHOT_VERSION = "783" TESTING_DATA_SNAPSHOT_VERSION = "783"
c1e9711cd1bfaa80ad1e6fed308c54875a4938f5294bea1b7b5706138fc04d22
Python
263
12
__all__ = [ "Implementation", "VhdlNode", "Edge", "FilterParameters", "edge", "vhdl_node", ] from elasticai.creator.ir.helpers import FilterParameters from elasticai.creator.ir2vhdl import Edge, Implementation, VhdlNode, edge, vhdl_node
f83999dda718c578528246aaa0e965f8789a6987e7b76edfecea866067b15b51
Python
263
4
from .default_handlers import get_default_shape_inference as get_default_shape_inference from .shape_inference import IrShapeInference as IrShapeInference from .shape_inference import Shape as Shape from .shape_inference import ShapedDatagraph as ShapedDatagraph
26267070c4375d6fab43f9e4fda843a60950dbbf6b7fac41904daa8c29f52a76
Python
266
17
from __future__ import annotations from .config import PipelineConfig from .pipeline import ( PipelineResult, MorphogliaPipeline, run_pipeline, ) __all__ = [ "PipelineConfig", "PipelineResult", "MorphogliaPipeline", "run_pipeline", ]
c1e3d0038536d2d2a060047248b102d38eee70d5fe83ca512e9601ba21e52dbf
Python
266
7
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from .initialise import init, deinit, reinit, colorama_text, just_fix_windows_console from .ansi import Fore, Back, Style, Cursor from .ansitowin32 import AnsiToWin32 __version__ = '0.4.6'
22ff4f38f1ad09a1d458827bed193b2eb6057b8eeef08fc81c62f1d042b16c46
Python
267
10
from setuptools import setup, find_packages setup( author="Oliver Contier", name="dimension_encoding", version="0.0.1", packages=find_packages(where="dimension_encoding"), package_dir={"": "dimension_encoding"}, # package_dir={":": "src"}, )
70ee94bd708fd8dc7fc3e415aa5fd7c6bbd2103a0691fffba8faae54e97bbb11
Python
267
6
"""coglet — high-performance Rust prediction server for Cog ML models.""" from coglet._impl import CancelationException, __build__, __version__, server from coglet._impl import _sdk as _sdk __all__ = ["__version__", "__build__", "server", "CancelationException"]
b722764a1cfc20da853cf735d573b3bacad2a76a5a8f7011400ffeb4dbcd5955
Python
267
10
from collections.abc import Hashable, Iterable, Mapping from typing import Protocol class Graph[T: Hashable](Protocol): @property def successors(self) -> Mapping[T, Iterable[T]]: ... @property def predecessors(self) -> Mapping[T, Iterable[T]]: ...
fdc9ab5f1898863ebf8c717de0ce0e6e22212e732e2362c6cb77c042312e038c
Python
267
12
import typing import numpy as np def colors(size: int = 128, seed: int = 0) \ -> typing.List[typing.Tuple[int, ...]]: np.random.seed(seed) return [ tuple(map(int, color)) for color in np.random.randint(0, 255, size=(size, 3)) ]
2e505d8d053f35386fef894680881b5d40b65d5a62ca895a0f2c52eb77c6eecd
Python
268
14
import torch def euclidean_dist(x, y): # x: N x D # y: M x D n = x.size(0) m = y.size(0) d = x.size(1) assert d == y.size(1) x = x.unsqueeze(1).expand(n, m, d) y = y.unsqueeze(0).expand(n, m, d) return torch.pow(x - y, 2).sum(2)
b4ca5e804b4c14fd3c477fdfc0a15587f848428c91e145e38bcc37b8e58dff7f
Python
268
9
try: import binutil # required to import from dreamcoder modules except ModuleNotFoundError: import bin.binutil # alt import if called as module from dreamcoder.domains.logo.makeLogoTasks import demoLogoTasks if __name__ == "__main__": demoLogoTasks()
de439306d05fb1c9d90eeffe9f03906373be3575803fa02aa5a1134336db1684
Python
268
12
""" Set of functions for IO communication with DisPerSe # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 02.04.14 """ __author__ = 'martinez' __version__ = "$Revision: 001 $" from .disperse_io import * from .handler import DisPerSe
a2e9af05fdc1d1a7110e2d41c29c8ea0f7d206be67c796882496099490d79f57
Python
269
7
__author__ = "Michael Ebner" __email__ = "michael.ebner@kcl.ac.uk" __license__ = "BSD-3-Clause" __version__ = "0.9" __summary__ = "NiftyMIC is a research-focused toolkit for " \ "motion-correction and volumetric image reconstruction of " \ "2D ultra-fast MRI."
0b9fd4e4dc768c77ebab8223d0d7bc3348322f40866a0b4f13b75ec5faba36ea
Python
270
13
# Add paths for importing modules from os.path import join import sys dir_analysis = join("..", "analysis") sys.path.append(dir_analysis) dir_data = join("..", "data") sys.path.append(dir_data) dir_model = join("..", "model") sys.path.append(dir_model)
d24e20a867c30c6a7202a37edae56a66169d614df2b9536549d4ba9b64493038
Python
270
9
""" Additional FSL wrappers intended to be compatible with FSL python wrappers as far as possible """ from .fabber import fabber, mvntool from .epi_reg import epi_reg from .fnirt_extra import fnirtfileutils __all__ = ["fabber", "mvntool", "epi_reg", "fnirtfileutils"]
dea7e39b9c41390b8d08daa9471ed760cce58ddcee1b64cc208d1e52fc01f177
Python
270
19
import pandas as pd from topaz.utils.star import (parse, parse_star, parse_star_body, parse_star_loop, write) def test_parse(): pass def test_parse_star_body(): pass def test_parse_loop(): pass def test_write(): pass
a8d5e366bbd27be7564d5e45065e8282187ce71a796ce5af130715d7393cba41
Python
271
13
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import print_function from setuptools import setup, find_packages import sys setup( name='gxipy', version='1.0.1905.9051', description='', license='MIT', packages=['gxipy'], )
3d157548e43e0c4eea538c269b1d6a3871027f9ff89a7b0e31883f26e22b442b
Python
272
11
"""Stdlib-only installer package. Runs on bare system Python BEFORE the project venv exists - do NOT import regtools or any pip dependency here.""" from dataclasses import dataclass @dataclass class Result: ok: bool message: str detail: str = ""
f2d07744ace8e33c30111e9880d5d8950c38a037dfc66f1980021d52eb14e3db
Python
272
11
from Models.InitialCNN import InitialModel from Models.ViT import ViT AVAILABLE_MODELS = { "CNN": InitialModel, "ViT": ViT } def get_model(config:dict, global_config:dict): model = AVAILABLE_MODELS[config["architecture"]] return model(**config["params"])
80f362dc2fe76ef5ffb035880a3e3b4c3c2c1ab627db396ab5ceef1dcb9f0481
Python
274
10
import inspect def test_registration_app_requests_large_screen_clamped_default(): from regtools.registration.launch import RegistrationApp src = inspect.getsource(RegistrationApp.__init__) assert "width=1720" in src assert "height=1040" in src
ac122d8af71a0f92fcef0bc67662e65361a626cbc351cb44d49cb4f21fa1ab94
Python
274
7
"""Package to detect spindles, ripples, slow waves. """ from .spindle import DetectSpindle, merge_close, transform_signal from .ripple import DetectRipple from .slowwave import DetectSlowWave from .arousal import DetectArousal from .agreement import consensus, match_events
5c765dd3bc500a2e209a767c9ee3c2d69d4c8e0163f07d1b656b54a309bee57c
Python
275
14
from enum import Enum, auto class EdgeType(Enum): '''Enum class for the different types of edges.''' # use bonds as calculated from nbo analysis NBO_BONDING_ORBITALS = auto() BOND_ORDER_NON_METAL = auto() BOND_ORDER_METAL = auto() SOPA = auto()
ce42bf0bf780a97918d48b7d8f1a0a571794e9d1091d7dfb77d7366237030b57
Python
275
9
from torch import Tensor from .math_operations import MathOperations as _FlpOperations def quantize(x: Tensor, mantissa_bits: int, exponent_bits: int) -> Tensor: return _FlpOperations( mantissa_bits=mantissa_bits, exponent_bits=exponent_bits ).quantize(x)
00a0bb2082a666bacf64f695da9014105e8621dfc7cd1c505da86c381273f987
Python
276
9
"""`python -m installer` - launch the wizard at the repo root.""" import os from installer.wizard import InstallerWizard if __name__ == "__main__": root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) InstallerWizard(project_root=root).run()
7dcab90f7a86352a00d9fd0b0652954ad07a8399504fe91b6343e2d2173b49e4
Python
276
9
from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord with open(str(snakemake.output), 'w') as file: for name, seq in snakemake.params['seq'].items(): record = SeqRecord(Seq(seq), id = name) SeqIO.write(record, file, 'fasta')
b02dd8f688a1b1853eaeb8414b2e1449e14f4b89f979cb33b0d2db448426c8f8
Python
276
12
from wonambi.attr import Surf, Channels from wonambi.source import Linear from .paths import (surf_path, chan_path, ) def test_source_linear(): surf = Surf(surf_path) channels = Channels(chan_path) Linear(surf, channels)
13e1c16a480eae2a70df2b5c04ce6fcf168b091158172c77f0890af7ea6a5b3b
Python
277
12
""" setup python path """ import sys import os def add_path(path): if path not in sys.path: sys.path.insert(-1, path) add_path(os.path.join(sys.path[0], '../')) add_path(os.path.join(sys.path[0], '../../')) print("add code root path (with `mylib`, 'acsconv').")
60a509a65da1741a94ada62a14c125c648845e91dd15ef2f4af1fc186314c664
Python
277
6
"""Cellpose model-training launcher. A thin GUI that shows step-by-step instructions for the human-in-the-loop Cellpose training workflow and launches the Cellpose GUI in a subprocess. No training logic lives here - Cellpose owns that; this is a guided entry point. """
eaa2e178e244eb68f391605523ca5d2f25ce04b34a0319d9437e7494ffe9c0a6
Python
277
13
import numpy as np from config import NEW_DATA DATA = None if NEW_DATA: from dataloader_new import DATA, DATA_TEST else: from dataloader_old import DATA print("Dataset {} loaded, containing image preprocessing of size{} ".format(DATA.name, np.shape(DATA.images)))
f395aa81936f62086f8d2ff5d7db17cb72945309a22bc255f8fb2f043035e035
Python
277
11
#!/usr/bin/python # -*- coding:utf-8 -*- # -*-mode:python ; tab-width:4 -*- ex:set tabstop=4 shiftwidth=4 expandtab: -*- from gxipy.gxiapi import * from gxipy.gxidef import * __all__ = ["gxwrapper", "dxwrapper", "gxiapi", "gxidef"] __version__ = '1.0.1905.9051'
9ea4658cf012fe184b1b4a2b0fef62f24bcbec5e414de77a2dd43e0be99d0c7e
Python
278
7
"""Package containing additional functions and classes, such as: - exceptions - simulate (functions to create fake data, channels for testing purposes) """ from .exceptions import UnrecognizedFormat, MissingDependency from .simulate import create_data, create_channels
f7d9e14934ddfa0867e80d91c5ef143a5d7c32c6a31f5cba2855eecb2d3b5a15
Python
278
9
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..file_utils import requires_backends SLOW_TO_FAST_CONVERTERS = None def convert_slow_tokenizer(*args, **kwargs): requires_backends(convert_slow_tokenizer, ["sentencepiece", "tokenizers"])
0a53f98c22165bd76c8720d4154f2d4db9849395e179327fd61d491fd16034a4
Python
279
12
#!/usr/bin/env python import hashlib from lab.parser import Parser def add_hash_value(content, props): props['translator_output_sas_xz_hash'] = hashlib.sha512(content).hexdigest() parser = Parser() parser.add_function(add_hash_value, file="output.sas.xz") parser.parse()
1a31fb37528ac4112b5cbc95eed78ae617ff3c782d64b33922ab208b94cba340
Python
280
7
from ._int_arith_protocol import IntArithmetic from .fxp_arithmetic import FxpArithmetic from .fxp_params import FxpParams def int_arithmetic(total_bits: int, signed: bool) -> IntArithmetic: return FxpArithmetic(FxpParams(total_bits=total_bits, frac_bits=0, signed=signed))
8142ca5e85f0a341526471cb58ed9f7c1bb13220da93dfbe608df6fd48cbdde5
Python
280
9
from scipy.signal import butter, lfilter def butter_lowpass(lowcut, fs, order=5): return butter(order, lowcut, fs=fs, btype='low') def butter_lowpass_filter(data, lowcut, fs, order): b, a = butter_lowpass(lowcut, fs, order=order) y = lfilter(b, a, data) return y