code
stringlengths
13
6.09M
order_type
stringclasses
2 values
original_example
dict
step_ids
listlengths
1
5
from PrStatusWorker import PrStatusWorker import threading def initialize_worker(): worker = PrStatusWorker() worker.start_pr_status_polling() print("Starting the PR status monitor worker thread...") worker_thread = threading.Thread(target=initialize_worker, name="pr_status_worker") worker_thread.start()
normal
{ "blob_id": "4b5f58d471b05428caef3ca7a3bdc0d30a7e3881", "index": 5265, "step-1": "<mask token>\n\n\ndef initialize_worker():\n worker = PrStatusWorker()\n worker.start_pr_status_polling()\n\n\n<mask token>\n", "step-2": "<mask token>\n\n\ndef initialize_worker():\n worker = PrStatusWorker()\n worke...
[ 1, 2, 3, 4, 5 ]
# Code Rodrigo ''' This script, basically generates all he possible combinations to be analyzed according to the Dempster Shafer Theory. It requires to define beforehand, the combination of variables that lead to the higher and lower bound for a given combination of random sets, via the sensitivity analysis ''' impo...
normal
{ "blob_id": "4b44f4343da1677b5436ec2b153e573fda3c0cee", "index": 2280, "step-1": "<mask token>\n\n\ndef read_input_RS():\n low = np.loadtxt('LowerArray.csv', delimiter=',', skiprows=1)\n lower_bound = np.ravel(low)\n upper_bound = np.ravel(np.transpose(np.loadtxt('UpperArray.csv',\n delimiter=','...
[ 2, 3, 4, 5, 6 ]
n, x0, y0 = list(map(int, input().split())) cards = [y0] + list(map(int, input().split())) # yの手持ちはゲームに関与するため、リストに加えてしまう xs = [[-1] * (n+1) for i in range(n+1)] ys = [[-1] * (n+1) for i in range(n+1)] #xs[i][j] = xの手番で、xがcards[i]を持ちyがcards[j]を持っているとき(i<j)の最善スコア #ys[i][j] = yの手番で、xがcards[j]を持ちyがcards[i]を持っているとき(i<j)の...
normal
{ "blob_id": "81b9fc78d92fdc4392cb71a77fdfd354ff950ae3", "index": 6153, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor i in range(n + 1):\n xs[i][-1] = abs(cards[-1] - cards[i])\n ys[i][-1] = abs(cards[-1] - cards[i])\nfor j in range(n - 1, -1, -1):\n xs_temp = max(ys[j][j + 1:n + 1])\n ys...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> web = Blueprint('web', __name__) <|reserved_special_token_0|> <|reserved_special_token_1|> from flask import Blueprint web = Blueprint('web', __name__) from app.web import auth from app.web import user from app.web import book
flexible
{ "blob_id": "02182f0379e58b64bbe17cc5f433e8aae7814976", "index": 196, "step-1": "<mask token>\n", "step-2": "<mask token>\nweb = Blueprint('web', __name__)\n<mask token>\n", "step-3": "from flask import Blueprint\nweb = Blueprint('web', __name__)\nfrom app.web import auth\nfrom app.web import user\nfrom app....
[ 0, 1, 2 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> for p in G['Pos']: Pos.append(p) <|reserved_special_token_0|> for v in G['Vel']: Vel.append(v) <|reserved_special_token_0|> for s in G['Spin']: Spin.append(s) <|reserved_special_token_0|> for d in G['DiscRadii']: D...
flexible
{ "blob_id": "0d565c9f92a60d25f28c903c0a27e7b93d547a4f", "index": 2971, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor p in G['Pos']:\n Pos.append(p)\n<mask token>\nfor v in G['Vel']:\n Vel.append(v)\n<mask token>\nfor s in G['Spin']:\n Spin.append(s)\n<mask token>\nfor d in G['DiscRadii']:\n...
[ 0, 1, 2, 3, 4 ]
# -*- coding: utf-8 -*- __all__ = ["kepler", "quad_solution_vector", "contact_points"] import numpy as np from .. import driver def kepler(mean_anomaly, eccentricity): mean_anomaly = np.ascontiguousarray(mean_anomaly, dtype=np.float64) eccentricity = np.ascontiguousarray(eccentricity, dtype=np.float64) ...
normal
{ "blob_id": "ccd32a6ca98c205a6f5d4936288392251522db29", "index": 4896, "step-1": "<mask token>\n\n\ndef kepler(mean_anomaly, eccentricity):\n mean_anomaly = np.ascontiguousarray(mean_anomaly, dtype=np.float64)\n eccentricity = np.ascontiguousarray(eccentricity, dtype=np.float64)\n sinf = np.empty_like(m...
[ 2, 3, 4, 5, 6 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> class Solution: <|reserved_special_token_0|> <|reserved_special_token_1|> class Solution: def convert(self, s: str, numRows: int) ->str: res = '' for i in range(numRows): pass return res <|reserved_special_tok...
flexible
{ "blob_id": "aa952e8f9a1855b5578cb26d6e5aca42605ee585", "index": 5454, "step-1": "<mask token>\n", "step-2": "class Solution:\n <mask token>\n", "step-3": "class Solution:\n\n def convert(self, s: str, numRows: int) ->str:\n res = ''\n for i in range(numRows):\n pass\n r...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> def takeInput(): x = input() while not validInput(x): print('Invalid input. Try another one:') x = input() return x def main(): stats = {'Council': 0, 'United': 0, 'Faceless': 0, 'Warband': 0} print( "Welcome to Skyrst's open-source recreation...
flexible
{ "blob_id": "5209638ec97a666783c102bec7a2b00991c41a08", "index": 5438, "step-1": "<mask token>\n\n\ndef takeInput():\n x = input()\n while not validInput(x):\n print('Invalid input. Try another one:')\n x = input()\n return x\n\n\ndef main():\n stats = {'Council': 0, 'United': 0, 'Facel...
[ 2, 3, 4, 5, 6 ]
import numpy as np import matplotlib.pyplot as plt from PIL import Image import cv2 import openslide class QualityPatch(): def __init__(self, original_img_path,label_img_path,patch_level,patch_size): """ parameter: original_img_path(str): the source of image label_img_path(s...
normal
{ "blob_id": "0ad71f02e37f2744036b134c33e037a724fd38a6", "index": 8049, "step-1": "<mask token>\n\n\nclass QualityPatch:\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n def getReleventPatches(self):\n relevent_patches = []\n for i, coor in enumerate(s...
[ 3, 6, 7, 9, 10 ]
<|reserved_special_token_0|> def processFrame(image_message): frame = CvBridge().imgmsg_to_cv2(image_message) frame_hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) mask = cv2.inRange(frame_hsv, (0, 0, 0, 0), (180, 255, 30, 0)) mask = cv2.dilate(mask, None, iterations=1) cnts = cv2.findContours(mask.c...
flexible
{ "blob_id": "e864dad3f46fc9c6c472823bd06ce74fb5cb3f41", "index": 462, "step-1": "<mask token>\n\n\ndef processFrame(image_message):\n frame = CvBridge().imgmsg_to_cv2(image_message)\n frame_hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)\n mask = cv2.inRange(frame_hsv, (0, 0, 0, 0), (180, 255, 30, 0))\n ...
[ 1, 2, 3, 4, 5 ]
import os import sys sys.path.insert(0, "/path/to/mm-api/python") sys.path.insert(0, "/path/to/mm-api/distrib/python_osx") print(sys.path) import mmapi from mmRemote import * import mm; # assumption: we are running examples_dir = "/dir/of/models/" part_filename1 = os.path.join( examples_dir, "model1.stl" ) part_file...
normal
{ "blob_id": "bf6d1ddf66bc0d54320c0491e344925a5f507df7", "index": 861, "step-1": "<mask token>\n", "step-2": "<mask token>\nsys.path.insert(0, '/path/to/mm-api/python')\nsys.path.insert(0, '/path/to/mm-api/distrib/python_osx')\nprint(sys.path)\n<mask token>\nremote.connect()\n<mask token>\nremote.shutdown()\n",...
[ 0, 1, 2, 3, 4 ]
#https://codecombat.com/play/level/village-champion # Incoming munchkins! Defend the town! # Define your own function to fight the enemy! # In the function, find an enemy, then cleave or attack it. def attttaaaaacccckkkk(): enemy = hero.findNearest(hero.findEnemies()) #enemy = hero.findNearestEnemy() if e...
normal
{ "blob_id": "ce365e011d8cc88d9aa6b4df18ea3f4e70d48f5c", "index": 4887, "step-1": "<mask token>\n", "step-2": "def attttaaaaacccckkkk():\n enemy = hero.findNearest(hero.findEnemies())\n if enemy:\n if enemy and hero.isReady('cleave'):\n hero.cleave(enemy)\n else:\n hero...
[ 0, 1, 2, 3 ]
import xml.etree.ElementTree as ET #tree = ET.parse('rutas/rutas_prueba.xml') #treeToAdd = ET.parse('rutas/rutas_prueba_agregar.xml') #root = tree.getroot() #git rootToAdd = treeToAdd.getroot() #for child in root: # for test in child: # print(test.tag, test.attrib) #for elem in root.iter(): # print(...
normal
{ "blob_id": "b4b7e20c9558bd1b29a1c1fa24bfca8a2d292b27", "index": 398, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor root in rootsToAdd:\n for elem in root:\n root1.append(elem)\nrutas0k_10k.write('rutas/rutas0k-110k.xml')\n", "step-3": "<mask token>\nrutas0k_10k = ET.parse('rutas/rutas0k...
[ 0, 1, 2, 3, 4 ]
import os from matplotlib import pyplot as plt from matplotlib import colors import numpy as np class figure: def __init__(self, dire, dpi, span, data, CIM, learn_loss=None, eval_loss=None, different_dir_app=True, reference_steps=0, reveal_trend=1): self.dire = self.new_num_directory(di...
normal
{ "blob_id": "dce6ef64cf1a758ed25e11f626ce31206d18f960", "index": 8645, "step-1": "<mask token>\n\n\nclass figure:\n <mask token>\n\n def new_num_directory(self, path):\n n = 1\n while True:\n if not os.path.exists(path + '_' + str(n)):\n os.mkdir(path + '_' + str(n))...
[ 4, 11, 12, 13, 14 ]
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created with YooLiang Technology (侑良科技). # Author: Qi-Liang Wen (温啓良) # Web: http://www.yooliang.com/ # Date: 2015/7/12. from monkey import BasicModel from monkey import Fields class WebInformationModel(BasicModel): class Meta: label_name = { "...
normal
{ "blob_id": "3d55a5b4e332523025f65e5f5859f4633f4ee9a3", "index": 7501, "step-1": "<mask token>\n\n\nclass WebInformationModel(BasicModel):\n\n\n class Meta:\n label_name = {'title': u'通用名稱', 'name': u'識別碼',\n 'domain_registration': u'網域註冊地', 'domain_registration_price':\n u'網域註冊費用...
[ 1, 2, 3, 4, 5 ]
import Numberjack as Nj class Teachers(object): """Will be expanded to allow constraints for individual teachers""" def __init__(self): self.store = list() def add(self, teachers): if isinstance(teachers, (list, tuple)): self.store.extend(teachers) elif isinstance(teac...
normal
{ "blob_id": "8787126e654808a5fec52283780d9b4f668fa50f", "index": 8593, "step-1": "<mask token>\n\n\nclass Subjects(object):\n\n def __init__(self):\n self.store = list()\n\n def add(self, subjects):\n if isinstance(subjects, (list, tuple)):\n self.store.extend(subjects)\n el...
[ 9, 10, 12, 13, 15 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def tools(): search = str(input('Please enter search: ')) search.strip() pulsesJSON = otx.search_pulses(search, 40) for aPulse in pulsesJSON['results']: name = aPulse.get('name') description = aPu...
flexible
{ "blob_id": "659f45d2c6c7138f26b4a8d15d1710ae60450b08", "index": 6278, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef tools():\n search = str(input('Please enter search: '))\n search.strip()\n pulsesJSON = otx.search_pulses(search, 40)\n for aPulse in pulsesJSON['results']:\n n...
[ 0, 1, 2, 3 ]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- db = { 'host': "localhost", 'user': "root", 'passwd': "m74e71", 'database': "dw_toner" } data_inicial = '1990-01-01' ano_final = 2018 feriados = "feriados.csv" meses_de_ferias = (1, 2, 7, 12) #Janeiro, Fevereiro, Julho, Dezembro dias_final_semana = (1, ...
normal
{ "blob_id": "360881cecbad88ea5d150548fba6a39d8dc30681", "index": 8598, "step-1": "<mask token>\n", "step-2": "db = {'host': 'localhost', 'user': 'root', 'passwd': 'm74e71', 'database':\n 'dw_toner'}\ndata_inicial = '1990-01-01'\nano_final = 2018\nferiados = 'feriados.csv'\nmeses_de_ferias = 1, 2, 7, 12\ndia...
[ 0, 1, 2 ]
def geo_avg(x, lat, dim=2): """ geo_avg: to calculate weighting average according to latitude input: x: variable lat: corresponding latittude dim: the order of the lat dimension, two cases: 2:[time,lev,lat,*lon],or 1:[time or lev, lat, *lon] output: result: 1d or 2d ave...
flexible
{ "blob_id": "a2871585ce36888cf89c4dc5a6a7de6b212412bb", "index": 1153, "step-1": "def geo_avg(x, lat, dim=2):\n \"\"\"\n geo_avg: to calculate weighting average according to latitude\n input: \n x: variable \n lat: corresponding latittude\n dim: the order of the lat dimension, two c...
[ 5, 6, 7, 8, 9 ]
lista = [] z = 0 j = 9 for i in range(0, 10): lista.append(int(input())) while z < j: c = lista[z] lista[z] = lista[j] lista[j] = c z += 1 j -= 1 print(lista)
normal
{ "blob_id": "01ede703e36268dc9b3331b21726c24674a43817", "index": 1338, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor i in range(0, 10):\n lista.append(int(input()))\nwhile z < j:\n c = lista[z]\n lista[z] = lista[j]\n lista[j] = c\n z += 1\n j -= 1\nprint(lista)\n", "step-3": "li...
[ 0, 1, 2 ]
<|reserved_special_token_0|> def avg(x): return [(sum(x[i]) / row) for i in range(col)] <|reserved_special_token_0|> def cov(x, md_x): cov_xy = [[(0) for r in range(col)] for c in range(col)] for i in range(col): for j in range(col): for k in range(row): cov_xy[i][j...
flexible
{ "blob_id": "ad3c5ed3d6a9aa83e69f53d3fec845e8e2b1c9c6", "index": 883, "step-1": "<mask token>\n\n\ndef avg(x):\n return [(sum(x[i]) / row) for i in range(col)]\n\n\n<mask token>\n\n\ndef cov(x, md_x):\n cov_xy = [[(0) for r in range(col)] for c in range(col)]\n for i in range(col):\n for j in ran...
[ 3, 4, 5, 6, 7 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> print( """ ███████████████████████████████ █ █ █═╬═════════════════════════╬═█ █ ║░░░░░░░░░░░░░░░░░░░░░░░░░║ █ █ ║░░░░Wi-fi Fucker Tool░░░░║ █ █ ║░░░░░░░░░░░░░░░░░░░░░░░░░║ ...
flexible
{ "blob_id": "15eb205e6bd36844fdfc8c05efbc3a3d584c122d", "index": 7238, "step-1": "<mask token>\n", "step-2": "<mask token>\nprint(\n \"\"\"\n\n ███████████████████████████████\n █ █\n █═╬═════════════════════════╬═█\n █ ║░░░░░░░░░░░░░░░░░░░░░░░░░║ █\n █ ║░░░░Wi-fi ...
[ 0, 1, 2, 3, 4 ]
# Bisection recursion algo for sqrt of 2 def bisectionSqrt(x, epsilon = 0.01, low = None, high = None): """ Performs a recursive bisection search to find the square root of x, within epsilon """ if low == None: low = 0.0 if high == None: high = x midPoint = (high + low)/2.0 # If the difference of the ...
normal
{ "blob_id": "d332ddd6c66bb22d60190ab8f94931eac6fd2394", "index": 8482, "step-1": "# Bisection recursion algo for sqrt of 2\n\ndef bisectionSqrt(x, epsilon = 0.01, low = None, high = None):\n\t\"\"\" \n\t\tPerforms a recursive bisection search to find the\n\t\tsquare root of x, within epsilon\n\t\"\"\"\n\n\tif lo...
[ 0 ]
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2017-05-29 04:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('nomenclature', '0002_saloon_default'), ] operations = [ migrations.AlterFiel...
normal
{ "blob_id": "7817a42e5aee1786cfb3e8018bd7ca0a5e74749d", "index": 8447, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n", "step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n dependencies = [('nomenclatur...
[ 0, 1, 2, 3, 4 ]
from parser import read_expression_line, read_expression_lines, read_assignment_line, read_import_line, Import def test_expression(): lines = ['a % b'] expression, left = read_expression_lines(lines) assert expression is not None and len(left) == 0, left print "test_expression 0: {} {}".format(expressi...
normal
{ "blob_id": "657866affd653a99eb7d9a9a82b2f7d6503ec21a", "index": 2468, "step-1": "from parser import read_expression_line, read_expression_lines, read_assignment_line, read_import_line, Import\n\ndef test_expression():\n lines = ['a % b']\n expression, left = read_expression_lines(lines)\n assert expres...
[ 0 ]
import pyodbc from configuration.config import Configuration from models.entities import Entities from models.columns import Columns from models.relationships import Relationship from models.synonyms import Synonyms from spacy.lemmatizer import Lemmatizer from spacy.lookups import Lookups class DBModel(object): ...
normal
{ "blob_id": "76ebab93441676f9f00b2c2d63435e72c2d5d1ba", "index": 9936, "step-1": "<mask token>\n\n\nclass DBModel(object):\n <mask token>\n <mask token>\n\n def get_matcher(self, matcher, nlp):\n for entity in self.entities:\n matcher.add(entity.name.upper() + '_TABLE', None, nlp(entit...
[ 2, 3, 4, 6, 7 ]
<|reserved_special_token_0|> class Gui: <|reserved_special_token_0|> def insert_data(self): self.id = e.get() self.name1 = e1.get() self.fathername = e2.get() self.mothername = e3.get() self.cont = e4.get() self.email = e5.get() self.cursor.execute( ...
flexible
{ "blob_id": "4c6b04716f41c3413896f0d59f2cc9b1475d7f64", "index": 5164, "step-1": "<mask token>\n\n\nclass Gui:\n <mask token>\n\n def insert_data(self):\n self.id = e.get()\n self.name1 = e1.get()\n self.fathername = e2.get()\n self.mothername = e3.get()\n self.cont = e4....
[ 9, 12, 17, 18, 20 ]
#from tkinter import Tk, Text, INSERT import mnemonicos as mne class Ensambler(object): def __init__(self, fileName): #Nombre del archivo self.fileName = fileName #Lineas del Archivo self.fileLines = [] #Contador de Localidades self.cl = 0 #Tamaño self.size = 0 #Opcode self.code = "" #Intr...
normal
{ "blob_id": "3bc009271c7dd34ad09bcef81214387b63dfac59", "index": 2549, "step-1": "<mask token>\n\n\nclass Ensambler(object):\n\n def __init__(self, fileName):\n self.fileName = fileName\n self.fileLines = []\n self.cl = 0\n self.size = 0\n self.code = ''\n self.instru...
[ 7, 8, 9, 10, 12 ]
<|reserved_special_token_0|> class Downloader: <|reserved_special_token_0|> def _worker(self, download_range: tuple, counter: AtomicCounter): start, end = download_range header = {'Range': 'bytes=' + str(start) + '-' + str(end)} r = requests.get(self.url, headers=header, stream=True, ...
flexible
{ "blob_id": "3dc3bbd00f9c2d00093bf8669963d96f5019b2da", "index": 4648, "step-1": "<mask token>\n\n\nclass Downloader:\n <mask token>\n\n def _worker(self, download_range: tuple, counter: AtomicCounter):\n start, end = download_range\n header = {'Range': 'bytes=' + str(start) + '-' + str(end)}...
[ 3, 4, 5, 6, 7 ]
""" Url router for the federated search application """ from django.conf.urls import include from django.urls import re_path urlpatterns = [ re_path(r"^rest/", include("core_federated_search_app.rest.urls")), ]
normal
{ "blob_id": "6903584b27c0720cebf42ed39968b18f0f67f796", "index": 6167, "step-1": "<mask token>\n", "step-2": "<mask token>\nurlpatterns = [re_path('^rest/', include(\n 'core_federated_search_app.rest.urls'))]\n", "step-3": "<mask token>\nfrom django.conf.urls import include\nfrom django.urls import re_pat...
[ 0, 1, 2, 3 ]
from meross_iot.model.http.exception import HttpApiError from logger import get_logger from typing import Dict from flask import Blueprint from authentication import _user_login from decorator import meross_http_api from messaging import make_api_response auth_blueprint = Blueprint('auth', __name__) _LOGGER = get_...
normal
{ "blob_id": "afccd33e4c6bc5b7907a6af4ab698489fc9ea70d", "index": 5299, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\n@auth_blueprint.route('/Login', methods=['POST'])\n@meross_http_api(login_required=False)\ndef login(api_payload: Dict, *args, **kwargs):\n email = api_payload.get('email')\n pa...
[ 0, 1, 2, 3, 4 ]
"""AWS CDK application. See https://docs.aws.amazon.com/cdk/ for details. """ from ias_pmi_cdk_common import PMIApp from stacks import MainStack APP_NAME = 'etl-pm-pipeline-be' # create CDK application app = PMIApp(APP_NAME) # add stacks MainStack(app, app, 'main') # synthesize application assembly app.synth(...
normal
{ "blob_id": "dfbbbaf6b5f02c60ca48f7864068d59349c547d1", "index": 5484, "step-1": "<mask token>\n", "step-2": "<mask token>\nMainStack(app, app, 'main')\napp.synth()\n", "step-3": "<mask token>\nAPP_NAME = 'etl-pm-pipeline-be'\napp = PMIApp(APP_NAME)\nMainStack(app, app, 'main')\napp.synth()\n", "step-4": "...
[ 0, 1, 2, 3, 4 ]
from . import by_trips from . import by_slope
normal
{ "blob_id": "74fae3636b1c1b0b79d0c6bec8698581b063eb9c", "index": 8944, "step-1": "<mask token>\n", "step-2": "from . import by_trips\nfrom . import by_slope\n", "step-3": null, "step-4": null, "step-5": null, "step-ids": [ 0, 1 ] }
[ 0, 1 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def resource_path(relative_path): """ Get absolute path to resource, works for dev and for PyInstaller """ try: base_path = sys._MEIPASS except Exception: base_path = os.path.abspath('.') return o...
flexible
{ "blob_id": "5fb3905abf958f0a8be41cd6ad07efb2a0cf6c66", "index": 7542, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef resource_path(relative_path):\n \"\"\" Get absolute path to resource, works for dev and for PyInstaller \"\"\"\n try:\n base_path = sys._MEIPASS\n except Exception...
[ 0, 1, 2, 3, 4 ]
animals = ['bear', 'python', 'peacock', 'kangaroo', 'whale', 'platypus'] The animal at 1. The third (3rd) animal. The first (1st) animal. The animal at 3. The fifth (5th) animal. The animal at 2. The sixth (6th) animal. The animal at 4.
normal
{ "blob_id": "a319ebb05e9034f19aef39bd46830c8a607ed121", "index": 1013, "step-1": "animals = ['bear', 'python', 'peacock', 'kangaroo', 'whale', 'platypus']\nThe animal at 1.\nThe third (3rd) animal.\nThe first (1st) animal.\nThe animal at 3.\nThe fifth (5th) animal.\nThe animal at 2.\nThe sixth (6th) animal.\nThe...
[ 0 ]
from .core import S3FileSystem, S3File from .mapping import S3Map from ._version import get_versions __version__ = get_versions()['version'] del get_versions
normal
{ "blob_id": "32e60c672d6e73600d442c4344743deccaed6796", "index": 8819, "step-1": "<mask token>\n", "step-2": "<mask token>\ndel get_versions\n", "step-3": "<mask token>\n__version__ = get_versions()['version']\ndel get_versions\n", "step-4": "from .core import S3FileSystem, S3File\nfrom .mapping import S3M...
[ 0, 1, 2, 3 ]
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.utils import timezone from timesheets.models import TimeSheet from channels import Group class ProjectTS(models.Model): class Meta: ...
normal
{ "blob_id": "df39a97db25f03aca8ebd501283fd6a7c486db8c", "index": 1243, "step-1": "<mask token>\n\n\nclass ProjectTSEntry(models.Model):\n description = models.CharField(max_length=150, default='')\n project_time_sheet = models.ForeignKey(ProjectTS, related_name=\n 'project_time_sheet')\n project_...
[ 3, 4, 5, 6, 7 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def smallest_divisible(nmax=20): smallest = 1 for i in range(1, nmax + 1): if smallest % i: smallest *= i / gcd(i, smallest) return smallest <|reserved_special_token_1|> <|reserved_special_toke...
flexible
{ "blob_id": "1cc696410a5d2eaf294d032c04a96974d5ef5db0", "index": 2831, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef smallest_divisible(nmax=20):\n smallest = 1\n for i in range(1, nmax + 1):\n if smallest % i:\n smallest *= i / gcd(i, smallest)\n return smallest\n", ...
[ 0, 1, 2, 3 ]
import pickle import pytest from reader import EntryError from reader import FeedError from reader import SingleUpdateHookError from reader import TagError from reader.exceptions import _FancyExceptionBase def test_fancy_exception_base(): exc = _FancyExceptionBase('message') assert str(exc) == 'message' ...
normal
{ "blob_id": "6fd4df7370de2343fe7723a2d8f5aacffa333835", "index": 3105, "step-1": "<mask token>\n\n\ndef test_fancy_exception_base():\n exc = _FancyExceptionBase('message')\n assert str(exc) == 'message'\n exc = _FancyExceptionBase(message='message')\n assert str(exc) == 'message'\n cause = Excepti...
[ 5, 6, 7, 8, 9 ]
<|reserved_special_token_0|> def login_name(request): if request.method == 'POST': form = Login(request.POST) if form.is_valid(): email = form.cleaned_data['email'] password = form.cleaned_data['password'] return render(request, 'login/new_index.html', {'form': ...
flexible
{ "blob_id": "cbbb314a3262713f6cb2bb2dd90709d7bf1ca8eb", "index": 6095, "step-1": "<mask token>\n\n\ndef login_name(request):\n if request.method == 'POST':\n form = Login(request.POST)\n if form.is_valid():\n email = form.cleaned_data['email']\n password = form.cleaned_data...
[ 1, 2, 3, 4, 5 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def StringToList(input_string): word_list = [] word = '' for i in range(0, len(input_string)): if input_string[i] == ' ': word_list.append(word) word = '' elif i == len(input_s...
flexible
{ "blob_id": "7c2897dcb732e75d7328e8c0484d5bd7f3b56e6f", "index": 9190, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef StringToList(input_string):\n word_list = []\n word = ''\n for i in range(0, len(input_string)):\n if input_string[i] == ' ':\n word_list.append(word)\n...
[ 0, 2, 3, 4, 5 ]
<|reserved_special_token_0|> class SSDigitDecoder(Elaboratable): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> class Blinky(Elaboratable): def __init__(self): self.dd0 = SSDigitDecoder() self.dd1 = SSDigitDecoder() def elaborate(self, pl...
flexible
{ "blob_id": "74bb511a9ec272020693db65a2e708f3db56931e", "index": 9954, "step-1": "<mask token>\n\n\nclass SSDigitDecoder(Elaboratable):\n <mask token>\n <mask token>\n <mask token>\n\n\nclass Blinky(Elaboratable):\n\n def __init__(self):\n self.dd0 = SSDigitDecoder()\n self.dd1 = SSDigi...
[ 4, 6, 7, 8, 10 ]
import logging from datetime import datetime from preprocessing import death_preprocessing from preprocessing_three_month import death_preprocessing_three_month from death_rule_first_55 import death_rule_first_55 from death_rule_second import death_rule_second_new from death_escalation import death_escalation if __n...
normal
{ "blob_id": "f44a8837056eb77fbf0ff37b9c57891cc3a3d6b2", "index": 6783, "step-1": "<mask token>\n", "step-2": "<mask token>\nif __name__ == '__main__':\n logging.basicConfig(filename='logfile.log', filemode='a', format=\n '%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)\n logging.in...
[ 0, 1, 2, 3 ]
a=int(input("Choose a number: ")) for x in range(1,100000): b=a*x; print(x, '*', a,'=',b) if b>100: break
normal
{ "blob_id": "043dd97d4d4ade29536a83c3557a34db3a4cb0f9", "index": 2002, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor x in range(1, 100000):\n b = a * x\n print(x, '*', a, '=', b)\n if b > 100:\n break\n", "step-3": "a = int(input('Choose a number: '))\nfor x in range(1, 100000):\n ...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> class SchemathesisCase(PyCollector): <|reserved_special_token_0|> def _get_test_name(self, endpoint: Endpoint) ->str: return f'{self.name}[{endpoint.method}:{endpoint.path}]' def _gen_items(self, endpoint: Endpoint) ->Generator[Function, None, None]: """Gener...
flexible
{ "blob_id": "2060f0af351c1487f8aa45943dbaa050f4291c58", "index": 7791, "step-1": "<mask token>\n\n\nclass SchemathesisCase(PyCollector):\n <mask token>\n\n def _get_test_name(self, endpoint: Endpoint) ->str:\n return f'{self.name}[{endpoint.method}:{endpoint.path}]'\n\n def _gen_items(self, endpo...
[ 4, 6, 7, 8, 9 ]
<|reserved_special_token_0|> class BureauActifCalendarDataType(db.Model, BaseModel): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class...
flexible
{ "blob_id": "83117000f5f34490cb14580a9867b1e871ccc2ae", "index": 526, "step-1": "<mask token>\n\n\nclass BureauActifCalendarDataType(db.Model, BaseModel):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n", "step-2": "<mask token>\n\n\nclass BureauActifCalendarDataType...
[ 1, 3, 4, 5, 6 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class AccountsnConfig(AppConfig): <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class AccountsnConfig(AppConfig): name = 'accounts' <|reserved_special_token_1|> from djang...
flexible
{ "blob_id": "a3fc624d6d101667ab11842eac96ed1b34d4317e", "index": 3369, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass AccountsnConfig(AppConfig):\n <mask token>\n", "step-3": "<mask token>\n\n\nclass AccountsnConfig(AppConfig):\n name = 'accounts'\n", "step-4": "from django.apps impor...
[ 0, 1, 2, 3 ]
import os from MdApi import MdApi class Adapter(MdApi): def __init__(self): super(Adapter, self).__init__() def connect(self): self.createFtdcMdApi(os.getcwd()) self.registerFront('tcp://180.168.146.187:10010') def onFrontConnected(self): print 'front succ...
normal
{ "blob_id": "0e58834120c34b5152026bde6d089be19244e21a", "index": 269, "step-1": "import os\n\nfrom MdApi import MdApi\n\nclass Adapter(MdApi):\n\n def __init__(self):\n \n super(Adapter, self).__init__()\n\n\n def connect(self):\n\n\n self.createFtdcMdApi(os.getcwd())\n\n self.r...
[ 0 ]
from clients.models import Budget from clients.models import Spend from datetime import date as datetimedate from datetime import datetime from datetime import timedelta from django.db import models from rest_framework.exceptions import ParseError import math import pandas as pd class CampaignPerformance: """ Get...
normal
{ "blob_id": "a860e6670719a733e75c7580cf2e07765b0777eb", "index": 2806, "step-1": "<mask token>\n\n\nclass CampaignPerformance:\n <mask token>\n\n def __init__(self, campaign, start):\n self.campaign = campaign\n self.start = start\n self.BUDGETS_NAME = 'Budgets'\n self.required_...
[ 9, 12, 13, 15, 16 ]
<|reserved_special_token_0|> def getRandomUserAgnet(): user_agents = [ 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 QIHU 360S' ] userAgent = random.choice(user_agents) return userAgent def getProxies(): proxies = [] ...
flexible
{ "blob_id": "911631e96d21bdf22a219007f1bdc04a5e6965dc", "index": 739, "step-1": "<mask token>\n\n\ndef getRandomUserAgnet():\n user_agents = [\n 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 QIHU 360S'\n ]\n userAgent = random.ch...
[ 3, 4, 5, 6, 7 ]
""" Looks up values in createresistorvaluesdbm.py. Outputs string value ( cmd ). """ import dbm # Open a DB. The c option opens in read/write mode and creates the file if needed. db = dbm.open( 'resistorvalues', 'c' ) with open( "dummyoutput.txt", "r" ) as file_object: #print (file_object.readli...
normal
{ "blob_id": "69eb62ba47a63cf007334c777709b0513d75f396", "index": 1504, "step-1": "<mask token>\n", "step-2": "<mask token>\nwith open('dummyoutput.txt', 'r') as file_object:\n data = file_object.readlines()\n for line in data:\n words = line.split(';')\n for i in range(1, len(words), 4):\n ...
[ 0, 1, 2, 3, 4 ]
TTTSIZE = 4 def who_win_line(line): elements = set(line) if '.' in elements: return '.' elements.discard('T') if len(elements) >= 2: return 'D' else: return elements.pop() def who_win_tic_tac_toe(original_rows): #print('%s' % repr(original_rows)) board...
normal
{ "blob_id": "2e041e33b5c34c2bddc72b36ff641817f1e21db2", "index": 3735, "step-1": "<mask token>\n\n\ndef who_win_line(line):\n elements = set(line)\n if '.' in elements:\n return '.'\n elements.discard('T')\n if len(elements) >= 2:\n return 'D'\n else:\n return elements.pop()\n...
[ 2, 3, 4, 5, 6 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> def heapify(lst, index, heap_size): largest = index left_index = 2 * index + 1 right_index = 2 * index + 2 if left_index < heap_size and lst[left_index] > lst[largest]: largest = left_index if right_index < heap_size and lst[right_...
flexible
{ "blob_id": "d8ea396ff8514cc10e02072ea478f0276584153d", "index": 3274, "step-1": "<mask token>\n", "step-2": "def heapify(lst, index, heap_size):\n largest = index\n left_index = 2 * index + 1\n right_index = 2 * index + 2\n if left_index < heap_size and lst[left_index] > lst[largest]:\n lar...
[ 0, 1, 2 ]
import numpy as np import initialization as init import evaluation as eval import selection as sel import recombination as rec import mutation as mut initialize = init.permutation evaluate = eval.custom select = sel.rank_based mutate = mut.swap reproduce = rec.pairwise crossover = rec.order replace = sel.rank_based par...
normal
{ "blob_id": "5eab41a2ef536365bab6f6b5ad97efb8d26d7687", "index": 4456, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor gen in range(params['gens']):\n parents = select(population, params['n_pars'])\n offspring = reproduce(params, parents, crossover)\n offspring = mutate(params, offspring)\n ...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> def visualize_grayscale_intensities(img, out_path): img_x, img_y = np.mgrid[0:img.shape[0], 0:img.shape[1]] fig = plt.figure() ax = fig.gca(projection='3d') ax.plot_surface(img_x, img_y, img, rstride=1, cstride=1, cmap=plt.cm. jet, linewidth=0) plt.savefig(out_...
flexible
{ "blob_id": "21fec6d307b928a295f2ffbf267456f9cd9ea722", "index": 9105, "step-1": "<mask token>\n\n\ndef visualize_grayscale_intensities(img, out_path):\n img_x, img_y = np.mgrid[0:img.shape[0], 0:img.shape[1]]\n fig = plt.figure()\n ax = fig.gca(projection='3d')\n ax.plot_surface(img_x, img_y, img, r...
[ 4, 6, 7, 8, 9 ]
#!/usr/bin/env python #coding:utf-8 import sys import time reload(sys) sys.setdefaultencoding('utf8') from bs4 import BeautifulSoup import requests import csv import codecs import xlwt #from word_power_dict import get_url_dict #from Vocabulary_Toefl_MP3s_5000_Words_Memory_Course_dict import get_url_dict #from new_para...
normal
{ "blob_id": "fab1d2270ae906ca92cf3be2c2d9767737ea6083", "index": 6364, "step-1": "#!/usr/bin/env python\n#coding:utf-8\n\nimport sys\nimport time\nreload(sys)\nsys.setdefaultencoding('utf8')\nfrom bs4 import BeautifulSoup\nimport requests\nimport csv\nimport codecs\nimport xlwt\n#from word_power_dict import get_...
[ 0 ]
''' Inspection of the network with unlabelled data ''' import numpy as np import matplotlib.pyplot as plt from main import IMG_SIZE, MODEL_NAME, model model.load(MODEL_NAME) ''' COMMENT OUT FOLLOWING AS APPROPRIATE ''' # if you need to create the data: # test_data = process_test_...
normal
{ "blob_id": "02d7022c7d864354379009577d64109601190998", "index": 7034, "step-1": "<mask token>\n", "step-2": "<mask token>\nmodel.load(MODEL_NAME)\n<mask token>\nfor num, data in enumerate(test_data[:12]):\n img_num = data[1]\n img_data = data[0]\n y = fig.add_subplot(3, 4, num + 1)\n orig = img_da...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def start(): try: CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 dest_path = winshell.desktop() + '\\Spyware\\Output' dest_path = dest_path.replace('\\', '/') ...
flexible
{ "blob_id": "bbbbf0e1bbd7ead034d8cd88ee6a09a61cde7803", "index": 3463, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef start():\n try:\n CHUNK = 1024\n FORMAT = pyaudio.paInt16\n CHANNELS = 2\n RATE = 44100\n dest_path = winshell.desktop() + '\\\\Spyware\\\\Ou...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def raiting_validator(value): if value < 1 or value > 10: raise ValidationError('%s is not a caorrect raiting!' % value) <|reserved_special_token_1|> <|reserved_special_token_0|> def year_validator(value): i...
flexible
{ "blob_id": "7a6d5309580b673413f57047e631a08e61e837cf", "index": 4447, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef raiting_validator(value):\n if value < 1 or value > 10:\n raise ValidationError('%s is not a caorrect raiting!' % value)\n", "step-3": "<mask token>\n\n\ndef year_vali...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> class DateFormat(TextFormat): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> def __init__(self, name...
flexible
{ "blob_id": "5e1398ed628917a42cc465e7cc2979601f0f4fbc", "index": 7865, "step-1": "<mask token>\n\n\nclass DateFormat(TextFormat):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n def __init__(self, name, attrs={}):\n \"\"\...
[ 100, 168, 171, 173, 175 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def test(): raw_text = ( "通化辉南县经济适用房_通化辉南县经适房_通化辉南县经济适用房转让_通化去114网通化切换城市var googlequerykey ='二手经适房 二手房买卖 二手房地产公司' ; var AdKeyWords = '...
flexible
{ "blob_id": "488d20a86c5bddbca2db09b26fb8df4b6f87a1dc", "index": 2354, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef test():\n raw_text = (\n \"通化辉南县经济适用房_通化辉南县经适房_通化辉南县经济适用房转让_通化去114网通化切换城市var googlequerykey ='二手经适房 二手房买卖 二手房地产公司' ; ...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def Lad(a1, a2, b1, b2): if (a1 == b1) | (a2 == b2): return 'YES' else: return 'NO' <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def Lad(a1, a2, b1, b2): ...
flexible
{ "blob_id": "0f55b598058b65c9dbf9cd4761d1ff6fc7091b19", "index": 8791, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef Lad(a1, a2, b1, b2):\n if (a1 == b1) | (a2 == b2):\n return 'YES'\n else:\n return 'NO'\n\n\n<mask token>\n", "step-3": "<mask token>\n\n\ndef Lad(a1, a2, b1...
[ 0, 1, 2, 3 ]
import gzip import pickle as pkl import time from datetime import datetime import grpc import numpy as np from sklearn.utils import shuffle import neural_nets_pb2 as nn_pb import neural_nets_pb2_grpc as nn_pb_grpc from mnist_loader import load_data from activations import * # pylint: disable=too-many-arguments cl...
normal
{ "blob_id": "fa6f251f27b645fc6827285b5578fd9634c8bb30", "index": 6361, "step-1": "<mask token>\n\n\nclass Layer(nn_pb_grpc.LayerDataExchangeServicer):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n def init_weights(self, load_weights=None):\n ...
[ 24, 27, 28, 32, 35 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> print('Max: {}'.format(max_value)) print('Max: {}'.format(max_value1)) print('Max: {}'.format(max_value2)) print('Max: {}'.format(max_value3)) <|reserved_special_token_1|> max_integer = __import__('9-max_integer').max_integer m...
flexible
{ "blob_id": "f5b74ca95cb368d70139b5d36e3c8d553b8c5393", "index": 1393, "step-1": "<mask token>\n", "step-2": "<mask token>\nprint('Max: {}'.format(max_value))\nprint('Max: {}'.format(max_value1))\nprint('Max: {}'.format(max_value2))\nprint('Max: {}'.format(max_value3))\n", "step-3": "max_integer = __import__...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> def sigmoid(x): return 0.5 * (1 + np.tanh(0.5 * x)) def bernoulli_array(prob_array, dim): sample = np.zeros(dim) uni_sample = np.random.uniform(0, 1, dim) diff = uni_sample - prob_array coords = np.argwhere(diff < 0) sample[[*coords.T]] = 1 return sample <|...
flexible
{ "blob_id": "e048170775c589cf0a9fb3d54c72dab4df3f1bcb", "index": 7558, "step-1": "<mask token>\n\n\ndef sigmoid(x):\n return 0.5 * (1 + np.tanh(0.5 * x))\n\n\ndef bernoulli_array(prob_array, dim):\n sample = np.zeros(dim)\n uni_sample = np.random.uniform(0, 1, dim)\n diff = uni_sample - prob_array\n ...
[ 2, 3, 4, 5, 6 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> if len(sys.argv) != 3: print('Wrong number of arguments! Exiting.') <|reserved_special_token_0|> for line in infile.readlines(): fields = line.split() node_id = int(fields[0]) lat = float(fields[1]) lon = float...
flexible
{ "blob_id": "4744d594c0599f1aa807eefa0cb40a2a2a3c7926", "index": 6677, "step-1": "<mask token>\n", "step-2": "<mask token>\nif len(sys.argv) != 3:\n print('Wrong number of arguments! Exiting.')\n<mask token>\nfor line in infile.readlines():\n fields = line.split()\n node_id = int(fields[0])\n lat =...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> def end_num(s): text = re.compile('.*[0-9]$') if text.match(s): return 'Yes!Number is present at the end of string' else: return 'No!Number is not present at the end of string' <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_to...
flexible
{ "blob_id": "94334f91b1556c05dce0ed6f23c074bb8875f185", "index": 2505, "step-1": "<mask token>\n\n\ndef end_num(s):\n text = re.compile('.*[0-9]$')\n if text.match(s):\n return 'Yes!Number is present at the end of string'\n else:\n return 'No!Number is not present at the end of string'\n\n...
[ 1, 2, 3, 4, 5 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> class Solution: <|reserved_special_token_0|> <|reserved_special_token_1|> class Solution: def eventualSafeNodes(self, graph: List[List[int]]) ->List[int]: res = [] d = {} def dfs(node): if graph[node] == []: ...
flexible
{ "blob_id": "b815f72e2cad351fd9411361a0e7cc75d39ae826", "index": 9270, "step-1": "<mask token>\n", "step-2": "class Solution:\n <mask token>\n", "step-3": "class Solution:\n\n def eventualSafeNodes(self, graph: List[List[int]]) ->List[int]:\n res = []\n d = {}\n\n def dfs(node):\n ...
[ 0, 1, 2 ]
<|reserved_special_token_0|> class TestUnwrap(object): @pytest.fixture def fn(self): def fn(): pass return fn <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <...
flexible
{ "blob_id": "a1e563f94044ff7cd7e0e55542bc4ca2db81df28", "index": 9749, "step-1": "<mask token>\n\n\nclass TestUnwrap(object):\n\n @pytest.fixture\n def fn(self):\n\n def fn():\n pass\n return fn\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask toke...
[ 14, 15, 20, 25, 26 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def check_fibonacci_number(): global CURRENT_INDEX while fib_list[CURRENT_INDEX - 1] < NUMBER_TO_BE_CHECKED: fib_list.append(fib_list[CURRENT_INDEX - 1] + fib_list[ CURRENT_INDEX - 2]) CURRENT...
flexible
{ "blob_id": "50fa8852f74f4d2428fb238a86dd1feedb210877", "index": 3261, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef check_fibonacci_number():\n global CURRENT_INDEX\n while fib_list[CURRENT_INDEX - 1] < NUMBER_TO_BE_CHECKED:\n fib_list.append(fib_list[CURRENT_INDEX - 1] + fib_list[...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def loadWavFile(fileName, filePath, savePlot, maxAudioLength, reduceNoise=True ): data, rate = librosa.load(filePath, sr=None) if reduceNoise: noiseRemovedData = noisereduce.reduce_noise(audio_clip=data, ...
flexible
{ "blob_id": "07ac061d7d1eaf23b6c95fbcbf6753f25e568188", "index": 157, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef loadWavFile(fileName, filePath, savePlot, maxAudioLength, reduceNoise=True\n ):\n data, rate = librosa.load(filePath, sr=None)\n if reduceNoise:\n noiseRemovedData ...
[ 0, 1, 2, 3 ]
# square environment. there are the wall at the edge from environment import super_environment class SquareNormal(super_environment.Environment): def __init__(self, size_x, size_y): super().__init__(size_x, size_y) @staticmethod def environment_type(): return 'square' def get_convert...
normal
{ "blob_id": "919f1746bfdec61f5e81e6ce0e17bb3bf040230a", "index": 2958, "step-1": "<mask token>\n\n\nclass SquareNormal(super_environment.Environment):\n <mask token>\n\n @staticmethod\n def environment_type():\n return 'square'\n <mask token>\n", "step-2": "<mask token>\n\n\nclass SquareNorm...
[ 2, 3, 4, 5, 6 ]
<|reserved_special_token_0|> class Deck: def __init__(self, num_cols, front, back): self.flashcards = [] self.num_cols = num_cols self.front = front self.back = back class Flashcard: def __init__(self, deck, front, back, column, row): self.deck = deck self.f...
flexible
{ "blob_id": "d5903698eb8ed6be531b0cc522d4feff6b79da4e", "index": 954, "step-1": "<mask token>\n\n\nclass Deck:\n\n def __init__(self, num_cols, front, back):\n self.flashcards = []\n self.num_cols = num_cols\n self.front = front\n self.back = back\n\n\nclass Flashcard:\n\n def _...
[ 8, 17, 18, 19, 20 ]
class Tienda: def __init__(self, nombre_tienda, lista_productos = []): self.nombre_tienda = nombre_tienda self.lista_productos = lista_productos def __str__(self): return f"Nombre de la Tienda: {self.nombre_tienda}\nLista de Productos: {self.lista_productos}\n" def anhadir_prod...
normal
{ "blob_id": "0ae5d20b78bf7c23418de55ffd4d81cd5284c6d5", "index": 8912, "step-1": "class Tienda:\n\n def __init__(self, nombre_tienda, lista_productos=[]):\n self.nombre_tienda = nombre_tienda\n self.lista_productos = lista_productos\n <mask token>\n\n def anhadir_producto(self, producto_nu...
[ 4, 5, 6, 7, 8 ]
from unittest import TestCase from attendance import Member __author__ = 'colin' class TestMember(TestCase): def test_here(self): member = Member("John", "Doe") self.assertFalse(member.attended) member.here() self.assertTrue(member.attended)
normal
{ "blob_id": "a6713a4edece14a88bd9c8ddd483ff8e16acdbcc", "index": 9695, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass TestMember(TestCase):\n\n def test_here(self):\n member = Member('John', 'Doe')\n self.assertFalse(member.attended)\n member.here()\n self.assertT...
[ 0, 2, 3, 4, 5 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> gpio.setmode(gpio.BOARD) <|reserved_special_token_0|> gpio.setup(pin, gpio.OUT) gpio.output(pin, gpio.HIGH) time.sleep(5) gpio.output(pin, gpio.LOW) time.sleep(1) gpio.cleanup() <|reserved_special_token_1|> <|reserved_special_t...
flexible
{ "blob_id": "cfdfc490396546b7af732417b506100357cd9a1f", "index": 6762, "step-1": "<mask token>\n", "step-2": "<mask token>\ngpio.setmode(gpio.BOARD)\n<mask token>\ngpio.setup(pin, gpio.OUT)\ngpio.output(pin, gpio.HIGH)\ntime.sleep(5)\ngpio.output(pin, gpio.LOW)\ntime.sleep(1)\ngpio.cleanup()\n", "step-3": "<...
[ 0, 1, 2, 3, 4 ]
number = int(input()) bonus = 0 if number <= 100: bonus = 5 total_point = number + bonus elif number > 1000: bonus = 0.1 * number total_point = number + bonus else: bonus = 0.2 * number total_point = number + bonus if number % 2 == 0: bonus = bonus + 1 total_point = number + bonus pr...
normal
{ "blob_id": "7ee3301b55d323d156bd394f8525e37502d19430", "index": 7669, "step-1": "<mask token>\n", "step-2": "<mask token>\nif number <= 100:\n bonus = 5\n total_point = number + bonus\nelif number > 1000:\n bonus = 0.1 * number\n total_point = number + bonus\nelse:\n bonus = 0.2 * number\n t...
[ 0, 1, 2 ]
import re # Class with static regex compilations class RegexCompiles: # regex for finding product-id in an EMAG link re_compile_product_id = re.compile('Product-Id=[0-9]*') # regex for finding the first number re_compile_id = re.compile('[0-9]+') # Verifies if a word exists in a text def find_whole_...
normal
{ "blob_id": "b1c06e9c5516a378c0bbce2ce9e17afaeae01928", "index": 668, "step-1": "<mask token>\n\n\nclass RegexCompiles:\n re_compile_product_id = re.compile('Product-Id=[0-9]*')\n re_compile_id = re.compile('[0-9]+')\n\n\n<mask token>\n", "step-2": "<mask token>\n\n\nclass RegexCompiles:\n re_compile_...
[ 2, 4, 5, 6, 7 ]
<|reserved_special_token_0|> def get_config(p, section, key, env_var, default, boolean=False, integer= False, floating=False, islist=False): """ return a configuration variable with casting """ value = _get_config(p, section, key, env_var, default) if boolean: return mk_boolean(value) if v...
flexible
{ "blob_id": "63bd8a15dd489844968f46c4b0ffe157d567537a", "index": 8044, "step-1": "<mask token>\n\n\ndef get_config(p, section, key, env_var, default, boolean=False, integer=\n False, floating=False, islist=False):\n \"\"\" return a configuration variable with casting \"\"\"\n value = _get_config(p, sect...
[ 4, 5, 6, 7, 8 ]
class Solution(object): def sortArrayByParityII(self, A): """ :type A: List[int] :rtype: List[int] """ i = 0 for j in range(1, len(A), 2): if A[j] % 2 == 1: continue else: while i + 2 < len(A) and A[i] % 2 == 0:...
normal
{ "blob_id": "429af603bf8f1c003799c3d94c0ce9a2c2f80dfc", "index": 3835, "step-1": "<mask token>\n", "step-2": "class Solution(object):\n <mask token>\n", "step-3": "class Solution(object):\n\n def sortArrayByParityII(self, A):\n \"\"\"\n :type A: List[int]\n :rtype: List[int]\n ...
[ 0, 1, 2 ]
from os import getenv config_env = {'api_port': int(getenv('API_PORT')), 'psg_uri': getenv('PSG_URI') }
normal
{ "blob_id": "21dd3d1deb00e9bc09803d01f1c05673ea8d25d2", "index": 3771, "step-1": "<mask token>\n", "step-2": "<mask token>\nconfig_env = {'api_port': int(getenv('API_PORT')), 'psg_uri': getenv('PSG_URI')\n }\n", "step-3": "from os import getenv\nconfig_env = {'api_port': int(getenv('API_PORT')), 'psg_uri'...
[ 0, 1, 2 ]
class default_locations: mc_2016_data_directory = "/afs/hephy.at/data/cms06/nanoTuples/" mc_2016_postProcessing_directory = "stops_2016_nano_v0p23/dilep/" data_2016_data_directory = "/afs/hephy.at/data/cms07/nanoTuples/" data_2016_postProcessing_directory = "stops_2016_nan...
normal
{ "blob_id": "b6df9414f99294c7986d3eb5332d40288f059cd1", "index": 1245, "step-1": "class default_locations:\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <ma...
[ 1, 2, 3, 4, 5 ]
<|reserved_special_token_0|> class simpleLSTM: <|reserved_special_token_0|> def create_dataset(self, dataset, look_back=4): dataX, dataY = [], [] for i in range(len(dataset) - look_back - 1): a = dataset.iloc[i:i + look_back] dataX.append(a) dataY.append(da...
flexible
{ "blob_id": "97ea837961c92b5c92a93ec33ac016de7ff1e876", "index": 2449, "step-1": "<mask token>\n\n\nclass simpleLSTM:\n <mask token>\n\n def create_dataset(self, dataset, look_back=4):\n dataX, dataY = [], []\n for i in range(len(dataset) - look_back - 1):\n a = dataset.iloc[i:i + ...
[ 4, 7, 8, 9, 10 ]
class Solution: def getDescentPeriods(self, prices: List[int]) -> int: ans = 1 # prices[0] dp = 1 for i in range(1, len(prices)): if prices[i] == prices[i - 1] - 1: dp += 1 else: dp = 1 ans += dp return ans
normal
{ "blob_id": "d10468d2d0aefa19a7d225bfffad03ec6cb6e082", "index": 4079, "step-1": "<mask token>\n", "step-2": "class Solution:\n <mask token>\n", "step-3": "class Solution:\n\n def getDescentPeriods(self, prices: List[int]) ->int:\n ans = 1\n dp = 1\n for i in range(1, len(prices)):...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> __all__ = ['JWTClient', 'get_domain', 'authenticated_users_only'] <|reserved_special_token_1|> from .hailjwt import JWTClient, get_domain, authenticated_users_only __all__ = ['JWTClient', 'get_domain', 'authenticated_users_only...
flexible
{ "blob_id": "39fb8d9f93be1e6c1ed2a425d14061737d643ab6", "index": 9330, "step-1": "<mask token>\n", "step-2": "<mask token>\n__all__ = ['JWTClient', 'get_domain', 'authenticated_users_only']\n", "step-3": "from .hailjwt import JWTClient, get_domain, authenticated_users_only\n__all__ = ['JWTClient', 'get_domai...
[ 0, 1, 2 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> if os.environ.get('MOCKPROGRAM_INOUT_FILE_OVERRIDE'): mockProgramInOutFilePath = os.environ.get('MOCKPROGRAM_INOUT_FILE_OVERRIDE' ) else: mockProgramInOutFilePath = '.mockprogram_inout.txt' if not os.path.exists(mo...
flexible
{ "blob_id": "550f5ad4fef77d5795db0393ae0701f679143e72", "index": 221, "step-1": "<mask token>\n", "step-2": "<mask token>\nif os.environ.get('MOCKPROGRAM_INOUT_FILE_OVERRIDE'):\n mockProgramInOutFilePath = os.environ.get('MOCKPROGRAM_INOUT_FILE_OVERRIDE'\n )\nelse:\n mockProgramInOutFilePath = '.m...
[ 0, 1, 2, 3, 4 ]
import turtle import math from tkinter import * #活性边表节点: class AetNode(object): def __init__(self,x,tx,my): self.x=x self.tx=tx self.my=my def op(self): return self.x class AetList(object): def __init__(self,y): self.y=y self.numy=0 self.l=[] p...
normal
{ "blob_id": "0a7a95755924fd264169286cc5b5b7587d7ee8e4", "index": 4608, "step-1": "<mask token>\n\n\nclass AetNode(object):\n\n def __init__(self, x, tx, my):\n self.x = x\n self.tx = tx\n self.my = my\n\n def op(self):\n return self.x\n\n\nclass AetList(object):\n\n def __ini...
[ 8, 10, 11, 12, 14 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> for banner_span in list_of_banners: print(f"{banner_span['id']}, {x_count}, {y_count}") x_count += 1 if x_count == 51: x_count = 1 y_count += 1 print('\n\n-----------------') <|reserved_specia...
flexible
{ "blob_id": "e60d57e8884cba8ce50a571e3bd0affcd4dcaf68", "index": 4056, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor banner_span in list_of_banners:\n print(f\"{banner_span['id']}, {x_count}, {y_count}\")\n x_count += 1\n if x_count == 51:\n x_count = 1\n y_count += 1\n ...
[ 0, 1, 2, 3, 4 ]
from functools import reduce from collections import defaultdict def memory(count: int, start_numbers: list): numbers = defaultdict(lambda: tuple(2 * [None]), { el: (idx,None ) for idx,el in enumerate(start_numbers) }) last = start_numbers[-1] for idx in range(len(numbers), count): last = 0 if None...
normal
{ "blob_id": "0f0adde7241898d2efe7e2b5cc218e42ed7b73d8", "index": 5475, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef memory(count: int, start_numbers: list):\n numbers = defaultdict(lambda : tuple(2 * [None]), {el: (idx, None) for \n idx, el in enumerate(start_numbers)})\n last = st...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Migration(migrations.Migration): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Migration(migrations.Migration): dependencies = [(...
flexible
{ "blob_id": "211ef4c64e42c54423ac8dab2128952874a2cf5a", "index": 7694, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n", "step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n dependencies = [('system', '0...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class UpdatePurchaseFood(forms.ModelForm): class Meta: model = purchase_cards fields = ['food_name', 'description', 'ss_code', 'calorie', 'fat', 'protein', 'carbs', 'image_path'] <|reserved_sp...
flexible
{ "blob_id": "3a1b0b9891fec7b3d722f77cd2f3f6efa878a7a0", "index": 4255, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass UpdatePurchaseFood(forms.ModelForm):\n\n\n class Meta:\n model = purchase_cards\n fields = ['food_name', 'description', 'ss_code', 'calorie', 'fat',\n ...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> admin.site.register(Hash) <|reserved_special_token_1|> from django.contrib import admin from .models import Hash admin.site.register(Hash)
flexible
{ "blob_id": "e2e4adaa8f7f62662e0c2915faff1bed72986351", "index": 1084, "step-1": "<mask token>\n", "step-2": "<mask token>\nadmin.site.register(Hash)\n", "step-3": "from django.contrib import admin\nfrom .models import Hash\nadmin.site.register(Hash)\n", "step-4": null, "step-5": null, "step-ids": [ ...
[ 0, 1, 2 ]
<|reserved_special_token_0|> class GraphTupleData(Base, sqlutil.PluralTablenameFromCamelCapsClassNameMixin): <|reserved_special_token_0|> id: int = sql.Column(sql.Integer, sql.ForeignKey('graph_tuples.id', onupdate='CASCADE', ondelete='CASCADE'), primary_key=True) sha1: str = sql.Column(sql.String...
flexible
{ "blob_id": "09788cf04ab5190a33b43e3756f4dbd7d78977a5", "index": 581, "step-1": "<mask token>\n\n\nclass GraphTupleData(Base, sqlutil.PluralTablenameFromCamelCapsClassNameMixin):\n <mask token>\n id: int = sql.Column(sql.Integer, sql.ForeignKey('graph_tuples.id',\n onupdate='CASCADE', ondelete='CASC...
[ 40, 44, 48, 54, 63 ]
<|reserved_special_token_0|> def fetch_images_from_db(chat_id, keyword_id, keyword_n, db, shared_dict): search = False if str(chat_id) + str(keyword_id) + 'db' in shared_dict: print('%s for group %s already in progress, sleeping for a while' % (keyword_id, chat_id)) time.sleep(unif...
flexible
{ "blob_id": "98dd7446045f09e6d709f8e5e63b0a94341a796e", "index": 3158, "step-1": "<mask token>\n\n\ndef fetch_images_from_db(chat_id, keyword_id, keyword_n, db, shared_dict):\n search = False\n if str(chat_id) + str(keyword_id) + 'db' in shared_dict:\n print('%s for group %s already in progress, sle...
[ 4, 5, 7, 8, 9 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def runWeka(wekapath, modelpath, datapath): os.chdir(wekapath) proc = subprocess.Popen(['/usr/bin/java', '-classpath', 'weka.jar', 'weka.classifiers.functions.MultilayerPerceptron', '-l', modelpath, '-T',...
flexible
{ "blob_id": "a1f0eced5d122fe8557ebc4d707c87b4194513e3", "index": 4976, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef runWeka(wekapath, modelpath, datapath):\n os.chdir(wekapath)\n proc = subprocess.Popen(['/usr/bin/java', '-classpath', 'weka.jar',\n 'weka.classifiers.functions.Multi...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> ii = [('CookGHP3.py', 1), ('AubePRP2.py', 1), ('WilkJMC3.py', 1), ( 'LeakWTI3.py', 1), ('AubePRP.py', 2), ('GellWPT.py', 2), ('AdamWEP.py', 1), ('KiddJAE.py', 1), ('CoolWHM.py', 1), ('WadeJEB.py', 1), ( 'SoutRD.py', 2), ('WheeJPT.py', 1), ('HowiWR...
flexible
{ "blob_id": "dce496c9ae6605e95ffbbb2885ec15b19fb756ef", "index": 2799, "step-1": "<mask token>\n", "step-2": "ii = [('CookGHP3.py', 1), ('AubePRP2.py', 1), ('WilkJMC3.py', 1), (\n 'LeakWTI3.py', 1), ('AubePRP.py', 2), ('GellWPT.py', 2), ('AdamWEP.py',\n 1), ('KiddJAE.py', 1), ('CoolWHM.py', 1), ('WadeJEB...
[ 0, 1 ]
import struct from coapthon import defines from coapthon.utils import byte_len, bit_len, parse_blockwise __author__ = 'Giacomo Tanganelli' __version__ = "2.0" class BlockwiseLayer(object): """ Handles the Blockwise feature. """ def __init__(self, parent): """ Initialize a Blockwise L...
normal
{ "blob_id": "70d740a7003ca3f2d2cde039b2fc470ef2165e77", "index": 7078, "step-1": "<mask token>\n\n\nclass BlockwiseLayer(object):\n <mask token>\n\n def __init__(self, parent):\n \"\"\"\n Initialize a Blockwise Layer.\n\n :type parent: coapserver.CoAP\n :param parent: the CoAP s...
[ 5, 6, 7, 8, 9 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Migration(migrations.Migration): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Migration(migrations.Migration): dependencies = [(...
flexible
{ "blob_id": "ea918bdf96572b38461dc1810bd0b8c16efd0f0d", "index": 5786, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n", "step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n dependencies = [('driver', '0...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def main(): tokens = Lexer() <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def main(): tokens = Lexer() if __name__ == '__main__': sys.path.append('Lib') from lex...
flexible
{ "blob_id": "d081abf3cd9bc323486772b4f6235fbbc9022099", "index": 5498, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef main():\n tokens = Lexer()\n\n\n<mask token>\n", "step-3": "<mask token>\n\n\ndef main():\n tokens = Lexer()\n\n\nif __name__ == '__main__':\n sys.path.append('Lib')\n ...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Migration(migrations.Migration): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Migration(migrations.Migration): dependencies = [(...
flexible
{ "blob_id": "71ffad81bcbc480dc0a750680bc72e1d5c48556a", "index": 3619, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n", "step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n dependencies = [('fotbal', '0...
[ 0, 1, 2, 3, 4 ]