content
stringlengths
0
1.55M
## # Copyright (c) 2009-2017 Apple Inc. 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 applicable l...
<import_stmt>FWCore.ParameterSet.Config<as>cms<line_sep># Preshower cluster producer multi5x5SuperClustersWithPreshower=cms.EDProducer("PreshowerPhiClusterProducer" esStripEnergyCut=cms.double(0.0) esPhiClusterDeltaEta=cms.double(0.15) esPhiClusterDeltaPhi=cms.double(0.12) preshClusterCollectionY=cms.string('preshowerY...
<import_stmt>json<import_from_stmt>fastapi APIRouter Depends HTTPException status<import_from_stmt>sqlalchemy.orm.session Session<import_from_stmt>quetz.db_models PackageVersion<import_from_stmt>quetz.deps get_db<line_sep>router=APIRouter()<line_sep>@router.get("/api/channels/{channel_name}/packages/{package_name}/vers...
SHARES=[0.5 0.6 0.7 0.8 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]<def_stmt>pop items<block_start><return>items[0] items[1:]<block_end><def_stmt>get_quantiles records shares=SHARES<block_start><if_stmt><not>shares<block_start><return><block_end>counts=[count<for>_,count records]<line_sep>total=sum(counts)<l...
<import_stmt>pytest<import_from_stmt>dagster Any String usable_as_dagster_type<import_from_stmt>dagster.check CheckError<import_from_stmt>dagster.core.types.dagster_type resolve_dagster_type<import_from_stmt>dagster.utils safe_tempfile_path<import_from_stmt>dagstermill.serialize read_value write_value<def_stmt>test_sca...
""" Test idlelib.outwin. """<import_stmt>unittest<import_from_stmt>tkinter Tk Text<import_from_stmt>idlelib.idle_test.mock_tk Mbox_func<import_from_stmt>idlelib.idle_test.mock_idle Func<import_from_stmt>idlelib outwin<import_from_stmt>test.support requires<import_from_stmt>unittest mock<class_stmt>OutputWindowTest(uni...
<class_stmt>View(dict)<block_start>"""A View contains the content displayed in the main window."""<def_stmt>__init__ self d=<none><block_start>""" View constructor. Keyword arguments: d=None: Initial keys and values to initialize the view with. Regardless of the value of d, keys 'song...
# Copyright (C) 2016-present the asyncpg authors and contributors # <see AUTHORS file> # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 # flake8: NOQA <import_from_stmt>.protocol Protocol Record NO_TIMEOUT BUILTIN_TYPE_NAME_MAP<line_sep>
<import_from_stmt>pecan rest<import_from_stmt>wsme types<as>wtypes<import_from_stmt>jmilkfansblog.api.expose expose<as>wsexpose<import_from_stmt>jmilkfansblog.controllers.v1 users<import_from_stmt>jmilkfansblog.controllers.v1 posts<class_stmt>V1(wtypes.Base)<block_start>id=wtypes.text<line_sep>"""The ID of the version,...
# -*- coding: utf-8 -*- # # Creating Sequence to Sequence Models #------------------------------------- # Here we show how to implement sequence to sequence models. # Specifically, we will build an English to German translation model. # <import_stmt>os<import_stmt>re<import_stmt>string<import_stmt>requests<import_stm...
""" Robot Debugger """<import_from_stmt>cumulusci.tasks.robotframework.debugger Breakpoint DebuggerCli Keyword Suite Testcase <class_stmt>DebugListener(object)<block_start>"""A robot framework listener for debugging test cases This acts as the controller for the debugger. It is responsible for managing breakp...
"""Unittest module for log handlers."""<import_stmt>os<import_stmt>sys<import_stmt>unittest<import_stmt>mock<line_sep>sys.path.append("..")# Adds higher directory to python modules path. <import_from_stmt>utils.log LogFilter<class_stmt>MockLog<block_start>""" Mock logs. """<def_stmt>__init__ self **kwargs<block...
<import_from_stmt>recon.core.module BaseModule<import_from_stmt>recon.utils.crypto aes_decrypt<class_stmt>Module(BaseModule)<block_start>meta={'name':'PwnedList - Pwned Domain Credentials Fetcher' 'author':'<NAME> (@LaNMaSteR53)' 'description':'Queries the PwnedList API to fetch all credentials for a domain. Updates th...
# # Author: <NAME> # Copyright 2016 # <import_stmt>logging<import_stmt>isceobj<import_stmt>mroipac<import_stmt>os<import_stmt>numpy<as>np<import_from_stmt>isceobj.Util.decorators use_api<line_sep>logger=logging.getLogger('isce.insar.VerifyDEM')<def_stmt>runVerifyDEM self<block_start>''' Make sure that a DEM is avai...
<import_stmt>FWCore.ParameterSet.Config<as>cms<line_sep>generator=cms.EDProducer("Pythia6PtGun" PGunParameters=cms.PSet(ParticleID=cms.vint32(-15) AddAntiParticle=cms.bool(<false>) MinPhi=cms.double(-3.14159265359) MaxPhi=cms.double(3.14159265359) MinPt=cms.double(50.0) MaxPt=cms.double(50.0001) MinEta=cms.double(-2.4)...
<import_from_stmt>django.urls path<import_from_stmt>. views<line_sep>urlpatterns=[path('' views.index name='api-home') path('tutorials/' views.tutorials) path('tutorials/<str:tags>/' views.tutorial_tag) path('tutorials/<str:tags>/<str:category>/' views.tutorial_tag_category) path('tags/' views.tags) path('latest/' view...
<import_stmt>sqlite3<import_stmt>textwrap<import_from_stmt>scripts.artifact_report ArtifactHtmlReport<import_from_stmt>scripts.ilapfuncs logfunc tsv timeline is_platform_windows open_sqlite_db_readonly<def_stmt>get_smanagerCrash files_found report_folder seeker wrap_text<block_start>file_found=str(files_found[0])<line_...
"""02: Reduce Clutter Reduce Clutter by Disabling Tools. - We are an IDE, but we can also do a lean-and-mean UI - Hide the Toolbar, Tool Window Bars, Navigation Bar Repo: https://github.com/pauleveritt/42-workshop Playlist: https://www.jetbrains.com/pycharm/guide/playlists/42/ """<import_from_stmt>fortytwo App Gree...
# 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 # distributed under th...
# Import Built-Ins <import_stmt>logging<line_sep># Import Third-Party # Import Homebrew <import_from_stmt>bitex.formatters.base Formatter<line_sep># Init Logging Facilities log=logging.getLogger(__name__)<class_stmt>CcexFormatter(Formatter)<block_start>@staticmethod<def_stmt>ticker data *args **kwargs<block_start><retu...
#! /usr/bin/env python # per rosengren 2011 <import_from_stmt>waflib.TaskGen feature after_method<import_from_stmt>waflib.Task Task always_run<import_from_stmt>os.path basename isabs<import_from_stmt>os tmpfile linesep<def_stmt>options opt<block_start>grp=opt.add_option_group('Softlink Libraries Options')<line_sep>grp....
"""Generics support via go_generics. A Go template is similar to a go library, except that it has certain types that can be replaced before usage. For example, one could define a templatized List struct, whose elements are of type T, then instantiate that template for T=segment, where "segment" is the concrete type. "...
# 在使用前,请通过「pip install scenedetect[opencv,progress_bar,scenedetect]」安装部分所需要的依赖~ <import_from_future_stmt> print_function<import_stmt>os<line_sep># Standard PySceneDetect imports: <import_from_stmt>scenedetect.video_splitter split_video_ffmpeg<import_from_stmt>scenedetect.video_manager VideoManager<import_from_stmt>scen...
""" This module defines functions to install c extensions for all the platforms into Kolibri. It is required to have pip version greater than 19.3.1 to run this script. Usage: > python build_tools/install_cexts.py --file "requirements/cext.txt" --cache-path "/cext_cache" It reads the package name and version from req...
<try_stmt><block_start><import_from_stmt>ulab numpy<as>np<block_end><except_stmt>ImportError<block_start><import_stmt>numpy<as>np<block_end>a=np.array([1 2 3 4] dtype=np.int8)<line_sep>b=a.copy()<line_sep>print(b)<line_sep>a=np.array([[1 2 3] [4 5 6] [7 8 9]] dtype=np.int16)<line_sep>b=a.copy()<line_sep>print(b)<line_s...
<import_from_stmt>azureml.core ScriptRunConfig<def_stmt>run_rolling_forecast test_experiment compute_target train_run test_dataset target_column_name inference_folder="./forecast" <block_start>train_run.download_file("outputs/model.pkl" inference_folder+"/model.pkl")<line_sep>inference_env=train_run.get_environment()<l...
<import_from_stmt>talon Context Module<line_sep>ctx=Context()<line_sep>mod=Module()<line_sep>mod.tag("code_comment_block" desc="Tag for enabling generic block comment commands")<line_sep>@mod.action_class<class_stmt>Actions<block_start><def_stmt>code_comment_block <block_start>"""Block comment"""<block_end><def_stmt>co...
<import_from_stmt>loudml.misc nan_to_none <import_from_stmt>loudml.donut DonutModel<import_stmt>logging<import_stmt>unittest<import_from_stmt>loudml.membucket MemBucket<line_sep>logging.getLogger('tensorflow').disabled=<true><line_sep>FEATURES=[{'name':'avg_foo' 'metric':'avg' 'field':'foo' 'default':0 } ]<class_stmt>T...
<import_stmt>tensorflow<as>tf<import_from_stmt>misc_fn controlled_shuffle<import_from_stmt>misc_fn random_drop<line_sep>FLAGS=tf.flags.FLAGS<line_sep>AUTOTUNE=tf.data.experimental.AUTOTUNE<def_stmt>batching_func x batch_size<block_start>"""Forms a batch with dynamic padding."""<line_sep><return>x.padded_batch(batch_siz...
<import_stmt>config<import_stmt>models.base<import_from_stmt>models.task TaskLock<def_stmt>main <block_start>app=config.App(config)<with_stmt>app.app_context()<block_start><for_stmt>lock models.base.db.session.query(TaskLock).all()<block_start><if_stmt>lock.step<is><not><none><block_start>lock.step.complete('Force rele...
<import_from_stmt>hypothesis given example note<import_stmt>hypothesis.strategies<as>st<import_stmt>hypothesis<import_stmt>strategies<import_stmt>warnings<import_stmt>base64<import_stmt>json<import_stmt>six<import_stmt>blackboxprotobuf<line_sep>warnings.filterwarnings("ignore" "Call to deprecated create function.*" )<t...
load("@io_bazel_rules_docker//container:container.bzl" _container_push="container_push")<def_stmt>container_push *args **kwargs<block_start>"""Creates a script to push a container image to a Docker registry. The target name must be specified when invoking the push script."""<if_stmt>"registry"<in>kwargs<block_start...
<import_stmt>sys<import_stmt>open3d<import_stmt>numpy<as>np<import_stmt>time<import_stmt>os<import_from_stmt>geometric_registration.utils get_pcd get_keypts get_desc loadlog<import_stmt>cv2<import_from_stmt>functools partial<def_stmt>build_correspondence source_desc target_desc<block_start>""" Find the mutually clo...
__author__='Ostico <<EMAIL>>'<import_stmt>struct<import_stmt>sys<import_from_stmt>..exceptions PyOrientBadMethodCallException PyOrientCommandException PyOrientNullRecordException<import_from_stmt>..otypes OrientRecord OrientRecordLink OrientNode<import_from_stmt>..hexdump hexdump<import_from_stmt>..constants BOOLEAN BY...
"""This program finds the total number of possible combinations that can be used to climb statirs . EG : for 3 stairs ,combination and output will be 1,1,1 , 1,2 , 2,1 i.e 3 . """<def_stmt>counting_stairs stair_number<block_start>result=stair_number<line_sep># This function uses Recursion. <if_stmt>(stair_number<le>...
# -*- coding: utf-8 -*- <import_stmt>re<import_stmt>pytest<import_from_stmt>mimesis Food<import_from_stmt>. patterns<class_stmt>TestFood(object)<block_start><def_stmt>test_str self food<block_start><assert_stmt>re.match(patterns.DATA_PROVIDER_STR_REGEX str(food))<block_end><def_stmt>test_vegetable self food<block_start...
<import_from_stmt>unittest.mock patch<import_stmt>demistomock<as>demisto<import_stmt>ExtractDomainFromIOCDomainMatchRes<line_sep>ARGS={'json_response':"{\"Artifact\": \"e9428.b.akamaiedge.net\", \"IocIngestTime\": \"2020-07-17T20:00:00Z\", "<concat>"\"FirstAccessedTime\": \"2018-11-05T12:01:29Z\", \"LastAccessedTime\":...
<import_from_stmt>pyquil.quantum_processor.transformers.qcs_isa_to_compiler_isa qcs_isa_to_compiler_isa QCSISAParseError <import_from_stmt>pyquil.quantum_processor.transformers.qcs_isa_to_graph qcs_isa_to_graph<import_from_stmt>pyquil.quantum_processor.transformers.compiler_isa_to_graph compiler_isa_to_graph<import_fro...
''' train_robot_value_prediction.py use Graph Neural Network to learn a value function for robot designs. Learned GNN: input: a graph of the robot design with all nodes being terminal nodes. output: the predicted reward for the design. Argument: --dataset-name: the name of the dataset --use-cuse: if use gpu to trai...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'demoTabWidget.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! <import_from_stmt>PyQt5 QtCore QtGui QtWidgets<class_stmt>Ui_Dialog(object)<block_start><def_stmt>setupUi self Dialog...
"""Manipulation functionality to deal with reference files. """<import_stmt>collections<import_from_stmt>bcbio utils<import_from_stmt>bcbio.pipeline config_utils<import_from_stmt>bcbio.provenance do<def_stmt>fasta_idx in_file config=<none><block_start>"""Retrieve samtools style fasta index. """<line_sep>fasta_index...
""" Compute depth maps for images in the input folder. """<import_stmt>os<import_stmt>glob<import_stmt>torch<import_stmt>cv2<import_stmt>numpy<as>np<import_from_stmt>torchvision.transforms Compose<import_from_stmt>models.midas_net MidasNet<import_from_stmt>models.transforms Resize NormalizeImage PrepareForNet<impor...
<import_from_stmt>. ExplorationTechnique<import_stmt>random<class_stmt>DFS(ExplorationTechnique)<block_start>""" Depth-first search. Will only keep one path active at a time, any others will be stashed in the 'deferred' stash. When we run out of active paths to step, we take the longest one from deferred a...
<import_stmt>pytest<import_from_stmt>django.conf settings<import_from_stmt>requests put<import_from_stmt>grandchallenge.uploads.models UserUpload<import_from_stmt>tests.algorithms_tests.factories AlgorithmImageFactory<import_from_stmt>tests.factories UserFactory<import_from_stmt>tests.verification_tests.factories Verif...
<import_stmt>sys<import_stmt>contextlib<line_sep>@contextlib.contextmanager<def_stmt>stdout_redirect stringIO<block_start>sys.stdout=stringIO<try_stmt><block_start><yield>stringIO<block_end><finally_stmt><block_start>sys.stdout=sys.__stdout__<line_sep>stringIO.seek(0)<block_end><block_end>
<import_stmt>shutil<import_from_stmt>snape.make_image_dataset *<import_from_stmt>snape.make_image_dataset _ImageNet _ImageGrabber<import_from_stmt>snape.utils get_random_state<import_stmt>glob<import_stmt>pytest<line_sep>conf={"n_classes":2 "n_samples":11 "out_path":"./test_images/" "weights":[.8 .2] "image_source":"im...
<import_stmt>sys<line_sep>sys.path.append('.')<import_from_stmt>tqdm tqdm<import_stmt>os<import_stmt>numpy<as>np<import_stmt>cv2<import_stmt>argparse<import_stmt>torch<import_from_stmt>lietorch SE3<import_stmt>raft3d.projective_ops<as>pops<import_from_stmt>utils show_image normalize_image<import_from_stmt>data_readers....
<import_from_stmt>unittest TestCase<import_from_stmt>mock patch Mock<import_from_stmt>torch nn<import_from_stmt>torchbearer.callbacks.manifold_mixup ManifoldMixup<import_stmt>torchbearer<import_stmt>torch<class_stmt>TestModule(nn.Module)<block_start><def_stmt>__init__ self<block_start>super(TestModule self).__init__()<...
<import_stmt>networkx.algorithms.traversal.tests.test_bfs<import_stmt>pytest<import_from_stmt>graphscope.nx.utils.compat import_as_graphscope_nx<line_sep>import_as_graphscope_nx(networkx.algorithms.traversal.tests.test_bfs decorators=pytest.mark.usefixtures("graphscope_session"))<line_sep>
# Generated by Django 2.2.19 on 2021-04-10 14:10 <import_from_stmt>django.db migrations models<class_stmt>Migration(migrations.Migration)<block_start>dependencies=[('repeaters' '0003_migrate_connectionsettings') ]<line_sep>operations=[migrations.AlterField(model_name='sqlrepeatrecordattempt' name='message' field=models...
<import_stmt>argparse<import_from_stmt>collections Counter OrderedDict<import_from_stmt>prenlp.tokenizer *<line_sep>TOKENIZER={'nltk_moses':NLTKMosesTokenizer() 'mecab':Mecab()}<class_stmt>Vocab<block_start>"""Defines a vocabulary object that will be used to numericalize text. Args: vocab_size (int) ...
<import_stmt>datetime<import_stmt>hashlib<import_stmt>urllib<import_stmt>time<import_stmt>collections<import_stmt>urlparse<import_stmt>requests<import_from_stmt>django http<import_from_stmt>django.conf settings<import_from_stmt>django.contrib.sites.requests RequestSite<import_from_stmt>django.shortcuts get_object_or_40...
# FILE: autoload/conque_term/conque_sole_shared_memory.py # AUTHOR: <NAME> <<EMAIL>> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-09-02 # VERSION: 2.3, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 <NAME> # # MIT License # # Permission is hereby granted, f...
# encoding: utf-8 <import_from_future_stmt> unicode_literals<import_stmt>copy<line_sep># `from doctest import DocTestCase` causes crashes, since the DocTestCase is # detected as a TestCase subclass and unittest.TestLoader.loadTestsFromModule() # called from GreenTestLoader.loadTestsFromModule() thinks it is a definitio...
<import_stmt>requests<import_stmt>os<import_from_stmt>botocore.exceptions ClientError<import_from_stmt>elasticsearch_connector ElasticsearchConnector<async_keyword><def_stmt>upload_file_to_s3 s3_client es_client:ElasticsearchConnector file_data token<block_start>""" Gets a file from slack and uploads it to a Cortx S3 b...
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. <import_stmt>numpy<as>np<import_stmt>logging_util<import_stmt>transducer_blocks<line_sep># set up logging logger=logging_util.get_basic_logger(__name__)<class_stmt>TranscriptionNetwork(transducer_blocks.Block)<block_start>""" Transcription Network (or Audio Enc...
<import_stmt>os<import_stmt>math<import_stmt>numpy<as>np<import_stmt>cv2<as>cv<import_stmt>torch<import_from_stmt>skimage io<line_sep># setup individual scene IDs and their download location scenes=['https://www.repository.cam.ac.uk/bitstream/handle/1810/251342/KingsCollege.zip' 'https://www.repository.cam.ac.uk/bitstr...
<import_stmt>os<import_stmt>sys<import_stmt>subprocess<import_stmt>platform<import_stmt>click<import_from_stmt>kungfu.version get_version<line_sep>@click.group(invoke_without_command=<true>)@click.option('-l' '--log_level' type=click.Choice(['trace' 'debug' 'info' 'warning' 'error' 'critical']) default='warning' help='...
<import_stmt>torch.nn<as>nn<import_stmt>torch.nn.functional<as>F<class_stmt>PadLayer(nn.Module)# E.g., (-1, 0) means this layer should crop the first and last rows of the feature map. And (0, -1) crops the first and last columns <block_start><def_stmt>__init__ self pad<block_start>super(PadLayer self).__init__()<line...
# Copyright (c) OpenMMLab. All rights reserved. <import_stmt>numpy<as>np<import_stmt>torch<import_stmt>torch.nn<as>nn<import_from_stmt>mmcv.cnn ConvModule<import_from_stmt>mmcv.runner BaseModule<import_from_stmt>mmocr.models.common MultiHeadAttention<class_stmt>SatrnEncoderLayer(BaseModule)<block_start>""""""<def_stmt>...
# ***** BEGIN GPL LICENSE BLOCK ***** # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distribute...
<import_stmt>asyncio<import_stmt>ssl<import_stmt>aiohttp<import_stmt>pytest# noqa <import_from_stmt>aiohttp ClientResponse TCPConnector<import_from_stmt>yarl URL# noqa <import_from_stmt>aiohttp_socks ProxyType ProxyConnector ChainProxyConnector ProxyInfo ProxyError ProxyConnectionError ProxyTimeoutError open_connection...
# -*- coding: utf-8 -*- # Copyright 2014 Google Inc. 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 require...
r""" Utility functions for building Sage """<line_sep># **************************************************************************** # Copyright (C) 2017 <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
<import_stmt>os<import_stmt>shutil<import_from_stmt>kas kas<def_stmt>test_build_dir_is_placed_inside_work_dir_by_default changedir tmpdir<block_start>conf_dir=str(tmpdir.mkdir('test_env_variables'))<line_sep>shutil.rmtree(conf_dir ignore_errors=<true>)<line_sep>shutil.copytree('tests/test_environment_variables' conf_di...
# Concord # # Copyright (c) 2019 VMware, Inc. All Rights Reserved. # # This product is licensed to you under the Apache 2.0 license (the "License"). # You may not use this product except in compliance with the Apache 2.0 License. # # This product may include a number of subcomponents with separate copyright # notices a...
<import_from_stmt>datetime datetime<import_stmt>pytz<def_stmt>convert_to_utc_date_time date<block_start>"""Convert date into utc date time."""<if_stmt>date<is><none><block_start><return><block_end><return>datetime.combine(date datetime.min.time() tzinfo=pytz.UTC)<block_end>
# Sphinx helper for Django-specific references <def_stmt>setup app<block_start>app.add_crossref_type(directivename="label" rolename="djterm" indextemplate="pair: %s; label" )<line_sep>app.add_crossref_type(directivename="setting" rolename="setting" indextemplate="pair: %s; setting" )<line_sep>app.add_crossref_type(dire...
_base_=['./super-resolution_dynamic.py' '../../_base_/backends/ncnn.py']<line_sep>
<import_from_stmt>sklearn.gaussian_process.kernels Kernel Hyperparameter<import_from_stmt>sklearn.gaussian_process.kernels GenericKernelMixin<import_from_stmt>sklearn.gaussian_process.kernels StationaryKernelMixin<import_stmt>numpy<as>np<import_from_stmt>sklearn.base clone<class_stmt>MiniSeqKernel(GenericKernelMixin St...
###################################################################### # Copyright (c) 2019 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 # # ...
<import_from_stmt>threading Thread<import_from_stmt>snoop.configuration Config<line_sep>snoop=Config(columns='thread').snoop<line_sep>@snoop<def_stmt>foo <block_start><return>1<block_end><def_stmt>run name<block_start>thread=Thread(target=foo name=name)<line_sep>thread.start()<line_sep>thread.join()<block_end><def_stmt...
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
<import_from_stmt>typing Union Optional Dict<import_stmt>torch<import_from_stmt>falkon sparse<import_from_stmt>falkon.kernels.diff_kernel DiffKernel<import_from_stmt>falkon.la_helpers.square_norm_fn square_norm_diff<import_from_stmt>falkon.options FalkonOptions<import_from_stmt>falkon.sparse SparseTensor<line_sep>SQRT3...
<import_from_future_stmt> absolute_import division print_function<import_stmt>cmath<import_stmt>math<import_from_stmt>six.moves zip<class_stmt>least_squares<block_start><def_stmt>__init__ self obs calc<block_start>self.obs=obs<line_sep>self.calc=calc<line_sep>a,b=self.calc.real self.calc.imag<line_sep>self.abs_calc=mat...
<import_from_future_stmt> absolute_import<as>_abs<import_stmt>json<import_from_stmt>nnvm symbol graph<def_stmt>infer_variable_shapes net feed_dict<block_start>"""Inference shape of all variables in the net. Parameters ---------- net : tf.Symbol The symbolic network containing all the variables. ...
<import_stmt>FWCore.ParameterSet.Config<as>cms<import_from_stmt>DQM.EcalPreshowerMonitorModule.ESRawDataTask_cfi *<import_from_stmt>DQM.EcalPreshowerMonitorModule.ESIntegrityTask_cfi *<import_from_stmt>DQM.EcalPreshowerMonitorModule.ESFEDIntegrityTask_cfi *<line_sep>#from DQM.EcalPreshowerMonitorModule.ESPedestalTask_c...
"""Tests for the ecobee.util module."""<import_stmt>pytest<import_stmt>voluptuous<as>vol<import_from_stmt>homeassistant.components.ecobee.util ecobee_date ecobee_time<async_keyword><def_stmt>test_ecobee_date_with_valid_input <block_start>"""Test that the date function returns the expected result."""<line_sep>test_input...
<import_stmt>sys<import_stmt>unittest<import_from_stmt>packaging version<import_from_stmt>unittest mock<import_stmt>tensorflow<as>tf<import_stmt>larq_zoo<as>lqz<import_from_stmt>tensorflow.python.eager context<line_sep>sys.modules["importlib.metadata"]=mock.MagicMock()<line_sep>sys.modules["importlib_metadata"]=mock.Ma...
# pylint: disable=missing-function-docstring, missing-module-docstring/ <import_from_stmt>pyccel.decorators types<line_sep>@types('int')<def_stmt>f a<block_start>b=0<if_stmt>a<is><not><none><block_start>b=b+a<block_end><return>b<block_end>
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-08-01 21:05 <import_from_future_stmt> unicode_literals<import_from_stmt>django.db migrations<class_stmt>Migration(migrations.Migration)<block_start>dependencies=[('contenttypes' '0002_remove_content_type_name') ('osf' '0121_merge_20180801_1458') ]<line_sep>o...
r""" Phony "compiler" for testing SCons. Copies its source files to the target file, dropping lines that match a pattern, so we can recognize the tool has made a modification. """<import_stmt>sys<if_stmt>__name__<eq>'__main__'<block_start>line=('/*'+sys.argv[1]+'*/\n').encode()<with_stmt>open(sys.argv[2] 'wb')<as>ofp<...
# # Copyright (C) 2019 Databricks, 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>stable_baselines ACER<import_from_stmt>rl_baselines.base_classes StableBaselinesRLObject<class_stmt>ACERModel(StableBaselinesRLObject)<block_start>""" object containing the interface between baselines.acer and this code base ACER: Sample Efficient Actor-Critic with Experience Replay """<li...
<import_from_stmt>rlpython embed<def_stmt>load_commands server<block_start>import_strings=server.settings.CORE_COMMANDS+server.settings.COMMANDS<line_sep>commands=[]<for_stmt>import_string import_strings<block_start>commands.append(server.acquire(import_string))<block_end><return>commands<block_end><def_stmt>embed_shel...
<for_stmt>i range(5)<block_start><for_stmt>j range(i+1 5)<block_start>print("i:%s, j:%s"%(i j))<block_end><block_end>
<import_stmt>json<import_stmt>os<import_stmt>time<import_from_stmt>timeit default_timer<as>timer<line_sep>IGNORES=[400 404]<line_sep>INDEX='ecs-search-metrics'<line_sep>TRANSFORM_NAMES=[f'{INDEX}_transform_queryid' f'{INDEX}_transform_completion']<line_sep>INDEX_NAMES=[INDEX]+TRANSFORM_NAMES<line_sep>PIPELINE_NAMES=IND...
""" A federated learning client at the edge server in a cross-silo training workload. """<import_from_stmt>dataclasses dataclass<import_stmt>logging<import_stmt>os<import_stmt>pickle<import_stmt>sys<import_from_stmt>plato.clients edge<line_sep>@dataclass<class_stmt>Report(edge.Report)<block_start>"""Report from an Axio...
<import_from_stmt>collections Counter<import_from_stmt>collections defaultdict<line_sep># [3] https://leetcode.com/problems/longest-substring-without-repeating-characters/ # Given a string, find the length of the longest substring without repeating characters. # # variation with no pattern <def_stmt>lengthOfLongestSubs...
<import_from_stmt>lldbsuite.test lldbinline<import_from_stmt>lldbsuite.test decorators<line_sep>lldbinline.MakeInlineTest(__file__ globals() [decorators.expectedFailureAll(compiler="gcc")])<line_sep>
<import_from_future_stmt> unicode_literals<import_from_stmt>django.test SimpleTestCase<import_from_stmt>django.utils.glob glob_escape<class_stmt>TestUtilsGlob(SimpleTestCase)<block_start><def_stmt>test_glob_escape self<block_start>filename='/my/file?/name[with special chars*'<line_sep>expected='/my/file[?]/name[[]with ...
<import_stmt>munkres<def_stmt>match first second method<block_start>""" Attempts to match every path in 'first' with a path in 'second'. Returns the association along with its score. Note: if two paths have nothing to do with each other, but there is no other suitable candidate, the two seeminly unre...
# -*- coding: utf-8 -*- # OPEN AI LAB is pleased to support the open source community by supporting Tengine available. # # Copyright (C) 2021 OPEN AI LAB. 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 ob...
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 <import_from_stmt>torch ones randn tensor zeros# noqa F401 <import_from_stmt>funsor.testing allclose# noqa F401 <import_from_stmt>.ops *# noqa F401
# quat_test.py Test for quat.py # Released under the MIT License (MIT). See LICENSE. # Copyright (c) 2020 <NAME> <import_from_stmt>math sin cos isclose pi sqrt<import_from_stmt>quat *<line_sep>print('Properties')<line_sep>q1=Quaternion(1 2 3 4)<line_sep>q1.w=5<line_sep>q1.x=6<line_sep>q1.y=7<line_sep>q1.z=8<assert_stmt...
# -*- coding: utf-8 -*- """ @date: 2021/5/4 下午7:11 @file: torchvision_resnet_to_zcls_resnet.py @author: zj @description: Transform torchvision pretrained model into zcls format """<import_stmt>os<import_from_stmt>torchvision.models.resnet resnet18 resnet34 resnet50 resnet101 resnet152 resnext50_32x4d resnext101_32x8d<i...
# # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free...
<import_from_future_stmt> absolute_import division print_function<import_from_stmt>iotbx.kriber strudat<import_from_stmt>cctbx geometry_restraints<import_from_stmt>cctbx crystal<import_from_stmt>cctbx.array_family flex<import_stmt>scitbx.math<import_from_stmt>scitbx matrix<import_from_stmt>libtbx.test_utils approx_equa...
<import_stmt>os<import_stmt>tempfile<import_from_stmt>flask Response Blueprint send_from_directory<import_from_stmt>platypush.backend.http.app template_folder<import_from_stmt>platypush.backend.http.app.utils authenticate send_request<import_from_stmt>platypush.config Config<import_from_stmt>platypush.plugins.camera.pi...
# 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...