messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom unittest import TestCase\n\nimport re\n\nfrom app import generate_profiles\n\n\nclass TestGenerateProfiles(TestCase):\n gen = generate_profiles.GenerateProfiles\n network_environment = \"%s/misc/network-environment\" %... | python | edit | 1 | 2 | mit | a50cca78f400077d56b328a20661c1a9d1e2aff4 | nyodas/enjoliver,kirek007/enjoliver,nyodas/enjoliver,kirek007/enjoliver,JulienBalestra/enjoliver,nyodas/enjoliver,kirek007/enjoliver,JulienBalestra/enjoliver,JulienBalestra/enjoliver,JulienBalestra/enjoliver,nyodas/enjoliver,kirek007/enjoliver,JulienBalestra/enjoliver,nyodas/enjoliver,kirek007/enjoliver | app/tests/test_generate_profiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport pytest\n\nfrom io import StringIO\n\nfrom teuthology.exceptions import CommandFailedError\n\nlog = logging.getLogger(__name__)\n\n\nclass TestRun(object):\n \"\"\"\n Tests to see if we can make remote procedure ... | python | edit | 1 | 2 | mit | abf91ac218c2386a2366eae243a15b1215f47832 | ktdreyer/teuthology,ceph/teuthology,ceph/teuthology,ktdreyer/teuthology | teuthology/task/tests/test_run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Parse data from TVMaze.\"\"\"\n\nimport datetime\nimport typing\n\n\ndef parse_date(\n val: typing.Optional[str],\n) -> typing.Optional[datetime.date]:\n \"\"\"\n Parse date from TVMaze API.\n\n :param val: A date stri... | python | edit | 1 | 3 | mit | f04ccb741ea059aed8891f647ff19b26172ba61c | tvmaze/tvmaze | src/tvmaze/parsers/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbinobj\n======\n\nA Python library for reading and writing structured binary data.\n\"\"\"\n\n__version_info__ = (0, 1, 0)\n__version__ = '.'.join(str(v) for v in __version_info__)\n\n```\n\nApply this change: Add wildcard imports a... | python | edit | 5 | 0 | bsd-3-clause | 44db9de83aad25a1302ac4c31450a525c0095583 | dargueta/binobj | binobj/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.db import models\n\nfrom django_extensions.db.models import TimeStampedModel\n\n\nclass {{ cookiecutter.model_name }}(TimeStampe... | python | edit | null | null | mit | 49f506dce441b3a8fb1e2eb0f06c26661721785e | rickydunlop/cookiecutter-django-app-template-drf-haystack | {{cookiecutter.app_name}}/models.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pymanopt\n\n\n# Package information\nproject = \"Pymanopt\"\nauthor = \"Jamie Townsend, Niklas Koep, Sebastian Weichwald\"\ncopyright = \"2016-2021, {:s}\".format(author)\nrelease = version = pymanopt.__version__\n\n# Build settings\... | python | edit | 1 | 0 | bsd-3-clause | f1f6848557428e9b2fc39c6b0d476279a0f5dd5c | pymanopt/pymanopt,pymanopt/pymanopt | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# データの作成\nx = np.arange(0, 7, 0.1)\ny = np.sin(x)\n\n# グラフの描画\nplt.plot(x, y)\nplt.show()\n```\n\nApply this change: Modify np.arange from 7 to 6"
},
{
"role": ... | python | edit | 1 | 0 | mit | 9cc39104b96a197a1f42667964f32f9671b5125f | kgsn1763/deep-learning-from-scratch,oreilly-japan/deep-learning-from-scratch | ch01/sin_graph.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport binascii\nimport os\nimport time\n\nfrom optparse import OptionParser\n\n\ndef gen_random_object_id():\n timestamp = '{0:x}'.format(int(time.time()))\n rest = binascii.b2a_hex(os.urandom(8))\n return timestamp + rest\n\nif _... | python | edit | 3 | 1 | mit | 7abecbcd949278eec4082b733c5d687ba8bf11d4 | mxr/random-object-id | random-object-id.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\n\nextensions = [\n 'sphinx.ext.doctest',\n 'sphinx.ext.coverage',\n 'sphinx.ext.viewcode',\n 'sphinx.ext.autodoc',\n]\n\nmaster_doc = 'index'\nproject = u'openprovider.py'\ncopyright = u'2014, Antagonist B... | python | edit | 2 | 0 | mit | 01f9649c9a661f1bf7289d3e6ea585b00ed48af3 | AntagonistHQ/openprovider.py | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\ntemplates_path = [\"templates\"]\n\nsource_suffix = \".rst\"\n\nmaster_doc = \"index\"\n\nproject = \"dependencies\"\ncopyright = \"2016-2018, Artem Malyshev\"\nauthor = \"Artem Malyshev\"\n\nversion = \"0.14\"\nre... | python | edit | 1 | 0 | bsd-2-clause | 44798dff0992d1c4e62bea97d4deaee1eed657e7 | proofit404/dependencies,proofit404/dependencies,proofit404/dependencies,proofit404/dependencies | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"Twilio backend for the RapidSMS project.\"\n\n\n__version__ = '0.3.0'\n\n```\n\nApply this change: Develop is now v1.0 dev."
},
{
"role": "assistant",
"content": "\"Twilio backend for the RapidSMS project.\"\n\n\n__version__ =... | python | edit | 1 | 0 | bsd-3-clause | 09462f834d2c61b106cfa44eb45360c10db47f35 | caktus/rapidsms-twilio | rtwilio/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport logging\n\nfrom pyramid.i18n import TranslationStringFactory\n\nfrom c2cgeoportal.models import * # noqa\n\n_ = TranslationStringFactory('geoportailv3')\nlog = logging.getLogger(__name__)\n\n```\n\nApply t... | python | edit | 4 | 0 | mit | 0c01cb42527fdc2a094d3cc3f2f99a75da6992fa | Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,geoportallux/geoportailv3-gisgr,geoportallux/geoportailv3-gisgr,geoportallux/geoportailv3-gisgr,Geoportail-Luxembourg/geoportailv3,geoportallux/geoportailv3-gisgr | geoportailv3/models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" This package contains native Python implementations of several `The NURBS Book <http://www.springer.com/gp/book/9783642973857>`_ algorithms for generating B-spline / NURBS curves and surfaces. It also provides a data structure for st... | python | edit | 10 | 0 | mit | 98190f0e96b2e2880e81b4801ebd5b04c1e9f1d8 | orbingol/NURBS-Python,orbingol/NURBS-Python | geomdl/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport statistics\n\nfrom cref.structure import rmsd\nfrom cref.app.terminal import download_pdb, download_fasta, predict_fasta\n\n\npdbs = ['1zdd', '1gab']\nruns = 100\nfragment_sizes = range(5, 13, 2)\nnumber_of_clusters = rang... | python | edit | 1 | 0 | mit | c3284516e8dc2c7fccfbf7e4bff46a66b4ad2f15 | mchelem/cref2,mchelem/cref2,mchelem/cref2 | cref/evaluation/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.conf import settings\nfrom django.contrib import admin\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\n\nfrom capomastro.views import HomeView\n\n\nadmin... | python | edit | 1 | 0 | mit | 41b8cefb881e294b3bcdbb497d21fe1153a25725 | caio1982/capomastro,caio1982/capomastro,timrchavez/capomastro,timrchavez/capomastro,caio1982/capomastro | capomastro/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\nfrom re import sub\nimport sys\nfrom os.path import basename, splitext\nfrom pyspark.sql import SparkSession, Row\n\ndef parseCTS(f):\n res = dict()\n text = ''\n locs = []\n for line in f[... | python | edit | 3 | 4 | apache-2.0 | b0d24c3aa1bea35afb81ee01fd238c8a263527c9 | ViralTexts/vt-passim,ViralTexts/vt-passim,ViralTexts/vt-passim | scripts/cts-load.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django import forms\nfrom django.conf import settings\n\nfrom .models import Page\nfrom glitter.integration import glitter_app_pool\n\n\nclass DuplicatePageForm(forms.... | python | edit | 1 | 3 | bsd-3-clause | 76bc5171cbccf9ce171f8891f24b66daa91aef0d | developersociety/django-glitter,developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter,blancltd/django-glitter,blancltd/django-glitter | glitter/pages/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement Expr class -- the base of it all."
},
{
"role": "assistant",
"content": "\"\"\"The compare module contains the components you need to \ncompare values and ensure that your expectations are met.\n\nTo make use of this mo... | python | new_file | 1 | 1 | bsd-3-clause | 370bc073d56615a5aaa3668ab89d96cdd49ef17d | rudylattae/compare,rudylattae/compare | compare.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add mandatory argument: path to file"
},
{
"role": "assistant",
"content": "import argparse\n\ndef run_main():\n path = file_path()\n\ndef file_path():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"path\")... | python | new_file | 3 | 1 | mit | 5c681567c359c76e9e323a82ab9162f5098b6421 | ahitrin-attic/measurator-proto | measurator/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding:utf-8 -*-\n\n# Standard library imports\nfrom __future__ import unicode_literals\nimport uuid\nimport requests\n\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils import translation\n\nimport slumber\n... | python | edit | 1 | 4 | bsd-3-clause | c8152d1ce0c9f83460da3d384a532d6d064d6543 | kapt-labs/django-cross-site-urls,kapt-labs/django-cross-site-urls | cross_site_urls/urlresolvers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport textwrap\n\ntry:\n import gi\n\n gi.require_version(\"Gst\", \"1.0\")\n from gi.repository import GLib, GObject, Gst\nexcept ImportError:\n print(\n textwrap.dedent(\n \"\"\"\n ERROR: ... | python | edit | 1 | 0 | apache-2.0 | 509669de3b61f7f67c5c3603f696b06ad759a7b3 | adamcik/mopidy,mopidy/mopidy,jodal/mopidy,jcass77/mopidy,mopidy/mopidy,jodal/mopidy,mopidy/mopidy,kingosticks/mopidy,adamcik/mopidy,kingosticks/mopidy,kingosticks/mopidy,jodal/mopidy,adamcik/mopidy,jcass77/mopidy,jcass77/mopidy | mopidy/internal/gi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\n\nfrom django.utils.timezone import utc\n\nfrom .models import Ticket\n\n\nclass TicketServices():\n def edit_ticket_once(self, **kwargs):\n id_list = kwargs.get('id_list')\n edit_tags = kwargs.get('edit_ta... | python | edit | 1 | 6 | mit | bd181f778e74bbd070fd4f46329ad5c8dc637ea7 | prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine | zendesk_tickets_machine/tickets/services.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, request\nfrom werkzeug.utils import secure_filename\nimport os\n\napp = Flask(__name__)\napp.config['UPLOAD_FOLDER'] = 'uploads/'\n\n\n@app.route('/')\ndef hello_world():\n return 'Team FifthEye!'\n\n@app.route('... | python | edit | 1 | 2 | mit | 0e4db0303d4a8212a91082ace75df95fd440bbfa | navinpai/LMTAS,navinpai/LMTAS,navinpai/LMTAS | server/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Provides cvloop, a ready to use OpenCV VideoCapture mapper, designed for jupyter notebooks.\"\"\"\nimport sys\n\nOPENCV_FOUND = False\nOPENCV_VERSION_COMPATIBLE = False\n\ntry:\n import cv2\n OPENCV_FOUND = True\nexcept Exceptio... | python | edit | 4 | 0 | mit | 418357ead146a98f2318af6c76323e2705b79cec | shoeffner/cvloop | cvloop/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom code import InteractiveConsole\n\nclass EspressoConsole(InteractiveConsole, object):\n def interact(self):\n banner = \"\"\"███████╗███████╗██████╗ ██████╗ ███████╗███████╗███████╗ ██████╗ \n██╔════╝█... | python | edit | 1 | 2 | bsd-3-clause | c4fa912acc573f5590510c0345d9a9b3bc40f4c8 | ratchetrobotics/espresso | espresso/repl.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport argparse\nimport sys\nimport logging\n\nimport elasticsearch\nimport elasticsearch.helpers\n\n\nES_NODES = 'uct2-es-door.mwt2.org'\nVERSION = '0.1'\nSOURCE_INDEX = '.kibana'\nTARGET_INDEX = 'osg-connect-kiban... | python | edit | 3 | 1 | apache-2.0 | 11cbeb3d0140e79fc0bedf5039a3c70f626062eb | DHTC-Tools/logstash-confs,DHTC-Tools/logstash-confs,DHTC-Tools/logstash-confs | condor/python/resync_dashboards.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom .base import SimSootExpr\n\n\nclass SimSootExpr_Phi(SimSootExpr):\n def __init__(self, expr, state):\n super(SimSootExpr_Phi, self).__init__(expr, state)\n\n def _execute(self):\n\n if len(self.expr.values) != 2:\... | python | edit | 1 | 6 | bsd-2-clause | 5b45d4996de8c15dfc09905b0e63651fdbb2fcc6 | schieb/angr,iamahuman/angr,angr/angr,schieb/angr,angr/angr,angr/angr,iamahuman/angr,schieb/angr,iamahuman/angr | angr/engines/soot/expressions/phi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\nimport sys\nimport re\nimport yaml\n\nFILE = sys.argv[1]\nYAML = sys.argv[2]\nTYPE = sys.argv[3]\n\nheader = open(YAML, \"r\")\ntext = open(FILE, \"r\")\ncopy = open(FILE+\"_NEW\", \"wt\")\n\ndocs = yaml.load_all(h... | python | edit | 1 | 0 | mit | 73d0225b64ec82c7a8142dbac023be499b41fe0f | PoisotLab/PLMT | figures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# print-divs.py\n\ndef printDivs(num):\n\tfor i in range(num):\n\t\tprint('<div class=\"item\">Item ' + str(i+1) + '</div>')\n\nprintDivs(20)\n```\n\nApply this change: Add dummy text to divs."
},
{
"role": "assistant",
"content... | python | edit | 1 | 2 | apache-2.0 | 62b74e6d6452012f8ad68810446a3648749a3fee | scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback | collections/show-test/print-divs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.2.24 on 2021-11-19 14:36\n\nfrom django.db import migrations\nfrom corehq.messaging.scheduling.scheduling_partitioned.models import CaseTimedScheduleInstance\nfrom corehq.sql_db.util import get_db_aliases_for_partiti... | python | edit | 1 | 2 | bsd-3-clause | 2834a22489ebe801743434dcf26e727448355756 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/messaging/scheduling/scheduling_partitioned/migrations/0009_update_custom_recipient_ids.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.blueprints.site.guest_server.forms\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nfrom flask_babel import lazy_gette... | python | edit | 1 | 0 | bsd-3-clause | 5bcb267761e6c2694111757ee4fcf2a050f6c556 | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/blueprints/site/guest_server/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2010 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 autotest_lib.client.cros import chrome_test\n\nclass desktopui_S... | python | edit | 1 | 1 | bsd-3-clause | b597956cd427a3b830a498c69602753ce6117119 | dednal/chromium.src,Jonekee/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,keishi/chromium,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,dushu1203/chromium.src,dednal/chromium.src,chuan9/chromi... | chrome/test/chromeos/autotest/files/client/site_tests/desktopui_SyncIntegrationTests/desktopui_SyncIntegrationTests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\nimport requests\nimport os\nimport shutil\nfrom appdirs import user_data_dir\nfrom airpy.install import airinstall\nfrom airpy.list import airlist\nfrom airpy.start import airstart\nfrom airpy.remove import airremove\nfrom air... | python | edit | 6 | 1 | mit | 3ab5b791494111a3b0d962b8b5de588665498653 | kevinaloys/airpy | airpy/main.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n.. module:: freebayes\n :platform: Unix, OSX\n :synopsis: A wrapper module for calling ScanIndel.\n\n.. moduleauthor:: Daniel Gaston <<EMAIL>>\n\"\"\"\n\nfrom ddb_ngsflow import pipeline\n\n\ndef run_flt3_itdseek(job, config, na... | python | edit | 1 | 1 | mit | 2cecc2e197e4a4089e29b350179103e323136268 | dgaston/ddb-ngsflow,dgaston/ddbio-ngsflow | ddb_ngsflow/variation/sv/itdseek.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n http://djangosnippets.org/snippets/2311/\n Ensure South will update our custom SQL during a call to `migrate`.\n\"\"\"\nimport logging\nimport traceback\n\nfrom south.signals import post_migrate\n\nlogger = logging.getLogger(... | python | edit | 4 | 6 | bsd-2-clause | e0cb864f19f05f4ddfed0fa90c8b9895bde9b8df | Anaethelion/Geotrek,makinacorpus/Geotrek,johan--/Geotrek,makinacorpus/Geotrek,camillemonchicourt/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,mabhub/Geotrek,camillemonchicourt/Geotrek,makinacorpus/Geotrek,johan--/Geotrek,GeotrekCE/Geotrek-admin,makinaco... | caminae/core/management/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport cffi\n\nffi = cffi.FFI()\n\nffi.cdef(\"\"\"\nint setup(void);\nvoid setup_gpio(int gpio, int direction, int pud);\nint gpio_function(int gpio);\nvoid output_gpio(int gpio, int value);\nint input_gpio(int gpio);\nvoid set_rising_eve... | python | edit | 1 | 1 | bsd-2-clause | 02f18e2ec6788f4cf92e8a2f78898f6861f2f395 | cg123/computernetworks,cg123/computernetworks,cg123/computernetworks | gofast/gpio.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime_plugin\r\n\r\nfrom sublime_lib.path import root_at_packages, get_package_name\r\n\r\nPLUGIN_NAME = get_package_name()\r\n\r\nCOMPLETIONS_SYNTAX_DEF = \"Packages/%s/Syntax Definitions/Sublime Completions.tmLanguage\" % PLUGIN_... | python | edit | 1 | 1 | mit | e59f187f2e4557114e534be57dc078ddf112b87c | SublimeText/PackageDev,SublimeText/AAAPackageDev,SublimeText/AAAPackageDev | completions_dev.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\n\nfrom django.core.exceptions import ValidationError\n\n\ndef validate_approximatedate(date):\n if date.month == 0:\n raise ValidationError(\n 'Event date can\\'t be a year only... | python | edit | 1 | 2 | bsd-3-clause | 132f91c5f3f193ca3b1a246b9ef5b20b4e03609f | DjangoGirls/djangogirls,DjangoGirls/djangogirls,DjangoGirls/djangogirls | core/validators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nmajor = 0\nminor=0\npatch=23\nbranch=\"master\"\ntimestamp=1376526646.52\n```\n\nApply this change: Tag commit for v0.0.24-master generated by gitmake.py"
},
{
"role": "assistant",
"content": "major = 0\nminor=0\npatch=24\nbranc... | python | edit | 1 | 0 | mit | 5c4026fbe42625a3595d26c2ef71cb1298b36547 | ryansturmer/gitmake | version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nRetrieves the firendly model name for machines that don't have one yet.\n'''\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom server.models import Machine\nfrom django.db.models import Q\nimport server.utils a... | python | edit | 3 | 2 | apache-2.0 | 93756f6f72d9f797c058bedcb3d6d7546a5a83f3 | sheagcraig/sal,salopensource/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal | server/management/commands/friendly_model_name.py | rejected_duplicate | Near-duplicate of sample 4710 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\r\n\r\nfrom . import tasks\r\n\r\nfrom django.db.models.signals import post_save\r\nfrom django.dispatch import receiver\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\n\r\n@receiver(post_save, sender=\"quickstats.Sample\"... | python | edit | 1 | 1 | mit | 14cdf6b7a82e49f1860aee41e4b1a5b20cf179b2 | kfdm/django-simplestats,kfdm/django-simplestats | quickstats/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\nfrom django.conf.urls import patterns, url\nfrom fileupload.views import (\n BasicVersionCreateView, BasicPlusVersionCreateView,\n jQueryVersionCreateView, AngularVersionCreateView,\n PictureCreateVie... | python | edit | 6 | 0 | bsd-2-clause | 5a2673366224751e675b894c13a2152c50d28e87 | ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark | fileupload/urls.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Person:\n def __init__(self, name, birth_date):\n self.name = name\n self.birth_date = birth_date\n\n\nclass BirthDate:\n def __init__(self, year, date):\n self.year = year\n self.date = date\n\n\ncla... | python | edit | 2 | 3 | mit | bbb3119c0087ec52185cd275b5dc132868129658 | be-ndee/object-calisthenics | oc/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" rhcephcompose CLI \"\"\"\n\nfrom argparse import ArgumentParser\nimport kobo.conf\nfrom rhcephcompose.compose import Compose\n\n\nclass RHCephCompose(object):\n \"\"\" Main class for rhcephcompose CLI. \"\"\"\n\n def __init__(s... | python | edit | 1 | 2 | mit | b627efe0675b2b1965eeac7104cf3a8f2d675539 | red-hat-storage/rhcephcompose,red-hat-storage/rhcephcompose | rhcephcompose/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (1, 0, 'post-release-SVN')\n\ndef get_version():\n \"Returns the version as a human-format string.\"\n v = '.'.join([str(i) for i in VERSION[:-1]])\n if VERSION[-1]:\n from django.utils.version import get_svn_revis... | python | edit | 1 | 5 | bsd-3-clause | 8e608c2155a4a466f1a4bf87df05c4e4ebd90c1c | blindroot/django,lsqtongxin/django,jgoclawski/django,blighj/django,fenginx/django,riklaunim/django-custom-multisite,jn7163/django,alrifqi/django,ryangallen/django,charettes/django,eugena/django,AndrewGrossman/django,yakky/django,eugena/django,denys-duchier/django,EliotBerriot/django,dwightgunning/django,hassanabidpk/dj... | django/__init__.py | rejected_duplicate | Near-duplicate of sample 11354 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\nimport os, sys\n\nsys.path.insert(0, '..')\n\nPROJECT_ROOT = os.path.dirname(__file__)\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_p... | python | edit | 1 | 0 | bsd-3-clause | 5ccfa503950156db79f3d63816168a4040f80b7b | CloudNcodeInc/djmail,CloudNcodeInc/djmail,CloudNcodeInc/djmail | testing/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\n\nclass LoginLibrary:\n\n def __init__(self):\n self._sut_path = os.path.join(os.path.dirname(__file__),\n '..', 'sut', 'login.py')\n self._status = ''\n\n de... | python | edit | 1 | 2 | apache-2.0 | ffce8ea9bda95945e335fef75ba93b1066c795ac | Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework,userzimmermann/robotframework-python3,userzimmermann/robotframework-python3,userzimmermann/robotframework-python3,Senseg/robotframework,Senseg/robotframework | doc/quickstart/testlibs/LoginLibrary.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nCLOUDIFY_TENANT_HEADER = 'Tenant'\n\nSUPPORTED_RELEASES = [\n '5.0.5',\n '5.1.0',\n '5.1.1',\n '5.1.2',\n '5.1.3',\n '5.1.4',\n '5.2.0',\n '5.2.1',\n '6.0.0',\n 'master',\n]\n\nSUPPORTED_FOR_RPM_UPGRADE = [\n ... | python | edit | 1 | 0 | apache-2.0 | 552283714c329e3a304cd8a8bc14e5370fa6a879 | cloudify-cosmo/cloudify-system-tests,cloudify-cosmo/cloudify-system-tests | cosmo_tester/framework/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\napp = Flask(__name__)\n\n@app.route(\"/\", methods=[\"GET\", \"POST\"])\ndef hello():\n from flask import request\n # print dir(request)\n print request.values\n print request.form.get('sdp')\n retur... | python | edit | 1 | 1 | mit | 9d759bc8f7980ad4fa9707b2d6425ceac616460a | optimus-team/optimus-video,optimus-team/optimus-video,optimus-team/optimus-video,optimus-team/optimus-video | backend/post_handler/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nConstants for the PyOWM library\n\"\"\"\n\nPYOWM_VERSION = '2.6.1'\nLATEST_OWM_API_VERSION = '2.5'\nDEFAULT_API_KEY = 'b1b15e88fa797225412429c1c50c122a'\n\n```\n\nApply this change: Prepare bump to version 2.7.0"
},
{
"role"... | python | edit | 1 | 0 | mit | e4c20eae4f847abe71ab661374abf14cdea3f99e | csparpa/pyowm,csparpa/pyowm | pyowm/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datashape\nfrom blaze.expr import TableSymbol, like, Like\n\n\ndef test_like():\n t = TableSymbol('t', '{name: string, amount: int, city: string}')\n\n expr = like(t, name='Alice*')\n\n assert eval(str(expr)).isidentical(exp... | python | edit | 3 | 2 | bsd-3-clause | 7848338fd8c1a73c8371617fc4b72a139380cc50 | ContinuumIO/blaze,cpcloud/blaze,ContinuumIO/blaze,cpcloud/blaze,cowlicks/blaze,cowlicks/blaze | blaze/expr/tests/test_strings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Unit tests for MAU101.\"\"\"\n\nfrom check import Check\nfrom proselint.checks.garner import a_vs_an as chk\n\n\nclass TestCheck(Check):\n\n \"\"\"Test garner.a_vs_n.\"\"\"\n\n __test__ = True\n\n @property\n def this_chec... | python | edit | 1 | 1 | bsd-3-clause | 7ca12bb0d2b687c41f9e3b304cc2d7be37ca7a8d | amperser/proselint,jstewmon/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint | tests/_test_mau_a_vs_an.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nfrom ftplib import FTP\nimport re\n\nexcluded = [x.strip() for x in open('bad-zip-names.txt').readlines()]\ncounties = [x.strip() for x in open('counties.txt').readlines()]\n\nconn = FTP('ftp.lmic.state.mn.us')\nconn... | python | edit | 1 | 0 | mit | e3e7fa542650cb909bb761771b08648252e9a279 | simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic | get-county-data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Phinx documentation build configuration file, created by\n# sphinx-quickstart on Thu Jun 14 17:39:42 2012.\n#\n\n# Import the base theme configuration\nfrom cakephpsphinx.config.all import *\n\n# The full versi... | python | edit | null | null | mit | 292ee86bb7c21c3bc99ff04176592b74aa5b1e85 | robmorgan/phinx | docs/config/all.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport unittest\nfrom graphenebase.ecdsa import (\n sign_message,\n verify_message\n)\n\n\nwif = \"5J4KCbg1G3my9b9hCaQXnHSm6vrwW9xQTJS6ZciW2Kek7cCkCEk\"\n\n\nclass Testcases(unittest.TestCase):\n\n # Ignore warning:\... | python | edit | 5 | 2 | mit | 18cd04d24965d173a98ebb4e7425344a1992bcce | xeroc/python-graphenelib | tests/test_ecdsa.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#solarnmf_main_ts.py\n\n#Will Barnes\n#31 March 2015\n\n#Import needed modules\nimport solarnmf_functions as snf\nimport solarnmf_plot_routines as spr\n\n#Read in and format the time series\nresults = snf.make_t_matrix(\"simulation\",format... | python | edit | 1 | 0 | mit | 832fecfe5bfc8951c0d302c2f913a81acfbc657c | wtbarnes/solarnmf | solarnmf_main_ts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016 Ericsson AB\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 | 2 | apache-2.0 | 2ccb6b1d1beddede7e98eabeeef0219bff293638 | EricssonResearch/calvin-base,les69/calvin-base,EricssonResearch/calvin-base,les69/calvin-base,les69/calvin-base,les69/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base | calvin/calvinsys/sensors/distance.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport json\nimport unittest\n\nfrom clippings.utils import DatetimeJSONEncoder\n\n\nDATE = datetime.datetime(2016, 1, 2, 3, 4, 5)\nDATE_STRING = \"2016-01-02T03:04:05\"\n\n\nclass DatetimeJSONEncoderTest(unittest.TestCase)... | python | edit | 3 | 1 | mit | 311dfdc28bda253e20d09c84a3ba739f5e9be7ef | samueldg/clippings | tests/utils_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport pygit2\n\nfrom .base_git import NoSuchRemote\nfrom .plain_git import PlainGit\n\n\nclass Pygit2Git(PlainGit):\n @staticmethod\n def is_on_branch(path):\n repo = pygit2.Repository... | python | edit | 1 | 3 | bsd-3-clause | 2f9c912c9071a498feb8d9cca69e447ffec397be | solarnz/polygamy,solarnz/polygamy | polygamy/pygit2_git.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\nimport re\nfrom elasticsearch import Elasticsearch\n\nes = Elasticsearch({'host': ELASTICSEARCH_URL})\n\nwith open('data/ParcelCentroids.csv', 'r') as csvfile:\n print \"open file\"\n csv_reader = csv.DictReader(csvfile, field... | python | edit | 2 | 0 | mit | cc51f18f0c123ed9ef68b35264f0e1f53ae22588 | codeforamerica/streetscope,codeforamerica/streetscope | index_addresses.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"Run the end to end tests of the project.\"\"\"\n\n__author__ = \"Martha Brennich\"\n__license__ = \"MIT\"\n__copyright__ = \"2020\"\n__date__ = \"11/07/2020\"\n\nimport sys\nimport unittest\ni... | python | edit | 1 | 1 | mit | 57318652ba9aacc0456334a1d6466734f35ab84d | kif/freesas,kif/freesas,kif/freesas | e2etest/e2etest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom nose.tools import eq_\nimport bot_mock\nfrom pyfibot.modules import module_wolfram_alpha\n\n\nconfig = {\"module_wolfram_alpha\":\n {\"appid\": \"3EYA3R-WVR6GJQWLH\"}} # unit-test only APPID, do not a... | python | edit | 1 | 1 | bsd-3-clause | dc4511324bcd518dfceb828eacd72b64a5442468 | lepinkainen/pyfibot,rnyberg/pyfibot,lepinkainen/pyfibot,EArmour/pyfibot,aapa/pyfibot,aapa/pyfibot,huqa/pyfibot,huqa/pyfibot,rnyberg/pyfibot,EArmour/pyfibot | tests/test_wolfram_alpha.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\n\nfrom feedback.forms import FeedbackForm\n\ndef leave_feedback(request):\n form = FeedbackForm(re... | python | edit | 1 | 3 | bsd-3-clause | d191a947e34e4d6eee1965f4896a44efc8c7ae91 | girasquid/django-feedback | feedback/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom time import sleep\n\nfrom django.conf import settings\nfrom django.test import TestCase\n\nfrom kolibri.utils import cli\n\n\nclass KolibriTimedRotatingFileHandlerTestCase(TestCase):\n def test_do_rollover(self):\n ... | python | edit | 1 | 3 | mit | 6ee261309f4492994b52403d485bdfd08739a072 | indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri | kolibri/utils/tests/test_handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test.testcases import SimpleTestCase\n\nfrom corehq.apps.es.sms import SMSES\nfrom corehq.apps.es.tests.utils import ElasticTestMixin\nfrom corehq.elastic import SIZE_LIMIT\n\n\nclass TestSMSES(ElasticTestMixin, SimpleTestCase):... | python | edit | 1 | 1 | bsd-3-clause | 4a4da808289ad2edd6549cca921fbfd8fa4049c9 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/es/tests/test_sms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\nfrom server import prepare_data, query_server\nfrom parser import parse_response\nfrom bottle import route, request, run, view\n\nimport bottle\nbottle.TEMPLATE_PATH = [\"api/views/\"]\nbottle.debug(True... | python | edit | 1 | 3 | mit | 6a06ae04309b3d881b7001836b5c9cec86a59eae | EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger | api/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"foo.py – a simple demo of importing a calss from C++\"\"\"\nimport ctypes\n\nlib = ctypes.cdll.LoadLibrary('./libfoo.so')\n\nclass Foo(object):\n \"\"\"The Foo class supports two methods, bar, and foobar...\"\"\"\n def __init__(... | python | edit | 1 | 1 | mit | db47b7622595356ef75b18ef09ac8a5c2a55581e | Auctoris/ctypes_demo,Auctoris/ctypes_demo | foo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom opps.articles.models import ArticleBox\n\n\ndef set_context_data(self, SUPER, **kwargs):\n context = super(SUPER, self).get_context_data(**kwargs)\n\n context['articleboxes'] = ArticleBox.objects.filter(\... | python | edit | 1 | 2 | mit | 8074fca48f6a7246f26471ecdc14633d78475d8c | opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,opps/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps | opps/articles/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom moj_irat.healthchecks import HealthcheckResponse, UrlHealthcheck, registry\n\n\ndef get_stats():\n from celery import Celery\n\n app = Celery(\"laalaa\")\n app.config_from_object(\"django.conf... | python | edit | 1 | 5 | mit | 4ce3685ec4aab479a4d8c7a1d41d7028285c1656 | ministryofjustice/laa-legal-adviser-api,ministryofjustice/laa-legal-adviser-api,ministryofjustice/laa-legal-adviser-api | laalaa/apps/advisers/healthchecks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nPrints a history of agent events to file.\n\"\"\"\n\nimport events\n\nclass AgentEvents(events.EventListener):\n \"\"\"\n View class\n \"\"\"\n\n def __init__(self, file_path):\n \"\"\"\n :param file_path: ... | python | edit | 1 | 8 | mit | 257e8d2e6d1dc3c10eb7fc26c3deacaf4133bd9b | Beskhue/enactive-agents,Beskhue/enactive-agents,Beskhue/enactive-agents | enactiveagents/view/agentevents.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport wol\nimport json\nfrom flask import request\nfrom app_factory import create_app\n\napp = create_app(__name__)\n\n\n@app.route('/help', methods=['GET'])\ndef help():\n return json.dumps({'help message': wol.help_message().strip()})... | python | edit | 4 | 5 | mit | 3a9a6cb2c98403fc619c8979bdf48102028fd770 | stevenaubertin/wol.py | rest/main.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom django.db import models\n\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass Region(models.Model):\n '''\n Common regional zones. All messages can be grouped by this territorial\n cluster.\n... | python | edit | 1 | 1 | mit | c78aa5abc18dda674f607ead5af59ddb4a879ed4 | sarutobi/ritmserdtsa,sarutobi/ritmserdtsa,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/flowofkindness | geozones/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file mainly exists to allow python setup.py test to work.\nimport os\nimport sys\n\nos.environ['DJANGO_SETTINGS_MODULE'] = 'nodeconductor.server.test_settings'\ntest_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(... | python | edit | 2 | 3 | mit | 709bdf06c38ccd9713fb1e92be3102e9b1b1ae59 | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/server/test_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .webdriver_util import init\n\n\ndef query_google(keywords):\n print(\"Loading Firefox driver...\")\n driver, waiter, selector = init()\n\n print(\"Fetching google front page...\")\n driver.get(\"http://google.com\")\n\n ... | python | edit | 1 | 1 | apache-2.0 | d562756f6b48366508db6ef9ffb27e3d5c707845 | weihanwang/webdriver-python,weihanwang/webdriver-python | root/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Enable pytest rewriting in test helper functions."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, division\n\nimport pytest\n\npytest.register_assert_rewrite... | python | new_file | 1 | 0 | mit | 3a8a7661c0aad111dbaace178062352b30f7fac5 | alimanfoo/numcodecs,zarr-developers/numcodecs,alimanfoo/numcodecs | numcodecs/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, print_function\n\nfrom .auth import SymantecAuth\nfrom .session import SymantecSession\n\n\nclass Symantec(object):\n\n def __init__(self, username, password,\n url=\"http... | python | edit | 1 | 1 | apache-2.0 | a7c210a68a8671137681c55324341c60b256a92b | glyph/symantecssl,chelseawinfree/symantecssl,cloudkeep/symantecssl,grigouze/symantecssl,jmvrbanac/symantecssl | symantecssl/core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom werkzeug.local import LocalProxy, LocalStack\nfrom flask import request\n\nfrom .models import _ctx_stack, Cosmos\n\n\n_global_cosmos = Cosmos()\n\ndef _get_current_cosmos():\n if _ctx_stack.top != None:\n return _ctx_stack.t... | python | edit | 4 | 2 | mit | 535d1f1ea3f229a0831830c4d19e7547e2b2ddab | cosmic-api/cosmic.py | cosmic/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2019, Frappe Technologies and Contributors\n# See license.txt\n# import frappe\nimport unittest\n\nclass TestTag(unittest.TestCase):\n\tpass\n\n```\n\nApply this change: test: Add test case to valida... | python | edit | 1 | 1 | mit | ae70502f910c85f6a4528b487eea3b535cec6c39 | mhbu50/frappe,almeidapaulopt/frappe,yashodhank/frappe,almeidapaulopt/frappe,mhbu50/frappe,almeidapaulopt/frappe,yashodhank/frappe,StrellaGroup/frappe,frappe/frappe,frappe/frappe,StrellaGroup/frappe,yashodhank/frappe,frappe/frappe,almeidapaulopt/frappe,yashodhank/frappe,StrellaGroup/frappe,mhbu50/frappe,mhbu50/frappe | frappe/desk/doctype/tag/test_tag.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport time\n\nfrom mopidy.exceptions import MpdNotImplemented\nfrom mopidy.models import Playlist\n\nlogger = logging.getLogger('backends.base')\n\nclass BaseBackend(object):\n current_playlist = None\n library = None... | python | edit | 4 | 1 | apache-2.0 | 1062ef4daf124f0dcc056c1e95b7a234642fb36d | vrs01/mopidy,dbrgn/mopidy,pacificIT/mopidy,kingosticks/mopidy,bacontext/mopidy,hkariti/mopidy,liamw9534/mopidy,rawdlite/mopidy,quartz55/mopidy,pacificIT/mopidy,tkem/mopidy,bacontext/mopidy,mopidy/mopidy,ZenithDK/mopidy,glogiotatidis/mopidy,rawdlite/mopidy,jmarsik/mopidy,jmarsik/mopidy,jcass77/mopidy,woutervanwijk/mopid... | mopidy/backends/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pymongo import MongoClient\n\n\ndef main():\n client = MongoClient()\n db = client.cityhotspots\n db.drop_collection('dineroptions')\n diners_collection = db.diners\n\n doc = {}\n diner_options_collection = db.dinerop... | python | edit | 1 | 1 | mit | e1043bfb410740ab3429ff659e78197b44fefb74 | earlwlkr/POICrawler | extract_options.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014 Lukas Lalinsky, Wieland Hoffmann\n# License: MIT, see LICENSE for details\nfrom mbdata.models import Area, Artist, Label, Recording, ReleaseGroup, Work\nfrom sqlalchemy import exc as sa_exc\nfrom sqlalchemy.orm import r... | python | edit | 1 | 0 | mit | bf0990f1e5dda5e78c859dd625638357da5b1ef4 | jeffweeksio/sir | sir/schema/modelext.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Load the machine\nimport pkg_resources\npkg_resources.require('aphla')\nimport aphla as ap\n# Other stuff\nfrom cothread.catools import caget, caput, ca_nothing\n\n# Load the machine\nap.machines.load('SRI21')\n\n# First task\nBPMS = ap.g... | python | edit | 4 | 0 | apache-2.0 | ff6502fd8ecc4ee28cb05cb7ee8f11f75240ce47 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | mini_project.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pml.exceptions import PvException\nimport pml.device\nimport pytest\nimport mock\n\n\n@pytest.fixture\ndef create_device(readback, setpoint):\n _rb = readback\n _sp = setpoint\n device = pml.device.Device(rb_pv=_rb, sp_pv=_sp,... | python | edit | 1 | 1 | apache-2.0 | 724a55ded262d4d0986e5a5a3c4c04e145558bea | willrogers/pml,willrogers/pml | test/test_device.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\nimport sys\n\nlines = sys.stdin.readlines()\n\n# Contact details are expected to begin on the fourth line, following the\n# header and a blank line, and extend until the next blank line. Lines with\n# bullets (•) will ... | python | edit | 3 | 0 | apache-2.0 | 72384b3f06d4c68a94805e101f6cf4f820157834 | davidbradway/resume,davidbradway/resume | process.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2019 Radim Rehurek <<EMAIL>>\n#\n# This code is distributed under the terms and conditions\n# from the MIT License (MIT).\n#\n\n\"\"\"\nUtilities for streaming to/from several file-like data stora... | python | edit | 1 | 0 | mit | e85d0b100bd907ddf82f4c5e132690000d8cb4a0 | RaRe-Technologies/smart_open,RaRe-Technologies/smart_open,piskvorky/smart_open | smart_open/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom girder_worker.utils import TeeStdOutCustomWrite, TeeStdErrCustomWrite, JobManager\n\n\ndef test_TeeStdOutCustomeWrite(capfd):\n _nonlocal = {'data': ''}\n\n def _append_to_data(message, **kwargs):\n _nonlocal['... | python | edit | 1 | 1 | apache-2.0 | 4bc34f0b8adfc22037475cbdafbb149b7ea88421 | girder/girder_worker,girder/girder_worker,girder/girder_worker | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2015 Red Hat\n# Licensed under The MIT License (MIT)\n# http://opensource.org/licenses/MIT\n#\nimport unittest\nimport argparse\n\n\"\"\"\nUse this script either without ar... | python | edit | 1 | 0 | mit | d6bfac0ac2bc27c8d809467ed6071c5c9a7f5579 | lao605/product-definition-center,xychu/product-definition-center,product-definition-center/product-definition-center,release-engineering/product-definition-center,product-definition-center/product-definition-center,pombredanne/product-definition-center,lao605/product-definition-center,pombredanne/product-definition-cen... | client_test_run.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\nfrom ..interface import TableLoaderInterface\n\n\nclass TableLoaderManager(TableLoaderInterface):\n\n def __ini... | python | edit | 1 | 2 | mit | 3520217e38849ad18b11245c6cac51d79db8422d | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | pytablereader/loadermanager/_base.py | rejected_duplicate | Near-duplicate of sample 11799 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom django import template\nfrom django.db.models import Min, Max\n\nfrom gnotty.models import IRCMessage\nfrom gnotty.conf import settings\n\n\nregister = template.Library()\n\n\n@register.inclusion_tag(\"gnotty/includes/nav.html\", tak... | python | edit | 1 | 2 | bsd-2-clause | d518c4f8fa7b657c735d5a2b4f653d5c0cad529e | spaceone/gnotty,stephenmcd/gnotty,stephenmcd/gnotty,spaceone/gnotty,stephenmcd/gnotty,spaceone/gnotty | gnotty/templatetags/gnotty_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom go.vumitools.conversation.definition import (\n ConversationDefinitionBase, ConversationAction)\n\n\nclass BulkSendAction(ConversationAction):\n action_name = 'bulk_send'\n action_display_name = 'Write and send bulk message'\n... | python | edit | 1 | 2 | bsd-3-clause | 087b6a623e4a48b76fa3ce62a14298d9744afd2a | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/apps/bulk_message/definition.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2014 - StackStorm, Inc.\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 Lice... | python | edit | 1 | 1 | apache-2.0 | 01c5a8d0f7e6540995817fecfee124f1859fa448 | openstack/mistral-dashboard,openstack/mistral-dashboard,openstack/mistral-dashboard | mistraldashboard/executions/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nKraller\n\nAn application to allow signups for accounts on a server with a key.\n\"\"\"\n\nfrom flask import Flask\n\napp = Flask(__name__)\n\n\n@app.route('/')\ndef index():\n return 'Hello from ACM@CWRU'\n\n\nif __name__ == '__... | python | edit | 1 | 1 | bsd-2-clause | ec1058fc1576b7a47af2d00b5b9e60e71dc6dc6b | Aaronneyer/kraller,Aaronneyer/kraller,bis12/kraller,hashbrowncipher/kraller,hacsoc/kraller,hashbrowncipher/kraller,hacsoc/kraller,cwruacm/kraller,bis12/kraller,cwruacm/kraller | kraller/kraller.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom uuid import uuid4\nfrom random import randint\nfrom basic_http import BasicHttp\n\ndef random_pk(length=8):\n s = uuid4().hex\n\n f = randint(0, (len(s) - length))\n t = f + length\n\n return s[f:t]\n\ndef get_url_info(url)... | python | edit | 1 | 1 | bsd-3-clause | 10360cc4d956faac194c58eb3b52fae2b348b356 | nachopro/followlink,nachopro/followlink | links/functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms.models import ModelForm\nfrom .models import Photo\nfrom artists.models import Artists\n\nclass UploadPhotoForm(ModelForm):\n\n class Meta:\n model = Photo\n fields = ['picture', 'comment']\n\n def __in... | python | edit | 1 | 1 | mit | 36f218ccab5de6799674c438546189245b444b25 | KeserOner/where-artists-share,KeserOner/where-artists-share | was/photo/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom os.path import dirname, join, realpath\n\nimport hacksport.deploy\nfrom hacksport.deploy import deploy_problem\nfrom shell_manager.util import default_config\n\nPATH = dirname(realpath(__file__))\n\nhacksport.deploy.depl... | python | edit | 3 | 1 | mit | c38fb74a71b3471f5363cf1aa95fecdd8ac9180f | royragsdale/picoCTF,picoCTF/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF | picoCTF-shell/tests/test_problems.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.contrib.auth.models import (\n AbstractBaseUser, PermissionsMixin)\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\n\n\nclass Profile(models.Model):\n user = mo... | python | edit | 1 | 1 | bsd-2-clause | 271c91a607797bbd9d1a1e179745aedf580e8209 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | user/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file is part of python-markups module\n# License: BSD\n# Copyright: (C) Dmitry Shachnev, 2012-2017\n\nimport os.path\n\n# Some common constants and functions\n(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)\nC... | python | edit | 1 | 4 | bsd-3-clause | 1b1a40646a08e6a01927279eb7dff8399adec740 | mitya57/pymarkups,retext-project/pymarkups | markups/common.py | rejected_duplicate | Near-duplicate of sample 15926 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import (\n get_object_or_404, render)\n\nfrom .models import Startup, Tag\n\n\ndef startup_detail(request, slug):\n startup = get_object_or_404(\n Startup, slug__iexact=slug)\n return render(\n r... | python | edit | 1 | 2 | bsd-2-clause | 224478e0d69197feb19f2f89c21e884a2e5cb77d | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, sys\n\nDEFAULT_SETTINGS = {\n 'DATABASE_ENGINE': 'sqlite3',\n 'DATABASES': {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': 'mydatabase'\n }\n },\n}\n\nclass Virtua... | python | edit | 3 | 2 | apache-2.0 | ad346d73a27c021de131ec871dc19da2e17854ee | armstrong/armstrong.dev | armstrong/dev/virtualdjango/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# basic dictionary\n\nd = {}\nprint(d)\nd[2] = 123\nprint(d)\nd = {1:2}\nd[3] = 3\nprint(len(d), d[1], d[3])\nd[1] = 0\nprint(len(d), d[1], d[3])\nprint(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')\n\nx = 1\nwhile x < 100:\n d[x... | python | edit | 1 | 0 | mit | 6caca3259f4ec8f298b1d35f15e4492efbcff6b1 | jmarcelino/pycom-micropython,alex-march/micropython,hiway/micropython,AriZuu/micropython,chrisdearman/micropython,kerneltask/micropython,jmarcelino/pycom-micropython,selste/micropython,tuc-osg/micropython,blazewicz/micropython,oopy/micropython,ryannathans/micropython,micropython/micropython-esp32,trezor/micropython,inf... | tests/basics/dict1.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.