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 django.core.management.base import BaseCommand\nfrom django_dbq.models import Job\n\n\nclass Command(BaseCommand):\n\n help = \"Print the current depth of the given queue\"\n\n def add_arguments(self, parser):\n parser.add... | python | edit | 1 | 2 | bsd-2-clause | bc0193a3a32521512b77e6149e91eab805836f8d | dabapps/django-db-queue | django_dbq/management/commands/queue_depth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport argparse\nimport getpass\nfrom cassandra import query\nfrom cassandra.cqlengine.management import sync_table\nfrom cassandra.cqlengine.management import create_keyspace_simple\nfrom cassandra.cluster import C... | python | edit | 1 | 0 | mit | b493073ec6978b6291cc66491bb3406179013d3d | dgaston/ddb-datastore,dgaston/ddb-variantstore,dgaston/ddbio-variantstore,GastonLab/ddb-datastore | create_variants_databases.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2016 Antoine Carme <<EMAIL>>\n# All rights reserved.\n\n# This file is part of the Python Automatic Forecasting (PyAF) library and is made available under\n# the terms of the 3 Clause BSD license\n\nimport sys, os\n\ndef cre... | python | edit | 3 | 2 | bsd-3-clause | d46d896b63ac24759a21c49e30ff9b3dc5c81595 | antoinecarme/pyaf,antoinecarme/pyaf,antoinecarme/pyaf | TS/Utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom relay_api.api.server import server\nfrom relay_api.core.relay import relay\nfrom relay_api.conf.config import relays\nimport relay_api.api.server as api\n\n\nfor r in relays:\n relays[r][\"instance\"] = relay(relays[r][\"gpio\"],\n ... | python | edit | 1 | 1 | mit | f0ede3d2c32d4d3adce98cd3b762b672f7af91a9 | pahumadad/raspi-relay-api | relay_api/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport sys\n\nfrom cliff.app import App\nfrom cliff.commandmanager import CommandManager\n\n\nclass DemoApp(App):\n\n log = logging.getLogger(__name__)\n\n def __init__(self):\n super(DemoApp, self).__init__(\n ... | python | edit | 1 | 2 | apache-2.0 | b9f5954b7760a326073cfec198e4247dac386f0d | openstack/cliff,enzochiau/cliff,idjaw/cliff,idjaw/cliff,openstack/cliff,enzochiau/cliff,dtroyer/cliff,dtroyer/cliff | demoapp/cliffdemo/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\n\ndef pyInstallerResourcePath(relativePath):\n basePath = getattr(sys, '_MEIPASS', os.path.abspath('./src'))\n return os.path.join(basePath, relativePath)\n\n```\n\nApply this change: Fix default file path loc... | python | edit | 1 | 1 | mit | 0a7fa2d65f2d563fbf36a2b39636dd8068cd4934 | JustinShenk/sensei | PyInstallerUtils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nfrom django.db import models\nfrom django.utils import timezone\nfrom django.conf import settings\nfrom django.core.urlresolvers import reverse\n\n\nclass BillingCode(models.Model):\n nr_rvus = mo... | python | edit | 1 | 1 | apache-2.0 | 35374e354bc34f01b47d8813ceea3fce2d175acf | craighagan/rvumanager,craighagan/rvumanager,craighagan/rvumanager,craighagan/rvumanager | rvusite/rvu/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom .app import app\n\n\nDEBUG = os.environ.get('DEBUG', 'false').lower() in ('true', 'yes', '1')\nHOST = os.environ.get('HOST', '0.0.0.0')\nPORT = int(os.environ.get('PORT', 8000))\n\n\ndef main():\n app.run(host=HOST, por... | python | edit | 1 | 1 | mit | b2ed3d191f564df0911580bb7214b3d834b78dc3 | bosondata/chrome-prerender | prerender/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom datetime import datetime\n\n\ndef get_next_pass(lat, lon):\n iss_url = 'http://api.open-notify.org/iss-pass.json'\n location = {'lat': lat, 'lon': lon}\n response = requests.get(iss_url, params=location).json(... | python | edit | 1 | 1 | mit | c80a0e14b0fc7a61accddd488f096f363fc85f2f | sagnew/ISSNotifications,sagnew/ISSNotifications,sagnew/ISSNotifications | iss.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pytgbot.api_types.sendable.files import InputFileFromURL\nfrom pytgbot.api_types.sendable.input_media import InputMediaVideo\nimport unittest\n\n\nclass MyTestCase(unittest.TestCase):\n def test_InputMediaVideo_thumb_files(self):\n ... | python | edit | 1 | 1 | mit | 705c2bb724b61f9b07f6ed1ce2191ea0e998ecc4 | luckydonald/pytgbot,luckydonald/pytgbot,luckydonald/pytgbot | tests/api_types/sendable/test_input_media.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mock\nfrom boto.compat import json\nfrom tests.unit import unittest\n\nfrom .test_search import HOSTNAME, CloudSearchSearchBaseTest\nfrom boto.cloudsearch.search import SearchConnection, SearchServiceException\n\n\ndef fake_loads_val... | python | edit | 1 | 1 | mit | 4407fcb950f42d080ca7e6477cddd507c87e4619 | ekalosak/boto,kouk/boto,revmischa/boto,Asana/boto,TiVoMaker/boto,rjschwei/boto,tpodowd/boto,Timus1712/boto,drbild/boto,awatts/boto,yangchaogit/boto,campenberger/boto,podhmo/boto,israelbenatar/boto,alex/boto,khagler/boto,abridgett/boto,FATruden/boto,janslow/boto,appneta/boto,j-carl/boto,clouddocx/boto,jindongh/boto,bryx... | tests/unit/cloudsearch/test_exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import Task, client\nfrom .document import Document\n\n\ndef test_handler(handler, url):\n print \"Testing handler: %s\" % handler.__name__\n t = Task(url=url, document_type=None, referer=None)\n print \" Fetching url: %s\"... | python | edit | 7 | 3 | mit | c50051bd8699589c20acb32764b13bdb1473ff23 | storborg/itsy | itsy/utils.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport click\n\nfrom .pycolfin import COLFin\n\nfrom getpass import getpass\n\n\nverbosity_help = \"\"\"\n1 = User ID, Last Login, Equity Value, Day Change\n2 = Display all info from 1 and portfolio summary\n3 = Dis... | python | edit | 1 | 7 | mit | 63f06cdea9a0471708ee633ff0546b22cdebb786 | patpatpatpatpat/pycolfin | pycolfin/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom .models import *\n\napp = Flask(__name__)\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'\n\nfrom codegolf import views\n\n```\n\nApply this change: Update app decl to use sqlalchemy rather th... | python | edit | 4 | 0 | mit | 567aa141546c905b842949799474742bf171a445 | UQComputingSociety/codegolf,UQComputingSociety/codegolf,UQComputingSociety/codegolf | codegolf/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom accloudtant import load_data\n\n\nif __name__ == \"__main__\":\n usage = load_data(\"tests/fixtures/2021/03/S3.csv\")\n\n print(\"Simple Storage Service\")\n for area, concepts in usage.totals(omit=lambda x: x.is_data_transfer... | python | edit | 1 | 0 | apache-2.0 | acf7b76e098e70c77fbce95d03ec70911260ab58 | ifosch/accloudtant | accloudtant/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport pika\nfrom twython import TwythonStreamer\n\nclass TwitterConfiguration:\n def __init__(self):\n with open('twitter_key.json') as jsonData:\n data = json.load(jsonData)\n\n self.consumer_key =... | python | edit | 2 | 2 | mit | a6adcc09bd1abe1d2538d499153a102cc37d5565 | estiller/tweet-analyzer-demo,estiller/tweet-analyzer-demo,estiller/tweet-analyzer-demo,estiller/tweet-analyzer-demo,estiller/tweet-analyzer-demo | reader/reader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.http import HttpResponse\n\ndef index(request):\n context = {'text': 'Welcome to our game'}\n return render(request, 'game/index.html', context)\n\ndef users(request):\n\tcontext = {'te... | python | edit | 1 | 1 | mit | 5d7c85d33f8e51947d8791bd597720f161a48f82 | shintouki/augmented-pandemic,shintouki/augmented-pandemic,shintouki/augmented-pandemic | game/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for result set intersection method"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n#\n\n\nimport avalon.web.services\n\n\ndef test_intersection_with_empty_set():\n set1 = set(['foo', 'bar'])\n set2... | python | new_file | 1 | 1 | mit | 575a73f7e1ba7d175fa406478e71fd05fd2cae2e | tshlabs/avalonms | test/test_web_services.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import defaultdict\n\nfrom django.template import TemplateDoesNotExist, TemplateSyntaxError # NOQA\nfrom django.template.backends.base import BaseEngine\nfrom django.template.backends.utils import csrf_input_lazy, csrf_tok... | python | edit | 3 | 3 | mit | 8c96f3211967c680ee26b673dc9fe0299180a1c4 | funkybob/knights-templater,funkybob/knights-templater | knights/dj.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom curses import wrapper\nimport platform\n\nif platform.system() == \"Darwin\":\n\t# create mock class for Pi Camera\n\tclass Camera:\n\t\tdef __init__(self):\n\t\t\tself.brightness = 10\n\t\t\tself.contrast = 2... | python | edit | 1 | 2 | mit | 9f80145574cfad56e91df9a598c311894d12a675 | gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x | scratchpad/ncurses.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom reddit.models import RedditAccount\nfrom reddit.forms import RedditAccountForm\n\nfrom datetime import date\n\nclass RedditAccountAdmin(admin.ModelAdmin):\n list_display = ('username', 'user', 'date... | python | edit | 1 | 5 | bsd-3-clause | 75c1dedb6eddfcb540ee29de5ae31b99d9927d07 | nikdoof/test-auth | reddit/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gather.organiser import NotEnoughPlayersError\n\n\ndef strip_help(bot):\n messages = []\n\n for regex, action in bot.actions.values():\n if action.__doc__:\n messages.append(action.__doc__.strip())\n return m... | python | edit | 1 | 3 | mit | 4bcbb06b779851dd5d031b7951ff80ed325b1414 | veryhappythings/discord-gather | gather/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Overwrite behavior of sympy objects to make more sense for this project.\nimport symfit.core.operators\n\n# Expose useful objects.\nfrom symfit.core.fit import (\n Fit, Model, Constraint, ODEModel, ModelError, CallableModel,\n Calla... | python | edit | 17 | 0 | mit | 980492cb76d0d72a005269a4fb9c1ec9767c10de | tBuLi/symfit | symfit/api.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nLOG_FORMAT = '%(asctime)s [%(name)s] %(levelname)s %(message)s'\nLOG_DATE = '%Y-%m-%d %I:%M:%S %p'\n\n\nlogging.basicConfig(format=LOG_FORMAT, datefmt=LOG_DATE, level=logging.WARN)\nlogger = logging.getLogger('yoda-discove... | python | edit | 1 | 0 | mit | 9729a77b9b8cbfe8a6960ded4b5931e3ed64fe10 | totem/yoda-discover | discover/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nimport monasca_setup.agent_config\nimport monasca_setup.detection\n\nlog = logging.getLogger(__name__)\n\n\nclass HttpCheck(monasca_setup.detection.ArgsPlugin):\n \"\"\" Setup an http_check according to the passed in ar... | python | edit | 1 | 5 | bsd-3-clause | ca09f3e4286be605e179f0b6ac742305d165b431 | sapcc/monasca-agent,sapcc/monasca-agent,sapcc/monasca-agent | monasca_setup/detection/plugins/http_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial push and pop tests for Stack"
},
{
"role": "assistant",
"content": "from stack import StackItem\nfrom stack import StackFrame\nimport pytest\n\n\ndef test_item_data():\n # Tests that \"Bacon\" is returned when call... | python | new_file | 1 | 1 | mit | d9334aee00ba0f7f7b6423d775a65ba6f40ac4d4 | jwarren116/data-structures | test_stack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport os\nfrom django.http import HttpResponse, Http404\nfrom django.views.decorators.csrf import csrf_exempt\n\nfrom twilio.rest import TwilioRestClient\n\nlogger = logging.getLogger('django')\n\n@csrf_exempt\ndef handle(r... | python | edit | 3 | 2 | mit | 81cd197e95e89dd37797c489774f34496ecea259 | zackzachariah/scavenger,zackzachariah/scavenger | server/pushlanding.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis script can be used to check if TM1py can connect to your TM1 instance\n\"\"\"\n\nimport getpass\nfrom distutils.util import strtobool\n\nfrom TM1py.Services import TM1Service\n\n# Parameters for connection\nuser = input(\"TM1 U... | python | edit | 1 | 0 | mit | 31eadf6cdaf70621941a6c5d269ed33f46e27cd7 | cubewise-code/TM1py-samples | check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass OutputHandler(object):\n def __init__(self, connection):\n self.connection = connection\n\n def cmdJOIN(self, channels, keys=None):\n chans = channels.split(\",\")\n for i in range(len(chans)):\n ... | python | edit | 1 | 3 | mit | a61d50ff6f564112c04d3a9a8ac6e57d5b99da9d | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | heufybot/output.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Produces IPHAS Data Release 2 using an MPI computing cluster.\"\"\"\nfrom IPython import parallel\nfrom astropy import log\n\n__author__ = 'Geert Barentsen'\n\n# Create the cluster view\... | python | edit | 5 | 0 | mit | ed271823e5a5f957b17f00fd4823b6ae0b973e83 | barentsen/iphas-dr2,barentsen/iphas-dr2,barentsen/iphas-dr2 | scripts/seam.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport wtforms_json\nfrom flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\ndb = SQLAlchemy()\n\n\ndef create_app():\n\n wtforms_json.init()\n\n # Define the WSGI Application object\n app = Flask(\n __name__... | python | edit | 1 | 1 | mit | 23604efc203f62f1059c4bd18f233cccdaf045e6 | ganemone/ontheside,ganemone/ontheside,ganemone/ontheside | server/app_factory/create_app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\n\nclass DocScanner(object):\n \"\"\"\n A class used to find certain tokens in a given document. The tokens can be\n specified by regular expressions.\n \"\"\"\n\n def __init__(self, tokens_dict, callback):\n \"\"\"\n ... | python | edit | 1 | 4 | mit | 99b72ab4e40a4ffca901b36d870947ffb5103da8 | hadithhouse/hadithhouse,rafidka/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse,hadithhouse/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,rafidka/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse | HadithHouseWebsite/textprocessing/regex.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\n\nfrom axes.utils import reset\n\n\nclass Command(BaseCommand):\n help = (\"resets any lockouts or failed login records. If called with an \"\n \"IP, resets only for that IP... | python | edit | 1 | 4 | mit | 1addfaecb6210054480aa3c1c2a42878f526e1ed | jazzband/django-axes,svenhertle/django-axes,django-pci/django-axes | axes/management/commands/axes_reset.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom rest_framework import fields\nfrom rest_framework_json_api import serializers\n\nfrom api_v3.models import Profile, Ticket\n\n\nclass ProfileSerializer(serializers.ModelSerializer):\n\n tickets_coun... | python | edit | 1 | 6 | mit | 759e22f8d629f76d7fca0d0567603c9ae6835fa6 | occrp/id-backend | api_v3/serializers/profile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nlink_re = re.compile(\"https?://\\S+(\\s|$)\")\n\n\ndef extract_url(message):\n \"\"\"\n Returns the first url in a message. If there aren't any returns None\n \"\"\"\n answer = link_re.search(message)\n\n if ans... | python | edit | 1 | 2 | mit | 017ba0d18acb83a5135dd7a23c085b3c93d539b3 | iwi/linkatos,iwi/linkatos | linkatos/message.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.decorators import decorator_from_middleware_with_args\n\nfrom lockdown.middleware import LockdownMiddleware\n\n\ndef lockdown(*args, **kwargs):\n \"\"\"Define a decorator based on the LockdownMiddleware.\n\n This dec... | python | edit | 1 | 0 | bsd-3-clause | ecfa18b7f05a23bdc6beab705dc748559eef2873 | Dunedan/django-lockdown,Dunedan/django-lockdown | lockdown/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport AgileCLU\nimport unittest\n\nclass AgileCLUTestCase(unittest.TestCase):\n def setup(self):\n self.agileclu = AgileCLU()\n def test_epwbasekey(self):\n return\n def test_e_pw_hash(self):\n return\n... | python | edit | 1 | 1 | bsd-2-clause | b51c8d107b6da5d6d6b0cc5a1db525bff856a1cf | wylieswanson/AgileCLU | AgileCLU/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"pep257 docstrings convention needs error code and class parser for be\nincluded as module into flake8\n\"\"\"\nimport pep257\n\n__version__ = '0.2.1.post1'\n\n\nclass pep257Checker(object):\n\n \"\"\"flake8... | python | edit | 1 | 3 | mit | 52c5f4ddfde8db6179f11c3bec2bc8be69eed238 | PyCQA/flake8-docstrings | flake8_docstrings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n\nfrom app import db, bcrypt\nfrom app.utils.misc import make_code\n\n\nclass User(db.Model):\n\n id = db.Column(db.Integer(), primary_key=True)\n email = db.Column(db.String(255), unique=True)\n pass... | python | edit | 1 | 1 | mit | 4c4f4e3e5f1e92d0acdaf1598d4f9716bcd09727 | projectweekend/Flask-PostgreSQL-API-Seed | app/users/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Sergey Margaritov\n# Copyright (c) 2013 Sergey Margaritov\n#\n# License: MIT\n#\n\n\"\"\"This module exports the scss-lint plugin lin... | python | edit | 4 | 0 | mit | 5f88686bdd089d67192f75eac9d3f46effad2983 | attenzione/SublimeLinter-scss-lint | linter.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport os\nfrom mock import call, patch\nfrom packages.lyrics import lyrics\n\n#TODO: add tests for PyLyricsClone\nclass Lyrics_Test(unittest.TestCase):\n\n def setUp(self):\n self.song_name = \"everybody dies\"\n... | python | edit | 5 | 1 | mit | bfdd095d501c6760e6623aedf3525ba4e21d1637 | sukeesh/Jarvis,appi147/Jarvis,sukeesh/Jarvis,appi147/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis | jarviscli/tests/test_auto/test_lyrics.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef checkio(array):\n if array[0][0] == array[0][1] == array[0][2] or array[0][0] == array[1][0] == array[2][0] or array[0][0] == array[1][1] == array[2][2]:\n return array[0][0]\n if array[1][0] == array[1][1] == array[1][2] o... | python | edit | 1 | 12 | mit | 1a150cb57171212358b84e351a0c073baa83d9fd | edwardzhu/checkio-solution | Home/xsOros.py | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, render_template, redirect\nimport json\napp = Flask(__name__)\n\nwith open(\"modules.json\", 'r') as fp:\n layout = json.load(fp)\n\n@app.route('/')\ndef main():\n return redirect(\"content/start/\", code=302)... | python | edit | 1 | 1 | mit | cbbb59aa42676a9adfe25344437cc4284afcac73 | grenmester/hunt-master,grenmester/hunt-master,grenmester/hunt-master,grenmester/hunt-master,grenmester/hunt-master | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#----------------------------------------------------------------------\n# Copyright (c) 2011 Raytheon BBN Technologies\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and/or hardware s... | python | edit | 1 | 1 | mit | 68c20c259834fa11b9e3e514c918c1776775ad12 | ahelsing/geni-tools,tcmitchell/geni-tools,GENI-NSF/gram,plantigrade/geni-tools,GENI-NSF/gram,tcmitchell/geni-tools,ahelsing/geni-tools,GENI-NSF/gram,plantigrade/geni-tools | src/geni/am/fakevm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom blinkenlights import setup, cleanup\nfrom fourleds import light, clear\nfrom time import sleep\n\npins = [32, 22, 18, 16]\n# blu grn red yel\n\nfor p in pins:\n setup(p)\n\nfor i in range(20):\n for... | python | edit | 1 | 0 | mit | 4f64f04a2fbbd2b25c38c9e0171be6eeaff070cf | zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nimport re\n\nbugre = re.compile(\"bug\\\\s+(\\\\d+)\", re.I);\n\ndef searchFile(f, path):\n first = True\n section = ''\n\n for l in f.readlines():\n # Skip trailing/leading whitespace\n ... | python | edit | 6 | 13 | mit | 71e36134d23ecca8eacd9ae9549b75c460227e53 | mrbkap/disabled-e10s-finder,mrbkap/disabled-e10s-finder | manifest-parser.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.decorators import user_passes_test, login_required\n\nfrom hackingweek.models import Team\n\nhas_no_team = user_passes_test(lambda u: u.team_set.all().count() == 0)\n\ndef has_no_team_required(view_func):\n decor... | python | edit | 3 | 1 | bsd-2-clause | 6a8753bcc8f1090e93b1f690bead4fda8e810d76 | perror/hackingweek,perror/hackingweek,perror/hackingweek | hackingweek/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Any, Callable\n\nfrom graphql.type import (\n GraphQLArgument,\n GraphQLField,\n GraphQLInputType,\n GraphQLOutputType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLResolveInfo,\n)\n\n\ndef plural_identi... | python | edit | 1 | 2 | mit | f1957185f0d93861a8ed319223f574df8f4e838f | graphql-python/graphql-relay-py | src/graphql_relay/node/plural.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\nfrom website.app import init_app\n\n\nif __name__ == \"__main__\":\n os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.base.settings')\n\n from django.core.management import execute_fro... | python | edit | 1 | 0 | apache-2.0 | 359cbd7b45289e364ad262f09dd3d3ef3932eb76 | alexschiller/osf.io,Ghalko/osf.io,dplorimer/osf,mluo613/osf.io,CenterForOpenScience/osf.io,ZobairAlijan/osf.io,cldershem/osf.io,ticklemepierce/osf.io,chennan47/osf.io,aaxelb/osf.io,rdhyee/osf.io,abought/osf.io,crcresearch/osf.io,KAsante95/osf.io,mattclark/osf.io,lyndsysimon/osf.io,brianjgeiger/osf.io,amyshi188/osf.io,j... | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Minify Javascript using `UglifyJS <https://github.com/mishoo/UglifyJS/>`_.\n\nUglifyJS is an external tool written for NodeJS; this filter assumes that\nthe ``uglifyjs`` executable is in the path. Otherwise, you may define\na ``UGLIFY... | python | edit | 1 | 3 | bsd-2-clause | f176051094b5482f48781f0695835fed5727742c | JDeuce/webassets,scorphus/webassets,heynemann/webassets,scorphus/webassets,aconrad/webassets,JDeuce/webassets,glorpen/webassets,wijerasa/webassets,john2x/webassets,heynemann/webassets,aconrad/webassets,heynemann/webassets,wijerasa/webassets,glorpen/webassets,aconrad/webassets,0x1997/webassets,florianjacob/webassets,joh... | src/webassets/filter/uglifyjs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase\nfrom DjangoLibrary.middleware import FactoryBoyMiddleware\nfrom mock import Mock\n\n\nclass TestFactoryBoyMiddleware(TestCase):\n\n def setUp(self):\n ... | python | edit | 1 | 1 | apache-2.0 | 2198e43a3701351085ac186a9a8574b788148fcf | kitconcept/robotframework-djangolibrary | mysite/mysite/tests/test_middleware.py | rejected_duplicate | Near-duplicate of sample 11533 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nfrom docutils import nodes\nfrom docutils.parsers.rst import Directive\n\ndef make_link_node(rawtext, app, type, slug, options):\n \"\"\"Create a link to a JIRA ticket.\n\n :param rawtext: Text being replaced ... | python | edit | 5 | 3 | apache-2.0 | e6d0c5dab7c24b223815aee65d58b4b5191213a9 | htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor | docs/extensions/jira.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\nclass Gaussian:\n\t\"\"\"\n\tAn object of this class is a 2D elliptical gaussian\n\t\"\"\"\n\tdef __init__(self):\n\t\t\"\"\"\n\t\tConstructor sets up a standard gaussian\n\t\t\"\"\"\n\t\tself.xc, self.yc, self.mass, s... | python | edit | 1 | 1 | mit | c429abe7bee0461c8d2874ecb75093246565e58c | eggplantbren/MogTrack | code/python/Gaussian.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask.ext.mongoengine import MongoEngine\nfrom views import mocks\nimport os\n\napp = Flask(__name__)\napp.config[\"MONGODB_SETTINGS\"] = {\n\t\"db\": \"mox\"\n}\napp.config[\"SECRET_KEY\"] = \"KeepThisS3cr3t\"... | python | edit | 1 | 0 | mit | 6e2a484ac46279c6a077fb135d7e5f66605e9b88 | abouzek/mox,abouzek/mox | mox/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport sys\nimport os\nfrom tasklib.task import TaskWarrior\n\ntime_attributes = ('wait', 'scheduled')\n\ndef is_new_local_recurrence_child_task(task):\n # Do not affect tasks not spun by recurrence\n if not task[... | python | edit | 1 | 4 | mit | d97dd4a8f4c0581ce33ed5838dcc0329745041bf | tbabej/task.shift-recurrence | pirate_add_shift_recurrence.py | rejected_duplicate | Near-duplicate of sample 3880 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 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# pylint: disable=W0401,W0614\n\n\nfrom telemetry import story\nfrom teleme... | python | edit | 1 | 2 | bsd-3-clause | 9340b43508c4203c81e3feb9607c8a7fe5972eb5 | google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,goo... | tools/skp/page_sets/skia_intelwiki_desktop.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"yolk.\n\nAuthor: Rob Cakebread <cakebread at gmail>\n\nLicense : BSD\n\n\"\"\"\n\n__version__ = '0.8'\n\n```\n\nApply this change: Increment patch version to 0.8.1"
},
{
"role": "assistant",
"content": "\"\"\"yolk.\n\nAut... | python | edit | 1 | 0 | bsd-3-clause | ad85d6495343d6089ede2bbf08540341ada93ca8 | myint/yolk,myint/yolk | yolk/__init__.py | rejected_duplicate | Near-duplicate of sample 12689 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Red Hat, Inc.\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 of the License at\n#\n# htt... | python | edit | 1 | 3 | apache-2.0 | e5d16155364c1dae2db238506f236194e2dfb1dc | openstack/tripleo-common,openstack/tripleo-common | tripleo_common/filters/capabilities_filter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bonspy.features import _apply_operations\n\n\ndef test_apply_operations_domain():\n value = _apply_operations('domain', 'www.test.com')\n\n assert value == 'test.com'\n\n\ndef test_apply_operations_segment():\n value = _apply_... | python | edit | 1 | 1 | bsd-3-clause | bce7111c2b927290e054dffb765468c41b785947 | markovianhq/bonspy | bonspy/tests/test_features.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-*- coding: utf-8 -*-\nfrom filer.tests.admin import *\nfrom filer.tests.fields import *\nfrom filer.tests.models import *\nfrom filer.tests.permissions import *\nfrom filer.tests.server_backends import *\nfrom filer.tests.tools import *\n... | python | edit | 7 | 0 | bsd-3-clause | 1c5b70610a973ff90dab4253cb525acb7504d239 | SmithsonianEnterprises/django-filer,jrief/django-filer,kriwil/django-filer,jakob-o/django-filer,samastur/django-filer,o-zander/django-filer,mkoistinen/django-filer,nimbis/django-filer,belimawr/django-filer,webu/django-filer,kriwil/django-filer,DylannCordel/django-filer,o-zander/django-filer,webu/django-filer,vechorko/d... | filer/tests/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom framework import StoredObject, fields\n\n\nclass Guid(StoredObject):\n\n _id = fields.StringField()\n referent = fields.AbstractForeignField()\n\n _meta = {\n 'optimistic': True,\n }\n\n\nclass GuidStoredObject(Store... | python | edit | 1 | 3 | apache-2.0 | 524ee1cd2f56f6fe968f409d37cbd2af1621e7f3 | zkraime/osf.io,emetsger/osf.io,RomanZWang/osf.io,chennan47/osf.io,TomHeatwole/osf.io,adlius/osf.io,cwisecarver/osf.io,petermalcolm/osf.io,mfraezz/osf.io,wearpants/osf.io,HalcyonChimera/osf.io,baylee-d/osf.io,samanehsan/osf.io,CenterForOpenScience/osf.io,caseyrollins/osf.io,felliott/osf.io,monikagrabowska/osf.io,Johneto... | framework/guid/model.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport praw\nimport humanize\nfrom datetime import datetime\nfrom flask import Flask\nfrom flask import request, render_template\nfrom prawoauth2 import PrawOAuth2Mini\n\nfrom settings import (app_key, app_secret, access_token, refresh_toke... | python | edit | 1 | 3 | mit | 587c1490538c610cdd885667720d3ad27da7eb83 | avinassh/kekday,avinassh/kekday | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\nimport models\nimport os\nimport os.path\nimport peewee\n\ndef init():\n models.db.connect()\n models.db.create_tables([models.Entry])\n\ndef digest(file_path):\n h = hashlib.sha1()\n file = open(file_path, 'rb')... | python | edit | 1 | 4 | mit | 3992e424169a9ac6eb0d13c03045139403dc27cf | rschiang/pineapple.py | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport StringIO\n\nimport PIL\nimport pytest\n\nfrom django.core.files.uploadedfile import InMemoryUploadedFile\n\n\nclass Image:\n def __init__(self):\n self.dimensions = (100, 100)\n self.color = 'blue'\n self.name... | python | edit | 1 | 1 | mit | 5db17915435eb569bf7644019b9fdbf94f18114a | saulshanabrook/django-simpleimages | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport socket\n\nfrom django.contrib.auth.models import AnonymousUser\nfrom django.contrib.auth.models import User\n\n\nclass GooglebotMiddleware(object):\n \"\"\"\n Middleware to automatically log in the Googlebot with the user accou... | python | edit | 3 | 6 | bsd-3-clause | 2567e56c7c17754e18346b21bcad6eab713276ea | macropin/django-googlebot | googlebot/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Example Rejected Consumer\"\"\"\nfrom rejected import consumer\n\nimport random\n\nfrom tornado import gen\nfrom tornado import httpclient\n\n__version__ = '1.0.0'\n\n\nclass ExampleConsumer(consumer.SmartConsumer):\n\n def process... | python | edit | 1 | 4 | bsd-3-clause | a270b7ea7636cd70b38f7e3534871a76ea2cdae1 | gmr/rejected,gmr/rejected | rejected/example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\nimport sys\n\nhere = os.path.abspath(os.path.split(__file__)[0])\nroot = os.path.abspath(os.path.join(here, \"..\", \"..\"))\n\nsys.path.insert(0, os.path.abspath(os.path.join(here, \"..\", \"scripts\")))\n\nimport m... | python | edit | 1 | 1 | bsd-3-clause | 9f17fc03a79434b3d92e4dea00ea33567c806280 | frewsxcv/wpt-tools,wpt-on-tv-tf/wpt-tools,wpt-on-tv-tf/wpt-tools,frewsxcv/wpt-tools,kaixinjxq/wpt-tools,UprootStaging/wpt-tools,UprootStaging/wpt-tools,wpt-on-tv-tf/wpt-tools,kaixinjxq/wpt-tools,vivliostyle/wpt-tools,UprootStaging/wpt-tools,frewsxcv/wpt-tools,vivliostyle/wpt-tools,kaixinjxq/wpt-tools,vivliostyle/wpt-to... | runner/update_manifest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport subprocess\nfrom ..utils import DEVNULL, change_working_directory\nfrom .base import DOWNLOAD_CONTAINER\n\n\ndef _checkout(name):\n with change_working_directory(DOWNLOAD_CONTAINER... | python | edit | 1 | 3 | mit | 1a5a5268cea83a7d29346a677e9d10ec9e5411e8 | uranusjr/cuteshop | cuteshop/downloaders/git.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDataWriter.py\n\"\"\"\n\nfrom DataController import DataController\nfrom DataReader import DataReader\nfrom vtk import vtkMetaImageWriter\nfrom vtk import vtkXMLImageDataWriter\n\n\nclass DataWriter(DataController):\n\t\"\"\"\n\tDat... | python | edit | 1 | 5 | mit | b262d53e8347ea666cb5cd46bc9e19b7944cf7e6 | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | core/data/DataWriter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\n\nfrom . import pf\n\n\"\"\"\n Doing this the \"right\" way by using DIOCNATLOOK on the pf device turns out\n to be a pain. Apple has made a number of modifications to the data\n structures returned, and compilin... | python | edit | 1 | 4 | mit | 6a9407d7cc4ac5555180a2ee331ff95eef131902 | mitmproxy/mitmproxy,cortesi/mitmproxy,MatthewShao/mitmproxy,MatthewShao/mitmproxy,laurmurclar/mitmproxy,mosajjal/mitmproxy,cortesi/mitmproxy,vhaupert/mitmproxy,mhils/mitmproxy,dwfreed/mitmproxy,ddworken/mitmproxy,gzzhanghao/mitmproxy,StevenVanAcker/mitmproxy,ujjwal96/mitmproxy,StevenVanAcker/mitmproxy,xaxa89/mitmproxy,... | mitmproxy/platform/osx.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals, print_function\nimport sqlite3, os, random\n\n_select = 'select {} from {} order by random() limit 1'\n_uncommon_select = 'select value from uncommons where key=?'\n\ndef generate_name():\n conn =... | python | edit | 1 | 7 | unlicense | 35f59e256224b82c82b2be3af4cd22e43443bc9f | rotated8/mgsv_names | mgsv_names.py | rejected_duplicate | Near-duplicate of sample 11672 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Daemonize makes Unix-y daemons real easy. Just import daemonize.daemonize\nand call the function before whatever you want the daemon to be. A couple\ngotchas:\n\n 1) It will disconnect your python process from stdin and stdout, so ... | python | edit | 2 | 0 | mit | 6fab7a8170cbd993400b097478f328024c3f9247 | cjeffers/ezdaemon | ezdaemon/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom client import PhilDBClient\n\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n\n```\n\nApply this change: Make import of client module explicit"
},
{
"role": "assistant",
"cont... | python | edit | 3 | 0 | bsd-3-clause | f7f6a8a1b1f019b45b9f3c3c9c6124469a335798 | amacd31/phildb_client | phildb_client/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Temporary inclusion of pycorenlp code for easier edits\n# https://github.com/smilli/py-corenlp\n\nimport json, requests\nimport six\n\nclass StanfordCoreNLP:\n\n\tuseSessions = False\n\tsessions = {}\n\n\tdef __init__(self, server_url):\n... | python | edit | 1 | 2 | mit | fc6acce0667d23c0f0b51d67c5899cf979d37516 | jakelever/kindred,jakelever/kindred | kindred/pycorenlp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Load data for videos in Youtube playlist\n# https://www.youtube.com/playlist?list=PLy7eek8wTbV9OtrbY3CJo5mRWnhuwTen0\n\n## TODO handle videos for multiple months\n# all_videos dict contains videos by day.\n\nimport pafy\nfrom datetime imp... | python | edit | 1 | 0 | mit | c0a41a602fb7fa2ef0a6472f8c6ca00a7acfc7f1 | jasalt/weatherlapse,jasalt/weatherlapse,jasalt/tiea207-demo,jasalt/tiea207-demo | app/youtube.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom canis import siriusxm, spotify, oauth\n\ndef main():\n try:\n current = siriusxm.get_currently_playing('siriusxmu')\n spotify_id = spotify.id_for_song(current)\n print(current, spotify_id)\n except Exception,... | python | edit | 4 | 5 | mit | a806d55b7cb2c554357895ca441f30c906aa1fc1 | maxgoedjen/canis | application.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Update cron job to use python3"
},
{
"role": "assistant",
"content": "import urllib.request\nurllib.request.urlopen('http://www.gamingwithlemons.com/cron/update')"
}
] | python | new_file | 1 | 0 | mit | d04a0000d231b1a597992bd28ab4ab8de27667e2 | rewphus/tidbitsdev,Clidus/gwl,rewphus/tidbitsdev,Clidus/gwl,rewphus/tidbitsdev,rewphus/tidbitsdev,Clidus/gwl,Clidus/gwl | cron/updateGameCache.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Utils for django-sekh\"\"\"\nimport re\nfrom itertools import izip\n\n\ndef remove_duplicates(items):\n \"\"\"\n Remove duplicates elements in a list preserving the order.\n \"\"\"\n seen = {}\n result = []\n for ite... | python | edit | 1 | 4 | bsd-3-clause | cae43a00c1a9421194721601c0bebc3468f134e4 | Fantomas42/django-sekh | sekh/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\nfrom getpass import getpass\nimport time\nimport paramiko\n\ndef main():\n\n ip_addr = '50.76.53.27'\n username = 'pyclass'\n password = getpass()\n ssh_port = 8022\n\n remote_conn_pre = paramiko.SSHClient(... | python | edit | 4 | 1 | apache-2.0 | 8e9de7c0df2f37c40d40b32612aae8e351c748b4 | linkdebian/pynet_course | class4/exercise1.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom brutal.core.plugin import cmd, match\nimport collections\n\nkarmas = collections.Counter()\n\n\n@match(regex=r'^([a-zA-Z0-9_]+)((:?\\+)+)$')\ndef karma_inc(event, name, pluses, *args):\n if name == event.meta['nick']:\n ret... | python | edit | 1 | 3 | apache-2.0 | cab3289827c859085dff9d492362d6648b52d23f | mrshu/brutal-plugins,Adman/brutal-plugins | karma.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for hash-based vtable creation"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division, absolute_import\n\nimport numba as nb\nfrom numba import *\nfrom numba.miniv... | python | new_file | 5 | 2 | bsd-2-clause | a94aa2d9aa58a7c2df289588eb4f16d83725ce8f | cpcloud/numba,ssarangi/numba,jriehl/numba,stuartarchibald/numba,pombredanne/numba,stefanseefeld/numba,stuartarchibald/numba,pitrou/numba,seibert/numba,cpcloud/numba,ssarangi/numba,IntelLabs/numba,IntelLabs/numba,sklam/numba,cpcloud/numba,seibert/numba,GaZ3ll3/numba,stonebig/numba,GaZ3ll3/numba,stonebig/numba,cpcloud/nu... | numba/exttypes/tests/test_vtables.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom ookoobah import core\nfrom ookoobah import utils\n\ngrid = utils.make_grid_from_string(\"\"\"\n # # # # # #\n # > . . \\ #\n # . # . | #\n # . / | o #\n # . \\ . / #\n # # # # # #\n\"\"\")\n\n... | python | edit | 4 | 0 | mit | 51060b1def98a98bee0a401205116e2cac056299 | vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah | test_core.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright 2014 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nimport argparse\nimport sys\n\nimport subprocess2\... | python | edit | 3 | 5 | bsd-3-clause | 8dbea15b789227d55972512307feb8f40f5d11a1 | svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools | git_upstream_diff.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\"\"\"itertools compatibility for Python 2 and 3, for imap, izip and ifilter.\n\nJust use:\n from funbox.itertools_compat import imap, izip, ifilter\n\ninstead of:\n from itertools import imap, izip, ifilter, ifilterfalse\n\n>>> lis... | python | edit | 3 | 0 | mit | 2c7464e8428359bec607623bffa3418e58ec8f1d | nmbooker/python-funbox,nmbooker/python-funbox | funbox/itertools_compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport praw\n\nfrom images_of import settings\n\nclass Reddit(praw.Reddit):\n def oauth(self, **kwargs):\n self.set_oauth_app_info(\n client_id = kwargs.get('client_id') or settings.CLIENT_ID,\n client_secret... | python | edit | 1 | 5 | mit | 2a285104807b07eba3682796536903254a175170 | amici-ursi/ImagesOfNetwork,scowcron/ImagesOfNetwork | images_of/connect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport wordsalad\nfrom flask import Flask\n\nApp = Flask(__name__)\n\n@App.route(\"salad/<int:n>/<string:corpus>\")\ndef _get(self, n, corpus=\"default\"):\n \"\"\"Generate n word salads from the given (optional) corpus.\"\"\"\n pass\... | python | edit | 4 | 1 | mit | a49cc6d6ca1ce22358292c00d847cb424306b229 | skurmedel/wordsalad | wordsaladflask.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\r\nimport serial\r\nimport time\r\nimport platform\r\nimport csv\r\n\r\nimport zephyr.protocol\r\n\r\ndef main():\r\n serial_port_dict = {\"Darwin\": \"/dev/cu.BHBHT001931-iSerialPort1\",\r\n \"Windows\": 23}\r\n ... | python | edit | 2 | 5 | bsd-2-clause | da4c39696a71077b34d4ab9347f7d7b4c5ef1601 | jpaalasm/zephyr-bt | scripts/create_test_data_file_from_bt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"Console script for nyucal.\"\"\"\n\nimport io\n\nimport click\nfrom lxml import html\nfrom nyucal import nyucal\nimport requests\n\n\n@click.group()\ndef main(args=None):\n \"\"\"Console script for nyucal... | python | edit | 4 | 3 | mit | 8e8545c024e307a4878cdb93a79b854afc84fad5 | nyumathclinic/nyucal,nyumathclinic/nyucal | nyucal/cli.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys, resource\nfrom ctypes import *\nimport ctypes.util\n\nif sys.platform == \"darwin\":\n def available_memory():\n libc = cdll.LoadLibrary(ctypes.util.find_library(\"libc\"))\n mem = c_uint64(0)\n size = c_... | python | edit | 16 | 5 | bsd-3-clause | a4beb8053780a9feb86fd85f0ce649717b9e7919 | ErikDubbelboer/disco,beni55/disco,mwilliams3/disco,oldmantaiter/disco,ktkt2009/disco,ErikDubbelboer/disco,oldmantaiter/disco,pooya/disco,beni55/disco,pombredanne/disco,ktkt2009/disco,beni55/disco,simudream/disco,mozilla/disco,ktkt2009/disco,simudream/disco,mozilla/disco,discoproject/disco,ErikDubbelboer/disco,pooya/dis... | lib/disco/sysutil.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n try:\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n except:\n return ''\n\nsetup(\n name='todoist-python',... | python | edit | 1 | 2 | mit | fb20bd41b5373c994274aa8565ba579fa13c8c28 | Doist/todoist-python,electronick1/todoist-python | setup.py | rejected_duplicate | Near-duplicate of sample 2235 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nalaf.features import FeatureGenerator\nfrom gensim.models import Word2Vec\n\n\nclass WordEmbeddingsFeatureGenerator(FeatureGenerator):\n \"\"\"\n DOCSTRING\n \"\"\"\n\n def __init__(self, model_file, weight=1):\n se... | python | edit | 1 | 4 | apache-2.0 | 81ca54adbfdb605cd63674134144e058c46bab5f | Rostlab/nalaf | nalaf/features/embeddings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n#-*- coding=utf-8 -*-\n\nfrom setuptools import setup\n\n\nsetup(name='kitabu',\n author=u'Adrian Duraj & Marek Brzóska',\n author_email='<EMAIL>, <EMAIL>',\n description=\"Django library to build rese... | python | edit | 1 | 0 | mit | 4bd13f0385dbac9855f6117afea0911bce1af3b3 | mbad/kitabu,mbad/kitabu,mbad/kitabu | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\ninstall_requires = ['jsonref', 'schema', 'openpyxl>=2.6', 'pytz',\n 'xmltodict', 'lxml', 'odfpy']\nsetup(\n name='flattentool',\n version='0.10.0',\n author='Open Data Services',\n... | python | edit | 1 | 0 | mit | deca54d2b3481647abaa19d30dfc8f8e9a8b719e | OpenDataServices/flatten-tool | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport pathlib\nfrom setuptools import setup\n\n\nsetup(\n name=\"ipytest\",\n version=\"0.8.0\",\n description=\"Unit tests in IPython notebooks.\",\n long_description=pathlib.Path(\"Readme.md\").read_tex... | python | edit | 1 | 0 | mit | a333bb06a913ca87aac77775e22fdb00c320cbb6 | chmp/ipytest | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='rgkit',\n version='0.2',\n description='Robot Game Testing Kit',\n maintainer='Peter Wen',\n maintainer_email='<EMAIL>',\n url='https://github.com/WhiteHalmos/rgkit',\n pac... | python | edit | 1 | 0 | unlicense | 39ab8f61731a383ea1befd18df5483a25811c0ca | RobotGame/rgkit,RobotGame/rgkit,mpeterv/rgkit,mpeterv/rgkit | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(name='aacrgenie',\n version='1.6.2',\n description='Processing and validation for GENIE',\n url='https://github.com/Sage-Bionetworks/Genie',\n author='Thomas Yu',\n ... | python | edit | 1 | 0 | mit | 220d1e99988f29e69295c70ef8428fa2cb3aa6f6 | thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\nimport tamarin\n\nDESCRIPTION = \"A Django app for monitoring AWS usage in Django's admin.\"\n\nLONG_DESCRIPTION = None\ntry:\n LONG_DESCRIPTION = open('README.rst').read()\nexcept:\n pass\n\nversion_str ... | python | edit | 1 | 0 | bsd-3-clause | 4b253f3620c3bc108982fb3f362dbe81e3e7ab3d | duointeractive/tamarin,duointeractive/tamarin,duointeractive/tamarin | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport re\n\nfrom setuptools import setup\n\nsetup_dir = os.path.dirname(__file__)\nreadme_contents = open(os.path.join(setup_dir, 'README.rst')).read()\nfaucet_version = re.match(r'.+version: ([0-9\\.]+)... | python | edit | 1 | 0 | apache-2.0 | 02b4f6a9513aa5213de0573b6a514a7221e7d625 | trentindav/faucet,wackerly/faucet,trentindav/faucet,gizmoguy/faucet,Bairdo/faucet,REANNZ/faucet,Bairdo/faucet,byllyfish/faucet,byllyfish/faucet,gizmoguy/faucet,shivarammysore/faucet,trungdtbk/faucet,mwutzke/faucet,shivarammysore/faucet,anarkiwi/faucet,REANNZ/faucet,faucetsdn/faucet,trungdtbk/faucet,anarkiwi/faucet,mwut... | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nAUTHENTICATION_BACKENDS = (\n 'django.contrib.auth.backends.ModelBackend',\n 'lib.pam_backend.PamBackend',\n)\n\nAUTH_USER_MODEL = 'accounts.User'\n\nLOGIN_URL = '/login'\n\nPAM_SERVICES = {\n 'default': 'login',\n 'csu': 'csu'\... | python | edit | 1 | 0 | mit | 70929aa10fb59ed25c8fc4e76ce60bd6d2934c3f | ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP | rcamp/rcamp/settings/auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='django-easymoney',\n version='0.5',\n author='Alexander Schepanovski',\n author_email='<EMAIL>',\n\n description='An easy MoneyField for Django.',\n long_description=open('REA... | python | edit | 1 | 0 | bsd-2-clause | 7205324a6081a73d2b332afd42e23cd0447e6617 | Suor/django-easymoney | setup.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.