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'''\nCreated on 3.12.2011\n\n@author: xaralis\n'''\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom boris.utils.widgets import SelectYearWidget\n\nclass MonthlyStatsForm(forms.Form):\n year = for... | python | edit | 1 | 0 | mit | 3fa9a7c62aeae10a191b3782e32df107618c19b3 | fragaria/BorIS,fragaria/BorIS,fragaria/BorIS | boris/reporting/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom docutils.nodes import SkipNode\n\nfrom . import data_dictionary\nfrom . import database_diagram\n\n\ndef skip(self, node):\n _ = self\n _ = node\n raise SkipNode\n\n\ndef setup(app):\n app.setup_extension('sphinx.ext.graphv... | python | edit | 1 | 2 | mit | 4a6fe04a93e0d500b9e2fa7ed9951bcb497045df | julot/sphinxcontrib-dd | sphinxcontrib/dd/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\nfrom application.default_settings import _basedir\nfrom application import app, db\n\n\nclass ManagerTestCase(unittest.TestCase):\n \"\"\" setup and teardown for the testing database \"\"\"\n\n def setUp(se... | python | edit | 2 | 2 | bsd-3-clause | dddef6b793bc7c45d1f70f133a608d017ad4b341 | san-bil/astan,san-bil/astan,fert89/prueba-3-heroku-flask,albertogg/flask-bootstrap-skel,Agreste/MobUrbRoteiro,fert89/prueba-3-heroku-flask,san-bil/astan,scwu/stress-relief,san-bil/astan,scwu/stress-relief,Agreste/MobUrbRoteiro,Agreste/MobUrbRoteiro,akhilaryan/clickcounter | tests/manage_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Lazy objects, for the serializer to find them we put them here\n\nclass LazyDriver(object):\n _driver = None\n\n @classmethod\n def get(cls):\n import os\n if cls._driver is None:\n from pyvirtualdisplay ... | python | edit | 2 | 3 | apache-2.0 | c32eb5f0a09f0a43172ed257ce21ab9545b6e03e | holdenk/diversity-analytics,holdenk/diversity-analytics | lazy_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_wtf import FlaskForm\nfrom wtforms import StringField, PasswordField, BooleanField, TextAreaField\nfrom wtforms.validators import DataRequired, Length, Email\n\n\nclass SignupForm(FlaskForm):\n \"\"\"Render and validate the si... | python | edit | 1 | 0 | mit | 788ac45c702109036a4ebd0868919d5b42c040ef | borenho/flask-bucketlist,borenho/flask-bucketlist | this_app/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport build_inputs\nfrom path import Path\n\nclass SourceFile(build_inputs.File):\n def __init__(self, name, source=Path.srcdir, lang=None):\n build_inputs.File.__init__(self, name, source=source)\n self.lang = lang\n\ncla... | python | edit | 1 | 1 | bsd-3-clause | 52a9d0701f7ccc6e5ab12bf2c83473d878b80ee0 | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | src/file_types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2013 Hewlett-Packard Development Company, L.P.\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... | python | edit | 1 | 1 | apache-2.0 | 5a7f88a7d033a8005d09792d62827689d6d5230d | openstack/mox3 | mox3/fixture.py | rejected_duplicate | Near-duplicate of sample 4167 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_site import freezer, config\n\nif __name__ == '__main__':\n freezer.run(debug=config.get('debug')) # build and serve from build directory\n\n```\n\nApply this change: Fix freezing debug or not"
},
{
"role": "assistant... | python | edit | 1 | 0 | apache-2.0 | 2204fa211f09dda25830d9f3f84a0e748e6aa02c | wcpr740/wcpr.org,wcpr740/wcpr.org,wcpr740/wcpr.org | freeze.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\nimport signal\n\n\nif sys.platform.startswith(\"win\"):\n def taskkill(pid):\n os.system('taskkill /F /PID {:d} /T >NUL 2>NUL'.format(pid))\nelse: # POSIX\n def taskkill(pid):\n os.kill(pid, signal.SIGTERM)\n... | python | edit | 3 | 2 | mit | 2145ee5961cc35d36013e2333c636c7390b6c039 | jschultz/Gooey,partrita/Gooey,chriskiehl/Gooey,codingsnippets/Gooey | gooey/gui/util/taskkill.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import Filth\n\n\nclass NamedEntityFilth(Filth):\n \"\"\"\n Named entity filth. Upon initialisation provide a label for named entity (e.g. name, org)\n \"\"\"\n type = 'named_entity'\n\n def __init__(self, *args, l... | python | edit | 1 | 1 | mit | 5dacd62d8d27f6d0d94313ec1bd39857ee314d2f | deanmalmgren/scrubadub,datascopeanalytics/scrubadub,deanmalmgren/scrubadub,datascopeanalytics/scrubadub | scrubadub/filth/named_entity.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Family module for Wikivoyage.\"\"\"\n#\n# (C) Pywikibot team, 2012-2020\n#\n# Distributed under the terms of the MIT license.\n#\n# The new Wikivoyage family that is hosted at Wikimedia\nfrom pywikibot import family\n\n\nclass Family(... | python | edit | 1 | 0 | mit | 8ad7e25d024e8549609119906fa09668dbb3e952 | wikimedia/pywikibot-core,wikimedia/pywikibot-core | pywikibot/families/wikivoyage_family.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ConfigParser\nimport os\nimport yaml\n\nclass Database(object):\n \"\"\" Generic class for handling database-related tasks. \"\"\"\n\n def select_config_for_environment(self):\n \"\"\" Read the value of env variable and ... | python | edit | 3 | 2 | apache-2.0 | 2f4ed65bcddf9494134f279046fde75b0772b07d | ProjectFlorida/outrider | utils/database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport click\nimport os\nimport codecs\nimport json\n\nfrom xtas.tasks._frog import parse_frog, frog_to_saf\n\n\n@click.command()\n@click.argument('input_files', nargs=-1, type=click.Path(exists=True))\n@click.argumen... | python | edit | 1 | 3 | apache-2.0 | a41e07ff20d9dc44288a57f76a83e86b4944049a | WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln | nlppln/commands/frog_to_saf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport copy\nfrom . import parallel\nfrom .. util import color_list\n\n\nclass Mixer(parallel.Parallel):\n def __init__(self, *args, levels=None, master=1, **kwds):\n self.master = master\n\n super().__init__(*args, **kwds)... | python | edit | 3 | 2 | mit | 0e34fce69b01ab9b8f3ec00be633bc2581df26d5 | rec/BiblioPixel,ManiacalLabs/BiblioPixel,ManiacalLabs/BiblioPixel,ManiacalLabs/BiblioPixel,rec/BiblioPixel,ManiacalLabs/BiblioPixel,rec/BiblioPixel,rec/BiblioPixel | bibliopixel/animation/mixer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nUnit tests for One Codex\n\"\"\"\nfrom onecodex.lib.auth import check_version\nfrom onecodex.version import __version__\n\n\nSERVER = 'https://app.onecodex.com/'\n\n\ndef test_check_version():\n # TODO: Remove Internet dependency... | python | edit | 1 | 2 | mit | 5990374409ca2c5f35c602cb6d2276eb536d979a | refgenomics/onecodex,refgenomics/onecodex,onecodex/onecodex,onecodex/onecodex | tests/test_lib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport unittest\nimport os.path\n\nif __name__ == '__main__':\n HERE = os.path.dirname(__file__)\n\n loader = unittest.loader.TestLoader()\n suite = loader.discover(HERE)\n result = unittest.result.TestResult()\n\n suite.ru... | python | edit | 1 | 0 | mit | 45f30b4b1da110e79787b85c054796a671718910 | funkybob/antfarm | tests/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jon Surrell\n# Copyright (c) 2013 Jon Surrell\n#\n# License: MIT\n#\n\n\"\"\"This module exports the Ghc plugin class.\"\"\"\n\nfrom ... | python | edit | 1 | 0 | mit | 85748e4b18dffca6436c5439a3e40ac773611c37 | alexbiehl/SublimeLinter-stack-ghc,SublimeLinter/SublimeLinter-ghc | linter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas\nimport numpy as np\n\nfrom scikits.statsmodels.tools import data\n\ndef test_missing_data_pandas():\n \"\"\"\n Fixes GH: #144\n \"\"\"\n X = np.random.random((10,5))\n X[1,2] = np.nan\n df = pandas.DataFrame... | python | edit | 1 | 1 | bsd-3-clause | 3f1aeba98cd4bc2f326f9c18c34e66c396be99cf | Averroes/statsmodels,saketkc/statsmodels,wwf5067/statsmodels,phobson/statsmodels,musically-ut/statsmodels,hlin117/statsmodels,cbmoore/statsmodels,ChadFulton/statsmodels,pprett/statsmodels,statsmodels/statsmodels,gef756/statsmodels,rgommers/statsmodels,alekz112/statsmodels,jstoxrocky/statsmodels,kiyoto/statsmodels,music... | scikits/statsmodels/tools/tests/test_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\n# The URI for our PostgreSQL database.\nSQLALCHEMY_DATABASE_URI = \"postgres:///warehouse\"\n\n# The base domain name for th... | python | edit | 1 | 0 | bsd-2-clause | 23d8664a80a51c489615db6dbcde8a7e76265f15 | davidfischer/warehouse | warehouse/defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom apps.article.models import Article, Tag\nfrom apps.authentication.serializers import UserSerializer\n\n\nclass ArticleSerializer(serializers.ModelSerializer):\n author = UserSerializer(sourc... | python | edit | 1 | 0 | mit | 71ec798d6a85a2aa0e4b80e6095d4da67612db70 | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | apps/article/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright 2014 Eugene Frolov <<EMAIL>>\n#\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 complia... | python | edit | 1 | 2 | apache-2.0 | 3fca658f3db21a0b3b8de626e6a7faf07da6ddab | phantomii/restalchemy | restalchemy/dm/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, sys\nfrom django.conf import settings\n\n# -- Setup Django configuration appropriately\n\nTESTDIR = os.path.abspath(os.path.dirname(__file__))\nsettings.MODULE_DIR = TESTDIR\nsettings.PULL_SCRIPT = os.path.join(TESTDIR, 'pull-tes... | python | edit | 5 | 0 | bsd-3-clause | 98dd2759a184ba1066e8fd49cd09ff4194d2da0f | pv/pydocweb,pv/pydocweb | docweb/tests/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\r\n# http.py\r\n# pyblox\r\n#\r\n# By Sanjay-B(Sanjay Bhadra)\r\n# Copyright © 2017 Sanjay-B(Sanjay Bhadra). All rights reserved.\r\n#\r\n\r\nimport json\r\nimport requests\r\n\r\nclass Http:\r\n\r\n\tdef sendRequest(url):\r\n\t\tpayl... | python | edit | 7 | 2 | mit | 2f34954716c3164b6fd65e997a6d0b02a4be6a03 | Sanjay-B/Pyblox | pyblox/api/http.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# TODO: migrate to Flask CLI instead of Flask-Script\n'''This module enables command line interface for randompeople app.'''\nfrom flask_script import Manager\nfrom app import create_app, db\nfrom app.models import Room, Member\n\nmanager =... | python | edit | 1 | 1 | mit | 8e755e7dc94b6966e73af5434d382fa1ecd15572 | chetotam/randompeople,chetotam/randompeople,chetotam/randompeople | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2013, Theo Crevon\n# Copyright (c) 2013, Greg Leclercq\n#\n# See the file LICENSE for copying permission.\n\n\nclass PollTimeout(Exception):\n pass\n\n\nclass InvalidCredentialsError(Exception):... | python | edit | 1 | 3 | mit | add6013c8484e56545ed2f11c8c6e042c1384429 | botify-labs/python-simple-workflow,botify-labs/python-simple-workflow | swf/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n__version__ = '0.2.dev{}'.format(datetime.now().strftime('%Y%m%d%H%M%S'))\n\ntry:\n # we need __version__ for setup.py, sphinx stuff, just to generally be nice, etc.,\n # but at the point of invocation i... | python | edit | 1 | 0 | apache-2.0 | 5397cb0d10f680bc4bf4ab30deb77e9fbff4761d | emilssolmanis/tapes,emilssolmanis/tapes,emilssolmanis/tapes | tapes/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCentral configuration module of webstr selenium tests.\n\nThis module provides configuration options along with default values and\nfunction to redefine values.\n\"\"\"\n\n# Copyright 2016 Red Hat\n#\n# Licensed under the Apache Lic... | python | edit | 1 | 2 | apache-2.0 | 2958e793ea30d879afe265bb511183e4512fc049 | Webstr-framework/webstr | webstr/core/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"{{ cookiecutter.description }}\"\"\"\n# Copyright (C) {{cookiecutter.year}} {{cookiecutter.author_name}}. See LICENSE for terms of use.\nimport sys\nimport logging\n\nimport click\nfrom click import echo\n\n__ve... | python | edit | 4 | 2 | mit | bfc16a9010a664d18d01f0fc4684353adbab7a47 | goerz/cookiecutter-pyscript | {{cookiecutter.project_name}}/{{cookiecutter.module_name}}.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mailviews.utils import is_django_version_greater\n\nfrom django.conf.urls import include, url\n\n\nfrom mailviews.previews import autodiscover, site\n\n\nautodiscover()\n\nurlpatterns = [\n url(regex=r'', view=site.urls)\n]\n\n```\n... | python | edit | 3 | 0 | apache-2.0 | 01ca6c2c71b8558e119ae4448e02c2c84a5ef6f9 | disqus/django-mailviews,disqus/django-mailviews | mailviews/tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ajax_select import register, LookupChannel\nfrom members.models import *\nfrom django.utils.html import escape\n\n\n@register('member')\nclass MemberLookup(LookupChannel):\n\n model = Member\n\n def get_query(self, q, request):\n... | python | edit | 6 | 3 | mit | faf8f70128d70696707f073181f9ce8d08629fd2 | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | teknologr/members/lookups.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.conf.urls.static import static\nfrom django.views.generic import Template... | python | edit | 3 | 0 | bsd-3-clause | a99150d5c98074bde9218d6feb68f4cb200a0e4c | DemocracyClub/candidate_questions,DemocracyClub/candidate_questions,DemocracyClub/candidate_questions | q_and_a/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nReload programs.\n\"\"\"\nimport shutil\nimport subprocess\n\nfrom pywal.settings import CACHE_DIR\nfrom pywal import util\n\n\ndef reload_i3():\n \"\"\"Reload i3 colors.\"\"\"\n if shutil.which(\"i3-msg\"):\n util.diso... | python | edit | 1 | 2 | mit | 6d48f5fb6be6045d89948729c6e28ed1f1a305ab | dylanaraps/pywal,dylanaraps/pywal,dylanaraps/pywal | pywal/reload.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Quick and Distributed TensorFlow command framework\"\"\"\n\nfrom .flag import *\nfrom .run import def_run\n\n```\n\nApply this change: Add __all__ variable to top level package"
},
{
"role": "assistant",
"content": "\"\"\"... | python | edit | 5 | 0 | unlicense | 580868c63f61bb7f6576dc7b0029aa137e274a51 | raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd | qnd/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generates validation/input definitions as if they were created by splunk for tests\nclass MockDefinitions(object):\n def __init__(self, session_key=None):\n self.session_key = session_key if session_key is not None else '1234567... | python | edit | 1 | 2 | bsd-2-clause | 15c8215415d36da4fac9c7333e62239f7b81c12d | Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input | test/support/mock_definitions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport unittest\nimport os\n\nfrom sqlalchemy import create_engine\n\nfrom rtrss import config, database\n\n\nlogging.disable(logging.ERROR)\n\nengine = create_engine(config.SQLALCHEMY_DATABASE_URI,\n e... | python | edit | 1 | 2 | apache-2.0 | 697120d4e693bf7fbc192164b5df3dfb30f71a3f | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | tests/__init__.py | rejected_duplicate | Near-duplicate of sample 5748 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Case Conductor is a Test Case Management system.\n# Copyright (C) 2011-2012 Mozilla\n#\n# This file is part of Case Conductor.\n#\n# Case Conductor is free software: you can redistribute it and/or modify\n# it under the terms of the GNU G... | python | edit | 2 | 0 | bsd-2-clause | 2673f1bac21e43a4cad9edb7352f89750d6d0144 | mozilla/moztrap,mccarrmb/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,mccarrmb/moztrap,mozilla/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,shinglyu/moztrap,mccarrmb/moztrap,mozilla/moztrap,bobsilverberg/moztrap,mozilla/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,bobs... | tests/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# My solution to the following challenge: https://redd.it/39ws1x\n\nfrom datetime import date\nfrom collections import defaultdict\n\nclass Todo:\n def __init__(self):\n self.items = defaultdict(list)\n\n ... | python | edit | 8 | 3 | mit | 2e3d133874e1df647df146ce90e0f4e2ccf84ef4 | Kredns/python | todo-list/todo.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .interfaces import (\n IAuthSourceService,\n IAuthService,\n )\n\nfrom .policy import (\n AuthServicePolicy,\n NoAuthCompleted,\n )\n\ndef includeme(config):\n config.set_authentication_policy(AuthServicePolicy())\... | python | edit | 4 | 2 | isc | 1d2d3f5dcab390244c58aa04305d74570ace5e44 | usingnamespace/pyramid_authsanity | pyramid_authsanity/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\n\nfrom towel import deletion\n\nfrom testapp.models import Person, EmailAddress\n\n\nclass ModelViewTest(TestCase):\n def test_list_view(self):\n for i in range(7):\n p = Person.objects... | python | edit | 4 | 2 | bsd-3-clause | 4f2dabc45f22a9ad6350ab33267e4bdf4a00b4ea | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | tests/testapp/tests/modelview.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) Metakernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nfrom metakernel import Magic, option\n\n\nclass PlotMagic(Magic):\n\n @option(\n '-s', '--size', action='store',\n ... | python | edit | 1 | 1 | bsd-3-clause | fa55f976f4a41bfcbf2009e543fd2a0057451c31 | Calysto/metakernel | metakernel/magics/plot_magic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gmusicapi import Mobileclient\n\n\ndef create_playlist(playlist_name, artists, email, password, max_top_tracks=2):\n api = Mobileclient()\n logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS)\n\n if not logge... | python | edit | 1 | 6 | mit | 630a8683ba748f130bbb70c285d30142e50cd8ba | epayet/playlist_kreator,epayet/playlist_kreator | playlist_kreator/gmusic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nReturn data to a redis server\nThis is a VERY simple example for pushing data to a redis server and is not\nnessisarily intended as a usable interface.\n'''\n\nimport redis\nimport json\n\n__opts__ = {\n 'redis.host': 'mcp',... | python | edit | 1 | 1 | apache-2.0 | 6a4c6c11cd0d2496ee33b7536b6691a34e1c81a8 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/returners/redis_return.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nline = \" 0:00 InitGame: \\g_matchmode\\1\\g_gametype\\7\\g_allowvote\\536871039\\g_gear\\KQ\\mapname\\ut4_dust2_v2\\gamename\\q3urt43\\g_survivor\\0\\auth\\0\\g_modversion\\4.3.4\"\n\n\nde... | python | edit | 2 | 2 | mit | 2ab1f7687e2cd3b2814ae4c68f48d76fcea4e42b | SpunkyBot/spunkybot,SpunkyBot/spunkybot | tests/test_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\ntest_itunes.py\n\nCopyright © 2015 Alex Danoff. All Rights Reserved.\n2015-08-02\n\nThis file tests the functionality provided by the itunes module.\n\"\"\"\n\nimport unittest\nfrom datetime import datetime\n\nfrom itunes.itunes imp... | python | edit | 1 | 1 | mit | a8571b066634b7e7cbeb35844e1ee0b0d678112c | adanoff/iTunesTUI | tests/test_itunes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport permstruct\nimport permstruct.dag\n\nclass TestTravis(unittest.TestCase):\n def test_travis(self):\n perm_prop = lambda p: p.avoids([2,3,1])\n perm_bound = 6\n inp_dag = permstruct.dag.incr_de... | python | edit | 1 | 3 | bsd-3-clause | 9837d14d4c9a1fa85d6dd122ebbdda6a6b559087 | PermutaTriangle/PermStruct | tests/test_travis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport cv2\nimport sys\nimport numpy as np\n\ndef resize(src, w_ratio, h_ratio):\n height = src.shape[0]\n width = src.shape[1]\n dst = cv2.resize(src,(width/100*w_ratio,height/100*h_ratio))\n return dst... | python | edit | 1 | 1 | mit | 373f0f4637103d526c75cae304740e621ad3c39c | karaage0703/python-image-processing,karaage0703/python-image-processing | resize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Locatie(models.Model):\n def __unicode__(self):\n return self.naam\n naam = models.CharField(max_length=200)\n lat = models.FloatField()\n long = models.FloatField()\n\nclass Dag(mode... | python | edit | 2 | 1 | mit | 3bcd36a063b112edb657a739287c6a2db3141746 | jonge-democraten/zues,jonge-democraten/zues,jonge-democraten/zues | appolo/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ast\n\nfrom knights.library import Library\n\nregister = Library()\n\n\n@register.tag\ndef static(parser, token):\n src = parser.parse_expression(token)\n return ast.Yield(value=ast.BinOp(\n left=ast.Str(s='/static/%s'),... | python | edit | 1 | 1 | mit | 1c231a8ef54af82d8ec03b828856ddac619fd345 | funkybob/knights-templater,funkybob/knights-templater | knights/compat/django.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.forms import widgets\n\n#JS_URL is the url to the filepicker.io javascript library\nJS_VERSION = 0\nJS_URL = \"//api.filepicker.io/v%d/filepicker.js\" % (JS_VERSION)\n\nif hasattr(settings, 'FIL... | python | edit | 1 | 2 | mit | 32116cf93b30fc63394379b49e921f9e0ab2f652 | filepicker/filepicker-django,filepicker/filepicker-django,FundedByMe/filepicker-django,FundedByMe/filepicker-django | django_filepicker/widgets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nimport os\n\nfrom django.db import models\nfrom django.contrib import admin\n\nif os.environ.get('READTHEDOCS'):\n TagField = lambda *args, **kwargs: None\nelse:\n from tagging.fields import TagField\n\nclass Event(models... | python | edit | 5 | 4 | apache-2.0 | 5d8555ffc9a4b0549d32161a79aada3857b9d639 | jssjr/graphite-web,mleinart/graphite-web,DanCech/graphite-web,bruce-lyft/graphite-web,dhtech/graphite-web,cgvarela/graphite-web,ceph/graphite-web,AICIDNN/graphite-web,kkdk5535/graphite-web,axibase/graphite-web,graphite-project/graphite-web,g76r/graphite-web,redice/graphite-web,section-io/graphite-web,cloudant/graphite-... | webapp/graphite/events/models.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_pagedown.fields import PageDownField\nfrom wtforms.fields import StringField\nfrom wtforms.validators import DataRequired\n\nfrom app.models import Post, Tag\nfrom app.utils.helpers import get_or_create\nfrom app.utils.forms impo... | python | edit | 1 | 3 | mit | 767cf250a23c164cfcf7d6eba5a48116e3b111e5 | Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger | app/admin/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\nfrom polling.models import CANDIDATES\nfrom polling.models import CANDIDATES_THIRD_PARTY\nfrom polling.models import STATES\n\n\nclass LandingPageForm(forms.Form):\n state = forms.ChoiceField(choices=STATES)\n... | python | edit | 1 | 0 | mit | 267076bba8b28f82da4d714d5ee3babc4d24b8da | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | voteswap/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 John Reese\n# Licensed under the MIT license\n\nimport os.path\nimport logging\n\nfrom pathlib import Path\nfrom importlib import import_module\nfrom types import ModuleType\nfrom typing import List\n\nlog = logging.getLogg... | python | edit | 3 | 5 | mit | 1ba620c9e9459b935bb59ed55dbb3fc6c14b1994 | jreese/edi | edi/units/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = (2014, 10, 0)\n\n\ndef get_version():\n \"\"\"\n :rtype: str\n \"\"\"\n return '.'.join(str(i) for i in __version__)\n\n\nclass Gignore(object):\n BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/m... | python | edit | 1 | 2 | bsd-3-clause | 6d9ad75ca3ac9a5ed9aac33e56a4809fc7e37f54 | Alir3z4/python-gignore | gignore/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\n\nansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']\nansi_colour_code = dict((name, str(code)) for code, name in enumerate(ansi_colour_list, 30))\n\ndef is_ansi_terminal(file):... | python | edit | 1 | 4 | mit | 7141cedd5667b373e3dd5a723052de42ea5dfa10 | shaurz/ome,shaurz/ome | ome/terminal.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import jsonify\n\nfrom . import main\nfrom ..models import ValidationError\n\n\n@main.app_errorhandler(ValidationError)\ndef validatation_error(e):\n return jsonify(error=e.message), 400\n\n\ndef generic_error_handler(e):\n ... | python | edit | 1 | 3 | mit | 5d09fef9ee1f6b8627e372695a93be3236820f46 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | app/main/errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Minimum settings that are needed to run django test suite\nimport os\nimport secrets\nimport tempfile\n\nSECRET_KEY = secrets.token_hex()\n\nif \"postgresql\" in os.getenv(\"TOX_ENV_NAME\", \"\") or os.getenv(\"TEST_DATABASE\") == \"postg... | python | edit | 1 | 0 | bsd-3-clause | 01b1b649539beb41073e7df427d6f4622d687a5d | romgar/django-dirtyfields | tests/django_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport wikidata\n\n\n# The data (= ID) of the Wikidata dump\ndump_id = '20150105'\n\n# The files to download\ndownload_urls = [\n \"https://tools.wmflabs.org/wikidata-exports/rdf/exports/... | python | edit | 1 | 0 | mit | a2c419296a9f42f3c0d70ad3b7d10eed3702bd85 | patrickhoefler/wikidata-virtuoso,patrickhoefler/wikidata-virtuoso | download-and-process.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python3\n\ndef superDigit(n, k):\n p = create_p(n, k)\n return get_super_digit(p)\n\ndef get_super_digit(p):\n if len(p) == 1:\n return int(p)\n else:\n digits = map(int, list(p))\n return get_super_d... | python | edit | 1 | 2 | mit | 54dc5c3a6ddf7fdc630547836058d017c778008f | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | python/recursive-digit-sum.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import render_template\nfrom . import main\n\n\n@main.app_errorhandler(404)\ndef page_not_found(e):\n return render_template(\"404.html\"), 404\n\n```\n\nApply this change: Fix 404 page template static resources"
},
{
... | python | edit | 1 | 1 | mit | c313d6fb6803edabb956e1e90f040f8518c334bf | mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace... | app/main/errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport txkazoo\n\nfrom twisted.trial.unittest import SynchronousTestCase\n\n\nclass VersionTests(SynchronousTestCase):\n \"\"\"\n Tests for programmatically acquiring the version of txkazoo.\n \"\"\"\n def test_both_names(self):... | python | edit | 1 | 1 | apache-2.0 | 3fe6d183b3c168da73f9fb65a9b52ffe1d79e6e1 | rackerlabs/txkazoo | txkazoo/test/test_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility method to DefinedObject base class"
},
{
"role": "assistant",
"content": "from StringIO import StringIO\n\nclass DefinedObject(object):\n\n def to_xml(self):\n \"\"\"Export an object as an XML String\"\"\"\n... | python | new_file | 1 | 1 | bsd-3-clause | 015ba19ceefacd82e68aa7a023e33140e868f5a6 | CybOXProject/python-cybox | cybox/common/defined_object.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nimport sys\nfrom PyQt5.QtWidgets import QApplication\nfrom keyboard.ui.widgets import KeyboardWindow\n\nif __name__ == '__main__':\n app = QApplication([])\n window = KeyboardWindow()\n window.showMaximized()\n s... | python | edit | 1 | 0 | apache-2.0 | f693f09bfedc4981557741a8ac445c160faab65d | brainbots/assistant | assisstant/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n radish\n ~~~~~~\n\n Behavior Driven Development tool for Python - the root from red to green\n\n Copyright: MIT, Timo Furrer <<EMAIL>>\n\"\"\"\n\nimport pytest\n\nimport radish.utils as utils\... | python | edit | 1 | 1 | mit | 0a09dbb6cc0104c9e1d3e504f84a70f729d14af1 | radish-bdd/radish,radish-bdd/radish | tests/unit/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License ... | python | edit | 1 | 1 | apache-2.0 | b9671e96e40b38d0662dbe0e32dca0ca0c5fe62e | tensorflow/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor | tensor2tensor/rl/trainer_model_based_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nModule for shelling out commands, inclusion of this module should be\nconfigurable for security reasons\n'''\n\ndef echo(text):\n '''\n Return a string - used for testing the connection\n '''\n return text\n\n```\n\nApply t... | python | edit | 2 | 1 | apache-2.0 | fff3e2ed2ef1bb3f87f31178ef03d6752f2dc152 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/cmd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\nclass Config(object):\n DEBUG = False\n TESTING = False\n SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']\n SQLALCHEMY_TRACK_MODIFICATIONS = True\n\n\nclass ProductionConfig(Config):\n DEBUG = False\n\n\nc... | python | edit | 1 | 0 | mit | bee340782a07a26a28bf89d91798d8091c42d1e1 | mdsrosa/routes_api_python | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render, redirect\nfrom django.conf import settings\nfrom django.http import HttpResponseRedirect\nfrom django.views import View\nfrom members.programmes import DEGREE_PROGRAMME_CHOICES\nfrom registration.forms i... | python | edit | 5 | 2 | mit | 2d8efdb0c5628f6262e7efd2d8a20369415982bb | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | teknologr/registration/views.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCopyright [2009-2014] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License ... | python | edit | 1 | 0 | apache-2.0 | a7535e3abc791bc3b13788fa321513a4a840f5a8 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | rnacentral/nhmmer/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n#\n# This is the configuration file of the application\n#\n# Please make sure you don't store here any secret information and use environment\n# variables\n#\n\n\nSQLALCHEMY_DATABASE_URI = os.environ.get('CLEARDB_DATABASE_URL')... | python | edit | 1 | 0 | bsd-3-clause | 8c9a8e715643ac76181a9c05b6dd0afbcd9802a9 | HamutalCohen3/anyway,boazin/anyway,boazin/anyway,yosinv/anyway,idogi/anyway,hasadna/anyway,omerxx/anyway,yosinv/anyway,njenia/anyway,OmerSchechter/anyway,OmerSchechter/anyway,idogi/anyway,HamutalCohen3/anyway,njenia/anyway,esegal/anyway,eladkarakuli/anyway,HamutalCohen3/anyway,hasadna/anyway,eladkarakuli/anyway,boazin/... | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom uuid import uuid4\n\nfrom changes.config import db\nfrom changes.models import Author\nfrom changes.testutils import APITestCase\n\n\nclass AuthorBuildListTest(APITestCase):\n def test_simple(self):\n fake_author_id = uuid4()... | python | edit | 1 | 1 | apache-2.0 | a5338e46ffd0684b2d4f21708176cf6c8bbdcc92 | wfxiang08/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes | tests/changes/api/test_author_build_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n\nclass Config:\n SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'\n SQLALCHEMY_COMMIT_ON_TEARDOWN = True\n\n @staticmethod\n def init_app(app):\n pass\n\n... | python | edit | 1 | 1 | mit | 594869bca15b93a8e583e29b1a65496bd6c058f2 | fernando24164/flask_api,fernando24164/flask_api | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\n\nclass UpdateInstances(object):\n\n @staticmethod\n def do():\n from dbaas_cloudstack.models import DatabaseInfraOffering\n from dbaas_cloudstack.models import PlanAttr\n\n infra_offerings = Da... | python | edit | 1 | 4 | bsd-3-clause | b4aae8d7f87bd3f1bb27610440c20ab1110d2b3a | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/util/update_instances_with_offering.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport api\n\nclass WWWDomain(api.API):\n\n def __init__(self, auth_handler):\n self.url = auth_handler.url\n self.sessid = auth_handler.sessid\n self.func = 'wwwdomain.edit'\n self.out = 'json'\n... | python | edit | 1 | 3 | mit | a18ae589f8217bc26bf1d4a8841c637354aedbaa | jakubjedelsky/python-ispmgr | ispmgr/wwwdomain.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter\n\nfrom falmer.events.models import Curator\nfrom . import models\n\n\nclass EventFilterSet(FilterSet):\n class Meta:\n model = ... | python | edit | 1 | 0 | mit | c0a341bb285e9906747c1f872e3b022a3a491044 | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | falmer/events/filters.py | rejected_duplicate | Near-duplicate of sample 2474 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import scoped_session, sessionmaker\n\n\nsession = None\n\n\ndef init_session(connection_string=None, drop=False):\n if connection_string is None:\n connection_string = 'sq... | python | edit | 1 | 4 | bsd-3-clause | a8966a4d3f9a160af3865b8cadb26e58eb36fd64 | janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system | src/database/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass ConfigReader():\n\t\n\tdef __init__(self):\n\t\tself.keys={}\n\t#Read Keys from file\n\tdef readKeys(self):\n\t\tkeysFile=open(\"config.txt\",\"r\")\n\t\tfileLines=keysFile.readlines()\n\t\tkeysFile.close()\n\t\tself.keys.clear()\n\t\... | python | edit | 1 | 5 | mit | dd58dbbbdb9b3a9479fa5db38a4e4038a6514fef | ollien/PyConfigReader | configReader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"geohash unit tests.\"\"\"\nimport unittest\nimport os\nimport json\n\nimport gtfs\n\nclass TestGTFSReader(unittest.TestCase):\n test_gtfs = os.path.join('examples', 'sample-feed.zip')\n \n def test_readcsv(self):\n expect = {\n ... | python | edit | 3 | 2 | mit | a7f761d662b98dea2b16f711e7d17ad826f491af | srthurman/transitland-python-client,transitland/transitland-python-client | onestop/test_gtfs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nprint(\"FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us\"\n \"ing 'make schema' before packaging.\")\nsys.exit(1)\n\n```\n\nApply this change: Add schema to repo for now"
},
{
"role": "assist... | python | edit | 1 | 0 | mit | 0dc3e4ffe86f25697799b8092822a8d77a22493b | flyte/pi-mqtt-gpio | pi_mqtt_gpio/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: UTF-8 -*-\nfrom django.contrib.contenttypes import generic\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass GenericLi... | python | edit | 1 | 3 | bsd-3-clause | 72b899fd0ae8bd07edf454d410e65ff00a9ca772 | matagus/django-generic-links,matagus/django-generic-links | generic_links/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Ilya Akhmadullin\n# Copyright (c) 2013 Ilya Akhmadullin\n#\n# License: MIT\n#\n\n\"\"\"This module exports the jscs plugin class.\"\"... | python | edit | 1 | 0 | mit | 851e515379a5da66b4171f5340b910a2db84d0f0 | roberthoog/SublimeLinter-jscs,SublimeLinter/SublimeLinter-jscs | linter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) Ivan Kravets <<EMAIL>>\n# See LICENSE for details.\n\nimport json\nimport logging.config\nimport os\nfrom time import tzset\n\n\nVERSION = (0, 3, 0)\n__version__ = \".\".join([str(s) for s in VERSION])\n\n__title__ = \"platf... | python | edit | 1 | 0 | apache-2.0 | 6f0a35372d625f923b9093194540cf0b0e9f054d | orgkhnargh/platformio-api,platformio/platformio-api | platformio_api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n API Client Interface for POEditor API (https://poeditor.com).\n\n Usage:\n\n >>> from poeditor import POEditorAPI\n >>> client = POEditorAPI(api_token='my_token')\n >>> projects = client.list_projects()\n\"\"\"\n\n__... | python | edit | 4 | 0 | mit | 76bb7b55b175a6495d0db2881f8d94f03708522c | sporteasy/python-poeditor | poeditor/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom buildbot.status import html, words\nfrom buildbot.status.web.authz import Authz\nfrom .djangoauth import DjangoAuth\n\nauthz = Authz(\n auth = DjangoAuth(),\n gracefulShutdown = 'auth',\n forceBuild = 'auth',\n forceAllBuil... | python | edit | 1 | 1 | bsd-3-clause | 0b853eb0d6a9d5f2ed6bb098c1fc1f9231cc52dc | jacobian-archive/django-buildmaster,hochanh/django-buildmaster | djangobotcfg/status.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import JsonResponse\nfrom dal import autocomplete\nfrom .models import Person\nfrom winthrop.books.models import PersonBook\nfrom django.db.models import BooleanField, Case, When, Value\nfrom .viaf import ViafAPI\n\n\nclass... | python | edit | 8 | 4 | apache-2.0 | 72fe214ba0bb66e5f5c4ca9670c14468304bdd49 | Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django | winthrop/people/views.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"BBF usage guidelines plugin\nSee BBF Assigned Names and Numbers at https://wiki.broadband-forum.org/display/BBF/Assigned+Names+and+Numbers#AssignedNamesandNumbers-URNNamespaces\n\"\"\"\n\nimport optparse\n\nfrom pyang import plugin\nf... | python | edit | 1 | 3 | isc | 6ef289403b4d88bc5e1a70568133924de54c2b9f | mbj4668/pyang,mbj4668/pyang | pyang/plugins/bbf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport serial\nimport threading\nfrom blueplayer import blueplayer\n\n\ndef main():\n args = sys.argv[1:]\n # first argument should be a serial terminal to open\n if not len(args):\n port = \"/dev/ttyAMA0\"\n ... | python | edit | 3 | 6 | mit | 56d1416a486f48fcbcf425d535268dec19715f2e | dylwhich/rpi-ipod-emulator | blueplayer/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport traceback\nfrom routes import Mapper\n\nimport ppp_core\nimport example_ppp_module as flower\nimport ppp_questionparsing_grammatical as qp_grammatical\nimport ppp_cas\n#import ppp_nlp_ml_standalone\n\nclass Application:\n def __in... | python | edit | 1 | 4 | cc0-1.0 | 1a0339b85d852526c184eeace73021fc7d68b2c6 | ProjetPP/Deployment,ProjetPP/Deployment,ProjetPP/Deployment | python_dispatcher.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nimport datetime\nfrom ._base import db\n\n\nclass User(db.Model):\n id = db.Column(db.Integer, primary_key=True)\n name = db.Column(db.String(50), unique=True)\n email = db.Column(db.String(50))\n avatar = db.Co... | python | edit | 1 | 1 | mit | dc6af73616163463bf2c5feac97ac1473ea76e07 | 1045347128/Flask-Boost,hustlzp/Flask-Boost,hustlzp/Flask-Boost,1045347128/Flask-Boost,1045347128/Flask-Boost,1045347128/Flask-Boost,hustlzp/Flask-Boost,hustlzp/Flask-Boost | proj/proj/models/user.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport unittest\n\nfrom mock import Mock\n\nfrom libcloud.common.openstack import OpenStackBaseConnection\n\n\nclass OpenStackBaseConnectionTest(unittest.TestCase):\n\n def setUp(self):\n self.timeout = 10\n Ope... | python | edit | 1 | 2 | apache-2.0 | 89b54d9c7fec213465446148e39612a2ac659ca2 | Jc2k/libcloud,marcinzaremba/libcloud,Scalr/libcloud,mathspace/libcloud,Verizon/libcloud,DimensionDataCBUSydney/libcloud,Cloud-Elasticity-Services/as-libcloud,lochiiconnectivity/libcloud,MrBasset/libcloud,sfriesel/libcloud,wrigri/libcloud,Itxaka/libcloud,erjohnso/libcloud,jerryblakley/libcloud,Scalr/libcloud,marcinzarem... | test/common/test_openstack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\n\nclass Markov:\n def __init__(self, source, k=5):\n self.source = source\n self.k = k\n self._init_source()\n\n def _init_source(self):\n self.seeds = {}\n for i in range(len(self.sou... | python | edit | 1 | 5 | mit | 81ca235178a742e0041f2483d1f80d367d77264d | calzoneman/MarkovBot,calzoneman/MarkovBot | markov.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport redis\nfrom celery import Celery\n\nfrom .Fuzzer import Fuzzer\n\nimport os\nimport time\nimport driller.config as config\nimport logging\n\nl = logging.getLogger(\"fuzzer.tasks\")\n\nbackend_url = \"redis://%s:%d\" % (config.REDIS_H... | python | edit | null | null | bsd-2-clause | 62da8b8a2774db2ccb725bc0c5a1598252ebf4a7 | shellphish/driller | fuzzer/tasks.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/opt/local/bin/python\nimport json\nimport os\nimport re\nimport string\nimport sys\n\nmyPath = os.path.dirname(os.path.realpath(__file__))\n\nfor i, line in enumerate(sys.stdin):\n (url, title, fileBase) = json.loads(line)\n fileName =... | python | edit | 4 | 1 | apache-2.0 | f8d90e92ce791650dc89944fca009fc36d9e3a90 | VladiMihaylenko/omim,edl00k/omim,dobriy-eeh/omim,65apps/omim,65apps/omim,Zverik/omim,vasilenkomike/omim,UdjinM6/omim,syershov/omim,milchakov/omim,yunikkk/omim,ygorshenin/omim,alexzatsepin/omim,mapsme/omim,kw217/omim,dobriy-eeh/omim,AlexanderMatveenko/omim,vasilenkomike/omim,rokuz/omim,mpimenov/omim,andrewshadura/omim,g... | crawler/wikitravel-optimize-articles.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport argparse\nimport os\n\nimport requests\n\nmy_domain = \"www.proporti.onl\"\nusername = \"emptysquare\"\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\n \"token\",\n metavar=\"PYTHON_ANYWHERE_... | python | edit | 1 | 0 | apache-2.0 | 5389fb8575251e2bd8ed18d96f4aa615e9a37bfa | ajdavis/twitter-gender-ratio,ajdavis/twitter-gender-distribution,ajdavis/twitter-gender-distribution,ajdavis/twitter-gender-ratio | deploy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 *-*\nimport os, sys, pprint; sys.path.insert(0, os.path.join(\"..\", \"..\"))\n\nfrom pattern.web import Wikia, WikiaArticleSet, URLTimeout\n\n# This example retrieves an article from Wikipedia (http://en.wikipedia.org).... | python | edit | 3 | 0 | bsd-3-clause | 5e42ab2aa7e5537a995e8d3ca81a29299a077116 | z0by/pattern,abcht/pattern,bijandhakal/pattern,NTesla/pattern,loretoparisi/pattern,Sri0405/pattern,pombredanne/pattern,shuangsong/pattern,jatinmistry13/pattern,sfprime/pattern,z0by/pattern,arne-cl/pattern,rebeling/pattern,clips/pattern,jatinmistry13/pattern,bijandhakal/pattern,codeaudit/pattern-1,aoom/pattern,ashhher3/... | examples/01-web/13-wikia.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport unittest\nimport http.client\n\nurl = \"localhost:8000\"\n\nclass Client:\n\tdef test_Connect(self):\n\t\tconnected = 0\n\t\ttry:\n\t\t\tself.conn = http.client.HTTPConnection(url)\n\t\t\tself.conn.connect()... | python | edit | 1 | 2 | bsd-3-clause | 4af368b3d3a4f5cfb8b78e19827c99078fb5ccab | starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer | client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport urllib2 as http\n\n# URL with GET to reboot router or status main page to tests\n#url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=... | python | edit | 3 | 0 | apache-2.0 | 258c24c86ebbcc4a4a347e916d520c0f98f82f90 | cleitonbueno/reboot_router | reboot_router_claro3G.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport grp\nimport logging\nimport os\nimport pwd\nimport sys\n\nfrom hades.common.cli import (\n ArgumentParser, parser as common_parser, setup_cli_logging,\n)\n\nlogger = logging.getLogger(__name__)\n\n\ndef drop_privileges(passwd, gro... | python | edit | 1 | 5 | mit | f3d3750986a8710c54c110c43c00fa152dbbd383 | agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades | src/hades/bin/su.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__ = '0.8.6'\n__author__ = 'Gunther Cox'\n__email__ = '<EMAIL>'\n__url__ = 'https://github.com/gunthercox/ChatterBo... | python | edit | 1 | 0 | bsd-3-clause | 6dc16ffca3fb2b3e95c7399fffd9f48493a8b969 | vkosuri/ChatterBot,gunthercox/ChatterBot | chatterbot/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom graphql.core.type import GraphQLScalarType\n\n\nclass ScalarMeta(type):\n def __new__(mcs, name, bases, attrs):\n if attrs.pop('abstract', False):\n return super(ScalarMeta, mcs).__new__(mcs, name, bases, attrs)\n\... | python | edit | 1 | 2 | mit | 5c7e83a20fe031e586a5a243c642506c9a2dbe9b | graphql-python/graphql-epoxy | epoxy/metaclasses/scalar.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.