sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a850662b74a0db7785b55b223470a55c3ebd2cac0c08e44a55f40925acccc0bf
Python
199
7
# -*- coding: utf-8 -*- """Methods for blending NWP model(s) with nowcasts.""" from pysteps.blending.interface import get_method from .clim import * from .skill_scores import * from .utils import *
9af5e07d6a8ebd74347f632233dd068e20b0e91c41f7de87d10722bbc490d19e
Python
202
12
class TestChoice: def test_get_choices(self): pass def test_get_tooltips(self): pass def test_has_tooltips(self): pass def test_test_valid(self): pass
ffc155f3c7a16dca9597aa843d02bf6ca9a8fccb688e478b1cad19f106ba143f
Python
202
8
from model.segmentation import SegModel class Model(SegModel): """Model class for ln project.""" def __init__(self, cfg, data, mode): super(Model, self).__init__(cfg, data, mode)
20fbd7f3440d5615fa03edf7d1ec9270c697c3e1fa93cb6c3d3e50402b61f6d3
Python
203
15
import click from ..__main__ import pass_environment @click.group("worker") @pass_environment def command(context): pass @command.command("start") @pass_environment def start(context): pass
4bc26d20f40ef4ab0b89983d39590407aa5623a089dacc19581ddc6a5e2f8649
Python
203
9
from .conv_module import ConvModule from .norm import build_norm_layer from .activation import build_activation_layer __all__ = [ 'ConvModule', 'build_norm_layer', 'build_activation_layer' ]
688a8813421c4f639cace9934968c5ceee222102a4db20c2f6a3c7011a912247
Python
204
8
from ..functions.image_processing import morphology_closing def closing(image, structuring_element): return morphology_closing( image, structuring_element=structuring_element, )
68fdeebd66ef39f6fc21839edabe5fc82b7acb461b17b68957d03838ef19e380
Python
204
8
import multiprocessing import cellprofiler.__main__ if __name__ == "__main__": # allows multiprocessing on Windows after freeze multiprocessing.freeze_support() cellprofiler.__main__.main()
8ebabe25a2b60cb1bf129ed08994e6ab7fc72aba5e23e723e6623b6ad8582252
Python
204
6
from .FeatureClass import FeatureClass from .BSA import BSA from .AtomicFeature import AtomicFeature from .FullPSSM import FullPSSM from .PSSM_IC import PSSM_IC from .ResidueDensity import ResidueDensity
74e79b8fc704acf9791ce35fc9c14b9f3c035b4dced119b88bd3ed3713f8719e
Python
206
12
class TestSubscriberMultiChoice: def test_load_choices(self): pass def test_group(self): pass def test_matches(self): pass def test_test_valid(self): pass
e0d51a27d2b09cb5251bfefa4af860bd35ee89b253aeb35dda85ad90edafcf92
Python
207
8
""" Author: Mingjian He <mh1@stanford.edu> switching module contains switching state-space models in SOMATA """ from .traditional import switching # noqa: F401 from .vb import VBSwitchModel # noqa: F401
286ff0404fdf134cc8de9ecf2a2c6fb568b5e78de6456ed176c21cd377be3964
Python
209
7
""" Author: Mingjian He <mh1@stanford.edu> source_loc module contains dynamic source localization code base in SOMATA """ from .dmap_em import SourceLocModel # Source localization model class # noqa: F401
8959eda4407d0d346a759ba0cec8d5ff62d13e1f9795e9b783f5ea7c26f9c919
Python
209
7
"""Main module of `s2cloudless`.""" from .cloud_detector import S2PixelCloudDetector from .pixel_classifier import PixelClassifier from .utils import download_bands_and_valid_data_mask __version__ = "1.7.3"
ca3486890a12bbe4b3de8684d5029549846b55bacb1e71880f936f1037852ad5
Python
209
12
class TestHiddenCount: def test_set_value(self): pass def test_get_value(self): pass def test_set_sequence(self): pass def test_get_unicode_value(self): pass
525f310153e077a221d2d337060e199285767af1939b1a42a087b291f809a882
Python
210
8
from setuptools import setup, find_packages setup( name="lioness", version="0.1.0", description="Code for the LIONESS project", packages=["lioness", "lioness.segmentation", "lioness.utils"], )
c86e28c42f41b9b659dd721c7ea721614f20896be08b33936dbb5e85babf89eb
Python
210
10
import tensorflow as tf from data.data_dealer import DataDealer class Data(DataDealer): """Data input for ln project.""" def __init__(self, cfg, mode): super(Data, self).__init__(cfg, mode)
01c6a11c661c75cb5f866e006b0f8178cb8bbc5ebbca38fe902714b956dd577d
Python
211
12
class TestDependency: def test_source(self): pass def test_source_setting(self): pass def test_destination(self): pass def test_destination_setting(self): pass
ba5cfd9023bfd074fd9b76c386d96b2cd700da9b6f72e2d8b5194b755d950529
Python
214
9
#!/usr/bin/env python import shutil from subprocess import Popen shutil.rmtree('docs/html', True) shutil.rmtree('docs/doctrees', True) shutil.rmtree('docs/build', True) Popen(['make', 'html'], cwd='docs').wait()
e361c43d01cd75604673cc49a5686da8b59453c5bef73a428fcd1b67bf6ba2bd
Python
216
6
from nidm.experiment.Utils import fuzzy_match_terms_from_graph, load_nidm_owl_files def test_loadowl(): owl_graph = load_nidm_owl_files() fuzzy_match_terms_from_graph(owl_graph, "WisconsinCardSortingTest")
7fbb3ad6eaf22d4c18f933311ac35fc2daf71619f7bf281144da7e21ab5a4d37
Python
217
12
from nose.tools import ok_ from deeprank.models.residue import Residue def test_compare(): residue1 = Residue(1, 'ALA', 'A') residue2 = Residue(1, 'ALA', 'A') d = {residue1: 0} ok_(residue1 in d)
27cd5917e961a7c2f7a291fc6f4d88a1bf9514c9bfdfa95e1755b9a7744b5ace
Python
218
7
from ._builder import * from ._helpers import * from ._manipulate import * from ._prune import * import warnings warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.models", FutureWarning)
783299d3badb6c5f72760fb69fa117d93f0c0338bb1969a707353abbcadab5bb
Python
219
7
# -*- coding: utf-8 -*- from __future__ import absolute_import __version__ = "0.0.1" __author__ = "Christoph Friedrich <christoph.friedrich@vonaffenfels.de>" from .core import RGBMatrix, FrameCanvas, RGBMatrixOptions
5863036f7caf70a0d305387660850d9bab34fb2db69f8e4c834655091841cba6
Python
220
8
# -*- coding: utf-8 -*- """Methods for plotting precipitation and motion fields.""" from .motionfields import * from .precipfields import * from .animations import * from .spectral import * from .thunderstorms import *
6e437ffb0a1b79a38aca86d4281b8e21825d9fbcfcbc5a2e502bcdba767566c4
Python
220
12
from functools import partial from typing import Any, Optional import torch import torch.nn as nn import torch.nn.init as init class MobileNetClassifier(nn.Module): def __init__(self): super().__init__()
51ca8e152d4e44e444243c06bfbc6ec2be2d3686a8a43a97192937840929663f
Python
221
4
from ._crop_image_subscriber import CropImageSubscriber from ._file_image_subscriber import FileImageSubscriber from ._image_subscriber import ImageSubscriber from ._outline_image_subscriber import OutlineImageSubscriber
3fc1f7227fa12f75d79894b65a14d069dba618496def4cbd8bfd3b1ebbe6a30a
Python
222
8
from ._run_exception import RunException class PostRunException(RunException): """An event indicating an uncaught exception during the post_run phase""" def event_type(self): return "Post run exception"
5cb5bdf398918124bacb1e0d6501db686be6aaae6294213afd962e1af4cb7a17
Python
222
10
from ._event import Event class URLsAdded(Event): def __init__(self, urls): super(self.__class__, self).__init__() self.urls = urls def event_type(self): return "URLs added to file list"
a4e90b0f5b25ad556e6f8193a9d5b790b22e23eac4228d9cfad254126014a8a3
Python
224
6
""" Options and enums for ShrinkToObjectCenters module """ # Note: ShrinkToObjectCenters is a simple morphological operation module that doesn't require # complex enums. It has no settings beyond basic "Object Processing".
b68b59f619c8ff6be4fa29801456cda19c4aeb585299db4998a9acd416d65dde
Python
224
7
from ._filter_predicate import FilterPredicate class CompoundFilterPredicate(FilterPredicate): def test_valid(self, pipeline, *args): for subexp in args: subexp[0].test_valid(pipeline, *subexp[1:])
bab5c964b705ed89da256882449a623bf9283b3d3881af5d32e92c6aa953b1fe
Python
224
8
from .criterions import UnilateralMse, MixLoss from .visualization import plot_tsne, plot_tsne_3d, plot_confusion_matrix __all__ = [ 'UnilateralMse', 'MixLoss', 'plot_tsne','plot_tsne_3d', 'plot_confusion_matrix' ]
cdba4c1f49d564e34c7bf0536fb45286664b0f117d153beb769974f698c7d7f2
Python
225
5
from ._crop_image_name import CropImageName from ._external_image_name import ExternalImageName from ._file_image_name import FileImageName from ._image_name import ImageName from ._outline_image_name import OutlineImageName
205789160c7fe64a998f2c402560346a3c9c5245dbd1180557318c089014fc26
Python
228
10
from ._event import Event class URLsRemoved(Event): def __init__(self, urls): super(self.__class__, self).__init__() self.urls = urls def event_type(self): return "URLs removed from file list"
61a2aad5a4d5ba1d1ab2f383ec64ebe9873f3e74aa0d67e66d0eb131f2927559
Python
229
6
from __future__ import absolute_import import skimage.segmentation def watershed(image, markers, connectivity=None, offset=None, mask=None): return skimage.segmentation.watershed(image, markers, connectivity, offset, mask)
2f02f1d1a8daf51cabe6377eb4d5fba785bdda82f039f118409e4f65089ad17d
Python
230
5
import logging logging.basicConfig(level=logging.INFO) logging.getLogger('matplotlib').setLevel(logging.WARNING) logging.getLogger('hicmatrix').setLevel(logging.WARNING) logging.getLogger('numexpr').setLevel(logging.WARNING)
6224b1eb54baffe1ac90b11fd0fda9a46451215e1ba55d217765318aab311845
Python
231
15
class TestJoiner: def test_parse(self): pass def test_default(self): pass def test_build(self): pass def test_build_string(self): pass def test_test_valid(self): pass
6bfc295b7c8dd3f05479b62c465d353a43cddec7517b2f07f1c9f0c13bbf2cb2
Python
231
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
aef3990bc60ebdc3e9834df1650b7120f5ae1aa7d194698022652290eecba1c3
Python
231
8
from ._run_exception import RunException class PrepareRunException(RunException): """An event indicating an uncaught exception during the prepare_run phase""" def event_type(self): return "Prepare run exception"
3a365740df3ebbeee5c023f57b4bc077e3036f260408ec1f5e49cd4359e2ce53
Python
233
11
import wx from ..figure import Figure class WorkspaceViewFigure(Figure): def on_close(self, event): """Hide instead of close""" if isinstance(event, wx.CloseEvent): event.Veto() self.Hide()
fed13a00a431e61dbf2a66105dd69f7bbac20f6b61770d8d5de022a5e3832b76
Python
235
6
"""Miscellaneous utilities for MEG/EEG field modelling """ from .compare_fields import compare_fields from .fieldcomp import dipfld_sph, biot_savart, magdipfld from .spharm import sph_X_fixed, sph_v from .fileutils import read_opt_res
fc40281c2552486b9792d3ec7165575c0de1dce8ff39a8220d56c1019e0788be
Python
236
6
from ...utilities.zmq.communicable.request import AnalysisRequest class SharedDictionary(AnalysisRequest): def __init__(self, analysis_id, module_num=-1): AnalysisRequest.__init__(self, analysis_id, module_num=module_num)
4b4ec12ca408258db8806fce0862e5dd91943419e7f441994f9ded11cea359da
Python
237
11
import sys from ..module._plugin_importer import PluginImporter from ..utilities.core.modules import fill_modules from ..utilities.core.plugins import load_plugins sys.meta_path.append(PluginImporter()) fill_modules() load_plugins()
611c5920de72b29137758e3f7be6a1cb5637a9c8e512a275e2252461908b11e6
Python
239
9
import asteroid from .sepformer_tasnet import SepFormerTasNet, SepFormer2TasNet asteroid.models.register_model(SepFormerTasNet) asteroid.models.register_model(SepFormer2TasNet) __all__ = [ "SepFormerTasNet", "SepFormer2TasNet", ]
0ad1edaed21a348b96e13f1e46dd25653ba24cb5f66174d010b6c31ca87dcc7f
Python
245
15
class TestSubscriber: def test_get_group(self): pass def test_get_choices(self): pass def test_get_is_blank(self): pass def test_matches(self): pass def test_test_valid(self): pass
2cee33f7087388ceb8ff5a553cc1a958f28f4bb541c00aa31e06331bc91e3efd
Python
248
10
from config import DEBUG import traceback def print_debug(message, exception=None): if DEBUG and not exception: print(message) elif DEBUG and exception: print(message) print(exception) traceback.print_exc()
8365d665ef6ada12e229391e8d46a945f69e02e32ed76526691942d45a1f7f2d
Python
248
8
from enum import Enum class SecondaryObjectMethod(str, Enum): PROPAGATION = "Propagation" WATERSHED_GRADIENT = "Watershed - Gradient" WATERSHED_IMAGE = "Watershed - Image" DISTANCE_N = "Distance - N" DISTANCE_B = "Distance - B"
7ea041032aacf08a9100a7715767b86eb167ec8ffc3b8712caf199ba20259b3b
Python
251
8
class DisplayPostRun: """Request a post-run display This is a message sent to the UI from the analysis worker""" def __init__(self, module_num, display_data): self.module_num = module_num self.display_data = display_data
778cce7b99293e206a5248cea4bfae64abb196014c20f4998bb7e4c4ea18564d
Python
252
9
from ...utilities.zmq.communicable.reply import Reply class SharedDictionary(Reply): def __init__(self, dictionaries=None): Reply.__init__(self, dictionaries=dictionaries) if dictionaries is None: dictionaries = [{}]
2e32350705a289eb79d672d27729d2795cffa6a067640fd75a177f01eed3261c
Python
253
12
import numpy from pyunicorn import Network, mpi offset = 10 n_max = 1000 s = 0 n = mpi.rank + offset while n <= n_max + offset: s += Network.Model("BarabasiAlbert", n_nodes=n).global_clustering() n += mpi.size numpy.save("s"+str(mpi.rank), s)
34c61c97381b25846b027362548bba30c38273466867956619b675a53d70a672
Python
253
5
#!/usr/bin/env python3 import os os.system('./run_scTIGER.py -goi AR+PTEN+ERG -ctrl ./Example/Data/Patient4_Benign_endothelial.csv -exp ./Example/Data/Patient4_Tumor_endothelial.csv -p 50 -top 100 -zero 0.15 -o ./Example/SampleResult_ProstateCancer')
5d5924e701679c54a31c1daf693c676c680fe1fb4db1c1aff8f603ed9c0a4777
Python
254
10
from ._name import Name class GridName(Name): """ A setting that provides a GridInfo object """ def __init__(self, text, value="Grid", *args, **kwargs): super(GridName, self).__init__(text, "gridgroup", value, *args, **kwargs)
0cca9502656e95262ad30c9afd53b970bbd3bb6264ebb9e88a2e0621eb164d2c
Python
255
6
from ...utilities.zmq.communicable.request import AnalysisRequest class ImageSetSuccess(AnalysisRequest): def __init__(self, analysis_id, image_set_number=None): AnalysisRequest.__init__(self, analysis_id, image_set_number=image_set_number)
ce7510ee718365b9af9b6e9568ed790ac97f20ad2af2fe7c4375df77856957fc
Python
255
7
""" @author: Johanna Rahm Research group Heilemann Institute for Physical and Theoretical Chemistry, Goethe University Frankfurt a.M. """ __all__ = ["loadAddOns", "loadImageBinner", "loadVisLocs", "widgetsAddOns", "widgetsImageBinner", "widgetsVisLocs"]
e08d13a846c9f17d56ad68ce6cc13c7d3ee6a6ea0b0e46162335b7936548f6a2
Python
255
8
class TopRowObject: def __init__(self, residue_name, atom_name, kwargs): self.residue_name = residue_name self.atom_name = atom_name self.kwargs = kwargs def __getitem__(self, key): return self.kwargs[key]
3d57088794c18056b60287633e39b3423f919f697b5575b09b7b7e7e435e6b4d
Python
256
13
NUM_CLASSES = 250 top_dropout_rate = 0.2 pricture_resolution = (1080, 1440) #(h,w) IMG_SIZE = 456 img_input_size = (IMG_SIZE, IMG_SIZE) batch_size = 64 current_model_name = "model.hdf5" model_name = "final_model.hdf5" image_interpolation = 'nearest'
bb964adb69fc761582ea7aad9e5918bd4ed96ee72a06228391d168346b8b72f5
Python
258
9
from tensorflow.keras import backend as K def earth_movers_distance(y_true, y_pred): cdf_true = K.cumsum(y_true, axis=-1) cdf_pred = K.cumsum(y_pred, axis=-1) emd = K.sqrt(K.mean(K.square(cdf_true - cdf_pred), axis=-1)) return K.mean(emd)
8859e822169e0267af6c9e82851b13beef221ca538cfce0183c2699c7c107476
Python
260
13
from nidm.experiment.tools import ( # noqa: F401 nidm_concat, nidm_convert, nidm_linreg, nidm_merge, nidm_query, nidm_queryai, nidm_version, nidm_visualize, ) from nidm.experiment.tools.click_base import cli __all__ = ["cli"]
c2b5a5f8a280f27624329e1165e452441ab280f4c773ee79c2acad4dccc14ba5
Python
260
10
from .._name import Name class ImageName(Name): """ A setting that provides an image name """ def __init__(self, text, value="Do not use", *args, **kwargs): super(ImageName, self).__init__(text, "imagegroup", value, *args, **kwargs)
438a417428039a33f1d39b7ad59aa2e342287fc363dd447993e17b6eb2262d96
Python
263
12
from enum import Enum class StructuringElementShape2D(str, Enum): DIAMOND = "Diamond" DISK = "Disk" SQUARE = "Square" STAR = "Star" class StructuringElementShape3D(str, Enum): BALL = "Ball" CUBE = "Cube" OCTAHEDRON = "Octahedron"
592984ac563b69eba9734a4191078e253b13812e248a157207bc166cedb09cfb
Python
264
16
from distutils.core import setup setup( name="protfarm", version="0.2", packages=[ "protfarm", "protfarm.analysis", "protfarm.workspace" ], install_requires=[ "pandas", "numpy", "pepars" ] )
7672c93cd0c22a73ab894b466a6a4bb8c8f533c5cea71d7e7fb69eeb86807296
Python
264
18
class TestImagePlane: def test_path(self): pass def test_url(self): pass def test_series(self): pass def test_index(self): pass def test_channel(self): pass def test_metadata(self): pass
7c249f85551c11a0457f1d6716e947af4454ac9df6f5a34257e4b56f4ccf8a8e
Python
265
5
from ._do_something import DoSomething from ._image_set_display import ImageSetDisplay from ._path_list_extract_button import PathListExtractButton from ._path_list_refresh_button import PathListRefreshButton from ._remove_setting_button import RemoveSettingButton
7d3685c123c787d375c4d1ca2e4f3e797072a63eb6aecb5b6363fec3f0fd7e93
Python
265
8
from ...utilities.zmq.communicable.reply import Reply class ExceptionPleaseDebug(Reply): def __init__(self, disposition, verification_hash=None): Reply.__init__( self, disposition=disposition, verification_hash=verification_hash )
018c03c302f5339fecb13b6d22a5a7a3e66b79dc741494c25aab23f47e4324f9
Python
267
18
class TestImagePlane: def test_build(self): pass def test_url(self): pass def test_series(self): pass def test_index(self): pass def test_channel(self): pass def test_test_valid(self): pass
18cc9ada73d230f481dff053b5109f3c27f9513fed3fba2ab8069756a609e1f2
Python
268
7
from .train import Trainer, KTrainer, TrainingDir from .evaluation import Evaluator, KEvaluator from .losses import DCS from .progress_bar import printProgressBar __all__ = ['Trainer', 'Evaluator', 'DCS', 'KTrainer', 'KEvaluator', 'printProgressBar', 'TrainingDir']
5b6ab8bb3abcebaff1f85612c49e3659e6ad22202a1de64506dd4b0e230ebce5
Python
268
17
class Layer(): ''' classdocs ''' def __init__(self): ''' Constructor ''' self.neutype = '' self.groups = {} def resetProperties(self): pass def addNewGroups(self, layerID, neunum): pass
9272fc35bd63066b3d443c50f6cdf9bd2bc49410235e8d60d9964ca1cd8450c8
Python
268
8
from ..functions.image_processing import morphological_skeleton_2d, morphological_skeleton_3d def morphologicalskeleton(image, volumetric): if volumetric: return morphological_skeleton_3d(image) else: return morphological_skeleton_2d(image)
2cf128f914ac28b26f5e6393a15f63d5b26488e9f288f883fc94eba08e369aa7
Python
269
8
import numpy def __compute_target__(variant, target_group): if variant.variant_class is None: raise ValueError("class isn't set on mutant {}".format(variant)) target_group.create_dataset("class", data=numpy.array(float(variant.variant_class.value)))
77ffb9fac19c647d72bb84ef257c0a3fd7867bd2bf5753ba04bca63b8a99e077
Python
270
6
class RelationshipKey: def __init__(self, module_number, relationship, object_name1, object_name2): self.module_number = module_number self.relationship = relationship self.object_name1 = object_name1 self.object_name2 = object_name2
84d0d95685431b015ed318dcfef96591a7ca269f4c79b88e639300503195b063
Python
270
8
class VanderwaalsParam: def __init__(self, inter_epsilon, inter_sigma, intra_epsilon, intra_sigma): self.inter_epsilon = inter_epsilon self.inter_sigma = inter_sigma self.intra_epsilon = intra_epsilon self.intra_sigma = intra_sigma
99a3a030189f3f159b5f2c14ee8c675928f4496bcf14be9fc690ad4c062b92f2
Python
271
9
"""Deprecation shim: re-exports :class:`BaseRawReader` from its new location.""" import warnings from .base import BaseRawReader __all__ = ['BaseRawReader'] warnings.warn('BaseRawReader should be imported from ptsa.data.readers.base', DeprecationWarning)
423ca87b7bf57f0f5fd139c4efc89c2bbadc0b2039a2d339f09919fdf8073215
Python
275
7
import os from pyControl.hardware import Digital_input, Digital_output, Analog_input, Rsync, off _driver_files = [f.split('.')[0] for f in os.listdir('devices') if 'init' not in f] for _driver_file in _driver_files: exec('from devices.{} import *'.format(_driver_file))
2d05fb09c19610fa555137448e0a121ba65cb35c3af95019599f23f17fff679e
Python
276
11
from torch.utils.data.distributed import DistributedSampler def build_sampler(cfg, default_args=None): if cfg is None: return None elif cfg['type'] == 'DistributedSampler': return DistributedSampler(**default_args) __all__ = ('DistributedSampler')
375a9db9774aed444141f3d7d388c838b68d33b2e9fc19a06b967bf7c51536c2
Python
276
2
from .iter_osc import IterativeOscillatorModel # class holding OscillatorModel class objects during iterative search # noqa: F401, E501 from .decomp_osc import DecomposedOscillatorModel # class holding OscillatorModel class objects during decomposition # noqa: F401, E501
f0b8971be5e8ea214dafd583a7fe7b86d7bab11a51b5d68687ac88ea5f212f76
Python
277
16
import pandas as pd path = f'../results/MLP_delta/top 1/lipo/tables' df = pd.read_csv(f'{path}/0.csv') df. tail(-1) sim = df['sim'] err = df['pred_prop'] - df['prop'] df['err'] = err # points = df[(df['sim'] <= 0.2) & (df['err'] > 5)] points.to_csv('question_group.csv')
0eb75ccb2b1389f5665484e39e10ae66a444004577e5bb0314c8a90d20c23cde
Python
278
11
#!/usr/bin/python3 from .qc import qc_reads, qc_outlier from .lcpm import lcpm, scaling_factor from .norm import normcov, compute_var, normvar from .de import de from .coex import coex from .binnet import binnet from .gocovt import gotop, pccovt assert __name__ != "__main__"
65f1506377a98323546bb8e54dd08973ad1648a08679f2215d39bd5284ef5fec
Python
281
10
from ._change_setting_event import ChangeSettingEvent class AfterChangeSettingEvent(ChangeSettingEvent): """Indicates that a setting has changed its value """ def __init__(self, old_value, new_value): ChangeSettingEvent.__init__(self, old_value, new_value)
a2786885d29f4109705ed12e17c20de6df93065dbb63a68ab406deeb428a8ae9
Python
281
18
class TestSegmentation: def test_shape(self): pass def test_has_dense(self): pass def test_has_sparse(self): pass def test_has_shape(self): pass def test_sparse(self): pass def test_get_dense(self): pass
d53b9b61e9798bfa2a6e5e6dd740865d9464572c0f6278cd3de0732b46b14c11
Python
283
12
from click.testing import CliRunner from nidm.experiment.tools.nidm_query import query def test_query_failing(): runner = CliRunner() res = runner.invoke(query) assert res.exit_code != 0 assert "Missing option" in res.output # TODO: adding tests that are passing
3932521ce051d364b76334cf4bd6a2157650edd001c9edaeab2eca9820ab1de6
Python
284
10
from ._image_name import ImageName class OutlineImageName(ImageName): """ A setting that provides an object outline name """ def __init__(self, text, value="Do not use", *args, **kwargs): super(OutlineImageName, self).__init__(text, value, *args, **kwargs)
794933ce015790b61db049cf0b082f03b74b7b1badb96542dd7371dbb847fafa
Python
284
10
from GANDLF.cli import copyrightMessage def append_copyright_to_help(command_func): command_func.__doc__ = ( copyrightMessage if command_func.__doc__ is None else (command_func.__doc__ + "\n\n" + copyrightMessage) ) return command_func
a77d4a555c1656339289f5a85cfb942b29f3c9e794a1349355d9261871a0aa99
Python
284
10
from pydantic import BaseModel, ConfigDict from GANDLF.configuration.user_defined_config import UserDefinedParameters class ParametersConfiguration(BaseModel): model_config = ConfigDict(extra="allow") class Parameters(ParametersConfiguration, UserDefinedParameters): pass
0a3f07fdd7a4cbfee2554d849803fff840b2422669fa250ac1a210455ed5e2fd
Python
285
8
from ._grid_name import GridName from ._label_name import LabelName from ._name import Name from .image_name import CropImageName from .image_name import ExternalImageName from .image_name import FileImageName from .image_name import ImageName from .image_name import OutlineImageName
04b2f9d1e8a037a1aad85c47f8135a34b308e92481f0acbca34de75eef28e0c0
Python
289
14
from enum import Enum class EdgeFindingMethod(str, Enum): SOBEL = "Sobel" PREWITT = "Prewitt" ROBERTS = "Roberts" LOG = "Log" CANNY = "Canny" KIRSCH = "Kirsch" class EdgeDirection(str, Enum): ALL = "All" HORIZONTAL = "Horizontal" VERTICAL = "Vertical"
09756b00e4ebb6c5c0ddf5c6c7b6c47eca8319e13050fd5241c8dfdd95295f32
Python
290
11
""" NIDM-Workflows Python API ------------------------- Python API to create, query, read, and write NIDM-Workflow documents. """ from .ProcessExecution import ProcessExecution from .ProcessSpecification import ProcessSpecification __all__ = ["ProcessExecution", "ProcessSpecification"]
05f37abfb8e035607264b6a9c89306af1a0a9b13a150028e76f71170141b56d3
Python
294
19
from pickletools import optimize import torch class BaseTrainStepper(): def __init__( self, model: torch.nn.Module, optimizer: optimize, ) -> None: pass def train_step(self) -> None: pass def val_step(self) -> None: pass
79f124e7ac4fed299df329c7eecc1bb4b7be413cb1df94a262cffba07371c513
Python
294
8
# -*- coding: utf-8 -*- """ Methods for advection-based extrapolation of precipitation fields. Currently the module contains an implementation of the semi-Lagrangian method described in :cite:`GZ2002` and the eulerian persistence.""" from pysteps.extrapolation.interface import get_method
b9ccd07b3ae2bbaf3f6ff40e9254fca530577a0f2070c1e0587e80862d6c6c9a
Python
295
18
class TestImageProcessing: def test_create_settings(self): pass def test_display(self): pass def test_run(self): pass def test_settings(self): pass def test_visible_settings(self): pass def test_volumetric(self): pass
44cb3181cb8bd7140c4e4bb5bbbf79758560e2f28f3ce9f81ff6660cb5e21270
Python
297
15
from nidm import __version__ from nidm.experiment.tools.click_base import cli # adding click argument parsing @cli.command() def version(): """ This function will print the version of pynidm. """ print(f"PyNIDM Version: {__version__}") if __name__ == "__main__": version()
2062633c3220c523cc2efba836c44b368b0e8564a22edaef793108198381b90d
Python
298
12
import docutils.core # https://wiki.python.org/moin/reStructuredText def rst_to_html_fragment(source): parts = docutils.core.publish_parts(source=source, writer_name="html") return parts["body_pre_docinfo"] + parts["fragment"] def find_link(name): return globals().get(name, None)
381c60f1e93aeb47fcd4cd34b690a3ca1ebc5158111d36d7aefa24c3c93c483a
Python
298
18
class TestMultiChoice: def test_parse_value(self): pass def test_get_choices(self): pass def test_set_choices(self): pass def test_set_value(self): pass def test_get_selections(self): pass def test_test_valid(self): pass
860f2d2e75302b1899f9e246936df7158c3d468c864e19858a9d51d63fc51699
Python
299
7
FILTER_CHOICE_NONE = "No filtering" FILTER_CHOICE_IMAGES = "Images only" FILTER_CHOICE_CUSTOM = "Custom" FILTER_CHOICE_ALL = [FILTER_CHOICE_NONE, FILTER_CHOICE_IMAGES, FILTER_CHOICE_CUSTOM] FILTER_DEFAULT = ( 'and (extension does isimage) (directory doesnot containregexp "[\\\\\\\\/]\\\\.")' )
9b1ef849ff756a3e1f238fd315e7ff80bae13b29277839b7f67ed36cea6efe0c
Python
299
8
from .models import UNet, FCN try: from .GFCN import GFCN, GFCNA, GFCNB, GFCNC, GFCND, GFCNE, GFCNF, GFCNG from .pointnet import PointNet __all__ = [ 'UNet', 'FCN', 'GFCN', 'GFCNA', 'GFCNB', 'GFCNC', 'GFCND', 'GFCNE', 'GFCNF', 'GFCNG'] except: __all__ = [ 'UNet', 'FCN', 'PointNet']
c1a520fea3b8bcd739e09adfcc9b94323bced48e8c0b6313deca80e57a36105b
Python
299
13
from weakref import WeakSet import zmq DEADMAN_START_ADDR = b"inproc://deadmanstart" DEADMAN_START_MSG = b"STARTED" NOTIFY_ADDR = b"inproc://notify" NOTIFY_STOP = b"STOP" NOTIFY_RUN = b"KeepAlive" ED_STOP = b"Stop" ED_CONTINUE = b"Continue" ED_SKIP = b"Skip" all_measurements: WeakSet = WeakSet()
84573249bc5b0cd071eaafd4a3e3b6d047e9019c768bdbb8f12949653e85bb0a
Python
302
8
from ._image_set_success import ImageSetSuccess class ImageSetSuccessWithDictionary(ImageSetSuccess): def __init__(self, analysis_id, image_set_number, shared_dicts): ImageSetSuccess.__init__(self, analysis_id, image_set_number=image_set_number) self.shared_dicts = shared_dicts
bab8f0dc1ac03acafbe45183c0a7df1687a2a4d46a5ef40ccccc8bcaccd812bf
Python
304
10
# Inheritaed from open-mmlab/mmclassification # Modified by Hangyu LIN from .base_dataset import BaseDataset from .builder import build_datasets, build_sampler, build_dataloader from .cifar import CIFAR10, CIFAR100 __all__ = [ 'BaseDataset', 'build_datasets', 'build_sampler', 'build_dataloader', ]
9215090e690d40f0e6b5fd8a28d3d19b826209038076c215318703ecc375665a
Python
306
18
from enum import Enum import numpy class SecondaryStructure(Enum): HELIX = 1 STRAND = 2 OTHER = 0 def one_hot(self): if self == SecondaryStructure.HELIX: return [1, 0] elif self == SecondaryStructure.STRAND: return [0, 1] return [0, 0]
c935ba82c9f2a8e6cd5899aa29eac456e93b1133c74a41b74eb035ee3033f70b
Python
306
12
from ._do_something import DoSomething class ImageSetDisplay(DoSomething): """A button that refreshes the image set display when pressed """ def __init__(self, *args, **kwargs): super(self.__class__, self).__init__( args[0], args[1], None, *args[:2], **kwargs )
78e7a7a7546640198fe89afc1a322fb2f08b89ac81e0e49655c2b8c2aa31d455
Python
307
8
from neurodynex3.working_memory_network import wm_model import brian2 as b2 def test_woking_memory_sim(): """Test if the working memory circuit is initialized and simulated for 1ms""" b2.defaultclock.dt = 0.2 * b2.ms wm_model.simulate_wm(N_excitatory=40, N_inhibitory=10, sim_time=1. * b2.ms)
c3133ec23f1a63f32346c020388f71d6e56b183158469e21df506e794f4c1a87
Python
307
12
from .data_loader import ( QueryDataset, QueryDataset_custom, QueryDataset_COMETA, QueryDataset_pretraining, MetricLearningDataset, MetricLearningDataset_pairwise, DictionaryDataset, ) from .metric_learning import Sap_Metric_Learning from .model_wrapper import Model_Wrapper
286201ac72866111e24c9098cff4fdd071f93ae9e86cd252fb3199156dd1bded
Python
308
8
from ...utilities.zmq.communicable.request import AnalysisRequest class DebugWaiting(AnalysisRequest): """Communicate the debug port to the server and wait for server OK to attach""" def __init__(self, analysis_id, port): AnalysisRequest.__init__(self, analysis_id=analysis_id, port=port)
5a29adbb7d00f64ad1b1a9f11323822e65cd3bef329f5a277066cfaee6606685
Python
308
12
default_settings = { "lstm1_hidden_units": 512, "lstm2_hidden_units": 512, "hidden_units_local": 256, "hidden_units_global": 256, "trainer": { "checkpoint_path": "../checkpoints/coal_mining", "max_to_keep": 1, "default_lr": 5e-4, "memory": False, }, }