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#-*- coding:utf-8 -*-\n\n\"\"\" \nBase Recommender Models.\n\"\"\"\n\n# Authors: Marcel Caraciolo <<EMAIL>>\n# Bruno Melo <<EMAIL>>\n# License: BSD Style.\n\nimport unittest\nimport sys\n\nsys.path.append('/Users/marcelcaraciolo/De... | python | edit | 1 | 1 | bsd-3-clause | c9003940c583a19861c1dff20498aa4c6aae1efb | Lawrence-Liu/crab,muricoca/crab,hi2srihari/crab,echogreens/crab,muricoca/crab,augustoppimenta/crab,imouren/crab,rcarmo/crab,Flowerowl/Crab,wnyc/crab,wnyc/crab | scikits/crab/tests/test_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ElasticMapping\n# File: types.py\n# Desc: base Elasticsearch types\n\n\nclass CallableDict(dict):\n BASE = None\n OVERRIDES = None\n\n def __call__(self, overrides):\n new_dict = CallableDict(self)\n new_dict.OVERRI... | python | edit | 1 | 1 | mit | 483cf7f91a89e040184bd71a0a1c59c0e0926e34 | Fizzadar/ElasticMapping,Fizzadar/ElasticMapping | elasticmapping/types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport http.client\nimport os\n\nfrom flask import Flask\nfrom pymongo import MongoClient\n\nMONGO_URL = os.environ.get('MONGO_URL', 'mongodb://mongo:27017/')\nMONGO_DATABASE = os.environ.get('MONGO_DATABASE', 'whistleblower')\nDATABASE = M... | python | edit | 2 | 1 | unlicense | f99847f363eed36713f657a4cb15a103ffcc6623 | datasciencebr/whistleblower | web/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand, CommandError\nfrom app.models import Author, Location, AutoComment, Comment, Idea, Vote\n\n\nclass Command(BaseCommand):\n def handle(self, *args, **options):\n self.stdout.writ... | python | edit | 1 | 2 | mit | b3bae8e48618e487ce9c8a90a555d5c6d6664872 | joausaga/social-ideation,joausaga/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,joausaga/social-ideation,joausaga/social-ideation,rebearteta/social-ideation | app/management/commands/cleanapptables.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nPython 2 Compatibility Layer\n\nThis module exists to work around compatibility issues between Python 2 and\nPython 3. The main code-base will use Python 3 idioms and this module will\npatch Python 2 code to support those changes. W... | python | edit | 5 | 1 | mit | b2e4b0eaf67714c180feec53e5b0021d911d8f8d | mcrute/pydora | pandora/py2compat.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyramid.settings import asbool\n\nfrom .client import ElasticClient\n\n\ndef client_from_config(settings, prefix='elastic.'):\n \"\"\"\n Instantiate and configure an Elasticsearch from settings.\n\n In typical Pyramid usage, y... | python | edit | 1 | 2 | mit | 12bbc7e10ae52328feb766e2bed5f5f20fa0d354 | storborg/pyramid_es | pyramid_es/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Cut 0.14.1 because setup.py bug"
},
{
"role": "assistant",
"content": "__version_info__ = (0, 14, 1)\n__version__ = '.'.join(map(str, __version_info__))\n"
}
] | python | new_file | 1 | 0 | bsd-2-clause | 823347e9c5bcc93710b7bdc2656f438a0e74c2b8 | pyinvoke/invocations | invocations/_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom django.conf import settings\nfrom rest_framework import serializers\nfrom rest_framework.validators import UniqueTogetherValidator\nfrom server.api.serializers.chapters import ChapterSerializer\nfrom server.core.models... | python | edit | 4 | 0 | mit | 84dd763d5d2aec1c4248e42106ef4f68439bc4cd | mwillmott/techbikers,mwillmott/techbikers,mwillmott/techbikers,Techbikers/techbikers,Techbikers/techbikers,Techbikers/techbikers,Techbikers/techbikers,mwillmott/techbikers | server/api/serializers/rides.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pythonforandroid.recipe import CompiledComponentsPythonRecipe\n\n\nclass RegexRecipe(CompiledComponentsPythonRecipe):\n name = 'regex'\n version = '2017.07.28'\n url = 'https://pypi.python.org/packages/d1/23/5fa829706ee1d44525... | python | edit | 1 | 0 | mit | 87d099f8094d5fb2c78729adfc6df9c68f68b450 | rnixx/python-for-android,kronenpj/python-for-android,kivy/python-for-android,kivy/python-for-android,kivy/python-for-android,kivy/python-for-android,germn/python-for-android,PKRoma/python-for-android,kronenpj/python-for-android,rnixx/python-for-android,germn/python-for-android,germn/python-for-android,rnixx/python-for-... | pythonforandroid/recipes/regex/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom subprocess import PIPE\n\nfrom .monkey import Popen\nfrom .exceptions import Failure\n\n\nclass Result(object):\n def __init__(self, stdout=None, stderr=None, exited=None):\n self.exited = self.return_code = exited\n s... | python | edit | 1 | 3 | bsd-2-clause | bfecf498c30c08d8ede18fd587e192f0961c334c | pyinvoke/invoke,mkusz/invoke,singingwolfboy/invoke,tyewang/invoke,mattrobenolt/invoke,kejbaly2/invoke,sophacles/invoke,pfmoore/invoke,pyinvoke/invoke,mkusz/invoke,pfmoore/invoke,kejbaly2/invoke,alex/invoke,frol/invoke,mattrobenolt/invoke,frol/invoke | invoke/run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Andrew Grim\n# Copyright (c) 2014 Andrew Grim\n#\n# License: MIT\n#\n\n\"\"\"This module exports the Puppet plugin class.\"\"\"\n\nfr... | python | edit | 1 | 0 | mit | 0d4e619a11a084f83ab42d45e528f7b38777fcae | dylanratcliffe/SublimeLinter-puppet,travisgroth/SublimeLinter-puppet,stopdropandrew/SublimeLinter-puppet | linter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom relay_api.core.relay import relay\nfrom relay_api.conf.config import relays\n\n\ndef init_relays():\n for r in relays:\n relays[r][\"object\"] = relay(relays[r][\"gpio\"])\n relays[r][\"state\"] = relays[r... | python | edit | 1 | 3 | mit | 5f5be04adc9e17aa497022ed3b19371075c63d85 | pahumadad/raspi-relay-api | relay_api/api/backend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gratipay.wireup import db, env\nfrom gratipay.models.team import AlreadyMigrated\n\ndb = db(env())\n\nteams = db.all(\"\"\"\n SELECT distinct ON (t.slug) t.*::teams\n FROM teams t\n JOIN tips ON t.owner = tips.tippee --... | python | edit | 1 | 0 | mit | f7172424977d0166ec4dd7946a360a5a426f4a72 | gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com | bin/migrate-tips.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a basic search-and-grab algorithm"
},
{
"role": "assistant",
"content": "import time\nfrom sr import *\n\nprint \"Hello, world!\"\n\nR = Robot()\n\n# This is the configuration for Elizabeth.\n# TODO: make this generic\n... | python | new_file | 2 | 2 | mit | c100d61f084ea759654baf0e9414f73567577f68 | prophile/tudor-block-chase | src/robot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jack Brewer\n# Copyright (c) 2015 Jack Brewer\n#\n# License: MIT\n\n\"\"\"Exports the Stylint plugin class.\"\"\"\n\nfrom SublimeLint... | python | edit | 1 | 0 | mit | b6b506e8250078664bdefdcf7d9d380e950e3730 | jackbrewer/SublimeLinter-contrib-stylint | linter.py | rejected_duplicate | Near-duplicate of sample 12441 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add component test functions using pytest"
},
{
"role": "assistant",
"content": "import pytest\nimport requests\nfrom time import sleep\n\nCOMPONENT_INDEX_URL = \"http://identidock:5000\"\n\nCOMPONENT_MONSTER_BASE_URL = COMPONENT... | python | new_file | 1 | 1 | mit | b698f6925b4629d7473fbe42806f54068d98428a | anirbanroydas/ci-testing-python,anirbanroydas/ci-testing-python,anirbanroydas/ci-testing-python | tests/component/test_component_identidock.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.1.4 on 2019-01-05 15:00\n\nimport django.contrib.postgres.fields\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\n \"peering\",\n ... | python | edit | 1 | 1 | apache-2.0 | 0ce14be170e09530b225f2f7526ad68ee1758095 | respawner/peering-manager,respawner/peering-manager,respawner/peering-manager,respawner/peering-manager | peering/migrations/0027_auto_20190105_1600.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\n\nimport const\nimport uniformdh\n\nimport obfsproxy.network.buffer as obfs_buf\n\nclass UniformDHTest( unittest.TestCase ):\n\n def setUp( self ):\n weAreServer =... | python | edit | 1 | 2 | bsd-3-clause | 024ea3b2e9e373abdcd78e44a163a2c32345073f | isislovecruft/scramblesuit,isislovecruft/scramblesuit | unittests.py | rejected_duplicate | Near-duplicate of sample 14645 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\nfrom __future__ import unicode_literals\nfrom .. import Provider as SsnProvider\n\n\n# Note: as there no SSN in Ukraine\n# we get value added tax identification number (VATIN) here.\n# It is also called \"Ідентифікаційний но... | python | edit | 1 | 4 | mit | e8b8c257c71b6c02fa691557618261e6832fba94 | joke2k/faker,danhuss/faker,trtd/faker,joke2k/faker | faker/providers/ssn/uk_UA/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_script import Manager\nfrom flask_skeleton_api.main import app\nimport subprocess\nimport os\n\nmanager = Manager(app)\n\n\n@manager.command\ndef unittest(report=False):\n \"\"\"Run unit tests\"\"\"\n\n if report:\n ... | python | edit | 1 | 2 | mit | 8a9c4585d633e5c7858071fe1420850f930c7614 | matthew-shaw/thing-api | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nv = '4.10.1'\nsetup(\n name='antlr4-python2-runtime',\n version=v,\n url='http://www.antlr.org',\n license='BSD',\n packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error'... | python | edit | 1 | 0 | bsd-3-clause | d06b80227e404bd0ad36e6fd9d382c247e570ca9 | parrt/antlr4,parrt/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,antlr/antlr4,parrt/antlr4,antlr/antlr4,antlr/antlr4,ericvergnaud/antlr4,parrt/antlr4,antlr/antlr4,parrt/antlr4,antlr/antlr4,parrt/antlr4,ericvergnaud/antlr4,parrt/antlr4,antlr/antlr4,parrt/antlr4,ericvergnaud/antlr... | runtime/Python2/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom learning_journal.models import Entry, DBSession\n\n\ndef test_create_entry(dbtransaction):\n \"\"\"Assert entry was entered into database.\"\"\"\n new_entry = Entry(title=\"Entry1\", text=\"Hey, this wo... | python | edit | 1 | 1 | mit | 61450328583cfb8e5ceee94a03502cef54bb11d6 | DZwell/learning_journal,DZwell/learning_journal,DZwell/learning_journal | learning_journal/tests/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\nimport json\n\nimport aiohttp\n\nimport SLA_bot.config as cf\n\nclass AlertFeed:\n source_url = 'http://pso2emq.flyergo.eu/api/v2/'\n\n async def download(url):\n try:\n async with aiohttp.get(url) as... | python | edit | 3 | 2 | mit | e45f394c61620db13bae579a29043dfdd6ae2d0f | EsqWiggles/SLA-bot,EsqWiggles/SLA-bot | SLA_bot/alertfeed.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Use the codon variables you defined previously\nS = \"TCT\"\nL = \"CTT\"\nY = \"TAT\"\nC = \"TGT\"\n\n# Create a list for the protein sequence CLYSY\ncodons = [C, L, Y, S, Y]\n\n# Print the DNA sequence of the protein\nprint(\"DNA sequenc... | python | edit | 1 | 0 | unlicense | c86e22a16eb2c1f2c95f81c232ae8535e447e935 | pycam/python-basic,pycam/python-basic | solutions/pybasic_ex1_3_1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.internet import endpoints, reactor\nfrom txampext.multiplexing import ProxyingFactory\n\n\ndef connectProxy(namespace, identifier, _reactor=reactor):\n \"\"\"Start listening on some free local port; connections will be\n ... | python | edit | 1 | 1 | isc | 7e78408dad1aab6bb42fd62601ee52e5f0ab3bd9 | crypto101/stanczyk | stanczyk/proxy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n#\n# Curriculum Module Status Script\n# - Run while the job is running\n# - Run -outside- of the allocation\n# - onramp_run_params.ini file is available in current working directory\n#\nimport sys\nimport re\n\n#\n#... | python | edit | 2 | 0 | bsd-3-clause | f5613b2b03f20f9d8f2a8d221ba1fae86664839c | OnRampOrg/onramp,koepked/onramp,OnRampOrg/onramp,ssfoley/onramp,OnRampOrg/onramp,koepked/onramp,ssfoley/onramp,koepked/onramp,OnRampOrg/onramp,koepked/onramp,ssfoley/onramp,ssfoley/onramp,OnRampOrg/onramp,koepked/onramp,OnRampOrg/onramp,OnRampOrg/onramp,koepked/onramp | modules/mpi-ring/bin/onramp_status.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils import timezone\nfrom datetime import timedelta\n\n\nclass Poll(models.Model):\n text = models.CharField(max_length=200)\n created_ts = models.DateTimeField()\n updated_ts = models.Da... | python | edit | 1 | 2 | mit | 8dc69dca8538eb992989da396b65ade4fe2e5088 | fernandocanizo/django-poll-site,fernandocanizo/django-poll-site,fernandocanizo/django-poll-site | polls/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom motobot import command, Notice, split_response, IRCBot\n\n\n@command('commands')\ndef commands_command(bot, database, context, message, args):\n userlevel = bot.get_userlevel(context.channel, context.nick)\n\n valid_command = lam... | python | edit | 2 | 3 | mit | c898d3f3d142727d0a55303238cda8044d729437 | Motoko11/MotoBot | motobot/core_plugins/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom Crypto.PublicKey import RSA\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCommand):\n help = 'Randomly generate a new RSA key for the OpenID server'\n\n def handle... | python | edit | 1 | 2 | mit | db977f65a6f986508c826b645b9c94e5eff4f83f | ByteInternet/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,ByteInternet/django-oidc-provider,wojtek-fliposports/django-oidc-provider,wayward710/django-oidc-provider,juanifioren/django-oidc-provider,bunnyinc/django-oidc-provider,torreco/django-oidc-provider,wojtek-fliposports/django-... | oidc_provider/management/commands/creatersakey.py | rejected_duplicate | Near-duplicate of sample 11453 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n#\n# SCRIPT FOR POPULATING TEST SOLR SERVER CORE WITH TEST DOCUMENTS\n#\n# Usage: python setup-test-docs.py <Solr Endpoint Url>\n#\n# Solr endpoint URL should be in the form:\n# https://example.com/solr/<core-name>/\n#\n#... | python | edit | 3 | 0 | mit | 90bc04a92bbe6f29d1487fbd87a4fad811f22c93 | gios-asu/search-api | setup/setup-test-docs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\ntry:\n VERSION = __import__('pkg_resources') \\\n .get_distribution('changes').version\nexcept Exception, e:\n VERSION = 'unknown'\n\n\ndef _get_git_revision(path):\n try:\n r = subproc... | python | edit | 1 | 2 | apache-2.0 | 7a582488a3f8d86820dca7c3b44ff86b8dbe4412 | bowlofstew/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes | changes/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom api.scrapers.item import scrape_item_by_id\nfrom api import app\n\nfrom flask.json import loads\n\nimport unittest\n\napp.config['TESTING'] = True\n\n\nclass ScrapeItem(unittest.TestCase):\n\n def test_scrape_item_by_id(self):\n ... | python | edit | 1 | 1 | mit | 35201e71037d544893a59bfda8c4538fcb6fb4b7 | Demotivated/loadstone | api/tests/test_scrape_item.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTest the importing module.\nThis module relies heavily on an external service and requires\nquite a bit of mocking.\n\"\"\"\nimport json\n\nfrom django.test import TestCase\n\nfrom molo.core.tests.base import MoloTestCaseMixin\nfrom... | python | edit | 1 | 1 | bsd-2-clause | 00b798c309d8807a562efb31751e82e5149ac7c8 | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | molo/core/api/tests/test_importers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport sys\n\nfrom pipreq.command import Command\n\n\ndef create_parser():\n parser = argparse.ArgumentParser(\n description='Manage Python package requirements across multiple environments using '\n ... | python | edit | 1 | 4 | mit | 190b4b193a2b33d7904310d24891e8aec18a126f | jessamynsmith/pipwrap,jessamynsmith/pipreq,jessamynsmith/pipwrap,jessamynsmith/pipreq | pipreq/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nProcessing routines for the waveFlapper case.\n\n\"\"\"\n\nimport foampy\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nwidth_2d = 0.1\nwidth_3d = 3.66\n\ndef plot_force():\n \"\"\"Plots the stream... | python | edit | 3 | 1 | cc0-1.0 | cb6f11ad05ef07facf651f8fbccae9e86e0a77c8 | petebachant/waveFlapper-OpenFOAM,petebachant/waveFlapper-OpenFOAM,petebachant/waveFlapper-OpenFOAM | processing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import transaction, connection\n\nclass TransactionMiddleware(object):\n def process_job(self, job):\n if not connection.in_atomic_block:\n transaction.set_autocommit(False)\n\n def process_result(self... | python | edit | 1 | 3 | bsd-3-clause | 3e7d83d51fa43f8e93ad548b07193f13791f8abe | thread/django-lightweight-queue,lamby/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,prophile/django-lightweight-queue | django_lightweight_queue/middleware/transaction.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\nfrom unittest import mock\n\nimport aiohttp\nimport pytest\n\nfrom bottery.app import App\n\n\ndef test_app_session():\n app = App()\n assert isinstance(app.session, aiohttp.ClientSession)\n\n\ndef test_app_already_con... | python | edit | 1 | 1 | mit | 7f86ab26fb1c6ba01f81fdc3f5b66a0f079c23ff | rougeth/bottery | tests/test_app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Django haystack `SearchIndex` module.\"\"\"\nfrom pages.models import Page, Content\n\nfrom haystack.indexes import SearchIndex, CharField, DateTimeField\nfrom haystack import site\n\nimport datetime\n\nclass PageIndex(SearchIndex):\n... | python | edit | 4 | 1 | bsd-3-clause | b6c98dd016aa440f96565ceaee2716cd530beae5 | remik/django-page-cms,akaihola/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,remik/django-page-cms,pombredanne/django-page-cms-1,pombredanne/django-page-cms-1,pombredanne/django-page-cms-1,oliciv/django-page-cms,remik/django-page-cms,remik/django-page-... | pages/search_indexes.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nfrom datetime import datetime\nfrom .logic_adapter import LogicAdapter\n\n\nclass TimeLogicAdapter(LogicAdapter):\n \"\"\"\n The TimeLogicAdapter returns the current time.\n \"\"\"\n\n de... | python | edit | 1 | 4 | bsd-3-clause | 2e9c6c883de12b7293b9e932e5268a2d806e714c | gunthercox/ChatterBot,vkosuri/ChatterBot,Gustavo6046/ChatterBot,davizucon/ChatterBot,Reinaesaya/OUIRL-ChatBot,Reinaesaya/OUIRL-ChatBot,maclogan/VirtualPenPal | chatterbot/logic/time_adapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\nfrom api.wb import views\n\napp_name = 'osf'\n\nurlpatterns = [\n url(r'^move/', views.MoveFile.as_view(), name=views.MoveFile.view_name),\n url(r'^copy/', views.MoveFile.as_view(), name=views.MoveFil... | python | edit | 1 | 0 | apache-2.0 | b5e4af74bfc12eb3ae9ca14ab4cebc49daf05fdc | baylee-d/osf.io,adlius/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,caseyrollins/osf.io,erinspace/osf.io,pattisdr/osf.io,erinspace/osf.io,icereval/osf.io,adlius/osf.io,erinspace/osf.io,HalcyonChimera/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,adlius/osf.io,felliott/osf.io,Johnetordoff/osf.io,felliott/osf.io,fe... | api/wb/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport sys\nimport os\n\n'''\nEasier searching for good RFI flagging values\n'''\n\ntry:\n vis = sys.argv[1]\nexcept IndexError:\n vis = raw_input(\"Input vis? : \")\n\n# Just want the number of SPWs\ntb.open(os.path.join(vis, \"SPE... | python | edit | 10 | 0 | mit | 3611e8a1b6477d251ddb2c90211e0cfee370671d | e-koch/canfar_scripts,e-koch/canfar_scripts | cal_pipe/easy_RFI_flagging.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app import database\n\n\nclass Talk(database.Model):\n id = database.Column(database.Integer, primary_key=True, autoincrement=True)\n title = database.Column(database.String(128), nullable=False)\n description = database.Colum... | python | edit | 1 | 1 | mit | 20224e4fe8b93dee087dd7a455f9709b9795a026 | Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot | app/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\nfrom pathlib import Path\nfrom random import shuffle\nfrom shutil import copy\n\n\n# configs\n\nN = 10000\nSAMPLED_DIR_PATH = Path('sampled/')\n\n# mkdir if doesn't exist\n\nif not SAMPLED_DIR_PATH.exists():\n ... | python | edit | 1 | 0 | mit | 9d68808a363ad00c3fc0b0907d625e5c75bdb8ae | moskytw/mining-news | ptt_preproc_sampling.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMCServer Tools config loader\n\"\"\"\n\nimport json\nimport os.path\n\nclass CoreConfig(object):\n\t\"\"\"\n\tMCServer Tools configuration\n\t\"\"\"\n\n\tSETTINGS_FILE = 'mcserver.settings'\n\n\tdef __init__(self, path):\n\t\t\"\"\"... | python | edit | 1 | 2 | mit | 44893be528063d25d0b2305c9d24be4605c49f3c | cadyyan/mcserver-tools,cadyyan/mcserver-tools | mcserver/config/core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\"\"\"ActiveMaster definition.\"\"\"\n\nclass Syzygy(object):\n project_... | python | edit | 1 | 0 | bsd-3-clause | be458ff809f6f49e21be06054ad096ff3f5430f9 | eunchong/build,eunchong/build,eunchong/build,eunchong/build | masters/master.client.syzygy/master_site_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"List Object Storage accounts.\"\"\"\n# :license: MIT, see LICENSE for more details.\n\nimport click\n\nimport SoftLayer\nfrom SoftLayer.CLI import environment\nfrom SoftLayer.CLI import formatting\n\n\n@click.command()\n@environment.p... | python | edit | 1 | 5 | mit | 10e23fdd5c0427ad1ff5a5284410c755378a0e6d | allmightyspiff/softlayer-python,softlayer/softlayer-python,kyubifire/softlayer-python | SoftLayer/CLI/object_storage/list_accounts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nraven.contrib.celery\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n\ntry:\n from celery.task import task\nexcept Imp... | python | edit | 1 | 1 | bsd-3-clause | 7e2440c00ce75dc3ff0eac53e63d629981a9873a | lepture/raven-python,recht/raven-python,lepture/raven-python,beniwohli/apm-agent-python,dbravender/raven-python,patrys/opbeat_python,recht/raven-python,jbarbuto/raven-python,getsentry/raven-python,akalipetis/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,patrys/opbeat_python,ewdurbin/raven-python,nikolas/rav... | raven/contrib/celery/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom .fields import Field\nfrom .views import DataView\n\nfrom django.utils.six import with_metaclass\n\n\nclass MetaView(type):\n\n def __new__(mcs, name, bases, attrs):\n meta = attrs.get('Meta', None)\n\n try:\n ... | python | edit | 1 | 8 | bsd-3-clause | 689dd5cb67516fd091a69e39708b547c66f96750 | limbera/django-nap,MarkusH/django-nap | nap/dataviews/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyramid.events import subscriber\nfrom openprocurement.tender.core.events import TenderInitializeEvent\nfrom openprocurement.tender.core.utils import get_now, calculate_business_date\n\n\n@subscriber(TenderInitializeEvent, procurementM... | python | edit | 3 | 3 | apache-2.0 | 80acc483f9b5d7fb462d81a2df092d16f5dbf035 | openprocurement/openprocurement.tender.limited | openprocurement/tender/limited/subscribers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSocketdjango Project Module\n\nInteresting Docstring goes here!\n\"\"\"\n\n__version__ = '0.0.1'\n\n```\n\nApply this change: Change Initial Version Number to '0.1.0'\n\nChange __version__ to '0.1.0'"
},
{
"role": "assistant... | python | edit | 1 | 0 | mit | 026aa257bff85b897e8e3ef1999b8fc6f7e3cc30 | bobbyrussell/django-socketio,bobbyrussell/django-socketio,bobbyrussell/django-socketio | socketdjango/socketdjango/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Xm\n#\n# The xm library is hard to find and requires this special code.\n#\n# Author P G Jones - 11/07/2012 <<EMAIL>> : First revision\n# Author P G Jones - 22/09/2012 <<EMAIL>> : Major refactor of snoing.\n#####... | python | edit | 1 | 4 | mit | e9386e24bea91b8659b5184fe146002f555ccd15 | mjmottram/snoing,mjmottram/snoing | versions/xmlib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\nif os.environ['DATABASE_URL'] is None:\n SQLALCHEMY_DATABASE_URI = 'sqlite:///meetup.db'\nelse:\n SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']\n\nSQLALCHEMY_TRACK_MODIFICATIONS = False # supress deprecation war... | python | edit | 1 | 0 | mit | 7dfe9c435b102eacddd9e0617540495f0af46416 | Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot | app/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''Sockets that wrap different connection types'''\n\n# Not all platforms support all types of sockets provided here. For those that\n# are not available, the corresponding socket wrapper is imported as None.\n\nfrom .. import logger\n\n# S... | python | edit | 1 | 0 | mit | 502a5cb7179aaedf68f3f16bf8d2ef7eb1ad0032 | dlecocq/nsq-py,dlecocq/nsq-py | nsq/sockets/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .models import Observer\n\n\nclass ObserverMiddleware(object):\n \"\"\"\n Attaches an observer instance to every request coming from an\n authenticated user.\n \"\"\"\n def process_request(self, request):\n assert... | python | edit | 1 | 3 | mit | 28e0a10925d866572cae86507a3ace845fbff6a9 | zsiciarz/variablestars.net,zsiciarz/variablestars.net,zsiciarz/variablestars.net | observers/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.views.generic import TemplateView\nfrom chartflo.factory import ChartDataPack\n\n\nclass ChartsView(TemplateView):\n template_name = 'chartflo/charts.html'\n graph_type = \"pie\"\n title = \"\... | python | edit | 1 | 1 | mit | 63d1eb69fc614cb3f019e7b37dd4ec10896c644e | synw/django-chartflo,synw/django-chartflo,synw/django-chartflo | chartflo/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n# References:\n# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse\n# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html\n\nimport argparse\n\ndef main():\n ... | python | edit | 1 | 1 | mit | a50a46ee26e5d7d325a228559bc701c86d1b392d | beepscore/argparse | arg-reader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom eve import Eve\nfrom eve_swagger import swagger\nfrom eve.auth import BasicAuth\nfrom config import *\nfrom hashlib import md5\n\nclass MyBasicAuth(BasicAuth):\n def check_auth(self, username, password, allowed_roles, resource,\n ... | python | edit | 2 | 2 | mit | e66468faaf9c4885f13545329baa20fe4914f49c | waoliveros/historia | historia.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cloudenvy.envy import Envy\n\n\nclass EnvySnapshot(object):\n \"\"\"Create a snapshot of an ENVy.\"\"\"\n\n def __init__(self, argparser):\n self._build_subparser(argparser)\n\n def _build_subparser(self, subparsers):\n... | python | edit | 1 | 1 | apache-2.0 | 4f9e51ff45f6faf6d0be6a442b4b04c3301026fe | cloudenvy/cloudenvy | cloudenvy/commands/envy_snapshot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\ndef readKey(keyFileName):\n return open(\"../options-and-settings/api-keys/\" + keyFileName, \"r\").readline()\n\n\n```\n\nApply this change: Remove newline and carraige return characters from key files so that API c... | python | edit | 1 | 1 | mit | 68724546ba4f6063559ba14b8625c7e7ecdf9732 | nilnullzip/StalkerBot,nilnullzip/StalkerBot | src/read_key.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport pytest\nfrom django.core.urlresolvers import reverse\nfrom members.tests.fixtures.memberlikes import MembershipApplicationFactory\nfrom members.tests.fixtures.types import MemberTypeFactory\nfrom members.mode... | python | edit | 1 | 1 | mit | b362d4b898493a856a810880079d3f44fe7d5d41 | jautero/asylum,jautero/asylum,rambo/asylum,hacklab-fi/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,rambo/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,jautero/asylum,rambo/asylum,rambo/asylum,hacklab-fi/asylum | project/members/tests/test_application.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add board list test code."
},
{
"role": "assistant",
"content": "from test_plus.test import TestCase\n\n\nclass BoardTest(TestCase):\n def test_get_board_list(self):\n board_list_url = self.reverse(\"board:list\")\n ... | python | new_file | 1 | 1 | mit | e35d55f46ffb9d42736ad4e57ae2a6c29838b054 | 9XD/9XD,9XD/9XD,9XD/9XD,9XD/9XD | board/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (3, 0, 1)\n__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))\n\n\nfrom django.apps import AppConfig\n\nfrom .simple import *\nfrom .query import *\nfrom .invalidation import *\nfrom .templatetags.cacheops i... | python | edit | 6 | 1 | bsd-3-clause | 9e783b39e89e34ded032dc550bc8cc9016f1eded | LPgenerator/django-cacheops,Suor/django-cacheops | cacheops/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport mock\nimport pytest\n\n\n@pytest.fixture\ndef default_trace_id_generator(dummy_request):\n return lambda dummy_request: '17133d482ba4f605'\n\n\n@pytest.fixture\ndef settings():\n return {\n 'zipk... | python | edit | 1 | 1 | apache-2.0 | 7845e017b264a38472d0dc94988a0afe6938132f | Yelp/pyramid_zipkin | tests/acceptance/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nsys.path.append('../ideascaly')\n\nfrom ideascaly.auth import AuthNonSSO\nfrom ideascaly.api import API\n\nimport unittest\n\ntesting_community = 'fiveheads.ideascale.com'\ntesting_token = '5b3326f8-50a5-419d-8f02-eef6a42fd61a'\... | python | edit | 1 | 1 | mit | 3d2b4536803df4a202d8c1c9b5d0e689f1053378 | joausaga/ideascaly | tests/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nExample using Arabic\n===============\nGenerating a wordcloud from Arabic text\nOther dependencies: bidi.algorithm, arabic_reshaper\n\"\"\"\n\nfrom os import path\nimport codecs\nfrom wordcloud import WordClou... | python | edit | 1 | 0 | mit | 5456bee257cb36e4d1400da7e27480beadbf21fd | amueller/word_cloud | examples/arabic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport importlib\nimport logging\nfrom volttron.platform.agent import utils\n\n_log = logging.getLogger(__name__)\nutils.setup_logging()\n__version__ = \"0.1\"\n\n__all__ = ['Model']\n\n\nclass Model(object):\n def __init__(self, config,... | python | edit | 1 | 3 | bsd-3-clause | 31fedddedc5ece0b7e68762269730e2cce110cb9 | VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications | pnnl/models/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis example:\n\n1. Connects to the current model\n2. Deploy a bundle and waits until it reports itself active\n3. Destroys the units and applications\n\n\"\"\"\nfrom juju import jasyncio\nfrom juju.model import Model\n\n\nasync def... | python | edit | 1 | 3 | apache-2.0 | c96e82caaa3fd560263c54db71772b44e9cd78d7 | juju/python-libjuju,juju/python-libjuju | examples/upgrade_local_charm_k8s.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport discord\nimport random\nfrom discord.ext import commands\n\n\nclass Meme:\n \"\"\"\n Meme commands.\n \"\"\"\n\n def __init__(self, bot):\n self.bot = bot\n print('Addon \"{}\" loaded'.format(self.__class__.... | python | edit | 1 | 1 | apache-2.0 | 18da33bd5524a7e9a043de90fb9b7aa78a26412d | 916253/Kurisu-Reswitched | addons/meme.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\nimport sys\n\n# hack to allow tests to find inmembrane in directory above\nmodule_dir = os.path.abspath(os.path.dirname(__file__))\nsys.path.insert(0, os.path.join(module_dir, '..'))\n\nimport inmembrane \n\n\ncl... | python | edit | 1 | 3 | bsd-2-clause | 8cbc55794d67571831ccc22b1ccdcf716362d814 | boscoh/inmembrane | tests/test_hmmsearch3.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nConstants for mots-vides\n\"\"\"\nimport os\n\nDATA_DIRECTORY = os.path.join(\n os.path.dirname(\n os.path.abspath(__file__)),\n 'datas/'\n)\n\n```\n\nApply this change: Define a complete list of language code, for easy... | python | edit | 1 | 0 | bsd-3-clause | dfd4a6f6b23447538b2b22da11666f5218d791db | Fantomas42/mots-vides,Fantomas42/mots-vides | mots_vides/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Red Hat, Inc.\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 of the License at\n#... | python | edit | 1 | 1 | apache-2.0 | b82fc6f21245cba7fadb35a6676433f015aad516 | openstack/tripleo-common,openstack/tripleo-common | tripleo_common/utils/tarball.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom common import gpu_test\n\n\nclass TestTensorflow(unittest.TestCase):\n def test_addition(self): \n op = tf.add(2, 3) \n sess = tf.Session(... | python | edit | 1 | 1 | apache-2.0 | cbadf5c564d7f5f701499409e2ae77ff90ba477c | Kaggle/docker-python,Kaggle/docker-python | tests/test_tensorflow.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals, division\n\nimport logging\n\nlogger = logging.getLogger(__name__) # pylint: disable=invalid-name\n\nDATA_DIR = 'data'\n\nDEFAULT_CON... | python | edit | 1 | 0 | bsd-3-clause | 1b9b4365a46cdbfbfe88e2f5e271ba387fe4274f | pignacio/vld | var_log_dieta/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file... | python | edit | 1 | 0 | apache-2.0 | 8dc6c7567f9bc94dc1b4a96b80d059f1231039bc | StackStorm/st2-auth-backend-flat-file | st2auth_flat_file_backend/__init__.py | rejected_duplicate | Near-duplicate of sample 13508 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\n\ndef cli_arg(*args, **kwargs):\n \"\"\"Decorator for CLI args\"\"\"\n def _decorator(func):\n add_arg(func, *args, **kwargs)\n return func\n return _decorator\n\n\ndef add_arg(func, *args, **kwargs):\n... | python | edit | 1 | 3 | mit | c4ee061f62e34c70cc67286ed0291423353cbcbe | ueg1990/imgur-cli | imgur_cli/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport enum\nimport os\nimport subprocess\nimport sys\n\nimport blessings\n\nfrom .misc import isatty\n\n\nif isatty(sys.stdout) and os.getenv(\"TERM\"):\n Terminal = blessings.Terminal\nelse:\n\n class Terminal:\n def __getatt... | python | edit | 1 | 2 | mit | 4abd7baafcd982993471d5c0137d4b506ea49e8b | wylee/runcommands,wylee/runcommands | src/runcommands/util/enums.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: set fileencoding=utf-8\n\nfrom django.conf.urls.defaults import *\nfrom views import *\n\nurlpatterns = patterns('',\n url(r'^$',\n questionnaire, name='questionnaire_noargs'),\n url(r'^csv/(?P<qid>\\d+)/',\n ... | python | edit | 12 | 0 | bsd-3-clause | 82ad6bf164000940e17dcb01b27b22b97c69beba | JanOosting/ed-questionnaire,affan2/ed-questionnaire,seantis/seantis-questionnaire,n3storm/seantis-questionnaire,affan2/ed-questionnaire,daniboy/seantis-questionnaire,eugena/ed-questionnaire,eugena/seantis-questionnaire,JanOosting/ed-questionnaire,eugena/seantis-questionnaire,trantu/seantis-questionnaire,daniboy/seantis... | questionnaire/urls.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python\nimport os\ndirectory = os.listdir()\nillegal_characters = \"%?_'*+$!\\\"\"\ntolowercase=True\n\nfor a in range(len(directory)):\n newname=\"\"\n for c in directory[a]:\n if c in illegal_characters:\n c... | python | edit | 4 | 7 | mit | 7519bebe1d9d87930275858a537dcc0a0a64f007 | dgengtek/scripts,dgengtek/scripts | tools/strip_filenames.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\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\n#\n#... | python | edit | 1 | 2 | apache-2.0 | c0b76d401b305c1bcd2ed5814a89719d4c6a3d83 | openstack-dev/heat-cfnclient | heat_cfnclient/tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns, include, url\nfrom django.conf import settings\nfrom django.contrib import admin\n\nadmin.autodiscover()\n\nurlpatterns = patterns('library',\n url(r'^all$',\n view='views.listing',\... | python | edit | 4 | 0 | mit | c3bb58fbcbd7c1699571859af736952c36f3029a | DUCSS/ducss-site-old,DUCSS/ducss-site-old,DUCSS/ducss-site-old | project/library/urls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"List drivers and send them commands.\"\"\"\nimport logging\n\nimport flask\n\nfrom appengine import device, rest\n\n\nclass Query(object):\n def iter(self):\n for name, cls in device.DEVICE_TYPES.iteritems():\n yield Driver(n... | python | edit | 1 | 3 | mit | 7e25472dab7732dc76bfb81d720946c18811962f | tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation | src/appengine/driver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport logging\nimport os\nimport queue\nimport threading\n\nlistening_port = 8444\nsend_outgoing_connections = True\nlisten_for_connections = True\ndata_directory = 'minode_data/'\nsource_directory = os.path.dirnam... | python | edit | 1 | 0 | mit | 0fac3d59a34a861c7a826b0d1fa2f3002356e04c | TheKysek/MiNode,TheKysek/MiNode | src/shared.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport traceback\nfrom hashlib import sha256\nfrom datetime import datetime, timedelta\n\n# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)\n\nclass _RateLimitFilter(object):\n last_error = 0\n\n def fi... | python | edit | 4 | 5 | apache-2.0 | 8d5d45f3a04235a9ee4fd1cadd39cc0010775ac9 | levixie/zulip,zwily/zulip,reyha/zulip,rht/zulip,jrowan/zulip,praveenaki/zulip,esander91/zulip,jeffcao/zulip,Juanvulcano/zulip,zachallaun/zulip,Batterfii/zulip,KingxBanana/zulip,krtkmj/zulip,zorojean/zulip,christi3k/zulip,easyfmxu/zulip,arpitpanwar/zulip,glovebx/zulip,yuvipanda/zulip,ashwinirudrappa/zulip,johnnygaddarr/... | humbug/ratelimit.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nimport urllib\n\n\n############### Functions called by stackdoc\n\ndef get_version():\n return 1\n\ndef get_ids(title, body, tags):\n ids = []\n if \"http://support.microsoft.com/\":\n urls = re.findall(r'<a href=... | python | edit | 3 | 5 | bsd-3-clause | 79c6c71ab6edd8313fd6c9c6441d69ad04d50721 | alnorth/stackdoc,alnorth/stackdoc,alnorth/stackdoc | update-database/stackdoc/namespaces/microsoftkb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.internet import reactor, defer\nfrom twisted.internet.protocol import ClientCreator\nfrom twisted.protocols import amp\nfrom ampserver import Sum, Divide\n\n\ndef doMath():\n d1 = ClientCreator(reactor, amp.AMP).connectTCP(\... | python | edit | 3 | 1 | mit | 24e80d80034084f6d2067df39fdc070e4eb41447 | dripton/ampchat | diceclient.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport json\n\nprint json.dumps({\n \"_meta\": {\n \"hostvars\": {\n 'afoo': {}\n },\n },\n \"foo\": {\n \"hosts\": ['afoo']\n }\n})\n```\n\nApply this change: Fix print sta... | python | edit | 1 | 0 | mit | 14d0e3b887b469c2b1979352804d8ade3184ef18 | AlanCoding/Ansible-inventory-file-examples,AlanCoding/Ansible-inventory-file-examples | scripts/symlinks/parent/foogroup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nUnit tests for pytils\n\"\"\"\n__all__ = [\"test_numeral\", \"test_dt\", \"test_translit\", \"test_utils\", \"test_typo\"]\n\nimport unittest\n\ndef get_django_suite():\n try:\n import django\n ... | python | edit | 7 | 3 | mit | c32bdff4b0ee570ed58cd869830d89e3251cf82a | Forever-Young/pytils,j2a/pytils | pytils/test/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import ModelForm, widgets\n\nfrom .models import Fellow, Event, Expense, Blog\n\nclass FellowForm(ModelForm):\n class Meta:\n model = Fellow\n exclude = [\n \"home_lon\",\n \"... | python | edit | 3 | 0 | bsd-3-clause | 14dd9f6cab99be6832ab98291337f4d38faae936 | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n\nimport rospy\nfrom humanoid_league_msgs.msg import BallInImage, BallRelative, BallsInImage\nfrom trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint\n\n\ndef run():\n pub_bal... | python | edit | 4 | 4 | bsd-3-clause | a54933f5fb5e958c890839c58fcba4e658c8e2a0 | bit-bots/bitbots_behaviour | bitbots_head_behavior/scripts/testHeadBehaviour.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport attr\n\n\ndef Field(*args, default=attr.NOTHING, **kwargs):\n if callable(default):\n default = attr.Factory(default)\n\n return attr.ib(*args, default=default, **kwargs)\n\n\ndef ManyToManyField(cls, *args, **kwargs):\n... | python | edit | 1 | 2 | apache-2.0 | 640ad3ed45eef21f2b7a71b4fd73a469ebed4b44 | onyb/reobject,onyb/reobject | reobject/models/fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nIntel definitions.\n\nCommonly used definitions.\n\"\"\"\nfrom __future__ import absolute_import\nfrom cdsl.isa import TargetISA, CPUMode\nimport base.instructions\nfrom . import instructions as x86\n\nISA = TargetISA('intel', [base... | python | edit | 1 | 0 | apache-2.0 | 629bfe7ba928bc9650217b90190409708740ee82 | sunfishcode/cretonne,stoklund/cretonne,sunfishcode/cretonne,stoklund/cretonne,stoklund/cretonne,sunfishcode/cretonne | lib/cretonne/meta/isa/intel/defs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom spec import Spec, skip\n\n\nclass Tessera(Spec):\n def is_importable(self):\n import tessera\n assert tessera.app\n assert tessera.db\n\n```\n\nApply this change: Add temp DB test harness + basic test"
},
{
... | python | edit | 3 | 2 | apache-2.0 | d028f66964249bab928a29d92ab4cff075352546 | tessera-metrics/tessera,jmptrader/tessera,aalpern/tessera,Slach/tessera,filippog/tessera,aalpern/tessera,aalpern/tessera,section-io/tessera,urbanairship/tessera,aalpern/tessera,urbanairship/tessera,Slach/tessera,jmptrader/tessera,urbanairship/tessera,Slach/tessera,urbanairship/tessera,urbanairship/tessera,tessera-metri... | integration/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport discord\nfrom discord.ext import commands\nfrom Cogs import GetImage\n\ndef setup(bot):\n bot.add_cog(Emoji(bot))\n\nclass Emoji(commands.Cog):\n\n def __init__(self, bot):\n self.bot = bot\n\n @commands.command()\n ... | python | edit | 1 | 9 | mit | 1100830d3b48262dd9b94d96eb50d75c8ff69fe4 | corpnewt/CorpBot.py,corpnewt/CorpBot.py | Cogs/Emoji.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#### Migrate person to a new account within the same Org\r\n\r\n# Requires admin role\r\n# Useful when migrating to Enterprise Logins.\r\n# Reassigns all items/groups to new owner and\r\n# adds userTo to all groups which userFrom is a membe... | python | edit | 1 | 0 | apache-2.0 | 3dfa781ce8e073f40eda3d80794ad1caff5d5920 | oevans/ago-tools | samples/migrateAccount.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2016 The Regents of the University of Michigan\n# All rights reserved.\n# This software is licensed under the BSD 3-Clause License.\n\n\nclass Error(Exception):\n pass\n\n\nclass ConfigError(Error, RuntimeError):\n pas... | python | edit | 1 | 2 | bsd-3-clause | c3a184a188d18f87bad2d7f34a2dfd3a7cca4827 | csadorf/signac,csadorf/signac | signac/common/errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.db import models\n\n# Create your models here.\nclass Necropsy (models.Model):\n\tclinical_information = models.TextField(null=True, blank=True)\n\tmacroscopic = models.TextField(null=True, blank=True)\n... | python | edit | 1 | 0 | mit | 5daa628d59576f00d0c5d49358a800dd728c6fdf | msfernandes/anato-hub,msfernandes/anato-hub,msfernandes/anato-hub,msfernandes/anato-hub | necropsy/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom . import SessionCart, CART_SESSION_KEY\n\n\nclass CartMiddleware(object):\n '''\n Saves the cart instance into the django session.\n '''\n\n def process_request(self, request):\n ... | python | edit | 1 | 3 | bsd-3-clause | 6464028097b13b5d03969c20bae56f9f70acbbd1 | HyperManTT/ECommerceSaleor,taedori81/saleor,car3oon/saleor,UITools/saleor,rodrigozn/CW-Shop,mociepka/saleor,spartonia/saleor,UITools/saleor,arth-co/saleor,UITools/saleor,paweltin/saleor,hongquan/saleor,Drekscott/Motlaesaleor,UITools/saleor,avorio/saleor,josesanch/saleor,tfroehlich82/saleor,maferelo/saleor,spartonia/sal... | saleor/cart/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function\nimport unittest\nfrom qtpy.QtWidgets import QApplication\nfrom addie.rietveld.braggtree import BraggTree, BankRegexException\n\n\nclass BraggTreeTests(unittest.TestCase):\n def setU... | python | edit | 5 | 1 | mit | 81f2a561ac27d13fb43edae1fb94b237951ff9cc | neutrons/FastGR,neutrons/FastGR,neutrons/FastGR | tests/rietveld/test_braggtree.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport jinja2\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n\nclass Config:\n @staticmethod\n def init_app(app):\n repo_root = os.path.abspath(os.path.dirname(__file__))\n template_folders = [\n ... | python | edit | 1 | 1 | mit | d5ee1185f0249d2e29f78866eb29552921b69ec9 | mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtek... | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n# must call \"sudo apt-get install sendmail\" first...\n\n\n# if sts != 0:\n# print(\"Sendmail exit status \"+str(sts))\n\n\n\ndef send_error(recipient, error_details):\n\tSENDMAIL = \"/usr/sbin/sendmail\" # sendmail locati... | python | edit | 3 | 3 | mit | 2ba4e0758c04bebcd1dcde78e99605d0b9460abf | mnori/foldatlas,mnori/foldatlas,mnori/foldatlas,mnori/foldatlas | foldatlas/monitor.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.