ngram
listlengths
0
67.8k
[ "'mushrooms' if requested_topping != 'anchovies': print(\"Hold the anchovies!\") answer = 17 if answer", "cheese'] for requested_topping in requested_toppings: if requested_topping in avaliable_toppings: print(\"Adding \" + requested_topping", "requested_toppings: print(\"Adding mushrooms.\") if 'pepperoni' in ...
[ "- elsolarlogepsilon['fe'], 'pr': 0.38 + elsolarlogepsilon['pr'] - elsolarlogepsilon['fe'], 'nd': 0.20 + elsolarlogepsilon['nd'] -", "population in NGC5286 # from Marino et al. (2015) 2015MNRAS.450..815M # [Fe/H] =", "+ log(X/Fe)_solar targetlogxtofe = { 'o': 0.58 + elsolarlogepsilon['o'] - elsolarlogepsilon['f...
[ "2 # c = a + b # time.sleep(1) # # if MODE", "MODE == \"INFO\": # print(\"a:{}, b:{}\".format(a,b)) # if MODE == \"INFO\": # print(\"c:{}\".format(c))", "# print(\"===start: not use logging===\") # # logレベルの設定 # MODE = \"INFO\" #", "when displaying imfomation on the screen ) for i in range(5): # 適当な繰り返しの処理を再現...
[ "None if val is None else AddressText(val) @property def supplementalAddressText(self) -> SupplementalAddressText: return", "LocalityName) -> None: self.__localityName = None if val is None else LocalityName(val) @property", "else AddressTypeName(val) @property def addressText(self) -> AddressText: return self....
[ "o.value.items(): assert isinstance(k, str) assert isinstance(v, int) opt = Option('num', complex) opt.setval('5+9j') assert", "sys from os.path import dirname sys.path.insert(0, dirname(dirname(__file__))) from typing import List, Set, Dict,", "import sys from os.path import dirname sys.path.insert(0, dirname(...
[ "from .add import AutoReplyAddView, AutoReplyAddExecodeView from .validate import ContentValidationView from .tag import AutoReplyTagPopularityQueryView" ]
[ "self._run_importer() self.assert_in_lib_dir('Tag Artist', 'Tag Album', u'\\xe4rtifact.file') def test_import_dir_with_unicode_character_in_artifact_name_move(self): config['import']['move'] = True open(os.path.join(self.album_path, u'\\xe4rtifact.file'),", "self._run_importer() self.assert_in_lib_dir('Tag Artist...
[ ">>> my_logger = JinaLogger('MyExecLogger') >>> >>> class MyExec(Executor): >>> @requests >>> @add_request_logger(my_logger) >>>", "typing import List from jina import DocumentArray from jina.logging.logger import JinaLogger from jina.enums", "verbose_level = os.environ.get('JINA_LOG_LEVEL', None) verbose_level...
[ "self.target x = page[target] assert isinstance(x, (LineObject,)) return x.content class FileName(Extractor): def __init__(self,", "assert isinstance(x, (LineObject,)) return x.content class FileName(Extractor): def __init__(self, target=None, *, project=True, replace_error=None,", "isinstance(x, (LineObject,))...
[ "kungfucms # TIME : 2020/6/9 12:54 # AUTHOR : <NAME> # EMAIL :", "13811754531 # https://github.com/youngershen from django.core.signals import request_started, \\ request_finished from django.dispatch import Signal,", "TIME : 2020/6/9 12:54 # AUTHOR : <NAME> # EMAIL : <EMAIL> #", "before_sign_in = Signal(prov...
[ "for i in range(len(numbers)): if numbers[i] >= numbers[index]: index = i return index", "algorithm here index = 0 for i in range(len(numbers)): if numbers[i] >= numbers[index]:", "= 0 for i in range(len(numbers)): if numbers[i] >= numbers[index]: index = i", "# write the modified algorithm here index = 0 for...
[ "\"\"\" 02 - Qual o valor do troco? Defina uma variável para o", "uma variável para o valor de uma compra que custou R$100,98; Defina uma", "o valor do troco? Defina uma variável para o valor de uma compra", "valor do troco? Defina uma variável para o valor de uma compra que", "R$100,98; Defina uma variável...
[ "sys import maxsize class Contact: def __init__(self, firstname=None, middlename=None, lastname=None, id=None, nickname=None, title=None,", "self.email_2 = email_2 self.email_3 = email_3 self.homepage = homepage self.address_2 = address_2 self.homephone2", "= workphone self.fax = fax self.email_1 = email_1 self...
[ "(float) site latitude :param longitude: (float) site longitude :param nearest_city: (str) site nearest_city", "kwargs: (dict) Chiller specific inputs as defined in reo/nested_inputs \"\"\" self.nearest_city = nearest_city", "kWth if electric_load_list is not None: self.load_list = [i*self.chiller_cop for i in ...
[ "already handled if name.lower() in ('from', 'to'): continue msg[name] = value return msg", "= self.subject msg['From'] = self.extra_headers.get('From', self.from_email) msg['To'] = self.extra_headers.get('To', ', '.join(map(force_text, self.to))) if", "self.to))) if self.cc: msg['Cc'] = ', '.join(map(force_tex...
[ "SparkSqlBatch message.\"\"\" from __future__ import absolute_import from __future__ import division from __future__ import", "raise AttributeError('--deps-bucket was not specified.') dependencies = local_file_uploader.Upload(args.bucket, dependencies) # Move main SQL", "KIND, either express or implied. # See t...
[ "# if __name__ == \"__main__\": # run_pipeline_component({ # \"output\": \"./\", # \"VOCAB_FILE\": \"bert_base_uncased_vocab.txt\",", "if __name__ == \"__main__\": # run_pipeline_component({ # \"output\": \"./\", # \"VOCAB_FILE\": \"bert_base_uncased_vocab.txt\", #", "it along with the vocab file :param input_o...
[ "contains five videos, added by two different users, # and some videos don't", "to test various features of the script. # It contains five videos, added", "r = main.get_playlist_items(TEST_PLAYLIST) self.assertEqual(len(r['items']), 5) def test_filter_items_by_timestamp(self): r = main.get_playlist_items(TEST_P...
[ "and the following disclaimer in the documentation # and/or other materials provided with", "WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND", "Fraction, stats: ISDStatistics): LOGGER.info(EventHandler._format_message(msg, doc_index, time_offset, available_time, stats)...
[ "= value super().__init__() # 引入父类 def fun(self): print(self.value) # 进程执行内容的入口函数 def run(self): self.fun()", "self.fun() print(\"搞点大事情,想干嘛都行\") my_process = MyProcess(3) # 启动进程 进程执行内容从入口函数run引出 my_process.start() my_process.join() # class Process:", "启动进程 进程执行内容从入口函数run引出 my_process.start() my_process.join() #...
[ "= soma + numero cont += 1 print(f' A soma dos {cont} numeros", "= int(input('Informe um numero inteiro[digite 999 para ele parar ]:')) if numero ==", "== 999: break soma = soma + numero cont += 1 print(f' A", "while True: numero = int(input('Informe um numero inteiro[digite 999 para ele parar ]:'))", "+ nu...
[ "__init__(self): alpha = 13000 self.K = np.matrix([[alpha, 0.0, 800], [0.0, alpha, 400], [0.0,", "(goal_top_left_corner, goal_top_right_corner) goal_left_bar = (goal_bot_left_corner, goal_top_left_corner) goal_right_bar = (goal_bot_right_corner, goal_top_right_corner) goal_left_back_line = (goal_bot_left_corner,"...
[ "dfs.pop() escapable += 1 for nr,nc in [[cr+1,cc],[cr-1,cc],[cr,cc+1],[cr,cc-1]]: if 0<=nr<len(matrix) and 0<=nc<len(matrix[0]) and", "0<=nr<len(matrix) and 0<=nc<len(matrix[0]) and (nr,nc) not in seen and matrix[nr][nc] == 1: dfs.append([nr,nc])", "0 seen = set() for r in range(len(matrix)): for c in [0,len(ma...
[ "inputs, dtype=tf.float32) final_state = tf.identity(final_state, name=\"final_state\") return (outputs, final_state) def build_nn(self, cell, rnn_size,", "Loss function self.cost = seq2seq.sequence_loss( logits, self.targets, tf.ones([input_data_shape[0], input_data_shape[1]])) tf.summary.scalar('train_loss', se...
[ "Y1\" ], maximum_error=0.01) assert data.smoothed_toolpath.segment_start.shape[0] == 3 straight_segment(data, l=0, s=0, start=\"start\", end=\"on\") corner_segment(data,", "plotter(data) def test_135_corner(plotter): data = generate_curves([ \"G1 X100 Y0\", \"G1 X200 Y100\" ],", "the middle of the line\" assert...
[ "bool): self.executor = executor self.libraries = defaultdict(set) self.scanned = set() self.scan_private = scan_private", "rls = RecursiveLibraryScanner(executor, scan_private=scan_private) return rls.scan(initial_target) def scan_libraries(target): in_load_dylib = False libraries =", "collections import defau...
[ "\"\"\" Pre-processing ASL - ASL signal workflows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. automodule:: aslprep.workflows.asl.base .. automodule::", "automodule:: aslprep.workflows.asl.hmc .. automodule:: aslprep.workflows.asl.stc .. automodule:: aslprep.workflows.asl.t2s .. automodule:: aslprep.workflows.a...
[ "from dotenv import load_dotenv, find_dotenv load_dotenv(find_dotenv('.env', usecwd=True)) load_dotenv(find_dotenv('default.env', raise_error_if_not_found=True)) COUNTDOWN = config('COUNTDOWN', default=5,", "find_dotenv load_dotenv(find_dotenv('.env', usecwd=True)) load_dotenv(find_dotenv('default.env', raise_err...
[ "= im[..., 0] im = im.astype(np.float) # normalize to [0,1] im /= 255.", "import Image from skimage.exposure import equalize_adapthist import os from matplotlib import pyplot as", "os.path.exists(save_dir): os.mkdir(save_dir) for f in os.listdir(dir_i): fname = os.fsdecode(f) if fname.endswith(\".png\"): im =",...
[ "length self.sampling_rate = sampling_rate self.stride = stride self.start_index = start_index + length self.overlap", "val_len, test_len = self.split_data_df() if test_len is None: x_Train_data = x_arr[train_len:, :] x_Val_data", "step.' % (self.start_index, self.end_index)) self.sample_shape = self.calc_shape...
[ "optional): epsilon for numerical stability in calculating norms Returns: The original module with", "\"bias\") delattr(module, self.name) delattr(module, self.name + '_orig') delattr(module, \"bias\") delattr(module, \"bias_orig\") module.register_parameter(self.name, torch.nn.Parameter(weight.detach()))", "re...
[ "* i + 1 if(c % a == 0): c = c//a break", "return a * b // gcd(a, b) def imod(a, n): i = 1", "params['e'] self.d = params['d'] def decrypt_request(self, tmpkey, message): k = self.decrypt(tmpkey) message =", "from rsa import prime from arc4 import ARC4 def gcd(a, b): while b", "= params['phi'] self.e = para...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "<<EMAIL>> # \"\"\"Implementation persistence store using S3.\"\"\" import logging from rudra.data_store.aws import AmazonS3", "store.\"\"\" def __...
[ "= 'RandomUniform' learning_rate = 0.001 nb_dense_block = 1 nb_layers = 5 nb_filter =", "model model2.load_weights(weights) for num in range(len(model2.layers) - 1): model.layers[num].set_weights(model2.layers[num].get_weights()) if nb_epoch > 0", "methods.phosnet import Phos model = Phos(nb_classes, nb_layers,...
[ "for ind in range(num_blocks - 1)] \\ + [[MADE(flow_dim, condition_dim, hidden_dim, False)]], []))", "- 0.5) * (1/256.) image = (image + noise).clip(0., 1.) return torch.logit(self.alpha +", "hack todo fix? with torch.no_grad(): self.model.data_init(inputs, conditions) self.initialized = True z, logjac =", "b...
[ "pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from ..", "\"expression\", expression) pulumi.set(__self__, \"id\", id) if push_status is not None: pulumi.set(__self__, \"push_status\", push_status)", "__init__(__self__, *, expression: pulumi.Input[str], id: pulumi.Input[str]...
[ "from sub8_msgs.srv import ThrusterInfo, ThrusterInfoResponse, FailThruster, UnfailThruster from sub8_thruster_comm import thruster_comm_factory from ros_alarms", "offline_on_port and failed not in self.deactivated_thrusters): self.failed_thrusters.remove(failed) # Thruster came online # Don't", "self.warn_volt...
[ "ordered list) #citation_manager.citekeys = cite_processor.all_citekeys #make the citation definitions for a list of", "list. To do so need: - the keys for the citations referenced -", "#second: create CiteRefProcessor object to process cites during src parsing # (and associate", "= ebnf_sp.cites_rest else: e...
[ "adopt_children(self, argn, subelem): for child in subelem.xml.iterchildren(): if self.set_child_argn: child.set(\"argn\", str(argn)) else: if", "options.verbose: sys.stdout.write( \"Parsing File: %-35s . . . . (%.1f%%) \" % (bname,", "ExpressionContainer(ListObject): tags = [\"expression\"] # adopt_childs_tags...
[ "src.libs.Web3Client.helpers.debug import pprintAttributeDict # VARS client = AvalancheCWeb3Client(nodeUri=nodeUri) # TEST FUNCTIONS def test()", "<gh_stars>0 from src.common.config import nodeUri from src.libs.Web3Client.AvalancheCWeb3Client import AvalancheCWeb3Client from pprint import pprint", "test() -> No...
[ "action='store', default='localhost', help='hostname to bind to') parser.add_argument('-p', '--port', action='store', type=int, required=True, help='port to", "-- A simple distributed hash table') parser.add_argument('-n', '--name', action='store', required=True, help='name of node')", "hash table') parser.add_...
[ "else: corr3.append('-1') corr2.append('-1') infile.close() outfname=fname.replace('csv','js').replace(inpath,outpath) outfile=open(outfname,\"w\") outfile.write('var trial_stim=[\\n') for i in range(len(cond)): outfile.write('", "We've been using some online order files in our original PsychoPy-derived web-based...
[ "the actual access token token = requests.post('https://api.fitbit.com/oauth2/token', headers=auth_header, params=post_params).json() LOGGER.debug(token) # for some", "= (base64.encodebytes(bytes(id_secret, 'utf8')) .decode('utf8') .rstrip()) auth_header = {'Authorization': f'Basic {b64_creds}', 'Content-Type': '...
[ "class AlleleMergeLog(TimeStampedModel): \"\"\" Keep track of calls to Allele.merge() \"\"\" old_allele = models.ForeignKey(Allele,", "can if version := self.varianttranscriptannotation_set.filter(version=vav).first(): return version if any_at_all := self.varianttranscriptannotation_set.first(): return any_at_all...
[ "pre-built surveys in Qualtrics', keywords='qualtrics survey', url='http://github.com/kaianalytics/qualtrics_mailer', author='<NAME>', author_email='<EMAIL>', license='MIT', classifiers=[ 'Programming Language", "classifiers=[ 'Programming Language :: Python :: 3.6' ], packages=[ 'qualtrics_mailer' ], install_req...
[ ".preact_resnet import * from .densenet import * from .dpn import * from .dla", "= { 'vgg': VGG11, 'resnet': ResNet56, 'preact_resnet': PreactResNet56, 'resnext': ResNext20_4x16d, 'densenet': DenseNet57, 'dpn':", "import * from .dpn import * from .dla import * from .senet import", "from .senet import * def cr...
[ "True import unittest import inc_dec class Test_TestIncrementDecrement(unittest.TestCase): def test_increment(self): self.assertEquals(inc_dec.increment(3), 4) def test_decrement(self):", "sys sys.dont_write_bytecode = True import unittest import inc_dec class Test_TestIncrementDecrement(unittest.TestCase): def t...
[ "here not reacheable since following 'if' -> 'else'.\") print(\"Just finished all the 'y'", "x:{x} loop.\") for y in range(1,5): print(f\"Start of y:{y} loop.\") if y ==", "end of y:{y} loop.\" ) # print(\"Will this start at beginning of 'y'", "# Second edit. # Added feature_01. # Create two nested 'for' loop...
[ "packages=find_packages(exclude=['testing']), version='0.1a18', description='A simple interface for accessing databases.', author='<NAME>', author_email='<EMAIL>', url='https://github.com/timniven/hsdbi', download_url='https://github.com/timniven/hsdbi/archive/0.1a18.tar.gz', license='MIT',", "import setup, find_...
[ "sudo, local from ConfigParser import ConfigParser import geospatial from fabric.context_managers import lcd cp", "cp.get('install','location') == 'local': run = local cd = lcd def lsudo(op): local('sudo {0}'.format(op))", "SRC = cp.get('install','src') INSTALL = cp.get('install','install') J = cp.get('install'...
[ "app = gui() # top slice - CREATE the GUI app.addLabel(\"title\", \"Welcome to", "from appJar import gui app = gui() # top slice - CREATE the", "# add a label app.setLabelBg(\"title\", \"red\") # set the label's background to be", "CREATE the GUI app.addLabel(\"title\", \"Welcome to appJar\") # add a label ap...
[]
[ "parser.add_argument('--cuda', action='store_true', help='enables cuda') parser.add_argument('--deviceIds', type=int, nargs='+', default=[0], help='the gpus used for training", "np.mean(globalIllu2ErrsNpList[1:j+1, :], axis=0), epoch, j) utils.writeNpErrToScreen('globalIllu3_Accu', np.mean(globalIllu3ErrsNpList[1...
[ "times = raw[meg_channels_idx, start:stop] # data, times = raw[:, start:stop] # read all", "raw.close() ############################################################################### # Show MEG data import pylab as pl pl.close('all') pl.plot(times, data.T)", "first start, stop = raw.time_to_index(100, 115) # 1...
[ "is reason of action this method return instance of Action \"\"\" # check", "= request.validated['json_data'].get('status') if context.status == 'pending' and new_status == 'active': return cls return", "will set to 'cancelled' - if procedure in statuses ['active.tendering', 'active.enquiry', 'active.auction'] ...
[ "sys import shutil sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from pre_ingestion import zip_data,geo_helper,par,validate_csv dirname = os.path.dirname(__file__).replace(\"test\",\"test_data\")", "from pre_ingestion import zip_data,geo_helper,par,validate_csv dirname = os.pa...
[ "to Pylint. depth (int): the depth of the matrix to generate. Returns: archan.DSM:", "pylint: ' + message) class PylintProvider(Provider): \"\"\"Pylint provider for Archan.\"\"\" identifier = 'archan_pylint.PylintProvider'", "= LoggerWriter(logger.debug) sys.stderr = LoggerWriter(logger.warning) try: run = Run(...
[]
[ "self.name = name self.url = url self.email = email self.extensions = extensions and", "email=None, extensions=None): self.name = name self.url = url self.email = email self.extensions =", "contacts models module\"\"\" class Contact(object): def __init__(self, name=None, url=None, email=None, extensions=None): ...
[ "# SPDX-License-Identifier: BSD-3-Clause import logging import collections log = logging.getLogger('codebasin') class TreeWalker(): \"\"\"", "TreeWalker(): \"\"\" Generic tree walker class. \"\"\" def __init__(self, _tree, _node_associations): self.tree =", "logging.getLogger('codebasin') class TreeWalker(): \"...
[ "-*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-01-09 14:58 from", "unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('daiquiri_files', '0001_initial'),", "Generated by Django 1.11.9 on 2018-01-09 14:58 from __future__ import unicode_l...
[ "import Flask app = Flask(\"\") @app.route(\"/\") def home(): return \"\"\" <!DOCTYPE=\"html\"> <html> <head>", "<code>info</code>, <code>ping</code>, and the <code>about</code> command.</li> <li>Fun commands such as the <code>joke</code> and", "color: #fff; text-align: center; font-family: sans-serif; font-siz...
[ "locations1 = torch.cumsum(mask1, dim=0) - 1 locations2 = torch.cumsum(mask2, dim=0) - 1 #", "super().__init__() self.wg = torch.nn.Linear(model_dim, num_experts, bias=False) def forward(self, input: torch.Tensor) -> Tuple[Tensor, Tensor,", "+ gates2_s # Avoid divide-by-zero denom_s = torch.clamp(denom_s, min=t...
[ "\"\"\" lst = [] for i in input or []: lst.extend(i) return (", "other than pre-existence. \"\"\" try: os.makedirs(path) except OSError as exception: if exception.errno !=", "cause other than pre-existence. \"\"\" try: os.makedirs(path) except OSError as exception: if exception.errno", "x.split(\"=\")[1] for ...
[]
[ "django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^', include('demo.urls')), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name':", "import patterns, include, url urlpatterns = patterns('', url(r'^', include('demo.urls')), url(r'^login/$', 'django.contrib.auth.views...
[ "cores=args.n_chains, max_treedepth=14, target_accept=ta, init='adapt_diag') save_cm_trace(f'iceswe.txt', model.trace.CMReduction, args.exp_tag, generate_base_output_dir(args.model_type, parse_extra_model_args(extras))) if model.country_specific_effects: nS, nCMs", "bd = {**ep.get_model_build_dict(), **parse_extr...
[ "from django import template register = template.Library() @register.filter('modF') def modF(value, arg): print (not", "<reponame>Netromnik/python from django import template register = template.Library() @register.filter('modF') def modF(value, arg): print", "template register = template.Library() @register.fi...
[ "range(len(self.list)): for y in range(len(self.list)): if self.list[x] > self.list[y]: self.list[x], self.list[y] = self.list[y],", "list def sma(self): for x in range(len(self.list)): for y in range(len(self.list)): if self.list[x]", "def sma(self): for x in range(len(self.list)): for y in range(len(self.list...
[ "min_set_size(arr): num_to_count, counts, min_size, current_length = {}, [], 0, len(arr) for num in", "reversed(sorted(counts)) if len(arr) % 2 == 0: cut = len(arr) / 2 else:", "Complexity: O(N) ''' def min_set_size(arr): num_to_count, counts, min_size, current_length = {}, [], 0,", "num_to_count: num_to_coun...
[]
[ "for teacher in extracted: self.teachers.add(teacher) else: random_teachers = random.choices(users_models.Teacher.objects.all(), k=5) for teacher in", "= factory.SubFactory(users_factories.StudentFactory) profile = fuzzy.FuzzyChoice(PROFILE_CHOICES) @factory.post_generation def students(self, create, extracted, *...
[ "not hasattr(self.model, 'structure'): return self.login() response = self.client.post(self._get_add_url(), self.get_good_data()) self.assertEqual(response.status_code, 302) obj =", "-*- encoding: utf-8 -*- from django.utils import translation from django.utils.translation import ugettext as", "encoding: utf-8 ...
[ "**kwargs): errors = super(CharField, self).check(**kwargs) errors.extend(self._check_min_length_attribute(**kwargs)) return errors _check_min_length_attribute = check_min_length_attribute def deconstruct(self):", "'min_length' or increase 'max_length'.\", obj=self, id='yepes.E113', ) ] else: return [] class Char...
[ "subject_obj = DictObj(subject_dict) assert hasattr(subject_obj, 'foo') assert hasattr(subject_obj, 'left') assert subject_obj.foo == \"bar\"", "\"right\" } subject_obj = DictObj(subject_dict) assert hasattr(subject_obj, 'foo') assert hasattr(subject_obj, 'left') assert subject_obj.foo", "def test_dictobj(): su...
[ "minDuration, difficultyWeight, profileWeight): self.id = id self.description = description self.minRequiredAbility = minRequiredAbility self.profile", "getPlayerCurrCharacteristics(self, playerId): return self.players[int(playerId)].currState.characteristics def getPlayerPreferencesEst(self, playerId): return se...
[ "#creating the CNN model as per the architecture followed with 4-conv and pooling", "optimizer='adam', learning_rate=0.01, loss='categorical_crossentropy', name='targets') self.model = tflearn.DNN(self.convnet) return self.model def train_1ConvModel(self, arg, model,", "64, 5, activation='relu') self.convnet = ...
[ "-*- coding: utf-8 -*- # @Time : 2019/4/22 14:57 # @Author : hyy", "utf-8 -*- # @Time : 2019/4/22 14:57 # @Author : hyy # @Email", "as e: print('Download error:', e.reason) html = None if num_retries > 0: if", "print('Download error:', e.reason) html = None if num_retries > 0: if hasattr(e, 'code')", "PyCha...
[ "target @mock.patch('kale.utils.jupyter_utils.process_outputs', new=lambda x: x) def test_run_code(): \"\"\"Test that Python code runs inside", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "...
[ "__new__(cls, name, pipeline_snapshots): return super(RepositorySnapshot, cls).__new__( cls, name=check.str_param(name, 'name'), pipeline_snapshots=check.list_param( pipeline_snapshots, 'pipeline_snapshots', of_type=PipelineSnapshot", "repository_snapshot.pipeline_snapshots ) def get_pipeline_index(self, pipeline...
[ "class SpiderMiddleware(object): def process_request(self, request): # 用于处理请求的: 在请求对象交给引擎之前调用 print(\"SpiderMiddleware-process_request-{}\".format(request.url)) return request def process_response(self,", "SpiderMiddleware(object): def process_request(self, request): # 用于处理请求的: 在请求对象交给引擎之前调用 print(\"SpiderMiddlew...
[ "0), (\"Ruby\", 9), (\"Amber\", 69), (\"MossyStone\", 42), (\"SolarSystem\", 9001), ]) def test_is_magic_potion(self, potion_name:", "!= HatchPotion(\"Silver\", quantity=2) assert HatchPotion(\"Watery\") != HatchPotion(\"Glow\") @pytest.mark.parametrize(\"potion_name,quantity\", [ (\"Base\", 10), (\"CottonCandyBl...
[ "is subject to # the license terms in the LICENSE.txt file found in", "triggers\", offset = 0x0000000C, bitSize = 32, bitOffset = 0, base = pr.UInt,", "base = pr.UInt, mode = \"WO\", hidden = True, )) self.add(StreamControl( offset=0x03000000, ))", "0x0000000C, bitSize = 32, bitOffset = 0, base = pr.UInt, mod...
[ "bar # Draw the red background start_x = 120 start_y = 35 if", "self.bullet_list.update() if len(self.enemy_list) == 0 and self.window.level > self.updated_level: self.window.level += 1 self.good", "to start\", start_x, start_y, arcade.color.WHITE, 20) arcade.draw_rectangle_outline(center_x=395, center_y=123, w...
[ "in a string meant to be interpreted as a JSON object, and removes", "}}') + ( '<table class=\"docutils field-list\">') + ( '<colgroup><col class=\"field-name\"><col class=\"field-body\"></colgroup>') + (", "OPERATORS_WRAPPER = ( '<div class=\"document\">{% verbatim %}<h1>Operators</h1><div class=\"section\" id...
[ "def load_cluster_config(name): return load('{0}.yml'.format(name)) _env = load('context.yml') _configs = {} def get_config(env): if", "load('context.yml') _configs = {} def get_config(env): if env not in _configs: _configs[env] =", "yaml from pkg_resources import resource_stream def load(filename): with resour...
[ "def getImg(url): response = requests.get(url) soup = BeautifulSoup(response.text, 'lxml') imgs = soup.find_all('img') for", "fileName = arr[len(arr) - 1] if not os.path.exists(targetUrl + fileName): output = open(targetUrl", "fore='cyan') + ' is downloaded.' else: print style.use_style('[warning] ', mode='bold...
[ "checkpoint = path + '/../work_dirs/faster_rcnn_r50_fpn_1x/latest.pth' config = path + '/../work_dirs/backplane_voc_20200520_rcnn_r50_fpn_1x_multiscale_kmeans_scorethr0.05_2/faster_rcnn_r50_fpn_1x_20200614_173610.py' checkpoint = path", "1) : img = sys.argv[1] print(img) result = inference_detector(model, img) ou...
[ "float(_line.split()[1]) if float(_line.split()[1]) > h_max: h_max = float(_line.split()[1]) hist.append(float(_line.split()[-1])) h_step = (h_max -", "sequence file not found at {}!\\n{}'.format(sys.argv[-2], help_msg)) if not os.path.isdir(PATH): sys.exit('Data directory not", "iupred_limit = par_c - (par_a /...
[ "os.unlink(rootfile) #create a new rootfile for dstfile os.symlink(dstfile,rootfile) return rootfile #dstfile like /bes3fs/offline/data/655-1/4040/dst/110504/run_0023474_All_file007_SFO-2.dst,", "',' items=runIds.split(',') #members' style in items is string,we need to change their style", "resonance of this fi...
[ "document_a, document_b = sorted((request.POST['doca'], request.POST['docb'])) do_deep = 'deep' in request.POST except KeyError: latest_comparisons", "= sorted((request.POST['doca'], request.POST['docb'])) do_deep = 'deep' in request.POST except KeyError: latest_comparisons = get_latest_comparisons()", "documen...
[ "Redistributions in binary form must reproduce the above copyright # * notice, this", "# * # **************************************************************************** import rospy import thread import threading import time from", "0 while not rospy.is_shutdown(): x = radius * cos(i*2*pi/sides) + offset_x y =...
[ "for model in models.gan.__all__] semantic_segmentation = [ \"semantic_segmentation.\" + model for model in", "model for model in models.semantic_segmentation.__all__ ] all_models = gan + semantic_segmentation @pytest.mark.parametrize(\"model\", all_models)", "@pytest.mark.parametrize(\"model\", all_models) def...
[ "variável \"self.log\" \"\"\" if self.log: # se houver algo no log, relate-o self.sendmail(EMAIL_ADDRESS,", "linha sempre que um ENTER for pressionado name = \"[ENTER]\\n\" elif name ==", "um método após uma quantidade de tempo \"intervalo\" from threading import Semaphore, Timer", "\"space\": # \" \"em vez d...
[ "return the words that can be typed using letters of alphabet on only", "= ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p']; row2 =", "Example: Input: [\"Hello\", \"Alaska\", \"Dad\", \"Peace\"] Output: [\"Alaska\", \"Dad\"] Note: You may use", "for letter in list(word.lower()): if letter in row1: Hash['fir...
[ "<reponame>janbodnar/Python-Course #!/usr/bin/python # split_join.py nums = \"1,5,6,8,2,3,1,9\" n = nums.split(\",\") print (n) m", "#!/usr/bin/python # split_join.py nums = \"1,5,6,8,2,3,1,9\" n = nums.split(\",\") print (n) m =", "split_join.py nums = \"1,5,6,8,2,3,1,9\" n = nums.split(\",\") print (n) m = ':...
[ "in this file will be lost! from PySide6 import QtCore qt_resource_data = b\"\\", "QtCore qt_resource_data = b\"\\ \\x00\\x00\\x03m\\ \\x89\\ PNG\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0dIHDR\\x00\\ \\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xffa\\ \\x00\\x00\\x00\\x19tEXtSoftware\\ \\x...
[ "if file not found ''' actual_files = find_paths(file_name, app_name, search_folders) if not actual_files:", "easy to change this for testing XDG_DATA_HOME=os.getenv('XDG_DATA_HOME','/usr/share/') def default_search_folders(app_name): ''' Return the list", "def load_json(file_name,app_name,search_folders=None):...
[ "\"<NAME> <marcin[at]threat9.com>\", # routersploit module ), \"references\": ( \"http://seclists.org/fulldisclosure/2017/Jan/40\", \"https://raw.githubusercontent.com/pedrib/PoC/master/advisories/zyxel_trueonline.txt\", \"https://blogs.securiteam.com/index.php/archives/2910\", ), \"devices\":", "Exploit(HTTPClie...
[ "numeric pagenum = pagenum + 1 # append data from this click locations", "Protests/protests_scrape.csv\" f = codecs.open(filename, encoding='utf-8', mode='w+') headers = \"Location, Date, Subject, Description, Participants\\n\"", "1 pagenum = -1 while(pagenum < page_new): #click to next page if pagenum", "imp...