text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|>def CheckChangeOnUpload(input_api, output_api): report = [] report.extend(_CommonChecks(input_api, output_api)) return report def CheckChangeOnCommit(input_api, output_api): report = [] report.extend(_CommonChecks(input_api, output_api)) return report<|fim_prefix|># repo: PDi-Communication-S...
code_fim
hard
{ "lang": "python", "repo": "PDi-Communication-Systems-Inc/lollipop_external_chromium_org", "path": "/tools/perf/PRESUBMIT.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self, data, titler=BoxedTitleDisplayer()): super().__init__(data) self.titler = titler def display(self): repo_info = self.data url = self.data['html_url'] owner = self.data['owner']['login'] comments = self.data['comments'] upd...
code_fim
hard
{ "lang": "python", "repo": "elunico/guppy", "path": "/gists_display.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def display(self): SingleGistDisplayObject(self.data).display() for (file, data) in self.data['files'].items(): putEntry(' Name', data['filename'], valueColor=magenta) putEntry(' Language', data['language']) putEntry(' Size', data['size']) ...
code_fim
hard
{ "lang": "python", "repo": "elunico/guppy", "path": "/gists_display.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: elunico/guppy path: /gists_display.py from utils import * from display import * from user_display import * from colors import * class UserGistsDisplayObjectFactory: @staticmethod def forGists(user, gists, gists_url): print(gists_url) if gists == 'all': putln(...
code_fim
hard
{ "lang": "python", "repo": "elunico/guppy", "path": "/gists_display.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: mlabouardy/swarm-mode-ui path: /docker.py import os import requests class Docker: WORKER = 'worker' MANAGER = 'manager' def __init__(self): self.URL = 'http://' + os.environ['SWARM_API'] def getServices(self): r = requests.get(self.URL + '/services') re...
code_fim
medium
{ "lang": "python", "repo": "mlabouardy/swarm-mode-ui", "path": "/docker.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> r = requests.get(self.URL + '/tasks/' + id) return r.json() def inspectNode(self, id): r = requests.get(self.URL + '/nodes/' + id) return r.json(); def getManagers(self): r = requests.get(self.URL + '/nodes') data = [] for node in r.json():...
code_fim
hard
{ "lang": "python", "repo": "mlabouardy/swarm-mode-ui", "path": "/docker.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: rakeshku93/nlpProjects path: /text_classification_with_pytorch/notebook/.ipynb_checkpoints/ctv_nb-checkpoint.py import pandas as pd from nltk.tokenize import word_tokenize from sklearn import naive_bayes from sklearn.feature_extraction.text import CountVectorizer <|fim_suffix|> x_train = cou...
code_fim
hard
{ "lang": "python", "repo": "rakeshku93/nlpProjects", "path": "/text_classification_with_pytorch/notebook/.ipynb_checkpoints/ctv_nb-checkpoint.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> count_vec = CountVectorizer(tokenizer=word_tokenize, token_pattern=None) count_vec.fit(df_train.review) x_train = count_vec.transform(df_train.review) x_valid = count_vec.transform(df_valid.review) model = naive_bayes.MultinomialNB() model.fit(x_train, df_t...
code_fim
medium
{ "lang": "python", "repo": "rakeshku93/nlpProjects", "path": "/text_classification_with_pytorch/notebook/.ipynb_checkpoints/ctv_nb-checkpoint.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: 4V4loon/HatSploit path: /hatsploit/modules/exploit/unix/linksys/wap54gv3_debug_rce.py #!/usr/bin/env python3 # # This module requires HatSploit: https://hatsploit.netlify.app # Current source: https://github.com/EntySec/HatSploit # import re from hatsploit.lib.module import Module from hatsplo...
code_fim
hard
{ "lang": "python", "repo": "4V4loon/HatSploit", "path": "/hatsploit/modules/exploit/unix/linksys/wap54gv3_debug_rce.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.output_process(f"Exploiting {remote_host}...") if not self.check(remote_host, remote_port): self.output_error("Exploit failed!") return if blinder.lower() in ['yes', 'y']: self.blinder( sender=self.exploit, ...
code_fim
hard
{ "lang": "python", "repo": "4V4loon/HatSploit", "path": "/hatsploit/modules/exploit/unix/linksys/wap54gv3_debug_rce.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: PacktPublishing/QGIS-Python-Programming-Cookbook-Second-Edition path: /Chapter05/B06246_05_32-coord.py # Creating a Mouse Coordinate Tracking Tool # https://github.com/GeospatialPython/Learn/raw/master/Mississippi.zip from qgis.gui import * from qgis.core import * from PyQt4.QtGui import * from...
code_fim
hard
{ "lang": "python", "repo": "PacktPublishing/QGIS-Python-Programming-Cookbook-Second-Edition", "path": "/Chapter05/B06246_05_32-coord.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if event.type() == QEvent.MouseMove: if event.buttons() == Qt.NoButton: pos = event.pos() x = pos.x() y = pos.y() p = self.canvas.getCoordinateTransform().toMapCoordinates(x, y) self.statusBar().showMessage...
code_fim
hard
{ "lang": "python", "repo": "PacktPublishing/QGIS-Python-Programming-Cookbook-Second-Edition", "path": "/Chapter05/B06246_05_32-coord.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: maciekmm/dokanki path: /dokanki/converter/test/test_gdocs.py import tempfile import shutil import unittest import dokanki.converter.gdocs class TestDocs(unittest.TestCase): docs_outliner = dokanki.converter.gdocs.GDocsConverter() def test_supports(self): <|fim_suffix|> def test_crea...
code_fim
hard
{ "lang": "python", "repo": "maciekmm/dokanki", "path": "/dokanki/converter/test/test_gdocs.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> temp_dir = tempfile.mkdtemp(prefix="dokanki-test") if temp_dir is None: self.skipTest("Can't create temp dir") return self.assertTrue(self.docs_outliner._unzip_entry("./docs.zip", temp_dir).endswith( "PBDOpracowaniepytazegzaminu2016i2017.html")) ...
code_fim
hard
{ "lang": "python", "repo": "maciekmm/dokanki", "path": "/dokanki/converter/test/test_gdocs.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Tivix/Django-parsley path: /parsley/mixins.py from parsley.decorators import parsleyfy <|fim_suffix|> class Media: js = ( "parsley/js/parsley-standalone.min.js", "parsley/js/parsley.django-admin.js", )<|fim_middle|> class ParsleyAdminMixin(object): ...
code_fim
medium
{ "lang": "python", "repo": "Tivix/Django-parsley", "path": "/parsley/mixins.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def get_form(self, *args, **kwargs): form = super(ParsleyAdminMixin, self).get_form(*args, **kwargs) return parsleyfy(form) class Media: js = ( "parsley/js/parsley-standalone.min.js", "parsley/js/parsley.django-admin.js", )<|fim_prefix|># r...
code_fim
easy
{ "lang": "python", "repo": "Tivix/Django-parsley", "path": "/parsley/mixins.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>,"!"]: result.append(w[0].upper() + w[1:]) first = False punc = False continue if punc and tpunc: result[-1] = w else: result.append(w) punc = tpunc return result def Sentence(): return ConstructSenten...
code_fim
medium
{ "lang": "python", "repo": "jvictor0/TiaraBoom", "path": "/tiara/sentence_gen.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jvictor0/TiaraBoom path: /tiara/sentence_gen.py from grammar import _sentence, _advice, _insult def ConstructSentence(phr): punc = False first = True result = [] for w in phr: tpunc =<|fim_suffix|> result[-1] = w else: result.append(w) pun...
code_fim
hard
{ "lang": "python", "repo": "jvictor0/TiaraBoom", "path": "/tiara/sentence_gen.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> result[-1] = w else: result.append(w) punc = tpunc return result def Sentence(): return ConstructSentence(_sentence())<|fim_prefix|># repo: jvictor0/TiaraBoom path: /tiara/sentence_gen.py from grammar import _sentence, _advice, _insult def ConstructSentence(phr...
code_fim
medium
{ "lang": "python", "repo": "jvictor0/TiaraBoom", "path": "/tiara/sentence_gen.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: theylom/tdog-husky-hg path: /src/validations.py #!/usr/bin/env python # #tdog-husky import re import os, sys import subprocess class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '...
code_fim
hard
{ "lang": "python", "repo": "theylom/tdog-husky-hg", "path": "/src/validations.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if os.path.exists('/'.join(filePath.split('/')[:-1]) + '/' + 'index.stories.js'): print bcolors.WARNING + ('Component added/modified %s make sure you ran "yarn jest storybook -u" to create/update the snapshot.' % filename) + bcolors.ENDC if line....
code_fim
hard
{ "lang": "python", "repo": "theylom/tdog-husky-hg", "path": "/src/validations.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if (exitval - entryval) > 0: tmp[i,j] = R[i,5]*(exitval-entryval); else: tmp[i,j] = 0; #endif #endfor #endfor radvec = np.sum(tmp,axis = 0); analytical_sinogram = np.transpose(np.reshape(radvec,(len(theta_vec),len(t_ve...
code_fim
hard
{ "lang": "python", "repo": "francescat93/Exact_sinogram", "path": "/exact_sinogram/radon_exact.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Returns ------- analytical_sinogram : Analytical Sinogram """ #Rescaling according to image size S[:,0] = S[:,0]*N/2 S[:,1] = (S[:,1])*N/2 S[:,2] = (S[:,2])*N/2 S[:,3] = S[:,3]*math.pi/180 [t_vec, grid_t, grid_theta] = build_t_theta_pixel(N,theta_vec, cir...
code_fim
hard
{ "lang": "python", "repo": "francescat93/Exact_sinogram", "path": "/exact_sinogram/radon_exact.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: francescat93/Exact_sinogram path: /exact_sinogram/radon_exact.py y.shape[1], nrow)) for k in range(nrow): #itero sulle ellissi x_new = x - E[k,2] y_new = y - E[k,3] #find(( (x.*cosp + y.*sinp).^2)./asq + ((y.*cosp - x.*sinp).^2)./bsq <= 1); cosp = math.cos(E...
code_fim
hard
{ "lang": "python", "repo": "francescat93/Exact_sinogram", "path": "/exact_sinogram/radon_exact.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: lishikuan/cutrect path: /rect/migrations/0002_auto_20180111_1541.py # -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2018-01-11 07:41 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): <|fim_suffix|> operations = [...
code_fim
medium
{ "lang": "python", "repo": "lishikuan/cutrect", "path": "/rect/migrations/0002_auto_20180111_1541.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('rect', '0001_auto_20180111_1408'), ] operations = [ migrations.AddField( model_name='page', name='updated_at', field=models.DateTimeField(auto_now=True, verbose_name='更新时间'), ), migrations.AlterField( ...
code_fim
medium
{ "lang": "python", "repo": "lishikuan/cutrect", "path": "/rect/migrations/0002_auto_20180111_1541.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>t0 = time() best_epoch = 0 gen_waves1=[] gen_waves2=[] dloss=[] gloss=[] mmd_save=[] cond_dim=0 print('epoch\ttime\tD_loss\tG_loss\tmmd2') for epoch in range(num_epochs): D_loss_curr, G_loss_curr = Combmodel_rnn_gan.train_epoch(epoch, samples['train'], labels['train'], ...
code_fim
hard
{ "lang": "python", "repo": "StoicGilgamesh/Comb-GAN", "path": "/Combrecurrentgan_tf.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: StoicGilgamesh/Comb-GAN path: /Combrecurrentgan_tf.py # -*- coding: utf-8 -*- """ Created on Fri Oct 19 15:20:49 2018 @author: CHHRGUP """ import tensorflow as tf import numpy as np from math import ceil from sklearn import preprocessing import Combmodel_rnn_gan from time import t...
code_fim
hard
{ "lang": "python", "repo": "StoicGilgamesh/Comb-GAN", "path": "/Combrecurrentgan_tf.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: shortthirdman/code-eval-challenges path: /moderate/pass_triangle.py3 import fileinput a = [] for line in fileinput.input(): s = [int<|fim_suffix|> len(s)-1): s[i] += max(a[i-1], a[i]) a = s print(max(a))<|fim_middle|>(i) for i in line.split()] if len(a) > 0: s[0] += a...
code_fim
medium
{ "lang": "python", "repo": "shortthirdman/code-eval-challenges", "path": "/moderate/pass_triangle.py3", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> len(s)-1): s[i] += max(a[i-1], a[i]) a = s print(max(a))<|fim_prefix|># repo: shortthirdman/code-eval-challenges path: /moderate/pass_triangle.py3 import fileinput a = [] for line in fileinput.input(): s = [int(i) for i in line.split()] if len(a) > 0: s[0] += a[0] <|fim_mi...
code_fim
medium
{ "lang": "python", "repo": "shortthirdman/code-eval-challenges", "path": "/moderate/pass_triangle.py3", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if len(a) > 1: s[-1] += a[-1] for i in range(1, len(s)-1): s[i] += max(a[i-1], a[i]) a = s print(max(a))<|fim_prefix|># repo: shortthirdman/code-eval-challenges path: /moderate/pass_triangle.py3 import fileinput a = [] for line in fileinput.input(): s = [int<|fim_mi...
code_fim
medium
{ "lang": "python", "repo": "shortthirdman/code-eval-challenges", "path": "/moderate/pass_triangle.py3", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> glidingAverage = getGlidingAverage() print "Gliding average is " + str(glidingAverage) if (db.isExpensiveHour(getNow(), glidingAverage, 1.2)): targetTemp += expensiveBreakpoint print "now is expensive hour. Adding to targetTemp " + str(expensiveBreakpoint) elif (db.isExpen...
code_fim
hard
{ "lang": "python", "repo": "tobiblas/ThermostatPi", "path": "/thermostat/sense_remote_temp.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: tobiblas/ThermostatPi path: /thermostat/sense_remote_temp.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import with_statement from subprocess import call import time import pytz import sys import urllib2 import threading from urllib2 import URLError import json import db from d...
code_fim
hard
{ "lang": "python", "repo": "tobiblas/ThermostatPi", "path": "/thermostat/sense_remote_temp.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> async def run(self): logger.info("Starting Slack Machine") self._dispatcher.start() Scheduler(settings=self._settings, loop=self._loop).start() logger.info("Scheduler started!") keepaliver: Optional[asyncio.Task] = None runner: Optional[AppRunner] = No...
code_fim
hard
{ "lang": "python", "repo": "mailgun/aio-slack-machine", "path": "/machine/core.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: mailgun/aio-slack-machine path: /machine/core.py # -*- coding: utf-8 -*- import asyncio import inspect import signal import sys from functools import partial from typing import Mapping, Optional import dill from aiohttp.web import Application, AppRunner, TCPSite from loguru import logger from ...
code_fim
hard
{ "lang": "python", "repo": "mailgun/aio-slack-machine", "path": "/machine/core.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: viniciusjulianirossi/Python path: /Comprehension e Funções Integradas/Generators.py """ Tuple comprehension...porque elas se chama generators nomes = ["Carlos", "Camila", "Carla", "Cassioano", "Cristina", "vanessa"] print(any([nome[0] == 'C' for nome in nomes])) # Poderiamos ter feito utilizan...
code_fim
hard
{ "lang": "python", "repo": "viniciusjulianirossi/Python", "path": "/Comprehension e Funções Integradas/Generators.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|># Set set_comp = getsizeof({x * 10 for x in range(1000)}) # Dict dict_comp = getsizeof({x: x * 10 for x in range(1000)}) # Generator gen = getsizeof(x * 10 for x in range(1000)) print("Para fazer a mesma tarefa gastamos em memoria") print(f"Lista {list_comp} bytes") print(f"Set {set_comp} bytes") prin...
code_fim
hard
{ "lang": "python", "repo": "viniciusjulianirossi/Python", "path": "/Comprehension e Funções Integradas/Generators.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: ntu-rris/bound-learning-supplementary path: /poseLearning/6D/util.py import numpy as np import os #import matplotlib import matplotlib.pyplot as plt def saveScatterPlotWithBoundary(points,reconPoints,actualBoundary, filename, fig=None, bound=True): if(fig==None): fig=plt.figure(figsize=(8, 8...
code_fim
hard
{ "lang": "python", "repo": "ntu-rris/bound-learning-supplementary", "path": "/poseLearning/6D/util.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> plt.scatter(points[:,0],points[:,1],color='k',s=1) plt.scatter(reconPoints[:,0],reconPoints[:,1],color='r',s=1) plt.plot(actualBoundary[:,0],actualBoundary[:,1],color='b',marker='+') plt.axis('equal') #allow true square scaling if bound: plt.axis([-2,2,-2,2]) plt.savefig(filename,bbox_inches...
code_fim
hard
{ "lang": "python", "repo": "ntu-rris/bound-learning-supplementary", "path": "/poseLearning/6D/util.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: facebookresearch/Mephisto path: /mephisto/abstractions/providers/prolific/api/eligibility_requirement_classes/approval_rate_eligibility_requirement.py from .base_eligibility_requirement import BaseEligibilityRequirement class ApprovalRateEligibilityRequirement(BaseEligibilityRequirement): <|fim...
code_fim
hard
{ "lang": "python", "repo": "facebookresearch/Mephisto", "path": "/mephisto/abstractions/providers/prolific/api/eligibility_requirement_classes/approval_rate_eligibility_requirement.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self, minimum_approval_rate: int, maximum_approval_rate: int): self.minimum_approval_rate = minimum_approval_rate self.maximum_approval_rate = maximum_approval_rate<|fim_prefix|># repo: facebookresearch/Mephisto path: /mephisto/abstractions/providers/prolific/api/eligibil...
code_fim
medium
{ "lang": "python", "repo": "facebookresearch/Mephisto", "path": "/mephisto/abstractions/providers/prolific/api/eligibility_requirement_classes/approval_rate_eligibility_requirement.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>__all__ = ["ElementDivide"] class ElementDivide( ElementOperator, BinaryOperator, ArrayOperator, ): fn: ClassVar = jnp.divide<|fim_prefix|># repo: jedhsu/tensor path: /src/tensor/op/arithmetic/divide.py """ *Element Divide* <|fim_middle|>""" import jax.numpy as jnp
code_fim
easy
{ "lang": "python", "repo": "jedhsu/tensor", "path": "/src/tensor/op/arithmetic/divide.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: jedhsu/tensor path: /src/tensor/op/arithmetic/divide.py """ *Element Divide* """ import jax.numpy as jnp __all__ = ["ElementDivide"] <|fim_suffix|> ElementOperator, BinaryOperator, ArrayOperator, ): fn: ClassVar = jnp.divide<|fim_middle|> class ElementDivide(
code_fim
easy
{ "lang": "python", "repo": "jedhsu/tensor", "path": "/src/tensor/op/arithmetic/divide.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> Equivalent of df[col].values, but without going through normal getitem, which triggers tracking references / CoW (and we might be testing that this is done by some other operation). """ if isinstance(obj, Series) and (col is None or obj.name == col): arr = obj._values else:...
code_fim
medium
{ "lang": "python", "repo": "tnir/pandas", "path": "/pandas/tests/copy_view/util.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: tnir/pandas path: /pandas/tests/copy_view/util.py from pandas import Series from pandas.core.arrays import BaseMaskedArray <|fim_suffix|> Equivalent of df[col].values, but without going through normal getitem, which triggers tracking references / CoW (and we might be testing that this...
code_fim
medium
{ "lang": "python", "repo": "tnir/pandas", "path": "/pandas/tests/copy_view/util.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>def meshgrid(x, y, row_major=True): a = torch.arange(0,x) b = torch.arange(0,y) xx = a.repeat(y).view(-1,1) yy = b.view(-1,1).repeat(1,x).view(-1,1) return torch.cat([xx,yy],1) if row_major else torch.cat([yy,xx],1) def change_box_order(boxes, order): '''Change box order between (...
code_fim
hard
{ "lang": "python", "repo": "Sindy98/spc2", "path": "/utils/util.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: Sindy98/spc2 path: /utils/util.py ileHandler(log_file, mode='a' if resume else 'w') fileHandler.setFormatter(formatter) streamHandler = logging.StreamHandler() streamHandler.setFormatter(formatter) logger.setLevel(level) logger.addHandler(fileHandler) logger.addHandler(s...
code_fim
hard
{ "lang": "python", "repo": "Sindy98/spc2", "path": "/utils/util.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> Args: boxes: (tensor) bounding boxes, sized [N,4]. order: (str) either 'xyxy2xywh' or 'xywh2xyxy'. Returns: (tensor) converted bounding boxes, sized [N,4]. ''' assert order in ['xyxy2xywh','xywh2xyxy'] a = boxes[:,:2] b = boxes[:,2:] if order == 'xyxy2xywh': ...
code_fim
hard
{ "lang": "python", "repo": "Sindy98/spc2", "path": "/utils/util.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: augeas/BirdSpider path: /birdspider/twitter_tools/neo.py # Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt from datetime import datetime from itertools import chain, starmap import logging import re import time noSlash = re.compile(r'\\') def cyph...
code_fim
hard
{ "lang": "python", "repo": "augeas/BirdSpider", "path": "/birdspider/twitter_tools/neo.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # push original tweets from RTs/quotes for label in ['retweet', 'quotetweet']: tweets = [(tw[0],) for tw in tweet_dump[label]] if tweets: tweets2Neo(db, tweets, label='tweet') # (RT/quote)-[RETWEET_OF/QUOTE_OF]->(tweet) if tweet_dump['retweet']: tweetLi...
code_fim
hard
{ "lang": "python", "repo": "augeas/BirdSpider", "path": "/birdspider/twitter_tools/neo.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def download_page(url): response = urllib.request.urlopen(url) return response.read().decode("utf-8") class WindowsKeyPageParser(html.parser.HTMLParser): def __init__(self, *, convert_charrefs=True): super().__init__(convert_charrefs=True) self.product_keys = {} self...
code_fim
hard
{ "lang": "python", "repo": "quickemu-project/quickemu", "path": "/windowskey", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.parsing_os = False def handle_data(self, data): if self.parsing_os: self.stash_table_cell(data) def stash_table_cell(self, data): if "Windows" in data: self.current_os = data else: product_key = data self.produc...
code_fim
hard
{ "lang": "python", "repo": "quickemu-project/quickemu", "path": "/windowskey", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: quickemu-project/quickemu path: /windowskey #!/usr/bin/env python3 import html.parser import os import sys import urllib.request """ Download Windows product keys from MicroSoft """ key_page_url = "https://docs.microsoft.com/en-us/windows-server/get-started/kms-client-activation-keys" <|fim...
code_fim
hard
{ "lang": "python", "repo": "quickemu-project/quickemu", "path": "/windowskey", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> #print(request.POST['VM_name']) #print(request.POST['SLA_Option']) #print(request.POST['SLA_Value']) URL = URLServer + URLSetSLA print(URL) print(URL) print(URL) print(URL) _VM_name = request.POST['VM_name'] _SLO_Option = requ...
code_fim
hard
{ "lang": "python", "repo": "hanjjm/Stella_Horizon", "path": "/openstack_dashboard/dashboards/stella/SLAConfigPanel/forms.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def submitSLA(self, request): #print(request.POST['VM_name']) #print(request.POST['SLA_Option']) #print(request.POST['SLA_Value']) URL = URLServer + URLSetSLA print(URL) print(URL) print(URL) print(URL) _VM_name = request.POST['VM...
code_fim
medium
{ "lang": "python", "repo": "hanjjm/Stella_Horizon", "path": "/openstack_dashboard/dashboards/stella/SLAConfigPanel/forms.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: hanjjm/Stella_Horizon path: /openstack_dashboard/dashboards/stella/SLAConfigPanel/forms.py from django import forms import requests from requests.auth import HTTPDigestAuth import json URLServer = "http://203.230.60.81:5000" URLstatus = "/stella" URLlistVM = "/stella/vms" URLSetSLA = "/stella/v...
code_fim
medium
{ "lang": "python", "repo": "hanjjm/Stella_Horizon", "path": "/openstack_dashboard/dashboards/stella/SLAConfigPanel/forms.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> graph_gen_tf = time.perf_counter() print(f"\tRandom graph generated in {graph_gen_tf - graph_gen_ti:0.4f} seconds.") print(f"\t\tPlayer 'Reachability' controls {len(random_graph.reachability_player_nodes)}") print(f"\t\tPlayer 'Safety' controls {len(random_graph.safety_player_nodes)}\n\n")...
code_fim
hard
{ "lang": "python", "repo": "giannetti1904342/Reasoning_agents", "path": "/Games_On_Graphs_1904342/reachability.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """ Naive version, directly derived from the slides. Given a graph and a set of target nodes, returns the set of nodes such that the target is not reachable from them. Optionally, writes the steps of the algorithm as pictures. :param G: a graph :param target: a set of integers ...
code_fim
hard
{ "lang": "python", "repo": "giannetti1904342/Reasoning_agents", "path": "/Games_On_Graphs_1904342/reachability.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: giannetti1904342/Reasoning_agents path: /Games_On_Graphs_1904342/reachability.py from typing import Set import time from graph import GameGraph from graph_simple import GameGraphSimple from draw_graph import draw_graph #Improved backward algorithm implementation. Please refer the documentation ...
code_fim
hard
{ "lang": "python", "repo": "giannetti1904342/Reasoning_agents", "path": "/Games_On_Graphs_1904342/reachability.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # Invalid column spacing with pytest.raises(ValueError) as excinfo: SimpleTable([column_1, column_2], column_spacing=-1) assert "Column spacing cannot be less than 0" in str(excinfo.value) # Invalid divider character with pytest.raises(TypeError) as excinfo: SimpleTabl...
code_fim
hard
{ "lang": "python", "repo": "python-cmd2/cmd2", "path": "/tests/test_table_creator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: python-cmd2/cmd2 path: /tests/test_table_creator.py Column("") assert c.width < 0 tc = TableCreator([c]) assert tc.cols[0].width == 1 # No width specified, label isn't blank but has no width c = Column(ansi.style('', fg=Fg.GREEN)) assert c.width < 0 tc = TableCreator(...
code_fim
hard
{ "lang": "python", "repo": "python-cmd2/cmd2", "path": "/tests/test_table_creator.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # No column borders at = AlternatingTable([column_1, column_2], column_borders=False) table = at.generate_table(row_data) assert table == ( '╔══════════════════════════════════╗\n' '║ Col 1 Col 2 ║\n' '╠══════════════════════════════════╣\n' ...
code_fim
hard
{ "lang": "python", "repo": "python-cmd2/cmd2", "path": "/tests/test_table_creator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if overwrite_dict: overwrite = PermissionOverwrite(**overwrite_dict) for ch in all_channels: if role in ch.overwrites: existing_ow = ch.overwrites_for(role) if existing_ow == overwrite: continue...
code_fim
hard
{ "lang": "python", "repo": "Lazyuki/DiscordStatsBotPython", "path": "/cogs/moderation.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Usage: ,,chrp <role> [excluded channels] permission1=True, permission2=None, permission3=False... [-f to force, otherwise merge] If forced, previous overwrites will be ignored. Do not specify permissions if you want to remove permission overwrites from all channels. Example...
code_fim
hard
{ "lang": "python", "repo": "Lazyuki/DiscordStatsBotPython", "path": "/cogs/moderation.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Lazyuki/DiscordStatsBotPython path: /cogs/moderation.py from discord.ext import commands import discord import typing import logging import asyncio import asyncpg import subprocess import re from discord.ext.commands.context import Context from discord.permissions import PermissionOverwrite, Per...
code_fim
hard
{ "lang": "python", "repo": "Lazyuki/DiscordStatsBotPython", "path": "/cogs/moderation.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>output_df['Github links'] = output_df[['Package','Function','Github link']].groupby(['Package','Function'])['Github link'].transform(lambda x: ', '.join(x)) output_df = output_df.sort_values(by=['Package','Function'], ascending=[True,True]).reset_index() output_df = output_df[['Package','Function','Github...
code_fim
hard
{ "lang": "python", "repo": "maladeep/preppin-data", "path": "/meta/methods.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> usage_df = pd.DataFrame() usage_df['Search Terms'] = search_terms usage_df['File'] = preppin_data_scripts[s] usage_df['Used'] = functions usage_df = usage_df.loc[usage_df['Used'] == True] if s == 0: output_df = usage_df else: output_df = pd.concat([output_df,u...
code_fim
hard
{ "lang": "python", "repo": "maladeep/preppin-data", "path": "/meta/methods.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: maladeep/preppin-data path: /meta/methods.py #from inspect import getmembers, isfunction import pandas as pd import numpy as np from pandas import DataFrame as df import glob preppin_data_scripts = glob.glob("20*.py") pandas_df = pd.DataFrame() pandas_df['Function'] = dir(pd) pandas_df['Packag...
code_fim
hard
{ "lang": "python", "repo": "maladeep/preppin-data", "path": "/meta/methods.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: moderngl/moderngl-window path: /examples/text_simple.py import moderngl_window from moderngl_window.text.bitmapped import TextWriter2D <|fim_suffix|> self.writer.draw((240, 380), size=120) App.run()<|fim_middle|>class App(moderngl_window.WindowConfig): title = "Text" aspect_rat...
code_fim
hard
{ "lang": "python", "repo": "moderngl/moderngl-window", "path": "/examples/text_simple.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def render(self, time, frame_time): self.writer.draw((240, 380), size=120) App.run()<|fim_prefix|># repo: moderngl/moderngl-window path: /examples/text_simple.py import moderngl_window from moderngl_window.text.bitmapped import TextWriter2D class App(moderngl_window.WindowConfig): tit...
code_fim
medium
{ "lang": "python", "repo": "moderngl/moderngl-window", "path": "/examples/text_simple.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.writer.draw((240, 380), size=120) App.run()<|fim_prefix|># repo: moderngl/moderngl-window path: /examples/text_simple.py import moderngl_window from moderngl_window.text.bitmapped import TextWriter2D class App(moderngl_window.WindowConfig): <|fim_middle|> title = "Text" aspect_rat...
code_fim
hard
{ "lang": "python", "repo": "moderngl/moderngl-window", "path": "/examples/text_simple.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: dandxy89/ImageModels path: /VGG19.py """ Model Name: VGG-19 - using the Functional Keras API A model of the 19-layer network used by the VGG team in the ILSVRC-2014 competition. Paper: Very Deep Convolutional Networks for Large-Scale Image Recognition - K. Sim...
code_fim
hard
{ "lang": "python", "repo": "dandxy89/ImageModels", "path": "/VGG19.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # Layer Cluster - 3 x = ZeroPadding2D(padding=(1, 1), dim_ordering=DIM_ORDERING)(x) x = Convolution2D(256, 3, 3, activation='relu', border_mode='same', dim_ordering=DIM_ORDERING)(x) x = ZeroPadding2D(padding=(1, 1), dim_orde...
code_fim
hard
{ "lang": "python", "repo": "dandxy89/ImageModels", "path": "/VGG19.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # Layer Cluster - 4 x = ZeroPadding2D(padding=(1, 1), dim_ordering=DIM_ORDERING)(x) x = Convolution2D(512, 3, 3, activation='relu', border_mode='same', dim_ordering=DIM_ORDERING)(x) x = ZeroPadding2D(padding=(1, 1), dim_orde...
code_fim
hard
{ "lang": "python", "repo": "dandxy89/ImageModels", "path": "/VGG19.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: HelenaAdrignoli/tir-script-samples path: /Protheus_WebApp/Modules/SIGAAGR/AGRA650TestCase.py from tir import Webapp import unittest class AGRA650(unittest.TestCase): @classmethod def setUpClass(inst): from datetime import datetime DateSystem = datetime.today().s...
code_fim
medium
{ "lang": "python", "repo": "HelenaAdrignoli/tir-script-samples", "path": "/Protheus_WebApp/Modules/SIGAAGR/AGRA650TestCase.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.oHelper.SearchBrowse("D MG 01 "+"1920 "+"000013") self.oHelper.SetButton("Outras Ações","Incluir Fardos",position=1, check_error=True) self.oHelper.SetValue("MV_PAR02", "999999",name_attr=True) self.oHelper.SetValue("MV_PAR03", "1",name_attr=True) ...
code_fim
medium
{ "lang": "python", "repo": "HelenaAdrignoli/tir-script-samples", "path": "/Protheus_WebApp/Modules/SIGAAGR/AGRA650TestCase.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.oHelper.SearchBrowse("D MG 01 "+"1920 "+"000013") self.oHelper.SetButton("Outras Ações","Incluir Fardos",position=1, check_error=True) self.oHelper.SetValue("MV_PAR02", "999999",name_attr=True) self.oHelper.SetValue("MV_PAR03", "1",name_attr=True) sel...
code_fim
medium
{ "lang": "python", "repo": "HelenaAdrignoli/tir-script-samples", "path": "/Protheus_WebApp/Modules/SIGAAGR/AGRA650TestCase.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: microsoftgraph/msgraph-sdk-python path: /msgraph/generated/models/security/kubernetes_service_evidence.py from __future__ import annotations from dataclasses import dataclass, field from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter from typing import Any, Calla...
code_fim
hard
{ "lang": "python", "repo": "microsoftgraph/msgraph-sdk-python", "path": "/msgraph/generated/models/security/kubernetes_service_evidence.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Enmin/ModellingJointInferenceOfPhysicsAndMind path: /exec/evaluateNNPriorMCTSNoPhysicsSheepChaseWolf/prepareNoPhysicsNeuralNetDataSheepChaseWolf.py import os import sys sys.path.append(os.path.join(os.path.join(os.path.dirname(__file__), '..'), '..')) import numpy as np import pickle import rando...
code_fim
hard
{ "lang": "python", "repo": "Enmin/ModellingJointInferenceOfPhysicsAndMind", "path": "/exec/evaluateNNPriorMCTSNoPhysicsSheepChaseWolf/prepareNoPhysicsNeuralNetDataSheepChaseWolf.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> numSimulations = 200 mcts = MCTS(numSimulations, selectChild, expand, rollout, backup, establishSoftmaxActionDist) # All agents' policies def policy(state): return [mcts(state), escapePolicy(state)] # generate trajectories maxRunningSteps = 30 numTrials = 5000...
code_fim
hard
{ "lang": "python", "repo": "Enmin/ModellingJointInferenceOfPhysicsAndMind", "path": "/exec/evaluateNNPriorMCTSNoPhysicsSheepChaseWolf/prepareNoPhysicsNeuralNetDataSheepChaseWolf.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # rollout rolloutHeuristicWeight = 0 rolloutHeuristic = reward.HeuristicDistanceToTarget( rolloutHeuristicWeight, getPredatorPos, getPreyPos) rollout = RollOut(rolloutPolicy, maxRolloutSteps, sheepTransit, rewardFunction, isTerminal, rolloutHeuristic) num...
code_fim
hard
{ "lang": "python", "repo": "Enmin/ModellingJointInferenceOfPhysicsAndMind", "path": "/exec/evaluateNNPriorMCTSNoPhysicsSheepChaseWolf/prepareNoPhysicsNeuralNetDataSheepChaseWolf.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: shunsunsun/orso path: /network/lookups.py from selectable.base import ModelLookup from selectable.registry import registry from django.db.models import Q from . import models class DistinctStringLookup(ModelLookup): """ Return distinct strings for a single CharField in a model """ ...
code_fim
hard
{ "lang": "python", "repo": "shunsunsun/orso", "path": "/network/lookups.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return self.get_item_value(item) class AllExpTypeLookup(ExperimentTypeLookup): def get_query(self, request, term): return self.get_queryset() \ .order_by('experiment_type__name') \ .distinct('experiment_type__name') class RecExpTypeLookup(ExperimentTypeLooku...
code_fim
hard
{ "lang": "python", "repo": "shunsunsun/orso", "path": "/network/lookups.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> extract_parser = subparsers.add_parser('extract', help='extract important information from a pepxml') extract_parser.add_argument('--input', dest="input_pepxml", help='pepxml', required=True) extract_parser.add_argument('--output_dir', dest="output_dir", help="dir for output", required=True) ...
code_fim
hard
{ "lang": "python", "repo": "kusterlab/MasterSpectrum", "path": "/bin/MasterSpectrum", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kusterlab/MasterSpectrum path: /bin/MasterSpectrum #!/usr/bin/env python from mgf_filter.apl2Mgf import Apl2Mgf from mgf_filter.util import calculate_Delta_by_ppm import logging import time from mgf_filter.mgfPatcher import MgfPatcher from mgf_filter.bruteForcePatcher import BruteForcePatcher fro...
code_fim
hard
{ "lang": "python", "repo": "kusterlab/MasterSpectrum", "path": "/bin/MasterSpectrum", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def deleteAminoAcidDeltas(original, out_dir): file_name = os.path.splitext(os.path.basename(original))[0] folder_out = timeStamped('noAminoAcidDeltas_' + file_name) output_dir = out_dir + folder_out os.makedirs(output_dir) gps = GeneratorForPerfectSpectra() gps.generateAminoAcidD...
code_fim
hard
{ "lang": "python", "repo": "kusterlab/MasterSpectrum", "path": "/bin/MasterSpectrum", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: DjangoLover/gitality path: /scripts/scraper/scraper/settings.py import os os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' <|fim_suffix|>BOT_NAME = 'scraper' LOG_ENABLED = True LOG_FILE = "/tmp/scraper.log" LOG_LEVEL = 'INFO' BOT_NAME = 'scraper' SPIDER_MODULES = ['scraper.spiders'] NEWSPIDE...
code_fim
medium
{ "lang": "python", "repo": "DjangoLover/gitality", "path": "/scripts/scraper/scraper/settings.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>BOT_NAME = 'scraper' LOG_ENABLED = True LOG_FILE = "/tmp/scraper.log" LOG_LEVEL = 'INFO' BOT_NAME = 'scraper' SPIDER_MODULES = ['scraper.spiders'] NEWSPIDER_MODULE = 'scraper.spiders' USER_AGENT = 'Gitality team.' DOWNLOAD_DELAY = 1 FEED_FORMAT = 'json' FEED_URI = os.path.join(SCRAPY_ROOT, "scraper/...
code_fim
medium
{ "lang": "python", "repo": "DjangoLover/gitality", "path": "/scripts/scraper/scraper/settings.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hyperledger-archives/indy-post-install-automation path: /test_scripts/functional_tests/did/signus_key_for_local_did_works_for_my_did_test.py """ Created on Jan 13, 2018 @author: nhan.nguyen Verify that user can get verkey of 'my_did' in local. """ import pytest from indy import did from utilit...
code_fim
hard
{ "lang": "python", "repo": "hyperledger-archives/indy-post-install-automation", "path": "/test_scripts/functional_tests/did/signus_key_for_local_did_works_for_my_did_test.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # 4. Get local verkey of 'my_did' from wallet # and store it into 'returned_verkey'. self.steps.add_step("Get local verkey of 'my_did' from wallet and " "store it into 'returned_verkey'") returned_verkey = await utils.perform(self.steps, ...
code_fim
hard
{ "lang": "python", "repo": "hyperledger-archives/indy-post-install-automation", "path": "/test_scripts/functional_tests/did/signus_key_for_local_did_works_for_my_did_test.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # 5. Check 'returned_verkey'. self.steps.add_step("Check 'returned_verkey'") err_msd = "Returned verkey mismatches with stored verkey" utils.check(self.steps, error_message=err_msd, condition=lambda: returned_verkey == my_verkey)<|fim_prefix|># repo: hyp...
code_fim
hard
{ "lang": "python", "repo": "hyperledger-archives/indy-post-install-automation", "path": "/test_scripts/functional_tests/did/signus_key_for_local_did_works_for_my_did_test.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: WolfGang1710/Figures_diffraction path: /modules/diffraction.py """ Title: Projet IPT - Diffraction DI Description: Ce programme permet de calculer la valeur (couleur) de chaque point de l'écran. On utlise une méthode de somme discrète. """ #pylint: disable=invalid-name ...
code_fim
medium
{ "lang": "python", "repo": "WolfGang1710/Figures_diffraction", "path": "/modules/diffraction.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def diffraction(Fente): """Renvoie une matrice représentant une figure de diffraction. Fente représentante une matrice également (la matrice de la fente). """ n = np.shape(Fente)[0] #Dimension de la matrice de la fente ecran = np.zeros((n, n)) #Création matrice carrée de taille n ...
code_fim
medium
{ "lang": "python", "repo": "WolfGang1710/Figures_diffraction", "path": "/modules/diffraction.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: pvu1984/cage-challenge-2 path: /CybORG/CybORG/Shared/Actions/MSFActionsFolder/MSFScannerFolder/MSFScanner.py # Copyright DST Group. Licensed under the MIT license. from CybORG.Shared.Actions.MSFActionsFolder.MSFAction import MSFAction from CybORG.Simulator.State import State class MSFScanner(MS...
code_fim
easy
{ "lang": "python", "repo": "pvu1984/cage-challenge-2", "path": "/CybORG/CybORG/Shared/Actions/MSFActionsFolder/MSFScannerFolder/MSFScanner.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> super().__init__(session, agent) def sim_execute(self, state: State): pass<|fim_prefix|># repo: pvu1984/cage-challenge-2 path: /CybORG/CybORG/Shared/Actions/MSFActionsFolder/MSFScannerFolder/MSFScanner.py # Copyright DST Group. Licensed under the MIT license. from CybORG.Shared.Actio...
code_fim
medium
{ "lang": "python", "repo": "pvu1984/cage-challenge-2", "path": "/CybORG/CybORG/Shared/Actions/MSFActionsFolder/MSFScannerFolder/MSFScanner.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>class Issue(models.Model): description = models.CharField(max_length=100) owner = models.ForeignKey(User, on_delete=models.SET_NULL) office = models.ForeignKey(Office, on_delete=models.SET_NULL)<|fim_prefix|># repo: lincolwn/djangorestframework-resource-permissions path: /tests/app/models.py ...
code_fim
medium
{ "lang": "python", "repo": "lincolwn/djangorestframework-resource-permissions", "path": "/tests/app/models.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: lincolwn/djangorestframework-resource-permissions path: /tests/app/models.py from django.db import models from django.contrib.auth.models import User <|fim_suffix|>class Issue(models.Model): description = models.CharField(max_length=100) owner = models.ForeignKey(User, on_delete=models....
code_fim
medium
{ "lang": "python", "repo": "lincolwn/djangorestframework-resource-permissions", "path": "/tests/app/models.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: t4d-classes/python_03152021 path: /feature-demos/object_ids.py # list_a = [1, 2] # list_b = [1, 2] # print(id(list_a)) # print(id(list_b)) # tuple_a = (1, 2) # tuple_b = (1, 3) # print(id(tuple_a)) # print(id(tuple_b)) # str_a = "hi" # str_b = "hi" # print(id(str_a)) # print(id(str_b)) <|...
code_fim
easy
{ "lang": "python", "repo": "t4d-classes/python_03152021", "path": "/feature-demos/object_ids.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def func_b(): str_b = "hi" print(id(str_b)) func_a() func_b()<|fim_prefix|># repo: t4d-classes/python_03152021 path: /feature-demos/object_ids.py # list_a = [1, 2] # list_b = [1, 2] # print(id(list_a)) # print(id(list_b)) # tuple_a = (1, 2) # tuple_b = (1, 3) # print(id(tuple_a)) # print(id...
code_fim
medium
{ "lang": "python", "repo": "t4d-classes/python_03152021", "path": "/feature-demos/object_ids.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def func_b(): str_b = "hi" print(id(str_b)) func_a() func_b()<|fim_prefix|># repo: t4d-classes/python_03152021 path: /feature-demos/object_ids.py # list_a = [1, 2] # list_b = [1, 2] <|fim_middle|># print(id(list_a)) # print(id(list_b)) # tuple_a = (1, 2) # tuple_b = (1, 3) # print(id(tuple...
code_fim
hard
{ "lang": "python", "repo": "t4d-classes/python_03152021", "path": "/feature-demos/object_ids.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }