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# -*- coding:utf-8 -*-\n\nfrom subprocess import check_output\nfrom multiprocessing import Pool\nfrom os import listdir, mkdir, path\nfrom sys import argv\n\ndef run_simu((psfile, dir_runs)):\n \"\"\"Runs the main script with specified p... | python | edit | 6 | 1 | mit | 2d4b6b1fa84f7530d064bfc5577d61430b4e5a34 | neuro-lyon/multiglom-model,neuro-lyon/multiglom-model | run_multip.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\ntry:\n import honeypot\nexcept ImportError:\n honeypot = None\n\n\nif not settings.configured:\n INSTALLED_APPS = (\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n ... | python | edit | 1 | 0 | mit | 7e4227b304da4313a3114a95d361fc5bb6bf5529 | r4ts0n/django-envelope,zsiciarz/django-envelope,r4ts0n/django-envelope,zsiciarz/django-envelope | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport rethinkdb as r\nfrom optparse import OptionParser\n\n\ndef compute_project_size(project_id, conn):\n total = 0\n for f in r.table('project2datafile').get_all(project_id, index=\"project_id\").eq_join('d... | python | edit | 3 | 3 | mit | 3504bd0c867841c85f5ef54cdb5096ec5117cc1e | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/scripts/projsize.py | rejected_duplicate | Near-duplicate of sample 9206 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom core.models import ApplicationBookmark as ImageBookmark\nfrom django.utils import timezone\nfrom django.db.models import Q\n\nfrom api.v2.serializers.details import ImageBookmarkSerializer\nfrom api.v2.views.base import AuthViewSet\nfr... | python | edit | 1 | 1 | apache-2.0 | 2f0f34efa83736b1f09db1971ca17ab6d0006516 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/v2/views/image_bookmark.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Create your views here.\nfrom django.http import HttpResponse\nfrom lingcod.raster_stats.models import zonal_stats, RasterDataset, ZonalStatsCache\nfrom django.core import serializers\nfrom django.contrib.gis.geos import fromstr\n\ndef st... | python | edit | 2 | 4 | bsd-3-clause | 7cd2f582c444c483b9f8a677063f03dfe9ce0e0a | underbluewaters/marinemap,underbluewaters/marinemap,underbluewaters/marinemap | lingcod/raster_stats/views.py | rejected_duplicate | Near-duplicate of sample 2960 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport bosh_client\nimport os\nimport yaml\n\n\ndef do_step(context):\n settings = context.meta['settings']\n username = settings[\"username\"]\n home_dir = os.path.join(\"/home\", username)\n\n f = open('manifests/index.yml')\n... | python | edit | 8 | 3 | apache-2.0 | c61cace4106a8cf9a27099acbfae26ba2a727d65 | cf-platform-eng/bosh-azure-template,cf-platform-eng/bosh-azure-template | install_steps/run_errands.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n# Copyright 2014-2018 PUNCH Cyber Analytics Group\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 obtai... | python | edit | 16 | 0 | apache-2.0 | 9a7de89fd4bc6d134f30bdee4c8a71b34e1e6ab9 | PUNCH-Cyber/stoq | stoq/__init__.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nfrom utilities.logger import ThreadLogger\nfrom utilities.mail import send_mail\nfrom utilities.mail import InvalidConfigurationException\n\n\"\"\"\nServer action to extend expiration date on a server by 30 days\n\"\"\"\n\n... | python | edit | 1 | 4 | apache-2.0 | 7e9f765b90df14b66a361c6cf9fe25a38189475a | CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge | actions/server/extend_expiration_date.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Convenience functions for matplotlib plotting and image viewing.\"\"\"\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n\ndef show(image, blocking=False, **kwargs):\n \"\"\"Show *image*. If *blocking* is False the call ... | python | edit | 1 | 2 | mit | adb6c4c86407d6c66e8679aefdf2f2f0c9c87277 | tfarago/pltpreview | pltpreview/view.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pragma: no cover\n\nimport warnings\n\nimport django\n\n\nif django.VERSION < (3, 2):\n from feincms3.applications import * # noqa\n\n warnings.warn(\n \"Django 3.2 will start autodiscovering app configs inside '.apps' modul... | python | edit | 1 | 0 | bsd-3-clause | ea02f8e714df34da0ff55a8c9750eb0d992875c2 | matthiask/feincms3,matthiask/feincms3,matthiask/feincms3 | feincms3/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n\n# enable web debugging\nimport cgitb\ncgitb.enable()\n\nprint(\"Content-Type: text/html;charset=utf-8\")\nprint()\n\nimport formar.fweb.WebFormar\n\n\n```\n\nApply this change: Add external modu... | python | edit | 3 | 0 | apache-2.0 | 878de0641342b4f43ca6cfe48357e9e198bc696f | ronengi/Formar,ronengi/Formar | index.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom turtle import *\n\nGROESSE = 0.5\nFARBE = \"red\"\nFAERBEN = True\nSHAPE = \"turtle\"\n\nfillcolor(FARBE)\nshape(SHAPE)\n\ndef zeichneKerze(brennt):\n pd()\n begin_fill()\n forward(GROESSE*100)\n left(90)\n forward(GROES... | python | edit | 32 | 2 | mit | 6b6fb12545ff3b35420fd2382576a6150044bdc8 | luforst/adventskranz | kerze.py | rejected_lint | Too many lint violations: 32 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Leetcode 53. Maximum Subarray\nEasy\n\nGiven an integer array nums, find the contiguous subarray\n(containing at least one number) which has the largest sum and return its sum.\n\nExample:\n\nInput: [-2,1,-3,4,-1,2,1,-5,4],\nOutput: 6... | python | edit | 2 | 2 | bsd-2-clause | 204c955b7150e3ef26f44e1982359b2d6096eebe | bowen0701/algorithms_data_structures | lc053_maximum_subarray.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom subprocess import call, check_output\nimport sys\n\nisPython3 = sys.version_info.major == 3\n\n# https://stackoverflow.com/a/3357357\ncommand = 'git log --format=%B -n 1'.split()\nout = check_output(command)\n\nif b'build wheels' not i... | python | edit | 2 | 0 | bsd-3-clause | 5c7161858fa7ca2962f08b66f6d20ae49715c206 | jr-garcia/AssimpCy,jr-garcia/AssimpCy | ci_scripts/buildLinuxWheels.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\n\nimport pyglet.window\nfrom pyglet.gl import *\nfrom pyglet import clock\nfrom pyglet.ext.scene2d import Image2d\n\nfrom ctypes import *\n\nif len(sys.argv) != 2:\n print 'Usage: %s <PNG/JPEG filename>'%sys.argv[0... | python | edit | 2 | 1 | bsd-3-clause | 7f6cd8f5444d92644642cadb84d7f958e0b6fce1 | regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations | examples/image_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom learntools.core import *\nimport tensorflow as tf\n\n\nclass Q1A(ThoughtExperiment):\n _solution = \"\"\n\n\nclass Q1B(ThoughtExperiment):\n _solution = \"\"\n\nQ1 = MultipartProblem(Q1A, Q1B)\n\nclass Q2A(ThoughtExperiment):\n ... | python | edit | 13 | 1 | apache-2.0 | 3ddbff7204c8458be777cdf194ce38170c1982d9 | Kaggle/learntools,Kaggle/learntools | learntools/computer_vision/ex4.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 12/2 part 2 solution"
},
{
"role": "assistant",
"content": "# Advent of Code\n# Dec 2, Part 1\n# @geekygirlsarah\n\ninputFile = \"input.txt\"\n\n# Tracking vars\nfinalCode = \"\"\nlastNumber = 5 # start here\ntempNumber ... | python | new_file | 1 | 0 | mit | fffce05288a80b4d4e8e45b6a1282eaa6c2d80c4 | geekygirlsarah/adventofcode2016 | dec02/dec02part2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\n\nfrom opps.channels.templatetags.menu_tags import ofKey\n\n\nclass OfKeyTest(TestCase):\n def test_tag(self):\n result = ofKey({\"name\": \"andrews\"}, \"name\")\n self.assertEqual(result,... | python | edit | 1 | 1 | mit | c88310e970518c3531dbe26c9544ff4455068a7e | williamroot/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,YACOWS/opps,jeanmask/opps,opps/opps,opps/opps,jeanmask/opps | opps/core/tests/test_obj_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom _nnpy import ffi, lib as nanomsg\n\nclass NNError(Exception):\n def __init__(self, error_no, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self.error_no = error_no\n\ndef convert(rc, value=None):\n if rc <... | python | edit | 1 | 3 | mit | 0e866db1377e4c58ef05d66583cea6e35071ba20 | nanomsg/nnpy | nnpy/errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.backends import ModelBackend\nfrom django.contrib.auth.models import User\n\n\nclass CustomUserModelBackend(ModelBackend):\n def authenticate(self, username=None, password=None):\n \"\"\"Allow users to log... | python | edit | 1 | 4 | bsd-2-clause | 06c7e43f96f9394949b0ec1ed709429ab3167cf9 | incuna/incuna-auth,ghickman/incuna-auth,ghickman/incuna-auth,incuna/incuna-auth | incuna_auth/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Given a singly linked list of integers l and an integer k, remove all elements from list l that have a value equal to k\n\nclass Node(object):\n\tdef __init__(self, value):\n\t\tself.value = value\n\t\tself.next = None\n\ndef remove_k_fro... | python | edit | 1 | 4 | mit | 6557cbe8bee7ded848ba7c3928e2b4f82aedeea8 | derekmpham/interview-prep,derekmpham/interview-prep | linked-list/remove-k-from-list.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom twitter.models import User, Tweet, Analytics, AnalyticsReport\n\n\nclass UserAdmin(admin.ModelAdmin):\n list_display = ('screen_name', 'current_followers')\n\n\nclass AnalyticsAdmin(admin.ModelAdmin... | python | edit | 1 | 0 | mit | ee6bd389e3e602b67fac399cdb4a50c3a67666b9 | CIGIHub/tweet_cache,albertoconnor/tweet_cache | twitter/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python\n#items=[('a','b'),(1,2)]\n#b=dict(items)\n#print b\n#c=dict(name='c',age=42)\n#print c\n#print len(c)\n#c['sex']='female'\n#print c\n#del c['age']\n#print c\n#print 'sex' in c\n#c['age']=25\n#print c\n#print c.clear... | python | edit | 3 | 0 | apache-2.0 | 08ac56dc6d80560ec46ad06fec6843be18bb1d91 | Vayne-Lover/Python | dictionary/test1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport factory\n\nfrom factories.factory_projects import ProjectFactory\nfrom factories.factory_users import UserFactory\nfrom pipelines.models import Pipeline, Operation\n\n\nclass PipelineFactory(factory.DjangoModelFactory):\n user = f... | python | edit | 1 | 0 | apache-2.0 | 6a717adf087f847ae4a58375170d01adf5ef17de | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/factories/pipelines.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom update import *\nfrom plot_and_save import *\nfrom Parameters.parametersA3 import n, n_t, n0\nanimate = False # animate the wave in the string upon completion\nplot = False # plot the waveform and frequency spectrum... | python | edit | 17 | 0 | mit | 404ff05ea8a57fff8e706a26b69356366e67352f | madarivi/PianoSimulation | main.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom nose.tools import *\n\nfrom libeeyore.builtins import add_builtins\nfrom libeeyore.classvalues import *\nfrom libeeyore.environment import EeyEnvironment\nfrom libeeyore.cpp.cppvalues import *\nfrom libeeyore.cpp.cpprenderer import E... | python | edit | 37 | 1 | mit | 84ccc5489b4d3dfdf1883bb777cd597bd9cb8e53 | andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper | src/test/testclasses.py | rejected_lint | Too many lint violations: 37 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Load the on-time parquet file\non_time_dataframe = sqlContext.read.parquet('../data/on_time_performance.parquet')\n\nwikidata = sqlContext.read.json('../data/wikidata-20160404-all.json.bz2')\n\n```\n\nApply this change: Work on chapter 7 ... | python | edit | 2 | 0 | mit | a5d2751be278356e2a03fe07f5a1d0aef11b401f | rjurney/Agile_Data_Code_2,naoyak/Agile_Data_Code_2,rjurney/Agile_Data_Code_2,rjurney/Agile_Data_Code_2,naoyak/Agile_Data_Code_2,rjurney/Agile_Data_Code_2,naoyak/Agile_Data_Code_2,naoyak/Agile_Data_Code_2 | ch07/enrich_airlines.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport re\nimport urllib\n\ndef handle_url(bot, user, channel, url, msg):\n \"\"\"Handle IMDB urls\"\"\"\n \n m = re.match(\"(http:\\/\\/open.spotify.com\\/|spotify:)(album|artist|track)([:\\/])([a-zA-Z0-9]+)\\/?\", url)\n if ... | python | edit | 1 | 2 | bsd-3-clause | 898e087d67ba5f6f8af3f280d46c59edc0bb665e | EArmour/pyfibot,nigeljonez/newpyfibot,huqa/pyfibot,lepinkainen/pyfibot,rnyberg/pyfibot,lepinkainen/pyfibot,aapa/pyfibot,aapa/pyfibot,EArmour/pyfibot,rnyberg/pyfibot,huqa/pyfibot | modules/module_spotify.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom celery.decorators import task\nfrom make_mozilla.bsd import BSDRegisterConstituent\n\n@task\ndef register_email_address_as_constituent(email_address, group):\n BSDRegisterConstituent.add_email_to_group(email_address, group)\n\n```\n... | python | edit | 1 | 1 | bsd-3-clause | 1525c25029a2cd93494ebab45377661d606fa7ab | mozilla/make.mozilla.org,mozilla/make.mozilla.org,mozilla/make.mozilla.org,mozilla/make.mozilla.org | make_mozilla/events/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport warnings\n\nqt_api = os.environ.get('QT_API')\n\nif qt_api is None:\n try:\n import PySide\n qt_api = 'pyside'\n except ImportError:\n try:\n import PyQt4\n qt_api = 'pyqt'\... | python | edit | 3 | 0 | bsd-3-clause | 817c9634e89be79c5ca4e08ce48c1eb1dd173f46 | jwiggins/scikit-image,blink1073/scikit-image,Hiyorimi/scikit-image,pratapvardhan/scikit-image,paalge/scikit-image,rjeli/scikit-image,emon10005/scikit-image,robintw/scikit-image,newville/scikit-image,almarklein/scikit-image,almarklein/scikit-image,oew1v07/scikit-image,vighneshbirodkar/scikit-image,michaelaye/scikit-imag... | skimage/viewer/qt/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Serializer fields\"\"\"\nfrom django.contrib.gis import forms\nfrom rest_framework.fields import WritableField\n\nfrom spillway.compat import json\n\n\nclass GeometryField(WritableField):\n type_name = 'GeometryField'\n type_lab... | python | edit | 1 | 2 | bsd-3-clause | 27723696885319aabea974f83189d3a43770b7d5 | bkg/django-spillway,barseghyanartur/django-spillway,kuzmich/django-spillway | spillway/fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\n\nfrom characters import BaseCharacer\n\n\nclass Mentor(BaseCharacer):\n MENTORS_COUNT = 4\n\n def __init__(self, location, *groups):\n super(Mentor, self).__init__(location, *groups)\n\n def change_place(self... | python | edit | 2 | 1 | mit | f3ef685d4bb900733741f53e1afcefd143b26289 | arturbalabanov/hacksym | npcs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef test_scrape_item_by_id():\n from api.scrapers.item import scrape_item_by_id\n\n item = scrape_item_by_id('d19447e548d')\n\n assert item.id == 'd19447e548d'\n assert item.name == 'Thyrus Zenith'\n assert item.type == 'Two-... | python | edit | 1 | 1 | mit | 0b6e9d6e329b8e88fca9635640ef0842f3cb82c2 | Demotivated/loadstone | api/tests/test_scrapers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport subprocess\nimport atexit\nimport sys\nfrom utils.safe_schedule import SafeScheduler\nfrom time import sleep\nfrom glob import glob\n\n\nMETA_IMPORT = '# narcissa import '\nscheduler = SafeScheduler()\n\n\nd... | python | edit | 1 | 2 | mit | 68ae2de4b51a2fe0f02c40bad8731d34b1092521 | mplewis/narcissa | narcissa.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport shutil\nimport logging\n\nfrom bcbio import install\ninstall._set_matplotlib_default_backend()\nimport matplotlib\nmatplotlib.use('Agg', force=True)\n\nfrom libs.read import load_data\nfrom libs.report import make_profile\... | python | edit | 1 | 2 | mit | 5933f9ef0ff7af0fd85a7dbe6578eefe9b8f7cdf | lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster | seqcluster/create_report.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Plot image to screen\nimport cv2\nimport numpy\nimport matplotlib\nfrom plantcv.plantcv import params\nfrom matplotlib import pyplot as plt\nfrom plantcv.plantcv import fatal_error\n\n\ndef plot_image(img, cmap=None):\n \"\"\"Plot an i... | python | edit | 3 | 9 | mit | eda7125f28a9da3c5ccefb3ec5c604ddd23d3034 | danforthcenter/plantcv,stiphyMT/plantcv,danforthcenter/plantcv,danforthcenter/plantcv,stiphyMT/plantcv,stiphyMT/plantcv | plantcv/plantcv/plot_image.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .pipeline import (\n install,\n uninstall,\n\n Creator,\n\n ls,\n containerise,\n\n)\n\nfrom .lib import (\n lsattr,\n lsattrs,\n read,\n\n maintained_selection,\n unique_name\n)\n\n\n__all__ = [\n \"in... | python | edit | 1 | 0 | mit | 3e488750a460afa549795d7189f5c5b1c43f96e0 | getavalon/core,mindbender-studio/core,mindbender-studio/core,getavalon/core | avalon/houdini/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nfile: model_files.py\n\nGraph model classes for working with files\n\"\"\"\n\nimport os\nimport logging\n\nfrom lie_graph.graph_mixin import NodeEdgeToolsBaseClass\n\n\nclass FilePath(NodeEdgeToolsBaseClas... | python | edit | 2 | 4 | apache-2.0 | 8aae2526f4e565982f8c57c25d796c59d17e6c46 | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | components/lie_graph/lie_graph/graph_model_classes/model_files.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nDEBUG = True\n\nBASE_DIR = os.path.dirname(__file__)\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),\n }\n}\n\nSECRET_KEY = '_'\n\nMI... | python | edit | 1 | 0 | mit | a2b6aa3bd90e967e2b7811f65a6b7311f13c53b3 | johnwalker/djoser,akalipetis/djoser,fladi/djoser,yiyocx/djoser,barseghyanartur/djoser,sunscrapers/djoser,sunscrapers/djoser,dokenzy/djoser,carlosfunk/djoser,akalipetis/djoser,PingaxAnalytics/koob_auth,liyocee/djoser,sunscrapers/djoser,mjuopperi/djoser,vandoornik/djoser,unacast/djoser,apokinsocha/djoser,avances123/djose... | testproject/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Main application file\n#\n# Copyright (c) 2017, Alexandre Hamelin <alexandre.hamelin gmail.com>\n\n\nimport os\nfrom flask import Flask\nfrom flask_login import LoginManager\napp = Flask(__name__)\napp.secret_key = 'default-secret-key'\n\... | python | edit | null | null | mit | 833a83a109bc52b034bbfeabc9a9e2d99d8226f9 | 0xquad/flask-app-template,0xquad/flask-app-template,0xquad/flask-app-template | app.tmpl/__init__.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom celery import shared_task\nfrom mrbelvedereci.build.models import Build\nfrom mrbelvedereci.salesforce.models import Org\n\n@shared_task\ndef run_build(build_id):\n build = Build.objects.get(id=build_id)\n build.run()\n return... | python | edit | 1 | 4 | bsd-3-clause | a38ee91cbb45cba35c930aae780a469c0cbc762c | SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci | mrbelvedereci/build/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"Tests for go.vumitools.api_worker.\"\"\"\n\nfrom twisted.internet.defer import inlineCallbacks\n\nfrom vumi.application.tests.test_base import ApplicationTestCase\n\nfrom go.vumitools.api_worker import VumiA... | python | edit | 1 | 1 | bsd-3-clause | 64219411d0bcbb7dafc754bef8538fc237584031 | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/vumitools/tests/test_api_worker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright FuseSoC contributors\n# Licensed under the 2-Clause BSD License, see LICENSE for details.\n# SPDX-License-Identifier: BSD-2-Clause\n\nimport logging\nimport os.path\nimport shutil\nimport subprocess\n\nfrom fusesoc.provider.prov... | python | edit | 4 | 2 | bsd-2-clause | c96f939c25663e5b123e2123d2d8ec69cf7c4cbe | olofk/fusesoc,olofk/fusesoc | fusesoc/provider/git.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport collections\nimport collections.abc\n\n\ndef strings_have_format_map_method():\n \"\"\"\n As of Python 3.2 you can use the .format_map() method on a string object\n to use mapping objects (not just builtin dictionaries) when... | python | edit | 1 | 2 | mit | 607ba7481abc7556c247e140b963dfc9d5bd2161 | svisser/python-3-examples | examples/strings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\nfrom random import randrange\n\nfrom todoman import ui\n\nDATE_FORMAT = \"%d-%m-%y\"\n\n\ndef test_format_date():\n \"\"\"\n Tests the format_date function in todoman.ui.TodoFormatter\n \"\... | python | edit | 1 | 1 | isc | 749c727b044244060e1e17ad51505ee11957bfeb | rimshaakhan/todoman | tests/test_formatter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom pacman103.core import control\nfrom pacman103 import conf\n\nfrom . import builder\n\n\nclass Simulator(object):\n def __init__(self, model, dt=0.001, seed=None):\n # Build the model\n self.builder = buil... | python | edit | 1 | 3 | mit | ca9cd229faaa0fc43a2ac0e4c6354331c0b57550 | ctn-archive/nengo_spinnaker_2014,ctn-archive/nengo_spinnaker_2014,ctn-archive/nengo_spinnaker_2014,ctn-archive/nengo_spinnaker_2014 | nengo_spinnaker/simulator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n# pylint: disable=unused-wildcard-import,unused-import,wildcard-import\n\nSRC_DIR = os.path.dirname(os.path.abspath(__file__)) # elife-builder/src/\n\n# once called 'THIS_DIR', now deprecated as confusing.\nPROJECT_DIR = os.pat... | python | edit | 17 | 0 | mit | 7cfdde79d161b463bf720cd7e222812280d09cdc | elifesciences/builder,elifesciences/builder | src/fabfile.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, request, redirect\nimport twilio.twiml\n\napp = Flask(__name__)\n\n@app.route(\"/\", methods=['GET', 'POST'])\ndef hello_monkey():\n \"\"\"Respond to incoming requests\"\"\"\n resp = twilio.twiml.Response()\n ... | python | edit | 2 | 2 | mit | eeba670eb9ee4aabf36843add730eaa983de7ca6 | ColdSauce/tw-1,christophert/tw-1,zachlatta/tw-1 | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\nimport jinja2\nimport sys\nimport re\nimport os\n\n\nKEY_REGEX = re.compile('([A-Z]+)=(\\w+)')\n\n\ndef main():\n args = sys.argv[1:]\n if len(args) < 1:\n raise Exception('args too short {}'.format(args... | python | edit | 2 | 5 | mit | dfd6e69b0a6202ed562360201e123e40c7aa1cc9 | BedquiltDB/bedquilt-core | bin/template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Author(models.Model):\n '''Object for book author'''\n\n first_name = models.CharField(max_length=128)\n last_name = models.CharField(max_length=128)\n\n def __unicode__(self):\n return self.last... | python | edit | 1 | 1 | mit | 90405c60b5d2ce583597382bc72e116cb9a450bd | DUCSS/ducss-site-old,DUCSS/ducss-site-old,DUCSS/ducss-site-old | project/library/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf8 -*-\nfrom __future__ import division, print_function, division\n\nimport pylifx\n\n\nif __name__ == '__main__':\n import argparse\n\n parser = argparse.ArgumentParser()\n parser.add_argument('bulb_addr')\n p... | python | edit | 1 | 3 | bsd-3-clause | 9bdd1c9a33bd48cde186a5d4c425fc8745017cd9 | MichaelAquilina/lifx-cmd | lifx.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\nimport os\n\nf = open(os.path.join(os.path.dirname(__file__), 'README.rst'))\nreadme = f.read()\nf.close()\n\nsetup(\n name='roku',\n version='3.1',\n description='Client for the Roku me... | python | edit | 1 | 0 | bsd-3-clause | 2b9f5550c85c3f89de7ee25f29cf40af121c70d3 | jcarbaugh/python-roku | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='nose2_html_report',\n packages=['nose2_html_report'],\n version='0.1.0',\n description='Generate an HTML report for your unit tests',\n long_description=open('README.md', 'r').re... | python | edit | 1 | 0 | mit | fa232a1bc9d051ac5d734d7dd888601608f6854b | mgrijalva/nose2-html-report,mgrijalva/nose2-html-report | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a requirements configuration exception"
},
{
"role": "assistant",
"content": "class CommandConfigError(Exception):\n \"\"\"Exception for command configuration errors\"\"\"\n pass\n\nclass RequirementsConfigError(Excepti... | python | new_file | 1 | 0 | mit | d731b4172592ef905101868b43817f25f5b04063 | ravenac95/virtstrap-core,ravenac95/testvirtstrapdocs,ravenac95/virtstrap-core | virtstrap/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\nfrom tools.generate_pyi import generate_pyi\n\ndef main():\n # Generate .pyi files\n import pyxtf.xtf_ctypes\n generate_pyi(pyxtf.xtf_ctypes)\n import pyxtf.vendors.kongsberg\n generate_pyi(pyxtf... | python | edit | 1 | 1 | mit | f1a683e98bf72cbbe4b65414184ed371af3b5879 | oysstu/pyxtf | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\nimport mando\n\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as fobj:\n readme = fobj.read()\n\nsetup(name='mando',\n version=mando.__version__,\n author='Michele L... | python | edit | 1 | 0 | mit | 08bab0a9e9ae2c362f1c4238fa70b39be109edfd | MarioSchwalbe/mando,MarioSchwalbe/mando,rubik/mando | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\nimport sys\nfrom sys import version_info\nfrom os.path import dirname, join as pjoin\nfrom setuptools import setup, find_packages\n\nwith open(pjoin(dirname(__file__), 'furl', '__init__.py')) as fd:\n VERSION = re.c... | python | edit | 1 | 0 | unlicense | f585b90825f5bb57cadefc6689765fd1ebff6b1a | Gerhut/furl,guiquanz/furl,lastfm/furl,penyatree/furl | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pbag.serialize import dump, load\n\n\ndata = [b'Hello\\n', 1, b'world!', None]\n\n\ndef test_core():\n with open('_foo.pack', 'wb') as f:\n dump(data, f)\n\n with open('_foo.pack', 'rb') as f:\n data2 = load(f)\n\n ... | python | edit | 1 | 1 | bsd-3-clause | 58ed8c24288ee8f470acfa85cc6ae267f0ad2fd8 | jakirkham/dask,clarkfitzg/dask,marianotepper/dask,ContinuumIO/dask,esc/dask,pombredanne/dask,wiso/dask,jcrist/dask,mraspaud/dask,hainm/dask,pombredanne/dask,jakirkham/dask,ssanderson/dask,mraspaud/dask,cpcloud/dask,wiso/dask,mrocklin/dask,minrk/dask,ContinuumIO/dask,PhE/dask,PhE/dask,esc/dask,jayhetee/dask,blaze/dask,d... | pbag/tests/test_serialize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nfrom BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer\n\nclass ErrorHTTPRequestHandler(BaseHTTPRequestHandler):\n def do_GET(self):\n self.send_response(420)\n\nif sys.argv[1:]:\n po... | python | edit | 1 | 1 | mit | d9f3e43a05663706b266d60c1f707133b0c3b6a0 | pozorvlak/error_proxy | error_proxy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nfrom setuptools import setup, find_packages\n\n\ndef recursive_path(pack, path):\n matches = []\n for root, dirnames, filenames in os.walk(os.path.join(pack, path)):\n for filename in filenames... | python | edit | 1 | 3 | mit | b21706f393ed7c619f5b4ce8ce8a481fb3941a92 | JoaoFelipe/ipython-unittest,JoaoFelipe/ipython-unittest | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom setuptools import setup, find_packages\nimport os\n\n\ndef readfile(fname):\n with open(os.path.join(os.path.dirname(__file__), fname)) as f:\n return f.read()\n\n\nsetup(\n name=\"imagesort\",\n ... | python | edit | 1 | 1 | mit | 28e9cd3e9d047883668263e595978392cd208ac5 | leinz/imagesort | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nsetup(name='devito',\n version='2.0.1',\n description=\"\"\"Finite Difference DSL for symbolic stencil computation.\"\"\",\n ... | python | edit | 1 | 0 | mit | 68f07070c829fa2703167e8f1c8161d364e3b800 | opesci/devito,opesci/devito | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport setuptools\nimport codecs\nimport os.path\n\n# Used to read the file\ndef read(rel_path):\n here = os.path.abspath(os.path.dirname(__file__))\n with codecs.open(os.path.join(here, rel_path), 'r') as fp:\n return fp.read(... | python | edit | 1 | 4 | mit | e0aba854c685610af085da91e25bb3682f20461b | robotichead/NearBeach,robotichead/NearBeach,robotichead/NearBeach | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\n# Python version flags for Python 3 support\nPY2 = ( sys.version_info.major == 2 )\nPY3 = ( sys.version_info.major == 3 ) \n\n```\n\nApply this change: Make this work on python2.6 again"
},
{
"role": "assistant",
... | python | edit | 1 | 0 | mit | a6ce774d11100208d2a65aa71c3cb147a550a906 | akesterson/dpath-python,pombredanne/dpath-python,benthomasson/dpath-python,lexhung/dpath-python,calebcase/dpath-python | dpath/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012 OpenStack Foundation\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy ... | python | edit | 1 | 1 | apache-2.0 | fb4bac2a228a196359317f338c3f1e6643c3837d | gooddata/openstack-nova,Juniper/nova,mikalstill/nova,cernops/nova,cernops/nova,vmturbo/nova,NeCTAR-RC/nova,klmitch/nova,jianghuaw/nova,mikalstill/nova,klmitch/nova,Juniper/nova,cloudbase/nova,cernops/nova,openstack/nova,rahulunair/nova,gooddata/openstack-nova,jianghuaw/nova,klmitch/nova,NeCTAR-RC/nova,mikalstill/nova,h... | nova/tests/unit/compute/fake_resource_tracker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\ntry:\n from pypandoc import convert\n read_md = lambda f: convert(f, 'rst')\nexcept ImportError:\n print(\"warning: pypandoc module not found, could not convert Markdown to RST\")\n read_md = lambda... | python | edit | 1 | 0 | apache-2.0 | 66250b7e448f54bc0cd9eb8b16731a885e4cf3e7 | o19s/elyzer | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"vcrpy-unittest setup module based on\nhttps://github.com/pypa/sampleproject\n\"\"\"\nfrom __future__ import absolute_import, unicode_literals\n\nfrom setuptools import setup, find_packages\nfrom codecs import open\nimport os\n\nhere =... | python | edit | 1 | 0 | mit | 89493c1249a5233cf8efb5be965ce427cdd5280a | agriffis/vcrpy-unittest | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom winton_kafka_streams.state.in_memory_key_value_store import InMemoryKeyValueStore\n\n\ndef test_inMemoryKeyValueStore():\n store = InMemoryKeyValueStore('teststore')\n\n store['a'] = 1\n assert store['a'] == 1\n\n store['a'... | python | edit | 1 | 1 | apache-2.0 | 2e406c8cca9e55c9b8e2dcbf33005aa580ef74ea | wintoncode/winton-kafka-streams | tests/state/test_in_memory_key_value_store.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ab_bridge\nimport alpha_beta\nfrom gui import *\n\nfrom player import *\n\nimport threading\n\nclass AIPlayer(Player):\n \"\"\" Yes there is a circular dependancy between AIPlayer and Game \"\"\"\n\n def __init__(self, max_dept... | python | edit | 5 | 2 | mit | 820ea244604a6563e2532d2cb848c9509bab4e77 | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | ai_player.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2\n\nfrom setuptools import setup, find_packages\n\n# Uploading to PyPI\n# =================\n# The first time only:\n# $ python setup.py register -r pypi\n#\n# Every version bump:\n# $ git tag <version>; git push --tag... | python | edit | 1 | 0 | mit | 3b741d4707cc81abcb22945b8532a416bbf00791 | Kortemme-Lab/klab,Kortemme-Lab/klab,Kortemme-Lab/klab,Kortemme-Lab/klab | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\n\nimport pyglet.window\nfrom pyglet.gl import *\nfrom pyglet import clock\nfrom pyglet.ext.scene2d import Image2d\n\nfrom ctypes import *\n\nif len(sys.argv) != 2:\n print 'Usage: %s <PNG/JPEG filename>'%sys.argv[0... | python | edit | 2 | 1 | bsd-3-clause | 7f6cd8f5444d92644642cadb84d7f958e0b6fce1 | regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations | examples/image_test.py | rejected_duplicate | Near-duplicate of sample 15726 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport setuptools\n\n\nsetuptools.setup(\n name='requires-provides',\n version='0.1',\n description='Flexible dependency decorators',\n license='MIT',\n author='Joshua Downer',\n ... | python | edit | 1 | 0 | mit | 8b59148347f3009bb082f8fff3d11b04c3048433 | jdowner/requires-provides | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom .models import Image\nfrom .forms import ImageForm\nfrom django.views.generic import CreateView, DeleteView, UpdateView, ListView, View\nfrom django.shortcuts import redirect, get_object_or_404\nfro... | python | edit | 5 | 3 | mit | 493dc021322bd7ecf516535d9fef444376d96e4e | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | files/views.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns, url, include\n\nfrom surlex.dj import surl\n\nfrom .api import ProjectResource, ProjectDetailResource\nfrom .views import ProjectListView, ProjectDetailView, ProjectMapView\n\nproject_resource... | python | edit | 1 | 0 | bsd-3-clause | a51bc09ec5c7c03ce0d76cca443520036d45fa63 | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | apps/projects/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this fi... | python | edit | 1 | 0 | apache-2.0 | 12525b5e58752df67fc5bc063aaf4a5996c2bf21 | munkiat/libcloud,sfriesel/libcloud,wrigri/libcloud,JamesGuthrie/libcloud,mbrukman/libcloud,aleGpereira/libcloud,t-tran/libcloud,Itxaka/libcloud,briancurtin/libcloud,pquentin/libcloud,sgammon/libcloud,jimbobhickville/libcloud,Cloud-Elasticity-Services/as-libcloud,apache/libcloud,cryptickp/libcloud,watermelo/libcloud,apa... | example_storage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\n\nsetup(\n name='cmsplugin_filery',\n version=\".\".join(map(str, __import__('cmsplugin_filery').__version__)),\n author='Alireza Savand',\n author_email='<EMAIL>',\n description = 'Image gal... | python | edit | 1 | 0 | bsd-2-clause | e2a55bf686679c39304645e3c73cc4ba353f5018 | jasekz/cmsplugin-filery,Alir3z4/cmsplugin-filery | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nNodes can contain words\n=======================\n\nWe here at **Daft** headquarters tend to put symbols (variable\nnames) in our graph nodes. But you don't have to if you don't\nwant to.\n\n\"\"\"\n\nfrom matplotlib import rc\nrc(... | python | edit | 1 | 0 | mit | 6ba28684960b14ecb29b26d63ae4a593337e7fa4 | dfm/daft | examples/wordy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.contrib import admin\n\nfrom blanc_pages.admin import BlancPageAdminMixin\n\nfrom .models import Category, Event\n\n\n@admin.register(Category)\nclass CategoryAdmin(admin.ModelAdmin):\n search_field... | python | edit | 1 | 0 | bsd-3-clause | 764f7d422da005fd84d9f24c36709442c1b2d51e | blancltd/django-glitter-events,blancltd/django-glitter-events | blanc_events/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom django import template\nfrom django.conf import settings\nfrom django.template.defaultfilters import stringfilter\nregister = template.Library()\n\n\n@register.simple_tag\ndef archive_url(file_path, is_latest=False):\n \"... | python | edit | 3 | 3 | mit | 7387d77a094b7368cf80a1e8c1db41356d92fc38 | california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website | calaccess_website/templatetags/calaccess_website_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\ndjango-queued-storage ships with a signal fired after a file was transfered\nby the Transfer task. It provides the name of the file, the local and the\nremote storage backend instances as arguments to connected signal callbacks.\n\n... | python | edit | 1 | 0 | bsd-3-clause | 0607e619da2cf94a4d12c11b2b43ad3e21719dd4 | jezdez/django-queued-storage,jazzband/django-queued-storage | queued_storage/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\ngithub-setup-irc-notifications - Configure all repositories in an organization\nwith irc notifications\n\"\"\"\n\nimport github3\n\n```\n\nApply this change: Add username and password args"
},
{
"role": "assistant",
"con... | python | edit | 4 | 1 | mit | a1746483da4e84c004e55ea4d33693a764ac5807 | kragniz/github-setup-irc-notifications | githubsetupircnotifications.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.test import TestCase, client\n\nfrom .models import Feedback\n\n\nclient = client.Client()\n\n\nclass FeedbackTest(TestCase):\n def test_add_feedback(self):\n before_add = Feedback.objects.coun... | python | edit | 3 | 1 | mit | 49c83e0ef5ec7390a78e95dbc035b7d2808ec13e | Hackfmi/Diaphanum,Hackfmi/Diaphanum | feedback/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Optional\n\nimport strawberry\nfrom api.scalars import DateTime\nfrom users.types import UserType\n\n\n@strawberry.type\nclass Post:\n id: strawberry.ID\n author: UserType\n title: str\n slug: str\n excerpt... | python | edit | 1 | 2 | mit | 775e0b819e3eac2f84d41900de7bdc2058156389 | patrick91/pycon,patrick91/pycon | backend/blog/types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Convenience to import Qt if it is availible, otherwise provide stubs.\n\nNormally I wouldn't bother with something like this, but due to the\ntesting contexts that we often run we may import stuff from uitools that\ndoes not have Qt a... | python | edit | 2 | 0 | bsd-3-clause | 2b4b71246646db8e28b999d2ff249c3a36aa0c33 | westernx/uitools | uitools/qt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom maas_common import (status_ok, status_err, metric, get_keystone_client,\n get_auth_ref)\nfrom requests import Session\nfrom requests import exceptions as exc\n\n\ndef check(auth_ref):\n ... | python | edit | 3 | 4 | apache-2.0 | d384781d77521f6e4b97b783737be09a7a99423e | mattt416/rpc-openstack,xeregin/rpc-openstack,darrenchan/rpc-openstack,major/rpc-openstack,byronmccollum/rpc-openstack,shannonmitchell/rpc-openstack,cloudnull/rpc-maas,npawelek/rpc-maas,miguelgrinberg/rpc-openstack,robb-romans/rpc-openstack,rcbops/rpc-openstack,BjoernT/rpc-openstack,nrb/rpc-openstack,git-harry/rpc-opens... | glance_registry_local_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nmake.py\n\nA drop-in or mostly drop-in replacement for GNU make.\n\"\"\"\n\nimport sys, os\nimport pymake.command, pymake.process\n\npymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)\np... | python | edit | 1 | 0 | mit | 221ff606f1c834141dd19d9101ab750733437b95 | indygreg/pymake,mozilla/pymake,mozilla/pymake,mozilla/pymake | make.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom flask import Flask\nfrom flask import request\nfrom flask import jsonify\nfrom utils import download_file, is_video_json_valid\nfrom annotations import sort_annotations_by_time, is_annotation_json_valid\nfrom ... | python | edit | 1 | 6 | mit | 6e76c9af0a4bdd6696b918913af73559c6dcd3c3 | melonmanchan/achso-video-exporter,melonmanchan/achso-video-exporter | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nimport os\n\n\ndef get_emoji_content(filename):\n full_filename = os.path.join(os.path.dirname(__file__), 'emojis', filename)\n with open(full_filename, 'r') as fp:\n return fp.read()\n\n\ndef fix_emoji(value):\n ... | python | edit | 1 | 2 | mit | 582c445e6ceb781cfb913a4d6a200d8887f66e16 | vv-p/jira-reports,vv-p/jira-reports | filters/filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.http import HttpResponse\n\nfrom hackfmi.utils import json_view\nfrom .models import User\n\n\ndef homepage(request):\n return render(request, \"index.html\", {})\n\n\n@json_view\ndef sear... | python | edit | 3 | 4 | mit | 6466e0fb7c5f7da0048a9ed9e1dd8023ddc5f59a | Hackfmi/Diaphanum,Hackfmi/Diaphanum | members/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix get_chan (which should return the channel)"
},
{
"role": "assistant",
"content": "\ndef get_chan(channels, chan):\n return channels.setdefault(chan['name'], {'producers': [], 'consumers': [], 'data': chan})\n"
}
] | python | new_file | 1 | 1 | apache-2.0 | 87ce10a94bdbedd97dae19989a7382b2bfa8ecde | leapp-to/snactor | snactor/utils/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport parser\nimport token\nimport symbol\n\nimport sys\nfrom pprint import pprint\n\ntree = parser.st2tuple(parser.suite(sys.argv[1]))\n\ndef convert_readable(tree):\n return tuple(((token.tok_name[i]\n if token.tok_n... | python | edit | 2 | 22 | mit | 957513329838474ba8f54c4571ea87c92600caf1 | thenoviceoof/pyli | pyli.py | rejected_complexity | Cyclomatic complexity too high: 22 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nimport urllib\n\nimport RPi.GPIO as GPIO\n\n# GPIO input pin to use\nLPR_PIN = 3\n# URL to get image from\nSOURCE = 'http://192.168.0.13:8080/photoaf.jpg'\n# Path to save image locally\nFILE = 'img.jpg'\n\n# Use GPIO pin number... | python | edit | 3 | 0 | mit | a65d86ea92d6b3de2d8585650595677efc18d3c2 | adampiskorski/lpr_poc | test.py | rejected_duplicate | Near-duplicate of sample 1038 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom serf_master import SerfHandler\nfrom utils import with_payload, truncated_stdout\n\n\nclass BaseHandler(SerfHandler):\n\n def __init__(self, *args, **kwargs):\n super(BaseHandler, self).__init__(*args, **kwargs)\... | python | edit | 1 | 2 | mit | 3d51452d466fc733ee782d8e82463588bb9d2418 | waltermoreira/serfnode,waltermoreira/serfnode,waltermoreira/serfnode | handler/base_handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n.. module: lemur.authorizations.models\n :platform: unix\n :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more\n :license: Apache, see LICENSE for more details.\n.. moduleauthor:: Netflix Secops <<EMAIL>>\n\"\"\"\nfr... | python | edit | 1 | 1 | apache-2.0 | 1f598e3752d18ecf4f022588531093d711ac6c01 | Netflix/lemur,Netflix/lemur,Netflix/lemur,Netflix/lemur | lemur/authorizations/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ndef expand_directory(directory_path):\n ret = []\n\n for file_path in os.listdir(directory_path):\n if os.path.isfile(os.path.join(directory_path, file_path)):\n # Append instead of extend or += because ... | python | edit | 1 | 3 | mit | 85b3a68ef93aa18dd176d8804f7f5089d7cf7be9 | PaulOlteanu/PVCS | helpers/file_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.2.10 on 2020-04-04 12:38\n\nfrom django.db import migrations\nfrom django.db.utils import OperationalError, ProgrammingError\n\nfrom part.models import Part\nfrom stdimage.utils import render_variations\n\n\ndef crea... | python | edit | 1 | 1 | mit | 1f4bd95d758db4e2388b180f637963e26a033790 | inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree | InvenTree/part/migrations/0034_auto_20200404_1238.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom coils import user_input\nfrom sqlalchemy import create_engine\n\nusername = user_input('Username', default='root')\npassword = user_input('Password', password=True)\ndbname = user_input('Database name')\n\nengine = create_engine(\n ... | python | edit | 1 | 1 | mit | 96c20164b3221321f71e12fd7054766a92722e08 | vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit | test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n # # #### ##### # # ##### # # # #\n # # # # # ## ## # # # ## # #\n ### #### #### # # # # # # # # #####\n # # # # # # # # ## # # #\n... | python | edit | 3 | 0 | bsd-2-clause | ff67e435ea31680698166e4ae3296ff4211e2b51 | glasnost/kremlin,glasnost/kremlin,glasnost/kremlin | kremlin/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"csunplugged URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.10/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from my_ap... | python | edit | 1 | 0 | mit | c4e1f1c147783a4a735dd943d5d7491302de300e | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/config/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom score import score_funcs\nfrom db import conn\ncurr = conn.cursor()\n\n\ndef process_diff(diffiduser):\n try:\n diffid, user = diffiduser\n except:\n return\n diff = get_diff_for_diffid(diffid)\n zum = 0\n ... | python | edit | 2 | 5 | mit | 0e7487948fe875d5d077f230b804983b28ca72cb | tjcsl/wedge,tjcsl/wedge | utils.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.