content
stringlengths
0
1.55M
<import_stmt>struct<import_stmt>numpy<as>np<import_stmt>pandas<as>pd<line_sep>df_train=pd.read_csv('../data/train_data.csv')<line_sep>df_valid=pd.read_csv('../data/valid_data.csv')<line_sep>df_test=pd.read_csv('../data/test_data.csv')<with_stmt>open('result.dat' 'rb')<as>f<block_start>N,=struct.unpack('i' f.read(4))<li...
<import_from_stmt>flask Blueprint<import_from_stmt>apps.auth.business.wxlogin WxLoginBusiness<import_from_stmt>apps.auth.extentions validation parse_json_form<import_from_stmt>library.api.render json_detail_render<line_sep>wxlogin=Blueprint("wxlogin" __name__)<line_sep>@wxlogin.route('/' methods=['POST'])@validation('P...
""" Test PEP 0448 -- Additional Unpacking Generalizations https://www.python.org/dev/peps/pep-0448/ """<line_sep># pylint: disable=superfluous-parens, unnecessary-comprehension UNPACK_TUPLE=(*range(4) 4)<line_sep>UNPACK_LIST=[*range(4) 4]<line_sep>UNPACK_SET={*range(4) 4}<line_sep>UNPACK_DICT={'a':1 **{'b':'2'}}<line_s...
''' This file implements various optimization methods, including -- SGD with gradient norm clipping -- AdaGrad -- AdaDelta -- Adam Transparent to switch between CPU / GPU. @author: <NAME> (<EMAIL>) '''<import_stmt>random<import_from_stmt>collections OrderedDict<import_stmt>...
<import_from_stmt>OpenGL.arrays vbo<import_from_stmt>OpenGL.GLES2.VERSION GLES2_2_0<import_from_stmt>OpenGL.GLES2.OES mapbuffer<class_stmt>Implementation(vbo.Implementation)<block_start>"""OpenGL-based implementation of VBO interfaces"""<def_stmt>__init__ self<block_start><for_stmt>name self.EXPORTED_NAMES<block_start>...
<import_from_future_stmt> print_function<import_stmt>os sys<import_stmt>pickle<import_stmt>time<import_stmt>glob<import_stmt>numpy<as>np<import_stmt>torch<import_from_stmt>model PVSE<import_from_stmt>loss cosine_sim order_sim<import_from_stmt>vocab Vocabulary<import_from_stmt>data get_test_loader<import_from_stmt>logge...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
<import_stmt>subprocess<import_stmt>aiostream<import_stmt>pytest<import_from_stmt>vdirsyncer.storage.filesystem FilesystemStorage<import_from_stmt>vdirsyncer.vobject Item<import_from_stmt>. StorageTests<class_stmt>TestFilesystemStorage(StorageTests)<block_start>storage_class=FilesystemStorage<line_sep>@pytest.fixture<d...
""" Model select class1 single allele models. """<import_stmt>argparse<import_stmt>os<import_stmt>signal<import_stmt>sys<import_stmt>time<import_stmt>traceback<import_stmt>random<import_from_stmt>functools partial<import_from_stmt>pprint pprint<import_stmt>numpy<import_stmt>pandas<import_from_stmt>scipy.stats kendallta...
<import_stmt>time<import_from_stmt>adafruit_circuitplayground.express cpx<import_stmt>simpleio<line_sep>cpx.pixels.auto_write=<false><line_sep>cpx.pixels.brightness=0.3<line_sep># Set these based on your ambient temperature for best results! minimum_temp=24<line_sep>maximum_temp=30<while_stmt><true># temperature value ...
<import_from_stmt>collections namedtuple<import_stmt>io<import_stmt>json<import_from_stmt>furl furl<import_from_stmt>django.core.handlers.wsgi WSGIRequest<import_from_stmt>django.http.request QueryDict<import_from_stmt>django.template Variable VariableDoesNotExist<import_from_stmt>django.test.client MULTIPART_CONTENT<i...
# -*- coding: utf-8 -*- # Copyright (c) 2013 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mo...
<import_from_stmt>PIL Image ImageDraw ImageFont<import_from_stmt>numpy asarray<import_from_stmt>cv2 cvtColor COLOR_RGB2BGR imshow waitKey<import_from_stmt>os getcwd<def_stmt>getFontSize_name resolution<block_start>x=resolution[0]<if_stmt>x<le>1024<block_start><return>(16 (1024 576))<block_end><elif_stmt>x<le>1280<block...
########################################################################## # Copyright (c) 2009, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Universitaetstrasse 6, CH...
""" enclosure_tags ~~~~~~~~~~~~~~ Fix tags for MP3 enclosures (e.g. podcasts). Adds a "with tags" link to a version of the file with tags set as follows: * the entry title as title * the feed title as album * the entry/feed author as author This plugin needs additional dependencies, use the ``unstable-plugins`` ext...
<class_stmt>Workset(WorksetPreview IDisposable)<block_start>""" Represents a workset in the document. """<line_sep>@staticmethod<def_stmt>Create document name<block_start>""" Create(document: Document,name: str) -> Workset Creates a new workset. document: The document in which the new instanc...
# Lint as: python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
<import_stmt>argparse pdb<import_stmt>gym<import_stmt>numpy<as>np<import_stmt>os<import_stmt>pickle<import_stmt>random<import_stmt>torch<import_stmt>scipy.misc<import_from_stmt>gym.envs.registration register<line_sep>parser=argparse.ArgumentParser()<line_sep>parser.add_argument('-display' type=int default=0)<line_sep>p...
<import_from_stmt>curriculum.utils set_env_no_gpu format_experiment_prefix<line_sep>set_env_no_gpu()<import_stmt>argparse<import_stmt>math<import_stmt>os<import_stmt>os.path<as>osp<import_stmt>sys<import_stmt>random<import_from_stmt>multiprocessing cpu_count<import_stmt>numpy<as>np<import_stmt>tensorflow<as>tf<import_f...
<def_stmt>decode_lines lines_bytes encoding:str<block_start><if_stmt>isinstance(lines_bytes[0] bytes)<block_start>lines_str=[line.decode(encoding)<for>line lines_bytes]<block_end><elif_stmt>isinstance(lines_bytes[0] str)<block_start>lines_str=lines_bytes<block_end><else_stmt><block_start><raise>TypeError(type(lines_byt...
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
# -*- coding: utf-8 -*- <import_stmt>pytest<def_stmt>test_translator <block_start><def_stmt>translator string<block_start>translations={'String value is too long.':'Tamanho de texto muito grande.'}<line_sep><return>translations.get(string string)<block_end><import_from_stmt>schematics.translator register_translator<lin...
<import_stmt>json<import_stmt>logging<import_from_stmt>django.core.management.base BaseCommand<import_from_stmt>django.db transaction<import_from_stmt>osf.models AbstractProvider PreprintProvider Preprint Subject<import_from_stmt>osf.models.provider rules_to_subjects<import_from_stmt>scripts utils<as>script_utils<impor...
<import_stmt>os<import_from_stmt>typing TYPE_CHECKING<import_from_stmt>modules.base ModuleProcessor<import_from_stmt>opta.core.terraform get_terraform_outputs<import_from_stmt>opta.exceptions UserErrors<if_stmt>TYPE_CHECKING<block_start><import_from_stmt>opta.layer Layer<import_from_stmt>opta.module Module<block_end><c...
<import_from_stmt>girder.exceptions ValidationException<import_from_stmt>girder.utility setting_utilities<class_stmt>PluginSettings<block_start>AUTO_COMPUTE='hashsum_download.auto_compute'<block_end>@setting_utilities.default(PluginSettings.AUTO_COMPUTE)<def_stmt>_defaultAutoCompute <block_start><return><false><block_e...
<import_from_future_stmt> absolute_import<import_stmt>os<import_stmt>yaml<import_from_stmt>ccmlib common extension repository<import_from_stmt>ccmlib.cluster Cluster<import_from_stmt>ccmlib.dse_cluster DseCluster<import_from_stmt>ccmlib.node Node<import_from_stmt>distutils.version LooseVersion#pylint: disable=import-er...
# Copyright 2019-2020 QuantumBlack Visual Analytics Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # THE SOFTWARE IS PROVIDED "AS IS"...
<import_from_stmt>raw.ndfd *<line_sep>
<import_stmt>json<import_stmt>kfp.dsl<as>_kfp_dsl<import_stmt>kfp.components<as>_kfp_components<import_from_stmt>collections OrderedDict<import_from_stmt>kubernetes client<as>k8s_client<def_stmt>step1 <block_start><import_from_stmt>kale.common mlmdutils<as>_kale_mlmdutils<line_sep>_kale_mlmdutils.init_metadata()<import...
<import_from_stmt>gaphor.diagram.connectors Connector<import_from_stmt>gaphor.diagram.presentation Classified<import_from_stmt>gaphor.RAAML.raaml RelevantTo<import_from_stmt>gaphor.RAAML.stpa RelevantToItem<import_from_stmt>gaphor.SysML.requirements.connectors DirectedRelationshipPropertyPathConnect<line_sep>@Connector...
# Copyright 2021 Sony Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
__author__='calvin'<import_stmt>re<import_stmt>sys<import_from_stmt>math log10<if_stmt>sys.version[0]<eq>'3'<block_start><pass><block_end><else_stmt><block_start>range=xrange<block_end>classdef_regex=re.compile(r"\S*def .*#!|class .*#!")<line_sep>tagged_line_regex=re.compile(r".*#!")<def_stmt>convert_time_units t<block...
# Copyright 2021 <NAME> <EMAIL> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
<import_from_future_stmt> print_function absolute_import<import_stmt>unittest math<import_stmt>pandas<as>pd<import_stmt>numpy<as>np<import_from_stmt>. *<class_stmt>T(base_pandas_extensions_tester.BasePandasExtensionsTester)<block_start><def_stmt>test_concat self<block_start>df=pd.DataFrame({'c_1':['a' 'b' 'c'] 'c_2':['...
<import_stmt>numpy<as>np<import_stmt>math<import_stmt>pyrobot.utils.util<as>prutil<import_stmt>rospy<import_stmt>habitat_sim.agent<as>habAgent<import_stmt>habitat_sim.utils<as>habUtils<import_from_stmt>habitat_sim.agent.controls ActuationSpec<import_stmt>habitat_sim.errors<import_stmt>quaternion<import_from_stmt>tf.tra...
<import_from_future_stmt> division<import_stmt>logging<import_from_stmt>nanpy.i2c I2C_Master<import_from_stmt>nanpy.memo memoized<import_stmt>time<line_sep>log=logging.getLogger(__name__)<def_stmt>to_s16 n<block_start><return>(n+2<power>15)%2<power>16-2<power>15<block_end><class_stmt>Bmp180(object)<block_start>"""Contr...
# Copyright 2016-present CERN – European Organization for Nuclear Research # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
<class_stmt>BaseHandler<block_start><def_stmt>send self data p<block_start><pass><block_end><def_stmt>recv self data p<block_start><pass><block_end><def_stmt>shutdown self p direction=2<block_start><pass><block_end><def_stmt>close self<block_start><pass><block_end><block_end>
""" Script for serving a trained chatbot model over http """<import_stmt>datetime<import_stmt>click<import_from_stmt>os path<import_from_stmt>flask Flask request send_from_directory<import_from_stmt>flask_cors CORS<import_from_stmt>flask_restful Resource Api<import_stmt>general_utils<import_stmt>chat_command_handler<im...
"""Trigonometric and Hyperbolic Functions"""<import_from_stmt>typing Callable<import_stmt>numpy<import_from_stmt>pipda register_func<import_from_stmt>..core.contexts Context<import_from_stmt>..core.types FloatOrIter<import_from_stmt>.constants pi<def_stmt>_register_trig_hb_func name:str np_name:str doc:str<arrow>Callab...
<import_from_stmt>anchorecli.cli repo<line_sep>
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. <import_stmt>numpy<as>np<import_stmt>pyrobot.utils.util<as>prutil<import_from_stmt>pyrobot.core Camera<import_from_stmt>pyrobot.utils.util try_cv...
<import_from_stmt>lib action<class_stmt>RGBAction(action.BaseAction)<block_start><def_stmt>run self light_id red green blue transition_time<block_start>light=self.hue.lights.get(light_id)<line_sep>light.rgb(red green blue transition_time)<block_end><block_end>
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licen...
<import_from_stmt>django.db models<import_from_stmt>django.contrib.auth.models User<class_stmt>Link(models.Model)<block_start>url=models.URLField()<line_sep>title=models.CharField(max_length=255)<line_sep>reporter=models.ForeignKey(User on_delete=models.SET_NULL related_name='reported_links' null=<true> blank=<false> )...
# -*- coding: utf-8 -*- """ clint.textui.core ~~~~~~~~~~~~~~~~~ Core TextUI functionality for Puts/Indent/Writer. """<import_from_future_stmt> absolute_import<import_stmt>sys<import_from_stmt>contextlib contextmanager<import_from_stmt>.formatters max_width min_width _get_max_width_context<import_from_stmt>.cols colum...
<import_from_stmt>ethereum tester<as>t<import_from_stmt>ethereum utils<def_stmt>test <block_start>s=t.state()<line_sep>test_company=s.abi_contract('company.se' ADMIN_ACCOUNT=utils.decode_int(t.a0))<line_sep>order_book=s.abi_contract('orders.se')<line_sep>test_currency=s.abi_contract('currency.se' sender=t.k0)<assert_st...
""" Dependency graph: Evaluated ID example ++++++++++++++++++++++++++++++++++++++ This example demonstrates access to the evaluated ID (such as object, material, etc.) state from an original ID. This is needed every time one needs to access state with animation, constraints, and modifiers taken into account. """<impor...
<import_stmt>os<import_stmt>re<import_from_stmt>base64 b64decode<import_from_stmt>pathlib Path<import_stmt>requests<line_sep>username=os.environ["GITHUB_USERNAME"]<line_sep>password=os.environ["GITHUB_PERSONAL_ACCESS_TOKEN"]<line_sep>auth=requests.auth.HTTPBasicAuth(username password)<line_sep>directory=Path(__file__)....
<import_stmt>logging<import_from_stmt>iemit_plugin IEmitter<import_from_stmt>plugins.emitters.base_http_emitter BaseHttpEmitter<line_sep>logger=logging.getLogger('crawlutils')<class_stmt>HttpEmitter(BaseHttpEmitter IEmitter)<block_start><def_stmt>get_emitter_protocol self<block_start><return>'http'<block_end><block_end...
<import_stmt>chainer<import_from_stmt>chainer functions<import_from_stmt>chainer links<import_stmt>chainer_chemistry<import_from_stmt>chainer_chemistry.links.connection.graph_linear GraphLinear<import_from_stmt>chainer_chemistry.utils is_sparse<class_stmt>GGNNUpdate(chainer.Chain)<block_start>"""GGNN submodule for upda...
<def_stmt>func a b<block_start><return>a+b<block_end><def_stmt>func2 a<block_start>print(a)<block_end>print("Hello")<line_sep>
<import_stmt>os<import_from_stmt>.default DefaultModelConfig<class_stmt>ModelConfig(DefaultModelConfig)<block_start><def_stmt>__init__ self<block_start>super().__init__()<line_sep>self.MODEL_NAME='AOTT'<block_end><block_end>
<def_stmt>_do_set env name value<block_start><if_stmt>env.contains(name)<block_start>env.set(name value)<block_end><elif_stmt>env.parent<is><not><none><block_start>_do_set(env.parent name value)<block_end><else_stmt><block_start><raise>Exception("Attempted to set name '%s' but it does not exist."%name)<block_end><block...
<import_stmt>itertools<import_from_stmt>..quant_utils QuantizedValue QuantizedValueType attribute_to_kwarg quantize_nparray<import_from_stmt>.base_operator QuantOperatorBase<class_stmt>QDQOperatorBase<block_start><def_stmt>__init__ self onnx_quantizer onnx_node<block_start>self.quantizer=onnx_quantizer<line_sep>self.no...
<import_stmt>numpy<def_stmt>layer_method <block_start><return>{"pi":"{0:.2f}".format(numpy.pi)}<block_end>
<import_from_stmt>uliweb.i18n ugettext_lazy<as>_<def_stmt>test_1 <block_start>""" >>> x = _('Hello') >>> print repr(x) ugettext_lazy('Hello') """<block_end><def_stmt>test_1 <block_start>""" >>> x = _('Hello {0}') >>> print x.format('name') Hello name """<block_end>
# Copyright 2017 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
"""Datatest main program"""<import_stmt>sys<as>_sys<import_from_stmt>unittest TestProgram<as>_TestProgram<import_from_stmt>unittest defaultTestLoader<as>_defaultTestLoader<try_stmt><block_start><import_from_stmt>unittest.signals installHandler<block_end><except_stmt>ImportError<block_start>installHandler=<none><block_e...
# -*- coding: utf-8 -*- <import_from_future_stmt> absolute_import<import_from_future_stmt> division<import_from_future_stmt> print_function<import_stmt>csv<import_stmt>numpy<as>np<import_stmt>os<import_stmt>sys<import_from_stmt>observations.util maybe_download_and_extract<def_stmt>chest_sizes path<block_start>"""Chest ...
# -*- coding: utf-8 -*- <import_from_stmt>beacontools parse_packet<line_sep># Eddystone UID packet uid_packet=b"\x02\x01\x06\x03\x03\xaa\xfe\x17\x16\xaa\xfe\x00\xe3\x12\x34\x56\x78\x90\x12"<concat>b"\x34\x67\x89\x01\x00\x00\x00\x00\x00\x01\x00\x00"<line_sep>uid_frame=parse_packet(uid_packet)<line_sep>print("Namespace: ...
r"""Train an EfficientNet classifier. Currently implementation of multi-label multi-class classification is non-functional. During training, start tensorboard from within the classification/ directory: tensorboard --logdir run --bind_all --samples_per_plugin scalars=0,images=0 Example usage: python train_cla...
""" Initialization methods. """<line_sep># pylint: disable=wildcard-import <import_from_stmt>.methods *<import_from_stmt>. methods<line_sep>__all__=[]<line_sep>__all__<augadd>methods.__all__<line_sep>
"""This module contains custom data-structures."""<import_stmt>six<class_stmt>TreeMap(dict)<block_start>"""Tree structure implemented with nested dictionaries."""<def_stmt>get_paths self<block_start>"""Get all paths from the root to the leaves. For example, given a chain like `{'a':{'b':{'c':None}}}`, ...
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. <import_stmt>datasets.registry<import_from_stmt>foundations hparams<import_from_stmt>foundations.step Step<import_from_stmt>lottery.branch base<i...
# Time: O(|V| + |E|) # Space: O(|V|) # """ # This is HtmlParser's API interface. # You should not implement it, or speculate about its implementation # """ <class_stmt>HtmlParser(object)<block_start><def_stmt>getUrls self url<block_start>""" :type url: str :rtype List[str] """<line_sep><pass><bloc...
""" Settings for re-running the experiments from the paper "Layer-wise relevance propagation for explaining deep neural network decisions in MRI-based Alzheimer’s disease classification". Please note that you need to download the ADNI data from http://adni.loni.usc.edu/ and preprocess it using https://github.com/ANT...
<import_stmt>math<import_stmt>unittest<import_stmt>torch<import_from_stmt>nuscenes.prediction.models mtp<class_stmt>TestMTPLoss(unittest.TestCase)<block_start>""" Test each component of MTPLoss as well as the __call__ method. """<def_stmt>test_get_trajectories_and_modes self<block_start>loss_n_modes_5=mtp.M...
<import_stmt>os<import_stmt>sys<line_sep>compiler=r'../Binary/RelWithDebInfo/ShaderCompiler'<line_sep>#compiler = r'../Binary/Debug/ShaderCompiler' shader_dirs=['.' './Editor']<line_sep>count=0<for_stmt>d shader_dirs<block_start><for_stmt>fn os.listdir(d)<block_start>print(fn)<line_sep>ext=fn.split('.')[-1]<if_stmt>ext...
# SPDX-License-Identifier: Apache-2.0 """Graph Optimizer Base"""<import_stmt>copy<import_from_stmt>.. logging utils<class_stmt>GraphOptimizerBase(object)<block_start>"""optimizer graph to improve performance """<def_stmt>__init__ self<block_start>self._logger=logging.getLogger('.'.join(__name__.split('.')[:-1]+[sel...
# # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # THIS SOFTWARE IS PR...
<import_stmt>pytest<line_sep># from pytest_factoryboy import register <def_stmt>pytest_addoption parser<block_start>parser.addoption("--slow" action="store_true" default=<false> help="run slow tests" )<line_sep>parser.addoption("--all" action="store_true" default=<false> help="run all tests" )<block_end><def_stmt>_is_c...
<import_stmt>os<import_stmt>random<line_sep>#initiate a list called emails_list emails_list=[]<line_sep>Directory='/home/azureuser/spam_filter/enron1/emails/'<line_sep>Dir_list=os.listdir(Directory)<for_stmt>file Dir_list<block_start><block_end>f=open(Directory+file 'r')<line_sep>emails_list.append(f.read())<line_sep>f...
<import_from_stmt>math pi sin cos<import_from_stmt>panda3d.core *<import_from_stmt>direct.showbase.ShowBase ShowBase<import_from_stmt>direct.task Task<import_from_stmt>floorplan Floorplan<import_stmt>numpy<as>np<import_stmt>random<import_stmt>copy<class_stmt>Viewer(ShowBase)<block_start><def_stmt>__init__ self<block_st...
<import_stmt>numpy<as>np<class_stmt>KF1D# this EKF assumes constant covariance matrix, so calculations are much simpler # the Kalman gain also needs to be precomputed using the control module <block_start><def_stmt>__init__ self x0 A C K<block_start>self.x=x0<line_sep>self.A=A<line_sep>self.C=C<line_sep>self.K=K<line_s...
# -*- coding: utf-8 -*- # SPDX-License-Identifier: GPL-2.0+ # # Copyright 2017 Google, Inc # <import_stmt>contextlib<import_stmt>os<import_stmt>re<import_stmt>shutil<import_stmt>sys<import_stmt>tempfile<import_stmt>unittest<import_stmt>gitutil<import_stmt>patchstream<import_stmt>settings<line_sep>@contextlib.contextman...
<import_stmt>re<line_sep>COMMENT_REGEX=re.compile(r'(checkov:skip=|bridgecrew:skip=) *([A-Z_\d]+)(:[^\n]+)?')<line_sep>
<import_stmt>logging<import_stmt>os<import_stmt>platform<import_from_stmt>datetime datetime<import_from_stmt>moabb.analysis plotting<as>plt<import_from_stmt>moabb.analysis.meta_analysis # noqa: E501 compute_dataset_statistics find_significant_differences <import_from_stmt>moabb.analysis.results Results# noqa: F401 log=...
""" Copyright (c) 2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
# fmt: off <import_stmt>logging<import_from_stmt>pathlib Path<import_from_stmt>farm.data_handler.data_silo DataSilo<import_from_stmt>farm.data_handler.processor RegressionProcessor TextPairClassificationProcessor<import_from_stmt>farm.experiment initialize_optimizer<import_from_stmt>farm.infer Inferencer<import_from_st...
<import_stmt>os<import_stmt>pytest<import_stmt>torch<import_stmt>torch.distributed<as>dist<import_from_stmt>ignite.distributed.comp_models has_native_dist_support<if_stmt><not>has_native_dist_support<block_start>pytest.skip("Skip if no native dist support" allow_module_level=<true>)<block_end><else_stmt><block_start><i...
<import_stmt>re<import_from_stmt>typing Dict Tuple List NamedTuple Optional<import_from_stmt>lib.utils.decorators with_exception_retry<import_from_stmt>.helpers.common split_hostport get_parsed_variables merge_hostport random_choice <import_from_stmt>.helpers.zookeeper get_hostname_and_port_from_zk<line_sep># TODO: mak...
# Copyright 2021 JD.com, Inc., JD AI """ @author: <NAME> @contact: <EMAIL> """<import_stmt>torch<import_stmt>torch.nn<as>nn<line_sep>__all__=["AttentionPooler"]<class_stmt>AttentionPooler(nn.Module)<block_start><def_stmt>__init__ self * hidden_size:int output_size:int dropout:float use_bn:bool<block_start>super(Attenti...
<import_stmt>FWCore.ParameterSet.Config<as>cms<import_from_stmt>CalibTracker.SiStripCommon.ShallowEventDataProducer_cfi *<import_from_stmt>CalibTracker.SiStripCommon.ShallowDigisProducer_cfi *<import_from_stmt>CalibTracker.SiStripCommon.ShallowClustersProducer_cfi *<import_from_stmt>CalibTracker.SiStripCommon.ShallowTr...
<import_stmt>mod<def_stmt>foo <block_start><return>1<block_end><try_stmt><block_start>mod.foo=foo<block_end><except_stmt>RuntimeError<block_start>print("RuntimeError1")<block_end>print(mod.foo())<try_stmt><block_start>mod.foo=1<block_end><except_stmt>RuntimeError<block_start>print("RuntimeError2")<block_end>print(mod.f...
<import_from_stmt>pathlib Path<line_sep>IPYTHON_STARTUP_FOLDER=Path.home()/".ipython"/"profile_default"/"startup"<line_sep>STARTUP_FILE=IPYTHON_STARTUP_FOLDER/"pyforest_autoimport.py"<def_stmt>_create_or_reset_startup_file <block_start><if_stmt>STARTUP_FILE.exists()<block_start>STARTUP_FILE.unlink()# deletes the old fi...
<import_from_stmt>common Modules data_strings load_yara_rules AndroidParseModule ModuleMetadata<import_from_stmt>base64 b64decode<import_from_stmt>string printable<class_stmt>dendroid(AndroidParseModule)<block_start><def_stmt>__init__ self<block_start>md=ModuleMetadata(module_name="dendroid" bot_name="Dendroid" descrip...
<import_stmt>tensorboardX<with_stmt>tensorboardX.SummaryWriter("foo")<as>w<block_start>w.add_scalar("a" 1.0 1)<line_sep>w.add_scalar("a" 2.0 2)<block_end><with_stmt>tensorboardX.SummaryWriter("foo/bar")<as>w<block_start>w.add_scalar("a" 3.0 3)<line_sep>w.add_scalar("a" 4.0 4)<block_end><with_stmt>tensorboardX.SummaryWr...
<import_from_stmt>collections defaultdict OrderedDict<import_from_stmt>itertools islice<import_stmt>copy os pickle warnings<import_stmt>esda<import_stmt>numpy<import_from_stmt>.analysis GlobalAutoK<import_from_stmt>. util<import_from_stmt>libpysal cg examples weights<import_from_stmt>libpysal.common requires<try_stmt><...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# encoding: utf-8 # module Autodesk.Revit.UI.Plumbing calls itself Plumbing # from RevitAPIUI,Version=172.16.58.3,Culture=neutral,PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # classes <class_stmt>IPipeFittingAndAccessoryPressureDropUIServer(IExternalServer)<block_start>""" Inte...
# Copyright 2021 QuantumBlack Visual Analytics Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # THE SOFTWARE IS PROVIDED "AS IS",...
<import_from_future_stmt> print_function<import_from_future_stmt> division<import_stmt>torch<import_stmt>torch.nn<as>nn<import_from_stmt>torch.nn Parameter<import_stmt>math<import_from_stmt>torchkit.util.utils l2_norm<import_from_stmt>torchkit.head.localfc.common calc_logits<class_stmt>CurricularFace(nn.Module)<block_s...
<try_stmt><block_start><import_from_stmt>public_config *<block_end><except_stmt>ImportError<block_start><pass><block_end>HOST='0.0.0.0'<line_sep>PORT=9038<line_sep>SERVICE_NAME='jobs'<line_sep>SERVER_ENV='prod'<line_sep>SQLALCHEMY_POOL_SIZE=10<line_sep>SQLALCHEMY_POOL_RECYCLE=3600<line_sep>JOBS=[{# 任务 信用积分每日检查, 每周一到每周五...
<import_from_stmt>sklearn.ensemble RandomForestRegressor<import_from_stmt>openbox.utils.config_space ConfigurationSpace<import_from_stmt>openbox.utils.config_space UniformFloatHyperparameter CategoricalHyperparameter Constant UniformIntegerHyperparameter<import_stmt>numpy<as>np<import_from_stmt>openbox.utils.config_spa...
<import_from_stmt>opt_utils *<import_stmt>argparse<line_sep>parser=argparse.ArgumentParser()<line_sep>parser.add_argument("-s" "--skip_compilation" action='store_true' help="skip compilation")<line_sep>args=parser.parse_args()<if_stmt><not>args.skip_compilation<block_start>compile_all_opt_examples()<block_end><for_stmt...
<import_from_stmt>nose.tools raises<import_from_stmt>blocks.bricks Bias Linear Logistic<import_from_stmt>blocks.bricks.parallel Merge<import_from_stmt>blocks.filter VariableFilter<import_from_stmt>blocks.graph ComputationGraph<import_from_stmt>blocks.roles BIAS FILTER PARAMETER OUTPUT<import_from_stmt>theano tensor<def...
<import_from_stmt>tensorflow.keras.models Model<import_from_stmt>tensorflow.keras.layers Dense Flatten Dropout Input<import_from_stmt>tensorflow.keras.layers MaxPooling1D Conv1D<import_from_stmt>tensorflow.keras.layers LSTM Bidirectional<import_from_stmt>tensorflow.keras.layers BatchNormalization GlobalAveragePooling1D...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...