content
stringlengths
0
1.55M
# Generated by Django 2.2.6 on 2019-10-25 12:31 <import_from_stmt>django.db migrations models<class_stmt>Migration(migrations.Migration)<block_start>dependencies=[("scripts" "0012_auto_20190128_1820")]<line_sep>operations=[migrations.AlterField(model_name="scriptdb" name="db_typeclass_path" field=models.CharField(db_in...
# -*- coding: utf-8 -*- # # Copyright (c) 2016 - 2020 -- <NAME> # All rights reserved. # # License: BSD License # """\ Test against issue <https://github.com/pyqrcode/pyqrcodeNG/pull/13/>. The initial test was created by Mathieu <https://github.com/albatros69>, see the above mentioned pull request. Adapted for Segno ...
<import_from_stmt>osp.corpus.syllabus Syllabus<import_from_stmt>osp.test.utils requires_tika<def_stmt>test_empty mock_osp<block_start>""" Should return None if the file is empty. """<line_sep>path=mock_osp.add_file(content='' ftype='plain')<line_sep>syllabus=Syllabus(path)<assert_stmt>syllabus.text<eq><none><bl...
# Copyright (c) 2021, NVIDIA 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...
# 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>pybullet<as>p<import_stmt>pybullet_data<import_stmt>gym<import_from_stmt>gym spaces<import_from_stmt>gym.utils seeding<import_stmt>numpy<as>np<import_from_stmt>math sqrt<import_stmt>random<import_stmt>time<import_stmt>math<import_stmt>cv2<import_stmt>torch<import_stmt>os<def_stmt>random_crop imgs out<block...
# Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD-3-Clause <import_stmt>os.path<as>op<import_stmt>numpy<as>np<import_from_stmt>numpy.testing assert_array_equal<import_stmt>pytest<import_from_stmt>mne pick_types<import_from_stmt>mne.datasets testing<import_from_stmt>mne.io.tests.test_raw _test_raw_r...
# This sample tests the type checker's reportUnnecessaryCast feature. <import_from_stmt>typing cast Union<def_stmt>foo a:int# This should generate an error if # reportUnnecessaryCast is enabled. <block_start>b=cast(int a)<block_end>c:Union[int str]="hello"<line_sep>d=cast(int c)<line_sep>
# Copyright 2020 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_stmt>bot.api.api_client ApiClient<import_from_stmt>bot.api.base_route BaseRoute<import_stmt>typing<as>t<import_from_stmt>bot.models Tag<class_stmt>TagRoute(BaseRoute)<block_start><def_stmt>__init__ self api_client:ApiClient<block_start>super().__init__(api_client)<block_end><async_keyword><def_stmt>create_...
# 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 # distribu...
# Copyright 2015 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. # This dictionary of GPU information was captured from a run of # Telemetry on a Linux workstation with NVIDIA GPU. It helps test # telemetry.internal.platfor...
<import_from_stmt>BTrees OOBTree<import_from_stmt>datetime datetime date timedelta<import_from_stmt>persistent Persistent<import_from_stmt>.vulnerability Vulnerability<import_stmt>fcntl<import_stmt>glob<import_stmt>gzip<import_stmt>json<import_stmt>logging<import_stmt>os<import_stmt>os.path<as>p<import_stmt>requests<im...
<def_stmt>add_cswrapper filename outfilename=<none><block_start><import_from_stmt>fmpy read_model_description extract sharedLibraryExtension platform __version__<import_from_stmt>lxml etree<import_stmt>os<import_from_stmt>shutil copyfile rmtree<if_stmt>outfilename<is><none><block_start>outfilename=filename<block_end>mo...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
<import_from_future_stmt> unicode_literals<import_stmt>unittest<import_from_stmt>nose.tools *# PEP8 asserts <import_from_stmt>nose.plugins.attrib attr<import_from_stmt>textblob.sentiments PatternAnalyzer NaiveBayesAnalyzer DISCRETE CONTINUOUS<class_stmt>TestPatternSentiment(unittest.TestCase)<block_start><def_stmt>setU...
""" Manage Linux kernel packages on APT-based systems """<import_stmt>functools<import_stmt>logging<import_stmt>re<try_stmt><block_start><import_from_stmt>salt.utils.versions LooseVersion<as>_LooseVersion<import_from_stmt>salt.exceptions CommandExecutionError<line_sep>HAS_REQUIRED_LIBS=<true><block_end><except_stmt>Imp...
<import_stmt>os tempfile subprocess<import_from_stmt>hammer_vlsi MMMCCorner MMMCCornerType HammerTool HammerToolStep HammerSRAMGeneratorTool SRAMParameters<import_from_stmt>hammer_vlsi.units VoltageValue TemperatureValue<import_from_stmt>hammer_tech Library ExtraLibrary<import_from_stmt>typing NamedTuple Dict Any List<...
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. 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 requ...
# -*- coding: utf-8 -*- # vispy: gallery 10 # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. <import_stmt>sys<import_stmt>numpy<as>np<import_from_stmt>vispy app gloo visuals<import_from_stmt>vispy.visuals.filters Clipper ColorFilter<i...
"""Auxiliary methods."""<import_stmt>os<import_stmt>json<import_from_stmt>errno EEXIST<import_stmt>numpy<as>np<import_stmt>seaborn<as>sns<import_stmt>cPickle<as>pickle<import_stmt>matplotlib.pyplot<as>plt<line_sep>sns.set()<line_sep>DEFAULT_LOG_DIR='log'<line_sep>ATOB_WEIGHTS_FILE='atob_weights.h5'<line_sep>D_WEIGHTS_F...
# 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 applic...
<import_from_future_stmt> absolute_import division print_function unicode_literals<import_stmt>torch.nn.qat<as>nnqat<import_stmt>torch.nn.intrinsic<import_stmt>torch.nn.functional<as>F<class_stmt>LinearReLU(nnqat.Linear)<block_start>r""" A LinearReLU module fused from Linear and ReLU modules, attached with Fa...
<import_stmt>unittest<import_stmt>astar<class_stmt>BasicTests(unittest.TestCase)<block_start><def_stmt>test_bestpath self<block_start>"""ensure that we take the shortest path, and not the path with less elements. the path with less elements is A -> B with a distance of 100 the shortest path is A -...
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
<import_stmt>numpy<as>np<import_from_stmt>collections defaultdict Counter<import_stmt>random<import_stmt>json<import_from_stmt>tqdm tqdm<def_stmt>transX dataset<block_start>rel2id=json.load(open(dataset+'/relation2ids'))<line_sep>ent2id=json.load(open(dataset+'/ent2ids'))<with_stmt>open('../Fast-TransX/'+dataset+'_base...
<import_from_stmt>amadeus.client.decorator Decorator<class_stmt>TripParserStatus(Decorator object)<block_start><def_stmt>__init__ self client job_id<block_start>Decorator.__init__(self client)<line_sep>self.job_id=job_id<block_end><def_stmt>get self **params<block_start>''' Returns the parsing status and the li...
<import_stmt>py<import_stmt>pytest<import_from_stmt>iniconfig IniConfig ParseError __all__<as>ALL<import_from_stmt>iniconfig iscommentline<import_from_stmt>textwrap dedent<line_sep>check_tokens={'section':('[section]' [(0 'section' <none> <none>)]) 'value':('value = 1' [(0 <none> 'value' '1')]) 'value in section':('[se...
<import_stmt>sys<line_sep>sys.path.insert(0 '..')<import_from_stmt>data.whale_data exchnage_accounts<import_from_stmt>data.html_helper check_if_address_name_exists<import_from_stmt>data.whale_eth_tx_data *<import_from_stmt>data.whale_token_tx_data identify_investor_type_token<line_sep>holding_account="holding_account"<...
"""Computation of ensemble anomalies based on a desired value."""<import_stmt>os<import_stmt>numpy<as>np<import_from_stmt>scipy stats<line_sep># User-defined packages <import_from_stmt>read_netcdf read_iris save_n_2d_fields<import_from_stmt>sel_season_area sel_area sel_season<def_stmt>ens_anom filenames dir_output name...
# 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_stmt>os<import_stmt>pytest<import_from_stmt>llnl.util.filesystem mkdirp touch<import_stmt>spack.config<import_from_...
# Copyright 2021 Google LLC. 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 law or a...
<import_from_future_stmt> absolute_import division print_function<import_stmt>matplotlib<import_stmt>numpy<as>np<import_stmt>os<import_stmt>subprocess<import_stmt>sys<import_stmt>tempfile<line_sep>matplotlib.use('pdf')<import_stmt>matplotlib.pyplot<as>plt<import_from_stmt>abc abstractmethod ABCMeta<import_from_stmt>dra...
# Copyright 2019 BDL Benchmarks Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
<import_stmt>setuptools<line_sep>setuptools.setup(name="monet_memory_optimized_training" version="0.0.1" description="Memory Optimized Network Training Framework" url="https://github.com/philkr/lowrank_conv" packages=setuptools.find_packages(include=['monet' 'monet.*' 'models' 'checkmate' 'gist']) classifiers=["Program...
# Copyright (c) 2009-2021 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """MPI communicator."""<import_from_stmt>hoomd _hoomd<import_stmt>hoomd<import_stmt>contextlib<class_stmt>Communicator(object)<block_start>"""MPI communicator. ...
__author__='Rio'<line_sep>
''' Given an array of intervals, merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6]....
print(18<times>1234)<line_sep>print(18<times>1234<times>2)<line_sep>print(0<times>1)<line_sep>print(1<times>0)<line_sep>print(0.0<times>1.0)<line_sep>print(1.0<times>0.0)<line_sep>
"""Command to run Nile scripts."""<import_stmt>logging<import_from_stmt>importlib.machinery SourceFileLoader<import_from_stmt>nile.nre NileRuntimeEnvironment<def_stmt>run path network<block_start>"""Run nile scripts passing on the NRE object."""<line_sep>logger=logging.getLogger()<line_sep>logger.disabled=<true><line_s...
array=[]<for_stmt>_ range(int(input()))<block_start>command=input().strip().split(" ")<line_sep>cmd_type=command[0]<if_stmt>(cmd_type<eq>"print")<block_start>print(array)<block_end><elif_stmt>(cmd_type<eq>"sort")<block_start>array.sort()<block_end><elif_stmt>(cmd_type<eq>"reverse")<block_start>array.reverse()<block_end...
<import_from_stmt>..downloader Downloader<import_stmt>os<import_stmt>pytest<line_sep>@pytest.fixture<def_stmt>cwd_to_tmpdir tmpdir<block_start>os.chdir(str(tmpdir))<block_end><def_stmt>test_audiobook_download cwd_to_tmpdir monkeypatch<block_start>audiobook_url="https://www.scribd.com/audiobook/237606860/100-Ways-to-Mot...
# -*- coding:utf-8 -*- # edit by fuzongfei <import_stmt>base64<import_stmt>datetime<line_sep># Create your views here. <import_stmt>json<import_from_stmt>django.http Http404 HttpResponse<import_from_stmt>django.utils timezone<import_from_stmt>django_filters.rest_framework DjangoFilterBackend<import_from_stmt>rest_frame...
# 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 the Li...
# encoding: utf-8 <import_stmt>datetime<import_from_stmt>south.db db<import_from_stmt>south.v2 SchemaMigration<import_from_stmt>django.db models<class_stmt>Migration(SchemaMigration)<block_start><def_stmt>forwards self orm# Adding model 'ProductType' <block_start>db.create_table('inventory_producttype' (('id' self.gf('...
# 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...
""" Cement generate extension module. """<import_stmt>re<import_stmt>os<import_stmt>inspect<import_stmt>yaml<import_stmt>shutil<import_from_stmt>.. Controller minimal_logger shell<import_from_stmt>..utils.version VERSION get_version<line_sep>LOG=minimal_logger(__name__)<class_stmt>GenerateTemplateAbstractBase(Controlle...
# Copyright (c) 2015 Red Hat, 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 ...
""" insert default serverInfo """<import_from_stmt>yoyo step<line_sep>__depends__={'20220114_02_lHBKM-new-table-serverinfo'}<line_sep>steps=[step("INSERT INTO `serverInfo` (`onlineMinute`) VALUES (0);")]<line_sep>
# Copyright 2017 FUJITSU LIMITED # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
<import_stmt>sys<import_from_stmt>abc ABCMeta abstractmethod<import_from_stmt>collections namedtuple<import_from_stmt>six add_metaclass<class_stmt>SaveException(Exception)<block_start><def_stmt>__init__ self other<block_start>self.traceback=sys.exc_info()<line_sep>super(SaveException self).__init__(str(other))<block_en...
# Copyright 2016 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 required by applicable law or ag...
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, <NAME> <<EMAIL>> # License: http://snmplabs.com/pyasn1/license.html # <import_stmt>sys<try_stmt><block_start><import_stmt>unittest2<as>unittest<block_end><except_stmt>ImportError<block_start><import_stmt>unittest<block_end><import_from_stmt>tests.ba...
<import_stmt>dash_core_components<as>dcc<import_stmt>dash_html_components<as>html<import_from_stmt>config strings<def_stmt>make_tab_port_map_controls port_arr:list port_val:str vessel_types_arr:list vessel_type_val:str year_arr:list year_val:int month_arr:list month_val:int <arrow>html.Div<block_start>""" Returns a...
# -*- coding: utf-8 -*- """Actions and snippets."""<line_sep># ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- <import_stmt>inspect<import_from_stmt>functools partial wraps<import_stmt>logging<import_...
<import_stmt>logging<import_stmt>time<import_from_stmt>sqlalchemy func desc<import_from_stmt>src.models Play<import_from_stmt>src.utils db_session<line_sep>logger=logging.getLogger(__name__)<def_stmt>get_plays_metrics args<block_start>""" Returns metrics for play counts Args: args: dict The parsed args...
<import_stmt>pytz<import_from_stmt>rest_auth.serializers TokenSerializer<import_from_stmt>rest_framework.authtoken.models Token<import_from_stmt>rest_framework.exceptions ValidationError<import_from_stmt>rest_framework.fields CharField CurrentUserDefault HiddenField UUIDField ChoiceField <import_from_stmt>rest_framewor...
<import_stmt>torch<import_stmt>torch.nn<as>nn<import_stmt>torch.nn.functional<as>F<import_from_stmt>.discriminator Discriminator<import_from_stmt>.identity Identity<class_stmt>MultiScaleDiscriminator(nn.Module)<block_start><def_stmt>__init__ self<block_start>super(MultiScaleDiscriminator self).__init__()<line_sep>self....
<import_from_stmt>typing Optional Dict Any List Union<import_from_stmt>allennlp.common.checks ConfigurationError<class_stmt>MetricTracker<block_start>""" This class tracks a metric during training for the dual purposes of early stopping and for knowing whether the current value is the best so far. It mimics the...
<import_stmt>FWCore.ParameterSet.Config<as>cms<import_from_stmt>DQMServices.Core.DQMEDAnalyzer DQMEDAnalyzer<line_sep>l1tGct=DQMEDAnalyzer('L1TGCT' gctCentralJetsSource=cms.InputTag("gctDigis" "cenJets") gctForwardJetsSource=cms.InputTag("gctDigis" "forJets") gctTauJetsSource=cms.InputTag("gctDigis" "tauJets") gctIsoTa...
# simple test function that uses python 3 features (e.g., f-strings) # see https://github.com/localstack/localstack/issues/264 <def_stmt>handler event context# the following line is Python 3.6+ specific <block_start>msg=f"Successfully processed {event}"# noqa This code is Python 3.6+ only <return>event<block_end>
<import_stmt>copy<import_stmt>inspect<import_stmt>json<import_stmt>logging<import_stmt>pytest<import_stmt>re<import_stmt>os<import_stmt>shutil<import_stmt>subprocess<import_stmt>time<import_from_stmt>datetime datetime timedelta<import_from_stmt>configparser ConfigParser ExtendedInterpolation<import_from_stmt>typing Dic...
# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker -b :8000 simple_server:app <import_stmt>bottle<import_stmt>ujson<import_from_stmt>bottle route run<line_sep>@route("/")<def_stmt>index <block_start><return>ujson.dumps({"test":<true>})<block_end>app=bottle.default_app()<line_sep>
# Copyright 2016-2018, Pulumi 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 t...
"""Fix bound method attributes (method.im_? -> method.__?__). """<line_sep># Author: <NAME> # Local imports <import_from_stmt>.. fixer_base<import_from_stmt>..fixer_util Name<line_sep>MAP={"im_func":"__func__" "im_self":"__self__" "im_class":"__self__.__class__"}<class_stmt>FixMethodattrs(fixer_base.BaseFix)<block_s...
"""Tests for miscellaneous properties, such as debuggability."""<import_stmt>time<import_from_stmt>chopsticks.tunnel Docker<import_from_stmt>chopsticks.group Group<def_stmt>test_tunnel_repr <block_start>"""Tunnels have a usable repr."""<line_sep>tun=Docker('py36' image='python:3.6')<assert_stmt>repr(tun)<eq>"Docker('py...
""" A simple, good-looking plot =========================== Demoing some simple features of matplotlib """<import_stmt>numpy<as>np<import_stmt>matplotlib<line_sep>matplotlib.use('Agg')<import_stmt>matplotlib.pyplot<as>plt<line_sep>fig=plt.figure(figsize=(5 4) dpi=72)<line_sep>axes=fig.add_axes([0.01 0.01 .98 0.98])<li...
<import_from_stmt>backend.common.models.mytba MyTBAModel<class_stmt>Favorite(MyTBAModel)<block_start>""" In order to make strongly consistent DB requests, instances of this class should be created with a parent that is the associated Account key. """<def_stmt>__init__ self *args **kwargs<block_start>super(F...
<class_stmt>Foo<block_start><def_stmt>bar self<block_start><return>"a"<block_end><block_end><if_stmt>__name__<eq>"__main__"<block_start>f=Foo()<line_sep>b=f.bar()<line_sep>print(b)<block_end>
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
''' Speed: 95.97% Memory: 24.96% Time complexity: O(n) Space complexity: O(n) '''<class_stmt>Solution(object)<block_start><def_stmt>longestValidParentheses self s<block_start>ans=0<line_sep>stack=[-1]<for_stmt>i range(len(s))<block_start><if_stmt>(s[i]<eq>'(')<block_start>stack.append(i)<block_end><else_stmt><block_sta...
<import_from_stmt>distdeepq models# noqa <import_from_stmt>distdeepq.build_graph build_act build_train# noqa <import_from_stmt>distdeepq.simple learn load make_session# noqa <import_from_stmt>distdeepq.replay_buffer ReplayBuffer PrioritizedReplayBuffer# noqa <import_from_stmt>distdeepq.static *<import_from_stmt>distdee...
<class_stmt>Solution<block_start><def_stmt>findDuplicate self nums:List[int]<arrow>int<block_start>p1,p2=nums[0] nums[nums[0]]<while_stmt>nums[p1]<ne>nums[p2]<block_start>p1=nums[p1]<line_sep>p2=nums[nums[p2]]<block_end>p2=0<while_stmt>nums[p1]<ne>nums[p2]<block_start>p1=nums[p1]<line_sep>p2=nums[p2]<block_end><return>...
<class_stmt>A<block_start><def_stmt>a self<block_start><return>'a'<block_end><block_end><class_stmt>B(A object)<block_start><def_stmt>b self<block_start><return>'b'<block_end><block_end><class_stmt>Inherit(A)<block_start><def_stmt>a self<block_start><return>'c'<block_end><block_end>
<import_stmt>json<import_from_stmt>threading Semaphore<import_stmt>ee<import_from_stmt>flask request<import_from_stmt>google.auth crypt<import_from_stmt>google.oauth2 service_account<import_from_stmt>google.oauth2.credentials Credentials<line_sep>service_account_credentials=<none><import_stmt>logging<line_sep>export_se...
<import_from_future_stmt> print_function<import_stmt>numpy<as>np<import_stmt>struct<import_stmt>solvers<import_stmt>pid<import_from_stmt>util *<line_sep>MOTORSPEED=0.9<line_sep>MOTORMARGIN=1<line_sep>MOTORSLOPE=30<line_sep>ERRORLIM=5.0<class_stmt>ArmConfig<block_start>"""Holds an arm's proportions, limits and other con...
<import_stmt>torch.nn<as>nn<import_from_stmt>.efficientnet EfficientNet_B4 EfficientNet_B0<import_from_stmt>.mobilenetv3 MobileNetV3_Large MobileNetV3_Small<def_stmt>get_trunk trunk_name<block_start>"""Retrieve the pretrained network trunk and channel counts"""<if_stmt>trunk_name<eq>'efficientnet_b4'<block_start>backbo...
<import_from_stmt>django.db migrations models<class_stmt>Migration(migrations.Migration)<block_start>dependencies=[('cmsplugin_cascade' '0006_bootstrapgallerypluginmodel') ]<line_sep>operations=[]<block_end>
Credits=[('Bootstrap' 'https://getbootstrap.com' 'The Bootstrap team' 'MIT') ('Bottle' 'http://bottlepy.org' '<NAME>' 'MIT') ('Cheroot' 'https://github.com/cherrypy/cheroot' 'CherryPy Team' 'BSD 3-Clause "New" or "Revised" License') ('Click' 'https://github.com/pallets/click' 'Pallets' 'BSD 3-Clause "New" or "Revised" ...
<import_stmt>typing<as>tp<import_from_stmt>unittest TestCase<import_stmt>hypothesis<as>hp<import_from_stmt>hypothesis strategies<as>st<import_stmt>pypeln<as>pl<import_stmt>cytoolz<as>cz<line_sep>MAX_EXAMPLES=10<line_sep>T=tp.TypeVar("T")<line_sep>@hp.given(nums=st.lists(st.integers()))@hp.settings(max_examples=MAX_EXAM...
<import_from_stmt>datadog_checks.base ConfigurationError OpenMetricsBaseCheck<line_sep>EVENT_TYPE=SOURCE_TYPE_NAME='pulsar'<class_stmt>PulsarCheck(OpenMetricsBaseCheck)<block_start>""" PulsarCheck derives from AgentCheck that provides the required check method """<def_stmt>__init__ self name init_config instanc...
<import_stmt>argparse<import_from_stmt>os listdir mkdir<import_from_stmt>os.path join isdir<import_from_stmt>subprocess call<import_stmt>sys<import_stmt>datasets<import_from_stmt>shutil which<line_sep>""" Script to use pdftoppm to turn the pdfs into single images per page """<def_stmt>get_images pdf_dir output_dir dpi ...
# imports <import_from_stmt>. coordinates<import_from_stmt>. data<import_from_stmt>.modflow *<import_from_stmt>. utils<import_from_stmt>.data mfdatascalar mfdatalist mfdataarray<import_from_stmt>.mfmodel MFModel<import_from_stmt>.mfbase ExtFileAction<line_sep>
<import_stmt>torch<line_sep>DEVICE=torch.device("cuda")<line_sep>SAVED_CHECKPOINTS=[32<times>1000 100<times>1000 150<times>1000 200<times>1000 300<times>1000 400<times>1000]<line_sep>SAVED_CHECKPOINTS<augadd>[10<times>1000 20<times>1000 30<times>1000 40<times>1000 50<times>1000 60<times>1000 70<times>1000 80<times>1000...
# RiveScript-Python # # This code is released under the MIT License. # See the "LICENSE" file for more information. # # https://www.rivescript.com/ <def_stmt>get_topic_triggers rs topic thats depth=0 inheritance=0 inherited=<false><block_start>"""Recursively scan a topic and return a list of all triggers. Argument...
<import_stmt>collections<import_stmt>datetime<import_stmt>json<import_stmt>multiprocessing<import_stmt>os<import_stmt>subprocess<import_stmt>sys<import_stmt>time<line_sep>_SSHD_BINARY_PATH="/usr/sbin/sshd"<line_sep>EnvironmentConfig=collections.namedtuple("EnvironmentConfig" ["hosts" "port" "is_chief" "pools" "job_id"]...
<import_stmt>random<import_from_stmt>typing Optional Tuple Union<import_stmt>numpy<as>np<import_stmt>torch<import_from_stmt>torch Tensor<import_from_stmt>torch_geometric.utils coalesce degree remove_self_loops<import_from_stmt>.num_nodes maybe_num_nodes<def_stmt>negative_sampling edge_index:Tensor num_nodes:Optional[Un...
# Copyright (C) 2015, 2016 GoSecure Inc. """ Telnet Transport and Authentication for the Honeypot @author: <NAME> <<EMAIL>> """<import_from_future_stmt> annotations<import_stmt>struct<import_from_stmt>twisted.conch.telnet ECHO LINEMODE NAWS SGA AuthenticatingTelnetProtocol ITelnetProtocol <import_from_stmt>twisted.pyt...
<class_stmt>WebException(Exception)<block_start><pass><block_end><class_stmt>ParserException(Exception)<block_start>""" 解析异常 """<line_sep><pass><block_end><class_stmt>ApiException(Exception)<block_start>""" api异常 """<line_sep><pass><block_end><class_stmt>WsException(Exception)<block_start>""" 轮...
<import_stmt>re<import_stmt>base64<import_stmt>hmac<import_stmt>hashlib<import_stmt>logging<import_stmt>requests<import_from_stmt>datetime datetime<class_stmt>AzureSentinel<block_start><def_stmt>__init__ self workspace_id workspace_key log_type log_analytics_url=''<block_start>self._workspace_id=workspace_id<line_sep>s...
<import_stmt>pytest<import_from_stmt>onnx TensorProto<import_from_stmt>onnx helper<as>oh<import_stmt>finn.core.onnx_exec<as>oxe<import_from_stmt>finn.core.modelwrapper ModelWrapper<import_from_stmt>finn.transformation.streamline.reorder MoveTransposePastJoinAdd<import_from_stmt>finn.util.basic gen_finn_dt_tensor<def_st...
<import_stmt>unittest<class_stmt>LexerTestCase(unittest.TestCase)<block_start><def_stmt>makeLexer self text<block_start><import_from_stmt>spi Lexer<line_sep>lexer=Lexer(text)<line_sep><return>lexer<block_end><def_stmt>test_tokens self<block_start><import_from_stmt>spi TokenType<line_sep>records=(('234' TokenType.INTEGE...
""" Simple pre-processing for PeerRead papers. Takes in JSON formatted data from ScienceParse and outputs a tfrecord Reference example: https://github.com/tensorlayer/tensorlayer/blob/9528da50dfcaf9f0f81fba9453e488a1e6c8ee8f/examples/data_process/tutorial_tfrecord3.py """<import_stmt>argparse<import_stmt>glob<import_...
# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. <import_stmt>numpy<as>np<import_from_stmt>os path<as>op<import_from_stmt>..util load_data_file<line_sep># This is the package data dir, not the dir for config, e...
<import_stmt>logging<import_stmt>os<import_from_stmt>typing List Tuple Optional<import_from_stmt>amlb.utils config_load Namespace<line_sep>log=logging.getLogger(__name__)<def_stmt>_find_local_benchmark_definition name:str benchmark_definition_dirs:List[str]<arrow>str# 'name' should be either a full path to the benchmar...
<import_from_stmt>itertools islice<import_from_stmt>test get_user_session cassette<import_from_stmt>test.resources.documents delete_all_documents create_document<def_stmt>test_should_iterate_through_documents <block_start>session=get_user_session()<line_sep>delete_all_documents()<with_stmt>cassette('fixtures/resources/...
# encoding: utf-8 """ mplsmask.py Created by <NAME> on 2016-12-01. Copyright (c) 2014-2017 Exa Networks. All rights reserved. """<import_from_stmt>exabgp.bgp.message.notification Notify<import_from_stmt>exabgp.bgp.message.update.attribute.bgpls.linkstate LinkState<import_from_stmt>exabgp.bgp.message.update.attribute.b...
<import_stmt>numpy<as>np<import_stmt>scipy.interpolate<import_stmt>scipy.ndimage<import_from_stmt>sklearn.feature_extraction.image extract_patches_2d reconstruct_from_patches_2d<def_stmt>_calc_patch_grid_dims shape patch_size patch_stride<block_start>x_w,x_h,x_c=shape<line_sep>num_rows=1+(x_h-patch_size)<floordiv>patch...
<import_from_stmt>.rohon_gateway RohonGateway<line_sep>
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...