text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_prefix|># repo: snehasinghania/compression-algorithms path: /lzwdecoding.py
ptr = open("outputf.txt", "r")
fptr = open("decoded.txt" , "w")
dic = {}
<|fim_suffix|>pointer = 128
code = ptr.readline()
code = int(code[:-1])
previous_char = dic[code]
#print previous_char
fptr.write(previous_char)
counter = 1
fo... | code_fim | medium | {
"lang": "python",
"repo": "snehasinghania/compression-algorithms",
"path": "/lzwdecoding.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>for code in ptr:
counter += 1
code = int(code[:-1])
#print "code received " , code , " " ,
if code not in dic.keys():
rcvd = previous_char + previous_char[0]
else:
rcvd = dic[code]
#print rcvd
fptr.write(rcvd)
dic[pointer] = previous_char + rcvd[0]
pointer += 1
previous_char = rcvd
#pri... | code_fim | medium | {
"lang": "python",
"repo": "snehasinghania/compression-algorithms",
"path": "/lzwdecoding.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> Example: if str(cmyk) is
'(0.0,31.3725490196,31.3725490196,0.0)'
then str5_cmyk(cmyk) is '(0.000, 31.37, 31.37, 0.000)'. Note the spaces
after the commas. These must be there.
Parameter cmtk: the color to convert to a string
Precondition: cmyk is an CMYK objec... | code_fim | hard | {
"lang": "python",
"repo": "jenniferxlin/CS-1110-A3-Color-Models",
"path": "/a3.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: jenniferxlin/CS-1110-A3-Color-Models path: /a3.py
# a3.py
# Jennifer Lin
# October 6, 2016
# Mia and Meghan suggested ways for how to write some of my code.
""" Functions for Assignment A3"""
import colormodel
import math
def complement_rgb(rgb):
"""Returns: the complement of color rgb.
... | code_fim | hard | {
"lang": "python",
"repo": "jenniferxlin/CS-1110-A3-Color-Models",
"path": "/a3.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>file = input("Insert file's name: ")
removeWhitespaceInfile(file)
print("OK")<|fim_prefix|># repo: alverad-katsuro/Python path: /python-examples-master/removeWhitespaceInfile/remove_whitespace.py
#!/bin/env python3
#Author: https://github.com/JohnWillker
<|fim_middle|>def removeWhitespaceInfile(file):
... | code_fim | hard | {
"lang": "python",
"repo": "alverad-katsuro/Python",
"path": "/python-examples-master/removeWhitespaceInfile/remove_whitespace.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> var_file = open(file, "r")
txt = var_file.read()
txt = txt.replace(' ', '').replace('\n', '')
var_file.close()
var_file = open(file, "w")
var_file.write(txt)
var_file.close()
file = input("Insert file's name: ")
removeWhitespaceInfile(file)
print("OK")<|fim_prefix|># repo: alv... | code_fim | easy | {
"lang": "python",
"repo": "alverad-katsuro/Python",
"path": "/python-examples-master/removeWhitespaceInfile/remove_whitespace.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: alverad-katsuro/Python path: /python-examples-master/removeWhitespaceInfile/remove_whitespace.py
#!/bin/env python3
#Author: https://github.com/JohnWillker
<|fim_suffix|> var_file = open(file, "r")
txt = var_file.read()
txt = txt.replace(' ', '').replace('\n', '')
var_file.close()... | code_fim | easy | {
"lang": "python",
"repo": "alverad-katsuro/Python",
"path": "/python-examples-master/removeWhitespaceInfile/remove_whitespace.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>289257474773567236829982654825474435937766729476455933465952323314658756826111625315518939418869683169128471126487291434896188825338697199443135247471737687874594876917124324262121991237873175554438724944399738239971473835185775232936799766516695646754445981758291547851448654145393217559841355425967211736... | code_fim | hard | {
"lang": "python",
"repo": "fdelia/advent-of-code-2017",
"path": "/1.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: fdelia/advent-of-code-2017 path: /1.py
puzzle_input = "95148459654114155731698478149499917967976774762713244751317162642456177966287315776144295221229668557345231126344516323349319921138783846159463566669942298294778262331733368397843812326132686395971977717922859931932113894846656274376158483618... | code_fim | hard | {
"lang": "python",
"repo": "fdelia/advent-of-code-2017",
"path": "/1.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: gcherr/CodeEval path: /Easy/SumofDigits/Python/SumofDigits.py3
import sys
#Reads the number right to left and adds each digit along the way
#Does so by adding the rightmost digit to a total and recursively calling sum
def sum(base):
<|fim_suffix|>def main():
lines = open(sys.argv[1], 'r')
... | code_fim | medium | {
"lang": "python",
"repo": "gcherr/CodeEval",
"path": "/Easy/SumofDigits/Python/SumofDigits.py3",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>def main():
lines = open(sys.argv[1], 'r')
content = lines.readlines()
for i in range (len (content)):
base = content[i].rstrip('\n')
print(sum(int(base)))
main()<|fim_prefix|># repo: gcherr/CodeEval path: /Easy/SumofDigits/Python/SumofDigits.py3
import sys
#Reads the number right ... | code_fim | medium | {
"lang": "python",
"repo": "gcherr/CodeEval",
"path": "/Easy/SumofDigits/Python/SumofDigits.py3",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: panchengl/yolov3_prune path: /aa.py
# a =[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 22]
# b = 0
# new_shortcut_list = [0, 0, 0, 0, 0]
# new_shortcut_list_2 = [0, 0, 0, 0, 0]
#
# if 0 in a:
# new_shortcut_list[0] += 1
# if 1 in a:
# new_shortcut_list[1] += 1
# if 2 in a:
#... | code_fim | hard | {
"lang": "python",
"repo": "panchengl/yolov3_prune",
"path": "/aa.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>dy/Conv_' + str(47) + '/weights:0')
# # layer_prune_name.remove('yolov3/darknet53_body/Conv_' + str(27) + '/weights:0')
# for i, j in enumerate(layer_prune_name):
# print(str(j).split('/')[2][5:])
# # first[i] = j
# # if int(str(j).split('/')[2][5:]) >= b[0]:
# # first[i] = 'yolov3/dar... | code_fim | hard | {
"lang": "python",
"repo": "panchengl/yolov3_prune",
"path": "/aa.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: toado/CMPUT401-Lab1 path: /requests_version_script.py
import requests
print("requests version: {}\n".format(requests.__version__))
<|fim_suffix|>raw_code = requests.get("https://raw.githubusercontent.com/toado/CMPUT401-Lab1/main/requests_version_script.py").text
print(raw_code)<|fim_middle|>res... | code_fim | medium | {
"lang": "python",
"repo": "toado/CMPUT401-Lab1",
"path": "/requests_version_script.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>raw_code = requests.get("https://raw.githubusercontent.com/toado/CMPUT401-Lab1/main/requests_version_script.py").text
print(raw_code)<|fim_prefix|># repo: toado/CMPUT401-Lab1 path: /requests_version_script.py
import requests
print("requests version: {}\n".format(requests.__version__))
<|fim_middle|>res... | code_fim | medium | {
"lang": "python",
"repo": "toado/CMPUT401-Lab1",
"path": "/requests_version_script.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
# Solving Problem by BGA
my_model = BGA(population_size, probability_crossover, probability_mutation, function, variables, variable_bits, variable_min, variable_max, max_generations)
(solution_binary, solution_real) = my_model.find_min()
for i in range(0, len(solution_binary)):
s... | code_fim | hard | {
"lang": "python",
"repo": "m-pathania/binary_coded_GA",
"path": "/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> for i in range(0, len(solution_binary)):
solution_binary[i] = int(solution_binary[i])
# Saving Results to file
with open("result_final.dat", "w") as file:
file.write("Binary Solution ===>\n")
print("\n\nBinary Solution ===>\n", end = "")
start = 0
for i... | code_fim | hard | {
"lang": "python",
"repo": "m-pathania/binary_coded_GA",
"path": "/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: m-pathania/binary_coded_GA path: /main.py
'''
ME674 Soft Computing in Engineering
Programming Assignment 2
Binary Coded Genetic Algorithm
Name = Mayank Pathania
Roll No. = 204103314
Specialization = Machine Design
'''
import random
import math
# importing function to be... | code_fim | hard | {
"lang": "python",
"repo": "m-pathania/binary_coded_GA",
"path": "/main.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: marco-c/gecko-dev-wordified path: /third_party/libwebrtc/build/android/gyp/unused_resources.py
#
!
/
usr
/
bin
/
env
python3
#
encoding
:
utf
-
8
#
Copyright
(
c
)
2021
The
Chromium
Authors
.
All
rights
reserved
.
#
Use
of
this
source
code
is
governed
by
a
BSD
-
style
license
that
can
be
#
found
... | code_fim | hard | {
"lang": "python",
"repo": "marco-c/gecko-dev-wordified",
"path": "/third_party/libwebrtc/build/android/gyp/unused_resources.py",
"mode": "psm",
"license": "LicenseRef-scancode-unknown-license-reference",
"source": "the-stack-v2"
} |
<|fim_suffix|>cmd
=
[
options
.
script
'
-
-
rtxts
'
options
.
r_text
'
-
-
manifests
'
'
:
'
.
join
(
options
.
android_manifests
)
'
-
-
resourceDirs
'
'
:
'
.
join
(
dep_subdirs
)
'
-
-
dexes
'
'
:
'
.
join
(
options
.
dexes
)
... | code_fim | hard | {
"lang": "python",
"repo": "marco-c/gecko-dev-wordified",
"path": "/third_party/libwebrtc/build/android/gyp/unused_resources.py",
"mode": "spm",
"license": "LicenseRef-scancode-unknown-license-reference",
"source": "the-stack-v2"
} |
<|fim_suffix|>fig, ax = plt.subplots()
space = range(len(in_region))
ax.plot(space, (in_region[:,3].astype(float) - tmean) / tstd, ls='--', marker='x')
ax.set_xticks(space)
ax.set_xticklabels(in_region[:,2])
ax.set_ylabel('z-normalized transcript level')
ax.set_xlabel('gene')
ax.axvline(5.5, c='r')
plt.show()<|fim_pre... | code_fim | medium | {
"lang": "python",
"repo": "simeoncarstens/ensemble_hic",
"path": "/data/nora2012/gene_expression.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>region_start = 100378306
region_end = 101298738
in_region = np.array(filter(lambda x: float(x[0]) >= region_start
and float(x[1]) <= region_end, table))
fig, ax = plt.subplots()
space = range(len(in_region))
ax.plot(space, (in_region[:,3].astype(float) - tmean) / tstd, ls='-... | code_fim | hard | {
"lang": "python",
"repo": "simeoncarstens/ensemble_hic",
"path": "/data/nora2012/gene_expression.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: simeoncarstens/ensemble_hic path: /data/nora2012/gene_expression.py
import os
import numpy as np
import matplotlib.pyplot as plt
from xlrd import open_workbook
dpath = os.path.expanduser('~/projects/ensemble_hic/data/nora2012/nature11049-s5.xls')
wb = open_workbook(dpath)
sheet = wb.sheets()[0]
... | code_fim | medium | {
"lang": "python",
"repo": "simeoncarstens/ensemble_hic",
"path": "/data/nora2012/gene_expression.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: xivlo-sysadmins/dns-api path: /certbot-dns-api/certbot_dns_api/_internal/dns_api.py
"""DNS Authenticator using DNS API Dynamic Updates."""
import logging
from typing import Optional
import dns.flags
import dns.message
import dns.name
import dns.query
import dns.rdataclass
import dns.rdatatype
im... | code_fim | hard | {
"lang": "python",
"repo": "xivlo-sysadmins/dns-api",
"path": "/certbot-dns-api/certbot_dns_api/_internal/dns_api.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def del_txt_record(self, record_name, record_content):
"""
Delete a TXT record using the supplied information.
:param str record_name: The record name (typically beginning with '_acme-challenge.').
:param str record_content: The record content (typically the challenge v... | code_fim | hard | {
"lang": "python",
"repo": "xivlo-sysadmins/dns-api",
"path": "/certbot-dns-api/certbot_dns_api/_internal/dns_api.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>b.append(i)
print(len(s)%6)
print(len(b)%6)
print(len(d)%6)<|fim_prefix|># repo: Dhavade/Data-structure path: /linkedlist/single-linkedlist/delet-oparation2/p.py
#a=input()
b=[]
s=[]
d=[]
b=[]
for i in range(6):
b.append(i<|fim_middle|>nput("enter number"))
print(b)
for i in b:
... | code_fim | medium | {
"lang": "python",
"repo": "Dhavade/Data-structure",
"path": "/linkedlist/single-linkedlist/delet-oparation2/p.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Dhavade/Data-structure path: /linkedlist/single-linkedlist/delet-oparation2/p.py
#a=input()
b=[]
s=[]
d=[]
b=[]
for i in range(6):
b.append(i<|fim_suffix|>s.append(i)
elif (i>0):
d.append(i)
else:
b.append(i)
print(len(s)%6)
print(len(b)%6)
print(l... | code_fim | medium | {
"lang": "python",
"repo": "Dhavade/Data-structure",
"path": "/linkedlist/single-linkedlist/delet-oparation2/p.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: jjoocceeee/led-display path: /Src/message.py
import serial
ser = serial.Serial()
ser.baudrat<|fim_suffix|>):
print(ser.readline())
i = input().encode()
ser.write(i)
print(ser.readline())<|fim_middle|>e = 115200
ser.port = "COM3"
ser.open()
while(1 | code_fim | easy | {
"lang": "python",
"repo": "jjoocceeee/led-display",
"path": "/Src/message.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>ode()
ser.write(i)
print(ser.readline())<|fim_prefix|># repo: jjoocceeee/led-display path: /Src/message.py
import serial
ser = serial.Serial()
ser.baudrate = 115200
ser.port = "COM3"
ser.open()
while(1<|fim_middle|>):
print(ser.readline())
i = input().enc | code_fim | easy | {
"lang": "python",
"repo": "jjoocceeee/led-display",
"path": "/Src/message.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> list_of_trips = self.getTrips()
headers = self.getTripsHeaders()
headers2 = []
for item in headers:
if item == 'out. flight nr':
headers2.append('out_flight_nr')
elif item == 'out. dep':
headers2.append('out_dep')
... | code_fim | hard | {
"lang": "python",
"repo": "magnsve/T-113-VLN1",
"path": "/Verkefni - Nan Air/NaN_Air/DataLayer/dl_trips.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: magnsve/T-113-VLN1 path: /Verkefni - Nan Air/NaN_Air/DataLayer/dl_trips.py
# Imports and constants
import csv, codecs, dateutil.parser, datetime
from ModelClasses.trip import Trip
from .dl_destinations import DL_Destinations
# Classes
class DL_Trips():
''' This class handles the database for... | code_fim | hard | {
"lang": "python",
"repo": "magnsve/T-113-VLN1",
"path": "/Verkefni - Nan Air/NaN_Air/DataLayer/dl_trips.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def getTripsHeaders(self):
with open(self.FILE_NAME, encoding="utf-8-sig") as _file:
dict_reader = csv.DictReader(_file)
return dict_reader.fieldnames
def setStatus(self, trip):
if trip.get_out_dep() == '':
pass
else: ... | code_fim | hard | {
"lang": "python",
"repo": "magnsve/T-113-VLN1",
"path": "/Verkefni - Nan Air/NaN_Air/DataLayer/dl_trips.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: bokusunny/atcoder-archive path: /atcoder.jp/arc118/arc118_b/Main.py
k,n,m = map(int, input().split())
a_list = list(map(int, input().split()))
ma_list= []
for a in a_list:
ma_list.append(a*m)
<|fim_suffix|>if m<b_sum:
while m < b_sum:
diff, i = heappop(diff_list_dec)
diff *= -1
b... | code_fim | hard | {
"lang": "python",
"repo": "bokusunny/atcoder-archive",
"path": "/atcoder.jp/arc118/arc118_b/Main.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>if m<b_sum:
while m < b_sum:
diff, i = heappop(diff_list_dec)
diff *= -1
b_list[i] -= 1
b_sum -= 1
heappush(diff_list_dec, (-diff+n, i))
elif m>b_sum:
while m > b_sum:
diff, i = heappop(diff_list_asc)
b_list[i] += 1
b_sum += 1
heappush(diff_list_asc, (diff+n, i))
pr... | code_fim | hard | {
"lang": "python",
"repo": "bokusunny/atcoder-archive",
"path": "/atcoder.jp/arc118/arc118_b/Main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: TAKEDA-Nura/shikin path: /scrapy/erad/erad/pipelines.py
from datetime import datetime
from sqlalchemy.orm import sessionmaker
from sqlalchemy import exc, Table, MetaData, Column, Date, String
from erad.models import FundDatabase, db_connect, create_table
from sqlalchemy.dialects.mysql import inse... | code_fim | hard | {
"lang": "python",
"repo": "TAKEDA-Nura/shikin",
"path": "/scrapy/erad/erad/pipelines.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # DBへ登録
session = self.Session()
funddb = FundDatabase()
funddb.erad_key = item["erad_key"]
funddb.erad_url = item["erad_url"]
funddb.url = item["url"]
funddb.publishing_date = item["publishing_date"]
funddb.funding_agency = item["funding_age... | code_fim | hard | {
"lang": "python",
"repo": "TAKEDA-Nura/shikin",
"path": "/scrapy/erad/erad/pipelines.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: TAzOnee/SpeakerRecognition path: /gui.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
import glob
from utils import read_wav
from PyQt5 import ... | code_fim | hard | {
"lang": "python",
"repo": "TAzOnee/SpeakerRecognition",
"path": "/gui.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def load_model(self,MainWindow):
global m
fileName = QtWidgets.QFileDialog().getOpenFileName(MainWindow, "Load Model", "", "Model File (*.out)")
print(fileName[0])
self.ln_model.setText(fileName[0])
m = ModelInterface.load(fileName[0])
def load_wav... | code_fim | hard | {
"lang": "python",
"repo": "TAzOnee/SpeakerRecognition",
"path": "/gui.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> def play_predict(self):
self.pre_dict()
self.play_wav()
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label.setText(_translate("MainWindow"... | code_fim | hard | {
"lang": "python",
"repo": "TAzOnee/SpeakerRecognition",
"path": "/gui.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
if __name__ == "__main__":
lvl = int(input('Введите уровень игры'))
point = 0
winscore = 35
width_of_window = 800
height_of_windows = 600
root = tk.Tk()
root.geometry('{}x{}'.format(width_of_window, height_of_windows))
root.wm_attributes('-topmost', 1)
canv = tk.Canvas... | code_fim | hard | {
"lang": "python",
"repo": "ameshkov27/cs_mipt_python3",
"path": "/lab7/ex1.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ameshkov27/cs_mipt_python3 path: /lab7/ex1.py
import tkinter as tk
from random import randint, choice
class Ball:
def __init__(self):
colors = ['red', 'orange', 'black', 'green', 'yellow', 'blue']
delta = [-0.05, -0.04, -0.03, -0.03, -0.02, -0.01, +0.01, +0.02, +0.03, +0.... | code_fim | hard | {
"lang": "python",
"repo": "ameshkov27/cs_mipt_python3",
"path": "/lab7/ex1.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Tyler-C2/advent_of_code_2020 path: /advent2020/day1/day1_part2.py
lst_of_nums = []
def loader():
expense_lst = []
with open("expense_report.txt") as report:
for line in report:
expense_lst.append(int(line))
return expense_lst
<|fim_suffix|> return m... | code_fim | hard | {
"lang": "python",
"repo": "Tyler-C2/advent_of_code_2020",
"path": "/advent2020/day1/day1_part2.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> sum = num1 + num2
dif = 2020 - sum
for i in lst:
if i == dif:
lst_of_nums.append(num1)
lst_of_nums.append(num2)
lst_of_nums.append(i)
return True
def mult_lst(lst):
final_lst = list(set(lst))
product = 1
for i in... | code_fim | medium | {
"lang": "python",
"repo": "Tyler-C2/advent_of_code_2020",
"path": "/advent2020/day1/day1_part2.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: daboo72/Assignments path: /Assignment3.py
#!/usr/bin/env python
# coding: utf-8
<|fim_suffix|>list3=list2.copy()
print(list3)
# In[40]:
l1=[12,15,17,19,30,45,10,56,95,10]
print(l1.count(10))
# In[ ]:<|fim_middle|># In[19]:
#
# In[21]:
#
# In[23]:
list=["foo","bar","baz"]
list[1]=... | code_fim | hard | {
"lang": "python",
"repo": "daboo72/Assignments",
"path": "/Assignment3.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>list3=list2.copy()
print(list3)
# In[40]:
l1=[12,15,17,19,30,45,10,56,95,10]
print(l1.count(10))
# In[ ]:<|fim_prefix|># repo: daboo72/Assignments path: /Assignment3.py
#!/usr/bin/env python
# coding: utf-8
# In[19]:
#
# In[21]:
#
# In[23]:
list=["foo","bar","baz"]
list[1]="run"
print(li... | code_fim | medium | {
"lang": "python",
"repo": "daboo72/Assignments",
"path": "/Assignment3.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: daboo72/Assignments path: /Assignment3.py
#!/usr/bin/env python
# coding: utf-8
# In[19]:
#
# In[21]:
#
# In[23]:
list=["foo","bar","baz"]
list[1]="run"
print(list)
print(list[1])
# In[30]:
a=[]
print(type(a))
print(a)
# In[34]:
<|fim_suffix|>l1=[12,15,17,19,30,45,10,56,95,10]
... | code_fim | medium | {
"lang": "python",
"repo": "daboo72/Assignments",
"path": "/Assignment3.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: lianchonghui/django-blog path: /comments/factories.py
from django.contrib.sites.models import Site
from django.utils import timezone
<|fim_suffix|>class BlogCommentFactory(DjangoModelFactory):
class Meta:
model = BlogComment
site = factory.SubFactory(SiteFactory)
content_obj... | code_fim | hard | {
"lang": "python",
"repo": "lianchonghui/django-blog",
"path": "/comments/factories.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> site = factory.SubFactory(SiteFactory)
content_object = factory.SubFactory(PostFactory)
user = factory.SubFactory(UserFactory)
comment = factory.Sequence(lambda n: 'comment %s' % n)
submit_date = factory.LazyFunction(timezone.now)<|fim_prefix|># repo: lianchonghui/django-blog path: /c... | code_fim | hard | {
"lang": "python",
"repo": "lianchonghui/django-blog",
"path": "/comments/factories.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> class Meta:
model = BlogComment
site = factory.SubFactory(SiteFactory)
content_object = factory.SubFactory(PostFactory)
user = factory.SubFactory(UserFactory)
comment = factory.Sequence(lambda n: 'comment %s' % n)
submit_date = factory.LazyFunction(timezone.now)<|fim_prefi... | code_fim | hard | {
"lang": "python",
"repo": "lianchonghui/django-blog",
"path": "/comments/factories.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> sep = kargs.pop('sep', ' ')
end = kargs.pop('end', '\n')
file = kargs.pop('file', sys.stdout)
if kargs: raise TypeError('Extra Keywords: %s' % kargs)
output = ''
first = True
for arg in args:
output += ('' if first else sep) + str(arg)
first = False
file.wri... | code_fim | hard | {
"lang": "python",
"repo": "dackour/python",
"path": "/Chapter_18/04_Emulating_Python_3_print_Function.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def print5(*args, **kargs):
sep = kargs.pop('sep', ' ')
end = kargs.pop('end', '\n')
file = kargs.pop('file', sys.stdout)
if kargs: raise TypeError('Extra Keywords: %s' % kargs)
output = ''
first = True
for arg in args:
output += ('' if first else sep) + str(arg)
... | code_fim | hard | {
"lang": "python",
"repo": "dackour/python",
"path": "/Chapter_18/04_Emulating_Python_3_print_Function.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: dackour/python path: /Chapter_18/04_Emulating_Python_3_print_Function.py
# Emulating the Python 3.X print Function
import sys
def print3(*args, **kargs):
sep = kargs.get('sep', ' ') # Keyword arg defaults
end = kargs.get('end', '\n')
file = kargs.get('file', sys.stdout)
output... | code_fim | hard | {
"lang": "python",
"repo": "dackour/python",
"path": "/Chapter_18/04_Emulating_Python_3_print_Function.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>failed_poms_fp_list_strip = [fp.encode('ascii').strip() for fp in failed_poms_fp_list.split('\n')]
passed_poms_fp_list_strip = [fp.encode('ascii').strip() for fp in passed_poms_fp_list.split('\n')]
for pom_list in [failed_poms_fp_list_strip, passed_poms_fp_list_strip]:
for pom in pom_list:
so... | code_fim | medium | {
"lang": "python",
"repo": "ucd-plse/Static-Bug-Detectors-ASE-Artifact",
"path": "/analyzers/annotations/from_host/modify_pom.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ucd-plse/Static-Bug-Detectors-ASE-Artifact path: /analyzers/annotations/from_host/modify_pom.py
import os
import subprocess
import sys
from bs4 import BeautifulSoup
def _run_command(command):
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
... | code_fim | hard | {
"lang": "python",
"repo": "ucd-plse/Static-Bug-Detectors-ASE-Artifact",
"path": "/analyzers/annotations/from_host/modify_pom.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> dependency_xml = """
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
"""
soup.dependencies.insert(0, BeautifulSoup(dependency_xml, 'lxml-xml'))
... | code_fim | hard | {
"lang": "python",
"repo": "ucd-plse/Static-Bug-Detectors-ASE-Artifact",
"path": "/analyzers/annotations/from_host/modify_pom.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: g-paulina/Tests path: /CartPlaceOrder.py
from selenium.webdriver.common.alert import Alert
from selenium import webdriver
from selenium.webdriver.common.by import By
import commons
class CartPlaceOrder():
def __init__(self, driver):
self.driver = driver
def click_place_order(sel... | code_fim | hard | {
"lang": "python",
"repo": "g-paulina/Tests",
"path": "/CartPlaceOrder.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def is_ok_button_present(self):
try:
ok_button = commons.wait_for_element_to_be_clickable(self.driver, By.CLASS_NAME, "sa-confirm-button-container")
if ok_button is not None:
return True
else:
return False
except:
... | code_fim | hard | {
"lang": "python",
"repo": "g-paulina/Tests",
"path": "/CartPlaceOrder.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> self.header = header
self.kostnad = kostnad
markedsvalg = []
markedsvalg.append(Markedsstatus("GODT", 100000, 40))
markedsvalg.append(Markedsstatus("MIDDELS", 75000, 50))
markedsvalg.append(Markedsstatus("SAKTE", 50000, 55))
kostnadsscenarioer = []
kostnadsscenarioer.append(Kostnadsscena... | code_fim | medium | {
"lang": "python",
"repo": "mradrianhh/morodag",
"path": "/eksamenssett_2020.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return markedsstatus.volum*(markedsstatus.pris-kostnadsscenario.kostnad) - faste_kostnader
def simulate():
markv, kostns = tilf_markv_kostns()
net_prof = netto_profitt(markv, kostns, 600000)
return net_prof
def run_monte_carlo(N):
# Num of simulations.
net_profs = []
for i i... | code_fim | hard | {
"lang": "python",
"repo": "mradrianhh/morodag",
"path": "/eksamenssett_2020.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: mradrianhh/morodag path: /eksamenssett_2020.py
import random
import sys
class Markedsstatus():
def __init__(self, status, volum, pris):
self.status = status
self.volum = volum
self.pris = pris
class Kostnadsscenario():
<|fim_suffix|> markv = random.choice(markeds... | code_fim | hard | {
"lang": "python",
"repo": "mradrianhh/morodag",
"path": "/eksamenssett_2020.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: nghiahsgs/test-httplib2-python path: /post_method.py
import httplib2
import urllib
http = httplib2.Http()
url = "http://global.longmandictionaries.com/dict_search/entry_for_alpha_key/lcdt/"
cookie = "_ga=GA1.2.593997455.1608592969; _gid=GA1.2.1576812044.1612036872; ci_session=a%3A10%3A%7Bs%3A... | code_fim | hard | {
"lang": "python",
"repo": "nghiahsgs/test-httplib2-python",
"path": "/post_method.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>ies.com/lcdt/collocations",
"Cookie":cookie,
"Accept-Language":"vi-VN,vi;q=0.9,fr-FR;q=0.8,fr;q=0.7,en-US;q=0.6,en;q=0.5"
}
raw_data = 'alpha_key=beautiful&name='
content = http.request(url,
method="POST",
headers=headers,
# ... | code_fim | hard | {
"lang": "python",
"repo": "nghiahsgs/test-httplib2-python",
"path": "/post_method.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>oup_id%22%3Bs%3A1%3A%222%22%3Bs%3A5%3A%22group%22%3Bs%3A7%3A%22members%22%3B%7D895b7995d1e361b3c07b6124eb6f87f25d83f111; _gat=1; dict_lcdt=learn"
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36",
"Content... | code_fim | hard | {
"lang": "python",
"repo": "nghiahsgs/test-httplib2-python",
"path": "/post_method.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: shikarkhane/vcal path: /run.py
import os
import json
from base import create_app
<|fim_suffix|>json_data = open('zappa_settings.json')
env_vars = json.load(json_data)['dev']['environment_variables']
# env_vars = {"TZ": "UTC"}
for key, val in env_vars.items():
os.environ[key] = val
app = c... | code_fim | medium | {
"lang": "python",
"repo": "shikarkhane/vcal",
"path": "/run.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|># from base.common.jobs import weekly_reminder
#
# weekly_reminder()<|fim_prefix|># repo: shikarkhane/vcal path: /run.py
import os
import json
from base import create_app
#if 'SERVERTYPE' in os.environ and os.environ['SERVERTYPE'] == 'AWS Lambda':
json_data = open('zappa_settings.json')
env_vars = js... | code_fim | medium | {
"lang": "python",
"repo": "shikarkhane/vcal",
"path": "/run.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: shikarkhane/vcal path: /run.py
import os
import json
from base import create_app
#if 'SERVERTYPE' in os.environ and os.environ['SERVERTYPE'] == 'AWS Lambda':
json_data = open('zappa_settings.json')
env_vars = json.load(json_data)['dev']['environment_variables']
# env_vars = {"TZ": "UTC"}
for ... | code_fim | medium | {
"lang": "python",
"repo": "shikarkhane/vcal",
"path": "/run.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Aerothon-2020/Reg2015Aircraft_Aerocats path: /Propulsion/HackerA60_PropellerComparison.py
import numpy as npy
import pylab as pyl
from scalar.units import AsUnit
from Aerothon.ACPropulsion import ACPropulsion
from scalar.units import SEC, FT, V, A, MIN, W, mAh, gacc
#### Import Motors ####
from ... | code_fim | hard | {
"lang": "python",
"repo": "Aerothon-2020/Reg2015Aircraft_Aerocats",
"path": "/Propulsion/HackerA60_PropellerComparison.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>#### PLOT CREATION ####
V = npy.linspace(0,Vmax/(FT/SEC),30)*FT/SEC
Vprop = npy.linspace(0,Vmax/(FT/SEC),1)*FT/SEC
N = Motor.NRange()
for pp in Propulsion:
pp.Alt = Alt
pp.Vmax = Vmax
pp.nV = nV
legend.append(pp.Prop.name)
pp.PlotMatched(V, N, Vprop, fig = 1 )
pp.PlotTest... | code_fim | hard | {
"lang": "python",
"repo": "Aerothon-2020/Reg2015Aircraft_Aerocats",
"path": "/Propulsion/HackerA60_PropellerComparison.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return self.price
def is_available(self):
return self.available<|fim_prefix|># repo: sulembutproton/commsys path: /product/models.py
from django.db import models
from user.models import User
# Create your models here.
class Product(models.Model):
vendor = models.ForeignKey(User,... | code_fim | medium | {
"lang": "python",
"repo": "sulembutproton/commsys",
"path": "/product/models.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sulembutproton/commsys path: /product/models.py
from django.db import models
from user.models import User
# Create your models here.
class Product(models.Model):
<|fim_suffix|> return self.price
def is_available(self):
return self.available<|fim_middle|> vendor = models.Fo... | code_fim | hard | {
"lang": "python",
"repo": "sulembutproton/commsys",
"path": "/product/models.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> def get_vendor(self):
return self.vendor
def get_price(self):
return self.price
def is_available(self):
return self.available<|fim_prefix|># repo: sulembutproton/commsys path: /product/models.py
from django.db import models
from user.models import User
# Create your... | code_fim | medium | {
"lang": "python",
"repo": "sulembutproton/commsys",
"path": "/product/models.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>@app.route("/edit", methods=["GET", "POST"])
def edit():
storage = Storage(STORAGE_FILE)
delete_id = request.args.get("delete", None)
if delete_id:
storage.delete(int(delete_id))
return redirect("/")
alarm_id = request.args.get("id", None)
if alarm_id:
alarm... | code_fim | medium | {
"lang": "python",
"repo": "Luminaar/smart-clock",
"path": "/app/app.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Luminaar/smart-clock path: /app/app.py
from flask import Flask, redirect, render_template, request
from alarm import Alarm, Storage
from form import AlarmForm
app = Flask(__name__)
STORAGE_FILE = "../data/alarms.json"
@app.route("/")
def list():
storage = Storage(STORAGE_FILE)
retur... | code_fim | hard | {
"lang": "python",
"repo": "Luminaar/smart-clock",
"path": "/app/app.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>"
return render(request,'hello.html',context)<|fim_prefix|># repo: jiangweidong/mydataproject path: /mydataproject/views.py
from django.shortcuts import render
from django.http import HttpResponse
def hello(request):
<|fim_middle|> context={}
context['hello']="zhouchunssssss | code_fim | easy | {
"lang": "python",
"repo": "jiangweidong/mydataproject",
"path": "/mydataproject/views.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: jiangweidong/mydataproject path: /mydataproject/views.py
from django.shortcuts import render
from django.<|fim_suffix|> context={}
context['hello']="zhouchunssssss"
return render(request,'hello.html',context)<|fim_middle|>http import HttpResponse
def hello(request):
| code_fim | easy | {
"lang": "python",
"repo": "jiangweidong/mydataproject",
"path": "/mydataproject/views.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>ant.
Please check other mini challenges before posting one to avoid duplications within a certain reason.
"""
def main():
pass
if __name__ == "__main__":
main()<|fim_prefix|># repo: DayGitH/Python-Challenges path: /DailyProgrammer/DP20141117W.py
"""
[Weekly #17] Mini Challenges
https://www.r... | code_fim | medium | {
"lang": "python",
"repo": "DayGitH/Python-Challenges",
"path": "/DailyProgrammer/DP20141117W.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: DayGitH/Python-Challenges path: /DailyProgrammer/DP20141117W.py
"""
[Weekly #17] Mini Challenges
https://www.reddit.com/r/dailyprogrammer/comments/2mkh5g/weekly_17_mini_challenges/
So this week mini challenges. Too small for an easy <|fim_suffix|> it) -- if
you want to solve a mini challenge yo... | code_fim | medium | {
"lang": "python",
"repo": "DayGitH/Python-Challenges",
"path": "/DailyProgrammer/DP20141117W.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: yinhongfeng/chatroom_utf8 path: /ui/ui.py
from tkinter import *
from tkinter import ttk
class Application:
def __init__(self, master):
self.root = master
# 窗口大小
self.root.geometry("350x200")
# 设置窗口标题
self.root.title("登录")
# 设置窗口不可变
s... | code_fim | hard | {
"lang": "python",
"repo": "yinhongfeng/chatroom_utf8",
"path": "/ui/ui.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # 点击关闭按钮触发事件
self.chat.protocol("WM_DELETE_WINDOW", lambda: self.on_closing(name=name))
self.chat.mainloop()
def recv_message(self, text): # 接收信息
text.config(state=NORMAL)
# 显示信息
text.insert(END, "5143543")
text.config(state=DISABLED)
def ... | code_fim | hard | {
"lang": "python",
"repo": "yinhongfeng/chatroom_utf8",
"path": "/ui/ui.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> with open(outpath+'\\'+json_name, 'w', encoding='utf-8') as json_file:
json.dump(result,json_file,ensure_ascii=False)
xls_to_json(r'C:\Users\v-yuexia\getMakeUpInfo\相宜本草.xls','相宜本草.json')<|fim_prefix|># repo: xyaxx07250026/pyspider path: /utils/transform.py
#coding:utf-8
import xlrd
im... | code_fim | hard | {
"lang": "python",
"repo": "xyaxx07250026/pyspider",
"path": "/utils/transform.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: xyaxx07250026/pyspider path: /utils/transform.py
#coding:utf-8
import xlrd
import json
def deal_with_ingredents(content):
elements = content.split(':')[1][1:-3].strip().split("\",\"")
result = []
for element in elements:
element = element.replace('\"',"")
res... | code_fim | medium | {
"lang": "python",
"repo": "xyaxx07250026/pyspider",
"path": "/utils/transform.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> # 点击打开按钮 提交文件
win32gui.SendMessage(top, win32con.WM_COMMAND, 1, button)
upload_file("C:\\1\\nihao.7z", 'firefox')<|fim_prefix|># repo: chrishshare/framework path: /utils/fileUpload.py
# -*- coding:utf8 -*-
import win32gui
import win32con
import operator
def upload_file(file_path, browser='ch... | code_fim | hard | {
"lang": "python",
"repo": "chrishshare/framework",
"path": "/utils/fileUpload.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: chrishshare/framework path: /utils/fileUpload.py
# -*- coding:utf8 -*-
import win32gui
import win32con
import operator
def upload_file(file_path, browser='chrome'):
# 一级窗口
top = None
if operator.eq(browser, 'chrome') or operator.eq(browser, 'edger'):
top = win32gui.FindWind... | code_fim | medium | {
"lang": "python",
"repo": "chrishshare/framework",
"path": "/utils/fileUpload.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: pabi2/pb2_addons path: /pabi_utils/models/job.py
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class QueueJob(models.Model):
_inherit = 'queue.job'
<|fim_suffix|> result = []
for rec in self:
result.append((rec.id, '%s | %s' % (rec.name, rec.sta... | code_fim | hard | {
"lang": "python",
"repo": "pabi2/pb2_addons",
"path": "/pabi_utils/models/job.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
class PabiProcess(models.Model):
_name = 'pabi.process'
_description = 'Process name for job running inside pabi_utils'
name = fields.Char(
string='Process Name',
required=True,
)<|fim_prefix|># repo: pabi2/pb2_addons path: /pabi_utils/models/job.py
# -*- coding: utf-8 -... | code_fim | medium | {
"lang": "python",
"repo": "pabi2/pb2_addons",
"path": "/pabi_utils/models/job.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: AnuraagBasu/greedy-music path: /music/migrations/0003_auto_20160428_1143.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-28 11:43
from __future__ import unicode_literals
<|fim_suffix|> dependencies = [
('music', '0002_auto_20160426_1012'),
]
operations = [
... | code_fim | medium | {
"lang": "python",
"repo": "AnuraagBasu/greedy-music",
"path": "/music/migrations/0003_auto_20160428_1143.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> operations = [
migrations.AlterField(
model_name='track',
name='createDate',
field=models.DateTimeField(default=datetime.datetime(2016, 4, 28, 11, 43, 24, 918185)),
),
]<|fim_prefix|># repo: AnuraagBasu/greedy-music path: /music/migrations/0003_... | code_fim | medium | {
"lang": "python",
"repo": "AnuraagBasu/greedy-music",
"path": "/music/migrations/0003_auto_20160428_1143.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: rchaud03/my_Pycharm path: /learn_Python3/03.4-numbers.py
#Video 3.4
a=10
b=23
add=(a+b)
subtract=(a-b)
multiply=(a*b)
divide=(a/b)
<|fim_suffix|>remainder= 10 % 3
print(remainder)<|fim_middle|>exponent=10**2
print(add)
print(subtract)
print(multiply)
print(divide)
print(exponent)
| code_fim | medium | {
"lang": "python",
"repo": "rchaud03/my_Pycharm",
"path": "/learn_Python3/03.4-numbers.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: rchaud03/my_Pycharm path: /learn_Python3/03.4-numbers.py
#Video 3.4
a=10
b=23
<|fim_suffix|>print(add)
print(subtract)
print(multiply)
print(divide)
print(exponent)
remainder= 10 % 3
print(remainder)<|fim_middle|>add=(a+b)
subtract=(a-b)
multiply=(a*b)
divide=(a/b)
exponent=10**2
| code_fim | medium | {
"lang": "python",
"repo": "rchaud03/my_Pycharm",
"path": "/learn_Python3/03.4-numbers.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>remainder= 10 % 3
print(remainder)<|fim_prefix|># repo: rchaud03/my_Pycharm path: /learn_Python3/03.4-numbers.py
#Video 3.4
a=10
b=23
<|fim_middle|>add=(a+b)
subtract=(a-b)
multiply=(a*b)
divide=(a/b)
exponent=10**2
print(add)
print(subtract)
print(multiply)
print(divide)
print(exponent)
| code_fim | medium | {
"lang": "python",
"repo": "rchaud03/my_Pycharm",
"path": "/learn_Python3/03.4-numbers.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: fsbiubiu/dataquery path: /dataquery/lib/util.py
# coding: utf-8
import datetime
import decimal
import requests
def utf8(value):
if isinstance(value, unicode):
return value.encode("utf-8")
elif isinstance(value, (bytes, type(None))):
return value
else:
retur... | code_fim | hard | {
"lang": "python",
"repo": "fsbiubiu/dataquery",
"path": "/dataquery/lib/util.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def send_mail(url, tos, title, html_content):
""" 发送邮件"""
try:
requests.post(url, data={'subject': title, 'html_content': html_content, 'tos': tos})
except:
pass<|fim_prefix|># repo: fsbiubiu/dataquery path: /dataquery/lib/util.py
# coding: utf-8
import datetime
import decima... | code_fim | medium | {
"lang": "python",
"repo": "fsbiubiu/dataquery",
"path": "/dataquery/lib/util.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>def send_mail(url, tos, title, html_content):
""" 发送邮件"""
try:
requests.post(url, data={'subject': title, 'html_content': html_content, 'tos': tos})
except:
pass<|fim_prefix|># repo: fsbiubiu/dataquery path: /dataquery/lib/util.py
# coding: utf-8
import datetime
import decimal... | code_fim | hard | {
"lang": "python",
"repo": "fsbiubiu/dataquery",
"path": "/dataquery/lib/util.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: anjumunothtrainingsl1/pythonDecCiti path: /WorkingWithCsv2.py
import csv
with open(r"C:\Users\Administrator\Desktop\zipcode1.csv", mode="r") as readfilePtr:
dic<|fim_suffix|>ictData:
print(row["city"], ":", row["pop"])<|fim_middle|>tData = csv.DictReader(readfilePtr)
for row... | code_fim | easy | {
"lang": "python",
"repo": "anjumunothtrainingsl1/pythonDecCiti",
"path": "/WorkingWithCsv2.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>tData = csv.DictReader(readfilePtr)
for row in dictData:
print(row["city"], ":", row["pop"])<|fim_prefix|># repo: anjumunothtrainingsl1/pythonDecCiti path: /WorkingWithCsv2.py
import csv
with open(r"C:\Users\Administrator\Desk<|fim_middle|>top\zipcode1.csv", mode="r") as readfilePtr:
... | code_fim | easy | {
"lang": "python",
"repo": "anjumunothtrainingsl1/pythonDecCiti",
"path": "/WorkingWithCsv2.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>weather_link = 'https://sinoptik.ua/погода-ялта/'
full_page_w = requests.get(weather_link, headers=headers)
soup_w = BeautifulSoup(full_page_w.content, 'html.parser')
convert_w = soup_w.findAll("div", {"class": "description"})
weather_text = str(convert_w[0].text) +" \n"+ str(convert_w[1].text)
full_page... | code_fim | hard | {
"lang": "python",
"repo": "M1Z3S/MyTeleBot",
"path": "/main.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: M1Z3S/MyTeleBot path: /main.py
import telebot
import requests
import time
from bs4 import BeautifulSoup
from telebot import types
bot = telebot.TeleBot('1323095011:AAEn5_1rcStJ-k8AkKCudLkRSY3gzL8gY9s')
doll_url = 'https://www.google.ru/search?newwindow=1&source=hp&ei=ifUGX7qlFIjNrgSp8Z7YBw&q=кур... | code_fim | hard | {
"lang": "python",
"repo": "M1Z3S/MyTeleBot",
"path": "/main.py",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|># duration of routine planning
ROUTINE_DURATION = 60
# distributing method
CURRENT_METHOD = DISPATCH_METHOD.EFFICIENT
# penalty
PENALTY = 1
#oil price
OIL_PRICE = 0.07289
# system time
SYSTEM_TIME = datetime(2017, 1, 2, 0, 0, 0, 0)<|fim_prefix|># repo: ChessyHsu/KHH_planer path: /KHH-master/code/alg... | code_fim | medium | {
"lang": "python",
"repo": "ChessyHsu/KHH_planer",
"path": "/KHH-master/code/algo/settings.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|># penalty
PENALTY = 1
#oil price
OIL_PRICE = 0.07289
# system time
SYSTEM_TIME = datetime(2017, 1, 2, 0, 0, 0, 0)<|fim_prefix|># repo: ChessyHsu/KHH_planer path: /KHH-master/code/algo/settings.py
"""parameters of the system
"""
from enum import Enum
from datetime import datetime
class DISPATCH_METHOD(... | code_fim | hard | {
"lang": "python",
"repo": "ChessyHsu/KHH_planer",
"path": "/KHH-master/code/algo/settings.py",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ChessyHsu/KHH_planer path: /KHH-master/code/algo/settings.py
"""parameters of the system
"""
from enum import Enum
from datetime import datetime
<|fim_suffix|># duration of routine planning
ROUTINE_DURATION = 60
# distributing method
CURRENT_METHOD = DISPATCH_METHOD.EFFICIENT
# penalty
PENALT... | code_fim | medium | {
"lang": "python",
"repo": "ChessyHsu/KHH_planer",
"path": "/KHH-master/code/algo/settings.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.