text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_prefix|># repo: damianbeles/Snake-Versus path: /player.py import pygame from utils import Entity class Player: KEYS = {pygame.K_a: "a", pygame.K_b: "b", pygame.K_c: "c", pygame.K_d: "d", pygame.K_e: "e", pygame.K_f: "f", pygame.K_g: "g", pygame.K_h: "h", pygame.K_i: "i", pygame.K_j: "j", pyga...
code_fim
hard
{ "lang": "python", "repo": "damianbeles/Snake-Versus", "path": "/player.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>entre {} e {} é {}'.format(n1, n2, media))<|fim_prefix|># repo: brunocorbetta/exerciciocursoemvideo path: /ex007.py n1 = float(input('Primeira nota do aluno: ')) n2 = float(input('Segunda nota do alun<|fim_middle|>o: ')) media = (n1+n2) / 2 print('A media
code_fim
easy
{ "lang": "python", "repo": "brunocorbetta/exerciciocursoemvideo", "path": "/ex007.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: brunocorbetta/exerciciocursoemvideo path: /ex007.py n1 = float(input('Primeira nota do aluno: ')) n2 = float(input('Segunda nota do alun<|fim_suffix|>entre {} e {} é {}'.format(n1, n2, media))<|fim_middle|>o: ')) media = (n1+n2) / 2 print('A media
code_fim
easy
{ "lang": "python", "repo": "brunocorbetta/exerciciocursoemvideo", "path": "/ex007.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> assert self.is_string_in_url_present(LoginPageLocators.LOGIN_PAGE_URL), "URL do not contain 'login' string." def basket_is_empty_message_present(self): print(self.browser.find_element(*BasketPageLocators.BASKET_IS_EMPTY_MESSAGE).text) assert self.browser.find_element(*BasketPa...
code_fim
hard
{ "lang": "python", "repo": "victorkaplunov/PageObject", "path": "/pages/base_page.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: victorkaplunov/PageObject path: /pages/base_page.py import math from selenium.common.exceptions import NoAlertPresentException from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverW...
code_fim
hard
{ "lang": "python", "repo": "victorkaplunov/PageObject", "path": "/pages/base_page.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: EPgg92/solat path: /tree_model/scr.py import os for x in range(1,10): print('clean tmp') os.system('bash cleantmp.sh') print(x) print('python generateFeatures.py {}'.format(x)) os.<|fim_suffix|>odyId.py {}'.format(x)) os.system('python xgb_train_cvBodyId.py {}'.format(x))<...
code_fim
medium
{ "lang": "python", "repo": "EPgg92/solat", "path": "/tree_model/scr.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>system('python generateFeatures.py {}'.format(x)) print('python xgb_train_cvBodyId.py {}'.format(x)) os.system('python xgb_train_cvBodyId.py {}'.format(x))<|fim_prefix|># repo: EPgg92/solat path: /tree_model/scr.py import os for x in range(1,10): print('clean tmp') os.system('bash cleant<...
code_fim
medium
{ "lang": "python", "repo": "EPgg92/solat", "path": "/tree_model/scr.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>admin.site.register(Product, ProductModelAdmin) admin.site.register(Product_Varients, Product_VarientsModelAdmin) admin.site.register(Sno, SnoModelAdmin)<|fim_prefix|># repo: smi96/django_clothsize_filter path: /shirts/shirt/admin.py from django.contrib import admin # Register your models here. from shi...
code_fim
hard
{ "lang": "python", "repo": "smi96/django_clothsize_filter", "path": "/shirts/shirt/admin.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: smi96/django_clothsize_filter path: /shirts/shirt/admin.py from django.contrib import admin # Register your models here. from shirt.models import Product, Product_Varients, Sno class ProductModelAdmin(admin.ModelAdmin): <|fim_suffix|> model = Product class Product_VarientsModelAdmin(admin.Mo...
code_fim
hard
{ "lang": "python", "repo": "smi96/django_clothsize_filter", "path": "/shirts/shirt/admin.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Returns ------- fout : ndarray - (n, ) vector field of given nonliner dynamical system with state feedback input """ fout = self.dynamicsf(x,p)+dEf(x,p) return fout def rk4(self,x,p,dEf,fun): """ Compute state a...
code_fim
hard
{ "lang": "python", "repo": "AstroHiro/ncm", "path": "/classncm.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: AstroHiro/ncm path: /classncm.py dimension Afun : function - ndarray (n,n_p) -> (n,n) Jacobian of dynamicsf (can be set to state-dependent coefficient matrix A s.t. f(x) = A(x)x, see the CV-STEM paper for details) Cfun : function - ndarray (n,n_p) -> (n,m)...
code_fim
hard
{ "lang": "python", "repo": "AstroHiro/ncm", "path": "/classncm.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Returns ------- fout : ndarray - (n, ) vector field of given nonliner dynamical system with state feedback input """ fout = self.dynamicsf(x,p)+dEf(x,p) return fout def rk4(self,x,p,dEf,fun): """ Compute state at...
code_fim
hard
{ "lang": "python", "repo": "AstroHiro/ncm", "path": "/classncm.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|># remove all the accents for i in range(len(scores)): scores.LastName[i] = unidecode(unicode(scores.LastName[i])) scores.FirstName[i] = unidecode(unicode(scores.FirstName[i])) scores.to_csv("Score_no_accent.csv")<|fim_prefix|># repo: Huade/BipartisanIndex path: /Data/no_accent.py # coding: utf-...
code_fim
easy
{ "lang": "python", "repo": "Huade/BipartisanIndex", "path": "/Data/no_accent.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Huade/BipartisanIndex path: /Data/no_accent.py # coding: utf-8 # In[3]: from unidecode import unidecode import pandas as pd scores = pd.read_csv("Score.csv") <|fim_suffix|>scores.to_csv("Score_no_accent.csv")<|fim_middle|># remove all the accents for i in range(len(scores)): scores.LastN...
code_fim
medium
{ "lang": "python", "repo": "Huade/BipartisanIndex", "path": "/Data/no_accent.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>scores.to_csv("Score_no_accent.csv")<|fim_prefix|># repo: Huade/BipartisanIndex path: /Data/no_accent.py # coding: utf-8 # In[3]: from unidecode import unidecode import pandas as pd <|fim_middle|>scores = pd.read_csv("Score.csv") # remove all the accents for i in range(len(scores)): scores.LastN...
code_fim
hard
{ "lang": "python", "repo": "Huade/BipartisanIndex", "path": "/Data/no_accent.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>angle = 0 for i in range(frames): newPage(side, side) frameDuration(1/24) fill(0) rect(0, 0, side, side) shapes(angle) angle += turn/frames saveImage('~/Desktop/34_36_DAYS_OF_TYPE_2020.mp4')<|fim_prefix|># repo: eduairet/eat36daysOfType2020 path: /34_36_DAYS_OF_TYPE_2020...
code_fim
hard
{ "lang": "python", "repo": "eduairet/eat36daysOfType2020", "path": "/34_36_DAYS_OF_TYPE_2020.py", "mode": "spm", "license": "CC0-1.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: eduairet/eat36daysOfType2020 path: /34_36_DAYS_OF_TYPE_2020.py side = 1080 frames = 48 turn = 360 def shapes(angle): fill(0, 1, 0.5) stroke(0, 1, 0.5) strokeWidth(0.1) def shape1(angle): <|fim_suffix|>angle = 0 for i in range(frames): newPage(side, side) frameDuration(1/2...
code_fim
hard
{ "lang": "python", "repo": "eduairet/eat36daysOfType2020", "path": "/34_36_DAYS_OF_TYPE_2020.py", "mode": "psm", "license": "CC0-1.0", "source": "the-stack-v2" }
<|fim_suffix|>def construct_target(trainSamples): """ given trainSamples, return a list of targets """ feature_names = ["click_bool", "booking_bool","position"] samples = trainSamples[feature_names].values def f(vec): x, y, z = vec return y + 0.2 * x return [f(vec...
code_fim
hard
{ "lang": "python", "repo": "jiecaoc/kaggle", "path": "/hotel_search/src/utilities.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: jiecaoc/kaggle path: /hotel_search/src/utilities.py # -*- coding: utf-8 -*- """ Created on Sat Nov 30 11:25:54 2013 @author: jiecaoc """ def preprocess(trainSample): """ pre-process the trainSample given trainSample return a list of features """ feature_names...
code_fim
hard
{ "lang": "python", "repo": "jiecaoc/kaggle", "path": "/hotel_search/src/utilities.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> """ given trainSamples, return a list of targets """ feature_names = ["click_bool", "booking_bool","position"] samples = trainSamples[feature_names].values def f(vec): x, y, z = vec return y + 0.2 * x return [f(vec) for vec in samples]<|fim_prefix|>#...
code_fim
hard
{ "lang": "python", "repo": "jiecaoc/kaggle", "path": "/hotel_search/src/utilities.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> # gromacs preprocessing & MD gmx grompp %(grompp_options)s %(ndxfile_options)s -f %(mdpfile_name)s -c $tmpstartgro -p %(topfile_name)s -o %(tprfile_name)s gmx mdrun -nt %(size)s %(mdrun_options)s -s %(tprfile_name)s -o %(trrfile_name)s -e %(edrfile_name)s #...
code_fim
hard
{ "lang": "python", "repo": "radical-cybertools/ExTASY", "path": "/examples/grlsd-on-stampede/helper_scripts/run.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: radical-cybertools/ExTASY path: /examples/grlsd-on-stampede/helper_scripts/run.py __author__ = 'vivek' ''' Purpose : This file is executed by each of the compute units in the simulation stage. Uses the arguments to create a bash script which is executed on the remote ma...
code_fim
hard
{ "lang": "python", "repo": "radical-cybertools/ExTASY", "path": "/examples/grlsd-on-stampede/helper_scripts/run.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>GENFILE = "generated_file.txt" ##==============================================================# ## SECTION: Function Definitions # ##==============================================================# def gen_file(): with open(GENFILE, "w") as fo: fo.write("just a...
code_fim
medium
{ "lang": "python", "repo": "jeffrimko/Qprompt", "path": "/tests/menu_helper_1.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == '__main__': menu = qprompt.Menu() menu.add("g", "Generate file", gen_file) menu.add("d", "Delete file", del_file) menu.main(loop=True)<|fim_prefix|># repo: jeffrimko/Qprompt path: /tests/menu_helper_1.py ##==============================================================# ## S...
code_fim
hard
{ "lang": "python", "repo": "jeffrimko/Qprompt", "path": "/tests/menu_helper_1.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jeffrimko/Qprompt path: /tests/menu_helper_1.py ##==============================================================# ## SECTION: Imports # ##==============================================================# from testlib import * import qprompt ##==========...
code_fim
medium
{ "lang": "python", "repo": "jeffrimko/Qprompt", "path": "/tests/menu_helper_1.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: signalfx/signalfx-agent path: /tests/monitors/windows_iis/windowsiis_test.py import sys import pytest from tests.helpers.assertions import http_status from tests.helpers.metadata import Metadata from tests.helpers.verify import run_agent_verify_default_metrics, run_agent_verify_all_metrics pyt...
code_fim
medium
{ "lang": "python", "repo": "signalfx/signalfx-agent", "path": "/tests/monitors/windows_iis/windowsiis_test.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def test_windowsiis_all(): # Required to make sure a worker (w3wp process) has started for process metrics. assert http_status("http://localhost", [200]), "IIS should be running on localhost" run_agent_verify_all_metrics( """ monitors: - type: windows-iis ex...
code_fim
hard
{ "lang": "python", "repo": "signalfx/signalfx-agent", "path": "/tests/monitors/windows_iis/windowsiis_test.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>class UDPMeasurementEventHandler(socketserver.DatagramRequestHandler): def handle(self): udp_payload=self.request[0].strip().decode() ip_address=self.client_address[0] log.info(ip_address+":"+udp_payload) # measurements=serializer.udp_msg_to_measurements(udp_payload) ...
code_fim
medium
{ "lang": "python", "repo": "andrewwgordon/robot_telemetry_service", "path": "/robottelemetryservice/infrastructure/udp/udp_measurement_event_handler.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: andrewwgordon/robot_telemetry_service path: /robottelemetryservice/infrastructure/udp/udp_measurement_event_handler.py import logging import socketserver import threading from robottelemetryservice.infrastructure.serialisation import serializer from robottelemetryservice.infrastructure.configurat...
code_fim
medium
{ "lang": "python", "repo": "andrewwgordon/robot_telemetry_service", "path": "/robottelemetryservice/infrastructure/udp/udp_measurement_event_handler.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Stella2019/UD513_Intro_to_DS_and_Algo path: /L3_Searching and sorting/Quiz_BinarySearch_practice.py """You're going to write a binary search function. You should use an iterative approach - meaning using loops. Your function should take two inputs: a Python list to search through, and the value y...
code_fim
medium
{ "lang": "python", "repo": "Stella2019/UD513_Intro_to_DS_and_Algo", "path": "/L3_Searching and sorting/Quiz_BinarySearch_practice.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return -1 test_list = [1,3,9,11,15,19,29] test_val1 = 25 test_val2 = 15 print ( binary_search(test_list, test_val1) ) print ( binary_search(test_list, test_val2) )<|fim_prefix|># repo: Stella2019/UD513_Intro_to_DS_and_Algo path: /L3_Searching and sorting/Quiz_BinarySearch_practice.py """You're ...
code_fim
hard
{ "lang": "python", "repo": "Stella2019/UD513_Intro_to_DS_and_Algo", "path": "/L3_Searching and sorting/Quiz_BinarySearch_practice.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ZhuoZhuoCrayon/AcousticKeyBoard-Web path: /apps/keyboard/core/mfcc/mfcc.py import math import numpy as np from scipy.signal import lfilter from apps.keyboard.core.mfcc import trifbank, vec2frames def nextpow2(n): return np.ceil(np.log2(np.abs(n))).astype("long") # function [CC, FBE, fra...
code_fim
hard
{ "lang": "python", "repo": "ZhuoZhuoCrayon/AcousticKeyBoard-Web", "path": "/apps/keyboard/core/mfcc/mfcc.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # % Explode samples to the range of 16 bit shorts if np.abs(speech).max(0) <= 1: speech = speech * (pow(2, 15)) Nw = round(1e-3 * Tw * fs) Ns = round(1e-3 * Ts * fs) nfft = pow(2, nextpow2(Nw)) K = nfft / 2 + 1 def hz2mel(hz): """hz2mel = @(hz)(1127 * log(1 +...
code_fim
medium
{ "lang": "python", "repo": "ZhuoZhuoCrayon/AcousticKeyBoard-Web", "path": "/apps/keyboard/core/mfcc/mfcc.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def ceplifter(N, L): """1 + 0.5 * L * sin(pi * [0:N - 1] / L)""" return 1 + 0.5 * L * np.sin(np.pi * np.arange(N) / L) # speech = filter([1, -alpha], 1, speech); speech = lfilter([1, -alpha], 1, speech) frames = vec2frames.vec2frames(speech, Nw, Ns, "cols", window, False)...
code_fim
hard
{ "lang": "python", "repo": "ZhuoZhuoCrayon/AcousticKeyBoard-Web", "path": "/apps/keyboard/core/mfcc/mfcc.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ''' http://127.0.0.1:8000/app4/getteachCourse?tno=101 ''' tid=request.GET.get("tno") result=TeachPlan.objects.values("teacher__tno","teacher__tname","course__cname","department__dname").filter(teacher__tno=tid) return showJsonresult(result)<|fim_prefix|># repo: Vanessa-kriby/Python...
code_fim
easy
{ "lang": "python", "repo": "Vanessa-kriby/Python", "path": "/day08/django/app4/dateview/getteachCourse.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: Vanessa-kriby/Python path: /day08/django/app4/dateview/getteachCourse.py from app1.models import * from app1.util.utils import * <|fim_suffix|> ''' http://127.0.0.1:8000/app4/getteachCourse?tno=101 ''' tid=request.GET.get("tno") result=TeachPlan.objects.values("teacher__tno","...
code_fim
easy
{ "lang": "python", "repo": "Vanessa-kriby/Python", "path": "/day08/django/app4/dateview/getteachCourse.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: Kennedy-Lab-UW/Duplex-Seq-Pipeline path: /scripts/mergeSubImages.py from argparse import ArgumentParser import math from PIL import Image def main(): parser = ArgumentParser() parser.add_argument("inBed"), parser.add_argument("inPrefix") o = parser.parse_args() <|fim_suffix|> ...
code_fim
medium
{ "lang": "python", "repo": "Kennedy-Lab-UW/Duplex-Seq-Pipeline", "path": "/scripts/mergeSubImages.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> inBed = open(o.inBed, 'r') numLines = 0. for line in inBed: if line.strip() != "": numLines += 1 numImages = math.ceil(numLines / bedLinesPerImage) firstImage = Image.open(f"{o.inPrefix}.1.targetCoverage.png") imageStart = 0 my_images = [] totalSize = 0 ...
code_fim
medium
{ "lang": "python", "repo": "Kennedy-Lab-UW/Duplex-Seq-Pipeline", "path": "/scripts/mergeSubImages.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: cnukaus/footprint-analytics path: /footprint_airflow/dags/utils/variables.py from datetime import datetime from airflow.models import Variable def read_dag_var(var_prefix, **kwargs): <|fim_suffix|> full_var_name = f'{var_prefix}{var_name}' if var_prefix is not None else var_name var = V...
code_fim
medium
{ "lang": "python", "repo": "cnukaus/footprint-analytics", "path": "/footprint_airflow/dags/utils/variables.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if isinstance(bool_string, bool): return bool_string if bool_string is None or len(bool_string) == 0: return default else: return bool_string.lower() in ["true", "yes"] def parse_int(val): if val is None: return None return int(val)<|fim_prefix|># repo...
code_fim
hard
{ "lang": "python", "repo": "cnukaus/footprint-analytics", "path": "/footprint_airflow/dags/utils/variables.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> phone = models.CharField( help_text=_("Número de telefone. Preencha apenas com números."), verbose_name=_("Número de Telefone"), max_length=15, null=False, blank=False) class Meta: verbose_name = _('Número de telefone') verbose_name_plural = _('Números de t...
code_fim
medium
{ "lang": "python", "repo": "Ache-Um-Pet/web", "path": "/users/models.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def __str__(self): return self.phone class PetUser(User): """Docstring for PetUser""" phone_numbers = models.ManyToManyField(PhoneNumber) class Meta: verbose_name = _('Usuário') verbose_name_plural = _('Usuários') def __str__(self): return (self.firs...
code_fim
medium
{ "lang": "python", "repo": "Ache-Um-Pet/web", "path": "/users/models.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Ache-Um-Pet/web path: /users/models.py from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ class PhoneNumber(models.Model): """Docstring for PhoneNumber""" phone = models.CharField( help_text=_("Número...
code_fim
medium
{ "lang": "python", "repo": "Ache-Um-Pet/web", "path": "/users/models.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: wyaadarsh/LeetCode-Solutions path: /Python3/0982-Triples-With-Bitwise-AND-Equal-to-Zero/soln-1.py class Solution: def countTriplets(self, A: List[int]) -> int: # 1 <= len(A) <= 1000<|fim_suffix|>irs[a & b] += 1 ans = 0 for num in A: for p, cnt in enumerate(...
code_fim
hard
{ "lang": "python", "repo": "wyaadarsh/LeetCode-Solutions", "path": "/Python3/0982-Triples-With-Bitwise-AND-Equal-to-Zero/soln-1.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>): if cnt and (num & p) == 0: ans += cnt return ans<|fim_prefix|># repo: wyaadarsh/LeetCode-Solutions path: /Python3/0982-Triples-With-Bitwise-AND-Equal-to-Zero/soln-1.py class Solution: def countTriplets(self, A: List[int]) -> int: # 1 <= len(A) <=...
code_fim
hard
{ "lang": "python", "repo": "wyaadarsh/LeetCode-Solutions", "path": "/Python3/0982-Triples-With-Bitwise-AND-Equal-to-Zero/soln-1.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>irs[a & b] += 1 ans = 0 for num in A: for p, cnt in enumerate(pairs): if cnt and (num & p) == 0: ans += cnt return ans<|fim_prefix|># repo: wyaadarsh/LeetCode-Solutions path: /Python3/0982-Triples-With-Bitwise-AND-Equal-to-Zero/soln-...
code_fim
hard
{ "lang": "python", "repo": "wyaadarsh/LeetCode-Solutions", "path": "/Python3/0982-Triples-With-Bitwise-AND-Equal-to-Zero/soln-1.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: yoniLavi/Open-Knesset path: /suggestions/models.py from datetime import datetime import json from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db import models from django.utils.trans...
code_fim
hard
{ "lang": "python", "repo": "yoniLavi/Open-Knesset", "path": "/suggestions/models.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> return subject def do_create(self, subject): """Create a new instance. we don't care about prev subjects, as we're creating a new one """ model = self.subject_type.model_class() subject = model.objects.create(**dict(self.action_params)) return...
code_fim
hard
{ "lang": "python", "repo": "yoniLavi/Open-Knesset", "path": "/suggestions/models.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: Fadi88/AoC path: /2022/day20/code.py from time import time as perf_counter def profiler(method): def wrapper_method(*arg, **kw): t = perf_counter() ret = method(*arg, **kw) print('Method ' + method.__name__ + ' took : ' + "{:2.5f}".format(perf_counter()...
code_fim
hard
{ "lang": "python", "repo": "Fadi88/AoC", "path": "/2022/day20/code.py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> buffer = [(idx, i) for idx, i in enumerate(input)] for _ in range(10): for idx, i in enumerate(input): old_idx = buffer.index((idx, i)) buffer.remove((idx, i)) buffer.insert((old_idx + i + len(input) - 1) % (len(input) - 1), (...
code_fim
medium
{ "lang": "python", "repo": "Fadi88/AoC", "path": "/2022/day20/code.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> return self._rate @rate.setter def rate(self, value): self._rate = value def to_alipay_dict(self): params = dict() if self.activity_type: if hasattr(self.activity_type, 'to_alipay_dict'): params['activity_type'] = self.activity_typ...
code_fim
hard
{ "lang": "python", "repo": "alipay/alipay-sdk-python-all", "path": "/alipay/aop/api/domain/ActivityMerchantOrder.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: alipay/alipay-sdk-python-all path: /alipay/aop/api/domain/ActivityMerchantOrder.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class ActivityMerchantOrder(object): def __init__(self): self._activity_type = None ...
code_fim
hard
{ "lang": "python", "repo": "alipay/alipay-sdk-python-all", "path": "/alipay/aop/api/domain/ActivityMerchantOrder.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('spraying', '0001_initial'), ] operations = [ migrations.AlterField( model_name='chemusedinspray', name='rate_units', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='measures.Rate...
code_fim
medium
{ "lang": "python", "repo": "emmakschu/greensManagerDjango", "path": "/spraying/migrations/0002_auto_20180504_0956.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: emmakschu/greensManagerDjango path: /spraying/migrations/0002_auto_20180504_0956.py # -*- coding: utf-8 -*- # Generated by Django 1.11.12 on 2018-05-04 14:56 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrat...
code_fim
medium
{ "lang": "python", "repo": "emmakschu/greensManagerDjango", "path": "/spraying/migrations/0002_auto_20180504_0956.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> operations = [ migrations.AlterField( model_name='chemusedinspray', name='rate_units', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='measures.RateUnit'), ), migrations.AlterField( model...
code_fim
medium
{ "lang": "python", "repo": "emmakschu/greensManagerDjango", "path": "/spraying/migrations/0002_auto_20180504_0956.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: dreamkeep/TiKick path: /tmarl/configs/config.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2021 The TARTRL Authors. # # 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 ...
code_fim
hard
{ "lang": "python", "repo": "dreamkeep/TiKick", "path": "/tmarl/configs/config.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # optimizer parameters parser.add_argument("--lr", type=float, default=5e-4, help='learning rate (default: 5e-4)') parser.add_argument("--tau", type=float, default=0.995, help='soft update polyak (default: 0.995)') parser.add_argument("--crit...
code_fim
hard
{ "lang": "python", "repo": "dreamkeep/TiKick", "path": "/tmarl/configs/config.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # replay buffer parameters parser.add_argument("--episode_length", type=int, default=200, help="Max length for any episode") # network parameters parser.add_argument("--separate_policy", action='store_true', default=False, help='Whether agen...
code_fim
hard
{ "lang": "python", "repo": "dreamkeep/TiKick", "path": "/tmarl/configs/config.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> Talker('robot1') r = Robot('blackboard','robot1',1,1,1,1,5,10,10,bat,'robot1',talker) rospy.spin()<|fim_prefix|># repo: fontysrobotics/Blackboard_based_distributed_fleet_manager path: /catkin_ws/bbinstance/src/bbinstance/robotInstance.py #!/usr/bin/env python #need to point to classes inorder to ...
code_fim
medium
{ "lang": "python", "repo": "fontysrobotics/Blackboard_based_distributed_fleet_manager", "path": "/catkin_ws/bbinstance/src/bbinstance/robotInstance.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: fontysrobotics/Blackboard_based_distributed_fleet_manager path: /catkin_ws/bbinstance/src/bbinstance/robotInstance.py #!/usr/bin/env python #need to point to classes inorder to import import rospy from blackboard.Robot impo<|fim_suffix|> Talker('robot1') r = Robot('blackboard','robot1',1,1,1,1,5,...
code_fim
hard
{ "lang": "python", "repo": "fontysrobotics/Blackboard_based_distributed_fleet_manager", "path": "/catkin_ws/bbinstance/src/bbinstance/robotInstance.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self,): _MAID.__init__(self) self.name = "MAIDS" self.specie = 'nouns' self.basic = "maid" self.jsondata = {}<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/nouns/_maids.py from xai.brain.wordbase.nouns._maid import _MAID <|fim_middle|>#calss header class _MAIDS(_...
code_fim
easy
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/nouns/_maids.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/nouns/_maids.py from xai.brain.wordbase.nouns._maid import _MAID <|fim_suffix|> def __init__(self,): _MAID.__init__(self) self.name = "MAIDS" self.specie = 'nouns' self.basic = "maid" self.jsondata = {}<|fim_middle|>#calss header class _MAIDS(_...
code_fim
easy
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/nouns/_maids.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>) next=f1+f2 f1=f2 f2=next<|fim_prefix|># repo: Codechef-SRM-NCR-Chapter/30-DaysOfCode-March-2021 path: /answers/Khushi/Day 5/Question 1.py #Print first 50 terms of Fibonacci Series: f1=0 f2=1 print(f1,end=" ") for x<|fim_middle|> in range (1,50): print(f2,end=" "
code_fim
easy
{ "lang": "python", "repo": "Codechef-SRM-NCR-Chapter/30-DaysOfCode-March-2021", "path": "/answers/Khushi/Day 5/Question 1.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Codechef-SRM-NCR-Chapter/30-DaysOfCode-March-2021 path: /answers/Khushi/Day 5/Question 1.py #Print first 50 terms of Fibonacci Ser<|fim_suffix|> in range (1,50): print(f2,end=" ") next=f1+f2 f1=f2 f2=next<|fim_middle|>ies: f1=0 f2=1 print(f1,end=" ") for x
code_fim
easy
{ "lang": "python", "repo": "Codechef-SRM-NCR-Chapter/30-DaysOfCode-March-2021", "path": "/answers/Khushi/Day 5/Question 1.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jthistle/wiskesynth path: /sf_test.py from wiske import Synthesizer, EventNoteOn, EventNoteOff NOTE = 50 synth = Synthesizer() synth.load_soundfont("/home/james/Downloads/GeneralUserGS/GeneralUserGS.sf2") # synth.load_soundfont("/home/james/Documents/MuseScore3Development/SoundFonts/MuseScore...
code_fim
medium
{ "lang": "python", "repo": "jthistle/wiskesynth", "path": "/sf_test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>for note in NOTES: inst.send_event(EventNoteOff(note + PITCH)) input() synth.halt()<|fim_prefix|># repo: jthistle/wiskesynth path: /sf_test.py from wiske import Synthesizer, EventNoteOn, EventNoteOff NOTE = 50 synth = Synthesizer() synth.load_soundfont("/home/james/Downloads/GeneralUserGS/Genera...
code_fim
hard
{ "lang": "python", "repo": "jthistle/wiskesynth", "path": "/sf_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>input() for note in NOTES: inst.send_event(EventNoteOn(note + PITCH, 100)) input() for note in NOTES: inst.send_event(EventNoteOff(note + PITCH)) input() synth.halt()<|fim_prefix|># repo: jthistle/wiskesynth path: /sf_test.py from wiske import Synthesizer, EventNoteOn, EventNoteOff NOTE = 50...
code_fim
medium
{ "lang": "python", "repo": "jthistle/wiskesynth", "path": "/sf_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @commands.command(name='image', aliases=['i', 'img'], help="Queries DuckDuckGo and returns the first image result") async def image_search(self, ctx, *args): try: async with ctx.typing(): result = ddg_image_search(args) embed = Embed( ...
code_fim
hard
{ "lang": "python", "repo": "xcdmcode/xcdmbot", "path": "/cogs/search.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: xcdmcode/xcdmbot path: /cogs/search.py import discord from discord import Colour, Embed from discord.ext import commands import requests import traceback from bs4 import BeautifulSoup import json import re import brotli # Scrapes the DDG search results page and returns a list of 5 tuples contain...
code_fim
hard
{ "lang": "python", "repo": "xcdmcode/xcdmbot", "path": "/cogs/search.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> #example on how to query your Schema from sqlalchemy.orm import sessionmaker session = sessionmaker(bind=engine)() objs = session.query(Affiliate).all() print 'All Affiliate objects: %s'%objs<|fim_prefix|># repo: metaperl/freegold-focus path: /saorm-test.py from sqlalchemy import create_engine <|fim_m...
code_fim
medium
{ "lang": "python", "repo": "metaperl/freegold-focus", "path": "/saorm-test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>engine = create_engine( 'mysql+pymysql://root:m0ney123@localhost/focus', echo=True ) #example on how to query your Schema from sqlalchemy.orm import sessionmaker session = sessionmaker(bind=engine)() objs = session.query(Affiliate).all() print 'All Affiliate objects: %s'%objs<|fim_prefix|># repo...
code_fim
easy
{ "lang": "python", "repo": "metaperl/freegold-focus", "path": "/saorm-test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: metaperl/freegold-focus path: /saorm-test.py from sqlalchemy import create_engine <|fim_suffix|>engine = create_engine( 'mysql+pymysql://root:m0ney123@localhost/focus', echo=True ) #example on how to query your Schema from sqlalchemy.orm import sessionmaker session = sessionmaker(bind...
code_fim
easy
{ "lang": "python", "repo": "metaperl/freegold-focus", "path": "/saorm-test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: sunilsm7/django_resto path: /restaurants/migrations/0005_auto_20170725_1149.py # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-25 06:19 from __future__ import unicode_literals from django.db import migrations <|fim_suffix|> operations = [ migrations.AlterModelOptions...
code_fim
medium
{ "lang": "python", "repo": "sunilsm7/django_resto", "path": "/restaurants/migrations/0005_auto_20170725_1149.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('restaurants', '0004_auto_20170725_1146'), ] operations = [ migrations.AlterModelOptions( name='city', options={'verbose_name_plural': 'Restaurant City'}, ), migrations.AlterModelOptions( name='state', ...
code_fim
medium
{ "lang": "python", "repo": "sunilsm7/django_resto", "path": "/restaurants/migrations/0005_auto_20170725_1149.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: james4388/noahcar path: /autorc/tests/test_PWM.py import unittest import time from hardware import PCA9685 class PWMCase(unittest.TestCase): <|fim_suffix|> pwm = PCA9685.PWM() pwm.frequency = 60 for i in range(16): time.sleep(0.5) print('\nChannel...
code_fim
easy
{ "lang": "python", "repo": "james4388/noahcar", "path": "/autorc/tests/test_PWM.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_PWM(self): pwm = PCA9685.PWM() pwm.frequency = 60 for i in range(16): time.sleep(0.5) print('\nChannel %d\n' % i) time.sleep(0.5) for j in range(4096): pwm.write(i, 0, j) print('PWM value: ...
code_fim
easy
{ "lang": "python", "repo": "james4388/noahcar", "path": "/autorc/tests/test_PWM.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # pprint( generator_recipe ) # Parses a USGS mission recipe file and returns a generator useable JSON def parse_recipe( mission ): with open( mission + ".json", "r" ) as file: generator_recipe = { "mission": "", "tasks": [], "output": "" } ...
code_fim
hard
{ "lang": "python", "repo": "cschwirian/pds-airflow", "path": "/ui/flaskui/recipe_to_rest.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_prefix|># repo: cschwirian/pds-airflow path: /ui/flaskui/recipe_to_rest.py import json from pprint import pprint mission = "galileo_ssi_edr" with open( mission + ".json", "r" ) as file: generator_recipe = { "mission": "", "tasks": [], "output": "directory" } recipe = json.l...
code_fim
hard
{ "lang": "python", "repo": "cschwirian/pds-airflow", "path": "/ui/flaskui/recipe_to_rest.py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> task.append( parameters ) tasks.append( task ) # print() # print() # print( tasks ) generator_recipe["mission"] = mission generator_recipe["tasks"] = tasks # pprint( generator_recipe ) # Returns a JSON object useable by the UI def...
code_fim
hard
{ "lang": "python", "repo": "cschwirian/pds-airflow", "path": "/ui/flaskui/recipe_to_rest.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> last_result = None sql_index = 0 drop_result = {"model": [], "query_set": []} for sql in sql_list: sql_index = sql_index + 1 ddl_args = { "tags": self.tags, "sql_list": [sql], "component_type": self.com...
code_fim
hard
{ "lang": "python", "repo": "Tencent/bk-base", "path": "/src/api/dataflow/flow/handlers/modeling_controller.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Tencent/bk-base path: /src/api/dataflow/flow/handlers/modeling_controller.py # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is lic...
code_fim
hard
{ "lang": "python", "repo": "Tencent/bk-base", "path": "/src/api/dataflow/flow/handlers/modeling_controller.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # if element has one object child use data if exists and object is # not root class poss_objs = el.find_all("object", recursive=False) if len(poss_objs) == 1: poss_obj = poss_objs[0] if mf2_classes.root(poss_obj.get('class', [])) == []: prop_value = get_attr(pos...
code_fim
hard
{ "lang": "python", "repo": "kevinmarks/mentiontech", "path": "/mf2py/implied_properties.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: kevinmarks/mentiontech path: /mf2py/implied_properties.py from . import mf2_classes from .dom_helpers import get_attr import sys if sys.version < '3': from urlparse import urljoin else: from urllib.parse import urljoin def name(el): """Find an implied name property Args: ...
code_fim
hard
{ "lang": "python", "repo": "kevinmarks/mentiontech", "path": "/mf2py/implied_properties.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def _call_runner(self, path) -> List["MatchError"]: runner = Runner(self.collection, path) return runner.run() def run_playbook(self, playbook_text): """Lints received text as a playbook.""" with tempfile.NamedTemporaryFile(mode="w", suffix=".yml", prefix="playbook...
code_fim
hard
{ "lang": "python", "repo": "andrewimeson/ansible-lint", "path": "/lib/ansiblelint/testing/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: andrewimeson/ansible-lint path: /lib/ansiblelint/testing/__init__.py """Test utils for ansible-lint.""" import os import shutil import subprocess import sys import tempfile from typing import TYPE_CHECKING, Dict, List from ansible import __version__ as ansible_version_str from ansiblelint.runn...
code_fim
hard
{ "lang": "python", "repo": "andrewimeson/ansible-lint", "path": "/lib/ansiblelint/testing/__init__.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: JaySabido/dl-keras path: /chapter2/sgd-2-min-2.1.4.py ''' Author: Rowel Atienza Project: https://github.com/roatienza/dl-keras Dependency: keras 2.0 Usage: python3 <this file> ''' <|fim_suffix|>x = np.arange(-2.5, 2.5, 0.1) c = [1, -0.2, -5, 0, 4] d = [4, -0.6, -10, 0] y = np.polyval(c, x) z = n...
code_fim
medium
{ "lang": "python", "repo": "JaySabido/dl-keras", "path": "/chapter2/sgd-2-min-2.1.4.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>x = np.arange(-2.5, 2.5, 0.1) c = [1, -0.2, -5, 0, 4] d = [4, -0.6, -10, 0] y = np.polyval(c, x) z = np.polyval(d, x) plt.xlabel('x') plt.ylabel('y and dy/dx') plt.plot(x, y, label="y=x^4 -0.2x^3 -5x^2 +4") plt.plot(x, z, label="dy/dx ymin at x=-1.51 & 1.66") plt.legend(loc=0) plt.grid(b=True) plt.show() ...
code_fim
medium
{ "lang": "python", "repo": "JaySabido/dl-keras", "path": "/chapter2/sgd-2-min-2.1.4.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: nathanielbaxter/AlienPhaseGateUse path: /GenerateMod.py # -- This script generates the AlienPhaseGateUse mod. # Use this python script to regenerate (and then update) the mod # everytime the "ns2/lua/Alien.lua" file is updated by a new build. import sys import os import re # Modification consta...
code_fim
hard
{ "lang": "python", "repo": "nathanielbaxter/AlienPhaseGateUse", "path": "/GenerateMod.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|># Delete any old Alien.lua file. if os.path.exists("mod/lua/" + filename): os.remove("mod/lua/" + filename) # Delete any old if os.path.exists("mod/lua" + filename2): os.remove("mod/lua/" + filename2) # Open the files to read/write fread = open(sys.argv[1] + "/" + filename, 'r') fwrite = open("mod/...
code_fim
hard
{ "lang": "python", "repo": "nathanielbaxter/AlienPhaseGateUse", "path": "/GenerateMod.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: BirdmanTeamShootingStars/FlightSimulator path: /file_func.py import pandas as pd from State import * def trajectory2df(t_list, state_list, alpha_list): x_list = [] vx_list = [] y_list = [] vy_list = [] theta_list = [] for state in state_list: x_list.append(state.x...
code_fim
hard
{ "lang": "python", "repo": "BirdmanTeamShootingStars/FlightSimulator", "path": "/file_func.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> df = pd.read_csv(file_path) t_list = df['t'].values alpha_list = df['alpha'].values state_list = [] for i in range(len(t_list)): state_list.append(State(df['x'].values[i], df['vx'].values[i], df['y'].values[i], df['vy'].values[i], ...
code_fim
hard
{ "lang": "python", "repo": "BirdmanTeamShootingStars/FlightSimulator", "path": "/file_func.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @mark.parametrize( "launcher_name, overrides", [ ( "basic", [ "hydra/sweeper=basic", "hydra.sweeper.max_batch_size=2", ], ) ], ) class TestBasicSweeperWithBatching(BatchedSweeperTestSuite): ...<|fim_prefix...
code_fim
hard
{ "lang": "python", "repo": "facebookresearch/hydra", "path": "/tests/test_basic_launcher.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: facebookresearch/hydra path: /tests/test_basic_launcher.py # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from pytest import mark, param from hydra.test_utils.launcher_common_tests import ( BatchedSweeperTestSuite, IntegrationTestSuite, LauncherTestSuite, ) ...
code_fim
hard
{ "lang": "python", "repo": "facebookresearch/hydra", "path": "/tests/test_basic_launcher.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if self.y + pilka_wys >= display_height or self.y <= 0: self.kat = -self.kat def czy_przegrana(self, liczba_graczy, myfont, lose_sound, win_sound, gameDisplay): if self.x + pilka_sze >= display_width: pg.mixer.music.pause() # gameDisplay.fill(white...
code_fim
hard
{ "lang": "python", "repo": "mmazurek/gra_python", "path": "/classpong.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> mouse = pg.mouse.get_pos() if self.x < mouse[0] < self.x + self.szerokosc and self.y < mouse[1] < self.y + self.wysokosc: pg.draw.rect(gameDisplay, self.col_active, (self.x, self.y, self.szerokosc, self.wysokosc)) label = myfont_button.rend...
code_fim
hard
{ "lang": "python", "repo": "mmazurek/gra_python", "path": "/classpong.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: mmazurek/gra_python path: /classpong.py import pygame as pg import math import random import time display_width = 800 display_height = 600 black = (0, 0, 0) white = (255, 255, 255) red = (255, 0, 0) green = (0, 255, 0) kolor_active = (35, 21, 71) kolor_inactive = (17, 13, 29) pilka_wys = 40 p...
code_fim
hard
{ "lang": "python", "repo": "mmazurek/gra_python", "path": "/classpong.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> parser = argparse.ArgumentParser(description='Deploying Unets for Probability Mapping') parser.set_defaults(func=lambda _: parser.print_help()) parser.add_argument( '--img_file', required=True, help='Local image file' ) parser.add_argument( ...
code_fim
medium
{ "lang": "python", "repo": "aplbrain/saber", "path": "/saber/xbrain/unets/deploy_unet_docker.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: aplbrain/saber path: /saber/xbrain/unets/deploy_unet_docker.py """ Copyright 2018 The Johns Hopkins University Applied Physics Laboratory. 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 ...
code_fim
hard
{ "lang": "python", "repo": "aplbrain/saber", "path": "/saber/xbrain/unets/deploy_unet_docker.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> """Generate SQL DB disabled TDE event. Arguments: com (dict): SQL DB record `com` bucket ext (dict): SQL DB record `ext` bucket Returns: dict: An event record representing SQL DB with disabled TDE """ friendly_cloud_type = util.friendly_string(com.get('cloud_t...
code_fim
hard
{ "lang": "python", "repo": "TinLe/cloudmarker", "path": "/cloudmarker/events/azsqldatabasetdeevent.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: TinLe/cloudmarker path: /cloudmarker/events/azsqldatabasetdeevent.py """Microsoft Azure SQL DB Transparent Data Encryption (TDE) event. This module defines the :class:`AzSQLDatabaseTDEEvent` class that identifies if a SQL database has TDE disabled . This plugin works on the SQL DB properties fou...
code_fim
hard
{ "lang": "python", "repo": "TinLe/cloudmarker", "path": "/cloudmarker/events/azsqldatabasetdeevent.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }