content
stringlengths
0
1.55M
#------------------------------------------------------------------------------ # Copyright (c) 2013-2017, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. #------------------------------------------------...
<import_stmt>math<import_from_stmt>pypy.module.cpyext pystrtod<import_from_stmt>pypy.module.cpyext.test.test_api BaseApiTest raises_w<import_from_stmt>rpython.rtyper.lltypesystem rffi<import_from_stmt>rpython.rtyper.lltypesystem lltype<import_from_stmt>pypy.module.cpyext.pystrtod PyOS_string_to_double<class_stmt>TestPy...
<import_stmt>pytest<import_stmt>cudf<import_stmt>mock<import_from_stmt>cuxfilter.charts.core.non_aggregate.core_non_aggregate BaseNonAggregate <import_from_stmt>cuxfilter.dashboard DashBoard<import_from_stmt>cuxfilter DataFrame<import_from_stmt>cuxfilter.layouts chart_view<class_stmt>TestCoreNonAggregateChart<block_sta...
<class_stmt>Session(list)<block_start>"""Abstract Session class"""<def_stmt>to_strings self user_id session_id<block_start>"""represent session as list of strings (one per event)"""<line_sep>user_id,session_id=str(user_id) str(session_id)<line_sep>session_type=self.get_type()<line_sep>strings=[]<for_stmt>event,product ...
<import_stmt>argparse<import_stmt>matplotlib.pyplot<as>plt<import_stmt>torch<import_from_stmt>pytorch_warmup *<def_stmt>get_rates warmup_cls beta2 max_step<block_start>rates=[]<line_sep>p=torch.nn.Parameter(torch.arange(10 dtype=torch.float32))<line_sep>optimizer=torch.optim.Adam([{'params':p}] lr=1.0 betas=(0.9 beta2)...
""" Keepkey ******* """<import_from_stmt>..errors DEVICE_NOT_INITIALIZED DeviceNotReadyError common_err_msgs handle_errors <import_from_stmt>.trezorlib protobuf<as>p<import_from_stmt>.trezorlib.transport hid udp webusb <import_from_stmt>.trezor TrezorClient HID_IDS WEBUSB_IDS<import_from_stmt>.trezorlib.messages DebugL...
<import_stmt>unittest<import_stmt>numpy<as>np<import_from_stmt>astroNN.lamost wavelength_solution pseudo_continuum<class_stmt>LamostToolsTestCase(unittest.TestCase)<block_start><def_stmt>test_wavelength_solution self<block_start>wavelength_solution()<line_sep>wavelength_solution(dr=5)<line_sep>self.assertRaises(ValueEr...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- <import_fr...
"""Python wrapper around the _clibs PicoSAT extension."""<import_stmt>os<import_from_stmt>tt.errors.arguments InvalidArgumentTypeError InvalidArgumentValueError <if_stmt>os.environ.get('READTHEDOCS')<ne>'True'<block_start><import_from_stmt>tt._clibs picosat<as>_c_picosat<line_sep>VERSION=_c_picosat.VERSION<block_end><d...
""" Schedule adjustments are functions that accept a `datetime` and modify it in some way. Adjustments have the signature `Callable[[datetime], datetime]`. """<import_from_stmt>datetime datetime timedelta<import_from_stmt>typing Callable<import_stmt>pendulum<import_stmt>prefect.schedules.filters<def_stmt>add interval:...
<import_from_stmt>collections.abc Iterable<import_stmt>warnings<import_from_stmt>hdmf.utils docval popargs call_docval_func get_docval<import_from_stmt>. register_class CORE_NAMESPACE<import_from_stmt>.core NWBDataInterface NWBData<class_stmt>RetinotopyImage(NWBData)<block_start>"""Gray-scale anatomical image of cortic...
""" Copyright (c) 2022 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...
<import_stmt>FWCore.ParameterSet.Config<as>cms<import_from_stmt>RecoEgamma.ElectronIdentification.Identification.mvaElectronID_tools *<line_sep># Documentation of the MVA # https://twiki.cern.ch/twiki/bin/viewauth/CMS/MultivariateElectronIdentificationRun2 # https://rembserj.web.cern.ch/rembserj/notes/Electron_MVA_ID_2...
# ============================================================================== # Copyright 2018-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://ww...
# Lint as: python3 # Copyright 2018 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 ...
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right <import_from_stmt>collections deque<import_from_stmt>collections defaultdict<class_stmt>Solution(object)<block_start><de...
"""Test API utilities."""<import_stmt>json<import_from_stmt>pytradfri.api.libcoap_api APIFactory<import_from_stmt>pytradfri.gateway Gateway<def_stmt>test_constructor_timeout_passed_to_subprocess monkeypatch<block_start>"""Test that original timeout is passed to subprocess."""<line_sep>capture={}<def_stmt>capture_args *...
<import_stmt>re<line_sep>regex=re.compile('[^a-zA-Z]')<def_stmt>score_word word corpus=<none><block_start>word=regex.sub('' word)# leave only alpha score=0<line_sep>consec_bonus=2<for_stmt>i,letter enumerate(word)<block_start><if_stmt>letter.islower()<block_start><continue><block_end><if_stmt>i<g>0<and>word[i-1].upper(...
<import_from_stmt>django.core.exceptions PermissionDenied<import_from_stmt>django.shortcuts get_object_or_404 redirect<import_from_stmt>django.template.response TemplateResponse<import_from_stmt>django.urls reverse<import_from_stmt>django.utils.translation gettext<as>_<import_from_stmt>wagtail.admin messages<import_fro...
<import_from_future_stmt> absolute_import<import_from_future_stmt> print_function<import_from_future_stmt> division<import_stmt>numpy<as>np<import_stmt>cPickle<as>pickle<import_from_stmt>keras backend<as>K<import_from_stmt>keras.utils np_utils<import_from_stmt>keras.preprocessing sequence<import_from_stmt>random shuffl...
"""Handle exceptions generated from 'user' code"""<import_stmt>sys<import_stmt>traceback<class_stmt>InvalidCommand(Exception)<block_start>"""Invalid command line argument."""<def_stmt>__init__ self *args **kwargs<block_start>self.not_found=kwargs.pop('not_found' <none>)<line_sep>super(InvalidCommand self).__init__(*arg...
""" owtf.__main__ ~~~~~~~~~~~~~ A __main__ method for OWTF so that internal services can be called as Python modules. """<import_stmt>sys<import_from_stmt>owtf.core main<if_stmt>__name__<eq>"__main__"<block_start>main()<block_end>
<import_from_stmt>typing List Type<import_from_stmt>apiron.service.base ServiceBase<class_stmt>DiscoverableService(ServiceBase)<block_start>""" A Service whose hosts are determined via a host resolver. A host resolver is any class with a :func:`resolve` method that takes a service name as its sole argument ...
# Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # registration.py - updates the database to say who is building something # and what the current settings are, which is used by the file serving # code to see if it is ok ...
<import_stmt>rumps<import_stmt>sys<import_stmt>icon_manager<import_from_stmt>datetime timedelta<import_stmt>timekeeper<import_stmt>os<line_sep># pyinstaller --onefile -w --add-data "Icons/:Icons" --icon="Icons/timeglass.png" --clean timeglass.spec # rumps.debug_mode(True) <class_stmt>TimerApp(rumps.App)<block_start><de...
# Copyright <NAME> 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) <import_from_future_stmt> print_function<line_sep>''' >>> from iterator_ext import * >>> from input_iterator import * >>> x = list_int() >>> x.p...
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 <import_from_stmt>openvino.tools.mo.front.common.partial_infer.utils mo_array<import_from_stmt>openvino.tools.mo.ops.proposal ProposalOp<import_from_stmt>openvino.tools.mo.front.caffe.collect_attributes merge_attrs<import_from_stmt>openvi...
""" 提供几种常用的控制器。 这些验证器通常需要提供一些参数进行一次调用,返回的结果才是真正的验证器,其中的技巧在于通过闭包使要控制的对象能够被内部函数访问。 版本: 1.3.0+ """<import_stmt>re<import_from_stmt>nonebot CommandSession<import_from_stmt>nonebot.helpers render_expression<def_stmt>handle_cancellation session:CommandSession<block_start>""" 在用户发送 `算了`、`不用了`、`取消吧`、`停` 之类的话的时候,结束当前传入的命令...
<import_from_stmt>desktop_local_tests.public_ip_during_disruption PublicIPDuringDisruptionTestCase<import_from_stmt>desktop_local_tests.windows.windows_reorder_adapters_disrupter WindowsReorderAdaptersDisrupter<class_stmt>TestWindowsPublicIPDisruptReorderAdapters(PublicIPDuringDisruptionTestCase)<block_start>'''Summary...
<import_stmt>json<import_stmt>logging<import_from_stmt>http HTTPStatus<import_from_stmt>typing Any Dict List Optional Tuple Type Union<import_stmt>werkzeug<import_from_stmt>flask Blueprint Flask Response abort jsonify<import_from_stmt>flask.views MethodView<import_from_stmt>flask_cors CORS<import_from_stmt>gevent.pywsg...
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'gui.ui' ## ## Created by: Qt User Interface Compiler version 5.15.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #######################...
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2009 Edgewall Software # Copyright (C) 2005-2007 <NAME> <<EMAIL>> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.or...
<import_stmt>os<import_stmt>sys<import_stmt>angr<import_stmt>nose.tools<line_sep>test_location=os.path.join(os.path.dirname(os.path.realpath(__file__)) '..' '..' 'binaries' 'tests')<def_stmt>test_various_loops <block_start>p=angr.Project(os.path.join(test_location 'x86_64' 'various_loops') auto_load_libs=<false>)<line_...
<import_from_stmt>TikTokApi TikTokApi<line_sep>api=TikTokApi.get_instance()<line_sep>count=30<line_sep># You can find this from a tiktok getting method in another way or find songs from the discoverMusic method. sound_id="6601861313180207878"<line_sep>tiktoks=api.by_sound(sound_id count=count)<for_stmt>tiktok tiktoks<b...
""" Environment for basic obstacle avoidance controlling a robotic arm from UR. In this environment the obstacle is only moving up and down in a vertical line in front of the robot. The goal is for the robot to stay within a predefined minimum distance to the moving obstacle. When feasible the robot should continue to...
<import_stmt>unittest<import_stmt>unittest.mock<import_from_stmt>programy.storage.entities.nodes NodesStore<class_stmt>NodesStoreTest(unittest.TestCase)<block_start><def_stmt>test_load self<block_start>store=NodesStore()<with_stmt>self.assertRaises(NotImplementedError)<block_start>collector=unittest.mock.Mock()<line_se...
<import_stmt>unittest<class_stmt>PrefixNotIncluded(unittest.TestCase)<block_start><def_stmt>test_not_included self<block_start><pass><block_end><block_end><if_stmt>__name__<eq>'__main__'<block_start>unittest.main()<block_end>
""" Stability analysis of the D2Q4 solver for the advection equation d_t(u) + c_x d_x(u) + c_y d_y(u) = 0 """<import_stmt>sympy<as>sp<import_stmt>pylbm<line_sep># pylint: disable=invalid-name # symbolic variables U,X,Y=sp.symbols('U, X, Y')<line_sep># symbolic parameters LA,CX,CY=sp.symbols('lambda, cx, cy' cons...
<import_from_future_stmt> absolute_import division print_function<import_from_stmt>libtbx.utils null_out<import_from_stmt>libtbx easy_pickle<import_from_stmt>six.moves cStringIO<as>StringIO<def_stmt>run_validation pdb_file ignore_hd=<true><block_start><import_from_stmt>mmtbx.validation restraints<import_stmt>mmtbx.comm...
<import_stmt>os<import_stmt>shutil<import_stmt>sys<import_stmt>tarfile<def_stmt>include_package envoy_api_protos rst_file_path prefix# `envoy_api_rst_files` is a list of file paths for .proto.rst files # generated by protodoc # # we are only interested in the proto files generated for envoy protos, # not for non-envoy ...
<import_from_stmt>mock.mock patch<import_stmt>os<import_stmt>pytest<import_stmt>ca_test_common<import_stmt>ceph_volume_simple_activate<line_sep>fake_cluster='ceph'<line_sep>fake_container_binary='podman'<line_sep>fake_container_image='quay.ceph.io/ceph/daemon:latest'<line_sep>fake_id='42'<line_sep>fake_uuid='0c4a7eca-0...
# @copyright@ # Copyright (c) 2006 - 2019 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ # # @rocks@ # Copyright (c) 2000 - 2010 The Regents of the University of California # All rights reserved. Rocks(r) v5.4 www.rocksclusters.org # ...
<try_stmt><block_start><import_from_stmt>torch.hub load_state_dict_from_url<block_end><except_stmt>ImportError<block_start><import_from_stmt>torch.utils.model_zoo load_url<as>load_state_dict_from_url<block_end>
<import_stmt>os<import_stmt>shutil<import_from_stmt>tempfile mkdtemp<import_stmt>pytest<import_stmt>numpy<import_stmt>py.path<as>pp<line_sep>NIPYPE_DATADIR=os.path.realpath(os.path.join(os.path.dirname(__file__) "testing/data"))<line_sep>temp_folder=mkdtemp()<line_sep>data_dir=os.path.join(temp_folder "data")<line_sep>...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making GameAISDK available. This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package. Copyright...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# 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...
<import_from_stmt>onnxsim.onnx_simplifier simplify<line_sep>__version__='0.0.0'<line_sep>
"""Simple water flow example using ANUGA Water driven up a linear slope and time varying boundary, similar to a beach environment """<line_sep>#------------------------------------------------------------------------------ # Import necessary modules #--------------------------------------------------------------------...
<import_from_stmt>pyxtal.molecule *<import_from_stmt>ase.build molecule<import_from_stmt>pymatgen.core Molecule<def_stmt>get_ase_mol molname<block_start>"""convert ase molecule to pymatgen style"""<line_sep>ase_mol=molecule(molname)<line_sep>pos=ase_mol.get_positions()<line_sep>symbols=ase_mol.get_chemical_symbols()<li...
<import_from_stmt>time sleep<import_stmt>xpc<def_stmt>ex <block_start>print("X-Plane Connect example script")<line_sep>print("Setting up simulation")<with_stmt>xpc.XPlaneConnect()<as>client# Verify connection <block_start><try_stmt># If X-Plane does not respond to the request, a timeout error # will be raised. <block_s...
<import_from_stmt>cytoolz.functoolz curry <import_from_stmt>eth_utils to_dict to_tuple <line_sep>@curry@to_dict<def_stmt>normalize_dict value normalizers<block_start><for_stmt>key,item value.items()<block_start>normalizer=normalizers[key]<line_sep><yield>key normalizer(item)<block_end><block_end>@curry@to_tuple<def_stm...
<import_stmt>os<import_stmt>shutil<import_stmt>unittest<import_from_stmt>base64 b64encode<import_from_stmt>sonLib.bioio TestStatus<import_from_stmt>sonLib.bioio getTempFile<import_from_stmt>sonLib.bioio getTempDirectory<import_from_stmt>sonLib.bioio system<import_from_stmt>toil.job Job<import_from_stmt>toil.common Toil...
<import_stmt>json<class_stmt>TrainingSpecification<block_start>template=""" { "TrainingSpecification": { "TrainingImage": "IMAGE_REPLACE_ME", "SupportedHyperParameters": [ { "Description": "Grow a tree with max_leaf_nodes in best-first fashion. Best nodes are defined as relative redu...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. <import_stmt>subprocess<import_from_stmt>catapult_base cloud_storage<import_from_stmt>telemetry.core platform<import_from_stmt>telemetry.util image_util<impor...
<import_from_stmt>adapters.adapter_with_battery AdapterWithBattery<import_from_stmt>devices.switch.selector_switch SelectorSwitch<class_stmt>HeimanAlarmRemoteAdapter(AdapterWithBattery)<block_start><def_stmt>__init__ self<block_start>super().__init__()<line_sep>self.switch=SelectorSwitch('Remote' 'action')<line_sep>sel...
<import_from_stmt>KratosMultiphysics ParallelEnvironment IsDistributedRun<if_stmt>IsDistributedRun()<block_start><import_from_stmt>KratosMultiphysics.mpi DataCommunicatorFactory<block_end><import_stmt>KratosMultiphysics.KratosUnittest<as>UnitTest<import_stmt>math<class_stmt>TestDataCommunicatorFactory(UnitTest.TestCase...
# Copyright 2018 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. <import_stmt>itertools<import_stmt>os<import_stmt>re<import_from_stmt>. base<class_stmt>OutProc(base.ExpectedOutProc)<block_start><def_stmt>__init__ self ex...
<import_stmt>pytest<import_from_stmt>Thycotic Client secret_password_get_command secret_username_get_command secret_get_command secret_password_update_command secret_checkout_command secret_checkin_command secret_delete_command folder_create_command folder_delete_command folder_update_command<import_from_stmt>test_data...
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc <import_from_future_stmt> unicode_literals<import_from_stmt>snapshottest Snapshot<line_sep>snapshots=Snapshot()<line_sep>snapshots['test_keywords 1']='[{"lineno": 7, "source": [" a\\n"], "value": "1"}, {"lineno": 7, "source": [" a\\n"], "value": "...
# -*- coding: utf-8 -*- <import_stmt>sphinx_rtd_theme<line_sep># -- General configuration ----------------------------------------------- extensions=['sphinx.ext.autodoc' 'sphinx.ext.doctest' 'sphinx.ext.intersphinx' ]<line_sep># Add any paths that contain templates here, relative to this directory. templates_path=['_t...
#This file is part of ElectricEye. #SPDX-License-Identifier: Apache-2.0 #Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you und...
<import_stmt>unittest<import_from_stmt>mox3.mox MoxTestBase IsA<import_from_stmt>slimta.queue.proxy ProxyQueue<import_from_stmt>slimta.smtp.reply Reply<import_from_stmt>slimta.relay Relay TransientRelayError PermanentRelayError<import_from_stmt>slimta.envelope Envelope<class_stmt>TestProxyQueue(MoxTestBase unittest.Tes...
<import_stmt>json<import_from_stmt>grafana_backup.dashboardApi create_snapshot<def_stmt>main args settings file_path<block_start>grafana_url=settings.get('GRAFANA_URL')<line_sep>http_post_headers=settings.get('HTTP_POST_HEADERS')<line_sep>verify_ssl=settings.get('VERIFY_SSL')<line_sep>client_cert=settings.get('CLIENT_C...
<import_from_stmt>.build build_transforms<import_from_stmt>.pre_augmentation_transforms Resize<import_from_stmt>.target_transforms PanopticTargetGenerator SemanticTargetGenerator<line_sep>
#from http://rosettacode.org/wiki/Greatest_subsequential_sum#Python #pythran export maxsum(int list) #pythran export maxsumseq(int list) #pythran export maxsumit(int list) #runas maxsum([0, 1, 0]) #runas maxsumseq([-1, 2, -1, 3, -1]) #runas maxsumit([-1, 1, 2, -5, -6]) <def_stmt>maxsum sequence<block_start>"""Return ma...
<import_from_stmt>typing List Union<import_from_stmt>pytest raises<import_from_stmt>graphql.error GraphQLError format_error<import_from_stmt>graphql.language Node Source<import_from_stmt>graphql.pyutils Undefined<def_stmt>describe_format_error <block_start><def_stmt>formats_graphql_error <block_start>source=Source(""" ...
<import_stmt>mock<import_from_stmt>maildown renderer<import_stmt>mistune<import_stmt>pygments<import_from_stmt>pygments lexers<import_from_stmt>pygments.formatters html<import_stmt>premailer<import_stmt>jinja2<def_stmt>test_highlight_renderer monkeypatch<block_start>monkeypatch.setattr(mistune "escape" mock.MagicMock()...
<import_stmt>math<import_from_stmt>mathutils Euler<import_stmt>bpy<import_from_stmt>.portal2_entity_classes *<import_from_stmt>.portal_entity_handlers PortalEntityHandler<line_sep>local_entity_lookup_table=PortalEntityHandler.entity_lookup_table.copy()<line_sep>local_entity_lookup_table.update(entity_class_handle)<clas...
<import_stmt>sys<import_stmt>webbrowser<import_stmt>os<import_from_stmt>comicstreamerlib.folders AppFolders<import_from_stmt>PyQt4 QtGui QtCore<class_stmt>SystemTrayIcon(QtGui.QSystemTrayIcon)<block_start><def_stmt>__init__ self icon app<block_start>QtGui.QSystemTrayIcon.__init__(self icon <none>)<line_sep>self.app=app...
<import_stmt>paddle<import_stmt>paddle.nn<as>nn<import_stmt>paddle.nn.functional<as>F<import_from_stmt>paddle.nn.initializer Assign<import_stmt>math<class_stmt>NoisyLinear(nn.Linear)<block_start><def_stmt>__init__ self in_features out_features sigma_zero=0.4 bias=<true><block_start>super(NoisyLinear self).__init__(in_f...
"""Agents for neural net bandit problems. We implement three main types of agent: - epsilon-greedy (fixed epsilon, annealing epsilon) - dropout (arXiv:1506.02142) - ensemble sampling All code is specialized to the setting of 2-layer fully connected MLPs. """<import_stmt>numpy<as>np<import_stmt>numpy.random<as>r...
"""Perform normalization on inputs or rewards. """<import_stmt>numpy<as>np<import_stmt>torch<import_from_stmt>gym.spaces Box<def_stmt>normalize_angle x<block_start>"""Wraps input angle to [-pi, pi]. """<line_sep><return>((x+np.pi)%(2<times>np.pi))-np.pi<block_end><class_stmt>RunningMeanStd()<block_start>"""Calula...
<import_stmt>os<import_from_stmt>fastf1.core Session Weekend<import_from_stmt>fastf1.livetiming.data LiveTimingData<def_stmt>test_file_loading_w_errors # load file with many errors and invalid data without crashing <block_start>livedata=LiveTimingData('fastf1/testing/reference_data/livedata/with_errors.txt')<line_sep>l...
# Copyright 2021 DeepMind Technologies 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
# -*- coding: utf-8 -*- """ Ramsey numbers. """<line_sep># Copyright (C) 2011 by # <NAME> <<EMAIL>> # All rights reserved. # BSD license. <import_stmt>networkx<as>nx<import_from_stmt>...utils arbitrary_element<line_sep>__all__=["ramsey_R2"]<line_sep>__author__="""<NAME> (<EMAIL>)"""<def_stmt>ramsey_R2 G<block_s...
<import_stmt>tensorflow<as>tf<import_from_stmt>..fastspeech.model TFFastSpeechEncoder TFTacotronPostnet TFFastSpeechLayer <import_from_stmt>..speechsplit.model InterpLnr<import_stmt>numpy<as>np<import_stmt>copy<class_stmt>Encoder_6(tf.keras.layers.Layer)<block_start><def_stmt>__init__ self config hparams **kwargs<block...
# flake8: noqa # errmsg.h CR_ERROR_FIRST=2000<line_sep>CR_UNKNOWN_ERROR=2000<line_sep>CR_SOCKET_CREATE_ERROR=2001<line_sep>CR_CONNECTION_ERROR=2002<line_sep>CR_CONN_HOST_ERROR=2003<line_sep>CR_IPSOCK_ERROR=2004<line_sep>CR_UNKNOWN_HOST=2005<line_sep>CR_SERVER_GONE_ERROR=2006<line_sep>CR_VERSION_ERROR=2007<line_sep>CR_O...
<import_from_stmt>pathlib Path<import_stmt>logging<import_from_stmt>.logger Logger<import_from_stmt>.log_formatter LogFormatter<class_stmt>FileLogger(Logger)<block_start>fmt=LogFormatter(use_colour=<false> output_ts=<false>)<line_sep>logger=<none><def_stmt>__init__ self folder format=<none><block_start><if_stmt>format<...
# Mostly copied and modified from torch/vision/references/segmentation to support unlabeled data # Copied functions from fmassa/vision-1 to support multi-dimensional masks loaded from numpy ndarray <import_stmt>numpy<as>np<import_from_stmt>PIL Image<import_stmt>random<import_stmt>torch<import_stmt>utils.functional<as>F...
<import_from_stmt>django template<line_sep>register=template.Library()<line_sep>@register.filter<def_stmt>negate value<block_start><return>-value<block_end>@register.filter<def_stmt>subtract value arg<block_start><return>value-arg<block_end>
<import_from_stmt>enum Enum<import_stmt>pytest<import_stmt>gino<import_from_stmt>gino.dialects.aiomysql AsyncEnum<line_sep>pytestmark=pytest.mark.asyncio<line_sep>db=gino.Gino()<class_stmt>MyEnum(Enum)<block_start>ONE="one"<line_sep>TWO="two"<block_end><class_stmt>Blog(db.Model)<block_start>__tablename__="s_blog"<line_...
""" netrd ----- netrd stands for Network Reconstruction and Distances. It is a repository of different algorithms for constructing a network from time series data, as well as for comparing two networks. It is the product of the Network Science Insitute 2019 Collabathon. """<import_from_stmt>. distance# noqa <import_f...
<import_from_stmt>transformer Encoder<import_from_stmt>torch nn optim<import_from_stmt>torch.nn.functional cross_entropy softmax relu<import_from_stmt>torch.utils.data DataLoader<import_from_stmt>torch.utils.data.dataloader default_collate<import_stmt>torch<import_stmt>utils<import_stmt>os<import_stmt>pickle<class_stmt...
<import_stmt>pandas<as>pd<import_stmt>smartplots3_setup<def_stmt>createSetup name expansion_factor percapita_factor plot_size settings<block_start>plt_setup_smart={'name':name 'expansion_factor':expansion_factor 'percapita_factor':percapita_factor 'scenarios_itr':[] 'scenarios_id':[] 'scenarios_year':[] 'plot_size':plo...
<import_from_stmt>sklearn.cluster KMeans<import_from_stmt>.exceptions KMeansException<import_from_stmt>.task Task<class_stmt>Cluster(Task)<block_start>""" Use the K-Means algorithm to group pixels by clusters. The algorithm tries to determine the optimal number of clusters for the given pixels. """<def_stmt...
# # @license BSD-3-Clause # # Copyright (c) 2019 Project Jupyter Contributors. # Distributed under the terms of the 3-Clause BSD License. <import_stmt>IPython.display<import_stmt>pandas<def_stmt>output_url url<block_start>IPython.display.publish_display_data({"application/x.jupyter.relative-dataset-urls+json":[url]})<b...
#! /usr/bin/python <import_stmt>requests<import_stmt>re<import_from_stmt>bs4 BeautifulSoup<import_stmt>colors<class_stmt>FindingComments(object)<block_start><def_stmt>__init__ self url<block_start>self.url=url<line_sep>self.comment_list=['<!--(.*)-->']<line_sep>self.found_comments={}<block_end><def_stmt>get_soure_code ...
d={"1":"a"}<line_sep>d[1]<line_sep>d["1"]<line_sep>
"""Support for Eight Sleep binary sensors."""<import_from_future_stmt> annotations<import_stmt>logging<import_from_stmt>pyeight.eight EightSleep<import_from_stmt>homeassistant.components.binary_sensor BinarySensorDeviceClass BinarySensorEntity <import_from_stmt>homeassistant.core HomeAssistant<import_from_stmt>homeassi...
default_app_config="nautobot.circuits.apps.CircuitsConfig"<line_sep>
<import_from_stmt>core.terraform.resources BaseTerraformVariable<class_stmt>TerraformVariable(BaseTerraformVariable)<block_start>""" Base resource class for Terraform tfvar variable Attributes: variable_dict_input (dict/none): Var dict values available_args (dict): Instance configurations ...
<import_stmt>os<line_sep>scrapy_project_path='/Users/kingname/book/chapter_12/DeploySpider'<line_sep>os.chdir(scrapy_project_path)#切换工作区,进入爬虫工程根目录执行命令 os.system('scrapyd-deploy')<import_stmt>json<import_stmt>time<import_stmt>requests<line_sep>start_url='http://45.76.110.210:6800/schedule.json'<line_sep>start_data={'pro...
<import_stmt>traceback<import_stmt>re<import_stmt>sys<import_stmt>logging<line_sep>""" ********** Note by wvmarle: This file contains the complete code from chained_exception.py plus the error handling code from GlacierWrapper.py, allowing it to be used in other modules like glaciercorecalls as well. ********** """<...
<import_stmt>async<import_from_stmt>async.services EchoUpperData<line_sep>server=async.server('10.211.55.3' 20007)<line_sep>async.register(transport=server protocol=EchoUpperData)<line_sep>async.run()<line_sep>
""" LLDB AppKit formatters part of The LLVM Compiler Infrastructure This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details. """<line_sep># summary provider for class NSException <import_stmt>lldb.runtime.objc.objc_runtime<import_stmt>lldb.formatters.metrics<import_st...
<import_stmt>FWCore.ParameterSet.Config<as>cms<import_from_stmt>CondCore.DBCommon.CondDBCommon_cfi *<line_sep>PoolDBESSourceMistag110118=cms.ESSource("PoolDBESSource" CondDBCommon toGet=cms.VPSet(# # working points # cms.PSet(record=cms.string('PerformancePayloadRecord') tag=cms.string('BTagMISTAGJBPLtable_v5_offline')...
<import_stmt>sys<import_stmt>argparse<import_from_stmt>hgraph *<import_from_stmt>rdkit Chem<import_from_stmt>multiprocessing Pool<def_stmt>process data<block_start>vocab=set()<for_stmt>line data<block_start>s=line.strip("\r\n ")<line_sep>hmol=MolGraph(s)<for_stmt>node,attr hmol.mol_tree.nodes(data=<true>)<block_start>s...
<import_from_future_stmt> annotations<import_from_stmt>django_perf_rec.sql sql_fingerprint<def_stmt>test_empty <block_start><assert_stmt>sql_fingerprint("")<eq>""<assert_stmt>sql_fingerprint("\n\n \n")<eq>""<block_end><def_stmt>test_select <block_start><assert_stmt>sql_fingerprint("SELECT `f1`, `f2` FROM `b`")<eq>"S...
<import_from_stmt>abc abstractproperty<import_from_stmt>..backend_config.bucket_config S3BucketConfig<import_from_stmt>..storage.helper StorageHelper<class_stmt>SetupUploadMixin(object)<block_start>log=abstractproperty()<line_sep>storage_uri=abstractproperty()<def_stmt>setup_upload self bucket_name host=<none> access_k...