messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom web_test_base import *\n\n\"\"\"\nA class to test new features without running all of the tests.\n\nUsage:\n py.test tests/test_test.py -rsx\n\"\"\"\nclass TestTest(WebTestBase):\n urls_to_get = [\n \"http:/... | python | edit | 5 | 1 | mit | c37500894b309a691009b87b1305935ee57648cb | IATI/IATI-Website-Tests | tests/test_test.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Defining constants for tensorpy use \"\"\"\n\nDOWNLOADS_FOLDER = \"downloads_folder\" # Folder created for downloaded files\nMIN_W_H = 50 # Minimum width/height for classifying images on a page\nMAX_THREADS = 4 # Total threads to ... | python | edit | 1 | 0 | mit | 3453b7961fae365f833199c88c7395428fcdf788 | TensorPy/TensorPy,TensorPy/TensorPy | tensorpy/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.contrib.auth.models import User\n\nclass Project(models.Model):\n user = models.ForeignKey(User)\n name = models.CharField(max_length=100)\n version = models.CharField(max_length=15, null=T... | python | edit | 1 | 0 | mit | 2a4b02fe84542f3f44fa4e6913f86ed3a4771d43 | hfrequency/django-issue-tracker | issue_tracker/core/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom werkzeug.utils import secure_filename\nimport config\nfrom flask_restful import Resource\nfrom flask import request, abort\n\n\ndef allowed_file(filename):\n return ('.' in filename and\n filename.rsplit('.', 1... | python | edit | 1 | 4 | apache-2.0 | 3794fe611e5fbbe55506a7d2e59b2f3f872d8733 | googleinterns/inventory-visualizer,googleinterns/inventory-visualizer,googleinterns/inventory-visualizer,googleinterns/inventory-visualizer,googleinterns/inventory-visualizer | backend/controllers/file_controller.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from hashlib import md5\nexcept ImportError:\n from md5 import md5\n\nfrom django.http import HttpResponseBadRequest\n\nfrom secretballot.middleware import SecretBallotIpUseragentMiddleware\n\n\nclass SecretBallotUserIpUseragen... | python | edit | 3 | 3 | bsd-3-clause | 91b9e5d71c323be2e5e0d1aa16e47cc49d45acc4 | Afnarel/django-likes,Afnarel/django-likes,Afnarel/django-likes | likes/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef print_generated_sequence(g, num, *, sep=\", \"):\n \"\"\"\n Helper function which prints a sequence of `num` items\n produced by the random generator `g`.\n \"\"\"\n\n elems = [str(next(g)) for _ in range(num)]\n sep_i... | python | edit | 1 | 4 | mit | bc36a19d3bb1c07cbe2a44de88f227ef71c50b8c | maxalbert/tohu | notebooks/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import defaultdict\n\nimport pytest\nfrom funcy.funcmakers import *\n\n\ndef test_callable():\n assert make_func(lambda x: x + 42)(0) == 42\n\n\ndef test_int():\n assert make_func(0)('abc') == 'a'\n assert make_fun... | python | edit | 19 | 1 | bsd-3-clause | 3ab0e72d5e4031bb07c6ce2e8e9e71db07b55f24 | Suor/funcy | tests/test_funcmakers.py | rejected_lint | Too many lint violations: 19 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cherrypy\nimport logging\nfrom girder import auditLogger\nfrom girder.models.model_base import Model\nfrom girder.api.rest import getCurrentUser\n\n\nclass Record(Model):\n def initialize(self):\n self.name = 'audit_log_rec... | python | edit | 1 | 2 | apache-2.0 | ce7c31f3dd97716051b72951c7c745dd2c63efcd | RafaelPalomar/girder,data-exp-lab/girder,RafaelPalomar/girder,data-exp-lab/girder,girder/girder,kotfic/girder,RafaelPalomar/girder,Kitware/girder,manthey/girder,jbeezley/girder,manthey/girder,girder/girder,data-exp-lab/girder,kotfic/girder,RafaelPalomar/girder,Kitware/girder,Kitware/girder,data-exp-lab/girder,kotfic/gi... | plugins/audit_logs/server/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json,httplib\n\nconfig_data = json.load(open('conf/net/ext_service/parse.json'))\n\nsilent_push_msg = {\n \"where\": {\n \"deviceType\": \"ios\"\n },\n \"data\": {\n # \"alert\": \"The Mets scored! The game is now tied ... | python | edit | 3 | 0 | bsd-3-clause | bd69ad0bf57876cef01cc8f7cdce49a301eb2444 | shankari/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,yw374cornell/e-mission-server,yw374cornell/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,shankari/e-mission-ser... | bin/remotePush.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nMPI utilities.\n\"\"\"\n\nfrom mpi4py import MPI\nimport twiggy\n\nclass MPIOutput(twiggy.outputs.Output):\n \"\"\"\n Output messages to a file via MPI I/O.\n \"\"\"\n\n def __init__(self, name, ... | python | edit | 1 | 2 | bsd-3-clause | ad21c9255f6246944cd032ad50082c0aca46fcb3 | cerrno/neurokernel | neurokernel/tools/mpi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport foauth.providers\n\n\nclass Flickr(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'http://www.flickr.com/'\n docs_url = 'http://www.flickr.com/services/api/'\n category = 'Pictures'\n\n ... | python | edit | 1 | 2 | bsd-3-clause | 40ca8cde872704438fecd22ae98bc7db610de1f9 | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | services/flickr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Azure:\n resource_group = \"MajavaShakki\"\n location = \"northeurope\"\n cosmosdb_name = f\"{resource_group}mongo\".lower()\n plan_name = f\"{resource_group}Plan\"\n site_name = f\"{resource_group}Site\"\n\nclass Mongo:\n datab... | python | edit | 1 | 0 | mit | aecaecfa20caba28af1e8117ffc14eeb6460872e | Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki | deployment/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport matplotlib\nmatplotlib.use('Agg')\n\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\nclass AnimatedGif:\n\n \"\"\" Setup various rendering things\n \"\"\"\n def __init__(self, dpi=100, colors=\"P... | python | edit | 1 | 6 | apache-2.0 | d012763c57450555d45385ed9b254f500388618e | stevearm/automata | automata/render.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nimport typer\nfrom typer.testing import CliRunner\n\nfrom first_steps import tutorial001 as mod\n\nrunner = CliRunner()\napp = typer.Typer()\napp.command()(mod.main)\n\n\... | python | edit | 3 | 2 | mit | cde63b076027345486e4e836a02811962ad5bcaa | tiangolo/typer,tiangolo/typer | tests/test_completion.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make sure things are loaded right."
},
{
"role": "assistant",
"content": "if __name__ == \"__main__\":\n import pycket.values\n import pycket.config\n from pycket.env import w_global_config\n #w_global_config.set_link... | python | new_file | 4 | 0 | mit | d6a03fad6c9280981ae3beee24de89bd6361bcc9 | samth/pycket,pycket/pycket,pycket/pycket,samth/pycket,samth/pycket,pycket/pycket | dumbrepl.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest_twisted\n\nfrom hendrix.ux import main\nfrom hendrix.options import HendrixOptionParser\n\n\ndef test_no_arguments_gives_help_text(mocker):\n\n class MockFile(object):\n @classmethod\n def write(cls, whatever)... | python | edit | 1 | 1 | mit | b352c3e1f5e8812d29f2e8a1bca807bea5da8cc4 | hangarunderground/hendrix,hendrix/hendrix,hangarunderground/hendrix,hendrix/hendrix,jMyles/hendrix,hendrix/hendrix,jMyles/hendrix,hangarunderground/hendrix,hangarunderground/hendrix,jMyles/hendrix | test/test_hx_launcher.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add convenience functions 'request' and 'notify'\n\nCloses #54"
},
{
"role": "assistant",
"content": "\"\"\"__init__.py\"\"\"\nfrom .request import Request, Notification\nfrom .http_client import HTTPClient\n\n\ndef request(endpo... | python | new_file | 4 | 1 | mit | c300453131360ef9c48586f48287d6c24b3a94a2 | bcb/jsonrpcclient | jsonrpcclient/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nimport os\nimport wiringpi\nfrom garden_lighting.MCP23017.MCP23017 import MCP23017\n\n\nclass RaspberryMCP23017(MCP23017):\n def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1):\n super().__init__(dev_addr, rst_pin,... | python | edit | 1 | 1 | mit | 44520918dc0fad40f3afcfc2cdfde6f3208543cd | ammannbros/garden-lighting,ammannbros/garden-lighting,ammannbros/garden-lighting,ammannbros/garden-lighting | garden_lighting/MCP23017/raspberry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef pipe(*functions):\n def closure(x):\n for fn in functions:\n if not out:\n out = fn(x)\n else:\n out = fn(out)\n return out\n\n return closure\n\n```\n\nApply this ... | python | edit | 2 | 3 | mit | 4d1b96792f73777adaa0a79341901ca82f57839b | log0ymxm/corgi | use/functional.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTests for POSIX-compatible `sleep`.\n\nhttps://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html\n\"\"\"\n\nimport time\nfrom helpers import check_version, run\n\n\ndef test_version():\n \"\"\"Check that we're using B... | python | edit | 1 | 1 | isc | 3751daef539d26b6909f142949293c20da3f8fe5 | duckinator/boreutils,duckinator/boreutils | test/test_sleep.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add imports imports to trigger cx_Freeze hooks"
},
{
"role": "assistant",
"content": "import logging\n\n# These are required to activate the cx_Freeze hooks\nimport matplotlib\nimport matplotlib.backends.backend_qt5agg\nimport Py... | python | new_file | 4 | 0 | mit | fb1422c22e570da21279edee0ea79605e74f7a92 | mretegan/crispy,mretegan/crispy | crispy/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Token:\n \"\"\"Representation of a single Token\"\"\"\n\n def __init__(self, _type, lexeme, literal=None):\n self.type = _type\n self.lexeme = lexeme\n self.literal = literal\n\n def __repr__(self):\n ... | python | edit | 1 | 4 | mit | afd27c62049e87eaefbfb5f38c6b61b461656384 | bambinos/formulae | formulae/token.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAsphalt framework mixin for Kyokai.\n\"\"\"\nimport logging\n\nimport asyncio\nfrom functools import partial\nfrom typing import Union\n\nfrom asphalt.core import Component, resolve_reference, Context\nfrom typeguard import check_ar... | python | edit | 1 | 2 | mit | 3ce1b928f36c314ab07c334843b2db96626f469e | SunDwarf/Kyoukai | kyokai/asphalt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Git Commit Auto Save.\n\nSublime Text 3 package to auto save commit messages when the window is closed.\nThis allows the user to close the window without having to save before,\nor having to deal with the \"Save File\" popup.\n\"\"\"\... | python | edit | 1 | 3 | mit | dad3eb5c1b0e188671884e97260422a90bdd5c21 | aristidesfl/sublime-git-commit-message-auto-save | gitcommitautosave.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\nimport numpy as np\nimport theano\n\n\ndef print_layer_shapes(model, input_shape):\n \"\"\"\n Utility function that prints the shape of the output at each layer.\n\n Arguments:\n model:... | python | edit | 1 | 3 | apache-2.0 | 1ad453f6d01d4007662fa63d59508d27bac029d5 | asampat3090/keras,xurantju/keras,keras-team/keras,cheng6076/keras,rudaoshi/keras,bottler/keras,ashhher3/keras,wxs/keras,nzer0/keras,rodrigob/keras,pthaike/keras,EderSantana/keras,zxsted/keras,abayowbo/keras,zxytim/keras,danielforsyth/keras,hhaoyan/keras,jalexvig/keras,chenych11/keras,brainwater/keras,amy12xx/keras,davi... | keras/utils/model_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n#coding=UTF-8\nimport os\nimport sys\n#installed\nimport pytest\n#local\nsys.path.append(os.path.split(os.path.split(__file__)[0])[0])\nimport searchcolor\n\nfrom api_keys import GoogleKeyLocker as Key\n\nKey = Key()... | python | edit | 3 | 4 | mit | d29410b39af1165ba520e7ecad7e6e9c36a7fd2f | Tathorack/searchcolor,Tathorack/searchcolor | test/test_basic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nimport numpy as np\nfrom IPython.core.display import Image\n\nimport praw\n\n\nreddit = praw.Reddit(\"BayesianMethodsForHackers\")\nsubreddit = reddit.get_subreddit( \"pics\" )\n\ntop_submissions = subreddit.get_top()\n\n\nn_... | python | edit | 3 | 0 | mit | 48e15b8f99bb0714b7ec465a0131e452c67004e5 | chengwliu/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,ultinomics/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,Fillll/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,ifduyue/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,jrmontag/Probabilistic-Programming-and-Bayesian-... | Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport xmlrpclib\nimport cPickle\nimport subprocess\nfrom time import sleep\n\np = None\ns = None\n\ndef start_plot_server():\n global p\n if p is None:\n p = subprocess.Popen([\"python\", \"plot_server.py\"])\n\ndef stop_plot_... | python | edit | 6 | 4 | bsd-3-clause | 9547988a1a9ef8faf22d9bfa881f4e542637fd46 | certik/mhd-hermes,certik/mhd-hermes | utils.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom threading import local\n\n\n_local = local()\n\n\ndef get_current_context(silent=False):\n \"\"\"Returns the current click context. This can be used as a way to\n access the current context object from anywhere. This is a more ... | python | edit | 1 | 3 | bsd-3-clause | e0d510b51f44b421696958660f2ca32ee41413bd | pallets/click,mitsuhiko/click | click/globals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom imhotep.tools import Tool\nfrom collections import defaultdict\nimport json\nimport os\nimport logging\n\nlog = logging.getLogger(__name__)\n\n\nclass FoodCritic(Tool):\n\n def invoke(self,\n dirname,\n f... | python | edit | 4 | 1 | mit | a6034ffa4d81bb57c5d86876ee72e0436426e6d2 | scottjab/imhotep_foodcritic | imhotep_foodcritic/plugin.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- encoding: utf-8\n\nimport os\n\nfrom travistooling import ROOT\n\n\ndef get_rfc_readmes(repo):\n rfcs_dir = os.path.join(repo, 'docs', 'rfcs')\n for root, _, filenames in os.walk(rfcs_dir):\n for f ... | python | edit | 1 | 4 | mit | d814c9c131f2c2957173302f7c4c1cbf2b719b45 | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | check_rfc_header.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python2.5\n#\n# Copyright 2009 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licen... | python | edit | 1 | 1 | apache-2.0 | 172768dacc224f3c14e85f8e732209efe9ce075a | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | app/soc/models/project_survey.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom django.http import Http404\nfrom django.views.generic import TemplateView\n\nimport settings\n\n\nclass VerificationView(TemplateView):\n \"\"\"\n This simply adds the verif... | python | edit | 1 | 3 | bsd-3-clause | 021cf436c23c5c705d0e3c5b6383e25811ade669 | nkuttler/django-webmaster-verification,nkuttler/django-webmaster-verification | webmaster_verification/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.contrib.auth.views import logout_then_login, login\nfrom django.contrib.auth.forms import AuthenticationForm\n\nurlpatterns = patterns('',\n (r'^login/$', login, {}, 'login' ),\n ... | python | edit | 6 | 0 | mit | 66f06164a5654f2925fb16a1ce28638fd57e3a9e | hfrequency/django-issue-tracker | issue_tracker/accounts/urls.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cupy import core\n\nlogical_and = core.create_comparison(\n 'logical_and', '&&',\n '''Computes the logical AND of two arrays.\n\n .. seealso:: :data:`numpy.logical_and`\n\n ''',\n require_sortable_dtype=False)\n\n\nlogic... | python | edit | 1 | 0 | mit | e0671b84c3d11b738d6fe6981d8b2fac87828558 | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | cupy/logic/ops.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass APIMismatch(Exception):\n pass\n\ndef translateArgs(request, api_version):\n args = request.args\n if request.method == 'system_add_keyspace' \\\n or request.method == 'system_update_keyspace':\n args = adapt_ksdef_... | python | edit | 1 | 5 | mit | 69a8528801ae5c3fdde57b9766917fcf8690c54e | Metaswitch/Telephus,driftx/Telephus,ClearwaterCore/Telephus,driftx/Telephus,Metaswitch/Telephus,ClearwaterCore/Telephus | telephus/translate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import (\n unicode_literals,\n absolute_import,\n print_function,\n division,\n )\nstr = type('')\n\n\nimport pytest\n\nimport gpiozero.cli.pinout as pinout\n\n\ndef test_args_incorrect():\n with pytest.rai... | python | edit | 1 | 1 | bsd-3-clause | 117e4f59720de9d13ddb4eaa439915addb616f1d | waveform80/gpio-zero,MrHarcombe/python-gpiozero,RPi-Distro/python-gpiozero | tests/cli/test_pinout.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# U... | python | edit | 1 | 4 | apache-2.0 | debdc71a1c22412c46d8bf74315a5467c1e228ee | ArchiFleKs/magnum,ArchiFleKs/magnum,openstack/magnum,openstack/magnum | magnum/tests/unit/common/test_exception.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nScript that trains graph-conv models on HOPV dataset.\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nimport numpy as np\n\nfrom models import GraphConvTens... | python | edit | 1 | 0 | mit | 8090fa9c072656497ff383e9b76d49af2955e420 | Agent007/deepchem,lilleswing/deepchem,lilleswing/deepchem,Agent007/deepchem,peastman/deepchem,miaecle/deepchem,peastman/deepchem,ktaneishi/deepchem,miaecle/deepchem,Agent007/deepchem,deepchem/deepchem,ktaneishi/deepchem,deepchem/deepchem,ktaneishi/deepchem,miaecle/deepchem,lilleswing/deepchem | examples/hopv/hopv_graph_conv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport unittest\n\nimport git_mnemonic as gm\n\nclass GitMnemonicTests(unittest.TestCase):\n def test_encode(self):\n self.assertTrue(gm.encode(\"master\"))\n\n def test_decode(self):\n self.asse... | python | edit | 1 | 1 | mit | 991973e554758e7a9881453d7668925902e610b9 | glenjamin/git-mnemonic | tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: latin-1\n\n\"\"\"\npax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.\n\"\"\"\n\nfrom mininet.node import Node\nfrom mininet.log import info, warn\n\nclass PaxNode( Node ):\n \"... | python | edit | 2 | 2 | apache-2.0 | 7641293947dba9f721cdd0364a638b9f7714033a | niksu/pax,TMVector/pax,niksu/pax,niksu/pax,TMVector/pax | examples/pax_mininet_node.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.13 on 2018-07-24 22:43\nfrom __future__ import unicode_literals\n\nimport django.contrib.postgres.fields.jsonb\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\... | python | edit | 1 | 0 | mit | 4a782f94e8fe5a26e2998408c2cb013f2aebe9ac | jayoshih/content-curation,jayoshih/content-curation,jayoshih/content-curation,fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,fle-internal/content-curation,jayoshih/content-curation,DXCanas/content-curation,DXCanas/content-curat... | contentcuration/contentcuration/migrations/0091_auto_20180724_2243.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# flake8: noqa\n\n\"\"\"\nA library for creating Latex files.\n\n.. :copyright: (c) 2014 by Jelte Fennema.\n :license: MIT, see License for more details.\n\"\"\"\n\nfrom .document import Document\nfrom .math import Math, VectorName, Mat... | python | edit | 1 | 0 | mit | e056dc3581785fe34123189cccd9901e1e9afe71 | sebastianhaas/PyLaTeX,sebastianhaas/PyLaTeX,votti/PyLaTeX,ovaskevich/PyLaTeX,JelteF/PyLaTeX,bjodah/PyLaTeX,votti/PyLaTeX,jendas1/PyLaTeX,bjodah/PyLaTeX,jendas1/PyLaTeX,JelteF/PyLaTeX,ovaskevich/PyLaTeX | pylatex/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport shlex\nimport sys\n\nfrom canaryd_packages import six\n# Not ideal but using the vendored in (to requests) chardet package\nfrom canaryd_packages.requests.packages import chardet\n\nfrom canaryd.log import logger\n\n\nif o... | python | edit | 1 | 4 | mit | 358df6514b19424d5576d7a0a74ea15d71a3565b | Oxygem/canaryd,Oxygem/canaryd | canaryd/subprocess.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n vcfexplorer.frontend.views\n\n VCF Explorer frontend views\n\"\"\"\n\nfrom flask import send_file\n\nfrom . import bp\n\n@bp.route('/', defaults={'path': ''})\n@bp.route('/<path:path>')\ndef index(path):\n return send_file... | python | edit | 1 | 1 | mit | 1da421dcb4356a4f572bc1a815ed7e87dc619f64 | CuppenResearch/vcf-explorer,CuppenResearch/vcf-explorer,CuppenResearch/vcf-explorer,CuppenResearch/vcf-explorer | vcfexplorer/frontend/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport datetime\nfrom django.utils.encoding import force_unicode\nfrom django.utils.functional import Promise\n\n\nclass LazyEncoder(json.JSONEncoder):\n \"\"\"Taken from https://github.com/tomchristie/django-rest-framework/... | python | edit | 3 | 2 | bsd-3-clause | f76783ddb616c74e22feb003cb12952375cad658 | SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare... | corehq/apps/hqwebapp/encoders.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic.detail import ContextMixin\nfrom django.utils.decorators import method_decorator\nfrom django.contrib.auth.decorators import login_required\n\nfrom apps.categories.models import Category\nfrom apps.books.models imp... | python | edit | 1 | 1 | mit | 946f8ff1c475ebf6f339c4df5eb5f7069c5633e9 | vuonghv/brs,vuonghv/brs,vuonghv/brs,vuonghv/brs | apps/core/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n__version__ = \"0.16.0rc7\"\nversion = tuple(__version__.split('.'))\n\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\n\n```\n\nApply this change: Bump version 0.16.0rc7 --> 0.16.0rc8\n\nSigned-off-by: Jack... | python | edit | 1 | 0 | mit | 0f4dc67fb9522801f010853d25939c0ef531f8ff | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nWelcome to pyinfra.\n'''\n\nimport logging\n\n\n# Global flag set True by `pyinfra_cli.__main__`\nis_cli = False\n\n# Global pyinfra logger\nlogger = logging.getLogger('pyinfra')\n\n# Setup package level version\nfrom .version import _... | python | edit | 1 | 0 | mit | 48dcf46b048c94437b957616a363f9f64447b8da | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport binascii\n\n\nfrom django.shortcuts import render, redirect, get_object_or_404\nfrom django.contrib import messages\nfrom django.db import IntegrityError, transaction\nfrom django.conf import settings\nfrom django.template.loader imp... | python | edit | 4 | 3 | mit | ab41dfa53325ee90032c4ed1b2e6e3c90b808ecf | Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/fbxnano,Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters | contact/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport string\n\nimport pytest\n\n@pytest.fixture\ndef identity_fixures():\n l = []\n for i, c in enumerate(string.ascii_uppercase):\n l.append(dict(\n name='identity_{0}'.format(i),\n access_key_id='somea... | python | edit | 1 | 2 | mit | 211972701d8dbd39e42ec5a8d10b9c56be858d3e | nocarryr/AWS-Identity-Manager | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import Page, PageRead, Tag\n\n\nclass PageAdmin(admin.ModelAdmin):\n search_fields = [\"title\"]\n list_display = [\"title\", \"parent\", \"updated\"]\n prepopulated_fields = {\"slug... | python | edit | 1 | 2 | bsd-3-clause | 219c474860ca7674070ef19fa95f0282b7c92399 | ahernp/DMCM,ahernp/DMCM,ahernp/DMCM | mpages/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns\nfrom views import doc\n\nurlpatterns = patterns(\n '',\n (r'^api$', doc),\n (r'^example/(?P<resource_name>\\w+)/', 'tastydocs.views.example_data'),\n)\n\n```\n\nApply this change: Add... | python | edit | 1 | 0 | bsd-3-clause | b20320301eb311bb1345061a8b74ac63495051b1 | juanique/django-tastydocs,juanique/django-tastydocs,juanique/django-tastydocs,juanique/django-tastydocs | tastydocs/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url, include\nfrom django.views.generic import TemplateView\nfrom rest_framework import routers\n\nfrom .views import FeatureRequestViewSet, ClientViewSet, ProductAreaViewSet\n\nrouter = routers.DefaultRouter()\... | python | edit | 1 | 0 | mit | a45f5ca2e92cfaa4478d632ada3889b81fef5f53 | wkevina/feature-requests-app,wkevina/feature-requests-app,wkevina/feature-requests-app | features/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.db import models\nfrom phonenumber_field.modelfields import PhoneNumberField\n\n\nclass Caller(models.Model):\n \"\"\"A caller is defined uniquely by their phone number.\n\n :param bool blacklist... | python | edit | 1 | 2 | unlicense | 682f45ffd222dc582ee770a0326c962540657c68 | rdegges/django-twilio,aditweb/django-twilio | django_twilio/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nA library whose purpose is to provide a low level layer between the CoNLL format\nand python code.\n\"\"\"\n\n__all__ = ['exception', 'load', 'tree', 'unit', 'util']\n\nfrom .load import load_from_string, load_from_file, load_from_u... | python | edit | 14 | 0 | mit | 4bcc0aae53def04e16e87499b1321256ff35a7c1 | pyconll/pyconll,pyconll/pyconll | pyconll/__init__.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\nimport sys\nimport assembler6502_tokenizer as tokenizer\nimport assembler6502_parser as parser\n\ndef output_byte(hexcode):\n sys.stdout.write(hexcode)\n #sys.stdout.write(chr(int(hexcode, 16)))\n\ndef main()... | python | edit | 3 | 3 | mit | 9c07f8fdb9c955f49cf6ff92a25b1c0629157811 | technetia/project-tdm,technetia/project-tdm,technetia/project-tdm | assembler6502.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport sys\nfrom six import PY3\nif PY3:\n from urllib.parse import urlsplit, parse_qsl\nelse:\n from urlparse import urlsplit, parse_qsl\n\nimport werkzeug as wz\n\nfrom flask import Flask, url_for, render_template_s... | python | edit | 10 | 1 | bsd-3-clause | b89f6981d4f55790aa919f36e02a6312bd5f1583 | mikeboers/Flask-Images | tests/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\ntry:\n from django.conf import settings\n\n settings.configure(\n DEBUG=True,\n USE_TZ=True,\n DATABASES={\n \"default\": {\n \"ENGINE\": \"django.db.backends.sqlite3\",\n ... | python | edit | 1 | 3 | mit | 15551db6af7e32ec4cc13fee4b73cb95b5a3a774 | webkom/django-holonet | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for errors.py\"\"\"\n\nimport aiohttp\n\n\ndef test_bad_status_line1():\n err = aiohttp.BadStatusLine(b'')\n assert str(err) == \"b''\"\n\n\ndef test_bad_status_line2():\n err = aiohttp.BadStatusLine('Test')\n assert... | python | edit | 1 | 1 | apache-2.0 | 891ca8ee117f462a1648e954b756f1d29a5f527c | jettify/aiohttp,esaezgil/aiohttp,z2v/aiohttp,arthurdarcet/aiohttp,pfreixes/aiohttp,z2v/aiohttp,mind1master/aiohttp,KeepSafe/aiohttp,mind1master/aiohttp,juliatem/aiohttp,hellysmile/aiohttp,esaezgil/aiohttp,esaezgil/aiohttp,arthurdarcet/aiohttp,panda73111/aiohttp,pfreixes/aiohttp,z2v/aiohttp,alex-eri/aiohttp-1,singulared... | tests/test_errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass YubicoError(Exception):\n \"\"\" Base class for Yubico related exceptions. \"\"\"\n pass\n\n\nclass StatusCodeError(YubicoError):\n def __init__(self, status_code):\n self.status_code = status_code\n\n def __str__(s... | python | edit | 1 | 1 | bsd-3-clause | ce9da309294f2520f297980d80773160f050e8bf | Kami/python-yubico-client | yubico/yubico_exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management import call_command\n\nfrom celery import task\n\n\n@task\ndef syncldap():\n \"\"\"\n Call the appropriate management command to synchronize the LDAP users\n with the local database.\n \"\"\"\n cal... | python | edit | 1 | 1 | bsd-3-clause | 70c9deb44cbbce13fbe094640786398cb4683b08 | alexsilva/django-ldap-sync,jbittel/django-ldap-sync,PGower/django-ldap3-sync,alexsilva/django-ldap-sync | ldap_sync/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom lxml import html\nfrom PIL import Image\nimport requests\n\ndef enlarge_image(image_file):\n\timage = Image.open(image_file)\n\tenlarged_size = map(lambda x: x*2, image.size)\n\tenlarged_image = image.resize(enlarged_size)\n\n\treturn ... | python | edit | 8 | 3 | mit | 026fade3f064f0185fa3a6f2075d43353e041970 | SkullTech/whois-scraper | whois-scraper.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom six import text_type\n\nfrom django.utils.text import slugify\nfrom django.utils.html import format_html\n\n\nclass MenuItem(object):\n def __init__(self, label, url, name=None, classnames=... | python | edit | 1 | 3 | bsd-3-clause | d6f2b132844d1923932447c0ce67c581f723f433 | JoshBarr/wagtail,m-sanders/wagtail,hamsterbacke23/wagtail,benemery/wagtail,jordij/wagtail,nutztherookie/wagtail,mixxorz/wagtail,nutztherookie/wagtail,dresiu/wagtail,serzans/wagtail,mixxorz/wagtail,bjesus/wagtail,nrsimha/wagtail,nilnvoid/wagtail,inonit/wagtail,torchbox/wagtail,wagtail/wagtail,dresiu/wagtail,davecranwell... | wagtail/wagtailadmin/menu.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport numpy as np\nfrom numpy.testing import assert_array_almost_equal\n\nfrom big_o import complexities\n\n\nclass TestComplexities(unittest.TestCase):\n\n def test_compute(self):\n x = np.linspace(10, 100, 100)... | python | edit | 1 | 2 | bsd-3-clause | 82ae5e5cf3da57af771aa688ec7d951879423578 | pberkes/big_O | big_o/test/test_complexities.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.services.email.service\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2017 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom typing import List, Optional\n\nfrom ... import email\nfrom... | python | edit | 1 | 2 | bsd-3-clause | 813ebbce962e7d59602a1f1693359b9d61bbef07 | homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps | byceps/services/email/service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models import CharField\nfrom django_filters import rest_framework as filters\nfrom . import models\n\n\nclass DefaultFilterMeta:\n \"\"\"\n Set our default Filter configurations to DRY up the FilterSet Meta classes.\n ... | python | edit | 1 | 2 | mit | 139e6acc19040d89f304875c533513c9651f2906 | jimtyhurst/team-budget,hackoregon/team-budget,hackoregon/team-budget,hackoregon/team-budget,jimtyhurst/team-budget,jimtyhurst/team-budget | budget_proj/budget_app/filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom py2neo import Graph, authenticate\n\n\nclass Neo4j:\n\n def __init__(self, host, port, username=None, password=None):\n self.host = host\n self.port = port\n self.username = username\n se... | python | edit | 1 | 3 | mit | 3bce013c51c454721de3a868ea6d8e8c6d335112 | nicolewhite/cycli,nicolewhite/cycli | cycli/neo4j.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ast\n\nfrom .base import BaseAnalyzer, Result\n\n\nclass DB_BackendsVisitor(ast.NodeVisitor):\n\n def __init__(self):\n self.found = []\n\n removed_items = {\n 'django.db.backends.postgresql':\n 'django... | python | edit | 1 | 4 | isc | 7e9db30ee426993b881357b0158d243d0a4c15c9 | alfredhq/djlint | djlint/analyzers/db_backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\nfrom vumi.tests.utils import FakeRedis\n\nfrom go.base.tests.utils import VumiGoDjangoTestCase, declare_longcode_tags\nfrom go.vumitools.tests.utils import CeleryTestMixIn\nfrom go.vumitools.api import Vu... | python | edit | 1 | 2 | bsd-3-clause | 8866a828e029c2db6439c16d49ba636e460fbf49 | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/apps/tests/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.8.0\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\", \".\", 1).split(\".\")\n ]\n)\n\n```\n\n... | python | edit | 1 | 0 | mit | 154ebba6f46acac1816e96993619b45ade314ba8 | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | dthm4kaiako/config/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for vectors.\"\"\"\n\nfrom sympy import sympify\n\nfrom drudge import Vec\n\n\ndef test_vecs_has_basic_properties():\n \"\"\"Tests the basic properties of vector instances.\"\"\"\n\n base = Vec('v')\n v_ab = Vec('v', in... | python | edit | 1 | 2 | mit | 457d8002a3758cc8f28ba195a21afc4e0d33965a | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | tests/vec_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# TODO: Test robustness, test speed\nimport unittest, time, sys\nfrom common_conf import *\nfrom test_server import EchoServer, MessageServer\nimport argparse\nimport threading\nfrom test_server import TestMessageServer\nfrom test_client im... | python | edit | 7 | 0 | mit | 5e53f1e86fc7c4f1c7b42479684ac393c997ce52 | qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv | client/test/test-unrealcv.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from django.apps.registry import apps\n\n get_apps = apps.get_apps\n cache = None\nexcept ImportError:\n from django.db.models.loading import cache\n\n get_apps = cache.get_apps\n apps = None\n\n\ndef get_app(app_la... | python | edit | 1 | 2 | bsd-3-clause | 4e0ec0fdf791fc9af1e83171b54054bd53d5536b | beanbaginc/django-evolution | django_evolution/compat/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.contrib.auth.decorators import login_required\nfrom meetings.views import (PastMeetings,\n ProposeTopic,\n MyTopics,\n ... | python | edit | 10 | 0 | mit | b636affedea494f1733bf413986a8546d3495c53 | agfor/chipy.org,bharathelangovan/chipy.org,bharathelangovan/chipy.org,agfor/chipy.org,tanyaschlusser/chipy.org,bharathelangovan/chipy.org,brianray/chipy.org,brianray/chipy.org,tanyaschlusser/chipy.org,brianray/chipy.org,chicagopython/chipy.org,chicagopython/chipy.org,tanyaschlusser/chipy.org,chicagopython/chipy.org,chi... | chipy_org/apps/meetings/urls.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, logging\nfrom flask import Flask\nfrom raven.contrib.flask import Sentry\n\napp = Flask(__name__)\n\napp.config.from_object(os.environ.get('SETTINGS'))\n\napp.logger.debug(\"\\nConfiguration\\n%s\\n\" % app.config)\n\n# Sentry ex... | python | edit | 1 | 0 | mit | 097cc817894c8bd05711f92916b184b88c108fb9 | LandRegistry/decision-alpha,LandRegistry/decision-alpha | decision/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nx = list(range(10))\nprint(x[::-1])\nprint(x[::2])\nprint(x[::-2])\n\n```\n\nApply this change: tests: Add small testcase for 3-arg slices."
},
{
"role": "assistant",
"content": "x = list(range(10))\nprint(x[::-1])\nprint(x[::2]... | python | edit | 1 | 0 | mit | d07bf029b7ba9b5ef1f494d119a2eca004c1818a | neilh10/micropython,danicampora/micropython,tuc-osg/micropython,noahchense/micropython,ahotam/micropython,alex-march/micropython,SungEun-Steve-Kim/test-mp,suda/micropython,SungEun-Steve-Kim/test-mp,noahwilliamsson/micropython,neilh10/micropython,aethaniel/micropython,noahwilliamsson/micropython,chrisdearman/micropython... | tests/basics/list_slice_3arg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest2\n\nfrom sparts.vservice import VService\n\n\nclass BaseSpartsTestCase(unittest2.TestCase):\n def assertNotNone(self, o, msg=''):\n self.assertTrue(o is not None, msg)\n\nclass SingleTaskTestCase(BaseSpartsTestCase... | python | edit | 1 | 2 | bsd-3-clause | a9e69025db7bf3c2f3cdf241f7c9b60a1e78ca58 | pshuff/sparts,facebook/sparts,bboozzoo/sparts,fmoo/sparts,facebook/sparts,djipko/sparts,fmoo/sparts,pshuff/sparts,djipko/sparts,bboozzoo/sparts | tests/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport extractor.ui.mainapplication as ui\nimport Tkinter as tk\n\ndef main():\n root = tk.Tk()\n root.title('SNES Wolfenstein 3D Extractor')\n root.minsize(400, 100)\n ui.MainApplication(root).pack(side=\"top\", fill=\"both\", ... | python | edit | 3 | 1 | mit | f0acf5023db56e8011a6872f230514a69ec9f311 | adambiser/snes-wolf3d-extractor | extractor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom subprocess import Popen, PIPE\n\ndef get_darwin_version():\n p = Popen([\"sw_vers\", \"-productVersion\"], stdout = PIPE, stderr = PIPE)\n st = p.wait()\n if st:\n raise RuntimeError(\n \"Cou... | python | edit | 1 | 5 | bsd-3-clause | 4fd47cf73d59cb9e9d83cea12026878f65df858a | cournape/numscons,cournape/numscons,cournape/numscons | numscons/core/allow_undefined.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework.permissions import IsAuthenticated\nfrom rest_framework.response import Response\nfrom .serializers import ProductSerializer\nfrom ..models import Product\nfrom django.http import Http404\nfrom rest_framework.views impor... | python | edit | 1 | 2 | bsd-3-clause | 401aafee6979cc95692555548b1fc10dea44a44e | KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend | product/api/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nBase package to import top level modules\n\"\"\"\nfrom formish.forms import Form\nfrom formish.validation import FieldError, FormError, FormishError\nfrom formish.widgets import *\nfrom formish.util import form_in_request\n\n\n```\n... | python | edit | 9 | 0 | bsd-3-clause | 234e50c105b7d7d1e77e1c392200668891130840 | ish/formish,ish/formish,ish/formish | formish/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom groundstation import logger\nlog = logger.getLogger(__name__)\n\n\ndef handle_describeobjects(self):\n if not self.payload:\n log.info(\"station %s sent empty DESCRIVEOBJECTS payload - new database?\" % (str(self.origin)))\n ... | python | edit | 1 | 4 | mit | 7a1254fa530b02d32f39e2210ec864f78dd9504a | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | groundstation/transfer/response_handlers/describeobjects.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\ndef fixture_response(path):\n return open(os.path.join(\n os.path.dirname(__file__),\n 'fixtures',\n path)).read()\n\n```\n\nApply this change: Fix file handlers being left open for fixtures"
},
{
... | python | edit | 1 | 1 | mit | 0180aead701820d2de140791c3e271b4b8a7d231 | accepton/accepton-python | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"Scheduled tasks to be run by erpnext_ebay\"\"\"\n\nfrom frappe.utils.background_jobs import enqueue\n\n\ndef all():\n pass\n\n\ndef hourly():\n enqueue('erpnext_ebay.sync_orders.sync',\n que... | python | edit | 1 | 1 | mit | 142022516f310aeb58f3560031b2266f39a0f2e5 | bglazier/erpnext_ebay,bglazier/erpnext_ebay | erpnext_ebay/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTODO\n\"\"\"\n\n__docformat__ = 'restructuredtext'\n\nimport fmri, hrf, utils\nimport fmristat\n\nfrom nipy.testing import Tester\ntest = Tester().test\nbench = Tester().bench\n\n```\n\nApply this change: Fix missing import of formu... | python | edit | 7 | 0 | bsd-3-clause | 678a6ed9e24b8f91933584ab211ee9f3b2643aad | alexis-roche/nipy,alexis-roche/nireg,arokem/nipy,arokem/nipy,bthirion/nipy,arokem/nipy,alexis-roche/nipy,nipy/nireg,alexis-roche/register,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/niseg,alexis-roche/nireg,bthirion/nipy,arokem/nipy,bthirion/nipy,alexis-roche/nipy,alexis-roche/register,bthirion/nipy,alexis-roche/nise... | nipy/modalities/fmri/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom flask import Flask, render_template, g\nfrom flask.ext.appconfig import AppConfig\n\n\ndef create_app(configfile=None):\n app = Flask('massa')\n AppConfig(app, configfile)\n\n @app.route('/')\n de... | python | edit | 1 | 1 | mit | 9971e5424b998f45e26b9da8288f20d641885043 | jaapverloop/massa | massa/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport warnings\n\nfrom scipy.constants import find\nfrom numpy.testing import assert_equal, run_module_suite\n\ndef test_find():\n\n warnings.simplefilter('ignore', DeprecationWarning)\n\n keys = find('weak mixing', disp=False)\n ... | python | edit | 1 | 1 | bsd-3-clause | b7971d68256b23646de1ef648181da5ceacd67f8 | WarrenWeckesser/scipy,arokem/scipy,aeklant/scipy,vhaasteren/scipy,lhilt/scipy,jseabold/scipy,fernand/scipy,e-q/scipy,nonhermitian/scipy,ndchorley/scipy,newemailjdm/scipy,scipy/scipy,grlee77/scipy,zerothi/scipy,FRidh/scipy,Shaswat27/scipy,trankmichael/scipy,mgaitan/scipy,vigna/scipy,woodscn/scipy,andyfaff/scipy,jonycgn/... | scipy/constants/tests/test_codata.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\nfrom cellcounter.accounts import views\n\nurlpatterns = patterns('',\n url('^new/$', views.RegistrationView.as_view(), name='register'),\n url('^(?P<pk>[0-9]+)/$', views.UserDetailView.as_... | python | edit | 1 | 0 | mit | 5ab0c1c1323b2b12a19ef58de4c03236db84644d | haematologic/cellcounter,haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcounter,cellcounter/cellcounter | cellcounter/accounts/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom subprocess import Popen, PIPE\n\nfrom mopidy.mixers import BaseMixer\n\nclass OsaMixer(BaseMixer):\n def _get_volume(self):\n try:\n return int(Popen(\n ['osascript', '-e', 'output volume of (get vol... | python | edit | 5 | 3 | apache-2.0 | 96365d3467e1b0a9520eaff8086224d2d181b03b | tkem/mopidy,quartz55/mopidy,tkem/mopidy,pacificIT/mopidy,bacontext/mopidy,mokieyue/mopidy,vrs01/mopidy,ZenithDK/mopidy,ZenithDK/mopidy,priestd09/mopidy,bencevans/mopidy,swak/mopidy,jmarsik/mopidy,jodal/mopidy,ali/mopidy,jodal/mopidy,adamcik/mopidy,rawdlite/mopidy,diandiankan/mopidy,adamcik/mopidy,SuperStarPL/mopidy,aba... | mopidy/mixers/osa.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom registry.models import ResourceCollection\nfrom django.http import HttpResponse, HttpResponseBadRequest\nimport json\n\ndef browse(req):\n ... | python | edit | 1 | 2 | bsd-3-clause | a8218a1c20ea48a3392ef9e6d898a73eb9642d9c | usgin/nrrc-repository,usgin/nrrc-repository,usgin/metadata-repository,usgin/metadata-repository | ui/repository/browse.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import path\nfrom ConfigParser import ConfigParser\nimport requests\nimport sys\n\ndef reverse_lookup(lat, lon):\n if(lat is None or lon is None):\n return None\n\n if not path.exists('./config.ini'):\n return No... | python | edit | 4 | 7 | apache-2.0 | c47c043e76ac037456b8e966a5f9d60a151e3120 | zserg/elodie,zingo/elodie,jmathai/elodie,jmathai/elodie,zingo/elodie,zserg/elodie,zserg/elodie,jmathai/elodie,zserg/elodie,jmathai/elodie,zingo/elodie | elodie/geolocation.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom genes.posix.traits import only_posix\nfrom genes.process.commands import run\n\n\n@only_posix()\ndef chgrp(path, group):\n run(['chgrp', group, path])\n\n\n@only_posix()\ndef chown(path, user):\n run(['ch... | python | edit | 1 | 2 | mit | 1bb00e56897d17d9779f535dc50f602321c26eca | hatchery/Genepool2,hatchery/genepool | genes/gnu_coreutils/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\nimport pdb\n\nfrom defines import *\n\nclass OpeningsMover(object):\n def __init__(self, o_mgr, game):\n self.o_mgr = o_mgr\n self.game = game\n\n def get_a_good_move(self):\n wins = 0\n loss... | python | edit | 5 | 9 | mit | 5cbf2988e9064a49e2d745694c8233513be63a0b | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | openings_mover.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright owners... | python | edit | 1 | 2 | apache-2.0 | cb49f6d3f0ecb367fd76afe2e98c55e48ba1128f | apache/tinkerpop,apache/tinkerpop,krlohnes/tinkerpop,robertdale/tinkerpop,robertdale/tinkerpop,apache/tinkerpop,robertdale/tinkerpop,apache/tinkerpop,krlohnes/tinkerpop,krlohnes/tinkerpop,apache/tinkerpop,apache/incubator-tinkerpop,apache/tinkerpop,apache/incubator-tinkerpop,apache/incubator-tinkerpop,apache/tinkerpop,... | bin/gephi-mock.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport dj_database_url\n\nfrom .base import *\n\n# BASE_NAME and BASE_DOMAIN are intentionally unset\n# They are only needed to seed data in staging and local\nBASE_URL = \"https://voterengagement.com\"\n\n#####################... | python | edit | 2 | 0 | mit | f80c11efb4bcbca6d20cdbbc1a552ebb04aa8302 | citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement | api/config/settings/production.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom service.settings.production import *\n\nALLOWED_HOSTS = [\n 'fantastic-doodle--staging.herokuapp.com',\n]\n\n```\n\nApply this change: Add .herokuapp.com to ALLOWED_HOSTS to support review apps"
},
{
"role": "assistant",
... | python | edit | 2 | 0 | unlicense | 6795e112e4f7037449850a361ab6b2f85fc2a66e | Mystopia/fantastic-doodle | service/settings/staging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Infiltration module.\n\n\"\"\"\nimport numpy as np\nfrom scipy.optimize import fsolve\n\ndef green_ampt_cum_infiltration(F, psi, dtheta, K, t):\n \"\"\"The Green-Ampt cumulative infiltration equation.\n\n \"\"\"\n tmp = psi*d... | python | edit | 1 | 2 | bsd-3-clause | 7255033298cad9a4a7c51bdceafe84c0536e78ba | scottza/PyTOPKAPI,sahg/PyTOPKAPI | pytopkapi/infiltration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponseRedirect, HttpResponse, Http404\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom django.views.generic import View\nfrom homedisplay.utils import publish_w... | python | edit | 6 | 1 | bsd-3-clause | 4241c6cbd9625c61a32ded5725e583da2b63a377 | ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display | homedisplay/display/views.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport angr\nimport simuvex\n\nclass DrillerTransmit(simuvex.SimProcedure):\n '''\n CGC's transmit simprocedure which supports errors\n '''\n\n def run(self, fd, buf, count, tx_bytes):\n\n if self.state.mode == 'fastpath'... | python | edit | 4 | 4 | bsd-2-clause | 3749294ae008c8bda7de9ea538d3d64d5a21c8f4 | shellphish/driller | driller/CGCSimProc.py | rejected_lint | Too many lint violations: 4 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.