text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_suffix|>
sentence = input('Введите предложение: ')
newSentence = ''
for word in sentence.split():
newSentence += str_cap(word) + ' '
print(newSentence.strip())<|fim_prefix|># repo: bulmasen/learn-to-program path: /GB_LearnProgramming/Python_Programming/lesson-03/homeWork-lesson03-6.py
# Реализовать функцию... | code_fim | hard | {
"lang": "python",
"repo": "bulmasen/learn-to-program",
"path": "/GB_LearnProgramming/Python_Programming/lesson-03/homeWork-lesson03-6.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: dangle0118/shopping_website path: /web_search/views.py
from django.shortcuts import render, get_object_or_404
from django.views.generic import ListView
from web_search.models import Overview, ItemForm, Spec_item, Offer_detail
from django.http import HttpResponse, HttpResponseRedirect, Http404
fro... | code_fim | hard | {
"lang": "python",
"repo": "dangle0118/shopping_website",
"path": "/web_search/views.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> refer_list = Overview.objects.filter(cat_id__in = refer)[:12]
return refer_list
except:
print "there"
return Overview.objects.all()[:12]
def get_context_data(self, ** kwargs):
context = super(index, self).get_context_data(**kwargs)
offer = context['offer']
print type(offer)
of... | code_fim | hard | {
"lang": "python",
"repo": "dangle0118/shopping_website",
"path": "/web_search/views.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> temp = Offer_detail.objects.filter(sem3_id = self.kwargs['pk'])
print temp
return temp
class show_spec_item(DetailView):
model = Spec_item
template_name = 'web_search/specs_item.html'
context_object_name = 'specs_item'
def get_context_data(self, **kwargs):
print type(self)
context = s... | code_fim | hard | {
"lang": "python",
"repo": "dangle0118/shopping_website",
"path": "/web_search/views.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> #Polynomial regression working code
# for data in datas:
# x.append([data.year.year])
# y.append([(data.actualDem)-(data.normsPred)])
# count+=1
# x = np.array(x)
# y = np.array(y)
# poly = PolynomialFeatures()
... | code_fim | hard | {
"lang": "python",
"repo": "anuragsingh7700/WaterDemand",
"path": "/Demand/models.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: anuragsingh7700/WaterDemand path: /Demand/models.py
from django.db import models
from django.db.models import signals
from django.dispatch import receiver
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.metrics... | code_fim | hard | {
"lang": "python",
"repo": "anuragsingh7700/WaterDemand",
"path": "/Demand/models.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
# def prediction(area):
#linear regression working code
# datas = area.objects.all()
# x=[]
# y=[]
# z = []
# z = np.array(z)
# for data in datas:
# x.append([data.year.year])
# y.append([data.actualDem])
# # x = np.arra... | code_fim | hard | {
"lang": "python",
"repo": "anuragsingh7700/WaterDemand",
"path": "/Demand/models.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: quanghuy1258/NLP path: /word2vec.py
from gensim.models import word2vec
from nltk import word_tokenize
import codecs, json
import numpy as np
<|fim_suffix|>d = {}
for k in words:
d[k] = model[k].tolist()
with codecs.open("data.json", "w", "utf-8-sig") as fp:
json.dump(d, fp, ensure_ascii=... | code_fim | hard | {
"lang": "python",
"repo": "quanghuy1258/NLP",
"path": "/word2vec.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>model = word2vec.Word2Vec(sentences=sens)
words = model.wv.vocab.keys()
d = {}
for k in words:
d[k] = model[k].tolist()
with codecs.open("data.json", "w", "utf-8-sig") as fp:
json.dump(d, fp, ensure_ascii=False)
ifile.close()<|fim_prefix|># repo: quanghuy1258/NLP path: /word2vec.py
from gensim.... | code_fim | medium | {
"lang": "python",
"repo": "quanghuy1258/NLP",
"path": "/word2vec.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>length_list = len(keys)
data = []
for i in range(length_list):
set = []
set.append(keys[i])
set.append(values[i])
data.append(set)
headers = ["Time", "Value"]
df = pd.DataFrame(data, columns=headers)
jsonfile = json.loads(df.to_json(orient="records"))
print(jsonfile)
w... | code_fim | medium | {
"lang": "python",
"repo": "HDGizzle/DataProcessing",
"path": "/Homework/Week_4/csv2jsonweek4.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
keys = list(jsonfile.keys())
values = list(jsonfile.values())
length_list = len(keys)
data = []
for i in range(length_list):
set = []
set.append(keys[i])
set.append(values[i])
data.append(set)
headers = ["Time", "Value"]
df = pd.DataFrame(data, columns=headers)
jsonf... | code_fim | medium | {
"lang": "python",
"repo": "HDGizzle/DataProcessing",
"path": "/Homework/Week_4/csv2jsonweek4.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: HDGizzle/DataProcessing path: /Homework/Week_4/csv2jsonweek4.py
import csv
import json
import pandas as pd
csv_data = "data.csv"
csvfile = open(csv_data, "r")
df = pd.read_csv(csv_data)
df = df.groupby('TIME')["Value"].agg("mean")
jsonfile = json.loads(df.to_json(orient="index"... | code_fim | hard | {
"lang": "python",
"repo": "HDGizzle/DataProcessing",
"path": "/Homework/Week_4/csv2jsonweek4.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def __init__(self):
a = pkgutil.get_data(IDIOM_PACKAGE, IDIOM_FILE)
self.all_idioms = set(a.decode('utf-8').strip().splitlines())
logger.debug('Idioms loaded from {}/{}'.format(IDIOM_PACKAGE, IDIOM_FILE))
def is_valid(self, s):
return s in self.all_idioms<|fim_pref... | code_fim | medium | {
"lang": "python",
"repo": "davidygs/idiom-finder-service",
"path": "/idiomfinder/validator/__init__.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> a = pkgutil.get_data(IDIOM_PACKAGE, IDIOM_FILE)
self.all_idioms = set(a.decode('utf-8').strip().splitlines())
logger.debug('Idioms loaded from {}/{}'.format(IDIOM_PACKAGE, IDIOM_FILE))
def is_valid(self, s):
return s in self.all_idioms<|fim_prefix|># repo: davidygs/idi... | code_fim | medium | {
"lang": "python",
"repo": "davidygs/idiom-finder-service",
"path": "/idiomfinder/validator/__init__.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> try:
self.used_tokens[token] = self.token[token]
self.remove_token(token)
except KeyError:
pass
def check_tokens_for_use_once(self):
# clear out tokens that are use once
to_delete = []
for k, v in self.token_erasers.iteritems... | code_fim | hard | {
"lang": "python",
"repo": "bufordtaylor/cardgame",
"path": "/game.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if len(self.active_player.hand) == 0:
print_red('No cards left to play')
os.system(['clear','cls'][os.name == 'nt'])
# play all cards until therea re no more
while self.active_player.hand:
self.play_user_card(selection='c0')
def check_cards_... | code_fim | hard | {
"lang": "python",
"repo": "bufordtaylor/cardgame",
"path": "/game.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: bufordtaylor/cardgame path: /game.py
import random
import os
from player import Player, Computer
from card import Card
from abilities_constants import *
from constants import *
from deck import (
PlayerStartDeck,
testDeck,
RealDeck,
print_card_attrs,
persistant_game_hand,
)
fr... | code_fim | hard | {
"lang": "python",
"repo": "bufordtaylor/cardgame",
"path": "/game.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>soup = BeautifulSoup(response.text, "lxml")
# 中文名子
chinese_name =soup.find_all("li")
# 英文名子
english_name =soup.find_all("a")
#
for index in chinese_name:
if index.div != None:
# print(index.div['class'])
if (index.div['class']==['num']):
rank.append(index.div.text... | code_fim | medium | {
"lang": "python",
"repo": "c9103205/python-spider",
"path": "/爬蟲測試.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: c9103205/python-spider path: /爬蟲測試.py
import requests
from bs4 import BeautifulSoup
import pandas as pd
response = requests.get('https://movies.yahoo.com.tw/movie_intheaters.html')
# print(response.text)
# print(response.status)
rank=[]
name=[]
soup = BeautifulSoup(response.text, "l... | code_fim | hard | {
"lang": "python",
"repo": "c9103205/python-spider",
"path": "/爬蟲測試.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: djvbao/MyFTP path: /MyFtpServer/core/logger.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# author: "Dev-L"
# file: logger.py
# Time: 2018/8/14 15:24
<|fim_suffix|>from conf import settings
class Logger:
@staticmethod
def get_logger(log_type):
logger = logging.getLogger(lo... | code_fim | medium | {
"lang": "python",
"repo": "djvbao/MyFTP",
"path": "/MyFtpServer/core/logger.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
class Logger:
@staticmethod
def get_logger(log_type):
logger = logging.getLogger(log_type)
logger.setLevel(settings.LOG_LEVEL)
# 创建控制台日志并设为debug级别
ch = logging.StreamHandler()
ch.setLevel(settings.LOG_LEVEL)
# 创建文件日志并设置级别
log_file = os.pat... | code_fim | medium | {
"lang": "python",
"repo": "djvbao/MyFTP",
"path": "/MyFtpServer/core/logger.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # 创建文件日志并设置级别
log_file = os.path.join(settings.LOG_PATH, '%s.log' % log_type)
fh = logging.FileHandler(log_file)
fh.setLevel(settings.LOG_LEVEL)
# 创建日志格式
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFo... | code_fim | medium | {
"lang": "python",
"repo": "djvbao/MyFTP",
"path": "/MyFtpServer/core/logger.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: JEENB/Etravel-Website path: /mysite/location/views.py
from django.shortcuts import render
from django.http import HttpResponse
from location.models import Locations, Images
# Create your views here.
def location(request, id):
loc = Locations.objects.get(pk = id)
img = Im<|... | code_fim | medium | {
"lang": "python",
"repo": "JEENB/Etravel-Website",
"path": "/mysite/location/views.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>ext = {
'loc' : loc,
'img' : img,
}
return render(request, 'locations.html', context)<|fim_prefix|># repo: JEENB/Etravel-Website path: /mysite/location/views.py
from django.shortcuts import render
from django.http import HttpResponse
from location.models import Locatio... | code_fim | medium | {
"lang": "python",
"repo": "JEENB/Etravel-Website",
"path": "/mysite/location/views.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>))
fobj2.write('\n')
num = num[79:]
else:
fobj2.write(i)
fobj2.write('\n')
with open('temp.txt') as fobj2:
with open(file1, 'w') as fobj1:
for i in fobj2:
fobj1.write(i)
#os.remove('temp.txt')
fobj1... | code_fim | hard | {
"lang": "python",
"repo": "Chekoo/Core-Python-Programming",
"path": "/9/9-16.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Chekoo/Core-Python-Programming path: /9/9-16.py
import os
file1 = raw_input('enter the filename: ')
with open(file1) as fobj1:
with open('temp.txt', 'w') as fobj2:
for i in fobj1:
if len(i) > 80:
num = list(i)
count = len(num) / 80
... | code_fim | hard | {
"lang": "python",
"repo": "Chekoo/Core-Python-Programming",
"path": "/9/9-16.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Xavier-Lam/wechat-django path: /wechat_django/tests/test_site_wechat.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import re
import time
from django.http import Http404, response
from django.test.utils import override_settings
from django.urls import reverse
imp... | code_fim | hard | {
"lang": "python",
"repo": "Xavier-Lam/wechat-django",
"path": "/wechat_django/tests/test_site_wechat.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> return response.HttpResponse(status=204)
resp = View.as_view()(self.rf().get("/"), self.app.name)
self.assertEqual(resp.status_code, 405)
resp = View.as_view()(self.rf().post("/"), self.app.name)
self.assertEqual(resp.status_code, 204)
def test_jsapi(self)... | code_fim | hard | {
"lang": "python",
"repo": "Xavier-Lam/wechat-django",
"path": "/wechat_django/tests/test_site_wechat.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>@strawberry.type
class Block:
subreddit: str
flairs: typing.List[str]
count: int
upvote_ratio: float
@strawberry.type
class Newsletter:
user_id: str
options: Options
blocks: typing.List[Block]<|fim_prefix|># repo: s0er3n/newsletter-website-backend path: /data.py
import typin... | code_fim | medium | {
"lang": "python",
"repo": "s0er3n/newsletter-website-backend",
"path": "/data.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: s0er3n/newsletter-website-backend path: /data.py
import typing
import strawberry
from dataclasses import asdict
@strawberry.type
class Options:
time: str
frequenzy: str
<|fim_suffix|>
@strawberry.type
class Newsletter:
user_id: str
options: Options
blocks: typing.List[Block]... | code_fim | medium | {
"lang": "python",
"repo": "s0er3n/newsletter-website-backend",
"path": "/data.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: hilmiraditya/ShortestPath path: /paa.py
import geocoder
from math import radians, cos, sin, asin, sqrt
from geopy.geocoders import Nominatim
from collections import defaultdict
from heapq import *
def currentlocation():
g = geocoder.ip('me')
cur_position = (g.latlng[0], g.latlng[1])
... | code_fim | hard | {
"lang": "python",
"repo": "hilmiraditya/ShortestPath",
"path": "/paa.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> print "\n"
print "harap menunggu, sedang membentuk graph !"
edges = [
(nama_lokasi[0], nama_lokasi[1], getdistance(getlatlong(nama_lokasi[0])[0],getlatlong(nama_lokasi[0])[1],getlatlong(nama_lokasi[1])[0],getlatlong(nama_lokasi[1])[1])),
(nama_lokasi[0], nama_lokasi[3], getdist... | code_fim | hard | {
"lang": "python",
"repo": "hilmiraditya/ShortestPath",
"path": "/paa.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> print "\n"
curlac = currentlocation()
for a in range(0,7):
print "lat dan long pada lokasi "+nama_lokasi[a]+" : "+str(getlatlong(nama_lokasi[a]))
print "\n"
print "harap menunggu, sedang membentuk graph !"
edges = [
(nama_lokasi[0], nama_lokasi[1], getdistance(getl... | code_fim | hard | {
"lang": "python",
"repo": "hilmiraditya/ShortestPath",
"path": "/paa.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # Load data for Anomaly Detection experiments
elif self.task == "anomaly_detection":
# Load the dataset
data = scipy.io.loadmat(f"graph_data/{self.task}/{self.dataset}.mat")
# Unfortunately the labels weren't chose by me...
X = sp.csr_matri... | code_fim | hard | {
"lang": "python",
"repo": "ivandonofrio/GraphRepresentationLearning",
"path": "/graph_loader.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
# Generate tensor from features matrix X
X = sparse_to_tensor(self.X, device=self.device)
# Get training, validation and training data masking edges (t: true, f: false) to be predicted
if self.task == "representation_learning":
A_train, E_train_t, E_val_t, E_v... | code_fim | hard | {
"lang": "python",
"repo": "ivandonofrio/GraphRepresentationLearning",
"path": "/graph_loader.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ivandonofrio/GraphRepresentationLearning path: /graph_loader.py
import torch
import numpy as np
import pickle as pkl
import networkx as nx
import scipy.io
import scipy.sparse as sp
from utils.edge_mask import mask_test_edges
from utils.matrices_and_tensors import sparse_to_tuple, sparse_to_tenso... | code_fim | hard | {
"lang": "python",
"repo": "ivandonofrio/GraphRepresentationLearning",
"path": "/graph_loader.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if result:
newUrlList.append(url)
# 新着をLINEで通知
linebot = linebot.Linebot()
text = linebot.createText(newUrlList)
res = linebot.pushMessage(settings.LINE_GROUP_ID, text)<|fim_prefix|># repo: daichi-s/notify-new-rentals-on-LINE path: /src/main.py
import os
import sys
import re
import datetime
... | code_fim | hard | {
"lang": "python",
"repo": "daichi-s/notify-new-rentals-on-LINE",
"path": "/src/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: daichi-s/notify-new-rentals-on-LINE path: /src/main.py
import os
import sys
import re
import datetime
from bs4 import BeautifulSoup
sys.path.append('../')
import settings
import scraping
import linebot
# 対象ページを取得
scraping = scraping.Scraping()
listUrl = []
newUrlList = []
page = scraping.getP... | code_fim | medium | {
"lang": "python",
"repo": "daichi-s/notify-new-rentals-on-LINE",
"path": "/src/main.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>page = scraping.getPage(settings.SCRAPING_PAGE_URL)
aElems = scraping.getElement(page, 'a')
for a in aElems:
try:
aClass = a.get('class').pop(0)
if aClass in 'js-cassette_link_href':
listUrl.append(a.get('href'))
print(listUrl)
except:
pass
# 更新日時を... | code_fim | medium | {
"lang": "python",
"repo": "daichi-s/notify-new-rentals-on-LINE",
"path": "/src/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: kautsiitd/Competitive_Programming path: /CodeChef/Long/September 2017/WEASELSC.py
def solveIncreasing(currentIndex,lastValue,ans,kRemain):
global finalAns
print currentIndex,lastValue,ans,kRemain
if currentIndex == n:
finalAns = max(ans,finalAns)
else:
for value in... | code_fim | hard | {
"lang": "python",
"repo": "kautsiitd/Competitive_Programming",
"path": "/CodeChef/Long/September 2017/WEASELSC.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>-1]):
temp.append(a[i-1])
if(i<n-1 and a[i]>a[i+1]):
if i!=0 and a[i-1] != a[i+1]:
temp.append(a[i+1])
else:
temp.append(a[i+1])
posValues.append(temp)
print posValues
finalAns = 0
solveIncreasing(0,0,0,k)
... | code_fim | hard | {
"lang": "python",
"repo": "kautsiitd/Competitive_Programming",
"path": "/CodeChef/Long/September 2017/WEASELSC.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> finalAns = max(ans,finalAns)
continue
for _ in range(input()):
n,k = map(int,raw_input().split())
a = map(int,raw_input().split())
posValues = []
for i in range(0,n):
temp = [0]
if a[i] == 0:
continue
temp.append(a[i])
if(i>... | code_fim | hard | {
"lang": "python",
"repo": "kautsiitd/Competitive_Programming",
"path": "/CodeChef/Long/September 2017/WEASELSC.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: FHoltorf/NMPCu path: /examples/SemiBatchPolymerization/illustrations/msMHE_stgen.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue May 22 07:56:11 2018
@author: flemmingholtorf
"""
from __future__ import print_function
from main.mods.SemiBatchPolymerization.mod_class_stgen imp... | code_fim | hard | {
"lang": "python",
"repo": "FHoltorf/NMPCu",
"path": "/examples/SemiBatchPolymerization/illustrations/msMHE_stgen.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # transform in polar coordinates for simpler waz of plotting
u = np.linspace(0.0, 2.0 * np.pi, 30) # angle = idenpendent variable
v = np.linspace(0.0, np.pi, 30) # angle = idenpendent variable
x = radii[0] * np.outer(np.cos(u), np.sin(v)) # x-coordinate
y = radii[1]... | code_fim | hard | {
"lang": "python",
"repo": "FHoltorf/NMPCu",
"path": "/examples/SemiBatchPolymerization/illustrations/msMHE_stgen.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> fname = os.path.basename(psf)
s1 = ""
s2 = ""
if fname[:3] == "c2a":
s1 = "resid 234 and name CA"
s2 = "resid 173 and name CA"
if fname[:3] == "c2b":
s1 = "resid 305 and name CA"
s2 = "resid 367 and name CA"
return (s1, s2)
d = Loop_distance()
d.prun()<|f... | code_fim | medium | {
"lang": "python",
"repo": "patrickjrock/AD3_syt_sim",
"path": "/analysis/python/loop_distance.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: patrickjrock/AD3_syt_sim path: /analysis/python/loop_distance.py
"""
Author: Patrick Rock
Date: July 8th 2016
"""
import MDAnalysis
import MDAnalysis.analysis.distances
import sys
import os
from distance import Distance
class Loop_distance(Distance):
def get_selection(self, psf):
<|fim_su... | code_fim | medium | {
"lang": "python",
"repo": "patrickjrock/AD3_syt_sim",
"path": "/analysis/python/loop_distance.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: CYBERxNUKE/xbmc-addon path: /context.seren/browse_season.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
import xbmc
from tools import get_current_list_item_action_args, url_quoted_action_args
<|fim_suffix|> trakt_id = action_args.get("trakt_id"... | code_fim | hard | {
"lang": "python",
"repo": "CYBERxNUKE/xbmc-addon",
"path": "/context.seren/browse_season.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> trakt_id = action_args.get("trakt_id")
if trakt_id:
path = "plugin://plugin.video.seren/?action=seasonEpisodes&action_args={}".format(
url_quoted_action_args(action_args)
)
xbmc.log(
"context.seren: Browse Season ({})".format(action_args["trakt_id"]... | code_fim | hard | {
"lang": "python",
"repo": "CYBERxNUKE/xbmc-addon",
"path": "/context.seren/browse_season.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> CSV_output : bool, csv output, optional (Default value = True)
if True, csv-format used, else Excel
in_sheet : str, optional (Default value = 'Sheet1')
name of input sheet for Excel format
out_sheet : str, optional (Default value = 'Sheet1')
name of ou... | code_fim | hard | {
"lang": "python",
"repo": "barisbalataci/eva",
"path": "/eva/data_access/data_functions.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> in_sheet : str, optional (Default value = 'Sheet1')
name of input sheet for Excel format
out_sheet : str, optional (Default value = 'Sheet1')
name of output sheet for Excel format
print_summary : bool, optional (Default value = False)
if True, print su... | code_fim | hard | {
"lang": "python",
"repo": "barisbalataci/eva",
"path": "/eva/data_access/data_functions.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: barisbalataci/eva path: /eva/data_access/data_functions.py
# -*- coding: utf-8 -*-
"""
Auxiliary data handling function: Case study UK CPI inflation projections
-------------------------------------------------------------------------
from Bank of England SWP 674: Machine learning at central bank... | code_fim | hard | {
"lang": "python",
"repo": "barisbalataci/eva",
"path": "/eva/data_access/data_functions.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sumedhbadnore/Python-Projects path: /Tkinter projects/Basics/images.py
from tkinter import*
from PIL import ImageTk, Image
root = Tk()
root.title('Say Cheese!')
root.iconbitmap('images/icons/arrow.ico')
<|fim_suffix|>button_quit = Button(root, text='Exit', command=root.quit, padx=20)
bu... | code_fim | medium | {
"lang": "python",
"repo": "sumedhbadnore/Python-Projects",
"path": "/Tkinter projects/Basics/images.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>button_quit = Button(root, text='Exit', command=root.quit, padx=20)
button_quit.pack()
root.mainloop()<|fim_prefix|># repo: sumedhbadnore/Python-Projects path: /Tkinter projects/Basics/images.py
from tkinter import*
from PIL import ImageTk, Image
<|fim_middle|>root = Tk()
root.title('Say Cheese!... | code_fim | medium | {
"lang": "python",
"repo": "sumedhbadnore/Python-Projects",
"path": "/Tkinter projects/Basics/images.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>my_img = ImageTk.PhotoImage(Image.open('images/5.jpeg'))
my_label = Label(image=my_img)
my_label.pack()
button_quit = Button(root, text='Exit', command=root.quit, padx=20)
button_quit.pack()
root.mainloop()<|fim_prefix|># repo: sumedhbadnore/Python-Projects path: /Tkinter projects/Basics/images.... | code_fim | medium | {
"lang": "python",
"repo": "sumedhbadnore/Python-Projects",
"path": "/Tkinter projects/Basics/images.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>add/', cv.add, name="add"),
url(r'add2/(\d+)/(\d+)/', cv.add2, name="add2"),
url(r're_add/(\d+)/(\d+)/', cv.add3),
]<|fim_prefix|># repo: mingod2009/mysite path: /mysite/calc/urls.py
from django.conf.urls import url
import calc.views as cv
urlp<|fim_middle|>atterns = [
url(r'^$', cv.index, n... | code_fim | medium | {
"lang": "python",
"repo": "mingod2009/mysite",
"path": "/mysite/calc/urls.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: mingod2009/mysite path: /mysite/calc/urls.py
from django.conf.urls import url
import calc.views as cv
urlpatterns = [
url(r'^$', cv.index, name='home'),
url(r'^<|fim_suffix|>dd2, name="add2"),
url(r're_add/(\d+)/(\d+)/', cv.add3),
]<|fim_middle|>add/', cv.add, name="add"),
url(r'... | code_fim | medium | {
"lang": "python",
"repo": "mingod2009/mysite",
"path": "/mysite/calc/urls.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>dd2, name="add2"),
url(r're_add/(\d+)/(\d+)/', cv.add3),
]<|fim_prefix|># repo: mingod2009/mysite path: /mysite/calc/urls.py
from django.conf.urls import url
import calc.views as cv
urlp<|fim_middle|>atterns = [
url(r'^$', cv.index, name='home'),
url(r'^add/', cv.add, name="add"),
url(r'... | code_fim | medium | {
"lang": "python",
"repo": "mingod2009/mysite",
"path": "/mysite/calc/urls.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> identifier_h = hashlib.blake2s(
identifier.encode('utf-8'), digest_size=6).hexdigest()
token_count_key = "{}:{}:count".format(self.redis_key_prefix,
identifier_h)
token_last_add_key = "{}:{}:last-add".format(self.redis_key... | code_fim | hard | {
"lang": "python",
"repo": "codl/status.chitter.xyz",
"path": "/updater/update/ratelimit.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>urlpatterns = [
url(r'^$', views.index, name='home'),
url(r'^author/$', views.authors, name='authors'),
url(r'^books/(?P<book_id>[0-9]+)/comments/new/$', views.comment_new, name='comment_new'),
url(r'^books/(?P<book_id>[0-9]+)/$', views.book_detail, name='book_detail'),
url(r'^books/ne... | code_fim | medium | {
"lang": "python",
"repo": "Vitkyk/django-library",
"path": "/library/bookstore/urls.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Vitkyk/django-library path: /library/bookstore/urls.py
from django.conf.urls import url
from django.contrib.auth import views as auth_views
<|fim_suffix|>urlpatterns = [
url(r'^$', views.index, name='home'),
url(r'^author/$', views.authors, name='authors'),
url(r'^books/(?P<book_id>[... | code_fim | medium | {
"lang": "python",
"repo": "Vitkyk/django-library",
"path": "/library/bookstore/urls.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: SURYATEJAVADDY/Assignment path: /assignment/assignment1_2.py
# Define a class called Bike that accepts a string and a float as input, and assigns those inputs respectively to two instance variables, color and price.
# Assign to the variable testOne an instance of Bike whose color is blue and who... | code_fim | medium | {
"lang": "python",
"repo": "SURYATEJAVADDY/Assignment",
"path": "/assignment/assignment1_2.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def getinfo(self):
print("color =",self.color + " and price =",self.price)
testOne = Bike()
testOne.getinfo()
testTwo = Bike()
testTwo.getinfo()<|fim_prefix|># repo: SURYATEJAVADDY/Assignment path: /assignment/assignment1_2.py
# Define a class called Bike that accepts a string and a fl... | code_fim | medium | {
"lang": "python",
"repo": "SURYATEJAVADDY/Assignment",
"path": "/assignment/assignment1_2.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ashmlk/CourseShell path: /backend/courseshell_backend/user/models.py
import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import ugettext_lazy as _
class User(AbstractUser):
<|fim_suffix|> def save(self, *args, **kwargs):
... | code_fim | hard | {
"lang": "python",
"repo": "ashmlk/CourseShell",
"path": "/backend/courseshell_backend/user/models.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> self.username = self.username.strip().lower()
super(User, self).save(*args, **kwargs)
def __str__(self):
return self.username<|fim_prefix|># repo: ashmlk/CourseShell path: /backend/courseshell_backend/user/models.py
import uuid
from django.db import models
from django.con... | code_fim | hard | {
"lang": "python",
"repo": "ashmlk/CourseShell",
"path": "/backend/courseshell_backend/user/models.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: swallowpumpkin/ImageImporter path: /imgimp.py
import argparse
import glob
from pyexiftool import exiftool
class ImageImporter:
def __init__(self):
print('hello')
def main():
parser = argparse.ArgumentParser()
for key, option in argument_options.items():
parser.add_... | code_fim | hard | {
"lang": "python",
"repo": "swallowpumpkin/ImageImporter",
"path": "/imgimp.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>argument_options = {
'sources': {
'type': str,
'help': 'import source as directory',
},
'targets': {
'type': str,
'help': 'output directory for renamed file',
},
'--digit': {
'type': int,
... | code_fim | hard | {
"lang": "python",
"repo": "swallowpumpkin/ImageImporter",
"path": "/imgimp.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: wsinbol/DataStructure path: /Search/MultiBinarySearch.py
# -*- coding:utf-8 -*-
'''
二分查找的四种变形:
查找第一个等于给定值的索引 FindFirstEqTargetBinarySearch
查找最后一个等于给定值的索引 FindLastEqTargetBinarySearch
查找第一个大于等于给定值的索引 FindFirstGEqTargetBinarySearch
查找最后一个小于等于给定值的索引 FindLastLEqTargetBinarySearch
'''
def FindFi... | code_fim | hard | {
"lang": "python",
"repo": "wsinbol/DataStructure",
"path": "/Search/MultiBinarySearch.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> low = 0
high = len(arr) - 1
while low <= high:
mid = int((low + high) / 2)
if arr[mid] < value:
low = mid + 1
else:
# 在所有大于等于给定值的元素中操作,当找出的mid的前一个小于给定元素,则此mid为最终目标
if mid == 0 or arr[mid - 1] < value:
return mid
else:
high = mid - 1
return
def FindLastLEqTargetBinarySearch(... | code_fim | hard | {
"lang": "python",
"repo": "wsinbol/DataStructure",
"path": "/Search/MultiBinarySearch.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> LookupModule
from .schema import SchemaModule
from .team import TeamModule
from .user import UserModule<|fim_prefix|># repo: quantumframework/python-queen path: /queen/ext/awx/ansible/__init__.py
from .credentialtype import CredentialTypeModule
from .credential import CredentialModule
from .invento<|fim... | code_fim | hard | {
"lang": "python",
"repo": "quantumframework/python-queen",
"path": "/queen/ext/awx/ansible/__init__.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: quantumframework/python-queen path: /queen/ext/awx/ansible/__init__.py
from .credentialtype import CredentialTypeModule
from .credential import CredentialModule
from .invento<|fim_suffix|> LookupModule
from .schema import SchemaModule
from .team import TeamModule
from .user import UserModule<|fim... | code_fim | hard | {
"lang": "python",
"repo": "quantumframework/python-queen",
"path": "/queen/ext/awx/ansible/__init__.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: MANSHALAMBA/LearningBasicsofPython path: /op.py
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> workinfile=open("demo.txt","r")
>>> content=workinfile.readline()
>>> print(content... | code_fim | hard | {
"lang": "python",
"repo": "MANSHALAMBA/LearningBasicsofPython",
"path": "/op.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>['me', '20']
me
20
['bhai', ' 24']
bhai
24
['mom', ' 50']
mom
50
['dad', ' 55']
dad
55
>>> with open("demo.txt","r") as myfile: # another way of opening file difference it automaticlaay closes file after coming out of indentation or if any error takes place.
content=csv.reader(myfile) #reader is ... | code_fim | hard | {
"lang": "python",
"repo": "MANSHALAMBA/LearningBasicsofPython",
"path": "/op.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>Traceback (most recent call last):
File "<pyshell#25>", line 1, in <module>
for rows in content:
ValueError: I/O operation on closed file.
>>> for rows in content:
print(','.join(rows))
for a in rows:
print(a)
SyntaxError: unexpected indent
>>> fo... | code_fim | hard | {
"lang": "python",
"repo": "MANSHALAMBA/LearningBasicsofPython",
"path": "/op.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: masanam/PhytonFlask path: /Task value group/view/view_EDIT_task_value_group.py
#import blueprint
from flask import Blueprint, render_template, abort
from jinja2 import TemplateNotFound
import sys
from main import getPath
sys.path.insert(1, getPath()+'/Task value group/controller/')
from contro... | code_fim | medium | {
"lang": "python",
"repo": "masanam/PhytonFlask",
"path": "/Task value group/view/view_EDIT_task_value_group.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>@EDIT_task_value_group.route("/view_EDIT_task_value_group", methods=['GET', 'POST'])
def view_EDIT_task_value_group():
return EditController.edit_controller()<|fim_prefix|># repo: masanam/PhytonFlask path: /Task value group/view/view_EDIT_task_value_group.py
#import blueprint
from flask ... | code_fim | hard | {
"lang": "python",
"repo": "masanam/PhytonFlask",
"path": "/Task value group/view/view_EDIT_task_value_group.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: thor5/planerix-booking1 path: /server/api/migrations/0001_initial.py
# Generated by Django 3.2.6 on 2021-08-21 10:55
from django.db import migrations, models
import django_extensions.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operation... | code_fim | hard | {
"lang": "python",
"repo": "thor5/planerix-booking1",
"path": "/server/api/migrations/0001_initial.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>bose_name='Плата за час')),
('full_name', models.CharField(blank=True, default=None, max_length=255, null=True, verbose_name='имя арендатора')),
('email', models.EmailField(max_length=254, verbose_name='Почта арендатора')),
('booked', models.BooleanField(bla... | code_fim | hard | {
"lang": "python",
"repo": "thor5/planerix-booking1",
"path": "/server/api/migrations/0001_initial.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: JJongHak/alarm-clock path: /src/apps/alarm_clock/tests/test_api.py
import pytest
from unittest.mock import patch
from ..api import *
from ..alarm import Alarm
from .. import AlarmClockApp
from ..alarm_states import Disabled, Enabled
class AlarmClockMock(AlarmClockApp):
auto_store = False
... | code_fim | hard | {
"lang": "python",
"repo": "JJongHak/alarm-clock",
"path": "/src/apps/alarm_clock/tests/test_api.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>@pytest.mark.asyncio
async def test_snooze():
ac = AlarmClockMock()
with patch("uaos.App.get_app", return_value=ac):
await snooze("")
assert ac.snooze
@pytest.mark.asyncio
async def test_disable():
ac = AlarmClockMock({123: Alarm()})
assert ac.alarms[123] == Enabled
with ... | code_fim | hard | {
"lang": "python",
"repo": "JJongHak/alarm-clock",
"path": "/src/apps/alarm_clock/tests/test_api.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: shybkoi/WMS-Demo path: /systems/KURSSKLAD/REFERENCE/SELGROUP/selgroup.py
# -*- coding: cp1251 -*-
#from systems.KURSSKLAD.REFERENCE.common import RCommon
from systems.KURSSKLAD.common import WHCommon
from systems.KURSSKLAD.taskInfo import TaskInfo
from systems.KURSSKLAD.REFERENCE.SELGROUP.templat... | code_fim | hard | {
"lang": "python",
"repo": "shybkoi/WMS-Demo",
"path": "/systems/KURSSKLAD/REFERENCE/SELGROUP/selgroup.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def waresByGroupLocateSG(self, wgid=None):
dSet = self.dbExecC(sql='select count(WID) as AMOUNT, coalesce(g.wselgrid,0) as wselgrid, g.wselgrcode, g.wselgrname\
from K_WH_SPWARES_BY_GROUP(?) g\
group by g.wselgrid, g.wselgrname... | code_fim | hard | {
"lang": "python",
"repo": "shybkoi/WMS-Demo",
"path": "/systems/KURSSKLAD/REFERENCE/SELGROUP/selgroup.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return assignment
def make_boto_hit(hit_id=None, batch_id=None):
"""Create a new random HIT.
:rtype: mock.MagicMock
"""
hit = mock.MagicMock()
hit.HITId = (hit_id if hit_id else str(uuid.uuid4()))
hit.RequesterAnnotation = (batch_id if batch_id else str(uuid.uuid4()))
re... | code_fim | hard | {
"lang": "python",
"repo": "etscrivner/turkleton",
"path": "/tests/assignment/factories.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: etscrivner/turkleton path: /tests/assignment/factories.py
# -*- coding: utf-8 -*-
"""
tests.assignment.factories
~~~~~~~~~~~~~~~~~~~~~~~~~~
Factories for producing assignment related object.
"""
import uuid
import mock
from turkleton.assignment import task
class CategorizationTas... | code_fim | hard | {
"lang": "python",
"repo": "etscrivner/turkleton",
"path": "/tests/assignment/factories.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>def make_boto_assignment(values):
"""Creates a new boto assignment mock class with the given fields
supplied with the specified values.
:param values: A dictionary mapping question names to values
:type values: dict
:rtype: mock.MagicMock
"""
assignment = mock.MagicMock()
... | code_fim | hard | {
"lang": "python",
"repo": "etscrivner/turkleton",
"path": "/tests/assignment/factories.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>#tree.Attach(ssdlMCtruth)
#tree.TAttach(ssdlMCtruth,ssdlTrigg)
##tree.Attach(ssdlTrigg)
#tree.TAttach(ssdlTrigg,ssdlSelec)
import robe_icfV08 as mysamplesV08
#samples=[mysamplesV08.ttbar]
#samples=[mysamplesV08.ttbar,mysamplesV08.qcd300]
#samples=[mysamplesV08.ttbar,mysamplesV08.qcd300]
samples=[mysampl... | code_fim | hard | {
"lang": "python",
"repo": "brynmathias/AnalysisV2",
"path": "/ssdl/scripts/.svn/text-base/taubkgEv.py.svn-base",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: brynmathias/AnalysisV2 path: /ssdl/scripts/.svn/text-base/taubkgEv.py.svn-base
#!/usr/bin/env python
# Example analysis script, commented for clarity
import setupSUSY
# Import core framework library and the ssdl library
from libFrameworkSUSY import *
from libSSDL import *
import lep_conf as lep... | code_fim | hard | {
"lang": "python",
"repo": "brynmathias/AnalysisV2",
"path": "/ssdl/scripts/.svn/text-base/taubkgEv.py.svn-base",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Aasthaengg/IBMdataset path: /Python_codes/p02821/s253920531.py
import numpy as np
def convolve(A, B):
# 畳み込み # 要素は整数
# 3 つ以上の場合は一度にやった方がいい
dtype = np.int64
fft, ifft = np.fft.rfft, np.fft.irfft
a, b = len(A), len(B)
if a == b == 1:
return np.array([A[0]*B[0]])
... | code_fim | medium | {
"lang": "python",
"repo": "Aasthaengg/IBMdataset",
"path": "/Python_codes/p02821/s253920531.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>c = convolve(cnt,cnt)
ans = 0
for i in range(len(c))[::-1]:
if c[i] > 0:
p = min(m,c[i])
m -= p
ans += i*p
if m == 0:
break
print(ans)<|fim_prefix|># repo: Aasthaengg/IBMdataset path: /Python_codes/p02821/s253920531.py
import numpy as np
def convolve(A, B):
# 畳み込み ... | code_fim | medium | {
"lang": "python",
"repo": "Aasthaengg/IBMdataset",
"path": "/Python_codes/p02821/s253920531.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return self.__hoj_set
def set_hoj_label( self, _hoj_labels ):
self.__hoj_labels = _hoj_labels
def get_hoj_label( self ):
return self.__hoj_labels
def set_hoj_set_name( self, _name ):
self.__hoj_set_name = _name
def get_hoj_set_name( self ):
return self.__hoj_set_name<|fim_pre... | code_fim | medium | {
"lang": "python",
"repo": "Nudelreaktor/pyNTURGB-D_Extraction_v1",
"path": "/single_hoj_set.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Nudelreaktor/pyNTURGB-D_Extraction_v1 path: /single_hoj_set.py
#!/usr/bin/env python2
import numpy as np
class single_hoj_set():
def __init(self):
self.__hoj_set_name = ""
self.__hoj_set = np.array([])
self.__hoj_labels = np.array([])
def set_hoj_set( self, _hoj_set ):
s... | code_fim | medium | {
"lang": "python",
"repo": "Nudelreaktor/pyNTURGB-D_Extraction_v1",
"path": "/single_hoj_set.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def get_hoj_label( self ):
return self.__hoj_labels
def set_hoj_set_name( self, _name ):
self.__hoj_set_name = _name
def get_hoj_set_name( self ):
return self.__hoj_set_name<|fim_prefix|># repo: Nudelreaktor/pyNTURGB-D_Extraction_v1 path: /single_hoj_set.py
#!/usr/bin/env python2
imp... | code_fim | medium | {
"lang": "python",
"repo": "Nudelreaktor/pyNTURGB-D_Extraction_v1",
"path": "/single_hoj_set.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>label_TITLE.grid(row=0,column=0,rowspan=2,sticky=NW,ipadx=3,ipady=15)
frm_NE1.grid(row=0,column=1,ipadx=10,pady=3)
frm_NE2.grid(row=0,column=2,ipadx=14,padx=5,pady=3)
btn_RST.grid(row=1,column=1,columnspan=2,padx=8,pady=5,sticky=SE)
frm_S.grid(row=2,column=0,columnspan=3,padx=6,pady=5,sticky=W)
label_SC... | code_fim | hard | {
"lang": "python",
"repo": "xzz308/DemoPrj",
"path": "/python/tk_test/tk_test2.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: xzz308/DemoPrj path: /python/tk_test/tk_test2.py
from tkinter import *
import tkinter.messagebox
def clickCallback():
tkinter.messagebox.askokcancel( "Hello Python", "Hello Runoob")
root = Tk()
root.geometry('250x340')
root.title('2048')
root.minsize(250,340)
root.maxsize(250,340)
root[... | code_fim | medium | {
"lang": "python",
"repo": "xzz308/DemoPrj",
"path": "/python/tk_test/tk_test2.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
label_SCORE.grid(row=0,column=0,sticky=W)
label_BEST.grid(row=0,column=0,sticky=W)
label_nSCORE.grid(row=1,column=0,sticky=W,ipadx=2)
label_nBEST.grid(row=1,column=0,sticky=W,ipadx=2)
root.mainloop()<|fim_prefix|># repo: xzz308/DemoPrj path: /python/tk_test/tk_test2.py
from tkinter import *
import tk... | code_fim | hard | {
"lang": "python",
"repo": "xzz308/DemoPrj",
"path": "/python/tk_test/tk_test2.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: guinslym/cstmc_helper_to_parse_the_dataset path: /parsing.py
import urllib2
import json
from pprint import pprint
from threading import Thread
import os
import time#benchmark
import datetime
#contains all the noun found url
not_found_url = []
temporary_holder = []
data_list_json= []
def create_... | code_fim | hard | {
"lang": "python",
"repo": "guinslym/cstmc_helper_to_parse_the_dataset",
"path": "/parsing.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> f.close()
except urllib2.HTTPError, URLError:
print("error not a valid url")
not_found_url.append(url)
temporary_holder.append(url)
def parse_this_json_file(file):
json_data=open('json/'+ file)
data = json.load(json_data)
data_list_json = create_a_list_of... | code_fim | hard | {
"lang": "python",
"repo": "guinslym/cstmc_helper_to_parse_the_dataset",
"path": "/parsing.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> with io.open(dataset_name, 'w', encoding='utf-8') as f:
f.write(unicode(json.dumps(artefact, ensure_ascii=True, indent=4 )))
def main():
files = os.listdir('json')
for f in files[::]:
print(f)
temporary_holder =[]
if os.path.isfile("json/"+f):
parse... | code_fim | hard | {
"lang": "python",
"repo": "guinslym/cstmc_helper_to_parse_the_dataset",
"path": "/parsing.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: NeelimaNalin/UItest path: /TestSuite.py
import unittest
import os
from HtmlTestRunner import HTMLTestRunner
from UnitTest import SearchText
from GoogleImage import HomePageTest
# get the directory path to output report file
dir = os.getcwd()
<|fim_suffix|># run the suite
runner = HTMLTestRunn... | code_fim | hard | {
"lang": "python",
"repo": "NeelimaNalin/UItest",
"path": "/TestSuite.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|># run the suite
runner = HTMLTestRunner(output='example_test_suite')
# run the suite using HTMLTestRunner
runner.run(test_suite)<|fim_prefix|># repo: NeelimaNalin/UItest path: /TestSuite.py
import unittest
import os
from HtmlTestRunner import HTMLTestRunner
from UnitTest import SearchText
from GoogleI... | code_fim | hard | {
"lang": "python",
"repo": "NeelimaNalin/UItest",
"path": "/TestSuite.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ldev-r3-t4/storage_server path: /web/swagger_server/models/problem.py
# coding: utf-8
from __future__ import absolute_import
from swagger_server.models.body import Body
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize... | code_fim | hard | {
"lang": "python",
"repo": "ldev-r3-t4/storage_server",
"path": "/web/swagger_server/models/problem.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.