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\nimport tracker\n\nfrom auditor.manager import default_manager\nfrom event_manager.event_service import EventService\n\n\nclass AuditorService(EventService):\n \"\"\"An service that just passes the event to author services.\"\"\"\n\n e... | python | edit | 1 | 1 | apache-2.0 | c16e2fed1b64c2d875c99940912e2aa3e5d6c33f | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/auditor/service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\n\nfrom localflavor.us.models import USStateField\n\nfrom django.contrib.gis.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\n... | python | edit | 1 | 1 | mit | 8562a58501aaa3f53a6aef5a0c1fab60aafb7c61 | texastribune/scuole,texastribune/scuole,texastribune/scuole,texastribune/scuole | scuole/states/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom builtins import super\n\nfrom django import forms\nfrom django.templatetags.static import static\n\n\nclass JSONEditorWidget(forms.Widget):\n class Media:\n css = {'all': (static('dist/jsoneditor.min.css'), )}\n ... | python | edit | 1 | 2 | mit | 61394aec9d2193a978a0754bb43f70d1f66262d4 | jmrivas86/django-json-widget,jmrivas86/django-json-widget | django_json_widget/widgets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#apt-get install python-pip\n#pip install netifaces\nimport netifaces\n\ndef select_iface(iface):\n try:\n iface = int(iface)\n if(iface < 0):\n raise IndexError\n return netifaces.interfaces()[iface]\n ... | python | edit | 6 | 4 | mit | 2c83c171a8594f708e3a12c0435c7d0aa20d68ad | andrewmichaelsmith/manuka,g1eagle/E-Pot | scripts/iface-choice.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2014 Universidad Politecnica de Madrid\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 | 0 | apache-2.0 | f5baf5aab4570f54e686ecf6c69f5100bf077d8b | ging/horizon,ging/horizon,ging/horizon,ging/horizon | openstack_dashboard/fiware_oauth2/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport json\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom unidecode import unidecode\nfrom .items import Subject\nfrom .spiders.cagr import SEMESTER\n\n\n# Define your item pipelines he... | python | edit | 1 | 2 | mit | 570a4911f0babf884fa57b4509957bd94fc790ed | ranisalt/moita-ufsc-crawler | moita/pipelines.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import Base\n\n\nclass List(Base):\n current = None\n\n def __init__(self, result, object_type):\n Base.__init__(self, result)\n self.object_type = object_type\n\n def get_object_name(self):\n return... | python | edit | 1 | 3 | bsd-2-clause | 85be415a27d23951f5ee943710ea3d22571aa697 | mollie/mollie-api-python | mollie/api/objects/list.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nModule that holds classes that represent an agent's perception handler.\n\"\"\"\n\nimport abc\nimport world\nimport structure\n\nclass PerceptionHandler(object):\n \"\"\"\n Abstract perception handler class.\n \"\"\"\n\n ... | python | edit | 1 | 8 | mit | ccb9e3d0fca96b853cabe0c9569dda1414409618 | Beskhue/enactive-agents,Beskhue/enactive-agents,Beskhue/enactive-agents | enactiveagents/model/perceptionhandler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom vcf import Reader\nimport gzip\n\nvcf = Reader(open(sys.argv[1], 'r'))\nn = 0\n\nfor v in vcf:\n if len(v.ALT) > 1: continue\n if v.QUAL < 20: continue\n if v.aaf[0] > 0.05: continue\n n += 1\nprint(n)\n\n```\n\... | python | edit | 3 | 0 | mit | 061872f2a89656250a1de32338663ebd6900b602 | brentp/cyvcf2,brentp/cyvcf2,brentp/cyvcf2 | scripts/filter-pyvcf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom django.db import IntegrityError\n\nfrom utils.create_random_data import create_items, create_users, create_orders\n\nfrom saleor.userprofile.models import User\n\n\nclass Command(Bas... | python | edit | 1 | 6 | bsd-3-clause | 02a95bafbcf739cef6306cdd0d785743f2dd7370 | HyperManTT/ECommerceSaleor,car3oon/saleor,car3oon/saleor,laosunhust/saleor,spartonia/saleor,UITools/saleor,KenMutemi/saleor,tfroehlich82/saleor,tfroehlich82/saleor,car3oon/saleor,HyperManTT/ECommerceSaleor,tfroehlich82/saleor,itbabu/saleor,maferelo/saleor,laosunhust/saleor,laosunhust/saleor,laosunhust/saleor,maferelo/s... | saleor/product/management/commands/populatedb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.comments.forms import CommentForm\nfrom recaptcha_comments.fields import RecaptchaField\n\nclass RecaptchaCommentForm(CommentForm):\n captcha = RecaptchaField()\n\n def clean_captcha(self):\n if not 'preview... | python | edit | 1 | 2 | mit | 67ea74ac57712ba963530845b566c62d7c5307dc | theju/django-comments-apps | recaptcha_comments/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom order import Order\nfrom orderbook import OrderBook\nfrom client import FinanceClient\nfrom ordermanager import OrderManager\nfrom strategy import Vanilla, Strawberry\nimport sys\n\n# local server for finance data\nhost_ip, server_port... | python | edit | 1 | 8 | mit | 1994a59d3ae9d3f24445f11f3bc0dd3089042bc4 | albhu/finance | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom netmiko.cisco_base_connection import CiscoSSHConnection\nfrom netmiko.cisco_base_connection import CiscoTelnetConnection\n\n\nclass CiscoIosSSH(CiscoSSHConnection):\n \"\"\"Cisco IOS SSH dr... | python | edit | 1 | 4 | mit | 01a012bf37c438c845e4962ffa6f1c0e1e2723f4 | fooelisa/netmiko,ktbyers/netmiko,ktbyers/netmiko,isidroamv/netmiko,isidroamv/netmiko,fooelisa/netmiko | netmiko/cisco/cisco_ios.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom openerp import models, fields\n\n'''\nThis module create module of Courso\n'''\n\n\nclass Course(models.Model):\n '''\n This class create module of Course\n '''\n\n _name = 'openacademy.course' # Model odoo name\n\n na... | python | edit | 1 | 3 | apache-2.0 | dcf0ee630a20b413d2212c3d3ae19ce4008a33fe | Hiregui92/openacademy-project | openacademy/model/openacademy_course.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2016 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n\"\"\"A module with Comment object creation hooks\"\"\"\n\nfrom ggrc import db\nfrom ggrc.login import get_current_user_id\n... | python | edit | 1 | 2 | apache-2.0 | d27ded9fb8c833b2f21fedade5cbef9ab831453e | josthkko/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,j0... | src/ggrc/models/hooks/comment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom .models import NewsletterSubscription\n\n\nclass SubscribtionForm(forms.ModelForm):\n class Meta:\n model = NewsletterSubscription\n ... | python | edit | 1 | 3 | bsd-3-clause | c20482f8c9c20b4d934e16a583697e2f8f520553 | guetux/django-yesimeanit | yesimeanit/showoff/newsletter_subscriptions/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport sys\nfrom os import path\n\n\ndef parse_arguments():\n parser = argparse.ArgumentParser(description='A modular and extensible visual novel engine.', prog='rave')\n parser.add_argument('-b', '--bootstrapper', he... | python | edit | 4 | 2 | bsd-2-clause | fc1cb951991cc9b4b0cdb9d533127d26eb21ea57 | rave-engine/rave | rave/__main__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import NewType\nfrom datetime import datetime, time, timezone, date\n\n\nTimeTz = NewType('TimeTz', time)\nDateTimeTz = NewType('DateTimeTz', datetime)\nDateTimeNoTz = NewType('DateTimeNoTz', datetime)\n\n\ndef time_min() -> Tim... | python | edit | 1 | 2 | apache-2.0 | 49997f92f8f62a1fc259c0285d386887a399ba0e | agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft | pycroft/helpers/utc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nirrelevant = object()\n\n\nclass ChangeWatcher(object):\n\n def __init__(self, thing, *args, **kwargs):\n self.thing = thing\n self.args = args\n self.kwargs = kwargs\n self.expected_before = kwargs.pop('befor... | python | edit | 1 | 2 | mit | a2d3c2e0391d2deeb1d6729567c2d8812ad7e7df | Fluxx/exam,gterzian/exam,Fluxx/exam,gterzian/exam | exam/asserts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix deprecation warnings due to invalid escape sequences."
},
{
"role": "assistant",
"content": "\nAWS_SECRET_ACCESS_KEY = r'A8+6AN5TSUZ3vysJg68Rt\\A9E7duMlfKODwb3ZD8'\n"
}
] | python | new_file | 1 | 0 | mit | 545171378864d4d80aeef52bd036ed99f18aadfc | landscapeio/dodgy | tests/testdata/amazon.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom .errors import parse_log\n\n\nclass LatexError(Exception):\n pass\n\n\nclass LatexBuildError(LatexError):\n \"\"\"LaTeX call exception.\"\"\"\n\n def __init__(self, logfn=None):\n if os.path.exists(logfn):\... | python | edit | 1 | 2 | bsd-3-clause | ba13537cf18b8bced21544866fcdcc887e1d290d | mbr/latex | latex/exc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# first party\nfrom delphi.epidata.acquisition.covid_hosp.common.network import Network as BaseNetwork\n\n\nclass Network(BaseNetwork):\n\n DATASET_ID = '823dd0e-c8c4-4206-953e-c6d2f451d6ed'\n\n def fetch_metadata(*args, **kwags):\n \"... | python | edit | 1 | 1 | mit | da3599ac6ed29e750d28834a8c0c0f39e9b57702 | cmu-delphi/delphi-epidata,cmu-delphi/delphi-epidata,cmu-delphi/delphi-epidata,cmu-delphi/delphi-epidata,cmu-delphi/delphi-epidata,cmu-delphi/delphi-epidata | src/acquisition/covid_hosp/state_daily/network.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport subprocess\nimport argparse\n\ndef readArguments():\n parser = argparse.ArgumentParser()\n parser.add_argument('-f','--file', action=\"store\", dest=\"file\", required=True, help=\"File to shred\")\n args = pa... | python | edit | 3 | 1 | apache-2.0 | 1cdb773f0d20dcdb1a66a4a6a52eff35398b1296 | monolive/hdfs-shred | getBlocks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport xyz\n\nclass ArmToolchain(xyz.BuildProtocol):\n group_only = True\n pkg_name = 'arm-toolchain'\n supported_targets = ['arm-none-eabi']\n deps = [('gcc', {'target': 'arm-none-eabi'}),\n ('binutils', {'target': '... | python | edit | 1 | 0 | mit | cb2db952d3a6c651dac5a285e8b0dc01a5e12a4b | BreakawayConsulting/xyz | rules/arm-toolchain.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.web import http\nfrom twisted.web.test.requesthelper import DummyRequest\n\n\n\nclass InMemoryRequest(DummyRequest):\n \"\"\"\n In-memory `IRequest`.\n \"\"\"\n def redirect(self, url):\n self.setResponseCode... | python | edit | 1 | 1 | mit | c84f14d33f9095f2d9d8919a9b6ba11e17acd4ca | jonathanj/txspinneret,mithrandi/txspinneret | txspinneret/test/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom snappybouncer.models import Conversation, UserAccount, Ticket\n\nadmin.site.register(Conversation)\nadmin.site.register(UserAccount)\nadmin.site.register(Ticket)\n\n```\n\nApply this change: Add downlo... | python | edit | 1 | 0 | bsd-3-clause | d8dd87f6f5bd1bdead9f2b77ec9271035d05a378 | praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control | snappybouncer/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport wpilib\n\nclass ButtonDebouncer:\n '''Useful utility class for debouncing buttons'''\n \n def __init__(self, joystick, buttonnum, period=0.5):\n '''\n :param joystick: Joystick object\n :type joystick:... | python | edit | 1 | 3 | bsd-3-clause | 3be25f88352ff20a3239b0647f437c45f4903008 | robotpy/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities | robotpy_ext/control/button_debouncer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom jawa.attribute import get_attribute_classes\n\n\ndef test_mandatory_attributes():\n for parser_class in get_attribute_classes().values():\n assert hasattr(parser_class, 'ADDED_IN'), (\n 'At... | python | edit | 1 | 3 | mit | 29cc59bc478c4c6bc936141d19a3386468ff8f07 | TkTech/Jawa,TkTech/Jawa | tests/test_general_attributes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Admin for schedule-related models.\"\"\"\n\nfrom pygotham.admin.utils import model_view\nfrom pygotham.schedule import models\n\n# This line is really long because pep257 needs it to be on one line.\n__all__ = ('DayModelView', 'RoomMo... | python | edit | 1 | 0 | bsd-3-clause | c9284e4d36026b837f1a43a58100b434e7a57337 | djds23/pygotham-1,PyGotham/pygotham,djds23/pygotham-1,PyGotham/pygotham,djds23/pygotham-1,PyGotham/pygotham,PyGotham/pygotham,pathunstrom/pygotham,PyGotham/pygotham,djds23/pygotham-1,pathunstrom/pygotham,pathunstrom/pygotham,pathunstrom/pygotham,pathunstrom/pygotham,djds23/pygotham-1 | pygotham/admin/schedule.py | rejected_duplicate | Near-duplicate of sample 16694 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collection_pipelines.http import http\nfrom collection_pipelines.json import *\n\n\nclass cat(CollectionPipelineProcessor):\n def __init__(self, fname):\n self.fname = fname\n self.source(self.make_generator)\n\n de... | python | edit | 9 | 2 | mit | be670eb5830a873d21e4e8587600a75018f01939 | povilasb/pycollection-pipelines | collection_pipelines/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, unicode_literals\n\nimport inspect\nimport logging\nimport os\nimport unittest\nimport vcr\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass VCRTestCase(unittest.TestCase):\n vcr_enabled = True\... | python | edit | 1 | 2 | mit | 2c1d40030f19356bdac6117d1df6dc35a475e480 | agriffis/vcrpy-unittest | vcr_unittest/testcase.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import Column, String, Sequence, Integer\n\nfrom virtool.postgres import Base\n\n\nclass Label(Base):\n __tablename__ = 'labels'\n\n id = Column(Integer, Sequence('labels_id_seq'), primary_key=True)\n name = Column(... | python | edit | 3 | 1 | mit | 939d76ec219b3bff45dceaef59aee08a82a76f87 | virtool/virtool,igboyes/virtool,igboyes/virtool,virtool/virtool | virtool/labels/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render_to_response\nfrom django.shortcuts import render\nfrom django.template import RequestContext\nfrom django.shortcuts import redirect\n\n\ndef handler404(request):\n return render(request, '404.html', {}... | python | edit | 4 | 2 | mit | 915370a5950bcaee4b7037196ef02621e518dcd9 | ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP | rcamp/lib/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Portal Service Layer\n\nThe service layer provides an API on top of Django models to build useful outputs for consumers such as views. This layer helps keep views thin, encourages reusability across views, simplifies testing, and ease... | python | edit | 4 | 0 | mit | ed33050bf503a1f8c9a009411f2cbbd4e2f78e4a | impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore | datastore/services/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .testenv import testenv\n\n__version__ = \"0.1.1\"\n\n__all__ = [\"testenv\"]\n\n```\n\nApply this change: Update init to latest version number"
},
{
"role": "assistant",
"content": "from .testenv import testenv\n\n__versio... | python | edit | 1 | 0 | mit | e67849ca91d5d7405cd2c666516b92d2db513963 | ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls | runners/trytls/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask.ext.bootstrap import Bootstrap\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask.ext.login import LoginManager\nfrom flask.ext.uploads import UploadSet, configure_uploads, IMAGES\n\nfrom config imp... | python | edit | 1 | 1 | mit | d07722c8e7cc2efa0551830ca424d2db2bf734f3 | finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is | app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import timedelta\nimport eventlet\nimport logging\nimport sys\nfrom threading import Thread\nimport time\n\n# Constants\nSUCCESS_EXIT_CODE = 0\n\neventlet.monkey_patch(\n os=True,\n select=True,\n socket=True,\n th... | python | edit | 7 | 2 | apache-2.0 | 90a3b5c66a050f22df56e39dc6fb4f32490df4cb | StackStorm/st2,Plexxi/st2,grengojbo/st2,Itxaka/st2,nzlosh/st2,armab/st2,grengojbo/st2,dennybaa/st2,alfasin/st2,emedvedev/st2,peak6/st2,tonybaloney/st2,jtopjian/st2,lakshmi-kannan/st2,tonybaloney/st2,nzlosh/st2,StackStorm/st2,Itxaka/st2,pixelrebel/st2,pixelrebel/st2,Itxaka/st2,Plexxi/st2,punalpatel/st2,alfasin/st2,tonyb... | st2reactor/st2reactor/container/base.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\r\n import wpilib\r\nexcept ImportError:\r\n from pyfrc import wpilib\r\nfrom common.autonomous_helper import StatefulAutonomous, timed_state\r\n\r\nclass TimedShootAutonomous(StatefulAutonomous):\r\n '''\r\n Tunable au... | python | edit | 3 | 2 | bsd-3-clause | 02076f919e56503c76a41e78feed8a6720c65c19 | frc1418/2014 | robot/robot/src/autonomous/timed_shoot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nlong_desc = '''\nThis package contains the mscgen Sphinx extension.\n\nAllow mscgen-formatted Message Sequence Chart graphs to be included in\nSphinx-generated docume... | python | edit | 1 | 0 | bsd-2-clause | a643cb510429d9fcf4de43e64b04480419c5500b | sphinx-contrib/spelling,sphinx-contrib/spelling | mscgen/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom chatterbot.ext.django_chatterbot.models import Statement\n\n\nclass OutputIntegrationTestCase(TestCase):\n \"\"\"\n Tests to make sure that output adapters\n function correctly when using Djan... | python | edit | 1 | 1 | bsd-3-clause | 5ea8993f76477c3cb6f35c26b38d82eda8a9478f | vkosuri/ChatterBot,Reinaesaya/OUIRL-ChatBot,Reinaesaya/OUIRL-ChatBot,maclogan/VirtualPenPal,davizucon/ChatterBot,gunthercox/ChatterBot,Gustavo6046/ChatterBot | tests_django/integration_tests/test_output_adapter_integration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport praw\nimport argparse\n\nparser = argparse.ArgumentParser(description='Stream self posts from any subreddit.')\nparser.add_argument('-sub', required=False, default='all', help='Subreddit name (default=\\'all\\')')\nparser.add_argumen... | python | edit | 1 | 0 | mit | 19c2f919c6deb11331e927ad3f794424905fc4f3 | kshvmdn/reddit-bots | self-post-stream/stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python -tt\n\n\"\"\"Solves problem B from Google Code Jam Qualification Round Africa 2010\n(https://code.google.com/codejam/contest/351101/dashboard#s=p1)\n\"Reverse Words\"\n\"\"\"\n\nimport sys\n\ndef main():\n \"\"\"Reads p... | python | edit | 2 | 2 | cc0-1.0 | cbfbc7482a19b5d7ddcdb3980bfdf5d1d8487141 | mschruf/python | Google_Code_Jam/2010_Africa/Qualification_Round/B/reverse_words.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\nimport tables\nprint 'tables.__version__', tables.__version__\n\nnrows=10000-1\n\nclass Distance(tables.IsDescription):\n frame = tables.Int32Col(pos=0)\n distance = tables.Float64Col(pos=1)\n\nh5file = tables.openFile(... | python | edit | 5 | 0 | bsd-3-clause | aca834449910cd358ea59a73984f895cbfc67030 | PyTables/PyTables,jennolsen84/PyTables,jack-pappas/PyTables,FrancescAlted/PyTables,dotsdl/PyTables,tp199911/PyTables,jennolsen84/PyTables,joonro/PyTables,joonro/PyTables,rabernat/PyTables,dotsdl/PyTables,rabernat/PyTables,cpcloud/PyTables,mohamed-ali/PyTables,avalentino/PyTables,jennolsen84/PyTables,tp199911/PyTables,j... | examples/index.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nRun all migrations\n\"\"\"\nimport imp\nimport os\nimport sys\nimport pymongo\nfrom os.path import join\nimport logging\n\nlogging.basicConfig(level=logging.DEBUG)\n\nROOT_PATH = os.path.abspath(os.path.dirname(__file__))\n\n\ndef l... | python | edit | 1 | 3 | mit | 407f3dfc9f2d87942908c23e6c4db938ac4d94dc | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | run_migrations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Charles Robison\n# 2016.10.16\n# Mailroom Lab\n\n#!/usr/bin/env python\n\ndonors = {\n 'Smith':[100, 125, 100],\n 'Galloway':[50],\n 'Williams':[22, 43, 40, 3.25],\n 'Cruz':[101],\n '... | python | edit | 1 | 5 | unlicense | 66461c43b3a0229d02c58ad7aae4653bb638715c | UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,Baumelbi/IntroPython2016,weidnem/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,Baumelbi/IntroPython2016,UWPCE-PythonCert/IntroPython2016 | students/crobison/session03/mailroom.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\nimport unittest\nfrom harness import MockRouter\n\nclass TestLog(unittest.TestCase):\n def test_backend_irc (self):\n router = MockRouter()\n try:\n import i... | python | edit | 2 | 2 | bsd-3-clause | a4931218fbb00d646dbc8de6f8861e4647ef7ab4 | catalpainternational/rapidsms,caktus/rapidsms,ken-muturi/rapidsms,rapidsms/rapidsms-core-dev,catalpainternational/rapidsms,caktus/rapidsms,lsgunth/rapidsms,peterayeni/rapidsms,rapidsms/rapidsms-core-dev,lsgunth/rapidsms,dimagi/rapidsms,ken-muturi/rapidsms,peterayeni/rapidsms,peterayeni/rapidsms,lsgunth/rapidsms,ehealth... | lib/rapidsms/tests/test_backend_irc.py | rejected_duplicate | Near-duplicate of sample 4296 | true |
[
{
"role": "user",
"content": "Write python code for the following: Use __all__ to make it not overwrite .models randomly."
},
{
"role": "assistant",
"content": "\nfrom denorm.fields import denormalized\nfrom denorm.dependencies import depend_on_related, depend_on_q\n\n__all__ = [\"denormalized\"... | python | new_file | 1 | 0 | bsd-3-clause | 4b0b85a54208625c7a2753d8ba9b96818f1411d0 | heinrich5991/django-denorm,miracle2k/django-denorm,Chive/django-denorm,anentropic/django-denorm,simas/django-denorm,catalanojuan/django-denorm,victorvde/django-denorm,initcrash/django-denorm,PetrDlouhy/django-denorm,gerdemb/django-denorm,kennknowles/django-denorm,Eksmo/django-denorm,alex-mcleod/django-denorm,mjtamlyn/d... | denorm/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\"\"\"A payload based version of page.\"\"\"\n\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nfrom IPython.core.getipython import get_ipython\n\n#----------------... | python | edit | 1 | 2 | bsd-3-clause | bb8d9aa91b6d1bf2a765113d5845402c059e6969 | ipython/ipython,ipython/ipython | IPython/core/payloadpage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom Cookie import SimpleCookie\nfrom urlparse import parse_qs\n\nfrom utils import MultiDict, cached_property\n\n\nclass Request(object):\n def __init__(self, event, context):\n self.event = event\n self.context = context\... | python | edit | 1 | 2 | bsd-3-clause | 39e561b2675649279cbff4aa457216d12072160b | funkybob/paws | paws/request.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import *\n\n@task\n@role('ci')\ndef install():\n sudo(\"apt-get install git\")\n sudo(\"apt-get install maven2\") # TODO: maven3\n sudo(\"apt-get install groovy\") # TODO: groovy-1.8, or gradle...\n configure_gro... | python | edit | 11 | 1 | bsd-2-clause | d9c005669c65d65a18b0bd8527918c5dd3fa688c | rinfo/rdl,rinfo/rdl,rinfo/rdl,rinfo/rdl,rinfo/rdl,rinfo/rdl | manage/fabfile/ci.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom .core import Conveyor\n\n\ndef main():\n Conveyor().run()\n\nif __name__ == \"__main__\":\n main()\n\n```\n\nApply this change: Bring the standard __future__ imports over"
},
{
"r... | python | edit | 1 | 1 | bsd-2-clause | f4dfcf91c11fd06b5b71135f888b6979548a5147 | crateio/carrier | conveyor/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n# ---------------------------------------------------------------------------\n# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.\n# Distributed under the terms of the BSD License. See COPYING.rst.... | python | edit | 1 | 3 | bsd-3-clause | 1ed7d695eff134557990d8b1a5dffa51b6d1d2f6 | enthought/distarray,RaoUmer/distarray,RaoUmer/distarray,enthought/distarray | distarray/run_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\n\nfrom scout.demo import coverage_qc_report \nfrom scout.commands import cli\n\n\ndef test_load_coverage_qc_report(mock_app, case_obj):\n \"\"\"Testing the load delivery report cli command\"\"\"\n\n ... | python | edit | 5 | 1 | bsd-3-clause | e0cfd055540b5647b0bd5a4cfffb9c1a3399c721 | Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout | tests/commands/load/test_load_coverage_qc_report_cmd.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Run 'Bundles' example application.\"\"\"\n\nimport sqlite3\nimport boto3\n\nfrom dependency_injector import containers\nfrom dependency_injector import providers\n\nfrom bundles.users import Users\nfrom bundles.photos import Photos\n\... | python | edit | 1 | 0 | bsd-3-clause | 4b863a659e36b1fa9887847e9dbb133b1852cf9b | ets-labs/dependency_injector,ets-labs/python-dependency-injector,rmk135/objects,rmk135/dependency_injector | examples/miniapps/bundles/run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.db import migrations\n\napp = 'model_logging'\nmodel = 'LogEntry'\n\n\ndef move_data(apps, schema_editor):\n LogEntry = apps.get_model(app, model)\n for entry in LogEntry.objects.all():\n en... | python | edit | 2 | 3 | bsd-2-clause | c1756ab481f3bf72ab33465c8eb1d5a3e729ce4e | incuna/django-model-logging | model_logging/migrations/0003_data_migration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport sys\nfrom parse_docker_args import parse_mount\n\ndef can_access(path, perm):\n mode = None\n if perm == 'r':\n mode = os.R_OK\n elif perm == 'w':\n mode = os.W_OK\n else:\n return Fal... | python | edit | 5 | 3 | mit | 9cbfed00905fb8b360b60cce1afc293b71a2aced | Duke-GCB/docker-wrapper,Duke-GCB/docker-wrapper | check_access.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\n# -*- coding: utf8 -*-\n\nimport argparse\nimport shutil\nfrom subprocess import check_output, run\n\nparser = argparse.ArgumentParser(description='Update every entries found in cask folder.')\nparser.add_argument(... | python | edit | 3 | 0 | cc0-1.0 | 7c9d2ace7de2727c43b0ee00f8f2280d8a465301 | boltomli/MyMacScripts,boltomli/MyMacScripts | Python/brewcaskupgrade.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport logging\nimport importlib\n\n# All configuration defaults are set in this module\n\nTRACKER_HOST = 'rutracker.org'\n\n# Timeone for the tracker times\nTZNAME = 'Europe/Moscow'\n\nLOGLEVEL = logging.INFO\n\nLOG_FORMAT_LOGEN... | python | edit | 1 | 0 | apache-2.0 | 9504529dd4b9140be0026d0b30a0e88e5dea5e25 | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | rtrss/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom nose.tools import * # flake8: noqa\n\nfrom tests.base import ApiTestCase\n\nfrom api.base.pagination import MaxSizePagination\n\nclass TestMaxPagination(ApiTestCase):\n def test_no_query_param_alters_page_s... | python | edit | 2 | 1 | apache-2.0 | c767ee0b4392c519335a6055f64bbbb5a500e997 | HalcyonChimera/osf.io,DanielSBrown/osf.io,HalcyonChimera/osf.io,TomBaxter/osf.io,crcresearch/osf.io,crcresearch/osf.io,alexschiller/osf.io,hmoco/osf.io,rdhyee/osf.io,caneruguz/osf.io,SSJohns/osf.io,laurenrevere/osf.io,icereval/osf.io,sloria/osf.io,emetsger/osf.io,felliott/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,l... | api_tests/base/test_pagination.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom neo.rawio.openephysbinaryrawio import OpenEphysBinaryRawIO\nfrom neo.test.rawiotest.common_rawio_test import BaseTestRawIO\n\n\nclass TestOpenEphysBinaryRawIO(BaseTestRawIO, unittest.TestCase):\n rawioclass = Open... | python | edit | 1 | 0 | bsd-3-clause | dd75314f203b907f25a7b7e158c7e5d988a5b6ae | apdavison/python-neo,JuliaSprenger/python-neo,NeuralEnsemble/python-neo,INM-6/python-neo | neo/test/rawiotest/test_openephysbinaryrawio.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom reddit.models import RedditUser,Submission,Comment,Vote\n\n# Register your models here.\nclass SubmissionInline(admin.TabularInline):\n model = Submission\n max_num = 10\n\nclass CommentsInline(a... | python | edit | 1 | 0 | apache-2.0 | ba57b3c016ed3bc3c8db9ccc3c637c2c58de1e1d | Nikola-K/django_reddit,Nikola-K/django_reddit,Nikola-K/django_reddit | reddit/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\ntest_perma_base.py\n tests of the perma_base component of permamodel\n\"\"\"\n\nfrom permamodel.components import frost_number\nimport os\nimport numpy as np\nfrom .. import permamodel_directory, data_directory, examples_directory\... | python | edit | 1 | 1 | mit | 39a743463f55c3cfbbea05b4d471d01f66dd93f8 | permamodel/permamodel,permamodel/permamodel | permamodel/tests/test_perma_base.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\nfrom ._metadata import version as __version__, author as __author__, email as __email__\n\n```\n\nApply this change: Add __package_version__ for version description\n\nExa... | python | edit | 4 | 0 | mit | 82217bab5263984c3507a68c1b94f9d315bafc63 | njvack/masterfile | src/masterfile/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = '0.1.6'\n__author__ = 'sukrit'\n\nimport logging\nfrom conf.appconfig import LOG_FORMAT, LOG_DATE, LOG_ROOT_LEVEL\n\n\nlogging.basicConfig(format=LOG_FORMAT, datefmt=LOG_DATE, level=LOG_ROOT_LEVEL)\n\n```\n\nApply this change:... | python | edit | 1 | 0 | mit | ee5cd9196fc273c74fce29e4ac9c3726d3da03b6 | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer | deployer/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# 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# Un... | python | edit | 1 | 0 | apache-2.0 | 1cdcacb8ab8e78c9b325f454382d591da10b06fd | stackforge/senlin-dashboard,stackforge/senlin-dashboard,openstack/senlin-dashboard,openstack/senlin-dashboard,openstack/senlin-dashboard,stackforge/senlin-dashboard,openstack/senlin-dashboard | senlin_dashboard/enabled/_50_senlin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom abc import ABCMeta\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\nclass SubclassRegisteringABCMeta(ABCMeta):\n\n def __init__(cls, name, bases, dct):\n super(SubclassRegisteringABCMeta, cls).__init__(name, bases... | python | edit | 1 | 6 | apache-2.0 | 8525465c4f428cc0df02df7eb4fca165a9af6bdc | airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo | knowledge_repo/utils/registry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"Script for updating a directory of repositories.\"\"\"\nimport logging\nimport os\n\nimport click\n\nfrom .actions import update_repo\n\n\n@click.command()\n@click.option('-d', '--debug', help='Set DEBUG level l... | python | edit | 1 | 4 | mit | 73344151ce39ebc093b7915d6625096ddc2a125d | e4r7hbug/git_update | git_update/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n SoftLayer.tests.CLI.modules.import_test\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :license: MIT, see LICENSE for more details.\n\"\"\"\nfrom SoftLayer.tests import unittest\nfrom SoftLayer.CLI.modules import get_module... | python | edit | 1 | 2 | mit | d531ea281b546d31724c021011a7145d3095dbf8 | allmightyspiff/softlayer-python,underscorephil/softlayer-python,cloudify-cosmo/softlayer-python,iftekeriba/softlayer-python,skraghu/softlayer-python,kyubifire/softlayer-python,nanjj/softlayer-python,Neetuj/softlayer-python,softlayer/softlayer-python,briancline/softlayer-python | SoftLayer/tests/CLI/modules/import_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom ddsc_worker.celery import celery\n\n\n@celery.task\ndef add(x, y):\n return x + y\n\n\n@celery.task\ndef mul(x, y):\n return x + y\n\n```\n\nApply this change: Add sleep to simulate work"
... | python | edit | 1 | 1 | mit | b3b216a95c4254302776fdbb67bab948ba12d3d3 | ddsc/ddsc-worker | ddsc_worker/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\r\nfrom .exceptions import IncompleteEnv\r\nfrom tempfile import TemporaryDirectory\r\nimport time\r\n\r\n\r\nclass Environment(object):\r\n def __init__(self, *args, **kwargs):\r\n self.environ = os.environ.copy()\r\n ... | python | edit | 4 | 5 | bsd-3-clause | 5b88a7068a6b245d99ef5998bbf659480fb85199 | jhunkeler/cbc,jhunkeler/cbc,jhunkeler/cbc | cbc/environment.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8\n\"\"\"\nThis test checks that all the internal links in the site (links that point to\nother pages on the site) are pointing at working pages.\n\"\"\"\n\nfrom http_crawler import crawl\n\n\ndef test_no_links_are_broke... | python | edit | 1 | 5 | mit | c05ec7f6a869712ec49c2366016b325cf18f7433 | alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net | tests/test_no_broken_links.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport threading\n\nfrom robotd.native import _cvcapture\n\nclass CaptureDevice(object):\n def __init__(self, path=None):\n if path is not None:\n argument_c = _cvcapture.ffi.new(\n 'char[]',\n ... | python | edit | 1 | 3 | mit | 2dc56ab04ea17bea05654eaec12bb27b48b0b225 | sourcebots/robotd,sourcebots/robotd | robotd/cvcapture.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport afnumpy\nimport arrayfire\nimport numpy\nfrom .. import private_utils as pu\n\ndef tile(A, reps):\n try:\n tup = tuple(reps)\n except TypeError:\n tup = (reps,)\n if(len(tup) > 4):\n raise NotImplemented... | python | edit | 4 | 6 | bsd-2-clause | c1473e77a9b92c9bdf292017cb2f46bf8695dfd5 | FilipeMaia/afnumpy,daurer/afnumpy | afnumpy/lib/shape_base.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport doctest\nimport glob\nimport pkg_resources\n\ntry:\n pkg_resources.require('OWSLib')\nexcept (ImportError, pkg_resources.DistributionNotFound):\n pass\n\ntestfiles = glob.glob('*.txt')\n\nfor file in testfiles: \n doctest.te... | python | edit | 2 | 3 | bsd-3-clause | 5c1f9b0a70fe47bbfa7d3813a47e2da81cd81506 | sabman/OWSLib,monoid/owslib,monoid/owslib | tests/runalldoctests.py | rejected_duplicate | Near-duplicate of sample 3119 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport sys\n\nfrom django.conf import settings\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\n\nimport rules\n\n\n@python_2_unicode_compatible\nclass B... | python | edit | 1 | 1 | mit | ede7158c611bf618ee03989d33c5fe6a091b7d66 | dfunckt/django-rules,dfunckt/django-rules,ticosax/django-rules,ticosax/django-rules,dfunckt/django-rules,ticosax/django-rules | tests/testapp/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport subprocess\nimport sys\n\n\ndef build(pkgpath):\n os.chdir(pkgpath)\n targets = [\n 'build',\n 'package',\n 'install',\n 'clean',\n 'clean-depends',\n ]\... | python | edit | 2 | 2 | isc | 0f546ce883bffa52d81ebfdc6eba005d6f2eca22 | eliteraspberries/minipkg,eliteraspberries/minipkg | build.py | rejected_duplicate | Near-duplicate of sample 3170 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2013 - Noorul Islam K M\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 Lice... | python | edit | 1 | 1 | apache-2.0 | 7b5896700a6c7408d0b25bb4dde4942eaa9032bb | devdattakulkarni/test-solum,gilbertpilz/solum,gilbertpilz/solum,stackforge/solum,openstack/solum,ed-/solum,ed-/solum,gilbertpilz/solum,openstack/solum,stackforge/solum,ed-/solum,ed-/solum,devdattakulkarni/test-solum,gilbertpilz/solum | solum/tests/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cffi import FFI\nffi = FFI()\n\n#Header generated with cpp spotify.h > spotify.processed.h && sed -i 's/__extension__//g' spotify.processed.h\nwith open(\"spotify.processed.h\") as file:\n header = file.read()\n\nffi.cdef(header)\nf... | python | edit | 2 | 0 | apache-2.0 | 8c10646768818a56ee89ff857318463da838f813 | chukysoria/spotify-connect-web,chukysoria/spotify-connect-web,chukysoria/spotify-connect-web,chukysoria/spotify-connect-web | connect_ffi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import AppCommand\n\n\nclass Command(AppCommand):\n help = \"Generate sphinx documentation skeleton for given apps.\"\n \n def handle_app(self, app, **options):\n # check if simpleadmindoc di... | python | edit | 1 | 3 | bsd-3-clause | 7f711f7da0003cf6f0335f33fb358e91d4e91cf7 | bmihelac/django-simpleadmindoc,bmihelac/django-simpleadmindoc | simpleadmindoc/management/commands/docgenapp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n# Copyright 2022 The TensorFlow Datasets 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 Li... | python | edit | 1 | 1 | apache-2.0 | e858be9072b175545e17631ccd838f9f7d8a7e21 | tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets | tensorflow_datasets/dataset_collections/longt5/longt5.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bloop import String\n\n\nclass Position(String):\n \"\"\" stores [2, 3, 4] as '2:3:4' \"\"\"\n def dynamo_load(self, value):\n values = value.split(\":\")\n return list(map(int, values))\n\n def dynamo_dump(self,... | python | edit | 1 | 1 | mit | 75536b58ab934b3870236f2124dfb505e0a9299f | numberoverzero/dvox | dvox/models/types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom astral.api.handlers.base import BaseHandler\nfrom astral.models.node import Node\nfrom astral.api.client import NodesAPI\nimport sys\n\n\nimport logging\nlog = logging.getLogger(__name__)\n\n\nclass NodeHandler(BaseHandler):\n def d... | python | edit | 1 | 3 | mit | af10508437be2001e9e12a369c4e8a973fd50ee8 | peplin/astral | astral/api/handlers/node.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom k2catalogue import models\n\n\n@pytest.fixture\ndef epic():\n return models.EPIC(epic_id=12345, ra=12.345, dec=67.894,\n mag=None, campaign_id=1)\n\n\ndef test_repr(epic):\n assert repr(epic... | python | edit | 1 | 1 | mit | 6876b6584cd90cca60fc21a53967dc1dfee6f2b4 | mindriot101/k2catalogue | testing/models/test_epic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\nscope = \"Private Program\"\ndescription = \"\"\"\n A user with authorization to edit mapping objects related to an access\... | python | edit | 1 | 0 | apache-2.0 | 091b543fd8668d6f53bf126492aaaf47251d0672 | selahssea/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core | src/ggrc_basic_permissions/roles/ProgramEditor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/python\nimport argparse\nfrom xml.dom import minidom\n\nparser = argparse.ArgumentParser(description='Parse a dive in xml formt.')\nparser.add_argument('-f', '--file', required=True,\n\t\t\t\t\tdest='path', help='path to xml fi... | python | edit | 1 | 0 | isc | 46259730666b967675336e7bda5014b17419614d | AquaBSD/libbuhlmann,AquaBSD/libbuhlmann,AquaBSD/libbuhlmann | test/parse_dive.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis module contains useful utility methods.\n\"\"\"\n\n\ndef jq_format(code):\n \"\"\"\n Use before throwing raw code such as 'div[tab=\"advanced\"]' into jQuery.\n Selectors with quotes inside of quotes would otherwise br... | python | edit | 2 | 1 | mit | 94eecbd714e82ce179ca9985f9dd89dc72995070 | ktp420/SeleniumBase,mdmintz/SeleniumBase,possoumous/Watchers,seleniumbase/SeleniumBase,mdmintz/seleniumspot,possoumous/Watchers,mdmintz/SeleniumBase,possoumous/Watchers,ktp420/SeleniumBase,ktp420/SeleniumBase,mdmintz/SeleniumBase,ktp420/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/Selen... | seleniumbase/fixtures/page_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test noreferences bot module.\"\"\"\n#\n# (C) Pywikibot team, 2018-2020\n#\n# Distributed under the terms of the MIT license.\n#\nimport pywikibot\n\nfrom scripts.noreferences import NoReferencesBot\n\nfrom tests.aspects import TestCa... | python | edit | 1 | 1 | mit | 7ad80225cd593689b33c59db0b8eb3e9cfd6e763 | wikimedia/pywikibot-core,wikimedia/pywikibot-core | tests/noreferences_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom invoke import ctask as task\n\n\n@task(help={\n 'module': \"Just runs tests/STRING.py.\",\n 'runner': \"Use STRING to run tests instead of 'spec'.\"\n})\ndef test(ctx, module=None, runner='spec'):\n \"\"\"\n Run a Spec or N... | python | edit | 1 | 3 | bsd-2-clause | fa85cbfe499599e8a0d667f25acae7fedcc13fb2 | singingwolfboy/invocations,pyinvoke/invocations,mrjmad/invocations,alex/invocations | invocations/testing.py | rejected_duplicate | Near-duplicate of sample 2749 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ncsp = {\n 'default-src': '\\'self\\'',\n 'style-src': [\n '\\'self\\'',\n '\\'unsafe-inline\\''\n ],\n 'script-src': [\n '\\'self\\'',\n 'cdn.httparchive.org',\n 'www.google-analytics.com',\n ... | python | edit | 1 | 0 | apache-2.0 | f14b1aa56b838469f63cec22c87e2e8c0c3f17c6 | HTTPArchive/beta.httparchive.org,HTTPArchive/beta.httparchive.org,HTTPArchive/beta.httparchive.org | csp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"This module contains the SQLAlchemy EventSubscription class definition.\"\"\"\nfrom server.models.db import db\n\n\nclass EventSubscription(db.Model):\n\n \"\"\"SQLAlchemy EventSubscription class definition.\"\"\"\n\n __tablenam... | python | edit | 1 | 1 | mit | 3492ae03c9cfc8322ba60522779c7c0eeb642dd3 | bnotified/api,bnotified/api | server/models/event_subscription.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\n\nurlpatterns = [\n url(r\"^\", include(\"formly.urls\", namespace=\"formly\")),\n]\n\n```\n\nApply this change: Add \"home\" url for testing"
},
{
"role": "assistant",
"content": "f... | python | edit | 1 | 0 | bsd-3-clause | a1d8a81bbd25404b1109688bded9bea923ba6771 | eldarion/formly,eldarion/formly | formly/tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"testapp URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from my_app imp... | python | edit | 1 | 0 | isc | 765864250faba841a2ee8f2fa669f57a25661737 | hobarrera/django-afip,hobarrera/django-afip | testapp/testapp/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n#\n# Copyright (c) 2016 All rights reserved\n# This program and the accompanying materials\n# are made available under the terms of the Apache License, Version 2.0\n# which accompanies this distribution, and is available ... | python | edit | 1 | 1 | apache-2.0 | d5820bef80ea4bdb871380dbfe41db12290fc5f8 | mywulin/functest,opnfv/functest,mywulin/functest,opnfv/functest | functest/opnfv_tests/features/odl_sfc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\n\ndef clean_whitespace(text):\n \"\"\"\n Remove any extra whitespace and line breaks as needed.\n \"\"\"\n # Replace linebreaks with spaces\n text = text.replace(\"\\n\", \" \").replace(\"\\r\", \" \").replace(\"... | python | edit | 2 | 3 | bsd-3-clause | 6fa0db63d12f11f0d11a77c2d0799cd506196b5b | Reinaesaya/OUIRL-ChatBot,gunthercox/ChatterBot,Gustavo6046/ChatterBot,Reinaesaya/OUIRL-ChatBot,maclogan/VirtualPenPal,davizucon/ChatterBot,vkosuri/ChatterBot | chatterbot/utils/clean.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2017, Frappe Technologies and Contributors\n# See license.txt\nfrom __future__ import unicode_literals\n\nimport frappe\nfrom frappe.integrations.doctype.social_login_key.social_login_key import Base... | python | edit | 1 | 2 | mit | 24a6519b7d6a9e961adff1b23a3d64231fc9d233 | vjFaLk/frappe,vjFaLk/frappe,vjFaLk/frappe,vjFaLk/frappe | frappe/integrations/doctype/social_login_key/test_social_login_key.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDetect incompatible version of OpenPyXL\n\nGH7169\n\"\"\"\n\nfrom distutils.version import LooseVersion\n\nstart_ver = '1.6.1'\nstop_ver = '2.0.0'\n\n\ndef is_compat():\n \"\"\"Detect whether the installed version of openpyxl is ... | python | edit | 1 | 1 | bsd-3-clause | 6e0e2a1e38506e85302197d4f700a924a609390c | pratapvardhan/pandas,nmartensen/pandas,cbertinato/pandas,jmmease/pandas,kdebrab/pandas,Winand/pandas,DGrady/pandas,MJuddBooth/pandas,jorisvandenbossche/pandas,jreback/pandas,jmmease/pandas,harisbal/pandas,DGrady/pandas,harisbal/pandas,gfyoung/pandas,jorisvandenbossche/pandas,jreback/pandas,jreback/pandas,cbertinato/pan... | pandas/compat/openpyxl_compat.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, 2), ... | python | edit | 1 | 0 | apache-2.0 | 6c74b18372d3945f909ad63f6f58e11e7658282a | deivislaya/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\nimport datetime\n\nimport arrow\n\nfrom marty.commands import Command\nfrom marty.printer import printer\n\n\nclass Remotes(Command):\n\n \"\"\" Show the list of configured remotes.\n \"\"\"\n\n help = 'Show the list of configured ... | python | edit | 1 | 7 | mit | 62c3fcd65b4c7d3cc4732885cf81640607a04480 | NaPs/Marty | marty/commands/remotes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 Rackspace Australia\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.apa... | python | edit | 1 | 0 | apache-2.0 | 1d0da246b5340b4822d2c47c79519edd7b9ed7e4 | stackforge/turbo-hipster,matthewoliver/turbo-hipster,matthewoliver/turbo-hipster,stackforge/turbo-hipster | turbo_hipster/task_plugins/shell_script/task.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sharepa.analysis import merge_dataframes\n\nimport pandas as pd\n\n\ndef test_merge_dataframes():\n dream = pd.DataFrame({'Rhodes': 'Dusty'}, index=['Rhodes'])\n stardust = pd.DataFrame({'Rhodes': 'Cody'}, index=['Rhodes'])\n\n ... | python | edit | 1 | 1 | mit | 0ea9fedf3eac7d8b6a7a85bd0b08fb30f35e4f4d | CenterForOpenScience/sharepa,samanehsan/sharepa,erinspace/sharepa,fabianvf/sharepa | tests/test_analysis.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.