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 .parser import Udger\n\n__version__ = '4.0.1'\n\n__all__ = ['Udger']\n\n```\n\nApply this change: Allow MutableMapping for python >= 3.10"
},
{
"role": "assistant",
"content": "from .parser import Udger\n\n__version__ = '4.... | python | edit | 1 | 0 | mit | 8922e6ff0570fc3b073746b01e6ee1d963315448 | udger/udger-python | udger/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\n\nfrom api import PubMed\nfrom sysrev.models import Review\n\n\nclass PubmedQueryTestCase(TestCase):\n def test_query(self):\n result = PubMed.query(\"smoking\")\n self.assertGreater(result... | python | edit | 2 | 1 | mit | c33e9cbf0f08c4ec93c9aeea899d93ac257b9bea | iliawnek/SystematicReview,iliawnek/SystematicReview,iliawnek/SystematicReview,iliawnek/SystematicReview | sysrev/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.\n#\nfrom setuptools import setup\n\nsetup(\n name='vnc_cfg_api_server',\n version='0.1dev',\n packages=[\n 'vnc_cfg_api_server',\n 'vnc_cfg_api_serve... | python | edit | 1 | 0 | apache-2.0 | 6c93bfc862ceb598747531dc5aef4f9445162e68 | reiaaoyama/contrail-controller,nischalsheth/contrail-controller,rombie/contrail-controller,cloudwatt/contrail-controller,sajuptpm/contrail-controller,tcpcloud/contrail-controller,cloudwatt/contrail-controller,Juniper/contrail-dev-controller,DreamLab/contrail-controller,DreamLab/contrail-controller,srajag/contrail-contr... | src/config/api-server/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom llvm import *\nfrom llvm.core import *\nfrom llvm.ee import *\n\nimport logging\n\ntp_int = Type.int()\ntp_float = Type.float()\ndef py_type_to_llvm(tp):\n if tp == int:\n return tp_int\n elif tp == float:\n return ... | python | edit | 10 | 3 | apache-2.0 | de4df4feb7f38577bb3db8852610398ecc238870 | squisher/stella,squisher/stella,squisher/stella,squisher/stella | stella/llvm.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport socket\n\nimport pytest\n\nimport portend\n\n\ndef socket_infos():\n\t\"\"\"\n\tGenerate addr infos for connections to localhost\n\t\"\"\"\n\thost = None\n\tport = portend.find_available_local_port()\n\tfamily = socket.AF_UNSPEC\n\ts... | python | edit | 1 | 2 | mit | 56e3225329d2f7fae37139ec1d6727784718d339 | jaraco/portend | test_portend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app.dataformats import peptable as peptabledata\nfrom app.dataformats import mzidtsv as psmtsvdata\n\n\ndef add_peptide(allpeps, psm, scorecol=False, fncol=None, new=False,\n track_psms=True):\n peptide = {'score': ps... | python | edit | 1 | 6 | mit | 46ea832db6db8a98c5b9f5a58a37bfed16a27a10 | glormph/msstitch | app/actions/peptable/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\nimport tempfile\n\n\ndef store(data, directory=\"/var/www/luke/wikipedia/graphs/\"):\n try:\n json.loads(data)\n except ValueError:\n return \"not-json\"\n\n tf = tempfile.mkstemp(prefix=\"\", ... | python | edit | 1 | 2 | mit | 07999d1f24acbbfde50fe94897054e7c8df7fea1 | controversial/wikipedia-map,controversial/wikipedia-map,controversial/wikipedia-map | api/jsonstore.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom evelink import api\nfrom evelink import constants\n\ndef parse_assets(api_result):\n def handle_rowset(rowset, parent_location):\n results = []\n for row in rowset.findall('row'):\n item = {'id': int(row.att... | python | edit | 4 | 3 | mit | c52a39b8a89e1fc8bfe607d2bfa92970d7ae17ad | zigdon/evelink,FashtimeDotCom/evelink,Morloth1274/EVE-Online-POCO-manager,ayust/evelink,bastianh/evelink | evelink/parsing/assets.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\n\nfrom django.conf.urls import patterns, url\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views.decorators.cache import cache_page\n\nfrom .views import OrganisationSearchView, Organisat... | python | edit | 1 | 2 | mit | 02f7edc042b46f091663fc12451aa043106f4f38 | correctiv/correctiv-justizgelder,correctiv/correctiv-justizgelder | correctiv_justizgelder/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom tests.util.pipe import Pipe\nfrom threading import Thread\n\nfrom pycell.repl import repl\n\nfrom tests.util.system_test import system_test\nfrom tests.util.all_examples import all_sessions\n\ndef _validate_session(f):\n strin = P... | python | edit | 1 | 4 | mit | 77caf4f14363c6f53631050d008bc852df465f5e | andybalaam/cell | tests/repl_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nimport urllib2\nimport traceback\n\ntry:\n import simplejson as json\nexcept ImportError:\n import json\n\nclass Twitter(object):\n \"\"\"Checks incoming messages for Twitter urls and calls the Twitter API to\n retrie... | python | edit | 3 | 2 | mit | f64582d7b254e5b4861a0d06ea40f9e608e3cc30 | billyvg/piebot | modules/urlparser/twitter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers as ser\nfrom api.base.serializers import JSONAPISerializer, LinksField\nfrom api.base.utils import absolute_reverse\n\nclass NodeAddonFolderSerializer(JSONAPISerializer):\n \"\"\"\n Overrides Add... | python | edit | 1 | 1 | apache-2.0 | db9703ef5cb277e4556d94503c581cbdf46a8419 | chennan47/osf.io,CenterForOpenScience/osf.io,pattisdr/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,alexschiller/osf.io,saradbowman/osf.io,chrisseto/osf.io,cwisecarver/osf.io,acshi/osf.io,monikagrabowska/osf.io,Johnetordoff/osf.io,Nesiehr/osf.io,mluo613/osf.io,adlius/osf.io,sloria/osf.io,icereval/osf.io,adlius/osf.i... | api/addons/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport binascii\nimport base64\nimport os.path\n\ndef __content(f):\n return open(os.path.join(os.path.dirname(__file__), f)).read()\n\ncrypto_js = __content('crypto.js')\nhotp_js = __content('hotp.js')\nmyotp_js = __content('my-otp.js')... | python | edit | 2 | 1 | mit | 93a4191b9cb79ee4ddb2efbb4962bef99bc2ec28 | bdauvergne/totp-js,bdauvergne/totp-js | totp_bookmarklet.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom django.views.generic import RedirectView\n\nurlpatterns = patterns(\n 'wafer.pages.views',\n url('^index(?:\\.html)?$', RedirectView.as_view(url='/')),\n url(r'^(.*)$', 'slug', name=... | python | edit | 1 | 0 | isc | 5d8453f18689a67185472b20e7daf287ebbdb3ac | CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer | wafer/pages/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division\nimport numpy as np\nfrom congestion_approx import CongestionApprox\n\n\nclass ConductanceCongestionApprox(CongestionApprox):\n def __init__(s, g):\n s.vertex_degrees_inv = [\n 1.0 / g.degree(v) if... | python | edit | 1 | 3 | mit | 534e7bf630670a5aa42ba4787e66f0b02fb55a7d | weinstein/FastMaxFlow | conductance_congestion_approx.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\nfrom django.conf import settings\nfrom django.core.urlresolvers import reverse\n\nregister = template.Library()\n\n\n@register.simple_tag(takes_context=True)\ndef active_link(context, viewname, css_class=None, s... | python | edit | 1 | 6 | bsd-3-clause | 9f0c73eab846d9b2b35c3223fca2014c338e0617 | valerymelou/django-active-link | active_link/templatetags/active_link_tags.py | rejected_duplicate | Near-duplicate of sample 12003 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\ndef handle_cd_command(arg):\n \"\"\"Handles a `cd` shell command by calling python's os.chdir.\"\"\"\n CD_CMD = 'cd'\n command = arg.strip()\n directory = ''\n error = False\n\n tokens = arg... | python | edit | 1 | 3 | bsd-3-clause | 4ab53bc73406396206ead375dd7b5e656fdc41b7 | mdsrosa/mycli,mdsrosa/mycli | mycli/packages/special/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# muddersOnRails()\n# Sara McAllister November 17, 2017\n# Last updated: 11-17-2017\n\n# delete all data from database (this is super sketch)\nimport dbCalls\n\ndef main():\n print('Deleting everything from students, styles, and answers.... | python | edit | 1 | 2 | mit | 6f09f32684571306b15175e23ee1672fa74ae9a6 | nathanljustin/teamwork-analysis,nathanljustin/teamwork-analysis,nathanljustin/teamwork-analysis,nathanljustin/teamwork-analysis | teamworkApp/lib/delete_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http.response import HttpResponse\n\n\ndef homepage(request):\n return HttpResponse('Hello (again) World!')\n\n```\n\nApply this change: Ch04: Modify homepage view to list Tags."
},
{
"role": "assistant",
"content... | python | edit | 1 | 2 | bsd-2-clause | c4a0b6a5b40f7ed964ef43533c4a761124b2ea06 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\n# This script has to generate the sqlite database\n#\n# Requirements (import from):\n# - sqlite3\n#\n# Syntax:\n# ./generate_db.py\n\nimport sqlite3\nDEFAULT_DB = \"run-tracking.db\"\n\ndef generate_tables(filename... | python | edit | 1 | 1 | mit | 5062700980fe432653a11173ab3c3835caf206c9 | dubzzz/py-run-tracking,dubzzz/py-run-tracking,dubzzz/py-run-tracking | scripts/generate_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nClient for Yandex.Disk.\n\"\"\"\n__version__ = '0.3.2'\n\nfrom .YaDiskClient import YaDiskException, YaDisk\n\n```\n\nApply this change: Change version, upload to pypi."
},
{
"role": "assistant",
"content": "\"\"\"\nClie... | python | edit | 4 | 0 | mit | da6f3cd94e60e4792926bd9f924714bb8a7c1903 | TyVik/YaDiskClient | YaDiskClient/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-*- coding: utf-8 -*-\n\nfrom src.shell.parser.i_log_parser import ILogParser\n\nclass TypeLogParser(ILogParser):\n \"\"\"\n Parser for type log file\n\n \"\"\"\n\n def __init__(self, *args, **kwargs):\n self.__fn = ... | python | edit | 2 | 6 | mit | 27591f150761eb78ba57b9a0ad027307122ac60c | Frky/scat,Frky/scat,Frky/scat,Frky/scat,Frky/scat | src/shell/parser/type.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport graphene\n\nfrom falmer.schema.schema import DjangoConnectionField\nfrom . import types\nfrom . import models\n\nclass Query(graphene.ObjectType):\n all_images = DjangoConnectionField(types.Image)\n image = graphene.Field(types... | python | edit | 1 | 2 | mit | e26b3ed4c96d0912f543d079f1ef016974483be5 | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | falmer/matte/queries.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom addons.base.serializer import CitationsAddonSerializer\n\nclass ZoteroSerializer(CitationsAddonSerializer):\n addon_short_name = 'zotero'\n\n @property\n def serialized_node_settings(self):\n result = super(ZoteroSerial... | python | edit | 1 | 1 | apache-2.0 | 03b2e8397414c761b5df7d123056e89b49312353 | HalcyonChimera/osf.io,aaxelb/osf.io,caseyrollins/osf.io,aaxelb/osf.io,erinspace/osf.io,Johnetordoff/osf.io,binoculars/osf.io,felliott/osf.io,HalcyonChimera/osf.io,icereval/osf.io,erinspace/osf.io,Johnetordoff/osf.io,adlius/osf.io,sloria/osf.io,icereval/osf.io,baylee-d/osf.io,mattclark/osf.io,pattisdr/osf.io,cslzchen/os... | addons/zotero/serializer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"YARN monitoring built-in UI.\"\"\"\n\nfrom flask import Blueprint, render_template\n\nui_bp = Blueprint('ui', __name__, static_folder='static')\n\n\n@ui_bp.route('/')\ndef index():\n return render_template('index.html')\n\n```\n\nA... | python | edit | 1 | 1 | bsd-3-clause | 5e4843b99f043bc5ad1ba9842e4bee452a5681e8 | maxpoint/yarnitor,maxpoint/yarnitor,maxpoint/yarnitor | yarnitor/ui.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDerive a list of impossible differentials.\n\"\"\"\n\nfrom ast import literal_eval\nimport sys\n\ndef parse(line):\n return literal_eval(line)\n\ndef in_set(s, xs):\n return any(i in s for i in xs)\n\ndef main():\n if len(s... | python | edit | 3 | 5 | mit | 854bb642dd6a4800f57555187b9dfb1a27a7801c | wei2912/aes-idc,wei2912/idc,wei2912/idc,wei2912/idc,wei2912/aes-idc,wei2912/idc | nibble_aes/find_dist/find_ids.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport foauth.providers\n\n\nclass Flickr(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'http://www.flickr.com/'\n docs_url = 'http://www.flickr.com/services/api/'\n category = 'Pictures'\n\n ... | python | edit | 1 | 2 | bsd-3-clause | baf82d48125d51ae5f5f37cf761ade574a2f8fc1 | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | services/flickr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nif __name__ == \"__main__\":\n __version__ = \"0.3\"\nelse:\n from animatedsprite import AnimatedSprite\n from tilemap import TileMap, Tilesheet, tmx_file_to_tilemaps\n from layers import SurfaceLayers\n\n```\n\nApply this chang... | python | edit | 7 | 0 | mit | 86f33f301cc6a7215b4e0da21ac5fbcdc67cedcf | lillian-lemmer/sappho,lillian-gardenia-seabreeze/sappho,lily-seabreeze/sappho,lillian-gardenia-seabreeze/sappho,lillian-lemmer/sappho,lily-seabreeze/sappho | sappho/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014-2015 Canonical Limited.\n#\n# This file is part of jujubigdata.\n#\n# jujubigdata is free software: you can redistribute it and/or modify\n# it under the terms of the Apache License version 2.0.\n#\n# jujubigdata is distrib... | python | edit | 1 | 0 | apache-2.0 | 2a41cae0e1992b23647ebdc7d49c435e4a187cf2 | tsakas/jujubigdata,johnsca/jujubigdata,ktsakalozos/jujubigdata-dev,juju-solutions/jujubigdata,juju-solutions/jujubigdata,ktsakalozos/jujubigdata-dev,andrewdmcleod/jujubigdata,andrewdmcleod/jujubigdata,johnsca/jujubigdata,ktsakalozos/jujubigdata,ktsakalozos/jujubigdata,tsakas/jujubigdata | jujubigdata/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ----- Info ------------------------------------------------------------------\n\n__author__ = 'Michael Montero <<EMAIL>>'\n\n# ----- Imports ---------------------------------------------------------------\n\nfrom tinyAPI.base.data_store.p... | python | edit | 1 | 2 | mit | 7c1dd8a6a547cb6183f66d73b27868a75451eb54 | mcmontero/tinyAPI,mcmontero/tinyAPI | dsh.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nVery partial backport of the `http.HTTPStatus` enum from Python 3.5\n\nThis implements just enough of the interface for our purposes, it does not\nattempt to be a full implementation.\n\"\"\"\n\nclass HTTPStatus(int):\n\n phrase ... | python | edit | 1 | 1 | mit | aa73c66b4069b63fa42ee91093e9967573cdf820 | evansd/whitenoise,evansd/whitenoise,evansd/whitenoise | whitenoise/httpstatus_backport.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom django.core.management import BaseCommand\nfrom django.conf import settings\n\n\ndef dump_attrs(obj_instance):\n for attr in dir(obj_instance):\n if attr != attr.upper():\n continue\n yield attr... | python | edit | 4 | 6 | bsd-3-clause | 860c19f236cf1d064376c045c889fc2ba6a4b928 | weijia/djangoautoconf,weijia/djangoautoconf | djangoautoconf/management/commands/dump_settings.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\n\nfrom os import urandom\nfrom base64 import b64encode, b64decode\nfrom itertools import izip\nfrom lampost.util.pdkdf2 import pbkdf2_bin\n\nSALT_LENGTH = 8\nKEY_LENGTH = 20\nCOST_FACTOR = 800\n\n\ndef make_hash(password):\n... | python | edit | 5 | 3 | mit | a9581a26704f663f5d496ad07c4a6f4fd0ee641f | genzgd/Lampost-Mud,genzgd/Lampost-Mud,genzgd/Lampost-Mud | lampost/util/encrypt.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 gRPC authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apach... | python | edit | 1 | 3 | apache-2.0 | 1e62124cfb3b3c30cc10a9f8fb1ff25ee2e4aa56 | muxi/grpc,ctiller/grpc,firebase/grpc,firebase/grpc,pszemus/grpc,grpc/grpc,donnadionne/grpc,ctiller/grpc,grpc/grpc,pszemus/grpc,pszemus/grpc,vjpai/grpc,grpc/grpc,stanley-cheung/grpc,pszemus/grpc,pszemus/grpc,muxi/grpc,muxi/grpc,ctiller/grpc,ejona86/grpc,ctiller/grpc,grpc/grpc,stanley-cheung/grpc,ejona86/grpc,jboeuf/grpc... | examples/python/helloworld/greeter_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division\n\nimport gzip\n\ntry:\n from BytesIO import BytesIO\nexcept ImportError:\n from io import BytesIO\n\ntry:\n from urlparse import urlparse\nexcept ImportError:\n from urllib.parse import urlparse\... | python | edit | 2 | 3 | mit | dfcac48b5bbbf68a82089a3a500457a0c5e6e65e | danjamker/DiffusionSimulation | CascadeCount.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom bioc import BioCReader\nfrom bioc import BioCWriter\n\ntest_file = '../test_input/PMID-8557975-simplified-sentences.xml'\ndtd_file = '../test_input/BioC.dtd'\n\ndef main():\n bioc_reader = BioCReader(test_fi... | python | edit | 1 | 1 | bsd-2-clause | ab627a078eee3000806bfd0abcd01dc89e85d93c | SuLab/PyBioC | src/test_read+write.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\nfrom numba.ctypes_support import *\nimport numpy\nimport numba.unittest_support as unittest\nfrom numba._numpyadapt import get_ndarray_adaptor\n\n\nclass ArrayStruct3D(Structure):\n _fields_ = [\n ... | python | edit | 12 | 2 | bsd-2-clause | b4e06f4e35355ed7502359d2ecffbee00d615f36 | seibert/numba,GaZ3ll3/numba,pombredanne/numba,sklam/numba,stonebig/numba,gmarkall/numba,sklam/numba,seibert/numba,numba/numba,stuartarchibald/numba,sklam/numba,stonebig/numba,pombredanne/numba,IntelLabs/numba,ssarangi/numba,stuartarchibald/numba,cpcloud/numba,stefanseefeld/numba,gdementen/numba,ssarangi/numba,pitrou/nu... | numba/tests/test_numpyadapt.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for the isort import placement module\"\"\"\nfrom functools import partial\n\nfrom isort import place, sections\nfrom isort.settings import Config\n\n\ndef test_module(src_path):\n place_tester = partial(place.module, config=... | python | edit | 1 | 1 | mit | 58cc02faf08ec499f0d9239959b6d50a1b2b90ad | PyCQA/isort,PyCQA/isort | tests/unit/test_place.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014-present PlatformIO <<EMAIL>>\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# ht... | python | edit | 1 | 3 | apache-2.0 | fa11217da72fc403b94e9574f4f4e6ec506e5353 | platformio/platformio,platformio/platformio-core,platformio/platformio-core | tests/commands/test_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models.expressions import Star\nfrom django.db.models.sql.datastructures import EmptyResultSet\n\nfrom .version_19 import Parser as BaseParser\n\n\nclass Parser(BaseParser):\n def _prepare_for_transformation(self):\n ... | python | edit | 1 | 5 | bsd-3-clause | 8521d53b20e8f4874a82188b792dd1d4d0ecf419 | grzes/djangae,grzes/djangae,potatolondon/djangae,grzes/djangae,potatolondon/djangae | djangae/db/backends/appengine/parsers/version_18.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nA simple standalone target for the prolog interpreter.\n\"\"\"\n\nimport sys\nfrom prolog.interpreter.translatedmain import repl, execute\n\n# __________ Entry point __________\n\nfrom prolog.interpreter.continuation import Engine... | python | edit | 4 | 3 | mit | eb60d0d226f08b90e2835aac0440560f392257f4 | cosmoharrigan/pyrolog | prolog/targetprologstandalone.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport cvmfs_geo\n\nnegative_expire_secs = 60*5; # 5 minutes\n\ndef bad_request(start_response, reason):\n response_body = 'Bad Request: ' + reason + \"\\n\"\n start_response('400 Bad Request',\n [('... | python | edit | 3 | 2 | bsd-3-clause | 0106108b2bb4f9ad5eaa4e02981293d5f5613aaf | reneme/cvmfs,cvmfs/cvmfs,djw8605/cvmfs,djw8605/cvmfs,alhowaidi/cvmfsNDN,cvmfs/cvmfs,djw8605/cvmfs,Gangbiao/cvmfs,trshaffer/cvmfs,cvmfs/cvmfs,reneme/cvmfs,reneme/cvmfs,cvmfs-testing/cvmfs,Moliholy/cvmfs,Gangbiao/cvmfs,reneme/cvmfs,MicBrain/cvmfs,DrDaveD/cvmfs,Moliholy/cvmfs,trshaffer/cvmfs,DrDaveD/cvmfs,MicBrain/cvmfs,G... | cvmfs/webapi/cvmfs_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport turtle\n\ndef draw_initials():\n #Set up screen, etc.\n window = turtle.Screen()\n window.bgcolor('gray')\n\n ###THE LETTER B###\n letter = turtle.Turtle()\n letter.shape('turtle')\n letter.color('white', 'gray')... | python | edit | 1 | 1 | mit | 5488e6361359eb299e47814fd83e8e09187f45fd | bencam/turtle | draw_initials.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# coding: utf8\n\n# TODO: Move imports to specific modules that need them\n\n# CORE\nfrom .api import get, yahoo, bing, geonames, google, mapquest # noqa\nfrom .api import nokia, osm, tomtom, geolytica, arcgis, opencage ... | python | edit | 1 | 0 | mit | ee2a6bb99d2a8fadecddd58366c20202c863c97c | epyatopal/geocoder-1,akittas/geocoder,minimedj/geocoder,DenisCarriere/geocoder,ahlusar1989/geocoder,miraculixx/geocoder | geocoder/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright 2014 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 t... | python | edit | 1 | 0 | apache-2.0 | dd6090464fa3eb1f95f6fd5efd7591b1c06c0ce6 | nebril/fuel-plugins,stackforge/fuel-plugins,stackforge/fuel-plugins,nebril/fuel-plugins | fuel_plugin_builder/fuel_plugin_builder/messages.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport nose\nimport angr\nimport subprocess\n\nimport logging\nl = logging.getLogger('angr.tests.test_signed_div')\n\nimport os\ntest_location = str(os.path.dirname(os.path.realpath(__file__)))\n\n\ndef run_strtol(threads):\n test_bin = ... | python | edit | 1 | 1 | bsd-2-clause | ac900d1a42e5379e192b57cef67845db202e82c3 | tyb0807/angr,angr/angr,tyb0807/angr,chubbymaggie/angr,schieb/angr,f-prettyland/angr,f-prettyland/angr,iamahuman/angr,f-prettyland/angr,axt/angr,chubbymaggie/angr,schieb/angr,angr/angr,schieb/angr,tyb0807/angr,chubbymaggie/angr,iamahuman/angr,iamahuman/angr,angr/angr,axt/angr,axt/angr | tests/test_signed_div.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncore,time,signal,sys\nfrom secure_smtpd import SMTPServer, FakeCredentialValidator\n\nclass SecureSMTPServer(SMTPServer):\n \n def __init__(self):\n pass\n \n def process_message(self, peer, mailfrom, rcptt... | python | edit | 1 | 1 | isc | 21e5ee2ad250c313ea0eb2c67c3d3cc32661d24d | bcoe/secure-smtpd | examples/benchmarking/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = '1.0.0.dev6'\n__author__ = 'D-Wave Systems Inc.'\n__authoremail__ = '<EMAIL>'\n__description__ = 'A shared API for binary quadratic model samplers.'\n\n```\n\nApply this change: Update version 1.0.0.dev6 -> 1.0.0.dev7"
},
... | python | edit | 1 | 0 | apache-2.0 | 64441102017e966895b8b082c40932148509f60d | oneklc/dimod,oneklc/dimod | dimod/package_info.py | rejected_duplicate | Near-duplicate of sample 3698 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A pytest plugin for using pyfakefs as a fixture\n\nWhen pyfakefs is installed, the \"fs\" fixture becomes available.\n\n:Usage:\n\ndef my_fakefs_test(fs):\n fs.create_file('/var/data/xx1.txt')\n assert os.path.exists('/var/data/... | python | edit | 1 | 1 | apache-2.0 | 51781b95b629a31107d16a52b0ea184306fe6163 | mrbean-bremen/pyfakefs,mrbean-bremen/pyfakefs,pytest-dev/pyfakefs,jmcgeheeiv/pyfakefs | pyfakefs/pytest_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mangopaysdk.types.payinpaymentdetails import PayInPaymentDetails\n\n\nclass PayInPaymentDetailsCard(PayInPaymentDetails):\n \"\"\"Class represents Card type for mean of payment in PayIn entity.\"\"\"\n\n def __init__(self):\n ... | python | edit | 1 | 1 | mit | 4b7e20c5640242a6e06392aaf9cbfe8e4ee8a498 | chocopoche/mangopay2-python-sdk,Mangopay/mangopay2-python-sdk | mangopaysdk/types/payinpaymentdetailscard.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_sqlalchemy import SQLAlchemy\nimport connexion\n\nfrom config import config\n\ndb = SQLAlchemy()\n\n\ndef create_app(config_name):\n app = connexion.FlaskApp(__name__, specification_dir='swagger/')\n app.add_api('swagger.ya... | python | edit | 4 | 1 | mit | ff61fb41273b8bf94bd0c64ddb1a4c1e1c91bb5f | EdwinKato/bucket-list,EdwinKato/bucket-list,EdwinKato/bucket-list,EdwinKato/bucket-list,EdwinKato/bucket-list | api/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport numpy\nfrom galpy.orbit import Orbit\nfrom galpy.potential import MiyamotoNagaiPotential\n\nif __name__ == '__main__':\n # python orbitint4sigint.py symplec4_c full\n mp= MiyamotoNagaiPotential(normalize=1.,a=0.5,b... | python | edit | 1 | 0 | bsd-3-clause | 3aa248a9ee40afb2c8c7725ae832c0d25ec92c9b | jobovy/galpy,jobovy/galpy,jobovy/galpy,jobovy/galpy | nose/orbitint4sigint.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Django haystack `SearchIndex` module.\"\"\"\nfrom pages.models import Page\n\nfrom haystack.indexes import SearchIndex, CharField, DateTimeField\nfrom haystack import site\n\n\nclass PageIndex(SearchIndex):\n \"\"\"Search index for... | python | edit | 1 | 1 | bsd-3-clause | 7bd82f6feb1a34dd7b855cfe2f421232229e19db | remik/django-page-cms,pombredanne/django-page-cms-1,oliciv/django-page-cms,remik/django-page-cms,remik/django-page-cms,batiste/django-page-cms,oliciv/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,remik/django-page-cms,akaihola/django-page-cms,pombredanne/django-page-cms-1,oliciv/django-page-cms,batis... | pages/search_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nNormalization class for Matplotlib that can be used to produce colorbars.\n\"\"\"\n\nimport numpy as np\nfrom numpy import ma\n\nfrom matplotlib.colors import Normalize\n\n\n__all__ = ['ImageNormalize']\n\n\nclass ImageNormalize(Nor... | python | edit | 1 | 4 | bsd-3-clause | 9ce1f694a7581333d000a6a7b77e8d846bb4b507 | dhomeier/astropy,bsipocz/astropy,MSeifert04/astropy,mhvk/astropy,MSeifert04/astropy,mhvk/astropy,joergdietrich/astropy,stargaser/astropy,StuartLittlefair/astropy,lpsinger/astropy,AustereCuriosity/astropy,AustereCuriosity/astropy,astropy/astropy,lpsinger/astropy,joergdietrich/astropy,lpsinger/astropy,AustereCuriosity/as... | imageutils/scaling/normalize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\n\nclass MutableTree:\n\n def __init__ (self):\n s... | python | edit | 1 | 2 | bsd-3-clause | aaaaad77054658ad6c5d63a84bffe8d43b4e3180 | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | falcom/tree/mutable_tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for pyswarm.\"\"\"\nfrom unittest import TestCase\nfrom grortir.externals.pyswarm.pso import pso\n\n\nclass TestPso(TestCase):\n \"\"\"Class for tests PSO.\"\"\"\n\n def test_run_simple_pso(self):\n \"\"\"Test runni... | python | edit | 1 | 1 | mit | a33f288bb2937bbf750b9d195861e311f293d94b | qbahn/grortir | grortir/test/externals/pyswarm/test_pyswarm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glob\nimport itertools as it\nimport os\n\nimport parmed as pmd\nfrom pkg_resources import resource_filename\nimport pytest\n\nfrom foyer import Forcefield\nfrom foyer.tests.utils import atomtype\nfrom foyer.xml_writer import write_f... | python | edit | 5 | 1 | mit | 1e5ec4a2923757ca79c8a55b056fd13872cac963 | iModels/foyer,mosdef-hub/foyer,mosdef-hub/foyer,iModels/foyer | foyer/tests/test_xml_writer.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Rename the generated kv file to be compatible with the original kivy kv file\ndetection of `App.load_kv`.\n\"\"\"\n\nimport os\n\n\npackage_dir = '{{cookiecutter.repo_name}}'\nold_kv_f... | python | edit | 1 | 2 | mit | 7ddb1b3d0139ef8b6a7badcb2c6bef6a0e35e88a | hackebrot/cookiedozer,hackebrot/cookiedozer | hooks/post_gen_project.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom leap import is_leap_year\n\n\n# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0\n\nclass YearTest(unittest.TestCase):\n def test_year_not_divisible_by_4(self):\n self.assertIs(is_l... | python | edit | 1 | 1 | mit | fb26a66ab179fe375f50933c2be3f2e5da2f68a3 | exercism/python,exercism/xpython,exercism/xpython,N-Parsons/exercism-python,pheanex/xpython,smalley/python,N-Parsons/exercism-python,jmluy/xpython,pheanex/xpython,exercism/python,behrtam/xpython,jmluy/xpython,behrtam/xpython,smalley/python | exercises/leap/leap_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ansiblelint import AnsibleLintRule\n\n\nformat = \"{}\"\n\nclass RoleRelativePath(AnsibleLintRule):\n id = 'E201'\n shortdesc = \"Doesn't need a relative path in role\"\n description = ''\n tags = ['role']\n\n def matchp... | python | edit | 1 | 15 | mit | f19b66d42f67a6a45bec6fdaffe6c73366788b48 | tsukinowasha/ansible-lint-rules | rules/RoleRelativePath.py | rejected_complexity | Cyclomatic complexity too high: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom suds.client import Client\n\ndef crab_factory(**kwargs):\n if 'wsdl' in kwargs:\n wsdl = kwargs['wsdl']\n del kwargs['wsdl']\n else:\n wsdl = \"http://crab.agiv.be/wscrab/wscrab.svc?wsdl\"\n if 'proxy' in ... | python | edit | 4 | 5 | mit | bc32d6456dc2c2b6cef5d2d7b1ccf602b43b1e69 | kmillet/crabpytest,OnroerendErfgoed/crabpy,kmillet/crabpytest | crabpy/client.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass LaboratoryException(Exception):\n pass\n\n\nclass MismatchException(LaboratoryException):\n pass\n\n```\n\nApply this change: Add message attr to LaboratoryException"
},
{
"role": "assistant",
"content": "class Labor... | python | edit | 1 | 1 | mit | 142b9fa072e5958273e67ff38f8c7c7f6ea51373 | joealcorn/laboratory | laboratory/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport inspect\nimport os.path\n\ndef pytest_namespace():\n def assume(expr, msg=''):\n if not expr:\n # get filename, line, and context\n (filename, line, funcname, contextlist) = inspect.stac... | python | edit | 1 | 4 | mit | e6c3b8960213fecdd6392457124bf20b66a164ff | astraw38/pytest-assume | pytest_assume/plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport os\nfrom django.conf import settings\n\nVERSION = (1, 2, 9)\n\n\ndef get_version():\n return '%s.%s.%s' % VERSION\n\ntry:\n LOGFILE = os.path.join(settings.DIRNAME, 'axes.log')\nexcept (ImportError, AttributeErr... | python | edit | 1 | 1 | mit | b3892da60507855aea56c5f0023187a196f87aff | SteveByerly/django-axes,grue/django-axes,nidhi-delhivery/django-axes,jazzband/django-axes,SteveByerly/django-axes,django-pci/django-axes,svenhertle/django-axes,zoten/django-axes | axes/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright 2012 Cisco Systems, Inc.\n#\n# Author: Soren Hansen <<EMAIL>>\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 ob... | python | edit | 1 | 1 | apache-2.0 | a000706bba6cdd02da4fff4ca16063d43ed8fe85 | sorenh/python-django-greenfan,sorenh/python-django-greenfan | greenfan/management/commands/create-job-from-testspec.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport virtool.app\nimport virtool.updates\nfrom virtool.handlers.utils import json_response\n\n\nasync def get(req):\n # db = req.app[\"db\"]\n settings = req.app[\"settings\"]\n\n repo = settings.get(\"software_repo\")\n serve... | python | edit | 1 | 1 | mit | caf8c08511042db195b359ed7fffac6d567f1e18 | igboyes/virtool,igboyes/virtool,virtool/virtool,virtool/virtool | virtool/handlers/updates.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer\nfrom jinja2 import Environment, FileSystemLoader\n\nfrom jinger.config import get_config\n\n\nenv = None\n\n\nclass Http404(Exception):\n pass\n\n\nclass JingerHTT... | python | edit | 3 | 4 | mit | fe6a1134a26f72833bcdfe16766fa0376396df4e | naiquevin/jinger,naiquevin/jinger | jinger/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport traceback\n\nfrom db.common import session_scope\nfrom db.team import Team\nfrom db.division import Division\n\n\ndef create_divisions(div_src_file=None):\n\n if not div... | python | edit | 3 | 8 | mit | d9349d617a504381d65f412930126de8e7548300 | leaffan/pynhldb | setup/create_divisions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django_mailer import constants\n\n\nclass QueueManager(models.Manager):\n use_for_related_fields = True\n\n def high_priority(self):\n \"\"\"\n Return a QuerySet of high priority queued... | python | edit | 1 | 2 | mit | 8b5bab10bf49f35c0c0e9147e7bcbffb88f8b536 | APSL/django-mailer-2,pegler/django-mailer-2,tclancy/django-mailer-2,davidmarble/django-mailer-2,maykinmedia/django-mailer-2,Giftovus/django-mailer-2,torchbox/django-mailer-2,APSL/django-mailer-2,SmileyChris/django-mailer-2,victorfontes/django-mailer-2,mfwarren/django-mailer-2,morenopc/django-mailer-2,k1000/django-maile... | django_mailer/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom random import shuffle\nimport pytest\n\nfrom quick_sort import quick_srt\n\n\ndef test_quick_srt():\n expected = range(20)\n actual = expected[:]\n shuffle(actual)\n quick_srt(actual)\n assert expected == actual\n\n\ndef... | python | edit | 1 | 1 | mit | af9c686750d55ff786807f9175faadb8bb9087e7 | jonathanstallings/data-structures | test_quick_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nExtension that omits the creation of file `skeleton.py`\n\"\"\"\n\nfrom ..api import Extension, helpers\n\n\nclass NoSkeleton(Extension):\n \"\"\"Omit creation of skeleton.py and test_skeleton.py\"\"\"\n ... | python | edit | 1 | 1 | mit | 09668c1818ef028e10669b9652e2f0ae255cc47e | blue-yonder/pyscaffold,blue-yonder/pyscaffold | src/pyscaffold/extensions/no_skeleton.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport time\nfrom functools import wraps\n\nfrom . import compat\n\ncompat.patch() # monkey-patch time.perf_counter\n\nlog = logging.getLogger('amqpy')\n\n\ndef synchronized(lock_name):\n \"\"\"Decorator for automaticall... | python | edit | 1 | 4 | mit | 27d34d851bcdf80559aff5f5d8cf83122da1953a | gst/amqpy,veegee/amqpy | amqpy/concurrency.py | rejected_duplicate | Near-duplicate of sample 4638 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.db import models\n\n# Create your models here.\n\n```\n\nApply this change: Change to model from class on 10/10/2016"
},
{
"role": "assistant",
"content": "from __future__ i... | python | edit | 1 | 0 | mit | 221caf718c5aa53c2ef5b9b05c72764ae65eac44 | UniversityOfDubuque/CIS405_DjangoProject,UniversityOfDubuque/CIS405_DjangoProject | SaudiStudentOrganization/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSource : https://oj.leetcode.com/problems/excel-sheet-column-number/\nAuthor : Changxi Wu\nDate : 2015-01-21\n\nGiven a column title as appear in an Excel sheet, return its corresponding column number.\n\nFor example:\n 1 -> A\... | python | edit | 4 | 4 | mit | c85fbf33d22a9775f9d22b863027eb50b41923c2 | chancyWu/leetcode | src/excel_sheet_column_title.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_login import LoginManager\nfrom flask_oauthlib.client import OAuth\n\nfrom config import config\n\ndb = SQLAlchemy()\noa = OAuth()\nlm = LoginManager()\nlm.login_v... | python | edit | 1 | 1 | mit | bc485e3deb47897fb5d87c80c299f2da240419db | Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary | app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Optional\nfrom thinc.api import Model\n\nfrom .tokenizer_exceptions import TOKENIZER_EXCEPTIONS\nfrom .stop_words import STOP_WORDS\nfrom .lex_attrs import LEX_ATTRS\nfrom .syntax_iterators import SYNTAX_ITERATORS\nfrom .... | python | edit | 1 | 1 | mit | 4b6afd36114fbe1871f17998f9e3f4ec0e116f0f | spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy | spacy/lang/en/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding:utf-8 -*-\n\nfrom subprocess import check_call\n\nfrom pytest import raises\n\nfrom csft import __main__ as main\n\n\ndef test_call():\n check_call(['python', '-m', 'csft', '.'])\n\n\ndef test_main():\n main.main(argv=['.... | python | edit | 1 | 1 | mit | fffe7392cb486f7218fc8afd2d42769660a1f558 | yanqd0/csft | tests/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# usage: python one_time_eval.py as8sqdtc\n\nfrom deuces.deuces import Card\nfrom convenience import find_pcts, pr, str2cards\nimport sys\n\ncards_str = sys.argv[1]\nboard_str = ''\nif len(sys.argv) > 2:\n board_str = sys.argv[2]\n\ncard... | python | edit | 3 | 0 | mit | dd3b135ab5e229c5f717fc4d296389e187a49f9a | zimolzak/poker-experiments,zimolzak/poker-experiments,zimolzak/poker-experiments | one_time_eval.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyak\nimport time\n\nclass YikBot(Yakker):\n def boot(self):\n while True:\n print \"DEBUG: Scanning feed\"\n yaks = yikBot.get_yaks()\n for yak in yaks:\n if yak.message.star... | python | edit | 10 | 5 | mit | 6c122daaf50bba2c7c28b67e40b3ca6eb30f99ee | congrieb/yikBot | yikbot.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Remove Element https://oj.leetcode.com/problems/remove-element/\n# Given an array and a value, remove all instances of that value in place and return the new length.\n# The order of elements can be changed. It doesn't matter what you leav... | python | edit | 1 | 5 | mit | 0baf08c61348f4fa6a657e1c0e2ff9bdf65eaa15 | aenon/OnlineJudge,aenon/OnlineJudge | leetcode/RemoveElement.py | rejected_duplicate | Near-duplicate of sample 8387 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools.dist import Distribution\nfrom setuptools.command.build import build\n\n\ndef test_distribution_gives_setuptools_build_obj(tmpdir_cwd):\n \"\"\"\n Check that the setuptools Distribution uses the\n setuptools specifi... | python | edit | 1 | 2 | mit | 7a68599ca8794d1d1b7d358e6f79791547f7740f | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/tests/test_build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom os.path import abspath, dirname, join\nfrom gendo import Gendo\n\nHERE = dirname(abspath(__file__))\nconfig_path = join(HERE, 'config.yaml')\nbot = Gendo.config_from_yaml(config_path)\n\n\n@bot.listen_for('morn... | python | edit | 1 | 2 | bsd-3-clause | b9156a522410bf39de8653bce22bb2cb56e435a0 | punchagan/parktain,punchagan/parktain,punchagan/parktain | parktain/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"forms for accounts app\n\n\"\"\"\nfrom django import forms\nfrom django.contrib.auth import get_user_model\nfrom django.core.mail import EmailMultiAlternatives\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.... | python | edit | 1 | 2 | mit | 5d2a4ac0e48d404a16b81d2f290be5ec13bdf8f1 | randomic/aniauth-tdd,randomic/aniauth-tdd | logintokens/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n__author__ = \"Stavros Korokithakis\"\n__email__ = \"<EMAIL>\"\n__version__ = \"0.9.3\"\n\n```\n\nApply this change: fix: Make catt refuse to install under 2 more"
},
{
"role": "assistant",
"content": ... | python | edit | 1 | 0 | bsd-2-clause | 98335de4b87638eff9613279bdd106651d4aefe1 | skorokithakis/catt,skorokithakis/catt | catt/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .simple_broker import _DataBrokerClass, EventQueue, Header\nfrom .handler_registration import register_builtin_handlers\n\nDataBroker = _DataBrokerClass() # singleton\nregister_builtin_handlers()\n\n```\n\nApply this change: DOC: Add ... | python | edit | 6 | 0 | bsd-3-clause | 7b72dbb331c120eb5657ce9a81e725c550779485 | danielballan/dataportal,ericdill/datamuxer,tacaswell/dataportal,ericdill/datamuxer,tacaswell/dataportal,NSLS-II/dataportal,danielballan/datamuxer,danielballan/datamuxer,ericdill/databroker,NSLS-II/datamuxer,danielballan/dataportal,NSLS-II/dataportal,ericdill/databroker | dataportal/broker/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport argparse\nimport inspect\nimport subprocess\nimport sys\n\nclass PyFrcProfiler:\n \"\"\"\n Wraps other commands by running them via the built in cProfile module.\n Use this to profile your program and figure out wh... | python | edit | 2 | 4 | mit | 0b7a1904ef5511916fc4978c325862241a46aef3 | robotpy/pyfrc | lib/pyfrc/mains/cli_profiler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import MutableMapping\n\n\nclass BetterOrderedDict(MutableMapping):\n def __init__(self, **kwargs):\n self._d = dict()\n self._keys = []\n\n def __len__(self):\n return len(self._d)\n\n def __i... | python | edit | 1 | 2 | mit | 8f0b72dcad39fbd6072185bf2244eb75f0f45a96 | JustusW/BetterOrderedDict,therealfakemoot/collections2 | better_od/core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.forms import AuthenticationForm\nfrom django import forms\nfrom .models import PoolingUser\n\n\nclass LoginForm(AuthenticationForm):\n username = forms.CharField(widget=forms.EmailInput(attrs={'placeholder': 'Ema... | python | edit | 1 | 0 | mit | 3786ebdf37820bc7b59342302c5858d7805a323c | livingsilver94/getaride,livingsilver94/getaride,livingsilver94/getaride | planner/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import date\nfrom datetime import timedelta\n\nfrom django.utils import timezone\n\nfrom books.models import Transaction\n\n\ndef get_months_transactions():\n today = timezone.now()\n first_day_of_a_month = date(today.ye... | python | edit | 1 | 1 | mit | 7ad0aa082114811a1638916060c6b18f93d09824 | trimailov/finance,trimailov/finance,trimailov/finance | books/services.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright © 2009 Ben Finney <<EMAIL>>\n# Copyright © 2006 Robert Niederreiter\n#\n# This is free software: you may copy, modify, and/or distribute this work\n# under the terms of the Python Software Foundation L... | python | edit | 3 | 0 | apache-2.0 | aa14a6036d262fab1d213d021640204419d3c9e1 | wting/python-daemon,eaufavor/python-daemon | daemon/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom random import randint\nimport sys\n\ndef count(arr):\n\tn = len(arr)\n\n\tif n == 1:\n\t\treturn 0\n\n\telse:\n\t\tfirst_half = count(arr[:n/2])\n\t\tsecond_half = count(arr[n/2:])\n\t\tsplit = count_split(arr)\n\t\treturn first_half +... | python | edit | 3 | 2 | mit | b40cb43eb2a3afcc08a207b66e1dededd1ff1eaa | timpel/stanford-algs,timpel/stanford-algs | count-inversions/count_inversions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom subprocess import Popen, PIPE\nfrom IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC\n\n\nclass ZMQInteractiveShell(InteractiveShell):\n \"\"\"A subclass of InteractiveShell for ZMQ.\"\"\"\n\n ... | python | edit | 3 | 5 | bsd-3-clause | 08ea2c257780f23cec5dfb923e80966fdf9c5ac8 | ipython/ipython,ipython/ipython | IPython/zmq/zmqshell.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, flash, redirect, render_template, request, session, abort\nfrom flask_sqlalchemy import SQLAlchemy\n\nimport os\n\napplication = Flask(__name__)\napplication.secret_key = '123456789'\napplication.config['PROPAGATE_E... | python | edit | 3 | 0 | apache-2.0 | 6d15281487dd7769fa60585e7c6497c3993e0e94 | jonvestal/open-kilda,nikitamarchenko/open-kilda,telstra/open-kilda,carmine/open-kilda,jonvestal/open-kilda,nikitamarchenko/open-kilda,telstra/open-kilda,telstra/open-kilda,jonvestal/open-kilda,telstra/open-kilda,nikitamarchenko/open-kilda,jonvestal/open-kilda,carmine/open-kilda,nikitamarchenko/open-kilda,jonvestal/open... | services/topology-engine/app/app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.forms import UserCreationForm\nfrom django.core.validators import RegexValidator\n\nalphanumericu = RegexValidator(\n regex=r'^[0-9a-zA-Z_]*$... | python | edit | 1 | 3 | mit | 3b6ddce7c0db0f0b1fbd9febd9bf68ceeda51f44 | avinassh/della,avinassh/della,avinassh/della | della/user_manager/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\"\"\"Test script for the binhex C module\n\n Uses the mechanism of the python binhex module\n Roger E. Masse\n\"\"\"\nimport binhex\nimport tempfile\nfrom test_support import verbose, TestSkipped\n\ndef test():\... | python | edit | 6 | 7 | mit | 5a9bf08b78176097d918d0ec7174e68094ee63a2 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_binhex.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import reverse\nfrom django.test import Client, TestCase\n\nfrom users.models import User\n\n\nclass UserRedirectViewTestCase(TestCase):\n\n def setUp(self):\n self.client = Client()\n User.obj... | python | edit | 1 | 1 | bsd-3-clause | 6f24dc967a082251d0bc62ab66c9263235174f9f | wldcordeiro/cookiecutter-django-essentials,wldcordeiro/cookiecutter-django-essentials,wldcordeiro/cookiecutter-django-essentials | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Convert browser bookmark export (NETSCAPE-Bookmark-file-1 format) to json\n#\nfrom argparse import ArgumentParser\nfrom bs4 import BeautifulSoup\nfrom datetime import datetime, timezone\nfrom bson import json_uti... | python | edit | 1 | 0 | mit | 345056a7a6a801013cdc340f0f9cd8b4f5d48173 | jhh/netscape-bookmark-converter | convert-bookmarks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2019 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 | 2 | apache-2.0 | 855ed8bcef8fc17655ccc28f70ce34a6b3b58d65 | tombstone/models,alexgorban/models,alexgorban/models,alexgorban/models,tombstone/models,tombstone/models,tombstone/models,tombstone/models,alexgorban/models,alexgorban/models,tombstone/models | official/utils/misc/tpu_lib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom settings import *\nINSTALLED_APPS.append('complex')\nINSTALLED_APPS.append('django.contrib.comments')\n\nROOT_URLCONF = 'complex.urls'\n\n```\n\nApply this change: Add sites app, change how installed_apps are edited."
},
{
"rol... | python | edit | 3 | 0 | bsd-3-clause | fb665cf8d6c0eb6c794a41eaf312c35473d1bdf0 | esatterwhite/django-tastypie,beni55/django-tastypie,Eksmo/django-tastypie,SeanHayes/django-tastypie,cbxcube/bezrealitky.py,ywarezk/nerdeez-tastypie,mohabusama/django-tastypie,ocadotechnology/django-tastypie,ocadotechnology/django-tastypie,waveaccounting/django-tastypie,SeanHayes/django-tastypie,Eksmo/django-tastypie,be... | tests/settings_complex.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys, time\nimport socket\n\n\ndef make_new_connection(name, host, port):\n sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n sockobj.connect((host, port))\n\n sockobj.send(b'foo^1234$jo')\n sockobj.send(b'sdfs... | python | edit | 1 | 3 | unlicense | f1e50c1caeeec5b8e443f634534bfed46f26dbdf | eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog | 2017/async-socket-server/simple-client.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.