messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ._version import __version__\nfrom .core.cartodataframe import CartoDataFrame\nfrom .core.logger import set_log_level\nfrom .io.carto import read_carto, to_carto, has_table, delete_table, describe_table, \\\n updat... | python | edit | 1 | 0 | bsd-3-clause | 07bf035221667bdd80ed8570079163d1162d0dd2 | CartoDB/cartoframes,CartoDB/cartoframes | cartoframes/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collector import ItemCollector\n\n\nclass ItemNumericAbsoluteFrequencyCollector(ItemCollector):\n\n def __init__(self, previous_collector_set = None):\n ItemCollector.__init__(self, previous_collector_set)\n self.absolute_freque... | python | edit | 1 | 1 | mit | 6c61e1000f3f87501b6e45a2715bd26a3b83b407 | davidfoerster/schema-matching | collector/absolutefrequency.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport os\n\nimport spacy\n\n\n@pytest.fixture(scope=\"session\")\ndef EN():\n return spacy.load(\"en\")\n\n@pytest.fixture(scope=\"session\")\ndef DE():\n return spacy.load(\"de\")\n\n\ndef pytest_addoption(parser):\n ... | python | edit | 3 | 4 | mit | 1318d0bc658d23d22452b27004c5d670f4c80d17 | raphael0202/spaCy,honnibal/spaCy,banglakit/spaCy,aikramer2/spaCy,recognai/spaCy,raphael0202/spaCy,recognai/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,oroszgy/spaCy.hu,raphael0202/spaCy,Gregory-Howard/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,explosion/spaCy,spacy-i... | spacy/tests/conftest.py | rejected_duplicate | Near-duplicate of sample 820 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__all__ = [\"SingleLayerRegularizer_ABC\", \"L1\", \"L2\"]\n\nclass SingleLayerRegularizer_ABC(object) :\n\t\"\"\"An abstract regularization to be applied to a layer.\"\"\"\n\n\tdef __init__(self, factor, *args, **kwargs) :\n\t\tself.name =... | python | edit | 3 | 1 | apache-2.0 | f338c4ff0c1ff30a3fa44182b0ce0dcbe4ae9dca | tariqdaouda/Mariana,tariqdaouda/Mariana,tariqdaouda/Mariana,JonathanSeguin/Mariana | Mariana/regularizations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport sys\nimport json\n\n\ndef read_conf(fname):\n if not os.path.isfile(fname):\n return {}\n\n with open(fname, 'r') as conf:\n return json.load(conf)\n\n\ndef build_qrc(resources)... | python | edit | 1 | 4 | bsd-2-clause | 49f61f7f47bbb69236ef319dfa861ea437a0aac4 | Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt | build_qrc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\nfrom twitter_text import TwitterText\n\ndef relative_time(timestamp):\n delta = (datetime.now() - datetime.fromtimestamp(timestamp))\n delta_s = delta.days * 86400 + delta.seconds\n if delta_s < 60:\n... | python | edit | 1 | 7 | bsd-3-clause | 9209ce05cae66f99166101905f6981da04eef656 | chromakode/wake | wake/filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass _base_model_class(dict):\n def __init__(self, json={}):\n self.update(json)\n self.update(self.__dict__)\n self.__dict__ = self\n\n def __repr__(self):\n return '%s(%s)' % (self.__class__.__name__, se... | python | edit | 1 | 1 | mit | 39d47ed5c0e89f41648a9bdd412b6190d274a488 | frc1418/tbapy | tbapy/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-*- coding: utf-8 -*-\n\ndevice_version = {\n \"android\": \"2.1.2\",\n \"android_donate\": \"2.1.2\",\n \"ios\": \"1.4.3\"\n}\n\n\n# Token duration in seconds\ntoken_duration = 3600\n\n# HTTP Status Code\nok = 200\nno_content = 2... | python | edit | 1 | 0 | mit | 138df31dc628daad0c60f062b05774d6c7d4338d | JohnSounder/AP-API,kuastw/AP-API,kuastw/AP-API,JohnSounder/AP-API | src/kuas_api/modules/const.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conans import ConanFile\n\n\nclass CtreConan(ConanFile):\n name = \"CTRE\"\n version = \"2.0\"\n license = \"MIT\"\n url = \"https://github.com/hanickadot/compile-time-regular-expressions.git\"\n author = \"Hana Dusíková... | python | edit | 1 | 1 | apache-2.0 | bd6c8b0354e9a32c47593ea19d09789d2a36912f | hanickadot/compile-time-regular-expressions,hanickadot/compile-time-regular-expressions,hanickadot/compile-time-regular-expressions,hanickadot/syntax-parser | conanfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This is the authoritative version number which should be used everywhere,\n# including setup, packaging, documentation generation etc.\n#\n# Normally, this should be available as fastats.__version__\nVERSION = '2017.1.3rc0'\n\n```\n\nAppl... | python | edit | 1 | 0 | mit | 9f8d134585a423773a6122c7312c1d88c6203867 | fastats/fastats,dwillmer/fastats | fastats/_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport os\nimport re\nfrom firefed import Firefed\nfrom feature import feature_map, Summary\n\n\ndef feature_type(val):\n try:\n return feature_map()[val]\n except KeyError as key:\n raise argparse.Argum... | python | edit | 1 | 6 | mit | 4bc31e675659af54ee26fe5df16a0ee3ebeb5947 | numirias/firefed | firefed/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport csv\n\ndef json_to_csv(json_file):\n\twith open(json_file, 'r') as jsonfile, open('output.csv', 'w', newline='') as csvfile:\n\t\tjsn = json.load(jsonfile)\n\t\tfieldnames = []\n\t\tfor name in jsn[0]:\n\t\t\tfieldnames ... | python | edit | 1 | 3 | mit | ae424937a7d9341862329cf7f04bd91ccdf345cd | SkullTech/json-csv-converter | converter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCreated on Dec 04, 2016\n\n@author: john papa\n\nCopyright 2016 John Papa. All rights reserved.\nThis work is licensed under the MIT License.\n\"\"\"\nfrom abc import ABCMeta, abstractproperty\n\nclass Card(metaclass=ABCMeta):\n\n ... | python | edit | 1 | 1 | mit | 6a5413ce81a606476734d9b37b33f683ed0c85e3 | johnpapa2/twenty-one,johnpapa2/twenty-one | cards/card.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A set of Resource objects used for Capability List\nIndexes and ResourceSync Description documents.\n\nFIXME - what should the ordering be?\n\"\"\"\n\nclass ResourceSet(dict):\n \"\"\"Implementation of class to store resources in C... | python | edit | 1 | 3 | apache-2.0 | 58daf6f2225cdf52079072eee47f23a6d188cfa9 | lindareijnhoudt/resync,resync/resync,lindareijnhoudt/resync,dans-er/resync,dans-er/resync | resync/resource_set.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom .main import special_command, RAW_QUERY, PARSED_QUERY\n\nlog = logging.getLogger(__name__)\n\n@special_command('\\\\dt', '\\\\dt', 'List or describe tables.', arg_type=PARSED_QUERY, case_sensitive=True)\ndef list_tables... | python | edit | 1 | 4 | bsd-3-clause | d2ad097e08b8c5e9d318968f0a6f859f03f7c07a | mdsrosa/mycli,jinstrive/mycli,j-bennet/mycli,martijnengler/mycli,martijnengler/mycli,mdsrosa/mycli,danieljwest/mycli,j-bennet/mycli,jinstrive/mycli,shoma/mycli,danieljwest/mycli,shoma/mycli | mycli/packages/special/dbcommands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef features_nav():\n return [\n {\n \"name\": \"Features\",\n \"link\": \"main.features\",\n },\n {\n \"name\": \"Roadmap\",\n \"link\": \"main.roadmap\",\n },\n ... | python | edit | 1 | 1 | mit | b6096dbe06f636a462f2c1ff85470599754f613f | gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | app/main/views/sub_navigation_dictionaries.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Provide the SavableMixin class.\"\"\"\nfrom ....const import API_PATH\n\n\nclass SavableMixin(object):\n \"\"\"Interface for RedditBase classes that can be saved.\"\"\"\n\n def save(self, category=None):\n \"\"\"Save the ... | python | edit | 1 | 1 | bsd-2-clause | d565786278eaf32761957dd1e064a5d549ef3ab4 | 13steinj/praw,RGood/praw,RGood/praw,darthkedrik/praw,darthkedrik/praw,leviroth/praw,gschizas/praw,leviroth/praw,gschizas/praw,praw-dev/praw,nmtake/praw,praw-dev/praw,nmtake/praw,13steinj/praw | praw/models/reddit/mixins/savable.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis is a setup.py script generated by py2applet\n\nUsage:\n python setup.py py2app\n\"\"\"\n\nfrom setuptools import setup\nfrom glob import glob\nimport syncplay\n\nAPP = ['syncplayClient.py']\nDATA_FILES = [\n ('resources',... | python | edit | 1 | 0 | apache-2.0 | 11220e1df49a2fb7dfd4032bb03f595188d8178f | NeverDecaf/syncplay,alby128/syncplay,NeverDecaf/syncplay,Syncplay/syncplay,alby128/syncplay,Syncplay/syncplay | buildPy2app.py | rejected_duplicate | Near-duplicate of sample 972 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport tensorflow as tf\n\ndef prelu(features, initializer=tf.constant_initializer(1), name=None):\n \"\"\"\n Implementa... | python | edit | 1 | 2 | mit | 55dfcce3d2c42433249f401ff5021820c341a691 | mikalyoung/recurrent-entity-networks,jimfleming/recurrent-entity-networks,mikalyoung/recurrent-entity-networks,jimfleming/recurrent-entity-networks | entity_networks/activations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom itertools import islice\n\nfrom .embeddings import text_to_pairs\n\n\ndef iter_pairs(fin, vocab, batch_size=10, nsamples=2, window=5):\n '''\n Convert a document stream to batches of pairs used for training embeddings.\n\n i... | python | edit | 1 | 3 | mit | 8a8d4905c169b9a1060f1283d0286c433af24f43 | seomoz/word2gauss,seomoz/word2gauss | word2gauss/words.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"Create a shop with article and order sequences.\n\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nimport click\n\nfrom byceps.services.shop.sequence imp... | python | edit | 1 | 1 | bsd-3-clause | 8111a7e32ec80a35f16c081664946292111485fe | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | scripts/create_shop.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.2.13 on 2020-11-23 13:44\n\nfrom django.db import migrations, models\n\n\ndef fill_new_geo_fields(apps, schema_editor):\n Offering = apps.get_model('marketplace', 'Offering')\n for offering in Offering.objects.... | python | edit | 1 | 3 | mit | 85df39bb82907dfec52735be3096c926c6b8bd54 | opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | src/waldur_mastermind/marketplace/migrations/0034_change_offering_geo_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport pytest\n\n\ndef pytest_addoption(parser):\n group = parser.getgroup('{{cookiecutter.plugin_name}}')\n group.addoption(\n '--foo',\n action='store_const',\n dest='foo',\n he... | python | edit | 1 | 1 | mit | 8ee2bed47efadf8bedf086295c0f67850fad6876 | s0undt3ch/cookiecutter-pytest-plugin,luzfcb/cookiecutter-pytest-plugin,pytest-dev/cookiecutter-pytest-plugin | pytest-{{cookiecutter.plugin_name}}/pytest_{{cookiecutter.plugin_name}}.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom invitation.models import InvitationKey, InvitationUser, InvitationRequest, InvitationCode\n\n\nclass InvitationKeyAdmin(admin.ModelAdmin):\n list_display = ('__unicode__', 'from_user', 'date_invited... | python | edit | 1 | 2 | bsd-3-clause | 849fbdf724528df99f2ac53d389274f7c2631f11 | adieu/django-invitation | invitation/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pymongo import MongoClient\n\n\n# Magic decorator for defining constants\ndef constant(f):\n def fset(self, value):\n raise TypeError\n\n def fget(self):\n return f()\n\n return property(fget, fset)\n\n\nclass Mo... | python | edit | 1 | 1 | mit | 8b5973b5581fb6da27891f8c2256886c1dc7e8a8 | Opportunity-Hack-2015-Arizona/Team1,Opportunity-Hack-2015-Arizona/Team1,Opportunity-Hack-2015-Arizona/Team1 | server/src/db_layer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTest Django settings\n\"\"\"\nimport os\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\nSECRET_KEY = 'fake-key'\n\nINSTALLED_APPS = [\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n ... | python | edit | 1 | 0 | bsd-3-clause | 0418609dd429a45a327ace191514ce2c4233ea11 | davizucon/ChatterBot,maclogan/VirtualPenPal,Reinaesaya/OUIRL-ChatBot,gunthercox/ChatterBot,Gustavo6046/ChatterBot,vkosuri/ChatterBot,Reinaesaya/OUIRL-ChatBot | tests_django/test_settings.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 | 3 | 4 | bsd-2-clause | 4fa22298598add3541baf8ac4b3636eb4c64b9ec | shellphish/driller | fuzzer/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\n\n\nkeys = OrderedDict([\n (\"j\", \"down\"),\n (\"k\", \"up\"),\n (\"ctrl f\", \"page down\"),\n (\"ctrl b\", \"page up\")]\n)\n\n```\n\nApply this change: Add ctrl+d/ctrl+u for page down an... | python | edit | 1 | 0 | mit | 8348f46fb78b55c5d2bcd6401f4041e8890072db | chhsiao90/gviewer | gviewer/keys/vim.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWSGI config for test2 project.\n\nThis module contains the WSGI application used by Django's development server\nand any production WSGI deployments. It should expose a module-level variable\nnamed ``application``. Django's ``runser... | python | edit | 1 | 0 | bsd-3-clause | a353e2227e9d8f7c5ccdb890fa70d4166751af22 | diegobz/django-admin-sso,matthiask/django-admin-sso,matthiask/django-admin-sso,diegobz/django-admin-sso | example/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n##-*- coding: utf-8 -*-\n#!/usr/bin/python\n\"\"\"\nUtilities related to Files.\n\"\"\"\nfrom io import FileIO, BufferedWriter\n\n__author__ = 'SeomGi, Han'\n__credits__ = ['SeomGi, Han']\n__copyright__ = 'Copyright 2015, Python Utils Proje... | python | edit | 1 | 3 | mit | 82d90487a43e309074e5572b6ac529a707345274 | iandmyhand/python-utils | fileutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport yaml\nimport sys\nfrom conversation import Conversation\n\n\ndef isLocal():\n return len(sys.argv) > 1 and sys.argv[1] == \"--local\"\n\nif isLocal():\n from local_mic import Mic\nelse:\n from mic import Mic\n\nif __name__ =... | python | edit | 5 | 2 | mit | 45bb9872978311774b97d9243358ffe9eaad3389 | syardumi/jasper-client,benhoff/jasper-client,tsaitsai/jasper-client,densic/HomeAutomation,sunu/jasper-client,fritz-fritz/jasper-client,jskye/voicehud-jasper,clumsical/hackthehouse-marty,djeraseit/jasper-client,markferry/jasper-client,jasperproject/jasper-client,densic/HomeAutomation,sunu/jasper-client,rowhit/jasper-cli... | client/main.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest as ut\n\n\nclass TravisBuildTest(ut.TestCase):\n def test_success(self):\n self.assertEqual(1, 1, \"1 is not equal to 1?!\")\n\n\ndef main():\n ut.main()\n\n\nif __name__ == '__main__':\n main()\n\n```\n\nApp... | python | edit | 1 | 1 | mit | d0f425d215f0d1c4f57a3517ad3e4c15f2b35e86 | PatrikValkovic/grammpy | tests/travis_test/TravisBuildTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\n\"\"\"Pytest config.\"\"\"\nimport os\nimport sys\nimport pytest\nfrom kiteconnect import KiteConnect\n\nsys.path.append(os.path.join(os.path.dirname(__file__), '../helpers'))\n\n\ndef pytest_addoption(parser):\n \"\"\... | python | edit | 1 | 7 | mit | 5dbdac674692b67f8f08627453b145c4d24ac32f | rainmattertech/pykiteconnect | tests/integration/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.http import HttpResponse\n\ndef dashboard(request):\n return HttpResponse('SUCCESS!')\n\n```\n\nApply this change: Add databases to dashboard context"
},
{
"role": "assistant",
... | python | edit | 3 | 2 | mit | 611218f302d30213fece13c1a8997f87a44afa70 | jakesen/djangosqladmin,jakesen/djangosqladmin,jakesen/djangosqladmin | djangosqladmin/databases/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom enum import Enum\nfrom . import us\n\n\nclass KEYBOARD_LAYOUT(Enum):\n US = 'US Keyboard Layout'\n\n\ndef get_scan_codes(data, keyboard_layout=KEYBOARD_LAYOUT.US):\n if keyboard_layout == KEYBOARD_LAYOUT.US:\n scancodes = ... | python | edit | 1 | 4 | bsd-2-clause | 15808c86b273363c9f6466107d0cbc14030a97fa | Yubico/yubikey-manager,Yubico/yubikey-manager | ykman/scanmap/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom ansiblelint import RulesCollection\nfrom ansiblelint.rules.VariableHasSpacesRule import VariableHasSpacesRule\nfrom test import RunFromText\n\nTASK_VARIABLES = '''\n- name: good variable format\n debug:\n msg: \"... | python | edit | 1 | 1 | mit | ababb2a603d91f407d4ecfc46ceabb2849413914 | willthames/ansible-lint | test/TestVariableHasSpaces.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport htmlify\nfrom socket import gethostname as hostname\nfrom time import time as unixTime\n\n\ndef showFooter():\n\t# Footer\n\thtmlify.dispHTML(\"br\")\n\thtmlify.dispHTML(\"hr\")\n\theart = \"<i class=\\\"fa fa-heart\\\" aria-hidden=\... | python | edit | 1 | 1 | apache-2.0 | 7cc357584ddd4f8e57783b5e0a462b5ad0daf411 | ISD-Sound-and-Lights/InventoryControl | footer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import connection, migrations\nfrom django.db.backends.postgresql.schema import DatabaseSchemaEditor\nfrom django.db.migrations.state import StateApps\n\n\ndef mark_messages_read(apps: StateApps, schema_editor: DatabaseSchema... | python | edit | 1 | 0 | apache-2.0 | 42d038f09bb9b24802ee78f92a5c7a309acf3a7a | zulip/zulip,andersk/zulip,showell/zulip,punchagan/zulip,hackerkid/zulip,showell/zulip,eeshangarg/zulip,showell/zulip,rht/zulip,rht/zulip,andersk/zulip,eeshangarg/zulip,zulip/zulip,punchagan/zulip,showell/zulip,andersk/zulip,hackerkid/zulip,rht/zulip,andersk/zulip,punchagan/zulip,zulip/zulip,punchagan/zulip,showell/zuli... | zerver/migrations/0301_fix_unread_messages_in_deactivated_streams.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.core import urlresolvers\nfrom django.utils import translation\nfrom localeurl import utils\n\ndef reverse(*args, **kwargs):\n reverse_kwargs = kwargs.get('kwargs', {})\n locale = utils.su... | python | edit | 1 | 2 | mit | ed326fba4f44552eeb206f3c5af9ad6f5e89ca44 | eugena/django-localeurl | localeurl/models.py | rejected_duplicate | Near-duplicate of sample 1227 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2018 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\nfrom recipe_engine import post_process\n\nDEPS = [\n 'bot_update',\n 'g... | python | edit | 1 | 1 | bsd-3-clause | 151c3484da58fa02f7d2c69454be3cb4e3395d05 | CoherentLabs/depot_tools,CoherentLabs/depot_tools | recipes/recipe_modules/bot_update/tests/ensure_checkout.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python -S\n\"\"\"\nxrender_test.py: Tests for xrender.py\n\"\"\"\n\nimport unittest\n\nimport xrender # module under test\n\nCSV = \"\"\"\\\nname,age\n<carol>,10\n<dave>,20\n\"\"\"\n\nclass FunctionsTest(unittest.TestCase):\n\n ... | python | edit | 7 | 1 | bsd-3-clause | d7ea417103bbe5a5c314b65a48dd823aca5df658 | andychu/webpipe,andychu/webpipe,andychu/webpipe,andychu/webpipe,andychu/webpipe | webpipe/xrender_test.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = '1.16.14'\n\nfrom model import BaseModel\n\nfrom feature import Feature, JSONFeature, TextFeature, CompressedFeature, \\\n PickleFeature\n\nfrom extractor import Node, Graph, Aggregator, NotEnoughData\n\nfrom bytestream imp... | python | edit | 42 | 0 | mit | 10a787c9f2147081001239029146b5b049db17f0 | JohnVinyard/featureflow,JohnVinyard/featureflow | featureflow/__init__.py | rejected_lint | Too many lint violations: 42 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.views.generic import TemplateView\nfrom . import resources, views\n\n# Uncomment the next two lines to enable the admin:\nfrom django.contrib.gis import admin\nadmin.autodisco... | python | edit | 1 | 0 | mit | 21bb022987c54b8c3343cfe5f4994203d799dc20 | openplans/streetscore,openplans/streetscore,openplans/streetscore | street_score/project/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nfrom django import forms\nfrom fluent_contents.forms import ContentItemForm\n\n\nclass TwitterEmbedAdminForm(ContentItemForm):\n def clean_twitter_url(self):\n \"\"\"\n Make sure the URL provided matches the twit... | python | edit | 1 | 3 | mit | 42bfa6b69697c0c093a961df5708f477288a6efa | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/plugins/twitter_embed/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nClient/Source\n\nGenerates and sends E1.31 packets over UDP\n\"\"\"\n\nimport socket\nimport struct\n\nfrom packet import E131Packet\n\ndef ip_from_universe(universe):\n # derive multicast IP address from Universe\n high_byte ... | python | edit | 1 | 2 | bsd-3-clause | c8c610c7249100e3e514b029a2f4209866910f3a | ptone/Lumos | lumos/source.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tests\n\ntry:\n import asyncio\n\n exec('''if 1:\n def hello_world(result, delay):\n result.append(\"Hello\")\n # retrieve the event loop from the policy\n yield from asyncio.sleep(delay)... | python | edit | 1 | 1 | apache-2.0 | aff5a09eb3d61f77cb277b076820481b8ba145d5 | overcastcloud/aioeventlet | tests/test_coroutine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom .base import BaseModule\n\nimport os\n\nclass HostInformationModule(BaseModule):\n key = 'host'\n\n def get_metrics(self):\n return {'name': os.uname()[1]}\n\n\ndef init():\n retu... | python | edit | 1 | 1 | mit | f9eac3523d4ab72d3abbfa8ee57801466552f18a | mixcloud/django-speedbar,theospears/django-speedbar,theospears/django-speedbar,mixcloud/django-speedbar,mixcloud/django-speedbar,theospears/django-speedbar | speedbar/modules/hostinformation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.test import Client, TestCase\n\n\nclass AdminTest(TestCase):\n def login(self):\n client = Client()\n u = User.objects.create(\n username=\"test\", is_acti... | python | edit | 1 | 1 | bsd-3-clause | 984089c3e963998d62768721f23d7e7c72880e39 | feinheit/django-fhadmin,feinheit/django-fhadmin,feinheit/django-fhadmin | tests/testapp/test_fhadmin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"QuesCheetah.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute... | python | edit | 3 | 0 | mit | 025da22574df8423bfdfea2f7b5bded5ab55054f | mingkim/QuesCheetah,mingkim/QuesCheetah,mingkim/QuesCheetah,mingkim/QuesCheetah | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3.8\n# ^ Use python 3.8 since Pip isn't configured for newer versions (3.9+)\n\n# Copyright 2020 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in... | python | edit | 1 | 0 | apache-2.0 | ac7102a85a30754d31d941395613b63574bfe026 | GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-pl... | xunit-autolabeler-v2/ast_parser/python_bootstrap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | python | edit | 1 | 1 | apache-2.0 | a86c7d9be7b7399b117b1289d6548f50b657efe6 | yeming233/horizon,openstack/horizon,bac/horizon,BiznetGIO/horizon,noironetworks/horizon,coreycb/horizon,sandvine/horizon,noironetworks/horizon,yeming233/horizon,ChameleonCloud/horizon,openstack/horizon,openstack/horizon,sandvine/horizon,openstack/horizon,NeCTAR-RC/horizon,yeming233/horizon,bac/horizon,sandvine/horizon,... | openstack_dashboard/dashboards/project/stacks/resource_types/tables.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom flask import Flask, render_template, jsonify, request\n\nfrom digitalocean import SSHKey, Manager\n\napp = Flask(__name__)\nmanager = Manager(token=\"24611cca29682d3d54f8208b67a47dbe8b6ea01b2c8103ba61150ece4b6259b6\")\nmy_d... | python | edit | 7 | 1 | mit | 4c39b8691762596c13cf197305c05fde5d4c3b5f | CapsLockHacks/do-server | app.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAdd _week_start_at field to all documents in all collections\n\"\"\"\nfrom backdrop.core.bucket import utc\nfrom backdrop.core.records import Record\nimport logging\n\nlog = logging.getLogger(__name__)\n\n\ndef up(db):\n for name... | python | edit | 1 | 4 | mit | ea947950d2ee8c6bd9f7693d977f0abfa1410548 | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | migrations/002_add_month_start.py | rejected_duplicate | Near-duplicate of sample 8127 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom nodes import Node\n\nclass Sort(Node):\n char = \"S\"\n args = 1\n results = 1\n \n @Node.test_func([[2,3,4,1]], [[1,2,3,4]])\n @Node.test_func([\"test\"], [\"estt\"])\n def func(self, a: N... | python | edit | 1 | 3 | mit | 796ac91df7dd4c63e76aa60b8eeec3d12354ecc7 | muddyfish/PYKE,muddyfish/PYKE | node/sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom lcp.settings.base import * # noqa\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),\n }\n}\n\n```\n\nApply this change: Set tempo... | python | edit | 2 | 0 | bsd-2-clause | 8d167a4db654dab46a0afbdd620349db9c68dc82 | mblayman/lcp,mblayman/lcp,mblayman/lcp | lcp/settings/staging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.mail import EmailMessage, get_connection\nfrom django.conf import settings\n\ntry:\n from froide.bounce.utils import make_bounce_address\nexcept ImportError:\n make_bounce_address = None\n\nHANDLE_BOUNCES = settings.F... | python | edit | 1 | 11 | mit | b0701b50bb5d3dd3a7255ef4cf205f75513d790e | fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide | froide/helper/email_sending.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nDEFAULT_TIMEOUT = 10\nIS_WINDOWS_PLATFORM = (sys.platform == \"win32\")\nLABEL_CONTAINER_NUMBER = 'com.docker.compose.container-number'\nLABEL_ONE_OFF = 'com.docker.compose.oneoff'\nLABEL_PROJECT = 'com.docker.compo... | python | edit | 1 | 0 | apache-2.0 | 58270d88592e6a097763ce0052ef6a8d22e9bbcb | johnstep/docker.github.io,mdaue/compose,danix800/docker.github.io,phiroict/docker,jeanpralo/compose,jzwlqx/denverdino.github.io,jonaseck2/compose,denverdino/compose,docker/docker.github.io,JimGalasyn/docker.github.io,andrewgee/compose,alexandrev/compose,jzwlqx/denverdino.github.io,albers/compose,denverdino/denverdino.g... | compose/const.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division, absolute_import\nimport llvm.core\nfrom .intrinsic import IntrinsicLibrary\nfrom .numba_intrinsic import is_numba_intrinsic\n\n__all__ = []\nall = {}\n\ndef _import_a... | python | edit | 4 | 3 | bsd-2-clause | 4250ae648ab975076fa8d87c8b40c0eca990fff7 | gmarkall/numba,sklam/numba,numba/numba,GaZ3ll3/numba,pombredanne/numba,pombredanne/numba,pombredanne/numba,gdementen/numba,stefanseefeld/numba,cpcloud/numba,numba/numba,shiquanwang/numba,IntelLabs/numba,stonebig/numba,sklam/numba,pitrou/numba,seibert/numba,IntelLabs/numba,numba/numba,gmarkall/numba,pombredanne/numba,cp... | numba/intrinsic/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom polyaxon.utils import config\n\nCLI_MIN_VERSION = config.get_string('POLYAXON_CLI_MIN_VERSION',\n is_optional=True,\n default='0.0.0')\nCLI_LATEST_VERSION = config.g... | python | edit | 1 | 0 | apache-2.0 | de35aee09f153999e0ae59879b2c57069616509b | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/polyaxon/config_settings/versions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tests.test_utils import recordtime\n\nfrom tests.pages.rollups import sign_in_email_auth\n\n\n@recordtime\ndef test_email_auth(driver, profile, base_url):\n # login email auth user\n sign_in_email_auth(driver, profile)\n # ass... | python | edit | 1 | 2 | mit | 2a93ed05a95aad9a27362f24abc766d9d1fc19fe | alphagov/notifications-functional-tests,alphagov/notifications-functional-tests | tests/functional/preview_and_dev/test_email_auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom mitmproxy import exceptions\nfrom mitmproxy import filt\n\n\nclass Replace:\n def __init__(self):\n self.lst = []\n\n def configure(self, options, updated):\n \"\"\"\n .replacements is a list... | python | edit | 1 | 4 | mit | f6ed06bf16329f075b52b89f2fdfb061bb1355c1 | mhils/mitmproxy,zlorb/mitmproxy,vhaupert/mitmproxy,laurmurclar/mitmproxy,mosajjal/mitmproxy,MatthewShao/mitmproxy,StevenVanAcker/mitmproxy,cortesi/mitmproxy,Kriechi/mitmproxy,Kriechi/mitmproxy,mhils/mitmproxy,MatthewShao/mitmproxy,mitmproxy/mitmproxy,StevenVanAcker/mitmproxy,mitmproxy/mitmproxy,laurmurclar/mitmproxy,St... | mitmproxy/builtins/replace.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.views.generic.base import TemplateView\nfrom django.views.generic.detail import DetailView\n\nfrom taggit.models import Tag\n\nfrom blog.models import Post\n\nclass BlogHomeView(TemplateView)... | python | edit | 3 | 1 | bsd-3-clause | 6edb40320a5338cbdb70321170f21ff9beb9d39a | brandonw/personal-site,brandonw/personal-site,brandonw/personal-site | personal-site/blog/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n@command(\"laws\")\ndef echo(nick, user, channel, message):\n argv = message.split(maxsplit=1)\n \n if len(argv) == 0:\n f = open('files/laws.txt', 'r')\n i = 1\n for line in f:\n say(channel, '{}. {... | python | edit | 6 | 7 | unlicense | a90041e444edd8a88bc264db5b1a9305ba94d88f | ccowmu/botler | commands/laws.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom EnsoMetricsGraph import EnsoMetricsTable\n\n#EnsoMetrics =[{'col1':'IPSL-CM5A-LR','col2':0.82,'col3':4.1},\n# {'col1':'IPSL-CM5A-MR','col2':1.2,'col3':4.5}]\nEnsoMetrics =[[1,2,3],[4,5,6]]\n\nfig=EnsoMetricsTable(EnsoMet... | python | edit | 1 | 0 | bsd-3-clause | e3054d71d3988a5fbc79c0ece8e37e06ef9e6851 | eguil/ENSO_metrics,eguil/ENSO_metrics | driveGraphs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport sys, os\n\nneeds_sphinx = '1.0'\n\nextensions = ['sphinx.ext.intersphinx', 'sphinxcontrib.issuetracker']\n\nsource_suffix = '.rst'\nmaster_doc = 'index'\n\nproject = u'sphinxcontrib-ansi'\ncopyright = u'201... | python | edit | 4 | 1 | bsd-2-clause | fecb3e2b610609ff24b8b19483e0c4b19f23e6c9 | sphinx-contrib/spelling,sphinx-contrib/spelling | ansi/doc/conf.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add DeleteStatement to control flow package"
},
{
"role": "assistant",
"content": "from numba.control_flow.control_flow import (ControlBlock, ControlFlowAnalysis,\n FuncDefExprNode)\nfr... | python | new_file | 7 | 0 | bsd-2-clause | acda2de1d6b317308a4a4f75d707774f06f16062 | cpcloud/numba,stonebig/numba,numba/numba,IntelLabs/numba,numba/numba,GaZ3ll3/numba,ssarangi/numba,stefanseefeld/numba,seibert/numba,stuartarchibald/numba,jriehl/numba,ssarangi/numba,stuartarchibald/numba,jriehl/numba,seibert/numba,stuartarchibald/numba,stefanseefeld/numba,stuartarchibald/numba,numba/numba,cpcloud/numba... | numba/control_flow/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth import get_user_model, authenticate\nfrom rest_framework import serializers\n\nfrom oscarapi.utils import overridable\n\n\nUser = get_user_model()\n\n\ndef field_length(fieldname):\n field = next(\n field ... | python | edit | 1 | 5 | bsd-3-clause | a95fa658116ce4df9d05681bbf4ef75f6af682c9 | crgwbr/django-oscar-api,regulusweb/django-oscar-api | oscarapi/serializers/login.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3.4\nfrom collections import namedtuple\n\n\n\"\"\"Document constants\"\"\"\ncountries = [\"Mordor\", \"Gondor\", \"Lorien\", \"Shire\"]\ngenders = [\"Male\", \"Female\"]\ncities = {\n 'Mordor': 'Minas Morgul,Barad Dur',... | python | edit | 1 | 1 | mit | f17a70980f1964e40a22fad5e54f4cafcdcf9d52 | Hethurin/UApp | useless_passport_validator/ulibrary.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2006, 2007, 2008 Andrey Golovizin\n#\n# This file is part of pybtex.\n#\n# pybtex is free software; you can redistribute it and/or modify\n# under the terms of the GNU General Public License as published by the\n# Free Soft... | python | edit | 1 | 0 | mit | 2515509c8e0d0461df043b26e74bcc5b574464a9 | live-clones/pybtex | pybtex/bibtex/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nEntry point for Django tests.\n\nThis script will setup the basic configuration needed by Django.\n\"\"\"\n\nimport sys\nfrom os.path import abspath, dirname, join\n\ntry:\n from django.conf import sett... | python | edit | 1 | 3 | isc | b6f0f3dfbf62b8b009155d3d510a908b73b53ab8 | Pawamoy/django-suit-dashboard,Pawamoy/django-suit-dashboard,Pawamoy/django-suit-dashboard,Pawamoy/django-suit-dashboard | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sentry_sdk\nfrom sentry_sdk.integrations.django import DjangoIntegration\n\nfrom .base import * # noqa\nfrom .base import env\n\nSECRET_KEY = env(\"SECRET_KEY\")\n# CELERY_BROKER_URL = env(\"CELERY_BROKER_URL\")\nUSE_SCHEDULER = Fal... | python | edit | 1 | 0 | mit | fd32bdaa00c61d11edcf0ca60e4058e6d0b6b2d0 | patrick91/pycon,patrick91/pycon | backend/pycon/settings/prod.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport markdown\nfrom datetime import datetime\nfrom twitter_text import TwitterText\nfrom flask import Markup\n\ndef relative_time(timestamp):\n delta = (datetime.now() - datetime.fromtimestamp(timestamp))\n delta_s = delta.days * 86... | python | edit | 1 | 7 | bsd-3-clause | 8c1cc6895f5f8772d2b09a9efab7395b0a6b39ba | chromakode/wake | wake/filters.py | rejected_duplicate | Near-duplicate of sample 11836 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Django\n# Third-Party\nfrom rest_framework.documentation import include_docs_urls\nfrom rest_framework.schemas import get_schema_view\n# from django.views.generic import TemplateView\n# from api.views import variance, ann\nfrom django.con... | python | edit | 1 | 0 | bsd-2-clause | 978fe280a610c6cf9fb83b4726c7c1f536b92720 | dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore,barberscore/barberscore-api | project/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\n\nfrom changes.config import db, queue\nfrom changes.constants import Status\nfrom changes.models.build import Build\n\n\ndef cleanup_builds():\n \"\"\"\n Look for any jobs which haven't check... | python | edit | 1 | 3 | apache-2.0 | d60112e569e13333cfd6316d30683282ceff8bee | dropbox/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes | changes/jobs/cleanup_builds.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyqode.core import modes\nfrom pyqode.core.api import TextHelper\n\n\nclass AutoCompleteMode(modes.AutoCompleteMode):\n def __init__(self):\n super(AutoCompleteMode, self).__init__()\n self.QUOTES_FORMATS.pop(\"'\")\n ... | python | edit | 1 | 2 | mit | eb1d581a94f87feb2bc09dbf45b13de282a205e8 | pyQode/pyqode.json,pyQode/pyqode.json | pyqode/json/modes/autocomplete.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport wpilib\n\nclass PreciseDelay:\n '''\n Used to synchronize a timing loop.\n \n Usage::\n \n delay = PreciseDelay(time_to_delay)\n \n while something:\n # do ... | python | edit | 1 | 3 | bsd-3-clause | 9445c23e70cabe519d51282bf4849a8d08e21039 | robotpy/robotpy-wpilib-utilities,Twinters007/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities,Twinters007/robotpy-wpilib-utilities | robotpy_ext/misc/precise_delay.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nimport os\n\nfrom lib.util import safe_mkdir, extract_zip, tempdir, download\n\n\nSOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))\nFRAMEWORKS_URL = 'https://github.com/atom/atom... | python | edit | 1 | 2 | mit | a60fa6989abd1080cafc860121885ec210d16771 | Rokt33r/electron,shiftkey/electron,Jacobichou/electron,shaundunne/electron,systembugtj/electron,dkfiresky/electron,subblue/electron,wan-qy/electron,brave/muon,preco21/electron,farmisen/electron,icattlecoder/electron,sshiting/electron,dkfiresky/electron,kostia/electron,MaxWhere/electron,chrisswk/electron,electron/electr... | script/update-frameworks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nCreated on Thu 6 March 2014\n\nContains testing routines for `SolarCoreModel.py`.\n\n@author Kristoffer Braekken\n\"\"\"\nimport SolarCoreModel\n\nfrom numpy import log10\n\ndef opacity_test(tol=1.e-10):\n ... | python | edit | 3 | 2 | mit | e4fcebfe4e87b57ae8505437f54c69f3afd59c04 | PaulMag/AST3310-Prj01,PaulMag/AST3310-Prj01 | python/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\n\n\nclass Point(object):\n \"\"\"Contains information about for each scan point\n\n Attributes:\n positions (dict): Dict of str position_name -> float position for each\n scannabl... | python | edit | 1 | 1 | apache-2.0 | ea93225dd2da27a18f61de0a92f371766d5317ec | dls-controls/scanpointgenerator | scanpointgenerator/point.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom django import forms\nfrom eve_api.models import EVEAccount, EVEPlayerCharacter, EVEPlayerCorporation\n\n\nclass EveAPIForm(forms.Form):\n \"\"\" EVE API input form \"\"\"\n\n user_id = forms.IntegerField(label=u'User... | python | edit | 5 | 4 | bsd-3-clause | 09a6e2528f062581c90ed3f3225f19b36f0ac0f9 | nikdoof/test-auth | eve_api/forms.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom queries import Grok\n\n\ndef print_monthly_views(site, pages, year, month):\n grok = Grok(site)\n for page in pages:\n result = grok.get_views_for_month(page, year, month)\n print result['... | python | edit | 2 | 2 | mit | c721ba7badc0b980d9c58822b5c0b626b1321f1a | Commonists/Grokapi | grokapi/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 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\nfrom telemetry import benchmark\nfrom telemetry.unittest import tab_test_... | python | edit | 1 | 1 | bsd-3-clause | f9bdf777a13404ba25e0e8cdf99a3554320529c9 | jaruba/chromium.src,Chilledheart/chromium,dednal/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu120... | tools/telemetry/telemetry/core/backends/chrome/inspector_memory_unittest.py | rejected_duplicate | Near-duplicate of sample 3347 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nresolver = None\n\nif sys.platform == \"linux2\":\n from . import linux\n resolver = linux.Resolver\nelif sys.platform == \"darwin\":\n from . import osx\n resolver = osx.Resolver\nelif sys.platform.startswith(\"fr... | python | edit | 1 | 0 | mit | 73b7da1a0360f50e660e1983ec02dd5225bde3a3 | mosajjal/mitmproxy,vhaupert/mitmproxy,laurmurclar/mitmproxy,Kriechi/mitmproxy,dwfreed/mitmproxy,xaxa89/mitmproxy,ujjwal96/mitmproxy,mosajjal/mitmproxy,Kriechi/mitmproxy,mitmproxy/mitmproxy,mitmproxy/mitmproxy,laurmurclar/mitmproxy,ujjwal96/mitmproxy,vhaupert/mitmproxy,zlorb/mitmproxy,StevenVanAcker/mitmproxy,Kriechi/mi... | mitmproxy/platform/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"py.test configuration\"\"\"\nimport os\nfrom pathlib import Path\nimport numpy\nimport pytest\n\nfrom .utils.bids import collect_data\n\ntest_data_env = os.getenv('TEST_DATA_HOME',\n str(Path.home() / '.cache'... | python | edit | 1 | 1 | apache-2.0 | d43a08706f3072a0b97d01526ffd0de0d4a4110c | oesteban/niworkflows,oesteban/niworkflows,poldracklab/niworkflows,oesteban/niworkflows,poldracklab/niworkflows | niworkflows/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom .document import Document\n\nclass Application(object):\n \"\"\"An Application is a factory for Document instances\"\"\"\n\n def __init__(self):\n self._handlers = []\n\n # TODO... | python | edit | 1 | 3 | bsd-3-clause | c24bd93a88a3998ac306a82f7c74b0a782aa8e04 | azjps/bokeh,timsnyder/bokeh,quasiben/bokeh,timsnyder/bokeh,azjps/bokeh,philippjfr/bokeh,justacec/bokeh,Karel-van-de-Plassche/bokeh,justacec/bokeh,philippjfr/bokeh,rs2/bokeh,phobson/bokeh,ericmjl/bokeh,stonebig/bokeh,htygithub/bokeh,phobson/bokeh,stonebig/bokeh,Karel-van-de-Plassche/bokeh,DuCorey/bokeh,gpfreitas/bokeh,q... | bokeh/application.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Spherical harmonic vector wind analysis.\"\"\"\n# Copyright (c) 2012-2013 Andrew Dawson\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"S... | python | edit | 5 | 0 | mit | b19b3d1e3433465e6e05a9b50d79206b7049cbf6 | nicolasfauchereau/windspharm,ajdawson/windspharm | lib/windspharm/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport httplib2\nimport json\nimport itertools\nfrom collections import defaultdict\n\nfrom apiclient.discovery import build\nfrom oauth2client.file import Storage\nfrom oauth2client.client import flow_from_clientsecrets\nfrom oauth2client.... | python | edit | 5 | 3 | mit | 26a4dc79b6ef9b19b9c5f2394386980aa452dc8e | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | licensing/data/location.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport time\nimport pwd\n\nfrom .utils import effective_user\n\n\nclass Tool(object):\n USER_NAME_PATTERN = 'tools.%s'\n\n class InvalidToolException(Exception):\n pass\n\n def __init__(self, name, username, uid, ... | python | edit | 1 | 3 | mit | 7f08e4c9fd370e375ad8e174a98478c0281ecb6e | wikimedia/operations-software-tools-manifest | tools/manifest/tool.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nGotoNewest\n\nA tool to quickly transfer to the latest directory\ncreated in a base directory, provided the name of\nthe base directory is supplied as an argument\n'''\n\nimport os\n\ndef transfer(basepath=None):\n ''' Transfer to t... | python | edit | 3 | 4 | bsd-2-clause | 290280725db406dac9a185b08600bcb0fba3d2e3 | ambidextrousTx/GotoNewest | src/gn.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import render_template, request, flash\nfrom flask_login import login_required\n\nfrom .. import main\nfrom ... import data_api_client\nfrom ..auth import role_required\n\n\n@main.route('/buyers', methods=['GET'])\n@login_require... | python | edit | 1 | 2 | mit | e8afa1408618d7dc4e39b84963199dd87c217ef9 | alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend | app/main/views/buyers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nif __name__ == '__main__':\n import sys\n import os\n import gitautodeploy\n sys.stderr.write(\"\\033[1;33m[WARNING]\\033[0;33m GitAutoDeploy.py is deprecated. Please use \\033[1;33m'python gitautodeploy... | python | edit | 3 | 0 | mit | 29efb23b2edb46aed4be835787d461ee1ada96f6 | evoja/docker-Github-Gitlab-Auto-Deploy,evoja/docker-Github-Gitlab-Auto-Deploy | GitAutoDeploy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\n\nfrom django.shortcuts import render\nfrom django.http import HttpResponse\n\nfrom . import services\n\ndef index(request):\n data = services.overview()\n return render(request, 'index.html', data)\n\ndef meter_runs(reque... | python | edit | 1 | 2 | mit | 608325c33cb2d446b89c263ba0bb02ced5c4ffe8 | impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore | portal/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nurl = \"https://ua.api.yle.fi/graphql?app_id=8d7303fe&app_key=105875199ef3a1f7e0fbf7e2834b2dc&query={uutisetMostRecentNews:articleList(publisher:YLE_UUTISET,limit:100,offset:0,coverage:NATIONAL){meta{count,total,remaining... | python | edit | 2 | 0 | mit | cca2bd0d4cfb14dbf85e4275fd9d064b9ffa08cc | HIIT/mediacollection | urlgetters/yle_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom CommandTemplate import CommandTemplate\nfrom IrcMessage import IrcMessage\n\n\nclass Command(CommandTemplate):\n\ttriggers = ['join']\n\thelptext = \"Makes me join another channel, if I'm allowed to at least\"\n\t\n\tdef execute(self, ... | python | edit | 3 | 6 | mit | 37170b156e6a284d5e5df671875070a3fcac9310 | Didero/DideRobot | commands/join.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\n\n\nclass SsoConfig(AppConfig):\n name = 'sso'\n github_client_id = '844189c44c56ff04e727'\n github_client_secret = '0bfecee7a78ee0e800b6bff85b08c140b91be4cc'\n\n```\n\nApply this change: Load git... | python | edit | 1 | 0 | mit | 54d67ce544e95ecb58a62062ffe50fcd95db6f09 | favoritemedium/sso-prototype,favoritemedium/sso-prototype | sso/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\nimport time\n\nfrom coverage.data import CoverageJsonData\nfrom coverage.sqldata import CoverageSqliteData\n\nNUM_FILES = 1000\nNUM_LINES = 1000\n\ndef gen_data(cdata):\n rnd = random.Random()\n rnd.seed(17)\n\n def ... | python | edit | 1 | 3 | apache-2.0 | b282c54ebaaae13aa8b81f2380cdc20acaa9fc69 | hugovk/coveragepy,nedbat/coveragepy,hugovk/coveragepy,nedbat/coveragepy,hugovk/coveragepy,nedbat/coveragepy,hugovk/coveragepy,hugovk/coveragepy,nedbat/coveragepy,nedbat/coveragepy | lab/gendata.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom vidscraper import errors\nfrom vidscraper.sites import (\n vimeo, google_video, youtube)\n\nAUTOSCRAPE_SUITES = [\n vimeo.SUITE, google_video.SUITE, youtube.SUITE,\n blip.SUITE]\n\n\ndef scrape_suite(url, suite, fields=None):\... | python | edit | 1 | 5 | bsd-3-clause | 711c35ce82479f0ced86ef7b3dff083c49f7ee09 | pculture/vidscraper,pculture/vidscraper | vidscraper/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\n\n\nclass Typecode(object):\n NONE = 0\n INT = 1 << 0\n FLOAT = 1 << 1\n STRING = 1 << 2\n DATETIME =... | python | edit | 1 | 2 | mit | 8d170381532228ffbef32534ca1217714b5f1594 | thombashi/DataProperty | dataproperty/type/_typecode.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Handles all imports from jnius to prevent conflicts resulting from attempts\nto set JVM options while the VM is already running.\"\"\"\n\nimport os\nimport warnings\nimport jnius_config\n\nif '-Xmx4g' not in jnius_config.get_options()... | python | edit | 5 | 0 | bsd-2-clause | ba9386fc7c14be6335896e1d888c822db972dfe1 | bgyori/indra,johnbachman/belpy,johnbachman/indra,bgyori/indra,sorgerlab/indra,jmuhlich/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,jmuhlich/indra,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,johnbachman/belpy,sorgerlab/indra,jmuhlich/indra,bgyori/indra,johnbachman/indra,pvtodorov/indra,jo... | indra/java_vm.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom .common import *\n\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'singlepoint',\n }\n}\n\nPUBLIC_ROOT = os.path.join(os.sep, 'var', 'www', 'singlepoint', ... | python | edit | 4 | 0 | mit | d66b4be946785d7b9223a0a3497d8ec4a4cebea9 | xobb1t/ddash2013,xobb1t/ddash2013 | project/settings/production.py | rejected_lint | Too many lint violations: 4 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.