code stringlengths 13 6.09M | order_type stringclasses 2
values | original_example dict | step_ids listlengths 1 5 |
|---|---|---|---|
from openfermion import QubitOperator, FermionOperator
from openfermion.transforms import jordan_wigner
from src.utils import QasmUtils, MatrixUtils
from src.ansatz_elements import AnsatzElement, DoubleExchange
import itertools
import numpy
class EfficientDoubleExchange(AnsatzElement):
def __init__(self, qubit_... | normal | {
"blob_id": "24cdbbadc8ff1c7ad5d42eeb518cb6c2b34724a2",
"index": 263,
"step-1": "<mask token>\n\n\nclass EfficientDoubleExcitation2(AnsatzElement):\n\n def __init__(self, qubit_pair_1, qubit_pair_2):\n self.qubit_pair_1 = qubit_pair_1\n self.qubit_pair_2 = qubit_pair_2\n super(EfficientDo... | [
3,
5,
6,
7,
11
] |
<|reserved_special_token_0|>
class Brainpool(VerifiableCurve):
<|reserved_special_token_0|>
def security(self):
self._secure = False
try:
curve = EllipticCurve(GF(self._p), [self._a, self._b])
except ArithmeticError:
return
order = curve.__pari__().ells... | flexible | {
"blob_id": "b717abaeecea2e97c6ec78d3e0e4c97a8de5eec3",
"index": 9169,
"step-1": "<mask token>\n\n\nclass Brainpool(VerifiableCurve):\n <mask token>\n\n def security(self):\n self._secure = False\n try:\n curve = EllipticCurve(GF(self._p), [self._a, self._b])\n except Arithm... | [
8,
9,
10,
12,
17
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
while t:
x = list(map(int, input().split()))
x.sort()
if x[0] + x[1] == x[2]:
print('YES')
else:
print('NO')
t -= 1
<|reserved_special_token_1|>
t = int(input())
while t:
x = list(map(int... | flexible | {
"blob_id": "d1200006b8d7a18b11b01eff4fbf38d9dfd8958e",
"index": 5758,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwhile t:\n x = list(map(int, input().split()))\n x.sort()\n if x[0] + x[1] == x[2]:\n print('YES')\n else:\n print('NO')\n t -= 1\n",
"step-3": "t = int(inp... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class AutoTestCase(APITestCase):
<|reserved_special_token_0|>
@classmethod
def setUpClass(cls):
"""
Создание пользователя для всех тестов, который цепляется через `settings.AUTH_USER_PK`
"""
super(AutoTestCase, cls).setUpClass()
model_... | flexible | {
"blob_id": "04822e735c9c27f0e0fcc9727bcc38d2da84dee6",
"index": 7831,
"step-1": "<mask token>\n\n\nclass AutoTestCase(APITestCase):\n <mask token>\n\n @classmethod\n def setUpClass(cls):\n \"\"\"\n Создание пользователя для всех тестов, который цепляется через `settings.AUTH_USER_PK`\n\n ... | [
6,
11,
12,
14,
16
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
print(60 * 60)
<|reserved_special_token_0|>
print(24 * seconds_per_hour)
<|reserved_special_token_0|>
print(seconds_per_day / seconds_per_hour)
print(seconds_per_day // seconds_per_hour)
<|reserved_special_token_1|>
print(60 * 60)
seconds_per_hour = 60 * 6... | flexible | {
"blob_id": "358879d83ed3058530031d50fb69e3ce11fbd524",
"index": 1057,
"step-1": "<mask token>\n",
"step-2": "print(60 * 60)\n<mask token>\nprint(24 * seconds_per_hour)\n<mask token>\nprint(seconds_per_day / seconds_per_hour)\nprint(seconds_per_day // seconds_per_hour)\n",
"step-3": "print(60 * 60)\nseconds_... | [
0,
1,
2
] |
import time,random,os
from tkinter import *
def restart():
root.destroy()
os.startfile(r"data\programs\game with tkinter.py")
def disableButton():
global l,restartButton,start
b1.config(state="disabled")
b2.config(state="disabled")
b3.config(state="disabled")
b4.config(state="disabled"... | normal | {
"blob_id": "e70c5c9a62faa4c501c0f103ce0a0a419aaf4301",
"index": 2096,
"step-1": "<mask token>\n\n\ndef restart():\n root.destroy()\n os.startfile('data\\\\programs\\\\game with tkinter.py')\n\n\ndef disableButton():\n global l, restartButton, start\n b1.config(state='disabled')\n b2.config(state=... | [
11,
12,
14,
15,
18
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
@app.callback(Output('node-6-display-value', 'children'), [Input(
'node-6-dropdown', 'value')])
def display_value(value):
return 'You have selected "{}"'.format(value)
<|reserved_special_token_1|>
<|reserved_special_t... | flexible | {
"blob_id": "632b90ea5a2ac35539e589af297c04b31bbf02d0",
"index": 3443,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\n@app.callback(Output('node-6-display-value', 'children'), [Input(\n 'node-6-dropdown', 'value')])\ndef display_value(value):\n return 'You have selected \"{}\"'.format(value)\n"... | [
0,
1,
2,
3,
4
] |
# C8-06 p.146 Write city_country() function that takes name city and country
# Print city name then the country the city is in. call 3 times with differet pairs.
def city_country(city, country):
"""Name a city and the country it resides in seperated by a comma."""
print(f'"{city.title()}, {country.title()}"\n'... | normal | {
"blob_id": "2866ecf69969b445fb15740a507ddecb1dd1762d",
"index": 3395,
"step-1": "<mask token>\n",
"step-2": "def city_country(city, country):\n \"\"\"Name a city and the country it resides in seperated by a comma.\"\"\"\n print(f'\"{city.title()}, {country.title()}\"\\n')\n\n\n<mask token>\n",
"step-3... | [
0,
1,
2,
3
] |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from app.models import *
# Register your models here.
class ProfileInline(admin.StackedInline):
model = UserProfile
can_delete = False
verbose_name_plural = 'profile'
clas... | normal | {
"blob_id": "a9f3d5f11a9f2781571029b54d54b41d9f1f83b3",
"index": 592,
"step-1": "<mask token>\n\n\nclass ProfileInline(admin.StackedInline):\n <mask token>\n <mask token>\n <mask token>\n\n\nclass UserAdmin(BaseUserAdmin):\n inlines = ProfileInline,\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n... | [
3,
4,
5,
6,
7
] |
#!/usr/bin/env python3
"""
This file contains all the required methods for the street prediction utilizing
the Hough transform.
"""
import numpy as np
import scipy.ndimage as ndi
from skimage.draw import polygon
from skimage.transform import hough_line
def draw_roads(roads, shape):
"""
Creates an image wit... | normal | {
"blob_id": "f76185095ebb1adbf7ae22ffb500ffc3d6b0a30d",
"index": 6019,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef find_roads(probability_map, *, input_threshold=0.3, max_roads=None,\n min_strength=0.17, num_angles=720, roads_min_angle=np.pi / 8,\n roads_min_distance=50, debugimage=None,... | [
0,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
class FilmSerializer(serializers.ModelSerializer):
owner = serializers.ReadOnlyField(source='owner.username')
class Meta:
model = Film
fields = 'id', 'title', 'year_prod', 'genre', 'theater_set', 'owner'
depth = 1
class FilmWriteSerializer(serializers.M... | flexible | {
"blob_id": "e6aa28ae312ea5d7f0f818b7e86b0e76e2e57b48",
"index": 4652,
"step-1": "<mask token>\n\n\nclass FilmSerializer(serializers.ModelSerializer):\n owner = serializers.ReadOnlyField(source='owner.username')\n\n\n class Meta:\n model = Film\n fields = 'id', 'title', 'year_prod', 'genre', ... | [
7,
9,
10,
11,
13
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(Webpage)
<|reserved_special_token_0|>
print(a)
<|reserved_special_token_0|>
print(total_page)
<|reserved_special_token_1|>
<|reserved_special_token_0|>
url_header = (
'http://srh.bankofchina.com/search/whpj/search.jsp... | flexible | {
"blob_id": "62a86bd33755510f0d71f4920e63be1a3ce8c563",
"index": 6304,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(Webpage)\n<mask token>\nprint(a)\n<mask token>\nprint(total_page)\n",
"step-3": "<mask token>\nurl_header = (\n 'http://srh.bankofchina.com/search/whpj/search.jsp?erectDate=201... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
class Solution(object):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
class Solution(object):
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""... | flexible | {
"blob_id": "1aed8e92a31ee42a3a609123af927f7074598ec1",
"index": 1820,
"step-1": "<mask token>\n",
"step-2": "class Solution(object):\n <mask token>\n\n\n<mask token>\n",
"step-3": "class Solution(object):\n\n def longestCommonPrefix(self, strs):\n \"\"\"\n :type strs: List[str]\n ... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class UnlockCodeRequestMultiStepFlow(MultiStepFlow):
<|reserved_special_token_0|>
def __init__(self, endpoint):
super(UnlockCodeRequestMultiStepFlow, self).__init__(title=_(
'form.auth-request.title'), steps=[UnlockCodeRequestInputStep,
UnlockCodeR... | flexible | {
"blob_id": "cddb16a305f74eb1a3f2854208f8508c4a7a8953",
"index": 649,
"step-1": "<mask token>\n\n\nclass UnlockCodeRequestMultiStepFlow(MultiStepFlow):\n <mask token>\n\n def __init__(self, endpoint):\n super(UnlockCodeRequestMultiStepFlow, self).__init__(title=_(\n 'form.auth-request.tit... | [
3,
4,
5,
6,
7
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
@bp.route('/')
@bp.route('/index')
@login_required
def index():
return render_template('index.html')
<|reserved_special_token_1|>
from flask import render_template, flash, redirect, url_for, request
from flask_login impor... | flexible | {
"blob_id": "495d606304e07a097033366d1a7e1d856a4cf61f",
"index": 1935,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\n@bp.route('/')\n@bp.route('/index')\n@login_required\ndef index():\n return render_template('index.html')\n",
"step-3": "from flask import render_template, flash, redirect, url_f... | [
0,
1,
2,
3
] |
#!/usr/bin/env python
from google.appengine.ext.webapp import template
from google.appengine.ext import ndb
import logging
import os.path
import webapp2
import json
from webapp2_extras import auth
from webapp2_extras import sessions
from webapp2_extras.auth import InvalidAuthIdError
from webapp2_extras.auth import ... | normal | {
"blob_id": "fe7fb9a4a5ca2bb8dab0acf440eb2fac127264ce",
"index": 2631,
"step-1": "<mask token>\n\n\nclass BaseHandler(webapp2.RequestHandler):\n\n @webapp2.cached_property\n def auth(self):\n \"\"\"Shortcut to access the auth instance as a property.\"\"\"\n return auth.get_auth()\n <mask t... | [
40,
42,
48,
49,
51
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print('Albedo:', albedo[x[0], y[0]])
print('Albedo in RGB space:', albedo[x[0], y[0]] * 255)
<|reserved_special_token_0|>
plt.subplot(1, 2, 1)
plt.imshow(ball)
plt.subplot(1, 2, 2)
plt.imshow(albedo * shading)
plt.show()
<|reser... | flexible | {
"blob_id": "cc6f70e328b774972e272e9600274dfd9fca93ee",
"index": 3073,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('Albedo:', albedo[x[0], y[0]])\nprint('Albedo in RGB space:', albedo[x[0], y[0]] * 255)\n<mask token>\nplt.subplot(1, 2, 1)\nplt.imshow(ball)\nplt.subplot(1, 2, 2)\nplt.imshow(albed... | [
0,
1,
2,
3,
4
] |
import PyPDF2
from pathlib import Path
def get_filenames():
"""
Get PDF files not yet reordered in the current directory
:return: list of PDF file names
"""
filenames = []
for filename in Path('.').glob('*.pdf'):
if 'reordered' not in filename.stem:
filenames.append(filenam... | normal | {
"blob_id": "2b3a42fed98b43cdd78edd751b306ba25328061a",
"index": 8652,
"step-1": "<mask token>\n\n\ndef appendix_and_index_pages():\n \"\"\"\n Prompt user to input appendix pages (if one exists) and index pages\n :return: start and end pages of the appendix and index\n \"\"\"\n\n def index_pages()... | [
2,
5,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Covid(models.Model):
<|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": "284955a555ce1a727ba5041008cd0bac3c3bed49",
"index": 1283,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Covid(models.Model):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Covid(models.Model):\n states = models.C... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class BinaryTreeInorderTraversal(object):
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class BinaryTreeInorderTraversal(object):
def inorderTraversal(self, root: TreeNode) ... | flexible | {
"blob_id": "8e629ee53f11e29aa026763508d13b06f6ced5ba",
"index": 940,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass BinaryTreeInorderTraversal(object):\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass BinaryTreeInorderTraversal(object):\n\n def inorderTraversal(self, root: TreeNod... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
print(sum([(row[lineNumber * 3 % len(row)] == '#') for lineNumber, row in
enumerate(open('input.txt').read().splitlines())]))
<|reserved_special_token_1|>
#!/usr/bin/env python3
print(sum([row[lineNumber * 3 % len(row)] == '#' for lineNumber, row in e... | flexible | {
"blob_id": "b2fecadbd99edb89379f82a935aa1622f043eeac",
"index": 9099,
"step-1": "<mask token>\n",
"step-2": "print(sum([(row[lineNumber * 3 % len(row)] == '#') for lineNumber, row in\n enumerate(open('input.txt').read().splitlines())]))\n",
"step-3": "#!/usr/bin/env python3\n\nprint(sum([row[lineNumber *... | [
0,
1,
2
] |
from math import sqrt
from numpy import concatenate
from matplotlib import pyplot
from pandas import read_csv
from pandas import DataFrame
from pandas import concat
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import mean_squared_error
from tensorflo... | normal | {
"blob_id": "11984027baf6d4c97b2976e4ac49a0e8ec62f893",
"index": 8709,
"step-1": "from math import sqrt\nfrom numpy import concatenate\nfrom matplotlib import pyplot\nfrom pandas import read_csv\nfrom pandas import DataFrame\nfrom pandas import concat\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn... | [
0
] |
<|reserved_special_token_0|>
@app.route('/<sensor_id>', methods=['GET'])
def sensor_details(sensor_id):
sensor_pos = search_index_by_id(sensor_id)
if sensor_pos >= 0:
return {'sensor': sensors[sensor_pos]}
else:
return {'kind': 'error', 'payload': f'Sensor {sensor_id} not found'}
<|reser... | flexible | {
"blob_id": "2843845848747c723d670cd3a5fcb7127153ac7e",
"index": 264,
"step-1": "<mask token>\n\n\n@app.route('/<sensor_id>', methods=['GET'])\ndef sensor_details(sensor_id):\n sensor_pos = search_index_by_id(sensor_id)\n if sensor_pos >= 0:\n return {'sensor': sensors[sensor_pos]}\n else:\n ... | [
2,
3,
4,
6,
7
] |
from flask import Flask, render_template, redirect, request, session
app = Flask(__name__)
app.secret_key = 'ThisIsSecret' #this line is always needed when using the import 'session'
@app.route('/') #methods=['GET'] by default
def index():
return render_template('index.html')
@app.route('/ninja'... | normal | {
"blob_id": "001198459b038186ab784b6a9bed755924784866",
"index": 4687,
"step-1": "from flask import Flask, render_template, redirect, request, session\r\n\r\napp = Flask(__name__)\r\napp.secret_key = 'ThisIsSecret' #this line is always needed when using the import 'session'\r\n\r\n\r\n@app.route('/') #meth... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
with open('student_registrations.json', 'w') as f:
f.write(e)
<|reserved_special_token_1|>
<|reserved_special_token_0|>
s1 = ex1.load_course_registrations('data.txt')
s1 = map(asdict, s1)
e = json.dumps(list(s1))
with open(... | flexible | {
"blob_id": "8a5ade450485f9114fa91c00c7588535ccbaf0e6",
"index": 1923,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwith open('student_registrations.json', 'w') as f:\n f.write(e)\n",
"step-3": "<mask token>\ns1 = ex1.load_course_registrations('data.txt')\ns1 = map(asdict, s1)\ne = json.dumps(list... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(result)
<|reserved_special_token_1|>
a = 1 + 2 * 3
a = 1 or 2 and 3
result = 1 < 2 < 3
result = 10 < 20 > 15
print(result)
<|reserved_special_token_1|>
# 运算符的优先级
# 和数学中一样,在Python运算也有优先级,比如先乘除 后加减
# 运算符的优先级可以根据优先级的表格来查询... | flexible | {
"blob_id": "25550cbaf6e0e5bdbbe3852bb8cdc05ac300d315",
"index": 8872,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(result)\n",
"step-3": "a = 1 + 2 * 3\na = 1 or 2 and 3\nresult = 1 < 2 < 3\nresult = 10 < 20 > 15\nprint(result)\n",
"step-4": "# 运算符的优先级\n# 和数学中一样,在Python运算也有优先级,比如先乘除 后加减\n# 运... | [
0,
1,
2,
3
] |
from config import Config
import numpy as np
from itertools import product
from sklearn.utils import shuffle
from sklearn.metrics import precision_recall_fscore_support
from keras import callbacks, regularizers
from keras.models import Sequential
from keras.layers import Dense, InputLayer
from keras import backend as K... | normal | {
"blob_id": "957e18b2536cda69ba1db571d0308d5e392fe488",
"index": 2166,
"step-1": "<mask token>\n\n\ndef FetchData(cfg):\n with open(cfg.FILE, 'rb') as f:\n data = pickle.load(f)\n if cfg.SHUFFLE:\n features, targets = shuffle(data[0], data[1])\n else:\n features = da... | [
5,
6,
7,
8,
10
] |
def most_expensive_item(products):
return max(products.items(), key=lambda p: p[1])[0]
| normal | {
"blob_id": "f1e335d0187aeb78d857bc523eb33221fd2e7e6d",
"index": 7148,
"step-1": "<mask token>\n",
"step-2": "def most_expensive_item(products):\n return max(products.items(), key=lambda p: p[1])[0]\n",
"step-3": null,
"step-4": null,
"step-5": null,
"step-ids": [
0,
1
]
} | [
0,
1
] |
# -*- coding: utf-8 -*-
"""
Created on Mon May 27 17:38:50 2019
@author: User
"""
import numpy as np
import pandas as pd
dataset = pd.read_csv('University_data.csv')
print(dataset.info())
features = dataset.iloc[:, :-1].values
labels = dataset.iloc[:, -1:].values
from sklearn.preprocessing import LabelEncoder
la... | normal | {
"blob_id": "94e8f0532da76c803b23fe2217b07dc8cf285710",
"index": 950,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(dataset.info())\n<mask token>\nregressor.fit(features, labels)\n<mask token>\nregressor.predict(x)\n",
"step-3": "<mask token>\ndataset = pd.read_csv('University_data.csv')\nprint(... | [
0,
1,
2,
3,
4
] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: Swking
@File : ZDT.py
@Date : 2018/12/28
@Desc :
"""
import numpy as np
class ZDT1:
def __init__(self):
self.dimension = 30
self.objFuncNum = 2
self.isMin = True
self.min = np.zeros(self.dimension)
self.max = np.zeros(self.dimension) + 1
self.s... | normal | {
"blob_id": "8ca16947054b681a5f43d8b8029191d031d3a218",
"index": 8352,
"step-1": "<mask token>\n\n\nclass ZDT2:\n\n def __init__(self):\n self.dimension = 30\n self.objFuncNum = 2\n self.isMin = True\n self.min = np.zeros(self.dimension)\n self.max = np.zeros(self.dimension)... | [
12,
13,
16,
17,
18
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
"""
db.集合.update()
"""
"""
实例 被替换了
> db.test1000.update({'name':'dapeng'},{'name':'大鹏'})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.test1000.find()
{ "_id" : ObjectId("5c35549d7ad0cf935d3c150d"), "name" : "大鹏" }
{ "_id" : ObjectId... | flexible | {
"blob_id": "7d8c2aa5674704d4443034c29bbdc715da9fd567",
"index": 5022,
"step-1": "<mask token>\n",
"step-2": "\"\"\"\ndb.集合.update()\n\n\"\"\"\n\"\"\"\n实例 被替换了\n> db.test1000.update({'name':'dapeng'},{'name':'大鹏'})\nWriteResult({ \"nMatched\" : 1, \"nUpserted\" : 0, \"nModified\" : 1 })\n> db.test1000.find()\n... | [
0,
1
] |
<|reserved_special_token_0|>
class SfCrawlSpider(scrapy.Spider):
<|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_1|>
<|reserved_special_toke... | flexible | {
"blob_id": "7ed6d475bfe36fdd0b6cd2f0902a0bccb22f7f60",
"index": 6082,
"step-1": "<mask token>\n\n\nclass SfCrawlSpider(scrapy.Spider):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass SfCrawlSpider(scrapy.Spider)... | [
1,
4,
5,
6,
7
] |
from pyloom import *
import random
import string
alphabet = string.ascii_letters
def random_string(N):
return ''.join([random.choice(alphabet) for _ in range(N)])
class TestBloomFilter(object):
def test_setup(self):
bf = BloomFilter(1000)
assert 10 == bf._num_hashes
assert 14380 ==... | normal | {
"blob_id": "24e486edc6f80e0b7d58b5df898e6d34f53111c8",
"index": 4389,
"step-1": "<mask token>\n\n\nclass TestBloomFilter(object):\n\n def test_setup(self):\n bf = BloomFilter(1000)\n assert 10 == bf._num_hashes\n assert 14380 == bf._num_bits\n assert 14380 == len(bf._bitarray)\n ... | [
5,
6,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
saveResult(
'/work/scratch/zhangbin/EmbryoTracking_ClaireBinZhang/MotilityAnalysis/20160317 10 dpf 60 fps 15 min (2)/here'
, results)
<|reserved_special_token_0|>
plt.plot(epoch_count, training_loss, 'r--')
plt.legend(['Tr... | flexible | {
"blob_id": "ba379ed90bccd05d058f69f33a960779f8b8bcd5",
"index": 5632,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nsaveResult(\n '/work/scratch/zhangbin/EmbryoTracking_ClaireBinZhang/MotilityAnalysis/20160317 10 dpf 60 fps 15 min (2)/here'\n , results)\n<mask token>\nplt.plot(epoch_count, traini... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def main():
random_graph = create_random_graph(5, 10)
print('THE GRAPH:')
for vertex in random_graph.parse_vertices():
for edge in random_graph.parse_outbound_edges(vertex):
print(edge)
print('\n')
next_vertex = find_accessible_vertices_backwards(ra... | flexible | {
"blob_id": "f882589729d74a910d20856d4dc02546fe316e0d",
"index": 2994,
"step-1": "<mask token>\n\n\ndef main():\n random_graph = create_random_graph(5, 10)\n print('THE GRAPH:')\n for vertex in random_graph.parse_vertices():\n for edge in random_graph.parse_outbound_edges(vertex):\n pr... | [
1,
2,
4,
5,
6
] |
from . import FixtureTest
class GatesLineGeometry(FixtureTest):
def test_linear_gate(self):
# Add barrier:gates with line geometries in landuse
# Line barrier:ghate feature
self.load_fixtures(['http://www.openstreetmap.org/way/391260223'])
self.assert_has_feature(
16, ... | normal | {
"blob_id": "2192e328bdfa454ff1d1f66a05fb6a322c48b244",
"index": 2847,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass GatesLineGeometry(FixtureTest):\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass GatesLineGeometry(FixtureTest):\n\n def test_linear_gate(self):\n self.load_... | [
0,
1,
2,
3,
4
] |
#!/usr/bin/env python
from scapy.all import *
from optparse import OptionParser
import socket
import struct
class MagicARP:
def __init__(self, iface):
self.iface = iface
self.macrecs = {}
def magic_arp(self, pkt):
# only look for queries
if ARP in pkt and pkt[ARP].op == 1:
# Get a rand... | normal | {
"blob_id": "c58bfa620df9f1b1f31c83a76d0d8a4576cbd535",
"index": 7795,
"step-1": "#!/usr/bin/env python\n\nfrom scapy.all import *\nfrom optparse import OptionParser\nimport socket\nimport struct\n\n\n\n\t\nclass MagicARP:\n\t\n\tdef __init__(self, iface):\n\t\t\n\t\tself.iface = iface\n\t\tself.macrecs = {}\n\t... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(rest_endpoint)
<|reserved_special_token_0|>
print(run_id)
<|reserved_special_token_1|>
<|reserved_special_token_0|>
ws = Workspace.from_config()
step1 = PythonScriptStep(name='prepare data', source_directory='scripts',
... | flexible | {
"blob_id": "4a7f8221208e8252c7f5c0adff2949f0e552def1",
"index": 775,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(rest_endpoint)\n<mask token>\nprint(run_id)\n",
"step-3": "<mask token>\nws = Workspace.from_config()\nstep1 = PythonScriptStep(name='prepare data', source_directory='scripts',\n ... | [
0,
1,
2,
3,
4
] |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 15 17:28:48 2018
@author: otalabay
"""
LOCAL_INFO = 1
LSM = 2
TLS = 3
TLS_STOP = 4
DANGER = 5
STOP_DANGER = 6
PM = 7
PM_STOP = 8 | normal | {
"blob_id": "db341c3686c53f1cd9fe98c532f17e872952cbba",
"index": 6733,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nLOCAL_INFO = 1\nLSM = 2\nTLS = 3\nTLS_STOP = 4\nDANGER = 5\nSTOP_DANGER = 6\nPM = 7\nPM_STOP = 8\n",
"step-3": "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Feb 15 17:28:48 2018\... | [
0,
1,
2
] |
from mcse.core.driver import BaseDriver_
class DimerGridSearch(BaseDriver_):
"""
Generates all dimer structures that should be considered for a grid search
to find the best dimer arangements. Grid search is performed over all
x,y,z positions for the COM and all orientations of the molecule. Only
... | normal | {
"blob_id": "9db4bca3e907d70d9696f98506efb6d6042b5723",
"index": 6710,
"step-1": "<mask token>\n\n\nclass DimerGridSearch(BaseDriver_):\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass DimerGridSearch(BaseDriver_):\n <mask token>\n\n def __init__(self, folder='', min_sr=0.75, ma... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
class figure:
<|reserved_special_token_0|>
def new_num_directory(self, path):
n = 1
while True:
if not os.path.exists(path + '_' + str(n)):
os.mkdir(path + '_' + str(n))
break
else:
n += 1
... | flexible | {
"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
] |
from django.db import models
from django.utils import timezone
class User(models.Model):
class Meta:
db_table = "User"
app_label = "backlog"
webin_id = models.CharField(
"ENA's submission account id", max_length=15, unique=True, primary_key=True
)
registered = models.BooleanFi... | normal | {
"blob_id": "dff5e75460637cf175b1b65af3320d01dc2e35b6",
"index": 2628,
"step-1": "<mask token>\n\n\nclass Blacklist(models.Model):\n\n\n class Meta:\n db_table = 'Blacklist'\n app_label = 'backlog'\n date_blacklisted = models.DateField(auto_now_add=True)\n pipeline_version = models.Foreign... | [
35,
36,
38,
45,
47
] |
<|reserved_special_token_0|>
class link_to_block(nodes.Admonition, nodes.Element):
<|reserved_special_token_0|>
pass
class LinkToBlock(BaseAdmonition):
""" Hidden technical block"""
node_class = link_to_block
has_content = False
required_arguments = 1
optional_arguments = 2
final_arg... | flexible | {
"blob_id": "63cce356b792949b90b215e0a5826f7b33d2d375",
"index": 8064,
"step-1": "<mask token>\n\n\nclass link_to_block(nodes.Admonition, nodes.Element):\n <mask token>\n pass\n\n\nclass LinkToBlock(BaseAdmonition):\n \"\"\" Hidden technical block\"\"\"\n node_class = link_to_block\n has_content =... | [
5,
6,
7,
9,
11
] |
from liver_tumor_segmentation.CGBS_Net import *
from liver_tumor_segmentation.loss import *
from keras.optimizers import *
from liver_tumor_segmentation.CGBS_data_generator import *
from keras.callbacks import *
import os
from keras.callbacks import ReduceLROnPlateau
from keras import losses
from configuration... | normal | {
"blob_id": "8c17f2c770c24bbf8c73628c6740c0b866e6b1c0",
"index": 9047,
"step-1": "<mask token>\n\n\ndef train():\n batch_size = 4\n os.environ['CUDA_VISIBLE_DEVICES'] = '0'\n trainGene = trainGenerator(batch_size, data_path='/data', folder=\n 'train', aug_dict=aug_args, seed=1, interaction='RECIS... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
__all__ = ['A1', 'A']
<|reserved_special_token_1|>
from output.models.sun_data.ctype.content_type.content_type00401m.content_type00401m_xsd.content_type00401m import A1, A
__all__ = ['A1', 'A']
<|reserved_special_token_1|>
f... | flexible | {
"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
] |
fname = input('Enter the file name to open')
fh = open(fname)
lst1 = list()
data = dict()
for ln in fh :
if ln.startswith("From"):
if ln.startswith('From:'):
continue
else :
word = ln.split()
lst1.append(word[1])
for word in lst1:
data[word] = dat... | normal | {
"blob_id": "4fba13d051a3aceb393a4473cdbf6d4fc684c7ac",
"index": 9473,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor ln in fh:\n if ln.startswith('From'):\n if ln.startswith('From:'):\n continue\n else:\n word = ln.split()\n lst1.append(word[1])\nfor... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def create_app(config_name):
app = Flask(__name__, static_folder=static_file_dir)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
from .main import main as main_blueprint
app.reg... | flexible | {
"blob_id": "bee6ba1db608c1d9c8114f89d4b3abab795a6b86",
"index": 3843,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef create_app(config_name):\n app = Flask(__name__, static_folder=static_file_dir)\n app.config.from_object(config[config_name])\n config[config_name].init_app(app)\n fro... | [
0,
1,
2,
3
] |
import requests
import time
while 1:
r = requests.put("http://localhost:3000/api/4", data={"temperature": 24, "led": 1})
print r.text
time.sleep(1) | normal | {
"blob_id": "23a560c5f5553fc32329121ea47f8a7ae1196889",
"index": 440,
"step-1": "import requests\nimport time\n\nwhile 1:\n r = requests.put(\"http://localhost:3000/api/4\", data={\"temperature\": 24, \"led\": 1})\n print r.text\n time.sleep(1)",
"step-2": null,
"step-3": null,
"step-4": null,
"... | [
0
] |
# Generated by Django 3.2.7 on 2021-10-01 06:43
from django.db import migrations
import django_resized.forms
import event.models.event
import event.models.event_agenda
class Migration(migrations.Migration):
dependencies = [
('event', '0009_auto_20211001_0406'),
]
operations = [
migratio... | normal | {
"blob_id": "d0a053faccecddc84a9556aec3dff691b171df96",
"index": 9977,
"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 = [('event', '00... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
__all__ = ['CountEncoder', 'CombinCountEncoder', 'FrequencyEncoder',
'NullCounter', 'AutoCalcEncoder', 'extract_obj_cols']
<|reserved_special_token_1|>
from CategoryReplacer.CategoryReplcaers import CountEncoder
from Catego... | flexible | {
"blob_id": "d28e517e72c3689e973a5b1255d414648de418fb",
"index": 1658,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n__all__ = ['CountEncoder', 'CombinCountEncoder', 'FrequencyEncoder',\n 'NullCounter', 'AutoCalcEncoder', 'extract_obj_cols']\n",
"step-3": "from CategoryReplacer.CategoryReplcaers im... | [
0,
1,
2,
3
] |
from functools import reduce
from math import (log, sqrt)
import matplotlib.pyplot as plt
import matplotlib.pylab as mlab
import numpy
import random
import scipy.stats
class Node:
def __init__(
self,
name,
val=None,
observed=False,
candidate_standard_devi... | normal | {
"blob_id": "4c5db1af9fd1c9b09f6e64a44d72351807c0f7a5",
"index": 8136,
"step-1": "<mask token>\n\n\nclass Node:\n <mask token>\n <mask token>\n <mask token>\n\n def save_sample(self, val):\n if self.file:\n self.file.write('{}\\n'.format(self.val))\n\n def sample(self, isBurn=Fal... | [
18,
19,
23,
24,
26
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for i in listings:
coins[str(i['id'])] = i['slug']
slugs[i['slug']] = str(i['id'])
for i in coins:
page = requests.get(
f'https://coinmarketcap.com/currencies/{coins[i]}/historical-data/?start=20200101&end=2020... | flexible | {
"blob_id": "925e1a1a99b70a8d56289b72fa0e16997e12d854",
"index": 4038,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor i in listings:\n coins[str(i['id'])] = i['slug']\n slugs[i['slug']] = str(i['id'])\nfor i in coins:\n page = requests.get(\n f'https://coinmarketcap.com/currencies/{co... | [
0,
1,
2,
3,
4
] |
import numpy as np, pandas as pd
from sklearn.preprocessing import MinMaxScaler
from sklearn.base import BaseEstimator, TransformerMixin
from datetime import timedelta
import sys
DEBUG = False
class DailyAggregator(BaseEstimator, TransformerMixin):
''' Aggregates time-series values to daily level. '''
def... | normal | {
"blob_id": "9f7b1cfcc3c20910201fc67b5a641a5a89908bd1",
"index": 8980,
"step-1": "<mask token>\n\n\nclass IndexSetter(BaseEstimator, TransformerMixin):\n \"\"\" Set index \"\"\"\n\n def __init__(self, index_cols, drop_existing):\n self.index_cols = index_cols\n self.drop_existing = drop_exist... | [
41,
44,
52,
56,
62
] |
<|reserved_special_token_0|>
def write_packets_from(f, fph, base_name, namespace, P):
if base_name != 'ServerPacket':
f.write('var {base_name}ID = {{ \n'.format(base_name=base_name))
for i, x in enumerate(P):
if x:
f.write(' {name} : {packet_id}'.format(base_name=
... | flexible | {
"blob_id": "22dccf6bb76dab735f373089d0772f475b2d5a5d",
"index": 6849,
"step-1": "<mask token>\n\n\ndef write_packets_from(f, fph, base_name, namespace, P):\n if base_name != 'ServerPacket':\n f.write('var {base_name}ID = {{ \\n'.format(base_name=base_name))\n for i, x in enumerate(P):\n ... | [
4,
5,
6,
7,
8
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
@pytest.fixture
def decorated_example():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token... | flexible | {
"blob_id": "ae3198e68d9479605327b729c01fb15eae87ab98",
"index": 3282,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\n@pytest.fixture\ndef decorated_example():\n \"\"\"Sample pytest fixture.\n See more at: http://doc.pytest.org/en/latest/fixture.html\n \"\"\"\n\n\n<mask token>\n",
"step-3"... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def riddle(lst):
"""
Holy fuck.
Better summary than above of what's happening:
Define an value `v` in the list to dominate a range of size `n`, including `v`
itself, if `v` is smaller than all other numbers in this contiguous range.
Define `v`'s "dominating window" to be t... | flexible | {
"blob_id": "dce7fd0c9ed8e1d433f9131a8d137c8dcca4ac56",
"index": 8307,
"step-1": "<mask token>\n\n\ndef riddle(lst):\n \"\"\"\n Holy fuck.\n\n Better summary than above of what's happening:\n\n Define an value `v` in the list to dominate a range of size `n`, including `v`\n itself, if `v` is smaller than ... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
def get_level_diff(word, only_common=False):
if only_common:
word_df = df[(df['word'] == word) & (df['common'] == 1)]
else:
word_df = df[df['word'] == word]
return (word_df.values[0][3], word_df.values[0][8]) if len(word_df
) > 0 else (None, None)
<|r... | flexible | {
"blob_id": "2f489a87e40bea979000dd429cc4cb0150ff4c3b",
"index": 908,
"step-1": "<mask token>\n\n\ndef get_level_diff(word, only_common=False):\n if only_common:\n word_df = df[(df['word'] == word) & (df['common'] == 1)]\n else:\n word_df = df[df['word'] == word]\n return (word_df.values[0... | [
3,
4,
5,
6,
7
] |
# Author: Loren Matilsky
# Date created: 03/02/2019
import matplotlib.pyplot as plt
import numpy as np
import sys, os
sys.path.append(os.environ['raco'])
sys.path.append(os.environ['rapl'])
sys.path.append(os.environ['rapl'] + '/timetrace')
from common import *
from cla_util import *
from plotcommon import *
from timey... | normal | {
"blob_id": "97a059d6d34b924a0512ebe6ff5ab1d5ccc072d5",
"index": 8966,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nsys.path.append(os.environ['raco'])\nsys.path.append(os.environ['rapl'])\nsys.path.append(os.environ['rapl'] + '/timetrace')\n<mask token>\nkwargs_default.update(plot_timey_kwargs_default... | [
0,
1,
2,
3,
4
] |
from django.contrib.auth import get_user_model
from django.db import models
from django.db.models.signals import post_save
from apps.common.constants import NOTIFICATION_TYPE_CHOICES, INFO
from apps.core.models import BaseModel
from apps.core.utils.helpers import get_upload_path
from apps.core.utils.push_notification ... | normal | {
"blob_id": "c2260278c8dfb353f55ee9ea3495049b08169447",
"index": 4115,
"step-1": "<mask token>\n\n\nclass City(BaseModel):\n name = models.CharField(max_length=255, db_index=True)\n\n def __str__(self):\n return self.name\n\n\nclass Article(BaseModel):\n created_by = models.ForeignKey(User, relat... | [
9,
10,
11,
12,
15
] |
<|reserved_special_token_0|>
class Model:
def __init__(self, dim_word, dim_char, dropout, learning_rate,
hidden_size_char, hidden_size_word, num_layers):
"""
:param dim_word: 词的维度
:param dim_char: 字符维度
:param dropout: dropout
:param learning_rate: 学习率
:para... | flexible | {
"blob_id": "5d9c8e235385ff53c7510994826ff3a04e4a5888",
"index": 10,
"step-1": "<mask token>\n\n\nclass Model:\n\n def __init__(self, dim_word, dim_char, dropout, learning_rate,\n hidden_size_char, hidden_size_word, num_layers):\n \"\"\"\n :param dim_word: 词的维度\n :param dim_char: 字... | [
5,
8,
10,
11,
13
] |
#Week 5
#Task 1.1
a = 13
b = 14
calculation = a + 1 <=b
calculation2 = a + 1 >=b
calculation3 = a + 1 !=b
print (calculation)
print (calculation2)
print (calculation3)
#Task 1.2
myage = input("How old are you : ")
print ("Hi there, You are " +myage+ " years old")
#Task 1.3
num1 = input("Enter the first number : ")
num2... | normal | {
"blob_id": "03f73a55e0a0773bbdbb0d5e29a2db598ba2e080",
"index": 149,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(calculation)\nprint(calculation2)\nprint(calculation3)\n<mask token>\nprint('Hi there, You are ' + myage + ' years old')\n<mask token>\nprint('The result is ' + result)\nprint('avera... | [
0,
1,
2,
3
] |
# @Author: Chen yunsheng(Leo YS CHen)
# @Location: Taiwan
# @E-mail:leoyenschen@gmail.com
# @Date: 2017-02-14 00:11:27
# @Last Modified by: Chen yunsheng
import click
from qstrader import settings
from qstrader.compat import queue
from qstrader.price_parser import PriceParser
from qstrader.price_handler.yahoo_dai... | normal | {
"blob_id": "0cec92bbfad87020baf5ef1bd005e64bc9a6ed01",
"index": 5232,
"step-1": "<mask token>\n\n\ndef run(config, testing, tickers, filename):\n events_queue = queue.Queue()\n csv_dir = config.CSV_DATA_DIR\n initial_equity = PriceParser.parse(500000.0)\n price_handler = YahooDailyCsvBarPriceHandler... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
def click():
i = 0
cal = 0
info = ''
for x in EntryArr:
if not x.get():
messagebox.showinfo('Error', 'Campos no llenos')
return
else:
info += f'{Label[i]}\t{x.get()}' + '\n'
cal = 40
i += 1
if ... | flexible | {
"blob_id": "aeab80e2d0006ffa938366ef046d2ab3d387f88c",
"index": 1152,
"step-1": "<mask token>\n\n\ndef click():\n i = 0\n cal = 0\n info = ''\n for x in EntryArr:\n if not x.get():\n messagebox.showinfo('Error', 'Campos no llenos')\n return\n else:\n in... | [
3,
5,
6,
7,
8
] |
import numpy as np
from load_data import load_entity, load_candidates2, load_train_data
def predict_batch(test_data, model, batch_size=None):
result = model.predict(test_data, batch_size=batch_size)
return result
def predict_data(test_data, entity_path, model, predict_path, score_path, test_path, dataset):
... | normal | {
"blob_id": "a19616d448da057d5be0af841467a25baaacf5b3",
"index": 9299,
"step-1": "<mask token>\n\n\ndef predict_batch(test_data, model, batch_size=None):\n result = model.predict(test_data, batch_size=batch_size)\n return result\n\n\n<mask token>\n\n\ndef post_predict(test_path, score_path, entity_path, al... | [
2,
3,
4,
5,
6
] |
import urllib.request
username = ''
link = r'https://www.instagram.com/' + username
html = urllib.request.urlopen(link)
print(html.read()) | normal | {
"blob_id": "db93de33f537eeaf64ca8e2b2b79aba1f592305b",
"index": 5434,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(html.read())\n",
"step-3": "<mask token>\nusername = ''\nlink = 'https://www.instagram.com/' + username\nhtml = urllib.request.urlopen(link)\nprint(html.read())\n",
"step-4": "i... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class TestMark:
@pytest.mark.demo1
def test_case1(self):
print('testcase1')
@pytest.mark.demo1
def test_case2(self):
print('testcase1')
<|reserved_special_token_0|>
@pytest.mark.demo2
def test_case4(self):
print('testcase1')
<|reser... | flexible | {
"blob_id": "f49c15dca26d987e1d578790e077501a504e560b",
"index": 5814,
"step-1": "<mask token>\n\n\nclass TestMark:\n\n @pytest.mark.demo1\n def test_case1(self):\n print('testcase1')\n\n @pytest.mark.demo1\n def test_case2(self):\n print('testcase1')\n <mask token>\n\n @pytest.ma... | [
4,
5,
6,
7,
8
] |
<|reserved_special_token_0|>
class Parent2(ABC):
form = 'Parent2 Setup: %s'
class Child(Parent, Parent2):
def __init__(self, words):
self._words = self.form % words
super(Child, self).printing()
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
cl... | flexible | {
"blob_id": "9ba60270a4afcf242de53692afd8ebff7d9b37a7",
"index": 4361,
"step-1": "<mask token>\n\n\nclass Parent2(ABC):\n form = 'Parent2 Setup: %s'\n\n\nclass Child(Parent, Parent2):\n\n def __init__(self, words):\n self._words = self.form % words\n super(Child, self).printing()\n\n\n<mask t... | [
4,
6,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print('math.pow:', math.pow(num, power))
print('pow:', pow(num, power))
print('pow:', pow(num, power, 100))
print('fmod:', math.fmod(5, 3))
print('fmod:', math.fmod(-1e-100, 1e+100))
print('%:', -1e-100 % 1e+100)
print('exp:', mat... | flexible | {
"blob_id": "17db8f7a35004a1f2bd8d098aff39928d20511da",
"index": 7026,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('math.pow:', math.pow(num, power))\nprint('pow:', pow(num, power))\nprint('pow:', pow(num, power, 100))\nprint('fmod:', math.fmod(5, 3))\nprint('fmod:', math.fmod(-1e-100, 1e+100))\... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def _getAlbums(conn, smugmug, lock):
albums = smugmug.albums_get(Extras='LastUpdated')
for album in albums['Albums']:
myLogger.debug(album)
title = album['Title']
cat = None
catid = None
subCat = None
subCatid = None
try:
... | flexible | {
"blob_id": "e2e3b63deba20cd87fdfca81a9f67fa24891a1e0",
"index": 6416,
"step-1": "<mask token>\n\n\ndef _getAlbums(conn, smugmug, lock):\n albums = smugmug.albums_get(Extras='LastUpdated')\n for album in albums['Albums']:\n myLogger.debug(album)\n title = album['Title']\n cat = None\n ... | [
5,
6,
7,
8,
9
] |
import os
import time
import torch
from torch.utils.data import DataLoader
from torchvision.datasets import SVHN
from torchvision.transforms import ToTensor
from lib.utils import Logger, normal_logpdf, sumflat, print_model_info, tanh_to_uint8, get_optimizer
from lib.vae import VAE
def train(hp):
os.makedirs(hp.o... | normal | {
"blob_id": "43db8ed10face1c668aeadd3cbc5b13f87fb0126",
"index": 4997,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef train(hp):\n os.makedirs(hp.out_dir, exist_ok=True)\n device = torch.device('cuda' if hp.use_cuda else 'cpu')\n dataset = SVHN(root='svhn', split='train', download=True, ... | [
0,
1,
2,
3,
4
] |
class Queue:
def __init__(self):
self.head = None
self.tail = None
class Node:
def __init__(self, data):
self.data = data
self.next = None
def isEmpty(self):
return self.head is None
def peek(self):
return self.head.data if self.head i... | normal | {
"blob_id": "1aca1cf11d64374d0e0786e74c16567a4c5a1dec",
"index": 6452,
"step-1": "class Queue:\n\n def __init__(self):\n self.head = None\n self.tail = None\n\n\n class Node:\n\n def __init__(self, data):\n self.data = data\n self.next = None\n <mask token>\n\n... | [
3,
4,
5,
6,
7
] |
<|reserved_special_token_0|>
class Bus:
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def getOn_2(self, *names):
str_names = str(names)
str_names.strip('')
list_names = str_names.split(' ')
for i in list_names:
self.... | flexible | {
"blob_id": "1396509f65d194eeaefa3841e152b7078abf0032",
"index": 5549,
"step-1": "<mask token>\n\n\nclass Bus:\n <mask token>\n <mask token>\n <mask token>\n\n def getOn_2(self, *names):\n str_names = str(names)\n str_names.strip('')\n list_names = str_names.split(' ')\n f... | [
3,
6,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def checkRaiz():
a = int(input('Informe o primeiro coeficiente: '))
b = int(input('Informe o segundo coeficiente: '))
c = int(input('Informe o terceiro coeficiente: '))
delta = b * b - 4 * a * c
if delta < 0:
print('Não tem raiz re... | flexible | {
"blob_id": "603a73a7cc0487fcabb527ebc21d44cb95817ecb",
"index": 5909,
"step-1": "<mask token>\n",
"step-2": "def checkRaiz():\n a = int(input('Informe o primeiro coeficiente: '))\n b = int(input('Informe o segundo coeficiente: '))\n c = int(input('Informe o terceiro coeficiente: '))\n delta = b * ... | [
0,
1,
2,
3
] |
__author__ = 'Administrator'
#coding:utf-8
def calculate_score(calculation_params):
"""
计算选手在一跳中的得分,共7名裁判,去掉两个最高分和两个最低分,余下3名裁判员的分数之和乘以运动员所跳动作的难度系数,便得出该动作的实得分
传入参数为字典
calculation_params["score_list"] = []
calculation_params["difficulty"] = float
"""
score_list = calculation_params["score_list... | normal | {
"blob_id": "52872804a069cd954bea247b64041eceafd8d139",
"index": 7673,
"step-1": "__author__ = 'Administrator'\n#coding:utf-8\ndef calculate_score(calculation_params):\n \"\"\"\n 计算选手在一跳中的得分,共7名裁判,去掉两个最高分和两个最低分,余下3名裁判员的分数之和乘以运动员所跳动作的难度系数,便得出该动作的实得分\n 传入参数为字典\n calculation_params[\"score_list\"] = []\... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def parse(url):
try:
parsed_url_components = url.split('//')
sublevel_split = parsed_url_components[1].split('/', 1)
domain = sublevel_split[0].replace('www.', '')
return domain
except Ind... | flexible | {
"blob_id": "c74fc99bf8582fd83c312f27dfffbe894a2c8c1b",
"index": 3431,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef parse(url):\n try:\n parsed_url_components = url.split('//')\n sublevel_split = parsed_url_components[1].split('/', 1)\n domain = sublevel_split[0].replace... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
MONITOR = odict({'oxygen': {'name': 'O2 Concentration', 'units': '%',
'abs_range': (0, 100), 'safe_range': (60, 100), 'decimals': 1},
'temperature': {'name': 'Temperature', 'units': '°C', 'abs_range': (0,
50), 'safe_r... | flexible | {
"blob_id": "941dac77fe60081ffa113c437a356d59837f5883",
"index": 5304,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nMONITOR = odict({'oxygen': {'name': 'O2 Concentration', 'units': '%',\n 'abs_range': (0, 100), 'safe_range': (60, 100), 'decimals': 1},\n 'temperature': {'name': 'Temperature', 'uni... | [
0,
1,
2,
3
] |
import time as t
class Record:
def __init__(self, value=10, name='name'):
self.id = name
self.value = value
def __get__(self, instance, owner):
with open('record.txt', 'a') as f:
msg = '读取变量%s ' % self.id
tmp = t.localtime()[:6]
form = ['年', '月', ... | normal | {
"blob_id": "3e1540a06c478d471f6e6a190cadc44d5c4c2467",
"index": 665,
"step-1": "<mask token>\n\n\nclass Record:\n\n def __init__(self, value=10, name='name'):\n self.id = name\n self.value = value\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass Record:\n\n def __... | [
2,
3,
4,
5
] |
<|reserved_special_token_0|>
@login_required(login_url='user_login')
def countries_add(request):
if request.method == 'POST':
form = CountryForm(request.POST or None)
if form.is_valid():
form.save()
messages.success(request,
'the country has been added succe... | flexible | {
"blob_id": "8640de519ebf7f95588ac40b55662da85ffc926e",
"index": 5224,
"step-1": "<mask token>\n\n\n@login_required(login_url='user_login')\ndef countries_add(request):\n if request.method == 'POST':\n form = CountryForm(request.POST or None)\n if form.is_valid():\n form.save()\n ... | [
2,
4,
5,
6,
7
] |
import pickle
from generation_code import serial_filename
import serial_output_code
import numpy as np
from shutil import copyfile
from os import remove
# This file is only temporary, mostly to be used when updating the
# reference output from a regression test, to ensure that, in all
# aspects that are in common with... | normal | {
"blob_id": "6acb253189798c22d47feb3d61ac68a1851d22ba",
"index": 1619,
"step-1": "<mask token>\n",
"step-2": "<mask token>\ntry:\n copyfile(serial_filename(), temp_filename)\n serial_output_code.serial_output_code()\n with open(serial_filename(), 'rb') as f:\n qmc_out = pickle.load(f)\n with... | [
0,
1,
2,
3,
4
] |
import sys
import json
with open(__file__.replace('.py', '.txt')) as f:
problem = f.read()
data = {
'problem': problem,
'example': """COM)B
B)C
C)D
D)E
E)F
B)G
G)H
D)I
E)J
J)K
K)L""" # should give 42
}
def solve_problem(input):
parents = {}
for i, line in enumerate(input.split('\n')):
... | normal | {
"blob_id": "e57680c9bd09866e68ade0cfea7ce83cd6d50f58",
"index": 1596,
"step-1": "<mask token>\n\n\ndef solve_problem(input):\n parents = {}\n for i, line in enumerate(input.split('\\n')):\n about, object = line.split(')')\n parents[object] = about\n orbit_counts = {'COM': 0}\n for obje... | [
3,
4,
5,
6,
7
] |
# 斐波那契数列(后一位=前两位之和)
# 又叫黄金分割数列,前/后 越来越接近0.618
# list1 = []
# for i in range(20):
# if i <= 1:
# list1.append(1)
# else:
# list1.append(list1[-2]+list1[-1])
# print(list1)
import random
dict1 = {'A': [], 'B': [], 'C': [], 'D': []}
for i in range(20):
re = random.randint(1, 100)
if re >=... | normal | {
"blob_id": "4a223cdd3c957af2f54e33c910ce70d2b5e6c963",
"index": 7705,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor i in range(20):\n re = random.randint(1, 100)\n if re >= 90:\n dict1['A'].append(re)\n elif re >= 80:\n dict1['B'].append(re)\nprint(dict1)\n",
"step-3": "<ma... | [
0,
1,
2,
3,
4
] |
import cv2
import numpy as np
frameWidth = 640
frameHeight = 480
# capturing Video from Webcam
cap = cv2.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
cap.set(10, 150)
myColors = [[20,40,40,70,255,255],
[100,169,121,135,255,255],
[0, 90, 90, 41, 255, 255]]
color_value = [[25... | normal | {
"blob_id": "836c1d2083d18c68fe551278d2df4155edc64c8c",
"index": 5298,
"step-1": "<mask token>\n\n\ndef find_color(img, color_value, myColors):\n hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)\n count = 0\n new_points = []\n for color in myColors:\n lower = np.array(color[0:3])\n upper = np... | [
3,
4,
5,
6,
7
] |
from Bio import BiopythonWarning, SeqIO
from Bio.PDB import MMCIFParser, Dice, PDBParser
from Bio.SeqUtils import seq1
import time
import requests
import re
import warnings
warnings.simplefilter('ignore', BiopythonWarning)
def get_response(url):
response = requests.get(url)
cnt = 20
while cnt != 0:
... | normal | {
"blob_id": "ad5cdcfd9d7a3c07abcdcb701422f3c0fdc2b374",
"index": 8860,
"step-1": "<mask token>\n\n\nclass Cif:\n\n def get_chain(self):\n return [chain for chain in list(self.structure.get_models())[0] if \n chain.get_id() == self.chain_id][0]\n\n def get_seq_from_pdb(self):\n seq_... | [
4,
6,
7,
9,
10
] |
__author__ = 'Vicio'
from Conexion.conexion import Conexion
class ConexionList():
def __init__(self):
self.conexion = Conexion()
def selectClientes(self):
pass
def selectProveedores(self):
pass
| normal | {
"blob_id": "6b4af452778bdf13ac18e8d260cf1c9176ca95e0",
"index": 8414,
"step-1": "<mask token>\n\n\nclass ConexionList:\n <mask token>\n\n def selectClientes(self):\n pass\n\n def selectProveedores(self):\n pass\n",
"step-2": "<mask token>\n\n\nclass ConexionList:\n\n def __init__(sel... | [
3,
4,
5,
6,
7
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
urlpatterns = patterns('', url('appmanagement', views.appmanagement, name=
'appmanagement'), url('^.*', views.index, name='index'))
<|reserved_special_token_1|>
from django.conf.urls import patterns, url
from riskDashboard2... | flexible | {
"blob_id": "3372d98ff91d90558a87293d4032820b1662d60b",
"index": 298,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nurlpatterns = patterns('', url('appmanagement', views.appmanagement, name=\n 'appmanagement'), url('^.*', views.index, name='index'))\n",
"step-3": "from django.conf.urls import patte... | [
0,
1,
2,
3
] |
class Enumerator(object):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def __next__(self):
return next(self.iterator)
<|reserved_special_token_0|>
def __iter__(self):
return self
<|reserved_special_token_1|>
class Enumerator(object):
<|reserved_special_token_0|>... | flexible | {
"blob_id": "1ca20b0cd9217623ff039ab352acd09df8dfae1b",
"index": 8235,
"step-1": "class Enumerator(object):\n <mask token>\n <mask token>\n\n def __next__(self):\n return next(self.iterator)\n <mask token>\n\n def __iter__(self):\n return self\n",
"step-2": "class Enumerator(object... | [
3,
4,
5,
6,
7
] |
s=input()
count=0
while(len(s)!=1):
count+=1
a=0
for i in range(len(s)):
a+=int(s[i])
s=str(a)
print(count)
| normal | {
"blob_id": "638e21e1eb1e2e14244628260d9c7ac179983721",
"index": 2541,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwhile len(s) != 1:\n count += 1\n a = 0\n for i in range(len(s)):\n a += int(s[i])\n s = str(a)\nprint(count)\n",
"step-3": "s = input()\ncount = 0\nwhile len(s) != 1... | [
0,
1,
2,
3
] |
from __future__ import print_function
import os
import re
import xml.etree.ElementTree as ET
def read_vivado_report(hls_dir, full_report=False):
if not os.path.exists(hls_dir):
print('Path {} does not exist. Exiting.'.format(hls_dir))
return
prj_dir = None
top_func_name = None
if os.p... | normal | {
"blob_id": "7d173b0571c20dc8fcae884451e8f69ba3a05763",
"index": 8087,
"step-1": "<mask token>\n\n\ndef read_vivado_report(hls_dir, full_report=False):\n if not os.path.exists(hls_dir):\n print('Path {} does not exist. Exiting.'.format(hls_dir))\n return\n prj_dir = None\n top_func_name = ... | [
4,
5,
6,
7,
8
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
columns = ['account', 'name', 'Death', 'archetype', 'profession', 'elite',
'phases.All.actual_boss.dps', 'phases.All.actual.dps',
'phases.All.actual_boss.flanking', 'phases.All.actual_boss.scholar',
'phases.All.actual_boss.condi_dps', 'phases.All.... | flexible | {
"blob_id": "fa948838b5c2d688fe8c748166f23ffc8e677f93",
"index": 9265,
"step-1": "<mask token>\n",
"step-2": "columns = ['account', 'name', 'Death', 'archetype', 'profession', 'elite',\n 'phases.All.actual_boss.dps', 'phases.All.actual.dps',\n 'phases.All.actual_boss.flanking', 'phases.All.actual_boss.sc... | [
0,
1
] |
<|reserved_special_token_0|>
@app.route('/')
def index():
return render_template('index.html')
@app.route('/survey', methods=['POST', 'GET'])
def survey():
if request.method == 'GET':
return render_template('survey.html')
if request.method == 'POST':
is_oversea = request.form['oversea']
... | flexible | {
"blob_id": "74aa93bf3731d4e3ddb920bedc7daced50b4f2c3",
"index": 1565,
"step-1": "<mask token>\n\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\n\n@app.route('/survey', methods=['POST', 'GET'])\ndef survey():\n if request.method == 'GET':\n return render_template('survey.h... | [
2,
4,
5,
6,
7
] |
from requests import get
from bs4 import BeautifulSoup, SoupStrainer
import httplib2
import re
from win32printing import Printer
def getLinks(url):
links = []
document = BeautifulSoup(response, "html.parser")
for element in document.findAll('a', href=re.compile(".pdf$")):
links.append(element.get(... | normal | {
"blob_id": "dbb007af79b2da2b5474281759c2bcce2a836fb5",
"index": 1254,
"step-1": "<mask token>\n\n\ndef getLinks(url):\n links = []\n document = BeautifulSoup(response, 'html.parser')\n for element in document.findAll('a', href=re.compile('.pdf$')):\n links.append(element.get('href'))\n return... | [
1,
2,
3,
4,
5
] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
from collections import defaultdict
from docopt import docopt
__doc__ = """{f}
Usage:
{f} <used_file>
{f} -h | --help
Options:
-h --help Show this screen and exit.
""".format(f=__file__)
args = docopt(__doc__)
used_file = args['<used_file>']
... | normal | {
"blob_id": "40b6d62f1e360c0df19b7e98fcb67dbd578e709f",
"index": 736,
"step-1": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport csv\nfrom collections import defaultdict\nfrom docopt import docopt\n\n__doc__ = \"\"\"{f}\n\nUsage:\n {f} <used_file>\n {f} -h | --help\n\nOptions:\n -h --help Sh... | [
0
] |
#! /usr/bin/python
# Project Euler problem 21
"""Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a != b, then a and b are an amicable pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 ... | normal | {
"blob_id": "2ee5991e2b6de6ee48c8207f2b78574fc8a02fc0",
"index": 2432,
"step-1": "#! /usr/bin/python\n\n# Project Euler problem 21\n\n\"\"\"Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).\nIf d(a) = b and d(b) = a, where a != b, then a and b are an amicabl... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for row in range(0, 7):
for col in range(0, 7):
if col == 0 and (row != 0 and row != 6) or (row == 0 or row == 6) and (
col > 0 and col < 6) or (row == 1 or row == 5 or row == 4
) and col == 6 o... | flexible | {
"blob_id": "e598091fc6c05b1d7f9f35f2ae58494fed53f9af",
"index": 5392,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor row in range(0, 7):\n for col in range(0, 7):\n if col == 0 and (row != 0 and row != 6) or (row == 0 or row == 6) and (\n col > 0 and col < 6) or (row == 1 or row... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
alphabet = ' ' + string.ascii_lowercase
<|reserved_special_token_1|>
import string
alphabet = ' ' + string.ascii_lowercase
<|reserved_special_token_1|>
# Let's look at the lowercase letters.
import string
alphabet = " " + st... | flexible | {
"blob_id": "da3be0d3b815e11d292a7c7e8f5ce32b35580f98",
"index": 1016,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nalphabet = ' ' + string.ascii_lowercase\n",
"step-3": "import string\nalphabet = ' ' + string.ascii_lowercase\n",
"step-4": "# Let's look at the lowercase letters.\nimport string\nalp... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
def _callbacks_loader(r: Registry):
from catalyst_rl.dl import callbacks as m
r.add_from_module(m)
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def _callbacks_loader(r: Registry):
from catalyst_rl.dl import callbacks as m
r.... | flexible | {
"blob_id": "09d13fe6b090850782feb601412cf135d497136f",
"index": 6206,
"step-1": "<mask token>\n\n\ndef _callbacks_loader(r: Registry):\n from catalyst_rl.dl import callbacks as m\n r.add_from_module(m)\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\ndef _callbacks_loader(r: Registry):\n from catal... | [
1,
2,
3,
4,
5
] |
class Violation(object):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
class Violation(object):
def __init__(self, line, column, code, message):
self.line = line
self.column = column
self.code = code
... | flexible | {
"blob_id": "c513ad6ef12ae7be5d17d8d44787691cbc065207",
"index": 9989,
"step-1": "class Violation(object):\n <mask token>\n <mask token>\n <mask token>\n",
"step-2": "class Violation(object):\n\n def __init__(self, line, column, code, message):\n self.line = line\n self.column = colum... | [
1,
2,
3,
4
] |
from redis_interval.client import RedisInterval
class TestRedisIntervalIADD(object):
""" Tests the IADD command """
@classmethod
def setup_class(cls):
cls.redis = RedisInterval(host="localhost")
def test_add_simple_text(self):
""" Add simple text inside an interval """
value ... | normal | {
"blob_id": "0e7732ffcada864fb83b59625c5b9abb01150aaa",
"index": 1702,
"step-1": "<mask token>\n\n\nclass TestRedisIntervalIADD(object):\n <mask token>\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass TestRedisIntervalIADD(object):\n <mask token>\n\n @classmethod\n def set... | [
1,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
<|reserved_special_token_0|>
print('Cursor Type : ', type(c))
c.execute(
'CREATE TABLE IF NOT EXISTS users(id INTEGER PRIMARY KEY, username text, ema... | flexible | {
"blob_id": "b066ab81eccee538eb3f85b49a3e46c00a947428",
"index": 6154,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nsys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))\n<mask token>\nprint('Cursor Type : ', type(c))\nc.execute(\n 'CREATE TABLE IF NOT EXISTS users(id INTEGER ... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class Context:
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Context:
def __init__(self, function_name, function_version):
self.function_name = function_name
self.function_version... | flexible | {
"blob_id": "1c685514f53a320226402a4e4d8f3b3187fad615",
"index": 7814,
"step-1": "<mask token>\n\n\nclass Context:\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass Context:\n\n def __init__(self, function_name, function_version):\n self.function_name = function_name\n ... | [
1,
2,
3,
4,
5
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.