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\nfrom s2v1 import *\n\ndef number_of_records(data_sample):\n\treturn len(data_sample)\n\nnumber_of_ties = number_of_records(data_from_csv)\n\nprint(number_of_ties, \"ties in our data sample\")\n```\n\nApply this change: Subtract header row f... | python | edit | 3 | 1 | mit | 428889029541bb5c8f8998eb1f4cbc057a80fb87 | alexmilesyounger/ds_basics | s2v2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom waflib.Task import Task\nfrom waflib.TaskGen import extension\n\nclass gogobject(Task):\n\trun_str = '${GGG} ${GGGFLAGS} -o ${TGT[0].parent.abspath()} ${SRC}'\n\n@extension('.go.in')\ndef gogobject_hook(self, node):\n\ttg = self.bld.ge... | python | edit | 1 | 2 | mit | e63a914457fc10d895eb776a164939da3ddd9464 | nsf/gogobject,nsf/gogobject,nsf/gogobject,nsf/gogobject | waftools/gogobject.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.commands import loaddata\nfrom django.core.management.base import CommandError\nfrom django.db import DatabaseError\n\nfrom optparse import make_option\n\nfrom ...models import Schema, template_schema\n\nclass Co... | python | edit | 4 | 5 | bsd-3-clause | 1e8ecd09ce6dc44c4955f8bb2f81aa65232ad9a0 | luzfcb/django-boardinghouse,luzfcb/django-boardinghouse,luzfcb/django-boardinghouse | multi_schema/management/commands/loaddata.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nimport deployer.logger\nfrom celery.signals import setup_logging\n\n\n__version__ = '0.1.10'\n__author__ = 'sukrit'\n\ndeployer.logger.init_logging('root')\nsetup_logging.connect(deployer.logger.init_... | python | edit | 1 | 0 | mit | 26df58ea40651ac20845ed4a4a84642e61cdf84a | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer | deployer/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Simple Tasks\n\ndef hello():\n print 'Hello ThaiPy!'\n\n\ndef hi(name='Kan'):\n print 'Hi ' + name\n\n\n# Local Commands\n\nfrom fabric.api import local, lcd\n\n\ndef deploy_fizzbuzz():\n with lcd('fizzbuzz'):\n local('pyt... | python | edit | 3 | 1 | mit | d5e3a4f76121b4c1c38787156c50e0602c4de43f | zkan/fabric-workshop,zkan/fabric-workshop | fabfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ast\n\nfrom snoop import snoop\nfrom IPython.core.magic import Magics, cell_magic, magics_class\n\n\n@magics_class\nclass SnoopMagics(Magics):\n @cell_magic\n def snoop(self, _line, cell):\n filename = self.shell.compile... | python | edit | 1 | 4 | mit | f43f71cb016bc71ea32e80c2fd86f05b6af38468 | alexmojaki/snoop,alexmojaki/snoop | snoop/ipython.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pprint import pprint, pformat\nimport datetime\nimport os\nimport itertools\n\nfrom sgmock import Fixture\nfrom sgmock import TestCase\n\nif 'USE_SHOTGUN' in os.environ:\n from shotgun_api3 import ShotgunError, Fault\n import sho... | python | edit | 12 | 1 | bsd-3-clause | 66c1b353a7fce078fc9c4209e453906b098a22e8 | westernx/sgfs,westernx/sgfs | tests/common.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import task, local\n\n@task\ndef up():\n \"\"\"\n Deploy new release to pypi. Using twine util\n \"\"\"\n local(\"rm -rf dist\")\n local(\"rm -rf pgup.egg-info\")\n local(\"python ./setup.py sdist\")\n ... | python | edit | 1 | 1 | mit | 8ac20f5bec2d94e71b92e48568d18fd74be4e5d4 | stepan-perlov/pgup | fabfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Node(object):\n def __init__(self, value):\n pass\n\n def value(self):\n pass\n\n def next(self):\n pass\n\n\nclass LinkedList(object):\n def __init__(self, values=[]):\n self.size = 0\n ... | python | edit | 1 | 2 | mit | c3c26c15895a192fba22482306182950c0ccd57c | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | python/simple-linked-list/simple_linked_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\n\nrandom.seed()\n\nwhile True:\n print(chr(random.getrandbits(8)), end='')\n\n```\n\nApply this change: Add some comments and a shebang on top."
},
{
"role": "assistant",
"content": "#! /usr/bin/python3\nimport... | python | edit | 1 | 0 | apache-2.0 | 1c01b9e794445242c450534d1615a9dc755b89da | Tombert/RandCat | randcat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mgdpck\nfrom mgdpck import _version\nfrom mgdpck import data_access\nfrom mgdpck import exceptions\nfrom mgdpck import logging_util\nfrom mgdpck import model\nfrom mgdpck import actions\nfrom mgdpck.readers import *\nfrom mgdpck.writ... | python | edit | 11 | 0 | apache-2.0 | ee498b8a22def03fb745ebab53a875c9097d44b6 | Djabx/mgd | test/mgdpck/syntax_test.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport pytest\nfrom pywatson.watson import Watson\n\n\n@pytest.fixture\ndef config():\n \"\"\"Get Watson configuration from the environment\n\n :return: dict with keys 'url', 'username', and 'password'\n \"\"\"\n try:... | python | edit | 1 | 4 | mit | a5f60d664e7758b113abc31b405657952dd5eccd | sherlocke/pywatson | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n# OMDB_api_scrape.py - parses a movie and year from the command line, grabs the\n# JSON and saves a copy for later\n\nimport json, requests, sys, os\n\nURL_BASE = 'http://www.omdbapi.com/?'\n\nif len... | python | edit | 3 | 0 | mit | f559001d2c46fade2d9b62f9cb7a3f8053e8b80f | samcheck/PyMedia,samcheck/PyMedia,samcheck/PyMedia | OMDB_api_scrape.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Rewrite function for sample count"
},
{
"role": "assistant",
"content": "async def attach_sample_count(db, document, label_id):\n document.update({\"count\": await db.samples.count_documents({\"labels\": {\"$in\": [label_id]}}... | python | new_file | 1 | 1 | mit | caf9795cf0f775442bd0c3e06cd550a6e8d0206b | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool | virtool/labels/db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add versioning information to eve_api"
},
{
"role": "assistant",
"content": "VERSION = (0, 1)\n\n# Dynamically calculate the version based on VERSION tuple\nif len(VERSION)>2 and VERSION[2] is not None:\n str_version = \"%d.%d... | python | new_file | 1 | 0 | bsd-3-clause | b005d0b5eae4328e1482d0571f4dbc7164fef21f | nikdoof/test-auth | app/eve_api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport collections\nimport contextlib\nimport shutil\nimport subprocess\nimport tempfile\n\nfrom util.iter import chunk_iter\n\nCommit = collections.namedtuple('Commit', ['sha', 'date', 'name'])\n\nclass RepoParser(object):\n\n def __i... | python | edit | 1 | 3 | mit | 967ec17d15f07191e6d42fc122eb5e731605ad67 | ucarion/git-code-debt,Yelp/git-code-debt,ucarion/git-code-debt,ucarion/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt | git_code_debt/repo_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom subprocess import check_output as co\nfrom sys import exit\n\n# Actually run bin/mn rather than importing via python path\nversion = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True )\nversion = version... | python | edit | 1 | 0 | bsd-3-clause | 5d2dfa9f40f29ce7ddd23f8aff574c131539ed6c | mininet/mininet,mininet/mininet,mininet/mininet | util/versioncheck.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport flask\nimport os.path\nimport datetime\nimport urllib.parse\nfrom .. import configmanager\nfrom . import controllers\n\nFILE_LOCATION = os.path.abspath(os.path.dirname(__file__))\nSTATIC_PATH = os.path.abspath(os.path.join(FILE_LOCAT... | python | edit | 4 | 1 | mit | acec9342e392fed103e5d6b78470251d2cf535d6 | ollien/Timpani,ollien/Timpani,ollien/Timpani | timpani/webserver/webserver.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nCreates an admin user if there aren't any existing superusers\n'''\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.contrib.auth.models import User\nfrom optparse import make_option\n\n\nclass Command(B... | python | edit | 3 | 4 | apache-2.0 | f9c51c592483ab08417d4df33898d32f7700ffe9 | salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal | sal/management/commands/update_admin_user.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom pysc2.agents import base_agents\nfrom pysc2.lib import actions\n\n\n## SENTINEL FUNCTIONS\n\n# Functions related with Hallucination\n\n_HAL_ADEPT = actions.FUNCTIONS.Hallucination_Adept_quick.id\n_HAL_ARCHON = actions.FUNCTIONS.Hallu... | python | edit | null | null | apache-2.0 | 13f3d7d4a708cd05712b610d979dcf857ae85856 | SoyGema/Startcraft_pysc2_minigames | Agents/SentinelDefense.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\":mod:`krcurrency.utils` --- Helpers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\"\"\"\nfrom bs4 import BeautifulSoup as BS\nimport requests\n\n__all__ = 'request',\n\ndef request(url, encoding='utf-8', parselib='lxml'):\n \"\"\"url... | python | edit | 3 | 3 | mit | eba354cfaa96754b814daeb7fa453e538b07a879 | ssut/py-krcurrency | krcurrency/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom test.test_support import vereq, TestFailed\n\nimport symtable\n\nsymbols = symtable.symtable(\"def f(x): return x\", \"?\", \"exec\")\n\n## XXX\n## Test disabled because symtable module needs to be rewritten for new compiler\n\n##vereq... | python | edit | 5 | 1 | mit | 3ddad0538430499182c583a0a7f877884038c0a5 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_symtable.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nPlanned worklist member table.\n\"\"\"\nfrom sqlalchemy import Column\nfrom sqlalchemy import ForeignKey\nfrom sqlalchemy import Integer\nfrom sqlalchemy import Table\nfrom sqlalchemy.schema import PrimaryKeyConstraint\n\n__docforma... | python | edit | 1 | 1 | mit | 486d7e76c76e79a44c0ed199724f0dc349e7539a | helixyte/TheLMA,helixyte/TheLMA | thelma/db/schema/tables/plannedworklistmember.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ._remove import remove\nfrom ._load_and_dump import load, dump, ZerothIFD, ExifIFD, GPSIFD\nfrom ._transplant import transplant\nfrom ._insert import insert\ntry:\n from ._thumbnail import thumbnail\nexcept ImportError:\n print(\... | python | edit | 11 | 0 | mit | fee11dbff232216726516eea6c8bf7645fdef1a7 | hMatoba/Piexif | pyxif/__init__.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\n\nclass Enterprise(object):\n\n def __init__(self, domain):\n self.domain = domain\n\n def saml_login(self, client_id, connection):\n \"\"\"\n \"\"\"\n\n return requests.get(\n ... | python | edit | 1 | 1 | mit | 10f72ab0428ddf51b47bc95b64b2a532c8e670a5 | auth0/auth0-python,auth0/auth0-python | auth0/v2/authentication/enterprise.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport discord\r\nimport asyncio\r\nfrom tqdm import tqdm\r\nimport argparse\r\n\r\nparser = argparse.ArgumentParser(description='Discord channel scraper')\r\nrequiredNamed = parser.add_argument_group('Required arguments:')\r\nrequiredNamed... | python | edit | 4 | 2 | mit | 186a2c3f235264c3c71396efcbb8a33924758db9 | suclearnub/discordgrapher | scrape.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- Coding: utf-8 -*-\n\nimport os\n\nclass Dirmuncher:\n def __init__(self, directory):\n self.directory = directory\n\n def directoryListing(self):\n for dirname, dirnames, filenames in os.walk... | python | edit | 1 | 4 | mit | ee8cb600c772e4a0f795a0fe00b1e612cb8a8e37 | claudemuller/masfir | dirmuncher.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, patterns, url\n\nfrom rest_framework.routers import SimpleRouter\n\nfrom .. import views\n\n\nrouter = SimpleRouter(trailing_slash=False)\nrouter.register(r'pages', views.PageViewSet)\n\nurlpatterns = p... | python | edit | 1 | 0 | bsd-2-clause | fa78c5b5442c904ba3888b858eb2c284f16664ed | incuna/feincms-pages-api | pages/urls/page.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass AccessTokenConfig(AppConfig):\n name = 'froide.accesstoken'\n verbose_name = _('Secret Access Token')\n\n def ready(self):\n ... | python | edit | 1 | 3 | mit | c354d130cb542c2a5d57e519ce49175daa597e9c | fin/froide,fin/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide | froide/accesstoken/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n'''Test that the window caption can be set.\n\nExpected behaviour:\n Two windows will be opened, one with the caption \"Window caption 1\"\n counting up every second; the other with a Unicode string including\... | python | edit | 1 | 4 | bsd-3-clause | f17baf70d08f47dc4ebb8e0142ce0a3566aa1e9a | regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations | tests/window/WINDOW_CAPTION.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef before_train_station_pop(station, escalator):\n # calculate the number of people waiting to depart on the train by the time the train arive.\n station.travelers_departing = station.travelers_departing + (escalator.rate * escalator... | python | edit | 1 | 1 | mit | 3d1612e5f9e20cf74a962dd4ca1b538776d5ec7e | ForestPride/rail-problem | StationPopWithoutTrain.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport datetime\n\ndef return_true():\n return True\n\ndef return_false():\n return False\n\ndef return_int():\n return 123\n\ndef return_float():\n return 1.0\n\ndef return_string():\n return \"ABC\"\n... | python | edit | 1 | 1 | mit | dfdeaf536466cfa8003af4cd5341d1d7127ea6b7 | sensorbee/py,sensorbee/py | py/_test_py2go.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 IBM Corp.\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# http... | python | edit | 1 | 1 | apache-2.0 | fa7aecae90026037c9f5ce2ffef37184ee83f679 | citrix-openstack-build/oslo.versionedobjects,openstack/oslo.versionedobjects | nova/objects/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport unittest\n\nimport numpy as np\nimport torch\n\nsys.path.append(\"../metal\")\nfrom metal.utils import (\n rargmax,\n hard_to_soft,\n recursive_merge_dicts\n)\n\nclass UtilsTest(unittest.TestCase):\n def test_... | python | edit | 1 | 2 | apache-2.0 | a2e3f0590d5bd25993be5291c058c722896aa773 | HazyResearch/metal,HazyResearch/metal | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\nimport helpers\n\n\ndef plot():\n from matplotlib import pyplot as plt\n import numpy as np\n\n fig = plt.figure()\n\n x = np.ma.arange(0, 2*np.pi, 0.02)\n y1 = np.sin(1*x)\n y2 = np.sin(2*x)\n ... | python | edit | 1 | 1 | mit | f7f489369fa675e6efe0fa5b164b7ee1fc25f3fd | nschloe/matplotlib2tikz,m-rossi/matplotlib2tikz,danielhkl/matplotlib2tikz | test/test_legend_labels.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport fire\nimport json\nimport sys\n\nfrom source import VocabularyCom\nfrom airtable import Airtable\n\nclass CLI:\n class source:\n \"\"\"Import word lists from various sources\"\"\"\n\n def vocabulary_com(self, list_ur... | python | edit | 3 | 2 | mit | a71bd3f953b0363df82d1e44b0d6df6cbe4d449b | zqureshi/vocab | vocab.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport platform\nimport sys\n\nimport click\n\nprog = os.path.basename(sys.argv[0])\n\n\n@click.command('heartbeat', short_help='Send a heartbeat')\n@click.option('--origin', default='{}/{}'.format(prog, platform.uname()[1]))\n@c... | python | edit | 1 | 6 | apache-2.0 | 899f28e2cd7dbeb6227e8c56eef541cce1a424f4 | alerta/python-alerta-client,alerta/python-alerta-client,alerta/python-alerta | alertaclient/commands/cmd_heartbeat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tastypie.authorization import Authorization\nfrom tastypie.fields import CharField\nfrom tastypie.resources import ModelResource\n\nfrom expensonator.models import Expense\n\n\nclass ExpenseResource(ModelResource):\n tags = CharFiel... | python | edit | 1 | 2 | mit | 54bce2a224843ec9c1c8b7eb35cdc6bf19d5726b | matt-haigh/expensonator | expensonator/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014, Matt Layman\n'''Tests for the StorageFactory.'''\n\nimport unittest\n\nfrom markwiki.exceptions import ConfigurationError\nfrom markwiki.storage.factory import UserStorageFactory\nfrom markwiki.storage.fs.user import F... | python | edit | 1 | 1 | bsd-2-clause | f4b0493edc949f6c31e120f8c005fc8ea99f9ede | mblayman/markwiki,mblayman/markwiki | markwiki/tests/test_factory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import current_app\n\nimport cea.inputlocator\n\n\ndef deconstruct_parameters(p):\n params = {'name': p.name, 'type': p.typename,\n 'value': p.get(), 'help': p.help}\n try:\n params['choices'] = p._choic... | python | edit | 1 | 5 | mit | f02b6505f190011f06b37619ec4fdf9bda1e804e | architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS | cea/interfaces/dashboard/api/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2015, Daniele Venzano\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www... | python | edit | 3 | 1 | apache-2.0 | 5dd07cdc94a479b5c274a2335a50815b957cffe6 | DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe | zoe_web/web/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Do not commit secrets to VCS.\n\n# Local environment variables will be loaded from `.env.local`.\n# Additional environment variables will be loaded from `.env.$DOTENV`.\n# Local settings will be imported from `project_settings_local.py`\n... | python | edit | 2 | 0 | mit | 3ebf7f1633a072cd09f006910660373527d335bb | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | project_template/project_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport fractal\nimport bmp\n\npixels = fractal.mandelbrot(488, 256)\n\nbmp.write_grayscale('mandel.bmp', pixels)\n```\n\nApply this change: Add a main runner for mandel"
},
{
"role": "assistant",
"content": "import fractal\nimpo... | python | edit | 1 | 1 | mit | e019ce982325a6284e844df3c9a5f8172f494ba3 | kentoj/python-fundamentals | run_mandel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# script :: creating a datamodel that fits mahout from ratings.dat\n\nratings_dat = open('../data/movielens-1m/ratings.dat', 'r')\n\nratings_csv = open('../data/movielens-1m/ratings_without_timestamp.txt', 'w')\n\nfor line in ratings_dat:\n... | python | edit | 1 | 0 | mit | c9c0104456ef7d5dcda29db67788112a8435945b | monsendag/goldfish,ntnu-smartmedia/goldfish,ntnu-smartmedia/goldfish,monsendag/goldfish,ntnu-smartmedia/goldfish,monsendag/goldfish | scripts/createDataModel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os.path\nimport sys\nimport pandas as pd\nimport logging\n\nINPUT_DIRECTORY = '../../../data/raw/disease_SG'\nINPUT_FILE = \"weekly-dengue-malaria.csv\"\nOUTPUT_DIRECTORY = '../../Data/interim/disease_SG'\nOUTPUT_FILE = \"weekly-deng... | python | edit | 1 | 2 | mit | 8faf4cd2fa6e155bbe85510ce3ee388bb0e19d3c | DataKind-SG/healthcare_ASEAN | src/data/clean_scripts/SG_dengue_malaria_clean.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nimport sys\n\nfrom .api import parse\n\n\ndef main():\n result = parse(sys.argv[1])\n print(result)\n\n```\n\nApply this change: Read from stdin if available."
},
{
"role": "assistant",... | python | edit | 1 | 2 | apache-2.0 | 39c777d6fc5555534628113190bb543c6225c07e | weinerjm/uncurl,spulec/uncurl | uncurl/bin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nfrom distutils.core import setup, Extension\n\nMODULES_TO_BUILD = [\"fasthash\", \"suc\", \"lemmatize\"]\n\nfor module in MODULES_TO_BUILD:\n setup(\n name=module,\n ext_modules=[\n Extens... | python | edit | 1 | 2 | mit | 75d6e88de0ed8f8cb081de15ce0d3949a78c9ded | EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger | efselab/build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand, CommandError\nfrom mqtt_logger.models import *\n\n\nclass Command(BaseCommand):\n help = 'Start listening to mqtt subscriptions and save messages in database.'\n\n def add_arguments... | python | edit | 6 | 7 | mit | 93373242eab8d387a9b13c567239fa2e36b10ffa | ast0815/mqtt-hub,ast0815/mqtt-hub | mqtt_logger/management/commands/runmqttlistener.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy.orm import joinedload\n\nfrom datetime import datetime\n\nfrom changes.api.base import APIView\nfrom changes.api.build_index import execute_build\nfrom changes.config import db\nfrom changes.constants import Result, Status\n... | python | edit | 1 | 3 | apache-2.0 | 7ce46ada7322f2618fd92adf3eb0e8813b118031 | dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes | changes/api/build_restart.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport places\nfrom character import Character\nimport actions\nimport options\nfrom multiple_choice import MultipleChoice\n\n\ndef combat(character):\n \"\"\"\n takes in a character, returns outcome of fight\n \"\"\"\n return a... | python | edit | 1 | 6 | apache-2.0 | 8e53b65b5f28a02f8ee980b9f53a57e7cdd077bd | SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport setuptools\n\n__version__ = None # This will get replaced when reading version.py\n\nexec(open('rlbot/version.py').read())\n\nwith open(\"README.md\", \"r\") as readme_file:\n long_description = readme_file.read()\n\nsetuptools.s... | python | edit | 1 | 0 | mit | 11bcc53bc80409a0458e3a5b72014c9837561b65 | drssoccer55/RLBot,drssoccer55/RLBot | src/main/python/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport multiprocessing\n\nDEBUG = False # for now\n\ndef get_logger(level=None):\n logger = multiprocessing.get_logger()\n format = '[%(asctime)s][%(levelname)s/%(processName)s] %(message)s'\n formatter = logging.... | python | edit | 5 | 2 | mit | e1399a76dc7a3f69f8e4c76127a05652505bc26e | ekarulf/pymp | src/pymp/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env vpython\n# Copyright 2017 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\nfrom os import path as os_path\nimport platform\n... | python | edit | 1 | 2 | bsd-3-clause | 40122e169e6a887caa6371a0ff3029c35ce265d5 | ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend | third_party/node/node.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n\tname = 'tentd',\n\tversion = \"0.0.0\",\n\n\tauthor = 'James Ravenscroft',\n\turl = 'https://github.com/ravenscroftj/pytentd',\n\n\tdescrip... | python | edit | 1 | 0 | apache-2.0 | a4a50e2043bf49b867cc80d9b7d55333d6e0cffa | pytent/pytentd | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport getpass\nfrom distutils.command import upload as orig\n\n\nclass upload(orig.upload):\n \"\"\"\n Override default upload behavior to obtain password\n in a variety of different ways.\n \"\"\"\n\n def finalize_options(s... | python | edit | 1 | 3 | mit | c105d6f18a5a17b0a47fda5a2df2f8f47352b037 | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/command/upload.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nList repositories on Github belonging to organisations, teams, etc\n\"\"\"\n\n# Technical Debt\n# --------------\n\n# Known Bugs\n# ----------\n\nimport argparse\nimport codetools\nimport textwrap\n\ngh = co... | python | edit | 3 | 0 | mit | 95a78f801a094861832d2a27fc69866f99b44af4 | lsst-sqre/sqre-codekit,lsst-sqre/sqre-codekit | github_list_repos.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This module contains built-in introspector plugins for various common\n# Django apps.\n\n# These imports trigger the lower-down files\nimport south.introspection_plugins.geodjango\nimport south.introspection_plugins.django_tagging\nimport... | python | edit | 3 | 0 | apache-2.0 | 55646644c18fe5e10669743025cc00b8225f9908 | philipn/django-south,philipn/django-south,nimnull/django-south,RaD/django-south,RaD/django-south,RaD/django-south,nimnull/django-south | south/introspection_plugins/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licens... | python | edit | 1 | 0 | apache-2.0 | a2182bf8360b6c13983fc0abb2b058ab0273d54c | paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,frreiss/tensorflow-fred,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflo... | tensorflow/python/ops/ragged/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.plugin import IPlugin\nfrom heufybot.moduleinterface import BotModule, IBotModule\nfrom heufybot.utils.logutils import logExceptionTrace\nfrom zope.interface import implements\nimport re, requests\n\n\nclass WebUtils(BotModule)... | python | edit | 1 | 4 | mit | 054dc32d30ca9175a6c8b40af52491b8e3a98978 | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | heufybot/modules/util/webutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n Unit Test: orchard.extensions.babel\n\"\"\"\n\nimport unittest\n\nimport orchard\nimport orchard.extensions.flask_babel\n\n\nclass BabelUnitTest(unittest.TestCase):\n\n def setUp(self):\n sel... | python | edit | 1 | 1 | mit | ad4effbdf95b51f151d613f02f70b4501bbe453d | BMeu/Orchard,BMeu/Orchard | tests/unit/extensions/flask_babel_unit_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import * # noqa\n\n\nenv.hosts = [\n '104.131.30.135',\n]\nenv.user = \"root\"\nenv.directory = \"/home/django/api.freemusic.ninja\"\nenv.deploy_path = \"/home/django/django_project\"\n\n\ndef deploy():\n with cd(env.... | python | edit | 27 | 1 | bsd-3-clause | 2e0286632b9120fe6a788db4483911513a39fe04 | FreeMusicNinja/api.freemusic.ninja | fabfile.py | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .nn_solver import NNSolver\nfrom .lstm_solver import LSTMSolver\nfrom .tree_lstm_solver import TreeLSTMSolver\nfrom .memory_network import MemoryNetworkSolver\nfrom .differentiable_search import DifferentiableSearchSolver\n\nconcrete_s... | python | edit | 3 | 0 | apache-2.0 | 91b0bcad27f12c29681235079960ee272275e0bd | allenai/deep_qa,matt-gardner/deep_qa,DeNeutoy/deep_qa,allenai/deep_qa,DeNeutoy/deep_qa,matt-gardner/deep_qa | src/main/python/dlfa/solvers/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Run autopep8 on the selected buffer in Vim.\n\nmap <C-I> :pyfile <path_to>/vim_autopep8.py<CR>\n\n\"\"\"\n\nimport vim\nif vim.eval('&syntax') == 'python':\n encoding = vim.eval('&fileencoding')\n source = '\\n'.join(line.decode... | python | edit | 1 | 2 | mit | 5436068e2a0974a932d59d51dd529af221832735 | vauxoo-dev/autopep8,Vauxoo/autopep8,vauxoo-dev/autopep8,hhatto/autopep8,SG345/autopep8,SG345/autopep8,MeteorAdminz/autopep8,Vauxoo/autopep8,hhatto/autopep8,MeteorAdminz/autopep8 | test/vim_autopep8.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport sys\nimport redis\nimport redis.exceptions\n\nhost = sys.argv[1]\nhost = host.strip('\\r\\n')\nport = 6379\ntimeout = 5\n\ntry:\n db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout)\n ... | python | edit | 1 | 0 | bsd-3-clause | 0749c47bb280230ae5b1e2cda23773d3b10b2491 | averagesecurityguy/research | redis_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nRules for PHAs, AccessTokens, ReqTokens\n\"\"\"\n\nfrom smart.views import *\n\ndef grant(happ, permset):\n \"\"\"\n grant the permissions of an account to this permset\n \"\"\"\n\n def need_admin(*a,**b): return happ.ad... | python | edit | 8 | 1 | apache-2.0 | bf8d2b33794f676f27b9a22bca57a06b94f7c2ce | smart-classic/smart_server,smart-classic/smart_server | smart/accesscontrol/rules/helper_app.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom django.contrib.auth.models import User\nfrom osmaxx.contrib.auth.frontend_permissions import user_in_osmaxx_group\n\n\nclass TestFrontendPermissions(TestCase):\n def test_superuser_can_access_fronte... | python | edit | 1 | 1 | mit | 370dac353937d73798b4cd2014884b9f1aa95abf | geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend | osmaxx-py/osmaxx/contrib/auth/tests/test_frontend_permissions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- mode: python; coding: utf-8 -*-\n# Copyright 2021 The HERA Collaboration\n# Licensed under the 2-clause BSD License\n\"\"\"\nCheck that input files are safely in the librarian.\n\nThis script takes a list of inp... | python | edit | 1 | 0 | bsd-2-clause | 4f6e27a6bbc2bbdb19c165f21d47d1491bffd70e | HERA-Team/hera_mc,HERA-Team/hera_mc | scripts/mc_check_lib_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom functools import wraps\n\nfrom twisted.web import http\n\nfrom jsonschema import Draft4Validator\n\nfrom vumi_http_retry.workers.api.utils import response\n\n\ndef validate(*validators):\n def validator(fn):\n @w... | python | edit | 3 | 4 | bsd-3-clause | a8c8b136f081e3a2c7f1fd1f833a85288a358e42 | praekelt/vumi-http-retry-api,praekelt/vumi-http-retry-api | vumi_http_retry/workers/api/validate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"create redmine tables\n\nRevision ID: d596dc9b53d9\nRevises: 2ffb0d589280\nCreate Date: 2017-08-14 14:43:31.234637\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\n\n\n# revision identifiers, used by Alembic.\nrevision = 'd... | python | edit | 1 | 1 | mit | 3bc3a9c29e448e6ca1eaa3c962d144bd1b5f874e | beproud/beproudbot,beproud/beproudbot | migrations/versions/d596dc9b53d9_create_redmine_tables.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\n\n\nclass DashboardTest(TestCase):\n def test_dashboard(self):\n url = reverse('graphite.dashboard.views.dashboard')\n response = self.client.g... | python | edit | 1 | 1 | apache-2.0 | 5c61d7f125078cb6b3bd0c5700ae9219baab0078 | redice/graphite-web,dbn/graphite-web,Skyscanner/graphite-web,penpen/graphite-web,lyft/graphite-web,esnet/graphite-web,bpaquet/graphite-web,atnak/graphite-web,section-io/graphite-web,kkdk5535/graphite-web,cosm0s/graphite-web,cgvarela/graphite-web,gwaldo/graphite-web,redice/graphite-web,edwardmlyte/graphite-web,atnak/gra... | webapp/tests/test_dashboard.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom . import widgets\n\n\nclass HistoryDetailsForm(forms.Form):\n\n CIRCUMSTANCE_CHOICES = [\n (\"full_time\", \"Full time\"),\n (\"part_time\", \"Part time\"),\n (\"work_programme\", \"Wor... | python | edit | 1 | 1 | bsd-3-clause | 193831b6ee8b49674e32413e71819f2451bfc844 | lm-tools/situational,lm-tools/sectors,lm-tools/situational,lm-tools/situational,lm-tools/situational,lm-tools/sectors,lm-tools/situational,lm-tools/sectors,lm-tools/sectors | situational/apps/quick_history/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright 2009-2014 Eucalyptus Systems, Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of t... | python | edit | 1 | 0 | apache-2.0 | 1a12f250088d92544a277e3d683dc397687a4188 | ccassler/DeploymentManager,tbeckham/DeploymentManager,tbeckham/DeploymentManager,ccassler/DeploymentManager,tbeckham/DeploymentManager,ccassler/DeploymentManager | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom werkzeug.contrib.cache import (NullCache, SimpleCache, MemcachedCache,\n GAEMemcachedCache, FileSystemCache)\n\ndef null(app, args, kwargs):\n return NullCache()\n\ndef simple(app, args, kwargs):\n... | python | edit | 1 | 2 | bsd-3-clause | 5a92773a1d9c40e745026ca318ae21bfce2d4fb6 | kazeeki/mezmorize,kazeeki/mezmorize,j-fuentes/flask-cache,ordbogen/flask-cache,j-fuentes/flask-cache,thadeusb/flask-cache,alexey-sveshnikov/flask-cache,ordbogen/flask-cache,alexey-sveshnikov/flask-cache,thadeusb/flask-cache,gerasim13/flask-cache,gerasim13/flask-cache | flaskext/cache/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .equals_builder import EqualsBuilder\nfrom .hash_code_builder import HashCodeBuilder\n\n\n__all__ = [\n 'hashable',\n 'equality_comparable',\n]\n\n\ndef hashable(cls=None, attributes=None, methods=None):\n _validate_attributes... | python | edit | 3 | 2 | mit | 57bc8b3c40bbafda6f69b23c230ad73750e881ab | minmax/hashable | hashable/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom .models import Playlist, Track, Favorite\n\nclass TrackSerializer(serializers.ModelSerializer):\n class Meta:\n model = Track\n fields = '__all__'\n\nclass PlaylistSerializer(ser... | python | edit | 1 | 2 | mit | 33fbc424d725836355c071593042953fb195cff6 | hrr20-over9000/9001,SoundMoose/SoundMoose,SoundMoose/SoundMoose,douvaughn/9001,douvaughn/9001,hxue920/9001,hrr20-over9000/9001,hxue920/9001,CalHoll/SoundMoose,CalHoll/SoundMoose,douvaughn/9001,CalHoll/SoundMoose,hrr20-over9000/9001,hxue920/9001,douvaughn/9001,hxue920/9001,SoundMoose/SoundMoose,SoundMoose/SoundMoose,Cal... | server/project/apps/core/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport threading\n\n_locals = threading.local()\n\n\ndef get_event_context():\n return getattr(_locals, 'context', None)\n\n\ndef set_event_context(context):\n _locals.context = context\n\n\n... | python | edit | 1 | 3 | mit | 9ac662557d6313190621c0c84a2c6923e0e9fa72 | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/logging/middleware.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_lazy as _\n\n\nclass Story(models.Model):\n url = models.URLField(_('URL'))\n title = models.CharField(_('Title'), max_length=64)\n excerpt = models.CharFi... | python | edit | 1 | 0 | bsd-3-clause | 4b819129557d5f0546d9edf206710fd2ec962881 | madr/utsokt,madr/utsokt | utsokt/restapi/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Note that in the Markdown preprocessor registry, the highest\n# numeric value is considered the highest priority, so the dict\n# below is ordered from highest-to-lowest priority.\nPREPROCESSOR_PRIORITES = {\n \"generate_parameter_descr... | python | edit | 1 | 0 | apache-2.0 | 09851ff2903db29703616da0fbc9ec003955712a | eeshangarg/zulip,rht/zulip,rht/zulip,kou/zulip,eeshangarg/zulip,rht/zulip,eeshangarg/zulip,zulip/zulip,rht/zulip,andersk/zulip,kou/zulip,eeshangarg/zulip,kou/zulip,andersk/zulip,andersk/zulip,andersk/zulip,kou/zulip,andersk/zulip,rht/zulip,rht/zulip,zulip/zulip,kou/zulip,zulip/zulip,zulip/zulip,eeshangarg/zulip,andersk... | zerver/lib/markdown/preprocessor_priorities.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom scrapy.item import Item, Field\n\nclass DatasetItem(Item):\n\n name = Field()\n frequency = Field()\n \n```\n\nApply this change: Add url field to Dataset web item"
},
{
"role": "assistant",
"content": "from scrapy... | python | edit | 1 | 0 | mit | 6d08c13fbf42eb4251d3477a904ab6d8513620df | MaxLikelihood/CODE | dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\nimport logging\nfrom corehq.util.global_request import get_request\nfrom dimagi.utils.logging import notify_exception\n\n\ndef handle_uncaught_exceptions(mail_admins=True):\n \"\"\"Decorator to log uncaught e... | python | edit | 3 | 3 | bsd-3-clause | 5c851ee3d333518829ce26bfc06fd1038e70651c | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq | corehq/util/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nBROKER_URL = 'amqp://couchbase:couchbase@172.23.97.73:5672/broker'\nCELERY_RESULT_BACKEND = 'amqp'\nCELERY_RESULT_EXCHANGE = 'perf_results'\nCELERY_RESULT_PERSISTENT = False\n\n```\n\nApply this change: Disable hijacking of previously confi... | python | edit | 1 | 0 | apache-2.0 | e8d57ef08616b06e5f94da7e01ba96c13b9124d7 | couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner | perfrunner/celeryremote.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport docker\n\nfrom etcdocker import util\n\n\nclass Container:\n def __init__(self, name, params):\n self.name = name\n self.params = params\n\n def set_or_create_param(self, key, value):\n self.params[key] = v... | python | edit | 1 | 7 | mit | 293d50438fab81e74ab4559df7a4f7aa7cfd8f03 | CloudBrewery/docrane | etcdocker/container.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nfrom rewrite_external_links import get_version\n\n\ndescription = (\n 'Rewrite all external (off-site) links to go via a message page, '\n + 'using a middleware class.'\n)\n\nsetup(\n name=\"django-r... | python | edit | 1 | 0 | bsd-2-clause | 19d2fcf0da030f32d9cef9384a5b5113dfcd8443 | incuna/django-rewrite-external-links,incuna/django-rewrite-external-links | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n###\n### Copyright 2014-2015 Boundary, Inc.\n###\n### Licensed under the Apache License, Version 2.0 (the \"License\");\n### you may not use this file except in compliance with the License.\n### You may obtain a copy of the License at\n###\... | python | edit | 1 | 1 | apache-2.0 | 75171ed80079630d22463685768072ad7323e653 | boundary/boundary-api-cli,boundary/boundary-api-cli,jdgwartney/boundary-api-cli,jdgwartney/pulse-api-cli,wcainboundary/boundary-api-cli,wcainboundary/boundary-api-cli,jdgwartney/pulse-api-cli,boundary/pulse-api-cli,jdgwartney/boundary-api-cli,boundary/pulse-api-cli | boundary/action_installed.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-#\nfrom collections import OrderedDict\n\nimport requests\nimport cssutils\n\nUSER_AGENTS = OrderedDict()\nUSER_AGENTS['woff'] = 'Mozilla/5.0 AppleWebKit/537.36 Chrome/30', # Chrome\nUSER_AGENTS... | python | edit | 1 | 2 | mit | 63a7b11d3ae51a944bf2e70637dea503e455c2f5 | glasslion/fontdump | fontdump/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport base\nfrom blocks import Blocks\nimport re\n\nclass Sentences(base.Base):\n _type = 'sentences'\n child_class = Blocks\n\n @staticmethod\n def parse(text):\n #re.split('\\!|\\?|\\. | \\.',text)\n result = []... | python | edit | 1 | 10 | mit | 7efcc9987f827eec56677d95bc7ad873208b392f | diNard/Saw | saw/parser/sentences.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\nimport glob\n\ndatas = [ \"locale/\" + l.rsplit('/')[-1]+\"/LC_MESSAGES/*.*\" for l in glob.glob(\"pages/locale/*\")]\ndatas.extend([\n 'templates/admin/pages/page/*.html',\n 'templates/pages/*.html',... | python | edit | 1 | 0 | bsd-3-clause | d9fe33ff2b6c995ac2864b85bee18f5b813c85cc | PiRSquared17/django-page-cms,odyaka341/django-page-cms,google-code-export/django-page-cms,google-code-export/django-page-cms,Alwnikrotikz/django-page-cms,pombreda/django-page-cms,PiRSquared17/django-page-cms,pombreda/django-page-cms,pombreda/django-page-cms,odyaka341/django-page-cms,google-code-export/django-page-cms,g... | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import Column, ForeignKey, Integer, String\nfrom sqlalchemy.orm import relationship\nfrom sqlalchemy import create_engine\n\nfrom models.base import Base\nfrom models.user import User\nfrom models.store import Store\nfrom mo... | python | edit | 10 | 0 | mit | 2e897f7dce89d4b52c3507c62e7120ee238b713c | caasted/aws-flask-catalog-app,caasted/aws-flask-catalog-app | database/database_setup.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(name='corker',\n version='0.4',\n description='Another WSGI Framework',\n classifiers=[\"Development Status :: 4 - Beta\",\n \"Intended Audience :: Develo... | python | edit | 1 | 0 | bsd-2-clause | 5c6bb0b463f0cfde26f56251bb3225e358d4b2b6 | jd-boyd/corker,vs-networks/corker | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 Internap.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.or... | python | edit | 1 | 2 | apache-2.0 | 34c427200c6ab50fb64fa0d6116366a8fa9186a3 | idjaw/netman,internaphosting/netman,internap/netman,godp1301/netman,mat128/netman,lindycoder/netman | netman/core/objects/bond.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom contextlib import contextmanager\n\nfrom sqlalchemy import MetaData, create_engine\nfrom sqlalchemy.engine import Engine\nfrom sqlalchemy.orm import sessionmaker\n\n\nclass Schema():\n\n def __init__(self, engine_or_url, *args, **kw... | python | edit | 1 | 3 | mit | 554bf6551d0be9d11e046610e4b5772b5beeb9b8 | mediawiki-utilities/python-mwdb | mwdb/schema.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:\n\n# python-quilt - A Python implementation of the quilt patch system\n#\n# Copyright (C) 2012 Björn Ricks <<EMAIL>>\n#\n# This library is free software; you can redistribute it and/or\n# modif... | python | edit | 1 | 4 | mit | eef28c81f19d7e5eb72635cc2e6bf3b74331c743 | vadmium/python-quilt,bjoernricks/python-quilt | quilt/patch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom .models import Institution\n\n\nclass InstitutionSerializer(serializers.HyperlinkedModelSerializer):\n on_site = serializers.CharField(source='get_absolute_url', read_only=True)\n\n class... | python | edit | 1 | 0 | mit | 368e2d6407cb021d80fe3679c65737581c3cc221 | watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator | bliski_publikator/institutions/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, Extension, find_packages\nfrom Cython.Build import cythonize\n\n# Cython extensions\nsources = [\"FastxIO/fastx.pyx\", \"FastxIO/reverse_complement.c\"]\nextensions = [Extension(\"FastxIO.fastx\", sources, extr... | python | edit | 1 | 0 | mit | 4c1ec733615b0fd21677f8b4e9a8acd9381dff53 | mckinsel/FastxIO,mckinsel/FastxIO | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\"zerver\", \"0098_index_has_alert_word_user_messages\"),\n ]\n\n operations = [\n migrations.RunSQL(\n \... | python | edit | 1 | 0 | apache-2.0 | cd9b9675cd81e9ee01b4ad2932319a6070b82753 | kou/zulip,kou/zulip,kou/zulip,rht/zulip,andersk/zulip,zulip/zulip,kou/zulip,andersk/zulip,andersk/zulip,zulip/zulip,andersk/zulip,rht/zulip,kou/zulip,rht/zulip,zulip/zulip,kou/zulip,andersk/zulip,zulip/zulip,zulip/zulip,zulip/zulip,rht/zulip,rht/zulip,kou/zulip,zulip/zulip,rht/zulip,rht/zulip,andersk/zulip,andersk/zuli... | zerver/migrations/0099_index_wildcard_mentioned_user_messages.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass FailedSynchronization(Exception):\n pass\n\n\nclass SynchronizationTimeout(Exception):\n \"\"\"\n A synchronization for a particular project took longer than the timeout.\n \"\"\"\n\n```\n\nApply this change: Add the stand... | python | edit | 1 | 0 | bsd-2-clause | e612a742caeedf5398522365c984a39c505e7872 | davidfischer/warehouse | warehouse/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport sys\nimport argparse\n\nfrom macdict.dictionary import lookup_word, ensure_unicode\n\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument('word')\n return ... | python | edit | 1 | 2 | mit | f16994fd3722acba8a60157eed0630a5e2a3d387 | tonyseek/macdict | macdict/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import find_packages, setup\n\nwith open('README.rst') as f:\n long_description = f.read()\n\nsetup(\n name='ocdsmerge',\n version='0.6.6',\n author='Open Contracting Partnership',\n author_email='<EMAIL>',\n ... | python | edit | 1 | 0 | bsd-3-clause | f53667ef43e1b57b611e55155571cf985fdf40d5 | open-contracting/ocds-merge | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Create your views here.\nfrom django.http import HttpResponse\nfrom registration.models import Team\nfrom django.core import serializers\n\ndef get_teams(request):\n return_data = serializers.serialize(\"json\", Team.objects.all())\n ... | python | edit | 1 | 1 | bsd-3-clause | 3ca30011794143785955792e391902823427ef77 | hgrimberg01/esc,hgrimberg01/esc | registration/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom ..framework import cli_test_suite\nfrom .util import DEFAULT_MANAGEMENT_KEY\n\n\n@cli_test_suite\ndef additional_tests(ykman_cli):\n class Misc(unittest.TestCase):\n\n def setUp(self):\n ykman_cl... | python | edit | 3 | 1 | bsd-2-clause | 7844df0c4f32c9cc1f5833aba4712680461f77b5 | Yubico/yubikey-manager,Yubico/yubikey-manager | test/on_yubikey/cli_piv/test_misc.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.