text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_prefix|># repo: kuc2477/anchor-backend path: /app/schedules/models.py
from marshmallow import fields
from sqlalchemy import (
Column, Text
)
from news.models.sqlalchemy import (
create_schedule_abc, create_schedule
)
from ..utils.ma import get_base_schema
from ..users.models import User
from ..extensions... | code_fim | medium | {
"lang": "python",
"repo": "kuc2477/anchor-backend",
"path": "/app/schedules/models.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: takingtheback/-20210517-engineer path: /OurHomeGround/routes/gall_route.py
from datetime import datetime
import os
from flask import request, render_template, redirect, Blueprint,session
from member import GalleryService, Gallery
service = GalleryService()
bp = Blueprint('gallery', __name__, u... | code_fim | hard | {
"lang": "python",
"repo": "takingtheback/-20210517-engineer",
"path": "/OurHomeGround/routes/gall_route.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|># @bp.route('/edit', methods=['POST'])
# def edit():
# num = request.form['gall_num']
# title = request.form['gall_title']
# content = request.form['gall_content']
# date = datetime.now()
# # service.editBoard(Gallery(gall_num=num, gall_date=date, gall_title=title, gall_content=content... | code_fim | hard | {
"lang": "python",
"repo": "takingtheback/-20210517-engineer",
"path": "/OurHomeGround/routes/gall_route.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>@bp.route('/edit', methods=['POST'])
def edit():
num = request.form['gall_num']
title = request.form['gall_title']
content = request.form['gall_content']
date = datetime.now()
service.editBoard(Gallery(gall_num=num, gall_date=date, gall_title=title, gall_content=content))
print("##... | code_fim | hard | {
"lang": "python",
"repo": "takingtheback/-20210517-engineer",
"path": "/OurHomeGround/routes/gall_route.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Baltic-Knights/SDL-Final-Submission path: /app.py
from flask import *
app = Flask(__name__)
@app.route('/')
def hello():
return render_template('index.html')
@app.route('/covid_map')
def covid():
return render_template('covid_map.html')
<|fim_suffix|> return... | code_fim | hard | {
"lang": "python",
"repo": "Baltic-Knights/SDL-Final-Submission",
"path": "/app.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>@app.route('/predict', methods=['POST','GET'])
def predict():
if request.method == 'POST':
#f = request.files.get('file')
f = request.files['file']
fname=f.filename
fname = fname.split(".")
name=fname[0]
return render_template('index.html', pre... | code_fim | medium | {
"lang": "python",
"repo": "Baltic-Knights/SDL-Final-Submission",
"path": "/app.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if request.method == 'POST':
#f = request.files.get('file')
f = request.files['file']
fname=f.filename
fname = fname.split(".")
name=fname[0]
return render_template('index.html', pred1="Condition of given X-ray Scan : {} ".format(name))
... | code_fim | medium | {
"lang": "python",
"repo": "Baltic-Knights/SDL-Final-Submission",
"path": "/app.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> name=self.request.get("name")
if(name==""):
playername="Anonymous"
else:
playername=name
score=self.request.get("score")
playerscore=int(score)
s = Player(playername=playername, playerscore=playerscore)
s.put()
self.render("base.html")
class ReminderTool(Handler):
def get(self):... | code_fim | hard | {
"lang": "python",
"repo": "fat1996/pacmanversion",
"path": "/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: fat1996/pacmanversion path: /main.py
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | code_fim | hard | {
"lang": "python",
"repo": "fat1996/pacmanversion",
"path": "/main.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: 0x20/ESP32-platform-firmware path: /firmware/python_modules/troopers2020/_device.py
import os, machine, display, easydraw, time, neopixel
def configureWakeupSource():
<|fim_suffix|>def showMessage(message="", icon=None):
easydraw.messageCentered(message, False, icon)
def setLedPower(state):
p... | code_fim | hard | {
"lang": "python",
"repo": "0x20/ESP32-platform-firmware",
"path": "/firmware/python_modules/troopers2020/_device.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>def showLoadingScreen(app=""):
try:
display.drawFill(0x000000)
display.drawText( 0, 28, "LOADING APP...", 0xFFFFFF, "org18")
display.drawText( 0, 52, app, 0xFFFFFF, "org18")
display.flush()
except:
pass
def showMessage(message="", icon=None):
easydraw.messageCentered(message, Fa... | code_fim | medium | {
"lang": "python",
"repo": "0x20/ESP32-platform-firmware",
"path": "/firmware/python_modules/troopers2020/_device.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> easydraw.messageCentered(message, False, icon)
def setLedPower(state):
pass<|fim_prefix|># repo: 0x20/ESP32-platform-firmware path: /firmware/python_modules/troopers2020/_device.py
import os, machine, display, easydraw, time, neopixel
def configureWakeupSource():
machine.RTC().wake_on_ext0(pin = mac... | code_fim | hard | {
"lang": "python",
"repo": "0x20/ESP32-platform-firmware",
"path": "/firmware/python_modules/troopers2020/_device.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: prabath147/physics-Light-Intensity-vs.-Kinetic-Energy path: /5.py
from matplotlib import pyplot as plt
x = [1,2,3,4]
y = [3,3,3,3]
plt.plot(x,y)
<|fim_suffix|>plt.show()
print("plancks constant =6.6^10-34")
h =6.624*10**-34
c=3*10**8
print("enter frequency ")
f=float(input())
#pri... | code_fim | medium | {
"lang": "python",
"repo": "prabath147/physics-Light-Intensity-vs.-Kinetic-Energy",
"path": "/5.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>plt.show()
print("plancks constant =6.6^10-34")
h =6.624*10**-34
c=3*10**8
print("enter frequency ")
f=float(input())
#print("enter kinetic energy")
#k=float(input())
#print("enter wavelength in nm")
#l=float(input())
print("enter mass of body")
m=int(input())
print("enter velocity of paerticl... | code_fim | medium | {
"lang": "python",
"repo": "prabath147/physics-Light-Intensity-vs.-Kinetic-Energy",
"path": "/5.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>#plottings of Markov Chain and all points
plt.scatter(steps,theta_prime_arr,marker="o",s=5,color='Green',label="other points")
plt.plot(steps,theta_arr,label="Markov chain",color='Blue')
plt.xlabel('steps',fontsize=17)
plt.ylabel(r'$\theta$ [steps]',fontsize=17)
plt.ylim(-4,10)
plt.title('Markov Chain.',f... | code_fim | hard | {
"lang": "python",
"repo": "ritambasu61/sem2_assignment4_computational_physics",
"path": "/problem9.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ritambasu61/sem2_assignment4_computational_physics path: /problem9.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 28 15:47:21 2020
@author: ritambasu
"""
#In this code n=10000000 should be used for better convergence (but it takes very long time to compute)
#for fast c... | code_fim | hard | {
"lang": "python",
"repo": "ritambasu61/sem2_assignment4_computational_physics",
"path": "/problem9.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: tornadoyi/jsshd path: /jsshd/session.py
import asyncio
import asyncssh
from pyplus.collection import qdict
from jsshd.command import run_command
<|fim_suffix|>
def exec_requested(self, command):
async def run_callback(command):
try:
env = qdict(channel=s... | code_fim | hard | {
"lang": "python",
"repo": "tornadoyi/jsshd",
"path": "/jsshd/session.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def exec_requested(self, command):
async def run_callback(command):
try:
env = qdict(channel=self._chan)
result = await run_command(command, env)
if isinstance(result, BaseException):
self._chan.write(str(result) +... | code_fim | hard | {
"lang": "python",
"repo": "tornadoyi/jsshd",
"path": "/jsshd/session.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def __init__(self, server):
self.__user_server = server
def connection_made(self, chan):
self._chan = chan
def shell_requested(self): return False
def exec_requested(self, command):
async def run_callback(command):
try:
env = qdict(cha... | code_fim | hard | {
"lang": "python",
"repo": "tornadoyi/jsshd",
"path": "/jsshd/session.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return total_loss / len(test_loader), total_acc / len(test_loader)
# Main
if __name__ == '__main__':
# Hyper parameters and configs
parser = argparse.ArgumentParser()
parser = program_config(parser)
opt = parser.parse_args()
cfg.init_param(opt)
# Get word2vec dict with embed... | code_fim | hard | {
"lang": "python",
"repo": "universebh/text_generation_fsa_gan",
"path": "/lstm_fsa/train.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: universebh/text_generation_fsa_gan path: /lstm_fsa/train.py
import json
import argparse
import torch
import torch.nn as nn
import pandas as pd
from torch import optim
from torch.utils.data import DataLoader
from gensim.models import Word2Vec
from tqdm import tqdm
import config as cfg
from utils... | code_fim | hard | {
"lang": "python",
"repo": "universebh/text_generation_fsa_gan",
"path": "/lstm_fsa/train.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: gridaco/ui-crawler path: /credentials/credentials_loader.py
import pathlib
import json
current_dir: pathlib.PurePath = pathlib.Path(__file__).parent
google_credentials_file = "./google_browser_login_credentials.json"
google_credentials_file = current_dir.joinpath(google_credentials_file)
print(... | code_fim | medium | {
"lang": "python",
"repo": "gridaco/ui-crawler",
"path": "/credentials/credentials_loader.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def test():
c = load_google_credentials()
print(c)
if __name__ == '__main__':
test()<|fim_prefix|># repo: gridaco/ui-crawler path: /credentials/credentials_loader.py
import pathlib
import json
current_dir: pathlib.PurePath = pathlib.Path(__file__).parent
google_credentials_file = "./go... | code_fim | medium | {
"lang": "python",
"repo": "gridaco/ui-crawler",
"path": "/credentials/credentials_loader.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: yifanjiang/moztrap path: /tests/view/lists/test_cases.py
"""
Tests for test case queryset-filtering by ID and with optional ID prefix.
"""
from sets import Set
from tests import case
from moztrap.view.lists.cases import PrefixIDFilter
class PrefixIDFilterTest(case.DBTestCase):
"""Tests fo... | code_fim | hard | {
"lang": "python",
"repo": "yifanjiang/moztrap",
"path": "/tests/view/lists/test_cases.py",
"mode": "psm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> """
3 cases have 2 different prefixes returns cases from both prefixes.
"""
self.create_testdata()
res = self.filter([u"pre", u"moz"])
self.assertEqual(
Set([x.name for x in res.all()]),
Set(["CV 1", "CV 3", "CV 4"]),
)
... | code_fim | hard | {
"lang": "python",
"repo": "yifanjiang/moztrap",
"path": "/tests/view/lists/test_cases.py",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> """ID as an int"""
td = self.create_testdata()
res = self.filter([int(td["cv1"].case.id)])
self.assertEqual(res.get().name, "CV 1")
def test_id_and_prefix_from_different_cases_gets_both(self):
"""ID from one case and prefix from a different case gets both"""
... | code_fim | hard | {
"lang": "python",
"repo": "yifanjiang/moztrap",
"path": "/tests/view/lists/test_cases.py",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: GodIsMadao/python_learning path: /function.py
# -*- coding: utf-8 -*-
# import os
# print [d for d in os.listdir('.')]
d = {'x':'A','y':'B','z':'C'}
print [k+'='+v for k,v in d.iteritems()]
# 运用列表生成式,可以快速生成list,可以通过一个list推导出另一个list,而代码却十分简洁。
g = (x*x for x in xrange(10))
# print g.next()
# for n ... | code_fim | easy | {
"lang": "python",
"repo": "GodIsMadao/python_learning",
"path": "/function.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> n,a,b=0,0,1
while n<max:
print b
a,b=b,a+b
n+=1
fab(9)<|fim_prefix|># repo: GodIsMadao/python_learning path: /function.py
# -*- coding: utf-8 -*-
# import os
# print [d for d in os.listdir('.')]
d = {'x':'A','y':'B','z':'C'}
print [k+'='+v for k,v in d.iteritems()]
# 运用列表生成式,可以快速生成list,可以通过一个lis... | code_fim | easy | {
"lang": "python",
"repo": "GodIsMadao/python_learning",
"path": "/function.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: woodstone121/memorizing path: /english/migrations/0002_auto_20170528_0732.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-28 07:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
<|fim_suffix|> dependencies = ... | code_fim | medium | {
"lang": "python",
"repo": "woodstone121/memorizing",
"path": "/english/migrations/0002_auto_20170528_0732.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> dependencies = [
('english', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='wrong',
name='times',
field=models.IntegerField(default=1, verbose_name='次数'),
),
migrations.AlterField(
model_name='... | code_fim | medium | {
"lang": "python",
"repo": "woodstone121/memorizing",
"path": "/english/migrations/0002_auto_20170528_0732.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
start = time()
main()
print('Program took %.02f seconds' % (time()-start))<|fim_prefix|># repo: alicekykwan/ProjectEuler-First-100 path: /pe001.py
from collections import *
from itertools import *
from random import *
from time import *
def main():
<|fim_middle|> ans = 0
for i in range(1000):
... | code_fim | medium | {
"lang": "python",
"repo": "alicekykwan/ProjectEuler-First-100",
"path": "/pe001.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>start = time()
main()
print('Program took %.02f seconds' % (time()-start))<|fim_prefix|># repo: alicekykwan/ProjectEuler-First-100 path: /pe001.py
from collections import *
from itertools import *
from random import *
from time import *
def main():
<|fim_middle|> ans = 0
for i in range(1000):
... | code_fim | medium | {
"lang": "python",
"repo": "alicekykwan/ProjectEuler-First-100",
"path": "/pe001.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: alicekykwan/ProjectEuler-First-100 path: /pe001.py
from collections import *
from itertools import *
from random import *
from time import *
<|fim_suffix|>
start = time()
main()
print('Program took %.02f seconds' % (time()-start))<|fim_middle|>def main():
ans = 0
for i in range(1000):
... | code_fim | medium | {
"lang": "python",
"repo": "alicekykwan/ProjectEuler-First-100",
"path": "/pe001.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> #the CycleGan takes data as a dictionary
#easier to work within that constraint than to reright
# start an infinite loop and keep reading frames from the webcam until we encounter a keyboard interrupt
data = {"A": None, "A_paths": None}
while True:
#ret is bool returned by cap... | code_fim | hard | {
"lang": "python",
"repo": "gschian0/webcam-CycleGAN",
"path": "/webcam.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> output_size = options["repr_dim_output"]
with tf.variable_scope("embedders") as varscope:
premise_embedded = nvocab(premise)
varscope.reuse_variables()
hypothesis_embedded = nvocab(hypothesis)
# todo: add option for attentive reader
print('TRAINABLE VARIABLES (on... | code_fim | hard | {
"lang": "python",
"repo": "mitchelljeff/fastqa4tackbp",
"path": "/projects/suppoRTE/kvrte.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: mitchelljeff/fastqa4tackbp path: /projects/suppoRTE/kvrte.py
# -*- coding: utf-8 -*-
import tensorflow as tf
from jtr.nn.models import get_total_trainable_variables, get_total_variables, predictor
def key_value_reader(inputs, lengths, output_size, contexts=(None, None),
s... | code_fim | hard | {
"lang": "python",
"repo": "mitchelljeff/fastqa4tackbp",
"path": "/projects/suppoRTE/kvrte.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>cmd == 'Paused':
print('')
else:
print('')<|fim_prefix|># repo: crysterbater/doots path: /home-configs/.config/polybar/scripts/playpause.py
#!usr/bin/python
import os
cmd = os.popen('playerctl -p spotify status').read()
cmd = cmd.split('\n')
cmd<|fim_middle|> = cmd[0]
if cmd == "Playing":
... | code_fim | easy | {
"lang": "python",
"repo": "crysterbater/doots",
"path": "/home-configs/.config/polybar/scripts/playpause.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: crysterbater/doots path: /home-configs/.config/polybar/scripts/playpause.py
#!usr/bin/python
import os
cmd = os.popen('playerctl<|fim_suffix|> = cmd[0]
if cmd == "Playing":
print('')
elif cmd == 'Paused':
print('')
else:
print('')<|fim_middle|> -p spotify status').read()
cmd = ... | code_fim | easy | {
"lang": "python",
"repo": "crysterbater/doots",
"path": "/home-configs/.config/polybar/scripts/playpause.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> sampled_groups = {}
num_samples = 0
num_skipped = 0
try:
with tqdm(desc='Calculating progress', unit=' messages') as progress_bar:
while num_samples < kwargs['total_mails'] and len(results['hits']['hits']) > 0:
for hit in results['hits']['hits']:
... | code_fim | hard | {
"lang": "python",
"repo": "MCECorpus/acl20-crawling-mailing-lists",
"path": "/src/index/mail_sampler.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> try:
with tqdm(desc='Calculating progress', unit=' messages') as progress_bar:
while num_samples < kwargs['total_mails'] and len(results['hits']['hits']) > 0:
for hit in results['hits']['hits']:
if skip > 0 and num_skipped < skip:
... | code_fim | hard | {
"lang": "python",
"repo": "MCECorpus/acl20-crawling-mailing-lists",
"path": "/src/index/mail_sampler.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: MCECorpus/acl20-crawling-mailing-lists path: /src/index/mail_sampler.py
#!/usr/bin/env python3
import json
import click
from tqdm import tqdm
from util import util
logger = util.get_logger(__name__)
@click.command()
@click.argument('index')
@click.argument('output_file')
@click.option('-q'... | code_fim | hard | {
"lang": "python",
"repo": "MCECorpus/acl20-crawling-mailing-lists",
"path": "/src/index/mail_sampler.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>person('Bob', 35, city='Beijing')
def fun(a,b,*,c,*f):
print(a,b,c,f)<|fim_prefix|># repo: mrhowe2118/MrHowe path: /mystuff/test.py
__author__ = 'MrHowe'
def person(name, age, **kw):
<|fim_middle|> if 'city' in kw:
kw['city']='Shanghai'
print('name:', name, 'age:', age, 'other:', kw)
| code_fim | medium | {
"lang": "python",
"repo": "mrhowe2118/MrHowe",
"path": "/mystuff/test.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: mrhowe2118/MrHowe path: /mystuff/test.py
__author__ = 'MrHowe'
def person(name, age, **kw):
if 'city' in kw:
kw['city']='Shanghai'
print('name:', name, 'age:', age, 'other:', kw)
<|fim_suffix|>def fun(a,b,*,c,*f):
print(a,b,c,f)<|fim_middle|>person('Bob', 35, city='Beijing')
| code_fim | easy | {
"lang": "python",
"repo": "mrhowe2118/MrHowe",
"path": "/mystuff/test.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>def fun(a,b,*,c,*f):
print(a,b,c,f)<|fim_prefix|># repo: mrhowe2118/MrHowe path: /mystuff/test.py
__author__ = 'MrHowe'
def person(name, age, **kw):
if 'city' in kw:
kw['city']='Shanghai'
print('name:', name, 'age:', age, 'other:', kw)
<|fim_middle|>person('Bob', 35, city='Beijing')
| code_fim | easy | {
"lang": "python",
"repo": "mrhowe2118/MrHowe",
"path": "/mystuff/test.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ChakChak1234/minas path: /thinkorswim/scripts/chat_logs.py
#!/usr/bin/python
'''
# crontab
*/5 7-20 * * 1-5 export DISPLAY=:0; /usr/bin/python /home/john/git/john/minas/scripts/chat_logs.py >> /var/log/john/chat_logger.log 2>&1
'''
import pyautogui
import pyperclip
import difflib
import os
fro... | code_fim | hard | {
"lang": "python",
"repo": "ChakChak1234/minas",
"path": "/thinkorswim/scripts/chat_logs.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> for room, w in room_windows.iteritems():
print(w.get_name())
print(w.get_pid())
w.activate(0)
x, y, width, height = w.get_client_window_geometry()
pyautogui.click(x=x+20, y=y+height/2)
sleep(.2)
pyautogui.hotkey('ctrl', 'a')
sleep(.5)
pyautogui.hotkey('ctrl', 'c')
sleep(.5)
data = ... | code_fim | hard | {
"lang": "python",
"repo": "ChakChak1234/minas",
"path": "/thinkorswim/scripts/chat_logs.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>def generateQuestionName():
i = 1
j = 'q'
temp_question_name = j + `i`
existing_questions = os.listdir("/home/nn899/.question/questions")
while (temp_question_name in existing_questions):
i = i + 1
temp_question_name = j + `i`
return temp_question_name
def generate... | code_fim | hard | {
"lang": "python",
"repo": "nn899/ost-assignments",
"path": "/python-solution.cgi",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> print("<div style=\"font-size: 1.5em; line-height: 1.7em; margin-left: 12%;\">")
print("<b>")
print("<u>")
print("<a href=\"http://cims.nyu.edu/~nn899/cgi-bin/question.cgi?add_question=true\"; style=\"color: black\";>")
print("Add question")
print("</a>")
print("</u>")
prin... | code_fim | hard | {
"lang": "python",
"repo": "nn899/ost-assignments",
"path": "/python-solution.cgi",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: nn899/ost-assignments path: /python-solution.cgi
_user_name):
"""The questions for the user get read here"""
DEVNULL = open(os.devnull, 'wb')
question_names_pipe = subprocess.Popen(['ls', '-1', "/home/"+clean_user_name+"/.question/questions"], stdout=subprocess.PIPE, stderr=DEVNULL)
... | code_fim | hard | {
"lang": "python",
"repo": "nn899/ost-assignments",
"path": "/python-solution.cgi",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if angle not in (self.RIGHT, self.DOWN, self.LEFT, self.UP):
raise ValueError('Unexpected angle value: %s' % angle)
self.__angle = angle
@property
def angle(self):
return self.__angle<|fim_prefix|># repo: dendygeeks/tanxees.client.ai.python path: /src/tanxees/... | code_fim | medium | {
"lang": "python",
"repo": "dendygeeks/tanxees.client.ai.python",
"path": "/src/tanxees/api/Direction.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: dendygeeks/tanxees.client.ai.python path: /src/tanxees/api/Direction.py
from tanxees.utils.Comparer import ComparerMixin
class Direction(ComparerMixin):
COMPARE_ATTRS = ('angle')
RIGHT = 0
DOWN = 90
LEFT = 180
UP = 270
<|fim_suffix|> @property
def angle(self):
... | code_fim | medium | {
"lang": "python",
"repo": "dendygeeks/tanxees.client.ai.python",
"path": "/src/tanxees/api/Direction.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Omkar02/FAANG path: /DP_14_EggDropping.py
import __main__ as main
from Helper.TimerLogger import CodeTimeLogging
fileName = main.__file__
fileName = fileName.split('\\')[-1]
CodeTimeLogging(Flag='F', filename=fileName, Tag='Dynamic-Programing', Difficult='Medium')
<|fim_suffix|> for i in ran... | code_fim | medium | {
"lang": "python",
"repo": "Omkar02/FAANG",
"path": "/DP_14_EggDropping.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> for i in range(2, noEggs + 1):
for j in range(1, nofloar + 1):
for k in range(1, j + 1):
print([i - 1, k - 1], [i, j - k], [i, j, k])
dp[i][j] = min(1 + max(dp[i - 1][k - 1],
dp[i][j - k]) for k in range(1, j + 1))
... | code_fim | medium | {
"lang": "python",
"repo": "Omkar02/FAANG",
"path": "/DP_14_EggDropping.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: dev-lusaja/Ruc-Consultant path: /worker/main.py
# -*- coding: utf-8 -*-
import yaml
import logging
from ruc.reducedPattern import reducedPattern
<|fim_suffix|>if __name__ == '__main__':
try:
Run()
except Exception as e:
msg = 'Error: %s' % (e)
logging.error(msg)<|fim_middle|>logging.basi... | code_fim | hard | {
"lang": "python",
"repo": "dev-lusaja/Ruc-Consultant",
"path": "/worker/main.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> file = open('config/config.yml', 'r')
config = yaml.load(file)
if (config is None):
raise Exception('Config file not found or format error.')
options = {}
options['url'] = config['sunat']['url']
options['zip_path'] = config['paths']['zip']
options['unzip_path'] = config['paths']['unzip']
option... | code_fim | medium | {
"lang": "python",
"repo": "dev-lusaja/Ruc-Consultant",
"path": "/worker/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> @property
def quantity(self):
return self.quantity
@property
def average_price(self):
return self.average_price
@property
def commission(self):
return self.commission
@property
def purchased_date(self):
return self.purchased_date
@pro... | code_fim | hard | {
"lang": "python",
"repo": "kevmartian/pyTD",
"path": "/pyTD/accounts/watchlists.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: kevmartian/pyTD path: /pyTD/accounts/watchlists.py
# MIT License
# Copyright (c) 2018 Addison Lynch
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrictio... | code_fim | hard | {
"lang": "python",
"repo": "kevmartian/pyTD",
"path": "/pyTD/accounts/watchlists.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: google/skia path: /infra/bots/assets/chromebook_x86_64_gles/create_and_upload.py
#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset and upload it."""
import argparse
i... | code_fim | medium | {
"lang": "python",
"repo": "google/skia",
"path": "/infra/bots/assets/chromebook_x86_64_gles/create_and_upload.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> sk = os.path.realpath(os.path.join(
FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir, 'bin', 'sk'))
if os.name == 'nt':
sk += '.exe'
if not os.path.isfile(sk):
raise Exception('`sk` not found at %s; maybe you need to run bin/fetch-sk?')
# Upload the asset.
subprocess.check_cal... | code_fim | hard | {
"lang": "python",
"repo": "google/skia",
"path": "/infra/bots/assets/chromebook_x86_64_gles/create_and_upload.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> t = int(input())
for t_itr in range(t):
n = int(input())
q = list(map(int, input().rstrip().split()))
minimumBribes(q)<|fim_prefix|># repo: mariusj/algo path: /hackerrank/bribes.py
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the ... | code_fim | hard | {
"lang": "python",
"repo": "mariusj/algo",
"path": "/hackerrank/bribes.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: mariusj/algo path: /hackerrank/bribes.py
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the minimumBribes function below.
def minimumBribes(q):
count = 0
qq = [ x for x in range(1, len(q) + 1)]
for i, v in enumerate(q):
if (q[i] == qq[i]):
# p... | code_fim | medium | {
"lang": "python",
"repo": "mariusj/algo",
"path": "/hackerrank/bribes.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>algoritmo que determine si hay mas de un orden topologico?
si la coleccion pending llega a tener mas de un elemento<|fim_prefix|># repo: joseuribe0624/Data_Structure path: /codigos/toposort.py
def toposort(G):
ans = list()
indeg = [ 0 for _ in len(G)]
for u in range(len(G)):
for v in G[u]:
indeg[... | code_fim | medium | {
"lang": "python",
"repo": "joseuribe0624/Data_Structure",
"path": "/codigos/toposort.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: joseuribe0624/Data_Structure path: /codigos/toposort.py
def toposort(G):
ans = list()
indeg = [ 0 for _ in len(G)]
for u in range(len(G)):
for v in G[u]:
indeg[v] += 1
pending = list()
for u in range(len(G)):
if indeg[u]==0:
pending.append(u)
<|fim_suffix|>algoritmo que determi... | code_fim | medium | {
"lang": "python",
"repo": "joseuribe0624/Data_Structure",
"path": "/codigos/toposort.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|># Save the vocabulary into a csv file.
sorteddict.loc[:10000, 'words'].to_frame().to_csv('Vocabulary.csv', index = False, quoting = csv.QUOTE_NONE, escapechar = ' ')
print('Longest sentence has {} tokens'.format(maxlen))
print(maxSen)<|fim_prefix|># repo: minjielu/Reinforcement-Learning-Chatbot path: /Ma... | code_fim | hard | {
"lang": "python",
"repo": "minjielu/Reinforcement-Learning-Chatbot",
"path": "/Main codes/generate_vocabulary.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: minjielu/Reinforcement-Learning-Chatbot path: /Main codes/generate_vocabulary.py
# This file generate the vocabulary.
import os
import pandas as pd
import numpy as np
import operator, csv
worddict = {}
cnt = 0
maxlen = 0
maxSen = ""
# Count the frequencies of occurrence of all words.
for filena... | code_fim | hard | {
"lang": "python",
"repo": "minjielu/Reinforcement-Learning-Chatbot",
"path": "/Main codes/generate_vocabulary.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: nandoflorestan/pluserable path: /tests/models.py
"""Models for tests."""
from sqlalchemy.ext.declarative import declarative_base
from bag.sqlalchemy.tricks import MinimalBase
from pluserable.data.sqlalchemy.models import (
ActivationMixin, GroupMixin, UsernameMixin, UserGroupMixin)
Base = d... | code_fim | medium | {
"lang": "python",
"repo": "nandoflorestan/pluserable",
"path": "/tests/models.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
class UserGroup(UserGroupMixin, Base): # noqa
pass
class Activation(ActivationMixin, Base): # noqa
pass<|fim_prefix|># repo: nandoflorestan/pluserable path: /tests/models.py
"""Models for tests."""
from sqlalchemy.ext.declarative import declarative_base
from bag.sqlalchemy.tricks import Min... | code_fim | hard | {
"lang": "python",
"repo": "nandoflorestan/pluserable",
"path": "/tests/models.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: alexpulich/embeddings-evaluation path: /src/evaluation/strategies/oov_strategies.py
import logging
import deepcut
import numpy as np
from .base import OOVStrategy
logger = logging.getLogger(__name__)
class NoActionOOVStrategy(OOVStrategy):
def handle_oov(self, embeddings, X, words):
... | code_fim | hard | {
"lang": "python",
"repo": "alexpulich/embeddings-evaluation",
"path": "/src/evaluation/strategies/oov_strategies.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # collecting oov words
for query in X:
for query_word in query:
if query_word not in words:
oov_words.add(query_word)
# iterating through each oov-word
for oov_word in oov_words:
cut_word = oov_word
wo... | code_fim | hard | {
"lang": "python",
"repo": "alexpulich/embeddings-evaluation",
"path": "/src/evaluation/strategies/oov_strategies.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # iterating through each oov-word
for oov_word in oov_words:
cut_word = oov_word
words_with_same_prefix = set()
# cutting letter by letter until we find some words with the same prefix
while len(cut_word) and cut_word not in words:
... | code_fim | hard | {
"lang": "python",
"repo": "alexpulich/embeddings-evaluation",
"path": "/src/evaluation/strategies/oov_strategies.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>cno=dff["Customer No"][len(overall_cno)-1] + 1
curr_user=[]
curr_phone=[]
curr_date=[]
curr_time=[]
curr_name=[]
curr_price=[]
curr_quantity=[]
curr_amount=[]
curr_cno=[]
def print_bill():
if os.path.isfile('print.txt'):
os.remove('print.txt')
with open('print.txt','a') as file:
... | code_fim | hard | {
"lang": "python",
"repo": "atul27-git/SuperMarket-Recommender-System",
"path": "/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>def det() :
w11=tk.Tk()
w11.title("Find Details")
w11.configure(background=mycolor)
w11.geometry('600x600')
l12=tk.Label(w11,text="Username",fg="White", bg=mycolor)
l12.place(x=100,y=50)
e12=tk.Entry(w11)
e12.place(x=160,y=50)
l22=tk.Label(w11,text="Phone",fg="Whit... | code_fim | hard | {
"lang": "python",
"repo": "atul27-git/SuperMarket-Recommender-System",
"path": "/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: atul27-git/SuperMarket-Recommender-System path: /main.py
import tkinter as tk
from tkinter import *
import datetime
from functools import partial
import requests
import pandas as pd
import numpy as np
import sys
import os
import tkinter.ttk
from mlxtend.preprocessing import TransactionEncoder
fr... | code_fim | hard | {
"lang": "python",
"repo": "atul27-git/SuperMarket-Recommender-System",
"path": "/main.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: fossabot/beehive path: /beehive/common/task/manager.py
'''
Created on Nov 3, 2015
@author: darkbk
'''
import logging
from beecell.logger.helper import LoggerHelper
from signal import SIGHUP, SIGABRT, SIGILL, SIGINT, SIGSEGV, SIGTERM, SIGQUIT
from signal import signal
from datetime import timedel... | code_fim | hard | {
"lang": "python",
"repo": "fossabot/beehive",
"path": "/beehive/common/task/manager.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> #run_command(['celery', 'multi', 'stopwait', 'worker1',
# '--pidfile="run/celery-%n.pid"'])
task_manager.stop()
#for sig in (SIGHUP, SIGABRT, SIGILL, SIGINT, SIGSEGV, SIGTERM, SIGQUIT):
# signal(sig, terminate)
task_manager.worker_main(argv)
... | code_fim | hard | {
"lang": "python",
"repo": "fossabot/beehive",
"path": "/beehive/common/task/manager.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|># @admin.register(models.Equipment)
# class EquipmentAdmin(VersionAdmin):
# search_fields = ['nombre']
# list_filter = ('type_equipment', 'moneda')
# list_display = [
# 'nombre',
# 'unidad',
# 'type_equipment',
# 'moneda',
# 'precio'
# ]
# @admin.r... | code_fim | hard | {
"lang": "python",
"repo": "sebaskun/budget_app",
"path": "/backend/resource/admin.py",
"mode": "spm",
"license": "Unlicense",
"source": "the-stack-v2"
} |
<|fim_suffix|># # tab_overview = (
# # (None, {
# # 'fields': ('nombre', 'unidad', 'type_manpower')
# # }),
# # )
# # tab_cost = (
# # ('Costo', {
# # 'fields': ('type_cost', 'moneda', 'precio')
# # }),
# # )
# # tabs = [
# # ('Overvie... | code_fim | hard | {
"lang": "python",
"repo": "sebaskun/budget_app",
"path": "/backend/resource/admin.py",
"mode": "spm",
"license": "Unlicense",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sebaskun/budget_app path: /backend/resource/admin.py
# # -*- coding: utf-8 -*-
# from __future__ import unicode_literals
# from django.contrib import admin
# from reversion.admin import VersionAdmin
# # from tabbed_admin import TabbedModelAdmin
# from . import models
# @admin.register(models.M... | code_fim | medium | {
"lang": "python",
"repo": "sebaskun/budget_app",
"path": "/backend/resource/admin.py",
"mode": "psm",
"license": "Unlicense",
"source": "the-stack-v2"
} |
<|fim_suffix|>class Markup:
def __init__(self):
self.elements = []
def header(self, level: int, text: str):
self.elements.append(Header(level, text))
return self
def code_block(self, text: str):
self.elements.append(CodeBlock(text))
return self
def section(self... | code_fim | medium | {
"lang": "python",
"repo": "servirtium/servirtium-python",
"path": "/servirtium/markup.py",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: servirtium/servirtium-python path: /servirtium/markup.py
class Header:
def __init__(self, level: int, text: str):
self.level = level
self.text = text
def as_markdown(self):
return f'{"#" * self.level} {self.text}\n'
class CodeBlock:
<|fim_suffix|>
class Markup:
... | code_fim | medium | {
"lang": "python",
"repo": "servirtium/servirtium-python",
"path": "/servirtium/markup.py",
"mode": "psm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> return self.header(level, title).code_block(body)
def as_markdown(self):
return '\n'.join([e.as_markdown() for e in self.elements])<|fim_prefix|># repo: servirtium/servirtium-python path: /servirtium/markup.py
class Header:
def __init__(self, level: int, text: str):
self.... | code_fim | hard | {
"lang": "python",
"repo": "servirtium/servirtium-python",
"path": "/servirtium/markup.py",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: DataStudySquad/CS_basics path: /leetcode_python/String/reverse-words-in-a-string-ii.py
"""
Reverse Words in a String II
# https://aaronice.gitbook.io/lintcode/string/reverse-words-in-a-string-ii
# https://www.programcreek.com/2014/05/leetcode-reverse-words-in-a-string-ii-java/
Given an input s... | code_fim | hard | {
"lang": "python",
"repo": "DataStudySquad/CS_basics",
"path": "/leetcode_python/String/reverse-words-in-a-string-ii.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def reverseWords(self, s):
"""
:type s: a list of 1 length strings (List[str])
:rtype: nothing
"""
s.reverse()
i = 0
while i < len(s):
j = i
while j < len(s) and s[j] != " ":
j += 1
for k in ran... | code_fim | medium | {
"lang": "python",
"repo": "DataStudySquad/CS_basics",
"path": "/leetcode_python/String/reverse-words-in-a-string-ii.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: plvaliente/Trabajos-Academicos path: /Algoritmos y Estructuras de Datos 3/tp3/plot.py
#COMPILAR CON PYTHON3
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pylab as pl
import random
import numpy as np
ns = range(10,151)
ms = [16,13,16,14,19,17,20,23,26,26,29,32,... | code_fim | medium | {
"lang": "python",
"repo": "plvaliente/Trabajos-Academicos",
"path": "/Algoritmos y Estructuras de Datos 3/tp3/plot.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
'''
plt.clf()
df3 = pd.DataFrame()
#df3 = pd.DataFrame({'Backtracking': tiemposBack, 'n': ns,'Complejidad (2^n)*(n^2)': complejidad })
df3['n'] = ns
df3['Backtracking'] = tiemposBack
df3['Complejidad (2^n)*(n^2)'] = complejidad
df3.plot(x='n', logy=True)
plt.ylabel('Tiempo (microsegundos)')
correlati... | code_fim | hard | {
"lang": "python",
"repo": "plvaliente/Trabajos-Academicos",
"path": "/Algoritmos y Estructuras de Datos 3/tp3/plot.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: shashankg7/curriculum-learning path: /ConvNet/image_classification/model_baseline_sorted.py
import keras
import json
import numpy as np
import util.emnist as emnist
import util.data as data_util
import util.model as model_util
import results.results as results_util
"""
We pretend sorted model is... | code_fim | hard | {
"lang": "python",
"repo": "shashankg7/curriculum-learning",
"path": "/ConvNet/image_classification/model_baseline_sorted.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> #Convert data to be used in model
x, y = data_util.prep(x, y, classes)
val_x, val_y = data_util.prep(val_x, val_y, classes)
test_x, test_y = data_util.prep(data['test_x'], data['test_y'], classes)
#Create Tasks for comparison sake, just going through unsorted data ... | code_fim | hard | {
"lang": "python",
"repo": "shashankg7/curriculum-learning",
"path": "/ConvNet/image_classification/model_baseline_sorted.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> samples_seen += len(tasks_x[task_index])
result_point = {
"samples_seens" : samples_seen,
"categorial_accuracy" : score[categorial_accuracy_index],
"top_2_accuracy" : score[top_2_accuracy_index],
... | code_fim | hard | {
"lang": "python",
"repo": "shashankg7/curriculum-learning",
"path": "/ConvNet/image_classification/model_baseline_sorted.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>test = Udacian("Mohammed Bokhari", "Jeddah", "Student", "Full-Stack", "--")
test.getInformation()<|fim_prefix|># repo: ndn94/session-two-exercise path: /session-two-exercise.py
class Udacian:
def __init__(self, name, city, enrollment, nanodegree, status):
self.name = name
self.city = ... | code_fim | medium | {
"lang": "python",
"repo": "ndn94/session-two-exercise",
"path": "/session-two-exercise.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ndn94/session-two-exercise path: /session-two-exercise.py
class Udacian:
def __init__(self, name, city, enrollment, nanodegree, status):
<|fim_suffix|>test = Udacian("Mohammed Bokhari", "Jeddah", "Student", "Full-Stack", "--")
test.getInformation()<|fim_middle|> self.name = name
... | code_fim | hard | {
"lang": "python",
"repo": "ndn94/session-two-exercise",
"path": "/session-two-exercise.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def getInformation(self):
print(self.name + " " + self.city + " " + self.enrollment + " " + self.nanodegree + " " + self.status)
test = Udacian("Mohammed Bokhari", "Jeddah", "Student", "Full-Stack", "--")
test.getInformation()<|fim_prefix|># repo: ndn94/session-two-exercise path: /session-tw... | code_fim | medium | {
"lang": "python",
"repo": "ndn94/session-two-exercise",
"path": "/session-two-exercise.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: andrussha/lab_7 path: /First.py
'''
Дана послідовність цілих чисел а1, ... a30. Нехай М - найбільше з цих чисел, а m -
найменше. Вивести на екран у порядку зростання всі цілі з інтерва<|fim_suffix|>ax(a)
m = min(a)
z = []
for i in range(m,M+1):
z.append(i)
for j in ran... | code_fim | medium | {
"lang": "python",
"repo": "andrussha/lab_7",
"path": "/First.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> z.remove(z[j])
print(z)
key = input('Again? Yes - 1, no - 2: ')
if key == '1':
continue
else:
print('Bye')
break<|fim_prefix|># repo: andrussha/lab_7 path: /First.py
'''
Дана послідовність цілих чисел а1, ... a30. Нехай М - найбільше з цих чисел, а m -
найменше. В... | code_fim | hard | {
"lang": "python",
"repo": "andrussha/lab_7",
"path": "/First.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>ax(a)
m = min(a)
z = []
for i in range(m,M+1):
z.append(i)
for j in range(len(z)):
if z[j] in a:
z.remove(z[j])
print(z)
key = input('Again? Yes - 1, no - 2: ')
if key == '1':
continue
else:
print('Bye')
break<... | code_fim | medium | {
"lang": "python",
"repo": "andrussha/lab_7",
"path": "/First.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # testcase 5: default form
self.assertEqual(controller.get_transition_action(transition),
default_url)
# testcase 6: complete task wizard
self.assertEqual(controller.get_transition_action(transition),
wizard_url)
def t... | code_fim | hard | {
"lang": "python",
"repo": "sensecs1/opengever.core",
"path": "/opengever/task/tests/test_guards.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # testcase 3: not responsible -> default form
self.expect(task.task_type_category).result(
'bidirectional_by_reference')
self.expect(
controller_mock._is_responsible_or_inbox_group_user()).result(
False)
# tes... | code_fim | hard | {
"lang": "python",
"repo": "sensecs1/opengever.core",
"path": "/opengever/task/tests/test_guards.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sensecs1/opengever.core path: /opengever/task/tests/test_guards.py
def setUp(self):
super(TestTaskTransitionController, self).setUp()
# we need to have a site root for making the cachecky work.
root = self.create_dummy(getSiteManager=getSiteManager,
... | code_fim | hard | {
"lang": "python",
"repo": "sensecs1/opengever.core",
"path": "/opengever/task/tests/test_guards.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ryansmick/autocli path: /src/internal/argument.py
# Class to represent an argument on the command line
# Can be user for both required arguments as well as values for optional arguments
class Argument(object):
def __init__(self, name=None):
<|fim_suffix|> @classmethod
def build(cls, ar... | code_fim | easy | {
"lang": "python",
"repo": "ryansmick/autocli",
"path": "/src/internal/argument.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> @classmethod
def build(cls, argument_dict):
return Argument(name=argument_dict.get('name', None))<|fim_prefix|># repo: ryansmick/autocli path: /src/internal/argument.py
# Class to represent an argument on the command line
# Can be user for both required arguments as well as values for opt... | code_fim | medium | {
"lang": "python",
"repo": "ryansmick/autocli",
"path": "/src/internal/argument.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ucode3715/IngSoftware path: /old/sistemaEstacionamiento/testEstacionamiento.py
'''
Created on 16/10/2014
@author: Mugul
'''
import unittest
from estacionamiento import *
class Test(unittest.TestCase):
##################################################################
###... | code_fim | hard | {
"lang": "python",
"repo": "ucode3715/IngSoftware",
"path": "/old/sistemaEstacionamiento/testEstacionamiento.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.