code stringlengths 13 6.09M | order_type stringclasses 2
values | original_example dict | step_ids listlengths 1 5 |
|---|---|---|---|
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
dependencies = [(... | flexible | {
"blob_id": "85c2a4163a3132794186b95b4068f6c6e1104828",
"index": 1306,
"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 = [('cms', '0020... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def get_similarity(word1, word2):
"""
Returns a similarity score between two words
"""
tok1 = cache.get(word1, nlp(word1))
tok2 = cache.get(word2, nlp(word2))
return tok1.similarity(tok2)
<|reserved_special_token_0|>
def get_closest_words(word, choices, n=1):
... | flexible | {
"blob_id": "8f854f4f2c807f988945af4dc53dba93cfb31168",
"index": 9441,
"step-1": "<mask token>\n\n\ndef get_similarity(word1, word2):\n \"\"\"\n Returns a similarity score between two words\n \"\"\"\n tok1 = cache.get(word1, nlp(word1))\n tok2 = cache.get(word2, nlp(word2))\n return tok1.simila... | [
3,
5,
6,
7,
8
] |
import itertools
import numpy as np
SAMPLER_CACHE = 10000
def cache_gen(source):
values = source()
while True:
for value in values:
yield value
values = source()
class Sampler:
"""Provides precomputed random samples of various distribution."""
randn_gen = cache_gen(lambda... | normal | {
"blob_id": "ddeff852e41b79fb71cea1e4dc71248ddef85d79",
"index": 7033,
"step-1": "<mask token>\n\n\nclass Sampler:\n <mask token>\n <mask token>\n <mask token>\n\n @classmethod\n def standard_normal(cls, size=1):\n return list(itertools.islice(cls.randn_gen, size))\n\n @classmethod\n ... | [
4,
7,
9,
10
] |
def encrypt(key,plaintext):
ciphertext=""
for i in plaintext:
if i.isalpha():
alphabet = ord(i)+key
if alphabet > ord("Z"):
alphabet -= 26
letter = chr(alphabet)
ciphertext+=letter
return ciphertext
def decrypt(key,ciphertext):
plaintext=""
for i i... | normal | {
"blob_id": "ac31cba94ee8ff7a2903a675954c937c567b5a56",
"index": 6739,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef decrypt(key, ciphertext):\n plaintext = ''\n for i in ciphertext:\n if i.isalpha():\n alphabet = ord(i) - key\n if alphabet < ord('A'):\n ... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class Net(nn.Module):
def __init__(self, input_size, hidden_size=40, num_classes=10,
bidirectional=False):
super().__init__()
self.encoder = RNN(input_size, hidden_size, bidirectional=bidirectional
)
out_size = hidden_size if not bidirectio... | flexible | {
"blob_id": "d8a09f9952856da69120fae6221636dd5bd8c93e",
"index": 3567,
"step-1": "<mask token>\n\n\nclass Net(nn.Module):\n\n def __init__(self, input_size, hidden_size=40, num_classes=10,\n bidirectional=False):\n super().__init__()\n self.encoder = RNN(input_size, hidden_size, bidirecti... | [
4,
5,
6,
7,
9
] |
from botocore_eb.model import ServiceModel
from botocore_eb.exceptions import ParamValidationError
from botocore_eb.exceptions import DataNotFoundError
from botocore_eb.exceptions import OperationNotPageableError
from botocore_eb import xform_name
from botocore_eb.paginate import Paginator
import botocore_eb.validate
i... | normal | {
"blob_id": "829c833866198307d7d19c4a0cbe40299ee14eb9",
"index": 5288,
"step-1": "<mask token>\n\n\nclass ClientCreator(object):\n <mask token>\n\n def __init__(self, loader, endpoint_creator):\n self._loader = loader\n self._endpoint_creator = endpoint_creator\n\n def create_client(self, ... | [
6,
8,
15,
16,
18
] |
import cv2
import numpy as np
img = cv2.imread('data/j.png', cv2.IMREAD_GRAYSCALE)
kernel = cv2.getStructuringElement(cv2.MORPH_CROSS, (7, 7))
erode = cv2.erode(img, kernel)
contorno = img - erode
cv2.imshow('Original', img)
cv2.imshow('Contorno', contorno)
cv2.waitKey()
cv2.destroyAllWindows()
| normal | {
"blob_id": "809c9ce2b017612bedd1eb889c2b017275ee8b6f",
"index": 1729,
"step-1": "<mask token>\n",
"step-2": "<mask token>\ncv2.imshow('Original', img)\ncv2.imshow('Contorno', contorno)\ncv2.waitKey()\ncv2.destroyAllWindows()\n",
"step-3": "<mask token>\nimg = cv2.imread('data/j.png', cv2.IMREAD_GRAYSCALE)\n... | [
0,
1,
2,
3
] |
import requests
import datetime
import collections
import csv
import sys
import os
import os.path
History = collections.namedtuple('History', ['open', 'high', 'low', 'close', 'volume', 'adjustment'])
def history(symbol, since, until):
response = requests.get('http://ichart.finance.yahoo.com/table.csv?s=%s&d=%d&e... | normal | {
"blob_id": "1cccb37a7195b1555513a32ef33b35b0edcd5eb1",
"index": 5363,
"step-1": "import requests\nimport datetime\nimport collections\nimport csv\nimport sys\nimport os\nimport os.path\n\n\nHistory = collections.namedtuple('History', ['open', 'high', 'low', 'close', 'volume', 'adjustment'])\n\ndef history(symbo... | [
0
] |
from population import Population
class REvolution:
def __init__(self, original_ind, combine_params, mutate_params, fitness, pop_params, method):
self.population = Population(1, fitness, pop_params)
self.combine_params = combine_params
self.mutate_params = mutate_params
self.fitnes... | normal | {
"blob_id": "fe13b57484e0f0796164fda99c0d759238a67153",
"index": 7215,
"step-1": "<mask token>\n\n\nclass REvolution:\n <mask token>\n <mask token>\n <mask token>\n\n def get_pop(self):\n ids = ['x: {} => y: {}'.format('%.3f' % i.value[0], '%.3f' % self.\n fitness(i.value)) for i in... | [
2,
4,
5,
6,
7
] |
#!/usr/bin/env python
#
# This will take a snapshot and convert it into a volume. To create a volume
# without any links to the old snapshot you need to convert it to a temporary
# volume first, convert that into an image and convert the image back into
# your final volume. Once this is all done, the temporary volume a... | normal | {
"blob_id": "aebe749a20482636d7ed508f9cbd9cde56656b73",
"index": 6236,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef main(args):\n openstack.enable_logging(debug=False)\n api = openstack.connect(cloud=args.cloud)\n snapshot_id = args.snapshot\n server = args.volume\n try:\n ... | [
0,
1,
2,
3,
4
] |
def Merge (left,right,merged):
#Ф-ция объединения и сравнения элементов массивов
left_cursor,right_cursor=0,0
while left_cursor<len(left) and right_cursor<len(right):
if left[left_cursor]<=right[right_cursor]:
merged[left_cursor+right_cursor]=left[left_cursor]
left_cursor+=1... | normal | {
"blob_id": "c64c542b57107c06de2ce0751075a81fcb195b61",
"index": 4293,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef MergeSort(array):\n if len(array) <= 1:\n return array\n mid = len(array) // 2\n left, right = MergeSort(array[:mid]), MergeSort(array[mid:])\n return Merge(lef... | [
0,
1,
2,
3
] |
# coding: utf-8
"""
Adobe Experience Manager OSGI config (AEM) API
Swagger AEM OSGI is an OpenAPI specification for Adobe Experience Manager (AEM) OSGI Configurations API # noqa: E501
OpenAPI spec version: 1.0.0-pre.0
Contact: opensource@shinesolutions.com
Generated by: https://openapi-generator... | normal | {
"blob_id": "0ddac0aac5bd001504ed37d31b74c6442304e350",
"index": 5729,
"step-1": "<mask token>\n\n\nclass OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties(\n object):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask... | [
12,
18,
19,
22,
25
] |
from pytorch_lightning.callbacks import Callback
from evaluation.validator import Validator
class LSTMCallback(Callback):
def on_test_end(self, trainer, pl_module):
f = open('/evaluation.log', 'w')
for ev in pl_module.evaluation_data:
f.write(ev + '\n')
Validator(pl_module.eva... | normal | {
"blob_id": "42743ee2a812d8fe6fc036ba97daaff5be35564d",
"index": 4618,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass LSTMCallback(Callback):\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass LSTMCallback(Callback):\n\n def on_test_end(self, trainer, pl_module):\n f = open('/... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class StoryForm(ModelForm):
class Meta:
model = NewsStory
fields = ['title', 'pub_date', 'content']
widgets = {'pub_date': forms.DateInput(format='%m/%d/%Y', attrs={
'class': 'form-contr... | flexible | {
"blob_id": "47a5ddcea2f6d8ce80793192d26c98ccc0e0340d",
"index": 1771,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass StoryForm(ModelForm):\n\n\n class Meta:\n model = NewsStory\n fields = ['title', 'pub_date', 'content']\n widgets = {'pub_date': forms.DateInput(format='... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
def measure_creation():
random.shuffle(TYPES)
for type_ in TYPES:
pre = 'from __main__ import {}, a, b, c'.format(type_.__name__)
body = '{}(a, b, c)'.format(type_.__name__)
print('\t', type_.__name__, timeit.repeat(stmt=body, setup=pre,
repeat=... | flexible | {
"blob_id": "ba73562cd8ffa52a1fede35c3325e7e76a6dad54",
"index": 7966,
"step-1": "<mask token>\n\n\ndef measure_creation():\n random.shuffle(TYPES)\n for type_ in TYPES:\n pre = 'from __main__ import {}, a, b, c'.format(type_.__name__)\n body = '{}(a, b, c)'.format(type_.__name__)\n pr... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class PyrpgConfig(AppConfig):
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class PyrpgConfig(AppConfig):
name = 'PyRPG'
<|reserved_special_token_1|>
from django.apps impo... | flexible | {
"blob_id": "f8bf7e2d8f06bbd00f04047153833c07bf483fd3",
"index": 259,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass PyrpgConfig(AppConfig):\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass PyrpgConfig(AppConfig):\n name = 'PyRPG'\n",
"step-4": "from django.apps import AppConfig\... | [
0,
1,
2,
3
] |
def main():
piso = largura * comprimento
volume_sala = largura * comprimento * altura
area = 2 * altura * largura + 2 * altura * comprimento
print(piso)
print(volume_sala)
print(area)
altura = float(input(""))
largura = float(input(""))
comprimento = float(input(""))
if __name__ == '__main__':... | normal | {
"blob_id": "d78fd8ebf9ef55700a25a9ce96d9094f1bfa564e",
"index": 6455,
"step-1": "<mask token>\n",
"step-2": "def main():\n piso = largura * comprimento\n volume_sala = largura * comprimento * altura\n area = 2 * altura * largura + 2 * altura * comprimento\n print(piso)\n print(volume_sala)\n ... | [
0,
1,
2,
3,
4
] |
from django.db import models
from django.contrib.auth.models import User
from Event.models import Event
from University.models import University
from django.core.validators import validate_email
class Person(models.Model):
user = models.ForeignKey(User, related_name='person', on_delete=models.
CASCADE, bl... | normal | {
"blob_id": "28f4f14c3c29ee96c370ffe71c268549552b915e",
"index": 2419,
"step-1": "<mask token>\n\n\nclass PersonTemporaryCode(models.Model):\n person = models.ForeignKey(Person, on_delete=models.CASCADE)\n code = models.IntegerField()\n expiration_date = models.DateTimeField()\n\n def __str__(self):\... | [
3,
4,
6,
7
] |
import os
import re
import time
import numpy as np
import pandas as pd
from sklearn.cluster import AgglomerativeClustering
import math
import edlib
from progress.bar import IncrementalBar as Bar
from multiprocessing import Pool
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--pools",
... | normal | {
"blob_id": "7ae328bcfdec2d17fceb5d707f13cf495fde4469",
"index": 7490,
"step-1": "<mask token>\n\n\nclass AlignmentProfile:\n\n def __init__(self, width, df, identifier):\n self.ident = identifier\n self.profile = np.zeros((5, width))\n self.repre_sq = ''\n self.seq_alignments = No... | [
5,
7,
8,
9,
11
] |
<|reserved_special_token_0|>
class Window:
def __init__(self, world, xyw_min=None, xyw_max=None):
self.world = world
if xyw_min is None or xyw_max is None:
self.xyw_min = -100, -100
self.xyw_max = 100, 100
else:
if not isinstance(xyw_min, tuple) or len(... | flexible | {
"blob_id": "deb0cd745eae97a6dbabdfab37e1c6d75e5372f0",
"index": 8422,
"step-1": "<mask token>\n\n\nclass Window:\n\n def __init__(self, world, xyw_min=None, xyw_max=None):\n self.world = world\n if xyw_min is None or xyw_max is None:\n self.xyw_min = -100, -100\n self.xyw_... | [
15,
16,
18,
20,
22
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(type(df))
print('\n')
print(df)
<|reserved_special_token_1|>
<|reserved_special_token_0|>
dict_data = {'c0': [1, 2, 3], 'c1': [4, 5, 6], 'c2': [7, 8, 9], 'c3': [10,
11, 12], 'c4': [13, 14, 15]}
df = pd.DataFrame(dict... | flexible | {
"blob_id": "22f4ae755e7ea43604db39452ca80f44f540708a",
"index": 9503,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(type(df))\nprint('\\n')\nprint(df)\n",
"step-3": "<mask token>\ndict_data = {'c0': [1, 2, 3], 'c1': [4, 5, 6], 'c2': [7, 8, 9], 'c3': [10, \n 11, 12], 'c4': [13, 14, 15]}\ndf =... | [
0,
1,
2,
3,
4
] |
def describe():
desc = """
Problem : Given a string, find the length of the longest substring in it with no more than K distinct characters.
For example :
Input: String="araaci", K=2
Output: 4
Explanation: The longest substring with no more than '2' distinct characters is "araa", where the distinct char... | normal | {
"blob_id": "1a730f4a5fa2be434af41a3e320cab8338d93644",
"index": 5050,
"step-1": "<mask token>\n\n\ndef main():\n describe()\n str = 'araaci'\n k = 2\n res = find_substr_with_distinct_chars(str, k)\n print('Input', str, k)\n print('Longest substring with k distinct chars is : ', res)\n print... | [
1,
2,
3,
4,
5
] |
"""
This is the hourly animation program. It displays a series of images across the board.
It is hard coded to work with the Sonic images. Adjustments would need to be made to
the y values which are distance traveled. Change sonicFrame < 8 value to the total
number of frames the new animation has.
"""
from runImages im... | normal | {
"blob_id": "ede675c971ed233e93c14aa4d2ffb66fe7ba775a",
"index": 5613,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef animationDisplay():\n matrix.Clear()\n sonicRun = 0\n sonicFrame = 0\n y = 0\n while y < 70:\n sonicFrame = 0\n if sonicRun >= 100:\n sonic... | [
0,
1,
2,
3
] |
from django.shortcuts import render,get_object_or_404, redirect
from django.contrib import admin #어드민 쓸꺼면 써야됨
from .models import Blog #앱을 가지고 오겠다는거
from django.utils import timezone
admin.site.register(Blog) #블로그 형식을 가져와 등록하겠다.
# Create your views here.
def home(request):
blogs = Blog.objects
return render(reque... | normal | {
"blob_id": "bc25338612f525f616fb26c64d8b36667d297d40",
"index": 3921,
"step-1": "<mask token>\n\n\ndef home(request):\n blogs = Blog.objects\n return render(request, 'home.html', {'blogs': blogs})\n\n\ndef detail(request, blog_id):\n blog_detail = get_object_or_404(Blog, pk=blog_id)\n return render(... | [
3,
4,
5,
6,
7
] |
<|reserved_special_token_0|>
def clusterVacio():
arreAux = []
busca = 1
bandera = True
for i in range(len(clusters)):
clu = clusters[i]
arreAux.append(int(clu[0]))
print(arreAux)
while bandera:
if busca in arreAux:
busca = busca + 1
else:
... | flexible | {
"blob_id": "da69fd937153fe2112b9f64411882527274247ef",
"index": 1878,
"step-1": "<mask token>\n\n\ndef clusterVacio():\n arreAux = []\n busca = 1\n bandera = True\n for i in range(len(clusters)):\n clu = clusters[i]\n arreAux.append(int(clu[0]))\n print(arreAux)\n while bandera:\... | [
8,
9,
10,
12,
13
] |
frase = "todos somos promgramadores"
palabras = frase.split()
for p in palabras:
print(palabras[p])
#if p[-2] == "o":
| normal | {
"blob_id": "00c57e7e26a3181ab23697a25257aca479d9ee05",
"index": 5755,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor p in palabras:\n print(palabras[p])\n",
"step-3": "frase = 'todos somos promgramadores'\npalabras = frase.split()\nfor p in palabras:\n print(palabras[p])\n",
"step-4": "fra... | [
0,
1,
2,
3
] |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 22 19:29:50 2017
@author: marcos
"""
from sklearn.cluster import KMeans
from sklearn.utils import shuffle
from classes.imagem import Imagem
import numpy as np
def mudaCor(img, metodo='average', nTons=256):
nova = Imagem((img.altura, img.largura))
for x in rang... | normal | {
"blob_id": "1f7007fcea490a8b28bd72163f99b32e81308878",
"index": 4834,
"step-1": "<mask token>\n\n\ndef balanco(img, ar, ag, ab):\n nova = Imagem((img.altura, img.largura))\n for y in range(img.altura):\n for x in range(img.largura):\n r, g, b = img[y][x]\n R = int(ar * r)\n ... | [
4,
5,
6,
7,
8
] |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 9 18:52:17 2021
@author: lewis
"""
import csv
import pandas as pd
import re
import statistics
import matplotlib.pyplot as plt
import numpy as np
from bs4 import BeautifulSoup
from urllib.request import urlopen
#Creating a function that groups by, co... | normal | {
"blob_id": "30b07e57737ac29643769c4773591199b2ba8656",
"index": 2184,
"step-1": "<mask token>\n\n\ndef groupby_count(df, groupby_column, count_column):\n new_df = pd.DataFrame(df.groupby(groupby_column)[count_column].count())\n new_df.columns = ['count']\n new_df[groupby_column] = new_df.index.get_leve... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
username = 'lucychibukhchyan'
api_key = 'sjbEMjfNrrglXY4zCFufIw9IPlZ3SA'
client = TextmagicRestClient(username, api_key)
message = client.message.create(phones='7206337812', text=
'wow i sent a text from python!!!!')
<|reser... | flexible | {
"blob_id": "1ba39cfc1187b0efc7fc7e905a15de8dc7f80e0d",
"index": 8888,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nusername = 'lucychibukhchyan'\napi_key = 'sjbEMjfNrrglXY4zCFufIw9IPlZ3SA'\nclient = TextmagicRestClient(username, api_key)\nmessage = client.message.create(phones='7206337812', text=\n ... | [
0,
1,
2,
3
] |
#############################################################################
## Crytek Source File
## Copyright (C) 2013, Crytek Studios
##
## Creator: Christopher Bolte
## Date: Oct 31, 2013
## Description: WAF based build system
#############################################################################
from wafl... | normal | {
"blob_id": "5848273a76995825f01df53d6beed534e6f9f9fe",
"index": 8730,
"step-1": "<mask token>\n\n\n@conf\ndef load_debug_linux_x64_settings(conf):\n \"\"\"\n\tSetup all compiler and linker settings shared over all linux_x64 configurations for\n\tthe 'debug' configuration\n\t\"\"\"\n v = conf.env\n load... | [
3,
4,
5,
6,
7
] |
import os
import sys
import pandas as pd
import pickle as pkl
from src.utils import image as im
if __name__ == '__main__':
pickled = True
create_sets = True
normed = False
if len(sys.argv) > 2:
filename = sys.argv[1]
else:
filename = os.path.join(os.path.pardir, os.path.pardir, 'data... | normal | {
"blob_id": "18a17c7326a6ae96f74c843d1a902074b377a6d2",
"index": 2701,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nif __name__ == '__main__':\n pickled = True\n create_sets = True\n normed = False\n if len(sys.argv) > 2:\n filename = sys.argv[1]\n else:\n filename = os.pat... | [
0,
1,
2
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def run():
contact_book = ContactBook()
with open('22_agenda/contactos.csv', 'r') as f:
reader = csv.reader(f)
for idx, row in enumerate(reader):
if idx == 0:
continue
... | flexible | {
"blob_id": "f5831b84c1177d8b869db05d332bd364b3f72fff",
"index": 4282,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef run():\n contact_book = ContactBook()\n with open('22_agenda/contactos.csv', 'r') as f:\n reader = csv.reader(f)\n for idx, row in enumerate(reader):\n ... | [
0,
1,
2,
3,
4
] |
#!/usr/bin/env python
# including libraries
import roslib
import sys
import rospy
import cv2
import math
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
import matplotlib.pyplot as plt
MAP = np.array([[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... | normal | {
"blob_id": "b30e6af035b589d5f4bd1bc6cccdd53c157861a0",
"index": 2144,
"step-1": "#!/usr/bin/env python\n\n# including libraries\nimport roslib\nimport sys\nimport rospy\nimport cv2\nimport math\nfrom std_msgs.msg import String\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge, CvBridgeError\nim... | [
0
] |
import pymongo
import pandas as pd
from scrape_mars import scrape
import json
# Create connection variable
conn = 'mongodb://localhost:27017'
# Pass connection to the pymongo instance.
client = pymongo.MongoClient(conn)
# Connect to a database. Will create one if not already available.
db = client.mars_db
#News
... | normal | {
"blob_id": "e3ac8039ffb6787b0e3e80b234c2689c66a184bf",
"index": 1704,
"step-1": "<mask token>\n",
"step-2": "<mask token>\ndb.news.drop()\ndb.news.insert_many(scrape(info, url))\n<mask token>\ndb.images.drop()\ndb.images.insert_many(scrape(info, url))\n<mask token>\ndb.weather.drop()\ndb.weather.insert_many(s... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def testeSelect(db):
cur1 = db.cursor()
cur1.execute('SELECT VERSION()')
data = cur1.fetchone()
print(dir(data))
print('cur1 : %s ' % cur1)
print('Database version : %s ' % data)
def dropTable(db):
cur1 = db.cursor()
cur1.execute('drop table if exists pyt... | flexible | {
"blob_id": "75133dd924f8f3f028075c5d2109bb79ddc7fe87",
"index": 434,
"step-1": "<mask token>\n\n\ndef testeSelect(db):\n cur1 = db.cursor()\n cur1.execute('SELECT VERSION()')\n data = cur1.fetchone()\n print(dir(data))\n print('cur1 : %s ' % cur1)\n print('Database version : %s ' % data)\n\n\n... | [
4,
5,
6,
7,
9
] |
<|reserved_special_token_0|>
class QQ_Login_Page(BasePage):
def login(self):
local.pyapp.click('android=>new UiSelector().text("登 录")')
def username(self):
local.pyapp.type('content=>请输入QQ号码或手机或邮箱', 3408467505)
def passwd(self):
local.pyapp.type('content=>密码 安全', 'besttest123')
... | flexible | {
"blob_id": "aa51c8f736461f147704c1ec0669c265348fcb80",
"index": 6869,
"step-1": "<mask token>\n\n\nclass QQ_Login_Page(BasePage):\n\n def login(self):\n local.pyapp.click('android=>new UiSelector().text(\"登 录\")')\n\n def username(self):\n local.pyapp.type('content=>请输入QQ号码或手机或邮箱', 340846750... | [
15,
16,
18,
20,
24
] |
<|reserved_special_token_0|>
def transform_to_my_format(data):
d = defaultdict(dict)
for i1, i2, i3 in re.findall('([\\d\\.]+)\\s+([\\d\\.]+)\\s+([\\d\\.]+)',
data):
d[i1].update({i2: float(i3)})
return d
<|reserved_special_token_0|>
def dijkstra_latency(start, goal):
Graph_Lat = t... | flexible | {
"blob_id": "0018cbb1d945ad1b6469804e7993afee44406fd1",
"index": 2895,
"step-1": "<mask token>\n\n\ndef transform_to_my_format(data):\n d = defaultdict(dict)\n for i1, i2, i3 in re.findall('([\\\\d\\\\.]+)\\\\s+([\\\\d\\\\.]+)\\\\s+([\\\\d\\\\.]+)',\n data):\n d[i1].update({i2: float(i3)})\n ... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print('INR :Rs.', inr, '/-')
<|reserved_special_token_1|>
rate = 69
dollar = int(input('enter an dollars to convert:'))
inr = dollar * rate
print('INR :Rs.', inr, '/-')
<|reserved_special_token_1|>
rate=69
dollar=int(input("... | flexible | {
"blob_id": "62018b32bf0c66fa7ec3cc0fcbdc16e28b4ef2d6",
"index": 2396,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('INR :Rs.', inr, '/-')\n",
"step-3": "rate = 69\ndollar = int(input('enter an dollars to convert:'))\ninr = dollar * rate\nprint('INR :Rs.', inr, '/-')\n",
"step-4": "rate=69\nd... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class testPyTaLib(unittest.TestCase):
def setUp(self):
pass
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class testPyTaLib(unittest.TestCase):
def setUp(self):
pass
<|reserved... | flexible | {
"blob_id": "fcd2bd91dff3193c661d71ade8039765f8498fd4",
"index": 8317,
"step-1": "<mask token>\n\n\nclass testPyTaLib(unittest.TestCase):\n\n def setUp(self):\n pass\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass testPyTaLib(unittest.TestCase):\n\n def setUp(self):\n ... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
class cnn:
def __init__(self, maxlen, max_voc, embedweight=None, embedding_dims=
300, batch_size=30, filters=1024, conv_kernel=3, hidden_dim=2048,
epochs=20, output_dim=2, dropout=0.1, trainable=False):
self.epochs = epochs
self.batch_size = batch_size... | flexible | {
"blob_id": "e235be879cf8a00eb9f39f90859689a29b26f1c6",
"index": 3161,
"step-1": "<mask token>\n\n\nclass cnn:\n\n def __init__(self, maxlen, max_voc, embedweight=None, embedding_dims=\n 300, batch_size=30, filters=1024, conv_kernel=3, hidden_dim=2048,\n epochs=20, output_dim=2, dropout=0.1, tra... | [
4,
5,
7,
8,
9
] |
from app.exceptions import UserAlreadyExist, UserDoesNotExist
class Accounts(object):
""" Creates an Account where users can be stored """
def __init__(self):
self.users = {}
def add_user(self, user):
if user.id in self.users:
raise UserAlreadyExist
else:
s... | normal | {
"blob_id": "88cc4ae4137cf9c0e9c39874b36f7a2770550f96",
"index": 5431,
"step-1": "<mask token>\n\n\nclass Accounts(object):\n <mask token>\n\n def __init__(self):\n self.users = {}\n\n def add_user(self, user):\n if user.id in self.users:\n raise UserAlreadyExist\n else:\... | [
4,
5,
6,
7,
9
] |
from django.urls import path
from django.conf.urls import include, url
from . import views
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
appname = 'home'
urlpatterns = [
path('', views.home, name='home'),
]
urlpatterns += staticfiles_urlpatterns() | normal | {
"blob_id": "dd23cd068eea570fc187dad2d49b30376fbd4854",
"index": 4856,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nurlpatterns += staticfiles_urlpatterns()\n",
"step-3": "<mask token>\nappname = 'home'\nurlpatterns = [path('', views.home, name='home')]\nurlpatterns += staticfiles_urlpatterns()\n",
... | [
0,
1,
2,
3,
4
] |
#!/usr/bin/env python
from __future__ import print_function
from types_ import SimpleObject, SimpleObjectImmutable, NamedTuple, SimpleTuple, c_struct
import timeit
import random
TYPES = [
SimpleObjectImmutable,
SimpleObject,
NamedTuple,
SimpleTuple,
c_struct,
]
a = 1035
b = b'\x54 - fo!'
c =... | normal | {
"blob_id": "ba73562cd8ffa52a1fede35c3325e7e76a6dad54",
"index": 7966,
"step-1": "<mask token>\n\n\ndef measure_creation():\n random.shuffle(TYPES)\n for type_ in TYPES:\n pre = 'from __main__ import {}, a, b, c'.format(type_.__name__)\n body = '{}(a, b, c)'.format(type_.__name__)\n pr... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(' Coefficients:')
print(' Coefficient of a = ', a)
print(' Coefficient of b = ', b)
print(' Coefficient of c = ', c)
<|reserved_special_token_0|>
print('The roots of the equation:')
print(' Root 1 =', root_1)
print(' Root 2 ... | flexible | {
"blob_id": "2acfd0bbad68bb9d55aeb39b180f4326a225f6d5",
"index": 1218,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(' Coefficients:')\nprint(' Coefficient of a = ', a)\nprint(' Coefficient of b = ', b)\nprint(' Coefficient of c = ', c)\n<mask token>\nprint('The roots of the equation:')\nprint(' R... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class Paddle(Turtle):
<|reserved_special_token_0|>
def up(self):
y_pos = self.ycor()
x_pos = self.xcor()
self.goto(y=y_pos + 20, x=x_pos)
def down(self):
y_pos = self.ycor()
x_pos = self.xcor()
self.goto(y=y_pos - 20, x=x_pos)
... | flexible | {
"blob_id": "f49b80d0b8b42bafc787a36d0a8be98ab7fa53e7",
"index": 3558,
"step-1": "<mask token>\n\n\nclass Paddle(Turtle):\n <mask token>\n\n def up(self):\n y_pos = self.ycor()\n x_pos = self.xcor()\n self.goto(y=y_pos + 20, x=x_pos)\n\n def down(self):\n y_pos = self.ycor()\... | [
3,
4,
5,
6,
7
] |
<|reserved_special_token_0|>
class FastCountQuerySet:
def __init__(self, queryset, tablename):
self.queryset = queryset
self.tablename = tablename
def count(self):
cursor = connection.cursor()
cursor.execute('SELECT reltuples FROM pg_class WHERE relname = %s',
[se... | flexible | {
"blob_id": "bcc959dcdb60c55897158e85d73c59592b112c12",
"index": 6381,
"step-1": "<mask token>\n\n\nclass FastCountQuerySet:\n\n def __init__(self, queryset, tablename):\n self.queryset = queryset\n self.tablename = tablename\n\n def count(self):\n cursor = connection.cursor()\n ... | [
25,
26,
28,
29,
35
] |
version https://git-lfs.github.com/spec/v1
oid sha256:a2959c4cccf29b3797cc2e2dcef87ddb5a0779d9fb992bb38e190b791ae37eb0
size 88352
| normal | {
"blob_id": "932bb7c9dbf3e97c966d2d7d537e747756831e30",
"index": 608,
"step-1": "version https://git-lfs.github.com/spec/v1\noid sha256:a2959c4cccf29b3797cc2e2dcef87ddb5a0779d9fb992bb38e190b791ae37eb0\nsize 88352\n",
"step-2": null,
"step-3": null,
"step-4": null,
"step-5": null,
"step-ids": [
0
... | [
0
] |
import cachetools
cache = cachetools.LRUCache(maxsize = 3)
cache['PyCon'] = 'India'
cache['year'] = '2017'
print("Older: " + cache['year'])
cache['year'] = '2018'
print("Newer: " + cache['year'])
print(cache)
cache['sdate'] = '05/09/2018'
print(cache)
cache['edate'] = '09/09/2018'
print(cache) | normal | {
"blob_id": "aebc918d6a1d1d2473f74d77b8a915ac25548e3a",
"index": 443,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('Older: ' + cache['year'])\n<mask token>\nprint('Newer: ' + cache['year'])\nprint(cache)\n<mask token>\nprint(cache)\n<mask token>\nprint(cache)\n",
"step-3": "<mask token>\ncache ... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class OvsApi(object):
<|reserved_special_token_0|>
def __init__(self, ip, protocol='tcp', port='6640', timeout=10):
super(OvsApi, self).__init__()
self.ip = ip
self.protocol = protocol
self.port = port
self.vsctl_timeout = timeout
s... | flexible | {
"blob_id": "89a3c34b3145b93a4cfa78eeb055c8136ab2bfe6",
"index": 2084,
"step-1": "<mask token>\n\n\nclass OvsApi(object):\n <mask token>\n\n def __init__(self, ip, protocol='tcp', port='6640', timeout=10):\n super(OvsApi, self).__init__()\n self.ip = ip\n self.protocol = protocol\n ... | [
18,
23,
25,
27,
35
] |
<|reserved_special_token_0|>
class Computer:
def __init__(self, data, inputs, memory_size=8192, interactive=True):
self._memory = [0] * memory_size
for i in range(len(data)):
self._memory[i] = data[i]
self._pc = 0
self._inputs = deque(inputs)
self._outputs = []... | flexible | {
"blob_id": "121fddf022c4eed7fd00e81edcb2df6a7a3b7510",
"index": 4903,
"step-1": "<mask token>\n\n\nclass Computer:\n\n def __init__(self, data, inputs, memory_size=8192, interactive=True):\n self._memory = [0] * memory_size\n for i in range(len(data)):\n self._memory[i] = data[i]\n ... | [
17,
19,
21,
22,
25
] |
<|reserved_special_token_0|>
class LdapSync(Thread):
def __init__(self, settings):
Thread.__init__(self)
self.settings = settings
def run(self):
if self.settings.enable_group_sync:
migrate_dn_pairs(settings=self.settings)
self.start_sync()
self.show_sync_r... | flexible | {
"blob_id": "8cc0393082448bb8f61068b5c96e89ef3aee77ed",
"index": 235,
"step-1": "<mask token>\n\n\nclass LdapSync(Thread):\n\n def __init__(self, settings):\n Thread.__init__(self)\n self.settings = settings\n\n def run(self):\n if self.settings.enable_group_sync:\n migrate_... | [
9,
10,
11,
12,
13
] |
'''
Given a string S and a string T,
find the minimum window in S which will contain all the characters in T in complexity O(n).
For example,
S = "ADOBECODEBANC"
T = "ABC"
Minimum window is "BANC".
Note:
If there is no such window in S that covers all characters in T, return the empty string "".
If there are multipl... | normal | {
"blob_id": "665a868ee71f247a621d82108e545257296e0427",
"index": 7048,
"step-1": "<mask token>\n\n\nclass Solution:\n <mask token>\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass Solution:\n <mask token>\n\n def minWindow(self, source, target):\n s_char_count = defaul... | [
1,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def pull_from_solr(output_directory):
solr_url = (
'http://54.191.81.42:8888/solr/collection1/select?q=*%3A*&wt=json&indent=true'
)
req = requests.get(solr_url)
if req.status_code != 200:
rais... | flexible | {
"blob_id": "47b40e4311f76cd620b7c6ed6b39216d866fa857",
"index": 8530,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef pull_from_solr(output_directory):\n solr_url = (\n 'http://54.191.81.42:8888/solr/collection1/select?q=*%3A*&wt=json&indent=true'\n )\n req = requests.get(solr... | [
0,
1,
2,
3
] |
import sys
import logging
import copy
import socket
from . import game_map
class GameUnix:
"""
:ivar map: Current map representation
:ivar initial_map: The initial version of the map before game starts
"""
def _send_string(self, s):
"""
Send data to the game. Call :function:`done_... | normal | {
"blob_id": "09d31df9c76975377b44470e1f2ba4a5c4b7bbde",
"index": 912,
"step-1": "<mask token>\n\n\nclass GameStdIO:\n <mask token>\n <mask token>\n\n def _done_sending(self):\n \"\"\"\n Finish sending commands to the game.\n\n :return: nothing\n \"\"\"\n sys.stdout.wri... | [
8,
14,
18,
21,
22
] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-27 21:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cms', '0020_old_tree_cleanup'),
('styleguide', '00... | normal | {
"blob_id": "85c2a4163a3132794186b95b4068f6c6e1104828",
"index": 1306,
"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 = [('cms', '0020... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class DocsIetfQosRfMacIfDirection(Integer):
subtypeSpec = Integer.subtypeSpec + SingleValueConstraint(2, 1)
namedValues = NamedValues(('downstream', 1), ('upstream', 2))
class DocsIetfQosSchedulingType(Integer):
subtypeSpec = Integer.subtypeSpec + SingleValueConstraint(3, 1,... | flexible | {
"blob_id": "b90678c8f7ad9b97e13e5603bdf1dc8cb3511ca5",
"index": 5432,
"step-1": "<mask token>\n\n\nclass DocsIetfQosRfMacIfDirection(Integer):\n subtypeSpec = Integer.subtypeSpec + SingleValueConstraint(2, 1)\n namedValues = NamedValues(('downstream', 1), ('upstream', 2))\n\n\nclass DocsIetfQosSchedulingT... | [
4,
5,
6,
7,
9
] |
# terminal based game in Python
from random import randint
print('Terminal based number guessing game')
while True:
try:
numberOfGames = int(input('Please choose how many games you want to play ---> '))
except:
print('Only numbes accepted')
continue
if (numberOfGames > 0 and numberO... | normal | {
"blob_id": "20c081dc47f541a988bccef89b8e51f446c80f58",
"index": 5471,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('Terminal based number guessing game')\nwhile True:\n try:\n numberOfGames = int(input(\n 'Please choose how many games you want to play ---> '))\n except:\n... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def create_all(engine):
ORMBase.metadata.create_all(engine)
<|reserved_special_token_1|>
<|reserved_special_token_0|>
ORMBase = declarative_base()
def create_all(engine):
ORMBase.metadata.create_all(engine)
<|rese... | flexible | {
"blob_id": "c7ca8235864ce5de188c4aa2feb9ad82d4fa9b0f",
"index": 4023,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef create_all(engine):\n ORMBase.metadata.create_all(engine)\n",
"step-3": "<mask token>\nORMBase = declarative_base()\n\n\ndef create_all(engine):\n ORMBase.metadata.create_... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class TodoViewset(viewsets.ModelViewSet):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class TodoViewset(viewsets.ModelViewSet):
queryset = ... | flexible | {
"blob_id": "1c668cf6f145b85a09b248fefda46e928de64e41",
"index": 5041,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass TodoViewset(viewsets.ModelViewSet):\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass TodoViewset(viewsets.ModelViewSet):\n queryset = models.Todo.... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
print('hello world123')
| flexible | {
"blob_id": "004a02f7ff49cb1b63ebedfcfcb4937377859099",
"index": 1187,
"step-1": "<mask token>\n",
"step-2": "print('hello world123')\n",
"step-3": null,
"step-4": null,
"step-5": null,
"step-ids": [
0,
1
]
} | [
0,
1
] |
from django.urls import path
from .views import (
TreeCreateView,
TreeListView,
TreeUpdateView,
)
app_name = 'trees'
urlpatterns = [
path('list/', TreeListView.as_view(),
name='list'),
path('create/', TreeCreateView.as_view(),
name='create'),
path('<int:pk>/update/', TreeCreat... | normal | {
"blob_id": "0c1de2c1eb5a4de7aeb14ad6b27aa61e07bc4c51",
"index": 602,
"step-1": "<mask token>\n",
"step-2": "<mask token>\napp_name = 'trees'\nurlpatterns = [path('list/', TreeListView.as_view(), name='list'), path(\n 'create/', TreeCreateView.as_view(), name='create'), path(\n '<int:pk>/update/', TreeCr... | [
0,
1,
2,
3
] |
import numpy as np
import pandas as pd
import logging
import matplotlib.pyplot as plt
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import LabelEncoder, OneHotEncoder, StandardScaler, RobustScaler
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline, make_pipeline
f... | normal | {
"blob_id": "dc51ca86a49dbec6f714753782494f21d4b1591d",
"index": 9091,
"step-1": "<mask token>\n\n\ndef preprocess_data(train, test):\n global train_features, test_features, train_target, categorical, numerical\n train_features = train.drop(['Sales', 'Customers'], axis=1)\n train_target = train[['Sales'... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
class ConsensusSimulation:
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def run_sim(self, record_all=False, update_every=1.0):
"""run the core simulation"""
t = 0
self.x_ini... | flexible | {
"blob_id": "3164eab8dc221149c9f865645edf9991d810d2ac",
"index": 8698,
"step-1": "<mask token>\n\n\nclass ConsensusSimulation:\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n def run_sim(self, record_all=False, update_every=1.0):\n \"\"\"run the core simulation\"\"\"\n ... | [
3,
8,
9,
11,
12
] |
DEBUG = True
ADMINS = frozenset(["briandowe@gmail.com"]) | normal | {
"blob_id": "68bade5767d4f418bcae07485a179df5e47e652c",
"index": 9066,
"step-1": "<mask token>\n",
"step-2": "DEBUG = True\nADMINS = frozenset(['briandowe@gmail.com'])\n",
"step-3": "DEBUG = True\nADMINS = frozenset([\"briandowe@gmail.com\"])",
"step-4": null,
"step-5": null,
"step-ids": [
0,
1... | [
0,
1,
2
] |
<|reserved_special_token_0|>
class AdditiveAttention(nn.Module):
<|reserved_special_token_0|>
def __init__(self, key_size, query_size, num_hiddens, dropout, **kwargs):
super(AdditiveAttention, self).__init__(**kwargs)
self.W_k = nn.Linear(key_size, num_hiddens, bias=False)
self.W_q = ... | flexible | {
"blob_id": "cda01bc7b0ebcfaf010bb87e7d9be34fd310d7a7",
"index": 9626,
"step-1": "<mask token>\n\n\nclass AdditiveAttention(nn.Module):\n <mask token>\n\n def __init__(self, key_size, query_size, num_hiddens, dropout, **kwargs):\n super(AdditiveAttention, self).__init__(**kwargs)\n self.W_k =... | [
7,
9,
10,
11,
13
] |
<|reserved_special_token_0|>
class Test_DatabaseUtils(unittest.TestCase):
def setUp(self):
self.db = DatabaseUtils()
<|reserved_special_token_0|>
def test_getUser(self):
count = self.dataCount()
try:
trueResult = self.db.getUser('username')
print('Test pas... | flexible | {
"blob_id": "ff8e8af72a8eb97a392fcfec5960eed7a2e51f68",
"index": 9211,
"step-1": "<mask token>\n\n\nclass Test_DatabaseUtils(unittest.TestCase):\n\n def setUp(self):\n self.db = DatabaseUtils()\n <mask token>\n\n def test_getUser(self):\n count = self.dataCount()\n try:\n ... | [
9,
10,
13,
17,
18
] |
<|reserved_special_token_0|>
class BlockDeviceTestCase(test.NoDBTestCase):
<|reserved_special_token_0|>
def test_properties(self):
root_device0 = '/dev/sda'
root_device1 = '/dev/sdb'
mappings = [{'virtual': 'root', 'device': root_device0}]
properties0 = {'mappings': mappings}
... | flexible | {
"blob_id": "d56e313318635788ae5b3d3a3f767450ab2f2296",
"index": 4985,
"step-1": "<mask token>\n\n\nclass BlockDeviceTestCase(test.NoDBTestCase):\n <mask token>\n\n def test_properties(self):\n root_device0 = '/dev/sda'\n root_device1 = '/dev/sdb'\n mappings = [{'virtual': 'root', 'dev... | [
37,
38,
43,
46,
55
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
from .tokening import sign_profile_tokens, validate_token_record, get_profile_from_tokens
from .zone_file import create_zone_file
from .legacy import is_profile_legacy_format, get_person_from_legacy_format
<|reserved_special_token_1|>
from .tokening import... | flexible | {
"blob_id": "de24b341102f5979cc48b22c3a07d42915b6dd18",
"index": 7146,
"step-1": "<mask token>\n",
"step-2": "from .tokening import sign_profile_tokens, validate_token_record, get_profile_from_tokens\nfrom .zone_file import create_zone_file\nfrom .legacy import is_profile_legacy_format, get_person_from_legacy_... | [
0,
1,
2
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def test_auth_passwordreset_reset1():
register = auth_register('Someemial@hotmail.com.au', 'Hello123',
'First', 'Last')
auth_passwordreset_request('Someemial@hotmail.com.au')
with pytest.raises(ValueError, ma... | flexible | {
"blob_id": "a315d01f0fb16f0c74c447c07b76f33e6ff6427d",
"index": 9742,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef test_auth_passwordreset_reset1():\n register = auth_register('Someemial@hotmail.com.au', 'Hello123',\n 'First', 'Last')\n auth_passwordreset_request('Someemial@hotmai... | [
0,
2,
3,
4,
5
] |
planet_list = ["Mercury", "Mars"]
planet_list.append("Jupiter")
planet_list.append("Saturn")
planet_list.extend(["Uranus", "Neptune"])
planet_list.insert(1, "Earth")
planet_list.insert(1, "Venus")
planet_list.append("Pluto")
del planet_list[-1]
print(planet_list) | normal | {
"blob_id": "1280ab66b817011e22e560a78104bbc4340989e7",
"index": 8495,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nplanet_list.append('Jupiter')\nplanet_list.append('Saturn')\nplanet_list.extend(['Uranus', 'Neptune'])\nplanet_list.insert(1, 'Earth')\nplanet_list.insert(1, 'Venus')\nplanet_list.append(... | [
0,
1,
2,
3
] |
#This is a file from CS50 Finance
from functools import wraps
from flask import redirect, render_template, session
from threading import Thread
from flask_mail import Message
from application import app, mail
ALLOWED_EXTENSIONS = {"png", "PNG", "jpg", "jpeg", "JPG", "JPEG"}
def login_required(f):
"""
Decorat... | normal | {
"blob_id": "1a4da621add157fa6d1f578370d64594b102eeb5",
"index": 4245,
"step-1": "<mask token>\n\n\ndef login_required(f):\n \"\"\"\n Decorate routes to require login.\n\n http://flask.pocoo.org/docs/1.0/patterns/viewdecorators/\n \"\"\"\n\n @wraps(f)\n def decorated_function(*args, **kwargs):\... | [
3,
4,
5,
6,
7
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def n(T):
k = 1.38065e-23
c = 300000000.0
N = 100
a = h * c / (lam2 * k * T)
b = h * c / (lam1 * k * T)
x, w = gaussxwab(N, a, b)
s = 0.0
for k in range(N):
s += w[k] * (x[k] ** 3 / (exp(x... | flexible | {
"blob_id": "9b88a3976d522bdfd38502e29eefc1f1a0c29ed2",
"index": 2884,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef n(T):\n k = 1.38065e-23\n c = 300000000.0\n N = 100\n a = h * c / (lam2 * k * T)\n b = h * c / (lam1 * k * T)\n x, w = gaussxwab(N, a, b)\n s = 0.0\n for k... | [
0,
2,
3,
4,
5
] |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-03 19:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mybus', '0007_auto_20160104_0053'),
]
operations = [
migrations.RemoveField(... | normal | {
"blob_id": "1dec7a997b0bef3226fb17e4039b053c7a2e457e",
"index": 9045,
"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 = [('mybus', '00... | [
0,
1,
2,
3,
4
] |
import pickle
from pathlib import Path
from rich.console import Console
from fourierdb import FourierDocument, FourierCollection, FourierDB
console = Console()
doc = FourierDocument({"bar": "eggs", "xyz": "spam"})
doc2 = FourierDocument({"a": "foo", "b": "bar"})
doc3 = FourierDocument({"abc": "xyz"})
doc4 = FourierDo... | normal | {
"blob_id": "f15f96658130ac9bba748a518371ad80d9772fbc",
"index": 4121,
"step-1": "<mask token>\n",
"step-2": "<mask token>\ndb.add_collection(coll)\ndb.add_collection(coll2)\npickle.dump(db, open(''))\n",
"step-3": "<mask token>\nconsole = Console()\ndoc = FourierDocument({'bar': 'eggs', 'xyz': 'spam'})\ndoc... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def get_summary():
model = T5ForConditionalGeneration.from_pretrained('t5-small')
tokenizer = T5Tokenizer.from_pretrained('t5-small')
device = torch.device('cpu')
text = str(url_display1.get('1.0', tk.END))
preprocess_text = text.strip().replace('\n', '')
t5_prepar... | flexible | {
"blob_id": "e3dece36ba3e5b3df763e7119c485f6ed2155098",
"index": 795,
"step-1": "<mask token>\n\n\ndef get_summary():\n model = T5ForConditionalGeneration.from_pretrained('t5-small')\n tokenizer = T5Tokenizer.from_pretrained('t5-small')\n device = torch.device('cpu')\n text = str(url_display1.get('1.... | [
8,
9,
13,
14,
15
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
sys.path.append('../../../../libs/VASNet/')
<|reserved_special_token_0|>
sys.path.append('../../../config')
<|reserved_special_token_0|>
if __name__ == '__main__':
path_pretrained_model = cfg.PATH_DRDSN_PRETRAINED_MODEL
pa... | flexible | {
"blob_id": "ce97da4aab2b9de40267730168690475c899526d",
"index": 3924,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nsys.path.append('../../../../libs/VASNet/')\n<mask token>\nsys.path.append('../../../config')\n<mask token>\nif __name__ == '__main__':\n path_pretrained_model = cfg.PATH_DRDSN_PRETRAI... | [
0,
1,
2,
3
] |
import requests
from google.cloud import datastore
import google.cloud.logging
###Helper functions
def report_error(error_text):
"""Logs error to Stackdriver.
:param error_text: The text to log to Stackdriver
:type error_text: string
"""
client = google.cloud.logging.Client()
logger = client.l... | normal | {
"blob_id": "bf2b3b74f772026328cdd04412455ee758c43d3f",
"index": 8142,
"step-1": "<mask token>\n\n\ndef report_error(error_text):\n \"\"\"Logs error to Stackdriver.\n :param error_text: The text to log to Stackdriver\n :type error_text: string\n \"\"\"\n client = google.cloud.logging.Client()\n ... | [
10,
12,
13,
14,
15
] |
from django.db import models
from django.contrib.auth.models import User as sUser
TYPES = (
('public', 'public'),
('private', 'private'),
)
#class GroupManager(models.Manager):
# def get_all_users(self):
# return self.extra(where=['users'])
class Group(models.Model):
name = models.CharField(max... | normal | {
"blob_id": "8baf61a20a64f296304b6a7017a24f1216e3d771",
"index": 2908,
"step-1": "<mask token>\n\n\nclass Group(models.Model):\n <mask token>\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 Group(models.Model)... | [
1,
3,
4,
5,
6
] |
s1 = {10, 20, 30, 60, 70, 80, 90}
s2 = set()
print(s2)
s1.add(100)
print(s1.pop())
print(10 in s1)
print(10 not in s1)
| normal | {
"blob_id": "3747e45dcba548060f25bd6d6f0e0e96091ca3df",
"index": 2358,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(s2)\ns1.add(100)\nprint(s1.pop())\nprint(10 in s1)\nprint(10 not in s1)\n",
"step-3": "s1 = {10, 20, 30, 60, 70, 80, 90}\ns2 = set()\nprint(s2)\ns1.add(100)\nprint(s1.pop())\nprin... | [
0,
1,
2
] |
<|reserved_special_token_0|>
def emailpatient(firstname, lastname, password, otp, email, id):
print('\n== UTILS ===')
html_message = (
"""
<html>
<body>
<p>Welcome %s %s and pass is %s and otp is %d</p>
<p>http://127.0.0.1:8000/varificationpage/%d<p>
</body>
</html>
"""
... | flexible | {
"blob_id": "4ecf9c03750a31ecd113a7548df4e2a700e775e0",
"index": 4034,
"step-1": "<mask token>\n\n\ndef emailpatient(firstname, lastname, password, otp, email, id):\n print('\\n== UTILS ===')\n html_message = (\n \"\"\"\n <html>\n <body>\n <p>Welcome %s %s and pass is %s and otp is %d</p>\n... | [
1,
2,
3,
4,
5
] |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import unittest
import logging
from collections import Counter
from utility import token_util
class TestFileReadingFunctions(unittest.TestCase)... | normal | {
"blob_id": "7c3798aa9cc5424656572dfaa87f7acb961613eb",
"index": 8715,
"step-1": "<mask token>\n\n\nclass TestFileReadingFunctions(unittest.TestCase):\n\n def setUp(self):\n self.data_dir = os.path.join(os.path.dirname(os.path.realpath(\n __file__)), 'data')\n self.one_word_per_line_p... | [
4,
5,
6,
7,
8
] |
import time
import argparse
import utils
from data_loader import DataLoader
from generate_model_predictions import sacrebleu_metric, compute_bleu
import tensorflow as tf
import os
import json
from transformer import create_masks
# Since the target sequences are padded, it is important
# to apply a padding mask when c... | normal | {
"blob_id": "7613dde4f49044fbca13acad2dd75587ef68f477",
"index": 2903,
"step-1": "<mask token>\n\n\ndef loss_function(real, pred, loss_object, pad_token_id):\n \"\"\"Calculates total loss containing cross entropy with padding ignored.\n Args:\n real: Tensor of size [batch_size, length_logits, voca... | [
5,
6,
7,
8,
9
] |
<|reserved_special_token_0|>
def load_skeleton(mat_path):
mat_data = scipy.io.loadmat(mat_path)['skel'][0, 0]
skeleton = OrderedDict()
bone_names = mat_data[1].tolist()
for i, bone in enumerate(bone_names):
bone = bone.strip()
if bone == 'Site':
bone = bone_names[i - 1].str... | flexible | {
"blob_id": "f2dac8b454805829cf5dbe2efe3c0de805ae4cb5",
"index": 1727,
"step-1": "<mask token>\n\n\ndef load_skeleton(mat_path):\n mat_data = scipy.io.loadmat(mat_path)['skel'][0, 0]\n skeleton = OrderedDict()\n bone_names = mat_data[1].tolist()\n for i, bone in enumerate(bone_names):\n bone =... | [
3,
5,
6,
7,
8
] |
import matplotlib.pyplot as plt
import numpy as np
import unittest
from ema_workbench.analysis import clusterer
from test import utilities
class ClusterTestCase(unittest.TestCase):
def test_cluster(self):
n = 10
experiments, outcomes = utilities.load_flu_data()
data = outcomes["infected f... | normal | {
"blob_id": "a7e2b016131dfdb75e537e86875e1b2f19fb3d9d",
"index": 2580,
"step-1": "<mask token>\n\n\nclass ClusterTestCase(unittest.TestCase):\n <mask token>\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\nclass ClusterTestCase(unittest.TestCase):\n\n def test_cluster(self):\n n = 10\n ex... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
file.write(response.content)
file.close()
<|reserved_special_token_0|>
bot.start()
run()
<|reserved_special_token_1|>
<|reserved_special_token_0|>
response = requests.get(BG_IMAGE)
file = open('./etc/tg_vc_bot.jpg', 'wb')
file.... | flexible | {
"blob_id": "c5ac37ce09f7cd76ccd9b93c64e602209a04c55c",
"index": 1824,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfile.write(response.content)\nfile.close()\n<mask token>\nbot.start()\nrun()\n",
"step-3": "<mask token>\nresponse = requests.get(BG_IMAGE)\nfile = open('./etc/tg_vc_bot.jpg', 'wb')\nfi... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
engine = create_engine(config.DB_URI)
Session = scoped_session(sessionmaker(bind=engine))
<|reserved_special_token_1|>
from app import config
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessi... | flexible | {
"blob_id": "86c1aee21639958f707f99bc2468e952ad6c1859",
"index": 9352,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nengine = create_engine(config.DB_URI)\nSession = scoped_session(sessionmaker(bind=engine))\n",
"step-3": "from app import config\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.o... | [
0,
1,
2
] |
#!/usr/bin/env python
from pymongo import MongoClient
import serial
import sys, os, datetime
os.system('sudo stty -F /dev/ttyS0 1200 sane evenp parenb cs7 -crtscts')
SERIAL = '/dev/ttyS0'
try:
ser = serial.Serial(
port=SERIAL,
baudrate = 1200,
parity=serial.PARITY_EVEN,
stopbits=serial.STOPBITS_ON... | normal | {
"blob_id": "d0997f5001090dd8925640cd5b0f3eb2e6768113",
"index": 3862,
"step-1": "#!/usr/bin/env python\n\n\nfrom pymongo import MongoClient\nimport serial\nimport sys, os, datetime\n\nos.system('sudo stty -F /dev/ttyS0 1200 sane evenp parenb cs7 -crtscts')\n\nSERIAL = '/dev/ttyS0'\ntry:\n ser = serial.Serial(\... | [
0
] |
def chess():
row = 0
line = 0
chess1 = []
chess2 = []
for line in range(3):
x1 = (0,line)
chess1.append(x1)
for line in range(3):
x2 = (1,line)
chess2.append(x2)
print(chess1)
print(chess2)
for x in range(len(chess1))
if chess2[x][1] != chess1[... | normal | {
"blob_id": "7d0d1a53a249167edade24a4e9305c95288a8574",
"index": 4851,
"step-1": "def chess():\n row = 0\n line = 0\n chess1 = []\n chess2 = []\n for line in range(3):\n x1 = (0,line)\n chess1.append(x1)\n for line in range(3):\n x2 = (1,line)\n chess2.append(x2)\n ... | [
0
] |
<|reserved_special_token_0|>
def output(i, out):
with open('B-large.out', 'a') as outfile:
outfile.write('Case #{0}: {1}\n'.format(i, out))
def solve(i, stack):
cursymbol = stack[0]
counter = 0 if stack[-1] == '+' else 1
for symbol in stack:
if symbol != cursymbol:
cursym... | flexible | {
"blob_id": "752679d2484b6b91a734c7cbe4a99bd5676661eb",
"index": 9498,
"step-1": "<mask token>\n\n\ndef output(i, out):\n with open('B-large.out', 'a') as outfile:\n outfile.write('Case #{0}: {1}\\n'.format(i, out))\n\n\ndef solve(i, stack):\n cursymbol = stack[0]\n counter = 0 if stack[-1] == '+... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
class Ui_GitPage(object):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Ui_GitPage(object):
def setupUi(self, GitPage):
GitPage.setObjectName('GitPage')
GitPage.resize(609, 751)
... | flexible | {
"blob_id": "80891a4c9703f91509d2c1b22304f33426dfb962",
"index": 4419,
"step-1": "<mask token>\n\n\nclass Ui_GitPage(object):\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass Ui_GitPage(object):\n\n def setupUi(self, GitPage):\n GitPage.setObjectName('GitPage')\n GitP... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
dependencies = [(... | flexible | {
"blob_id": "1dec7a997b0bef3226fb17e4039b053c7a2e457e",
"index": 9045,
"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 = [('mybus', '00... | [
0,
1,
2,
3,
4
] |
######################################################################
#
# Write something here to recognize your own file
#
# Copyright: MIT License
#
######################################################################
def multiply(value):
return value * 5
if __name__ == "__main__":
a = [0, 1, 2, 3, 4, 5... | normal | {
"blob_id": "0778b25363d50e699edf48b92f1104ab57c03172",
"index": 2015,
"step-1": "<mask token>\n",
"step-2": "def multiply(value):\n return value * 5\n\n\n<mask token>\n",
"step-3": "def multiply(value):\n return value * 5\n\n\nif __name__ == '__main__':\n a = [0, 1, 2, 3, 4, 5]\n new_empty_list ... | [
0,
1,
2,
3
] |
import graphene
from django.core.exceptions import ValidationError
from ....app import models
from ....app.error_codes import AppErrorCode
from ....permission.enums import AppPermission, get_permissions
from ....webhook.event_types import WebhookEventAsyncType
from ...account.utils import can_manage_app
from ...core.m... | normal | {
"blob_id": "972a063bab35926472be592e6a17d450034fbf37",
"index": 4745,
"step-1": "<mask token>\n\n\nclass AppUpdate(ModelMutation):\n\n\n class Arguments:\n id = graphene.ID(description='ID of an app to update.', required=True)\n input = AppInput(required=True, description=\n 'Fields ... | [
1,
2,
3,
4,
5
] |
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# In[2]:
import os
GFE_PATH = "C:\Haely\MS2017\sem2\EE 259\Project\grammatical_facial_expression"
def load_a_affirm_data(gfe_path=GFE_PATH):
csv_patha = os.path.join(gfe_path, "a_affirmative_datapoints.csv")
... | normal | {
"blob_id": "2fb8bce3a64787dbaf5a3bb3da53f70005048467",
"index": 4104,
"step-1": "<mask token>\n\n\ndef load_a_affirm_target(gfe_path=GFE_PATH):\n csv_targeta = os.path.join(gfe_path, 'a_affirmative_targets.csv')\n print(gfe_path)\n return pd.read_csv(csv_targeta)\n\n\ndef load_a_cond_data(gfe_path=GFE_... | [
19,
27,
29,
30,
40
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class photoForm(forms.Form):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class photoForm(forms.Form):
iso = forms.ChoiceField(label='ISO', ... | flexible | {
"blob_id": "19b55b2de3d2ed16275cef572e3518fbb2457f84",
"index": 8293,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass photoForm(forms.Form):\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass photoForm(forms.Form):\n iso = forms.ChoiceField(label='ISO', choices=[('1... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def test_convert_nc_2010_to_na_2310():
ffi_in, ffi_out = 2010, 2310
infile = os.path.join(cached_outputs, f'{ffi_in}.nc')
outfile = os.path.join(test_outputs, f'{ffi_out}_from_nc_{ffi_in}.na')
x = nappy.nc_interf... | flexible | {
"blob_id": "0de657ee173b606ad61d614a6168c00fcd571a70",
"index": 74,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef test_convert_nc_2010_to_na_2310():\n ffi_in, ffi_out = 2010, 2310\n infile = os.path.join(cached_outputs, f'{ffi_in}.nc')\n outfile = os.path.join(test_outputs, f'{ffi_out}... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class Adam(Optimizer):
<|reserved_special_token_0|>
def __init__(self, learningrate: float=0.001, learningrate_decay: float
=0.0, beta1: float=0.9, beta2: float=0.999, epsilon: float=1e-08
) ->None:
from bigdl.dllib.optim.optimizer import Adam as BAdam
... | flexible | {
"blob_id": "ce69f7b7cf8c38845bfe589c83fdd6e43ab50912",
"index": 3708,
"step-1": "<mask token>\n\n\nclass Adam(Optimizer):\n <mask token>\n\n def __init__(self, learningrate: float=0.001, learningrate_decay: float\n =0.0, beta1: float=0.9, beta2: float=0.999, epsilon: float=1e-08\n ) ->None:\... | [
19,
29,
33,
35,
41
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
api_id = 0
api_hash = '00000000000000000000000'
phone = '+000000000000'
username = 'theone'
project_id = 0
<|reserved_special_token_1|>
# (1) Obtain your values here (https://core.telegram.org/api/obtaining_api_id)
api_id = 000000
api_hash = '0000000000000... | flexible | {
"blob_id": "a5646a5d42dbf6e70e9d18f28513ee2df68a28b1",
"index": 6886,
"step-1": "<mask token>\n",
"step-2": "api_id = 0\napi_hash = '00000000000000000000000'\nphone = '+000000000000'\nusername = 'theone'\nproject_id = 0\n",
"step-3": "# (1) Obtain your values here (https://core.telegram.org/api/obtaining_ap... | [
0,
1,
2
] |
"""
测试用例
"""
import unittest
import jsonpath
import requests
from apiunittest.lib.loadIni import LoadIni
from apiunittest.keyword.keyword import Keyword
from apiunittest.lib.log import logger
from ddt import ddt, file_data
@ddt
class ApiTest(unittest.TestCase):
@classmethod
def setUpClass... | normal | {
"blob_id": "b28bada020ac593783ac62994bb45311ebb78813",
"index": 9055,
"step-1": "<mask token>\n\n\n@ddt\nclass ApiTest(unittest.TestCase):\n\n @classmethod\n def setUpClass(cls) ->None:\n cls.keyword = Keyword()\n cls.cookie = None\n cls.confData = LoadIni('config.ini')\n logge... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
@app.route('/api/v1.0/stations')
def stations():
"""return a json list of stations from the dataset."""
stationquery = session.query(Station.station).all()
stationlist = list(np.ravel(stationquery))
return jsonify(stationlist)
<|reserved_special_token_0|>
@app.route('/... | flexible | {
"blob_id": "c295d769b85943a6ca89f9d213e79b78129a6ce9",
"index": 2031,
"step-1": "<mask token>\n\n\n@app.route('/api/v1.0/stations')\ndef stations():\n \"\"\"return a json list of stations from the dataset.\"\"\"\n stationquery = session.query(Station.station).all()\n stationlist = list(np.ravel(station... | [
3,
8,
9,
10,
12
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.