messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file ex... | python | edit | 1 | 0 | apache-2.0 | dd1bcf71c6548f99e6bc133bf890c87440e13535 | openstack/taskflow,jessicalucci/TaskManagement,jimbobhickville/taskflow,openstack/taskflow,citrix-openstack-build/taskflow,jimbobhickville/taskflow,junneyang/taskflow,varunarya10/taskflow,pombredanne/taskflow-1,jessicalucci/TaskManagement,citrix-openstack-build/taskflow,junneyang/taskflow,pombredanne/taskflow-1,varunar... | taskflow/states.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# U... | python | edit | 1 | 2 | apache-2.0 | 5aa3dbf8f520f9ffaaed51ed397eb9f4c722882a | brantlk/python-sample-app | sample_app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Python Notes\n# Version 2.7\n\n# for loop\nfor i in range(10):\n print i\n\n# check list elements of matching string\nrandList = [\"a\", \"ab\", \"bc\", \"de\", \"abc\"]\ntoFind = \"a\"\nprint [x for x in randList if toFind in x]\n\n# ... | python | edit | 6 | 2 | cc0-1.0 | c28de15fd8cade476fa8d7af904826dcea3c0f3e | erictleung/programming-notes,erictleung/programming-notes,erictleung/programming-notes,erictleung/programming-notes,erictleung/programming-notes,erictleung/programming-notes,erictleung/programming-notes,erictleung/programming-notes,erictleung/programming-notes | python.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass DataRow(dict):\n \"\"\"object for holding row of data\"\"\"\n\n def row_values(self, field_names, default_value=None):\n \"\"\"returns row value of specified field_names\"\"\"\n\n return tuple(self.get(field_name, ... | python | edit | 1 | 3 | mit | 80cdc54dbe41c243c4620472aa8ba5c6ece40324 | pantheon-systems/etl-framework | etl_framework/DataTable.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom rest_framework import serializers\n\nclass Question(models.Model):\n version = models.CharField(primary_key=True, max_length=8)\n text = models.TextField()\n created_on = models.DateTimeField(auto... | python | edit | 1 | 0 | mit | 4146551d191152ae486f079911f53086f3a60a07 | holycattle/pysqueak-api,holycattle/pysqueak-api | api/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n# Create your models here.\nclass User(models.Model):\n uid = models.AutoField(primary_key=True)\n uname = models.CharField(max_length=128)\n session = models.CharField(max_length=35,unique=True)\n\n... | python | edit | 1 | 0 | apache-2.0 | b9d54da73e5c4d859aa5ad8e9d8b96bb7527ae6d | g82411/s_square | api/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom merc import errors\nfrom merc import feature\nfrom merc import message\nfrom merc import util\n\n\nclass SidFeature(feature.Feature):\n NAME = __name__\n\n\ninstall = SidFeature.install\n\n\n@SidFeature.register_server_command\nclass ... | python | edit | 4 | 2 | mit | 837b63918c29c1cd45a2a0daf8e6ff6e3b28bfb7 | merc-devel/merc | merc/features/ts6/sid.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass ExportEvents:\n \"\"\"The different csv events types.\"\"\"\n\n EXPORT_PENDING = \"export_pending\"\n EXPORT_SUCCESS = \"export_success\"\n EXPORT_FAILED = \"export_failed\"\n EXPORT_DELETED = \"export_deleted\"\n EX... | python | edit | 1 | 0 | bsd-3-clause | 6eae9369cc122b23577715951d6b0f59991b0f65 | mociepka/saleor,mociepka/saleor,mociepka/saleor | saleor/csv/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib.sites.models import get_current_site\nfrom django.utils import timezone\n\nfrom rest_framework.generics import ListAPIView as RestListAPIView\n\nfrom opps.views.generic.bas... | python | edit | 1 | 6 | mit | 1112f3602c147f469c21181c5c61d480b3f2ed75 | YACOWS/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,opps/opps,opps/opps,opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps | opps/api/views/generic/list.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import NamedTuple, Sequence, Dict, Iterable, List\nfrom datetime import datetime\n\n\nclass Slot(NamedTuple):\n venue: str\n starts_at: datetime\n duration: int\n capacity: int\n session: str\n\n\nclass Event(Name... | python | edit | 5 | 3 | mit | 069e98f036c77f635a955ea2c48580709089e702 | PyconUK/ConferenceScheduler | src/conference_scheduler/resources.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport urlparse\n\nimport foauth.providers\nfrom oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_QUERY\n\n\nclass Netflix(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'https://www.netflix.com/'\n doc... | python | edit | 1 | 1 | bsd-3-clause | cad48e91776ded810b23c336380797c88dd456c0 | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | services/netflix.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom recover.models import *\nfrom recover.patient_data import *\nfrom datetime import date\n\ndef midnightRun():\n physicians = User.objects()\n for physician in physicians:\n patients = physician.patients\n for patient... | python | edit | 5 | 3 | mit | 6b8f66ed0bcaa62b3afd9fea7d749916d768847d | SLU-Capstone/Recover,SLU-Capstone/Recover,SLU-Capstone/Recover | scripts/midnightRun.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Lidar Project Distance Subsystem\n\nimport serial\nimport socket\nimport time\nimport sys\nsys.path.insert(0, \"/home/pi/lidar/pi_approach/Libraries\")\nimport serverxclient as cli\n\narduino_dist = serial.Serial('/dev/ttyUSB0',9600)\ncli... | python | edit | 5 | 4 | mit | b6f04f32556fc8251566212c56159dcfff7bf596 | the-raspberry-pi-guy/lidar | pi_approach/Distance_Pi/distance.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nContains the quick reference widget\n\"\"\"\nfrom pyqode.qt import QtWidgets\nfrom .forms import quick_ref_ui\n\nclass QuickRefWidget(QtWidgets.QWidget):\n def __init__(self, parent=None):\n super(QuickRefWidget, self).__i... | python | edit | 1 | 1 | mit | c4b8cce856777b08a8ffd5a85567389102aea2c2 | ColinDuquesnoy/QRegexEditor | qregexeditor/api/quick_ref.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport six\n\n\n@six.python_2_unicode_compatible\nclass Vendor(object):\n \"\"\"\n Represents a VPS provider.\n \"\"\"\n\n def __init__(self, name, endpoint):\n... | python | edit | 1 | 2 | mit | f5bb9e5f388c4ac222da2318638266fdfbe925f0 | gebn/beam,gebn/beam | beam/vendor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom googl.short import GooglUrlShort\n\nfrom opps.core.models import Publishable, BaseConfig\n\n\nclass FlatPage(Publishable)... | python | edit | 3 | 1 | mit | d16988174f5570334b6b3986dbd0b35148566a62 | opps/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,opps/opps | opps/flatpages/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add lib functions to add/edit/delete port relations"
},
{
"role": "assistant",
"content": "from pycroft.lib.logging import log_room_event, log_event\nfrom pycroft.model.host import SwitchPort, Host, Switch\nfrom pycroft.model.por... | python | new_file | 6 | 4 | apache-2.0 | 3793ef9014b72d5f48e7df0e91521cfdb4b06134 | agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft | pycroft/lib/infrastructure.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport unittest\nimport yv_suggest.open as yvs\nimport inspect\n\nclass WebbrowserMock(object):\n '''mock the builtin webbrowser module'''\n\n def open(self, url):\n '''mock the webbrowser.open() function... | python | edit | 1 | 1 | mit | a2ee2f617ae561ce5b905a6c3960371ce6f157e3 | caleb531/youversion-suggest,caleb531/youversion-suggest | tests/test_open.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom .base import BaseModel\n\n\nclass Tag(BaseModel):\n _id = models.CharField(max_length=1024)\n lower = models.CharField(max_length=1024)\n system = models.BooleanField(default=False)\n\n```\n\nAp... | python | edit | 1 | 0 | apache-2.0 | 00bb631437fdf45c7a067da43aa042f8b1f6ef8e | Nesiehr/osf.io,adlius/osf.io,erinspace/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,crcresearch/osf.io,caneruguz/osf.io,caseyrollins/osf.io,laurenrevere/osf.io,Nesiehr/osf.io,baylee-d/osf.io,leb2dg/osf.io,acshi/osf.io,monikagrabowska/osf.io,monikagrabowska/osf.io,cslzchen/osf.io,chrisseto/osf.io,chennan47/osf.io,... | osf_models/models/tag.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Graphical User Interface (GUI) for configuration and database inspection.\n\nThe GUI is a leight-weight interface which makes the configuration\nof the signac framework and data inspection more straight-forward.\"\"\"\nimport warnings... | python | edit | 1 | 1 | bsd-3-clause | e275fb1406f0a8e70bb3a9d4a50a82400f7e2c29 | csadorf/signac,csadorf/signac | signac/gui/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (3, 0, 1)\n__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))\n\n\nfrom django.apps import AppConfig\n\nfrom .simple import *\nfrom .query import *\nfrom .invalidation import *\nfrom .templatetags.cacheops i... | python | edit | 6 | 1 | bsd-3-clause | e203f76177de390fb02a2770499679c099c4f87c | Suor/django-cacheops,LPgenerator/django-cacheops | cacheops/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport appearance\n\nimport image\n\nfrom residual import (LSIntensity,\n ECC,\n GradientImages,\n GradientCorrelation)\n\n```\n\nApply this change: Add GaborFourier to default ... | python | edit | 9 | 0 | bsd-3-clause | fb21faaec025a0a6ca2d98c8b2381902f3b1444a | menpo/menpo,yuxiang-zhou/menpo,grigorisg9gr/menpo,mozata/menpo,mozata/menpo,mozata/menpo,mozata/menpo,grigorisg9gr/menpo,menpo/menpo,menpo/menpo,jabooth/menpo-archive,jabooth/menpo-archive,jabooth/menpo-archive,yuxiang-zhou/menpo,grigorisg9gr/menpo,patricksnape/menpo,yuxiang-zhou/menpo,jabooth/menpo-archive,patricksnap... | pybug/align/lucaskanade/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Reads a profile from ~/.aws/config and calls the command with\n# AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set correctly.\nimport ConfigParser\nimport os\nimport subprocess\nimport sys\n\nc = ConfigParser.SafeConf... | python | edit | 2 | 0 | mit | c2d681f0df11d2111fe1ade63a0c045f9c9ebad7 | mivok/tools,mivok/tools,mivok/tools,mivok/tools | aws_profile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# U... | python | edit | 1 | 1 | apache-2.0 | f566e0e36269ea2cd1e82c6af712097917effd4a | openstack-packages/delorean,openstack-packages/delorean,openstack-packages/DLRN,openstack-packages/DLRN | dlrn/migrations/versions/2d503b5034b7_rename_artifacts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function\nimport unittest\nfrom qtpy.QtWidgets import QApplication\nfrom addie.rietveld import event_handler\n\n\nclass RietveldEventHandlerTests(unittest.TestCase):\n def setUp(self):\n ... | python | edit | 1 | 1 | mit | 779c01d3932c02f2b9c45e300c7efb54f81749e9 | neutrons/FastGR,neutrons/FastGR,neutrons/FastGR | tests/rietveld/test_event_handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Checkouts application middleware\"\"\"\n\nimport logging\n\nlogger = logging.getLogger('analytics')\n\nclass Analytics():\n \"\"\"Tracks request details useful for analysis of usage patterns.\n \n To ensure that the name of t... | python | edit | 1 | 2 | mit | 4da5ebbad11a5c5cdbea307668657d843d6d1005 | eallrich/checkniner,eallrich/checkniner,eallrich/checkniner | cotracker/checkouts/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.views import generic as views\nfrom . import resources\n\n# Uncomment the next two lines to enable the admin:\nfrom django.contrib.gis import admin\nadmin.autodiscover()\n\nur... | python | edit | 1 | 0 | mit | fbd37fe6404bfc1e7cec4b2137c19e7323cdde02 | openplans/streetscore,openplans/streetscore,openplans/streetscore | street_score/project/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Add some assert methods to nose.tools. These were added in Python 2.7/3.1, so\nonce we stop testing on Python 2.6, this file can be removed.\n\"\"\"\n\nimport nose.tools as nt\n\ndef assert_in(item, collection):\n assert item in co... | python | edit | 1 | 1 | bsd-3-clause | 4b8de0203d2eec87c2d05c3521df8af3365f73a4 | ipython/ipython,ipython/ipython | IPython/testing/nose_assert_methods.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport random\n\nimport game as g\nimport hand_optimizer\n\ngame = g.PineappleGame1()\n\nNUM_ITERS = 1000\n\nutilities = []\nfor iter_num in xrange(NUM_ITERS):\n print \"{:5} / {:5}\".format(iter_num, NUM_ITERS), '\\r',... | python | edit | 4 | 0 | mit | 8afb48e23b91efa3432ffad568002a46384eb021 | session-id/pineapple-ai | fantasyland.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nDisplay clean output of an overstate stage\n'''\n\n\n#[{'group2': {'match': ['fedora17-2', 'fedora17-3'],\n# 'require': ['group1'],\n# 'sls': ['nginx', 'edit']}\n# }\n# ]\n\n# Import Salt... | python | edit | 2 | 4 | apache-2.0 | 5f67934da00ff36044e9fd620b690e36968570c0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/output/overstatestage.py | rejected_duplicate | Near-duplicate of sample 6800 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport json\nfrom datetime import datetime\nfrom bigbuild.models import PageList\nfrom bigbuild import get_archive_directory\nfrom django.core.management.base import BaseCommand\n\n... | python | edit | 2 | 3 | mit | 6ad4a0d511f874ccb94a6c8b02f0d4f5e99947ee | datadesk/django-bigbuild,datadesk/django-bigbuild,datadesk/django-bigbuild | bigbuild/management/commands/cachepages.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport platform\n\n# -----------------------------------------------------------------------------\n# Guess platform we are running on\ndef current_platform():\n machine = platform.machine()\n if machine == 'armv5tejl':\n retur... | python | edit | 3 | 3 | mit | 377d0634a77c63ce9e3d937f31bdd82ebe695cbb | rhempel/ev3dev-lang-python,dwalton76/ev3dev-lang-python,dwalton76/ev3dev-lang-python | ev3dev/auto.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\nimport sys\n\nimport pytest\n\n\ndef test_adding_deps(tmpdir):\n with pytest.raises(ImportError):\n import sentinels\n\n projdir = tmpdir.join('proj')\n yaml = projdir.join('.cob-project.yml')\n... | python | edit | 3 | 2 | bsd-3-clause | 648b128542f737da37dc696a02bd71ace6dbb28c | getweber/weber-cli | tests/test_deps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\n\nfrom api.files import views\n\nurlpatterns = [\n url(r'^$', views.FileList.as_view(), name='file-list'),\n url(r'^(?P<file_id>\\w+)/$', views.FileDetail.as_view(), name='file-detail'),\n url(r'^(... | python | edit | 1 | 0 | apache-2.0 | 9856361b48bb481f7913eaf69be668225c5bb818 | acshi/osf.io,aaxelb/osf.io,cslzchen/osf.io,felliott/osf.io,brandonPurvis/osf.io,wearpants/osf.io,Ghalko/osf.io,CenterForOpenScience/osf.io,cwisecarver/osf.io,abought/osf.io,TomBaxter/osf.io,SSJohns/osf.io,amyshi188/osf.io,GageGaskins/osf.io,laurenrevere/osf.io,erinspace/osf.io,DanielSBrown/osf.io,asanfilippo7/osf.io,co... | api/files/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport azurerm\nimport json\n\n# Load Azure app defaults\ntry:\n with open('azurermconfig.json') as configFile: \n configData = json.load(configFile)\nexcept FileNotFoundError:\n print(\"Error: Expecting vmssConfig.json in curre... | python | edit | 2 | 0 | mit | 73609d84871973449e2e4520fdeac027131d0e6d | gbowerman/azurerm | tests/list_pubs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nclass Test(unittest.TestCase):\n\n def setUp(self):\n self.seq = range(10)\n\n #def test_shuffle(self):\n # # make sure the shuffled sequence does not lose any elements\n # random.shuffle(self.seq... | python | edit | 1 | 2 | apache-2.0 | 751819ea58389eaa1baf3de243459be4948b15f1 | anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46 | rpc_client/rpc_client_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\ndef load(fp):\n sequences = []\n header = None\n curseq = ''\n for line in fp:\n if line.startswith('>'):\n if header and curseq:\n sequences.append({\n ... | python | edit | 1 | 8 | mit | 122507fb2c68a0d5734082bdc67ce7cf91293870 | hivdb/sierra-client | python/sierrapy/fastareader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\n\nfrom core.models import ConveneTime\nfrom legislators.models import Chamber\n\nimport requests\n\n\nclass Command(BaseCommand):\n help = u'Scrape TLO for convening times.'\n\n def... | python | edit | 1 | 1 | mit | 2f2f6cba331515b8d563d0e2f7869111df4227c3 | texastribune/txlege84,texastribune/txlege84,texastribune/txlege84,texastribune/txlege84 | txlege84/core/management/commands/updateconveningtimes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport multiprocessing\n\nfrom lobster.cmssw.plotting import Plotter\n\nlogger = multiprocessing.get_logger()\n\nclass DummyPlotter(object):\n def make_plots(*args, **kwargs):\n pass\n\nclass Actions(object):\n ... | python | edit | 1 | 3 | mit | 48f643b99c93fc10c042fe10e4a06c64df245d0d | matz-e/lobster,matz-e/lobster,matz-e/lobster | lobster/cmssw/actions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n## A quick script to fix the ridiculous format of the raw FAA download data (at least it's available though!)\n\nimport csv\n\n# MASTER.txt is from https://www.faa.gov/licenses_certificates/aircraft_certification/aircraft_registry/releasabl... | python | edit | 1 | 0 | apache-2.0 | e7e0b8b723382e7a187e02c6a3052dacefc84bbe | GISDev01/adsbpostgis | faaopendata/faa_data_cleaner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nversion = '1.3.0'\nmilestone = 'Chami'\nrelease_number = '4'\nprojectURL = 'http://syncplay.pl/'\n\n```\n\nApply this change: Increase release number to 5 (1.3.0 Beta 3a)"
},
{
"role": "assistant",
"content": "version = '1.3.0'\... | python | edit | 1 | 0 | apache-2.0 | d9f10a5ac329522f06f41cb52ed113b0703b87a1 | NeverDecaf/syncplay,alby128/syncplay,Syncplay/syncplay,Syncplay/syncplay,alby128/syncplay,NeverDecaf/syncplay | syncplay/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test of callback function."
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nfrom models import *\n\nclass SubscriptionTests(TestCase):\n\n @classmethod\n def setUpTestData(cls):\n sub = ... | python | new_file | 4 | 1 | mit | 1e5d68e8cbd592f1bd7535c74948f2bf5f95b4f1 | ast0815/mqtt-hub,ast0815/mqtt-hub | mqtt_logger/tests.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Track():\n artist = \"\"\n name = \"\"\n track_id = \"\"\n\n def __init__(self, artist, name, track_id=\"\"):\n self.artist = artist\n self.name = name\n self.track_id = track_id\n\n @staticmethod\n... | python | edit | 1 | 2 | apache-2.0 | 6d888061089648f2363f77f48fb7458a7ff16735 | rckclmbr/pyportify,rckclmbr/pyportify,rckclmbr/pyportify,rckclmbr/pyportify | pyportify/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import (ModelForm, CheckboxSelectMultiple,\n MultipleChoiceField)\n\nfrom .models import AuthorityElection, AuthorityElectionPosition\n\n\nclass AuthorityAreaForm(ModelForm):\n def __init__(self... | python | edit | 1 | 3 | bsd-3-clause | b0ae4cb386411ae8ae5fd27b19ddb415d0772cf3 | DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website | democracy_club/apps/everyelection/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Source Server Stats\n# File: sourcestats/collector/__main__.py\n# Desc: __main__ for the collector\n\nfrom gevent import monkey\nmonkey.patch_all()\n\nimport sys\nimport logging\n\nimport gevent\nfrom coloredlogs import ColoredStreamHandl... | python | edit | 2 | 0 | mit | 990de574769cf6b64dfc90128838e209af377ae0 | Fizzadar/SourceServerStats,Fizzadar/SourceServerStats,Fizzadar/SourceServerStats | sourcestats/collector/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport speech_recognition as sr\n\nr = sr.Recognizer()\nm = sr.Microphone()\n\nprint(\"A moment of silence, please...\")\nwith m as source:\n r.adjust_for_ambient_noise(source)\n print(\"Set minimum energy threshold to {}\".format(r.e... | python | edit | 1 | 0 | bsd-3-clause | 900f5fab722d32762b8a5fa214838f84b3fc376c | adrianzhang/speech_recognition,Python-Devs-Brasil/speech_recognition,Uberi/speech_recognition,Python-Devs-Brasil/speech_recognition,Zenohm/speech_recognition,jjsg/speech_recognition,Uberi/speech_recognition,adrianzhang/speech_recognition,Zenohm/speech_recognition,jjsg/speech_recognition,arvindch/speech_recognition,arvi... | speech_recognition/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom kivy.factory import Factory\n\nr = Factory.register\n\nr('StageTreeNode', module='moa.render.treerender')\nr('StageSimpleDisplay', module='moa.render.stage_simple')\n\n\n# --------------------- devices -----------------------------\nr(... | python | edit | 1 | 0 | mit | 61427695c0abb3c9385610a13c78cb21eec388d3 | matham/moa | moa/factory_registers.py | rejected_duplicate | Near-duplicate of sample 31 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport re\nimport requests\nimport socket\n\nimport settings\n\n\ndef get_responsible_user(full_url):\n members = settings.TEAM_MEMBERS\n response = requests.get(\n full_url,\n auth=(\n settings.J... | python | edit | 4 | 4 | mit | 71f00a03d6cbe4dc4d3cd2362ef91bd192a9a31e | mrteera/who-broke-build-slack,mrteera/who-broke-build-slack,zkan/who-broke-build-slack,prontodev/who-broke-build-slack,prontodev/who-broke-build-slack,zkan/who-broke-build-slack | who_broke_build.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom os import environ\n\nfrom eve import Eve\nfrom eve.io.mongo import Validator\n\nfrom settings import API_NAME, URL_PREFIX\n\n\nclass KeySchemaValidator(Validator):\n def _validate_keyschema(self, schema, field, dct):\n ... | python | edit | 1 | 2 | apache-2.0 | acfd2165c400b7318cea7c4e74db050968f9a123 | gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa | api.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 aafigure Sphinx extension.\n\nAllow embeded ASCII art figure to be rendered as nice images.\n'''\n\nrequires = ['Sphinx>=0.... | python | edit | 1 | 0 | bsd-2-clause | 1cc83f902fbfaaf571c15927aa633af361c47f78 | sphinx-contrib/spelling,sphinx-contrib/spelling | aafig/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tastypie import http\nfrom tastypie.authorization import Authorization\nfrom test_utils import RequestFactory\n\nfrom amo.tests import TestCase\nfrom mkt.api.base import MarketplaceResource\n\n\nclass TestMarketplace(TestCase):\n de... | python | edit | 1 | 1 | bsd-3-clause | 64f68922cce077716b9b8ec3de0a04ee31b7b7a9 | kumar303/addons-server,psiinon/addons-server,jasonthomas/zamboni,Witia1/olympia,Revanth47/addons-server,Joergen/zamboni,eviljeff/zamboni,jamesthechamp/zamboni,wagnerand/zamboni,clouserw/zamboni,wagnerand/zamboni,mstriemer/addons-server,diox/olympia,Hitechverma/zamboni,clouserw/zamboni,Nolski/olympia,mozilla/addons-serv... | mkt/api/tests/test_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\nfrom expire import expire as default_expire_func\n\n\n__all__ = ('BackupSimulator',)\n\n\ntry:\n from collections import OrderedDict # Python 2.7\nexcept ImportError:\n # Install from: http://pypi.pyt... | python | edit | 3 | 3 | bsd-2-clause | 36a2051e8f0c36923d93e172d453ce0e6fe18512 | jyrkij/tarsnapper | src/tarsnapper/test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mfhclient\nimport os\nimport Queue\nimport sys\nimport threading\nimport trigger\nimport update\n\n\ndef main():\n q = Queue.Queue()\n updateq = Queue.Queue()\n mfhclient_thread = threading.Thread(\n args=(q,),\n ... | python | edit | 1 | 2 | mit | 3f728b83eb407527588dd5a13a06cc5d1cd11df5 | Zloool/manyfaced-honeypot | mfh.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport os\nfrom tempfile import mkdtemp\nfrom shutil import rmtree\n\nfrom nipy.testing import *\nfrom sneeze import find_pkg, run_nose\n\nimport_strings = [\"from nipype.interfaces.afni import To3d\",\n \"from nipype.int... | python | edit | 3 | 3 | bsd-3-clause | f57f3a5a7abec6c9c6077c213cf29ef3fd9b4483 | yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD | tools/test_sneeze.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mimetypes\nimport posixpath\nimport urllib\n\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.contrib.staticfiles.views import serve as staticfiles_serve\nfrom django.http import... | python | edit | 1 | 6 | isc | fdb7617539d63cd3522c41489817eb841374f525 | juliomenendez/django-gears,juliomenendez/django-gears,wiserthanever/django-gears,juliomenendez/django-gears,gears/django-gears,juliomenendez/django-gears,wiserthanever/django-gears,gears/django-gears,wiserthanever/django-gears,wiserthanever/django-gears,gears/django-gears | django_gears/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Downloads the FITS files that are used in image testing and for building documentation.\n\n\n\"\"\"\n\nfrom astropy.utils.data import download_file\nfrom astropy.io import fits\n\n\ndef msx_hdu(cache=True):\n filename = download_fi... | python | edit | 1 | 1 | bsd-3-clause | ea748053152c048f9ac763a4fb6b97a1815082df | saimn/astropy,saimn/astropy,StuartLittlefair/astropy,dhomeier/astropy,astropy/astropy,stargaser/astropy,astropy/astropy,larrybradley/astropy,bsipocz/astropy,bsipocz/astropy,kelle/astropy,pllim/astropy,funbaker/astropy,dhomeier/astropy,mhvk/astropy,pllim/astropy,StuartLittlefair/astropy,astropy/astropy,dhomeier/astropy,... | wcsaxes/datasets/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom idea.models import State\n\ndef get_first_state():\n \"\"\" Get the first state for an idea. \"\"\"\n return State.objects.get(previous__isnull=True)\n\n```\n\nApply this change: Fix add_idea when multiple States have no previous... | python | edit | 1 | 1 | cc0-1.0 | bf307c6fa8c7259d49da2888f91d6bce9fc921cd | cfpb/idea-box,cfpb/idea-box,cfpb/idea-box | src/idea/utility/state_helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom aqt import mw\n\nfrom .main import ReadingManager\n\n__version__ = '4.3.1'\n\nmw.readingManager = ReadingManager()\n\n```\n\nApply this change: Remove version number from init"
},
{
"role": "assistant",
"content": "from aqt... | python | edit | 1 | 0 | isc | cf12d0560e8eaedae054c3276857be84c425a89c | luoliyan/incremental-reading-for-anki,luoliyan/incremental-reading-for-anki | ir/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\ndef scroll(clip, h=None, w=None, x_speed=0, y_speed=0,\n x_start=0, y_start=0, apply_to=\"mask\"):\n \"\"\" Scrolls horizontally or vertically a clip, e.g. to make end\n credits \"\"\"\n if h is ... | python | edit | 1 | 3 | mit | 0948e7a25e79b01dae3c5b6cf9b0c272e2d196b7 | Zulko/moviepy,ssteo/moviepy,kerstin/moviepy | moviepy/video/fx/scroll.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTest lldb 'process connect' command.\n\"\"\"\n\nimport os, time\nimport unittest2\nimport lldb\nfrom lldbtest import *\n\nclass ConnectRemoteTestCase(TestBase):\n\n mydir = \"connect_remote\"\n\n def test_connect_remote(self):... | python | edit | 6 | 1 | apache-2.0 | 88e7859d3cca4a07265fc831c3ef6952af3e3d70 | apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb | test/connect_remote/TestConnectRemote.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom likes.signals import likes_enabled_test, can_vote_test\nfrom likes.exceptions import LikesNotEnabledException, CannotVoteException\n\ndef _votes_enabled(obj):\n \"\"\"See if voting is enabled on the class. Made complicated because\n... | python | edit | 2 | 4 | bsd-3-clause | 9f13b732b68c62a90bbfd2f3fc9ad0c93d54f1e7 | sandow-digital/django-likes,just-work/django-likes,Afnarel/django-likes,Afnarel/django-likes,just-work/django-likes,chuck211991/django-likes,Afnarel/django-likes,sandow-digital/django-likes,chuck211991/django-likes,chuck211991/django-likes,just-work/django-likes | likes/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\n\nfrom dmutils import init_manager\n\nfrom app import create_app\n\napplication = create_app(os.getenv('DM_ENVIRONMENT') or 'development')\nmanager = init_manager(application, 5000, ['./json_schemas'])\n\... | python | edit | 1 | 1 | mit | e2962b3888a2a82cff8f0f01a213c0a123873f60 | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api | application.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom test_app.settings import *\n\nINSTALLED_APPS += (\"cmsplugin_rst\",)\n\n\n## DJANGO CMSPLUGIN RST CONF ##\n\nCMSPLUGIN_RST_WRITER_NAME = \"html4css1\"\n\nCMSPLUGIN_RST_CONTENT_PREFIX = \"\"\"\n\n.. |nbsp| unicode:: 0xA0 \n :trim:\n... | python | edit | 4 | 1 | bsd-3-clause | d51b9786b1cc72dd01549a8547f06efc27aab4c3 | pakal/cmsplugin-rst,ojii/cmsplugin-rst | tests/test_settings.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unidecode import unidecode\n\n\nclass Normalizer:\n\n def normalize(text):\n text = Normalizer.remove_extra_whitespaces(text)\n text = Normalizer.replace_hyphens(text)\n # text = Normalizer.remove_accent_marks(t... | python | edit | 1 | 1 | mit | 7c9fbdb62c6b045476064fd4193fd133ed0de7c3 | davidmogar/genderator | genderator/utils.py | rejected_duplicate | Near-duplicate of sample 877 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom model import BaseModel\n\nfrom feature import Feature, JSONFeature, TextFeature, CompressedFeature, \\\n PickleFeature\n\nfrom extractor import Node, Graph, Aggregator, NotEnoughData\n\nfrom bytestream import ByteStream, ByteStreamF... | python | edit | 30 | 0 | mit | 1a43628a42f249a69e0f8846ebbf88ef0af9bb9d | JohnVinyard/featureflow,JohnVinyard/featureflow | flow/__init__.py | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\"\"\"These tests have to be run separately from the main test suite (iptest),\nbecause that sets the default encoding to utf-8, and it cannot be changed after\nthe interpreter is up and running. The default encoding in a P... | python | edit | 2 | 4 | bsd-3-clause | 4ac6905ee4867c038f0574c9c14827164c10f6a6 | ipython/ipython,ipython/ipython | tools/unicode_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file... | python | edit | 1 | 0 | apache-2.0 | a39b1e480499c19eee1e7f341964f7c94d6cdbad | StackStorm/st2-auth-backend-ldap | st2auth_ldap_backend/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport networkx as nx\n\n\nclass ConnectedComponents:\n \"\"\"This is a class for connected component detection method to cluster event logs [1]_.\n\n References\n ----------\n .. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro,... | python | edit | 1 | 2 | mit | 78aabbc9c66bc92fdedec740e32ad9fbd9ee8937 | studiawan/pygraphc | pygraphc/clustering/ConnectedComponents.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom iotbx.xds.read_ascii import reader\nimport sys\nfor n, argv in enumerate(sys.argv[1:]):\n r = reader(open(argv))\n mas = r.as_miller_arrays(merge_equivalents = False)\n assert(len(mas) == 1)\n ma = mas[0].apply_scaling(targ... | python | edit | 2 | 0 | bsd-3-clause | 99609e3643c320484c7978440ffedd892f8bb088 | xia2/xia2,xia2/xia2 | Toolkit/PlayPen/xscale_2_hkl.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\nfrom django.contrib import admin\n\n\nclass IntegrationCredentialAdmin(admin.ModelAdmin):\n search_fields = (\"endpoint\",)\n list_display = (\"user\",... | python | edit | 1 | 0 | bsd-3-clause | cca106b4cb647e82838deb359cf6f9ef813992a9 | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/integrations/credentials/admin/integration_credential.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom osgeo import ogr\nfrom osgeo import osr\nfrom glob import glob\nimport os.path\n\ndriver = ogr.GetDriverByName(\"ESRI Shapefile\")\nds = driver.CreateDataSource(\"summary-maps/cutline-map.shp\")\n\nsrs = osr.Spat... | python | edit | 1 | 0 | mit | e09d60380f626502532e78494314f9ed97eca7c8 | simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic | build-cutline-map.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nimport ib_insync as ibi\n\npytestmark = pytest.mark.asyncio\n\n\nasync def test_request_error_raised(ib):\n contract = ibi.Stock('MMM', 'SMART', 'USD')\n order = ibi.MarketOrder('BUY', 100)\n orderState = await ib.... | python | edit | 1 | 2 | bsd-2-clause | 97cc8b9dd87d43e38d6ff2a20dc4cab2ffcc3d54 | erdewit/ib_insync,erdewit/ib_insync | tests/test_requests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom botornado.s3.bucket import AsyncBucket\nfrom botornado.s3.connection import AsyncS3Connection\nfrom botornado.s3.key import AsyncKey\n\nfrom thumbor_botornado.s3_loader import S3Loader\nfrom thumbor.loaders.http_loader import HttpLoade... | python | edit | 1 | 2 | mit | 53a1c2ccbd43a8fcb90d8d9b7814c8ed129c0635 | 99designs/thumbor_botornado,Jimdo/thumbor_botornado,99designs/thumbor_botornado,Jimdo/thumbor_botornado | thumbor_botornado/s3_http_loader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\n Wapiti does not provide ranking for the vulnerabilities it has found.\n This file tries to define a ranking for every vulnerability Wapiti might\n find.\n\n\"\"\"\n\n\nfrom libptp.constants import HIGH, MEDIUM, LOW, INFO... | python | edit | 1 | 0 | bsd-3-clause | e331e49d39b6e60f953a982c90f800cd07dfbc2d | DoomTaper/ptp,owtf/ptp | libptp/tools/wapiti/signatures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass DotDict(object):\n \"\"\"\n Immutable dict-like objects accessible by dot notation\n\n Used because the amount of configuration access is very high and just using\n dots instead of the dict notation feels good.\n\n \"\"... | python | edit | 1 | 3 | mit | be83b28d5a2dedd8caa39cfac57f398af69b2042 | thiderman/piper | piper/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom appconf import AppConf\nfrom django.conf import settings\n\n\nclass ImageKitConf(AppConf):\n CACHEFILE_NAMER = 'imagekit.cachefiles.namers.hash'\n SPEC_CACHEFILE_NAMER = 'imagekit.cachefiles.namers.source_name_as_path'\n CACHE... | python | edit | 1 | 5 | bsd-3-clause | 51dcf283fda1492d8e75da2c036848ab4149030d | tawanda/django-imagekit,FundedByMe/django-imagekit,tawanda/django-imagekit,FundedByMe/django-imagekit | imagekit/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nForms for the rdap_explorer project, query app.\n\"\"\"\n\nfrom django import forms\n\n\nclass QueryForm(forms.Form):\n query = forms.CharField(\n label='',\n max_length=45, # Max length of an IPv6 address.\n ... | python | edit | 1 | 0 | mit | 06bed92f55396c33a4f55c109fdb7871737fea7a | cdubz/rdap-explorer,cdubz/rdap-explorer | query/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n################################################################################\n# \"THE BEER-WARE LICENSE\" (Revision 42):\n# <thenoviceoof> wrote this file. As long as you retain this notice\n# you can do whatever you ... | python | edit | 3 | 1 | mit | a179b2afff8af8dce5ae816d6f97a002a9151cf4 | thenoviceoof/booger,thenoviceoof/booger | booger_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom TestStack.White.UIItems import TextBox\nfrom WhiteLibrary.keywords.librarycomponent import LibraryComponent\nfrom WhiteLibrary.keywords.robotlibcore import keyword\n\n\nclass TextBoxKeywords(LibraryComponent):\n @keyword\n def in... | python | edit | 1 | 1 | apache-2.0 | 00e4663940ed1d22e768b3de3d1c645c8649aecc | Omenia/robotframework-whitelibrary,Omenia/robotframework-whitelibrary | src/WhiteLibrary/keywords/items/textbox.py | rejected_duplicate | Near-duplicate of sample 3315 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import, unicode_literals\n\nimport abc\n\nfrom ._common import validate_null_string\nfrom ._six import add_metaclass\n\n\n@a... | python | edit | 1 | 2 | mit | 65731a34e152d085f55893c65607b8fa25dcfd63 | thombashi/pathvalidate | pathvalidate/_interface.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test the DigitalOcean backed ACME DNS Authentication Class.\"\"\"\n\nfrom acmednsauth.authenticate import Authenticate\nfrom mock import call\n\n\ndef test_valid_data_calls_digital_ocean_record_creation(\n mocker, api_key, host... | python | edit | 1 | 1 | apache-2.0 | 9ccdbcc01d1bf6323256b8b8f19fa1446bb57d59 | Jitsusama/lets-do-dns | tests/unit/test_authenticate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\nfrom .version import __version__\n\ntry:\n __ATRASU_SETUP__\nexcept:\n __ATRASU_SETUP__ = False\n\nif not __ATRASU_SETUP__:\n\tfrom . import spectra\n\tfrom . import setup_atmosphere\n\tfrom . import const... | python | edit | 9 | 0 | mit | 70c98a42326471d3ed615def61954905673c5972 | atmtools/typhon,atmtools/typhon | typhon/nonlte/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nExample program for the Stream API. This prints public status messages\nfrom the \"sample\" stream as fast as possible.\n\nUSAGE\n\n twitter-stream-example <username> <password>\n\n\"\"\"\n\nfrom __future__ import print_function\n\... | python | edit | 1 | 3 | mit | 95d498009eca0a9e179a14eec05e7e3738a72bfb | Adai0808/twitter,tytek2012/twitter,adonoho/twitter,miragshin/twitter,hugovk/twitter,sixohsix/twitter,jessamynsmith/twitter | twitter/stream_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport base\nimport getters\n\nALL_CLASSES= base.BaseIpGetter.__subclasses__()\nALL= [x() for x in ALL_CLASSES]\n\ndef get_ip():\n import random\n remaining= ALL[:]\n while remaining:\n getter= random.choice(remaining)\n ... | python | edit | 4 | 3 | bsd-3-clause | 0989089aa4e9766739359b57b2bd56e5b70fa53b | bkonkle/update-ip | update_ip/ip_getters/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport base64, os\n\ndef get_content(texts):\n\n if isinstance(texts, str) or isinstance(texts, unicode):\n file_path = texts\n with open(file_path, 'r') as f:\n return list(f.read().decode(\"utf-8\"))\n ... | python | edit | 2 | 3 | mit | 35d5dc83d8abc4e33988ebf26a6fafadf9b815d4 | eHanlin/font-generator,eHanlin/font-generator | fontGenerator/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: set ts=4 sw=4 et: coding=UTF-8\n\nfrom rpmsection import Section\n\n\nclass RpmBuild(Section):\n \"\"\"\n Replace various troublemakers in build phase\n \"\"\"\n\n def add(self, line):\n line = self._complete_c... | python | edit | 1 | 8 | bsd-3-clause | 053239698dcb0842a8c8fcc019092c65b7f436e7 | pombredanne/spec-cleaner,pombredanne/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner | spec_cleaner/rpmbuild.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ._overlap_wrapper import _computeOverlap\n\ndef compute_overlap(ilon, ilat, olon, olat, energy_mode=True, reference_area=1.):\n \"\"\"\n Compute the overlap between two 'pixels' in spherical coordinates\n \n Parameters\n ... | python | edit | 1 | 1 | bsd-3-clause | e1291e88e8d5cf1f50e9547fa78a4a53032cc89a | barentsen/reproject,astrofrog/reproject,barentsen/reproject,mwcraig/reproject,astrofrog/reproject,astrofrog/reproject,mwcraig/reproject,barentsen/reproject,bsipocz/reproject,bsipocz/reproject | reproject/overlap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom deuces.deuces import Card, Deck\nfrom convenience import who_wins\n\np1 = [Card.new('As'), Card.new('Ac')]\np2 = [Card.new('Ad'), Card.new('Kd')]\nwin_record = []\n\nfor i in range(100000):\n deck = Deck()\n b = []\n while len... | python | edit | 2 | 4 | mit | c43e6a69fa1391b5fd00a43628111f8d52ec8792 | zimolzak/poker-experiments,zimolzak/poker-experiments,zimolzak/poker-experiments | pct_vs_time.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass QuestionGroup(models.Model):\n heading = models.TextField()\n text = models.TextField(blank=True)\n date_added = models.DateTimeField(auto_now=True)\n date_modified = models.DateTimeField(... | python | edit | 1 | 1 | mit | 6bdcda14c8bd5b66bc6fcb4bb6a520e326211f74 | gabriel-v/psi,gabriel-v/psi,gabriel-v/psi | poll/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" Check density inversion QC test\n\"\"\"\n\nfrom numpy import ma\n\nfrom cotede.qctests import density_inversion\n\n\ndef test():\n dummy_data = {\n 'PRES': ma.masked_array([... | python | edit | 3 | 2 | bsd-3-clause | 82b517426804e9e6984317f4b3aa5bbda5e3dc5e | castelao/CoTeDe | tests/qctests/test_density_inversion.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport morepath\nimport jinja2\n\n\nclass Jinja2App(morepath.App):\n pass\n\n\n@Jinja2App.setting_section(section='jinja2')\ndef get_setting_section():\n return {\n 'auto_reload': False,\n 'autoescape': True,\... | python | edit | 1 | 1 | bsd-3-clause | 0292bf82de87483ec0391ecd580e93f42bf6a95b | morepath/more.jinja2 | more/jinja2/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.template import RequestContext, loader\nfrom django.conf import settings\nfrom django.core.exceptions import PermissionDenied\nfrom django.http import HttpResponseForbidden \n\n# A custom Http403 exce... | python | edit | 1 | 3 | mit | ad68b5f75bc58f467ba92be6b8835bad60bcbcd5 | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | common/http.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nl = [1, 2, 3, 4]\ns = set(l)\nouts = [s.difference(),\n s.difference({1}),\n s.difference({1}, [1, 2]),\n s.difference({1}, {1, 2}, {2, 3})]\nfor out in outs:\n print(sorted(out))\n\ns = set(l)\nprint(s.difference_up... | python | edit | 1 | 0 | mit | 443cc0114d7669471e39661c97e2bad91c8eabb8 | blazewicz/micropython,tobbad/micropython,tuc-osg/micropython,henriknelson/micropython,SHA2017-badge/micropython-esp32,cwyark/micropython,ryannathans/micropython,Timmenem/micropython,alex-robbins/micropython,PappaPeppar/micropython,dxxb/micropython,Peetz0r/micropython-esp32,jmarcelino/pycom-micropython,hiway/micropython... | tests/basics/set_difference.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport os\n\n'''\nSubmits a job for every sample defined in the info dict\n'''\n\nscript_path = \"/lustre/home/ekoch/code_repos/BaSiCs/Examples/THINGS/\"\n\nsubmit_file = os.path.join(script_path, \"submit_THINGS.pbs\")\n\n# Load in the i... | python | edit | 3 | 1 | mit | a6491e62201e070665020e8e123d1cd65fc2cca6 | e-koch/BaSiCs | Examples/THINGS/submit_all_THINGS.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThe data models\n\"\"\"\n\nclass Repository(object):\n def __init__(self, base_url, identifier):\n self.base_url = base_url\n self.identifier = identifier\n\nclass GitObject(object):\n def __init__(self, sha1):\n... | python | edit | 1 | 1 | mit | 8db9ab08725ebbdb3a9b5a70b1f8071433b01a04 | ebroder/anygit,ebroder/anygit | data/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport binascii\n\nfrom cryptography.hazmat.backends import default_backend\nfrom cryptography.hazmat.primitives import hashes\nfrom OpenSSL.rand import bytes as generate_bytes\n\nfrom knox.settings import knox_settings, CONSTANTS\n\nsha = ... | python | edit | 1 | 1 | mit | ade69178edac1d4d73dedee0ad933d4106e22c82 | James1345/django-rest-knox,James1345/django-rest-knox | knox/crypto.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys, operator, string\n\ndef characters(filename):\n for line in open(filename):\n for c in line:\n yield c\n\ndef all_words(filename):\n start_char = True\n for c in characters(filen... | python | edit | 3 | 5 | mit | 9a4afbab2aded6e6e0ad1088f8cc2d92cfd7684a | alex-quiterio/exercises-in-programming-style,alex-quiterio/exercises-in-programming-style,alex-quiterio/exercises-in-programming-style,alex-quiterio/exercises-in-programming-style,alex-quiterio/exercises-in-programming-style | 26-lazy-rivers/tf-26.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom seed_stage_based_messaging.settings import * # flake8: noqa\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = 'TESTSEKRET'\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG =... | python | edit | 2 | 0 | bsd-3-clause | a33ccab017bd6dfab03e12242c7e1306b47b2bed | praekelt/seed-stage-based-messaging,praekelt/seed-stage-based-messaging,praekelt/seed-staged-based-messaging | seed_stage_based_messaging/testsettings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pkg_resources\n\nversion = pkg_resources.require(__name__)[0].version\n\ndef greet(name='World'):\n print \"Hi, %s! -- from version %s of %s\" % (name, version, __name__)\n\n```\n\nApply this change: Allow 'hello' test package to ... | python | edit | 2 | 1 | apache-2.0 | 9f76a0a673b83b2de6a5f8a37b0628796da4a88c | comoyo/python-transmute | tests/hello/hello/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom detectem.core import MATCHERS\nfrom detectem.plugin import load_plugins, GenericPlugin\nfrom .utils import create_har_entry\n\n\nclass TestGenericPlugin(object):\n @pytest.fixture\n def plugins(self):\n re... | python | edit | 1 | 1 | mit | 8d5ac7efd98426394040fb01f0096f35a804b1b7 | spectresearch/detectem | tests/plugins/test_generic.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.