messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\n\nfrom setuptools import setup, find_packages\nfrom eodatasets import __version__ as version\n\n# Append TeamCity build number if it gives us one.\nif 'BUILD_NUMBER' in os.environ and version.endswith('b'... | python | edit | 1 | 0 | apache-2.0 | c88b060e216b494d893a1cf50de4e85b276740c1 | jeremyh/eo-datasets,GeoscienceAustralia/eo-datasets,GeoscienceAustralia/eo-datasets,jeremyh/eo-datasets | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport codecs\n\nfrom os import path\nfrom setuptools import find_packages, setup\n\n\ndef read(*parts):\n filename = path.join(path.dirname(__file__), *parts)\n with codecs.open(filename, encoding=\"utf-8\") as fp:\n return fp... | python | edit | 1 | 1 | mit | 1ad58abffb5b9f768a916620e503b2511509fba5 | eldarion/user_messages,pinax/pinax-messages,pinax/pinax-messages,eldarion/user_messages | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n__author__ = \"Antonio J. Nebro\"\n__license__ = \"GPL\"\n__version__ = \"1.0-SNAPSHOT\"\n__status__ = \"Development\"\n__email__ = \"<EMAIL>\"\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name_... | python | edit | 1 | 4 | mit | a12bdf5b8ffa0b43fdd0b1ad9b49b47e09815c9c | ajnebro/pyMSAScoring | pymsascoring/score/score.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(name='polycircles',\n version='0.1',\n description='Polycircles: WGS84 Circle approximations using polygons',\n url='http://github.com/vioozer/servers',\n author='Adam Matan',\n ... | python | edit | 1 | 0 | mit | 35e5643db16e2da200c9151b6d6fc53ea2096944 | adamatan/polycircles | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 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\nimport os\n\nfrom telemetry.core import util\nfrom telemetry.page imp... | python | edit | 1 | 2 | bsd-3-clause | 3e689dc769bd4859b4ed73e98d8d559710aa2e14 | hgl888/chromium-crosswalk-efl,littlstar/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,jaruba/chromium.src,dushu1203/chromium.src,Chilledheart/chr... | tools/perf/profile_creators/small_profile_creator.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 | a61363b23c2fee99c7420cf2371a2711b3bc1eaa | johnbachman/indra,johnbachman/belpy,sorgerlab/indra,jmuhlich/indra,sorgerlab/indra,sorgerlab/belpy,jmuhlich/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/indra,johnbachman/belpy,johnbachman/indra,bgyori/indra,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,pvtodorov/indra,sorgerlab/belpy... | indra/java_vm.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2011 by Christopher Adams\n# Released under MIT License. See LICENSE.txt in the root of this\n# distribution for details.\n\nfrom django.conf.urls.defaults import *\n\nurlpatterns = patterns('',\n\turl(r'^$', 'manuscript.vie... | python | edit | 8 | 0 | mit | bdde8bb3ee9a79dc0ae777bb6e226dbc2be18dfb | adamsc64/django-manuscript,adamsc64/django-manuscript | manuscript/urls.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime\nimport sublime_plugin\n\nPANEL_NAME = \"SublimeLinter Messages\"\nOUTPUT_PANEL = \"output.\" + PANEL_NAME\n\n\ndef plugin_unloaded():\n for window in sublime.windows():\n window.destroy_output_panel(PANEL_NAME)\n\n... | python | edit | 1 | 2 | mit | 247850851367486d54c8cf3a074e85d1d283e654 | SublimeLinter/SublimeLinter3,SublimeLinter/SublimeLinter3 | message_view.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport RPi.GPIO as gpio\n\n\npin_power=12\npin_light=16\n\n# Setup\ngpio.setmode(gpio.BOARD)\ngpio.setup(pin_power, gpio.OUT)\ngpio.setup(pin_light, gpio.OUT)\ngpio.output(pin_power, gpio.HIGH)\ngpio.output(pin_ligh... | python | edit | 1 | 0 | apache-2.0 | 8162cf98f04125b7db1460a42a177eae516660d0 | kensonman/IMCSmartHome,kensonman/IMCSmartHome,kensonman/IMCSmartHome | appliance/getready.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright (c) 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\n\"\"\" Utilities for ASAN,TSAN,etc. build step... | python | edit | 2 | 1 | bsd-3-clause | f79f5a8494930cd7f64c6471dea631a7e8f35478 | google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Ti... | slave/skia_slave_scripts/flavor_utils/xsan_build_step_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mbuild.box import Box\nfrom mbuild.coarse_graining import coarse_grain\nfrom mbuild.coordinate_transform import *\nfrom mbuild.compound import *\nfrom mbuild.pattern import *\nfrom mbuild.packing import *\nfrom mbuild.port import Port\... | python | edit | 12 | 0 | mit | fda50fb75b0b0e1d571c825e0a364573b93461bc | iModels/mbuild,iModels/mbuild | mbuild/__init__.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nmylang = 'test'\nfamily = 'wikipedia'\n\n\ncustom_path = os.path.expanduser('~/user-config.py')\nif os.path.exists(custom_path):\n with open(custom_path, 'r') as f:\n exec(compile(f.read(), custom_path, 'exec'), globa... | python | edit | 2 | 0 | mit | bd679f26e384ab42ac9edc2e99575dc57b9450ef | yuvipanda/paws,yuvipanda/paws | singleuser/user-config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import Grade, Group, Pupil, Teacher, Warden\n\nfor model in {Grade, Group, Pupil, Teacher, Warden}:\n admin.site.register(model)\n\n```\n\nApply this change: Add Course field to Admin\n\n... | python | edit | 1 | 0 | bsd-3-clause | e5db0a11634dc442f77f5550efd5cbf687ea6526 | Leo2807/lioncore | lionschool/core/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom unittest import TestCase\nimport webtest\n\n\nHERE = os.path.dirname(os.path.abspath(__file__))\n\n\nclass BaseWebTest(TestCase):\n \"\"\"Base Web Test to test your cornice service.\n\n It setups the database before ea... | python | edit | 1 | 1 | bsd-3-clause | 64398ae731b2f89e126ae9c63fe048134cbf649c | spiral-project/daybed,spiral-project/daybed | daybed/tests/support.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom haystack import indexes\nfrom tx_people.models import Organization\nfrom tx_salaries.models import Employee\n\n\nclass EmployeeIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharField(document=True, use_template=Tru... | python | edit | 1 | 1 | apache-2.0 | 6f968a4aa4048163dd55f927a32da2477cd8c1ff | texastribune/tx_salaries,texastribune/tx_salaries | tx_salaries/search_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup, find_packages\n\n\nDESCRIPTION = 'Send emails using Django template system'\n\nLONG_DESCRIPTION = None\ntry:\n LONG_DESCRIPTION = open('README.rst').read()\nexcept:\n pass\n\nCLASSIFIERS = [\n ... | python | edit | 1 | 0 | mit | 8565921f7bc42c30534bdc272bd3daaf1e758b1c | artemrizhov/django-mail-templated,artemrizhov/django-mail-templated,artemrizhov/django-mail-templated | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name=\"go_contacts\",\n version=\"0.1.0a\",\n url='http://github.com/praekelt/go-contacts-api',\n license='BSD',\n description=\"A contacts and groups API for Vumi Go\",... | python | edit | 1 | 0 | bsd-3-clause | 7352f08852d5d265e4cb79a43e056b666a1877c5 | praekelt/go-contacts-api,praekelt/go-contacts-api | setup.py | rejected_duplicate | Near-duplicate of sample 2777 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django import template\nfrom django.conf import settings\nfrom Instanssi.ext_blog.models import BlogEntry\n\nregister = template.Library()\n\n@register.inclusion_tag('ext_blog/blog_messages.html')\ndef render... | python | edit | 1 | 1 | mit | e43b91412ee0899bb6b851a760dd06bce263d099 | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | Instanssi/ext_blog/templatetags/blog_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http.response import HttpResponse\n\n\ndef webhook(request):\n return HttpResponse('Webhooks not implemented yet', status=501)\n\n```\n\nApply this change: fix: Add csrf_exempt to webhook view"
},
{
"role": "assistant... | python | edit | 1 | 1 | mit | 24ed97f09707a404bf81062a99a485c547d92d11 | relekang/accio,relekang/accio,relekang/accio | accio/webhooks/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test package setup and teardown"
},
{
"role": "assistant",
"content": "import logging\nimport unittest\n\nfrom cassandra.cluster import Cluster\nfrom cassandra.connection import _loop\nfrom cassandra.policies import HostDistance\... | python | new_file | 16 | 7 | apache-2.0 | 4e70bc00a7b3fb96302ac6c2a29e463e07eabbb0 | HackerEarth/cassandra-python-driver,jfelectron/python-driver,tempbottle/python-driver,stef1927/python-driver,kishkaru/python-driver,coldeasy/python-driver,jfelectron/python-driver,HackerEarth/cassandra-python-driver,stef1927/python-driver,aholmberg/python-driver,yi719/python-driver,mike-tr-adamson/python-driver,datasta... | tests/__init__.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport base64\nimport unittest\n\n\ndef setup_package(self):\n pass\n\n\ndef teardown_package(self):\n pass\n\n\nclass BaseS3EncryptTest(unittest.TestCase):\n\n def decode64(self, data):\n return base64.b64decode(data)\n\n ... | python | edit | 1 | 1 | bsd-3-clause | a7919b78c96128cc5bcfda759da11f6b067d0041 | boldfield/s3-encryption | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport socket\n\nfrom ood.minecraft import Client\nfrom ood.models import SimpleServerState\n\n\nclass SimpleServerController(object):\n\n def __init__(self, ood_instance):\n self.state = SimpleServerState.objects.get(ood=ood_inst... | python | edit | 1 | 2 | mit | c8cc85f0d10093ae9cd42ee4cc7dabef46718645 | markrcote/ood,markrcote/ood,markrcote/ood,markrcote/ood | ood/controllers/simple.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: API: Add register_handler with the API."
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division, print_function\n\nfrom .commands import insert_resource, insert_datum, retrieve\nfrom .retrieve impo... | python | new_file | 6 | 0 | bsd-3-clause | 75345f55679437b418d9645371efc647b0d7db6c | ericdill/fileStore,ericdill/databroker,ericdill/databroker,danielballan/filestore,ericdill/fileStore,stuwilkins/filestore,danielballan/filestore,NSLS-II/filestore,stuwilkins/filestore,tacaswell/filestore | filestore/api.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\n\nfrom digestive.io import Sink\n\n\nclass HashDigest(Sink):\n def __init__(self, name, digest):\n super().__init__(name)\n self._digest = digest\n\n def update(self, data):\n self._digest.update(d... | python | edit | 1 | 1 | isc | 86fdcd6575a944a378a9c3f5b292fb33a6c42853 | akaIDIOT/Digestive | digestive/hash.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__title__ = 'vcspull'\n__package_name__ = 'vcspull'\n__description__ = 'synchronize your repos'\n__version__ = '1.0.3'\n__author__ = 'Tony Narlock'\n__email__ = '<EMAIL>'\n__license__ = 'BSD'\n__copyright__ = 'Copyright 2013-2016 Tony Narlo... | python | edit | 1 | 0 | mit | 6d23a879a40b9e94f1c568dc6f97e42001b4203c | tony/vcspull,tony/vcspull | vcspull/__about__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom thinglang.lexer.symbols.base import LexicalIdentifier\nfrom thinglang.parser.tokens import BaseToken, DefinitionPairToken\nfrom thinglang.parser.tokens.collections import ListInitializationPartial, ListInitialization\nfrom thinglang.ut... | python | edit | 3 | 3 | mit | 8e76b64fa3eafa9d22fc37b68ddb1daff6633119 | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/parser/tokens/functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Session interface switcher \"\"\"\n\nfrom flask.sessions import SecureCookieSessionInterface, SessionMixin\n\nfrom dockci.util import is_api_request\n\n\nclass FakeSession(dict, SessionMixin):\n \"\"\" Transient session-like objec... | python | edit | 1 | 3 | isc | c74b444f75441a6ccf9d9305f956ec4443f6ec01 | sprucedev/DockCI-Agent,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,RickyCook/DockCI,sprucedev/DockCI,RickyCook/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,RickyCook/DockCI | dockci/session.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import ModelForm, RadioSelect\n\nfrom .models import Product, Option\n\n\nclass ProductForm(ModelForm):\n class Meta:\n model = Product\n\nclass OptionForm(ModelForm):\n class Meta:\n model = Option\n\n... | python | edit | 2 | 1 | bsd-2-clause | 5597c9db9067ce466697f75949d47d7f94077fae | Suor/django-easymoney | tests/test_forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nfrom time import time\ntry:\n # Python 3\n from xmlrpc.client import ServerProxy\nexcept ImportError:\n # Python 2\n from SimpleXMLRPCServer import ServerProxy\n\nif __name__ == '__main__':\n parser = argpars... | python | edit | 3 | 0 | mit | b4f17dfd004cf0033e1aeccbb9e75a07bbe35cfa | FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition | competition_scripts/interop/tra.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass HalfedgeMesh:\n def __init__(self, filename=None):\n \"\"\"Make an empty halfedge mesh.\"\"\"\n self.vertices = []\n self.halfedges = []\n self.facets = []\n\n def read_off(self, filename):\n\n cla... | python | edit | 1 | 1 | mit | d6da05f79d62f90d8d03908197a0389b67535aa5 | carlosrojas/halfedge_mesh | halfedge_mesh.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import (\n LargeBinary, Boolean, Column, Integer, String, PickleType, ForeignKey)\nfrom sqlalchemy.orm import backref, relationship\nfrom sqlalchemy.orm.exc import NoResultFound\n\nfrom myarchive.db.tables.base import Bas... | python | edit | 6 | 1 | mit | a1a9852f478258b2c2f6f28a0ee28f223adaa299 | zetasyanthis/myarchive | src/myarchive/db/tables/ljtables.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nimport os\nfrom datetime import timedelta\n\n_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))\n\nDEFAULT_SERVICE_PORT = 34000\nSWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')\nDEF... | python | edit | 1 | 0 | apache-2.0 | dcd6d830033914a0ccf26822d6f305c084b90987 | fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs | f8a_jobs/defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models import Q\nfrom django.utils import timezone\n\n\ndef remove_expired_record(expire_days, query_set, time_attr_name=\"timestamp\"):\n expired_record_filter = {\"%s__lt\" % time_attr_name: timezone.now() - timezone.tim... | python | edit | 1 | 2 | bsd-3-clause | e8da237a6c1542b997b061db43cc993942983b10 | weijia/django-local-apps,weijia/django-local-apps | django_local_apps/management/commands/local_app_utils/db_clean_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app import mulungwishi_app as url\nfrom flask import render_template\n\n\n@url.route('/')\ndef index():\n return render_template('index.html')\n\n\n@url.route('/<query>')\ndef print_user_input(query):\n if '=' in query:\n ... | python | edit | 1 | 2 | mit | ce3948b2aacddfb9debd4834d9aa446e99987a0d | admiral96/mulungwishi-webhook,engagespark/public-webhooks,admiral96/public-webhooks,admiral96/mulungwishi-webhook,admiral96/public-webhooks,engagespark/mulungwishi-webhook,engagespark/mulungwishi-webhook,engagespark/public-webhooks | app/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nCopyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)\nSee the file 'doc/COPYING' for copying permission\n\"\"\"\n\nimport re\n\nfrom lib.core.exception import SqlmapUndefinedMethod\n\nclass Syntax:... | python | edit | 1 | 3 | mit | 65c55a6a4920d67b10d705909864124776d3a2dc | dtrip/.ubuntu,RexGene/monsu-server,dtrip/.ubuntu,RexGene/monsu-server | plugins/generic/syntax.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport re\nfrom django import forms\nfrom apps.chat.models import Chats\nfrom django.utils.translation import ugettext as _\n\n\nclass CreateChatForm(forms.Form):\n pass\n\n\nclass JoinChatForm(forms.Form):\n ... | python | edit | 1 | 3 | bsd-3-clause | 13350cdf5598ac0ed55e5404cf6d407300b4c1ac | MySmile/sfchat,MySmile/sfchat,MySmile/sfchat,MySmile/sfchat | apps/home/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport jellyfish\nimport multiprocessing\nfrom itertools import combinations\n\n\nclass JaroWinkler(object):\n def __init__(self, event_attributes, event_length):\n self.event_attributes = event_attributes\n self.event_leng... | python | edit | 4 | 2 | mit | 454e107abfdc9e3038a18500568e9a1357364bd0 | studiawan/pygraphc | pygraphc/similarity/JaroWinkler.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE... | python | edit | 1 | 0 | apache-2.0 | 0ee0d94e6a167ab8994a5e61f3db45799eba7a12 | FrankDuan/df_code,openstack/dragonflow,FrankDuan/df_code,openstack/dragonflow,FrankDuan/df_code,openstack/dragonflow | dragonflow/common/common_params.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.gis.db import models\nimport os\nfrom phonenumber_field.modelfields import PhoneNumberField\n\nclass Image(models.Model):\n \"\"\"\n The Image model holds an image and related data.\n\n The Created and Modified ... | python | edit | 4 | 0 | apache-2.0 | 2aed0c4089eced430dabf8d63c732e6b0013f540 | osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api | project_fish/whats_fresh/models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import render_template\nfrom flask_app import app\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\n\n```\n\nApply this change: Add routes for other pages"
},
{
"role": "assistant",
"conten... | python | edit | 1 | 2 | mit | 98aea2115cb6c5101379be2320a6fb0735a32490 | Relrin/Helenae,Relrin/Helenae,Relrin/Helenae | helenae/web/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Record(models.Model):\n\tdomain_id = models.IntegerField()\n\tname = models.CharField(max_length=30)\n\ttype=models.CharField(max_length=6)\n\tcontent=models.CharField(max_length=30)\n\tttl=models.Integ... | python | edit | 2 | 1 | bsd-2-clause | 590f80bc382cdbec97e2cb3e7b92c79bb7fa89cc | zefciu/django-powerdns-dnssec,allegro/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,allegro/django-powerdns-dnssec,zefciu/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,zefciu/django-powerdns-dnssec,allegro/djan... | dyndns/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Manage websocket connections.\"\"\"\n# -*- coding: utf-8 -*-\nimport json\n\nfrom channels import Group\nfrom channels.auth import channel_session_user_from_http, channel_session_user\n\nfrom .models import Job\n\n\n@channel_session_u... | python | edit | 4 | 2 | isc | 93d0f11658c7417371ec2e040397c7a572559585 | ornl-ndav/django-remote-submission,ornl-ndav/django-remote-submission,ornl-ndav/django-remote-submission | django_remote_submission/consumers.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\nfrom django.views import generic\n\nfrom stardate.models import Blog\nfrom stardate.views import (\n BlogCreate,\n select_backend,\n process_webhook,\n)\n\n\nurlpatterns = [\n url(r'^ne... | python | edit | 1 | 0 | bsd-3-clause | 39d7ec0fe9fdbdd152dfcc2d4280b784f6315886 | blturner/django-stardate,blturner/django-stardate | stardate/urls/index_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom tinydb import TinyDB, where\nimport markdown2\n\narticles_db = TinyDB(\"data/articles.json\")\n\n\ndef get_all_articles():\n\treturn articles_db.all()\n\n\ndef get_article_data_by_url(url: str):\n\tresults = articles_db.sea... | python | edit | 3 | 3 | apache-2.0 | 099c41acc83fdd6589f5a53ec8d1615d96e4d188 | timlyo/personalWebsite,timlyo/timlyo.github.io,timlyo/timlyo.github.io,timlyo/personalWebsite,timlyo/personalWebsite,timlyo/timlyo.github.io | website/articles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom opps.core.models import Publishable\nfrom opps.db import Db\n\n\nNOTIFICATION_TYPE = ... | python | edit | 1 | 2 | mit | e53e489da4e9f53e371997449bc813def2600008 | YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,opps/opps,YACOWS/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,opps/opps,williamroot/opps | opps/contrib/notifications/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom resync.resource_list import ResourceList\nfrom resync.resource import Resource\nfrom resync.sitemap import Sitemap\n\nrl = ResourceList()\nrl.add( Resource('http://example.com/res1', lastmod='2013-01-01') )\nrl.add( Resource('http://ex... | python | edit | 2 | 0 | apache-2.0 | 22472d7947c16388dc849b2c317ee4d509322754 | dans-er/resync,lindareijnhoudt/resync,lindareijnhoudt/resync,dans-er/resync,resync/resync | docs/examples/01_make_resourcelist.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\n\n# This only works if you're running schematic from the zamboni root.\nsys.path.insert(0, os.path.realpath('.'))\n\n# Set up zamboni.\nimport manage\nfrom django.conf import settings\n\nconfig = settings.DATABASES['d... | python | edit | 3 | 0 | bsd-3-clause | e82225201772794bf347c6e768d25f24a61b9b54 | kumar303/zamboni,kmaglione/olympia,Prashant-Surya/addons-server,jamesthechamp/zamboni,yfdyh000/olympia,aviarypl/mozilla-l10n-addons-server,Joergen/zamboni,muffinresearch/addons-server,Jobava/zamboni,koehlermichael/olympia,clouserw/zamboni,kmaglione/olympia,mstriemer/addons-server,Hitechverma/zamboni,mstriemer/olympia,p... | migrations/schematic_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport pytest\nfrom qtpy import QtSql\n\ndef test_qtsvg():\n \"\"\"Test the qtpy.QtSql namespace\"\"\"\n assert QtSql.QSqlDatabase is not None\n # assert QtSql.QSqlDriverCreator is not None... | python | edit | 3 | 1 | mit | 14c7f4295701ffbb5c7cd14062a43cb8c86d57de | davvid/qtpy,davvid/qtpy,spyder-ide/qtpy,goanpeca/qtpy,goanpeca/qtpy | qtpy/tests/test_qtsql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Wikibase data type classes.\"\"\"\n#\n# (C) Pywikibot team, 2013-2015\n#\n# Distributed under the terms of the MIT license.\n#\nfrom __future__ import absolute_import, unicode_literals\n\n__version__ = '$Id$'\... | python | edit | 1 | 4 | mit | 3f848be239d5fc4ae18d598250e90217b86e8fcf | hasteur/g13bot_tools_new,magul/pywikibot-core,jayvdb/pywikibot-core,Darkdadaah/pywikibot-core,happy5214/pywikibot-core,hasteur/g13bot_tools_new,magul/pywikibot-core,happy5214/pywikibot-core,wikimedia/pywikibot-core,npdoty/pywikibot,wikimedia/pywikibot-core,jayvdb/pywikibot-core,npdoty/pywikibot,Darkdadaah/pywikibot-cor... | pywikibot/_wbtypes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport io\nimport functools\nimport warnings\nimport six\n\nfrom .decoder import LabelDecoder\nfrom .encoder import LabelEncoder\n\n\ndef load(stream):\n \"\"\"Parse an isis label from a stream.\n\n :param stream: a ``.read()``-suppor... | python | edit | 1 | 2 | bsd-3-clause | eccda634d3233cd4f8aaeea372735731fd674c29 | michaelaye/Pysis,wtolson/pysis,wtolson/pysis,michaelaye/Pysis | pysis/labels/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom django.db.models import Manager\n\nfrom mezzanine.utils.cache import cache_installed\n\n\nclass TweetManager(Manager):\n \"\"\"\n Manager that handles generating the initial ``Query`` instance\n for a user, list or search te... | python | edit | 1 | 6 | bsd-2-clause | 0fae7ce68a531b2c27e03a854fba3319d041ee45 | viaregio/mezzanine,promil23/mezzanine,biomassives/mezzanine,dekomote/mezzanine-modeltranslation-backport,sjuxax/mezzanine,AlexHill/mezzanine,dustinrb/mezzanine,ZeroXn/mezzanine,theclanks/mezzanine,theclanks/mezzanine,SoLoHiC/mezzanine,guibernardino/mezzanine,dekomote/mezzanine-modeltranslation-backport,emile2016/mezzan... | mezzanine/twitter/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n import lockfile\nexcept ImportError:\n lockfile = None\n\nimport threading\n\nimport logging\nlog = logging.getLogger(__name__)\n\nNO_PYLOCKFILE_MESSAGE = \"pylockfile module not found, expect suboptimal Pulsar lock handling.\"... | python | edit | 1 | 3 | apache-2.0 | 4aad37d8186fab025ba29050620a929c167ca497 | ssorgatem/pulsar,natefoo/pulsar,natefoo/pulsar,ssorgatem/pulsar,galaxyproject/pulsar,galaxyproject/pulsar | pulsar/locks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom riot.app import quit_app, run_tag\nfrom riot.tags.style import parse_style\nfrom riot.tags.tags import parse_tag_from_node\nfrom riot.tags.utils import convert_string_to_node\nfrom riot.virtual_dom import def... | python | edit | 3 | 0 | mit | 2875a8e6c123d3d4f6039e7864ff66373c51daea | soasme/riotpy | examples/signal_handlers/signal_handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from urllib.parse import urlencode\nexcept ImportError:\n from urllib import urlencode\n\nimport tornado.testing\nimport tornado.options\n\nimport celery\n\nfrom flower.app import Flower\nfrom flower.urls import handlers\nfrom ... | python | edit | 3 | 3 | bsd-3-clause | 79c0071b7aad2992011684428611701bc58a9bff | jzhou77/flower,asmodehn/flower,jzhou77/flower,asmodehn/flower,asmodehn/flower,jzhou77/flower | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os.path import abspath, dirname, join\nimport json\n\n\nif __name__ == '__main__':\n file = abspath(join(dirname(__file__), '..', 'unittesting.json'))\n with open(file, 'w') as fp:\n config = {\n \"deferred\": T... | python | edit | 1 | 0 | mit | 5b156e3927f2168d9df36f5771c91807704c6dc9 | tomv564/LSP | tests/adjust_unittesting_config_for_ci.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport os\n\nfrom EasyEuler.cli import commands\n\nfrom click.testing import CliRunner\n\n\nclass CommandLineInterfaceTestCase(unittest.TestCase):\n def setUp(self):\n self.runner = CliRunner()\n\n\nclass TestGene... | python | edit | 1 | 1 | mit | 2da9a6d5f1668bc78995034ba3bb9ed22172e799 | Encrylize/EasyEuler | tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport simuvex\n\n######################################\n# Caller\n######################################\n\n\nclass Caller(simuvex.SimProcedure):\n \"\"\"\n Caller stub. Creates a Ijk_Call exit to the specified function\n \"\"\... | python | edit | 1 | 1 | bsd-2-clause | aa5bc77e78e82fbe63acf2fd8f6764a420f2e4e8 | axt/angr,chubbymaggie/angr,iamahuman/angr,tyb0807/angr,tyb0807/angr,chubbymaggie/angr,schieb/angr,iamahuman/angr,schieb/angr,angr/angr,angr/simuvex,iamahuman/angr,chubbymaggie/angr,axt/angr,angr/angr,chubbymaggie/simuvex,tyb0807/angr,angr/angr,f-prettyland/angr,f-prettyland/angr,axt/angr,schieb/angr,chubbymaggie/simuve... | simuvex/procedures/stubs/caller.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom django.conf import settings\n\n\nclass SettingsTestCase(TestCase):\n\n def test_modified_settings(self):\n with self.settings(CHATTERBOT={'name': 'Jim'}):\n self.assertIn('name', s... | python | edit | 1 | 1 | bsd-3-clause | 11abf077a8c429825c2ba55e42ffa590448da502 | vkosuri/ChatterBot,davizucon/ChatterBot,Reinaesaya/OUIRL-ChatBot,gunthercox/ChatterBot,Gustavo6046/ChatterBot,maclogan/VirtualPenPal,Reinaesaya/OUIRL-ChatBot | examples/django_app/tests/test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to populate Base Tags on app startup"
},
{
"role": "assistant",
"content": "from api.models import BaseTag\n\nTAGS = {\n 'fairness': {\n 'color': '#bcf0ff',\n 'description': 'Fairness is ideas of justice, rights... | python | new_file | 2 | 2 | mit | 18a8a9e90ab0dd31ca1ee147f85d16d0cc7e6bc1 | haystack/eyebrowse-server,haystack/eyebrowse-server,haystack/eyebrowse-server,haystack/eyebrowse-server,haystack/eyebrowse-server | api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\n\ndef check(header, convention=None, dimensions=[0, 1]):\n\n ix = dimensions[0] + 1\n iy = dimensions[1] + 1\n\n ctypex = header['CTYPE%i' % ix]\n crvaly = header['CRVAL%i' % iy]\n cr... | python | edit | 1 | 6 | mit | 47348a032bf86aac563dca41703f1e39d03b2360 | mwcraig/aplpy,allisony/aplpy | aplpy/header.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom ffmpy import FF\n\n\nclass FFprobe(FF):\n \"\"\"\n Wrapper for `ffprobe <https://www.ffmpeg.org/ffprobe.html>`_.\n\n Utilizes ffmpeg `pipe protocol <https://www.ffmpeg.org/ffmpeg-protocols.html#pipe>`_. Input da... | python | edit | 1 | 2 | mit | f9b3fd3d5e14c7ecfc59848e9edf6d99d5c6b98d | Ch00k/ffmpy,wchill/ffmpy3,astroza/ffmpy,astroza/ffmpy,Ch00k/ffmpy,wchill/ffmpy3 | ffmpy/ffprobe.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\nfrom goerr import err\nfrom dataswim import DataSwim\nfrom django.db.models.query import QuerySet\nfrom django_pandas.io import read_frame\n\n\nclass ChartFlo(DataSwim):\n\n def __repr__(self):\n \"\"\"\n ... | python | edit | 1 | 1 | mit | 9836c275d79851010654aacda379ccb78cea1b27 | synw/django-chartflo,synw/django-chartflo,synw/django-chartflo | chartflo/engine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\"\"\"\n gerberlicious, a python library for programmatically generating Gerber files\n\n Example script.\n\"\"\"\n\nfrom gerberlicious.point import Point\nfrom gerberlicious.layer import Layer\nfrom gerberlicious.aperture import Ci... | python | edit | 1 | 0 | mit | 986b15b5f33ebf25b26f40645378174bb66f1898 | deveah/gerberlicious | gerberlicious.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport multiprocessing\n\nfrom lobster.cmssw.plotting import Plotter\n\nlogger = multiprocessing.get_logger()\n\nclass DummyPlotter(object):\n def make_plots(*args, **kwargs):\n pass\n\nclass Actions(object):\n ... | python | edit | 1 | 3 | mit | b28dd26792be9125d2fd3d5657431bc6ee7a5470 | matz-e/lobster,matz-e/lobster,matz-e/lobster | lobster/cmssw/actions.py | rejected_duplicate | Near-duplicate of sample 13487 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\nTAGS = (\n # ( tag name, tag slug ),\n (\"augmented reality\", \"augmented-reality\"),\n (\"big data\", \"big-data\"),\... | python | edit | 3 | 2 | bsd-2-clause | ed667175f4961bbc7cc823657a5dd80f35ed9593 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/migrations/0002_tag_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"This module contains a cache handler.\"\"\"\n\n__author__ = 'Aaron Steele'\n\n# MOL imports\nimport cache\n\n# Standard Python imports\nimport json\nimport logging\nimport urllib\nimport webapp2\n\n# Google App Engine imports\nfrom go... | python | edit | 1 | 6 | bsd-3-clause | b0311af3895b359ce3a1ea1fad953c0b41585ce8 | MapofLife/MOL,MapofLife/MOL,MapofLife/MOL,MapofLife/MOL,MapofLife/MOL,MapofLife/MOL,MapofLife/MOL,MapofLife/MOL | app/cache_handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.translation import ugettext as _\nfrom django.utils.safestring import mark_safe\nfrom django.contrib.auth.models import User\n\ntry:\n from django import newforms as forms\nexcept ImportError:\n from django import fo... | python | edit | 1 | 2 | bsd-3-clause | cb17da3fbd819a386446bc2af42e38f8c95bc392 | fiam/blangoblog,fiam/blangoblog,fiam/blangoblog | blango/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# We need to enable global symbol visibility for lupa in order to\n# support binary module loading in Lua. If we can enable it here, we\n# do it temporarily.\n\ndef _try_import_with_global_library_symbols():\n try:\n import DLF... | python | edit | 5 | 3 | mit | c78d9c63238b5535b1881f4eee54700f5a138b04 | pombredanne/lupa,pombredanne/lupa | lupa/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nimport api\n\n\ndef index(request):\n uid = request.COOKIES.get(\"uid\")\n if not uid:\n uid... | python | edit | 1 | 2 | mit | 1cc044e601dc6b6d2a5f62c7557a6cd2d5b50986 | c17r/tsace,c17r/tsace,c17r/tsace | homepage/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport inspect\nimport sys\nimport unittest\n\nfrom contextlib import contextmanager\n\nimport kafka.tools.assigner.actions\n\nfrom kafka.tools.assigner.arguments import set_up_arguments\nfrom kafka.tools.assigner.modules import get_modules... | python | edit | 1 | 2 | apache-2.0 | fc2c3ec6680e8c1102a336ec0f6bde7db32d2070 | toddpalino/kafka-tools | tests/tools/assigner/test_arguments.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glob\nimport json\nimport os\n\nimport pytest\n\nfrom helpers import solutions_dir\n\n\n# NOTE: If we make solution_files a fixture instead of a normal attr/function,\n# then we can't use it in pytest's parametrize\nsolution_files = ... | python | edit | 1 | 1 | mit | 3068b3d55082947fcd0594945a705c3cc34659ca | project-lovelace/lovelace-engine,project-lovelace/lovelace-engine,project-lovelace/lovelace-engine | tests/test_python_solutions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport imgaug as ia\nimport imgaug.augmenters as iaa\n\n\ndef main():\n image = ia.quokka_square((128, 128))\n images_aug = iaa.Solarize(1.0)(images=[image] * (5*5))\n ia.imshow(ia.draw_grid(images_aug))\n\n\nif __name__ == \"__mai... | python | edit | 1 | 3 | mit | c755934a9bc9f15f1e7dcf6d337c3dd3acf4e824 | aleju/ImageAugmenter,aleju/imgaug,aleju/imgaug | checks/check_solarize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# relative\nfrom .passthrough import AcceptableSimpleType # type: ignore\nfrom .passthrough import PassthroughTensor # type: ignore\nfrom .passthrough import SupportedChainType # type: ignore\n\n```\n\nApply this change: Fix flake8 warni... | python | edit | 1 | 0 | apache-2.0 | d10344dce7d012de2d434cd205fb0f179e34113c | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/syft/src/syft/core/tensor/types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport time\nimport Axon\nfrom Kamaelia.Util.Backplane import *\nfrom Kamaelia.Util.Console import *\nfrom Kamaelia.Chassis.Pipeline import Pipeline\n\nclass Source(Axon.ThreadedComponent.threadedcomponent):\n value ... | python | edit | 9 | 2 | apache-2.0 | edcf561564a8fe30c80bda750ec0770c5e854ce8 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Code/Python/Kamaelia/Examples/Backplane/Forwarding.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\nfrom collections import OrderedDict\nimport sys\n\n\ndef call(url, methods=('ALL', )):\n def decorator(api_function):\n module = sys.modules[api_function.__name__]\n api_definition = sys.modules... | python | edit | 2 | 2 | mit | 418be2bfa0f902183b607fa402da75c09bf7e6db | STANAPO/hug,shaunstanislaus/hug,shaunstanislaus/hug,timothycrosley/hug,philiptzou/hug,janusnic/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug,jean/hug,giserh/hug,origingod/hug,janusnic/hug,yasoob/hug,gbn972/hug,MuhammadAlkarouri/hug,jean/hug,giserh/hug,timothycrosley/hug,gbn972/hug,alisaifee/hug,yas... | hug/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport flask\nimport os.path\nimport datetime\nimport urllib.parse\nfrom .. import database\nfrom .. import configmanager\nfrom . import controllers\n\nFILE_LOCATION = os.path.abspath(os.path.dirname(__file__))\nSTATIC_PATH = os.path.abspat... | python | edit | 4 | 1 | mit | 6610648c75dc90800655a3502d4cd24fb47ac406 | ollien/Timpani,ollien/Timpani,ollien/Timpani | timpani/webserver/webserver.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Leetcode 201. Bitwise AND of Numbers Range\nMedium\n\nURL: https://leetcode.com/problems/bitwise-and-of-numbers-range/\n\nGiven a range [m, n] where 0 <= m <= n <= 2147483647,\nreturn the bitwise AND of all numbers in this range, incl... | python | edit | 3 | 3 | bsd-2-clause | b04a01f451b2fe0348af217e9eed905b552cf1cf | bowen0701/algorithms_data_structures | lc0201_bitwise_and_of_numbers_range.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Blueprint, request\nfrom json import dumps, loads\nfrom redis import Redis\n\nfrom plenario.settings import REDIS_HOST_SAFE\n\n\nblueprint = Blueprint(\"apiary\", __name__)\nredis = Redis(REDIS_HOST_SAFE)\n\n\n@blueprint.r... | python | edit | 1 | 2 | mit | c576acc020e60e704dad55f8cd281c4ebb26ad28 | UrbanCCD-UChicago/plenario,UrbanCCD-UChicago/plenario,UrbanCCD-UChicago/plenario | plenario/apiary/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom appconf import AppConf\nfrom django.conf import settings\n\n\nclass ImageKitConf(AppConf):\n CACHEFILE_NAMER = 'imagekit.cachefiles.namers.hash'\n SPEC_CACHEFILE_NAMER = 'imagekit.cachefiles.namers.source_name_as_path'\n CACHE... | python | edit | 2 | 6 | bsd-3-clause | 32522114db3c9afc5331a898df3b956b6a3d229a | FundedByMe/django-imagekit,tawanda/django-imagekit,tawanda/django-imagekit,FundedByMe/django-imagekit | imagekit/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom .base import SimSootExpr\n\nfrom archinfo import ArchSoot\n\nimport logging\nl = logging.getLogger(\"angr.engines.soot.expressions.cast\")\n\nclass SimSootExpr_Cast(SimSootExpr):\n def __init__(self, expr, state):\n super(S... | python | edit | 1 | 4 | bsd-2-clause | 6b6181f1c2f902f20da440eb3bedb5d02ecfbf16 | iamahuman/angr,iamahuman/angr,iamahuman/angr,angr/angr,schieb/angr,schieb/angr,angr/angr,schieb/angr,angr/angr | angr/engines/soot/expressions/cast.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport argparse\nimport random\nimport sys\n\nDESCRIPTION = '''Shuffle the arguments received, if called without arguments \n the lines read from stdin will be shuffled and printed to\n ... | python | edit | 1 | 2 | apache-2.0 | a2582b3352582034af1b8dff99d4ac39a15d9b54 | aebm/shuffler | shuffler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: DOC: Add doc for pynifti package."
},
{
"role": "assistant",
"content": "\"\"\"\nNifti\n=====\n\n Python bindings for the nifticlibs. Access through the NiftiImage class.\n\n See help for pyniftiio.nifti.NiftiImage\n\n\"\"... | python | new_file | 3 | 0 | bsd-3-clause | 85809e34f1d8ad3d8736e141f3cb2e6045260938 | alexis-roche/nipy,alexis-roche/register,nipy/nireg,alexis-roche/register,nipy/nipy-labs,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/niseg,arokem/nipy,arokem/nipy,alexis-roche/nipy,nipy/nireg,bthirion/nipy,alexis-roche/nireg,alexis-roche/niseg,bthirion/nipy,bthirion/nipy,bthirion/nipy,alexis-roche/nireg,arokem/nipy,al... | neuroimaging/externals/pynifti/nifti/__init__.py | rejected_duplicate | Near-duplicate of sample 2902 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n```python\n\ni = -1\nsum = 0\n\none_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\nwhile i < 10:\n\ti += 1\n\tsum += one_to_ten[i]\n\nprint(sum)\n\n```\n```\n\nApply this change: Make function! and Use 4 tabs, not 8 tabs."
},
{
"role":... | python | edit | null | null | mit | 013048e1d68174e71d4579e28efd0339144ce186 | Yokan-Study/study,Yokan-Study/study,Yokan-Study/study | 2017/11.07/python/jya_homework2.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport logging\n\nfrom aleph.core import db, archive\nfrom aleph.model import Document\nfrom aleph.queues import ingest_entity\n\nlog = logging.getLogger(__name__)\n\n\ndef crawl_directory(collection, path, parent=None):\n \"\... | python | edit | 1 | 6 | mit | 2864441be365beb40e0396b444f8d96af8d7d92e | alephdata/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph | aleph/logic/documents.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n# PyCRS\n\nPyCRS is a pure Python GIS package for reading, writing, and converting between various\ncommon coordinate reference system (CRS) string and data source formats. \n\n- [Home Page](http://github.com/karimbahgat/PyCRS)\n- [... | python | edit | 6 | 0 | mit | 6a83c4808d7f1104aba832f53bcd25fb98be1686 | karimbahgat/PyCRS | pycrs/__init__.py | rejected_lint | Too many lint violations: 6 | 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',\n dest='foo',\n help='Se... | python | edit | 2 | 1 | mit | 3cf44a081f6dc824e1ff0639f424c0502fa6fe39 | s0undt3ch/cookiecutter-pytest-plugin,pytest-dev/cookiecutter-pytest-plugin,luzfcb/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\n\"\"\"\nraven.contrib.pylons\n~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\nfrom raven.middleware import Sentry as Middleware\nfrom rave... | python | edit | 1 | 3 | bsd-3-clause | a510d20cebe2aff86a6bf842d063b5df8937a7ec | tarkatronic/opbeat_python,tarkatronic/opbeat_python,inspirehep/raven-python,ticosax/opbeat_python,jbarbuto/raven-python,jmagnusson/raven-python,ronaldevers/raven-python,akalipetis/raven-python,collective/mr.poe,patrys/opbeat_python,arthurlogilab/raven-python,percipient/raven-python,inspirehep/raven-python,ronaldevers/r... | raven/contrib/pylons/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import render_template\nfrom app.main import main\n\n\n@main.app_errorhandler(400)\ndef bad_request(e):\n return render_template(\"errors/500.html\",\n **main.config['BASE_TEMPLATE_DATA']), 400\n\n\n@... | python | edit | 1 | 2 | mit | ae2f1014bbe83d64f17fee6a9ebd2c12cdc9a1bf | alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend | app/main/errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom brew.constants import IMPERIAL_UNITS\nfrom brew.constants import SI_UNITS\nfrom brew.recipes import Recipe\nfrom fixtures import grain_additions\nfrom fixtures import hop_additions\nfrom fixtures import recipe\n\n\nc... | python | edit | 1 | 2 | mit | 6f7890c8b29670f613b6a551ebac2b383f3a7a64 | chrisgilmerproj/brewday,chrisgilmerproj/brewday | tests/test_recipes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport json\nimport asyncio\nfrom butterfield.utils import at_bot\nfrom aiodocker import Docker\nfrom aiocore import Service\n\nWEB_ROOT = os.environ.get(\"MOXIE_WEB_URL\", \"http://localhost:8888\")\n\n\n\n@asyncio.coroutine\nde... | python | edit | 4 | 5 | mit | 931a858dc1cfde1652d21e1ccd60a82dde683ce3 | paultag/moxie,loandy/moxie,mileswwatkins/moxie,mileswwatkins/moxie,paultag/moxie,loandy/moxie,loandy/moxie,paultag/moxie,rshorey/moxie,rshorey/moxie,rshorey/moxie,mileswwatkins/moxie | moxie/butterfield.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render, redirect, get_object_or_404\nfrom django.urls import reverse\nfrom mainmodels.models import Category, Course, CourseInCategory\nfrom django.contrib.auth.models import User\n# Create your views here.\ndef... | python | edit | 5 | 3 | apache-2.0 | a3570205c90dd8757a833aed4f4069fbd33028e0 | PNNutkung/Coursing-Field,PNNutkung/Coursing-Field,PNNutkung/Coursing-Field | course/views.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nfrom nose.tools import *\n\ndef setup_yamlmod():\n\timport yamlmod\n\treload(yamlmod)\n\ndef teardown_yamlmod():\n\timport yamlmod\n\n\tfor hook in sys.meta_path:\n\t\tif isinstance(hook, yamlmod.YamlImportHook):\n\... | python | edit | 11 | 3 | mit | f0c374eba55cdeb56bf3526ea0da041556f6ffe2 | sciyoshi/yamlmod | tests/test_yamlmod.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import get_object_or_404\nfrom invoice.models import Invoice\nfrom invoice.pdf import draw_pdf\nfrom invoice.utils import pdf_response\n\n\ndef pdf_view(request, pk):\n invoice = get_object_or_404(Invoice, pk=pk)\n ... | python | edit | 1 | 1 | bsd-3-clause | 69baf66b13331d5936e8c540a2bb7eccb1d64cb7 | Chris7/django-invoice,Chris7/django-invoice,simonluijk/django-invoice | invoice/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'adrie_000'\n\nimport numpy as np\nimport numpy.matrixlib as nm\n\np = nm.matrix([[3, 3, 3], [3, 5, 7]])\nq = p - p.mean(1)\nprint q\nr = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]\nprint r\nd = [np... | python | edit | 4 | 0 | apache-2.0 | 94f795dbbac32cbe1c83da1fb3cd3e55fdceef11 | adrien-bellaiche/ia-cdf-rob-2015 | testFile.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport os\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"webview.settings\")\n\nimport logging\nfrom api.webview.models import Document\n\nfrom scrapi import events\nfrom scrapi.processing.bas... | python | edit | 1 | 2 | apache-2.0 | f7b351a43d99a6063c49dfdf8db60c654fd89b74 | CenterForOpenScience/scrapi,fabianvf/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,erinspace/scrapi,felliott/scrapi,mehanig/scrapi,fabianvf/scrapi,felliott/scrapi | scrapi/processing/postgres.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, unicode_literals\nfrom parser_base import RegexParser\nimport model\n\n\nclass RegexSemantics(object):\n def __init__(self):\n super(RegexS... | python | edit | 1 | 3 | bsd-2-clause | 0ea1153438c1d98232a921c8d14d401a541e95fd | vmuriart/grako,frnknglrt/grako | examples/regex/regex_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division\nimport os\nimport numpy as np\nimport scipy.io\nimport scipy.ndimage.interpolation\n\n\ndef load_head_phantom(number_of_voxels=None):\n if number_of_voxels is None:\n number_of_voxels = np.array((1... | python | edit | 1 | 3 | bsd-3-clause | 0da74f42f7d7311859a340b0e72c1b8902287d5c | CERN/TIGRE,CERN/TIGRE,CERN/TIGRE,CERN/TIGRE | Python/tigre/utilities/sample_loader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Local imports\nfrom uplink import session\n\n\ndef test_base_url(uplink_builder_mock):\n # Setup\n uplink_builder_mock.base_url = \"https://api.github.com\"\n sess = session.Session(uplink_builder_mock)\n\n # Run & Verify\n ... | python | edit | 1 | 1 | mit | c5970991ed2d3285e6a3ef9badb6e73756ff876b | prkumar/uplink | tests/test_session.py | rejected_duplicate | Near-duplicate of sample 2502 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nimport yaml\n\n\ndef main(base_file, new_file, overwrite_language):\n old = yaml.load(file(base_file).read())\n new = yaml.load(file(new_file).read())\n\n assert len(overwrite_language) == 2\n\n for o, n in zip(old... | python | edit | 3 | 9 | mit | d635fc9129bc4ccfd5384be6958ae1c14e9916ec | okfde/eucopyright,okfde/eucopyright,okfde/eucopyright | scripts/merge_translations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport os\nimport signal\n\nfrom setproctitle import setproctitle\n\n\nclass Proc(object):\n\n signal_map = {}\n\n def __init__(self):\n self.logger = logging.getLogger(self.__module__)\n\n self.pid = Non... | python | edit | 1 | 2 | mit | 03a78a509c0213f8f95223a7926a1bce547f05fe | wglass/rotterdam | rotterdam/proc.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.