code stringlengths 13 6.09M | order_type stringclasses 2
values | original_example dict | step_ids listlengths 1 5 |
|---|---|---|---|
import pandas as pd
df1 = pd.read_csv("../final/your_no.tsv", '\t')
df2 = pd.read_csv("../../Downloads/me.csv", '\t')
final = pd.concat([df1, df2])
final.to_csv('../../Downloads/final_con_final.tsv', sep='\t', index=False)
| normal | {
"blob_id": "cd5945631a9dd505bf67089bab8c5a37ad375129",
"index": 410,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfinal.to_csv('../../Downloads/final_con_final.tsv', sep='\\t', index=False)\n",
"step-3": "<mask token>\ndf1 = pd.read_csv('../final/your_no.tsv', '\\t')\ndf2 = pd.read_csv('../../Downlo... | [
0,
1,
2,
3,
4
] |
import pandas as pd
iris_nan = pd.read_csv("MLData/iris_nan.csv")
iris_nan.head()
Y = iris_nan["class"].values
X = iris_nan.drop("class", axis=1)
# Our iris dataframe presents some NaN values, and we need to fix that.
# We got some methods to apply on a pandas dataframe:
# 1: Drop records presenting a NaN value: We... | normal | {
"blob_id": "00429a16ac009f6f706ef11bc29b0aec77b9ebe6",
"index": 9536,
"step-1": "<mask token>\n",
"step-2": "<mask token>\niris_nan.head()\n<mask token>\niris_nan.dropna()\niris_nan.dropna(axis=1)\n<mask token>\niris_nan.fillna(mean_replace)\n<mask token>\niris_nan.fillna(median_replace)\n<mask token>\niris_n... | [
0,
1,
2,
3,
4
] |
import numpy as np
import time
# Create key based on timestamp
KEY = time.time()
np.random.seed(int(KEY))
# Read in message
with open('Message.txt', 'r') as f:
Message = f.read()
f.close()
# Generate vector of random integers
Encoder = np.random.random_integers(300, size=len(Message))
# Map message to encoded arr... | normal | {
"blob_id": "b2f9a133581b5144b73a47f50a3b355d1112f7ea",
"index": 4072,
"step-1": "import numpy as np\nimport time\n\n# Create key based on timestamp\nKEY = time.time()\nnp.random.seed(int(KEY))\n\n# Read in message\nwith open('Message.txt', 'r') as f:\n\tMessage = f.read()\n\tf.close()\n\n# Generate vector of ra... | [
0
] |
<|reserved_special_token_0|>
class Demo(ConanFile):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
... | flexible | {
"blob_id": "c9bc331f4805a956146619c59d183fc3bcbe47cb",
"index": 9728,
"step-1": "<mask token>\n\n\nclass Demo(ConanFile):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask... | [
3,
4,
5,
6,
8
] |
"""
Escreva um programa que leia as coordenadas x e y de um ponto R² e calcule
sua distância da origem(0,0).
"""
import math
print("Origem = 0")
x = int(input("X: "))
y = int(input("Y: "))
aux = (x*x)+(y*y)
dist = math.sqrt(aux)
print("Distância da origem {:.2f}".format(dist)) | normal | {
"blob_id": "69d48bc9ecd0f003d7b22c6fbaa532d28137b38e",
"index": 7713,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('Origem = 0')\n<mask token>\nprint('Distância da origem {:.2f}'.format(dist))\n",
"step-3": "<mask token>\nprint('Origem = 0')\nx = int(input('X: '))\ny = int(input('Y: '))\naux =... | [
0,
1,
2,
3,
4
] |
# 2. Отсортируйте по возрастанию методом слияния одномерный вещественный массив,
# заданный случайными числами на промежутке [0; 50).
# Выведите на экран исходный и отсортированный массивы.
from random import randint
# создаем массив [0, 50) случайных чисел
size = 13
array = [randint(0, 50) for x in range(s... | normal | {
"blob_id": "cd1987f09ca3e09ac251b1ebdec4168fd5dbdd0e",
"index": 7607,
"step-1": "<mask token>\n\n\ndef merge_sort(merged_arr: list):\n \"\"\"\n функция делит поданный на вход массив,\n и рекурсивно все сортирует слиянием\n :param merged_arr: - список на входе\n :return: - список отсортированный с... | [
2,
3,
4,
5,
6
] |
'''
Aluno: Lucas Airam Castro de Souza
Resumo: Programa para calcular a raiz com a precisão n de casas decimais
def raiz(numero, casas_decimais=0):
if ((numero == 0) or (numero == 1)):
return "O resultado eh: " + str(numero)
elif (numero<0):
return "A raiz nao existe no conjunto rea... | normal | {
"blob_id": "5c174dd514d0a7d9aa932fcb436f22d9a44d2327",
"index": 1486,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef raiz(numero):\n casas_decimais = 18\n if numero == 0 or numero == 1:\n return 'O resultado eh: ' + str(numero)\n elif numero < 0:\n return 'A raiz nao exist... | [
0,
1,
2
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
plt.figure()
<|reserved_special_token_0|>
for color, i, target_name in zip(colors, [0, 1, 2], target_names):
plt.scatter(X_r[y == i, 0], X_r[y == i, 1], color=color, alpha=0.8, lw=
lw, label=target_name)
plt.legend(loc... | flexible | {
"blob_id": "d0448ca8e3fd2f3bb8a3a7ec052e29ab0be6351a",
"index": 471,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nplt.figure()\n<mask token>\nfor color, i, target_name in zip(colors, [0, 1, 2], target_names):\n plt.scatter(X_r[y == i, 0], X_r[y == i, 1], color=color, alpha=0.8, lw=\n lw, lab... | [
0,
1,
2,
3,
4
] |
from pymoo.model.duplicate import ElementwiseDuplicateElimination
class ChrDuplicates(ElementwiseDuplicateElimination):
"""Detects duplicate chromosome, which the base ElementwiseDuplicateElimination then removes."""
def is_equal(self, a, b):
"""
Checks whether two character chromosome elemen... | normal | {
"blob_id": "9276c4106cbe52cf0e2939b5434d63109910a45c",
"index": 8801,
"step-1": "<mask token>\n\n\nclass ChrDuplicates(ElementwiseDuplicateElimination):\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass ChrDuplicates(ElementwiseDuplicateElimination):\n <mask token>\n\n def is_eq... | [
1,
2,
3,
4
] |
<|reserved_special_token_0|>
@tasks.route('/my_tasks', methods=['GET', 'POST'])
@login_required
def my_tasks():
_all_tasks = MyTaskModel.query.filter_by(users_id=current_user.id).all()
return render_template('tasks/my_tasks.html', all_tasks=_all_tasks,
_active_tasks=True)
<|reserved_special_token_0|... | flexible | {
"blob_id": "7882504f08e871f2610ff633608eb3d380179041",
"index": 1735,
"step-1": "<mask token>\n\n\n@tasks.route('/my_tasks', methods=['GET', 'POST'])\n@login_required\ndef my_tasks():\n _all_tasks = MyTaskModel.query.filter_by(users_id=current_user.id).all()\n return render_template('tasks/my_tasks.html',... | [
4,
5,
6,
7,
8
] |
from os import environ
import boto3
from flask import Flask, redirect
from flask_sqlalchemy import SQLAlchemy
from json import load
from pathlib import Path
path = Path(__file__).parent
db = SQLAlchemy()
with open(path / "../schemas.json", "r") as fp:
schemas = load(fp)
with open(path / "../config.json", "r"... | normal | {
"blob_id": "631904ae96584bd19756f9335175a419397ac252",
"index": 8562,
"step-1": "<mask token>\n\n\n@app.route('/')\ndef redirect_to_swagger():\n return redirect('/swagger', 302)\n",
"step-2": "<mask token>\nwith open(path / '../schemas.json', 'r') as fp:\n schemas = load(fp)\nwith open(path / '../config... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
__all__ = ['NUMPY_LT_1_10_4', 'NUMPY_LT_1_11', 'NUMPY_LT_1_12',
'NUMPY_LT_1_13', 'NUMPY_LT_1_14', 'NUMPY_LT_1_14_1', 'NUMPY_LT_1_14_2']
NUMPY_LT_1_10_4 = not minversion('numpy', '1.10.4')
NUMPY_LT_1_11 = not minversion('numpy'... | flexible | {
"blob_id": "9376d697158faf91f066a88e87d317e79a4d9240",
"index": 6575,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n__all__ = ['NUMPY_LT_1_10_4', 'NUMPY_LT_1_11', 'NUMPY_LT_1_12',\n 'NUMPY_LT_1_13', 'NUMPY_LT_1_14', 'NUMPY_LT_1_14_1', 'NUMPY_LT_1_14_2']\nNUMPY_LT_1_10_4 = not minversion('numpy', '1.... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class BloomFilter:
def __init__(self):
bit_array = bitarray(BIT_SIZE)
bit_array.setall(0)
self.bit_array = bit_array
def add(self, val):
point_list = self.get_postions(val)
for b in point_list:
self.bit_array[b] = 1
<|reser... | flexible | {
"blob_id": "5a103a4f72b9cd3ea3911aeefeeb2194c8ad7df0",
"index": 589,
"step-1": "<mask token>\n\n\nclass BloomFilter:\n\n def __init__(self):\n bit_array = bitarray(BIT_SIZE)\n bit_array.setall(0)\n self.bit_array = bit_array\n\n def add(self, val):\n point_list = self.get_posti... | [
4,
5,
6,
7,
9
] |
from django.http import HttpResponse
from django.shortcuts import render
from dashboard.models import Farmer
import random, json, requests
from django.core import serializers
from collections import namedtuple
def sendSMS(message):
if message:
assert isinstance(message, (str, unicode))
payload = {... | normal | {
"blob_id": "0d07ad60c58828ce19153063fb5d7d80135cb9ec",
"index": 9737,
"step-1": "from django.http import HttpResponse\nfrom django.shortcuts import render\nfrom dashboard.models import Farmer\nimport random, json, requests\nfrom django.core import serializers\n\nfrom collections import namedtuple\n\ndef sendSMS... | [
0
] |
#! /usr/bin/env python
from nutils import *
@log.title
def makeplots( domain, geom, c, psi, index ):
force = c * psi.grad(geom)
xpnt, cpnt = domain.elem_eval( [ geom, c ], ischeme='bezier5', title='mesh', separate=True )
xy, uv = domain.elem_eval( [ geom, force ], ischeme='uniform1', title='quiver', separate=... | normal | {
"blob_id": "bf2a827e9c314da2ce9ad9f8f61b82c9c798e2f9",
"index": 1942,
"step-1": "#! /usr/bin/env python\n\nfrom nutils import *\n\n\n@log.title\ndef makeplots( domain, geom, c, psi, index ):\n\n force = c * psi.grad(geom)\n xpnt, cpnt = domain.elem_eval( [ geom, c ], ischeme='bezier5', title='mesh', separate=... | [
0
] |
# A perfect number is a number for which the sum of its proper divisors is exactly equal to the number.
# For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28,
# which means that 28 is a perfect number.
#
# A number whose proper divisors are less than the number is called deficient a... | normal | {
"blob_id": "8ca77ed608108a9aa693acb686156e661794d7ab",
"index": 394,
"step-1": "# A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. \r\n# For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, \r\n# which means that 28 is a perfect... | [
0
] |
'''''''''''''''''''''''''''''
> Filename: lv6.py
> Author: Kadrick, BoGwon Kang
> Created at: 2021/10/11 16:07
> Description: zip
'''''''''''''''''''''''''''''
import zipfile
import re
# open zipfile
zfile = zipfile.ZipFile('./channel.zip')
# check list
'''
print(zfile.namelist())
print(zfile.read("readme.txt"))
prin... | normal | {
"blob_id": "b1fe7e318c361930c8ad00758bcb86597fd8f3bd",
"index": 2567,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwhile True:\n answer = zfile.read(nothing).decode('utf-8')\n comments += zfile.getinfo(nothing).comment.decode('utf-8')\n print(answer)\n findRet = re.findall(target, answer)\... | [
0,
1,
2,
3,
4
] |
"""AOC Day 13"""
import pathlib
import time
TEST_INPUT = """6,10
0,14
9,10
0,3
10,4
4,11
6,0
6,12
4,1
0,13
10,12
3,4
3,0
8,4
1,10
2,14
8,10
9,0
fold along y=7
fold along x=5"""
def read_input(input_path: str) -> str:
"""take input file path and return a str with the file's content"""
with open(input_path, '... | normal | {
"blob_id": "bda28e5a0cb8a3dddea58c9c59a165b31274ac03",
"index": 5225,
"step-1": "<mask token>\n\n\ndef extract(input_data: str) ->tuple:\n \"\"\"take input data and return the appropriate data structure\"\"\"\n sheet = set()\n folds = list()\n s_instr, f_instr = input_data.split('\\n\\n')\n for l... | [
5,
8,
10,
11,
12
] |
import cgi
import os
import math
import sys
from datetime import datetime
sys.path.append(os.path.join(os.path.dirname(__file__), 'pygooglechart-0.2.1'))
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from pygooglechart import PieChart3D
from LPData import Totals
fr... | normal | {
"blob_id": "d8c9e1098dde9d61341ebc3c55eada5592f4b71a",
"index": 2891,
"step-1": "<mask token>\n\n\ndef stacked_vertical():\n total = Totals.get_or_insert('total')\n if len(total.shirts) == 0:\n shirts = sorted(T_Shirts, key=lambda shirt: shirt[0])\n for shirt in shirts:\n total.sh... | [
4,
5,
6,
7,
8
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for items in pd_fetch_tourspot_visitor(district='서울특별시', year=2017, month=7):
print(items)
<|reserved_special_token_0|>
print(item)
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for items in pd_fetch_tourspot_vi... | flexible | {
"blob_id": "c6a6b8f2485528af479fadbdf286e82f10a11de8",
"index": 9101,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor items in pd_fetch_tourspot_visitor(district='서울특별시', year=2017, month=7):\n print(items)\n<mask token>\nprint(item)\n",
"step-3": "<mask token>\nfor items in pd_fetch_tourspot_vi... | [
0,
1,
2,
3,
4
] |
# Authors: Robert Luke <mail@robertluke.net>
#
# License: BSD (3-clause)
import numpy as np
from mne.io.pick import _picks_to_idx
def run_GLM(raw, design_matrix, noise_model='ar1', bins=100,
n_jobs=1, verbose=0):
"""
Run GLM on data using supplied design matrix.
This is a wrapper function fo... | normal | {
"blob_id": "8279c6d5f33d5580bef20e497e2948461a1de62c",
"index": 7951,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef run_GLM(raw, design_matrix, noise_model='ar1', bins=100, n_jobs=1,\n verbose=0):\n \"\"\"\n Run GLM on data using supplied design matrix.\n\n This is a wrapper functio... | [
0,
1,
2,
3,
4
] |
# -*- coding:utf-8 -*-
# class TreeLinkNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution:
"""
给定一个二叉树和其中的一个结点,请找出中序遍历顺序的下一个结点并且返回。
注意,树中的结点不仅包含左右子结点,同时包含指向父结点的指针。
"""
def GetNext(self, pNode):
... | normal | {
"blob_id": "57f8584a8d058e5f9d4e0b7b75c7ec8dbbfef24a",
"index": 9681,
"step-1": "<mask token>\n",
"step-2": "class Solution:\n <mask token>\n <mask token>\n",
"step-3": "class Solution:\n <mask token>\n\n def GetNext(self, pNode):\n\n def left_most(p):\n if p == None:\n ... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
@jsii.interface(jsii_type='aws-cdk-lib.aws_chatbot.ISlackChannelConfiguration')
class ISlackChannelConfiguration(_IResource_c80c4260, _IGrantable_71c4f5de,
_INotificationRuleTarget_faa3b79b, typing_extensions.Protocol):
<|reserved_special_token_0|>
<|reserved_special_token_0|>... | flexible | {
"blob_id": "937fd6aa7bd21258bd6e0f592d94a966519ef885",
"index": 9458,
"step-1": "<mask token>\n\n\n@jsii.interface(jsii_type='aws-cdk-lib.aws_chatbot.ISlackChannelConfiguration')\nclass ISlackChannelConfiguration(_IResource_c80c4260, _IGrantable_71c4f5de,\n _INotificationRuleTarget_faa3b79b, typing_extension... | [
39,
61,
66,
75,
85
] |
from __future__ import print_function
import ot
import torch
import numpy as np
from sklearn.neighbors import KernelDensity
from torch.utils.data import Dataset
import jacinle.io as io
import optimal_transport_modules.pytorch_utils as PTU
import optimal_transport_modules.generate_data as g_data
from optimal_transport_m... | normal | {
"blob_id": "0ee902d59d3d01b6ec8bb4cc8d5e8aa583644397",
"index": 1298,
"step-1": "<mask token>\n\n\ndef kde_Gaussian_fitting(miu, bandwidth):\n kde_analyzer = KernelDensity(kernel='gaussian', bandwidth=bandwidth).fit(\n miu)\n return kde_analyzer\n\n\n<mask token>\n\n\ndef second_moment_all_dist(bat... | [
12,
13,
17,
21,
22
] |
<|reserved_special_token_0|>
def sextractor(location):
"""
runs SExtractor on all residual images
"""
x = 0
sources = location + '/sources'
residuals = location + '/residuals'
check = os.path.exists(sources)
check_temp = os.path.exists(sources + '/temp')
length = len(residuals) + 1... | flexible | {
"blob_id": "6f5eda426daf5db84dc205f36ec31e9076acb8ee",
"index": 8971,
"step-1": "<mask token>\n\n\ndef sextractor(location):\n \"\"\"\n runs SExtractor on all residual images\n \"\"\"\n x = 0\n sources = location + '/sources'\n residuals = location + '/residuals'\n check = os.path.exists(so... | [
8,
9,
10,
11,
12
] |
import os
from unittest import TestCase
from pyfibre.gui.file_display_pane import FileDisplayPane
from pyfibre.tests.fixtures import (
directory,
test_image_path)
from pyfibre.tests.probe_classes.parsers import ProbeParser
from pyfibre.tests.probe_classes.readers import ProbeMultiImageReader
source_dir = os.p... | normal | {
"blob_id": "7c65d0bdd4fd808b3d87706357a651601368e43b",
"index": 8596,
"step-1": "<mask token>\n\n\nclass TestFileDisplayPane(TestCase):\n\n def setUp(self):\n self.file_display = FileDisplayPane(supported_readers={'Probe':\n ProbeMultiImageReader()}, supported_parsers={'Probe':\n ... | [
5,
6,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
ec2.add_dependency(net)
<|reserved_special_token_0|>
alb.add_dependency(net)
alb.add_dependency(ec2)
alb.add_dependency(cert)
<|reserved_special_token_0|>
aga.add_dependency(net)
aga.add_dependency(cert)
aga.add_dependency(alb)
ap... | flexible | {
"blob_id": "2f96e58a825744ae6baafd1bfb936210500f0fd0",
"index": 6334,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nec2.add_dependency(net)\n<mask token>\nalb.add_dependency(net)\nalb.add_dependency(ec2)\nalb.add_dependency(cert)\n<mask token>\naga.add_dependency(net)\naga.add_dependency(cert)\naga.add... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def gets(input):
return input.readline().strip()
<|reserved_special_token_0|>
def main():
result = run(sys.stdin)
print(result)
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def gets(input):
return input.readline().strip(... | flexible | {
"blob_id": "a1ea0f269a20ff608d10ee01804eeee7e7232b1d",
"index": 7650,
"step-1": "<mask token>\n\n\ndef gets(input):\n return input.readline().strip()\n\n\n<mask token>\n\n\ndef main():\n result = run(sys.stdin)\n print(result)\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\ndef gets(input):\n r... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def application(env, handle_headers):
status = '200'
response_headers = [('Server', '')]
return ''
<|reserved_special_token_1|>
# coding:utf-8
def application(env,handle_headers):
status="200"
response_headers=[
('Server','')
... | flexible | {
"blob_id": "8c318d7152bfdf2bc472258eb87dfa499b743193",
"index": 797,
"step-1": "<mask token>\n",
"step-2": "def application(env, handle_headers):\n status = '200'\n response_headers = [('Server', '')]\n return ''\n",
"step-3": "# coding:utf-8\n\n\ndef application(env,handle_headers):\n status=\"... | [
0,
1,
2
] |
from microbit import *
import music
while True:
if button_a.is_pressed():
music.pitch(400, 500)
| normal | {
"blob_id": "356c817e254d8885beb447aa10759fff6a45ca25",
"index": 9454,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwhile True:\n if button_a.is_pressed():\n music.pitch(400, 500)\n",
"step-3": "from microbit import *\nimport music\nwhile True:\n if button_a.is_pressed():\n music.... | [
0,
1,
2
] |
# Generated by Django 3.0.7 on 2020-12-16 15:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('play', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='playerA',
... | normal | {
"blob_id": "ea414835554ea3dcac2017036692cf178526f91b",
"index": 5641,
"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 = [('play', '000... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class ConfigurationParser:
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def ParseVlan(self, cuName):
intPattern = (
'interface GigabitEthernet0\\/0.([0-9]+)\\n\\s+encapsulation\\s+dot1Q [0-9]+\\n\\s+ip vrf forwarding %s'
% cuName)... | flexible | {
"blob_id": "582cbacd26f4a3ed0b4f5c85af67758de7c05836",
"index": 7396,
"step-1": "<mask token>\n\n\nclass ConfigurationParser:\n <mask token>\n <mask token>\n\n def ParseVlan(self, cuName):\n intPattern = (\n 'interface GigabitEthernet0\\\\/0.([0-9]+)\\\\n\\\\s+encapsulation\\\\s+dot1Q... | [
2,
6,
7,
8,
9
] |
"""
Copyright (c) 2017- Sinergise and contributors
For the full list of contributors, see the CREDITS file in the root directory of this source tree.
This source code is licensed under the MIT license, see the LICENSE file in the root directory of this source tree.
"""
import numpy as np
import pytest
from numpy.test... | normal | {
"blob_id": "b7d7b6c070f237f9ab59f3367417ecf2672fbaaf",
"index": 6437,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\n@pytest.mark.parametrize(('num_of_elements', 'middle_idx', 'window_size',\n 'expected_indices'), [(100, 0, 10, (0, 10)), (100, 1, 10, (0, 10)), (\n 100, 50, 10, (45, 55)), (271,... | [
0,
2,
3,
4,
5
] |
#
# PySNMP MIB module CISCO-LWAPP-CLIENT-ROAMING-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-CLIENT-ROAMING-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:04:56 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ... | normal | {
"blob_id": "76fbe055b53af9321cc0d57a210cfffe9188f800",
"index": 6531,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nciscoLwappClRoamMIB.setRevisions(('2010-01-29 00:00', '2006-04-11 00:00'))\nif getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):\n if mibBuilder.loadTexts:\n ciscoLwappClRo... | [
0,
1,
2,
3
] |
# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
NGramHash
"""
import numbers
from ..utils.entrypoints import Component
from ..utils.utils import try_set
def n_gram_hash(
hash_bits=16,
ngram_length=1,
skip_length=0,
all_lengths=True,
seed=314489979,
... | normal | {
"blob_id": "fb1974ad7ac9ae54344812814cb95a7fccfefc66",
"index": 5880,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef n_gram_hash(hash_bits=16, ngram_length=1, skip_length=0, all_lengths=\n True, seed=314489979, ordered=True, invert_hash=0, **params):\n \"\"\"\n **Description**\n ... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
def foo():
time.sleep(0.1)
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def foo():
time.sleep(0.1)
<|reserved_special_token_0|>
p.start()
print('process running: ', p, p.is_alive())
p.terminate()
print('process running: ', p, p.is... | flexible | {
"blob_id": "19aad7d45416e311530aa2ce3e854cf1f65d18f5",
"index": 960,
"step-1": "<mask token>\n\n\ndef foo():\n time.sleep(0.1)\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\ndef foo():\n time.sleep(0.1)\n\n\n<mask token>\np.start()\nprint('process running: ', p, p.is_alive())\np.terminate()\nprint('... | [
1,
2,
3,
4,
5
] |
You are given a 2 x N board, and instructed to completely cover the board with
the following shapes:
Dominoes, or 2 x 1 rectangles.
Trominoes, or L-shapes.
For example, if N = 4, here is one possible configuration, where A is
a domino, and B and C are trominoes.
A B B C
A B C C
Given an in... | normal | {
"blob_id": "834fa5d006188da7e0378246c1a019da6fa413d2",
"index": 4882,
"step-1": "You are given a 2 x N board, and instructed to completely cover the board with\nthe following shapes:\n\n Dominoes, or 2 x 1 rectangles.\n Trominoes, or L-shapes.\n For example, if N = 4, here is one possible configuration... | [
0
] |
# coding: utf-8
"""
CityPay POS API
CityPay Point of Sale API for payment with card present devices including EMV readers and contactless POS readers. The API is available from https://github.com/citypay/citypay-pos-api The API makes it simple to add EMV and contactless card acceptance to iOS, Android, Tabl... | normal | {
"blob_id": "775ac823f6784510fa919b08ee4150eb500710c4",
"index": 6423,
"step-1": "# coding: utf-8\n\n\"\"\"\n CityPay POS API\n\n CityPay Point of Sale API for payment with card present devices including EMV readers and contactless POS readers. The API is available from https://github.com/citypay/citypay-... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for i in range(0, n):
num = int(input())
if num > max_number:
max_number = num
if num < min_number:
min_number = num
print(f'Max number: {max_number}')
print(f'Min number: {min_number}')
<|reserved_sp... | flexible | {
"blob_id": "ac6f2287390bdad8fe20cdc73c0063f685970cfb",
"index": 5289,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor i in range(0, n):\n num = int(input())\n if num > max_number:\n max_number = num\n if num < min_number:\n min_number = num\nprint(f'Max number: {max_number}')\n... | [
0,
1,
2,
3,
4
] |
# Give a string that represents a polynomial (Ex: "3x ^ 3 + 5x ^ 2 - 2x - 5") and
# a number (whole or float). Evaluate the polynomial for the given value.
#Horner method
def horner( poly, x):
result = poly[0]
for i in range(1 , len(poly)):
result = result*x + poly[i]
return result
# Let us evalua... | normal | {
"blob_id": "750565af03d945fbdc32e26347b28977b203e9dc",
"index": 4858,
"step-1": "<mask token>\n",
"step-2": "def horner(poly, x):\n result = poly[0]\n for i in range(1, len(poly)):\n result = result * x + poly[i]\n return result\n\n\n<mask token>\n",
"step-3": "def horner(poly, x):\n resu... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for i in range(0, len(zi)):
x = input('dati salariul de: {} '.format(zi[i]))
V.append(int(x))
print('Salariul in fiecare zi: {}'.format(V))
print(sum(V))
print(round(sum(V) / 7, 2))
print(max(V))
<|reserved_special_token_0... | flexible | {
"blob_id": "6c91114e0c32628b64734000c82354105032b2fd",
"index": 7954,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor i in range(0, len(zi)):\n x = input('dati salariul de: {} '.format(zi[i]))\n V.append(int(x))\nprint('Salariul in fiecare zi: {}'.format(V))\nprint(sum(V))\nprint(round(sum(V) /... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def solution(S):
log_sep = ','
num_sep = '-'
time_sep = ':'
from collections import defaultdict
bill = defaultdict(int)
total = defaultdict(int)
calls = S.splitlines()
maximal = 0
free_number = 0
for call in calls:
... | flexible | {
"blob_id": "bf8bbeb408cb75af314ef9f3907456036e731c0b",
"index": 294,
"step-1": "<mask token>\n",
"step-2": "def solution(S):\n log_sep = ','\n num_sep = '-'\n time_sep = ':'\n from collections import defaultdict\n bill = defaultdict(int)\n total = defaultdict(int)\n calls = S.splitlines()... | [
0,
1,
2
] |
import sys, math
nums = sys.stdin.readline().split(" ")
my_set = set()
my_list = []
for i in xrange(int(nums[1])):
inpt = int(sys.stdin.readline())
my_set.add(inpt)
my_list.append(inpt)
x = 0
for i in xrange(1, int(nums[0]) + 1):
if (i in my_set):
continue
while (x < len(my_list) and my_l... | normal | {
"blob_id": "3efa5eb97af116929a7426ed3bfb5e4a170cfacd",
"index": 3014,
"step-1": "import sys, math\n\nnums = sys.stdin.readline().split(\" \")\nmy_set = set()\nmy_list = []\nfor i in xrange(int(nums[1])):\n inpt = int(sys.stdin.readline())\n my_set.add(inpt)\n my_list.append(inpt)\n\nx = 0\nfor i in xra... | [
0
] |
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [path('', views.PostList.as_view(), name='blog_index'), path(
'<slug:slug>/', views.post_detail, name='post_detail'), path(
'tag/<slug:slug>/', views.TagIndexView.as_view(),... | normal | {
"blob_id": "09ea684cfb6f0a521d3bdadf977d9385636bdc83",
"index": 7150,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nurlpatterns = [path('', views.PostList.as_view(), name='blog_index'), path(\n '<slug:slug>/', views.post_detail, name='post_detail'), path(\n 'tag/<slug:slug>/', views.TagIndexView.... | [
0,
1,
2
] |
import contextlib
import dask
import dask.array as da
import packaging.version
import pandas
import six
import sklearn
SK_VERSION = packaging.version.parse(sklearn.__version__)
DASK_VERSION = packaging.version.parse(dask.__version__)
PANDAS_VERSION = packaging.version.parse(pandas.__version__)
@contextlib.contextma... | normal | {
"blob_id": "1bdb19373960e4f63d80d6ab73ec3c0939e40b7f",
"index": 364,
"step-1": "<mask token>\n\n\n@contextlib.contextmanager\ndef dummy_context(*args, **kwargs):\n yield\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\n@contextlib.contextmanager\ndef dummy_context(*args, **kwargs):\n yield\n\n\nif six... | [
1,
2,
3,
4,
5
] |
import os
import sys
import platform
import numpy as np
import sklearn.preprocessing as sp
def deal_with_ohe(raw_sample):
# --------------------#
# 10 100 0001 #
# 01 010 1000 #
# 10 001 0100 #
# 01 100 0010 #
# --------------------#
ohe_sample... | normal | {
"blob_id": "0b0282ade565eb4031cef3a2fa8605249f104d9d",
"index": 2438,
"step-1": "<mask token>\n\n\ndef main(argc, argv, envir):\n raw_samples = np.array([[0, 0, 3], [1, 1, 0], [0, 2, 1], [1, 0, 2]])\n deal_with_ohe(raw_samples)\n ohe = sp.OneHotEncoder(sparse=False, dtype=int)\n ohe_samples = ohe.fi... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class TodoListViewSet(viewsets.ModelViewSet):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def delete(self, request, pk=None):
instance = TodoList.objects.get(id=pk)
instance.delete()
... | flexible | {
"blob_id": "2d4680b63cdd05e89673c4bd6babda7ac6ebb588",
"index": 8895,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass TodoListViewSet(viewsets.ModelViewSet):\n <mask token>\n <mask token>\n\n def delete(self, request, pk=None):\n instance = TodoList.objects.get(id=pk)\n i... | [
0,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
class Redeemed(commands.Converter):
async def convert(self, ctx, argument):
argument = await commands.MemberConverter().convert(ctx, argument)
muted = discord.utils.get(ctx.guild.roles, name='Muted')
if muted in argument.roles:
return argument
... | flexible | {
"blob_id": "16cd89a43a1985276bd14d85ad8ddb990c4d82c3",
"index": 6136,
"step-1": "<mask token>\n\n\nclass Redeemed(commands.Converter):\n\n async def convert(self, ctx, argument):\n argument = await commands.MemberConverter().convert(ctx, argument)\n muted = discord.utils.get(ctx.guild.roles, na... | [
4,
5,
7,
8,
9
] |
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.views.generic.base import View
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
# from com_search.get_info import Search as Search_1
# from com_search.models import CompanyType
import json
# Cr... | normal | {
"blob_id": "e5e7856d752f14e0671bae8d8b7997207c667ae1",
"index": 6602,
"step-1": "<mask token>\n\n\nclass SearchSuggest(View):\n <mask token>\n\n\nclass SearchDetail(View):\n\n def get(self, request):\n key_words = request.GET.get('q', '')\n data = {}\n if key_words:\n es = ... | [
5,
6,
7,
8,
9
] |
/home/runner/.cache/pip/pool/9b/88/a0/f20a7b2f367cd365add3353eba0cf34569d5f62a33587f96cebe6d4360 | normal | {
"blob_id": "12f05f42c9ed56d6a2c95fb56a8619fae47a2f1a",
"index": 6035,
"step-1": "/home/runner/.cache/pip/pool/9b/88/a0/f20a7b2f367cd365add3353eba0cf34569d5f62a33587f96cebe6d4360",
"step-2": null,
"step-3": null,
"step-4": null,
"step-5": null,
"step-ids": [
0
]
} | [
0
] |
#!/usr/bin/env python
import argparse
import sys
import logging
import vafator
from vafator.power import DEFAULT_FPR, DEFAULT_ERROR_RATE
from vafator.hatchet2bed import run_hatchet2bed
from vafator.ploidies import PloidyManager
from vafator.annotator import Annotator
from vafator.multiallelic_filter import Mul... | normal | {
"blob_id": "1651865f120ba4fe440549567a8d9903e5455788",
"index": 5774,
"step-1": "<mask token>\n\n\ndef annotator():\n parser = argparse.ArgumentParser(description='vafator v{}'.format(\n vafator.VERSION), formatter_class=argparse.\n ArgumentDefaultsHelpFormatter, epilog=epilog)\n parser.add_... | [
3,
4,
5,
6,
7
] |
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test support for the various "EMPTY" WKT geometry representations.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
#############################################... | normal | {
"blob_id": "1ef1dcc8fdf4d813dad70c860e33778715d51b0c",
"index": 1575,
"step-1": "<mask token>\n\n\nclass TestWktEmpty:\n\n def __init__(self, inString, expectedOutString):\n self.inString = inString\n self.expectedOutString = expectedOutString\n\n def isEmpty(self, geom):\n try:\n ... | [
5,
6,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
from django.contrib import admin
<|reserved_special_token_1|>
from django.contrib import admin
# from .models import Usuario
# from .models import Lote
# from .models import Fornecedor
# from .models import Cliente
# from .models import Medicamento
# from ... | flexible | {
"blob_id": "63a2258bf0ed779254b68a683e3d30e9fb356b1f",
"index": 139,
"step-1": "<mask token>\n",
"step-2": "from django.contrib import admin\n",
"step-3": "from django.contrib import admin\n# from .models import Usuario\n# from .models import Lote\n# from .models import Fornecedor\n# from .models import Cli... | [
0,
1,
2
] |
# 문제 풀이 진행중..(나중에 재도전)
import collections
class Solution(object):
def removeStones(self, stones):
"""
:type stones: List[List[int]]
:rtype: int
"""
# 전체 연결점 개수 확인한다.
# 개수가 적은 것 부터 처리한다
# # 연결된 게 0개인 애들은 제외
#
# data init
stones_share_li... | normal | {
"blob_id": "896329a8b14d79f849e4a8c31c697f3981395790",
"index": 3327,
"step-1": "<mask token>\n\n\nclass Solution(object):\n\n def removeStones(self, stones):\n \"\"\"\n :type stones: List[List[int]]\n :rtype: int\n \"\"\"\n stones_share_list = []\n for i in range(le... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
class KitSubImageUrl(models.Model):
image_url = models.URLField(max_length=1000)
kit = models.ForeignKey('kit.Kit', on_delete=models.CASCADE)
class Meta:
db_table = 'kit_sub_image_urls'
class KitLike(models.Model):
user = models.ForeignKey('user.User', on_delet... | flexible | {
"blob_id": "ea2183530667437e086bc89f137e464dec6f363a",
"index": 1800,
"step-1": "<mask token>\n\n\nclass KitSubImageUrl(models.Model):\n image_url = models.URLField(max_length=1000)\n kit = models.ForeignKey('kit.Kit', on_delete=models.CASCADE)\n\n\n class Meta:\n db_table = 'kit_sub_image_urls'... | [
4,
5,
6,
7
] |
from modules.core.logging.logging_service import LoggingService
from modules.core.logging.models import LogLevel, LogEntry
import pytest
from .setup import register_test_db, register_test_injections, teardown,\
drop_all_collections
@pytest.fixture(autouse=True)
def setup():
register_test_db()
... | normal | {
"blob_id": "a29cf9e7006d52cea8f5ccdcbc2087983ffa3ef3",
"index": 2973,
"step-1": "<mask token>\n\n\ndef test_mongo_logging_client_persists_log():\n \"\"\"\n Test to see if the mongodb client logger\n can persist a log entry to the database\n \"\"\"\n error_message = 'This is a test message.'\n ... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
class StackQueue(object):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def enqueue(self, data):
self.stack1.append(data)
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|res... | flexible | {
"blob_id": "24f6328d578b6145bf86d7b5378a081463936df3",
"index": 9670,
"step-1": "<mask token>\n\n\nclass StackQueue(object):\n <mask token>\n <mask token>\n\n def enqueue(self, data):\n self.stack1.append(data)\n <mask token>\n <mask token>\n\n\n<mask token>\n",
"step-2": "<mask token>\n... | [
2,
6,
8,
9,
11
] |
from django.db import models
from .data import REGISTER_TYPE_CHOICES
from .data import ENTRANCE_TYPE
from .data import EXPENSE_TYPE
class EstheticHouse(models.Model):
name = models.CharField(
verbose_name='nombre',
max_length=512,
unique=True,
)
def __str__(self):
return ... | normal | {
"blob_id": "df25b51010fdbcbf1a8949a7a755a3a982bbf648",
"index": 6352,
"step-1": "<mask token>\n\n\nclass Employee(models.Model):\n <mask token>\n <mask token>\n <mask token>\n\n def __str__(self):\n return self.name\n\n\n class Meta:\n ordering = ['name']\n verbose_name = 'Em... | [
7,
8,
18,
19,
20
] |
/home/rip-acer-vn7-591g-1/catkin_ws/devel_cb/.private/nmea_navsat_driver/lib/python2.7/dist-packages/libnmea_navsat_driver/__init__.py | normal | {
"blob_id": "8fd020e7f1854d29cf903f86d91a3a9ffa9d08d3",
"index": 9390,
"step-1": "/home/rip-acer-vn7-591g-1/catkin_ws/devel_cb/.private/nmea_navsat_driver/lib/python2.7/dist-packages/libnmea_navsat_driver/__init__.py",
"step-2": null,
"step-3": null,
"step-4": null,
"step-5": null,
"step-ids": [
0
... | [
0
] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import tensorflow
from pyspark.sql.functions import split
from pyspark.ml.fpm import FPGrowth
from pyspark.sql import SparkSession
from pyspark import SparkConf
from pyspark.sql.functions import udf, array
import re
from pyspark.sql.types import *
import pyspark.sql.functi... | normal | {
"blob_id": "e7d63c3b56459297eb67c56e93a3c640d93e5f6d",
"index": 8683,
"step-1": "<mask token>\n\n\n@udf(returnType=BooleanType())\ndef filter_host(item):\n for i in filter_hosts:\n if item.find(i) != -1:\n return False\n return True\n\n\n<mask token>\n\n\n@udf(returnType=BooleanType())\n... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
app.config.from_object(__name__)
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
app = Flask(__name__)
csrf = CSRFProtect(app)
app.config['SECRET_KEY'] = 'vù÷\x11\x13\x18úMYpí_èÉw\x06\x8eð... | flexible | {
"blob_id": "24c9b562411a63f0d3f2ee509bb60dafe7fbecd1",
"index": 373,
"step-1": "<mask token>\n",
"step-2": "<mask token>\napp.config.from_object(__name__)\n<mask token>\n",
"step-3": "<mask token>\napp = Flask(__name__)\ncsrf = CSRFProtect(app)\napp.config['SECRET_KEY'] = 'vù÷\\x11\\x13\\x18úMYpí_èÉw\\x06\\... | [
0,
1,
2,
3,
4
] |
import os
import sys
from subprocess import check_output
from charmhelpers.fetch import (
apt_install,
apt_update,
add_source,
)
from charmhelpers.core.templating import render
from charmhelpers.contrib.database.mysql import MySQLHelper
def install_mysql(package='mysql-server', sources=None, keys=None)... | normal | {
"blob_id": "083a9555f8db586fbb065d59e4e333bb16ee3d2a",
"index": 5521,
"step-1": "<mask token>\n\n\ndef install_mysql(package='mysql-server', sources=None, keys=None):\n if not sources:\n sources = []\n if not keys:\n keys = []\n from subprocess import Popen, PIPE\n for source in source... | [
9,
10,
11,
13,
14
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
g
<|reserved_special_token_0|>
for _ in range(t):
n.append(int(input()))
<|reserved_special_token_0|>
for i in range(3, index + 1):
d[0][i] = d[1][i - 1] + d[1][i - 3]
d[1][i] = d[0][i] + d[0][i - 2]
for k in n:
if k % 2 == 1:
print(d[... | flexible | {
"blob_id": "524b6ebd0be4c2285fac540627bb48baca71452e",
"index": 2989,
"step-1": "<mask token>\n",
"step-2": "g\n<mask token>\nfor _ in range(t):\n n.append(int(input()))\n<mask token>\nfor i in range(3, index + 1):\n d[0][i] = d[1][i - 1] + d[1][i - 3]\n d[1][i] = d[0][i] + d[0][i - 2]\nfor k in n:\n... | [
0,
1,
2,
3,
4
] |
#!/usr/bin/env python
# encoding: utf-8
"""
plot: regularization on x axis, number of k_best features on y
Created by on 2012-01-27.
Copyright (c) 2012. All rights reserved.
"""
import sys
import os
import json
import numpy as np
import pylab as plt
import itertools as it
from master.libs import plot_lib as plib
... | normal | {
"blob_id": "c5bbfa1a86dbbd431566205ff7d7b941bdceff58",
"index": 1233,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nreload(plib)\nreload(rdl)\n<mask token>\nplt.rcParams.update(params)\n<mask token>\nif not os.path.exists(outpath):\n os.mkdir(outpath)\nplt.close('all')\n<mask token>\nif config['plot... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class BFSWithQueue:
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def run(self, source=None, pre_action=None, post_action=None):
"""Executable pseudocode."""
if source is not None:
self._visit(source, pre_action, post_action)
el... | flexible | {
"blob_id": "0bce5d590b96e434cd8aee7531a321bc648c1981",
"index": 8722,
"step-1": "<mask token>\n\n\nclass BFSWithQueue:\n <mask token>\n <mask token>\n\n def run(self, source=None, pre_action=None, post_action=None):\n \"\"\"Executable pseudocode.\"\"\"\n if source is not None:\n ... | [
8,
10,
11,
12,
14
] |
def alt(h, dt):
t=0
while True:
t=t+1
a=(-6)*(t**4)+ h*(t**3)+2*(t**2)+t
if a<=0:
print('The balloon first touches ground at hour:')
print(t)
break
elif t==dt:
print('The balloon does not touch ground in the given tim... | normal | {
"blob_id": "592f29f08637e511bd7d49a3b58f69b700721d89",
"index": 8083,
"step-1": "<mask token>\n",
"step-2": "def alt(h, dt):\n t = 0\n while True:\n t = t + 1\n a = -6 * t ** 4 + h * t ** 3 + 2 * t ** 2 + t\n if a <= 0:\n print('The balloon first touches ground at hour:')... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Solution:
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Solution:
def slidingPuzzle(self, board: List[List[int]]) ->int:
def board2str(board: List[List[... | flexible | {
"blob_id": "dc934f8db4e0c1113e1398b051b58369d909fff8",
"index": 6471,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Solution:\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Solution:\n\n def slidingPuzzle(self, board: List[List[int]]) ->int:\n\n def board2str(board: List... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
while cantidad <= 0:
print('El numero de preguntas debe ser al menos 1')
cantidad = int(input('Numero de preguntas: '))
for i in range(cantidad):
numero = randint(2, 10)
numero2 = randint(2, 10)
aleatorio = int... | flexible | {
"blob_id": "48bc5d4b191fa631650b60240560dbece6396312",
"index": 655,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwhile cantidad <= 0:\n print('El numero de preguntas debe ser al menos 1')\n cantidad = int(input('Numero de preguntas: '))\nfor i in range(cantidad):\n numero = randint(2, 10)\n ... | [
0,
1,
2,
3,
4
] |
#This file was created by Tate Hagan
from RootGUI import RootGUI
root = RootGUI()
root.mainloop() | normal | {
"blob_id": "d17081ef94df1e14308128341d040559edb81805",
"index": 7100,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nroot.mainloop()\n",
"step-3": "<mask token>\nroot = RootGUI()\nroot.mainloop()\n",
"step-4": "from RootGUI import RootGUI\nroot = RootGUI()\nroot.mainloop()\n",
"step-5": "#This fil... | [
0,
1,
2,
3,
4
] |
## CreateDGNode.py
# This files creates the boilerplate code for a Dependency Graph Node
import FileCreator
## Class to create Maya DG node plugin files
class DGNodeFileCreator(FileCreator.FileCreator):
## Constructor
def __init__(self):
FileCreator.FileCreator.__init__(self, "DGNodePluginData.json")
self.writ... | normal | {
"blob_id": "8271935901896256b860f4e05038763709758296",
"index": 4722,
"step-1": "## CreateDGNode.py\n# This files creates the boilerplate code for a Dependency Graph Node\n\nimport FileCreator\n\n## Class to create Maya DG node plugin files\nclass DGNodeFileCreator(FileCreator.FileCreator):\n\n\t## Constructor\... | [
0
] |
<|reserved_special_token_0|>
class TILA_Config_LogList(bpy.types.UIList):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
class TILA_Config_SatusList(bpy.types.UIList):
bl_idname = 'TILA_UL_Config_status_list'
def draw_item(self, context, layout, data, item, icon, active_data,
act... | flexible | {
"blob_id": "7fa7a632078ce4f0052e3cadf11d5efd47a1fad5",
"index": 831,
"step-1": "<mask token>\n\n\nclass TILA_Config_LogList(bpy.types.UIList):\n <mask token>\n <mask token>\n\n\nclass TILA_Config_SatusList(bpy.types.UIList):\n bl_idname = 'TILA_UL_Config_status_list'\n\n def draw_item(self, context,... | [
12,
13,
14,
15,
17
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for i in range(0, len(L[1])):
con = []
for j in range(0, len(L)):
print(L[j][i])
con.append(L[j][i])
con1.append(con)
<|reserved_special_token_0|>
for k in range(0, len(con1)):
if con1[k].count('A')... | flexible | {
"blob_id": "beb9fe8e37a4f342696a90bc624b263e341e4de5",
"index": 5459,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor i in range(0, len(L[1])):\n con = []\n for j in range(0, len(L)):\n print(L[j][i])\n con.append(L[j][i])\n con1.append(con)\n<mask token>\nfor k in range(0, len... | [
0,
1,
2,
3
] |
#!/usr/bin/python3
"""1. Divide a matrix """
def matrix_divided(matrix, div):
"""Divides a Matrix
Args:
matrix: A list of lists of ints or floats
div: a non zero int or float
Exceptions:
TypeError: if the matrix and/or div is not as stated or the matrix elements
are not of the... | normal | {
"blob_id": "95c5971a102fb2ed84ab0de0471278d0167d8359",
"index": 22,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef matrix_divided(matrix, div):\n \"\"\"Divides a Matrix\n\n Args:\n matrix: A list of lists of ints or floats\n div: a non zero int or float\n\n Exceptions:\n TypeEr... | [
0,
1,
2
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.... | flexible | {
"blob_id": "1073845131afb2446ca68ee10092eeb00feef800",
"index": 3585,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n initial = T... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class Consumer(object):
<|reserved_special_token_0|>
def __init__(self):
self.db_processor = DbProcessor()
credentials = pika.PlainCredentials(config.RABBITMQ_USER, config.
RABBITMQ_PASS)
parameters = pika.ConnectionParameters(config.RABBITMQ_H... | flexible | {
"blob_id": "ff26a2c2d8427f1ad4617669e701ea88b34616cd",
"index": 9152,
"step-1": "<mask token>\n\n\nclass Consumer(object):\n <mask token>\n\n def __init__(self):\n self.db_processor = DbProcessor()\n credentials = pika.PlainCredentials(config.RABBITMQ_USER, config.\n RABBITMQ_PASS... | [
3,
5,
6,
7,
9
] |
from .menu import menu
from .create_portfolio import create_portfolio
from .search import search
from .list_assets import list_assets
from .add_transaction import add_transaction
from .stats import stats
from .info import info
| normal | {
"blob_id": "f2abb7ea3426e37a10e139d83c33011542e0b3d1",
"index": 3863,
"step-1": "<mask token>\n",
"step-2": "from .menu import menu\nfrom .create_portfolio import create_portfolio\nfrom .search import search\nfrom .list_assets import list_assets\nfrom .add_transaction import add_transaction\nfrom .stats impor... | [
0,
1
] |
# coding=utf-8
# flake8:noqa
from .string_helper import (
camelize, uncamelize,
camelize_for_dict_key, camelize_for_dict_key_in_list,
uncamelize_for_dict_key, uncamelize_for_dict_key_in_list
)
from .datetime_helper import datetime_format
from .class_helper import override
from .paginate import paginate2di... | normal | {
"blob_id": "64a590d31be98f7639034662b2a322e5572cc1ae",
"index": 3554,
"step-1": "<mask token>\n",
"step-2": "from .string_helper import camelize, uncamelize, camelize_for_dict_key, camelize_for_dict_key_in_list, uncamelize_for_dict_key, uncamelize_for_dict_key_in_list\nfrom .datetime_helper import datetime_fo... | [
0,
1,
2
] |
from . import UbuntuPackageManager, RedHatPackageManager, SolarisPackageManager, RpmMixin
from infi import unittest
from infi.run_as_root import RootPermissions
from contextlib import contextmanager
from infi import pkgmgr
from mock import patch
import distro
# pylint: disable-all
class TestOnUbuntu(unittest.TestCa... | normal | {
"blob_id": "b3c1843a742a82bca61650ab89ea8afdf3c9010d",
"index": 6667,
"step-1": "<mask token>\n\n\nclass TestUbuntuMock(TestOnUbuntu):\n\n def _should_skip(self):\n pass\n\n def _dpkg_query_s(self):\n from textwrap import dedent\n if self._installed:\n return Output(stdout=... | [
27,
33,
43,
46,
53
] |
from flask import Blueprint, render_template, flash, redirect, url_for, request, current_app, g, session
from flask_login import current_user
from app import decorators
from app.models import User, Post, Comment, Tag
from slugify import slugify
from app.main.forms import CommentForm, TagForm, ProfileForm, ContactForm
f... | normal | {
"blob_id": "4e66fe0485d987da590d11c848009b2e1665b3dc",
"index": 5445,
"step-1": "<mask token>\n\n\ndef manage_prev_page():\n global session, request\n if ('profile' not in request.referrer and 'change_password' not in\n request.referrer and 'forgot_password' not in request.referrer and \n 'r... | [
5,
6,
7,
8,
9
] |
print ("hello guys")
print ("hello everyone") | normal | {
"blob_id": "4d87c3f70809bbd488159f0b55131af903c7e7b4",
"index": 1509,
"step-1": "<mask token>\n",
"step-2": "print('hello guys')\nprint('hello everyone')\n",
"step-3": "print (\"hello guys\")\nprint (\"hello everyone\")",
"step-4": null,
"step-5": null,
"step-ids": [
0,
1,
2
]
} | [
0,
1,
2
] |
import BST
tree = BST.BST(10)
tree.insert(5, tree.root)
tree.insert(15, tree.root)
tree.insert(25, tree.root)
tree.insert(12, tree.root)
tree.insert(35, tree.root)
print(tree.height(tree.root))
| normal | {
"blob_id": "59ddb85d55c342342be4edc1fc3b92af701fa6cc",
"index": 4342,
"step-1": "<mask token>\n",
"step-2": "<mask token>\ntree.insert(5, tree.root)\ntree.insert(15, tree.root)\ntree.insert(25, tree.root)\ntree.insert(12, tree.root)\ntree.insert(35, tree.root)\nprint(tree.height(tree.root))\n",
"step-3": "<... | [
0,
1,
2,
3
] |
#!/usr/bin/env python
import argparse
import xml.etree.cElementTree as ET
from datetime import datetime, timedelta
from requests import codes as requests_codes
from requests_futures.sessions import FuturesSession
from xml.etree import ElementTree as ET
parser = argparse.ArgumentParser(description='Fetch dqm images')... | normal | {
"blob_id": "0d18272f8056f37eddabb024dd769a2793f88c24",
"index": 6064,
"step-1": "#!/usr/bin/env python\n\nimport argparse\nimport xml.etree.cElementTree as ET\n\nfrom datetime import datetime, timedelta\nfrom requests import codes as requests_codes\nfrom requests_futures.sessions import FuturesSession\nfrom xml... | [
0
] |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
month = ['Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb',
'Mar', 'Apr', 'May']
df = pd.DataFrame([[53, 0, 5, 3, 3], [51, 0, 1, 3, 2], [70, 4, 7, 5, 1], [
66, 4, 1, 4, 2], [64, 4, 4, 3, 2], [69, 4, 7, 8, 2], [45, 2, 8, 4, 2],
... | normal | {
"blob_id": "f5c277da2b22debe26327464ae736892360059b4",
"index": 781,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nplt.pcolor(df)\nplt.colorbar()\nplt.yticks(np.arange(0.5, len(df.index), 1), df.index)\nplt.xticks(np.arange(0.5, len(df.columns), 1), df.columns)\nplt.show()\n",
"step-3": "<mask token>... | [
0,
1,
2,
3
] |
#!/usr/bin/python2
import gmpy2
p = 24659183668299994531
q = 28278904334302413829
e = 11
c = 589000442361955862116096782383253550042
t = (p-1)*(q-1)
n = p*q
# returns d such that e * d == 1 modulo t, or 0 if no such y exists.
d = gmpy2.invert(e,t)
# Decryption
m = pow(c,d,n)
print "Solved ! m = %d" % m
| normal | {
"blob_id": "61c2a6499dd8de25045733f9061d660341501314",
"index": 8334,
"step-1": "#!/usr/bin/python2\nimport gmpy2\n\np = 24659183668299994531\nq = 28278904334302413829\ne = 11\nc = 589000442361955862116096782383253550042\nt = (p-1)*(q-1)\nn = p*q\n\n# returns d such that e * d == 1 modulo t, or 0 if no such... | [
0
] |
import networkx as nx
import pytest
from caldera.utils.nx import nx_copy
def add_data(g):
g.add_node(1)
g.add_node(2, x=5)
g.add_edge(1, 2, y=6)
g.add_edge(2, 3, z=[])
def assert_graph_data(g1, g2):
assert g1 is not g2
assert g2.nodes[1] == {}
assert g2.nodes[2] == {"x": 5}
assert g... | normal | {
"blob_id": "7fe7ea89908f9d233dbdb9e46bf2d677406ab324",
"index": 1050,
"step-1": "<mask token>\n\n\ndef add_data(g):\n g.add_node(1)\n g.add_node(2, x=5)\n g.add_edge(1, 2, y=6)\n g.add_edge(2, 3, z=[])\n\n\ndef assert_graph_data(g1, g2):\n assert g1 is not g2\n assert g2.nodes[1] == {}\n as... | [
6,
7,
8,
9,
10
] |
<|reserved_special_token_0|>
class TestClass:
def setUp(self):
search_index.buildIndex(test_data.sample_food_trucks_data)
def tearDown(self):
pass
def test_case_query_index(self):
assert_equals(search_index.query_index, test_data.sample_query_index)
<|reserved_special_token_... | flexible | {
"blob_id": "a9c0251b3422457b2c0089b70308a70b09cfa0e0",
"index": 7276,
"step-1": "<mask token>\n\n\nclass TestClass:\n\n def setUp(self):\n search_index.buildIndex(test_data.sample_food_trucks_data)\n\n def tearDown(self):\n pass\n\n def test_case_query_index(self):\n assert_equals(... | [
11,
13,
14,
18,
19
] |
import pygame
import random
from lb_juego import*
#Dimensiones de la pantalla
ALTO=400
ANCHO=600
#lista de colores basicos
ROJO=(255,0,0)
SALMON=(240,99,99)
BLANCO=(255,255,255)
NEGRO=(0,0,0)
AZUL=(59,131,189)
VERDE=(0,255,0)
if __name__=='__main__':
#Inicializacion de la aplicacion en pygame
pygame.init()
... | normal | {
"blob_id": "85fc2fc0a404c20b1f0806412424192ea4a50a9b",
"index": 7085,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nif __name__ == '__main__':\n pygame.init()\n fuente = pygame.font.Font(None, 36)\n pantalla = pygame.display.set_mode([ANCHO, ALTO])\n pantalla.fill(BLANCO)\n General = pyg... | [
0,
1,
2,
3,
4
] |
from kraken.core.maths import Vec3, Vec3, Euler, Quat, Xfo
from kraken.core.objects.components.base_example_component import BaseExampleComponent
from kraken.core.objects.attributes.attribute_group import AttributeGroup
from kraken.core.objects.attributes.scalar_attribute import ScalarAttribute
from kraken.core.objec... | normal | {
"blob_id": "20167058697450f342c2ac3787bd1721f860dc58",
"index": 3169,
"step-1": "<mask token>\n\n\nclass SimpleControlComponentGuide(SimpleControlComponent):\n <mask token>\n\n def __init__(self, name='SimpleControl', parent=None):\n Profiler.getInstance().push(\n 'Construct Simple Contr... | [
12,
15,
17,
18,
20
] |
from Shapes import *
c1 = Circle(5)
r1 = Rectangle(3,2)
c2 = Circle(3)
c3 = Circle(1)
r2 = Rectangle(1,1)
listShapes = [c1,r1,c2,c3,r2]
for item in listShapes:
print(item.toString())
print("Area: " + str(item.area()))
print("Perimeter: " + str(item.perimeter()))
| normal | {
"blob_id": "9ef5d57d536f5c88f705b1032cc0936e2d4cd565",
"index": 1039,
"step-1": "from Shapes import *\n\nc1 = Circle(5)\nr1 = Rectangle(3,2)\nc2 = Circle(3)\nc3 = Circle(1)\nr2 = Rectangle(1,1)\n\nlistShapes = [c1,r1,c2,c3,r2]\n\nfor item in listShapes:\n\tprint(item.toString())\n\tprint(\"Area: \" + str(item.... | [
0
] |
from wtforms import Form as BaseForm
from wtforms.widgets import ListWidget
class Form(BaseForm):
def as_ul(self):
widget = ListWidget()
return widget(self)
| normal | {
"blob_id": "5dffda8215b8cfdb2459ec6a9e02f10a352a6fd0",
"index": 3173,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Form(BaseForm):\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Form(BaseForm):\n\n def as_ul(self):\n widget = ListWidget()\n return widget(self)\n"... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
BellMusicCreator().write(data, fp=exportFile)
<|reserved_special_token_1|>
data = {'title': 'Dva leteca (gostimo na 2)', 'song': [
'x - - - - - x - - - - -', '- x - - - x - - - x - -',
'- - x - x - - - x - x -', '- - - ... | flexible | {
"blob_id": "957fb1bd34d13b86334da47ac9446e30afd01678",
"index": 5477,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nBellMusicCreator().write(data, fp=exportFile)\n",
"step-3": "data = {'title': 'Dva leteca (gostimo na 2)', 'song': [\n 'x - - - - - x - - - - -', '- x - - - x - - - x - -',\n '- -... | [
0,
1,
2,
3,
4
] |
# Employee Table's Dictionary
employee={
1001:{
"empname":"Ashish",
"Designation Code":'E',
"Department":"R&D",
"Basic": 20000,
"HRA": 8000,
"IT": 3000
},
1002:{
"empname":"Sushma",
"Designation Code":'C',
"Department":"PM",
"Ba... | normal | {
"blob_id": "fcb0fb439db77c4d57c449ec8f720dbd3fef5abc",
"index": 2871,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(\"\"\"\n\nEmployee Details:\nEmployee Id:\"\"\", id, '\\nName:', employee[id][\n 'empname'], '\\nDepartment:', employee[id]['Department'],\n '\\nDesignation:', DA[employee[id]... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class ContactForm(forms.Form):
"""Форма обратной связи"""
subject = forms.CharField(label='Тема', widget=forms.TextInput(attrs={
'class': 'form-control'}))
content = forms.CharField(label='Текст', widget=forms.Textarea(attrs={
'class': 'form-control', 'rows': 5... | flexible | {
"blob_id": "1b4a012f5b491c39c0abd139dd54f2095ea9d221",
"index": 3016,
"step-1": "<mask token>\n\n\nclass ContactForm(forms.Form):\n \"\"\"Форма обратной связи\"\"\"\n subject = forms.CharField(label='Тема', widget=forms.TextInput(attrs={\n 'class': 'form-control'}))\n content = forms.CharField(l... | [
7,
11,
14,
16,
18
] |
import voldemort
import time
authorStore = voldemort.StoreClient('authorStore', [{'0', 6666}])
stack = []
components = []
index = 1
# Implementation of the Tarjan algorithm for the detection of strongly connected components.
# Function collects all authors in the database and outputs them as strongly connected compon... | normal | {
"blob_id": "bb2c684fd5b962c97c033d4b4c2027d52b7371fd",
"index": 499,
"step-1": "<mask token>\n\n\ndef tarjan():\n timer = time.time\n start = timer()\n voldemortResult = authorStore.get('_authors')\n allAuthors = voldemortResult[0][0]\n nodes = {}\n for author in allAuthors.get('content'):\n ... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def main(event: func.EventHubEvent):
logging.info('Python EventHub trigger processed an event: %s', event.
get_body().decode('utf-8'))
<|reserved_special_token_1|>
import logging
import azure.functions as func
d... | flexible | {
"blob_id": "58f8924a9cd2af4106e54b163e96bcd8517282b5",
"index": 2803,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef main(event: func.EventHubEvent):\n logging.info('Python EventHub trigger processed an event: %s', event.\n get_body().decode('utf-8'))\n",
"step-3": "import logging\ni... | [
0,
1,
2
] |
<|reserved_special_token_0|>
def create_axes(length, both=False, text=False, font=_glut.
GLUT_BITMAP_HELVETICA_18):
"""
Create axes system.
:param length: Axes length
:param both: Both axes
:param text: Show axes names (x,y,z)
:param font: Font
:type length: float, int
:type both:... | flexible | {
"blob_id": "cffcfa08cd919f93dfe2ab8dc676efc76feafab3",
"index": 2123,
"step-1": "<mask token>\n\n\ndef create_axes(length, both=False, text=False, font=_glut.\n GLUT_BITMAP_HELVETICA_18):\n \"\"\"\n Create axes system.\n\n :param length: Axes length\n :param both: Both axes\n :param text: Show... | [
2,
3,
5,
6,
7
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(f'(n, e, s, w)={n, e, s, w!r}')
for lat in range(s, n + 1):
for lon in range(w, e + 1):
latdir = 'n' if lat >= 0 else 's'
londir = 'e' if lon >= 0 else 'w'
fname = f'{latdir}{abs(lat):02d}{londir}... | flexible | {
"blob_id": "9f36b846619ca242426041f577ab7d9e4dad6a43",
"index": 3797,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(f'(n, e, s, w)={n, e, s, w!r}')\nfor lat in range(s, n + 1):\n for lon in range(w, e + 1):\n latdir = 'n' if lat >= 0 else 's'\n londir = 'e' if lon >= 0 else 'w'\n... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
from codebase.mod.mod_test import test_f
<|reserved_special_token_1|>
#!/usr/bin/env python
#-*- coding:utf8 -*-
# Power by null 2018-09-19 18:41:17
from codebase.mod.mod_test import test_f
| flexible | {
"blob_id": "7c4709eaa5123b44e6355c6a60932f286e3b1cf5",
"index": 7450,
"step-1": "<mask token>\n",
"step-2": "from codebase.mod.mod_test import test_f\n",
"step-3": "#!/usr/bin/env python\n#-*- coding:utf8 -*-\n# Power by null 2018-09-19 18:41:17\n\nfrom codebase.mod.mod_test import test_f\n",
"step-4": nu... | [
0,
1,
2
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
class Solution:
<|reserved_special_token_0|>
<|reserved_special_token_1|>
class Solution:
def sortArrayByParity(self, A: List[int]) ->List[int]:
l = []
r = []
for x in A:
if x % 2 == 0:
l.append(... | flexible | {
"blob_id": "ae4d12ff88cf08b2e19b212c80549adc0a0d47dc",
"index": 2030,
"step-1": "<mask token>\n",
"step-2": "class Solution:\n <mask token>\n",
"step-3": "class Solution:\n\n def sortArrayByParity(self, A: List[int]) ->List[int]:\n l = []\n r = []\n for x in A:\n if x %... | [
0,
1,
2,
3
] |
# 217 is a prime number. In order 2017 to be a divisor of for sigma(a)=Product((p**(n+1)-1) // (p-1) for all divisors) it must be a power of a prime with (p**(a+1)-1) // (p-1) % 2017 == 0
# so we need only to check all such primes 'p' and count all k*p for k=1..N//p. We check p^n with n>=2 by brute force all primes. F... | normal | {
"blob_id": "fabd3f233753f63d731a43c8b8b311e50d9deefe",
"index": 6349,
"step-1": "<mask token>\n\n\ndef calc(N, D):\n\n def check(n):\n return not sig(factor(n)) % D\n cachePrimes(int(N ** 0.5))\n\n def a2n(a):\n return (a + 1) // D\n from math import log\n\n def genPrimeSigDivs(minA... | [
1,
3,
4,
5,
6
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.