sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4395385bb4078a74444c455d6ec4d41842a7a53530dc275f27464904044c59a0
Python
267
13
"""ConvTran deep learning classifiers. This subpackage provides ConvTran classifiers implemented in PyTorch. """ __all__ = [ "ConvTranClassifierTorch", ] from sktime.classification.deep_learning.convtran._convtran_torch import ( ConvTranClassifierTorch, )
56a1e4bb01e57e82389452ad46fdcb4cdf7ee025d3b16815451b49166bbfc716
Python
267
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Sign(OpRunUnaryNum): def _run(self, x): return (np.sign(x),)
8adf68b25b7e42ddb298a6a6102d7c0c5ffcd5fccccb4709c1a4d8f074d2d6a7
Python
267
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Tanh(OpRunUnaryNum): def _run(self, x): return (np.tanh(x),)
a426489c65b74031e97ded935a68496d88cf95742a113c5bbb90c296af583341
Python
267
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Sinh(OpRunUnaryNum): def _run(self, x): return (np.sinh(x),)
abc7ff475b9be949adf134b313f669332cbcd677ac45dc491e7d161eb3defe99
Python
267
6
"""Utilities.""" from .timeseries import limit_signal from .dataframes import (limit_df, get_extrema_df, rename_extrema_df, split_samples_df, drop_samples_df, epoch_df, flatten_dfs) from .checks import check_param_range, check_param_options
b93a010ca8cac7a48b1fb65cb0535c4b59d759cfd4df8ca8600710971012ae13
Python
267
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Cosh(OpRunUnaryNum): def _run(self, x): return (np.cosh(x),)
d8a071e9e68576ceab6ed200c5f4718119f7d61ee0fae337a867b095f1d5c5d9
Python
267
7
#------------------------------------------------------------------------------- # elftools # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- __version__ = '0.33'
f0a6ed97ffef5f2a67441ae83620acb2fdd1ff4895224bf73df648ed014786a6
Python
267
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnary class Not(OpRunUnary): def _run(self, x): return (np.logical_not(x),)
a79f99924f75ab2c04fc824a486f90d39ccd52353ec10a8c7b8b3cf3101f0f6d
Python
268
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.op_run import OpRun class Tile(OpRun): def _run(self, x, repeats): return (np.tile(x, repeats),)
2037919b8de6854b3cda1747eaaa308f6fba3078970d56f82277f1d3b251a12d
Python
269
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Acos(OpRunUnaryNum): def _run(self, x): return (np.arccos(x),)
2d9fa4516444ebc1f4c04083ba20068e66613277db50e54f6237f62ae2fdc6c1
Python
269
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Asin(OpRunUnaryNum): def _run(self, x): return (np.arcsin(x),)
a8de61d5445125d739531712cfac7547f459df986370d2b05686e6eabb0dc96d
Python
269
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Floor(OpRunUnaryNum): def _run(self, x): return (np.floor(x),)
ea07e7510233541082c7f04a3e7b45b36a750c7958c5ed897c23fa9f8c694657
Python
269
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnary class IsNaN(OpRunUnary): def _run(self, data): return (np.isnan(data),)
fb2860963bc3b1f6f04c46f5cc0bf12cbc7ee83a5c26f8a74d50f5186a890f4e
Python
269
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Atan(OpRunUnaryNum): def _run(self, x): return (np.arctan(x),)
122979ed76cbfcc2cfbd17bed8ba4fa37fdf17917ff7d1871570446a45a1c413
Python
270
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Abs(OpRunUnaryNum): def _run(self, x): return (np.absolute(x),)
baae514de5442a94dffddbf23d1968870c78134270947e672ec05ae238ca3402
Python
270
13
import torch import torch.nn as nn __all__ = ['MseLoss'] class MseLoss(nn.Module): def __init__(self): super().__init__() def forward(self, input, target): MSE = ((input - target) ** 2).sum() / input.data.nelement() return MSE
c5c59a819a89ef17b376b311c53dbb34f58e8f02528a8fb16fa40a7d86e58172
Python
270
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Neg(OpRunUnaryNum): def _run(self, x): return (np.negative(x),)
10aa012bd2c304b42ecfd5d2b46916db47034a25293de63cdb6bcb48476cc261
Python
271
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Acosh(OpRunUnaryNum): def _run(self, x): return (np.arccosh(x),)
de97caa1e52ce0d315d1ded6f622b414a799428c1db5cfe044afec5ff6879abc
Python
271
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Atanh(OpRunUnaryNum): def _run(self, x): return (np.arctanh(x),)
f66940a093fca8c457cb1cdd8f88998fe886664fb1466aa30a996010bc236ac2
Python
271
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Asinh(OpRunUnaryNum): def _run(self, x): return (np.arcsinh(x),)
0cddc3ae86346a614c16082c5e9cf9f86e85cda9bd26bcb427a31011e139c4ba
Python
272
12
import torch import torch.nn as nn __all__ = ['CEL'] class CEL(nn.Module): def __init__(self): super().__init__() self.loss = nn.CrossEntropyLoss() def forward(self, input, target): Loss = self.loss(input, target) return Loss
5f85b573c5e00ef73aff9a39e13dc7462d2225fd82287af42899152dad8ac2ef
Python
272
13
from .armodel import ARModel from .cnn1d import CNN1d from .cnn2d import resnet model_dict = { "cnn1d": CNN1d, "ARConvs": ARModel, "cnn2d": resnet, } def create_model(model_name: str, model_hparams: dict): return model_dict[model_name](**model_hparams)
c23529461fd6515314c23bc0ea9cab7ca7a11b0c99f487ffc0468598e8c13664
Python
272
14
import ants from ants.core.ants_image import ANTsImage def is_lpi(image: ANTsImage) -> bool: """Check if the ants image is LPI- Args: image (ANTsImage): MRI Returns: bool: LPI- status """ return ants.get_orientation(image) == "LPI"
fb90e240e3a7aa1294a7c9bddb56f05873d931a58c24e8dd8c43d817b9812d0c
Python
272
6
"""Adapter mixins for dists_kernels module.""" from sktime.dists_kernels.base.adapters._sklearn import _SklearnDistanceAdapter from sktime.dists_kernels.base.adapters._tslearn import _TslearnPwTrafoAdapter __all__ = ["_TslearnPwTrafoAdapter", "_SklearnDistanceAdapter"]
31b19023e2fcb9e9ca4b3c545946aaa1c51a0ff70c2015e0cade301afe66d426
Python
273
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinary class Or(OpRunBinary): def _run(self, x, y): return (np.logical_or(x, y),)
9d8a927d77359033647b1bc197e49f4ce3e77dafc2290e95ee92a3b55e4abf6b
Python
273
11
from __future__ import division, absolute_import, print_function import sys from nose import SkipTest def test_import(): if sys.version_info[0] >= 3: raise SkipTest("traitsdoc not ported to Python3") import numpydoc.traitsdoc # No tests at the moment...
38579ae68950b63586761983bfe52e235236a1eb95e0d571c189128fc08449d2
Python
274
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnary class BitwiseNot(OpRunUnary): def _run(self, X): return (np.bitwise_not(X),)
0f768d31137b5527b660add4ab3e3d27f7231401c820f596ef5c437ed5f5ce34
Python
275
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinary class Xor(OpRunBinary): def _run(self, x, y): return (np.logical_xor(x, y),)
a0a4d849c47a9ec966f7ed0e82bbe3ed394aa05da27a7f2e4c5a149a6bf10762
Python
275
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinary class And(OpRunBinary): def _run(self, x, y): return (np.logical_and(x, y),)
c1166acde0c8247093da0e0626d7b6be1a4f084fa617a6c3a57b507946ca2a5b
Python
275
13
"""ConvTimeNet deep learning classifiers. This subpackage provides ConvTimeNet classifiers implemented in PyTorch. """ __all__ = [ "ConvTimeNetClassifier", ] from sktime.classification.deep_learning.convtimenet._convtimenet_torch import ( ConvTimeNetClassifier, )
776e779abff895ee3cf795ffa1fe4e4331f353f47da7db30d9142fac0b0bc75d
Python
276
13
import pickle def save(obj, filename): with open(filename + ".pickle", "wb") as f: pickle.dump(obj, f, protocol=pickle.HIGHEST_PROTOCOL) return def load(filename): with open(filename + ".pickle", "rb") as f: obj = pickle.load(f) return obj
96e0e02e2d91847d1bcc510ec38b5594929b3eaa06fdc2a51deadb1c99ee5842
Python
276
11
"""Vector sklearn classifiers.""" __all__ = [ "RotationForest", "ContinuousIntervalTree", ] from sktime.classification.sklearn._continuous_interval_tree import ( ContinuousIntervalTree, ) from sktime.classification.sklearn._rotation_forest import RotationForest
4aba77b0f0cd1c2e1e042e2eeb57424bddcfd63933e196607abba74c24c3f167
Python
278
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.op_run import OpRun class Size(OpRun): def _run(self, data): return (np.array(data.size, dtype=np.int64),)
55e27c2cc81ab2b026f5da6fbc57edc6038ce588bfd96a86b7044bd3bcceb533
Python
278
8
from os.path import dirname, basename, isfile, join import glob modules = glob.glob(join(dirname(__file__), "*.py")) for f in modules: if isfile(f) and not f.endswith('__init__.py'): cur_f = f.split('\\')[-1][:-3] exec(f"from src.configs.{cur_f} import *")
159c945ed3b882d9d818f5c0041be077a04368ea8d74cfb71cbb2627d4c276fd
Python
280
12
""" This module does the following: a. Starts model-server. b. Creates end-points based on the configured models. c. Exposes standard "ping" and "api-description" endpoints. d. Waits for servicing inference requests. """ from . import version __version__ = version.__version__
6c43b9fda86beccf8a29217f3583c2298bcf2d58dfd1e0e68fc486837bcf4f8f
Python
280
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinary class BitwiseOr(OpRunBinary): def _run(self, x, y): return (np.bitwise_or(x, y),)
70ff898892139d54cc71e472641a0398a8aa5657f7dadcd6841ce6724e2a2d2f
Python
280
12
from __future__ import division, absolute_import, print_function import sys from nose import SkipTest def test_import(): if sys.version_info[0] >= 3: raise SkipTest("phantom_import not ported to Py3") import numpydoc.phantom_import # No tests at the moment...
2672a28de20370695e5e8632a0ee6c571d82984b7103f85f7fe290fd7e712075
Python
281
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Exp(OpRunUnaryNum): def _run(self, x): return (np.exp(x).astype(x.dtype),)
9b2e69b7b63ddbf182fcd1c4db58869aa382c6093db00a625ca03a52f93e008c
Python
281
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Log(OpRunUnaryNum): def _run(self, x): return (np.log(x).astype(x.dtype),)
a7628f8e9f31e585336d67691bfd69a828e9872010ac8824dfe652aa427ea7ec
Python
281
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from onnx.reference.op_run import OpRun class Identity(OpRun): def _run(self, a): if a is None: return (None,) return (a.copy(),)
39520400cc65fb89a3e84c0148cd309603e4cdc62995f69654fdd77b02f2f05f
Python
282
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.op_run import OpRun class OptionalHasElement(OpRun): def _run(self, x=None): return (np.array(x is not None),)
a76bb71d5087f96a89c56b0bfdf7ce543a7d3a6072be7d1e87b0b53e67f66c26
Python
282
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinary class BitwiseAnd(OpRunBinary): def _run(self, x, y): return (np.bitwise_and(x, y),)
c02cebc44251ad73fb17abdda50db19ad87d5b40d57229177d5362f72da5f3d1
Python
282
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinary class BitwiseXor(OpRunBinary): def _run(self, x, y): return (np.bitwise_xor(x, y),)
c7c00fd5bce4b0196502adb89e5d2442793766677fd878213109521ac2d02be3
Python
282
11
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from onnx.reference.op_run import OpRun class SequenceEmpty(OpRun): def _run(self, dtype=None): # type: ignore[override] # noqa: ARG002 return ([],)
1dfd617fa336e6c459e1a99f6adb954e976f265a1e89bf81684f9263aa65a107
Python
283
11
"""All time series detectors.""" from sktime.registry import all_estimators est_tuples = all_estimators(estimator_types="detector", return_names=True) est_names, ests = zip(*est_tuples) for i, x in enumerate(est_tuples): exec(f"{x[0]} = ests[{i}]") __all__ = list(est_names)
910f6bc47a129a6d7962691ce9c92aa306a57e167d8d541e54a74b76fc10f129
Python
284
12
import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv('pose_data.csv') x = df['field.position.x'].to_numpy() y = df['field.position.y'].to_numpy() plt.figure() plt.plot(x,y,linestyle='--') plt.xlim([-50,50]) plt.ylim([-50,50]) plt.gca().set_aspect('equal') plt.show()
1a503245a98f2198c8b3d558ed197c03ddb0bc5de117cb6403b4ee61abdebf44
Python
285
12
"""Top-level package for fnnls.""" # Do not edit this string manually, always use bumpversion # Details in CONTRIBUTING.md __version__ = "0.0.1" __author__ = "Joshua Vendrow" __email__ = "jvendrow@gmail.com" __license__ = "MIT" __copyright__ = "Copyright (c) 2020, Joshua Vendrow"
3b2b63cbac2cc822057d104569c6aeaa09b9c53b407af14dcb105b68c4928208
Python
285
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Round(OpRunUnaryNum): def _run(self, x): return (np.round(x).astype(x.dtype),)
4335dea09c211d5b25d6be07dae1d97edeb035af5292068160c55ab170b1fc3b
Python
287
11
"""All time series classifiers.""" from sktime.registry import all_estimators est_tuples = all_estimators(estimator_types="classifier", return_names=True) est_names, ests = zip(*est_tuples) for i, x in enumerate(est_tuples): exec(f"{x[0]} = ests[{i}]") __all__ = list(est_names)
18fd652349c971c3ca13bb286eb22153c6105617d3a6d8aa6cddba1de0f8febb
Python
288
12
try: from viziphant.rasterplot import rasterplot as vizi_rasterplot viziphant = True except: viziphant = False def rasterplot(spiketrains, **kwargs): if viziphant: return vizi_rasterplot(spiketrains, **kwargs) else: print('Missing viziphant package')
8e051c980e42bbd0b4a8afa66596b41a15789d9c9f81868bd36f87385845f683
Python
289
10
from setuptools import setup setup(name="molgnn", version='1.0', description='Molecular Graph Neural Network', packages=['molgnn'], author='Mesfin Diro', author_email='mesfindiro@gmail.com', zip_safe=False, install_requires=['rdkit-pypi','pyg','pytorch','tqdm','torch-scatter'])
9005b5e0ffe1ead9dfda208711124b0518a71fd66d5735fb5c2b2ec2329f351d
Python
289
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Relu(OpRunUnaryNum): def _run(self, x): return (np.maximum(x, 0).astype(x.dtype),)
e472fc5a621237c036cd0e90be43e73f60dd74a97ecd4cfa52923166d59d07a0
Python
289
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinaryComparison class Less(OpRunBinaryComparison): def _run(self, a, b): return (np.less(a, b),)
42684b80808c159d3e592424e5242344b998aca0f52836e7548114455b7d9783
Python
290
20
import sys fi=open(sys.argv[1]) fo=open(sys.argv[2],'w') #fi.readline() i=1 for line in fi: seq=line.rstrip().split('\t') p1=seq[0] p2=seq[1] out=p1.split('-')+p2.split('-') #out.append('PE'+str(i)) fo.write('\t'.join(out)+'\n') i=i+1 fo.close() fi.close()
7a28e1e0e3c63fda6e1e77b57133f87d50bfbc517de5d01a4cc08a53349acf34
Python
290
13
""" Horizontal, unfilled violinplots ================================ _thumb: .5, .45 """ import seaborn as sns sns.set_theme() seaice = sns.load_dataset("seaice") seaice["Decade"] = seaice["Date"].dt.year.round(-1) sns.violinplot(seaice, x="Extent", y="Decade", orient="y", fill=False)
2c4d00a0ba5d255c6c76b6e54c2898bd22adf75e9d58981902b872908804c3b5
Python
291
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinaryComparison class Equal(OpRunBinaryComparison): def _run(self, a, b): return (np.equal(a, b),)
51ffeaa83592104241af3719f76f5693ae8be80334df471bc29293f99524d4d7
Python
291
9
"""Concrete catalogue classes for classification experiments.""" from sktime.catalogues.classification.bakeoff import BakeOffCatalogue from sktime.catalogues.classification.dummy import DummyClassificationCatalogue __all__ = [ "BakeOffCatalogue", "DummyClassificationCatalogue", ]
9ca507dc3e9d5fcdb9e609488982d6a8dc0184dc38e06da991b19e32d16a2b75
Python
291
14
""" Definitions of cell populations for each cell type. """ from .population import Population from .bushy import Bushy from .tstellate import TStellate from .dstellate import DStellate from .pyramidal import Pyramidal from .tuberculoventral import Tuberculoventral from .sgc import SGC
eb8712bb8b09351771c664d221ba646b25c0243ab4c5ec307ccd454d608bf64f
Python
291
10
from lgn.nn.utils import NoLayer from lgn.nn.generic_levels import BasicMLP from lgn.nn.input_levels import InputLinear, InputMPNN from lgn.nn.position_levels import RadialFilters, RadPolyTrig from lgn.nn.mask_levels import MaskLevel from lgn.nn.g_nn import MixReps, CatReps, CatMixReps
469f6c3988609244c5a96ca9d872356215ff884b1ec3506359ccb3679bed1152
Python
292
17
""" @author: derricw Displays a full screen light. """ from psychopy import visual, event, core win = visual.Window(screen=0,fullscr=True,color=(1,1,1)) while 1: win.flip() for keys in event.getKeys(timeStamped=True): if keys[0]in ['escape','q']: win.close()
ced13d7f6a0841594a7da555c5418452393cff666f38c18f417ce1be302e2ecf
Python
293
13
"""Module exports: Series/Panel conversions.""" from sktime.datatypes._series_as_panel._convert import ( convert_Panel_to_Series, convert_Series_to_Panel, convert_to_scitype, ) __all__ = [ "convert_Panel_to_Series", "convert_Series_to_Panel", "convert_to_scitype", ]
1814c306206d2474e57b283a578171e04773da27799e53764ce7bc2dfeaf84e7
Python
295
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinaryComparison class Greater(OpRunBinaryComparison): def _run(self, a, b): return (np.greater(a, b),)
1b841abf36977415dd1761ab0cb7676079c02cf67a6301ad84ba473de6e712a6
Python
295
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Softplus(OpRunUnaryNum): def _run(self, X): return (np.logaddexp(0, X).astype(X.dtype),)
13f67e0cdcc165b934aa5535f74f17fa9232233285713999c2bfd5fe49a07a67
Python
297
16
import logging import sys logging.basicConfig( level=logging.INFO, format="%(asctime)s [%(levelname)s] %(processName)s %(filename)s:%(lineno)s -- %(message)s", filemode="w", filename='logs.log', ) logging.info('Useful message') logging.debug('debug message')
1dbc0309e01a0ec408a8819126702b03f86995a70bc7742c4b68a64ee3b1a358
Python
299
9
from flair.embeddings import BytePairEmbeddings from tests.embedding_test_utils import BaseEmbeddingsTest class TestBytePairEmbeddings(BaseEmbeddingsTest): embedding_cls = BytePairEmbeddings is_token_embedding = True is_document_embedding = False default_args = {"language": "en"}
37c26070529c8bf20b7a5ce98cbb59b65591f816665e7c58bb92e3b2ad37c23c
Python
299
12
#!/usr/bin/python -u import pandas # if __name__ == '__main__': df = pandas.read_csv("./tmp/prediction_matrix.tsv", sep="\t", header=0, index_col=0) data = df.corr(method="spearman") data.to_csv('./tmp/correlation_matrix.tsv', sep="\t", float_format='%.4f')
833622776a3ace420d6e85f1cb7382dd034949fab682642ca0997e8ad006ef07
Python
299
17
""" Dummy custom service which is class based """ # noinspection PyUnusedLocal class CustomService(object): def initialize(self, context): pass # noinspection PyMethodMayBeStatic def handle(self, data, context): from ts.context import Context return ["OK"]
d909c88b2c1c0e2fd959c3d5f2eed9cc2036e238c4f6b8699231186d687b8183
Python
300
11
import os from sasa_lstm.sasa_lstm_ import sasa_lstm_model data_path = "./dataset/" model = sasa_lstm_model(data_path=data_path) model.train() res = model.predict() if not os.path.exists('result'): os.makedirs('result') res.to_csv("result/submission.csv", index=False, header=False)
7e8f63c84768af83ff9d8d6205c6563a82971ec7061c7a79245a04a46fde2fa9
Python
301
15
""" Paired density and scatterplot matrix ===================================== _thumb: .5, .5 """ import seaborn as sns sns.set(style="white") df = sns.load_dataset("iris") g = sns.PairGrid(df, diag_sharey=False) g.map_lower(sns.kdeplot) g.map_upper(sns.scatterplot) g.map_diag(sns.kdeplot, lw=3)
af26c94b9125d7ae9f4d3c9b4b6a83441aeefbdd10b0a4480fcccf1965f88318
Python
301
9
# Copyright (c) OpenMMLab. All rights reserved. # flake8: noqa import warnings from .formatting import * warnings.warn('DeprecationWarning: mmcls.datasets.pipelines.formating will be ' 'deprecated in 2021, please replace it with ' 'mmcls.datasets.pipelines.formatting.')
c2756329b1fed08a08ed364accdeb6c475e469803230d753d568182af63d59c1
Python
301
16
import sys fi=open(sys.argv[1]) fo=open(sys.argv[2],'w') OLD=set() for line in fi: seq=line.rstrip().split('\t') this_net=[seq[0],seq[1]] this_net.sort() this_tmp = ':'.join(this_net) if this_tmp not in OLD: fo.write(line) OLD.add(this_tmp) fo.close() fi.close()
2371935666e83cd08f352c46e9a27d2e98d5b7cb5dfe5fdad1f819e4b728c1b2
Python
302
8
"""Tuning of time series classifiers.""" # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) from sktime.classification.model_selection._hyperactive import TSCOptCV from sktime.classification.model_selection._tune import TSCGridSearchCV __all__ = ["TSCOptCV", "TSCGridSearchCV"]
6de31f6e53539356d04348d976aa9e305521a2c779ef3ea9849f7a22d74b8140
Python
302
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinaryComparison class LessOrEqual(OpRunBinaryComparison): def _run(self, a, b): return (np.less_equal(a, b),)
74ae82e3c077f3ca084b9176bd8a01e068b5a8044badbec4fe58d5518a100196
Python
302
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.op_run import OpRun class Compress(OpRun): def _run(self, x, condition, axis=None): return (np.compress(condition, x, axis=axis),)
9f446133a6eb8146c02238632a5a81b4b1bd626e341d9714a1b21487d19bf30b
Python
302
4
from mprl.utility_services.worker.base_interface import FalseConfirmationError from mprl.utility_services.worker.console import ConsoleManagerInterface from mprl.utility_services.worker.evaluator import EvaluatorManagerInterface from mprl.utility_services.worker.learner import LearnerManagerInterface
c95f884b0f6a90936d78b60e85c68e3986020f7d540aa7809aa7c9861ec88e18
Python
304
9
# Copyright (c) OpenMMLab. All rights reserved. from .class_num_check_hook import ClassNumCheckHook from .lr_updater import CosineAnnealingCooldownLrUpdaterHook from .precise_bn_hook import PreciseBNHook __all__ = [ 'ClassNumCheckHook', 'PreciseBNHook', 'CosineAnnealingCooldownLrUpdaterHook' ]
37e2ae95136db7f271f3360913e424a3c51a4ebebb5dada2ba4056c88569d716
Python
305
10
"""Time series forecasting with arch models.""" __all__ = ["ARCH", "StatsForecastARCH", "StatsForecastGARCH"] __author__ = ["eyjo", "Vasudeva-bit"] from sktime.forecasting.arch._statsforecast_arch import ( StatsForecastARCH, StatsForecastGARCH, ) from sktime.forecasting.arch._uarch import ARCH
798de499ae2e14c05b7ef01a5b1436485d77227c26f5a74c1be7b4c7dbea93d7
Python
305
16
""" .. include:: ../README.md .. include:: ../docs/gallery.md """ from .plot import plot from .__version import __version__ from .derive import edges_from_bids __all__ = ['plot', '__version__', 'edges_from_bids'] __pdoc__ = { "plotting": False, "utils": False, "templatesettings": False, }
87139d1322c5a3277fd2bf84caf1162d2af8592b1d07e84e13fa70961504c7c6
Python
305
15
celltool_commands = [ 'extract_contours', 'align_contours', 'plot_contours', 'shape_model', 'plot_model', 'measure_contours', 'plot_distribution', 'modify_contours', 'add_landmarks', 'extract_images', 'find_centerlines', 'to_matlab', 'resample_stats' ]
3f97cb2c5e5d2d0dc1d1c0044ebe8dd544775cc896ad4bbc92344343f747674d
Python
306
13
from setuptools import find_packages, setup setup( name="tune_tf2", version="0.1.0", packages=find_packages(), install_requires=[ "ray[tune]==0.8.7", ], author="Andrew Sedler", author_email="arsedler9@gmail.com", description="Hyperparameter utilities for LFADS", )
ae2a68ac6d27baa8c1fb1260e96f99bdc12716214b1e42d5a4f9338fde125223
Python
307
10
from src.cajal.run_gw import compute_gw_distance_matrix import os def test(): compute_gw_distance_matrix("tests/icdm.csv", "tests/gw1.csv", None, True) os.remove("tests/gw1.csv") compute_gw_distance_matrix( "tests/icdm.csv", "tests/gw.csv", "tests/gw_coupling_mat.csv" )
1ceecdd3de09c06230a51e6b1dd076cd1161b69be3c7bb703085e07e101dab1a
Python
308
18
# SPDX-License-Identifier: LGPL-3.0-or-later from .base_long_range import ( BaseLongRange, ) from .kernel import ( LESKernel, SOGKernel, ) from .latent_charge import ( LatentChargeLongRange, ) __all__ = [ "BaseLongRange", "LESKernel", "LatentChargeLongRange", "SOGKernel", ]
c98fd31919786438b55c74c79af80709990d4ec5bde5fa175eb34fe658a7e5a9
Python
308
13
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunBinaryComparison class GreaterOrEqual(OpRunBinaryComparison): def _run(self, a, b): return (np.greater_equal(a, b),)
22051176b033e88e5ea8f9b06cafcb0693c664276b1c085749878f3ae36df060
Python
310
20
fi=open('scATAC_loop.txt.uniq.txt') fo=open('scATAC_loop.txt.uniq.bed','w') #fi.readline() i=1 for line in fi: seq=line.rstrip().split('\t') p1=seq[0] p2=seq[1] out=p1.split('-')+p2.split('-') #out.append('PE'+str(i)) fo.write('\t'.join(out)+'\n') i=i+1 fo.close() fi.close()
1fe7b7a0829e910391914178ac859316311fad99c29047662dea49c376751276
Python
313
10
# Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # from .calibrate import CalibrationLayer __all__ = ["CalibrationLayer"]
cc6a38abdf9c86cd7ca53446e3cd72c0650f95083bdeb0d53fc7743c09406f9e
Python
313
15
""" Hexbin plot with marginal distributions ======================================= _thumb: .45, .4 """ import numpy as np import seaborn as sns sns.set(style="ticks") rs = np.random.RandomState(11) x = rs.gamma(2, size=1000) y = -.5 * x + rs.normal(size=1000) sns.jointplot(x, y, kind="hex", color="#4CB391")
2a8cf597fd8fe6c340fb5f07af7e3dc539b46a6e45f43508973bd5f637738239
Python
315
9
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations __all__ = ["load_op", "OpRunTraining"] from onnx.reference.ops.aionnx_preview_training._op_list import load_op from onnx.reference.ops.aionnx_preview_training._op_run_training import OpRunTraining
c5ce15c9fb07ab69e9405bf026b10151d84615483e3c87e9318e1439993958ec
Python
315
8
# Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # __all__ = ["scoring", "encoding", "corruption_generation", "calibration"]
140fdef053767f0d1a8257fcfcfac150dcd849f297ea1858e687d32d516fa025
Python
316
10
#------------------------------------------------------------------------------- # elftools tests # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- import unittest if __name__ == '__main__': unittest.main()
74c4f966db317c9a348abccd91e3cd0e5a3d4f0508de24203820f9aaecb9f666
Python
317
15
""" Paired density and scatterplot matrix ===================================== _thumb: .5, .5 """ import seaborn as sns sns.set_theme(style="white") df = sns.load_dataset("penguins") g = sns.PairGrid(df, diag_sharey=False) g.map_upper(sns.scatterplot, s=15) g.map_lower(sns.kdeplot) g.map_diag(sns.kdeplot, lw=2)
01a4b64b4f12acc5ad20c352d29a30fad0065eb06a3821822d5822a5f45e215f
Python
318
13
""" Utility functions for saving and loading compiled SNS networks. """ from sns_toolbox.backends import Backend import pickle def save(model: Backend, filename: str) -> None: pickle.dump(model, open(filename, 'wb')) def load(filename) -> Backend: model = pickle.load(open(filename, 'rb')) return model
d86445bfa43dfb1febd593ec979adc64d963506d338be520b13244f8b5a1a8b7
Python
319
12
import qiime2.plugin import qiime2.sdk plugin = qiime2.plugin.Plugin( name='differential', version='0.0.1', website="https://github.com/mortonjt/q2-differential", citations=[], short_description=('Plugin for differential abundance analysis.'), description=(''), package='q2-differential')
65254a78723ffae5ed84b742aa11444d7ae54e8930ee4ce386efca5bee3fdb26
Python
321
14
from cyvcf2 import VCF import collections import sys order = [line.strip() for line in open(sys.argv[1], 'rt') if line[0] != '#'] counts = collections.defaultdict(int) for v in VCF(sys.argv[2]): hi = v.INFO.get("highest_impact_order") counts[order[hi]] += 1 for k, v in counts.items(): print(f"{k}\t{v}")...
44610036442c8c20df07642b1db17e2a2742f7c2ae4afbed30d37a02430cbf6e
Python
322
11
from setuptools import setup, find_packages setup( name="evoaug_analysis", version="0.1.0", packages=find_packages(), description = "Code to analyze genomics datasets with deep learning models trained with evolution-inspired data augmentations. ", python_requires=">=3.6", install_requires=[], ...
61bfbadb44ba86812956223cce98c4289aac41e7d495a70be6a63d351bb808fe
Python
322
11
from __future__ import division, absolute_import, print_function import sys from nose import SkipTest def test_import(): if sys.version_info[0] >= 3: raise SkipTest("plot_directive not ported to Python 3 (use the one from Matplotlib instead)") import numpydoc.plot_directive # No tests at the moment.....
9d98af150dcaf8b43ca42f46096b061c876c340db26c09b9ae494420d5e87104
Python
322
14
import json from config import Config project_home = Config.project_home print('project_home = ' + project_home) pickledDir = project_home + '/pickled' parameterFilePath = open(pickledDir + '/params.json') d = json.load(parameterFilePath) windowSizeInSec = d['windowSizeInSec'] print('wSS = ' + str(windowSizeInSec)...
2e9c4bf6abd0ef00eb1d93b7236fdbe002e8496a499c304834e20ec6f4d4b4b7
Python
323
15
""" Hexbin plot with marginal distributions ======================================= _thumb: .45, .4 """ import numpy as np import seaborn as sns sns.set_theme(style="ticks") rs = np.random.RandomState(11) x = rs.gamma(2, size=1000) y = -.5 * x + rs.normal(size=1000) sns.jointplot(x=x, y=y, kind="hex", color="#4CB391...
4fe69173e5fe34929b711a16192059739d402531c80077a03bf7c85ed9f927d8
Python
323
11
import sys from PyQt5 import QtWidgets from app import RemApplication if __name__ == '__main__': args = [sys.argv[0]] + ['o'] + sys.argv[2:] app = QtWidgets.QApplication(args) host, port = '127.0.0.1', 50007 mainapp = RemApplication(host, port, args) mainapp.activateWindow() sys.exit(app.exec_(...
1a7b81f60472e7c5d5bff6d071d63f8be4af277c9a185de710b6926ed360bdea
Python
324
15
import os import model_archiver def test_model_export_tool_version(): """ Test the model archive version :return: """ with (open(os.path.join('model_archiver', 'version.py'))) as f: exec(f.read(), globals()) assert __version__ == str(model_archiver.__version__), "Versions do not mat...
16f7e18437c447cd6bce3baefe0bacd5cf4ed7ef9ac4ee4fa58dc00b4b5fceda
Python
325
12
import sys def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('smote_cd', parent_package, top_path) return config if __name__ == '__main__': from numpy.distutils.core import setup setup(**configuration(top_path='').todi...