content
stringlengths
0
1.55M
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! <import_stmt>grpc<import_stmt>fibcapi_pb2<as>fibcapi__pb2<import_stmt>fibcapis_pb2<as>fibcapis__pb2<class_stmt>FIBCApApiStub(object)# missing associated documentation comment in .proto file <block_start><pass><def_stmt>__init__ self channel<block_sta...
""" Copyright (c) 2020 COTOBA DESIGN, Inc. 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, modify, merge, publish, distri...
"""Test Evil Genius Labs light."""<import_from_stmt>unittest.mock patch<import_stmt>pytest<import_from_stmt>homeassistant.components.light ATTR_COLOR_MODE ATTR_SUPPORTED_COLOR_MODES ColorMode LightEntityFeature <import_from_stmt>homeassistant.const ATTR_SUPPORTED_FEATURES<line_sep>@pytest.mark.parametrize("platforms" [...
<import_from_stmt>django.core.exceptions ValidationError<import_from_stmt>django.core.validators validate_email<import_from_stmt>django.template Template TemplateSyntaxError TemplateDoesNotExist<import_from_stmt>django.utils.encoding force_str<def_stmt>validate_email_with_name value<block_start>""" Validate email a...
""" Determine the number of bits required to convert integer A to integer B Example Given n = 31, m = 14,return 2 (31)10=(11111)2 (14)10=(01110)2 """<line_sep>__author__='Danyang'<class_stmt>Solution<block_start><def_stmt>bitSwapRequired self a b<block_start>""" :param a: :param b: :return: ...
<import_stmt>contextlib<import_stmt>logging<import_stmt>typing<import_from_stmt>typing Any Dict Tuple<import_stmt>attr<import_from_stmt>dbnd._core.configuration get_dbnd_project_config<import_from_stmt>dbnd._core.constants RESULT_PARAM DbndTargetOperationStatus DbndTargetOperationType TaskRunState <import_from_stmt>dbn...
<import_stmt>nose<import_stmt>angr<import_stmt>logging<line_sep>l=logging.getLogger("angr.tests.test_bindiff")<import_stmt>os<line_sep>test_location=os.path.join(os.path.dirname(os.path.realpath(__file__)) '..' '..' 'binaries' 'tests')<line_sep># todo make a better test <def_stmt>test_bindiff_x86_64 <block_start>binary...
""" Warning - this will reset all components back to a blank state before running the simulation Runs node1, electrumx1 and electrumsv1 and loads the default wallet on the daemon (so that newly submitted blocks will be synchronized by ElectrumSV reorged txid: 'a1fa9460ca105c1396cd338f7fa202bf79a9d244d730e91e19f6302a0...
<import_stmt>torch<import_stmt>torch.overrides<import_stmt>linecache<import_from_stmt>typing Type Dict List Any Union<import_from_stmt>.graph Graph<import_stmt>copy<line_sep># normal exec loses the source code, however we can patch # the linecache module to still recover it. # using exec_with_source will add it to our ...
<import_from_stmt>hover.utils.metrics classification_accuracy<import_stmt>numpy<as>np<def_stmt>test_classification_accuracy <block_start>true=np.array([1 2 3 4 5 6 7 7])<line_sep>pred=np.array([1 2 3 4 5 6 7 8])<line_sep>accl=classification_accuracy(true pred)<line_sep>accr=classification_accuracy(pred true)<assert_stm...
''' Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. This script tests arbitrary payload of the RackHD API 2.0 OS bootstrap workflows. The default case is running a minimum payload Windows OS install. Other Windows-type OS install cases can be specified by creating a payload file and specifiying it u...
# Copyright 2015 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...
# # This file is part of LiteX-Boards. # # Copyright (c) 2017-2019 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause <import_from_stmt>litex.build.generic_platform *<import_from_stmt>litex.build.xilinx XilinxPlatform VivadoProgrammer<line_sep># IOs ----------------------------------------------------------------...
<import_stmt>pytest<import_stmt>numpy<as>np<import_stmt>pandas<as>pd<import_stmt>matplotlib.pyplot<as>plt<import_stmt>itertools<import_from_stmt>sklearn.datasets make_regression make_blobs load_digits fetch_openml load_diabetes <import_from_stmt>sklearn.preprocessing KBinsDiscretizer<import_from_stmt>dabl.preprocessing...
<import_from_stmt>._ffi.base string_types<import_from_stmt>._ffi.object register_object Object<import_from_stmt>._ffi.node register_node NodeBase<import_from_stmt>._ffi.node convert_to_node<as>_convert_to_node<import_from_stmt>._ffi.node_generic _scalar_type_inference<import_from_stmt>._ffi.function Function<import_fro...
<import_stmt>copy<import_stmt>torch<import_from_stmt>..attack Attack<class_stmt>MultiAttack(Attack)<block_start>r""" MultiAttack is a class to attack a model with various attacks agains same images and labels. Arguments: model (nn.Module): model to attack. attacks (list): list of attacks. ...
<import_stmt>torch<import_stmt>torch.nn<as>nn<import_stmt>os<import_stmt>torch.nn.functional<as>F<class_stmt>LDS(nn.Module)<block_start><def_stmt>__init__ self <block_start>super(LDS self).__init__()<line_sep>self.pool1=nn.MaxPool2d(kernel_size=(2 2) stride=2 padding=0)<line_sep>self.pool2=nn.MaxPool2d(kernel_size=(2 2...
{'targets':[{'target_name':'hiredis' 'sources':['src/hiredis.cc' 'src/reader.cc'] 'include_dirs':["<!(node -e \"require('nan')\")"] 'dependencies':['deps/hiredis.gyp:hiredis-c'] 'defines':['_GNU_SOURCE'] 'cflags':['-Wall' '-O3']}]}<line_sep>
<import_stmt>os<import_from_stmt>conans ConanFile tools<import_from_stmt>conans.errors ConanInvalidConfiguration<class_stmt>CxxOptsConan(ConanFile)<block_start>name="cxxopts"<line_sep>homepage="https://github.com/jarro2783/cxxopts"<line_sep>url="https://github.com/conan-io/conan-center-index"<line_sep>description="Ligh...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. <import_stmt>torch<import_from_stmt>.active_rotating_filter active_rotating_filter<import_from_stmt>.active_rotating_filter ActiveRotatingFilter<import_from_stmt>.rotation_invariant_encoding rotation_invariant_encoding<import_from_stmt>.rotation_in...
__author__='<NAME>'<import_from_stmt>setuptools setup<line_sep>setup(name="einops" version='0.3.2' description="A new flavour of deep learning operations" long_description=open('README.md' encoding='utf-8').read() long_description_content_type='text/markdown' url='https://github.com/arogozhnikov/einops' author='<NAME>'...
# Copyright (c) 2020, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow...
<import_from_stmt>django.contrib admin<import_from_stmt>django.contrib.auth.admin UserAdmin<import_from_stmt>.models CustomUser<line_sep>admin.site.register(CustomUser UserAdmin)<line_sep>
<import_stmt>copy<import_stmt>os<import_stmt>re<import_stmt>string<import_stmt>sys<import_stmt>warnings<import_from_stmt>contextlib contextmanager<import_from_stmt>enum Enum<import_from_stmt>textwrap dedent<import_from_stmt>typing Any Dict Iterator List Optional Tuple Type Union get_type_hints <import_stmt>yaml<import_...
<import_stmt>unittest<import_from_stmt>test support<import_stmt>base64<import_stmt>binascii<import_stmt>os<import_stmt>sys<import_stmt>subprocess<class_stmt>LegacyBase64TestCase(unittest.TestCase)<block_start><def_stmt>test_encodebytes self<block_start>eq=self.assertEqual<line_sep>eq(base64.encodebytes(b"www.python.org...
<import_stmt>numpy<as>np<import_from_stmt>sklearn metrics<import_from_stmt>neupy algorithms<import_from_stmt>base BaseTestCase<class_stmt>CMACTestCase(BaseTestCase)<block_start><def_stmt>test_cmac self<block_start>X_train=np.reshape(np.linspace(0 2<times>np.pi 100) (100 1))<line_sep>X_train_before=X_train.copy()<line_s...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-25 22:22 <import_from_future_stmt> unicode_literals<import_from_stmt>django.db migrations models<import_stmt>django.db.models.deletion<import_stmt>django.utils.timezone<import_stmt>django_smalluuid.models<class_stmt>Migration(migrations.Migration)<block_st...
<import_stmt>asyncio<import_stmt>uuid<import_stmt>pytest<import_from_stmt>aiomisc_pytest.pytest_plugin TCPProxy<import_stmt>aiormq<async_keyword><def_stmt>test_simple amqp_channel:aiormq.Channel<block_start><await>amqp_channel.basic_qos(prefetch_count=1)<assert_stmt>amqp_channel.number<line_sep>queue=asyncio.Queue()<li...
# -*- coding: utf-8 -*- """Parser for the CCleaner Registry key."""<import_stmt>re<import_from_stmt>dfdatetime time_elements<as>dfdatetime_time_elements<import_from_stmt>plaso.containers events<import_from_stmt>plaso.containers time_events<import_from_stmt>plaso.lib definitions<import_from_stmt>plaso.parsers winreg_par...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
# tests/test_provider_Mongey_kafka-connect.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:20:11 UTC) <def_stmt>test_provider_import <block_start><import_stmt>terrascript.provider.Mongey.kafka_connect<block_end><def_stmt>test_resource_import <block_start><import_from_stmt>terrascript.resource.Mongey.k...
# -*- encoding: utf-8 -*- <import_stmt>json<import_stmt>os<import_stmt>shutil<import_stmt>tempfile<import_from_stmt>collections OrderedDict<import_from_stmt>datetime timedelta<import_from_stmt>pyparsing ParseBaseException ParseException ParseSyntaxException<import_stmt>mock<import_stmt>pytest<import_from_stmt>pyhocon C...
<import_stmt>mock<import_stmt>pytest<import_stmt>py_zipkin.storage<line_sep>@pytest.fixture(autouse=<true> scope="module")<def_stmt>create_zipkin_attrs # The following tests all expect _thread_local.zipkin_attrs to exist: if it # doesn't, mock.patch will fail. <block_start>py_zipkin.storage.ThreadLocalStack().get()<blo...
<import_from_stmt>desktop_local_tests.local_packet_capture_test_case_with_disrupter LocalPacketCaptureTestCaseWithDisrupter<import_from_stmt>desktop_local_tests.windows.windows_dns_force_public_dns_servers_disrupter WindowsDNSForcePublicDNSServersDisrupter<class_stmt>TestWindowsPacketCaptureDisruptForcePublicDNSServers...
"""Lighting channels module for Zigbee Home Automation."""<import_from_future_stmt> annotations<import_from_stmt>contextlib suppress<import_from_stmt>zigpy.zcl.clusters lighting<import_from_stmt>.. registries<import_from_stmt>..const REPORT_CONFIG_DEFAULT<import_from_stmt>.base ClientChannel ZigbeeChannel<line_sep>@reg...
<import_from_stmt>querybuilder.fields RankField RowNumberField DenseRankField PercentRankField CumeDistField NTileField LagField LeadField FirstValueField LastValueField NthValueField NumStdDevField <import_from_stmt>querybuilder.query QueryWindow Query<import_from_stmt>querybuilder.tests.models Order<import_from_stmt>...
<import_from_stmt>datetime timedelta<import_from_stmt>dateutil.relativedelta relativedelta<import_from_stmt>django.core.management.base BaseCommand CommandError<import_from_stmt>django.utils timezone<import_from_stmt>...models Request<line_sep>DURATION_OPTIONS={'hours':<lambda>amount:timezone.now()-timedelta(hours=amou...
<def_stmt>getRoot config<block_start><if_stmt><not>config.parent<block_start><return>config<block_end><return>getRoot(config.parent)<block_end>root=getRoot(config)<line_sep># We only run a small set of tests on Windows for now. # Override the parent directory's "unsupported" decision until we can handle # all of its te...
# Copyright (c) 2014-present PlatformIO <<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 ag...
<import_stmt>pyredner<import_stmt>numpy<as>np<import_stmt>torch<line_sep>cam=pyredner.Camera(position=torch.tensor([0.0 0.0 -5.0]) look_at=torch.tensor([0.0 0.0 0.0]) up=torch.tensor([0.0 1.0 0.0]) fov=torch.tensor([45.0]) # in degree clip_near=1e-2 # needs to > 0 resolution=(256 256) fisheye=<false>)<line_sep>mat_grey...
########################################################################## # # Copyright (c) 2011, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
"""Types for the Todoist component."""<import_from_future_stmt> annotations<import_from_stmt>typing TypedDict<class_stmt>DueDate(TypedDict)<block_start>"""Dict representing a due date in a todoist api response."""<line_sep>date:str<line_sep>is_recurring:bool<line_sep>lang:str<line_sep>string:str<line_sep>timezone:str|<...
<import_from_stmt>abc ABC abstractmethod<import_from_stmt>contextlib contextmanager<import_from_stmt>uuid uuid4<import_stmt>pytest<import_from_stmt>sqlalchemy delete select UniqueConstraint <class_stmt>AbstractBaseTest(ABC)<block_start>@pytest.fixture<def_stmt>cls_ self<block_start>""" Return class under test. ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
"""Various utility functions. .. todo:: Reorganize this package in a more meaningful way. """<import_from_future_stmt> print_function<import_from_future_stmt> absolute_import<line_sep># from builtins import str # from builtins import range <import_stmt>torch<import_from_stmt>torch.nn.parameter Parameter<import_fro...
<import_stmt>getopt<import_stmt>sys<line_sep>comment=('#'+sys.argv[1]).encode()<line_sep>opts,args=getopt.getopt(sys.argv[2:] 'cf:o:xy')<line_sep>optstring=''<line_sep>length=len(comment)<for_stmt>opt,arg opts<block_start><if_stmt>opt<eq>'-o'<block_start>out=arg<block_end><elif_stmt>opt<not><in>('-f' '-K')<block_start>...
# # For licensing see accompanying LICENSE file. # Copyright (C) 2022 Apple Inc. All Rights Reserved. # <import_from_stmt>torch.nn functional<as>F<import_from_stmt>torch Tensor<import_stmt>argparse<import_from_stmt>. register_classification_loss_fn<import_from_stmt>.. BaseCriteria<line_sep>@register_classification_loss...
# Submit a function to be run either locally or in a computing cluster. # Compared to original StyleGAN implementation, we extend the support for automatic training resumption, # and network recompilation. <import_stmt>copy<import_stmt>inspect<import_stmt>os<import_stmt>pathlib<import_stmt>pickle<import_stmt>platform<i...
df8.cbind(df9)<line_sep># A B C D A0 B0 C0 D0 # ----- ------ ------ ------ ------ ----- ----- ----- # -0.09 0.944 0.160 0.271 -0.351 1.66 -2.32 -0.86 # -0.95 0.669 0.664 1.535 -0.633 -1.78 0.32 1.27 # 0.17 0.657 0.970 -0.419 -1.413 -0.51 0.64 -1.25 # 0.58 -0.516 -1.598 -1.3...
# -*- coding: utf-8 -*- """ Microsoft-Windows-IPxlatCfg GUID : 3e5ac668-af52-4c15-b99b-a3e7a6616ebd """<import_from_stmt>construct Int8sl Int8ul Int16ul Int16sl Int32sl Int32ul Int64sl Int64ul Bytes Double Float32l Struct<import_from_stmt>etl.utils WString CString SystemTime Guid<import_from_stmt>etl.dtyp Sid<import_fr...
# CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }} const=<lambda>x y:x<line_sep>y=const(<true> <true>)<line_sep>z=const(<false> <false>)<line_sep>
<import_from_stmt>distutils.core setup Extension<line_sep>setup(name='qconf_py' version='1.2.2' ext_modules=[Extension('qconf_py' ['lib/python_qconf.cc'] include_dirs=['/usr/local/include/qconf'] extra_objects=['/usr/local/qconf/lib/libqconf.a'])])<line_sep>
# log_battery.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Wed, Sep 1, 2021 5:05:45 PM """Example to continuously read the battery (with no Wifi connection)"""<import_stmt>csv<import_stmt>time<import_stmt>logging<import_stmt>argparse<im...
""" neo.io have been split in 2 level API: * neo.io: this API give neo object * neo.rawio: this API give raw data as they are in files. Developper are encourage to use neo.rawio. When this is done the neo.io is done automagically with this king of following code. Author: sgarcia """<import_from_stmt>neo.io.base...
# -*- coding: utf-8 -*- <import_from_future_stmt> unicode_literals<import_from_stmt>django.db migrations models<class_stmt>Migration(migrations.Migration)<block_start>dependencies=[('scrapyproject' '0002_auto_20170208_1738') ]<line_sep>operations=[migrations.AlterField(model_name='project' name='link_generator' field=m...
<import_stmt>re<import_stmt>discord<import_from_stmt>redbot.core commands<class_stmt>Covfefe(commands.Cog)<block_start>""" Convert almost any word into covfefe """<def_stmt>__init__ self bot<block_start>self.bot=bot<block_end><async_keyword><def_stmt>covfefe self x k="aeiouy])"<block_start>""" https://c...
<import_stmt>numpy<as>np<import_from_stmt>gym.spaces Box<import_from_stmt>metaworld.envs reward_utils<import_from_stmt>metaworld.envs.asset_path_utils full_v2_path_for<import_from_stmt>metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env SawyerXYZEnv _assert_task_is_set<class_stmt>SawyerDialTurnEnvV2(SawyerXYZEnv)<block_sta...
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 <import_stmt>numpy<as>np<import_from_stmt>openvino.tools.mo.front.common.partial_infer.utils dynamic_dimension_value shape_array set_input_shapes<import_from_stmt>openvino.tools.mo.ops.op Op<class_stmt>ExperimentalDetectronDetectionOutput...
<import_from_stmt>.torch2onnx torch2onnx<import_from_stmt>.onnx2trt onnx2trt<import_from_stmt>.torch2trt torch2trt<import_from_stmt>.base load save<line_sep>
<import_stmt>FWCore.ParameterSet.Config<as>cms<line_sep>process=cms.Process("LIKELIHOODPDFDBREADER")<line_sep># process.load("MuonAnalysis.MomentumScaleCalibration.local_CSA08_Y_cff") process.source=cms.Source("EmptySource" numberEventsInRun=cms.untracked.uint32(1) firstRun=cms.untracked.uint32(1))<line_sep>process.loa...
<import_stmt>torch.utils.data<as>data<import_from_stmt>PIL Image<import_stmt>os<import_stmt>os.path<import_stmt>numpy<as>np<import_stmt>pdb<import_stmt>glob<line_sep>IMG_EXTENSIONS=['.jpg' '.JPG' '.jpeg' '.JPEG' '.png' '.PNG' '.ppm' '.PPM' '.bmp' '.BMP' ]<def_stmt>is_image_file filename<block_start><return>any(filename...
<import_stmt>re<import_from_stmt>curtsies.formatstring fmtstr FmtStr<import_from_stmt>curtsies.termformatconstants FG_COLORS BG_COLORS colors<as>CURTSIES_COLORS <import_from_stmt>functools partial<import_from_stmt>..lazyre LazyReCompile<line_sep>COLORS=CURTSIES_COLORS+("default" )<line_sep>CNAMES=dict(zip("krgybmcwd" C...
<import_from_stmt>..imports *<import_from_stmt>.. utils<as>U<import_from_stmt>..core GenLearner<class_stmt>NodeClassLearner(GenLearner)<block_start>""" ``` Main class used to tune and train Keras models for node classification Main parameters are: model (Model): A compiled instance of keras.engine.trai...
<import_from_stmt>collections defaultdict<import_stmt>json<import_stmt>re<import_stmt>time<import_from_stmt>urllib.parse urlparse<import_stmt>uuid<import_stmt>boto3<import_stmt>boto3.exceptions<import_stmt>botocore.exceptions<import_stmt>markus<import_stmt>redis.exceptions<import_stmt>requests<import_stmt>requests.exce...
<import_stmt>hugectr<import_from_stmt>mpi4py MPI<line_sep>solver=hugectr.CreateSolver(model_name="dcn" max_eval_batches=1 batchsize_eval=16384 batchsize=16384 lr=0.001 vvgpu=[[0]] repeat_dataset=<true> use_mixed_precision=<false> scaler=1.0 use_cuda_graph=<true> metrics_spec={hugectr.MetricsType.AUC:1.0})<line_sep>read...
''' pymmh3 was written by <NAME> and enhanced by <NAME>, and is placed in the public domain. The authors hereby disclaim copyright to this source code. pure python implementation of the murmur3 hash algorithm https://code.google.com/p/smhasher/wiki/MurmurHash3 This was written for the times when you do not want to c...
<import_stmt>pytest<import_from_stmt>httmock urlmatch HTTMock<import_from_stmt>util.config URLSchemeAndHostname<import_from_stmt>util.config.validator ValidatorContext<import_from_stmt>util.config.validators ConfigValidationException<import_from_stmt>util.config.validators.validate_bitbucket_trigger BitbucketTriggerVal...
<import_from_stmt>typing List Tuple<import_from_stmt>omegaconf DictConfig<import_stmt>torch<import_stmt>torch.nn<as>nn<import_stmt>torch.nn.functional<as>F<import_from_stmt>rlcycle.common.abstract.loss Loss<class_stmt>DQNLoss(Loss)<block_start>"""Compute double DQN loss"""<def_stmt>__init__ self hyper_params:DictConfig...
# -*- coding: utf8 -*- # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. <import_stmt>os<import_stmt>platform<import_stmt>time<import_stmt>pytest<import_stmt>zmq<import_from_stmt>zmq.tests BaseZMQTestCase skip_pypy<class_stmt>TestDraftSockets(BaseZMQTestCase)<block_start><def_s...
# -*- coding: utf-8 -*- <import_from_stmt>django.conf.urls.defaults patterns url<import_from_stmt>django_qbe.exports formats<line_sep>urlpatterns=patterns('django_qbe.views' url(r'^$' 'qbe_form' name="qbe_form") url(r'^js/$' 'qbe_js' name="qbe_js") url(r'^results/bookmark/$' 'qbe_bookmark' name="qbe_bookmark") url(r'^r...
# -*- coding:utf-8 -*- # Author: RubanSeven # import cv2 <import_stmt>numpy<as>np<line_sep># from transform import get_perspective_transform, warp_perspective <import_from_stmt>warp_mls WarpMLS<def_stmt>distort src segment<block_start>img_h,img_w=src.shape[:2]<line_sep>cut=img_w<floordiv>segment<line_sep>thresh=cut...
<import_from_stmt>devito.ir Call<import_from_stmt>devito.passes.iet.definitions DataManager<import_from_stmt>devito.passes.iet.langbase LangBB<line_sep>__all__=['CBB' 'CDataManager']<class_stmt>CBB(LangBB)<block_start>mapper={'aligned':<lambda>i:'__attribute__((aligned(%d)))'%i 'host-alloc':<lambda>i j k:Call('posix_me...
# PyTorch <import_stmt>torch<import_from_stmt>torch.utils.data IterableDataset DataLoader<import_from_stmt>donkeycar.utils train_test_split<import_from_stmt>donkeycar.parts.tub_v2 Tub<import_from_stmt>torchvision transforms<import_from_stmt>typing List Any<import_from_stmt>donkeycar.pipeline.types TubRecord TubDataset<...
<import_from_stmt>robot __version__<as>ROBOT_VERSION<import_stmt>sys<import_stmt>tempfile<import_stmt>textwrap<import_stmt>unittest<import_stmt>shutil<import_stmt>subprocess<class_stmt>PabotOrderingGroupTest(unittest.TestCase)<block_start><def_stmt>setUp self<block_start>self.tmpdir=tempfile.mkdtemp()<block_end><def_st...
<import_stmt>torch<line_sep>ckp_path='./checkpoints/fashion_PATN/latest_net_netG.pth'<line_sep>save_path='./checkpoints/fashion_PATN_v1.0/latest_net_netG.pth'<line_sep>states_dict=torch.load(ckp_path)<line_sep>states_dict_new=states_dict.copy()<for_stmt>key states_dict.keys()<block_start><if_stmt>"running_var"<in>key<o...
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - StackStorm, Inc. # Copyright 2015 - Huawei Technologies Co. Ltd # # 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:/...
<import_stmt>json<import_from_stmt>wptserve.utils isomorphic_decode<def_stmt>main request response<block_start>origin=request.GET.first(b"origin" request.headers.get(b'origin')<or>b'none')<if_stmt>b"check"<in>request.GET<block_start>token=request.GET.first(b"token")<line_sep>value=request.server.stash.take(token)<if_st...
"""Implementation of Rule L024."""<import_from_stmt>sqlfluff.core.rules.doc_decorators document_fix_compatible<import_from_stmt>sqlfluff.rules.L023 Rule_L023<line_sep>@document_fix_compatible<class_stmt>Rule_L024(Rule_L023)<block_start>"""Single whitespace expected after USING in JOIN clause. | **Anti-pattern** ...
<import_from_stmt>matplotlib.colors LinearSegmentedColormap<import_from_stmt>numpy nan inf<line_sep># Used to reconstruct the colormap in viscm parameters={'xp':[-5.4895292543686764 14.790571669586654 82.5546687431056 29.15531114139253 -4.1316769886951761 -13.002076438907238] 'yp':[-35.948168839230306 -42.2733761598857...
"""Test the Airthings config flow."""<import_from_stmt>unittest.mock patch<import_stmt>airthings<import_from_stmt>homeassistant config_entries<import_from_stmt>homeassistant.components.airthings.const CONF_ID CONF_SECRET DOMAIN<import_from_stmt>homeassistant.core HomeAssistant<import_from_stmt>homeassistant.data_entry_...
# 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 (c) 2022, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause <import_stmt>os<import_stmt>re<import_stmt>time<import_stmt>random<import_stmt>argparse<import_stmt>tor...
<import_stmt>argparse<import_stmt>warnings<line_sep>warnings.simplefilter("ignore" UserWarning)<import_stmt>files<import_from_stmt>tensorboardX SummaryWriter<import_stmt>os<import_stmt>numpy<as>np<import_stmt>time<import_stmt>torch<import_stmt>torch.optim<import_stmt>torch.nn<as>nn<import_stmt>torch.utils.data<import_s...
<import_stmt>pathlib<import_stmt>yaml<line_sep>documentations={"Our Platform":"QuantConnect-Platform-2.0.0.yaml" "Alpha Streams":"QuantConnect-Alpha-0.8.yaml"}<def_stmt>RequestTable api_call params<block_start>writeUp='<table class="table qc-table">\n<thead>\n<tr>\n'<line_sep>writeUp<augadd>f'<th colspan="2"><code>{api...
<import_stmt>logging<import_stmt>os<import_stmt>re<import_stmt>uuid<import_from_stmt>pathlib Path<import_from_stmt>ludwig.constants CHECKSUM META TEST TRAINING VALIDATION<import_from_stmt>ludwig.data.cache.util calculate_checksum<import_from_stmt>ludwig.utils data_utils<import_from_stmt>ludwig.utils.fs_utils delete pat...
<import_from_stmt>guillotina.contrib.workflows.interfaces IWorkflowChangedEvent<import_from_stmt>guillotina.events ObjectEvent<import_from_stmt>zope.interface implementer<line_sep>@implementer(IWorkflowChangedEvent)<class_stmt>WorkflowChangedEvent(ObjectEvent)<block_start>"""An object has been moved"""<def_stmt>__init_...
# Copyright 2016 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_from_stmt>common.chrome_proxy_shared_page_state ChromeProxySharedPageState<import_from_stmt>telemetry.page page<as>page_module<import_from_stmt>teleme...
<import_from_stmt>django.db.models.fields.files FieldFile ImageField ImageFileDescriptor <import_from_stmt>django.utils.translation ugettext<as>_<import_from_stmt>.backends get_backend_class<import_from_stmt>.files VideoFile<class_stmt>VideoFileDescriptor(ImageFileDescriptor)<block_start><pass><block_end><class_stmt>Vi...
""" Copyright (c) 2020 COTOBA DESIGN, Inc. 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, modify, merge, publish, distri...
"""\ Code generator functions for wxDatePickerCtrl objects @copyright: 2002-2007 <NAME> @copyright: 2014-2016 <NAME> @copyright: 2016-2021 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """<import_stmt>common compat<import_stmt>wcodegen<class_stmt>PythonDatePickerCtrlGenerator(wcodegen.Py...
<import_stmt>os<import_stmt>sys<import_stmt>unittest<import_from_stmt>tests.tests_bin_class.test_performance *<if_stmt>__name__<eq>"__main__"<block_start>unittest.main()<block_end>
<import_stmt>unittest<import_stmt>pytest<import_from_stmt>small_text.integrations.pytorch.exceptions PytorchNotFoundError<try_stmt><block_start><import_from_stmt>small_text.integrations.pytorch.query_strategies BADGE ExpectedGradientLength ExpectedGradientLengthMaxWord <block_end><except_stmt>PytorchNotFoundError<block...
TANGO_PALLETE=['2e2e34343636' 'cccc00000000' '4e4e9a9a0606' 'c4c4a0a00000' '34346565a4a4' '757550507b7b' '060698989a9a' 'd3d3d7d7cfcf' '555557575353' 'efef29292929' '8a8ae2e23434' 'fcfce9e94f4f' '72729f9fcfcf' 'adad7f7fa8a8' '3434e2e2e2e2' 'eeeeeeeeecec' ]<def_stmt>parse_tango_color c<block_start>r=int(c[:4][:2] 16)<li...
<import_from_stmt>mongoengine Document<import_from_stmt>mongoengine.fields FloatField StringField ListField URLField ObjectIdField <class_stmt>Shop(Document)<block_start>meta={"collection":"shop"}<line_sep>ID=ObjectIdField()<line_sep>name=StringField()<line_sep>address=StringField()<line_sep>website=URLField()<block_en...
<import_from_stmt>..charts Chart<import_from_stmt>flask jsonify request<line_sep>_BASE_CONFIG={"showLink":<false> "displaylogo":<false> "modeBarButtonsToRemove":["sendDataToCloud"]}<class_stmt>PlotlyAPI(Chart)<block_start>""" Base class for Plotly.js API This class is used to create charts using the plotly.js ...
<import_from_stmt>.functions.deform_conv deform_conv modulated_deform_conv<import_from_stmt>.functions.deform_pool deform_roi_pooling<import_from_stmt>.modules.deform_conv DeformConv ModulatedDeformConv DeformConvPack ModulatedDeformConvPack <import_from_stmt>.modules.deform_pool DeformRoIPooling DeformRoIPoolingPack M...
<def_stmt>gen <block_start>i=0<while_stmt>1<block_start><yield>i<line_sep>i<augadd>1<block_end><block_end>g=gen()<try_stmt><block_start>g.pend_throw<block_end><except_stmt>AttributeError<block_start>print("SKIP")<line_sep><raise>SystemExit<block_end>print(next(g))<line_sep>print(next(g))<line_sep>g.pend_throw(ValueErro...
<import_stmt>math<import_stmt>numpy<as>np<import_stmt>numpy.random<as>npr<import_stmt>torch<import_stmt>torch.utils.data<as>data<import_stmt>torch.utils.data.sampler<as>torch_sampler<import_from_stmt>torch.utils.data.dataloader default_collate<import_from_stmt>torch._six int_classes<as>_int_classes<import_from_stmt>cor...
# -------------------------------------------------------------------------- # # OpenSim Moco: examplePredictAndTrack.py # # -------------------------------------------------------------------------- # # Copyright (c) 2018 Stanford University and the Authors # # ...