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 fabric.api import local\n\n__author__ = 'derek'\n\n\ndef deploy(version):\n local('python runtests.py')\n local(\"git tag -a %s -m %s\" % (version, version))\n local('python setup.py sdist upload')\n```\n\nApply this change: M... | python | edit | 1 | 1 | mit | 943d2648c17facb9dbfd4f26d335beef341e9c49 | winfieldco/django-mail-queue,Goury/django-mail-queue,Goury/django-mail-queue,dstegelman/django-mail-queue,dstegelman/django-mail-queue,styrmis/django-mail-queue | fabfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport imp\nimport os\nimport sys\nimport traceback\n\nfrom os.path import dirname\n\nfrom configurations import values\nfrom .common import Common, BASE_DIR, external_keys\n\nSECRETS_DIR = os.path.join(dirname(BASE_DIR), \"secrets\")\n\ncl... | python | edit | 6 | 6 | apache-2.0 | b8b72be48328ba0bc6e946a4ecf15c00f5f8b3b6 | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | director/director/config/dev.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# TOOL test-data-in-out.py: \"Test data input and output in Python\" (Data input output test.) \n# INPUT input TYPE GENERIC\n# OUTPUT output\n# OUTPUT OPTIONAL missing_output.txt\n\nimport shutil\n\nshutil.copyfile('input', 'output')\n\n\n`... | python | edit | 2 | 0 | mit | 075b11aa830c9a5961e9ee63e42484192990f7d3 | chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools | tools/misc/python/test-data-in-out.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nset(\n fab_hosts = ['startthedark.com'],\n fab_user = 'startthedark',\n)\n\ndef unlink_nginx():\n 'Un-link nginx rules for startthedark.'\n sudo('rm -f /etc/nginx/sites-enabled/startthedark.com')\n sudo('/etc/init.d/nginx rel... | python | edit | 11 | 1 | bsd-3-clause | 04e8206a8610666c6027fc0f4be5e786e4bd5513 | mvayngrib/startthedark,mvayngrib/startthedark,ericflo/startthedark,ericflo/startthedark,mvayngrib/startthedark,ericflo/startthedark | fabfile.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nBase NLP utilities\n'''\n\n\ndef get_words(sentence):\n ''' Return all the words found in a sentence.\n Ignore whitespace and all punctuation\n >>> get_words('a most interesting piece')\n >>> ['a', 'most', 'interesting', 'p... | python | edit | 1 | 6 | bsd-2-clause | d52d8ce18745d5ec0e722340cf09735938c8a0c0 | ambidextrousTx/RNLTK | src/BaseUtils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"An example application using Confit for configuration.\"\"\"\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nimport confit\nimport argparse\n\n\nconfig = confit.LazyConfig('ConfitExample', __name__)\n\... | python | edit | 1 | 2 | mit | 9e90fe6523e7d61d6b94f9bb37a2dbf711cd3b83 | sampsyo/confit,sampsyo/confuse | example/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom enum import Enum\n\n\nclass Status(Enum):\n ok = 1 # green\n maintenance = 2 # blue\n minor = 3 # yellow\n major = 4 # orange\n critical = 5 # red\n unavailable = 6 # gr... | python | edit | 6 | 1 | apache-2.0 | 716d967971d9ea23ab54d327231ba873b681a7c7 | marcopaz/is-service-up,marcopaz/is-service-up,marcopaz/is-service-up | isserviceup/services/models/service.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils._os import safe_join\nimport os\nfrom django.conf import settings\nfrom django.contrib.staticfiles.finders import FileSystemFinder\nfrom bluebottle.clients.models import Client\n\n\nclass TenantStaticFilesFinder(FileSystem... | python | edit | 1 | 6 | bsd-3-clause | b575099c0d1f23916038172d46852a264a5f5a95 | jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle | bluebottle/utils/staticfiles_finders.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import date as vanilla_date\n\nfrom calendar_testing import CalendarTest\n\nfrom calexicon.calendars.other import JulianDayNumber\n\nclass TestJulianDayNumber(CalendarTest):\n def setUp(self):\n self.calendar = Julia... | python | edit | 1 | 2 | apache-2.0 | 5233e6d7f7d4f494f62576206ede87d13e8f760d | jwg4/calexicon,jwg4/qual | calexicon/calendars/tests/test_other.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2015 Mirantis, Inc.\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://www... | python | edit | 1 | 0 | apache-2.0 | ae689c9de698daeaf8ab5275c384183cb665c903 | openstack/neutron-classifier,openstack/neutron-classifier | neutron_classifier/common/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE... | python | edit | 1 | 1 | apache-2.0 | 183f9455425fa63b6ca43c5d4fe650bcf2179da5 | SauloAislan/ironic,SauloAislan/ironic | ironic/drivers/modules/storage/noop.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\nfrom main.models import Profile, LanProfile\n\n\nclass AdminLanProfileForm(forms.ModelForm):\n class Meta:\n model = LanProfile\n fields = '__all__'\n\n\nclass AdminProfileForm(forms.ModelForm):\... | python | edit | 1 | 2 | mit | 15db774538b4fa18c0653fb741ba14c0373867c8 | bomjacob/htxaarhuslan,bomjacob/htxaarhuslan,bomjacob/htxaarhuslan | main/admin/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.backends import ModelBackend\nfrom django.contrib.auth.models import User\nfrom hashlib import sha1\n\n\nclass SimpleHashModelBackend(ModelBackend):\n\n def authenticate(self, username=None, password=None):\n ... | python | edit | 1 | 5 | bsd-3-clause | 44547695f662c957f5242f7cfefd328b33d99830 | nikdoof/test-auth | sso/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom kokki import *\n\nPackage(\"python-boto\")\n\n# Mount volumes and format is necessary\n\nfor vol in env.config.aws.volumes:\n env.cookbooks.aws.EBSVolume(vol['volume_id'],\n availability_zone = env.config.aws.availability_z... | python | edit | 10 | 0 | bsd-3-clause | f46770697d668e31518ada41d31fdb59a84f3cf6 | samuel/kokki | kokki/cookbooks/aws/recipes/default.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"Test testing utilities\n\"\"\"\n\nfrom nipype.testing.utils import TempFATFS\nfrom nose.tools import assert_true\n\n\n... | python | edit | 1 | 2 | bsd-3-clause | c557058a7a7206167108535129bc0b160e4fe62b | mick-d/nipype,carolFrohlich/nipype,FCP-INDI/nipype,sgiavasis/nipype,mick-d/nipype,FCP-INDI/nipype,FCP-INDI/nipype,carolFrohlich/nipype,carolFrohlich/nipype,FCP-INDI/nipype,mick-d/nipype,sgiavasis/nipype,mick-d/nipype,carolFrohlich/nipype,sgiavasis/nipype,sgiavasis/nipype | nipype/testing/tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\nimport importlib\nimport os\nimport logging\nfrom website import settings\n\n\nlogger = logging.getLogger(__name__)\n\nWATERBUTLER_CREDENTIALS = {\n 'storage': {}\n}\n\nWATERBUTLER_SETTINGS = {\n 'storage': {\n ... | python | edit | 1 | 0 | apache-2.0 | 1b338aa716311b4c91281993e35e9beda376735a | CenterForOpenScience/osf.io,binoculars/osf.io,monikagrabowska/osf.io,caneruguz/osf.io,TomBaxter/osf.io,chrisseto/osf.io,monikagrabowska/osf.io,sloria/osf.io,crcresearch/osf.io,erinspace/osf.io,caseyrollins/osf.io,Nesiehr/osf.io,TomBaxter/osf.io,leb2dg/osf.io,pattisdr/osf.io,baylee-d/osf.io,adlius/osf.io,felliott/osf.io... | addons/osfstorage/settings/defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nYou can use this as a boilerplate for your test framework.\nDefine your customized library methods in a master class like this.\nThen have all your test classes inherit it.\nBaseTestCase will inherit SeleniumBase methods from BaseCase.... | python | edit | 1 | 1 | mit | 2515b3402c671c2949e5f3c712cb284777f2accf | seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | examples/boilerplates/base_test_case.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pprint\nimport sys\n\nfrom st2actions.runners.pythonrunner import Action\n\n__all__ = [\n 'AssertObjectEquals'\n]\n\n\nclass AssertObjectEquals(Action):\n def run(self, object, expected):\n ret = cmp(object, expected)\n\... | python | edit | 1 | 2 | apache-2.0 | bd9d08870ec3db09c41c825029c6a513ecc4d1c7 | StackStorm/st2tests,StackStorm/st2tests,StackStorm/st2tests | packs/asserts/actions/object_equals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..override_audit import reload\n\nreload(\"src\", [\"core\", \"events\", \"contexts\", \"browse\", \"settings_proxy\"])\nreload(\"src.commands\")\n\nfrom . import core\nfrom .core import *\nfrom .events import *\nfrom .contexts import ... | python | edit | 28 | 0 | mit | 03fb3e68f9ec9432a25c60bda06fcd49d604befc | OdatNurd/OverrideAudit | src/__init__.py | rejected_lint | Too many lint violations: 28 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: Milos Buncic\n# Date: 2017/10/14\n# Description: Convert YAML to JSON and vice versa (OpenFaaS function)\n\nimport os\nimport sys\nimport json\nimport yaml\n\n\ndef handle(data, **parms):\n def yaml2json(ydata):\n \"\"\"\n ... | python | edit | 4 | 2 | mit | 5a45a312eebe9e432b066b99d914b49a2adb920c | psyhomb/serverless | openfaas/yaml2json/function/handler.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('testing', parent_package, top_path)\n\n config.add_subpackage('_private')... | python | edit | 1 | 1 | bsd-3-clause | 22412b3f46451177286f8fc58509a69bb2d95731 | rgommers/numpy,numpy/numpy,endolith/numpy,pdebuyl/numpy,simongibbons/numpy,simongibbons/numpy,mhvk/numpy,seberg/numpy,mattip/numpy,jakirkham/numpy,jakirkham/numpy,mattip/numpy,mhvk/numpy,charris/numpy,seberg/numpy,anntzer/numpy,rgommers/numpy,jakirkham/numpy,mhvk/numpy,charris/numpy,anntzer/numpy,pdebuyl/numpy,rgommers... | numpy/testing/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nimport os.path\n\nfrom qmpy.models import Calculation\nfrom ..tools import get_globals\n\nfrom bokeh.embed import components\n\ndef calculation_vie... | python | edit | 1 | 5 | mit | a78f56e5c4dedc4148ff3503a05705a8d343b638 | wolverton-research-group/qmpy,wolverton-research-group/qmpy,wolverton-research-group/qmpy,wolverton-research-group/qmpy,wolverton-research-group/qmpy | qmpy/web/views/analysis/calculation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport copy\nimport json\n\nfrom py4j.java_gateway import JavaClass, java_import\nfrom pymrgeo.instance import is_instance_of as iio\n\nclass RasterMapOp(object):\n mapop = None\n gateway = None\n context = None\n job = None\n\n... | python | edit | 1 | 3 | apache-2.0 | 3c2663d4c8ca523d072b6e82bf872f412aba9321 | ngageoint/mrgeo,ngageoint/mrgeo,ngageoint/mrgeo | mrgeo-python/src/main/python/pymrgeo/rastermapop.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom censusreporter.config.base.settings import *\nimport os\n\nDEBUG = False\nROOT_URLCONF = 'censusreporter.config.prod.urls'\nWSGI_APPLICATION = \"censusreporter.config.prod.wsgi.application\"\n\n\nALLOWED_HOSTS = [\n 'censusreporter.... | python | edit | 2 | 0 | mit | a64f8aaa2822ccd280f252e0937be5027d5ec012 | censusreporter/censusreporter,censusreporter/censusreporter,censusreporter/censusreporter,censusreporter/censusreporter | censusreporter/config/prod/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import namedtuple\n\nimport requests\n\n\nQUERY_TEMPLATE = '?token={}&domain={}'\nBASE_URL = 'https://pddimp.yandex.ru/api2/'\n\nConnection = namedtuple('Connection', ['auth', 'domain'])\n\n\ndef list_emails(connection):\n ... | python | edit | 3 | 4 | mit | 0ad29aa9945448236500b221fc489c1627e6693b | chrisseto/dinosaurs.sexy,chrisseto/dinosaurs.sexy | api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf8\nfrom __future__ import unicode_literals\n\nimport gc\n\nfrom . import msgpack\nfrom .util import force_path\n\n\ndef msgpack_dumps(data):\n return msgpack.dumps(data, use_bin_type=True)\n\n\ndef msgpack_loads(data):\n ... | python | edit | 1 | 1 | mit | 94e44e18832311bc063830c0a6bfe23e04e40a8d | explosion/srsly,explosion/srsly,explosion/srsly,explosion/srsly | srsly/_msgpack_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Blueprint\nfrom flask import render_template\nfrom flask import request\n\nspring_evals_bp = Blueprint('spring_evals_bp', __name__)\n\n@spring_evals_bp.route('/spring_evals/')\ndef display_spring_evals():\n # get user d... | python | edit | 1 | 1 | mit | dc68813d5f555a01f1bdd2511d9d2de820369573 | RamZallan/conditional,ComputerScienceHouse/conditional,RamZallan/conditional,ComputerScienceHouse/conditional,RamZallan/conditional,ComputerScienceHouse/conditional | conditional/blueprints/spring_evals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n\"\"\"Setup file for distutils / pypi.\"\"\"\ntry:\n from ez_setup import use_setuptools\n use_setuptools()\nexcept ImportError:\n pass\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='django-wms-... | python | edit | 1 | 0 | bsd-2-clause | b56446e0dc7c0c0fe45557461dd4fffa7f1da8d5 | kartoza/django-wms-client,kartoza/django-wms-client,kartoza/django-wms-client,kartoza/django-wms-client | django_project/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nfrom spec import Spec, skip\nfrom invoke import run\n\n\nclass Integration(Spec):\n def setup(self):\n from tessera.application import db\n # Ensure we have a clean db target.\n self.dbpath =... | python | edit | 5 | 2 | apache-2.0 | e78b3f53150a5f1c170b860f8719e982cf1c6f9e | section-io/tessera,urbanairship/tessera,tessera-metrics/tessera,jmptrader/tessera,section-io/tessera,urbanairship/tessera,aalpern/tessera,section-io/tessera,jmptrader/tessera,filippog/tessera,aalpern/tessera,aalpern/tessera,Slach/tessera,Slach/tessera,urbanairship/tessera,urbanairship/tessera,Slach/tessera,jmptrader/te... | integration/main.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom decorator_plus import (\n require_form_methods, require_safe_methods)\nfrom django.shortcuts import (\n get_object_or_404, redirect, render)\n\nfrom .forms import ExampleForm\nfrom .models import ExampleModel\n\n\n@require_safe_m... | python | edit | 1 | 3 | bsd-2-clause | eb453010915f6700edd1baa0febcc634deec81dc | jambonrose/djangocon2015-views,jambonrose/djangocon2015-views | src/viewsapp/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom itertools import combinations\nfrom operator import itemgetter\n\nfrom distance import jaccard\nfrom networkx import Graph, pagerank\nfrom nltk import tokenize\n\nfrom... | python | edit | 1 | 7 | mit | cbddfe308f4e0da728974777f10b245a966520b6 | despawnerer/summarize | summarize/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n@pytest.mark.parametrize(\"name\", [\n (\"apt-file\"),\n (\"apt-transport-https\"),\n (\"atom\"),\n (\"blktrace\"),\n (\"ca-certificates\"),\n (\"chromium-browser\"),\n (\"cron\"),\n (\"curl\"),\n (\"diod\"),\n (\... | python | edit | 1 | 1 | mit | db935a152efc8ab730491fc860db6d4c9cf65c5f | wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build | test/test_packages.py | rejected_duplicate | Near-duplicate of sample 3637 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom celery import shared_task\nfrom django.conf import settings\n\nfrom waldur_keycloak.models import ProjectGroup\nfrom waldur_rancher.models import Cluster, ClusterRole\n\nlogger = logging.getLogger(__name__)\n\n\n@shar... | python | edit | 1 | 5 | mit | df325e7caee163f754c1b85cf71dab7810700933 | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | src/waldur_keycloak_rancher/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nPurpose: to recreate the univariate pdfs of Conlisk et al. (2007)\nin figure 2. This provides a test that the univariate pdfs are \nworking correctly\n\"\"\"\nimport numpy as np\nimport mete\nimport csv\n\nn0 = 617\nc = 256\n\nsing_... | python | edit | 1 | 0 | mit | ee2ed250fdf42d0e4616f0e783ff1ace0a201514 | weecology/mete-spatial,weecology/mete-spatial,weecology/mete-spatial,weecology/mete-spatial | scripts/spat_conlisk_univariate_fig2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\nimport configparser\nimport discord\nfrom discord.ext import commands\n\nclass Bot(commands.Bot):\n\tdef __init__(self, config_filepath, command_prefix):\n\t\tsuper().__init__(command_prefix)\n\t\tself._load_config_data(conf... | python | edit | 3 | 3 | mit | 7d621db3618db90679461550fb0c952417616402 | MagiChau/ZonBot | bot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport oauth.oauth as oauth\n\nfrom django.conf import settings\nfrom django.http import HttpResponse\n\nfrom stores import DataStore\n\nOAUTH_REALM_KEY_NAME = 'OAUTH_REALM_KEY_NAME'\n\ndef initialize_server_request(request):\n \"\"\"Sho... | python | edit | 1 | 4 | bsd-3-clause | 0a1358f27db3abb04032fac1b8a3da09d846d23e | e-loue/django-oauth-plus | oauth_provider/utils.py | rejected_duplicate | Near-duplicate of sample 2283 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport os\nfrom speech_recognition import WavFile\n\nfrom mycroft.client.speech.listener import RecognizerLoop\n\n__author__ = 'seanfitz'\n\nDATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), \"data\")\n\... | python | edit | 1 | 1 | apache-2.0 | 4790b1afa5d0125948bb8fdbed6f5838d470a570 | MycroftAI/mycroft-core,forslund/mycroft-core,aatchison/mycroft-core,Dark5ide/mycroft-core,linuxipho/mycroft-core,forslund/mycroft-core,linuxipho/mycroft-core,MycroftAI/mycroft-core,aatchison/mycroft-core,Dark5ide/mycroft-core | test/client/local_recognizer_test.py | rejected_duplicate | Near-duplicate of sample 8351 | true |
[
{
"role": "user",
"content": "Write python code for the following: Use common timezones and not all timezones pytz provides.\n\n\ngit-svn-id: 13ea2b4cf383b32e0a7498d153ee882d068671f7@13 86ebb30f-654e-0410-bc0d-7bf82786d749"
},
{
"role": "assistant",
"content": "\nimport pytz\n\nTIMEZONE_CHOICES ... | python | new_file | 1 | 0 | bsd-2-clause | 59c66d0e172b23ea7106a70866871d20bbcabe5b | mfogel/django-timezone-field,brosner/django-timezones | timezones/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom latex.build import LatexMkBuilder\n\n\ndef test_xelatex():\n min_latex = r\"\"\"\n\\documentclass{article}\n\\begin{document}\nHello, world!\n\\end{document}\n\"\"\"\n builder = LatexMkBuilder(variant='xelatex')\n pdf = builde... | python | edit | 1 | 1 | bsd-3-clause | eb06e85c7dcb93febe22d20cd7e3e694939449ba | mbr/latex | tests/test_xelatex.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase, RequestFactory\nfrom molo.core.tests.base import MoloTestCaseMixin\nfrom freebasics.views import HomeView\nfrom freebasics.templatetags import freebasics_tags\n\n\nclass EnvTestCase(TestCase, MoloTestCaseMi... | python | edit | 1 | 1 | bsd-2-clause | d95d71f996483bdde4f0b27d9d9c023aef706c65 | praekelt/molo-freebasics,praekelt/molo-freebasics,praekelt/molo-freebasics,praekelt/molo-freebasics | freebasics/tests/test_env_variables.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport pytest\nimport testinfra.utils.ansible_runner\n\ntestinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(\n os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')\n\n\ndef test_docker_service_enabled(host):\n ... | python | edit | 1 | 1 | mit | f7caec9d0c0058b5d760992172b434b461f70d90 | triplepoint/ansible-mosquitto | molecule/default/tests/test_default.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport brainfuck\n\ntest_cases = [(\"++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.\", \"Hello World!\\n\")]\n\nclass InterpreterTestCase(unittest.TestCase):\n ... | python | edit | 1 | 1 | bsd-3-clause | 775170d69862aaff63231b669639a872596ed2cd | handrake/brainfuck | test_interpreter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom aiohttp import BasicAuth\nfrom plumeria import config, scoped_config\nfrom plumeria.command import commands, CommandError\nfrom plumeria.config.common import nsfw\nfrom plumeria.message import Response\nfrom plumeria.util import http\n... | python | edit | 1 | 4 | mit | 131454ffaec010442c17f748365ab491668d947f | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | plumeria/plugins/bing_images.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom .scripts import SCRIPTS\n\n# This module is loaded as a \"plugin\" by pytest by a setting in conftest.py\n# Any fixtures defined here will be globally available in tests,\n# as if they were defined in conftest.py itself.... | python | edit | 1 | 1 | apache-2.0 | 8bd738972cebd27b068250bd52db8aacea6c7876 | htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor | src/condor_tests/ornithology/plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase\nfrom DjangoLibrary.middleware import FactoryBoyMiddleware\nfrom mock import Mock\n\nimport json\n\n\nclass TestFactoryBoyMiddleware(TestCase):\n\n def setUp(s... | python | edit | 1 | 1 | apache-2.0 | e6933a46086f83913de307fb8803ccbfd3c55114 | kitconcept/robotframework-djangolibrary | mysite/mysite/tests/test_middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nclass Strategy(object):\n TIMEFRAMES = [] # e.g. ['M30', 'H2']\n\n def __init__(self, instrument):\n self.instrument = instrument\n if not self.TIMEFRAMES:\n raise ValueError('Pleas... | python | edit | 1 | 3 | mit | e68c38428c055f7c001011c6cc325593d2a26a81 | jmelett/pyfx,jmelett/pyFxTrader,jmelett/pyfx | pyFxTrader/strategy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport sys\n\n\ndef load_config_file(out=sys.stdout):\n default_filepath = \"../resources/config/default-config.json\"\n user_filepath = \"../resources/config/user-config.json\"\n\n try:\n default_json = read_js... | python | edit | 1 | 4 | bsd-3-clause | 23a0db627060afc3e1563d298c733edd8bb106a1 | sky-uk/bslint | src/ConfigLoader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport redisdl\nimport unittest\nimport json\nimport os.path\n\nclass RedisdlTest(unittest.TestCase):\n def setUp(self):\n import redis\n self.r = redis.Redis()\n for key in self.r.keys('*'):\n self.r.dele... | python | edit | 1 | 2 | bsd-2-clause | 73d9049dea55ddfa32e4cb09f969b6ff083fee2c | p/redis-dump-load,p/redis-dump-load,hyunchel/redis-dump-load,hyunchel/redis-dump-load | tests/redisdl_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom urllib.parse import urljoin\n\nfrom oauthlib.oauth2 import LegacyApplicationClient\nfrom requests_oauthlib import OAuth2Session\nimport slumber\n\nfrom . import settings\n\nREQUEST_TOKEN_URL = urljoin(settings.API_URL, '/oauth2/token/'... | python | edit | 1 | 1 | mit | 3dc06581d07a204a3044e3a78deb84950a6ebf74 | ministryofjustice/money-to-prisoners-transaction-uploader | mtp_transaction_uploader/api_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mock\nimport pytest\n\nfrom flask.ext.wtf import Form\nfrom wtforms.fields.core import Field\nfrom wtforms.validators import StopValidation\n\nfrom app.main.forms import AdminEmailAddressValidator\n\n\n@mock.patch('app.main.forms.dat... | python | edit | 1 | 1 | mit | 47e5fdce2d248e6bf78addcb46e1a8f12fcc07d6 | alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend | tests/app/main/test_form_validators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport numpy\nimport six\n\nimport chainer\nfrom chainer import cuda\nfrom chainer import gradient_check\nfrom chainer.testing import attr\n\n\nif cuda.available:\n cuda.init()\n\n\nclass TestAccuracy(unittest.TestCase... | python | edit | 1 | 3 | mit | 4fb39abc5afef5b0ca87e5c3b40e3dc9c9c0b2ef | elviswf/chainer,1986ks/chainer,cupy/cupy,ktnyt/chainer,hvy/chainer,tigerneil/chainer,rezoo/chainer,sou81821/chainer,tereka114/chainer,hvy/chainer,wavelets/chainer,jfsantos/chainer,chainer/chainer,ikasumi/chainer,okuta/chainer,aonotas/chainer,ysekky/chainer,kashif/chainer,ktnyt/chainer,niboshi/chainer,pfnet/chainer,ytoy... | tests/functions_tests/test_accuracy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass defaultDict(dict):\n def __init__(self, default=None):\n dict.__init__(self)\n self.default = default\n\n def __getitem__(self, key):\n try:\n return dict.__getitem____(self, key)\n except ... | python | edit | 13 | 3 | mit | 830a767aa42cfafc22342ff71c23419c86845fe8 | williamHuang5468/ExpertPython | src/Classes/SubClass/SubClass.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Update to use new gate api"
},
{
"role": "assistant",
"content": "\"\"\"Constant variables for Spinnaker IAM Pipe.\"\"\"\nAPI_URL = 'http://gate-api.build.example.com:8084'\n"
}
] | python | new_file | 1 | 0 | apache-2.0 | b458e34c0e6466afd3125fff6b1f36278572857b | gogoair/foremast,gogoair/foremast | pipes/iam/consts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n###############################################################################\n# Copyright 2015 Kitware Inc.\n#\n# Licensed under the Apache License, Version 2.0 ( the \"License\" );\n# ... | python | edit | 1 | 1 | apache-2.0 | 664ad3a2848f7188cd1ea562ddbfd4dc6947915b | data-exp-lab/girder,Kitware/girder,sutartmelson/girder,sutartmelson/girder,kotfic/girder,RafaelPalomar/girder,Kitware/girder,data-exp-lab/girder,RafaelPalomar/girder,adsorensen/girder,jbeezley/girder,manthey/girder,kotfic/girder,Kitware/girder,RafaelPalomar/girder,adsorensen/girder,Xarthisius/girder,Xarthisius/girder,a... | tests/test_plugins/bad_server/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom django.core.management.base import BaseCommand\nfrom apps.processing.ala.util import util\nfrom dateutil.parser import parse\nfrom datetime import date, timedelta\n\nlogger = logging.getLogger(__name__)\n\n\nclass Comma... | python | edit | 1 | 4 | bsd-3-clause | 7d6e6325e0baf5f4994350a7dd52856db0cb6c8a | gis4dis/poster,gis4dis/poster,gis4dis/poster | src/apps/processing/ala/management/commands/ala_import.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# U... | python | edit | 1 | 2 | apache-2.0 | 2ef4362be90e2314b69a2ff17ccb5d25ef8905fd | rackerlabs/rackspace-sdk-plugin,briancurtin/rackspace-sdk-plugin | rackspace/database/database_service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under an MIT open source license - see LICENSE\n\nfrom astropy.io.fits import PrimaryHDU\nfrom spectral_cube import SpectralCube\nfrom spectral_cube.lower_dimensional_structures import LowerDimensionalObject\n\n\ndef input_data(d... | python | edit | 1 | 10 | mit | ad2b8bce02c7b7b7ab477fc7fccc1b38fb60e63a | Astroua/TurbuStat,e-koch/TurbuStat | turbustat/statistics/input_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Fibonacci series:\n\n0, 1, 1, 2, 3, 5, 8,... \n\n- Fib(0) = 0\n- Fib(1) = 1\n- Fib(n) = Fib(n - 1) + Fib(n - 2)\n\"\"\"\n\nfrom __future__ import print_function\nimport time\n\n\ndef fibonacci(n):\n \"\"\"Get nth number of Fibonacc... | python | edit | 3 | 4 | bsd-2-clause | 4a6f76857a626dd756675a4fe1dd3660cf63d8b7 | bowen0701/algorithms_data_structures | alg_fibonacci.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\n\nregister = template.Library()\n\n\nclass InContextNode(template.Node):\n def __init__(self, nodelist, subcontext_names):\n self.nodelist = nodelist\n self.subcontext_names = subcontext_names\n... | python | edit | 1 | 3 | cc0-1.0 | a307bddf490b6ad16739593d4ca51693b9a340fe | 18F/regulations-site,jeremiak/regulations-site,18F/regulations-site,18F/regulations-site,eregs/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site,jeremiak/regulations-site,jeremiak/regulation... | regulations/templatetags/in_context.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pupa.scrape import Jurisdiction\n\nfrom .people import PersonScraper\n\n\nclass Example(Jurisdiction):\n jurisdiction_id = 'ex'\n\n def get_metadata(self):\n return {\n 'name': 'Example',\n 'legislatu... | python | edit | 1 | 2 | bsd-3-clause | 05b2848849553172873600ffd6344fc2b1f12d8e | datamade/pupa,mileswwatkins/pupa,rshorey/pupa,opencivicdata/pupa,mileswwatkins/pupa,influence-usa/pupa,datamade/pupa,influence-usa/pupa,rshorey/pupa,opencivicdata/pupa | example/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport itertools\n\nPY3 = sys.version_info[:2] >= (3,0)\n\nif PY3:\n def dict_iteritems(d):\n return d.items().__iter__()\n xrange = range\n _inttypes = (int,)\n _strtypes = (str,)\n unicode = str\n imap... | python | edit | 4 | 1 | bsd-3-clause | ea5fd30a583016b4dc858848e28168ada74deca3 | scls19fr/blaze,markflorisson/blaze-core,ChinaQuants/blaze,jdmcbr/blaze,nkhuyu/blaze,cpcloud/blaze,LiaoPan/blaze,FrancescAlted/blaze,cowlicks/blaze,FrancescAlted/blaze,mwiebe/blaze,markflorisson/blaze-core,mwiebe/blaze,ContinuumIO/blaze,FrancescAlted/blaze,aterrel/blaze,AbhiAgarwal/blaze,jdmcbr/blaze,aterrel/blaze,China... | blaze/py3help.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Unittests for heapq.\"\"\"\n\nfrom test.test_support import verify, vereq, verbose, TestFailed\n\nfrom heapq import heappush, heappop\nimport random\n\ndef check_invariant(heap):\n # Check the heap invariant.\n for pos, item in ... | python | edit | 2 | 6 | mit | a25920e3549933e4c6c158cc9490f3eaa883ec66 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_heapq.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport datetime\nimport uuid\n\nfrom sentry.utils import json\n\nfrom sentry.testutils import TestCase\n\n\nclass JSONTest(TestCase):\n def test_uuid(self):\n re... | python | edit | 1 | 1 | bsd-3-clause | 202a9b2ad72ffe4ab5981f9a4a886e0a36808eb6 | mitsuhiko/sentry,ifduyue/sentry,looker/sentry,mvaled/sentry,gencer/sentry,mvaled/sentry,looker/sentry,zenefits/sentry,korealerts1/sentry,zenefits/sentry,Kryz/sentry,kevinlondon/sentry,alexm92/sentry,JamesMura/sentry,mvaled/sentry,kevinlondon/sentry,looker/sentry,beeftornado/sentry,BuildingLink/sentry,ifduyue/sentry,fel... | tests/sentry/utils/json/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport docker\nfrom djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase\n\n\nlog = logging.getLogger()\n\n\nclass DockerExecutor(DjangoCmdBase):\n\n def add_arguments(self, parser):\n # Positi... | python | edit | 1 | 1 | bsd-3-clause | d98e33d28105c8180b591e3097af83e42599bfc5 | weijia/django-local-apps,weijia/django-local-apps | django_local_apps/management/commands/docker_exec.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport threading\ntry:\n import prctl\n def set_thread_name(name): prctl.set_name(name)\n\n def _thread_name_hack(self):\n set_thread_name(self.name)\n threading.Thread.__bootstrap_original__(self)\n\n threading.Th... | python | edit | 1 | 1 | mit | de22e547c57be633cb32d51e93a6efe9c9e90293 | hb9kns/PyBitmessage,hb9kns/PyBitmessage,hb9kns/PyBitmessage,hb9kns/PyBitmessage | src/helper_threading.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright (C) 2011 Lukas Lalinsky\n# Distributed under the MIT license, see the LICENSE file for details.\n\nfrom acoustid.script import run_script\nimport subprocess\n\n\ndef main(script, opts, args):\n subpro... | python | edit | 1 | 1 | mit | 3298fff0ded49c21897a7387a7f3093c351ae04f | lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server | scripts/run_psql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\nfrom django.views.generic import TemplateView\n\nfrom core.views import flat_page\nfr... | python | edit | 1 | 0 | mit | 7cee7edabad08b01ceda0ed8f2798ebf47c87e95 | uranusjr/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,uranusjr/pycontw2016,pycontw/pycontw2016,uranusjr/pycontw2016,uranusjr/pycontw2016 | src/pycontw2016/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom geotrek.land.tests.test_filters import LandFiltersTest\n\nfrom geotrek.trekking.filters import TrekFilterSet\nfrom geotrek.trekking.factories import TrekFactory\n\n\nclass TrekFilterLandTest(LandFiltersTest):\n\n filterclass = TrekF... | python | edit | 1 | 1 | bsd-2-clause | e2cbd73218e6f5cf5b86718f6adebd92e9fee2a3 | GeotrekCE/Geotrek-admin,johan--/Geotrek,johan--/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,johan--/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,makinacorpus/... | geotrek/trekking/tests/test_filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom selenium import webdriver\n\nbrowser = webdriver.Firefox()\nbrowser.get('http://localhost:8000')\n\nassert 'Django' in browser.title\n\n```\n\nApply this change: Add FT specs and use unittest."
},
{
"role": "assistant",
"co... | python | edit | 1 | 1 | mit | b12b4f47d3cd701506380c914e45b9958490392c | ejpreciado/superlists,ejpreciado/superlists,ejpreciado/superlists | functional_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns\n\n\nurlpatterns = patterns(\n 'buysafe.views',\n (r'^entry/(?P<order_id>\\d+)/$', 'entry'),\n (r'^start/$', 'start'),\n (r'^success/(?P<payment_type>[01])/$', 'success'),\n (r'^fail/(?P<... | python | edit | 1 | 0 | bsd-3-clause | e10f2b85775412dd60f11deea6e7a7f8b84edfbe | uranusjr/django-buysafe | buysafe/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nPer kobotoolbox/kobo-docker#301, we have changed the uWSGI port to 8001. This\nprovides a helpful message to anyone still trying to use port 8000\n\"\"\"\n\nimport BaseHTTPServer\nimport sys\n\nclass Handler... | python | edit | 1 | 1 | bsd-2-clause | c1b0cfe9fdfbacf71ffbba45b4a8f7efe3fe36a7 | kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat | docker/dev_wrong_port_warning.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright 2011 Google 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#\n#... | python | edit | 1 | 5 | apache-2.0 | fee10efeae410a0bc51842877ef8ffb5fe8b97af | natduca/trace_event_viewer,natduca/trace_event_viewer,natduca/trace_event_viewer | src/file_dialogs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a version base on djangocms version from where the code was cloned"
},
{
"role": "assistant",
"content": "\"\"\"\n\"cms.plugins.snippet\" (from djangocms) clone to extend it with some facilities\n\"\"\"\n__version__ = '2.3.6.... | python | new_file | 1 | 0 | bsd-3-clause | 27fec389928c93ba0efe4ca1e4c5b34c3b73fa2c | emencia/emencia-cms-snippet,emencia/emencia-cms-snippet,emencia/emencia-cms-snippet | snippet/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\n\nfrom imap import EmailCheckError, EmailServer\nfrom postgresql import DatabaseServer\n\n\nCSV_FOLDER = os.getcwd()\n\nCSV_NAME_FORMAT = '{year}-{month}-{day}T{hour}{minute}.csv'\n\n# Restrict emails by sender.\nEMAIL... | python | edit | 3 | 1 | mit | 62a04170e41d599d653e94afe0844576e175c314 | AustralianAntarcticDataCentre/save_emails_to_files,AustralianAntarcticDataCentre/save_emails_to_files | settings_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ***** BEGIN LICENSE BLOCK *****\n#\n# For copyright and licensing please refer to COPYING.\n#\n# ***** END LICENSE BLOCK *****\n__version__ = '0.9.13p1'\n\nfrom pika.connection import ConnectionParameters\nfrom pika.connection import URLP... | python | edit | 10 | 0 | bsd-3-clause | d03b385b5d23c321ee1d4bd2020be1452e8c1cab | reddec/pika,skftn/pika,Tarsbot/pika,shinji-s/pika,jstnlef/pika,zixiliuyue/pika,fkarb/pika-python3,renshawbay/pika-python3,vrtsystems/pika,Zephor5/pika,pika/pika,vitaly-krugl/pika,knowsis/pika,hugoxia/pika,benjamin9999/pika | pika/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth import get_user_model\nfrom django.utils.translation import ugettext\nfrom social_auth.exceptions import AuthAlreadyAssociated\nfrom social_auth.backends.pipeline.associate import associate_by_email as super_associa... | python | edit | 1 | 5 | mit | ab6b61d8d0b91ebc2d0b1b8cbd526cfbb6a45a42 | chicagopython/chipy.org,tanyaschlusser/chipy.org,agfor/chipy.org,bharathelangovan/chipy.org,tanyaschlusser/chipy.org,chicagopython/chipy.org,brianray/chipy.org,chicagopython/chipy.org,tanyaschlusser/chipy.org,chicagopython/chipy.org,bharathelangovan/chipy.org,brianray/chipy.org,agfor/chipy.org,bharathelangovan/chipy.or... | chipy_org/libs/social_auth_pipelines.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n__version__ = \"0.19.0rc3\"\nversion = tuple(__version__.split('.'))\n\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\n\n```\n\nApply this change: Bump version 0.19.0rc3 --> 0.19.0rc4\n\nSigned-off-by: Jack... | python | edit | 1 | 0 | mit | 0cf45657c01349b6304470e0ee7349e9f62874f5 | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | rejected_duplicate | Near-duplicate of sample 4121 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom chainer.serializers import npz\nfrom chainer.trainer import extension\n\n\ndef snapshot(savefun=npz.save_npz,\n filename='snapshot_iter_{.updater.iteration}'):\n \"\"\"Return a trainer extension to take snapshots of the ... | python | edit | 5 | 2 | mit | 6104b111b4ceaec894018b77cbea4a0de31400d4 | hvy/chainer,jnishi/chainer,ktnyt/chainer,chainer/chainer,cupy/cupy,hvy/chainer,ktnyt/chainer,cupy/cupy,wkentaro/chainer,ysekky/chainer,kikusu/chainer,pfnet/chainer,jnishi/chainer,okuta/chainer,keisuke-umezawa/chainer,ktnyt/chainer,okuta/chainer,niboshi/chainer,niboshi/chainer,cupy/cupy,rezoo/chainer,chainer/chainer,hvy... | chainer/trainer/extensions/_snapshot.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask_testing import LiveServerTestCase\nfrom myflaskapp.app import create_app\nfrom myflaskapp.settings import DevConfig, ProdConfig\nimport requests\n\n\nclass MyTest(LiveServerTestCase):\n\n def create_ap... | python | edit | 12 | 1 | mit | d6c5b9a19921ce2c1e3f2e30d6ce0468a5305e80 | terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python | myflaskapp/tests/test_flask_testing.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'shawnmehan'\n\nimport csv, os, re\n\n\n# # first lets open the file, which is tab delimited because of , in description field and others\nwith open('./data/AppDataRequest2010-2015.tsv', 'rb') as csvfile:\n testfile = open(\... | python | edit | 2 | 0 | apache-2.0 | 1382fd8afecdeca9bb1b6961a636b6502c16ad6e | smehan/App-data-reqs,smehan/App-data-reqs | log-preprocessor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport botconfig\nfrom settings import wolfgame as var\n\n# Todo: Allow game modes to be set via config\n\n# Carry over settings from botconfig into settings/wolfgame.py\n\nfor setting, value in botconfig.__dict__.items():\... | python | edit | 1 | 0 | bsd-2-clause | 11b35c79ff8d2108d572929334e4e3f30c70eea5 | Agent-Isai/lykos,billion57/lykos,Diitto/lykos,Cr0wb4r/lykos | modules/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nTests for the standard library PEP 543 shim.\n\"\"\"\nimport pep543.stdlib\n\nfrom .backend_tests import SimpleNegotiation\n\n\nclass TestSimpleNegotiationStdlib(SimpleNegotiation):\n BACKEND = pep543.std... | python | edit | 1 | 2 | mit | 8fe8717b4e2afe6329d2dd25210371df3eab2b4f | python-hyper/pep543 | test/test_stdlib.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add author and lincense variables"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\n\n__author__ = 'Sebastian Vetter'\n__version__ = VERSION = '0.0.0'\n__license__ = 'MIT'\n"
}
] | python | new_file | 1 | 0 | mit | 2fdf35f8a9bf7a6249bc92236952655314a47080 | elbaschid/swapify | swapify/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .utils import to_bytes\n\n\nclass Message:\n \"\"\"A message recieved from the IRC network.\"\"\"\n\n def __init__(self, raw_message):\n self.raw = raw_message\n self.prefix, self.command, self.params, self.suffix =... | python | edit | 1 | 5 | bsd-2-clause | 04608636f6e4fc004458560499338af4b871cddb | meshy/framewirc | asyncio_irc/message.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport sys\n\nsys.path.append('..')\nfrom skytap.Labels import Labels # noqa\n\nlabels = Labels()\n\n\ndef test_labels():\n \"\"\"Peform tests relating to labels.\"\"\"\n sys.exit()\n\n #labels.create(\"barf\", True)\... | python | edit | 2 | 2 | mit | 09bdc51dacfe72597105c468baf356f0b1e81012 | FulcrumIT/skytap,mapledyne/skytap | tests/testLabels.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding:utf-8 -*-\n\nimport os\n\nfrom sigal.image import generate_image, generate_thumbnail\n\nCURRENT_DIR = os.path.dirname(__file__)\nTEST_IMAGE = 'exo20101028-b-full.jpg'\n\n\ndef test_image(tmpdir):\n \"Test the Image class.\"\... | python | edit | 3 | 1 | mit | 42c667ab7e1ed9cdfc711a4d5eb815492d8b1e05 | franek/sigal,jdn06/sigal,cbosdo/sigal,jasuarez/sigal,muggenhor/sigal,jdn06/sigal,kontza/sigal,franek/sigal,t-animal/sigal,t-animal/sigal,kontza/sigal,kontza/sigal,muggenhor/sigal,elaOnMars/sigal,cbosdo/sigal,jasuarez/sigal,jdn06/sigal,Ferada/sigal,saimn/sigal,saimn/sigal,cbosdo/sigal,saimn/sigal,xouillet/sigal,elaOnMar... | tests/test_image.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 3.0.5 on 2020-04-23 12:37\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('product', '0116_auto_20200225_0237'),\n ]\n\n operations = [\n ... | python | edit | 1 | 0 | bsd-3-clause | 0f6128c3694b08899220a3e2b8d73c27cda7eeee | mociepka/saleor,mociepka/saleor,mociepka/saleor | saleor/product/migrations/0117_auto_20200423_0737.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nFind all company names in a piece of text\n\nextractor = EntityExtractor()\nentities = extractor.entities_from_text(text)\n> ['acme incorporated', 'fubar limited', ...]\n\nTODO:\n - work out a standard form to normalize company name... | python | edit | 1 | 2 | mit | ccfe12391050d598ec32861ed146b66f4e907943 | uf6/noodles,uf6/noodles | noodles/entities.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pylint: disable = C0103, C0111\n\n# Standard Library\nimport json\nimport mimetypes\nfrom os import makedirs\nfrom subprocess import check_output\n\n# Third Party\nimport requests\n\ndef list_emojis(domain, token):\n script = ['bin/lis... | python | edit | 4 | 5 | mit | 729a5c2e1276f9789733fc46fb7f48d0ac7e3178 | le1ia/slackmoji | src/slackmoji.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom creditor.models import RecurringTransaction\nfrom django.core.management.base import BaseCommand, CommandError\n\n\nclass Command(BaseCommand):\n help = 'Gets all RecurringTransactions and runs conditional_a... | python | edit | 5 | 8 | mit | 48b7880fec255c7a021361211e56980be2bd4c6b | HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum | project/creditor/management/commands/addrecurring.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass BlinkyPattern(object):\n def __init__(self, blinkytape):\n self._blinkytape = blinkytape\n self._animated = False\n self._timebase_sec = 0.05\n\n @property\n def animated(self):\n return self._anim... | python | edit | 1 | 1 | mit | 4008824b7b7bf8338b057bc0b594774cb055c794 | jonspeicher/blinkyfun | blinkylib/patterns/blinkypattern.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Remove trailing whitespace from files in current path and sub directories.\"\"\"\n\nimport os, glob\n\ndef scanpath(path):\n for filepath in glob.glob(os.path.join(path, '*')):\n if os.path.isdir(filepath):\n scanpath(filepat... | python | edit | 1 | 4 | apache-2.0 | 3640a5b1976ea6c5b21617cda11324d73071fb9f | GoogleCloudPlatform/datastore-ndb-python,GoogleCloudPlatform/datastore-ndb-python | trimwhitespace.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWidget functions to generate widgets faster.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nfrom .animation_widget import animation_widget\nfrom .category_widget import category_widget\nfrom .default_widget import default_widg... | python | edit | 1 | 1 | bsd-3-clause | 38845ecae177635b98a2e074355227f0c9f9834d | CartoDB/cartoframes,CartoDB/cartoframes | cartoframes/viz/widgets/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cloudly.pubsub import Pusher\nfrom cloudly.tweets import Tweets\nfrom cloudly.twitterstream import Streamer\n\nfrom webapp import config\n\n\nclass Publisher(Pusher):\n def publish(self, tweets, event):\n \"\"\"Keep only rele... | python | edit | 1 | 1 | mit | d31d2a73127a79566651e644d105cbe2063a6e2a | hdemers/webapp-template,hdemers/webapp-template,hdemers/webapp-template | webapp/publish.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import IntegrityError\n\nfrom rest_framework.permissions import IsAuthenticated\nfrom rest_framework.views import APIView\nfrom rest_framework.response import Response\nfrom rest_framework import status\n\nfrom .serializers i... | python | edit | 1 | 3 | bsd-3-clause | 4a7b548511fa0651aa0bc526302d13947941dacc | willandskill/django-parse-push | parse_push/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glob, os.path, sys\n\n# Add path to hiredis.so load path\npath = glob.glob(\"build/lib*/hiredis/*.so\")[0]\nsys.path.insert(0, os.path.dirname(path))\n\nfrom unittest import *\nfrom . import reader\n\ndef tests():\n suite = TestSuit... | python | edit | 4 | 1 | bsd-3-clause | c1f5b9e3bfa96762fdbe9f4ca54b3851b38294da | badboy/hiredis-py-win,charsyam/hiredis-py,badboy/hiredis-py-win,redis/hiredis-py,charsyam/hiredis-py,badboy/hiredis-py-win,redis/hiredis-py | test/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import # Python 2 only\n\nfrom django.contrib.staticfiles.storage import staticfiles_storage\nfrom django.core.urlresolvers import reverse\nfrom django.template.defaultfilters import slugify\nfrom wagtail.wa... | python | edit | 1 | 1 | cc0-1.0 | 3e30737c98a4a9e890d362ba4cbbb2315163bc29 | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh | cfgov/v1/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom openerp import fields, models\n\nclass Session(models.Model):\n _name = 'openacademy.session'\n\n name = fields.Char(required=True)\n start_date = fields.Date()\n duration = fields.Float(digits=(6, ... | python | edit | 1 | 0 | apache-2.0 | f20c0b650da2354f3008c7a0933eb32a1409fbf0 | KarenKawaii/openacademy-project | openacademy/model/openacademy_session.py | rejected_duplicate | Near-duplicate of sample 5562 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''parse cards according to deck issue mode'''\n\nfrom .pautils import exponent_to_amount\n\n\ndef none_parser(cards):\n '''parser for NONE [0] issue mode'''\n\n return None\n\n\ndef custom_parser(cards, parser=None):\n '''parser f... | python | edit | 1 | 4 | bsd-3-clause | 410207e4c0a091e7b4eca9cedd08f381095f50a9 | PeerAssets/pypeerassets | pypeerassets/card_parsers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport json\n\nimport raco.fakedb\nfrom raco import RACompiler\nfrom raco.language import MyriaAlgebra\nfrom myrialang import compile_to_json\n\n\nclass DatalogTestCase(unittest.TestCase):\n\n def setUp(self):\n s... | python | edit | 1 | 1 | bsd-3-clause | 8ca30840b5477239625c93f4799f266f0a971e3d | uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco | raco/datalog/datalog_test.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.