sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
7572aee3f85b3a7f95cc75c8f1f0f339b7f6a2bfd4805c6ff0dd5fa0870e7b01
Python
188
6
# -*- coding: utf-8 -*- from .model import VISemanticDependencyModel from .parser import VISemanticDependencyParser __all__ = ['VISemanticDependencyModel', 'VISemanticDependencyParser']
f32e95dda4dfa8994a5b52cea9284a984902e59f0678953f180979edc03e7cd3
Python
188
6
# Copyright (c) OpenMMLab. All rights reserved. from mmcv.cnn import CONV_LAYERS from torch import nn CONV_LAYERS.register_module('Deconv', module=nn.ConvTranspose2d) # TODO: octave conv
7fba6bb1c5780e4ccba6775a86ec6bec584fcc67afe9d15818e6c613c4b23e6f
Python
189
8
""" OXASL - Quantification using SVB (Stochastic VB) Copyright (c) 2008 University of Nottingham """ def run(wsp): raise NotImplementedError("SVB quantification not yet implemented")
8704f5d2866c16eca4042a3ef285314db5f08522daa430e3f78630f72daade17
Python
189
6
# -*- coding: utf-8 -*- # @Author: Sadamori Kojaku # @Date: 2023-06-15 12:07:19 # @Last Modified by: Sadamori Kojaku # @Last Modified time: 2023-06-15 12:32:16 from .generator import *
b712819c62b1b27f29fd61cb4fea1f46e4e6c864dd5709e085ded8a89472b2e7
Python
189
9
# Settings for time-related aspects of simulation params = {} # Length of simulation before voltage is checked (ms) params["tstep"] = 100 # Size of time step (ms) params["tres"] = 0.025
edfc4209a0f16fa50d495f0e9e3f37d633d0d004c0f1003d2084e8960768555a
Python
190
10
import io from PIL import Image def _plot_to_image(ploter): buf = io.BytesIO() ploter.savefig(buf, bbox_inches='tight', pad_inches=0.0) buf.seek(0) return Image.open(buf)
8b76864a6c4bfa216af1c2ec33b46d6e1aeb5491c0a20184dbb7fbfba0dd380a
Python
191
6
""" Specification tests for HED Python library. This package contains integration tests that validate the HED Python library against the official HED specification and example datasets. """
775a427e61f33f188c6b9cc82c4bd532a47659bcbc5757bb8934f966adbeb373
Python
192
9
from .amigos import * from .deap import * from .dreamer import * from .mahnob import * from .seed import * from .seed_iv import * from .mped import * from .seed_v import * from .faced import *
9c82347bbc6ab451a9216be843ea9508ddceb3a113cce6b4c7025537df2e63e7
Python
192
4
from .wgan_gp import WGANGPTrainer, CWGANGPTrainer from .beta_vae import BetaVAETrainer, CBetaVAETrainer from .ddpm import DDPMTrainer, CDDPMTrainer from .glow import GlowTrainer, CGlowTrainer
c4324954cd12a415b9005f963239e31ef1956700ca6ac8b70402f3c38ebe48bd
Python
192
15
from .config import ( CategoryConfig, ) from .stage import ( CATEGORY_COLUMN, apply_category, ) __all__ = [ "CategoryConfig", "CATEGORY_COLUMN", "apply_category", ]
fd7fc129f0824059c8d0d270bef00260104f38050c8b5fd88e738969eaf5d486
Python
192
3
from .metabric_datasets_manager import METABRIC_Datasets_Manager from .tcga_datasets_manager import (TCGA_Balanced_Datasets_Manager, TCGA_Datasets_Manager)
084672956bb68188f67efdfc446129c435c37dc4b243602d5a4a17a7f316605c
Python
193
6
#! /usr/bin/env python # -*- coding: utf-8 -*- from main import main main(combinations=[("issue571-base", "issue571-base", "issue571-v3"), ("issue571-base", "issue571-base", "issue571-v4")])
275341ef483aac315a5b8b8ee6741ce5bfa376ac0be315897b96b4e90d8dfb0a
Python
193
6
#! /usr/bin/env python # -*- coding: utf-8 -*- from main import main main(combinations=[("issue571-base", "issue571-base", "issue571-v6"), ("issue571-base", "issue571-base", "issue571-v7")])
3c5e521f5f306aac368016f0d86e3bdab051f6d5da8613a585f5d100a68b40f8
Python
193
12
from setuptools import setup setup( name="met-brewer", version="1.0", packages=["met_brewer"], install_requires=[ "colour>=0.1.5", "matplotlib>=3.5.1" ] )
70319a548bc55c89a57304cc72e2c32e430dca8d9bf23e545bf943fd8a53c8b1
Python
193
6
#! /usr/bin/env python # -*- coding: utf-8 -*- from main import main main(combinations=[("issue571-base", "issue571-base", "issue571-v4"), ("issue571-base", "issue571-base", "issue571-v5")])
b232538cffc963d0b445257f207378c4fa11b62c49cca056fe7e2b705a9c7adb
Python
193
6
#! /usr/bin/env python # -*- coding: utf-8 -*- from main import main main(combinations=[("issue571-base", "issue571-base", "issue571-v5"), ("issue571-base", "issue571-base", "issue571-v6")])
d08592c09b21e2f247acb2cf75f17545e2218c2954da6ff50238bb71b412ad65
Python
193
11
from preprocessing import * import json import sys def main(arg): params = json.loads(arg) task = PreprocessChunkTask(**params) task.execute() if __name__ == "__main__": main(sys.argv[1])
eb489fe8da5ccbd317d6d705c1d51b1d97b4994d1996812be3beda086f48301a
Python
193
6
#! /usr/bin/env python # -*- coding: utf-8 -*- from main import main main(combinations=[("issue571-base", "issue571-base", "issue571-v2"), ("issue571-base", "issue571-base", "issue571-v3")])
311fc5bc44c119e499d93adb8be32ddd2bdadbde1bf41727e0a5ace097c72326
Python
194
14
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 27 13:50:10 2020 @author: sayan """ import torch def cpu(x): x = x.to(torch.device("cpu")) return(x)
b9c1b157505791b9cb7bec2fe166921da508c545e1a53790bee6713c1c8abaf8
Python
194
6
""" https://github.com/MIPT-Oulu/Collagen/blob/master/collagen/modelzoo/segmentation/constants.py """ allowed_encoders = ['resnet18', 'resnet34', 'resnet50'] allowed_decoders = ['FPN', 'UNet']
abd098b55ef8cf07cc20ec2bfa70314abd777348eeadbe4e49cafd374fc96d2f
Python
195
5
from .arjun_vit import ArjunViT from .simple_vit import SimpleViT from .vanilla_transformer import VanillaTransformer from .vit import ViT from .LFP_Transformer_LARGE import LFP_Transformer_LARGE
dd914aa21b0b7c7bafa758ac57deae6ef5a9bd0cf31452a3b943c6508824814a
Python
195
11
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys from .main import main if __name__ == '__main__': sys.exit(main())
96b485b28f61f178cf47139470efe7e91c8a2e3bbd7c06702a495b76005d7b85
Python
197
6
import torch class HardTanh(torch.nn.Hardtanh): def __init__(self, min_val: float = -1, max_val: float = 1) -> None: super().__init__(min_val=min_val, max_val=max_val, inplace=False)
3949358cb2e9ba0e2a3f64e5b9822fc96e8a914abc7d369af8f7f6fa3d466527
Python
198
10
"""Collection of modules for post-hoc data analysis """ from .array_ops import * from .data import * from .dynamic import * from .static import * from .statistics import * from .visualize import *
5c68713587a06634211560025ed6ca8f25c4e85ad17b6fc74a3a52b98d38dcf7
Python
198
3
from .create_makefile import create_makefile as create_makefile from .flatten_params import flatten_params as flatten_params from .get_vhdl_templates import get_vhdl_templates as get_vhdl_templates
8d422f34d12f47b872f03345a5846e4fee789cb137cadb0e37b8f7c489eca0d2
Python
198
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-v2")])
5cd8fada87f5987024fcea54b93bf2604557a835eff2571c2d2016effba18efd
Python
201
5
from .base_dataset import BaseDataset from .base_datasets_manager import BaseDatasetsManager from .base_model import BaseModel from .base_tester import BaseTester from .base_trainer import BaseTrainer
8e85484f902e82c9322ddf14fcaa1614ee77731f173efd4ce6ad4431278f3283
Python
201
9
from setuptools import setup, find_packages setup( name="discrete-vaes", author=["Max D Grogan"], author_email="mdg19@ic.ac.uk", version="1.0.0", packages=find_packages("tvae"), )
93a4dccadcbdb0d2a08efb3da49cf44eed5353d0634dc7bd3f3c938f5441cdb7
Python
201
3
print("DEPRECATION NOTICE: this module (dreamcoder.ec) will be deleted soon, " "please update your code to import from dreamcoder.dreamcoder instead") from dreamcoder.dreamcoder import * # noqa
3975ff38544df73ef040306c62defd6eddf9d49a8bb31a95f222eed78804ed31
Python
202
6
from utils.hgnn_utils import * from utils.data_utils import * from utils.dataloader_utils import * from utils.roi_utils import * # from utils.hyperbolic_learning_master import * print('imported utils')
59bdc4bb60db69b9745097994986308e6454fcb1a50db92dc76a470b996a80b0
Python
202
10
import warnings from . import train from . import losses from . import metrics warnings.warn( "`smp.utils` module is deprecated and will be removed in future releases.", DeprecationWarning, )
ef740e700afcb4538522134868a81a069ec977610d90ae1cc4a7e814971de662
Python
202
7
__author__ = 'martinez' from .parser import Threshold from .parser import SliceSet, SynSliceSet from .parser import LinkerSet from .parser import ThresSliceSet from .parser import RwrGroup, RwrGroupSet
7e9f8ad91a03bf8d424e1ba68777de9d086e579f3c2c4f32b0ca6de760d43340
Python
204
6
# -*- coding: utf-8 -*- from .model import TetraTaggingConstituencyModel from .parser import TetraTaggingConstituencyParser __all__ = ['TetraTaggingConstituencyModel', 'TetraTaggingConstituencyParser']
00025db6d9c110d2d56d30cae434442c93d63d4f594b44cef05bbe8c11dfee3b
Python
205
9
import pyqtgraph as pg import pyplot pyplot.SetJetRGBC(0.5) pyplot.SetDefScatMarkerSize(6) pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') import pyclamp self = pyclamp.main()
9ddfaae8c00ed039763d4068f1a75d6ed562544de794545cf8fc5caf1a803e48
Python
205
14
### configs for next hyperparam trial import optuna from datetime import datetime dataset = 'cora' task = 'lp' config = { 'set_params':{ 'task':task, ### 'dataset':dataset, } }
8472345c7e7d3b5e005e13fccdc08f334f3a8fc44aa8dbcf0c0b19061bd1e12d
Python
206
11
import sys import pyqtgraph as pg import pyplot pyplot.SetJetRGBC(1.5) pyplot.SetDefScatMarkerSize(6) import pyclamp if __name__ == '__main__': self = pyclamp.main() sys.exit(self.App.Widget.exec_())
34b30d3a7e68d58113bbad0caa9ac7261427315ecf1dda806dd0ade1724c79a3
Python
207
6
from sleeplab_format.extractor import config def test_parse_config(example_extractor_config_path): cfg = config.parse_config(example_extractor_config_path) assert type(cfg) == config.DatasetConfig
92f3c677b889191af537aa527ae545d2a4786b9fa313c92b2c78ee86f206d625
Python
207
8
import os, gdown, tarfile def extract_tar(tar_file, dst_path, delete_after=False): tar = tarfile.open(tar_file) tar.extractall(dst_path).close() if delete_after: os.remove(tar_file)
ae342319ad05b278f7f26d919d944a97e16555f0bedaca7a2b2c06f5755d67da
Python
207
4
from .src.mac_array import mac_array as mac_array from .src.mac_bram import mac_bram as mac_bram from .src.uint_to_int import uint_to_int as uint_to_int from .utils import load_and_plugin as load_and_plugin
185c588afe96d72b7b259029d76dd765a6e265014ace437b5ad50dd2dafb330f
Python
208
11
from enum import Enum class Mode(Enum): """Enumeration over the different prediction modes.""" PREDICT = "predict" TRAIN = "train" def __str__(self) -> str: return str(self.value)
8746f66d600c06762c72fa340b852ae87be505f4915ccc6fe06a2e60b3ddd534
Python
208
10
""" Clustering # Author: Vladan Lucic (Max Planck Institute for Biochemistry) # $Id: __init__.py 914 2012-10-25 16:15:17Z vladan $ """ __version__ = "$Revision: 914 $" from .contingency import Contingency
b4048ef49ed4c5660ee9434cf5e885e25c96ba8f19f0bfb9c2b42715c5f29017
Python
208
9
from __future__ import absolute_import from __future__ import division from __future__ import print_function from .gspan import gSpan from .config import parser from .main import main __version__ = '0.2.2'
25c94f0eed69292791f703ce9786655db10591bbd95745ee39e6383dbf576b9c
Python
209
10
from typing import Any, Protocol class _NodeP(Protocol): implementation: str name: str type: str input_shape: tuple[int, int] output_shape: tuple[int, int] attributes: dict[str, Any]
771e3e13f07d0bcbd8d5c8d43100167456b3da59d2c74b9f4e4b7e04dcc48ef0
Python
209
10
"""Parameter estimation methods for HMP models.""" from .base import BaseEstimator, EstimationResult from .em import EMEstimator __all__ = [ "BaseEstimator", "EstimationResult", "EMEstimator", ]
ef49d4247fe2b722d99918c9caaa12f7e1f82e493943a0797d4084839be79a4b
Python
209
5
from .dnn_trainer import DNN_Trainer from .multi_dnn_trainer import Multi_DNN_Trainer from .dann_trainer import DANN_Trainer from .tester import Tester from .baseline_fits_manager import Baseline_Fits_Manager
062ed6fdb43f656fc995deb5816d802b7cda59c2005700b4949d0e723bae38ac
Python
211
7
from .coral import CORALTrainer from .ddc import DDCTrainer from .dann import DANNTrainer from .dan import DANTrainer from .ada import ADATrainer from .jan import JANTrainer from .center import CenterLossTrainer
15bdea8c12cd4e26236415d62f9f53b219df4b8a0bea6360789568df75fd6117
Python
212
6
# -*- coding: utf-8 -*- from .model import BiaffineSemanticDependencyModel from .parser import BiaffineSemanticDependencyParser __all__ = ['BiaffineSemanticDependencyModel', 'BiaffineSemanticDependencyParser']
2f2faf2007944efcac1bae475463c600844c70dc395ce912ea2e9a0941cfacea
Python
212
8
""" To run snap_coordinates from your local machine, set the path to the root of mounted rhino. e.g. if rhino is mounted in a folder named RHINO in /Volumes, set RHINO_ROOT='/Volumes/RHINO' """ RHINO_ROOT='/'
65b97e0d0faf8250aa88061bfc2d708152cd275f3a51949145f33391067f7ce5
Python
212
6
from enum import Enum class Methods(Enum): METHOD_IMG_PROC = "Image Processing" METHOD_GAN_IMG_PROC = "GAN + Image Processing" METHOD_GAN_4SM = "GAN + 4SM" METHOD_GAN_SEGMENTATION = "GAN + Segementation"
64255710421e97726cd1ae991a5d80b993958cb55ebeaf46d7e3ebb8d88c533e
Python
213
3
from .src.bram_dual_port import bram_dual_port as bram_dual_port from .src.bram_single_port import bram_single_port as bram_single_port from .src.lutrom_single_port import lutrom_single_port as lutrom_single_port
22fccb22194bb04115811af75f0c05a3a00c88b581d741a883787657e384ff66
Python
214
7
# from .expect import expect_2distr from .expect_efficient import expect_2distr from .sampling_Ustate import make_logpsi_U_afun, _logpsi_U_fun from netket.utils import _hide_submodules _hide_submodules(__name__)
ef1ec76095529fd586313d9d5b3905a037e70c19fd1a7743a1fb6a1fdf01955c
Python
214
13
from .biotite import ( BiotiteParser, BiotiteReader, BiotiteWrapper, universe_from_atoms, ) __all__ = [ "BiotiteParser", "BiotiteReader", "BiotiteWrapper", "universe_from_atoms", ]
5a286ffe94f92ec0196c1936fa08ae1003ec2196cb0d03882e490dcc4a77ff04
Python
215
11
import numpy as np from topaz.utils.data.coordinates import coordinates_table_to_dict, match_coordinates_to_images def test_coordinates_table_to_dict(): pass def test_match_coordinates_to_images(): pass
f6883754f5a74abce26dfe3f160ca129bc549f2fe6391eed86f20fae792aea0d
Python
215
8
# -*- coding: utf-8 -*- @profile def test_unicode(txt): # test when unicode is present txt = txt.replace (u"ی", u"ي") #Arabic Yah = ي return txt if __name__ == '__main__': test_unicode (u"ایست")
6e3b82b1a8869b2d1c017e4c42ce27b2afbac65e51a6e53c11c05e03b0ca414f
Python
216
7
import mmdet from packaging import version if version.parse(mmdet.__version__).major >2: from Pose_detect_mmdetect3x import Pose_detect_mmdetect else: from Pose_detect_mmdetect2x import Pose_detect_mmdetect
792728021e26075df5b8eb4972b2aa62bfd3da9438a197175da2b30aa4274cdf
Python
216
10
import torch.nn from elasticai.creator.nn.binary.binary_quantization_function import ( Binarize as _BinarizeFn, ) class Binarize(torch.nn.Module): def forward(self, X): return _BinarizeFn.apply(X)
acbdbbedb088fa2474d6c3fcc40d244d3fd00985580582768c40d2d650b40f25
Python
216
5
### Submit script "XY.py" to HPC (Torque) cluster import subprocess subprocess.run(['echo "$PWD/extract_timeseries.py" | qsub -l nodes=1:ppn=1,walltime=48:00:00,mem=128gb -N extract_timeseries'], shell = True)
c5ee22840aeda1cbeb48bd6f02133da8108cc2f054fb37c908ab1b12a45641f5
Python
216
6
# -*- coding: utf-8 -*- from .model import AttachJuxtaposeConstituencyModel from .parser import AttachJuxtaposeConstituencyParser __all__ = ['AttachJuxtaposeConstituencyModel', 'AttachJuxtaposeConstituencyParser']
1773a8f6c26611a482b2213019097d901f946d913465109f7c193271be51c135
Python
217
9
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Add custom configs and default values""" def add_custom_config(_C): # Add your own customized configs. pass
819f8d43973ab9fc1512427407091baea1bd4ef5a2ad5248ad51aa860bda63e4
Python
217
8
def aix_platform(osname, version, release): try: import _aix_support return _aix_support.aix_platform() except ImportError: pass return "{}-{}.{}".format(osname, version, release)
c23a78db4eb270e71771dbf3672cf5657ff5fbe2d6588864c4ec9cd7a2a2b7a8
Python
217
10
from setuptools import setup with open("requirements.txt") as f: require = [x.strip() for x in f.readlines() if not x.startswith("git+")] setup( name="inv_vae", version="0.1", packages=["inv_vae"], )
d6b69a80319c8077a703e35c8f7a0a1d30a4d1a8bc96d2dda90cd303ffdc9648
Python
217
8
# app from .compression_based import * # noQA from .edit_based import * # noQA from .phonetic import * # noQA from .sequence_based import * # noQA from .simple import * # noQA from .token_based import * # noQA
cc67b2b50e7bfa4896428b71da0a99617079309d78817ed0fc4457d75b821fa1
Python
218
9
from __future__ import annotations import pytest from quacc.utils.kpts import bandgap_to_kspacing def test_bandgap_to_kspacing(): assert bandgap_to_kspacing(0.60) == pytest.approx(0.20040662647547047)
9900f30f885d02174ac21b489b9e00fe5fe39a2cd01e27fa64cd6354205b970b
Python
220
13
from pathlib import Path import pytest @pytest.fixture def data_dir(): return Path(__file__).parent / "data" @pytest.fixture def stat_img(data_dir): return data_dir / "collection_658" / "image_10426.nii.gz"
658d4a11bf5c8d8bbdadaaeb0a8155382f770904ae72d10f60ce34e8eb786d8b
Python
221
6
import pytorch_cifar_models dependencies = ['torch'] models = filter(lambda name: name.startswith("cifar"), dir(pytorch_cifar_models)) globals().update({model: getattr(pytorch_cifar_models, model) for model in models})
6c80bc6ed09e32d845eb1dacd77f6fbad0ef89a7b0e0c5a798c97da8aa0f49a7
Python
221
8
"""Different methods for projecting data into subspace.""" from .base import Projector from .custom import Custom from .identity import Identity from .pca import PCA __all__ = ["Projector", "Custom", "Identity", "PCA"]
a12af44878b84f97cce6dc9b444386ca24eaddfd9bbad23ae7438ecc7ac39f40
Python
221
12
import copy class ReplayAgent: def __init__(self, actions): self.actions = list(copy.copy(actions)) def reset(self): pass def act(self, obs, reward): return self.actions.pop(0), {}
d0cff2ffd599db3b52df4d2cbf8e64a932adec409125fa52b2f5cd18d07f611d
Python
221
15
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 27 13:08:35 2020 @author: sayan """ import torch def gpu_t(x): x = torch.tensor(x.astype(float)).float() y = x.to("cpu") return(y)
237dd6dfff12e5cf61b130f70a3abae74cd791a870e8a251645b20b6b7b6c6fa
Python
222
6
from cog.errors import CogError, ConfigDoesNotExist, PredictorNotSet def test_error_types_remain_importable() -> None: assert issubclass(ConfigDoesNotExist, CogError) assert issubclass(PredictorNotSet, CogError)
0040fb56f1245cd9c109ea33f7f366dfece12fb106a9430775db5715fa2a33df
Python
223
9
"""""" class DeviceNotConnected(RuntimeError): """ Raised when the requested device is not connected. """ class IllegalSetting(ValueError): """ Raised when the device does not support the requested setting. """
4a76d97e1c2ae8f4aa8cf955eac38ccf915f6c70f6479a7a1b21395f0a9c4dca
Python
223
14
# coding: utf-8 import os.path as osp import sys def add_path(path): if path not in sys.path: sys.path.insert(0, path) this_dir = osp.dirname(__file__) lib_path = osp.join(this_dir, '.') add_path(lib_path)
563de0af590a831a4d9b857f80c6cfa7abf092b4079136a2df1910b137d58230
Python
223
5
from .src import grouped_filter from .src.filter_params import FilterParameters from .src.index_generators import GroupedFilterIndexGenerator __all__ = ["FilterParameters", "grouped_filter", "GroupedFilterIndexGenerator"]
929bb7443c6585e6f64dba31c68dc187ac7d3318f0ceabbe6e8c6b6b26eca034
Python
223
10
import numpy as np def center(box: np.ndarray) \ -> np.ndarray: return np.stack(( (box[..., 2] - box[..., 0]) / 2 + box[..., 0], (box[..., 3] - box[..., 1]) / 2 + box[..., 1], ), axis=-1)
f6d27c7fd8900357bfa7b2399105bd2de468185d7cb131a02c65e01f41b272c4
Python
224
12
import numpy as np from topaz.transform import ScaledGaussianMixture class TestScaledGaussianMixture(): def test_init(self): pass def test_fit(self): pass def test_transform(self): pass
6f592825692057547ea17d9314191390927d173d77d291fd29674f17f2540ff0
Python
225
15
from niftymic.__about__ import ( __author__, __email__, __license__, __summary__, __version__, ) __all__ = [ "__author__", "__email__", "__license__", "__summary__", "__version__", ]
66385f7d1657932ec530dc5a19066ba1230d9de0b1c85297875732fdaa68a8a8
Python
226
5
path_to_pad = [ "/home/xtngchn3/final_submission/architecture", # todo: change path "/home/xtngchn3/final_submission/utils", # todo: change path ] data_path = "/home/xtngchn3/Dream-Challenges-Data" # todo: change path
6df1de2c53fb0374aaeb892e94fcf8eb89dbb6552b796a3c03aa2c8ef811fc1f
Python
226
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'{p.Q:+2}', f'{p.P:+2}', sep='\t')
988ba652a929042fe34a9a386b4acb7d749dd63ea9173d50642114c1cd5f2df6
Python
226
11
""" Set of exceptions used in PySeg package # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 02.04.14 """ __author__ = 'martinez' __version__ = "$Revision: 001 $" from .pexceptions import *
a2d2ba7344a1847cfe912f05365776b0f4a03a1257932c1f462b8fb3ec911fd7
Python
226
8
# Copyright (c) OpenMMLab. All rights reserved. from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry MODELS = Registry('model', parent=MMCV_MODELS) BACKBONES = MODELS COMPONENTS = MODELS LOSSES = MODELS
be1c2d855e02e03b96a553e04e3b8a1f79a5631ae94eb13cae61b5fb8e93e076
Python
226
7
from .ani import ANI from .miao import MiaoNet from .spinmiao import SpinMiaoNet from .miaomiao import MiaoMiaoNet from .model_interface import LitAtomicModule from .base import MultiAtomicModule from .repulsion import TwoBody
072790acb9c180d415e2a9ca1c74df04b57134c34ffbb1c9bf4e99d2c19a4d4a
Python
228
3
from .file import download_url, get_package_dir_path, get_temp_dir_path from .visualize import (plot_2d_tensor, plot_3d_tensor, plot_feature_topomap, plot_raw_topomap, plot_signal, plot_adj_connectivity)
96a3400e550143655787768850cb1893e74239066ff44223e8362634788b1ec8
Python
228
15
import os import subprocess import sys argv = sys.argv argv = argv[argv.index("--") + 1 :] def main(): python = os.path.realpath(sys.executable) subprocess.run([python] + argv) if __name__ == "__main__": main()
0420eba98f6d2f42c7334aec1c01bc8751312776c2803db9179e536ad7ecdfb1
Python
229
6
# Copyright (c) OpenMMLab. All rights reserved. from .cli import modify_args from .logger import get_root_logger from .setup_env import setup_multi_processes __all__ = ['get_root_logger', 'setup_multi_processes', 'modify_args']
1b28de34809424fae92c05bcbeb155972e485d6332fe7c91a750dec57e4527df
Python
229
6
from .dtu import DTUDataset from .dtu_processed import DTUProcessedDataset from .kul import KULDataset from .kul_processed import KULProcessedDataset from .aved import AVEDDataset from .aved_processed import AVEDProcessedDataset
912d75a75c168fa855194c0f071062bd315f3d9e6eecdcddb7487287d5cc5e03
Python
229
8
from .ccnn import CCNN from .eegnet import EEGNet from .fbccnn import FBCCNN from .fbcnet import FBCNet from .mtcnn import MTCNN from .stnet import STNet from .tsception import TSCeption from .sst_emotion_net import SSTEmotionNet
287e81e6d22552044f1dbc9da4bc04b5fee17e955d12e83317e20aac924578f4
Python
231
13
import autograd.numpy as np from autograd import grad def peakmem_needless_nodes(): N, M = 1000, 100 def fun(x): for i in range(M): x = x + 1 return np.sum(x) grad(fun)(np.zeros((N, N)))
eb2dfee1ef72ca14e44f8ef3d0840c13360e8663da381dfdd66c1f990ed79129
Python
231
5
### Submit script "XY.py" to HPC (Torque) cluster import subprocess subprocess.run(['echo "$PWD/create_is-distance_matrices.py" | qsub -l nodes=1:ppn=1,walltime=01:00:00,mem=128gb -N create_distance_matrices'], shell = True)
9071db434d2e669400060cdf2fd24230d7fcf09b01ebf71d07e74de3c5f0ac6f
Python
232
12
import setuptools __version__ = "0.1.0" setuptools.setup( name="rocf_scoring", version=__version__, python_requires=">=3.6", packages=setuptools.find_packages( exclude=["preprocessing", "scripts"] ), )
cd2587089af5fb0f6c78182ef03b828544b25e3fa6cf64bc5c96a8d62d5bf411
Python
232
10
from abc import ABC, abstractmethod import torch from elasticai.creator.vhdl.design.design import Design class DesignCreatorModule(ABC, torch.nn.Module): @abstractmethod def create_design(self, name: str) -> Design: ...
d60040fb8bf3caa0c7b9bf5744649645c1b4b8eed2af76ff3669a6b0eb071182
Python
232
10
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
50ae61c2c9e1486d2048247da5c7b853054ea05afb5f375cfd8d3fafd5d52287
Python
234
10
"""Definition of enums.""" from enum import StrEnum class DDCMethod(StrEnum): """Enum for DDC methods.""" FIR = "finite-impulse-response-filter" AVG = "moving-average-filter" CIC = "cascaded-integrator-comb-filter"
ec6bb7df9b534005f272dec38a800cfd413aaa8cdb74cfc90b64f21995e82f94
Python
234
7
"""Optimizes hyperparameters using Bayesian optimization.""" from chemprop.args import HyperoptArgs from chemprop.hyperparameter_optimization import hyperopt if __name__ == "__main__": hyperopt(args=HyperoptArgs().parse_args())
ac1c9814e867fdd61cdf462a4710cc298c9afc83e9989fb152f28064d37c1c58
Python
235
13
from . import config from . import common, mesh, model, model_assembly, solvers, units, mesh_tools __all__ = [ "config", "model_assembly", "solvers", "model", "common", "mesh", "units", "mesh_tools", ]
90993b1fa723c144543efa9c19995885fbfe9709a7cfdb05b6d5a0828fdab61b
Python
236
7
from cuppa.runners.args import RunnerArgParser from cuppa.runners.training_runner import TrainingRunner if __name__ == "__main__": kwargs = RunnerArgParser().get_kwargs_train() runner = TrainingRunner(**kwargs) runner.run()
94023f6c29a78ddb8ea9062bceb56252f9aab9734e5150ec9ea2b06976c43d17
Python
236
10
from setuptools import setup, find_packages setup( name="hippo", version="1.0", description="Hippocampus models", author="Toon Van de Maele", author_email="toonvandemaele@gmail.com", packages=find_packages(), )
c0d7fbf288601a8df62fbed1c5332a6e121a44bc409754f4e3d1fd1a1044de94
Python
236
14
from dash import html, get_app, register_page register_page(__name__, path='/', description="Home") layout = html.Div( [ html.H3([ "Project description", ]), html.Hr(), ] ) app = get_app()
518baff9d1184ea84dbaef17c69531bafdad33094de50f71af5055c393b9e1c3
Python
237
9
from wikibaseintegrator.datatypes.string import String class ExternalID(String): """ Implements the Wikibase data type 'external-id' """ DTYPE = 'external-id' PTYPE = 'http://wikiba.se/ontology#ExternalId'
85deff10d3b84fd1c1c649b3a6c9f0e2f08203c964d8ca5909334c43d52a82ac
Python
237
11
import pandas as pd file_paths = ['Barklabel.csv','Howllabel.csv'] # Tüm uçuşlara ait verileri birleştirme all_data = pd.concat([pd.read_csv(file) for file in file_paths]) all_data.to_csv('DogKaggle.csv', index=False)
27340a94ae1c031e69faaa3a6694563824fb96c4f22f486be3b8c9d071d935e4
Python
238
11
""" 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 *
4cb5fe161b4bbb1f6cde1dc85480adaa87e81a7d034546826f1a82e1e18beba3
Python
239
7
from .aseinterface import * try: from .sharcinterface import * except ModuleNotFoundError: import logging log = logging.getLogger(__name__) log.warning("PySHARC not installed! Install PySHARC to use all features of SPaiNN")