text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_prefix|># repo: nachiketgalande/UIHome path: /stg-nrtviewer.web.att.com/htdocs/vertica_getter.py #!/opt/app/cacheDB/python/bin/python3 """ A script for getting data objects from Vertica References: Vertica Python - https://github.com/uber/vertica-python """ import vertica_python import logging # Set the logging...
code_fim
hard
{ "lang": "python", "repo": "nachiketgalande/UIHome", "path": "/stg-nrtviewer.web.att.com/htdocs/vertica_getter.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: RYoTA1209/KeyakiAPI path: /app.py from flask import Flask, abort, make_response, jsonify, render_template from util.utils import Member,getSchedules app = Flask(__name__) app.config['JSON_AS_ASCII'] = False app.config['JSON_SORT_KEYS'] = False @app.route('/', methods=['GET']) def index(): ...
code_fim
hard
{ "lang": "python", "repo": "RYoTA1209/KeyakiAPI", "path": "/app.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>@app.route('/members', methods=['GET']) def get_all_members(): try: members = Member.select() except Member.DoesNotExist: abort(404) items = [] for member in members: items.append({ "memberId": member.memberId, "name": member.name, ...
code_fim
hard
{ "lang": "python", "repo": "RYoTA1209/KeyakiAPI", "path": "/app.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def make(self): dxf_profile = self.params['dxf_profile'] length = self.params['length'] width = self.params['width'] part = Linear_DXF_Extrude(dxf_profile,height=length) part = Scale(part,v=(INCH2MM, INCH2MM, 1.0)) self.part = part # -------------------...
code_fim
medium
{ "lang": "python", "repo": "iorodeo/hallway_arenas", "path": "/mechanics/camera_post.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: iorodeo/hallway_arenas path: /mechanics/camera_post.py """ CAD model for camera mounting posts. """ from py2scad import * from part import Part class Camera_Post(Part): <|fim_suffix|> import params part = Camera_Post(**params.camera_post) prog = SCAD_Prog() prog.fn = 50 prog.a...
code_fim
hard
{ "lang": "python", "repo": "iorodeo/hallway_arenas", "path": "/mechanics/camera_post.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> import params part = Camera_Post(**params.camera_post) prog = SCAD_Prog() prog.fn = 50 prog.add(part) prog.write('camera_post.scad')<|fim_prefix|># repo: iorodeo/hallway_arenas path: /mechanics/camera_post.py """ CAD model for camera mounting posts. """ from py2scad import * from ...
code_fim
medium
{ "lang": "python", "repo": "iorodeo/hallway_arenas", "path": "/mechanics/camera_post.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>"""# VGG16""" vgg16 = applications.VGG16(weights = "imagenet", include_top = False, input_shape = (img_width, img_height, 3)) vgg16.layers # !rm -rf test_aug # os.mkdir('saved') train_aug = 'train_aug' test_aug = 'test_aug' os.mkdir(train_aug) os.mkdir(test_aug) # Freeze the layers which you don't wa...
code_fim
hard
{ "lang": "python", "repo": "pratikg1999/millet_djangorest", "path": "/webapp/plant_disease_detection.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: pratikg1999/millet_djangorest path: /webapp/plant_disease_detection.py # -*- coding: utf-8 -*- """Plant disease detection Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1p_O39hjZ9J9CzX2lDWWqH_rNa8cp-mg1 """ from keras import app...
code_fim
hard
{ "lang": "python", "repo": "pratikg1999/millet_djangorest", "path": "/webapp/plant_disease_detection.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># Initiate the train and test generators with data Augumentation train_datagen = ImageDataGenerator( rescale = 1./255, horizontal_flip = True, fill_mode = "nearest", zoom_range = 0.3, width_shift_range = 0.3, ...
code_fim
hard
{ "lang": "python", "repo": "pratikg1999/millet_djangorest", "path": "/webapp/plant_disease_detection.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> self.__lives -= 1 if(not self.__lives): self.__score -= (time.time() - self.__start) / 10 print(font['red'] + bg['reset'] + "You Lost! Game Over! Your final score is %.3f" %(self.__score)) print("\033[?25h") quit() for l in range(0...
code_fim
hard
{ "lang": "python", "repo": "SRDewan/Brick-Breaker", "path": "/game.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: SRDewan/Brick-Breaker path: /game.py ndint(0, 5)][random.randint(0, self.__brickCtr - 1)].getPos())) self.__powers.append(padGrab(self.__bricks[random.randint(0, 5)][random.randint(0, self.__brickCtr - 1)].getPos())) self.__powers.append(padShoot(self.__bricks[random.randi...
code_fim
hard
{ "lang": "python", "repo": "SRDewan/Brick-Breaker", "path": "/game.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> if(ctype == 1 or ctype == 2 or ctype == 3): self.__paddle.release(self.__balls) elif(not self.__lifeRec and ctype == 6): self.__paddle.release(self.__balls) def play(self): os.system('cls' if os.name == 'nt' else 'clear') print...
code_fim
hard
{ "lang": "python", "repo": "SRDewan/Brick-Breaker", "path": "/game.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: LamprechtMatyas/MolecularSimilarity path: /model/linear_regression_model.py #!/usr/bin/env python3 """" Model that uses standard machine learning method - linear regression It can be used for whole molecules or their fragments, but it has to be consistent. If we use fragments then the similar...
code_fim
hard
{ "lang": "python", "repo": "LamprechtMatyas/MolecularSimilarity", "path": "/model/linear_regression_model.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> else: num_of_fragment = [0] names_of_molecules = [] with open(fragments_file, "r", encoding="utf-8") as fragments_stream: suma = 0 for new_line in fragments_stream: line = json.loads(new_line) ...
code_fim
hard
{ "lang": "python", "repo": "LamprechtMatyas/MolecularSimilarity", "path": "/model/linear_regression_model.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: TMenezesO/Python-UERJ path: /Aula13/Aula13_ex1.py #Utilizando um arquivo de dados com varias colunas (por exemplo, o arquivo dados_alunos.txt), #faca um histograma com os dados de cada uma das colunas. #Dica: utilize o matplotlib para fazer os histogramas. import matplotlib.pyplot as plt <|fi...
code_fim
medium
{ "lang": "python", "repo": "TMenezesO/Python-UERJ", "path": "/Aula13/Aula13_ex1.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> plt.hist(lista) plt.show() histo(lista_idade) histo(lista_altura) histo(lista_peso)<|fim_prefix|># repo: TMenezesO/Python-UERJ path: /Aula13/Aula13_ex1.py #Utilizando um arquivo de dados com varias colunas (por exemplo, o arquivo dados_alunos.txt), #faca um histograma com os dados de cada um...
code_fim
hard
{ "lang": "python", "repo": "TMenezesO/Python-UERJ", "path": "/Aula13/Aula13_ex1.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>def histo(lista): plt.hist(lista) plt.show() histo(lista_idade) histo(lista_altura) histo(lista_peso)<|fim_prefix|># repo: TMenezesO/Python-UERJ path: /Aula13/Aula13_ex1.py #Utilizando um arquivo de dados com varias colunas (por exemplo, o arquivo dados_alunos.txt), #faca um histograma com o...
code_fim
hard
{ "lang": "python", "repo": "TMenezesO/Python-UERJ", "path": "/Aula13/Aula13_ex1.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_marshals.py #calss header class _MARSHALS(): def __init__(self,): <|fim_suffix|> self.parents = [] self.childen = [] self.properties = [] self.jsondata = {} self.basic = ['marshal']<|fim_middle|> self.name = "MARSHALS" self.defi...
code_fim
easy
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_marshals.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.basic = ['marshal']<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_marshals.py #calss header class _MARSHALS(): def __init__(self,): self.name = "MARSHALS" self.definitions = marshal <|fim_middle|> self.parents = [] self.childen = [] self.properties = [] se...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_marshals.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.basic = ['marshal']<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_marshals.py #calss header class _MARSHALS(): <|fim_middle|> def __init__(self,): self.name = "MARSHALS" self.definitions = marshal self.parents = [] self.childen = [] self.properties = [] s...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_marshals.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>it() elif weird_algorithm_number>1000000: print ("Error: Give an integer equal to or smaller than") print ("1000000, and bigger than or equal to 1.") sys.exit() print (weird_algorithm_number, end=" ", flush=True) while weird_algorithm_number!=1: if is_even(weird_algorithm_number): ...
code_fim
hard
{ "lang": "python", "repo": "xormor2/Weird-algorithm", "path": "/weird_algorithm_pylint_this2.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: xormor2/Weird-algorithm path: /weird_algorithm_pylint_this2.py #!/bin/python3 # copyright Lauri K. Friberg 2021 """System module.""" import sys def is_even(number): """Find out if number is even.""" return (number%2)==0 def is_odd(number): """Find out if number is odd.""" return (...
code_fim
hard
{ "lang": "python", "repo": "xormor2/Weird-algorithm", "path": "/weird_algorithm_pylint_this2.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: matzim95/Human-flow-recognition path: /people_counter_yolo.py # import the necessary packages from tracker.centroidtracker import CentroidTracker from tracker.trackableobject import TrackableObject from imutils.video import VideoStream from imutils.video import FPS import numpy as np import argpa...
code_fim
hard
{ "lang": "python", "repo": "matzim95/Human-flow-recognition", "path": "/people_counter_yolo.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # construct a tuple of information we will be displaying on the frame info = [ ("Up", totalUp), ("Down", totalDown), ("Status", status), ] for (i, (k, v)) in enumerate(info): text = "{}: {}".format(k, v) cv2.putText(frame, text, (10, H - ((i * 20) + 20)), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (...
code_fim
hard
{ "lang": "python", "repo": "matzim95/Human-flow-recognition", "path": "/people_counter_yolo.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>def check (n, base): nn=num(n,base) d = 1 for p in P: if p*p>=nn: break if not nn%p: d=p break return d def solve(t): print "Case #%d:"%(t+1) N, J = map(int, raw_input().strip().split()) fine = [] for p in product(...
code_fim
medium
{ "lang": "python", "repo": "DaHuO/Supergraph", "path": "/codes/CodeJamCrawler/16_0_3_neat/16_0_3_vlejd_C.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> nn=num(n,base) d = 1 for p in P: if p*p>=nn: break if not nn%p: d=p break return d def solve(t): print "Case #%d:"%(t+1) N, J = map(int, raw_input().strip().split()) fine = [] for p in product(range(2), repeat= N-2...
code_fim
medium
{ "lang": "python", "repo": "DaHuO/Supergraph", "path": "/codes/CodeJamCrawler/16_0_3_neat/16_0_3_vlejd_C.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: DaHuO/Supergraph path: /codes/CodeJamCrawler/16_0_3_neat/16_0_3_vlejd_C.py from itertools import product def primes(n): """ Returns a list of primes < n """ sieve = [True] * n for i in xrange(3,int(n**0.5)+1,2): if sieve[i]: sieve[i*i::2*i]=[False]*((n-i*i-1)/(2*...
code_fim
medium
{ "lang": "python", "repo": "DaHuO/Supergraph", "path": "/codes/CodeJamCrawler/16_0_3_neat/16_0_3_vlejd_C.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> logger.info("deleting tunnel i:{}, o:{}, ebi:{}".format(i_tei, o_tei, ebi)) ifindex = lgnl.if_nametoindex ifindex.argtypes = [c_char_p] idx = ifindex(devname.encode('ascii')) zero = V0(0) one = V1(i_tei, o_tei) versions = VERSIONS(zero, one) ue_bytes = IN_ADDR(0) enb_by...
code_fim
hard
{ "lang": "python", "repo": "Cumucore/pygtpnl", "path": "/pygtpnl/pygtpnl.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Cumucore/pygtpnl path: /pygtpnl/pygtpnl.py ''' Python wrapper for libgtpnl ''' from ctypes import CDLL,c_int,c_uint16,c_char_p,c_void_p from ctypes import pointer,byref from socket import socket,inet_aton,AF_INET,SOCK_DGRAM,AF_NETLINK # IPv4 from struct import unpack from .gtpsock import GtpSock...
code_fim
hard
{ "lang": "python", "repo": "Cumucore/pygtpnl", "path": "/pygtpnl/pygtpnl.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> #TODO: pythonize if_mnlsock_id = lgnl.genl_lookup_family if_mnlsock_id.argtypes = [c_void_p, c_char_p] mnlsock_id = if_mnlsock_id(byref(c_sock), devname.encode('ascii')) logger.debug("mnlsock_id: {}".format(mnlsock_id)) tdel = lgnl.gtp_del_tunnel tdel.argtypes = [c_int, c_void...
code_fim
hard
{ "lang": "python", "repo": "Cumucore/pygtpnl", "path": "/pygtpnl/pygtpnl.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: firdausraginda/gcp-cloud-storage path: /main.py import os import sys from google.cloud import storage from setup.init_client import create_client os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = './service_account.json' def create_bucket(bucket_name): """create new bucket in specifi...
code_fim
hard
{ "lang": "python", "repo": "firdausraginda/gcp-cloud-storage", "path": "/main.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return None def get_list_of_blobs(bucket_name, prefix=None, delimiter=None): """get lists of all the blobs in the bucket""" # initialize client storage_client = storage.Client() # get list blobs blobs = storage_client.list_blobs(bucket_name, prefix=prefix, delimiter=d...
code_fim
hard
{ "lang": "python", "repo": "firdausraginda/gcp-cloud-storage", "path": "/main.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: kingsdigitallab/field-django path: /django_kdl_timeline/tests.py from django.test import TestCase from .models import (TimelineSlide) import json # Test data test_data_headline = 'Milk Marketing Board established' test_data_text = 'The Milk Marketing Board (MMB) was a producer-led ' \ ...
code_fim
hard
{ "lang": "python", "repo": "kingsdigitallab/field-django", "path": "/django_kdl_timeline/tests.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> slide = TimelineSlide.objects.get(unique_id='F001') test_text = { "headline": test_data_headline, "text": test_data_text } self.assertEqual(slide.serialise_text(), test_text) def test_get_timeline_data(self): slide = TimelineSlide.object...
code_fim
hard
{ "lang": "python", "repo": "kingsdigitallab/field-django", "path": "/django_kdl_timeline/tests.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_serialise_end_date(self): slide = TimelineSlide.objects.get(unique_id='F001') test_date = {"year": 1933, 'month': 12, 'day': 1} self.assertEqual(slide.serialise_end_date(), test_date) def test_serialise_text(self): slide = TimelineSlide.objects.get(unique_...
code_fim
hard
{ "lang": "python", "repo": "kingsdigitallab/field-django", "path": "/django_kdl_timeline/tests.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hhthuongbtr/monitor path: /BLL/__init__.py import json import logging import logging.config import logging.handlers <|fim_suffix|>with open("/monitor/config/python_logging_configuration.json", 'r') as configuration_file: config_dict = json.load(configuration_file) logging.config.dictConfig(c...
code_fim
medium
{ "lang": "python", "repo": "hhthuongbtr/monitor", "path": "/BLL/__init__.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>with open("/monitor/config/python_logging_configuration.json", 'r') as configuration_file: config_dict = json.load(configuration_file) logging.config.dictConfig(config_dict) # Create the Logger logger = logging.getLogger(__name__)<|fim_prefix|># repo: hhthuongbtr/monitor path: /BLL/__init__.py import...
code_fim
medium
{ "lang": "python", "repo": "hhthuongbtr/monitor", "path": "/BLL/__init__.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>p.log10(20)))/(10**(50/20+np.log10(20))))<|fim_prefix|># repo: yuridesu/python-data-science path: /D03.py #20微巴斯卡=0分貝,定義為v0;此式代表多少微巴斯卡=多少分貝 import numpy as np print(20*np.log10(20000/20))<|fim_middle|> #分貝=20log10(微巴斯卡/20) print((10**(30/20+n
code_fim
easy
{ "lang": "python", "repo": "yuridesu/python-data-science", "path": "/D03.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: yuridesu/python-data-science path: /D03.py #20微巴斯卡=0分貝,定義為v0;此式代表多少微巴斯卡=多少分貝 import<|fim_suffix|> #分貝=20log10(微巴斯卡/20) print((10**(30/20+np.log10(20)))/(10**(50/20+np.log10(20))))<|fim_middle|> numpy as np print(20*np.log10(20000/20))
code_fim
easy
{ "lang": "python", "repo": "yuridesu/python-data-science", "path": "/D03.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>########### Example:1 For loop same program ####################################### for i in range(10): ### range is 0 to 9 here print("hello world") i += 1 for i in range(1,11): ### range is 1 to 10 here print("how r u") i += 1 ####### Example:2 Sum from 1 to 10 ############...
code_fim
medium
{ "lang": "python", "repo": "Tech-Amol5278/Python_Basics", "path": "/c3 - loops/c3_for_loop.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>for i in range(len_name): if name[i] not in uq_name: uq_name += name[i] i += 1 #### get letter count from name ## for i in range(len(uq_name)): print(f"{uq_name[i]} : {name.count(uq_name[i])}") i += 1<|fim_prefix|># repo: Tech-Amol5278/Python_Basics path: /c3 - loops/c3_for_loop...
code_fim
hard
{ "lang": "python", "repo": "Tech-Amol5278/Python_Basics", "path": "/c3 - loops/c3_for_loop.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Tech-Amol5278/Python_Basics path: /c3 - loops/c3_for_loop.py # while loop # print("hello world") 10 times ######################################################################## # i = 1 # while i <= 10: # print("hello world") # i +=1 ########### Example:1 For loop same program ####...
code_fim
medium
{ "lang": "python", "repo": "Tech-Amol5278/Python_Basics", "path": "/c3 - loops/c3_for_loop.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return Response({ 'message': 'User Found!', 'data': { 'token': token } }, status=status.HTTP_200_OK) else: Response({ 'message': 'User Not Fo...
code_fim
hard
{ "lang": "python", "repo": "erfynaila/arrihu.ukt", "path": "/web/apps/settings/api/serializers.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: erfynaila/arrihu.ukt path: /web/apps/settings/api/serializers.py from django.contrib.auth import authenticate from rest_framework import serializers, status from rest_framework.response import Response from rest_framework_jwt.serializers import ( JSONWebTokenSerializer, jwt_payload_handle...
code_fim
hard
{ "lang": "python", "repo": "erfynaila/arrihu.ukt", "path": "/web/apps/settings/api/serializers.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def validate(self, kwargs): credentials = { 'username': kwargs.get('username'), 'password': kwargs.get('password') } if all(credentials.values()): user = authenticate(request=self.context['request'], **credentials) if user: ...
code_fim
hard
{ "lang": "python", "repo": "erfynaila/arrihu.ukt", "path": "/web/apps/settings/api/serializers.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: bmcq55/schoolprojects path: /Lab03_Q1b.py # -*- coding: utf-8 -*- """ Created on Tue Sep 22 11:25:28 2020 @author: Brendon McHugh Question 1(b) of Lab03 Here, we use gaussian quadrature to calculate the probability of blowing snow based on the average hourly windspeed at 10m, the s...
code_fim
hard
{ "lang": "python", "repo": "bmcq55/schoolprojects", "path": "/Lab03_Q1b.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>plt.title('Probability of Blowing Snow vs Temperature') plt.savefig('ProbSnow_Temp_1b') # Create log plot of proability of blowing snow vs temperature plt.figure() for (u10, colour) in zip(u10_vals, colours): for (th, line) in zip(th_vals, lines): P_bs = prob_blowing_snow(u10, Ta, th...
code_fim
hard
{ "lang": "python", "repo": "bmcq55/schoolprojects", "path": "/Lab03_Q1b.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># Create log plot of proability of blowing snow vs temperature plt.figure() for (u10, colour) in zip(u10_vals, colours): for (th, line) in zip(th_vals, lines): P_bs = prob_blowing_snow(u10, Ta, th, N) plot_str = colour + line plt.semilogy(Ta, P_bs, plot_str, label=r'$u_{1...
code_fim
hard
{ "lang": "python", "repo": "bmcq55/schoolprojects", "path": "/Lab03_Q1b.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: josepalos/temperature_monitor path: /backend/load.py import random import uuid from temperatures import models import datetime from django.utils import timezone <|fim_suffix|>for i in range(0, dades): temp = random.randint(0, 40) models.Temperature.objects.create(temperature=temp, device...
code_fim
hard
{ "lang": "python", "repo": "josepalos/temperature_monitor", "path": "/backend/load.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>dades = 3600 device, _ = models.Device.objects.get_or_create(identifier=DUMMY_UUID) for i in range(0, dades): temp = random.randint(0, 40) models.Temperature.objects.create(temperature=temp, device=device, datetime=first) first = first - offset<|fim_prefix|># repo: josepalos/temperature_moni...
code_fim
medium
{ "lang": "python", "repo": "josepalos/temperature_monitor", "path": "/backend/load.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: rickyrawal458/gallery path: /galleryview/migrations/0005_auto_20201201_1906.py # Generated by Django 3.1.2 on 2020-12-01 13:36 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): <|fim_suffix|> ope...
code_fim
medium
{ "lang": "python", "repo": "rickyrawal458/gallery", "path": "/galleryview/migrations/0005_auto_20201201_1906.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('galleryview', '0004_remove_list_available'), ] operations = [ migrations.AlterModelOptions( name='list', options={}, ), migrations.AddField( ...
code_fim
medium
{ "lang": "python", "repo": "rickyrawal458/gallery", "path": "/galleryview/migrations/0005_auto_20201201_1906.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('exam', '0002_profile'), ] operations = [ migrations.AddField( model_name='profile', name='About_me', field=models.TextField(blank=True, null=True), ), migrations.AddField( model_name=...
code_fim
medium
{ "lang": "python", "repo": "Kdheeru12/intern2", "path": "/exam/migrations/0003_auto_20200804_2034.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Kdheeru12/intern2 path: /exam/migrations/0003_auto_20200804_2034.py # Generated by Django 3.0.2 on 2020-08-04 15:04 from django.db import migrations, models <|fim_suffix|> dependencies = [ ('exam', '0002_profile'), ] operations = [ migrations.AddField( ...
code_fim
medium
{ "lang": "python", "repo": "Kdheeru12/intern2", "path": "/exam/migrations/0003_auto_20200804_2034.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: gracechg/PythonCode path: /DataBase/上证综指.py # coding=utf8 import matplotlib.pyplot as plt import numpy as np open,close=<|fim_suffix|> today=change[1:] plt.scatter(yesterday,today,10,'r','<',alpha=0.5) plt.show()<|fim_middle|>np.loadtxt('G:\\PythonCode\\DataBase\\000001.csv',delimiter=',',skipro...
code_fim
medium
{ "lang": "python", "repo": "gracechg/PythonCode", "path": "/DataBase/上证综指.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> today=change[1:] plt.scatter(yesterday,today,10,'r','<',alpha=0.5) plt.show()<|fim_prefix|># repo: gracechg/PythonCode path: /DataBase/上证综指.py # coding=utf8 import matplotlib.pyplot as plt import numpy as np open,close=<|fim_middle|>np.loadtxt('G:\\PythonCode\\DataBase\\000001.csv',delimiter=',',skipro...
code_fim
medium
{ "lang": "python", "repo": "gracechg/PythonCode", "path": "/DataBase/上证综指.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: sunxinzhao/LeetCode_subject path: /medium/tree/98.py # coding=utf-8 ''' 给定一个二叉树,判断其是否是一个有效的二叉搜索树。 假设一个二叉搜索树具有如下特征: 节点的左子树只包含小于当前节点的数。 节点的右子树只包含大于当前节点的数。 所有左子树和右子树自身必须也是二叉搜索树。 示例 1: 输入: 2 / \ 1 3 输出: true 示例 2: 输入: ...
code_fim
medium
{ "lang": "python", "repo": "sunxinzhao/LeetCode_subject", "path": "/medium/tree/98.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def digui(node): if node: digui(node.left) return_list.append(node.val) digui(node.right) digui(root) for i in range(1, len(return_list) - 1): if return_list[i] < return_list[i - 1]: return Fa...
code_fim
hard
{ "lang": "python", "repo": "sunxinzhao/LeetCode_subject", "path": "/medium/tree/98.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: jdaeira/Python-Basics path: /lists.py my_list = [1 , 2.5, 'a'] print(my_list) length = len(my_list) print("The length of the list is: {}".format(length)) print("The contents of the list is:") for item in my_list: print(item) <|fim_suffix|># split = '_'.join(split) # print(split) split = ' '....
code_fim
medium
{ "lang": "python", "repo": "jdaeira/Python-Basics", "path": "/lists.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># split = '_'.join(split) # print(split) split = ' '.join(split) print(split)<|fim_prefix|># repo: jdaeira/Python-Basics path: /lists.py my_list = [1 , 2.5, 'a'] print(my_list) length = len(my_list) print("The length of the list is: {}".format(length)) print("The contents of the list is:") for item in...
code_fim
medium
{ "lang": "python", "repo": "jdaeira/Python-Basics", "path": "/lists.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> operations = [ migrations.CreateModel( name='reg2', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('user_name', models.CharField(max_length=100)), ('password...
code_fim
hard
{ "lang": "python", "repo": "sallythompson28/Agraryans-Form-equipment-rental-system", "path": "/main_part/sub_part/migrations/0013_reg2.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('sub_part', '0012_add_categories_database_status'), ] operations = [ migrations.CreateModel( name='reg2', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ...
code_fim
hard
{ "lang": "python", "repo": "sallythompson28/Agraryans-Form-equipment-rental-system", "path": "/main_part/sub_part/migrations/0013_reg2.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: sallythompson28/Agraryans-Form-equipment-rental-system path: /main_part/sub_part/migrations/0013_reg2.py # Generated by Django 3.2.5 on 2021-08-09 14:43 from django.db import migrations, models <|fim_suffix|> dependencies = [ ('sub_part', '0012_add_categories_database_status'), ...
code_fim
hard
{ "lang": "python", "repo": "sallythompson28/Agraryans-Form-equipment-rental-system", "path": "/main_part/sub_part/migrations/0013_reg2.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>#Now train the model test= pd.read_csv("testeco_lstm.csv") train = pd.read_csv("traineco_lstm.csv") gg=train.fillna(train.median()) y=gg['target'] X=gg.drop(['id','target'],axis=1) print("X_shape:"+str(X.shape)," , y_shape :"+str(y.shape)) X_train, X_cv, y_train, y_cv = train_test_split(X, y, test_...
code_fim
hard
{ "lang": "python", "repo": "nikitaomare/Softbank_USD-JPY", "path": "/softbank_script.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: nikitaomare/Softbank_USD-JPY path: /softbank_script.py #importing library import pandas as pd from keras import models from keras import layers from keras.datasets import boston_housing from keras.models import Model from sklearn.model_selection import cross_val_score from keras.layers imp...
code_fim
hard
{ "lang": "python", "repo": "nikitaomare/Softbank_USD-JPY", "path": "/softbank_script.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # retrieve list of Gmail labels labels = ListLabels(service, 'me') for label in labels: # check if specified label exists if label['name'] == flags.label: label_id = label['id'] label_exists = True # get label_ID of 'new' label elif labe...
code_fim
hard
{ "lang": "python", "repo": "UI-VAST/dashboard", "path": "/scripts/PacketDownloader/PacketDownloader.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> try: label = service.users().labels().create(userId=user_id, body=label_object).execute() return label except errors.HttpError, error: print('An error occurred: %s' % error) # make actual label in Gmail def MakeLabel(label_name, mlv='show', llv='labelShow'): label = {'messageListVisibil...
code_fim
hard
{ "lang": "python", "repo": "UI-VAST/dashboard", "path": "/scripts/PacketDownloader/PacketDownloader.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: UI-VAST/dashboard path: /scripts/PacketDownloader/PacketDownloader.py #!/usr/bin/python2 from __future__ import print_function import httplib2 import oauth2client # $ pip install google-api-python-client import os import base64 import time import email from googleapiclient import discovery...
code_fim
hard
{ "lang": "python", "repo": "UI-VAST/dashboard", "path": "/scripts/PacketDownloader/PacketDownloader.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # your code here return 0 # change<|fim_prefix|># repo: yeonwookang/Practice path: /JH/q2b.py # q2b.py # Name: # Section: <|fim_middle|># TODO: fill sv_recursive # m is a matrix represented by a 2D list of integers. e.g. m = [[3, 0, 2, 18],[-1, 1, 3, 4],[-2, -3, 18, 7]] # This function returns the ...
code_fim
hard
{ "lang": "python", "repo": "yeonwookang/Practice", "path": "/JH/q2b.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: yeonwookang/Practice path: /JH/q2b.py # q2b.py # Name: # Section: <|fim_suffix|> # your code here return 0 # change<|fim_middle|># TODO: fill sv_recursive # m is a matrix represented by a 2D list of integers. e.g. m = [[3, 0, 2, 18],[-1, 1, 3, 4],[-2, -3, 18, 7]] # This function returns the ...
code_fim
hard
{ "lang": "python", "repo": "yeonwookang/Practice", "path": "/JH/q2b.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def get_ticker_list(self, folder = "/Users/zhouzijian/myproject/Backtest-Platform"): #save to a local file dateToday = self.today tickersRawData = ts.get_stock_basics() tickers = tickersRawData.index.to_list() return pd.DataFrame(tickers)<|fim_prefix|># repo: h...
code_fim
medium
{ "lang": "python", "repo": "hantop/CN-Trade", "path": "/strategies/get_cn_data.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> #if history, append at end file = folder + "/" + ticker + ".csv" if os.path.exists(file): history = pd.read_csv(file, index_col = 0) intraday.append(history) #save intraday.to_csv(file) print("intraday for [" + ticker + "] saved.") ...
code_fim
hard
{ "lang": "python", "repo": "hantop/CN-Trade", "path": "/strategies/get_cn_data.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: hantop/CN-Trade path: /strategies/get_cn_data.py import baostock as bs import tushare as ts import pandas as pd import datetime import os class stock_data: def __init__(self, ticker = "000001"): if ticker[0] == '6': ticker = 'sh.' + ticker else: ticke...
code_fim
medium
{ "lang": "python", "repo": "hantop/CN-Trade", "path": "/strategies/get_cn_data.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>dosAbundante = set([]) for a in abundantes: for b in abundantes: valor = a+b if valor < 28123: dosAbundante.add(a+b) print len(dosAbundante) total = 0 for n in dosAbundante: total += n superior = 0 for n in xrange(1, 28123): superior += n print superior print tota...
code_fim
medium
{ "lang": "python", "repo": "Mohamedtareque/joac-python", "path": "/Euler/euler23.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Mohamedtareque/joac-python path: /Euler/euler23.py import math def sumaDivisoresPropios(numero): n = numero p =2 sum = 1 while pow(p, 2) <= n and n >1: if not n%p: j = pow(p,2) n /= p while not n%p: j *= p ...
code_fim
medium
{ "lang": "python", "repo": "Mohamedtareque/joac-python", "path": "/Euler/euler23.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># In[16]: # DON'T WRITE HERE # #### 16. Write code that reproduces the output shown below. # In[65]: mat[4] # In[17]: # DON'T WRITE HERE # #### 17. Write code that reproduces the output shown below. # In[69]: mat[3:5] # In[18]: # DON'T WRITE HERE # ## NumPy Operations # #### 18. Get...
code_fim
hard
{ "lang": "python", "repo": "Kopuz90/demorepo", "path": "/NumPy-Exercises.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Kopuz90/demorepo path: /NumPy-Exercises.py #!/usr/bin/env python # coding: utf-8 # ___ # # <a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a> # ___ # <center><em>Copyright Pierian Data</em></center> # <center><em>For more information, visit us at <a href='http://www....
code_fim
hard
{ "lang": "python", "repo": "Kopuz90/demorepo", "path": "/NumPy-Exercises.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> # #### 19. Get the standard deviation of the values in mat # In[71]: mat.std() # In[20]: # DON'T WRITE HERE # #### 20. Get the sum of all the columns in mat # In[72]: mat.sum(axis=0) # In[21]: # DON'T WRITE HERE # ## Bonus Question # # We worked a lot with random data with numpy, but i...
code_fim
hard
{ "lang": "python", "repo": "Kopuz90/demorepo", "path": "/NumPy-Exercises.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>def install(): env.run("npm install")<|fim_prefix|># repo: Frojd/Fabrik path: /fabrik/ext/npm.py # -*- coding: utf-8 -*- """ fabrik.ext.npm ------------------------- """ <|fim_middle|>from fabric.decorators import task from fabric.state import env
code_fim
medium
{ "lang": "python", "repo": "Frojd/Fabrik", "path": "/fabrik/ext/npm.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> env.run("npm install")<|fim_prefix|># repo: Frojd/Fabrik path: /fabrik/ext/npm.py # -*- coding: utf-8 -*- <|fim_middle|>""" fabrik.ext.npm ------------------------- """ from fabric.decorators import task from fabric.state import env def install():
code_fim
medium
{ "lang": "python", "repo": "Frojd/Fabrik", "path": "/fabrik/ext/npm.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Frojd/Fabrik path: /fabrik/ext/npm.py # -*- coding: utf-8 -*- <|fim_suffix|>from fabric.decorators import task from fabric.state import env def install(): env.run("npm install")<|fim_middle|>""" fabrik.ext.npm ------------------------- """
code_fim
easy
{ "lang": "python", "repo": "Frojd/Fabrik", "path": "/fabrik/ext/npm.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: charlie1kimo/leetcode_judge path: /63_unique_paths_2.py """ Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and 0 respectively in the grid. For example, There is one obstacle i...
code_fim
hard
{ "lang": "python", "repo": "charlie1kimo/leetcode_judge", "path": "/63_unique_paths_2.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>class Solution(object): """ Idea: - DP (bottom up) - initialize path[m+1][n+1] - initialize path[m - 1][n] = 1 (one way to get to the end) - path[m][n] = path[m - 1][n] + path[m][n - 1] if no obstacle, else 0 """ def uniquePathsWithObstacles(self, ob...
code_fim
medium
{ "lang": "python", "repo": "charlie1kimo/leetcode_judge", "path": "/63_unique_paths_2.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: Aasthaengg/IBMdataset path: /Python_codes/p02813/s908791583.py n = int(input()) P = tuple(map(int, input().split())) Q = tuple(map(int, input().split())) <|fim_suffix|> break for i in range(len(X)): if Q == X[i]: b = i break print(abs(a-b))<|fim_middle|>##print(P) #print(Q) im...
code_fim
medium
{ "lang": "python", "repo": "Aasthaengg/IBMdataset", "path": "/Python_codes/p02813/s908791583.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>: X.append(p) #print(X) for i in range(len(X)): if P == X[i]: a = i break for i in range(len(X)): if Q == X[i]: b = i break print(abs(a-b))<|fim_prefix|># repo: Aasthaengg/IBMdataset path: /Python_codes/p02813/s908791583.py n = int(input()) P = tuple(map(int, i...
code_fim
medium
{ "lang": "python", "repo": "Aasthaengg/IBMdataset", "path": "/Python_codes/p02813/s908791583.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self, sz): self.size = sz self.board = Board(self.size) self.clues = [] def __str__(self): return f'{{\n"title": "Randomly Generated Crossword",\n"by": "#1 POOSD Group",\n"clues":{self.clues}\n}}'<|fim_prefix|># repo: jin0s/Crossing-Words pa...
code_fim
medium
{ "lang": "python", "repo": "jin0s/Crossing-Words", "path": "/Sprint 1/src/crossword.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> self.size = sz self.board = Board(self.size) self.clues = [] def __str__(self): return f'{{\n"title": "Randomly Generated Crossword",\n"by": "#1 POOSD Group",\n"clues":{self.clues}\n}}'<|fim_prefix|># repo: jin0s/Crossing-Words path: /Sprint 1/src/crossword.py im...
code_fim
hard
{ "lang": "python", "repo": "jin0s/Crossing-Words", "path": "/Sprint 1/src/crossword.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: jin0s/Crossing-Words path: /Sprint 1/src/crossword.py import numpy as np class Clue: def __init__(self, x_pos, y_pos, num, _direction, _length): self.x_position = x_pos self.y_position = y_pos self.number = num self.direction = _direction self.len...
code_fim
medium
{ "lang": "python", "repo": "jin0s/Crossing-Words", "path": "/Sprint 1/src/crossword.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: quantumFeline/algebra-hw path: /Legendre_Jacobi.py import functions import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib import colors as mcolors def legendre(a,p): return functions.fast_power(a, (p-1)//2, p) def jacobi(a,n): # print...
code_fim
hard
{ "lang": "python", "repo": "quantumFeline/algebra-hw", "path": "/Legendre_Jacobi.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> if functions.gcd(a, n) != 1: return 0 if a % 2 == 0: if n % 8 == 3 or n % 8 == 5: res *= -1 a //= 2 res *= (-1) ** ((n-1)//2) * (-1) ** ((a-1)//2) a, n = n % a, a if __name__ == "__main__": print(jacobi(13,13)) ...
code_fim
medium
{ "lang": "python", "repo": "quantumFeline/algebra-hw", "path": "/Legendre_Jacobi.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> conexion de eventos con los objetos estamos conectando el código con la interfaz gráfico botones formulario cliente ''' var.ui.btnSalir.clicked.connect(events.Eventos.Salir) var.ui.btnCalendar.clicked.connect(clients.Clientes.abrirCalendar) ...
code_fim
hard
{ "lang": "python", "repo": "scollboul/COLLAZOBOULLOSA", "path": "/main.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: scollboul/COLLAZOBOULLOSA path: /main.py from PyQt5 import QtWidgets, QtGui, QtCore, QtPrintSupport from ventana import * from vensalir import * from vencalendar import * from datetime import datetime, date import sys, var, events, clients, conexion, printer, Products, ventas, provider class Dia...
code_fim
hard
{ "lang": "python", "repo": "scollboul/COLLAZOBOULLOSA", "path": "/main.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> Botones proveedores """ var.ui.btnAltaProv.clicked.connect(provider.Provider.altaProveedor) var.ui.TableProveedores.clicked.connect(provider.Provider.cargarProd) var.ui.TableProveedores.setSelectionBehavior(QtWidgets.QTableWidget.SelectRows) var.ui....
code_fim
hard
{ "lang": "python", "repo": "scollboul/COLLAZOBOULLOSA", "path": "/main.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: jackm1123/offgroundshousing path: /listings/admin.py from django.contrib import admin from .models import Listing,Listing_Image,Review <|fim_suffix|> # class Listing_ImageInline(admin.TabularInline): # model = Listing_Image # extra = 3 # # class ListingAdmin(admin.ModelAdmin): # inl...
code_fim
medium
{ "lang": "python", "repo": "jackm1123/offgroundshousing", "path": "/listings/admin.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|># class Listing_ImageInline(admin.TabularInline): # model = Listing_Image # extra = 3 # # class ListingAdmin(admin.ModelAdmin): # inlines = [ Listing_ImageInline, ]<|fim_prefix|># repo: jackm1123/offgroundshousing path: /listings/admin.py from django.contrib import admin from .models import ...
code_fim
medium
{ "lang": "python", "repo": "jackm1123/offgroundshousing", "path": "/listings/admin.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|># repo: rtapadar/designate path: /functionaltests/api/v2/test_zone.py """ Copyright 2015 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/...
code_fim
hard
{ "lang": "python", "repo": "rtapadar/designate", "path": "/functionaltests/api/v2/test_zone.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> resp, model = ZoneClient.as_user(user).post_zone(zone_model) self.assertEqual(resp.status, 202) ZoneClient.as_user(user).wait_for_zone(model.id) return resp, model def test_no_create_duplicate_domain(self): zone = datagen.random_zone_data() self._create...
code_fim
hard
{ "lang": "python", "repo": "rtapadar/designate", "path": "/functionaltests/api/v2/test_zone.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def test_no_create_subdomain_by_alt_user(self): zone = datagen.random_zone_data() subzone = datagen.random_zone_data(name='sub.' + zone.name) subsubzone = datagen.random_zone_data(name='sub.sub.' + zone.name) self._create_zone(zone, user='default') self.assertRa...
code_fim
hard
{ "lang": "python", "repo": "rtapadar/designate", "path": "/functionaltests/api/v2/test_zone.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: mcooper52590/RadioAstronomy path: /Homework3/HW3-Problem3.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Feb 9 16:01:22 2019 @author: mattcooper """ import numpy as np import matplotlib.pyplot as plt u = 1.661e-27 k = 1.38e-23 c = 3e8 m_He = 4.003*u m_C = 12.0107*u m_P ...
code_fim
hard
{ "lang": "python", "repo": "mcooper52590/RadioAstronomy", "path": "/Homework3/HW3-Problem3.py", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> flag = False while flag == False: M = (A + B)/2 func_A = FUNC(A, *args) func_B = FUNC(B, *args) func_M = FUNC(M, *args) if B - M < ERR: print('Error reached') return M if func_A == func_B: print('Bisection...
code_fim
hard
{ "lang": "python", "repo": "mcooper52590/RadioAstronomy", "path": "/Homework3/HW3-Problem3.py", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }