ngram
listlengths
0
67.8k
[ "right: mid = (left + right) // 2 total = 0 for cap", "ans = 0, sum(batteries) // n, 0 while left <= right: mid =", "class Solution: def maxRunTime(self, n: int, batteries: List[int]) -> int: left, right, ans", "n, 0 while left <= right: mid = (left + right) // 2", "total += min(cap, mid) if total >= n * mi...
[ "cellPos[0] <= screenBottom: nextCell = (cellPos[0] + 1, cellPos[1]) if nextCell not in", "in self.dictionary: self.dictionary[nextCell] = (randint(0,4), 255) # Deleting cells if cellOpacity < tailSize:", "= self.dictionary[cellPos][1] #Update Cell opacity = cellOpacity - tailSize if cellOpacity >= tailSize", ...
[ "# set config app.logger.setLevel(logging.INFO) from src.controller import excel_service app.register_blueprint(excel_service, url_prefix='/') @app.route('/healthcheck') def healthcheck():", "'payload', None) or ()) response_dict['message'] = str(error) response_dict['traceback'] = trace response = jsonify(respon...
[ "if message.get(\"error\"): pretty_print( f\"[bold yellow]ERROR: {message['error']}\", file=sys.stderr) return local_server_host = '127.0.0.1' public_server_port =", "public_server_port = message[\"public_server_port\"] private_server_port = message[\"private_server_port\"] pretty_print(f\"{'Tunnel Status:':<25}[...
[ "for l in range(0, 3): for c in range(0, 3): print(f'[{matriz[l][c]:^5}]', end='') print()", "range(0, 3): print(f'[{matriz[l][c]:^5}]', end='') print() soma = matriz[0][2] + matriz[1][2] + matriz[2][2] print('='", "print(f'[{matriz[l][c]:^5}]', end='') print() soma = matriz[0][2] + matriz[1][2] + matriz[2][2] ...
[ "processed image. Args: image (np.ndarray): original image bboxes (List): detected bounding box scores", "Tuple, List import cv2 import numpy as np import streamlit as st from", "-> Optional[np.ndarray]: \"\"\"show upload image area Returns: Optional[np.ndarray]: uploaded image \"\"\" uploaded_file =", "is no...
[ "in matchlist: yield { 'rank' : match[0], 'src' : match[1], 'name' : match[2],", "request.Request(url, headers=headers) return request.urlopen(req).read().decode('utf-8') except error as e: return e.reason def parse_(html): ol", "req = request.Request(url, headers=headers) return request.urlopen(req).read().dec...
[ "<gh_stars>0 import os import sys import uuid import zipfile def extract(source, destination): z", "os import sys import uuid import zipfile def extract(source, destination): z = zipfile.ZipFile(source)", "import os import sys import uuid import zipfile def extract(source, destination): z =", "destination): z...
[]
[ "after finalizing meta_attr def _get_field_name(n: str) -> str: if n in meta_attrs['_field_defs_']: return", "= () exclude_values_up = {'':()} exclude_values_down = {'':()} #internal _field_defs_: Dict[str, Field] _fields_:", "model could look like this: ```python class User(Base): name = Field('varchar(65)') e...
[ "doc='身份证正面') id_card_back = db.Column(db.String, doc='身份证背面') id_card_handheld = db.Column(db.String, doc='手持身份证') ctime = db.Column('create_time', db.DateTime,", "db.Column(db.String, doc='简介') certificate = db.Column(db.String, doc='认证') article_count = db.Column(db.Integer, default=0, doc='发帖数') following_cou...
[ "the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in", "under the License. \"\"\" import app_server_conf \"\"\"Default configuration settings for NetHead UI\"\"\" #", "\"\"\" import app_server_conf \"\"\"Default configuration settings for NetHead UI\"\"\" ...
[ "django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app', '0014_alter_list_users'), ] operations =", "2022-01-22 15:53 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app', '0014_alter_list_users'),", "from django.db import migrations...
[ "print(name.rstrip() + dots) #rstrip Method print(name.strip() + dots) #strip Method print(name.replace(\" \", \"\")", "\" Pervaiz \" dots = \" .........\" print(name.lstrip() + dots) #lstrip Method print(name.rstrip()", "name = \" Pervaiz \" dots = \" .........\" print(name.lstrip() + dots) #lstrip", "\" ......
[ "self._allSensors = data self._lastUpdatedTime = time.time() def setUseByInterval(self, seconds): if seconds <= 0:", "57 BATTERY_CURRENT = 58 GYRO_ACCUM = 60 class BUFFER_SIZES(Enum): ULTRASONIC = 2 ACCL", "None self._lastUpdatedTime = 0 self._useByInterval = ( 0.25 # cached values older than", "self._lastUpd...
[ "the y-axis. INSTRUCTIONS 70XP First, use plt.hist() to plot the histogram of the", "the histogram of the 1-D array pixels in the bottom subplot. Use the", "pre-flattened into the 1D array pixels for you. The histogram option cumulative=True permits", "BY 2.0). This time, the 2D array image will be pre-loaded...
[ "NFHead from .none import NoneHead from .pre_activation import PreActivationHead from .swin import SwinHead", ".mobilenet import MobileNetV2Head, MobileNetV3Head from .nfnet import NFHead from .none import NoneHead from", "NoneHead from .pre_activation import PreActivationHead from .swin import SwinHead from .v...
[ "poop == \"randomNum\": print(\"This define prints a random number\") print(\"using random randint between", "used as a template on how to make a tester correctly import ce_tools", "Engine Tools Tester (CE_tools.py)\") print(\"This tools tests all functions up to\", ce_tools.ce_tools_ver) while", "random dice...
[ "+ \"/output\") f = open(v + '/output','r') o = open('louvain_to_gephi/graphx/community_itr_1.nodes','w') nodeMap = {}", "KIND, either express or implied. # See the License for the specific language", "2016 Sotera Defense Solutions Inc. # # Licensed under the Apache License, Version", "Unless required by appl...
[ "through='Follow', related_name='subscriber', blank=True) grade = models.ForeignKey('board.Grade', on_delete=models.CASCADE, blank=True, null=True) exp = models.IntegerField(default=0) bio", "models.ForeignKey('board.Theme', on_delete=models.CASCADE, blank=True, null=True) def __str__(self): return self.user.user...
[]
[ "Switch class SwitchApp(App): def build(self): switch = Switch() switch.bind(active=self.switch_state) return switch def switch_state(self,", "import App from kivy.uix.switch import Switch class SwitchApp(App): def build(self): switch = Switch()", "kivy.uix.switch import Switch class SwitchApp(App): def build(s...
[ "# @lc app=leetcode.cn id=559 lang=python3 # # [559] N叉树的最大深度 # class Node: def", "int: if root is None: return 0 # 没有子树,只有根节点1层 if root.children is None", "Node: def __init__(self, val, children): self.val = val self.children = children class Solution:", "<reponame>fengbaoheng/leetcode # # @lc app=leetcode.c...
[ "\"0.0.0.0:8000\" # workers = multiprocessing.cpu_count() * 2 + 1 workers = 2 threads", "multiprocessing bind = \"0.0.0.0:8000\" # workers = multiprocessing.cpu_count() * 2 + 1 workers", "import multiprocessing bind = \"0.0.0.0:8000\" # workers = multiprocessing.cpu_count() * 2 + 1", "# workers = multiprocess...
[ "GetServiceDefinition class TestGetServiceDefinition(TestBase): def test_getservicedefinition(self): method = GetServiceDefinition(['platform', 'shell', 'topology', 'xml-over-http-methods', 'meaningful-use']) method.execute(self.connection)", "import TestBase from healthvaultlib.methods.getservicedefinition impor...
[ "=1 pi = math.pi inputCircleRadius = int(scriptCircleRadius) inputCircleSliceAngle = int(scriptCircleSliceAngle) inputCircleRl = calcCircleRl(inputCircleRadius)", "inputCircleRadius = int(scriptCircleRadius) inputCircleSliceAngle = int(scriptCircleSliceAngle) inputCircleRl = calcCircleRl(inputCircleRadius) inputC...
[ "based on HSV range provided by COLOR_MIN and COLOR_MAX frame = cv2.inRange(hsv, COLOR_MIN,", "MIN_BOIL_AREA = 100 def cart2pol(a): x = a[0] y = a[1] rho =", "filteredContours[iTargetContour] M = cv2.moments(targetContour) cX = int(M[\"m10\"] / M[\"m00\"]) cY = int(M[\"m01\"] /", "int(M[\"m01\"] / M[\"m00\"])...
[ "UserDAL(): def __init__(self, db_session: Session): self.db_session = db_session async def get_user_by_email(self, email: str):", "sqlalchemy.orm import Session, noload from sqlalchemy.future import select from sqlalchemy import update from", "return q.scalars().first() async def create_user(self, user: schema...
[ "r\"fortran\", r\"for\", r\"goto\", r\"ifdef\", r\"ifndef\", r\"if\", r\"include\", r\"inline\", r\"int\", r\"line\", r\"long\", r\"pragma\", r\"register\",", "is not closed _COMMENT_MULTILINE = r\"/\\*(.|[\\r\\n])*?(\\*/|\" + _STRING_CB.format(\"COMM_M\") + \")\" _REGEX_COMMENT = _COMMENT", "= r\"[^0\\D][\\d]*...
[ "Some other formatters can make things easier. \"\"\" from typing import Iterable, Tuple", ":created: 10/30/2020 The `string_conversion` module will format floats or strings. Some other formatters", "\"\"\" return \" \".join(str(round(x)) for x in floats) def svg_float_tuples(tuples: Iterable[Tuple[float, float...
[ "= 0 nreq = len(required) for doc in doclist: fields_found = 0 for", "part X - test input is used print(\"Part1. Number of valid passports:\", part1(readfile()))", "eyr (Expiration Year) - four digits; at least 2020 and at most 2030.", "as follows: byr (Birth Year) iyr (Issue Year) eyr (Expiration Year) hgt (...
[ "FiniteAutomaton({(A, a): B}, A, {B}) C = State('C') D = State('D') fa_2 =", "= fa1.copy() assert fa1 is not fa2 def test_evaluate(): a = Symbol('a') A,", "fa.complete() def test_negate(): a = Symbol('a') b = Symbol('b') A = State('A') B", "{A}, (B, a): {A}, (B, b): {B}, } fa1 = FiniteAutomaton(transitions, A...
[ "0: period = period + 1 return self.income_statements[period]['incomeTaxExpense'] / self.income_statements[period]['incomeBeforeTax'] def say(self, contet):", "of {} From {}'.format(self.profile[0]['companyName'], url)) self.say('Loading Income statements...') self.income_statements = retrieve_from('{}/api/v3/inc...
[]
[ "by Django 3.1.1 on 2020-11-16 06:44 from django.db import migrations, models class Migration(migrations.Migration):", "'0001_initial'), ] operations = [ migrations.AlterField( model_name='product_data', name='product_name', field=models.CharField(blank=True, max_length=2000, null=True), ), ]", "import migratio...
[ "in enumerate(row.yvars): name = row.volume_id #+ '_' + yvar.lower() print(\"# precision: tgt %.2e", "max %.2e (%.1f%%) avg %.2e (%.1f%%)\" % # ( test_dev[0][i], test_dev[1][i], test_dev[2][i], test_dev[3][i]", "Y) #print xvars #(sample_score, test_score) = (lr.score(X, Y), lr.score(Xtest, Ytest)) #print(\"line...
[ "# Combine operations with centring allops = dif.fc.gen_symcen_ops(ops, cen) # Convert to magnetic", "Plotting cf = os.path.dirname(__file__) sys.path.insert(0,os.path.join(cf, '..')) import Dans_Diffraction as dif f = '../Dans_Diffraction/Structures/LaMnO3.mcif'", "magnetic symmetry magops = dif.fc.symmetry_op...
[ "from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration):", "operations = [ migrations.AlterField( model_name='dates', name='startDate', field=models.DateField(default=datetime.datetime(2017, 5, 26, 10, 44, 7, 194576)),", "= [ ('dist...
[ "name='post-detail'), path('post/<int:pk>/update/', views.PostUpdateView.as_view(), name='post-update'), path('post/<int:pk>/delete/', views.PostDeleteView.as_view(), name='post-delete'), path('user/<str:username>/', UserPostListView.as_view(), name='user-post'), path('post/comment/<int:pk>/delete/', views.CommentD...
[ "Y) = H(X) + H(Y) - H(X,Y) Where H(X), H(Y) and H(X,Y) are", "prob1_2) else: return (mutual_information, entropy1, entropy2, entropy1_2) def plot_2dhist(data, path, title): \"\"\" Helper", "proficiency (normalized mutual information) of an image pair \"\"\" alpha_data = load_image(alpha) beta_data", "displace...
[ "9, 0, 2 ], # 0x5F '_' [ 851, 3, 3, 5, 2,", "0x38, 0x78, 0x48, 0x4D, 0xC6, 0x73, 0x32, 0x26, 0x64, 0x4C, 0xDE, 0x77, 0x39,", "12, 5, 0, -11 ], # 0x2F '/' [ 137, 9, 13, 9,", "514, 13, 12, 12, 0, -11 ], # 0x4B 'K' [ 534, 11,", "0x60 '`' [ 853, 9, 8, 9, 0, -7 ], # 0x61 'a'", "0x74 't' [ 1074, 8, 8, 9, 1, -7 ...
[ "'0003_travel_history2'), ] operations = [ migrations.RenameField( model_name='medical_history', old_name='Bronchitis', new_name='bronchitis', ), migrations.RenameField( model_name='medical_history', old_name='COPD',", "model_name='medical_history', old_name='Bronchitis', new_name='bronchitis', ), migrations.Rena...
[ "properties[i] = [attacki, # defensei] represents the properties of the ith character in", "attack and defense. # # Example 3: # # Input: properties = [[1,5],[10,4],[4,3]]", "third character is weak because the second character has a strictly greater attack", "characters, # and each of the characters has two ...
[ "dss_file = \"example.dss\" pathname = \"/IRREGULAR/TIMESERIES/FLOW//IR-DECADE/Ex3/\" with HecDss.Open(dss_file) as fid: ts = fid.read_ts(pathname,regular=False,window_flag=0)", "<reponame>alai-arpas/pydsstools ''' Read irregular time-series data ''' from pydsstools.heclib.dss import HecDss dss_file =", "data '...
[ "blank on plugin {cls.__name__}\" ) if cls.__type__ is not None and cls.__type__ not", "TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.", "cls.__author__: raise MetadataException(f\"Author cannot be empty on plugin {cls.__name__}\") if cls.__params__: _check_params_...
[ "Instantiate the root app root = Aurora() # Run the root app if", "import Aurora # Instantiate the root app root = Aurora() # Run the", "aurora import Aurora # Instantiate the root app root = Aurora() # Run", "<filename>app.py # Dependencies from aurora import Aurora # Instantiate the root app root", "# Ins...
[ "fields=\"+l\", exclude=None, ctags=\"/usr/local/bin/ctags\", creates='tags'): from os.path import join if fields is None: fields", "fields is None: fields = [] elif isinstance(fields, str): fields = [fields] fields", "\"{ctags} -R {fields} {exclude} .\".format(ctags=ctags, fields=fields, exclude=exclude) retur...
[ "use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the", "IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR", "copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED", "\"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUD...
[]
[ "+= os.path.basename(localPath) with open(localPath, 'rb') as fp: try: self.operator.mkdir(os.path.dirname(remotePath)) if not self.operator.put(remotePath, fp):", "open(localPath, 'rb') as fp: try: self.operator.mkdir(os.path.dirname(remotePath)) if not self.operator.put(remotePath, fp): print '[ERROR] upload", ...
[ "from flask import Flask app = Flask(__name__) @app.route(\"/\") def home(): \"\"\"\"View for the", "page of the Website\"\"\" return \"Welcome to the HomePage!\" @app.route('/square/<int:number>') def show_square(number): \"\"\"View", "the Home page of the Website\"\"\" return \"Welcome to the HomePage!\" @app...
[ "!= 0: return msg = data['d'] try: if data['t'] == 'MESSAGE_CREATE': if 'content'", "msg['author']['id'], msg['author']['discriminator'], msg['member']['nick'] if 'nick' in msg['member'] else None, )) elif data['t'] ==", "None, msg['author']['username'], msg['author']['id'], msg['author']['discriminator'], msg[...
[ "import * from Package.PackageBase import * from Packager.PackagerBase import * from Package.VirtualPackageBase import", "from Package.PackageBase import * from Packager.PackagerBase import * from Package.VirtualPackageBase import * from", "class PipPackageBase(PackageBase, PipBuildSystem, PackagerBase): \"\"\"...
[ "in the base model print(\"Number of layers in the base model: \", len(base_model.layers))", "plt.axis('off') preprocess_input = tf.keras.applications.mobilenet_v2.preprocess_input #rescale = tf.keras.layers.experimental.preprocessing.Rescaling(1./127.5, offset= -1) # Create the base", "tf.keras.layers.experime...
[ "from . import misc from .db_api.json_db import Database from .notify_admins import on_startup_notify from", "import misc from .db_api.json_db import Database from .notify_admins import on_startup_notify from .voice_recognition import", ".db_api.json_db import Database from .notify_admins import on_startup_noti...
[ "Created on Mon Apr 12 13:21:44 2021 @author: hiszm \"\"\" from sys import", "on Mon Apr 12 13:21:44 2021 @author: hiszm \"\"\" from sys import argv", "-*- coding: utf-8 -*- \"\"\" Created on Mon Apr 12 13:21:44 2021 @author:", "filename) print (txt.read()) print (\"Type the filename again:\") file_again = in...
[ "string for the array ''' if not isinstance(a, _np.ndarray): raise TypeError(\"An ndarray expected.", "= ['ndarray_repr'] def ndarray_repr(a): '''Gets a one-line representation string for a numpy array.", "''' if not isinstance(a, _np.ndarray): raise TypeError(\"An ndarray expected. Got '{}'.\".format(type(a)))...
[ "= normalize_obj_file(input_file_path, output_file_path, padding=shape_scale_padding) size_centroid = {'size': total_size.tolist(), 'centroid': centroid.tolist()} write_json(size_centroid_file, size_centroid) def", "''' input_path = os.path.abspath(input_path) output_path = os.path.abspath(output_path) for root, ...
[ "import admin from django.views.generic import TemplateView from rsvps.views import GuestRsvpView urlpatterns = [", "admin from django.views.generic import TemplateView from rsvps.views import GuestRsvpView urlpatterns = [ url(r'^$',", "GuestRsvpView urlpatterns = [ url(r'^$', TemplateView.as_view(template_name...
[ "random def main(): filename = 'test' n_hidden = 64 mutual_infos = [] for", "filename = 'test' n_hidden = 64 mutual_infos = [] for i in range(n_hidden):", "for i in range(n_hidden): mutual_info_dict[f'{i:04}'] = mutual_infos[i] with open(f'mutual_info_{filename}.toml', 'w') as f: toml_str", "[] for i in range...
[ "@property def pressure(self) -> float: # hPa return 1013.25 * self.value @property def", "100.0 * self.value @property def pressure(self) -> float: # hPa return 1013.25 *", "float: # hPa return 1013.25 * self.value @property def temperature(self) -> float: #", "import Base class BME280(Base): @property def h...
[ "letra O ou X def escolhaLetraJogador(): l = \"\" while l != \"O\"", "range(9): t.append(' ') return t # Mostrar o tabuleiro def mostraTabuleiro(posi): print(\" |", "True else: return False def criaTabuleiro(): t = [] t.append('') for i in", "\") print(' {} | {} | {} '.format(posi[7],posi[8],posi[9])) print(\...
[ "self.conv1 = SeparableConv2D(in_channels, 128, (3, 3), padding=1, bias=False) self.bn1 = nn.BatchNorm2d(128) self.conv2 =", "padding, dilation, groups=in_channels, bias=bias, padding_mode=padding_mode) self.pointwise_conv = nn.Conv2d(depthwise_conv_out_channels, out_channels, kernel_size=1, stride=1, bias=False)...
[]
[ "utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class TaskConfig(AppConfig): name", "-*- from __future__ import unicode_literals from django.apps import AppConfig class TaskConfig(AppConfig): name =", "# -*- coding: utf-8 -*- from __future__ import unicode_literals from djan...
[ "name_meta: #print(meta_data) # meta_data_list.append(entry+\"/\"+meta_data) #for entry in append_by_name_meta_data: # for extension in meta_data_extensions:", "name)): if count % 100 == 0: printTime(count, now) #i+=1 #if i >", "meta_data_list.append(entry+\"/\"+meta_data) #for entry in append_by_name_meta_data...
[ "+ num_img_tr * epoch) if i == visualization_index: vis_img, vis_tgt, vis_out = image,", "from utils.summary import TensorboardSummary from utils.loss import SegmentationLosses from utils.calculate_weights import calculate_weights_labels from", "Acc_class, epoch) self.val_writer.add_scalar('fwIoU', FWIoU, epoch...
[ "get_schedule(page: str): if not page.isdecimal(): return False variables = {\"page\": page} return variables", "def get_schedule(page: str): if not page.isdecimal(): return False variables = {\"page\": page} return", "<gh_stars>0 def get_schedule(page: str): if not page.isdecimal(): return False variables = {\...
[ "by CarveMe' Lreu_ca.id = 'Lreu_ca' bigg_rea_df = pd.read_csv('../bigg_database/bigg_rea_df.csv', sep='\\t') bigg_met_df = pd.read_csv('../bigg_database/bigg_met_df.csv', sep='\\t')", "bigg_rea_df = pd.read_csv('../bigg_database/bigg_rea_df.csv', sep='\\t') bigg_met_df = pd.read_csv('../bigg_database/bigg_met_df....
[ "cal_rf_wh(grad_input): binary_map: np.ndarray = (grad_input[:, :] > 0.0) x_cs: np.ndarray = binary_map.sum(-1) >=", "module.eval() input = torch.ones(1, 3, 640, 640, requires_grad= True) model.zero_grad() features = model(input)", "#grad_input = grad_input * 100 width, height = cal_rf_wh(grad_input) print(\"wi...
[]
[ "mypy expects object to be here at the last index ('we skip \"object\"", "def fold_intersection_and_its_args(self, type_: mypy.types.Type) -> mypy.types.Type: folded_type = self.fold_intersection(type_) if isinstance(folded_type, mypy.types.Instance): folded_type.args", "def intersection_function_signature_hook...
[ "import migrations, models def update_names(apps, schema_editor): for x in apps.get_model('institutions', 'regon').objects.exclude(data=None).iterator(): x.name =", "1.10.7 on 2017-07-18 04:43 from __future__ import unicode_literals from django.db import migrations, models", "'') x.save() for x in apps.get_mode...
[ "% str(response['id']) usr = User.get_by('authIDs_', auth_id) bio = response['bio'][:user.bio_span[1]] if response['bio'] else ''", "Todo replace opaque and repeated code such as # bio = response['bio'][:UserVdr.bio_span[1]] if", "User.get_by('authIDs_', auth_id) bio = response['bio'][:user.bio_span[1]] if resp...
[ "date) except FileNotFoundError: if doscrape: print(\"* WARNING: beginning web scrape--be polite, they ban", "except StopIteration: data = None print(\"failed to process \" + date.strftime(\"%Y-%m-%d\")) return data", "(data[\"act\"] - data[\"sked\"]).astype(\"timedelta64[h]\") < -4 # hours data.ix[dayflip, \"a...
[ "import streamfieldify class ServicePageFactory(JanisBasePageWithTopicsFactory): @classmethod def create(cls, *args, **kwargs): if 'dynamic_content' in kwargs:", "in kwargs: kwargs['dynamic_content'] = streamfieldify(kwargs['dynamic_content']) step_keywords = ['steps', 'steps_es'] for step_keyword in step_keyword...
[ "allowed_environments: list, ): self.__container_init_function = container_init_function self.__kernel_class = kernel_class self.__root_module_name = root_module_name self.__allowed_environments", "container_init_function self.__kernel_class = kernel_class self.__root_module_name = root_module_name self.__allowed...
[ "import List class Solution: def majorityElement(self, nums: List[int]) -> int: count, candidate =", "from typing import List class Solution: def majorityElement(self, nums: List[int]) -> int: count,", "def majorityElement(self, nums: List[int]) -> int: count, candidate = 0, 0 for num", "candidate = 0, 0 for ...
[ "Unless required by applicable law or agreed to in writing, software # distributed", "Normally, only value needs to be provided.\" \" We will proceed but you", "configuration file. :param bool is_user_config: If True, the config object represents user-provided configuration.", "is None else JSON loaded from t...
[ "subtitles self._clean_formatting() #Write file self._write_file(self._path_to_sub, self._sub_list) def Offset(self, _sign, _hour=0, _minute=0, _second=0, _ms=0):", "blank line if it is not before a number i = 0 while", "= re.sub(r' \\.', '.', self._sub_list[i], re.UNICODE) #if re.match(\"^.+\\.[^ ]+\",self._su...
[ "search for pubkey in. external_address (Address): The external address of a wanted pubkey.", "pystratis.api import Model from pystratis.core.types import Address # noinspection PyUnresolvedReferences class PubKeyRequest(Model): \"\"\"A", "import Model from pystratis.core.types import Address # noinspection PyU...
[ "start_job(job_id, task_id) -> Submission: worker_name = \"unknown_worker\" if os.getenv(\"WORKER_NAME\") is not None: worker_name", "result): resp = requests.get(API_BASE_URL + f\"/jobs/{job_id}/submit_job/\", headers={\"Authorization\": f\"Token {ACCESS_TOKEN}\"}, data={ \"result\": result, \"task_id\":", "+ ...
[ "= color def run(self, recalc=False): # Get a new task from the server", "try: gt.run(recalc) current_sleep = 10 except Exception as e: logging.exception(\"Failed when running thread\")", "self.server.get_recalc_task() else: task = self.server.get_task(self.client_name) return task @staticmethod def solve_task(...
[]
[ "forms.CharField(max_length=8) # first_name = forms.CharField(max_length=10) # last_name = forms.CharField(max_length=10) # # sacco =", "the time being')), ('Blacklisted', ('Blacklisted from operating')) ] class VehicleForm(forms.Form): # sacco =", "= forms.CharField( widget=forms.Select(choices=SACCO_DRIVER_ST...
[ "other.right is None elif other.left is None and other.right is None: return False", "Returns a list of all unique symmetrical trees with n internal nodes \"\"\"", "None: return False else: return self.left == other.left and self.right == other.right def", "return \"( )\" else: return \"( \" + str(self.left) ...
[ "surrounding_text() -> Optional[SurroundingText]: # TODO: If the voicemacs server is inactive, return nothing.", "import Context from user.emacs.utils.voicemacs import rpc_call from user.utils.formatting import SurroundingText context = Context()", "talon import Context from user.emacs.utils.voicemacs import rp...
[ "side of an assignment. global_x = 1 def f(): global_x += 1 ___assertRaises(UnboundLocalError,", "as a local and assigned # unbound, because it is the left side", "unbound, because it is the left side of an assignment. global_x = 1", "f() is lifted as a local and assigned # unbound, because it is", "variabl...
[ "4.855094), '1': (52.378281, 4.90007), '3': (52.375737, 4.896547), '2': (52.373634, 4.890289), '5': (52.376237, 4.90286),", ">= 0: # res += str(d['id']) + ' ' # else: # break", "addresses.append(address) m = int(input_file.readline()) for i in xrange(m): line = input_file.readline() lines =", "' # else: # bre...
[ "'<KEY> # SECURITY WARNING: don't run with debug turned on in production! DEBUG", "'USER_AUTHENTICATION_RULE': 'v1.third_party.rest_framework_simplejwt.authentication.custom_user_authentication_rule' } CORS_ORIGIN_ALLOW_ALL = True MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, \"media\")", "'smtp.gma...
[ "from my_mod import enlarge, decimate class TestMathFunctions(unittest.TestCase): def test_enlarge(self): self.assertEqual(enlarge(10), 1000) def test_decimate(self):", "decimate class TestMathFunctions(unittest.TestCase): def test_enlarge(self): self.assertEqual(enlarge(10), 1000) def test_decimate(self): self.a...
[ "karnewaala\",\"1.5 Disember\",\"1.Central processing Unit\",\"1.Google\",\"1.mouse\",\"1.1024 byte\"] # second_options=[\"2.valmiki\",\"2.bhopal\",\"2.blue\",\"2.Green\",\"2.6\",\"2.GS kilvi\",\"2.ENIC\",\"2.1951\",\"2.2000\",\"2.sangndak\",\"2.14.Disember\",\"2.Central problem Unit\",\"2.Yahoo\",\"2.key_board\",\...
[ "__version__ = 1.0 from .em import * from .functions_em import * from .py3", "* from .functions_em import * from .py3 import * from .rotation import *", "1.0 from .em import * from .functions_em import * from .py3 import *", "<filename>clumpy/__init__.py __version__ = 1.0 from .em import * from .functions_em ...
[ "def build_from_rawfiles(cls, rawfiles, **kwargs): \"\"\" \"\"\" bflat = FlatBuilder.from_rawfiles(rawfiles, persist=False) data, header =", ":qshape[1]], dataccd[:qshape[0], qshape[1]:] ] else: raise ValueError(f\"qid must be 1->4 {qid} given\") return", "cls.from_filenames(filenames, use_dask=use_dask, **kwar...
[ "elif left == 'iyr': print( 'iyr', parts_found) if len(right) == 4 and (int(right)", "len(right) == 4 and (int(right) >= 1920 and int(right) <= 2002): parts_found +=1", "chunck split and check if valid for text in chuncks: parts = text.split()", "valid and right[1] in valid_chars valid = valid and right[2] in...
[ "python # -*- coding: utf-8 -*- import sys import zipfile def make_nvz_main(output_file, nvm_file,", "nvm_file = 'outputs/target.nvm' target_file = 'outputs/target.pb' pitch_file = 'outputs/pitch.pb' if len(sys.argv) == 5:", "'outputs/target.pb' pitch_file = 'outputs/pitch.pb' if len(sys.argv) == 5: nvm_file = ...
[ "remove_case_from_db @click.command('remove') @click.argument('case_id') @click.pass_context def remove_command(context, case_id): \"\"\" Deletes case from mutacc DB", "def remove_command(context, case_id): \"\"\" Deletes case from mutacc DB \"\"\" adapter = context.obj['adapter']", "import remove_case_from_db ...
[]
[ "\"\" def init(self): #idaapi.msg(\"init() called!\\n\") #self.run(0) return idaapi.PLUGIN_OK def run(self, arg=0): print(\"hell2\") idaapi.msg(\"run()", "# Color the Calls off-white if print_insn_mnem(i) == \"call\": funcCalls.append(i) # Color Anti-VM", "CIC_ITEM import idaapi #idaapi.auto_wait() PLUGIN_TEST ...
[ "FILES = os.listdir(MYPATH) INP = '' while INP != 'q': INP = input('q", "else to continue') file_choice = random.choice(FILES) pathname_choice = MYPATH + '/' + file_choice", "enter anything else to continue') file_choice = random.choice(FILES) pathname_choice = MYPATH + '/'", "'./out-of-dropbox-2020-08to12-' ...