messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom requests import get\n\n\nclass WrapperBase(object):\n\n def __init__(self, bearer, token):\n self.bearer = bearer\n self.token = token\n\n @property\n def headers(self):\n \"\"\"The HTTP headers needed for... | python | edit | 1 | 3 | mit | 1090ecf891dd7c0928cdaae385464d3be660fdbf | pennlabs/penn-sdk-python,pennlabs/penn-sdk-python | penn/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cornice.service import Service\n\nfrom ..commands import create_configuration_files_and_restart_apps_\nfrom ..config import path\n\n\nconfiguration_service = Service(\n name='configuration_create',\n path=path('setup/config'),\n ... | python | edit | 1 | 1 | mit | 4ee3900c8ac78c8ed1d0145f9d99a0485b542141 | grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/senic-hub | senic_hub/backend/views/setup_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom beam_construct import beam\n\nclass BeamFile(object):\n\tdef __init__(self, filename):\n\t\tself._tree = beam.parse(file(filename,\"r\").read())\n\n\tdef selectChunkByName(self, name):\n\t\tfor c in self._tree.chunk:\n\t\t\tif c.chunk_... | python | edit | 2 | 3 | mit | 608298a3bed65a36312500f15d58ac6c3cd6663d | matwey/pybeam | pybeam/beam_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: Braedy Kuzma\n\nfrom rest_framework import serializers\nfrom dash.models import Post, Author, Comment, Category\n\nclass AuthorSerializer(serializers.ModelSerializer):\n class Meta:\n model = Author\n fields = ('i... | python | edit | 1 | 1 | apache-2.0 | 2e23898ea287b6b9efcf6bcb8758cf61fca25256 | CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project | rest/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport wx\nimport wxClass\n\n\nclass wxGestaltApp(wxClass.MyFrame1):\n\n def __init__(self, *args, **kw):\n super(wxGestaltApp, self).__init__(*args, **kw)\n self.InitUI()\n\n def InitUI(self):... | python | edit | 2 | 2 | mit | 164e4b5f02fbe9558e9fa50b12e7b28921f5be9b | openp2pdesign/wxGestalt | wxGestalt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom warnings import warn\nfrom django.conf import settings\n\n\ndef patch_response(request, response, methods):\n if getattr(settings, 'SERRANO_CORS_ENABLED', False):\n if hasattr(settings, 'SERRANO_CORS_ORIGIN'):\n wa... | python | edit | 1 | 8 | bsd-2-clause | 5e1ea27b1334f74dee4f7d3f3823f80037da3690 | chop-dbhi/serrano,rv816/serrano_night,chop-dbhi/serrano,rv816/serrano_night | serrano/cors.py | rejected_duplicate | Near-duplicate of sample 884 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# Copyright (c) 2013 Spotify AB\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at\n... | python | edit | 2 | 8 | apache-2.0 | 427b894fdd5690bc7a52dbcea42c4918b87d0046 | brainly/check-growth | run_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom oscar.core.application import Application\n\nfrom systempay import views\n\n\nclass SystemPayApplication(Application):\n name = 'systempay' \n\n place_order_view = views.PlaceOrderView\... | python | edit | 1 | 1 | mit | 1c6d93d83b6979ca9c5bfb298efb6fdb3e0c27ee | dulaccc/django-oscar-systempay,bastien34/django-oscar-systempay,bastien34/django-oscar-systempay | systempay/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Package for PythonTemplateDemo.\"\"\"\n\nimport sys\n\n__project__ = 'PythonTemplateDemo'\n__version__ = '0.0.0'\n\nVERSION = \"{0} v{1}\".format(__project__, __version__)\n\nPYTHON_VERSION = 3, 5\n\nif sys.version_info < PYTHON_VERSI... | python | edit | 1 | 0 | mit | 336e81005deb485378fe594cf466773f36160d5e | jacebrowning/template-python-demo | demo/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport logging\nimport pysoundcard\nimport pysoundfile\nfrom tikplay.database import interface\n\n\nclass API():\n \"\"\" Implements the audio parsing interface for tikplay.\n\n Parses song metadata, handles database upda... | python | edit | 3 | 2 | mit | b89e210f95b8f41efa8019ee66d6449b7242d56f | tietokilta-saato/tikplay,tietokilta-saato/tikplay,tietokilta-saato/tikplay,tietokilta-saato/tikplay | tikplay/audio.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nModule for managing NFS.\n'''\n\n# Import python libs\nimport logging\n\nimport salt.utils\n\nlog = logging.getLogger(__name__)\n\n\ndef __virtual__():\n '''\n Only work on posix-like systems\n '''\n # Disable on these plat... | python | edit | 3 | 5 | apache-2.0 | 6924b1326b664e405f926c36753192603204034e | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/nfs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport functools\nimport glob\nimport os\nimport pkgutil\n\n_all_builtins = {}\n_loaded_builtins = False\n\nclass Binder(object):\n def __init__(self, fn):\n self.fn = fn\n\n def bind(self, build_inputs, env):\n return f... | python | edit | 5 | 3 | bsd-3-clause | ef43e04970151ec5bba9688f268b2f85b5debd3f | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | bfg9000/builtins/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''Consolidates settings from defaults.py and local.py.\n\n::\n >>> from api.base import settings\n >>> settings.API_BASE\n 'v2/'\n'''\nfrom .defaults import * # noqa\n\ntry:\n from .local import * # noq... | python | edit | 3 | 0 | apache-2.0 | 8a778750c2284045566c6f67b2aedffd2811f1ce | leb2dg/osf.io,jinluyuan/osf.io,ckc6cz/osf.io,brandonPurvis/osf.io,kch8qx/osf.io,KAsante95/osf.io,billyhunt/osf.io,abought/osf.io,emetsger/osf.io,felliott/osf.io,TomBaxter/osf.io,bdyetton/prettychart,alexschiller/osf.io,doublebits/osf.io,leb2dg/osf.io,ticklemepierce/osf.io,erinspace/osf.io,brianjgeiger/osf.io,samanehsan... | api/base/settings/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import (\n get_object_or_404, render)\nfrom django.views.generic import View\n\nfrom .models import Post\n\n\ndef post_detail(request, year, month, slug):\n post = get_object_or_404(\n Post,\n pub_d... | python | edit | 1 | 1 | bsd-2-clause | ac3db8b26bd6ac2e0db2c8221521aead9c996ec0 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | blog/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n# scrapeOMDB.py - parses a movie and year from arguments and returns JSON\n\nimport json, requests\n\nURL_BASE = 'http://www.omdbapi.com/?'\n\ndef OMDBmovie(mTitle, mYear):\n # Craft the URL\n url = URL_BASE + 't='... | python | edit | 1 | 1 | mit | 7fe1ce9b1c9d6368bdb0945c2ed820cdafdc53c2 | samcheck/PyMedia,samcheck/PyMedia,samcheck/PyMedia | scrapeOMDB.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nimport os\n\n# Root directory that we scan for music from\n# Do not change this unless you're not using the docker-compose\n# It is preferred you use just change the volume mapping on the docker-compose.yml\nMUSIC_DIRECTORY = os.... | python | edit | 1 | 0 | apache-2.0 | 4e4390db6ed35de4fb7ad42579be5180a95bb96f | nhydock/ftmp3,lunared/ftmp3,nhydock/ftmp3,lunared/ftmp3,lunared/ftmp3 | src/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# (c) 2014 Bjoern Ricks <<EMAIL>>\n#\n# See LICENSE comming with the source of 'trex' for details.\n#\n\nfrom django.conf.urls import patterns, url\nfrom django.views.generic import TemplateView\n\nfrom trex.view... | python | edit | 1 | 0 | mit | c30b4aa0d577e545193229d0f33b55998405cba2 | bjoernricks/trex,bjoernricks/trex | trex/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Filter classes corresponding to each one of the works app's models that has the\nsame fields as the model for an equalTo filter.\nThere can be added extra fields inside each class as gt, lt, gte, lte and so on for\nconvinience.\n\"\"\... | python | edit | 1 | 0 | mit | b1edf4678a57bb25220bd4c50f05ceb7fbd5e7fe | fernandolobato/balarco,fernandolobato/balarco,fernandolobato/balarco | users/filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2.5\n#\n# Copyright 2009 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the L... | python | edit | 1 | 0 | apache-2.0 | c7d2e917df5e0c2182e351b5157271b6e62a06cd | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/modules/gsoc/models/timeline.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Chapter 2: The pq-system\n\ndef make_axiom(n):\n assert type(n) == int\n assert n > 0\n x = '-' * n\n return x + 'p' + '-q' + x + '-'\n\ndef next_theorem(theorem):\n assert 'p' in theorem\n assert 'q' in theorem\n iq = theorem.find... | python | edit | 6 | 2 | mit | 89cb9f325403e3094a5fb2090ef4ea5f804b9d20 | ericfs/geb | pq.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ev3.ev3dev import Lcd\n# -*- coding: utf-8 -*-\nimport unittest\nfrom util import get_input\nimport time\nfrom PIL import Image,ImageDraw,ImageFont\nclass TestLcd(unittest.TestCase):\n\n def test_lcd(self):\n get_input('Test ... | python | edit | 4 | 2 | apache-2.0 | 0e2dbbd204d9c1c9bd31f4be78b0a76ce39786d2 | MaxNoe/python-ev3,evz/python-ev3,topikachu/python-ev3,MaxNoe/python-ev3,evz/python-ev3,topikachu/python-ev3 | test/test_ev3_lcd.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom CITests import CITests\n\n# Libs in Application Examples\nappExamples = {\n#\"KundurSMIB\":\"/ApplicationExamples/KundurSMIB/package.mo\",\n#\"TwoAreas\":\"/ApplicationExamples/TwoAreas/package.mo\",\n#\"SevenBus\":\"/Appli... | python | edit | 1 | 0 | bsd-3-clause | 73dd57a0d27b08089f91f303d3d36e428b108618 | SmarTS-Lab/OpenIPSL,OpenIPSL/OpenIPSL,SmarTS-Lab/OpenIPSL,tinrabuzin/OpenIPSL | CI/syntaxCheck.py | rejected_duplicate | Near-duplicate of sample 3407 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# SECRET_KEY and DATABASES needs to be defined before the base settings is imported.\nSECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q=='\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite... | python | edit | 2 | 0 | bsd-3-clause | b0e21495e0421a3656ed4507fe7b43b65601f16f | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | bluebottle/settings/travis.py | rejected_duplicate | Near-duplicate of sample 4992 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom functools import wraps\n\nfrom django.http import HttpResponse\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\n\n\ndef as_json(func):\n def decorator(request, *ar, **kw):\n ... | python | edit | 1 | 2 | bsd-2-clause | 1f25d3a8d73fe776a2182ee68c027105fd15ab04 | rvause/django-tiamat | tiamat/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n### ---------------------------------------------------------------------------\n\n\nfrom .startup import initialize\n\n__version_tuple = (1, 0, 0)\n__version__ = \".\".join([str(num) for num in __version_tuple])\n\n\n### ------------------... | python | edit | 5 | 1 | mit | 48d234fffe052454356e09d7b3c69c938f1f7f87 | OdatNurd/hyperhelp | all/hyperhelpcore/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bidict import bidict, ValueDuplicationError\n\n\ndef is_anonymous(name):\n return name.startswith(\"ANONYMOUS_ANONYMOUS_ANONYMOUS_\")\n\n\nclass TohuNamespaceError(Exception):\n \"\"\"\n Custom exception.\n \"\"\"\n\n\nclas... | python | edit | 1 | 7 | mit | 6fd5e51a797f3d85954f6a4c97eacc008b0e4d48 | maxalbert/tohu | tohu/v5/namespace.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef largest_prime_factor(n, h):\n for i in xrange(2, n+1):\n d, m = divmod(n, i)\n if m == 0:\n largest_prime_factor(d, i)\n break\n if n == 1: print h\nlargest_prime_factor(600851475143, 0)\n\n```\... | python | edit | 2 | 4 | mit | 1e63d21d5751da12ad4104b6d2a0c170cc3898ff | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | problem_3/solution.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom config import Config\nfrom motor import Motor\nimport Rpi.GPIO as GPIO\nimport json\nimport sys\nimport time\n\ndef _init_motor(self, pin1_s, pin2_s, pinE_s):\n pin1 = self.config.get(\"motors\", pin1_s)\n pi... | python | edit | null | null | mit | 579101f714201ba2cc933f64c83ca6cfda8eca8c | thomasweng15/rover | test/wheel_velocity.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n# Tests of NDDataBase\n\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nfrom ..nddatabase import NDDataBase\n... | python | edit | 1 | 1 | bsd-3-clause | 96db3441a0cc2e3010606b2017c900a16c6a8f2f | tbabej/astropy,lpsinger/astropy,dhomeier/astropy,larrybradley/astropy,pllim/astropy,dhomeier/astropy,AustereCuriosity/astropy,stargaser/astropy,mhvk/astropy,astropy/astropy,AustereCuriosity/astropy,pllim/astropy,lpsinger/astropy,MSeifert04/astropy,tbabej/astropy,stargaser/astropy,bsipocz/astropy,joergdietrich/astropy,j... | astropy/nddata/tests/test_nddatabase.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for solver/proofread pair"
},
{
"role": "assistant",
"content": "import os\nimport threading\n\nimport numpy as np\n\nimport pytest\nfrom skimage import io\n\nfrom gala import serve, evaluate as ev\n\nD = os.path.dirname... | python | new_file | 1 | 1 | bsd-3-clause | f5b085878b6bc9b461811a9083fdcaab5546497b | jni/gala,janelia-flyem/gala | tests/test_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef selection_sort(ls):\n \"\"\"Selection Sort algortihm.\n\n Time complexity: O(n^2).\n Space complexity: O(1).\n ... | python | edit | 1 | 4 | bsd-2-clause | ed12fe8cde425c75d02dbb9beb98abd8a814292a | bowen0701/algorithms_data_structures | alg_selection_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ntag = 'celebA_dcgan'\ndataset = 'celebA'\n\ncommand = 'python main.py --dataset %s --is_train True ' \\\n '--sample_dir samples_%s --checkpoint_dir checkpoint_%s --tensorboard_run %s '%(dataset, tag, tag, tag)\n\n\nos.... | python | edit | 1 | 0 | mit | e9862c50c1d71800602ca78bf9bdd8aad2def0a2 | MustafaMustafa/WassersteinGAN-TensorFlow | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom django.db import models\n\ndef get_image_path(filename):\n return os.path.join('photos',filename)\n\nclass Location(models.Model):\n name = models.CharField(max_length=250)\n local_name = models.CharField(max_leng... | python | edit | 3 | 1 | mit | 0a136631d78ee518aec96a1a6ec24ed3e7d4c613 | Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja | taOonja/game/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# escpos/impl/__init__.py\n#\n# Copyright 2015 Base4 Sistemas Ltda ME\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#... | python | edit | 4 | 0 | apache-2.0 | 63a4a2dfa733fab15bb7e0d632c8efe6528b82cb | base4sistemas/pyescpos | escpos/impl/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test.simple import run_tests as default_run_tests \nfrom django.conf import settings \n\n\ndef run_tests(test_labels, *args, **kwargs):\n\tdel test_labels\n\treturn default_run_tests(settings.OUR_APPS, *args, **kwargs)\n\n```\n\... | python | edit | 1 | 1 | bsd-3-clause | a492b0395ff56f150d2fde506b6536f0324f31f6 | SushiTee/teerace,SushiTee/teerace,SushiTee/teerace | teerace/local_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport time\nimport json\nimport sys\nimport pika\nfrom tweepy.streaming import StreamListener\n\nclass Listener(StreamListener):\n def __init__(self):\n #setup rabbitMQ Connection\n \tconnection = pi... | python | edit | 6 | 3 | mit | 16a85be6597388092e497e642cdad8650fdfea95 | robot-overlord/syriarightnow | app/tasks/twitter/listener.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\n\nclass UpdateInstances(object):\n\n @staticmethod\n def do():\n from dbaas_cloudstack.models import DatabaseInfraOffering\n from dbaas_cloudstack.models import PlanAttr\n\n infra_offerings = Da... | python | edit | 1 | 4 | bsd-3-clause | 252bc8df092f59ecd092ea5904fcc845dc22bee8 | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/util/update_instances_with_offering.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis module is responsible for handling configuration and files related to it,\nincluding calibration parameters.\n\"\"\"\n\nimport configparser\nfrom os import path\nimport syslog\n\n\n\"\"\"\nDefault options\n\"\"\"\n#TODO: more d... | python | edit | 1 | 2 | mit | d3ca58e098fd872eb32c82e87a76361829d68f37 | mgunyho/kiltiskahvi | config/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.decorators import user_passes_test\nfrom django.http import Http404\nfrom django.shortcuts import redirect, render\n\nfrom accounts.utils import send_activation_email\n\nfrom .forms import InviteForm\n\n\nowner_requ... | python | edit | 1 | 3 | mit | dbc932d7776b22835ff15f086c41e1bff02e9daf | xobb1t/ddash2013,xobb1t/ddash2013 | apps/private/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013 Mirantis Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.ap... | python | edit | 1 | 3 | apache-2.0 | 600992d9bb3f357bdef8769a61b4829be8952573 | stackforge/blazar,openstack/blazar,ChameleonCloud/blazar,ChameleonCloud/blazar,stackforge/blazar,openstack/blazar | blazar/api/context.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport logging\nimport distutils.log\nfrom . import monkey\n\n\ndef _not_warning(record):\n return record.levelno < logging.WARNING\n\n\ndef configure():\n \"\"\"\n Configure logging to emit warning and above to stderr\... | python | edit | 1 | 1 | mit | 0d491c616284933e35bb5d61a94828aed0c8d3f2 | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom functools import wraps, partial\n\nfrom flask import request\nfrom flask_api import status\nfrom flask.wrappers import Response\n\nfrom app.config import API_ACCEPT_HEADER\n\n\ndef API(method=None):\n if met... | python | edit | 1 | 6 | mit | 7db3a14636402a5c66179a9c60df33398190bd3e | h4wldev/Frest | app/modules/frest/api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django import forms\nfrom django.conf import settings\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom . import get_user_model\n\n\nclass UserSuForm(forms.Form):\n\n user = forms.ModelChoic... | python | edit | 1 | 4 | mit | 9c037ed3ebe7353b419562311bbc1f07875ab358 | adamcharnock/django-su,PetrDlouhy/django-su,adamcharnock/django-su,PetrDlouhy/django-su | django_su/forms.py | rejected_duplicate | Near-duplicate of sample 3767 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# function\ndef sum(op1, op2):\n return op1 + op2\n\nmy_sum = sum\nprint my_sum(1, 2)\nprint my_sum(\"I am \", \"zzz\");\n\n# Default value in a fuction\ninit = 12\ndef accumulate(val = init):\n val += val\n ... | python | edit | 9 | 1 | bsd-2-clause | cd5d291fc1ccf3e2171ccfc0444e4748de450d3c | zzz0072/Python_Exercises,zzz0072/Python_Exercises | 99_misc/control_flow.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.contenttypes.models import ContentType\n\n\n# USEFUL FUNCTIONS FOR FLUENT CONTENTS #############################################################\n\n# Fluent Contents Helper Functions #####################################... | python | edit | 1 | 3 | mit | f9aeede7af207a672a867c4f310d7d357a4d47c9 | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/utils/fluent_contents.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core import serializers\nfrom django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden\nfrom django.shortcuts import get_object_or_404, redirect, render_to_response\nfrom django.template import RequestConte... | python | edit | 8 | 4 | mit | 079ab75cc316c994bb3f63d32fa633aeebf08d87 | bschmeck/gnarl,bschmeck/gnarl,bschmeck/gnarl | grid/views.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8\nfrom django.conf import settings\nfrom django.db import models\n\nclass InlistItem(models.Model):\n text = models.CharField(max_length=255, default='')\n user = models.ForeignKey(settings.AUTH_USER_MODEL)\n\n d... | python | edit | 1 | 1 | mit | 331ce5fde1a653997900f3e247f9d34a2c47fb54 | XeryusTC/projman,XeryusTC/projman,XeryusTC/projman | projects/models.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 | 1 | 2 | mit | c23e697ccc64340027d3b07728032247bb5b21a4 | luforst/adventskranz | kerze.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport threading\nimport contextlib\n\nthe_current_shell = threading.local()\nthe_current_shell.value = None\n\n\n@contextlib.contextmanager\ndef set_current_shell(shell):\n outer = the_current_shell.value\n the_current_shell.value = ... | python | edit | 2 | 2 | apache-2.0 | e9efe7ff408fe5dd3be596ce9ded3bce312cb9e6 | probcomp/bayeslite,probcomp/bayeslite | shell/src/hook.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\n\nfrom asyncio import coroutines\n\n\ndef _format_coroutine(coro):\n if asyncio.iscoroutine(coro) and not hasattr(coro, 'cr_code'):\n # Most likely a Cython coroutine\n coro_name = '{}()'.format(coro.__qualn... | python | edit | 1 | 8 | apache-2.0 | a6fe31d7f687df6934143fd2dda1cd323f3d31fb | 1st1/uvloop,MagicStack/uvloop,MagicStack/uvloop | uvloop/_patch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Imports the hooks dynamically while keeping the package API clean,\n# abstracting the underlying modules\nfrom airflow.utils import import_module_attrs as _import_module_attrs\n\n_hooks = {\n 'ftp_hook': ['FTPHook'],\n 'vertica_hook... | python | edit | 1 | 0 | apache-2.0 | 970eb92f6db8b2fd22594d662a7142a976d60559 | cjqian/incubator-airflow,KL-WLCR/incubator-airflow,dmitry-r/incubator-airflow,yiqingj/airflow,rishibarve/incubator-airflow,vineet-rh/incubator-airflow,ty707/airflow,preete-dixit-ck/incubator-airflow,saguziel/incubator-airflow,sdiazb/airflow,NielsZeilemaker/incubator-airflow,subodhchhabra/airflow,yiqingj/airflow,preete-... | airflow/contrib/hooks/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\n\nimport dpy\n\nsetup(name = \"DistPy\",\n version = dpy.__version__,\n author= \"bolin\",\n author_email = \"<EMAIL>\",\n packages = ['dpy', 'dpy.compiler'])\n\n```\n\nApply this change... | python | edit | 1 | 0 | mit | 452c3c4258c8dce5bd6f9e6799fe24253a800651 | sghosh1991/distalgo,mayli/DistAlgo,sghosh1991/distalgo,mayli/DistAlgo | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an initial model for an issue"
},
{
"role": "assistant",
"content": "\"\"\"Mini Issue Tracker program. Originally taken from Paul Bissex's blog post:\nhttp://news.e-scribe.com/230 and snippet: http://djangosnippets.org/snippe... | python | new_file | 1 | 1 | bsd-3-clause | f3cf8b8e36dc7d2ed5096e17dcfa1f9456a7a996 | zooming-tan/Project-AENEAS,zooming-tan/Project-AENEAS,zooming-tan/Project-AENEAS,zooming-tan/Project-AENEAS | Project-AENEAS/issues/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Setup module for txrudp.\"\"\"\n\nimport codecs\nfrom os import path\nimport sys\n\nfrom setuptools import find_packages, setup\n\n\n_HERE = path.abspath(path.dirname(__file__))\nwith codecs.open(path.join(_HERE, 'README.md'), encodin... | python | edit | 3 | 0 | mit | b87c237ef7ec77f3f2224f609cac19f12fe0fa2e | Renelvon/txrudp,OpenBazaar/txrudp,jorik041/txrudp | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n'''Implementation of a simple stack data structure.\nThe stack has push, pop, and peek methods. Items in the stack have a value,\nand next_item attribute. The stack has a top attribute.\n'''\n\n\nclass Item(object):... | python | edit | 1 | 1 | mit | 60d2137878b78620444ce533fcf4ee50ba7b8be1 | jwarren116/data-structures-deux | stack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014, Matt Layman\n\nimport os\nimport sys\n\nfrom werkzeug.contrib.atom import AtomFeed\n\nfrom handroll import logger\nfrom handroll.composers import Composer\n\n\nclass AtomComposer(Composer):\n \"\"\"Compose an Atom f... | python | edit | 1 | 2 | bsd-2-clause | 6b3dc6528a8172c4e07dfd63a57d490c8484700d | handroll/handroll | handroll/composers/atom.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass AllHangs(object):\n title = \"All Hangs\"\n\n @staticmethod\n def matches_hang(_):\n return True\n\nclass DevtoolsHangs(object):\n title = \"Devtools Hangs\"\n\n @staticmethod\n def matches_hang(hang):\n ... | python | edit | 3 | 4 | mit | a692c339983ae0252577635751b67324985275dc | squarewave/background-hang-reporter-job,squarewave/background-hang-reporter-job | background_hang_reporter_job/tracked.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app.actions.mslookup import proteinquant as lookups\nfrom app.drivers.mslookup import base\n\n\nclass ProteinQuantLookupDriver(base.LookupDriver):\n \"\"\"Creates lookup of protein tables that contain quant data\"\"\"\n lookuptyp... | python | edit | 1 | 2 | mit | a23011dbd6500094f1e2632a998395e32739bb45 | glormph/msstitch | app/drivers/mslookup/proteinquant.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nhyper/http20/exceptions\n~~~~~~~~~~~~~~~~~~~~~~~\n\nThis defines exceptions used in the HTTP/2 portion of hyper.\n\"\"\"\n\nclass HTTP20Error(Exception):\n \"\"\"\n The base class for all of ``hyper``'... | python | edit | 1 | 0 | mit | 56b5b4d49973702bcb95bb36dcd1e35f40b57a1d | Lukasa/hyper,plucury/hyper,fredthomsen/hyper,irvind/hyper,fredthomsen/hyper,lawnmowerlatte/hyper,lawnmowerlatte/hyper,Lukasa/hyper,plucury/hyper,irvind/hyper | hyper/http20/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport django\nimport os\nimport yaml\nfrom backend.settings import BASE_DIR\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')\ndjango.setup()\n\nfrom breach.models import Target\n\n\ndef create_target(target):\n t =... | python | edit | 7 | 1 | mit | 91b281a2d8e0938404fa533c7a4ff9f2a251d1b1 | dimkarakostas/rupture,dionyziz/rupture,dionyziz/rupture,dimkarakostas/rupture,dimriou/rupture,dimriou/rupture,esarafianou/rupture,dimriou/rupture,dionyziz/rupture,dionyziz/rupture,esarafianou/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dionyziz/rupture,esara... | backend/populate_targets.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bongo.settings.prod import *\n\n# The same settings as production, but no database password.\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'bongo_test',\n 'USER'... | python | edit | 3 | 0 | mit | d05a16474c9eabc7f52d8d9c6811e4d01bea6080 | BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo | bongo/settings/travis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nRunner classes to execute tasks.\n\"\"\"\n\n_namemodmap = dict(\n SimpleRunner='simple',\n IPythonParallelRunner='ipythonparallel',\n MultiprocessingRunner='multiprocessingpool',\n)\n\n\ndef getrunner(classname):\n impor... | python | edit | 1 | 1 | bsd-3-clause | 8f4c8760dd5f6f21b1c59579332a3c81fa58ed13 | tkf/buildlet | buildlet/runner/__init__.py | accepted | null | 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, 'rb') as f:\n exec(compile(f.read(), custom_path, 'exec'), glob... | python | edit | 3 | 0 | mit | a055f97a342f670171f30095cabfd4ba1bfdad17 | yuvipanda/paws,yuvipanda/paws | images/singleuser/user-config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .decorators import raw_response, validate # NOQA\nfrom .client import JsonRpcClient # NOQA\nfrom .rpc import JsonRpc # NOQA\n\nfrom .exceptions import ( # NOQA\n RpcGenericServerDefinedError,\n RpcInvalidRequestError,\n Rp... | python | edit | 1 | 0 | apache-2.0 | 7e15a22ed01b4aa68a73a0e8e10d88d9b3785062 | pengutronix/aiohttp-json-rpc,pengutronix/aiohttp-json-rpc,pengutronix/aiohttp-json-rpc | aiohttp_json_rpc/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Configuration file for ipython-notebook.\n\nc = get_config()\nc.NotebookApp.ip = '*'\nc.NotebookApp.open_browser = False\nc.NotebookApp.port = 8888\n\n# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-\n# For ... | python | edit | 2 | 0 | bsd-3-clause | 13ffe365680b4dcfb99ce446cc4dffe1587755ff | jupyter/nature-demo,jupyter/nature-demo,jupyter/nature-demo | ipython_notebook_config.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\n\nimport unittest\n\nfrom numba2 import jit, int32\n\n#===------------------------------------------------------------------===\n# Test code\n#===---... | python | edit | 3 | 1 | bsd-2-clause | 3272067020ed0f2204716ee77d69b475cf0782a0 | flypy/flypy,flypy/flypy | numba2/tests/test_classes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom unittest.mock import patch\n\nimport pytest\n\nfrom byceps.services.user_message import service as user_message_service\n\n... | python | edit | 3 | 1 | bsd-3-clause | c3380306512e194543893442ef9327935e789437 | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | tests/integration/blueprints/site/user_message/test_address_formatting.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\nimport os\nfrom slackclient import SlackClient\nimport pyrebase\nimport linkatos.firebase as fb\nimport linkatos.activities as activities\n\n# starterbot environment variables\nBOT_ID = os.environ.get(\"BOT_ID\")\n... | python | edit | 3 | 0 | mit | 97105453db680c2d99becd10f91604339c970591 | iwi/linkatos,iwi/linkatos | linkatos.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import (\n Column,\n DateTime,\n Integer,\n Unicode,\n UnicodeText,\n )\n\nfrom sqlalchemy.ext.declarative import declarative_base\nimport datetime\nimport psycopg2\n\nfrom sqlalchemy.orm import (\n scop... | python | edit | 3 | 1 | mit | 46074e64289995aab5e1129f1eead705a53010b9 | DZwell/learning_journal,DZwell/learning_journal,DZwell/learning_journal | learning_journal/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom dmutils.status import get_version_label\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n\nclass Config:\n\n VERSION = get_version_label(\n os.path.abspath(os.path.dirname(__file__))\n )\n AUTH_REQU... | python | edit | 1 | 1 | mit | 28c47a5d810490c234b85efb0b0d3b200b716b4e | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nimport iati.core.resources\n\nclass TestResources(object):\n \"\"\"A container for tests relating to resources\"\"\"\n\n def test_codelist_flow_type(self):\n \"\"\"Check that the FlowType codelist contains cont... | python | edit | 3 | 1 | mit | c797a3db62b2af1c236527ef95d713b6b0285345 | IATI/iati.core,IATI/iati.core | iati/core/tests/test_resources.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# (c) 2012-2014, Michael DeHaan <<EMAIL>>\n#\n# This file is part of Ansible\n#\n# Ansible is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software ... | python | edit | 2 | 1 | mit | ca908f2e1244af91ecb1c79bb01ec463f6872835 | thaim/ansible,thaim/ansible | lib/ansible/playbook/attribute.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Use x, y coords for unit positions\n# (97, 56) ... (104, 56)\n# ... ...\n# (97, 49) ... (104, 49)\n#\n# Algebraic notation for a position is:\n# algebraic_pos = chr(x) + chr(y)\n\n\ndef _coord_to_algebraic(coord):\n x, y = ... | python | edit | 1 | 3 | mit | e2959ec01b25c3f447fdd31608b30f19c2dc3599 | EyuelAbebe/gamer,EyuelAbebe/gamer | engine.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\"\"\" Download the image files needed to run ... | python | edit | 2 | 2 | bsd-3-clause | cc6bb949b0f4a3c4b6344b219f8b5bae2081e0a4 | google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Ti... | slave/skia_slave_scripts/download_skimage_files.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright 2015, Google Inc.\n# Author: Dave Crossland (<EMAIL>)\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# Yo... | python | edit | 2 | 4 | apache-2.0 | 5dcac8299e754a4209f6f4177eb0df8ecea914c1 | googlefonts/gftools,googlefonts/gftools | namelist.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport rethinkdb as r\n\nconn = r.connect('localhost', 30815, db='materialscommons')\n\nif __name__ == \"__main__\":\n selection = list(r.table('datadirs').run(conn))\n for datadir in selection:\n print... | python | edit | 2 | 0 | mit | c59c762be198b9c976d25b093860f1d14e9d2271 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/scripts/ddirdenorm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim:fileencoding=utf-8:noet\n\nfrom powerline.renderers.shell import ShellRenderer\nfrom powerline.theme import Theme\n\n\nclass IpythonRenderer(ShellRenderer):\n\t'''Powerline ipython segment renderer.'''\n\tescape_hl_start = '\\x01'\n\t... | python | edit | 1 | 3 | mit | 8dcbb031aa00afc35900243142d8f49814834d19 | S0lll0s/powerline,IvanAli/powerline,Liangjianghao/powerline,cyrixhero/powerline,blindFS/powerline,bezhermoso/powerline,blindFS/powerline,EricSB/powerline,keelerm84/powerline,QuLogic/powerline,cyrixhero/powerline,darac/powerline,magus424/powerline,cyrixhero/powerline,dragon788/powerline,prvnkumar/powerline,keelerm84/pow... | powerline/renderers/ipython.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport webapp2\n\nclass IntroHandler(webapp2.RequestHandler):\n def get(self):\n pass\n\napp = webapp2.WSGIApplication([\n ('/', IntroHandler),\n])\n\n\n```\n\nApply this change: Add basic draft of example code."
},
{
... | python | edit | null | null | apache-2.0 | 3471dd3196c134f7aee35aa38370c93915be2197 | robertkluin/furious,Workiva/furious,rosshendrickson-wf/furious,andreleblanc-wf/furious,rosshendrickson-wf/furious,andreleblanc-wf/furious,beaulyddon-wf/furious,Workiva/furious,mattsanders-wf/furious,beaulyddon-wf/furious,mattsanders-wf/furious | example/__init__.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\n\n\ndef home(request):\n return render(request, 'portal/home.html')\n\n```\n\nApply this change: Add an a function(view) about which is going to render about page when it is requested"
},
{
"r... | python | edit | 1 | 1 | mit | 540a589a3d20b4841e9a9c936673cc30a2f0a9ff | utailab/cs-portal,utailab/cs-portal | csportal/portal/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport ctypes\n\nfrom numba import *\n\n@autojit(backend='ast', nopython=True)\ndef call_ctypes_func(func, value):\n return func(value)\n\n\ndef test_ctypes_calls():\n libc = ctypes.CDLL(ctypes.util.find_library('c'))\n ... | python | edit | 3 | 2 | bsd-2-clause | 7cbc6ae58357ef647a007e1b505884e523d924c2 | sklam/numba,pitrou/numba,GaZ3ll3/numba,numba/numba,jriehl/numba,sklam/numba,IntelLabs/numba,IntelLabs/numba,jriehl/numba,pitrou/numba,shiquanwang/numba,gdementen/numba,stonebig/numba,pombredanne/numba,gmarkall/numba,cpcloud/numba,stonebig/numba,jriehl/numba,ssarangi/numba,gdementen/numba,stuartarchibald/numba,ssarangi/... | numba/tests/test_ctypes_call.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom urllib.parse import urlparse\n\nimport logbook\nfrom nameko.rpc import rpc\n\nfrom .logger import LoggingDependency\nfrom .storages import RedisStorage\n\nlog = logbook.debug\n\n\nclass MigrationsService(object):\n name = 'migration... | python | edit | 1 | 4 | mit | cadd2539d5468041599d86ffc94e7a39d83c8759 | davidbgk/croquemort,opendatateam/croquemort,opendatateam/croquemort,davidbgk/croquemort | croquemort/migrations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport numpy\n\nimport chainer\nfrom chainer import cuda\nfrom chainer import functions\nfrom chainer import testing\nfrom chainer.testing import attr\n\n\nif cuda.available:\n cuda.init()\n\n\nclass TestDropout(unitte... | python | edit | 1 | 1 | mit | 3671f6f1e3a2e518255a6a04d0aadf52d5fcca97 | benob/chainer,truongdq/chainer,ronekko/chainer,sou81821/chainer,t-abe/chainer,anaruse/chainer,kashif/chainer,okuta/chainer,sinhrks/chainer,niboshi/chainer,jnishi/chainer,woodshop/chainer,elviswf/chainer,ktnyt/chainer,keisuke-umezawa/chainer,wkentaro/chainer,wkentaro/chainer,niboshi/chainer,cupy/cupy,1986ks/chainer,jfsa... | tests/functions_tests/test_dropout.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Scripts for counting recently added users by email domain; pushes results\nto the specified project.\n\"\"\"\n\nimport datetime\nimport collections\nfrom cStringIO import StringIO\n\nfrom dateutil.relativedelt... | python | edit | 1 | 2 | apache-2.0 | 5e86c516927bca9089541fdc3b60616bee8ec117 | chennan47/osf.io,zachjanicki/osf.io,jolene-esposito/osf.io,haoyuchen1992/osf.io,Nesiehr/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,RomanZWang/osf.io,zachjanicki/osf.io,felliott/osf.io,cwisecarver/osf.io,caneruguz/osf.io,GageGaskins/osf.io,pattisdr/osf.io,acshi/osf.io,fabianvf/osf.io,njantrania/osf.io,CenterForOpenScien... | scripts/analytics/tabulate_emails.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ndefault_settings = [\n ('auth_url', str, 'http://localhost:5000/v3'),\n ('region', str, 'RegionOne'),\n ('user_domain_name', str, 'Default'),\n ('cacert', str, ''),\n]\n\ndef parse_settings(settings):\n pars... | python | edit | 1 | 2 | isc | d5966f60491c408eede66221bc820e4ede93fc0c | bertjwregeer/pyramid_keystone | pyramid_keystone/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport string\n\ntemplate = string.Template(\"\"\"\n[APISERVER]\napi_server_ip = $__contrail_api_server_ip__\napi_server_port = $__contrail_api_server_port__\nmulti_tenancy = $__contrail_multi_tenancy__\ncontrail_extensions = ipam:neutron_p... | python | edit | 1 | 0 | apache-2.0 | 65050e11fd951968b100640c503c0ca7999283c0 | Juniper/contrail-provisioning,Juniper/contrail-provisioning | templates/quantum_conf_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom pysteps.cascade import decomposition, bandpass_filters\n\n_cascade_methods = dict()\n_cascade_methods['fft'] = decomposition.decomposition_fft\n_cascade_methods['gaussian'] = bandpass_filters.filter_gaussian\n_cascade_methods['unifor... | python | edit | 1 | 3 | bsd-3-clause | 47f46e3237ba2f746193e9074136f805e71bacec | pySTEPS/pysteps | pysteps/cascade/interface.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom office365.runtime.client_object import ClientObject\nfrom office365.runtime.odata.odata_path_parser import ODataPathParser\nfrom office365.sharepoint.principal import Principal\nfrom office365.runtime.resource_path_entry import Resourc... | python | edit | 1 | 5 | mit | 956cfc16cee4d4069fdf21f980b881c3fa1864d6 | vgrem/SharePointOnline-REST-Python-Client,vgrem/Office365-REST-Python-Client | office365/sharepoint/group.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\nimport sys\nimport time\n\nimport requests\nimport pync\n\n\ntry:\n cache = []\n headers = {'Authorization': 'bearer {0}'.format(os.environ['GITHUB_TOKEN'])}\n since = None\n url = 'https://api.github.com... | python | edit | 1 | 0 | mit | ab32e80f7d5bb92c969a0f0926a120325fad438b | ghickman/peekaboo | peekaboo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom purl import Template\nimport requests\n\nfrom .models import SimilarResponse\n\n\nAPI_URL = Template(\"http://developer.echonest.com/api/v4/artist/similar\"\n \"?api_key=%s&results=10... | python | edit | 1 | 2 | bsd-3-clause | 63c43ae652ac0b18aba5f56f70271f95e43815d6 | FreeMusicNinja/freemusic.ninja,FreeMusicNinja/freemusic.ninja | django/echonest/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.views.generic.simple import redirect_to\n\nurlpatterns = patterns('',\n \n # filebrowser urls\n url(r'^browse/$', redirect_to, {'url': '/admin/business/photo/?_popup=1'}, name=\"... | python | edit | 13 | 0 | bsd-3-clause | 0e8cc65317e7c443b4319b028395951185ef80de | django-wodnas/django-filebrowser-no-grappelli,sandow-digital/django-filebrowser-no-grappelli-sandow,sandow-digital/django-filebrowser-no-grappelli-sandow,django-wodnas/django-filebrowser-no-grappelli,sandow-digital/django-filebrowser-no-grappelli-sandow,django-wodnas/django-filebrowser-no-grappelli | filebrowser/urls.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom collections import defaultdict\nimport subprocess\nimport os\n\nKEEP_LAST_VERSIONS = os.environ.get('KEEP_LAST_VERSIONS', 4)\n\n\ndef find_obsolete_images(images):\n for image_name, versions in images.items():... | python | edit | 1 | 4 | mit | 69ac16b1501f9affa008c68d4b8197b320ae00b8 | dreipol/cleanup-deis-images,dreipol/cleanup-deis-images | cleanup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nfrom oauthlib.oauth2 import WebApplicationClient, InsecureTransportError\n\nfrom .utils import is_secure_transport\n\n\nclass OAuth2(object):\n \"\"\"Adds proof of authorization (OAuth2 token) to ... | python | edit | 1 | 4 | isc | 32191547567e9ce0cdec954d0079fb18f85b38ce | requests/requests-oauthlib,lucidbard/requests-oauthlib,dongguangming/requests-oauthlib,elafarge/requests-oauthlib,abhi931375/requests-oauthlib,gras100/asks-oauthlib,sigmavirus24/requests-oauthlib,jayvdb/requests-oauthlib,jsfan/requests-oauthlib,jayvdb/requests-oauthlib,singingwolfboy/requests-oauthlib | requests_oauthlib/oauth2_auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pkg_resources\nimport unittest\n\n\nclass CodeStyleTestCase(unittest.TestCase):\n def test_code_style(self):\n flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')\n try:\n flake8... | python | edit | 1 | 3 | mit | cd2e4cce080413feb7685ec9a788327b8bca9053 | ministryofjustice/bai2 | tests/test_style.py | rejected_duplicate | Near-duplicate of sample 3007 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\".. Ignore pydocstyle D400.\n\n===================\nWorkload Connectors\n===================\n\nThe workload management system connectors are used as glue between the\nResolwe Manager and various concrete workload management systems th... | python | edit | 1 | 0 | apache-2.0 | c733126501690c7168d757ab9f14a4877e8544da | genialis/resolwe,genialis/resolwe | resolwe/flow/managers/workload_connectors/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pprint\n\nfrom django.core.mail import EmailMessage\n\nimport log\nfrom rest_framework.reverse import reverse\nfrom sesame.utils import get_query_string\n\n\ndef send_login_email(user, request, *, welcome):\n assert user.email, f\... | python | edit | 1 | 2 | mit | cedbfda6e9c040c6924eae2eff0e9b4e9f3f93f0 | citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement | api/core/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for some helper functions in views.py."
},
{
"role": "assistant",
"content": "import pytest\nfrom .test_views import twenty_name_fixtures\nfrom django.test.client import RequestFactory\nfrom name.views import (\n nor... | python | new_file | 1 | 1 | bsd-3-clause | dffe54088c9cb66a29a7aa63de269730de8a67d7 | damonkelley/django-name,unt-libraries/django-name,unt-libraries/django-name,damonkelley/django-name,unt-libraries/django-name,damonkelley/django-name | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom travispy import TravisPy\nfrom gpiozero import LED\nfrom gpiozero.tools import negated\nfrom time import sleep\nfrom signal import pause\n\ndef build_passed(repo='RPi-Distro/python-gpiozero', delay=3600):\n t = TravisPy()\n r = t... | python | edit | 3 | 2 | bsd-3-clause | 7a324d85ef76604c919c2c7e2f38fbda17b3d01c | RPi-Distro/python-gpiozero,waveform80/gpio-zero,MrHarcombe/python-gpiozero | docs/examples/led_travis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n\nclass ApiNamespace(object):\n def __init__(self, api, name, description=None, endpoint=None, path=None, **kwargs):\n self.api = api\n self.name = name\n ... | python | edit | 1 | 3 | mit | bf4af59b4a9d0637d3743b6b6ff0eaef18dbb902 | leiserfg/flask-restplus,luminusnetworks/flask-restplus,awiddersheim/flask-restplus,awiddersheim/flask-restplus,fixedd/flask-restplus,luminusnetworks/flask-restplus,fixedd/flask-restplus,leiserfg/flask-restplus | flask_restplus/namespace.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom experiment_config_lib import ControllerConfig\nfrom sts.topology import MeshTopology\nfrom sts.control_flow import Fuzzer, Interactive\nfrom sts.input_traces.input_logger import InputLogger\nfrom sts.invariant_checker import InvariantC... | python | edit | 3 | 0 | apache-2.0 | 6518911dad0d22e878d618f9a9a1472de7a7ee1e | jmiserez/sts,ucb-sts/sts,ucb-sts/sts,jmiserez/sts | config/fuzz_pox_mesh.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth import get_user_model\nfrom django.core.exceptions import ObjectDoesNotExist, ValidationError\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom registration.forms import RegistrationForm\n\nfrom .mode... | python | edit | 1 | 2 | mit | 97a799965e74f6add2eefab38a4e1a69699092df | muhummadPatel/raspied,muhummadPatel/raspied,muhummadPatel/raspied | students/forms.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.