ngram
listlengths
0
82k
[ "default=480, type=int) args = parser.parse_args() mkdir(args.dest_folder) if (args.width % 32", "Path def _extract_frames(video_path, parent, start=0, sampling_f=1): vidcap = cv2.VideoCapture(video_path) success,", "image) saved += 1 success, image = vidcap.read() # read", "with its name. ''') parser.add_arg...
[ "using utils headers = self.utils.getHeaders(responseInfo) # overwrite the Content-Type header.", "class BurpExtender(IBurpExtender, IHttpListener): # implement IBurpExtender # set everything up", "register an HTTP listener callbacks.registerHttpListener(self) # # implement IHttpListener #", "callbacks.regist...
[ "= 'dev_appserver_login' # Indicates that the user has admin access", "hashlib import logging import os import sha import sys import", "completed. email: Email address to set for the client. admin:", "cookie, so ignoring it.\".format(email)) return '', False, '' admin_apps =", "2.0 (the \"License\"); # you ...
[ "endpoint, timeout=None): self._endpoint = endpoint self._timeout = timeout def start(self):", "be aware that they run Docker-on-Mac # to connect against", "import tempfile import threading import grpc from apache_beam.portability.api import beam_job_api_pb2_grpc", "self._timeout = timeout def start(self): ch...
[ "expr): func = self.known_functions.get(expr.__class__.__name__, None) if func is None: func", "c = arg.cond result.append('((') result.append(self._print(e)) result.append(') if (') result.append(self._print(c)) result.append(')", "def _print_Integer(self, e): return '%s(%d)' % (self._module_format('mpmath.mpf...
[ "model = self.args.model assert model in self.model_list, \"model is not", "model to process\") parser.add_argument(\"--task\", \"-t\", required=True, help=\"training/testing\") return parser.parse_args() def", "configuration file(json type)\") parser.add_argument(\"--model\", \"-m\", required=True, help=\"the ...
[ "circulantSize) ): bLeft = hexToCirculant(lines[2 * i], circulantSize) bRight =", "01/12/2020, need to make sure this doesn't break anything. import", "figureName = str(file)) else: pass return evalTimes, evaluationFaildAt, numberOfIterationsAtHigh #plt.imshow(nearEarthParity)", "pathlib projectDir = pathlib....
[ "'agent': '\"Mozilla/4.08 [en] (Win98; I ;Nav)\"', 'auth': 'frank', 'ident': '-',", "'ndc': 'unknown', 'message': 'This is sample log message'}, 'COMMON_LOG_FORMAT': {'request':", "{'message': 'client denied by server configuration:/export/home/live/ap/htdocs/' 'test', 'timestamp': 'Wed Oct", "'ident': '-', '...
[ "linear regression Attributes ---------- _linear_regression : LinearRegression The actual scikt", "2019 <NAME> Copyright 2019 <NAME> Licensed under the Apache License,", "experiment configuration regression_inputs: RegressionInputs The input of the regression problem", "estimated values for a give set of data...
[ "# ---------------------------------------------------------------------------------------------------------------- def __init__(self, pin): raise NotImplementedError() # ---------------------------------------------------------------------------------------------------------------- @property", "from scs_host.sys...
[ "UnsubclassableType(type): def __new__(cls, name, bases, dct): c = super().__new__(cls, name,", "c = super().__new__(cls, name, bases, dct) setattr(c, '__init_subclass__', prevent_subclassing) return", "type') def prevent_subclassing(): raise TypeError('Unacceptable base type') def final_class(cls): setattr(cls...
[ "L4 as ARCHI from ...my_argparser import TP_parse_args from collections import", "def tensor(self, data, requires_grad=False, dtype=None): return self.data_generator.tensor(data, requires_grad=requires_grad, dtype=dtype) def", "evaluate_summary_computer from utils.images import gather_images from visual.misc im...
[ "MagicMock else: from mock import Mock, MagicMock class ADLTest(unittest.TestCase): \"\"\"", "\"baz\"], ) self.ls.assert_called_once_with(\"path/to/file\") def test_read_opens_and_reads_file(self): self.assertEquals( self.adl.read(\"adl://foo_store.azuredatalakestore.net/path/to/file\"), [\"a\", \"b\", \"c\"]", ...
[ "import CustomUserCreationForm class SignUpView(CreateView): form_class = CustomUserCreationForm success_url = reverse_lazy('login')", "django.views.generic import CreateView from django.urls import reverse_lazy from .forms import", "import reverse_lazy from .forms import CustomUserCreationForm class SignUpView...
[ "typing import * # noqa: F401, F403 except ImportError: from", "try: from typing import * # noqa: F401, F403 except", "from .typing_stubs import * # type: ignore # noqa: F401,", "* # noqa: F401, F403 except ImportError: from .typing_stubs import", "import * # noqa: F401, F403 except ImportError: from .typin...
[ "not None: res = res + dropmask.float() * replacement return", "(e.g., any inputs to an LSTM layer). Given a batch", "= x.masked_fill(dropmask, 0) if replacement is not None: res =", "x.size()] dropmask = torch.rand(*masksize, device=x.device) < self.dropprob res = x.masked_fill(dropmask,", "class LockedDro...
[ "'rb') as f: reader = PdfFileReader(f, strict=False) print(reader.numPages) if reader.isEncrypted:", "= PdfFileReader(f, strict=False) print(reader.numPages) if reader.isEncrypted: reader.decrypt('') current_page = reader.getPage(5)", "2018-03-26 \"\"\" from PyPDF2 import PdfFileReader with open('./res/Python课程...
[ "'ipetrash' from PyQt5 import QtWidgets as qtw from PyQt5.QtTest import", "def fill_tree(self, global_number=-1): self.number_total_class = 0 self.tree.clear() t = time.clock()", "sec'.format(self.number_total_class, time.clock() - t) ) def closeEvent(self, e): quit() if", "import QTest import time import req...
[ "Corp. # # # Licensed under the Apache License, Version", "in, # even though it actually doesn't. let's check to", "many users' logged in, # even though it actually doesn't.", "2.0 (the \"License\"); # you may not use this file", "form = \"form=2\" resp = self.submit(form, param) count = 0", "let's check ...
[ "import storage from modules.service import Service from modules.database import Database", "self.database.add_service(Service()) self.database.name = \"Hey\" storage.write(\"test\", self.database, \"test.db\") database2 = Database()", "__author__ = \"<NAME>\" import sys import os sys.path.append(\"..\") import...
[ "vars.update(lookup_template_vars) self._templar.set_available_variables(vars) # do the templating res = self._templar.template(template_data, preserve_trailing_newlines=True,", "in # addition to our original search paths. newsearchpath =", "print statement. default: '{{' version_added: '2.8' type: str variable...
[ "join, dirname setup( name=\"fant_sizer\", version=\"0.7\", author=\"<NAME>\", author_email=\"<EMAIL>\", description=\"fant_sizer command-line file-information\",", "Python :: 3.6' ], packages=find_packages(), long_description=open(join(dirname(__file__), \"README.rst\")).read(), entry_points={ \"console_scripts\...
[ "accum = 0 for i, r in enumerate(choco_row): accum +=", "i in range(R): row = input() for j in range(C):", "num_choco/(H+1) num_choco_v = num_choco/(V+1) accum = 0 for i, r", "accum += c if accum == num_choco_v: accum = 0", "V cuts if num_choco == 0: return 'POSSIBLE' H_idx, V_idx", "C) choco_row, choco_c...
[ "assert_equal({ 'jobTracker': 'curacao:8032', 'nameNode': 'hdfs://curacao:8020' }, submission.properties) def test_get_logical_properties(self): submission", "fs = cluster.get_hdfs() jt = cluster.get_next_ha_mrcluster()[1] final_properties = properties.copy() final_properties.update({", "cluster.fs.stats(deploy...
[ "# prev:[None, 3, 42, 42] -> [None, 3, 43, 43]", "opt.label_nc, opt.nzx, opt.nzy], 0, device=opt.device) in_s_S = prev_S # full", "schedulerS.step() functions.save_networks(netG, netD, netS, opt) ## save netG, netD, z_opt,", "__init__(self, opt): self.criterionGAN = GANLoss(not opt.no_lsgan) self.criterionFea...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "OF ANY # KIND, either express or implied. See the", "1 stmt = ib.get() stmt = tvm.tir.ir_pass.InjectDoubleBuffer(stmt, 2) stmt =", "Software Foundation (ASF) under one # or more contributor license", "more contributor l...
[ "with pressure #data r=requests.post('http://127.0.0.1:8080/function/sensor',data) print(r.text) sense=SenseHat() sense.show_message(r.text) except KeyboardInterrupt: sys.exit()", "smbus import time while True: try: pressure=0 sense = SenseHat()", "data = {'pressure':pressure} print(pressure) #send http request...
[ "v ''' invader = r''' /XXXXXX\\ /XXXXXXXX\\ XXXXXXXXXX XX XX", "# Steering. vel = keydir()*50 + tapdir(ship.pos())*4 ship.vel((vel.x,0,0)) # Only", "keys() or 'LCtrl' in keys() or is_tap_close if is_shooting and", "ASCII geometries. shipascii = r''' /\\ /XXXXXXXX\\ v v '''", "/XXXXXXXX\\ XXXXXXXXXX XX XX XX...
[ "2048, 3, stride=1, dilation=exit_block_dilations[1], BatchNorm=BatchNorm) self.bn5 = BatchNorm(2048) # Init", "torch.rand(1, 3, 512, 512) output, low_level_feat = model(input) print(output.size()) print(low_level_feat.size())", "dilation=middle_block_dilation, BatchNorm=BatchNorm, start_with_relu=True, grow_fi...
[ "Mail( from_email=from_mail, to_emails=to_mails ) message.dynamic_template_data = { 'name': username, 'title1'", "event1, event2): for user in users: send_mail(DEFAULT_MAIL, user.username, user.email, event1,", "in users: send_mail(DEFAULT_MAIL, user.username, user.email, event1, event2) def send_mail(from_mail...
[ "heatmap if necessary and modifying the aspect ratio. Does not", "X. If a user passes feature names in, those features", "X, y=None, **kwargs): \"\"\" Calls the internal `transform` method of", "features=None, classes=None, scale=True, projection=2, proj_features=False, colors=None, colormap=None, alpha=0.75,...
[ "bool: return _is_arc_sorted(fsa.get_base()) def has_self_loops(fsa: Fsa) -> bool: return _has_self_loops(fsa.get_base())", "def is_top_sorted(fsa: Fsa) -> bool: return _is_top_sorted(fsa.get_base()) def is_arc_sorted(fsa: Fsa)", "_k2host import _is_acyclic from _k2host import _is_deterministic from _k2host imp...
[ "text = Field() voter_count = Field() def __init__(self, text: str,", "PollOption(TelegramStructure): text = Field() voter_count = Field() def __init__(self, text:", "Field() voter_count = Field() def __init__(self, text: str, voter_count: int", "int ): self.text = \\ Field(text, [str]) self.voter_count = \\"...
[ "# SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class", "Default Color Maps from 'matplotlib' (Lite Version)\"\"\" homepage = \"https://github.com/sjmgarnier/viridisLite\"", "OR MIT) from spack import * class RViridislite(RPackage): \"\"\"viridisLite: Default", "Maps from 'matplotlib' (Lit...
[ "type(data_len) == type([]): data_recv_len.append( [ r, data_len[0] ] ) else:", "dsp_data = DSP( DSP_type = \"DSP_MSG\", universalAesKey = aes_key_pack[\"aes_key\"], nonce", "import time class IPNC(): def __init__(self): pass def _read_yml(self,file =", "\"utf-8\")).digest(), wait = False) if get is not None:...
[ "5): decode_sequence, # Search result done (1, 7): decode_sequence, #", "False elif pyasn1_version <= '0.3.7': def encodeValue(self, value, encodeFun, **options):", "def decode_sequence(message, start, stop, context_decoders=None): decoded = [] while start", "is free software: you can redistribute it and/or m...
[ "nl=tf.nn.relu, out_channel=32): x = Conv2D('conv0', x) x = Conv2D('conv1', x)", "dict of dict: ``dict[layername] = {arg: val}`` \"\"\" if len(_ArgScopeStack)", "collections import defaultdict import tensorflow as tf _ArgScopeStack = []", "val}`` \"\"\" if len(_ArgScopeStack) > 0: return _ArgScopeStack[-1] el...
[ "as f: raw_data = f.read() re_table = textfsm.TextFSM(template) data =", "= open(template_file) with open(\"datafile\") as f: raw_data = f.read() re_table", "a.write(intstatus) a.close() template_file= \"ifconfig-template.template\" template = open(template_file) with open(\"datafile\") as", ": x[0].split(':'...
[ "32, 32)) screen.blit(pygame.image.load('Images/explosion.png'), (self.leftcheck+16, self.rect.y)) self.expboxlist.append(pygame.Rect(self.leftcheck+16, self.rect.y, 32, 32)) if", "1 >= 21: self.walkCount = 0 screen.blit(self.p2walkRight[self.walkCount // 3], (self.rect.x,", "pygame.image.load('Images/p1left1.p...
[ "self.modules[index_A] = temp_A self.modules[index_B] = temp_B self.module_map[module_A] = index_B self.module_map[module_B]", "are replaced) \"\"\" temp = rel_path.split('/', 1)[-1] if \"$(INSTALL)\" in", "of ADCore \"\"\" return self.get_module_by_name('ADCORE').version def swap_module_positions(self, module_...
[ "form.instance email = form.cleaned_data['email'] msg = settings.INVITE_MESSAGE % { 'user':", "sid=sid) if not invite: return {'redirect': 'core:ufo'} form = InviteRegisterForm(request.POST", "request.user.api_key.generate_key() request.user.api_key.save() key = request.user.api_key.key return {'success': True,...
[ "the structured fields will be ignored in the requests and", "backup frequency. returned: on success type: str sample: ONE_HOUR offset_type:", "backup start time should be shifted from the default interval", "name. Does not have to be unique, and it's changeable.", "resource. Each key is predefined and scop...
[ "<reponame>mhozza/pi-control<gh_stars>0 from django.apps import AppConfig class ServerStatsConfig(AppConfig): name = \"server_stats\"" ]
[ "# Every cache key will get prefixed with this value", "item in the sequence is a four item sequence. #", "data has been created. This is where any custom order", "# production. Best set to ``True`` in local_settings.py DEBUG =", "_ SECRET_KEY = <KEY>' ###################### # CARTRIDGE SETTINGS # #########...
[ "accepted = list(\"abcdefghijklmnopqrstuvqwxyz\") + ['\\n'] for i in range(len(dataset)-1): #", "print(\"Dataset must be > 0\") matrix = [] for i", "in accepted and dataset[i] in accepted): if dataset[i] in accepted:", "in range(len(dataset)-1): # if (dataset[i+1] in accepted and dataset[i] in", "for o in c...
[ "mipmaps NEAREST_MIPMAP_LINEAR = 0x2702 #: Texture interpolation: Minification filter for", "function ONE = 0x0001 #: Blend function SRC_COLOR = 0x0300", "An estimate of the number of bits of subpixel resolution", "number of individual floating-point, integer, or boolean values that #:", "fragment shader so...
[ "British Columbia Licensed under the Apache License, Version 2.0 (the", "db.Column(db.Integer, nullable=True) number_of_students = db.Column(db.Integer, nullable=True) exam_method = db.Column(db.String(15), nullable=False)", "notes = db.Column(db.String(400), nullable=True) exam_received_date = db.Column(db.Dat...
[ "<filename>leetcode/1672 Richest Customer Wealth.py class Solution(object): def maximumWealth(self, accounts): \"\"\"", ":rtype: int \"\"\" # Runtime: 36 ms # Memory: 13.5", "\"\"\" :type accounts: List[List[int]] :rtype: int \"\"\" # Runtime: 36", "# Runtime: 36 ms # Memory: 13.5 MB return max(map(sum,", "...
[ "= helper(extra_attrs=['special', 'data_custom', 'fake'], **kwargs) output = secondary_helper(data, **internals) expected_output", "to be null. output = secondary_helper(None) self.assertEqual(output, \"\") def test_format(self):", "data-value=\"1\" data-xeditable=\"xeditable\"> ExampleModel 1 </a> \"\"\" self....
[ "traceback.TracebackException.from_exception(orig_error).format()) await ctx.send(error_msg) # 起動時のメッセージの関数 async def ready_greet(): channel =", "async def giratina(ctx): await ctx.send('https://img.gamewith.jp/article/thumbnail/rectangle/36417.png') # bokuseku.mp3 流し逃げ - https://qiita.com/sizumita/items/cafd00fe...
[ "# Server health check record _push_record(_SERVER_HEALTH_CHECK_RECORD_NAME, dns.Record_A(_SERVER_HEALTH_CHECK_RECORD_DATA, ttl=0)) soa_record =", "'of run_tests.py.')) argp.add_argument( '--add_a_record', default=None, type=str, help=('Add an A record", "2.0 (the \"License\"); # you may not use this file", "...
[ "-*- \"\"\" Showcases *ICTCP* *colour encoding* computations. \"\"\" import numpy", "BT.2020\" colourspace to \"ICTCP\" colour ' 'encoding given \"RGB\" values:\\n'", "encoding* computations. \"\"\" import numpy as np import colour from", "0.04091952]) message_box(('Converting from \"ITU-R BT.2020\" colourspa...
[ "= models.ForeignKey( 'Routine', related_name='routines', on_delete=models.CASCADE) def sets(self): return SetRoutine.objects.filter(routine=self) class", "'Routine', related_name='routines', on_delete=models.CASCADE) def sets(self): return SetRoutine.objects.filter(routine=self) class Routine(models.Model): name...
[ "nemo_u = coast.Gridded(fn_data=fn_nemo_dat_u, fn_domain=fn_nemo_dom, config=fn_config_u_grid) nemo_v = coast.Gridded(fn_data=fn_nemo_dat_v, fn_domain=fn_nemo_dom, config=fn_config_v_grid)", "N 15 W) and (56 N, 12 W) using the", "coordinates): Creating them and performing some custom diagnostics with them.", ...
[ "``b`` are integers. In particular, since Python considers ``True`` and", "(B | C | ...) & ...). If simplify is", "does so in terms of structural equality rather than mathematical,", "Includes 0, 1 argset.discard(x) argset.add(True if x else False) rel", "-2) U (2, oo] \"\"\" from ..sets import Union if", ...
[ "and int(each_count) > 0: if int(each_count) % 10 == 0:", "goods_data.drop_duplicates(subset=['r','评价数量'],inplace=True) for each_asin, each_count in zip(goods_data['ASIN'][5:50], goods_data['goods_review_count'][5:50]): if each_asin and", "each_view in view_con: # 评价人 view_name = each_view.xpath('.//span[@class...
[ "numpy as np from pathlib import Path def extract_param(data, n_states):", "data[f\"sp_{n_states}\"] return y, sp, param @pytest.fixture(scope=\"session\") def trace_simple(request): \"\"\"Trace data", "trace_simple(request): \"\"\"Trace data can be generated by running ./data/generate_trace_data.py \"\"\"", ...
[ "time.sleep(random.random()) return arg def pipeline(future): pools[1].submit(worker, future.result()).add_done_callback(printer) def printer(future): pools[2].submit(worker,", "pools[1].submit(worker, future.result()).add_done_callback(printer) def printer(future): pools[2].submit(worker, future.result()).add_do...
[ "-m digibujogens ... \"\"\" def main(): \"\"\" Execute the application.", "\"\"\" raise NotImplementedError # Make the script executable. if __name__", "# Make the script executable. if __name__ == \"__main__\": raise", "\"\"\" Main application entry point. python -m digibujogens ... \"\"\"", "Make the scri...
[ "user code. :type plat_info: lisa.platforms.platinfo.PlatformInfo You need to provide the", "abritrary code execution. \"\"\".format( script=os.path.basename(sys.argv[0]) ))) parser.add_argument(\"--conf\", '-c', help=\"Path to", "avoids messing up with ``devlib`` internal members. \"\"\" ADB_PORT_DEFAULT =", ...
[ "GetNodeInfoCommand(FilterCommand): \"\"\" Executes `getNodeInfo` command. See :py:meth:`iota.api.StrictIota.get_node_info`. \"\"\" command =", "] class GetNodeInfoCommand(FilterCommand): \"\"\" Executes `getNodeInfo` command. See :py:meth:`iota.api.StrictIota.get_node_info`. \"\"\"", "GetNodeInfoRequestFilter(...
[ "request) if controller.usuarioIniciado() and request.method== 'GET': return controller.mostrarRutinas(mysql, request) else:", "return redirect(url_for('Index')) def registrarEliminacion(mysql, request): if request.method=='POST' and controller.usuarioIniciado(): return", "ejercicios=datosEjer, rutinaEjer=rutin...
[ "assert m._new_format is False assert m._result_name == 'completions' def test_new_format_load():", "= Matcher(new_format=False) m.load(r\"./tests/test_data/test_old_format.json\") assert m._new_format is False assert m._result_name ==", "0 def test_old_format_load(): m = Matcher(new_format=False) m.load(r\"./t...
[ "internal_cleanup_func(): cleanup_func(*args, **kwargs) else: internal_cleanup_func = cleanup_func current_frame = self._stack[0]", "Without dropping the last context layer. except Exception: cleanups_failed =", "= os.path.abspath(base_dir) # supplied path might be to a feature", "if os.path.isfile(os.path.jo...
[ "datetime import datetime tileCount = 20 def setup(): global savePDF,", "(colorLeft == color(0)): colorLeft = color(323, 100, 77) else: colorLeft", "import random from datetime import datetime tileCount = 20 def", "if savePDF: beginRecord(PDF, datetime.now().strftime(\"%Y%m%d%H%M%S\")+\".pdf\") background(255...
[ "in the dbt project and its dependencies' )) ) sources:", "if package is None: if not pkg_dct: return None else:", "field(metadata=dict( description='A list of the disabled nodes in the target'", "metadata={'serialize': lambda x: None, 'deserialize': lambda x: None} ) _lock:", "this until you're done with b...
[ "schema schema_016; ALTER DEFAULT PRIVILEGES for role default016_01 in schema", "CONSTRAINTS ; ALTER DEFAULT PRIVILEGES for role default016_01 revoke select,insert,update,truncate,references,TRIGGER,DELETE", "cascade; drop function if exists test_default_016(int) cascade; drop schema if", "revoke select,inser...
[ "detectedclosed else 'false' } } if domainname is not None:", "Shadows API. :param view: InfrastructureView :return: Infrastructure generator \"\"\" if", "severities is None else severities, 'alerted': 'true' if alerted else", ".ds_base_service import DSBaseService from .ds_find_service import DSFindService f...
[ "os import sys import tempfile import yaml import zipfile import", "protein_accession: str = \"\" def get_fields(self): return [self.feat_type, self.name, self.range_start,", "from google.protobuf import json_format from ncbi.datasets.v1alpha1 import dataset_catalog_pb2 from ncbi.datasets.v1alpha1.reports", "...
[ "Meta: unique_together = ('trip', 'stop',) class Capacity(models.Model): trip = models.ForeignKey(Trip)", "stop_time = models.ForeignKey(StopTime) service_date = models.ForeignKey(ServiceDate) capacity1st = models.IntegerField('capacity1st', null=True,", "Route, Service, ServiceDate, Shape, ShapePoint, Stop, St...
[ "* except ImportError: pass PORT = 9028 SERVICE_NAME = 'interface'", "from public_config import * except ImportError: pass PORT = 9028", "public_config import * except ImportError: pass PORT = 9028 SERVICE_NAME", "try: from public_config import * except ImportError: pass PORT =", "import * except ImportErro...
[ ".models import Pokemon from .serializers import PokemonSerializer from .filters import", "queryset = Pokemon.objects.all() serializer_class = PokemonSerializer @method_decorator(cache_page(7200)) def get(self, request,", "from .models import Pokemon from .serializers import PokemonSerializer from .filters", ...
[ "create address with username as param tmp = self.get_parentcfg( cfg,", "ServerHumansNormalizer(pluginref), ] super(ServerUsersNormalizer, self).__init__( pluginref, *args, **kwargs ) @property def", "my_group = self.get_parentcfg(cfg, cfgpath_abs) my_group = '/'.join(my_group['role_abspath']) for (k,ul) in", ...
[ "conexao com DynamoDB\") logging.CRITICAL(\"Problema na conexao com DynamoDB\") return False", "DyConnect: def __init__(self, table, region): self.table = table self.region =", "Dynamodb \"\"\" import boto3 import botocore import logging import datetime", "'details' in stages['Item']: return stages['Item']['d...
[ "scrapy_ddiy.utils.spiders.ddiy_base import DdiyBaseSpider class GlidedSky001Spider(DdiyBaseSpider): name = 'glided_sky_001' description =", "爬虫-基础1' start_url = 'http://www.glidedsky.com/level/web/crawler-basic-1' custom_settings = { 'COOKIES_ENABLED': True, 'DOWNLOADER_MIDDLEWARES':", "description = 'GlidedSk...
[ "attribute is \"shape\" and there are three possible shapes, then", "\"iid\" or \"comp\" dataset_dir: The base directory of the dataset", "2.0 (the \"License\"); # you may not use this file", "instructions for reading 2D shapes data. Args: split_name: A train/test", "For example, if the first attribute is \...
[ "os.path.join(self.path, f\"{step:010d}_{score}.gif\") imageio.mimwrite(write_path, frames, fps=60) optimize(write_path) print(f\"...Record episode to {write_path}...\")", "key, value, step) self.writer.add_scalar(\"all/\" + key, value, step) if \"score\"", "len(frames) > 0: score = scalar_dict[\"score\"] write...
[ "driver UNI interface configuraton ''' import GlobalModule from EmCommonLog import", "%(vip_ip_address)s\" self._append_add_command(comm_txt, parame) if self.is_active: comm_txt = \"standby %(hsrp_id)s priority", "vip_ip_address self.hsrp_id = hsrp_id self.mtu = mtu self.is_active = is_active", "mtu self.is_a...
[ "images requires Pillow installation, please install it before usage\" )", "Corporation Licensed under the Apache License, Version 2.0 (the \"License\");", "if file not found content_errors.append('{}: does not exist'.format(self.converted_images_dir / identifier))", "not None and index % progress_interval ==...
[ "the action that has raised this error exc: Caught exception", "import config import log import logging import sys import wx", "\"\"\"Wrapper for creating a L{BugReport} dialog and show the given", "return exc_type = exc.__class__.__name__ exc_msg = str(exc) header = self.st_header.GetLabel()", "exc_type = ...
[ "email_from, recipient_list ) mail.send() c=1 m=\"your password is changed succesfully\"", "= 'QRcode scanner for license Forget password' message = \"Password", "document_last=Document.objects.values_list('document')[document_count-1] document_name=document_last[0] print(email) t=Document.objects.last() num_li...
[]
[ "query = input(\">> \") if 'exit' in query: exit() else:", "exit by type exit\\n') while True: query = input(\">> \")", "from chatterbot import ChatBot from chatterbot.trainers import ChatterBotCorpusTrainer form termcolor", "ChatterBotCorpusTrainer(chatbot) trainer.train('chatterbot.corpus.english') cprint(\...
[ "mask = c[1] else: address = c[0][c[0].index(\"[\")+1:len(c[0])-1] binaryValue = decimalToBinary(int(c[1]))", "the bit in the value unchanged. For example, consider the", "runs this port isn't compatible with the docking program on", "\"r\") def processData(file): data = [] for x in f:", "overwrites the cor...
[ "definition if self.free_point: item = turn_into_free_point(item, self.scene) self.scene.project_data.add(item) A =", "self.scene = scene self.sides = 3 self.free_point = False self.data", "self).__init__() self.ui = uic.loadUi('regularpolygon.ui', self) self.scene = scene self.sides =", "def hslider_sides_fu...
[ "def test_set_qos(self): self.network.set_backhaul(QoS.minimum_qos_dict) self.assertEqual(self.network.get_backhaul(), QoS(QoS.minimum_qos_dict)) def test_qos_from_distance(self): self.assertEqual(self.network.get_qos_from(5).get_formated_qos(), self.parameters.get('worst_qos')) self.assertEqual(self.network.get_qo...
[ "----') models.Inventory.objects.create(name='Example', hosts_file='web_nornir/nornir_config/example_config/hosts.yaml', groups_file='web_nornir/nornir_config/example_config/groups.yaml', type=1) models.Inventory.objects.create(name='INS Lab', hosts_file='web_nornir/nornir_config/inslab_config/hosts.yaml', groups_f...
[ "distro def get_distro_info(root_dir): # We point _UNIXCONFDIR to root_dir old_value", "LinuxDistribution distro information is done in a lazy way. #", "before we restore the old value of _UNIXCONFDIR. _ =", "the old value of _UNIXCONFDIR. _ = obj.info() distro._UNIXCONFDIR =", "root_dir old_value = distro....
[ "2.0 (the \"License\"); # you may not use this file", "\"action chains\" (https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/common/action_chains.py). # These do not quite work for", "[] return self @property def json_wire_gestures(self) -> Dict[str, Union[List, str]]:", "self._touch_actio...
[ "= points[i, 1] p_z = points[i, 2] u = int(((p_x", "ffmpeg -r 10 -i ./filtered_{}_%d.png -vcodec mpeg4 -y {}.mp4\".format( self.output_path,", "tag := tensorboard tag epoch := tensorboard epoche store :=", "self.seq_data = seq_data self.images_path = images_path self.output_path = output_path def", "output_...
[ "tree.append(temp.right) else: self.temp.append(None) #print(\"trabylary\",self.tree) self.traByLayer(tree) def serialize(self, root): \"\"\"Encodes a", "if r==[] or data==[]: return root = r.pop(0) datalen =", "你可以将以下二叉树: 1 / \\ 2 3 / \\ 4 5", "TreeNode :rtype: str \"\"\" if root==None: return '' tree =", ...
[ "\"mandatory\": ( \"dimensions\", ), \"validators\": { 1: IPUZ_WORDSEARCH_VALIDATORS, }, },", "\"http://ipuz.org/fill\": { \"mandatory\": (), \"validators\": { 1: IPUZ_FILL_VALIDATORS, }, },", "\"puzzle\", ), \"validators\": { 1: IPUZ_CROSSWORD_VALIDATORS, }, }, \"http://ipuz.org/fill\": {", "}, }, \"http://i...
[ "request.get_json() data[\"id\"] = user_id schema = UserSchema(view=\"admin\", instance=user, partial=True) response", "UserPublicFails(Resource): @check_account_visibility @check_score_visibility def get(self, user_id): user = Users.query.filter_by(id=user_id).first_or_404() if", "count}} @users_namespace.rout...
[ "few pages. n_pages = 5 for i in range(n_pages): page", "page_name(i), prefix=str(i)) # Setup main app layout. app_shell = [html.H1(\"App", "n_pages = 5 for i in range(n_pages): page = make_page(i)", "page.layout = html.Div([html.H2(f\"Page {i}\"), html.Button('Click me!', id='btn'), html.Div(id='log')]) @pag...
[ "'limit': 'param/messages_limit', 'echo': 'param/echo', 'include_claimed': 'param/include_claimed', }, 'hints': { 'allow':", "{ 'href-template': '/v2/queues/{queue_name}/messages', 'href-vars': { 'queue_name': 'param/queue_name', }, 'hints': {", "'limit': 'param/queue_limit', 'detailed': 'param/detailed', }, 'h...
[ "containing code that created the new file. May or may", "bitwise concatenation of the major, minor and patch levels. Prerelease", "triggered the signature hit.', }), ('sig', ('it:av:sig', {}), { 'ro':", "('comp', {'fields': ( ('app', 'it:prod:soft'), ('intent', 'it:os:android:intent'))}), { 'doc': 'The", "...
[ "class TestRoutes(unittest.TestCase): \"\"\"Test routes.\"\"\" ignore_routes = ('/static/<path:filename>',) ignore_end_patterns = ('>',)", "\"\"\"Smoke test routes to ensure no runtime errors..\"\"\" routes =", "bool: True if valid, else False. \"\"\" if route in", "up: Put Flask app in test mode.\"\"\" app =...
[ "currentDirectories = line.split(os.sep) if directory in currentDirectories: found = True", "format on 'f' file.\"\"\" return subprocess.check_output(['clang-format', '-style=file', f]) def test_clang_format_is_correctly_installed(self):", "'include/controller', 'projects', 'resources/projects', 'resources/wren...
[ "self.mock.log_error.assert_has_calls( [mock.call('Failed to clear directory dir.')]) self.assertEqual(0, self.mock.log_warn.call_count) self.mock.system.assert_has_calls( [mock.call('rm", "posix platforms.') def test(self): self.assertEqual('/bin/ls', shell.which('ls')) class ClearSystemTempDirectoryTest(fake_fi...
[ "False: return out3 else: out4 = self.Layers[3](out3) return out4 def", "embedding_dim self.embeddings = tf.keras.layers.Embedding(self.vocab_size, self.embedding_dim, weights = [embedding_matrix], trainable=False, name='embeddings')", "out1 = self.Layers[0](inp) out2 = self.Layers[1]([inp, out1]) out3 = self.L...