text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|> def test_default(self): self.failIf(cgs.speed_of_light/pygsl.const.speed_of_light!=100) if __name__ == "__main__": unittest.main()<|fim_prefix|># repo: juhnowski/FishingRod path: /production/pygsl-0.9.5/tests/const_test.py import string import unittest import math import pygsl.const ver...
code_fim
hard
{ "lang": "python", "repo": "juhnowski/FishingRod", "path": "/production/pygsl-0.9.5/tests/const_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: juhnowski/FishingRod path: /production/pygsl-0.9.5/tests/const_test.py import string import unittest import math import pygsl.const version = string.split(pygsl.compiled_gsl_version, '.') major_version = version[0] minor_version = version[1] if major_version == 1 and minor_version < 4: impo...
code_fim
hard
{ "lang": "python", "repo": "juhnowski/FishingRod", "path": "/production/pygsl-0.9.5/tests/const_test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Anthlay/FUN_TOOLS path: /weibo_spider/cloud.py import matplotlib.pyplot as plt from wordcloud import WordCloud, ImageColorGenerator import os import numpy as np import PIL.Image as Image <|fim_suffix|>path = os.getcwd() + '/comment.txt' content = open(path, encoding='utf-8').read().replace('图片评论...
code_fim
medium
{ "lang": "python", "repo": "Anthlay/FUN_TOOLS", "path": "/weibo_spider/cloud.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>path = os.getcwd() + '/comment.txt' content = open(path, encoding='utf-8').read().replace('图片评论', '')\ .replace('回复', '').replace('等人', '') alice_coloring = np.array(Image.open('background.jpg')) my_wordcloud = WordCloud(background_color="white", max_words=2000, mask=alice_co...
code_fim
medium
{ "lang": "python", "repo": "Anthlay/FUN_TOOLS", "path": "/weibo_spider/cloud.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>my_wordcloud = WordCloud(background_color="white", max_words=2000, mask=alice_coloring,max_font_size=40, random_state=42, font_path='C:\Windows\Fonts\msyh.ttf').generate(content) image_colors = ImageColorGenerator(alice_coloring) plt.imshow(my_wordcloud.r...
code_fim
hard
{ "lang": "python", "repo": "Anthlay/FUN_TOOLS", "path": "/weibo_spider/cloud.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: skylarkgit/sql2phpclass path: /htmlBuilds/mytemplateSimple.py HTMLadd={ 'string': '<div class="form-group col-md-6">\ <label class="form-control-label" for="{id}">{label}</label>\ <input type="text" class="form-control" name="{name}" id="{id}" ng-model="{model}" placeholder="" autocomplet...
code_fim
hard
{ "lang": "python", "repo": "skylarkgit/sql2phpclass", "path": "/htmlBuilds/mytemplateSimple.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>ss="form-control-label" for="{id}">{label}</label>\ <input type="date" class="form-control date-input-style" name="{name}" id="{id}" ng-model="{model}" placeholder="" autocomplete="on" {extensions} required/>\ <div class="help-block" ng-messages="{controller}.{model}.$touched && {controller}.{mod...
code_fim
hard
{ "lang": "python", "repo": "skylarkgit/sql2phpclass", "path": "/htmlBuilds/mytemplateSimple.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|># which regions to pull from # note AZs for each region are included regions = [ 'us-east-1','us-west-1','us-west-2','eu-west-1','sa-east-1', 'ap-southeast-1','ap-southeast-2','ap-northeast-1', 'eu-central-1', 'ap-northeast-2' ] # which fields to print from DBInstance class attributes ...
code_fim
hard
{ "lang": "python", "repo": "vap0rtranz/aws", "path": "/inventory/rds-instance-list.py", "mode": "spm", "license": "CC0-1.0", "source": "the-stack-v2" }
<|fim_suffix|>def main(): # which regions to pull from # note AZs for each region are included regions = [ 'us-east-1','us-west-1','us-west-2','eu-west-1','sa-east-1', 'ap-southeast-1','ap-southeast-2','ap-northeast-1', 'eu-central-1', 'ap-northeast-2' ] # which fields to print from DBInstance class...
code_fim
hard
{ "lang": "python", "repo": "vap0rtranz/aws", "path": "/inventory/rds-instance-list.py", "mode": "spm", "license": "CC0-1.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: vap0rtranz/aws path: /inventory/rds-instance-list.py # this is an AWS inventory for RDS # you must supply an AWS IAM keypair with Read to RDS across specified regions # output is to STDOUT in white space delimited (except Tags are comma # seperated) # feel free to change the fields to any variabl...
code_fim
medium
{ "lang": "python", "repo": "vap0rtranz/aws", "path": "/inventory/rds-instance-list.py", "mode": "psm", "license": "CC0-1.0", "source": "the-stack-v2" }
<|fim_suffix|> measurements = npr.normal(loc=mean, scale=sd, size=n) # print(measurements) measurements = measurements * (measurements > 0) # print(measurements) data.extend(measurements.tolist()) indices.extend([i] * n) # Add baseline measurements (bl_measures) ...
code_fim
hard
{ "lang": "python", "repo": "Supr4pt0/bayesian-measurement-paper", "path": "/notebooks/model.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Supr4pt0/bayesian-measurement-paper path: /notebooks/model.py import numpy as np import numpy.random as npr import pymc3 as pm import matplotlib.pyplot as plt import click import pickle as pkl @click.command() @click.option('--max_n_reps', default=2, help="Number of replicate samples.") @click.o...
code_fim
hard
{ "lang": "python", "repo": "Supr4pt0/bayesian-measurement-paper", "path": "/notebooks/model.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> fold = pm.Uniform('fold', lower=1E-10, upper=upper, shape=n_genotypes+2) sigma = pm.HalfCauchy('sigma', beta=1, shape=n_genotypes+2) # Model prediction mu = fold[indices] sig = sigma[indices] # Data likelihood like = pm.S...
code_fim
hard
{ "lang": "python", "repo": "Supr4pt0/bayesian-measurement-paper", "path": "/notebooks/model.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> while True: result = ser.readline() if not result or 'Invalid Access Code' in result.decode('ascii'): return False elif 'Enter Section ---' in result.decode('ascii'): return True def press(key): command = complete(bytes([0x30,0x37,0x3...
code_fim
hard
{ "lang": "python", "repo": "bschick/dscrecover", "path": "/findcode.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: bschick/dscrecover path: /findcode.py #!/usr/bin/python3 # -*- coding: UTF-8 -*- import serial SERIALDEVICE = '/dev/ttyUSB0' def complete(payload): '''add checksum and CR LF to payload to make is a valid command''' # such a strange checksum process s = sum(payload) & 0xFF high, low...
code_fim
hard
{ "lang": "python", "repo": "bschick/dscrecover", "path": "/findcode.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> command = complete(bytes([0x30,0x37,0x30,ord(key)])) ser.write(command) ser.flush() wait() ser.write(BREAK) ser.flush() wait() print("clearing response buffer") eat() for code in range(0, 10000): guess = f'{code:04}' press('#') press('...
code_fim
hard
{ "lang": "python", "repo": "bschick/dscrecover", "path": "/findcode.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: murmurian/LuminAlgoritmi path: /algoritmi.py numeroKaytetty = [False for i in range(6)] ruudut = [0, 0, 0, 0, 0, 0, 0] ratkaisuja = 0 <|fim_suffix|> global ratkaisuja if ruutu == 7: return if ruudut[0] + ruudut[1] + ruudut[3] + ruudut[4] == a and ruudut[1] + ruudut[2] + ruudut...
code_fim
medium
{ "lang": "python", "repo": "murmurian/LuminAlgoritmi", "path": "/algoritmi.py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> global ratkaisuja if ruutu == 7: return if ruudut[0] + ruudut[1] + ruudut[3] + ruudut[4] == a and ruudut[1] + ruudut[2] + ruudut[4] + ruudut[5] == b and ruudut[5] != 0: print(ruudut[0:3]) print(ruudut[3:6]) ratkaisuja += 1 print("Ratkaisuja:", ratkaisuja...
code_fim
medium
{ "lang": "python", "repo": "murmurian/LuminAlgoritmi", "path": "/algoritmi.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_prefix|># repo: sairam1318/GUI path: /helloGui.py from tkinter import * sai_root = Tk() #creates a basic gui window <|fim_suffix|>text = Label(text = "Hai ALL") text.pack() #unless we pack it, it will not be displayed sai_root.mainloop()<|fim_middle|>#geometrty = width x Height sai_root.geometry("400x400") #s...
code_fim
medium
{ "lang": "python", "repo": "sairam1318/GUI", "path": "/helloGui.py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|>text = Label(text = "Hai ALL") text.pack() #unless we pack it, it will not be displayed sai_root.mainloop()<|fim_prefix|># repo: sairam1318/GUI path: /helloGui.py from tkinter import * sai_root = Tk() #creates a basic gui window <|fim_middle|>#geometrty = width x Height sai_root.geometry("400x400") #s...
code_fim
medium
{ "lang": "python", "repo": "sairam1318/GUI", "path": "/helloGui.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_prefix|># repo: Grigory526/2019-fall-polytech-cs path: /Processing/Section 6/Listing37/Listing37.pyde flug =True def setup(): size(500,500) smooth() background(255) noStroke() colorMode(HSB) <|fim_suffix|> global flug if(flug): for i in range (-1, 10): for j in ra...
code_fim
easy
{ "lang": "python", "repo": "Grigory526/2019-fall-polytech-cs", "path": "/Processing/Section 6/Listing37/Listing37.pyde", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> global flug if(flug): for i in range (-1, 10): for j in range (0, 10): fill(10,random(0,255), random(10,250)) rect(j*40+50, j*40+50,35,35) rect((10-j)*40 + 10, i*40+50,35,35) def mouseClicked(): global flug ...
code_fim
easy
{ "lang": "python", "repo": "Grigory526/2019-fall-polytech-cs", "path": "/Processing/Section 6/Listing37/Listing37.pyde", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Symbo1/wsltools path: /wsltools/utils/faker/providers/address/en/__init__.py # -*- coding: UTF-8 -*- from __future__ import unicode_literals from .. import Provider as AddressProvider class Provider(AddressProvider): countries = ( 'Afghanistan', 'Albania', 'Algeria', 'American Sam...
code_fim
hard
{ "lang": "python", "repo": "Symbo1/wsltools", "path": "/wsltools/utils/faker/providers/address/en/__init__.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>Lebanon', 'Lesotho', 'Liberia', 'Libyan Arab Jamahiriya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macao', 'Macedonia', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Martinique', 'Mauritania', 'Mauritius', 'Mayotte', 'Mexico', 'Micronesia...
code_fim
hard
{ "lang": "python", "repo": "Symbo1/wsltools", "path": "/wsltools/utils/faker/providers/address/en/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Miquelon', 'Saint Vincent and the Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Saudi Arabia', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovakia (Slovak Republic)', 'Slovenia', 'Solomon Islands', 'Somalia', 'South Africa', 'South Georgia and the Sou...
code_fim
hard
{ "lang": "python", "repo": "Symbo1/wsltools", "path": "/wsltools/utils/faker/providers/address/en/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: shravan97/WordHunter path: /WordsAnalyzer/analyze.py from nltk.stem.porter import PorterStemmer as ps import re , csv , os , inspect class WordAnalyze: def __init__(self , words_list): self.words = words_list def frequency(self): words=[str.upper(word.encode('utf8')) for...
code_fim
hard
{ "lang": "python", "repo": "shravan97/WordHunter", "path": "/WordsAnalyzer/analyze.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> w = self.words w_temp = list(w) curr_index=0 for k in w_temp: if str.upper(k.encode('utf8')) in prepositions: w.pop(curr_index) curr_index-=1 curr_index+=1 # !!-- Add more filters here --!! retur...
code_fim
hard
{ "lang": "python", "repo": "shravan97/WordHunter", "path": "/WordsAnalyzer/analyze.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>#label on the bottom of the chart plt.xlabel("Categories of Sports") #add a title to the chart plt.title("Number of medals in each sports category", pad="20") for i, val in enumerate(medals): plt.text(i, val + 4, val, color='b', fontweight='bold') #run the show method (this lives inside the pylot ...
code_fim
medium
{ "lang": "python", "repo": "Sarikayaelif/Data-Visualization-with-Python", "path": "/Data/mapper.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Sarikayaelif/Data-Visualization-with-Python path: /Data/mapper.py import matplotlib.pyplot as plt #draw a simple line chart showing sport categories and number of medals sports= ["Biathlon", "Bobsleigh", "Curling", "Ice Hockey", "Skating", "Skiing"] medals= [3, 22, 50, 351, 159, 40] <|fim_suff...
code_fim
hard
{ "lang": "python", "repo": "Sarikayaelif/Data-Visualization-with-Python", "path": "/Data/mapper.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: engr16x/engr16x-library path: /build/lib/src/engr16x/piTalk/pi.py import socket import struct import time import sys from numpy import array, zeros from binascii import crc_hqx class PiTalk(): # The init function will create the socket connection with the computer def __init__(se...
code_fim
hard
{ "lang": "python", "repo": "engr16x/engr16x-library", "path": "/build/lib/src/engr16x/piTalk/pi.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if ((formatStr[i] == 's')): # If a string, only incriment by 1 as a string is only 1 element in an array regardless of the length dataIndex += 1 else: dataIndex += length # Reset the length length = 0 # set the last valid...
code_fim
hard
{ "lang": "python", "repo": "engr16x/engr16x-library", "path": "/build/lib/src/engr16x/piTalk/pi.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def mapper(self, o): if o.name == self.refJava.name: return "this" else: return self.refJava.varName + 'Mapper' class MySqlQueryFunc(object): """docstring for MySqlQueryFunc""" def __init__(self, cols): self.cols = cols self.unique = Fal...
code_fim
hard
{ "lang": "python", "repo": "yamingd/ssm-script", "path": "/platform.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> @property def defaultTips(self): if self.default: return u'默认为: ' + self.default return u'' @property def columnMark(self): vals = [] if self.name != self.java.name: vals.append('name=\"%s\"' % self.name) if self.key: ...
code_fim
hard
{ "lang": "python", "repo": "yamingd/ssm-script", "path": "/platform.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: yamingd/ssm-script path: /platform.py prj._company_, table.prj._name_, table.package) self.wrapper_impl_ns = 'com.%s.%s.wrapper.impl.%s' % (table.prj._company_, table.prj._name_, table.package) def dbFields(self): s = [] for c in self.table.columns: s.appe...
code_fim
hard
{ "lang": "python", "repo": "yamingd/ssm-script", "path": "/platform.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> parser = argparse.ArgumentParser(description="Reproduced ICNet") parser.add_argument("--model", type=str, default='others', help="Model to use.", choices=['train', 'trainval', 'train_bn', 'trainval_bn', 'others'], required=Fa...
code_fim
hard
{ "lang": "python", "repo": "erichhhhho/DM6190_Coursework", "path": "/test/ensemble_visualize.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> plot4 = plt.subplot(144) plot4.set_title("Ensemble's Result", fontsize=10) plt.imshow(ensemble_fig, cmap='gray') plt.axis('off') plt.show() save_comparation_path = os.path.dirname(cfg.model_paths['others']) + '/eval_ensemble' if os.path.exists(save...
code_fim
hard
{ "lang": "python", "repo": "erichhhhho/DM6190_Coursework", "path": "/test/ensemble_visualize.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: erichhhhho/DM6190_Coursework path: /test/ensemble_visualize.py import os import sys CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) sys.path.append(CURRENT_PATH) PAR_PATH = os.path.abspath(os.path.join(CURRENT_PATH, os.pardir)) sys.path.append(PAR_PATH) from utils.image_reader import...
code_fim
hard
{ "lang": "python", "repo": "erichhhhho/DM6190_Coursework", "path": "/test/ensemble_visualize.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kilrogg/pagestore path: /app.py er-radius) var(--universal-border-radius) 0}blockquote:before{position:absolute;top:calc(0rem - var(--universal-padding));left:0;font-family:sans-serif;font-size:3rem;font-weight:700;content:"\201c";color:var(--blockquote-color)}blockquote[cite]:after{font-style:no...
code_fim
hard
{ "lang": "python", "repo": "kilrogg/pagestore", "path": "/app.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kilrogg/pagestore path: /app.py y-back-color)}select{max-width:100%}option{overflow:hidden;text-overflow:ellipsis}[type="checkbox"],[type="radio"]{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;height:calc(1rem + var(--universal-padding) / 2);width:calc(1rem + var(...
code_fim
hard
{ "lang": "python", "repo": "kilrogg/pagestore", "path": "/app.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>:0}table:not(.horizontal) tbody tr:first-child td{border-top:0}table.horizontal{border:0}table.horizontal thead,table.horizontal tbody{border:0;flex:.2 0 0;flex-flow:row nowrap}table.horizontal tbody{overflow:auto;justify-content:space-between;flex:.8 0 0;margin-left:0;padding-bottom:calc(var(--universal-...
code_fim
hard
{ "lang": "python", "repo": "kilrogg/pagestore", "path": "/app.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def emails(self): self.delete_special_files() for i in range(len(self.dir_content)): with codecs.open(self.path + '/' + self.dir_content[i], "r",encoding='utf-8', errors='ignore') as file: filename = self.dir_content[i] body = file.read(...
code_fim
medium
{ "lang": "python", "repo": "unacau/bayesian-spam-filtering", "path": "/corpus.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.delete_special_files() for i in range(len(self.dir_content)): with codecs.open(self.path + '/' + self.dir_content[i], "r",encoding='utf-8', errors='ignore') as file: filename = self.dir_content[i] body = file.read() yiel...
code_fim
medium
{ "lang": "python", "repo": "unacau/bayesian-spam-filtering", "path": "/corpus.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: unacau/bayesian-spam-filtering path: /corpus.py import os import codecs __author__ = 'Igor Ekishev' PATH = '/home/expirience/Rph/uloha_SPAM/1' <|fim_suffix|> self.delete_special_files() for i in range(len(self.dir_content)): with codecs.open(self.path + '/' ...
code_fim
medium
{ "lang": "python", "repo": "unacau/bayesian-spam-filtering", "path": "/corpus.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: PositronicsLab/wild-robot path: /scripts/wb_svr.py nt 'time to ' + msg + ': ' + s #------------------------------------------------------------------------------ """ """ def log_start(): start_time = timestamp() log = {'start_time' : start_time} return log #-------------------------------...
code_fim
hard
{ "lang": "python", "repo": "PositronicsLab/wild-robot", "path": "/scripts/wb_svr.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # training error < 5% #C = [1e-1, 1, 1e1] #eps = [1e-5, 1e-4, 1e-3] #gamma = [1e-1, 1, 1e1] #C = [1e-4, 1e-3, 1e-2, 1e-1, 1] #eps = [1e-5, 1e-4, 1e-3, 1e-2, 1e-1] #gamma = [1e-3, 1e-2, 1e-1, 1, 1e1] svr = SVR(kernel='rbf') hyperparameters = { 'svr__C...
code_fim
hard
{ "lang": "python", "repo": "PositronicsLab/wild-robot", "path": "/scripts/wb_svr.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: PositronicsLab/wild-robot path: /scripts/wb_svr.py ernel='linear', max_iter=1e6) hyperparameters = { 'svr__C': [1, 1e-1, 1e-2, 1e-3], 'svr__epsilon' : [1e-1, 1e-2, 1e-3]} elif alg == 'poly': degree = [1,2,3] svr = SVR(kernel='poly', max_iter=1e6) hyperparameters = { 'svr__C': ...
code_fim
hard
{ "lang": "python", "repo": "PositronicsLab/wild-robot", "path": "/scripts/wb_svr.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def getUrlHtmlObj(self): try: return models.UrlHtml except: raise DbError("Can't find UrlHtml object") def getSearchObj(self): try: return models.Search except: raise DbError("Can't find Search object") def getContentObj(self): try: ...
code_fim
hard
{ "lang": "python", "repo": "pbarton666/buzz_bot", "path": "/djangoproj/PES_web_site/trunk/djangoproj/djangoapp/crawler/django_dbRoutines.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: pbarton666/buzz_bot path: /djangoproj/PES_web_site/trunk/djangoproj/djangoapp/crawler/django_dbRoutines.py block of code is for running the module in a 'stand-alone' mode for testing The import statement is very important because django is looking for a "fully specified" representation of ...
code_fim
hard
{ "lang": "python", "repo": "pbarton666/buzz_bot", "path": "/djangoproj/PES_web_site/trunk/djangoproj/djangoapp/crawler/django_dbRoutines.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cww0614/make.py path: /examples/configure/Makefile.py from shutil import which from make_py import phony_task, task, PersistentVariables VARIABLES = PersistentVariables("variables.json") CC = VARIABLES["CC"] phony_task("all", "print_variables") @task() def configure(ctx): CC.set(which("g...
code_fim
medium
{ "lang": "python", "repo": "cww0614/make.py", "path": "/examples/configure/Makefile.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @task() def clean(ctx): # If the variable collection isn't empty, it will be created again # when the script exits VARIABLES.clear() if VARIABLES.path.exists(): VARIABLES.path.unlink()<|fim_prefix|># repo: cww0614/make.py path: /examples/configure/Makefile.py from shutil import w...
code_fim
medium
{ "lang": "python", "repo": "cww0614/make.py", "path": "/examples/configure/Makefile.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # Join the new classifier with the inverted relations df_classifier = pd.merge(df_classifier, df_inner, left_on=['source', 'target'], right_on=['target','source'], how='left', suffixes...
code_fim
hard
{ "lang": "python", "repo": "catherinekerr/ip-ensemble", "path": "/clinicalensemble.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> mapFileName = prefix + fileName + ".csv" eMap = pd.read_csv(mapFileName) eMap.set_index(['start', 'end'], inplace=True) #eMap.sort() return eMap # Add a classifier to the ensemble dataframe def addClassifier(self, classifier) : cl = cl...
code_fim
hard
{ "lang": "python", "repo": "catherinekerr/ip-ensemble", "path": "/clinicalensemble.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: catherinekerr/ip-ensemble path: /clinicalensemble.py """ Class ClinicalEnsemble Parse file across all classfiers and combine into single dataframe For example Source Target classifier1 classifier2 ... classifiern e1 e2 BEFORE CONTAINS...
code_fim
hard
{ "lang": "python", "repo": "catherinekerr/ip-ensemble", "path": "/clinicalensemble.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>with open(fname, 'w') as f: for v1, v2 in res: f.write('{} {}\n'.format(v1, v2))<|fim_prefix|># repo: brunsgaard/ado path: /tools/datafixer.py #!/usr/bin/env python import sys fname = sys.argv[1] <|fim_middle|>with open(fname) as f: res = sorted(list(set([tuple(sorted(map(int,filter(No...
code_fim
medium
{ "lang": "python", "repo": "brunsgaard/ado", "path": "/tools/datafixer.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>with open(fname) as f: res = sorted(list(set([tuple(sorted(map(int,filter(None, l.split())))) for l in f.readlines()]))) with open(fname, 'w') as f: for v1, v2 in res: f.write('{} {}\n'.format(v1, v2))<|fim_prefix|># repo: brunsgaard/ado path: /tools/datafixer.py #!/usr/bin/env python i...
code_fim
easy
{ "lang": "python", "repo": "brunsgaard/ado", "path": "/tools/datafixer.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: brunsgaard/ado path: /tools/datafixer.py #!/usr/bin/env python import sys fname = sys.argv[1] <|fim_suffix|>with open(fname, 'w') as f: for v1, v2 in res: f.write('{} {}\n'.format(v1, v2))<|fim_middle|>with open(fname) as f: res = sorted(list(set([tuple(sorted(map(int,filter(No...
code_fim
medium
{ "lang": "python", "repo": "brunsgaard/ado", "path": "/tools/datafixer.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ... and many more bus route relations assert_has_feature( 16, 10484, 25329, 'roads', {'name': 'Mission St.', 'is_bus_route': True})<|fim_prefix|># repo: GeoThings/vector-datasource path: /integration-test/611-add-bus-to-roads.py # block between mission & 6th and howard & 5th in SF. # appears to ...
code_fim
hard
{ "lang": "python", "repo": "GeoThings/vector-datasource", "path": "/integration-test/611-add-bus-to-roads.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: GeoThings/vector-datasource path: /integration-test/611-add-bus-to-roads.py # block between mission & 6th and howard & 5th in SF. # appears to have lots of buses. # https://www.openstreetmap.org/way/88572932 -- Miss<|fim_suffix|>own # https://www.openstreetmap.org/relation/3406708 -- 14R to Missi...
code_fim
medium
{ "lang": "python", "repo": "GeoThings/vector-datasource", "path": "/integration-test/611-add-bus-to-roads.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: c4chow/SpaGE path: /benchmark/MERFISH_Moffit/Performance_evaluation.py import os os.chdir('MERFISH_Moffit/') import numpy as np import pandas as pd import pickle import matplotlib matplotlib.use('qt5agg') matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 ...
code_fim
hard
{ "lang": "python", "repo": "c4chow/SpaGE", "path": "/benchmark/MERFISH_Moffit/Performance_evaluation.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ### Seurat Seurat_imputed = pd.read_csv('Results/Seurat_LeaveOneOut.csv',header=0,index_col=0,sep=',').T Seurat_imputed = Seurat_imputed.loc[:,Gene_Order] Seurat_Corr = pd.Series(index = Gene_Order) for i in Gene_Order: Seurat_Corr[i] = st.spearmanr(MERFISH_data[i],Seurat_imputed[i])[0] ...
code_fim
hard
{ "lang": "python", "repo": "c4chow/SpaGE", "path": "/benchmark/MERFISH_Moffit/Performance_evaluation.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>r i in range(len(W)) for j in range(len(B))): if ans[w] == -1 and b not in used: ans[w] = b used.add(b) if len(used) == len(ans): break return ans<|fim_prefix|># repo: jxhangithub/leetcode path: /solutions/python3/1057.py cla...
code_fim
hard
{ "lang": "python", "repo": "jxhangithub/leetcode", "path": "/solutions/python3/1057.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jxhangithub/leetcode path: /solutions/python3/1057.py class Solution: def assignBikes(self, W: List[List[int]], B: List[List[int]]) -> List[int]: ans, used = [-1] * len(W), set() for d, w, b in sorted([abs(W[i][0] - B[j][0]) + abs(W[i][1] - B[j][1]), i, j] fo<|fim_suffix|>w] =...
code_fim
hard
{ "lang": "python", "repo": "jxhangithub/leetcode", "path": "/solutions/python3/1057.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>masyon Verileri hk;" self.excel_file_name ="İşletme_Ototmasyon_Raporu.xlsx"<|fim_prefix|># repo: iek21/business_data_tracking path: /settings.py class Variables(object): def __init__(self): ##Messagebox self.successful_message = "Successful" self.unsuccessful_mess...
code_fim
medium
{ "lang": "python", "repo": "iek21/business_data_tracking", "path": "/settings.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: iek21/business_data_tracking path: /settings.py class Variables(object): def __init__(self): ##Messagebox self.successful_message = "Successful" self.unsuccessful_message = "Failed" <|fim_suffix|>masyon Verileri hk;" self.excel_file_name ="İşletme_Ototmas...
code_fim
medium
{ "lang": "python", "repo": "iek21/business_data_tracking", "path": "/settings.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.mail_text = "Rapor Ek'tedir." self.mail_topic = "İşletme Otomasyon Verileri hk;" self.excel_file_name ="İşletme_Ototmasyon_Raporu.xlsx"<|fim_prefix|># repo: iek21/business_data_tracking path: /settings.py class Variables(object): def __init__(self): ##Message...
code_fim
medium
{ "lang": "python", "repo": "iek21/business_data_tracking", "path": "/settings.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ZucchiniZe/preworkhub path: /prework/views.py from django.shortcuts import get_object_or_404, render from .models import Video def index(request): <|fim_suffix|> def show_video(request, _subject, slug): """Subject is ignored because it isn't needed but it is part of the URL""" video = ...
code_fim
hard
{ "lang": "python", "repo": "ZucchiniZe/preworkhub", "path": "/prework/views.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def show_video(request, _subject, slug): """Subject is ignored because it isn't needed but it is part of the URL""" video = get_object_or_404(Video.objects.select_related('subject', 'class_date'), slug=slug) return render(request, 'videos/show_video.html', {'video': video})<|fim_prefix|># rep...
code_fim
medium
{ "lang": "python", "repo": "ZucchiniZe/preworkhub", "path": "/prework/views.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: soyalextreme/YT-minicurso-Python-Algoritmos path: /ciclos.py """ CICLOS EN PYTHON Y SU USO FOR Y WHILE PRIMITIVO RANGE() """ if __name__ == "__main__": counter = 10 while counter > 0: print(counter) counter -= 1 list_names = ["Alejandro", "David", "Ferna...
code_fim
medium
{ "lang": "python", "repo": "soyalextreme/YT-minicurso-Python-Algoritmos", "path": "/ciclos.py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> print(p_n) print(pair_numbers) for _ in range(100): print("hola")<|fim_prefix|># repo: soyalextreme/YT-minicurso-Python-Algoritmos path: /ciclos.py """ CICLOS EN PYTHON Y SU USO FOR Y WHILE PRIMITIVO RANGE() """ <|fim_middle|> if __name__ == "__main__": counter = 1...
code_fim
hard
{ "lang": "python", "repo": "soyalextreme/YT-minicurso-Python-Algoritmos", "path": "/ciclos.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_prefix|># repo: projectsyn/commodore path: /tests/test_postprocess.py """ Tests for postprocessing """ import os import click import pytest import yaml from textwrap import dedent from commodore.config import Config from commodore.component import Component from commodore.multi_dependency import MultiDependenc...
code_fim
hard
{ "lang": "python", "repo": "projectsyn/commodore", "path": "/tests/test_postprocess.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def _setup(tmp_path, f, alias="test-component"): targetdir = tmp_path / "compiled" / alias / "test" os.makedirs(targetdir, exist_ok=True) libdir = tmp_path / "vendor" / "lib" os.makedirs(libdir, exist_ok=True) testf = targetdir / "object.yaml" with open(testf, "w") as objf: ...
code_fim
hard
{ "lang": "python", "repo": "projectsyn/commodore", "path": "/tests/test_postprocess.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: bdastur/notes path: /python/asyncio/conditions.py #!/usr/bin/env python # -*- coding: utf-8 -*- ''' https://pymotw.com/3/asyncio/synchronization.html ''' import asyncio async def worker(condition, n): print("Worker ", n) async with condition: print("worker is waiting ", n) ...
code_fim
hard
{ "lang": "python", "repo": "bdastur/notes", "path": "/python/asyncio/conditions.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if __name__ == '__main__': loop = asyncio.get_event_loop() try: result = loop.run_until_complete(main(loop)) finally: loop.close()<|fim_prefix|># repo: bdastur/notes path: /python/asyncio/conditions.py #!/usr/bin/env python # -*- coding: utf-8 -*- ''' https://pymotw.com/3/as...
code_fim
hard
{ "lang": "python", "repo": "bdastur/notes", "path": "/python/asyncio/conditions.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: morganstanley/testplan path: /testplan/exporters/testing/pdf/renderers/reports.py """ PDF Renderer classes for test report objects. """ import logging from collections import OrderedDict from typing import Optional, Tuple from reportlab.lib import colors, styles from reportlab.platypus import Pa...
code_fim
hard
{ "lang": "python", "repo": "morganstanley/testplan", "path": "/testplan/exporters/testing/pdf/renderers/reports.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def should_display(self, source: TestCaseReport) -> bool: return self.get_style(source).display_testcase @registry.bind((TestGroupReport, ReportCategories.MULTITEST)) class MultiTestRowBuilder(TestRowRenderer): """Multitests get special treatment with extra formatting & summary.""" ...
code_fim
hard
{ "lang": "python", "repo": "morganstanley/testplan", "path": "/testplan/exporters/testing/pdf/renderers/reports.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jotagesales/Vial path: /vial.py """The Python WSGI picoframework""" import os import re import html from string import Template from enum import Enum ENCODING = "utf-8" TEMPLATE_DIR = "./templates" STATIC_DIR = "./static" STATIC_URL = "/static" class Status(Enum): OK = 200 BAD_REQUES...
code_fim
hard
{ "lang": "python", "repo": "jotagesales/Vial", "path": "/vial.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self): import views from urlmap import urlmap self.views = views self.urlmap = urlmap def not_found(self, environ): return Response(body=None, status_code=Status.NOT_FOUND, content_type=None, encoding=None) def static_file(self, environ, s...
code_fim
hard
{ "lang": "python", "repo": "jotagesales/Vial", "path": "/vial.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: luosch/leetcode path: /python/Maximum Size Subarray Sum Equals k.py class Solution(object): def maxSubArrayLen(self, nums, k): sum_index = {0: -1} <|fim_suffix|>ex: answer = max(answer, i - sum_index[tmp - k]) return answer<|fim_middle|> answer ...
code_fim
hard
{ "lang": "python", "repo": "luosch/leetcode", "path": "/python/Maximum Size Subarray Sum Equals k.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if tmp not in sum_index: sum_index[tmp] = i if tmp - k in sum_index: answer = max(answer, i - sum_index[tmp - k]) return answer<|fim_prefix|># repo: luosch/leetcode path: /python/Maximum Size Subarray Sum Equals k.py class Solution(object): ...
code_fim
hard
{ "lang": "python", "repo": "luosch/leetcode", "path": "/python/Maximum Size Subarray Sum Equals k.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # parameters color_channels = train_set[0][0].shape[0] z_dim = int(config['dcgan']['z_dim']) g_feature_map = int(config['dcgan']['g_feature_map']) d_feature_map = int(config['dcgan']['d_feature_map']) # model device = torch.device("cuda" if torch.cuda.is_available() else "cpu"...
code_fim
hard
{ "lang": "python", "repo": "zhongyuchen/generative-models", "path": "/dcgan.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: zhongyuchen/generative-models path: /dcgan.py from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.optim as optim import torch.utils.data from torchvision import datasets, transforms from torchvisio...
code_fim
hard
{ "lang": "python", "repo": "zhongyuchen/generative-models", "path": "/dcgan.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>def main(): for epoch in range(1, epochs + 1): train(epoch) if __name__ == "__main__": # args parser = argparse.ArgumentParser() parser.add_argument('--ngpu', type=int, default=1, help='number of GPUs to use') args = parser.parse_args() ngpu = int(args.ngpu) # config...
code_fim
hard
{ "lang": "python", "repo": "zhongyuchen/generative-models", "path": "/dcgan.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> value = self.validate(instance, value) super().__set__(instance, value) @abstractmethod def validate(self, instance, value): """ zwraca zweryfikowaną wartość bądź wyjątek """ class ColorValidator(Validated): def validate(self, instance, value): ...
code_fim
hard
{ "lang": "python", "repo": "Paarzivall/Programowanie-obiektowe-2", "path": "/Projekt Zaliczeniowy - Okienko/Descryptors.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Paarzivall/Programowanie-obiektowe-2 path: /Projekt Zaliczeniowy - Okienko/Descryptors.py from abc import ABC, abstractmethod class Storage(object): _count = 0 def __init__(self): cls = self.__class__ prefix = cls.__name__ index = cls._count self.storage...
code_fim
hard
{ "lang": "python", "repo": "Paarzivall/Programowanie-obiektowe-2", "path": "/Projekt Zaliczeniowy - Okienko/Descryptors.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> class AngleValidator(Validated): def validate(self, instance, value): try: value = float(value) except ValueError: raise ValueError("Błędna Wartość") else: if value <= 120.0: return value else: ra...
code_fim
hard
{ "lang": "python", "repo": "Paarzivall/Programowanie-obiektowe-2", "path": "/Projekt Zaliczeniowy - Okienko/Descryptors.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> purge_expired(aging_hash) current_val = update_aging_hash(aging_hash, k) return current_val[1] <= frequency_threshold # public methods def valid_ip_address (ip_address): """Determine if this ip is valid, based on the number of occurences within the aging time interval""" return vali...
code_fim
hard
{ "lang": "python", "repo": "canwe/intelligent-smtp-responder", "path": "/server/anti_spam.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: canwe/intelligent-smtp-responder path: /server/anti_spam.py #!/usr/bin/python """ Functions to prevent spam by ignoring ip and subject combinations which occur too frequently, and are likely to be from spammers or bots, etc. Based on concept described by Paul Tyma: http://mailinator.blogspot.co...
code_fim
hard
{ "lang": "python", "repo": "canwe/intelligent-smtp-responder", "path": "/server/anti_spam.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def asignar(self, p, num_set, n1, n2): if(p == self.p1): self.contP1 = self.contP1 + 1 self.ganadores = self.ganadores + [p] self.scoreP1 = self.scoreP1 + [n1] self.scoreP2 = self.scoreP2 + [n2] elif(p == self.p2): self.contP...
code_fim
hard
{ "lang": "python", "repo": "lupineka/sqa2014tennis", "path": "/app/match.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: lupineka/sqa2014tennis path: /app/match.py # -*- coding: utf-8 -*- class Match: def __init__(self, player1, player2, pacted_sets): self.contP1 = 0 self.contP2 = 0 self.ganadores = [] self.scoreP1 = [] self.scoreP2 = [] self.p1 = player1 ...
code_fim
hard
{ "lang": "python", "repo": "lupineka/sqa2014tennis", "path": "/app/match.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> arg_type = types.from_string(arg_type) if types.generics(arg_type): self._classes = {} elif fq_source_filename: sys_path = sys.path[:] if fq_source_filename.endswith('None'): raise IOError(fq_source_filename) sys.path....
code_fim
hard
{ "lang": "python", "repo": "SharpLu/Sympathy-for-data-benchmark", "path": "/Library/Common/sylib/function_selector.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: SharpLu/Sympathy-for-data-benchmark path: /Library/Common/sylib/function_selector.py # Copyright (c) 2013, System Engineering Software Society # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following co...
code_fim
hard
{ "lang": "python", "repo": "SharpLu/Sympathy-for-data-benchmark", "path": "/Library/Common/sylib/function_selector.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: swshadle/bokeh path: /release/git.py # ----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. # -----...
code_fim
hard
{ "lang": "python", "repo": "swshadle/bokeh", "path": "/release/git.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> regex_filenames: List[str] = [] json_filenames: List[str] = [ "bokehjs/package.json", "bokehjs/package-lock.json", ] pat = rf"(release|version)([\" ][:=] [\"\']){config.js_last_any_version}([\"\'])" for filename in regex_filenames: path = join(REPO_TOP, filen...
code_fim
hard
{ "lang": "python", "repo": "swshadle/bokeh", "path": "/release/git.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> pat = rf"(release|version)([\" ][:=] [\"\']){config.js_last_any_version}([\"\'])" for filename in regex_filenames: path = join(REPO_TOP, filename) with open(path) as f: text = f.read() match = re.search(pat, text) if not match: failed(f...
code_fim
hard
{ "lang": "python", "repo": "swshadle/bokeh", "path": "/release/git.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: lucas-sancere/EPySeg path: /epyseg/ezfig.py elf.shapes_to_draw.append(Circle2D(150, 300, 30, color=0xFF0000)) self.shapes_to_draw.append(PolyLine2D(10, 10, 20, 10, 20, 30, 40, 30, color=0xFF0000, stroke=2)) self.shapes_to_draw.append(PolyLine2D(10, 10, 20, 10, 20, 30, 40, ...
code_fim
hard
{ "lang": "python", "repo": "lucas-sancere/EPySeg", "path": "/epyseg/ezfig.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def scaling_factor_to_achieve_DPI(self, desired_dpi): return desired_dpi / 72 # TODO maybe get bounding box size in px by measuring the real bounding box this is especially important for raster images so that everything is really saved... SVG_INKSCAPE = 96 SVG_ILLUSTRATOR = 72 ...
code_fim
hard
{ "lang": "python", "repo": "lucas-sancere/EPySeg", "path": "/epyseg/ezfig.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: lucas-sancere/EPySeg path: /epyseg/ezfig.py a series of commands so that it can always be recreated from scratch from source image, allow export as SVF or various formats with DPI scaling ??? # todo CAN i USE css to change font and apply style would be so much simpler and better than current stu...
code_fim
hard
{ "lang": "python", "repo": "lucas-sancere/EPySeg", "path": "/epyseg/ezfig.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>colors = [(27,158,119), (217,95,2), (117,112,179), (231,41,138), (102,166,30), (230,171,2)] colors = [(r/255.0, g/255.0, b/255.0) for r, g, b in colors] formats = ["-o", "-D", "-s", "-v"] maxColorP = -0.35 # throughput plt.figure() for tIndex in range(len(threads)): plt.errorbar(clients, TPS[tIndex],...
code_fim
hard
{ "lang": "python", "repo": "gttm/eth-advanced-systems-lab", "path": "/scripts_2/maxthroughput_plot.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: gttm/eth-advanced-systems-lab path: /scripts_2/maxthroughput_plot.py import sys from math import sqrt from statistics import stdev, mean from numpy import percentile import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt def extractMemaslapValues(benchmark): f = open(benchma...
code_fim
hard
{ "lang": "python", "repo": "gttm/eth-advanced-systems-lab", "path": "/scripts_2/maxthroughput_plot.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: nightohl/phoneypdf path: /pdf/filters/test.py # Exploit Title: Foxit Reader 9.0.1.1049 - Arbitrary Code Execution # Date: August 29, 2020 # Exploit Author: CrossWire # Vendor Homepage: https://www.foxitsoftware.com/ # Software Link: https://www.foxitsoftware.com/downloads/latest.php?product=Foxit...
code_fim
hard
{ "lang": "python", "repo": "nightohl/phoneypdf", "path": "/pdf/filters/test.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }