content
stringlengths
0
1.55M
""" test_markup ~~~~~~~~~~~ Test various Sphinx-specific markup extensions. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """<import_stmt>re<import_stmt>pytest<import_from_stmt>docutils frontend nodes utils<import_from_stmt>docutils.parser...
# sql/default_comparator.py # Copyright (C) 2005-2018 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Default implementation of SQL comparison operations. """<import_from_stm...
# The MIT License (MIT) # # Copyright (c) 2020 <NAME> for Adafruit Industries LLC # # 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 right...
<import_stmt>pytest<import_from_stmt>pathlib Path<import_from_stmt>blendtorch btt<line_sep>BLENDDIR=Path(__file__).parent/'blender'<class_stmt>MyEnv(btt.env.OpenAIRemoteEnv)<block_start><def_stmt>__init__ self background=<true> **kwargs<block_start>super().__init__(version='1.0.0')<line_sep>self.launch(scene=BLENDDIR/'...
<import_stmt>imp<import_stmt>torch<import_stmt>torch.nn<as>nn<import_stmt>numpy<as>np<import_stmt>torch.nn.functional<as>F<import_from_stmt>pytorch_ares.attack_torch.utils loss_adv<class_stmt>MIM(object)<block_start>'''Projected Gradient Descent'''<def_stmt>__init__ self net epsilon p stepsize steps decay_factor data_n...
''' The randomization defense method, which applies random . '''<import_stmt>tensorflow<as>tf<import_from_stmt>ares.defense.input_transformation input_transformation<def_stmt>randomize xs scale_min=0.875 pad_value=0.0<block_start>''' Apply random rescaling and padding to xs. :param xs: A batch of inputs for some c...
################################################################################ # Copyright (c) 2015-2018 Skymind, Inc. # # This program and the accompanying materials are made available under the # terms of the Apache License, Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0. # # Unless...
<import_stmt>numpy<as>np<import_stmt>scipy<as>sp<import_stmt>scipy.sparse.linalg<as>splinalg<def_stmt>eig2_nL g tol_eigs=1.0e-6 normalize:bool=<true> dim:int=1<block_start>""" DESCRIPTION ----------- Computes the eigenvector that corresponds to the second smallest eigenvalue of the normaliz...
# Copyright (C) 2015-2021 Regents of the University of California # # 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 app...
<import_from_stmt>.gripper_model GripperModel<import_from_stmt>.gripper_factory gripper_factory<import_from_stmt>.gripper_tester GripperTester<import_from_stmt>.panda_gripper PandaGripper<import_from_stmt>.rethink_gripper RethinkGripper<import_from_stmt>.robotiq_85_gripper Robotiq85Gripper<import_from_stmt>.robotiq_thr...
# Copyright (c) 2014, Fundacion Dr. <NAME> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and t...
"""用户, 组, 及相关认证数据库模型"""<import_from_stmt>.group Group<import_from_stmt>.user User<import_from_stmt>.user UserIndex<import_from_stmt>.auth Authentication<import_from_stmt>.accesspoint AccessPoint<line_sep>
<import_stmt>json<import_stmt>os<import_stmt>responses<import_from_stmt>django.urls reverse<import_from_stmt>.. TestAdminMixin TestLociMixin<class_stmt>BaseTestAdmin(TestAdminMixin TestLociMixin)<block_start>geocode_url='https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/'<def_stmt>test_location_list s...
<import_from_stmt>django.core.exceptions NON_FIELD_ERRORS<import_from_stmt>rest_framework status viewsets serializers<import_from_stmt>rest_framework.decorators list_route<import_from_stmt>rest_framework.response Response<import_from_stmt>rest_framework.serializers ModelSerializer<import_from_stmt>jet_django.filters.mo...
<import_from_stmt>openems.openems *<line_sep># A simple simulation # # FDTD Simulation Setting # F=FDTD()<line_sep>F.add(Exc(typ='Sinus' f0=100000))<line_sep>F.add(BoundaryCond(['PMC' 'PMC' 'PEC' 'PEC' 'MUR' 'MUR']))<line_sep># # CSX (Geometry setting) # C=CSX()<line_sep># The Box is added as a property C.add(Excitati...
<import_stmt>clr<line_sep>clr.AddReference('RevitAPI')<import_from_stmt>Autodesk.Revit.DB *<def_stmt>GetViewTemplate view<block_start><if_stmt><not>view<block_start><return><none><block_end><elif_stmt>hasattr(view "ViewTemplateId")<block_start><if_stmt>view.ViewTemplateId.IntegerValue<eq>-1<block_start><return><none><b...
<import_stmt>numpy<as>np<import_from_stmt>igibson.external.pybullet_tools.utils aabb_union get_aabb get_all_links<import_from_stmt>igibson.object_states.object_state_base CachingEnabledObjectState<class_stmt>AABB(CachingEnabledObjectState)<block_start><def_stmt>_compute_value self<block_start>body_id=self.obj.get_body_...
#-*- coding:utf-8 -*- # &Author AnFany # 引入方法 <import_stmt>Kmeans_AnFany<as>K_Af# AnFany <import_stmt>Kmeans_Sklearn<as>K_Sk# Sklearn <import_stmt>matplotlib.pyplot<as>plt<import_from_stmt>pylab mpl# 作图显示中文 mpl.rcParams['font.sans-serif']=['FangSong']# 设置中文字体新宋体 mpl.rcParams['axes.unicode_minus']=<false><import...
# ***************************************************************************** # Copyright (c) 2020, Intel Corporation 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 sou...
<import_stmt>FWCore.ParameterSet.Config<as>cms<import_from_stmt>DQMServices.Core.DQMEDHarvester DQMEDHarvester<line_sep>l1EmulatorErrorFlagClient=DQMEDHarvester("L1EmulatorErrorFlagClient" # # for each L1 system, give: # - SystemLabel: system label # - HwValLabel: system label as used in hardware validation ...
<def_stmt>main <block_start>n=111<line_sep>gen=(n<times>7<for>x range(10))<if_stmt>777<in>gen<block_start>print("Yes!")<block_end><block_end><if_stmt>__name__<eq>'__main__'<block_start>main()<block_end>
<import_from_stmt>.banks callback_view go_to_bank_gateway<import_from_stmt>.samples sample_payment_view sample_result_view<line_sep>
<import_stmt>sys<class_stmt>RPCType(object)<block_start>CloseRPC=0<line_sep>DetachRPC=1<line_sep>AddWindowRPC=2<line_sep>DeleteWindowRPC=3<line_sep>SetWindowLayoutRPC=4<line_sep>SetActiveWindowRPC=5<line_sep>ClearWindowRPC=6<line_sep>ClearAllWindowsRPC=7<line_sep>OpenDatabaseRPC=8<line_sep>CloseDatabaseRPC=9<line_sep>A...
<import_stmt>abc<import_from_stmt>typing Dict Callable<import_stmt>tensorflow<as>tf<import_from_stmt>flink_ml_framework.context Context<import_from_stmt>flink_ml_framework.java_file *<import_from_stmt>..runner tf_helper io_helper<import_from_stmt>..runner.output_writer DirectOutputWriter<try_stmt><block_start><import_f...
# All credit to https://stackoverflow.com/questions/46571448/tkinter-and-a-html-file - thanks DELICA - https://stackoverflow.com/users/7027346/delica <import_from_stmt>cefpython3 cefpython<as>cef<import_stmt>ctypes<try_stmt><block_start><import_stmt>tkinter<as>tk<import_from_stmt>tkinter messagebox<block_end><except_st...
# 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 writing, software # ...
<import_stmt>os<import_stmt>glob<import_stmt>cv2<import_stmt>numpy<as>np<import_stmt>torch<import_from_stmt>torchvision.transforms transforms<import_from_stmt>natsort natsorted<import_from_stmt>models resmasking_dropout1<import_from_stmt>utils.datasets.fer2013dataset EMOTION_DICT<import_from_stmt>barez show<line_sep>tr...
""" wrapper for ccmake command line tool """<import_stmt>subprocess<line_sep>name='ccmake'<line_sep>platforms=['linux' 'osx']<line_sep>optional=<true><line_sep>not_found="required for 'fips config' functionality"<line_sep>#------------------------------------------------------------------------------- <def_stmt>check_e...
# # 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 writing, software # ...
<import_from_stmt>sys version_info<if_stmt>version_info[0]<le>2<and>version_info[1]<le>4<block_start><def_stmt>all iterable<block_start><for_stmt>element iterable<block_start><if_stmt><not>element<block_start><return><false><block_end><block_end><return><true><block_end><block_end><else_stmt><block_start>all=all<block_...
# 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...
""" The constants used in FLV files and their meanings. """<line_sep># Tag type (TAG_TYPE_AUDIO TAG_TYPE_VIDEO TAG_TYPE_SCRIPT)=(8 9 18)<line_sep># Sound format (SOUND_FORMAT_PCM_PLATFORM_ENDIAN SOUND_FORMAT_ADPCM SOUND_FORMAT_MP3 SOUND_FORMAT_PCM_LITTLE_ENDIAN SOUND_FORMAT_NELLYMOSER_16KHZ SOUND_FORMAT_NELLYMOSER_8KHZ...
# - Generated by tools/entrypoint_compiler.py: do not edit by hand """ Trainers.LightGbmBinaryClassifier """<import_stmt>numbers<import_from_stmt>..utils.entrypoints EntryPoint<import_from_stmt>..utils.utils try_set unlist<def_stmt>trainers_lightgbmbinaryclassifier training_data predictor_model=<none> number_of_iterati...
# -*- coding: utf-8 -*- <import_from_stmt>gengine.app.tests.base BaseDBTest<import_from_stmt>gengine.app.tests.helpers create_user update_user delete_user get_or_create_language<import_from_stmt>gengine.metadata DBSession<import_from_stmt>gengine.app.model AuthUser<class_stmt>TestUserCreation(BaseDBTest)<block_start><d...
<import_stmt>logging<import_from_stmt>collections namedtuple<import_from_stmt>. export<line_sep>log=logging.getLogger(__name__)<line_sep>NO_QUERY=0<line_sep>PARSED_QUERY=1<line_sep>RAW_QUERY=2<line_sep>SpecialCommand=namedtuple('SpecialCommand' ['handler' 'command' 'shortcut' 'description' 'arg_type' 'hidden' 'case_sen...
<import_stmt>torch<import_from_stmt>torch nn<import_from_stmt>torch.nn functional<as>F<import_from_stmt>torchdrug layers<class_stmt>ConditionalFlow(nn.Module)<block_start>""" Conditional flow transformation from `Masked Autoregressive Flow for Density Estimation`_. .. _Masked Autoregressive Flow for Density Es...
<import_stmt>logging<as>log<class_stmt>Log<block_start><def_stmt>__init__ self level<block_start>self.level=level<line_sep>log.basicConfig(format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s' level=level)<line_sep>self.log=log<block_end><def_stmt>info self msg<block_start>self.log.info(msg)...
# # Copyright (c) 2019 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...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) <import_from_stmt>spack *<class_stmt>PyMdanalysis(PythonPackage)<block_start>"""MDAnalysis is a Python toolkit to analyze m...
<import_stmt>cherrypy<import_from_stmt>cherrypy.test helper<class_stmt>SessionAuthenticateTest(helper.CPWebCase)<block_start><def_stmt>setup_server <block_start><def_stmt>check username password# Dummy check_username_and_password function <block_start><if_stmt>username<ne>'test'<or>password<ne>'password'<block_start><r...
# Copyright 2020 The TensorFlow Quantum 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...
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) <import_stmt>pytest<import_from_stmt>mock MagicMock<import_from_stmt>requests HTTPError<import_from_stmt>datadog_checks.base AgentCheck<import_from_stmt>datadog_checks.dev.http MockResponse<import_from_stm...
# Copyright 2012 Nebula, 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 agree...
<import_stmt>torch<import_stmt>sys<import_stmt>os<line_sep>sys.path.append(os.getcwd())<import_from_stmt>utils.helper_modules Sequential2<import_from_stmt>unimodals.common_models Linear MLP MaxOut_MLP<import_from_stmt>datasets.imdb.get_data get_dataloader<import_from_stmt>fusions.common_fusions Concat<import_from_stmt>...
# <import_stmt>os<line_sep>TEST_DIR=os.path.abspath(os.path.dirname(__file__))<line_sep>
<import_stmt>os<import_stmt>numpy<as>np<import_stmt>torch<import_stmt>argparse<import_from_stmt>hparams create_hparams<import_from_stmt>model lcm<import_from_stmt>train load_model<import_from_stmt>torch.utils.data DataLoader<import_from_stmt>reader TextMelIDLoader TextMelIDCollate id2sp<import_from_stmt>inference_utils...
<def_stmt>task_pos_args <block_start><def_stmt>show_params param1 pos<block_start>print('param1 is: {0}'.format(param1))<for_stmt>index,pos_arg enumerate(pos)<block_start>print('positional-{0}: {1}'.format(index pos_arg))<block_end><block_end><return>{'actions':[(show_params )] 'params':[{'name':'param1' 'short':'p' 'd...
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2020, <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...
# -*- mode:python -*- <import_stmt>flask<import_stmt>json<import_stmt>logging<import_from_stmt>datetime datetime<import_stmt>inflection<import_from_stmt>functools wraps<import_from_stmt>flask request url_for<import_from_stmt>werkzeug.exceptions HTTPException<import_from_stmt>.client.api.model *<import_from_stmt>. datab...
<import_from_stmt>dataclasses dataclass field<import_from_stmt>datetime date datetime time timezone<import_from_stmt>pathlib Path<import_from_stmt>typing Any Dict Optional Union<import_stmt>ciso8601<import_stmt>pytest<import_from_stmt>mashumaro DataClassDictMixin<import_from_stmt>mashumaro.exceptions UnserializableFiel...
<import_stmt>ast<import_stmt>re<import_stmt>sys<if_stmt>sys.version_info<l>(2 7)<block_start><import_stmt>unittest2<as>unittest<block_end><else_stmt><block_start><import_stmt>unittest<block_end><import_stmt>astunparse<import_from_stmt>tests.common AstunparseCommonTestCase<class_stmt>DumpTestCase(AstunparseCommonTestCas...
# pylint: skip-file <import_from_stmt>athena_glue_service_logs.catalog_manager BaseCatalogManager<def_stmt>test_class_init mocker<block_start>mocker.patch.multiple(BaseCatalogManager __abstractmethods__=set())<line_sep>base_catalog=BaseCatalogManager('us-west-2' 'dbname' 'tablename' 's3://somewhere')<assert_stmt>base_c...
""" CutBlur Copyright 2020-present NAVER corp. MIT license """<import_stmt>os<import_stmt>glob<import_stmt>data<class_stmt>BenchmarkSR(data.BaseDataset)<block_start><def_stmt>__init__ self phase opt<block_start>root=opt.dataset_root<line_sep>self.scale=opt.scale<line_sep>dir_HQ,dir_LQ=self.get_subdir()<line_sep>self.HQ...
""" $lic$ Copyright (C) 2016-2020 by Tsinghua University and The Board of Trustees of Stanford University This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it wi...
<import_from_stmt>sympy Derivative<as>D Eq exp sin Function Symbol symbols cos log <import_from_stmt>sympy.core S<import_from_stmt>sympy.solvers.pde pde_separate pde_separate_add pde_separate_mul pdsolve classify_pde checkpdesol <import_from_stmt>sympy.testing.pytest raises<line_sep>a,b,c,x,y=symbols('a b c x y')<def_s...
""" Author: <NAME> """<import_stmt>numpy<as>np<import_stmt>pandas<as>pd<import_from_stmt>datetime datetime<class_stmt>TrackerFeeder(object)<block_start>""" Feeder for the trackers of the FinanceHub database. """<def_stmt>__init__ self db_connect<block_start>""" Feeder construction :param db_conn...
<import_from_stmt>diagrams Node<class_stmt>_Outscale(Node)<block_start>_provider="outscale"<line_sep>_icon_dir="resources/outscale"<line_sep>fontcolor="#ffffff"<block_end>
<import_from_stmt>overrides overrides<import_from_stmt>..masked_layer MaskedLayer<class_stmt>OutputMask(MaskedLayer)<block_start>""" This Layer is purely for debugging. You can wrap this on a layer's output to get the mask output by that layer as a model output, for easier visualization of what the model is ac...
<class_stmt>RegipyException(Exception)<block_start>""" This is the parent exception for all regipy exceptions """<line_sep><pass><block_end><class_stmt>RegipyGeneralException(RegipyException)<block_start>""" General exception """<line_sep><pass><block_end><class_stmt>RegistryValueNotFoundException(Regip...
""" If you find this code useful, please cite our paper: <NAME>, <NAME>, and <NAME>. "HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms." In CVPR, 2021. @inproceedings{afifi2021histogan, title={Histo{GAN}: Controlling Colors of {GAN}-Generated and Real Images via Color Histog...
# 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 under the Apache License, Version 2.0 (the # "License"); you may not u...
<import_stmt>sys<import_stmt>math<import_stmt>numpy<as>np<import_from_stmt>datetime datetime<import_stmt>torch<import_stmt>torch.nn<as>nn<import_stmt>torch.nn.functional<as>F<import_from_stmt>torch.autograd Variable<class_stmt>DecAtt(nn.Module)<block_start><def_stmt>__init__ self num_units num_classes embedding_size dr...
<import_stmt>torch.nn<as>nn<import_stmt>math<import_stmt>torch.utils.model_zoo<as>model_zoo<import_stmt>torch.nn.functional<as>F<import_stmt>torch<import_stmt>numpy<as>np<import_stmt>cv2<import_stmt>pdb<def_stmt>sigmoid x<block_start><return>1/(1+math.exp(-x))<block_end><def_stmt>norm_angle angle<block_start>norm_angle...
<import_stmt>tensorflow<as>tf<import_from_stmt>tensorflow keras<import_from_stmt>tensorflow.keras backend<as>K<import_from_stmt>keras_cv_attention_models.aotnet AotNet<import_from_stmt>keras_cv_attention_models.download_and_load reload_model_weights<import_from_stmt>keras_cv_attention_models.attention_layers batchnorm_...
<import_stmt>os<import_from_stmt>typing List<import_stmt>numpy<as>np<import_from_stmt>torchvision datasets<as>torchdata<import_from_stmt>continuum.datasets ImageFolderDataset<import_from_stmt>continuum download<import_from_stmt>continuum.tasks TaskType<class_stmt>DTD(ImageFolderDataset)<block_start>"""Describable Textu...
<import_from_stmt>algorithms.maths.gcd gcd<import_from_stmt>typing List<def_stmt>solve_chinese_remainder num:List[int] rem:List[int]<block_start>""" Computes the smallest x that satisfies the chinese remainder theorem for a system of equations. The system of equations has the form: x % num[0] = rem[0] ...
<import_stmt>spacy<line_sep>nlp=spacy.load("ja_core_news_sm")<line_sep>text=("チックフィレイはジョージア州カレッジパークに本社を置く、"<concat>"チキンサンドを専門とするアメリカのファストフードレストランチェーンです。")<line_sep># トークナイズのみ行う doc=nlp(text)<line_sep>print([token.text<for>token doc])<line_sep>
<import_from_stmt>selenium.common.exceptions NoSuchElementException<import_from_stmt>selenium.webdriver.remote.webelement WebElement<class_stmt>Select(WebElement)<block_start>""" Implements logic to work with Web List UI elements """<line_sep>@property<def_stmt>is_multiple self<block_start>value=self.get_attrib...
# Copyright 2019 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
<import_from_future_stmt> absolute_import print_function unicode_literals<if_stmt>__name__<eq>"__main__"<block_start><import_from_stmt>.cli cli<line_sep>cli.wormhole()<block_end><else_stmt># raise ImportError('this module should not be imported') <block_start><pass><block_end>
<import_stmt>torch<import_stmt>torch.nn.functional<as>F<class_stmt>SelfAttnFunc(torch.autograd.Function)<block_start>@staticmethod<def_stmt>forward ctx use_time_mask is_training heads scale inputs input_weights output_weights input_biases output_biases mask is_additive_mask dropout_prob <block_start>use_biases_t=torch....
<import_from_stmt>django.contrib admin<import_from_stmt>django.urls path<import_from_stmt>.models BookLoan Library<import_from_stmt>.views CustomView<class_stmt>BookLoanInline(admin.StackedInline)<block_start>model=BookLoan<line_sep>extra=1<line_sep>readonly_fields=("id" "duration")<line_sep>fields=("book" "imprint" "s...
# Helper code to plot binary losses. # # <NAME> (http://eli.thegreenplace.net) # This code is in the public domain <import_from_future_stmt> print_function<import_stmt>matplotlib.pyplot<as>plt<import_stmt>numpy<as>np<if_stmt>__name__<eq>'__main__'<block_start>fig,ax=plt.subplots()<line_sep>fig.set_tight_layout(<true>)<...
<import_from_stmt>pytest_djangoapp configure_djangoapp_plugin<line_sep>pytest_plugins=configure_djangoapp_plugin(extend_INSTALLED_APPS=['django.contrib.sessions' 'django.contrib.messages' ] extend_MIDDLEWARE=['django.contrib.sessions.middleware.SessionMiddleware' 'django.contrib.messages.middleware.MessageMiddleware' ]...
<import_stmt>enum<import_from_stmt>typing Dict List<import_from_stmt>odmantic.field Field<import_from_stmt>odmantic.model Model<class_stmt>TreeKind(str enum.Enum)<block_start>BIG="big"<line_sep>SMALL="small"<block_end><class_stmt>TreeModel(Model)<block_start>name:str=Field(primary_key=<true> default="<NAME> montagnes")...
<import_stmt>subprocess os<line_sep>ue4_win=r"C:\Program Files\Epic Games\UE_4.16"<line_sep>ue4_linux="/home/qiuwch/workspace/UE416"<line_sep>ue4_mac='/Users/Shared/Epic Games/UE_4.16'<line_sep>win_uprojects=[r'C:\qiuwch\workspace\uprojects\UE4RealisticRendering\RealisticRendering.uproject' r'C:\qiuwch\workspace\uproje...
# coding=utf-8 # Copyright 2021 RigL 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 applicable law or agree...
<import_stmt>pytest<import_from_stmt>fuzz_lightyear.datastore _ALL_POST_FUZZ_HOOKS_BY_OPERATION<import_from_stmt>fuzz_lightyear.datastore _ALL_POST_FUZZ_HOOKS_BY_TAG<import_from_stmt>fuzz_lightyear.datastore _RERUN_POST_FUZZ_HOOKS_BY_OPERATION<import_from_stmt>fuzz_lightyear.datastore _RERUN_POST_FUZZ_HOOKS_BY_TAG<impo...
<import_from_stmt>tests run_main_and_assert<line_sep>FAST_LOCAL_TEST_ARGS="--exp-name local_test --datasets mnist"<concat>" --network LeNet --num-tasks 5 --seed 1 --batch-size 32"<concat>" --nepochs 2 --num-workers 0 --stop-at-task 3"<def_stmt>test_finetuning_stop_at_task <block_start>args_line=FAST_LOCAL_TEST_ARGS<lin...
# Autor: <NAME> (@optider) # Github Profile: https://github.com/Optider/ # Problem Link: https://leetcode.com/problems/contains-duplicate/ <class_stmt>Solution<block_start><def_stmt>containsDuplicate self nums:List[int]<arrow>bool<block_start>count={}<for_stmt>n nums<block_start><if_stmt>count.get(n)<ne><none><block_st...
<import_stmt>sys<import_stmt>logging<import_stmt>unittest<import_from_stmt>testfixtures LogCapture<import_from_stmt>twisted.python.failure Failure<import_from_stmt>scrapy.utils.log failure_to_exc_info TopLevelFormatter LogCounterHandler StreamLogger <import_from_stmt>scrapy.utils.test get_crawler<import_from_stmt>scrap...
<import_from_stmt>django.conf.urls url<import_from_stmt>. views<line_sep>urlpatterns=[url(r'^$' views.home name='home') url(r'^piechart/' views.demo_piechart name='demo_piechart') url(r'^linechart/' views.demo_linechart name='demo_linechart') url(r'^linechart_without_date/' views.demo_linechart_without_date name='demo_...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
""" Test get_obj_value set_obj_value has_obj_value """<import_stmt>pytest<import_from_stmt>dayu_widgets utils<class_stmt>_HasNameAgeObject(object)<block_start><def_stmt>__init__ self name age<block_start>super(_HasNameAgeObject self).__init__()<line_sep>self.name=name<line_sep>self.age=age<block_end><block_end>@pytest....
<import_stmt>sys yaml test_appliance<def_stmt>main args=<none><block_start>collections=[]<import_stmt>test_yaml<line_sep>collections.append(test_yaml)<if_stmt>yaml.__with_libyaml__<block_start><import_stmt>test_yaml_ext<line_sep>collections.append(test_yaml_ext)<block_end><return>test_appliance.run(collections args)<bl...
<import_stmt>datetime<import_from_stmt>abc ABC abstractmethod<import_stmt>pajbot<class_stmt>AccessToken(ABC)<block_start>SHOULD_REFRESH_THRESHOLD=0.9<line_sep>"""Fraction between 0 and 1 indicating what fraction/percentage of the specified full validity period should actually be utilized. E.g. if this is set to 0.9...
"""Precision for ranking."""<import_stmt>numpy<as>np<import_from_stmt>matchzoo.engine.base_metric BaseMetric sort_and_couple RankingMetric <class_stmt>Precision(RankingMetric)<block_start>"""Precision metric."""<line_sep>ALIAS='precision'<def_stmt>__init__ self k:int=1 threshold:float=0.<block_start>""" :class:...
<import_stmt>os.path<as>osp<line_sep># Root directory of project ROOT_DIR=osp.abspath(osp.join(osp.dirname(__file__) '..' '..'))<line_sep># Path to data dir _DATA_DIR=osp.abspath(osp.join(ROOT_DIR 'data'))<line_sep># Required dataset entry keys _IM_DIR='image_directory'<line_sep>_ANN_FN='annotation_file'<line_sep># Ava...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** <import_stmt>warnings<import_stmt>pulumi<import_stmt>pulumi.runtime<import_from_stmt>typing Any Mapping Optional Sequence Union overload...
<import_stmt>random<import_stmt>numpy<as>np<import_stmt>selfdrive.boardd.tests.boardd_old<as>boardd_old<import_stmt>selfdrive.boardd.boardd<as>boardd<import_from_stmt>common.realtime sec_since_boot<import_from_stmt>cereal log<import_stmt>unittest<def_stmt>generate_random_can_data_list <block_start>can_list=[]<line_sep>...
# Generated by Django 3.1.5 on 2021-02-17 11:04 <import_from_stmt>django.db migrations<import_stmt>saleor.core.db.fields<import_stmt>saleor.core.utils.editorjs<def_stmt>update_empty_description_field apps schema_editor<block_start>Category=apps.get_model("product" "Category")<line_sep>CategoryTranslation=apps.get_model...
""" This makes the functions in torch._C._VariableFunctions available as torch._VF.<funcname> without mypy being able to find them. A subset of those functions are mapped to ATen functions in torch/jit/_builtins.py See https://github.com/pytorch/pytorch/issues/21478 for the reason for introducing torch._VF """<i...
# 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 ...
version="1.0.10.dev0"<line_sep>
# Time: sum(O(l * 2^l) for l in range(1, 11)) = O(20 * 2^10) = O(1) # Space: O(1) <class_stmt>Solution(object)<block_start><def_stmt>findInteger self k digit1 digit2<block_start>""" :type k: int :type digit1: int :type digit2: int :rtype: int """<line_sep>MAX_NUM_OF_DIGITS=10<li...
# Copyright (C) 2020 THL A29 Limited, a Tencent company. # All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may # not use this file except in compliance with the License. You may # obtain a copy of the License at # https://opensource.org/licenses/BSD-3-Clause # Unless required by appl...
# # Copyright 2013 The py-lmdb authors, all rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted only as authorized by the OpenLDAP # Public License. # # A copy of this license is available in the file LICENSE in the # top-level directory of the distribut...
# Copyright 2015 Ufora 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 i...
<import_from_stmt>tensorhive.models.Group Group<import_from_stmt>fixtures.controllers API_URI<as>BASE_URI HEADERS<import_from_stmt>http HTTPStatus<import_from_stmt>importlib reload<import_stmt>json<import_stmt>auth_patcher<line_sep>ENDPOINT=BASE_URI+'/groups'<def_stmt>setup_module _<block_start>auth_patches=auth_patche...
<import_stmt>asyncio<import_from_stmt>contextlib asynccontextmanager<import_stmt>pytest<import_from_stmt>mitmproxy exceptions<import_from_stmt>mitmproxy.addons.proxyserver Proxyserver<import_from_stmt>mitmproxy.connection Address<import_from_stmt>mitmproxy.proxy layers server_hooks<import_from_stmt>mitmproxy.proxy.laye...