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#!/usr/bin/env python\nimport os\nimport sys\n\nfrom serfclient import __version__\n\ntry:\n from setuptools import setup\n from setuptools.command.test import test as TestCommand\n\n class PyTest(TestCommand):\n def finaliz... | python | edit | 1 | 1 | mit | a620066a23f21b8a736cae0238dfa3ee8549e3a7 | charleswhchan/serfclient-py,KushalP/serfclient-py | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nsetup(\n name=\"xutils\",\n version=\"0.8\",\n description=\"A Fragmentary Python Library.\",\n author=\"xgfone\",\n author_... | python | edit | 1 | 0 | mit | 179e72db3d95a41d53ebd019a5cb698a7767eb45 | xgfone/xutils,xgfone/pycom | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#coding: utf-8\nfrom cms import VERSION\n\nfrom setuptools import setup, find_packages\n\n\nEXCLUDE_FROM_PACKAGES = ['cms.bin']\n\nsetup(\n name=\"onespacemedia-cms\",\n version=\".\".join(str(n) for n in VERSIO... | python | edit | 1 | 0 | bsd-3-clause | 825ab4f2a26e7a5c4348f1adfa8e5163013e43f7 | jamesfoley/cms,danielsamuels/cms,lewiscollard/cms,danielsamuels/cms,lewiscollard/cms,dan-gamble/cms,lewiscollard/cms,dan-gamble/cms,jamesfoley/cms,danielsamuels/cms,dan-gamble/cms,jamesfoley/cms,jamesfoley/cms | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom setuptools import setup\n\n\nURL_BASE = 'https://github.com/astropy/astropy-tools/'\n\n\nsetup(\n name='astropy-tools',\n version='0.0.0.dev0',\n author='The Astropy Developers',\n author_email='<EM... | python | edit | 1 | 0 | bsd-3-clause | 2df022622348c568bfb2620dfa2b9803de3ca2d5 | astropy/astropy-tools,astropy/astropy-tools | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\n\nsetup(\n name='tangled.mako',\n version='0.1a3.dev0',\n description='Tangled Mako integration',\n long_description=open('README.rst').read(),\n url='http://tangledframework.org/',\n downlo... | python | edit | 1 | 0 | mit | fea6c5e84104b320c3d9475e59f7cf8625339a29 | TangledWeb/tangled.mako | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nREPO_URL = 'http://github.com/okfn-brasil/serenata-toolbox'\n\n\nsetup(\n author='Serenata de Amor',\n author_email='<EMAIL>',\n classifiers=[\n 'Development Status :: 4 - Beta',\n 'Int... | python | edit | 1 | 0 | mit | fec10deb7670abb2b0daf72c80ebdcc6346e0545 | datasciencebr/serenata-toolbox | setup.py | rejected_duplicate | Near-duplicate of sample 5111 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name = 'plumbing',\n version = '2.9.9',\n description = 'Helps with plumbing-type programing in python.',\n license = 'MIT',\n url ... | python | edit | 1 | 0 | mit | 0e4abdd8ab8ced760dbd2eb2c39afd8e88e4e87f | xapple/plumbing | setup.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\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nlong_description = \"\"\"\nDjango URL routing system DRYed.\n\"\"\"\n\n\nrequirements =... | python | edit | 1 | 0 | bsd-3-clause | ae290af846848a63b85e3832d694de6c5c25a4dc | Visgean/urljects | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup\n\nsetup(\n name='yg.emanate',\n use_scm_version=True,\n description=\"Lightweight event system for Python\",\n author=\"YouGov, plc\",\n author_e... | python | edit | 1 | 0 | mit | 82da444753249df9bbd4c516a7b1f9f5a4a7a29a | yougov/emanate | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\nCompute the force of gravity between the Earth and Sun.\n\nCopyright 2012, Casey W. Stark. See LICENSE.txt for more information.\n\n\"\"\"\n\n# Import the gravitational constant and the Quantity class\nfrom dimensionful import G, ... | python | edit | 4 | 0 | bsd-2-clause | 29cb760030021f97906d5eaec1c0b885e8bb2930 | caseywstark/dimensionful | example/gravity.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nimport transip\n\nsetup(\n name = transip.__name__,\n version = transip.__version__,\n author = transip.__author__,\n author_email = transip.__email__,\n license = transip.__license__,\n des... | python | edit | 1 | 0 | mit | 6a07e4b3b0c67c442f0501f19c0253b4c99637cd | benkonrath/transip-api,benkonrath/transip-api | setup.py | rejected_duplicate | Near-duplicate of sample 5190 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\nimport dynamodb_sessions\n\nlong_description = open('README.rst').read()\n\nmajor_ver, minor_ver = dynamodb_sessions.__version__\nversion_str = '%d.%d' % (major_ver, minor_ver)\n\nsetup(\n nam... | python | edit | 1 | 0 | bsd-3-clause | 86a35469dd474d09457d31fe6b74a2904e0a8091 | gtaylor/django-dynamodb-sessions | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import find_packages, setup\n\nfrom virtualenvapi import __version__\n\nsetup(\n name='virtualenv-api',\n version=__version__,\n license='BSD',\n author='Sam Kingston and AUTHORS',\n author_email='<EMAIL>',\n ... | python | edit | 1 | 0 | bsd-2-clause | 5145e5cfccaef99be1fd7c1240e289ab132a858b | sjkingo/virtualenv-api | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom oddt import __version__ as VERSION\n\nsetup(name='oddt',\n version=VERSION,\n description='Open Drug Discovery Toolkit',\n author='Maciej Wojcikowski',\... | python | edit | 1 | 0 | bsd-3-clause | 76127c6c7e0ae1271dfecd2a10efd2ccd6148f97 | oddt/oddt,oddt/oddt,mkukielka/oddt,mkukielka/oddt | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Setup script of zinnia-theme-html5\"\"\"\nfrom setuptools import setup\nfrom setuptools import find_packages\n\nimport zinnia_html5\n\nsetup(\n name='zinnia-theme-html5',\n version=zinnia_html5.__version__,\n\n description='H... | python | edit | 1 | 0 | bsd-3-clause | adc4575d7261c3047f88e62695445d2a70de4823 | django-blog-zinnia/zinnia-theme-html5 | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\n# Dynamically calculate the version based on dbsettings.VERSION\nversion_tuple = (0, 7, None)\nif version_tuple[2] is not None:\n if type(version_tuple[2]) == int:\n version = \"%d.%d... | python | edit | 1 | 0 | bsd-3-clause | 46a715545e70e04cd56f97ac8d14f325b4439554 | winfieldco/django-dbsettings,DjangoAdminHackers/django-dbsettings,nwaxiomatic/django-dbsettings,zlorf/django-dbsettings,sciyoshi/django-dbsettings,sciyoshi/django-dbsettings,johnpaulett/django-dbsettings,nwaxiomatic/django-dbsettings,johnpaulett/django-dbsettings,winfieldco/django-dbsettings,zlorf/django-dbsettings,hel... | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nCreate wordcloud with Arabic\n===============\nGenerating a wordcloud from Arabic text\nOther dependencies: bidi.algorithm, arabic_reshaper\n\"\"\"\n\nfrom os import path\nimport codecs\nfrom wordcloud import ... | python | edit | 1 | 0 | mit | 9c7aedc3b29d823d79409c5246290362a3c7ffdc | amueller/word_cloud | examples/arabic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n # Try using ez_setup to install setuptools if not already installed.\n from ez_setup import use_setuptools\n use_setuptools()\nexcept ImportError:\n # Ignore import error and assume Python 3 which already has setuptools.\... | python | edit | 1 | 2 | mit | 6a7ba2d366424d50b75dd97748c3a94aae96b7dd | chrisb2/pi_ina219 | setup.py | rejected_duplicate | Near-duplicate of sample 11752 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom setuptools import setup\ndependency_links=[\n 'git+https://github.com/Toblerity/Shapely.git@maint#egg=Shapely',\n]\n\nsetup(\n name = 'hxl-proxy',\n packages = ['hxl_proxy'],\n version = '0.0.1',\n d... | python | edit | 1 | 0 | unlicense | d16267549323c583df7aaf82768b7efef17df564 | HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\nimport sys, os\n\nhere = os.path.abspath(os.path.dirname(__file__))\ntry:\n README = open(os.path.join(here, 'README.rst')).read()\nexcept IOError:\n README = ''\n\nversion = \"0.0.2\"\n\ns... | python | edit | 3 | 0 | mit | ac73d93b5a29f4f0929551c51da837b45227f3b3 | TurboGears/backlash,TurboGears/backlash | setup.py | rejected_duplicate | Near-duplicate of sample 11085 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Config for PyPI.\"\"\"\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\n\nsetup(\n author='Kyle P. Johnson',\n author_email='<EMAIL>',\n classifiers=[\n 'Intended Audience :: Education',\n ... | python | edit | 1 | 0 | mit | ea0094c555b499a2ad77c8b7af02d796dd5b4d92 | kylepjohnson/cltk,LBenzahia/cltk,TylerKirby/cltk,diyclassics/cltk,LBenzahia/cltk,TylerKirby/cltk,D-K-E/cltk,cltk/cltk | setup.py | rejected_duplicate | Near-duplicate of sample 4589 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\nfrom setuptools import setup\n\nsetup(\n name=\"Cetacean\",\n version=\"0.0.1\",\n author=\"Ben Hamill\",\n author_email=\"<EMAIL>\",\n url=\"http://github.com/benhamill/cetacean-python#readme\",\n lic... | python | edit | 1 | 0 | mit | 89abf161e670fda99497ecc60aac0df239af5a01 | benhamill/cetacean-python,nanorepublica/cetacean-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nPUPPETDB_HOST = 'localhost'\nPUPPETDB_PORT = 8080\nPUPPETDB_SSL_VERIFY = True\nPUPPETDB_KEY = None\nPUPPETDB_CERT = None\nPUPPETDB_TIMEOUT = 20\nDEFAULT_ENVIRONMENT = 'production'\nSECRET_KEY = os.urandom(24)\nDEV_LISTEN_HOST =... | python | edit | 1 | 0 | apache-2.0 | 596e850189e8c8590ac4b8c401de5930ce711929 | puppet-community/puppetboard,johnzimm/xx-puppetboard,tparkercbn/puppetboard,mterzo/puppetboard,stoyansbg/puppetboard,mterzo/puppetboard,holstvoogd/puppetboard,johnzimm/xx-puppetboard,johnzimm/puppetboard,tparkercbn/puppetboard,mterzo/puppetboard,stoyansbg/puppetboard,james-powis/puppetboard,tparkercbn/puppetboard,voxpu... | puppetboard/default_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf8 -*-\nfrom setuptools import setup, find_packages\n\nsetup(\n name=\"Burger\",\n packages=find_packages(),\n version=\"0.3.0\",\n description=\"Extract information from Minecraft bytecode... | python | edit | 1 | 0 | mit | fdff962aeb1aa0351fc222e005af3fa9248345fb | Pokechu22/Burger,mcdevs/Burger | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(name='s3fs',\n version='0.1.5',\n classifiers=[\n 'Development Status :: 4 - Beta',\n 'Intended Audience :: Developers',\n 'License ::... | python | edit | 1 | 0 | bsd-3-clause | 3d1e06c6b37431ed4f6c9d426b10682be4ddc5db | fsspec/s3fs | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\nimport sys\nimport os\nimport re\n\nPACKAGENAME = 'OpSimSummary'\npackageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n PACKAGENAME)\nversionFile = os.path.join(pa... | python | edit | 3 | 0 | mit | 655db4e1c8aefea1699516339dd80e1c6a75d67d | rbiswas4/simlib | setup.py | rejected_duplicate | Near-duplicate of sample 1248 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nimport materializecssform\n\nsetup(\n\n name='django-materializecss-form',\n\n version=materializecssform.__version__,\n\n packages=fi... | python | edit | 1 | 0 | mit | 290ead5bbc57e526f0fe12d161fa5fb684ab4edf | florent1933/django-materializecss-form,florent1933/django-materializecss-form | setup.py | rejected_duplicate | Near-duplicate of sample 5112 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding:utf-8\n\nimport sys\nfrom setuptools import setup, find_packages\n\n\nsetup(name='flanker',\n version='0.3.13',\n description='Mailgun Parsing Tools',\n long_description=open('README.rst').read(),\n classifiers=... | python | edit | 3 | 0 | apache-2.0 | 0579da9a2cc9b8696d8071c4f1e07140d940b386 | ad-m/flanker,EthanBlackburn/flanker,glyph/flanker,alex/flanker,aroberts/flanker,nylas/flanker,EncircleInc/addresslib,mailgun/flanker,xjzhou/flanker,smokymountains/flanker,stefanw/flanker | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport io\nimport os\nimport re\nfrom setuptools import setup, find_packages\n\n\ndef find_version():\n file_dir = os.path.dirname(__file__)\n with io.open(os.path.join(file_dir, 'auth0', '__init__.py')) as f:\n version = re.se... | python | edit | 1 | 2 | mit | cc9d23142be989662c8fedd0124fe6f99de360bb | auth0/auth0-python,auth0/auth0-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom invoke import task\n\n\n@task\ndef clean(context):\n context.run(\"rm -rf .coverage dist build\")\n\n\n@task(clean, default=True)\ndef test(context):\n context.run(\"pytest\")\n\n\n@task(test)\ndef inst... | python | edit | 1 | 1 | apache-2.0 | f607cf2f024c299953a0d3eb523b6be493792d0f | miso-belica/sumy,miso-belica/sumy | tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom subprocess import call\nimport os\nfrom os.path import join, getsize\n\n\nwikiHtml = \"/var/www/sp/wiki-html\"\nLOwikiHtml = \"/var/www/sp/5-libre-wiki-html\"\nwikiFiles = \"/var/www/sp/6-wiki-files\"\n\nfor f in o... | python | edit | 2 | 0 | mit | a22b21e4a06525f081c6a7ce92ddc2102d7ddce8 | jamesmontalvo3/Sharepoint-to-MediaWiki,jamesmontalvo3/Sharepoint-to-MediaWiki | 5-convert-to-mw.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport setuptools\nimport sys\n\nif not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)\n or sys.version_info.major > 3):\n exit(\"Sorry, Python's version must be later than 3.5.\")\n\nimport shak... | python | edit | 1 | 0 | unlicense | 853481c6c6f6c27e8805c62b77bd85bec0f1535c | raviqqe/shakyo | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.core.urlresolvers import RegexURLResolver, RegexURLPattern\nfrom django.utils.module_loading import import_string\nfrom rest_framework.views import APIView\nfrom rest_framework_docs.api_endpoint... | python | edit | 1 | 7 | bsd-2-clause | b85a92df83563e38b84340574cde2f9dc06b563c | ekonstantinidis/django-rest-framework-docs,manosim/django-rest-framework-docs,ekonstantinidis/django-rest-framework-docs,manosim/django-rest-framework-docs,manosim/django-rest-framework-docs,ekonstantinidis/django-rest-framework-docs | rest_framework_docs/api_docs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport json\n\nfrom flask import Flask, render_template\n\n\ndef channels_json(station, escaped=False):\n channels = [{\"name\": channel} for channel in station.channels()]\n jsonbody = json.dumps(channels)\n if escaped:... | python | edit | 3 | 3 | mit | d7133922de24c6553417eb1e25c65bb51e7451f7 | richo/airship,richo/airship,richo/airship | airship/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom alexia.apps.organization.models import Organization\n\n\ndef organization(request):\n return {\n 'organizations': Organization.objects.all(),\n 'current_organization': request... | python | edit | 1 | 4 | bsd-3-clause | 23c29c4964286fc2ca8fb3a957a6e7810edb9d17 | Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia | alexia/template/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tornado.options\nfrom twiggy import *\n\n\ndef twiggy_setup():\n fout = outputs.FileOutput(\n tornado.options.options.app_log_file, format=formats.line_format)\n sout = outputs.StreamOutput(format=formats.line_format)\n\... | python | edit | 9 | 1 | mit | 9c119ec89b79d27b284bb89f2507cc93f32d8d68 | jiffyclub/ipythonblocks.org,jiffyclub/ipythonblocks.org | app/twiggy_setup.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\n\nfrom prompt_toolkit import prompt\nfrom prompt_toolkit.history import InMemoryHistory\nfrom prompt_toolkit.layout.lexers import PygmentsLexer\nfrom prompt_toolkit.styles.from_pygments import style_from_pygments\nfrom pygment... | python | edit | 1 | 6 | mit | c5683cb2bf8635c6ad26aac807f47c8f1fb4c68a | eliangcs/http-prompt,Yegorov/http-prompt | http_prompt/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/urs/local/bin/python3\n# Python challenge - 4\n# http://www.pythonchallenge.com/pc/def/linkedlist.php\n\nimport urllib.request\nimport re\n\n\ndef main():\n '''\n http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345\n... | python | edit | 1 | 4 | mit | b6c8dd224279ad0258b1130f8105059affa7553f | HKuz/PythonChallenge | Challenges/chall_04.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Stock:\n def __init__(self, symbol):\n self.symbol = symbol\n self.price_history = []\n\n @property\n def price(self):\n return self.price_history[-1] if self.price_history else None\n\n def update(sel... | python | edit | 1 | 2 | mit | 3736d7fb32e20a64591f949d6ff431430447d421 | bsmukasa/stock_alerter | stock.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework.pagination import PageNumberPagination\n\n\nclass BluebottlePagination(PageNumberPagination):\n page_size = 10\n\n```\n\nApply this change: Make it possible to send a page_size parameter to all paged endpoints.\n\nBB-... | python | edit | 1 | 0 | bsd-3-clause | b7b67a0327feddc977a404178aae03e47947dd20 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/bluebottle_drf2/pagination.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom snorkel.models import Span, Label\nfrom sqlalchemy.orm.exc import NoResultFound\n\n\ndef add_spouse_label(session, key, cls, person1, person2, value):\n try:\n person1 = session.query(Span).filter(Span.stable_id == person1).o... | python | edit | 1 | 5 | apache-2.0 | 8ed4d09a9e0c0e16f179185cd3d0e6f2dece360d | HazyResearch/snorkel,HazyResearch/snorkel,jasontlam/snorkel,jasontlam/snorkel,jasontlam/snorkel,HazyResearch/snorkel | tutorials/intro/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport socket\nfrom . import packet\n\nBLOCKSIZE = 4096\n\ndef connect(host, port, connect=socket.create_connection):\n sock = connect((host, port))\n def tx(pack):\n sock.send(packet.encode(pack))\n def rx():\n buf =... | python | edit | 1 | 3 | mit | fba44cbf5f2cf0740e1579d70e79da4ab7d57aa0 | prophile/libdiana | diana/socket.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom data_importers.management.commands import BaseXpressDemocracyClubCsvImporter\nfrom pathlib import Path\n\n\ndef make_base_folder_path():\n base_folder_path = Path.cwd() / Path(\"test_data/pollingstations_data/EXE\")\n return str(... | python | edit | 1 | 1 | bsd-3-clause | d675dbcab18d56ae4c2c2f05d342159c1032b7b4 | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/data_importers/management/commands/import_fake_exeter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom hvad.contrib.restframework import TranslatableModelSerializer\nfrom rest_framework import serializers\nfrom rest_framework.reverse import reverse\n\nfrom .models import Category, TargetGroup, TargetAge, Event\nfrom pagoeta.apps.core.fu... | python | edit | 5 | 1 | mit | 7f212a9bacfce6612c6ec435174bf9c3eddd4652 | zarautz/pagoeta,zarautz/pagoeta,zarautz/pagoeta | pagoeta/apps/events/serializers.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Centralized logging setup\n#\n\nimport os\nimport logging\n\nfrom .utils import getLogger\nl = getLogger('backend')\n\nlogging.basicConfig(\n level=logging.DEBUG,\n format='[%(asctime)s][%(levelname)s] %(name)s '\n '%(f... | python | edit | 1 | 0 | mit | 1f5c196796d8f10bc19260c2d353d880b6147be7 | The-Fonz/adventure-track,The-Fonz/adventure-track,The-Fonz/adventure-track | backend/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('portal', '0007_add_precomputed_rna_table'),\n ]\n\n operations = [\n ... | python | edit | 1 | 0 | apache-2.0 | 9249f1f2fce010cb0378080b5b7fef55235eefea | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | rnacentral/portal/migrations/0010_add_precomputed_rna_type.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" This module is now vestigial. \"\"\"\n\nimport sys, Pmw\n\n# This is required by the ihooks.py module used by Squeeze (used by\n# pandaSqueezer.py) so that Pmw initializes properly\nif '_Pmw' in sys.modules:\n sys.modules['_Pmw']... | python | edit | 5 | 1 | bsd-3-clause | 388c938c0604bbf432921ad46be8325b1e74fa4a | ee08b397/panda3d,hj3938/panda3d,mgracer48/panda3d,chandler14362/panda3d,grimfang/panda3d,mgracer48/panda3d,chandler14362/panda3d,brakhane/panda3d,chandler14362/panda3d,cc272309126/panda3d,grimfang/panda3d,matthiascy/panda3d,mgracer48/panda3d,chandler14362/panda3d,Wilee999/panda3d,ee08b397/panda3d,jjkoletar/panda3d,jjko... | direct/src/showbase/TkGlobal.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2\n################################################################################\n# broadcast_any_song.py\n#\n# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an\n# audio file matching a que... | python | edit | 1 | 0 | mit | 43434cc8efa52b56a64d52076b3760131456c34c | ryanmjacobs/ryans_dotfiles,ryanmjacobs/ryans_dotfiles | .bin/broadcast_any_song.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pelican import signals\nfrom .mdx_liquid_tags import LiquidTags, LT_CONFIG\n\n\ndef addLiquidTags(gen):\n if not gen.settings.get('MD_EXTENSIONS'):\n from pelican.settings import DEFAULT_CONFIG\n gen.settings['MD_EXTEN... | python | edit | 1 | 6 | apache-2.0 | 80857a9f30b3e6773a658bf8ce93809c0881f80a | danielfrg/danielfrg.github.io-source,danielfrg/danielfrg.github.io-source,danielfrg/danielfrg.github.io-source | plugins/liquid_tags/liquid_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.db import models\n\n\nclass Weekday(models.Model):\n \"\"\"Model representing the day of the week.\"\"\"\n\n name = models.CharField(max_length=60, unique=True)\n\n def clean(s... | python | edit | 1 | 1 | mit | edd4f01065b7bac6c7400d8c1496375fbe0a9aa5 | teamtaverna/core | app/timetables/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport threading\n\n\ndef pytest_exception_interact(node, call, report):\n \"\"\"\n Drop into PyCharm debugger, if available, on uncaught exceptions.\n \"\"\"\n try:\n import pydevd\n from ... | python | edit | 1 | 7 | bsd-3-clause | 5681e5ee342ee4660e634a2081d499940a3b0d3f | jlubcke/pytest-pycharm | pytest_pycharm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n__version__ = '1.0.0'\n__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']\n\nfrom .application_master import ApplicationMaster\nfrom .history_server import HistoryServer\nfrom .node_m... | python | edit | 1 | 0 | bsd-3-clause | e773239cbf0adee5ca192c10dba14d35275040ff | toidi/hadoop-yarn-api-python-client | yarn_api_client/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\n__version__ = '1.8.0'\n\n```\n\nApply this change: Switch back to dev version\n\nSigned-off-by: Joffrey F <<EMAIL>>"
},
{
"role": "assistant",
"c... | python | edit | 1 | 0 | apache-2.0 | 6ab0607e6182f7c4dec55b6318ab07af746e7c89 | thaJeztah/compose,shin-/compose,andrewgee/compose,thaJeztah/compose,shin-/compose,michael-k/docker-compose,sdurrheimer/compose,dnephin/compose,hoogenm/compose,andrewgee/compose,dbdd4us/compose,swoopla/compose,hoogenm/compose,swoopla/compose,jrabbit/compose,schmunk42/compose,schmunk42/compose,funkyfuture/docker-compose,... | compose/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\n\n\ndef cached_property(f):\n name = f.__name__\n @property\n @wraps(f)\n def inner(self):\n if not hasattr(self, \"_property_cache\"):\n self._property_cache = {}\n if name ... | python | edit | 1 | 3 | unlicense | d2076f6fd3a0bb687224048de904207c885aba5c | drkitty/python3-base,drkitty/python3-base | utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n\nfrom django.db import models\n\nfrom django.contrib.auth.models import User\n\n\n\nclass BadgeAward(models.Model):\n user = models.ForeignKey(User, related_name=\"badges_earned\")\n awarded_at = models... | python | edit | 3 | 1 | bsd-3-clause | 72de9e47015e2018ca13c6d4681a79e53c2d5475 | kinsights/brabeion | brabeion/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\n\nfrom settings import ADMIN_BASE\n\nfrom . import views\n\nbase_pattern = '^{}'.format(ADMIN_BASE)\n\nurlpatterns = [\n ### ADMIN ###\n url(\n base_p... | python | edit | 1 | 0 | apache-2.0 | deb5a6c45d6f52daef7ca5752f574d7c14abbc47 | mattclark/osf.io,caseyrollins/osf.io,aaxelb/osf.io,icereval/osf.io,felliott/osf.io,cwisecarver/osf.io,adlius/osf.io,crcresearch/osf.io,caneruguz/osf.io,cslzchen/osf.io,pattisdr/osf.io,leb2dg/osf.io,mattclark/osf.io,mfraezz/osf.io,caseyrollins/osf.io,baylee-d/osf.io,chrisseto/osf.io,saradbowman/osf.io,brianjgeiger/osf.i... | admin/base/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n# pylint: disable=W0401,W0614\n\n\nfrom telemetry.page import page as page_... | python | edit | 1 | 2 | bsd-3-clause | 6eea9e787107a83be36b03d93cddfe7fdf1e9e05 | HalCanary/skia-hc,samuelig/skia,noselhq/skia,spezi77/android_external_skia,w3nd1go/android_external_skia,geekboxzone/mmallow_external_skia,YUPlayGodDev/platform_external_skia,AOSP-YU/platform_external_skia,PAC-ROM/android_external_skia,Infinitive-OS/platform_external_skia,UBERMALLOW/external_skia,scroggo/skia,AOSPB/ext... | tools/skp/page_sets/skia_amazon_desktop.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom generator.helper import Helper\n\n\nclass TestHelper(unittest.TestCase):\n \n def test_parse_definition_string(self):\n data = ' * @var FooClass | BarClass '\n class_list = Helper.parse_definition_... | python | edit | 1 | 1 | apache-2.0 | 7f690132df6672978990589dd584f2101f592389 | HappyRay/php-di-generator | tests/test_helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport errno\nimport os\nimport socket\n\nfrom contextlib import closing\n\nimport plumbum\n\n\n# http://stackoverflow.com/a/166589\n# Create a UDP socket to the internet at large to get our routed IP\ndef get_routed_ip():\n with closing... | python | edit | 1 | 4 | mit | 07f2de7775cd73e220bebe3d6ea8cfe5604de174 | liffiton/ATLeS,liffiton/ATLeS,liffiton/ATLeS,liffiton/ATLeS | utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\nfrom app.chess.chess import Chess\nimport unittest\n\n\nclass TestBuildChess(unittest.TestCase):\n \"\"\"\n `TestBuildChess()` class is unit-testing the class\n Chess().\n \"\"\"\n\n # ///////////... | python | edit | 1 | 1 | mit | bf8ddb49a1043f399a210e05e66e2db4d815cc22 | aymguesmi/ChessChallenge | tests/test_build_chess.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2012 Cloudbase Solutions Srl\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# ... | python | edit | 1 | 2 | apache-2.0 | c8af52e91eb5ea40090a4b303e147c2d5d6cf28a | chialiang-8/cloudbase-init,stackforge/cloudbase-init,openstack/cloudbase-init,stefan-caraiman/cloudbase-init,cmin764/cloudbase-init,alexpilotti/cloudbase-init,ader1990/cloudbase-init | cloudbaseinit/shell.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom numba import d\nfrom numba.decorators import jit as jit\n\ndef sum2d(arr):\n M, N = arr.shape\n result = 0.0\n for i in range(M):\n for j in range(N):\n result += arr[i,j]\n return result\n\ncsum2d = jit(r... | python | edit | 4 | 3 | bsd-2-clause | 30261101fada94b4bd5df0f9c4506a4ac4dd1063 | stonebig/numba,seibert/numba,seibert/numba,stefanseefeld/numba,jriehl/numba,ssarangi/numba,IntelLabs/numba,GaZ3ll3/numba,pombredanne/numba,stuartarchibald/numba,gdementen/numba,numba/numba,IntelLabs/numba,stuartarchibald/numba,pitrou/numba,gdementen/numba,cpcloud/numba,stefanseefeld/numba,GaZ3ll3/numba,cpcloud/numba,ss... | examples/sum.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis file serves as a hook into virtualenvs that do NOT have sitetools\ninstalled.\n\nIt is added to the $PYTHONPATH by the `dev` command so that new virtualenvs\ncan refer to the sitetools from the old virtualenv.\n\nIt tries to pl... | python | edit | 3 | 0 | bsd-3-clause | 33e40319b5d670c3fa1a1423bf7eed1865115d5c | westernx/sitetools,westernx/sitetools,mikeboers/sitetools | sitetools/venv_hook/sitecustomize.py | rejected_duplicate | Near-duplicate of sample 13574 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom thinglang.lexer.lexical_token import LexicalToken\nfrom thinglang.utils.type_descriptors import ValueType\n\n\nclass InlineCode(LexicalToken, ValueType):\n \"\"\"\n Represents inline C++ code\n \"\"\"\n\n STATIC = True\n\n ... | python | edit | 1 | 1 | mit | d97d9294bf470c6e95958b0dc51391830c56a7b3 | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/parser/values/inline_code.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport avro.protocol\nimport tornado.web\nimport tornado.ioloop\n\nimport tornavro.server\nimport tornavro.responder\n\n\nclass HelloResponder(tornavro.responder.Responder):\n def hello(self, name):\n return 'Hello, %... | python | edit | 1 | 1 | mit | 905a2b0ebc2a7e825f93fe1411dc598524dfd843 | richid/tornavro | examples/hello/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport flask\n\napp = flask.Flask(__name__)\n\n\n@app.route('/')\ndef index():\n return flask.render_template('index.html')\n\n\n@app.route('/hello')\ndef hello():\n return 'hello'\n\nif __name__ == '__main__':\n port = ... | python | edit | 1 | 1 | mit | 639356ecf1b19b8546b5a4691d13a34d4b46d583 | judsonsam/tekautoday,judsonsam/tekautoday,judsonsam/tekautoday,judsonsam/tekautoday | src/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2015 Mirantis, Inc.\n# All Rights Reserved.\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... | python | edit | 1 | 1 | apache-2.0 | 257315a2e0b3f23db36bb97813849d5cf425f81f | openstack/murano,satish-avninetworks/murano,olivierlemasle/murano,NeCTAR-RC/murano,satish-avninetworks/murano,olivierlemasle/murano,satish-avninetworks/murano,NeCTAR-RC/murano,NeCTAR-RC/murano,NeCTAR-RC/murano,DavidPurcell/murano_temp,DavidPurcell/murano_temp,satish-avninetworks/murano,openstack/murano,olivierlemasle/m... | murano_tempest_tests/tests/api/service_broker/test_service_broker_negative.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import reverse\n\n\ndef get_login_url(url):\n \"\"\"Returns an expected login URL.\"\"\"\n return ('%s?next=%s' % (reverse('auth_login'), url))\n\n```\n\nApply this change: Add ``TestMessagesBackend`` for... | python | edit | 1 | 1 | bsd-3-clause | 67d7ce2d9e8ffe26f5f5a97aca9cfb99c8914f3e | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/common/tests/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom tapioca import (\n TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)\n\nfrom requests.auth import HTTPBasicAuth\n\n\nfrom .resource_mapping import RESOURCE_MAPPING\n\n\nclass HarvestClientAdapter(JS... | python | edit | 3 | 2 | mit | b9eb6ac32a12ef912edc237409c0433cd139aaf6 | vintasoftware/tapioca-harvest | tapioca_harvest/tapioca_harvest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\nimport collections\nfrom StringIO import StringIO\n\nfrom flask import render_template\nfrom jinja2 import Markup\n\n\ndef init_app(app):\n @app.template_filter('format_record')\n def format_record(record):\n val = ... | python | edit | 3 | 5 | mit | c91e494f16301789f2ebcc9c245697b379b30eca | GaretJax/irco,GaretJax/irco,GaretJax/irco,GaretJax/irco | irco/explorer/filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\" Cross Correlation\n\n\nsee @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html\n\n\"\"\"\n# Author: Avraam Marimpis <<EMAIL>>\n\nfrom .estimator import Estimator\nfrom ..analytic_signal... | python | edit | 3 | 3 | bsd-3-clause | 99f61b183da7fb1f7e22377e0347418a852846e3 | makism/dyfunconn | dyfunconn/fc/crosscorr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport django\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\n\n\nif django.VERSION < (1, 9):\n admin_urls = include(admin.site.urls)\nelse:\n admin_urls = admin.site.urls\n\nurlpatterns = [\n url(r'^a... | python | edit | 1 | 0 | mit | b700e40f65953ea0c87666d38d53e968581611e1 | jjkester/django-auditlog | auditlog_tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\nfrom optparse import OptionParser\nfrom sys import stderr\nimport pytz\nfrom werkzeug import script\nfrom werkzeug.script import make_runserver\n\nfrom firmant.wsgi import Application\nfrom firmant.utils import mod_to_dic... | python | edit | 6 | 0 | bsd-3-clause | bd878da54d9816779303a0e7ea042c9adaeab993 | rescrv/firmant | runserver.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# noinspection PyUnresolvedReferences\nfrom .prod import * # noqa\nimport os\nprint os.environ\n\nALLOWED_HOSTS = ['*']\n\nADMINS = (\n ('Tim Sutton', '<EMAIL>'),\n ('Ismail Sunni', '<EMAIL>'),\n ('Christian Christellis', '<EMAIL>... | python | edit | 2 | 0 | bsd-2-clause | ecdda95d5d1ed9e3614639c672a860e2467ba3f1 | AIFDR/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django,timlinux/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django | django_project/core/settings/prod_docker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport inspect\n\n# Flask\nDEBUG = True\n\n# Amazon S3 Settings\nAWS_KEY = ''\nAWS_SECRET_KEY = ''\nAWS_BUCKET = 'www.vpr.net'\nAWS_DIRECTORY = 'sandbox/members/'\n\nNPR_API_KEY = ''\n\nGOOGLE_SPREADSHEET = {'USER': '',\n 'PAS... | python | edit | 1 | 0 | apache-2.0 | 70d0b672eb9f857c052028be12ccae56ed798c8a | vprnet/pledge-drive,vprnet/pledge-drive,vprnet/pledge-drive | main/_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"This subpackage contains all data dictionaries.\"\"\"\n# The Python source code gets auto-generated and this package is intentially empty.\nfrom enum import Enum\n\n\nclass OrderedEnum(Enum):\n \"\"\"An Enum whose members are order... | python | edit | 1 | 2 | mit | 2b2a1848b398e59818ea7d3aa51bf7db6669917c | timtroendle/pytus2000 | pytus2000/datadicts/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\r\n\"\"\"\r\n:Author Patrik Valkovic\r\n:Created 23.06.2017 16:39\r\n:Licence GNUv3\r\nPart of grammpy\r\n\r\n\"\"\"\r\n\r\nfrom .RawGrammar import RawGrammar as Grammar\r\n\r\n\r\nclass StringGrammar(Grammar):\r\n ... | python | edit | 1 | 2 | mit | 1104ef0db6b174c64aa9ddad4df10a790fda13cf | PatrikValkovic/grammpy | grammpy/StringGrammar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport os\nfrom FeatureExtractorAbstract import FeatureExtractorAbstract\nfrom helpers.config import PathConfig\n\nclass Gait(FeatureExtractorAbstract):\n\n def getCSVheader(self):\n return [\"gaitPeriod\"]\n\n... | python | edit | 1 | 6 | apache-2.0 | 51d4e250ca8105430bb881338d4e6174c7e0d86b | metamarkovic/dataCollector,metamarkovic/dataCollector,fgolemo/dataCollector,fgolemo/dataCollector | featureExtractors/Gait.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport setup\nfrom algorithm import LimitedAlgorithm\n\n\ndef iterative(algorithms, problem, iteration_func, local_limit,\n global_limit=None):\n algorithm_runners = map(\n lambda m: LimitedAlgorithm(\n m[0... | python | edit | 1 | 11 | mit | 5e0e6d672f5066b9caa2a202fe785cb2cfb1edc7 | sagersmith8/ai_graph_coloring,sagersmith8/ai_graph_coloring | ai_graph_color/experiment.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom selenium import webdriver\n\nbrowser = webdriver.Firefox()\nbrowser.get('http://localhost:8000')\n\nassert 'Django' in browser.title\n```\n\nApply this change: Update tests to be human-readable"
},
{
"role": "assistant",
"c... | python | edit | 1 | 1 | apache-2.0 | c1e1c9d63d5334140aa71c025a90e9500b299307 | rocity/the-testing-goat,rocity/the-testing-goat | functional_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask.ext.testing import TestCase\nimport unittest\nfrom app import create_app, db\n\nclass BaseTestCase(TestCase):\n def create_app(self):\n return create_app('config.TestingConfiguration')\n\n def setUp(self):\n d... | python | edit | 1 | 1 | mit | 2bad8f41c8e64249ae3d1e0d129a41917ec73482 | rtfoley/scorepy,rtfoley/scorepy,rtfoley/scorepy | app/test_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\nfrom datasource import Datasource\nfrom ..dataset import Dataset\n\nclass CSVDatasource(Datasource):\n\n def __init__(self, path, target=None):\n super(CSVDatasource, self).__init__(path)\n self.target = target\... | python | edit | 1 | 4 | mit | 250aab8f88cb7c6ef0c99a365a717035ce4f77d6 | rsk-mind/rsk-mind-framework | rsk_mind/datasource/datasource_csv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n# Copyright lowRISC contributors.\n# Licensed under the Apache License, Version 2.0, see LICENSE for details.\n# SPDX-License-Identifier: Apache-2.0\n\nimport argparse\nimport shutil\nimport sys\n\nfrom scripts_lib... | python | edit | 1 | 2 | apache-2.0 | 3e42d128cd3139a9e35fec45b6ed3785557784f2 | lowRISC/ibex,lowRISC/ibex,AmbiML/ibex,AmbiML/ibex,AmbiML/ibex,lowRISC/ibex,AmbiML/ibex,lowRISC/ibex | dv/uvm/core_ibex/scripts/build-instr-gen.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nChatterBot is a machine learning, conversational dialog engine.\n\"\"\"\nfrom .chatterbot import ChatBot\n\n__version__ = '1.0.0a3'\n__author__ = 'Gunther Cox'\n__email__ = '<EMAIL>'\n__url__ = 'https://github.com/gunthercox/Chatter... | python | edit | 1 | 0 | bsd-3-clause | e74e4e1108cac7d8438e4b412e72f016323636a1 | vkosuri/ChatterBot,gunthercox/ChatterBot | chatterbot/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\n\nclass HostUtils(object):\n\n @classmethod\n def host_selectors(self, all_selectors, host):\n if host is None:\n return None\n\n if host in all_selectors:\n selectors = all_selectors[h... | python | edit | 3 | 4 | apache-2.0 | 0f8263fb264e880bef47ce69d8b42b2bb885a2fd | cronycle/python-goose,cronycle/python-goose,cronycle/python-goose | goose/host_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom person import Person\n\n__all__ = ['AddressBook']\n\n\nclass AddressBook(object):\n\n def __init__(self):\n self.persons = []\n self.groups = []\n\n def add_person(self, person):\n self.persons.append(person)... | python | edit | 1 | 3 | mit | d5377e06ae059a9d478c3fe06652a353f1a8359c | dizpers/python-address-book-assignment | address_book/address_book.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Nicole Thomas <<EMAIL>>`\n'''\n\n# Import Python libs\nfrom __future__ import absolute_import\n\n# Import Salt Testing libs\nfrom salttesting import TestCase, skipIf\nfrom salttesting.h... | python | edit | 1 | 1 | apache-2.0 | 59bd51f4c809a7f99f186be52c6c9090b613ac42 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/state_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom dragoman_blog.models import EntryTranslation\nfrom django.views.generic.list import ListView\n\n\nclass ListByTagView(ListView):\n\n \"\"\" View for listing posts by tags\"\"\"\n template_name = \"dragoman_blog/entrytranslation_l... | python | edit | 1 | 3 | bsd-3-clause | 70748648bc4e7b050840ed781208ea14d21a735e | fivethreeo/django-dragoman-blog | dragoman_blog/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport photomosaic.flickr\nimport photomosaic as pm\n\n\nif not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):\n FLICKR_API_KEY = os.environ['FLICKR_API_KEY']\n pm.set_options(flickr_api_key=FLICKR_API_KEY)\n... | python | edit | 1 | 0 | bsd-3-clause | 2ba1139fe7994da64eb1bbcf057f7205b35a0fd5 | danielballan/photomosaic | doc/pool_scripts/cats.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom spec import skip\n\n\ndef simple_command_on_host():\n \"\"\"\n Run command on host \"localhost\"\n \"\"\"\n skip()\n Connection('localhost').run('echo foo')\n # => Result\n\ndef simple_command_on_multiple_hosts():\n ... | python | edit | 9 | 1 | bsd-2-clause | 2e2a00a075c7f59375f90ee8b1416800dddd53d1 | fabric/fabric | integration/main.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Functions that multiple plugins should use\n\n\ndef time_string(tdel):\n if tdel.days > 14:\n return \"{}w ago\".format(tdel.days//7)\n elif tdel.days > 1:\n return \"{}d ago\".format(tdel.days)\n elif tdel.seconds ... | python | edit | 1 | 6 | mit | a1a426a49511a52f5a40ab07310c1af4197feca2 | Sulter/MASTERlinker | includes/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"cell.result\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import with_statement\n\nfrom kombu.pools import producers\n\nfrom .exceptions import CellError, NoReplyError\n\n__all__ = ['AsyncResult']\n\n\nclass AsyncRe... | python | edit | 1 | 4 | bsd-3-clause | 66bc45bb5cd8808bd65c4b796f3ca4d5564cccf8 | celery/cell,celery/cell | cell/results.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom Math.MathFunctions import *\n\ndef pointTest():\n point1 = (0, 0)\n point2 = (2, 4)\n\n print(\"Point 1: {}\".format(point1))\n print(\"Point 2: {}\".format(point2))\n print(\"Point distance: {}\".format(pointDistance(po... | python | edit | 8 | 1 | mit | 42f0c76664337af80d692fe7649f3643c237cc47 | turtles/PythonScripts | Tests/MathFunctionsTest.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.admin.sites import AdminSite as DjangoAdminSite\nfrom django.contrib.admin.sites import site as django_site\n\n\nclass HatbandAndDjangoRegistry(object):\n def __init__(self, site, default_site=None):\n if defau... | python | edit | 3 | 1 | apache-2.0 | 122b4e6982fe7a74ee668c1b146c32a61c72ec7b | texastribune/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband | armstrong/hatband/sites.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom runtests import Tester\nimport os.path\n\ntester = Tester(os.path.abspath(__file__), \"fake_spectra\")\n\ntester.main(sys.argv[1:])\n\n```\n\nApply this change: Add import back to test script"
},
{
"role": "assistant",
"con... | python | edit | 1 | 0 | mit | 20562a167e24911873e83659bccfde94b0a91061 | sbird/fake_spectra,sbird/fake_spectra,sbird/fake_spectra | do_the_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport functools\nimport blessed\n\n\ndef color(func):\n functools.wraps(func)\n def wrapper(string):\n if os.environ.get('JARN_NO_COLOR') == '1':\n return string\n return func(string)\n return w... | python | edit | 1 | 4 | bsd-2-clause | e0989ff4c2292d0f2d053065bfa71124a3705559 | Jarn/jarn.mkrelease | jarn/mkrelease/colors.py | rejected_duplicate | Near-duplicate of sample 5215 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\n# Please don't change following settings unless you know what you are doing\nSTATIC_ROOT = '/data/static'\n\nMEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')\n\n# SECURITY WARNING: keep the secret key used in production secret... | python | edit | 1 | 0 | bsd-2-clause | 5a102dfce418ec170a937ee50e3dbe0dac11bce9 | pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry,pinry/pinry,pinry/pinry,lapo-luchini/pinry,lapo-luchini/pinry | pinry/settings/local_settings.example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom classes.models import Attendee\nfrom classes.models import Attendance\nfrom classes.models import Session\nfrom classes.models import WalkinClass\n\n\nclass AttendanceInline(admin.TabularInline):\n ... | python | edit | 1 | 0 | mit | ec2d3feff6a1677457dfeb5b948b2013bc03df2a | thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee | classes/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n\nimport json\nimport watson_developer_cloud as wdc\n\nfrom api_aggregator import ApiAggregator\n\n\nclass WatsonConnector():\n \"\"\"\n Handles the connection to IBM Watson, API calls and whatnot.\n \"\"\... | python | edit | 1 | 1 | mit | f3ce6fbb4f90e600955307e307d83103ef090d8f | martialblog/watson-diary,martialblog/watson-diary,martialblog/watson-diary | watson-connector/watson_connector.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix \"invalid credentials\" error running functional tests\n\nThis fixes the \"invalid credentials\" error that you will get\nif you create a clean barbican environment and try to run the\nfunctional tests. It is actually a workaround for a... | python | new_file | 1 | 0 | apache-2.0 | 2f373227e16124ea63586c255a19b4919f1ec150 | cloudkeep/barbican,cneill/barbican,cloudkeep/barbican,MCDong/barbican,cneill/barbican,jmvrbanac/barbican,MCDong/barbican,openstack/barbican,openstack/barbican,jmvrbanac/barbican | functionaltests/__init__.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.