ngram
listlengths
0
67.8k
[ "= vidcap.read() count = -1 saved = 0 print(f'Processing: {video_path}') while success: count", "required=True, help='''Path to a single video or a folder. If path to folder", "count + start parser = argparse.ArgumentParser( description='build a \"frame dataset\" from a given", "videos = [args.input] else: ra...
[ "# Blog post: https://parsiya.net/blog/2019-04-06-hiding-options-an-adventure-in-dealing-with-burp-proxy-in-an-extension/ # support for burp-exceptions - see https://github.com/securityMB/burp-exceptions try: from", "if requestInfo.getMethod() != \"OPTIONS\": return # get response info responseInfo = self.utils.g...
[ "self.request.get(_ADMIN_PARAM).lower() == 'true' continue_url = self.request.get(CONTINUE_PARAM) login_url = self.request.path_url if action: redirect_url =", "cookie_name=_COOKIE_NAME): \"\"\"Gets the requestor's user info from an HTTP Cookie header. Args: http_cookie:", "# limitations under the License. # \"...
[ "base class for JobServers run as an external process.\"\"\" def __init__(self): self._local_temp_root =", "self.subprocess_cmd_and_endpoint() port = int(endpoint.split(':')[-1]) self._server = subprocess_server.SubprocessServer( beam_job_api_pb2_grpc.JobServiceStub, cmd, port=port) return self._server.start() de...
[ "{k: 'scipy.constants.' + v for k, v in _known_constants_scipy_constants.items()} def _print_SparseMatrix(self, expr): i,", "'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield', 'None' # 'None' is", ":'not_equal', '<' :'less', '<=' :'less_equal', '>' :'greater', '>=' :'greater_equal', } if e...
[ "__init__(self, model_list): self.model_list = model_list self.args = self.get_input_arguments() self.validate_arguments() def get_input_arguments(self): parser =", "import argparse, os class ArgumentManager: def __init__(self, model_list): self.model_list = model_list self.args =", "== \"training\" or task == ...
[ "import common import hashlib import os projectDir = os.environ.get('LDPC') if projectDir == None:", "projectDir) FILE_HANDLER_INT_DATA_TYPE = np.int32 GENERAL_CODE_MATRIX_DATA_TYPE = np.int32 NIBBLE_CONVERTER = np.array([8, 4, 2, 1],", "14: h = 'E' elif n== 15: h = 'F' else: h =", "np.hstack((bLeft, bRight))...
[ "def test_configurations_data_format_log(sdc_executor, sdc_builder, aws, data_format, log_format): \"\"\"Check whether S3 origin can parse different", "trash = builder.add_stage('Trash') pipeline_finisher_executor = builder.add_stage('Pipeline Finisher Executor') pipeline_finisher_executor.set_attributes(stage_re...
[ "signature.append(\"C_\" + str(self._hyperparameters['C'])) signature.append(\"epsilon_\" + str(self._hyperparameters['epsilon'])) signature.append(\"gamma_\" + str(self._hyperparameters['gamma'])) signature.append(\"kernel_\" + str(self._hyperparameters['kernel'])) signature.append(\"degree_\"", "command line an...
[ "on 12 May 2017 @author: <NAME> (<EMAIL>) \"\"\" from scs_host.sys.host_gpio import HostGPIO #", "NotImplementedError() # ---------------------------------------------------------------------------------------------------------------- @property def state(self): raise NotImplementedError() def wait(self, edge): ra...
[ "class Unsubclassable: def __init_subclass__(cls, **kwargs): raise TypeError('Unacceptable base type') def prevent_subclassing(): raise TypeError('Unacceptable", "type') def final_class(cls): setattr(cls, '__init_subclass__', prevent_subclassing) return cls class UnsubclassableType(type): def __new__(cls, name,",...
[ "from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals #", "from archi.classic import L4 as ARCHI from ...my_argparser import TP_parse_args from collections import", "(self.tes, self.jes, self.tes, self.mu) self.nuisance_params = OrderedDict([ ('tes', sel...
[ "self.open = Mock(return_value=self.fakeFile) self.fakeAdapter = Mock(open=self.open, ls=self.ls) self.adl = ADL() self.adl._create_adapter = Mock(return_value=self.fakeAdapter)", "self.fakeFile self.open = Mock(return_value=self.fakeFile) self.fakeAdapter = Mock(open=self.open, ls=self.ls) self.adl = ADL() self....
[ "from .forms import CustomUserCreationForm class SignUpView(CreateView): form_class = CustomUserCreationForm success_url = reverse_lazy('login') template_name", "<reponame>AnvarKhan/django-python from django.views.generic import CreateView from django.urls import reverse_lazy from .forms import CustomUserCreation...
[ "try: from typing import * # noqa: F401, F403 except ImportError: from .typing_stubs", "typing import * # noqa: F401, F403 except ImportError: from .typing_stubs import *", "F401, F403 except ImportError: from .typing_stubs import * # type: ignore # noqa:", "from typing import * # noqa: F401, F403 except Impo...
[ "A variant of dropout layer that consistently drops out the same parameters over", "if not self.training or self.dropprob == 0: return x masksize = [y for", "them to be a replacement state. Note that this layer assumes the last", "return res def extra_repr(self): return 'p={}'.format(self.dropprob) class Lock...
[ "'rb') as f: reader = PdfFileReader(f, strict=False) print(reader.numPages) if reader.isEncrypted: reader.decrypt('') current_page =", "Version: 0.1 Author: BDFD Date: 2018-03-26 \"\"\" from PyPDF2 import PdfFileReader with open('./res/Python课程大纲.pdf',", "Date: 2018-03-26 \"\"\" from PyPDF2 import PdfFileReader...
[ "return QTest.qWait(1000) indent = ' ' * indent_level rs = requests.get(url) root =", "import BeautifulSoup from console import get_inherited_children, ROOT_URL class MainWindow(qtw.QMainWindow): def __init__(self): super().__init__() self.setWindowTitle('qt__class_tree__parse_and_print__recursively__from__doc_qt...
[ "OF ANY KIND, either express or # implied. See the License for the", "self.getcsrf(form) data = urllib.parse.urlencode(param).encode(\"utf-8\") req = urllib.request.Request(self.url+form, data) return urllib.request.urlopen(req) def login(self): if", "Unless required by applicable law or agreed to in writing, s...
[ "for i in range(len(self.database.services)): self.assertEqual(database2.services[i].service_name, self.database.services[i].service_name) self.assertEqual(database2.services[i].username, self.database.services[i].username) self.assertEqual(database2.services[i].password, self.database.services[i].password) def tea...
[ "for jinja includes. # We want to search into the 'templates' subdir of", "run(self, terms, variables, **kwargs): convert_data_p = kwargs.get('convert_data', True) lookup_template_vars = kwargs.get('template_vars', {}) ret", "search paths. newsearchpath = [] for p in searchpath: newsearchpath.append(os.path.joi...
[ "recursively\", license=\"MIT\", classifiers=[ 'Topic :: Utilities', 'Environment :: Console', 'Natural Language :: English',", "dirname setup( name=\"fant_sizer\", version=\"0.7\", author=\"<NAME>\", author_email=\"<EMAIL>\", description=\"fant_sizer command-line file-information\", url=\"https://github.com/ripi...
[ "0 for i, c in enumerate(choco_col): accum += c if accum == num_choco_v:", "__name__ == '__main__': T = int(input()) for t in range(T): print('Case #{}: {}'.format(t+1,", "for c in V_idx: num = 0 for i in range(r_from, r+1): for", "!= num: return 'IMPOSSIBLE' c_from = c+1 r_from = r+1 return 'POSSIBLE' if", ...
[ "finish.append(MR_CLUSTERS['default'].LOGICAL_NAME.set_for_testing('jobtracker')) clear_sys_caches() fs = cluster.get_hdfs() jt = cluster.get_next_ha_mrcluster()[1] final_properties = properties.copy() final_properties.update({ 'jobTracker':", "assert_equal(final_properties, submission.properties) clear_sys_cache...
[ "optim.Adam(netS.parameters(), lr=opt.lr_s, betas=(opt.beta1, 0.999)) schedulerD = torch.optim.lr_scheduler.MultiStepLR(optimizer=optimizerD, milestones=[opt.niter * 0.8], gamma=opt.gamma) schedulerG =", "iteration D_real2plot.append(D_x) ## discriminator loss on real D_fake2plot.append(D_G_z + D_S_z) ## discrimi...
[ "an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND,", "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "j: C[j] = B[j] + 1 stmt = ib.get() stmt = tvm.tir.ir_pass.InjectDoubleBuffer(stmt, 2)", "express or implied. See the License for the # specific language gov...
[ "import time while True: try: pressure=0 sense = SenseHat() pressure = sense.get_pressure() data", "request to sense serverless function 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", "import SenseHat import sm...
[ "while loop(): # Steering. vel = keydir()*50 + tapdir(ship.pos())*4 ship.vel((vel.x,0,0)) # Only move", "pos=(x*25-130,0,100-y*20), col=rndvec().abs(), physmesh=True)) for invader in invaders: invader.vel(invaderspeeds[0]) while loop(): # Steering. vel", "physmesh=True)) for invader in invaders: invader.vel(inv...
[ "grow_first=True) self.block19 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) # Exit", "planes, 3, 2, BatchNorm=BatchNorm)) rep.append(BatchNorm(planes)) if stride == 1 and is_last: rep.append(self.relu) rep.append(SeparableConv2d(pl...
[ "\"utf-8\" DEFAULT_MAIL=\"<EMAIL>\" def link(urlsafe): return \"https://develop-dot-autonomus.appspot.com/events/details?event_id=\" + urlsafe def send_newsletter(users, event1, event2): for", "= '<KEY>' API_KEY_ID = '<KEY>' ENCODING = \"utf-8\" DEFAULT_MAIL=\"<EMAIL>\" def link(urlsafe): return \"https://develop...
[ "or set heatmap=False on the visualizer\" ) ) # Create the new axes", "used to specify the colors of the points. Returns ------- self.ax : matplotlib", "and 3D PCA Visualizer ########################################################################## class PCA(ProjectionVisualizer): \"\"\" Produce a two or three...
[ "_k2host import _is_arc_sorted from _k2host import _has_self_loops from _k2host import _is_acyclic from _k2host", "../../../LICENSE for clarification regarding multiple authors import torch from torch.utils.dlpack import to_dlpack from", "_is_deterministic from _k2host import _is_epsilon_free from _k2host impor...
[ "voter_count = Field() def __init__(self, text: str, voter_count: int ): self.text = \\", "TelegramStructure, Field class PollOption(TelegramStructure): text = Field() voter_count = Field() def __init__(self, text:", "PollOption(TelegramStructure): text = Field() voter_count = Field() def __init__(self, text: s...
[ "RViridislite(RPackage): \"\"\"viridisLite: Default Color Maps from 'matplotlib' (Lite Version)\"\"\" homepage = \"https://github.com/sjmgarnier/viridisLite\" url", "import * class RViridislite(RPackage): \"\"\"viridisLite: Default Color Maps from 'matplotlib' (Lite Version)\"\"\" homepage", "Developers. See th...
[ "= port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, 1 ) self.sock.setblocking(0) self.sock.bind((self.address,self.port))", "in ini[0]: try: data_len = pickle.loads(base64.b64decode(r.recv(32).decode().strip(\"0\").encode(\"utf-8\")))...
[ "stop, context_decoders=None): return False if message[start: stop] == 0 else True def decode_bind_response(message,", "message[start: stop] == 0 else True def decode_bind_response(message, start, stop, context_decoders=None): return decode_sequence(message,", "encoding Boolean with the value 0xFF for TRUE # TH...
[ "wrapped_init(self, *args, **kwargs): actual_args = copy.copy(get_arg_scope()[cls.__name__]) actual_args.update(kwargs) instance = original_init(self, *args, **actual_args) return", "input/output tensor shape is displayed during logging. Returns: The decorated function. \"\"\" original_init", "during logging. R...
[ "= { 'Interface' : x[0].split(':')[0], 'TX' : int(x[1])+int(random.randint(1,100)) } NL.append(NLD) print(NL) import json", "'Interface' : x[0].split(':')[0], 'TX' : int(x[1])+int(random.randint(1,100)) } NL.append(NLD) print(NL) import json print('#'*12) print(json.dumps(NL))", "NL = [] for x in data: NLD = { ...
[ "= self.rect.y - 32 self.downcheck = self.rect.y + self.height self.expleft = True self.doubleexpleft", "self.walkCount += 1 elif self.back: if self.shield: if self.change_y == 0: screen.blit(pygame.image.load('Images/p1backshield.png'), (self.rect.x,", "pygame.image.load('Images/death2.png'), pygame.image.load...
[ "base_path : str abs path to install location of EPICS base support_path :", "def get_printable_string(self): \"\"\"Function that gets a toString for an InstallConfigurations Returns ------- str", "level install_location, the path to the configuration files, any OS specific configurations, and", "0)\\n' \\ 'd...
[ "or None) if request.method == \"POST\": if form.is_valid(): user = form.save(commit=False) user.set_password(form.cleaned_data['password']) user.save()", "subject=unicode(_('You have been invited to b3ban service')), message=unicode(msg), from_email=settings.EMAIL_FROM, recipient_list=[email] ) invite.save() ret...
[ "list_resources(self): optional_list_method_params = [ \"compartment_id\", \"display_name\", ] optional_kwargs = dict( (param, self.module.params[param]) for", "ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils import ( OCIResourceFactsHelperBase, get_custom_class, ) try: from oci.core import...
[]
[ "# used to render the admin dashboard. # # DASHBOARD_TAGS = ( #", "STATIC_URL + \"media/\" # Absolute filesystem path to the directory that will hold", "confirmation step before # completion. # SHOP_CHECKOUT_STEPS_CONFIRMATION = True # Controls the formatting", "try and use something # project specific. CACHE...
[ "accepted and dataset[i] in accepted): if dataset[i] in accepted: val2 = i+1 while", "> 0\") matrix = [] for i in consts.rang: matrix.append([]) for o in", "in consts.rang: matrix[i].append(0) dataset = dataset.lower() accepted = list(\"abcdefghijklmnopqrstuvqwxyz\") + ['\\n'] for i", "import preprocessing de...
[ "``GL_NEAREST``, ``GL_LINEAR``, ``GL_NEAREST_MIPMAP_NEAREST``, ``GL_LINEAR_MIPMAP_NEAREST`` ``GL_NEAREST_MIPMAP_LINEAR``, ``GL_LINEAR_MIPMAP_LINEAR`` Magnifying filters: ``GL_NEAREST``, ``GL_LINEAR`` :param Tuple[int, int]", "\"\"\" return Query(self) class ContextStats: def __init__(self, warn_threshold=100): se...
[ "db.ForeignKey(\"booking.booking_id\", ondelete=\"set null\"), nullable=True) exam_type_id = db.Column(db.Integer, db.ForeignKey(\"examtype.exam_type_id\"), nullable=False) office_id = db.Column(db.Integer, db.ForeignKey(\"office.office_id\"),", "= db.Column(db.Integer, primary_key=True, autoincrement=True, nulla...
[ "class Solution(object): def maximumWealth(self, accounts): \"\"\" :type accounts: List[List[int]] :rtype: int \"\"\" #", "Customer Wealth.py class Solution(object): def maximumWealth(self, accounts): \"\"\" :type accounts: List[List[int]] :rtype: int", "Wealth.py class Solution(object): def maximumWealth(self,...
[ "self.assertEqual(output, '<a href=\"#1\">RelatedModel object</a>') # Verify ``key`` access version of custom text output", "\"\"\" Verifies that format_date works. \"\"\" helper = helpers.format_date # Verify simple use", "Verify that None objects get swallowed without complaint. # This helps promise that", ...
[ "if message.author.bot: return # ドナルドの言葉狩り - https://qiita.com/sizumita/items/9d44ae7d1ce007391699 # メッセージの本文が ドナルド だった場合 if 'ドナルド'", "await ctx.send('https://img.gamewith.jp/article/thumbnail/rectangle/36417.png') # bokuseku.mp3 流し逃げ - https://qiita.com/sizumita/items/cafd00fe3e114d834ce3 @bot.command() async de...
[ "max_timeouts = 60 * 10 while num_timeouts_so_far < max_timeouts: sys.stdout.flush() time.sleep(sleep_time) num_timeouts_so_far +=", "KIND, either express or implied. # See the License for the specific language", "_push_record(name, dns.Record_TXT(*txt_data_list, ttl=r_ttl)) with open(args.records_config_path) ...
[ "\"ITU-R BT.2020\" colourspace to \"ICTCP\" colour ' 'encoding given \"RGB\" values:\\n' '\\n\\t{0}'.format(RGB))) print(colour.RGB_to_ICTCP(RGB))", "Showcases *ICTCP* *colour encoding* computations. \"\"\" import numpy as np import colour from", "values:\\n' '\\n\\t{0}'.format(RGB))) print(colour.RGB_to_ICTCP(...
[ "<reponame>MauricioAntonioMartinez/django-workout-tracker-api import os import uuid from django.conf import settings # this is how", "variables # for the settings file from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager, PermissionsMixin) from", "from django.core.validators import MaxValue...
[ "N 15 W) and (56 N, 12 W) using the `coast.TransectT` object. This", "variable cross_velocity_mean = tran_f.data_cross_tran_flow.normal_velocities.mean(dim=\"t_dim\") plt.figure() cross_velocity_mean.rolling(r_dim=2).mean().plot.pcolormesh(yincrease=False, y=\"depth_0\", cbar_kwargs={\"label\": \"m/s\"}) plt.show...
[ "are True and the rest are False. Returns False if an even number", "ValueError('ITE expects exactly 3 arguments') if a == true: return b elif a", "@cacheit def args(self): return tuple(ordered(self._argset)) def to_nnf(self, simplify=True): args = [] for a,", "if all arguments are True. Examples ======== >>>...
[ "for each in review_threads: each.start() print(\"队列剩余数量\", self.url_queue.qsize()) for each in review_threads: each.join() except:", "columns=['review_goods', 'review_name', 'review_star', 'review_title', 'review_date', 'review_colour', 'review_size', 'review_body', 'review_useful']) view_goods_pd.drop_duplicate...
[ "\"means\", \"st_devs\") param = {\"n_states\": n_states} for key in keys: param[key] = data[f\"{key}_{n_states}\"]", "\"st_devs\") param = {\"n_states\": n_states} for key in keys: param[key] = data[f\"{key}_{n_states}\"] return", "keys: param[key] = data[f\"{key}_{n_states}\"] return param @pytest.fixture(sco...
[ "for i in range(3): pool = ProcessPoolExecutor(2) pools.append(pool) return pools def shutdownPools(pools): for", "future.result()).add_done_callback(printer) def printer(future): pools[2].submit(worker, future.result()).add_done_callback(spout) def spout(future): print(future.result()) def instanceProcessPool():...
[ "\"\"\" raise NotImplementedError # Make the script executable. if __name__ == \"__main__\": raise", "digibujogens ... \"\"\" def main(): \"\"\" Execute the application. \"\"\" raise NotImplementedError #", "\"\"\" def main(): \"\"\" Execute the application. \"\"\" raise NotImplementedError # Make the", "the ...
[ "designed for quick scripting. \"\"\" parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent( \"\"\" Connect to", "name of the Platform allows this YAML configuration # to not use any", "_DEVLIB_AVAILABLE_MODULES - devlib_excluded_modules # Initialize...
[ "command. See :py:meth:`iota.api.StrictIota.get_node_info`. \"\"\" command = 'getNodeInfo' def get_request_filter(self): return GetNodeInfoRequestFilter() def get_response_filter(self):", "class GetNodeInfoCommand(FilterCommand): \"\"\" Executes `getNodeInfo` command. See :py:meth:`iota.api.StrictIota.get_node_in...
[ "imc=imc, evaluacion=functions.evaluarIMC(imc), pg=functions.porcentajeGrasa(usuario[5], usuario[9], usuario[10], usuario[7], usuario[11]), m_basal=m_basal ) else: return redirect(url_for('Index')) def", "controller.usuarioIniciado(): return redirect(url_for('home')) else: return render_template('Index.html') els...
[ "> 0 def test_old_format_load(): m = Matcher(new_format=False) m.load(r\"./tests/test_data/test_old_format.json\") assert m._new_format is False assert", "matrix = m.get_annotations_agreement() assert matrix is not None assert matrix > 0 def", "test_old_format_agreement_matrix(): m = Matcher(new_format=False) m...
[ "except KeyboardInterrupt: self.aborted = True failed_count += 1 run_feature = False # --", "within the scope of the environment before_all and after_all). .. attribute:: scenario This", "r\"D:\\\" \"\"\" drive, _ = os.path.splitdrive(path) if drive: # -- WINDOWS: return drive", "0 # @property def _get_aborte...
[ "range(tileCount): for gridX in range(tileCount): posX = int(width/tileCount*gridX) posY = int(height/tileCount*gridY) toggle =", "noFill() strokeCap(actStrokeCap) random.seed(actRandomSeed) for gridY in range(tileCount): for gridX in range(tileCount): posX =", "False actStrokeCap = ROUND actRandomSeed = 0 colo...
[ ") @property def doc_lookup(self) -> DocLookup: if self._doc_lookup is None: self._doc_lookup = DocLookup(self)", "CandidateList = self._find_macros_by_name( name=name, root_project_name=root_project_name, filter=filter, ) return candidates.last() def find_generate_macro_by_name( self, component:", "in cache bu...
[ "PRIVILEGES for role default016_01 revoke EXECUTE on functions from default016_01 CASCADE CONSTRAINTS; ALTER", "OPTION ; ALTER DEFAULT PRIVILEGES for role default016_01 GRANT USAGE on TYPES to", "in schema schema_016 revoke ALL on TYPES from {self.username} CASCADE CONSTRAINTS ; ALTER", "GRANT select,insert,u...
[ "# # Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) # from .ds_base_service import DSBaseService from", "None: view = InfrastructureService.infrastructure_view() return self._find_all('/api/ip-ports', view, Infrastructure) def find_all_pages(self, view=None): \"\"\" Streams", "if de...
[ "stop, extra_fields): found_genes = [] feat_types = ('gene', 'pseudogene') for gene in gff3_db.region(seqid=seq_acc,", "*extra_fields, *geneobj.get_fields()]) found_genes.append(geneobj) return found_genes class FindGenesByLoc: default_packages_dir = os.path.join('var', 'data', 'packages') def", "of input data ...
[ "path = models.CharField(max_length=1024, null=True, blank=True) class Meta: unique_together = ('trip', 'stop',) class Capacity(models.Model):", "<filename>web/backend/backend_django/apps/capacity/models.py from django.db import models from multigtfs.models import ( Block, Fare, FareRule, Feed,", "class Meta: u...
[ "from public_config import * except ImportError: pass PORT = 9028 SERVICE_NAME = 'interface'", "try: from public_config import * except ImportError: pass PORT = 9028 SERVICE_NAME =" ]
[ "from django.views.decorators.cache import cache_page from rest_framework.generics import ( ListAPIView, RetrieveAPIView, CreateAPIView, UpdateAPIView, DestroyAPIView", "Create your views here. class PokemonListAPIView(ListAPIView): queryset = Pokemon.objects.all() serializer_class = PokemonSerializer filterset_c...
[ "__init__(self, pluginref, *args, **kwargs): super(SrvRoleInstNormalizer, self).__init__( pluginref, *args, **kwargs ) @property def config_path(self):", "= ['roles', 'subroles'] \\ + urole['path'].replace('/', '/subroles/').split('/') tmp = get_subdict(cfg, tmp, default_empty=True) setdefault_none(setdefault_non...
[ "com DynamoDB\") return False def dynamodb_save(self, dados): conn = self.connect() if conn: retorno", "self.connect() return conn.get_item(Key=query) def get_dy_template(template_name): newtemplate = DyConnect(dynamodb['template'], aws_region) query = {'name': template_name}", "'Item' in stages: if 'details' i...
[ "response, **kwargs): all_number = [int(i) for i in response.xpath('//div[@class=\"card-body\"]//div[@class=\"col-md-1\"]/text()').getall()] self.logger.info(f'Sum or web number", "589, }, } def start_requests(self): yield Request(url=self.start_url, callback=self.parse) def parse(self, response, **kwargs): all_n...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "recognized.' % split_name) if split_type is not \"iid\": raise ValueError(\"Only IID split available", "utilities for an augmented version of th...
[ "= SummaryWriter(self.path) self.stamp = time.time() def write(self, scalar_dict, frames, step): for key, value", "self.writer.add_scalar(\"all/\" + key, value, step) if \"score\" in key: time_delta = int(time.time() -", "frames, step): for key, value in scalar_dict.items(): self.writer.add_scalar(f\"{self.id}/...
[ "@decorater_log def output_add_command(self): ''' Command line to add configuration is output. ''' parame", "configuration is output. ''' parame = self._get_param() self._interface_common_start() self._append_add_command(\"standby version 2\") comm_txt =", "# Filename: ASRDriverParts/UNIInterface.py ''' Parts M...
[ "annotation_types = (ClassificationAnnotation, ) @classmethod def parameters(cls): configuration_parameters = super().parameters() configuration_parameters.update({ 'annotation_file': PathField(description=\"Path", "pixel = int(features[column_template.format(x+1, y+1)]) image[x, y] = pixel return image def gener...
[ "dialog.ShowModal() dialog.Destroy() def ShowEnvironmentError(msg, inst): \"\"\"Show EnvironmentError exceptions detailed and user-friendly msg: Error", "def __init__(self): self._disabled = getattr(sys, '_called_from_test', False) bugdialog_ui.UIBugDialog.__init__(self, None, -1, \"\") def SetContent(self,", "...
[ "\"\"\"def simple_upload(request): if request.method == 'POST' and request.FILES['myfile']: myfile = request.FILES['myfile'] fs =", "form = DocumentForm(request.POST, request.FILES,request.POST) if form.is_valid(): form.save() email=form.cleaned_data['Email'] document_count=Document.objects.values_list('document'...
[]
[ "= ChatBot('Bot') trainer = ChatterBotCorpusTrainer(chatbot) trainer.train('chatterbot.corpus.english') cprint(\"#\" * 50, \"magenta\") cprint((f\"A Chatot \").center(50),", "while True: query = input(\">> \") if 'exit' in query: exit() else: print(chatbot.get_response(query))", "- Python mini project Date - 18...
[ "an X leaves the bit in the value unchanged. For example, consider the", "= [] # xCount = 0 xPositions = [] for i in range(len(bin_address)):", "insert combination[i] into binary number # current combo associated idx is in xPositions[i]", "the least significant bit (2^0, that is, the 1s bit) on the right.", ...
[ "from Dialogs.DialogMacros import turn_into_free_point, free_point_checkbox from Fill.ListWidget import fill_listWidget_with_data, set_selected_id_in_listWidget import Constant as", "= polygon item.item[\"id\"] = Factory.next_id(item, definition, self.scene.project_data.items) item.item[\"definition\"] = definiti...
[ "self.network.set_node_location('destination1', 20, 20) self.assertEqual(self.network.get_node_location('destination1'), Location(20, 20)) with self.assertRaises(Location.LocationException): self.network.set_node_location('destination1', 'test', 20) with self.assertRaises(Location.LocationException):", "self.netw...
[ "about all interfaces, sh ip int br', file_name='get_interfaces.py', created_by_id=1) models.JobTemplate.objects.create(name='Ping Device', description='Pings a", "\"\"\" from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User, Group from django.core.management.base impor...
[ "we restore the old value of _UNIXCONFDIR. _ = obj.info() distro._UNIXCONFDIR = old_value", "os.path.join(root_dir, 'etc') obj = distro.LinuxDistribution(include_lsb=False, include_uname=False) # NOTE: The parsing of LinuxDistribution distro", "We point _UNIXCONFDIR to root_dir old_value = distro._UNIXCONFDIR d...
[ "next batch self._touch_actions = [] return self @property def json_wire_gestures(self) -> Dict[str, Union[List,", "Args: touch_actions: one or more TouchAction objects describing a chain of actions to", "KIND, either express or implied. # See the License for the specific language", "object. Usage: | a1 = Tou...
[ "- w:u + w + 1, 0] = 0 except: #print(\"out of bounce\")", "= k3d.points(x, col1.astype(np.uint32), point_size=point_size) plot += plt_points plt_points = k3d.points(y, col2.astype(np.uint32), point_size=point_size) plot", "+= plt_points plt_points = k3d.points(y, col2.astype(np.uint32), point_size=point_size) ...
[ "= [root] self.traByLayer(tree) print(str(self.tree)) return str(self.tree) def deserialize(self, data): \"\"\"Decodes your encoded data", "root.left = TreeNode(temp) r.append(root.left) if data!=[]: temp = data.pop(0) if temp!=None: root.right =", ":31 MB, 在所有 Python3 提交中击败了100.00%的用户 class Codec: def __init__...
[ "from .block import IPUZ_BLOCK_VALIDATORS from .crossword import IPUZ_CROSSWORD_VALIDATORS from .fill import IPUZ_FILL_VALIDATORS from", "), \"validators\": { 1: IPUZ_CROSSWORD_VALIDATORS, }, }, \"http://ipuz.org/fill\": { \"mandatory\": (), \"validators\": {", "\"dimensions\", ), \"validators\": { 1: IPUZ_BLOC...
[ "name = response.data.name password = <PASSWORD>\") clear_standings() response = schema.dump(response.data) return {\"success\": True,", "abort(404) solves = user.get_solves(admin=is_admin()) view = \"user\" if not is_admin() else \"admin\" response", "abort(404) fails = user.get_fails(admin=is_admin()) view = ...
[ "= 5 for i in range(n_pages): page = make_page(i) page.register(app, page_name(i), prefix=str(i)) #", "def make_page(i: int): page = DashBlueprint() page.layout = html.Div([html.H2(f\"Page {i}\"), html.Button('Click me!', id='btn'),", "page = make_page(i) page.register(app, page_name(i), prefix=str(i)) # Setup ...
[ "}, }, # ----------------------------------------------------------------- # Messages # ----------------------------------------------------------------- 'rel/messages': { 'href-template': ('/v2/queues/{queue_name}/messages' '{?marker,limit,echo,include_claimed}'),", "'flavor_name': 'param/flavor_name', }, 'hints...
[ "('org', ('ou:org', {}), { 'doc': 'The org that operates the given domain.', }),", "import synapse.lib.version as s_version logger = logging.getLogger(__name__) class Cpe23Str(s_types.Str): ''' CPE 2.3 Formatted", "product which contains the signature.', }), )), ('it:av:prochit', {}, ( ('proc', ('it:exec:proc',...
[ "# -*- coding: utf-8 -*- \"\"\"Unit tests.\"\"\" import os import unittest from copy", "for route in routes: self.app.get(route) if __name__ == '__main__': from test.utils.doctest_unittest_runner import doctest_unittest_runner", "@staticmethod def valid_route(route): \"\"\"Validate route. Args: route (str): Rou...
[ "and # limitations under the License. \"\"\"Test that the C, C++ and shader", "= line.strip() extension = os.path.splitext(line)[1][1:].lower() if extension not in extensions: continue found =", "class TestClangFormat(unittest.TestCase): \"\"\"Unit test for ClangFormat compliance.\"\"\" def setUp(self): \"\"\"S...
[ "def _test_remove_os_specific(self, platform, recreate, raise_mkdir_error): \"\"\"Helper for testing removing dir with os-specific command.\"\"\"", "that doesn't need one. We don't want empty string since this is easier", "\"\"\"Test that the correct interpreters to execute a file are returned.\"\"\" def get_in...
[ "tf.keras.layers.Dense(self.vocab_size, activation='softmax', name='softmax')] def call(self, inp, predict=False): inp = self.embeddings(inp) out1 = self.Layers[0](inp)", "BiRNN(tf.keras.Model): def __init__(self, units: int,projection_units: int,max_seq_length: int, vocab_size: int,embedding_dim: int,embedding_m...