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\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nrequirements = [\n]\n\ntest_requirements = [\n]\n\ndist = setup(\n name='cloudpickle',... | python | edit | 1 | 0 | bsd-3-clause | 0eba6d5b468bf2a03883638fd7d3500585029b86 | pczerkas/cloudpickle,pczerkas/cloudpickle | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport argparse\nimport csv\nimport shutil\nimport subprocess\nimport sys\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description=\"Chain together Inkscape extensions\")\n parser.add_argum... | python | edit | 1 | 0 | mit | 6d1117fbba83b258162cc0f397573e21cd31543e | jturner314/inkscape-batch-effect | batch_effect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\n# The name of the iterable ``django-discoverage`` looks for in the discovery\n# process\nTESTED_APPS_VAR_NAME = getattr(settings, 'TESTED_APPS_VAR_NAME', 'TESTS_APPS')\n\n# Modules not to trace\nCOVERAGE_... | python | edit | 1 | 0 | bsd-2-clause | 9c0d79d5d019c941806c09ccb79593b96f5e9fbe | ryankask/django-discoverage,ryankask/django-discoverage | discoverage/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"EVELink - Python bindings for the EVE API.\"\"\"\n\nimport logging\n\nfrom evelink import account\nfrom evelink import api\nfrom evelink import char\nfrom evelink import constants\nfrom evelink import corp\nfrom evelink import eve\nfr... | python | edit | 2 | 1 | mit | 9ab1530a010e974a376c75da806016185199c545 | FashtimeDotCom/evelink,ayust/evelink,bastianh/evelink,zigdon/evelink | evelink/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMinimal example showing the use of the AutoCompleteMode.\n\"\"\"\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\nimport sys\n\nfrom pyqode.qt import QtWidgets\nfrom pyqode.core.api import CodeEdit, ColorScheme\nfrom pyqod... | python | edit | 3 | 0 | mit | d237071aef4cc62c3506d25072937cdc6feab797 | pyQode/pyqode.core,zwadar/pyqode.core,pyQode/pyqode.core | examples/modes/pygments_syntax_highlighter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import annotations\n\nfrom typing import List, Tuple\n\nfrom aoc_common import load_puzzle_input, report_solution\n\n\ndef parse_horizontal(string: str) -> List[Tuple[int, int, int]]:\n \"\"\"Parse the instruction lines i... | python | edit | 1 | 4 | mit | e0b3b767ccb7fc601eb7b40d336f94d75f8aa43c | robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions | 2016/python/aoc_2016_03.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals, division, absolute_import\nfrom builtins import * # pylint: disable=unused-import, redefined-builtin\n\nimport logging\n\nfrom flexget import plugin\nfrom flexget.event import event\n\nlog = logging... | python | edit | 2 | 2 | mit | 2342cd5ede9fac66007d2b15025feeff52c2400b | OmgOhnoes/Flexget,qk4l/Flexget,jacobmetrick/Flexget,jacobmetrick/Flexget,Flexget/Flexget,LynxyssCZ/Flexget,crawln45/Flexget,Flexget/Flexget,ianstalk/Flexget,OmgOhnoes/Flexget,poulpito/Flexget,drwyrm/Flexget,malkavi/Flexget,jawilson/Flexget,malkavi/Flexget,LynxyssCZ/Flexget,jawilson/Flexget,ianstalk/Flexget,gazpachoking... | flexget/plugins/operate/verify_ssl_certificates.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.11.3 on 2017-07-14 19:02\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('to... | python | edit | 1 | 0 | apache-2.0 | 4e88b6ee9c1927aeb312e40335633d2ca9871c8c | onyb/ethane,onyb/ethane,onyb/ethane,onyb/ethane | tokens/migrations/0002_token_token_type.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass WebMentionResponse(models.Model):\n response_body = models.TextField()\n response_to = models.URLField()\n source = models.URLField()\n reviewed = models.BooleanField(default=False)\n c... | python | edit | 3 | 2 | mit | 73dfb1fc4ff62705f37b1128e0684e88be416d8f | easy-as-python/django-webmention | src/webmention/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport scrapy\n\n\nclass SearchSpider(scrapy.Spider):\n name = 'search'\n allowed_domains = ['linkedin.com']\n start_urls = [\n 'https://www.linkedin.com/vsearch/f?type=people&keywords=MateuszMoneta']\n\n def parse(self, ... | python | edit | 1 | 2 | mit | e743f82d93e9501c8b3bd827ee0553ceec8aadb6 | nihn/linkedin-scraper,nihn/linkedin-scraper | linkedin_scraper/spiders/search.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSQL generators for Katagawa.\n\"\"\"\nimport abc\nimport typing\n\n\nclass Token(abc.ABC):\n \"\"\"\n Base class for a token.\n \"\"\"\n def __init__(self, subtokens: typing.List['Token']):\n \"\"\"\n :para... | python | edit | 1 | 1 | mit | 14869bd8c58a393caec488e95d51c282ccf23d0d | SunDwarf/asyncqlio | katagawa/sql/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\n\nimport os\nfrom setuptools import find_packages\n\n__version__ = 'unknown'\nversion_path = os.path.join(os.path.split(__file__)[0], 'banneret/version.py')\n\nwith open(version_path) as version_file:\n ... | python | edit | 1 | 0 | mit | cba6cbc22faf1bf1d1351417854a06b1472c13dc | lancelote/banneret | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask.ext.wtf import Form\nfrom wtforms import BooleanField\nfrom wtforms.validators import DataRequired, Length\nfrom dmutils.forms import StripWhitespaceStringField\n\n\nclass SignerDetailsForm(Form):\n signerName = StripWhitespac... | python | edit | 1 | 0 | mit | d84e6aa022ef5e256807738c35e5069a0a1380d7 | alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend | app/main/forms/frameworks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport getpass\nfrom wikked.bcryptfallback import generate_password_hash\nfrom wikked.commands.base import WikkedCommand, register_command\n\n\nlogger = logging.getLogger(__name__)\n\n\n@register_command\nclass UsersCommand(... | python | edit | 1 | 2 | apache-2.0 | 1782b15b244597d56bff18c465237c7e1f3ab482 | ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked | wikked/commands/users.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n#\n# Copyright 2013 Jay Pipes\n#\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\... | python | edit | 1 | 1 | apache-2.0 | 5cf0b19d67a667d4e0d48a12f0ee94f3387cfa37 | talons/talons,jaypipes/talons | tests/test_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom abc import ABCMeta, abstractmethod\n\n\nclass Driver(metaclass=ABCMeta):\n @abstractmethod\n def create(self):\n pass\n\n @abstractmethod\n def resize(self, id, quota):\n pass\n\n @abstractmethod\n def c... | python | edit | 1 | 1 | apache-2.0 | 5e5a6a55d43bf66c7f71d054b92a66528bf2a571 | PressLabs/cobalt,PressLabs/cobalt | driver/driver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rpc import RPCService\nfrom pi_pin_manager import PinManager\n\n\nALLOWED_ACTIONS = ('on', 'off', 'read')\n\n\nclass GPIOService(RPCService):\n\n def __init__(self, rabbit_url, device_key, pin_config):\n self.pins = PinManage... | python | edit | 1 | 6 | mit | 837b767036f580a8c9d523e0f6c175a75d1dc3b2 | HydAu/ProjectWeekds_Pi-Control-Service,projectweekend/Pi-Control-Service | pi_control_service/gpio_service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext as _\nfrom Django.contrib.auth.models import User\n\nFEMALE = 'F'\nMALE = 'M'\n\n\nclass Teacher(models.Model):\n \"\"\"\n halaqat teachers informations\n ... | python | edit | 1 | 1 | mit | 68d7b3995c49abd8f7096f9498bdbddf6b696d81 | EmadMokhtar/halaqat,EmadMokhtar/halaqat,EmadMokhtar/halaqat | back_office/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make the tests run just via py.test"
},
{
"role": "assistant",
"content": "from factories import post_factory, post\nimport os\nimport sys\n\n\nroot = os.path.join(os.path.dirname(__file__))\npackage = os.path.join(root, '..')\ns... | python | new_file | 4 | 0 | mit | 6f8b5950a85c79ed33c1d00a35a1def2efc7bff5 | kalasjocke/hyp | tests/conftest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport os\nfrom approvaltests.Namer import Namer\n\n\nclass NamerTests(unittest.TestCase):\n def test_class(self):\n n = Namer()\n self.assertEqual(\"NamerTests\", n.getClassName())\n\n def test_method(... | python | edit | 1 | 1 | apache-2.0 | d95001c17b095b713d8a4edacead561ba127aa53 | approvals/ApprovalTests.Python,tdpreece/ApprovalTests.Python,approvals/ApprovalTests.Python,approvals/ApprovalTests.Python | src/NamerTests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nPHASES = (\n ('PHASE_01', 'In review',),\n ('PHASE_02', 'Active',),\n ('PHASE_02', 'Inactive',),\n)\n```\n\nApply this change: Add MintableToken as new token type"
},
{
"role": "assistant",
"content": "PHASES = (\n (... | python | edit | 1 | 0 | apache-2.0 | 004326064c87184e4373ab0b2d8d7ef9b46d94f9 | onyb/ethane,onyb/ethane,onyb/ethane,onyb/ethane | tokens/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis file provides a single interface to unittest objects for our\ntests while supporting python < 2.7 via unittest2.\n\nIf you need something from the unittest namespace it should be\nimported here from the relevant module and then... | python | edit | 8 | 0 | apache-2.0 | 94ec7d4816d2a243b8a2b0a0f2dc8a55a7347122 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/saltunittest.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\"\"\"\nA simple utility to import something by its string name.\n\nAuthors:\n\n* Brian Granger\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (C) 2008-2011 The IP... | python | edit | 1 | 3 | bsd-3-clause | 271b4cd3795cbe0e5e013ac53c3ea26ca08e7a1a | ipython/ipython,ipython/ipython | IPython/utils/importstring.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom datetime import date\n\nimport qual\n\nclass TestProlepticGregorianCalendar(unittest.TestCase):\n def setUp(self):\n self.calendar = qual.ProlepticGregorianCalendar()\n\n def check_valid_date(self, year,... | python | edit | 3 | 1 | apache-2.0 | 6f45e82af789586baf7354b562bbb1587d94b28c | jwg4/qual,jwg4/calexicon | qual/tests/test_calendar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\nfrom distutils.core import Extension\n\n\nmodule = Extension('confluent_kafka.cimpl',\n include_dirs = ['/usr/local/include'],\n lib... | python | edit | 1 | 0 | apache-2.0 | 343422a7f609d0f0c1484ea4573064c7f9d54156 | blindroot/confluent-kafka-python,blindroot/confluent-kafka-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport jsonsempai\n\nimport os\nimport shutil\nimport sys\nimport tempfile\n\nTEST_FILE = '''{\n \"three\": 3,\n \"one\": {\n \"two\": {\n \"three\": 3\n }\n }\n}'''\n\n\nclass TestSempai(object):\n\n de... | python | edit | 3 | 1 | mit | d4c168cc552a444ecb3ee3059f12fa1c34c4419c | kragniz/json-sempai | test_sempai.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\nimport requests\n\nfrom shub.utils import find_api_key\nfrom shub.click_utils import log\n\n\n@click.command(help=\"Download a project's eggs from the Scrapy Cloud\")\n@click.argument(\"project_id\", required=True)\ndef cli(pr... | python | edit | 1 | 3 | bsd-3-clause | d6551b93f5900eca3f44af6e45cf96ba9573fe0e | scrapinghub/shub | shub/fetch_eggs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom .models import Upload\n\n\nclass UploadSerializer(serializers.ModelSerializer):\n class Meta:\n model = Upload\n fields = '__all__'\n\n```\n\nApply this change: Make guid requi... | python | edit | 1 | 1 | mit | c157ddeae7131e4141bca43857730103617b42c4 | stefanw/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide | froide/upload/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glob\n\nfrom mitmproxy import utils, script\nfrom mitmproxy.proxy import config\nfrom netlib import tutils as netutils\nfrom netlib.http import Headers\nfrom . import tservers, tutils\n\nfrom examples import (\n modify_form,\n\n)\... | python | edit | 1 | 9 | mit | 96df077d5485979af256fe7b95708ace658fb8e2 | mitmproxy/mitmproxy,jvillacorta/mitmproxy,tdickers/mitmproxy,dufferzafar/mitmproxy,mosajjal/mitmproxy,cortesi/mitmproxy,tdickers/mitmproxy,dwfreed/mitmproxy,laurmurclar/mitmproxy,gzzhanghao/mitmproxy,ddworken/mitmproxy,mosajjal/mitmproxy,mhils/mitmproxy,mhils/mitmproxy,fimad/mitmproxy,mitmproxy/mitmproxy,ujjwal96/mitmp... | test/mitmproxy/test_examples.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nfrom setuptools import setup, find_packages\nimport pyvim\n\nlong_description = open(\n os.path.join(\n os.path.dirname(__file__),\n 'README.rst'\n )\n).read()\n\n\nsetup(\n name='pyv... | python | edit | 1 | 0 | bsd-3-clause | 182985866082ae039629ac3bcd84e62e169655ba | jonathanslenders/pyvim,amjith/pyvim | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom mopidy import config, ext\nfrom mopidy.exceptions import ExtensionError\n\n__version__ = \"2.1.0\"\n\n\nclass Extension(ext.Extension):\n\n dist_name = \"Mopidy-SoundCloud\"\n ext_name = \"soundcloud\"\n version =... | python | edit | 1 | 3 | mit | 5e7c99844a0687125e34104cf2c7ee87ca69c0de | mopidy/mopidy-soundcloud | mopidy_soundcloud/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nimport pytest\n\nfrom byceps.services.shop.cart.models import Cart\nfrom byceps.services.shop.sequence import service as sequenc... | python | edit | 1 | 1 | bsd-3-clause | 66ba9aa2172fbed67b67a06acb331d449d32a33c | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | tests/services/shop/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\nsetup(name='dscsrf',\n\tversion='1.0',\n\tdescription='Global double-submit Flask CSRF',\n\tpackages=['dscsrf'],\n \tpy_modules=['flask'],\n)\n\n```\n\nApply this change: Prepare for tagging for PyPI"
},
... | python | edit | 1 | 0 | mit | 3eb3cc047f2f5a358066eac8f806580089d70df2 | wkoathp/dscsrf | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"ResourceSync Resource Container object\n\nBoth ResourceList and Change Set objects are collections of Resource\nobjects with additional metadata regarding capabilities and \ndiscovery information.\n\nThis is a superclass for the Resou... | python | edit | 3 | 2 | apache-2.0 | e45c3a759d56dc70907b2169ece9da2415ab1ffa | dans-er/resync,resync/resync,lindareijnhoudt/resync,lindareijnhoudt/resync,dans-er/resync | resync/resource_container.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport time\nimport bracoujl.processor.gb_z80 as proc\n\ndis = proc.CPU_CONF['disassembler']()\n\ndef disassemble(lines):\n res = ''\n for line in lines:\n op = proc.CPU_CONF['parse_line'](line)\n if op is No... | python | edit | 3 | 5 | bsd-3-clause | 09b2fe8b248e70300470fcf71f6df0741376c548 | fmichea/bracoujl | misc/disassemble_linear.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom setuptools import setup\nimport ibei\n\nsetup(name = \"ibei\",\n version = ibei.__version__,\n author = \"Joshua Ryan Smith\",\n author_email = \"<EMAIL>\",\n packages = [\"ibei\", \"physica... | python | edit | 1 | 0 | mit | 5c3aee40f21b6346120df99698b1f273886b5e70 | jrsmith3/ibei | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport statsmodels.api as sm\nimport numpy as np\n\nstar98 = sm.datasets.star98.load_pandas().data\n\nformula = 'SUCCESS ~ LOWINC + PERASIAN + PERBLACK + PERHISP + PCTCHRT '\nformula += '+ PCTYRRND + PERMINTE*AVYRSEXP*AVSALK + PERSPENK*PTRA... | python | edit | 3 | 1 | bsd-3-clause | 91f5db6ddf6e26cec27917109689c200498dc85f | bert9bert/statsmodels,YihaoLu/statsmodels,cbmoore/statsmodels,hlin117/statsmodels,bavardage/statsmodels,detrout/debian-statsmodels,hainm/statsmodels,statsmodels/statsmodels,jstoxrocky/statsmodels,statsmodels/statsmodels,astocko/statsmodels,DonBeo/statsmodels,bzero/statsmodels,Averroes/statsmodels,gef756/statsmodels,jos... | statsmodels/formula/try_formula.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom .models import Activity, Datapoint\n\n\nclass ActivitySerializer(serializers.HyperlinkedModelSerializer):\n class Meta:\n model = Activity\n fields = ('user', 'full_description',... | python | edit | 1 | 0 | mit | 3838e44a397fdb4b605ead875b7c6ebc5787644d | jal-stats/django | jal_stats/stats/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nUser-facing interface for plotting all dimensionality reduction algorithms\n\"\"\"\n\ndef smushplot(data, smusher='pca', n_components=2, marker='o', marker_order=None,\n text=False, text_order=None, linewidth=1, linewid... | python | edit | 1 | 2 | bsd-3-clause | cba5a3d4928a3ee2e7672ca4a3f766a789d83acf | olgabot/cupcake | cupcake/smush/plot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 12/2 part 1 solution"
},
{
"role": "assistant",
"content": "# Advent of Code\n# Dec 2, Part 1\n# @geekygirlsarah\n\ninputFile = \"input.txt\"\n\n# Tracking vars\nfinalCode = \"\"\nlastNumber = 5 # start here\ntempNumber ... | python | new_file | 1 | 0 | mit | 5c620a504327696b9cfe3ffc423ae7ae6e915e78 | geekygirlsarah/adventofcode2016 | dec02/dec02part1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2016 F Dou<<EMAIL>>\n# See LICENSE for details.\n\nimport bluetooth\nimport os\nimport logging\nimport time\nfrom daemon import runner\n\nclass RxCmdDaemon():\n def __init__(sel... | python | edit | 3 | 4 | apache-2.0 | 6845c56edc315f5ce07f0bf1101d59ee04036024 | javatechs/RxCmd,javatechs/RxCmd,javatechs/RxCmd | pydir/daemon-rxcmd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport monasca_setup.detection\n\n\nclass Neutron(monasca_setup.detection.ServicePlugin):\n\n \"\"\"Detect Neutron daemons and setup configuration to monitor them.\n\n \"\"\"\n\n def __init__(self, template_dir, overwrite=True, arg... | python | edit | 1 | 2 | bsd-3-clause | 79b5227deaf830a9ce51d18387372fe6cf88e51d | sapcc/monasca-agent,sapcc/monasca-agent,sapcc/monasca-agent | monasca_setup/detection/plugins/neutron.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport zipfile\nimport tarfile\nimport shutil\nimport tempfile\nfrom osgeo import gdal\n\n\ndef is_zip(tmp):\n \"\"\"\n Returns True if the NamedTemporaryFile given as the argument appears to be\n a well-formed Zip file.\n \"\"\... | python | edit | 3 | 2 | mit | 356dd5294280db3334f86354202f0d68881254b9 | mapzen/joerd,tilezen/joerd | joerd/check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os.path import abspath, dirname, join, normpath\n\nfrom setuptools import setup\n\n\nsetup(\n\n # Basic package information:\n name = 'django-heroku-memcacheify',\n version = '0.8',\n py_modules = ('memcacheify',),\n\n #... | python | edit | 1 | 0 | unlicense | 506612277718e13d852330553f52903544e3f3c2 | rdegges/django-heroku-memcacheify | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\nimport sys, os\nimport argparse\nfrom deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo\n\ndef main(argv=None):\n\n parser = argparse.ArgumentParser(description='Print count of objects... | python | edit | 6 | 4 | bsd-3-clause | 9353a5e2369e819c092c94d224b09c321f5b5ff0 | barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere | utils/get_collection_object_count.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\"\"\"Solves problem xxx from the Project Euler website\"\"\"\nfrom common.fibonacci import fibonacci_numbers_until_n_digits\n\n\ndef solve():\n \"\"\"Solve the problem and return the result\"\"\"\n fibonacci_n... | python | edit | 1 | 1 | mit | 2150f99461e4790477ad90483a7f716f09679ef1 | janhenke/project-euler | p025.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Code to load project paths\n#\n\nimport os, sys\n\nMR_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), \"/Users/dmhembere44/MR-connectome\" ))\nMR_CMAPPER_PATH = os.path.join(MR_BASE_PATH, \"cmapper\" )\nMR_MRCAP_PAT... | python | edit | 1 | 0 | apache-2.0 | c4d64672c8c72ca928b354e9cfd35a7d40dbb78f | neurodata/ndmg | MROCPdjangoForm/ocpipeline/mrpaths.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nModule containing package exception classes.\n\"\"\"\n\n\nclass Invalid(Exception):\n\n def __init__(self, message, exceptions=None, validator=None):\n Exception.__init__(self, message, exceptions)\n self.message = ... | python | edit | 2 | 4 | bsd-3-clause | 65fd070a88e06bb040e8c96babc6b4c86ca29730 | ish/validatish,ish/validatish | validatish/error.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport platform\nimport subprocess\nimport sys\n\nif platform.system() == 'Windows':\n import ctypes\n AdvAPI32 = ctypes.windll.Advapi32\n\n from ctypes.wintypes import POINTER\n\n UNLEN = 256\n\n GetUserNameW = AdvAPI32.Ge... | python | edit | 1 | 0 | apache-2.0 | ed3c03ac4f213f3882e28f25ae0596a7021928cd | atrick/swift,hooman/swift,harlanhaskins/swift,shahmishal/swift,stephentyrone/swift,jmgc/swift,devincoughlin/swift,ahoppen/swift,tkremenek/swift,xedin/swift,shahmishal/swift,xwu/swift,xedin/swift,harlanhaskins/swift,harlanhaskins/swift,sschiau/swift,shajrawi/swift,karwa/swift,gribozavr/swift,apple/swift,CodaFi/swift,aho... | test/ParseableInterface/Inputs/make-unreadable.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nimport requests\nimport time\n\n\ndef get_statuses():\n return requests.get('https://status.mojang.com/check/').json()\n\n\ndef get_uuid(username, unix_timestamp=None):\n if unix_timestamp is None:\n unix_timesta... | python | edit | 1 | 2 | mit | c668aaa0f22f5a61094c2028291b65c781733a54 | zugmc/mojapi | mojapi/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nr'''\nCopyright 2014 Google Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n htt... | python | edit | 1 | 4 | apache-2.0 | b6e9e37350a4b435df00a54b2ccd9da70a4db788 | google/nogotofail,leasual/nogotofail,mkenne11/nogotofail,joshcooper/nogotofail,digideskio/nogotofail,mkenne11/nogotofail-pii,joshcooper/nogotofail,google/nogotofail,mkenne11/nogotofail,digideskio/nogotofail,leasual/nogotofail,mkenne11/nogotofail-pii | nogotofail/mitm/util/ip.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: UTF-8 -*-\n\"\"\"\nConfigure pytest environment.\nAdd project-specific information.\n\n.. seealso::\n * https://github.com/pytest-dev/pytest-html\n\"\"\"\n\nimport behave\nimport pytest\n\n@pytest.fixture(autouse=True)\ndef... | python | edit | 1 | 2 | bsd-2-clause | 2fe72f41b1b62cf770869b8d3ccefeef1096ea11 | Abdoctor/behave,Abdoctor/behave,jenisys/behave,jenisys/behave | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\nimport random\nimport string\n\nfrom ext.aboard.model import *\n\ndef set_value(token):\n \"\"\"Randomly create and return a value.\"\"\"\n value = str(token.user) + \"_\" + str(token.timestamp)\n len_rand = random.... | python | edit | 7 | 3 | bsd-3-clause | ebbc68da19755097b2131d60bc9757ecb4dc6d4c | v-legoff/pa-poc2,v-legoff/pa-poc2 | bundles/auth/models/token.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom distutils.core import Extension\n\nVERSION = '1.0.5'\nLONG_DESCRIPTION = \"\"\"\nA numerical geometric algebra module for python. BSD License.\n\"\"\"\nsetup(\n nam... | python | edit | 4 | 0 | bsd-3-clause | 6218287f7123e7c952e35ef8e12cacb985cea435 | arsenovic/clifford,arsenovic/clifford | setup.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyvm\nimport unittest\n\nclass PyVMTest(unittest.TestCase):\n def setUp(self):\n self.vm = pyvm.PythonVM()\n\n def test_load_const_num(self):\n self.assertEqual(\n 10,\n self.vm.eval('10')\n ... | python | edit | 1 | 1 | mit | 0003ef7fe3d59c4bda034dee334d45b6d7a2622d | utgwkk/tiny-python-vm | pyvm_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2012 Intel Inc, OpenStack LLC.\n# All Rights Reserved.\n#\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... | python | edit | 1 | 1 | apache-2.0 | 66df1b2719aa278c37f1c70ef550659c22d93d10 | openstack/oslo.i18n,varunarya10/oslo.i18n | tests/unit/fakes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport json\n\nfrom dateutil.parser import parse\n\nfrom scrapi.util import safe_filename\n\n\ndef migrate_from_old_scrapi():\n for dirname, dirs, filenames in os.walk('archive'):\n for filename in filenames:\n ... | python | edit | 4 | 4 | apache-2.0 | 8a573dae750b1b9415df0c9e2c019750171e66f0 | erinspace/scrapi,CenterForOpenScience/scrapi,icereval/scrapi,fabianvf/scrapi,fabianvf/scrapi,ostwald/scrapi,mehanig/scrapi,alexgarciac/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,erinspace/scrapi | migrations.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nGenerate an RSS feed of published crosswords from staff users.\n\nUses the built-in feed framework. There's no attempt to send the actual\ncrossword, it's just a message indicating that a new one is available.\n\"\"\"\n\nfrom django... | python | edit | 1 | 1 | mit | 4b5dd61607c9692bb330f89545d5f76d7a1ed221 | jomoore/threepins,jomoore/threepins,jomoore/threepins | puzzle/feeds.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The util module contains a variety of utility functions.\"\"\"\nimport configparser\nimport sys\n\n\ndef read_cfg_file(filename):\n \"\"\"Read and parse the experiment configuration file with configparser.\"\"\"\n\n config = con... | python | edit | 1 | 5 | bsd-3-clause | 2965891b46e89e0d7222ec16a2327f2bdef86f52 | gbouvignies/chemex | chemex/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom libcloud.utils.py3 import httplib\nfrom libcloud.common.types import InvalidCredsError\nfrom libcloud.common.base import JsonResponse\nfrom libcloud.common.base import ConnectionKey\n\n\nclass MaxihostResponse(JsonResponse):\n valid... | python | edit | 2 | 3 | apache-2.0 | 4eab1fb42f58d6203a0862aa9caf304193d3442b | ByteInternet/libcloud,andrewsomething/libcloud,ByteInternet/libcloud,Kami/libcloud,apache/libcloud,andrewsomething/libcloud,mistio/libcloud,Kami/libcloud,mistio/libcloud,andrewsomething/libcloud,apache/libcloud,apache/libcloud,ByteInternet/libcloud,Kami/libcloud,mistio/libcloud | libcloud/common/maxihost.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# coding=utf-8\n\nfrom setuptools import setup\n\nsetup(\n name='alfred-workflow-packager',\n version='0.11.0',\n description='A CLI utility for packaging and exporting Alfred workflows',\n url='https://gi... | python | edit | 1 | 0 | mit | f0c684ab89fa4fe698c9e20e7e904d3371fe58e2 | caleb531/alfred-workflow-packager | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name='tomviz-pipeline',\n version='0.0.1',\n description='Tomviz python external pipeline execution infrastructure.',\n author='Kitware, Inc.',\n author_email='<EMAIL>',... | python | edit | 1 | 0 | bsd-3-clause | 7c69dc5bddc7136c274f039223686a92cffd693a | OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz | tomviz/python/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom __future__ import division\n\nimport numpy as np\n\nfrom astropy.tests.helper import pytest\nfrom photutils.psf import GaussianPSF\n\ntry:\n from scipy import optimiz... | python | edit | 2 | 1 | bsd-3-clause | cb798ae8f7f6e810a87137a56cd04be76596a2dd | larrybradley/photutils,astropy/photutils | photutils/tests/test_psfs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Heuristic:\n\n def heuristic(self, board, color):\n raise NotImplementedError('Dont override this class')\n\n```\n\nApply this change: Create the minimal class MiniMax"
},
{
"role": "assistant",
"content": "class Heuri... | python | edit | null | null | apache-2.0 | 2ef97501b15a9369d21953312115ea36355f251c | frila/agente-minimax | minimax.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport rasterio\n\ndef test_reshape():\n with rasterio.open('tests/data/RGB.byte.tif') as src:\n im_data = rasterio.plot.reshape_as_image(src)\n assert im_data.shape == (718, 791, 3)\n\ndef test_toundtri... | python | edit | 1 | 1 | bsd-3-clause | 5c3bd2ebdfd1abdacc0e2603fbba0f4e5b3eb5e3 | kapadia/rasterio,brendan-ward/rasterio,kapadia/rasterio,kapadia/rasterio,brendan-ward/rasterio,brendan-ward/rasterio | tests/test_reshape_image.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 | 864dac9b2586891f62700e3170421617aca48a88 | 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\n#!/usr/bin/env python3\n\nclass Routes:\n\t'''Define the feature of route for URIs.'''\n\tdef __init__(self):\n\t\tself._Routes = []\n\n\tdef AddRoute(self, uri, callback):\n\t\t'''Add an URI into the route table.'''\n\t\tself._Routes.appen... | python | edit | 1 | 7 | bsd-3-clause | 70259a9f9ce5647f9c36b70c2eb20b51ba447eda | starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer | middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Sample unittests.\"\"\"\n\nimport unittest2 as unittest\n\nfrom domain_models import model\nfrom domain_models import fields\n\n\nclass User(model.DomainModel):\n \"\"\"Example user domain model.\"\"\"\n\n id = fields.Int()\n ... | python | edit | 3 | 1 | bsd-3-clause | 2501bb03e836ac29cc1defa8591446ff217771b2 | ets-labs/domain_models,ets-labs/python-domain-models,rmk135/domain_models | tests/test_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport interleaving as il\nimport numpy as np\nimport pytest\nnp.random.seed(0)\nfrom .test_methods import TestMethods\n\nclass TestProbabilisticInterleaveSpeed(TestMethods):\n\n def test_interleave(self):\n r1 = list(range(100))\... | python | edit | 3 | 2 | mit | c7ba0ecbbe263fbf7378edbc45fcbbefb150a8fb | mpkato/interleaving | tests/test_probabilistic_interleave_speed.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add copyright, license and version information."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# The MIT License (MIT)\n#\n# Copyright (c) 2014 Storj Labs\n#\n# Permission is hereby grant... | python | new_file | 4 | 0 | mit | 12254ea15b1f761ad63095ed7244f347d42e4c85 | Storj/file-encryptor | file_encryptor/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef require_request_model(cls, *args, validate=True, **kwargs):\n \"\"\"\n Makes a handler require that a request body that map towards the given model\n is provided. Unless the ``validate`` option is set to ``False`` the data will... | python | edit | 1 | 4 | bsd-3-clause | 8bc2b19e9aef410832555fb9962c243f0d4aef96 | brinkframework/brink | brink/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom pytun import TunTapDevice\nfrom binascii import hexlify\n\n\nif __name__ == '__main__':\n\ttun = TunTapDevice(name='ipsec-tun')\n\ttun.up()\n\ttun.persist(True)\n\n\twhile True:\n\t\ttry:\n\t\t\tbuf = tun.read(tun.... | python | edit | 2 | 0 | mit | 1f6fb7bb0e20cafbe4392bf8a0cafa3e9fa2fbc1 | adrian-nicolau/ipsec-poc,adrian-nicolau/ipsec-poc | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\nimport os\nimport color\n\ndef _GetDataDirPath():\n return os.path.join(os.path.dirname(__file__), 'data')\n\ndef _GetCsvPath():\n return os.path.join(_GetDataDirPath(), 'dmccolors.csv')\n\ndef _GetCsvString():\n with open(_G... | python | edit | 2 | 2 | apache-2.0 | 91556f15e64f2407d77ab6ea35d74abccc9f1984 | nanaze/pystitch,nanaze/pystitch | pystitch/dmc_colors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nsentry.web.frontend.generic\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\nfrom __future__ import absolute_import\n\... | python | edit | 1 | 3 | bsd-3-clause | ebfb9290f5afdc07489be117f9ccb6df34e4023a | alexm92/sentry,daevaorn/sentry,ifduyue/sentry,daevaorn/sentry,mvaled/sentry,gencer/sentry,looker/sentry,beeftornado/sentry,ifduyue/sentry,zenefits/sentry,zenefits/sentry,gencer/sentry,looker/sentry,daevaorn/sentry,JackDanger/sentry,looker/sentry,mitsuhiko/sentry,looker/sentry,ifduyue/sentry,zenefits/sentry,jean/sentry,... | src/sentry/web/frontend/generic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: Milan Kubik\n\nimport logging\nimport yaml\n\nfrom ipaqe_provision_hosts.errors import IPAQEProvisionerError\n\nlog = logging.getLogger(__name__)\n\n\nclass ConfigLoadError(IPAQEProvisionerError):\n pass\n\n\ndef load_yaml(path... | python | edit | 1 | 5 | mit | f624ca7894037361c441d4c5834e4a1fe66c991d | apophys/ipaqe-provision-hosts | ipaqe_provision_hosts/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom core.feed import Feed\nimport core.config.celeryimports\n\n\nif __name__ == '__main__':\n all_feeds = Feed.objects()\n for n in all_feeds:\n print \"Testing: {}\".format(n)\n n.update()\n\n```\n\nApply this change: ... | python | edit | 3 | 0 | apache-2.0 | c555c53290c8894c80dc7991081dd5d7591fda8c | yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti | helpers/run_feeds.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nimport yaml\n\n\ndef extDetect(url):\n if url.endswith('.tar.gz'):\n return '.tar.gz'\n elif url.endswith('.tgz'):\n return '.tar.gz'\n elif url.endswith('.tar.bz2'):\n return... | python | edit | 2 | 6 | mit | 5f0f1da10ebc01d95bb8659f5dc7782e57365b53 | erasche/community-package-cache,erasche/community-package-cache,gregvonkuster/cargo-port,gregvonkuster/cargo-port,galaxyproject/cargo-port,galaxyproject/cargo-port,erasche/community-package-cache,gregvonkuster/cargo-port | .conda/to_cargoport.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from south.modelsinspector import add_ignored_fields\n add_ignored_fields([\"^taggit_autosuggest\\.managers\"])\nexcept ImportError:\n pass # without south this can fail silently\n \n\n```\n\nApply this change: Correct igno... | python | edit | 1 | 0 | mit | cb5dc31aa3b77d2bf4aab08785749d24da80f325 | iris-edu/django-taggit-autosuggest-select2,kpantic/django-taggit-autosuggest-select2,iris-edu/django-taggit-autosuggest-select2,kpantic/django-taggit-autosuggest-select2,iris-edu-int/django-taggit-autosuggest-select2,iris-edu-int/django-taggit-autosuggest-select2,iris-edu/django-taggit-autosuggest-select2,iris-edu-int/... | taggit_autosuggest_select2/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport logging\nimport os\nimport signal\nimport time\n\nfrom optparse import OptionParser\nfrom watchdog.observers import Observer\nfrom pyautotest.observers import Notifier, ChangeHandler\n\n# Configure logging\... | python | edit | 3 | 4 | mit | d73872b8bcc6c7c32fa10d4a8ffdd77fe568a954 | ascarter/pyautotest | pyautotest/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write tests for swappable model.\n\nResolves #28, #36.\n\n--HG--\nbranch : fix-swappable-model"
},
{
"role": "assistant",
"content": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom... | python | new_file | 1 | 1 | bsd-3-clause | 5e30bd1ae8218a6ad5a2582c15aed99258994d83 | schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse | tests/tests/test_swappable_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nclass PolicyError(RuntimeError):\n def __init__(self, message, url):\n self.message = message\n self.url = url\n\n def __str__(self):\n return \"{}: {}\".format(self.mess... | python | edit | 1 | 3 | mit | d15f6df74b8fe188a7a80c3491aeec62c35ce415 | lpancescu/atlas-lint | policy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .models import Thread\n\n\ndef user_messages(request):\n c = {}\n if request.user.is_authenticated():\n c[\"inbox_count\"] = Thread.inbox(request.user).count()\n return c\n\n```\n\nApply this change: Return querysets in... | python | edit | 1 | 2 | mit | 6fbe58692005e5c8b7a9c4f4e98984ae86d347a2 | eldarion/user_messages,pinax/pinax-messages,pinax/pinax-messages,arthur-wsw/pinax-messages,eldarion/user_messages,arthur-wsw/pinax-messages | pinax/messages/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport logging\nfrom django.conf import settings\n\nlog = logging.getLogger(__name__)\n\n\ndef static(request):\n \"Shorthand static URLs. In debug mode, the JavaScript is not minified.\"\n static_url = settings.STATIC_URL\... | python | edit | 1 | 2 | bsd-2-clause | 7f6bb0706b24f8664937e9d991ffe01b2d62279e | chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify | varify/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Enable all auth algorithms that might be emitted by the alice."
},
{
"role": "assistant",
"content": "from lib.test_config import AUTH_CREDS as AUTH_CREDS_orig\n\nclass AUTH_CREDS(AUTH_CREDS_orig):\n enalgs = ('SHA-256-sess', ... | python | new_file | 1 | 1 | bsd-2-clause | c3937702d8d9fa4ef7661a555876ad69654f88fd | sippy/voiptests,sippy/voiptests | scenarios/passtr/bob_cfg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file is part of Moksha.\n#\n# Moksha is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or... | python | edit | 1 | 0 | apache-2.0 | 816874f692c7ef9de5aa8782fab1747e96199229 | ralphbean/moksha,lmacken/moksha,lmacken/moksha,pombredanne/moksha,ralphbean/moksha,mokshaproject/moksha,pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,pombredanne/moksha,mokshaproject/moksha,pombredanne/moksha,ralphbean/moksha,lmacken/moksha | moksha/live/flot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n''' \nScript used to query Wikipedia for summary of object \n'''\n\nimport sys\nimport wikipedia \n\ndef main():\n\t# Check that we have the right number of arguments \n\tif (len(sys.argv) != 2): \n\t\tprint 'Incorrect number of arguments; ... | python | edit | 5 | 4 | apache-2.0 | d970f2e4dc1d040bd352a68f6ebe4d3df93d19f7 | christopher18/Celsearch,christopher18/Celsearch,christopher18/Celsearch | web/celSearch/api/scripts/query_wikipedia.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# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom mica.stats import update_guide_stats\nupdate_guide_stats.main()\n\nimport os\ntable_file = mica.stats.guide_stats.TABLE_FILE\nfile_stat = os.stat... | python | edit | 1 | 0 | bsd-3-clause | d13c674a7286f1af9cd13babe2cb5c429b5b3bfa | sot/mica,sot/mica | scripts/update_guide_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nsentry.tasks.deletion\n~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n\nfrom celery.task import task\n\n\n@task(name='sentr... | python | edit | 1 | 5 | bsd-3-clause | 63ca54e320b77501a304aa0520e133e1194e1324 | vperron/sentry,BuildingLink/sentry,JTCunning/sentry,fotinakis/sentry,BuildingLink/sentry,zenefits/sentry,daevaorn/sentry,nicholasserra/sentry,hongliang5623/sentry,llonchj/sentry,mitsuhiko/sentry,TedaLIEz/sentry,alexm92/sentry,mvaled/sentry,jokey2k/sentry,fuziontech/sentry,ngonzalvez/sentry,looker/sentry,camilonova/sent... | src/sentry/tasks/deletion.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pkg_resources\nimport random\n\n_insulting_adjectives = []\n\ndef _load_wordlists():\n\tglobal _insulting_adjectives\n\tinsulting_adjective_list = pkg_resources.resource_string(__name__, \"wordlists/insulting_adjectives.txt\")\n\t_in... | python | edit | 1 | 1 | mit | f898d1cc96fe66a097def29552f3774f3509be83 | tr00st/insult_generator | insultgenerator/words.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCopyright (C) 2017 Open Source Robotics Foundation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ... | python | edit | 1 | 2 | apache-2.0 | aff77b144c1a1895c9e8c0ca2d4e79451525901c | ekumenlabs/terminus,ekumenlabs/terminus | terminus/models/trunk.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\n\ndef canAppAccessDatabase():\n \"\"\"\n Returns True if the apps.py file can access database records.\n\n There are some circumstances where we don't want the ready function in apps.py\n to touch the database\n ... | python | edit | 1 | 3 | mit | b6cfa50e127d3f74247ab148219ef6336e445cca | inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree | InvenTree/InvenTree/ready.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function\n\n# Standard library\nimport inspect\nimport unittest\n\nfrom cinspect import getfile, getsource\n\n\nclass TestHelloModule(unittest.TestCase):\n\n def test_patching_inspect_should_... | python | edit | 1 | 1 | bsd-3-clause | a00f9c56671c028c69638f61d3d4c1fd022c0430 | punchagan/cinspect,punchagan/cinspect | cinspect/tests/test_patching.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nimport reversion\nfrom yawf.revision import RevisionModelMixin\n\n\nclass WINDOW_OPEN_STATUS:\n\n MINIMIZED = 'minimized'\n MAXIMIZED = 'maximized'\n NORMAL = 'normal'\n\n types = (MINIMIZED, MAXI... | python | edit | 1 | 0 | mit | 5e7cce09a6e6a847dad1714973fddb53d60c4c3f | freevoid/yawf | yawf_sample/simple/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nclass SMSRouter(object):\n\n app_label = 'sms'\n db_name = 'sms'\n\n def db_for_read(self, model, **hints):\n\n if model._meta.app_label == self.app_label:\n return self.db_name\n\n return None\n\n def... | python | edit | 1 | 3 | isc | d8c1c7da47e2568cecc1fd6dff0fec7661b39125 | pmaigutyak/mp-turbosms | turbosms/routers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport sys\nimport logging\n\nfrom website.app import setup_django\nsetup_django()\nfrom website import mails\nfrom osf.models import OSFUser\nfrom addons.mendeley.models import UserSettings\nimport progressbar\n\nf... | python | edit | 3 | 3 | apache-2.0 | c0eb0f902b0fcbea29c8a3bf70f80ca9384cce9f | cslzchen/osf.io,icereval/osf.io,brianjgeiger/osf.io,mattclark/osf.io,pattisdr/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,adlius/osf.io,cslzchen/osf.io,mattclark/osf.io,saradbowman/osf.io,brianjgeiger/osf.io,CenterForOpenScience/osf.io,adlius/osf.io,mfraezz/osf.io,brianjgeiger/osf.io,CenterForOpenScience/osf.io,baylee-d... | scripts/remove_after_use/send_mendeley_reauth_email.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 The LUCI Authors. All rights reserved.\n# Use of this source code is governed under the Apache License, Version 2.0\n# that can be found in the LICENSE file.\n\nfrom recipe_engine import recipe_api\n\n\nclass RuntimeApi(rec... | python | edit | 1 | 1 | apache-2.0 | e7fec5ccb9e70bf17b7878e63052a874afa06856 | luci/recipes-py,luci/recipes-py | recipe_modules/runtime/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conans import ConanFile, AutoToolsBuildEnvironment, tools\nimport os\n\n\nclass LibxauConan(ConanFile):\n name = \"libxau\"\n version = \"1.0.8\"\n license = \"Custom https://cgit.freedesktop.org/xorg/lib/libXau/tree/COPYING\"... | python | edit | 1 | 1 | mit | 5cf8516db40a8581eb80a1fb64a0b11da37527dd | trigger-happy/conan-packages | libxau/conanfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport eventlet\nimport os\nimport sys\n\nfrom oslo.config import cfg\n\nfrom st2common import log as logging\nfrom st2common.models.db import db_setup\nfrom st2common.models.db import db_teardown\nfrom st2actions import config\nfrom st2act... | python | edit | 1 | 4 | apache-2.0 | 45f0cd033938a5c28907e84fcbc8f5f8e93d0c65 | dennybaa/st2,grengojbo/st2,pinterb/st2,alfasin/st2,jtopjian/st2,peak6/st2,nzlosh/st2,punalpatel/st2,armab/st2,StackStorm/st2,nzlosh/st2,peak6/st2,alfasin/st2,Plexxi/st2,StackStorm/st2,emedvedev/st2,nzlosh/st2,pixelrebel/st2,Plexxi/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,tonybaloney/st2,pixelrebel/st2,StackStorm/st2,d... | st2actions/st2actions/cmd/history.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThe FVCOM Python toolbox (PyFvcom)\n\n\"\"\"\n\n__version__ = '1.2'\n__author__ = 'Pierre Cazenave'\n__credits__ = ['Pierre Cazenave']\n__license__ = 'MIT'\n__maintainer__ = 'Pierre Cazenave'\n__email__ = '<EMAIL>'\n\nimport inspect... | python | edit | 15 | 0 | mit | 47831156874d31dcf9b8b61118399cb5ac77632c | pwcazenave/PyFVCOM | PyFVCOM/__init__.py | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\r\n\r\n\r\ndef get_language_choices():\r\n \"\"\"\r\n Default list of language choices, if not overridden by Django.\r\n \"\"\"\r\n DEFAULT_LANGUAGES = (\r\n ('bash', 'Bash/Shell'),\r\n ... | python | edit | 1 | 1 | bsd-3-clause | 9ff48dd4bff605ad1521c8ebaffc18432a155d8d | FlipperPA/wagtailcodeblock,FlipperPA/wagtailcodeblock,FlipperPA/wagtailcodeblock | wagtailcodeblock/settings.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.