code
stringlengths
13
6.09M
order_type
stringclasses
2 values
original_example
dict
step_ids
listlengths
1
5
<|reserved_special_token_0|> class MockTracer(Tracer): def __init__(self, scope_manager: (ScopeManager | None)=...) ->None: ... def register_propagator(self, format: str, propagator: Propagator) ->None: ... <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_specia...
flexible
{ "blob_id": "76d2c80c673f9a0444e72721909a51479ff35521", "index": 1785, "step-1": "<mask token>\n\n\nclass MockTracer(Tracer):\n\n def __init__(self, scope_manager: (ScopeManager | None)=...) ->None:\n ...\n\n def register_propagator(self, format: str, propagator: Propagator) ->None:\n ...\n ...
[ 3, 4, 5, 6, 7 ]
i = 100 while i >= 100: print(i) i -= 1 print(i)
normal
{ "blob_id": "9527743802a0bb680ab3dcf325c0f7749a51afc6", "index": 5949, "step-1": "<mask token>\n", "step-2": "<mask token>\nwhile i >= 100:\n print(i)\ni -= 1\nprint(i)\n", "step-3": "i = 100\nwhile i >= 100:\n print(i)\ni -= 1\nprint(i)\n", "step-4": null, "step-5": null, "step-ids": [ 0, ...
[ 0, 1, 2 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class FosAppConfig(AppConfig): <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class FosAppConfig(AppConfig): name = 'fos_app' <|reserved_special_token_1|> from django.apps ...
flexible
{ "blob_id": "d83f2d9bb25a46bc7344b420ce65bf729165e6b9", "index": 278, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass FosAppConfig(AppConfig):\n <mask token>\n", "step-3": "<mask token>\n\n\nclass FosAppConfig(AppConfig):\n name = 'fos_app'\n", "step-4": "from django.apps import AppCon...
[ 0, 1, 2, 3 ]
"""Plugin setup.""" import importlib from qiime2.plugin import ( Plugin, Str, Choices, Int, Bool, Range, Float, Metadata, MetadataColumn, Categorical, Numeric, Citations, ) import q2_micom from q2_micom._formats_and_types import ( SBML, JSON, Pickle, SBM...
normal
{ "blob_id": "9a6f159d9208ee9e337de7b717e2e25c7e7f9f06", "index": 4277, "step-1": "<mask token>\n", "step-2": "<mask token>\nplugin.register_formats(SBMLFormat, SBMLDirectory, JSONFormat,\n JSONDirectory, CommunityModelFormat, CommunityModelManifest,\n CommunityModelDirectory, GrowthRates, Fluxes, MicomRe...
[ 0, 1, 2, 3, 4 ]
# function to add two numbers def add2nums(a,b): return a+b
normal
{ "blob_id": "6e2fb9d498294a580426ff408183f7beec135329", "index": 5592, "step-1": "<mask token>\n", "step-2": "def add2nums(a, b):\n return a + b\n", "step-3": "# function to add two numbers\ndef add2nums(a,b):\n return a+b\n", "step-4": null, "step-5": null, "step-ids": [ 0, 1, 2 ] ...
[ 0, 1, 2 ]
import time import datetime import mx from openerp.report import report_sxw class course_form(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(course_form, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'time1': self....
normal
{ "blob_id": "c4fcca61e560046c77046079fb305be8c883653b", "index": 2077, "step-1": "<mask token>\n\n\nclass course_form(report_sxw.rml_parse):\n <mask token>\n <mask token>\n\n def _get_course(self, data):\n training_category_obj = self.pool.get('hr.training.category')\n training_category_id...
[ 4, 6, 7, 8, 9 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> for key, ax in zip(sorted(res), axes.flatten()): print(key, ax) ax.plot(res[key]['df'].M, res[key]['df'].iv, '.') ax.plot(res[key]['M'], res[key]['smile']) ax.text(0.99, 0.99, '$\\tau$ = ' + str(key), horizontalali...
flexible
{ "blob_id": "a01f812584e4cee14c9fe15e9fb6ede4ae3e937a", "index": 4953, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor key, ax in zip(sorted(res), axes.flatten()):\n print(key, ax)\n ax.plot(res[key]['df'].M, res[key]['df'].iv, '.')\n ax.plot(res[key]['M'], res[key]['smile'])\n ax.text(0.9...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class FileDataSource(UpdateProcessor): <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class FileDataSource(UpdateProcessor): @classmethod def factory(cls, **kwargs): ...
flexible
{ "blob_id": "ee68ebe146f948f3497577f40741e59b7421e652", "index": 8186, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass FileDataSource(UpdateProcessor):\n <mask token>\n", "step-3": "<mask token>\n\n\nclass FileDataSource(UpdateProcessor):\n\n @classmethod\n def factory(cls, **kwargs):...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> print('Time now : ', now) <|reserved_special_token_1|> <|reserved_special_token_0|> now = datetime.datetime.now() print('Time now : ', now) <|reserved_special_token_1|> import datetime now = datetime.datetime.now() print('Ti...
flexible
{ "blob_id": "0110d26e17a5402c22f519d0aeb2aacca3279d00", "index": 7792, "step-1": "<mask token>\n", "step-2": "<mask token>\nprint('Time now : ', now)\n", "step-3": "<mask token>\nnow = datetime.datetime.now()\nprint('Time now : ', now)\n", "step-4": "import datetime\nnow = datetime.datetime.now()\nprint('T...
[ 0, 1, 2, 3, 4 ]
class Calculator: <|reserved_special_token_0|> def Subtract(self, num1, num2): return num1 - num2 <|reserved_special_token_0|> def Divide(self, num1, num2): return num1 / num2 <|reserved_special_token_0|> <|reserved_special_token_1|> class Calculator: def Add(self, num1, num2...
flexible
{ "blob_id": "d2972fb7cff08e15957f9baeaa6fd9a6f5bbb006", "index": 1127, "step-1": "class Calculator:\n <mask token>\n\n def Subtract(self, num1, num2):\n return num1 - num2\n <mask token>\n\n def Divide(self, num1, num2):\n return num1 / num2\n\n\n<mask token>\n", "step-2": "class Calc...
[ 3, 4, 5, 6, 7 ]
from urllib import request, parse import pandas as pd import json import os class BusInfo: url = 'https://api-tokyochallenge.odpt.org/api/v4/odpt:Bus' url_busstop = 'https://api-tokyochallenge.odpt.org/api/v4/odpt:BusstopPole.json' url_routes = 'https://api-tokyochallenge.odpt.org/api/v4/odpt:BusroutePatt...
normal
{ "blob_id": "7eefcfdb9682cb09ce2d85d11aafc04977016ba4", "index": 8332, "step-1": "<mask token>\n\n\nclass BusInfo:\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n @staticmethod\n def init():\n apiKey = os.getenv('BUS_TOKEN')\n Bu...
[ 5, 6, 7, 8, 9 ]
""" Configuration management. Environment must be set before use. Call .get() to obtain configuration variable. If the variable does not exist in the set environment, then """ CONFIG_KEY = "config_class" ENV = {} class EMPTY: """ Signifies that a default value was not set. Should trigger an error if ...
normal
{ "blob_id": "263d2fe43cf8747f20fd51897ba003c9c4cb4280", "index": 9907, "step-1": "<mask token>\n\n\nclass EMPTY:\n <mask token>\n pass\n\n\nclass Config:\n \"\"\"\n Configuration management entity.\n\n Args:\n name (str): Name of config environment.\n fallback (bool): Indicate if con...
[ 6, 7, 8, 9, 11 ]
from time import sleep import pytest import allure from app.debug_api import DebugAPI from app.check_api import HandlersAPI from locators.movies_details_locators import MoviesDetailsPageLocators from locators.movies_locators import MoviesPageLocators from locators.shedule_locators import ShedulePageLocators from screen...
normal
{ "blob_id": "c7c412fe4e2d53af1b4f2a55bd3453496767890d", "index": 975, "step-1": "<mask token>\n\n\n@pytest.mark.usefixtures('driver')\nclass Test_001_ShedulePage:\n <mask token>\n <mask token>\n\n def test_001_elements_exists(self, driver):\n \"\"\"тапнуть на фичерс,\n тапнуть на смотреть ...
[ 4, 5, 6, 7 ]
<|reserved_special_token_0|> def run_timed_benchmark_time_series(series_name, tf_flags, do_training=True): topology = load_default_topology(series_name, tf_flags) n_train_samples = np.minimum(tf_flags.n_training_samples_benchmark, 10000) bin_distribution = _create_bin_distribution(series_name, n_t...
flexible
{ "blob_id": "bef16443f77b2c1e09db9950a4617703085d9f71", "index": 7807, "step-1": "<mask token>\n\n\ndef run_timed_benchmark_time_series(series_name, tf_flags, do_training=True):\n topology = load_default_topology(series_name, tf_flags)\n n_train_samples = np.minimum(tf_flags.n_training_samples_benchmark, 1...
[ 1, 2, 3, 4, 5 ]
import unittest import brainfuck import sys from StringIO import StringIO def run_program(program, input = None): old_stdout = sys.stdout old_stdin = sys.stdin try: out = StringIO() sys.stdout = out if input is not None: input = StringIO(input) sys.stdin = ...
normal
{ "blob_id": "19ab44cec863560513aadd88b5fd4bb40f75e371", "index": 2579, "step-1": "<mask token>\n\n\nclass TestInterpreter(unittest.TestCase):\n <mask token>\n\n def test_HelloWorld(self):\n result = run_program(\n \"\"\"\n ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>...
[ 4, 6, 7, 9, 10 ]
import matplotlib.pyplot as plt import numpy as np from tti_explorer.contacts import he_infection_profile plt.style.use('default') loc = 0 # taken from He et al gamma_params = { 'a': 2.11, 'loc': loc, 'scale': 1/0.69 } t = 10 days = np.arange(t) mass = he_infection_profile(t, gamma_params) fig, ax = pl...
normal
{ "blob_id": "fa5cbbd03641d2937e4502ce459d64d20b5ee227", "index": 8630, "step-1": "<mask token>\n", "step-2": "<mask token>\nplt.style.use('default')\n<mask token>\nax.bar(np.arange(5) + 0.1, [1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5], label=\n 'Kucharski profile', align='edge', color='C1', zorder=1, alpha=0.6)\nax...
[ 0, 1, 2, 3, 4 ]
with expression [as var] #...BODY... #object is the result of the expression and must have __enter__ and __exit__ methods #result of the expression must be context manager - implements context management protocol #https://www.python.org/dev/peps/pep-0343/ # This PEP adds a new statement "with" to the Python language...
normal
{ "blob_id": "e1787fd4be66d19ab83ece44eacfd96cb488b504", "index": 722, "step-1": "with expression [as var]\n\t#...BODY...\n\n#object is the result of the expression and must have __enter__ and __exit__ methods\n#result of the expression must be context manager - implements context management protocol\n\n#https://...
[ 0 ]
<|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_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Migration(migrations....
flexible
{ "blob_id": "1b71789ba7c2191b433a405723fe6c985c926610", "index": 8620, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n <mask token>\n", "step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n initial = T...
[ 0, 1, 2, 3, 4 ]
import glob from PIL import Image from PIL.ExifTags import TAGS, GPSTAGS from pyproj import Proj from osgeo import gdal, osr from PyQt4.QtCore import QFile, QFileInfo import os from os import walk #slika="c:\slike\Zito\DJI_0060.jpg" #georef_slika="c:\Slike\Zito\Georeferencirana.tif" radni_dir = 'c:/slike/Zito...
normal
{ "blob_id": "e92d770f9d2176b4943653b09ac1069fa3301e46", "index": 1931, "step-1": "import glob\r\nfrom PIL import Image\r\nfrom PIL.ExifTags import TAGS, GPSTAGS\r\nfrom pyproj import Proj\r\nfrom osgeo import gdal, osr\r\nfrom PyQt4.QtCore import QFile, QFileInfo\r\nimport os\r\nfrom os import walk\r\n#slika=\"c...
[ 0 ]
<|reserved_special_token_0|> def allowed_file(filename): return '.' in filename and filename.rsplit('.', 1)[1].lower( ) in ALLOWED_EXTENSIONS @app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST': if 'file' not in request.files: print('No file attached...
flexible
{ "blob_id": "eb17de8828a600832253c4cfeeb91503b6876dd7", "index": 9963, "step-1": "<mask token>\n\n\ndef allowed_file(filename):\n return '.' in filename and filename.rsplit('.', 1)[1].lower(\n ) in ALLOWED_EXTENSIONS\n\n\n@app.route('/', methods=['GET', 'POST'])\ndef index():\n if request.method == ...
[ 5, 6, 7, 8, 9 ]
from selenium import webdriver from bs4 import BeautifulSoup from selenium.webdriver.common.action_chains import ActionChains import time import json import re import os import datetime ########################################################################### driver_path = "/home/arnab/Codes/00_Libs/chromedriver_lin...
normal
{ "blob_id": "43b9d308bb8d2b38c5f539e8700f5c2d8fe2287d", "index": 2157, "step-1": "<mask token>\n\n\ndef simplify_string(inp):\n inp = inp.lower().strip()\n inp = re.sub('[^A-Za-z0-9]', '_', inp)\n return inp\n\n\ndef makeDirectory(path):\n print('creating directory ' + path)\n try:\n os.mkd...
[ 7, 9, 10, 12, 16 ]
# Generated by Django 3.0.3 on 2020-05-30 05:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('people', '0110_auto_20200530_0631'), ] operations = [ migrations.AlterField( model_name='site', name='password_reset...
normal
{ "blob_id": "795f936423965063c44b347705c53fd1c306692f", "index": 4927, "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 = [('people', '0...
[ 0, 1, 2, 3, 4 ]
import asyncio import sys import aioredis import msgpack async def main(host: str, endpoint: str, message: str): msg = msgpack.packb( { "endpoint": endpoint, "headers": {"Content-Type": "text/json"}, "payload": message.encode("utf-8"), }, ) redis = awai...
normal
{ "blob_id": "e94d66732a172286814bc0b0051a52c1374a4de5", "index": 3168, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nasync def main(host: str, endpoint: str, message: str):\n msg = msgpack.packb({'endpoint': endpoint, 'headers': {'Content-Type':\n 'text/json'}, 'payload': message.encode('u...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> for i in range(len(word)): if word[i] in '.,?!' or word[i] == ' ': pass else: new.append(word[i]) for i in range(len(new)): o.append(new[i]) for i in range(len(new)): r.append(new[-i - 1]) print(new...
flexible
{ "blob_id": "c6ab82d7f59faeee2a74e90a96c2348b046d0889", "index": 7382, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor i in range(len(word)):\n if word[i] in '.,?!' or word[i] == ' ':\n pass\n else:\n new.append(word[i])\nfor i in range(len(new)):\n o.append(new[i])\nfor i in ra...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> while True: os.chdir('/home/ec2-user/ML-Processed') print(str(os.getcwd())) for f in os.listdir(os.getcwd()): print('looping in file') file_name, file_ext = os.path.splitext(f) if file_ext == '....
flexible
{ "blob_id": "ec0697d8d78fafe6bfd4630be2a1fb20eb9eb4cf", "index": 2472, "step-1": "<mask token>\n", "step-2": "<mask token>\nwhile True:\n os.chdir('/home/ec2-user/ML-Processed')\n print(str(os.getcwd()))\n for f in os.listdir(os.getcwd()):\n print('looping in file')\n file_name, file_ext...
[ 0, 1, 2, 3, 4 ]
import math class Solution: # @param {integer} n # @param {integer} k # @return {string} def getPermutation(self, n, k): res = '' k -= 1 nums = [str(i) for i in range(1, n+1)] while n > 0: tmp = math.factorial(n-1) res += nums[k/tmp] d...
normal
{ "blob_id": "d267bf82aee2eca29628fcd1d874a337adc1ae09", "index": 8859, "step-1": "import math\n\nclass Solution:\n # @param {integer} n\n # @param {integer} k\n # @return {string}\n def getPermutation(self, n, k):\n res = ''\n k -= 1\n nums = [str(i) for i in range(1, n+1)]\n ...
[ 0 ]
from helper.logger_helper import Log from helper.mail_helper import MailHelper import spider.spider as spider from configuration.configuration_handler import Configuration from configuration.products_handler import ProductsHandler if __name__ == "__main__": logger = Log() conf = Configuration('configuration/co...
normal
{ "blob_id": "2e140d1174e0b2d8a97df880b1bffdf84dc0d236", "index": 1029, "step-1": "<mask token>\n", "step-2": "<mask token>\nif __name__ == '__main__':\n logger = Log()\n conf = Configuration('configuration/configuration.yaml'\n ).load_configuration()\n ph = ProductsHandler(conf['products_path']...
[ 0, 1, 2, 3 ]
import typing import torch.nn as nn from .torch_utils import get_activation, BatchNorm1d from dna.models.torch_modules.torch_utils import PyTorchRandomStateContext class Submodule(nn.Module): def __init__(self, layer_sizes: typing.List[int], activation_name: str, use_batch_norm: bool, use_skip: bool=Fals...
normal
{ "blob_id": "950b2906853c37cdeaa8ed1076fff79dbe99b6f8", "index": 8327, "step-1": "<mask token>\n\n\nclass Submodule(nn.Module):\n <mask token>\n <mask token>\n", "step-2": "<mask token>\n\n\nclass Submodule(nn.Module):\n\n def __init__(self, layer_sizes: typing.List[int], activation_name: str,\n ...
[ 1, 2, 3, 4 ]
<|reserved_special_token_0|> def get_input(): return sys.stdin.read(1) def exit(orig_settings): termios.tcsetattr(sys.stdin, termios.TCSADRAIN, orig_settings) <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def init(): orig_settings = termios.tcgetattr(sys.s...
flexible
{ "blob_id": "c64e41609a19a20f59446399a2e864ff8834c3f0", "index": 4322, "step-1": "<mask token>\n\n\ndef get_input():\n return sys.stdin.read(1)\n\n\ndef exit(orig_settings):\n termios.tcsetattr(sys.stdin, termios.TCSADRAIN, orig_settings)\n\n\n<mask token>\n", "step-2": "<mask token>\n\n\ndef init():\n ...
[ 2, 3, 4, 5, 6 ]
number = int(input("Enter a number, and I'll tell you if it's even or odd: ")) if number % 2 == 0: print(f"{number} is an even number.") else: print(f"{number} is an odd number.")
normal
{ "blob_id": "b147a22d6bd12a954c0d85c11e578a67f0a51332", "index": 3025, "step-1": "<mask token>\n", "step-2": "<mask token>\nif number % 2 == 0:\n print(f'{number} is an even number.')\nelse:\n print(f'{number} is an odd number.')\n", "step-3": "number = int(input(\"Enter a number, and I'll tell you if ...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def cmd_create(nexus_client, **kwargs): """Performs ``nexus3 cleanup_policy create``""" policy = cleanup_policy.CleanupPolicy(None, **kwargs) nexus_client.cleanup_policies.create_or_update(policy) return exceptio...
flexible
{ "blob_id": "521b90ffb4bace4cbd50d08ed4be278d4f259822", "index": 7049, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef cmd_create(nexus_client, **kwargs):\n \"\"\"Performs ``nexus3 cleanup_policy create``\"\"\"\n policy = cleanup_policy.CleanupPolicy(None, **kwargs)\n nexus_client.cleanup...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> class PageIndex(BasePageIndex, Indexable): template = CharField(model_attr='template') template_title = CharField(model_attr='get_template_display') get_template_display = CharField(model_attr='get_template_display') <|reserved_special_token_1|> <|reserved_special_token_0|>...
flexible
{ "blob_id": "8e1eef3c5a9ca3ea504bbc269b48446527637626", "index": 1323, "step-1": "<mask token>\n\n\nclass PageIndex(BasePageIndex, Indexable):\n template = CharField(model_attr='template')\n template_title = CharField(model_attr='get_template_display')\n get_template_display = CharField(model_attr='get_...
[ 2, 4, 5, 6, 7 ]
import tensorflow as tf import tensorflow_probability as tfp import pytest import numpy as np from estimators import NormalizingFlowNetwork tfd = tfp.distributions tf.random.set_seed(22) np.random.seed(22) @pytest.mark.slow def test_x_noise_reg(): x_train = np.linspace(-3, 3, 300, dtype=np.float32).reshape((300,...
normal
{ "blob_id": "303a8609cb21c60a416160264c3d3da805674920", "index": 777, "step-1": "<mask token>\n\n\n@pytest.mark.slow\ndef test_x_noise_reg():\n x_train = np.linspace(-3, 3, 300, dtype=np.float32).reshape((300, 1))\n noise = tfd.MultivariateNormalDiag(loc=5 * tf.math.sin(2 * x_train),\n scale_diag=ab...
[ 2, 3, 4, 5, 6 ]
import os, random, string from django.conf import settings from django.template.loader import render_to_string from django.core.mail import send_mail def generate_temp_password(): length = 7 chars = string.ascii_letters + string.digits rnd = random.SystemRandom() return ''.join(rnd.choice(chars) for...
normal
{ "blob_id": "822fc2941099cb9d7791580678cfb2a89a987175", "index": 4685, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef send_confirmation_email(user):\n try:\n confirmation_key = user.confirmation_key\n except:\n confirmation_key = user.add_unconfirmed_email(user.email)\n msg...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> class Styled(object): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> def __str__(self): return str(self._styles) def __repr__(self): cls = self.__class__.__name__ items = pprint.pformat(self._styles) ...
flexible
{ "blob_id": "8fa58791aae1352109b3bf7410d68bf5ae1d8cb7", "index": 9559, "step-1": "<mask token>\n\n\nclass Styled(object):\n <mask token>\n <mask token>\n <mask token>\n\n def __str__(self):\n return str(self._styles)\n\n def __repr__(self):\n cls = self.__class__.__name__\n it...
[ 5, 6, 8, 9, 10 ]
<|reserved_special_token_0|> class ArrayReader: def __init__(self, arr): self.arr = arr def get(self, index): if index > len(self.arr): return math.inf return self.arr[index] <|reserved_special_token_0|> def binary_search_array(reader, key, low, high): while low <...
flexible
{ "blob_id": "a9efa258c223460b2b79861acdde89161706ad9a", "index": 8770, "step-1": "<mask token>\n\n\nclass ArrayReader:\n\n def __init__(self, arr):\n self.arr = arr\n\n def get(self, index):\n if index > len(self.arr):\n return math.inf\n return self.arr[index]\n\n\n<mask to...
[ 4, 5, 7, 8, 9 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def plot_merc(s): proj = ccrs.Mercator() ax = plt.axes(projection=proj) ax.set_extent((s.bounds[0], s.bounds[2], s.bounds[1], s.bounds[3]), crs =ccrs.PlateCarree()) shape_feature = ShapelyFeature([s], ccr...
flexible
{ "blob_id": "75754f4032d6e22e53cdbed0f6c640247473faec", "index": 7606, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef plot_merc(s):\n proj = ccrs.Mercator()\n ax = plt.axes(projection=proj)\n ax.set_extent((s.bounds[0], s.bounds[2], s.bounds[1], s.bounds[3]), crs\n =ccrs.PlateCarr...
[ 0, 1, 2, 3, 4 ]
#!/usr/bin/env python # -*- coding:utf-8 _*- """ @author:tom_tao626 @license: Apache Licence @file: 17.列表中的元素统计.py @time: 2020/12/09 @contact: tp320670258@gmail.com @site: xxxx.suizhu.net @software: PyCharm """ # collections.Counter() from collections import Counter list1 = ['a', 'b', 'b', 'c', 'd', 'e', 'a', ...
normal
{ "blob_id": "f2c592a0ea38d800510323a1001c646cdbecefff", "index": 3009, "step-1": "<mask token>\n", "step-2": "<mask token>\nprint(count)\nprint(count['b'])\nprint(count.most_common(1))\nprint(count.items())\n", "step-3": "<mask token>\nlist1 = ['a', 'b', 'b', 'c', 'd', 'e', 'a', 'b', 'e']\ncount = Counter(li...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> experiment_name = 'nodes10' wall = 'wall2' wall_image = 'irati_110' mr_dif_policy = True spn_dif_policy = True destination_ip = '2001:40b0:7500:286:84:88:81:57' <|reserved_special_token_1|> #!/usr/bin/python3 experiment_name = "nodes10" wall = "wall2" wal...
flexible
{ "blob_id": "78db25586f742b0a20bc3fad382b0d4f1a271841", "index": 3970, "step-1": "<mask token>\n", "step-2": "experiment_name = 'nodes10'\nwall = 'wall2'\nwall_image = 'irati_110'\nmr_dif_policy = True\nspn_dif_policy = True\ndestination_ip = '2001:40b0:7500:286:84:88:81:57'\n", "step-3": "#!/usr/bin/python3...
[ 0, 1, 2 ]
class SimulatorInfo(object): def __init__(self, name=None, device_type=None, sdk=None, device_id= None, sim_id=None): self.name = name self.device_type = device_type self.sdk = sdk self.device_id = device_id self.sim_id = sim_id
normal
{ "blob_id": "9b94e8aed2b0be2771a38cf2d1cf391772f3a9f0", "index": 6478, "step-1": "<mask token>\n", "step-2": "class SimulatorInfo(object):\n <mask token>\n", "step-3": "class SimulatorInfo(object):\n\n def __init__(self, name=None, device_type=None, sdk=None, device_id=\n None, sim_id=None):\n ...
[ 0, 1, 2 ]
<|reserved_special_token_0|> def count_regexp(): """Counts the occurences of the regular expressions you will write. """ email = re.compile('[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+\\.[a-zA-Z]{2,5}') subheading = re.compile('\\=\\=+.*\\=\\=+') link_to_subheading = re.compile( "\\[\\[[\\w'*\\-*\\:*\\(...
flexible
{ "blob_id": "8a4269f2094fa8ab8f6a93e653183dafb141232e", "index": 5717, "step-1": "<mask token>\n\n\ndef count_regexp():\n \"\"\"Counts the occurences of the regular expressions you will write.\n \"\"\"\n email = re.compile('[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+\\\\.[a-zA-Z]{2,5}')\n subheading = re.compile('...
[ 1, 2, 3, 4, 5 ]
<|reserved_special_token_0|> class Horse(object): def naili(self): print('马力足,持久强……') <|reserved_special_token_0|> class Mule(Donkey, Horse): pass def jiao(self): print('骡子在唱歌') <|reserved_special_token_0|> <|reserved_special_token_1|> class Donkey(object): def manzou(sel...
flexible
{ "blob_id": "5d4ef436c4ee5c31496977a5ae9b55db9ff34e79", "index": 4082, "step-1": "<mask token>\n\n\nclass Horse(object):\n\n def naili(self):\n print('马力足,持久强……')\n <mask token>\n\n\nclass Mule(Donkey, Horse):\n pass\n\n def jiao(self):\n print('骡子在唱歌')\n\n\n<mask token>\n", "step-2":...
[ 4, 7, 8, 9, 11 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def closeConnection(): cursor.close() mariadb_connection.close() return def getTasks(amount): mariadb_connection = mariadb.connect(user='web', password='raspberry', database='PlantHubDB') cursor = m...
flexible
{ "blob_id": "f471062573a5ec8cfeb194168edfba3d2700cac6", "index": 9845, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef closeConnection():\n cursor.close()\n mariadb_connection.close()\n return\n\n\ndef getTasks(amount):\n mariadb_connection = mariadb.connect(user='web', password='raspb...
[ 0, 3, 4, 5, 6 ]
<|reserved_special_token_0|> class WithinDatagram(object): def __init__(self, traceObj): self.Trace = traceObj self.current_datagram = None <|reserved_special_token_0|> class WithinFlowsample(object): def __init__(self, traceObj): self.Trace = traceObj self.current_data...
flexible
{ "blob_id": "395ff2e7c052b57548151fc71fad971c94ebceea", "index": 3974, "step-1": "<mask token>\n\n\nclass WithinDatagram(object):\n\n def __init__(self, traceObj):\n self.Trace = traceObj\n self.current_datagram = None\n <mask token>\n\n\nclass WithinFlowsample(object):\n\n def __init__(se...
[ 9, 12, 14, 16, 23 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> if __name__ == '__main__': gateway = config.gateway['trading_system_gateway'] host = gateway['host'] port = gateway['port'] server_id = gateway['server_id'] licences = gateway['licences'] service = SubServi...
flexible
{ "blob_id": "f72cdf8d91c31760335b96052a34615307f48727", "index": 9774, "step-1": "<mask token>\n", "step-2": "<mask token>\nif __name__ == '__main__':\n gateway = config.gateway['trading_system_gateway']\n host = gateway['host']\n port = gateway['port']\n server_id = gateway['server_id']\n licen...
[ 0, 1, 2, 3 ]
data = [ "........#.............#........", "...#....#...#....#.............", ".#..#...#............#.....#..#", "..#......#..##............###..", "..........#......#..#..#.......", ".#..#.......#.........#.#......", ".........#..#....##..#.##....#.", "..#....##...#..................",...
normal
{ "blob_id": "c22651437094723b711a959e031f1c7f928f735a", "index": 7645, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef treeCounter(moveRight, moveDown):\n row = 0\n index = 0\n trees = 0\n finished = False\n while not finished:\n row += moveDown\n if len(data) > row:\n...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> class Dice2(Pmf): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Dice2(Pmf): def __init__(self, sides): Pmf.__init__(self) for x in range(1, sides + 1): self.Set(x, 1) ...
flexible
{ "blob_id": "236dd70dec8d53062d6c38c370cb8f11dc5ef9d0", "index": 556, "step-1": "<mask token>\n\n\nclass Dice2(Pmf):\n <mask token>\n\n\n<mask token>\n", "step-2": "<mask token>\n\n\nclass Dice2(Pmf):\n\n def __init__(self, sides):\n Pmf.__init__(self)\n for x in range(1, sides + 1):\n ...
[ 1, 2, 3, 4, 5 ]
<|reserved_special_token_0|> def save_ave_replay(aveData, nIter, nStart, bfname): vd = np.zeros((nIter, 4, nStart)) for i_trial in range(nIter): vv = aveData[i_trial] for i_dendrite in range(4): vvv = vv[i_dendrite] mv = np.reshape(vvv, (nStart, 1501)) vd[i_...
flexible
{ "blob_id": "6eb8172e7e26ad6ec9cb0d30c5a0613ce79296e6", "index": 8421, "step-1": "<mask token>\n\n\ndef save_ave_replay(aveData, nIter, nStart, bfname):\n vd = np.zeros((nIter, 4, nStart))\n for i_trial in range(nIter):\n vv = aveData[i_trial]\n for i_dendrite in range(4):\n vvv = ...
[ 1, 2, 3, 4, 5 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> print(True) print(False) <|reserved_special_token_1|> # 30_Days_Of_Code # Day 2 # Boolean print(True) print(False)
flexible
{ "blob_id": "f1ca3d7ff7efcf500f1a16e415b13c47fd08688d", "index": 5044, "step-1": "<mask token>\n", "step-2": "print(True)\nprint(False)\n", "step-3": "# 30_Days_Of_Code\n# Day 2\n# Boolean\nprint(True)\nprint(False)\n", "step-4": null, "step-5": null, "step-ids": [ 0, 1, 2 ] }
[ 0, 1, 2 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> for member in team: print('Hello, ' + member) <|reserved_special_token_1|> team = input('Wymien wszystkich czlonkow swojego zespolu: ').split(',') for member in team: print('Hello, ' + member) <|reserved_special_token...
flexible
{ "blob_id": "5d3f7d74cf1cc2612d599c65393abed11181c981", "index": 2300, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor member in team:\n print('Hello, ' + member)\n", "step-3": "team = input('Wymien wszystkich czlonkow swojego zespolu: ').split(',')\nfor member in team:\n print('Hello, ' + mem...
[ 0, 1, 2, 3 ]
import gc import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from tqdm import tqdm import cv2 import torch from torch.utils.data import DataLoader from torch import optim from torch.optim import lr_scheduler from dataset.car_dataset import CarDataset from nn.netw...
normal
{ "blob_id": "1861c394fb02643d2e6ac8362f3340f512ef6d72", "index": 6402, "step-1": "<mask token>\n", "step-2": "<mask token>\nif __name__ == '__main__':\n ROOT_PATH = '/media/andreis/storage/datasets/pku-autonomous-driving/'\n df = pd.read_csv(ROOT_PATH + 'train.csv')\n df_test = pd.read_csv(ROOT_PATH +...
[ 0, 1, 2, 3, 4 ]
#!/usr/bin/env python from anytree import Node, RenderTree webtest = Node("WebappTest") registration = Node("Registration", parent=webtest) smsconfirm = Node("SMSconfirm", parent=registration) login = Node("Login", parent=smsconfirm) useruploadCV = Node("UserUploadCV", parent=l...
normal
{ "blob_id": "33ac328b2bf16380b50c58013bd0d4d888dc3952", "index": 4693, "step-1": "<mask token>\n", "step-2": "<mask token>\nDotExporter(webtest).to_picture('webtest.png')\n", "step-3": "<mask token>\nwebtest = Node('WebappTest')\nregistration = Node('Registration', parent=webtest)\nsmsconfirm = Node('SMSconf...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> @given('the browser is open, navigate to the SCALE URL, and login') def the_browser_is_open_navigate_to_the_scale_url_and_login(driver, nas_ip, root_password): """the browser is open, navigate to the SCALE URL, and login.""" if nas_ip not in driver.current_url: driver....
flexible
{ "blob_id": "f4aaf0449bff68814090552ea4f6ccac85dacf1b", "index": 5617, "step-1": "<mask token>\n\n\n@given('the browser is open, navigate to the SCALE URL, and login')\ndef the_browser_is_open_navigate_to_the_scale_url_and_login(driver, nas_ip,\n root_password):\n \"\"\"the browser is open, navigate to the...
[ 3, 4, 5, 7, 8 ]
debt = 100 equity = 50 ratio = debt / equity if ratio <= 2: print('😊') else: print('⚠️') print('Ratio is', ratio)
normal
{ "blob_id": "40b1fac14aaa81039aec8e80ce1c91bb881cfe78", "index": 3474, "step-1": "<mask token>\n", "step-2": "<mask token>\nif ratio <= 2:\n print('😊')\nelse:\n print('⚠️')\nprint('Ratio is', ratio)\n", "step-3": "debt = 100\nequity = 50\nratio = debt / equity\nif ratio <= 2:\n print('😊')\nelse:\n...
[ 0, 1, 2 ]
from . import chequeador_camion from . import chequeador_camion_modelo from . import chequeador_destino_tipo from . import chequeador_destino from . import chequeador_origen from . import chequeador_minerales
normal
{ "blob_id": "bf7319996043a41b7d0ef4e6098c3609e5db101e", "index": 9809, "step-1": "<mask token>\n", "step-2": "from . import chequeador_camion\nfrom . import chequeador_camion_modelo\nfrom . import chequeador_destino_tipo\nfrom . import chequeador_destino\nfrom . import chequeador_origen\nfrom . import chequead...
[ 0, 1 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> def ip_address(address): new_address = '' split_address = address.split('.') seprator = '[.]' new_address = seprator.join(split_address) return new_address <|reserved_special_token_0|> <|reserved_special_token_1|> def ip_address(addre...
flexible
{ "blob_id": "7ef62e5545930ab13312f8ae1ea70a74386d8bfa", "index": 1231, "step-1": "<mask token>\n", "step-2": "def ip_address(address):\n new_address = ''\n split_address = address.split('.')\n seprator = '[.]'\n new_address = seprator.join(split_address)\n return new_address\n\n\n<mask token>\n"...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> def add_tuple(tuple_a=(), tuple_b=()): if len(tuple_a) < 1: a_x = 0 else: a_x = tuple_a[0] if len(tuple_a) < 2: a_y = 0 else: a_y = tuple_a[1] if len(tuple_b) < 1: b_x = 0 else: b_x = tup...
flexible
{ "blob_id": "1522ebb52504f7f27a526b597fe1e262bbcbfbb0", "index": 4429, "step-1": "<mask token>\n", "step-2": "def add_tuple(tuple_a=(), tuple_b=()):\n if len(tuple_a) < 1:\n a_x = 0\n else:\n a_x = tuple_a[0]\n if len(tuple_a) < 2:\n a_y = 0\n else:\n a_y = tuple_a[1]\n ...
[ 0, 1, 2 ]
<|reserved_special_token_0|> class ApiOAuth2Application(base.ObjectIDMixin, base.BaseModel): """Registration and key for user-created OAuth API applications This collection is also used by CAS to create the master list of available applications. Any changes made to field names in this model must be echoe...
flexible
{ "blob_id": "8186b7bddbdcdd730a3f79da1bd075c25c0c3998", "index": 3131, "step-1": "<mask token>\n\n\nclass ApiOAuth2Application(base.ObjectIDMixin, base.BaseModel):\n \"\"\"Registration and key for user-created OAuth API applications\n\n This collection is also used by CAS to create the master list of avail...
[ 17, 18, 21, 25, 26 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Pharmacy4LessAUSpider(StoreLocatorWidgetsSpider): <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> class Phar...
flexible
{ "blob_id": "aad3c104432a1a028d96263236133e495536ee69", "index": 6644, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Pharmacy4LessAUSpider(StoreLocatorWidgetsSpider):\n <mask token>\n <mask token>\n <mask token>\n", "step-3": "<mask token>\n\n\nclass Pharmacy4LessAUSpider(StoreLocat...
[ 0, 1, 2, 3, 4 ]
from pyspark.sql import SQLContext, Row from pyspark import SparkContext, SparkConf from pyspark.sql.functions import col import collections # Create a Spark Session (the config bit is only for windows) #conf = SparkConf().setAppName("SQL App").setMaster("local") sc = SparkContext() sqlCtx = SQLContext(sc) def mapp...
normal
{ "blob_id": "e4bc2e97b70e2dc91dc86457866ec6b3531ef803", "index": 8772, "step-1": "<mask token>\n\n\ndef mapper(line):\n fields = line.split(',')\n return Row(ID=int(fields[0]), name=fields[1].encode('utf-8'), age=int(\n fields[2]), numFriends=int(fields[3]))\n\n\n<mask token>\n", "step-2": "<mask ...
[ 1, 2, 3, 4, 5 ]
message = input() vowel = 'aeiouAEIOU' consonant = 'bcdfghjklmnpqrstvwxyz' consonant += consonant.upper() vowel_count = 0 consonant_count = 0 for c in message: if c in vowel: vowel_count += 1 elif c in consonant: consonant_count += 1 print(vowel_count, consonant_count)
normal
{ "blob_id": "edf704d720abdb09d176937664c9ba98bcd253a5", "index": 8320, "step-1": "<mask token>\n", "step-2": "<mask token>\nconsonant += consonant.upper()\n<mask token>\nfor c in message:\n if c in vowel:\n vowel_count += 1\n elif c in consonant:\n consonant_count += 1\nprint(vowel_count, c...
[ 0, 1, 2 ]
import torch import tarfile import pickle import pandas import json import argparse from pathlib import Path import numpy as np import shutil from shutil import copyfile import os import re import pandas as pd import sys from numpy import asarray from numpy import savetxt sys.path.append("..") def parse_arguments(): ...
normal
{ "blob_id": "da55d9a6534525e58b6c1d2db997e90a1c9b0f36", "index": 1427, "step-1": "<mask token>\n\n\ndef parse_arguments():\n parser = argparse.ArgumentParser()\n parser.add_argument('--data_dir', type=str, required=True, help=\n 'dir holding sequences as separate files')\n parser.add_argument('--...
[ 2, 3, 4, 5, 6 ]
# File for the information gain feature selection algorithm import numpy as np import pandas as pd from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_selection import mutual_info_classif # The function which will be called def get_features(raw_data, raw_ids): """ Calculate the in...
normal
{ "blob_id": "ca403e8820a3e34e0eb11b2fdd5d0fc77e3ffdc4", "index": 9394, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef get_features(raw_data, raw_ids):\n \"\"\"\n Calculate the information gain of a dataset. This function takes three parameters:\n 1. data = The dataset for whose feature t...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> class PositionReader: def __init__(self): self.image_sub = rospy.Subscriber('/visp_auto_tracker/object_position', PoseStamped, self.callback) self.pub = rospy.Publisher('object_position', PoseStamped, queue_size=10) rospy.init_node('Pos...
flexible
{ "blob_id": "26ac0c94d0ab70d90854ca2c913ef0f633b54a3c", "index": 4527, "step-1": "<mask token>\n\n\nclass PositionReader:\n\n def __init__(self):\n self.image_sub = rospy.Subscriber('/visp_auto_tracker/object_position',\n PoseStamped, self.callback)\n self.pub = rospy.Publisher('objec...
[ 2, 3, 4, 5, 6 ]
import tkinter as tk from tkinter import Tk, BOTH,RIGHT,LEFT,END from tkinter.ttk import Frame, Label, Style,Entry from tkinter.ttk import Frame, Button, Style import random import time class StartPage(tk.Frame): def __init__(self, master): tk.Frame.__init__(self, master) tk.Frame.configu...
normal
{ "blob_id": "4e6401672d4762b444bb679e4cc39ada04193a26", "index": 1882, "step-1": "<mask token>\n\n\nclass PageOne(tk.Frame):\n\n def __init__(self, master):\n tk.Frame.__init__(self, master)\n frame_left = Frame(self)\n self.frame_left = frame_left\n frame_left.pack(fill=BOTH, side...
[ 11, 12, 15, 17, 18 ]
from pkg.models.board import Board class BaseAI: _board: Board = None def __init__(self, board=None): if board is not None: self.set_board(board) def set_board(self, board): self._board = board def find_move(self, for_player): pass
normal
{ "blob_id": "b794a4cca3303ac7440e9aad7bc210df62648b51", "index": 5476, "step-1": "<mask token>\n\n\nclass BaseAI:\n _board: Board = None\n <mask token>\n <mask token>\n <mask token>\n", "step-2": "<mask token>\n\n\nclass BaseAI:\n _board: Board = None\n <mask token>\n <mask token>\n\n d...
[ 1, 2, 3, 4, 5 ]
<|reserved_special_token_0|> class Command(BaseCommand): <|reserved_special_token_0|> <|reserved_special_token_0|> def handle(self, *args, **options): s = '' result = 0 tag = sum([options[i] for i in ['add', 'substract', 'multiply', 'divide']]) if options['add'...
flexible
{ "blob_id": "b2d5b16c287dc76a088f6e20eca4a16dd0aad00f", "index": 8797, "step-1": "<mask token>\n\n\nclass Command(BaseCommand):\n <mask token>\n <mask token>\n\n def handle(self, *args, **options):\n s = ''\n result = 0\n tag = sum([options[i] for i in ['add', 'substract', 'multiply...
[ 2, 3, 4, 5, 6 ]
from sanic import Sanic from sanic.blueprints import Blueprint from sanic.response import html, json, text from sanic_jwt import Initialize from sanic_jwt.decorators import inject_user, protected, scoped def test_forgotten_initialized_on_protected(): blueprint = Blueprint("Test") @blueprint.get("/protected"...
normal
{ "blob_id": "55fc197eebc4e06466e0fc0458957d0460602eef", "index": 2032, "step-1": "<mask token>\n\n\ndef test_forgotten_initialized_on_protected():\n blueprint = Blueprint('Test')\n\n @blueprint.get('/protected')\n @protected()\n def protected_hello_world(request):\n return json({'message': 'he...
[ 6, 7, 8, 11, 13 ]
# Generated by Django 2.1.4 on 2019-04-23 23:37 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('mach...
normal
{ "blob_id": "b9608208f71f25ae05ed9bd7bdf94b8882a26e06", "index": 3091, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n <mask token>\n", "step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n initial = T...
[ 0, 1, 2, 3, 4 ]
from django.shortcuts import render def index(request): return render(request, 'munchiesfastfood/home.html', {'drinks': [ 'Pineapple Juice', 'Green Juice', 'Soft Drinks', 'Carlo Rosee Drinks'], 'dishes': ['Beef Steak', 'Tomato with Chicken', 'Sausages from Italy', 'Beef Grilled']})
normal
{ "blob_id": "e279ca43ce2c582c702f1c6a0c1acf37eb9bcefe", "index": 5603, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef index(request):\n return render(request, 'munchiesfastfood/home.html', {'drinks': [\n 'Pineapple Juice', 'Green Juice', 'Soft Drinks',\n 'Carlo Rosee Drinks'], 'd...
[ 0, 1, 2 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> import models import wizard import parser <|reserved_special_token_1|> # -*- encoding: utf-8 -*- #---------------------------------------------------------------------------- # # Copyright (C) 2014 . # Coded by: Borni DHIFI (dhifi.borni@gmail.com) ...
flexible
{ "blob_id": "a3216aa41cd28b91653b99017e21a03e43372e9b", "index": 4137, "step-1": "<mask token>\n", "step-2": "import models\nimport wizard\nimport parser\n", "step-3": "# -*- encoding: utf-8 -*-\n#----------------------------------------------------------------------------\n#\n# Copyright (C) 2014 .\n# ...
[ 0, 1, 2 ]
<|reserved_special_token_0|> def parse_args(): parser = argparse.ArgumentParser(description= 'Analyze codon usage of SP and LP\n') parser.add_argument('sp_file', help='one input SP data file\n') parser.add_argument('lp_file', help='one input LP data file\n') parser.add_argument('--label', '-l'...
flexible
{ "blob_id": "ae7a2de8742e353818d4f5a28feb9bce04d787bb", "index": 8382, "step-1": "<mask token>\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(description=\n 'Analyze codon usage of SP and LP\\n')\n parser.add_argument('sp_file', help='one input SP data file\\n')\n parser.add_argument('...
[ 11, 13, 16, 20, 21 ]
from django.db import models class TamLicense(models.Model): license = models.TextField("Inserisci qui il tuo codice licenza.")
normal
{ "blob_id": "1daecce86769e36a17fe2935f89b9266a0197cf0", "index": 3942, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass TamLicense(models.Model):\n <mask token>\n", "step-3": "<mask token>\n\n\nclass TamLicense(models.Model):\n license = models.TextField('Inserisci qui il tuo codice licen...
[ 0, 1, 2, 3, 4 ]
#calss header class _PULPIER(): def __init__(self,): self.name = "PULPIER" self.definitions = pulpy self.parents = [] self.childen = [] self.properties = [] self.jsondata = {} self.basic = ['pulpy']
normal
{ "blob_id": "a1d1056f302cf7bc050537dd8cc53cdb2da7e989", "index": 5507, "step-1": "<mask token>\n", "step-2": "class _PULPIER:\n <mask token>\n", "step-3": "class _PULPIER:\n\n def __init__(self):\n self.name = 'PULPIER'\n self.definitions = pulpy\n self.parents = []\n self.c...
[ 0, 1, 2, 3 ]
from setuptools import setup from Cython.Build import cythonize setup( ext_modules=cythonize("utils.pyx"), )
normal
{ "blob_id": "66c71111eae27f6e9fee84eef05cc1f44cc5a477", "index": 3745, "step-1": "<mask token>\n", "step-2": "<mask token>\nsetup(ext_modules=cythonize('utils.pyx'))\n", "step-3": "from setuptools import setup\nfrom Cython.Build import cythonize\nsetup(ext_modules=cythonize('utils.pyx'))\n", "step-4": "fro...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def Error(app): @app.route('/errors', cors=True, methods=['POST']) @printError def errors(): request = app.current_request data = request.json_body print(data) return data <|reserve...
flexible
{ "blob_id": "f100757fcb1bef334f9f8eacae83af551d2bac5b", "index": 3239, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef Error(app):\n\n @app.route('/errors', cors=True, methods=['POST'])\n @printError\n def errors():\n request = app.current_request\n data = request.json_body\...
[ 0, 1, 2 ]
<|reserved_special_token_0|> def voxels(): shape = [] for x in range(-5, 4, 1): for y in range(-5, 4, 1): for z in range(0, 10, 1): translate([x, y, z]) new_cube = color([0, 0, 1, 0.5])(cube([1, 1, 1], center=False)) shape.append(new_cube) ...
flexible
{ "blob_id": "27ca60435c614e4d748917da45fc2fc75ee59f1c", "index": 1682, "step-1": "<mask token>\n\n\ndef voxels():\n shape = []\n for x in range(-5, 4, 1):\n for y in range(-5, 4, 1):\n for z in range(0, 10, 1):\n translate([x, y, z])\n new_cube = color([0, 0,...
[ 2, 3, 4, 5, 6 ]
<|reserved_special_token_0|> class WireValues: def __init__(self): self.wires = {} def __getitem__(self, name): return int(name) if isnum(name) else self.wires[name] def __setitem__(self, name, value): self.wires[name] = value def __contains__(self, name): return is...
flexible
{ "blob_id": "a5eb1f559972519dbe0f3702e03af77e61fbfb4e", "index": 7985, "step-1": "<mask token>\n\n\nclass WireValues:\n\n def __init__(self):\n self.wires = {}\n\n def __getitem__(self, name):\n return int(name) if isnum(name) else self.wires[name]\n\n def __setitem__(self, name, value):\n...
[ 7, 14, 16, 18, 20 ]
import numpy as np import matplotlib.pyplot as plt from sklearn import mixture, metrics import utils import spsa_clustering N = 5000 mix_prob = np.array([0.4, 0.4, 0.2]) clust_means = np.array([[0, 0], [2, 2], [-3, 6]]) clust_gammas = np.array([[[1, -0.7], [-0.7, 1]], np.eye(2), [[1, 0.8], [0.8, 1]]]) data_set = [] t...
normal
{ "blob_id": "5807d1c2318ffa19d237d77fbe3f4c1d51da8601", "index": 7634, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor _ in range(N):\n mix_ind = np.random.choice(len(mix_prob), p=mix_prob)\n data_point = np.random.multivariate_normal(clust_means[mix_ind],\n clust_gammas[mix_ind])\n da...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> def get_accuracy(a, b, X_test, y_test): size = len(y_test) count = 0 for i in range(size): x = X_test[i] real = y_test[i] x = np.array(x) x = x.reshape(1, 6) prediction = x.dot(a.T) + b if prediction > 0 and real == 1: ...
flexible
{ "blob_id": "f5c4057babc873099ae2a4d8c1aca960ab9fa30a", "index": 9692, "step-1": "<mask token>\n\n\ndef get_accuracy(a, b, X_test, y_test):\n size = len(y_test)\n count = 0\n for i in range(size):\n x = X_test[i]\n real = y_test[i]\n x = np.array(x)\n x = x.reshape(1, 6)\n ...
[ 1, 2, 3, 4, 5 ]
from django.db import models from django.utils.safestring import mark_safe from ondoc.authentication.models import TimeStampedModel, CreatedByModel, Image import datetime from django.contrib.contenttypes.models import ContentType from django.urls import reverse from ondoc.doctor.models import Doctor, PracticeSpecializ...
normal
{ "blob_id": "9bc15f063adc7d2a5ea81d090736ab6ce66a03d4", "index": 5028, "step-1": "<mask token>\n\n\nclass ArticleLinkedUrl(TimeStampedModel):\n article = models.ForeignKey(Article, on_delete=models.CASCADE)\n url = models.CharField(max_length=2000, unique=True)\n title = models.CharField(max_length=500)...
[ 9, 18, 21, 22, 28 ]
def label_modes(trip_list, silent=True): """Labels trip segments by likely mode of travel. Labels are "chilling" if traveler is stationary, "walking" if slow, "driving" if fast, and "bogus" if too fast to be real. trip_list [list]: a list of dicts in JSON format. silent [bool]: if True, does n...
normal
{ "blob_id": "3f4e8402bbd096a33ed159ca0fed250c74c2f876", "index": 4833, "step-1": "<mask token>\n", "step-2": "def label_modes(trip_list, silent=True):\n \"\"\"Labels trip segments by likely mode of travel.\n\n Labels are \"chilling\" if traveler is stationary, \"walking\" if slow,\n \"driving\" if...
[ 0, 1, 2 ]
import datetime import time def calculate(a): return a data = set() class Bank: amount = 0 def __init__(self): self.Bank_name = "State Bank of India" self.ifsc = 'SBI0N00012' def __repr__(self): return f'Bank Name: {self.Bank_name}, IFSC_Code : {self.ifsc} ' # se...
normal
{ "blob_id": "66ae7f4ee01ca5516d8e3dc447eeb4709e2b6aec", "index": 4615, "step-1": "<mask token>\n\n\nclass Bank:\n <mask token>\n\n def __init__(self):\n self.Bank_name = 'State Bank of India'\n self.ifsc = 'SBI0N00012'\n\n def __repr__(self):\n return f'Bank Name: {self.Bank_name}, ...
[ 9, 10, 13, 14, 15 ]
<|reserved_special_token_0|> class IntegratedRegressor: <|reserved_special_token_0|> <|reserved_special_token_0|> def fit(self, X, y): self.regs = [] for target in y.columns: tmp = deepcopy(self.reg) if self.predict_log: tmp.fit(X, np.log1p(y[target...
flexible
{ "blob_id": "72d41f939a586fbd8459927983d9d62a96b650e2", "index": 1844, "step-1": "<mask token>\n\n\nclass IntegratedRegressor:\n <mask token>\n <mask token>\n\n def fit(self, X, y):\n self.regs = []\n for target in y.columns:\n tmp = deepcopy(self.reg)\n if self.predi...
[ 6, 7, 8, 10, 11 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def quantity_posts(): try: data = shelve.open('data') except Exception: print(Exception) else: for key, value in sorted(data.items()): print(key, ': \t', value, '\n') finally: ...
flexible
{ "blob_id": "41c44b32ce3329cbba5b9b336c4266bb20de31f0", "index": 5151, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef quantity_posts():\n try:\n data = shelve.open('data')\n except Exception:\n print(Exception)\n else:\n for key, value in sorted(data.items()):\n ...
[ 0, 1, 2, 3, 4 ]
from StockDatabase import StockDatabase from RNNinner import RecurrentAnalyzer import torch import matplotlib.pyplot as plt import numpy as np database = StockDatabase() database.read_data() prices = torch.tensor(database.normalize(database.get_stock_prices('AAPL', length=2000))) print(prices.shape) model = Recurre...
normal
{ "blob_id": "8abfb6a9ca3a7a909a1e8125e8c03e29b2bacda8", "index": 109, "step-1": "<mask token>\n", "step-2": "<mask token>\ndatabase.read_data()\n<mask token>\nprint(prices.shape)\n<mask token>\nmodel.load_state_dict(torch.load('rnn_inner'))\nmodel.init_hidden()\nmodel.eval()\nwith torch.no_grad():\n preds =...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> class Column(Expr): """ Inherited from :class:`~expr.Expr`. Representation of a Python object :class:`~col.Column`. """ def __init__(self, name: str, dataframe: 'DataFrame') ->None: """:meta private:""" super().__init__(dataframe=dataframe) se...
flexible
{ "blob_id": "a52edeec62a6849bda7e5a5481fb6e3d7d9a4c6a", "index": 8571, "step-1": "<mask token>\n\n\nclass Column(Expr):\n \"\"\"\n Inherited from :class:`~expr.Expr`.\n\n Representation of a Python object :class:`~col.Column`.\n \"\"\"\n\n def __init__(self, name: str, dataframe: 'DataFrame') ->No...
[ 6, 9, 10, 12, 13 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> print('my_list consists of: ', my_list) print() print('Operations similar to strings') print('Concatenation') print("my_list + ['bill'] equals: ", my_list + ['bill']) print() print('Repeat') print('my_list * 3 equals: ', my_list *...
flexible
{ "blob_id": "1c134cba779459b57f1f3c195aed37d105b94aef", "index": 9935, "step-1": "<mask token>\n", "step-2": "<mask token>\nprint('my_list consists of: ', my_list)\nprint()\nprint('Operations similar to strings')\nprint('Concatenation')\nprint(\"my_list + ['bill'] equals: \", my_list + ['bill'])\nprint()\nprin...
[ 0, 1, 2, 3 ]
from flask import Flask, render_template from config import Config from flask_bootstrap import Bootstrap from config import config_options from flask_login import LoginManager from flask_wtf.csrf import CSRFProtect from flask_sqlalchemy import SQLAlchemy login_manager = LoginManager() login_manager.session_protection ...
normal
{ "blob_id": "2eecc852a6438db19e0ed55ba6cc6610d76c6ed0", "index": 2207, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\ndef create_app(config_name):\n app = Flask(__name__)\n app.config.from_object(Config)\n app.config.from_object(config_options[config_name])\n app.config['SECRET_KEY'] = 'd...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> from .mail_utils import send_mail from .request_utils import get_host_url
flexible
{ "blob_id": "74b0ccb5193380ce596313d1ac3f898ff1fdd2f3", "index": 930, "step-1": "<mask token>\n", "step-2": "from .mail_utils import send_mail\nfrom .request_utils import get_host_url\n", "step-3": null, "step-4": null, "step-5": null, "step-ids": [ 0, 1 ] }
[ 0, 1 ]
<|reserved_special_token_0|> def phonenumbervalidate(phone): pattern = '^[0][6-9][0-9]{9}$' phone = str(phone) if re.match(pattern, phone): return True return False <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> def phonenumbervalidate(phone): ...
flexible
{ "blob_id": "6b2161379bdd27980d3a515cdf4719ab036845fe", "index": 8217, "step-1": "<mask token>\n\n\ndef phonenumbervalidate(phone):\n pattern = '^[0][6-9][0-9]{9}$'\n phone = str(phone)\n if re.match(pattern, phone):\n return True\n return False\n\n\n<mask token>\n", "step-2": "<mask token>\...
[ 1, 2, 3, 4, 6 ]
a, b, c, y = 4.4, 0.0, 4.2, 3.0 print(c + a * y * y / b)
normal
{ "blob_id": "2c43ede960febfb273f1c70c75816848768db4e5", "index": 6599, "step-1": "<mask token>\n", "step-2": "<mask token>\nprint(c + a * y * y / b)\n", "step-3": "a, b, c, y = 4.4, 0.0, 4.2, 3.0\nprint(c + a * y * y / b)\n", "step-4": null, "step-5": null, "step-ids": [ 0, 1, 2 ] }
[ 0, 1, 2 ]
# This is a generated file, do not edit from typing import List import pydantic from ..rmf_fleet_msgs.DockParameter import DockParameter class Dock(pydantic.BaseModel): fleet_name: str = "" # string params: List[DockParameter] = [] # rmf_fleet_msgs/DockParameter class Config: orm_mode = True...
normal
{ "blob_id": "62d0818395a6093ebf2c410aaadeb8a0250707ab", "index": 3865, "step-1": "<mask token>\n", "step-2": "<mask token>\n\n\nclass Dock(pydantic.BaseModel):\n fleet_name: str = ''\n params: List[DockParameter] = []\n\n\n class Config:\n orm_mode = True\n", "step-3": "from typing import Lis...
[ 0, 1, 2, 3 ]
# Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
normal
{ "blob_id": "049950bd4bbf7903218bb8fb3a4c91492d6af17b", "index": 3252, "step-1": "<mask token>\n\n\nclass _CallableObject(object):\n\n def __init__(self):\n self._lock = threading.Lock()\n self._passed_values = []\n\n def __call__(self, value):\n with self._lock:\n self._pas...
[ 8, 10, 11, 12, 13 ]
""" file: babysit.py language: python3 author: pan7447@rit.edu Parvathi Nair author: vpb8262 Vishal Bulchandani """ """ To compute the maximum pay a brother and sister can earn considering jobs that they can work on together or separately depending on the number of children to babysit """ from operator import * clas...
normal
{ "blob_id": "f57fa2787934dc2a002f82aa1af1f1d9a7f90da5", "index": 9947, "step-1": "<mask token>\n\n\nclass Job:\n \"\"\"\n Job class which stores the attributes of the jobs\n \"\"\"\n\n def __init__(self, day, startTime, endTime, noOfChildren, hourlyRate):\n self.day = day\n self.startTi...
[ 9, 11, 12, 13, 14 ]
a=input("Please enter the elements with spaces between them:").split() n=len(a) for i in range(n): a[i]=int(a[i]) for i in range(n-1): for j in range(n-i-1): if a[j]>a[j+1]: a[j],a[j+1]=a[j+1],a[j] print("Sortes array :",a)
normal
{ "blob_id": "5c2a6802e89314c25f0264bbe2bc7ed2689a255a", "index": 782, "step-1": "<mask token>\n", "step-2": "<mask token>\nfor i in range(n):\n a[i] = int(a[i])\nfor i in range(n - 1):\n for j in range(n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\nprint('Sortes ar...
[ 0, 1, 2, 3 ]
<|reserved_special_token_0|> def getMuseums(): museos = Museo.objects.all() allMuseums = {} for museo in museos: allMuseums[museo.ID_ENTIDAD] = museo.comentario_set.count() return allMuseums def getAccessibleMuseums(): museos = Museo.objects.all() allMuseums = {} for museo in mus...
flexible
{ "blob_id": "8b2911586e21162bec074732216c410c591f18a8", "index": 6018, "step-1": "<mask token>\n\n\ndef getMuseums():\n museos = Museo.objects.all()\n allMuseums = {}\n for museo in museos:\n allMuseums[museo.ID_ENTIDAD] = museo.comentario_set.count()\n return allMuseums\n\n\ndef getAccessible...
[ 10, 11, 14, 17, 18 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> driver.get('https://www.baidu.com') driver.maximize_window() <|reserved_special_token_0|> ActionChains(driver).double_click(element).perform() <|reserved_special_token_0|> time.sleep(2) driver.quit() <|reserved_special_token_0|> A...
flexible
{ "blob_id": "e3f180d4309ade39ac42a895f7f73469fd20724f", "index": 4538, "step-1": "<mask token>\n", "step-2": "<mask token>\ndriver.get('https://www.baidu.com')\ndriver.maximize_window()\n<mask token>\nActionChains(driver).double_click(element).perform()\n<mask token>\ntime.sleep(2)\ndriver.quit()\n<mask token>...
[ 0, 1, 2, 3, 4 ]
<|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0|> process.load('Geometry.VeryForwardGeometry.geometryRPFromDD_2018_cfi') <|reserved_special_token_0|> process.load('CondCore.CondDB.CondDB_cfi') <|reserved_special_token_0|> <|reserved_special_token_1|> <|reserved_special_token_0...
flexible
{ "blob_id": "ac0e301e58ea64465ccd4b2b9aa4ae69283d6d0c", "index": 6052, "step-1": "<mask token>\n", "step-2": "<mask token>\nprocess.load('Geometry.VeryForwardGeometry.geometryRPFromDD_2018_cfi')\n<mask token>\nprocess.load('CondCore.CondDB.CondDB_cfi')\n<mask token>\n", "step-3": "<mask token>\nprocess = cms...
[ 0, 1, 2, 3, 4 ]
from output.models.sun_data.ctype.content_type.content_type00401m.content_type00401m_xsd.content_type00401m import ( A1, A, ) __all__ = [ "A1", "A", ]
normal
{ "blob_id": "846a42a997539a45576d3ecbe0bd290e00b55935", "index": 3258, "step-1": "<mask token>\n", "step-2": "<mask token>\n__all__ = ['A1', 'A']\n", "step-3": "from output.models.sun_data.ctype.content_type.content_type00401m.content_type00401m_xsd.content_type00401m import A1, A\n__all__ = ['A1', 'A']\n", ...
[ 0, 1, 2, 3 ]