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.contrib import admin\nfrom django.db import models\nfrom django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget\nfrom django_summernote.models import Attachment\nfrom django_summernote.settings import summern... | python | edit | 1 | 2 | mit | 1285e4bcbdbcf3c28eced497c8585892f3ae1239 | lqez/django-summernote,summernote/django-summernote,lqez/django-summernote,lqez/django-summernote,summernote/django-summernote,summernote/django-summernote | django_summernote/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\nimport logging\nimport yaml\nfrom collections import namedtuple\n\nlog = logging.getLogger(__name__)\n\n\ndef load(filename):\n with open(filename) as fp:\n config = yaml.safe_load(fp)\n\n return Cf... | python | edit | 1 | 3 | mit | 619253a51d0b79f170065e6023530937d7111102 | Kotaimen/awscfncli,Kotaimen/awscfncli | awscfncli/config/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n'''\ntest mavlink messages\nDo not forget to precise the baudrate (default 115200)\n'''\n\nimport sys, struct, time, os\nfrom curses import ascii\n\nfrom pymavlink import mavutil\n\nfrom argparse import ArgumentPars... | python | edit | 2 | 1 | mit | 6021f5af785e5234b9f83ea4ac740571b9308ae4 | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Communication/mavtester.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom __future__ import division\nimport requests\nimport json\nimport sys\nfrom requests.exceptions import SSLError, InvalidSchema, ConnectionError\n\ndef get_link_status_code(link):\n headers = {'User-agent':'Mo... | python | edit | 4 | 4 | mit | cba8bd7d3440cc643823e93036bc3b9ac938a412 | edgauthier/pinboard_linkrot | pinboard_linkrot.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom app import create_app, db\nfrom flask.ext.script import Manager, Shell, Server\nfrom flask.ext.migrate import Migrate, MigrateCommand\n\napp = create_app(os.getenv('FLASK_CONFIG') or 'default')\nmanager = Manager(app)\nmanag... | python | edit | 1 | 1 | mit | c4ea39ab8666a2872b25c9b8619f1b0feb823d9f | luisfcofv/Superhero | server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for vumi.persist.riak_manager.\"\"\"\n\nfrom twisted.trial.unittest import TestCase\n\nfrom vumi.persist.riak_manager import RiakManager\n\n\nclass TestRiakManager(TestCase):\n pass\n\n```\n\nApply this change: Add tests for ... | python | edit | 1 | 2 | bsd-3-clause | 3b8811af898ec8cbaa93c69c6b702b92756713dc | vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,TouK/vumi,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi | vumi/persist/tests/test_riak_manager.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport json\nimport sys\nimport time\nfrom urllib.request import urlopen\n\nSTATS_URL = \"http://localhost:18001/stats\"\nMAXIMUM_TIME_SECONDS = 2 * 60\nSLEEPING_INTERVAL_SECONDS = 1\n\nSTATUS_CODE_OK = 200\n\ndef ... | python | edit | 3 | 3 | apache-2.0 | 59651470489a4479db6d9a79de3aacee6b9d7cd8 | codiply/barrio,codiply/barrio | travis/wait-until-cluster-initialised.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\nimport time\nfrom SimpleXMLRPCServer import SimpleXMLRPCServer\n\n\ndef get_time():\n time.sleep(random.random())\n return time.time()\n\ndef get_random_number(low, high):\n time.sleep(random.random())\n return ra... | python | edit | 1 | 1 | mit | c1af56026da9669ff76908e4d89982b1c88fd30d | locustio/locust,mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,locustio/locust,heyman/locust,mbeacom/locust,locustio/locust | examples/custom_xmlrpc_client/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport configparser\nimport sys\nimport os\n\nparser = configparser.ConfigParser()\nparser.read(\"../halite.ini\")\nWORKERS = dict(parser.items(\"workerIPs\"))\n\ncommand = sys.argv[1]\nprint(command)\nfor name in WORKERS:\n print(\"####... | python | edit | 1 | 0 | mit | d81dbd7b25cd44f730e979efe03eb6e5e1d87f1b | HaliteChallenge/Halite,HaliteChallenge/Halite,yangle/HaliteIO,HaliteChallenge/Halite,lanyudhy/Halite-II,lanyudhy/Halite-II,yangle/HaliteIO,yangle/HaliteIO,lanyudhy/Halite-II,yangle/HaliteIO,yangle/HaliteIO,HaliteChallenge/Halite,HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite,lanyudhy/Halite-II,lany... | admin/commandRunner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\n*************************\nPlot classes and tools for use in Orange widgets\n*************************\n\nThe main class of this module is :obj:`.OWPlot`, from which all plots \nin visualization widgets should inherit. \n\nThis mo... | python | edit | 10 | 0 | bsd-2-clause | b80b781b8f446b8149b948a6ec4aeff63fd728ce | cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3 | Orange/widgets/utils/plot/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport dateutil.parser\nimport datetime\nimport humanize\n\nstatus_view =\"\"\"\\\n=== Bashhub Status\nhttp://bashhub.com/u/{0}\nTotal Commands: {1}\nTotal Sessions: {2}\nTotal Systems: {3}\n===\nSession PID {4} Started {5}\nCommands In Se... | python | edit | 3 | 1 | apache-2.0 | 7dcda004fb2cc61b075e7ef67c8c33ebfd70786c | rcaloras/bashhub-client,rcaloras/bashhub-client | bashhub/view/status.py | rejected_duplicate | Near-duplicate of sample 2358 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport math\nfrom django.shortcuts import render\nfrom django.template import RequestContext\nfrom django.http import HttpResponseRedirect\nfrom orders.models import Order\n\ndef index(request, x, y):\n\n if request.META['HTTP_REFERER'] ... | python | edit | 3 | 2 | bsd-3-clause | 7959c38d82090db6a66c7d81a4adba089c9a884f | crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains | brains/orders/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom werkzeug.urls import url_decode\nfrom oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY\n\nimport foauth.providers\n\n\nclass Rdio(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'http://www.rdio.c... | python | edit | 2 | 2 | bsd-3-clause | 530b1b09b7fd6215822283c22c126ce7c18ac9a9 | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | services/rdio.py | rejected_duplicate | Near-duplicate of sample 16750 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport serial\nimport os\n\n# Make and flash the unit test\nFILE_LOCATION = os.path.dirname(os.path.abspath(__file__))\nos.system(\"cd \" + FILE_LOCATION + \" ../\")\nprint os.system(\"make flash_unit_test\")\n\n# ... | python | edit | 3 | 0 | mit | 9a7c84cab0931f2998af990200c4412f23cc2034 | fnivek/Pop-a-Gator,fnivek/Pop-a-Gator,fnivek/Pop-a-Gator | scripts/run_unit_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nGitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',\n\tconfigure = './configure --prefix=\"%{prefix}\" --enable-optimized --enable-targets=\"x86 x86_64\" --target=i386-apple-darwin10.8.0',\n\toverride_pr... | python | edit | 2 | 0 | mit | 81489c115704c5df83ef7607121c8c20ab2ab2b0 | mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild | packages/mono-llvm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport sys\nimport appdirs\n\nif sys.version_info[0] < 3:\n STRING_TYPE = basestring\nelse:\n STRING_TYPE = str\n\n\nclass Test_AppDir(unittest.TestCase):\n def test_metadata(self):\n self.assertTrue(hasattr... | python | edit | 2 | 1 | mit | e2c3c9f50f3bdb537ef863d7cff80d4fd5e27911 | platformdirs/platformdirs | test/test_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Django Tests\n# ..........................\n\nTEST = True\n\nCELERY_ALWAYS_EAGER = True\n\nTEST_EXCLUDE = ('django',)\n\nINSTALLED_APPS += (\n 'geotrek.diving',\n 'geotrek.sensitivity',\n 'geotrek.outdoor',\n)\n\nLOGGING['han... | python | edit | 3 | 1 | bsd-2-clause | 79488513dfedb27a627a1eb516fb2fb2b6a2900c | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | geotrek/settings/env_tests.py | rejected_duplicate | Near-duplicate of sample 15683 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nproject_1_yaml = {\n 'common': {\n 'sources': ['sources/main.cpp'],\n 'includes': ['includes/header1.h'],\n 'target': ['mbed-lpc1768']\n }\n}\n\nprojects_1_yaml = {\n 'projects': {\n 'project_1' : ['test... | python | edit | 1 | 0 | apache-2.0 | 456de4b1184780b9179ee9e6572a3f62cf22550a | molejar/project_generator,hwfwgrp/project_generator,0xc0170/project_generator,sarahmarshy/project_generator,ohagendorf/project_generator,project-generator/project_generator | tests/test_tools/simple_project.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gevent.server import StreamServer\n\n__all__ = ['FlashPolicyServer']\n\n\nclass FlashPolicyServer(StreamServer):\n policy = \"\"\"<?xml version=\"1.0\"?><!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross... | python | edit | 2 | 3 | bsd-3-clause | 47aeeaad68ea0c9246ec68b7a49f385a4b7fe9cf | abourget/gevent-socketio,arnuschky/gevent-socketio,bobvandevijver/gevent-socketio,Eugeny/gevent-socketio,hzruandd/gevent-socketio,gutomaia/gevent-socketio,gutomaia/gevent-socketio,yacneyac/gevent-socketio,smurfix/gevent-socketio,gutomaia/gevent-socketio,smurfix/gevent-socketio,Eugeny/gevent-socketio,kazmiruk/gevent-soc... | socketio/policyserver.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__\n#use_ssl = False\n#insecure = False\... | python | edit | 1 | 0 | apache-2.0 | 534066b1228bb0070c1d62445155afa696a37921 | Juniper/contrail-provisioning,Juniper/contrail-provisioning | contrail_provisioning/config/templates/contrail_plugin_ini.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 | 4 | mit | c306f6963e53b971674421eddca7f6b5c913281e | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | core/data/DataWriter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport math\n\ndef f1(x):\n \"\"\"\n Test function 1\n \"\"\"\n return x*x*x - math.pi*x + math.e/100\n\n```\n\nApply this change: Use numpy instead of math to allow vectorization"
},
{
"role": "assistant",
"content"... | python | edit | 1 | 1 | bsd-3-clause | 60a90722fbd5fc047fee5e9f7377f03e11f6a654 | robclewley/fovea,akuefler/fovea | examples/root_finding/test_funcs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\n\nclass Driver:\n '''\n Holds the driver state so the flasked script can change behaviour based\n on what the user injects via HTTP\n '''\n name = 'nobody'\n\n def start(self, name):\n ... | python | edit | 1 | 1 | mit | bfe884723d06252648cb95fdfc0f9dd0f804795f | ustwo/mastermind,ustwo/mastermind | proxyswitch/driver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import namedtuple\n\n\nTAG_DIMAGI_ONLY = 'Dimagi Only'\n\n\nMobileFlag = namedtuple('MobileFlag', 'slug label tags')\n\n\nSUPERUSER = MobileFlag(\n 'superuser',\n 'Enable superuser-only features',\n tags=(TAG_DIMAG... | python | edit | 1 | 0 | bsd-3-clause | cd030a1ed2c3c7f0bf7d9a5d86f9cc81f802fcba | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq | corehq/mobile_flags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\n# Fixes and mod-specific data for various mods' mcmod.info files\n\nDEP_BLACKLIST = set((\n \"mod_MinecraftForge\", # we always have Forge\n \"Forge\", # typo for mod_MinecraftForge\n \"Industrialcraft\", # t... | python | edit | 1 | 3 | bsd-3-clause | 22b5f7ecc6057252ec77d037522b5783c5f86c1f | agaricusb/ModAnalyzer,agaricusb/ModAnalyzer | mcmodfixes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\n\nfrom ..utils import load_plugins, invoke_plugins\nfrom .base import ProviderError\n\nplugins, broken_plugins = load_plugins('providers', ['thetvdb', 'tvrage'])\n\n@asyncio.coroutine\ndef start(manager):\n \"\"\"\n Ca... | python | edit | 4 | 2 | mit | fd054790ce32c3918f6edbe824540c09d7efce59 | jtackaberry/stagehand,jtackaberry/stagehand | stagehand/providers/__init__.py | rejected_lint | Too many lint violations: 4 | 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_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'\n_select_uncommon = 'select value from uncommons wher... | python | edit | 1 | 7 | unlicense | 54bb12bdeec33e98451451837dce90665413bd67 | rotated8/mgsv_names | mgsv_names.py | rejected_duplicate | Near-duplicate of sample 3316 | true |
[
{
"role": "user",
"content": "Write python code for the following: Increase version to 0.9.2 for release"
},
{
"role": "assistant",
"content": "__version__ = '0.9.2'\n\nfrom dicomweb_client.api import DICOMwebClient\n"
}
] | python | new_file | 3 | 0 | mit | eca27464cc2c23a84e56e1d432a080ca663d04fb | MGHComputationalPathology/dicomweb-client | src/dicomweb_client/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n# https://faq.i3wm.org/question/3699/how-can-i-open-an-application-when-i-open-a-certain-workspace-for-the-first-time/\n\nfrom argparse import ArgumentParser\nimport i3ipc\n\ni3 = i3ipc.Connection()\n\nparser = Arg... | python | edit | 1 | 3 | bsd-3-clause | 593bab981f36f7af52ae55914c18e368e8c1a94f | xenomachina/i3ipc-python,nicoe/i3ipc-python,acrisci/i3ipc-python,chrsclmn/i3ipc-python | examples/app-on-ws-init.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.forms.widgets import Input\n\nclass SubmitButtonWidget(Input):\n \"\"\"\n A widget that handles a submit button.\n \"\"\"\n input_type = 'submit'\n\n def render(self, name, value, attrs=N... | python | edit | 1 | 1 | mit | 5eb3f2c61c2b61e1bad7faa006e5503bd9a20edf | HungryCloud/django-crispy-forms,spectras/django-crispy-forms,iris-edu-int/django-crispy-forms,scuml/django-crispy-forms,ngenovictor/django-crispy-forms,CashStar/django-uni-form,PetrDlouhy/django-crispy-forms,RamezIssac/django-crispy-forms,jcomeauictx/django-crispy-forms,tarunlnmiit/django-crispy-forms,CashStar/django-u... | uni_form/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright (c) 2012 Cloudera, Inc. All rights reserved.\n# Targeted tests for decimal type.\n#\nimport logging\nimport pytest\nfrom copy import copy\nfrom tests.common.test_vector import *\nfrom tests.common.impala_t... | python | edit | 8 | 3 | apache-2.0 | bd1719885b1328c5aca34bc8d78b761e846f4037 | cchanning/Impala,XiaominZhang/Impala,tempbottle/Impala,cgvarela/Impala,kapilrastogi/Impala,grundprinzip/Impala,scalingdata/Impala,bratatidas9/Impala-1,mapr/impala,ImpalaToGo/ImpalaToGo,cchanning/Impala,lnliuxing/Impala,gerashegalov/Impala,theyaa/Impala,lirui-intel/Impala,bowlofstew/Impala,ImpalaToGo/ImpalaToGo,gerasheg... | tests/query_test/test_decimal_queries.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.text import capfirst\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom feincms.module.page.extensions.navigation import NavigationExtension, PagePretender\n\n\nclass ZivinetzNavigationExtension(NavigationExt... | python | edit | 1 | 4 | mit | 5977eb82f2614efe8cde843913db62a93c7978f5 | matthiask/zivinetz,matthiask/zivinetz,matthiask/zivinetz,matthiask/zivinetz | navigation_extensions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom locust import HttpLocust, TaskSet, task, events, between\n\nfrom gevent.lock import Semaphore\n\nall_locusts_spawned = Semaphore()\nall_locusts_spawned.acquire()\n\ndef on_hatch_complete(**kw):\n all_locusts_spawned.release()\n\neve... | python | edit | 1 | 1 | mit | 23f23884cb55899a77b08dfa8c1649a195815f8c | locustio/locust,locustio/locust,locustio/locust,mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,mbeacom/locust | examples/semaphore_wait.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import generics, permissions, status\nfrom rest_framework.response import Response\nfrom social_django.utils import load_backend, load_strategy\n\nfrom djoser.conf import settings\nfrom djoser.social.serializers import P... | python | edit | 1 | 2 | mit | fdee90e6fd4669222c2da0530d9bc90131b5145e | sunscrapers/djoser,sunscrapers/djoser,sunscrapers/djoser | djoser/social/views.py | rejected_duplicate | Near-duplicate of sample 4892 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nVersion control management tools.\n\n\"\"\"\n\nimport abc\nimport brigit\nfrom docutils import nodes\nfrom docutils.parsers.rst import directives\n\nfrom .tool import Tool, Directive\n\n\nclass VCS(Tool):\n \"\"\"Abstract class f... | python | edit | 1 | 2 | bsd-3-clause | 745565adaff36e95676c427157acb52112e0a3cc | Kozea/sitenco | sitenco/config/vcs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport appdirs\n\nclass Test_AppDir(unittest.TestCase):\n def test_metadata(self):\n self.assertTrue(hasattr(appdirs, \"__version__\"))\n self.assertTrue(hasattr(appdirs, \"__version_info__\"))\n\n def t... | python | edit | 1 | 1 | mit | 51757c8a893640e2a9fa3a7b9f8e617b22e6db87 | platformdirs/platformdirs | test/test_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import timedelta\nfrom pathlib import Path\n\n\nDEBUG = True\nPERMANENT_SESSION_LIFETIME = timedelta(14)\nSECRET_KEY = b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00... | python | edit | 1 | 0 | bsd-3-clause | b5047a36ffec7515986e92346a17657247319e6e | homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps | webapp/config/env/development_admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport xyz\nimport os\nimport shutil\n\nclass Binutils(xyz.BuildProtocol):\n pkg_name = 'binutils'\n supported_targets = ['arm-none-eabi']\n\n def check(self, builder):\n if builder.target not in self.supported_targets:\n ... | python | edit | 1 | 2 | mit | 37c33a4a133326cce7083ea68607971344f0e6ed | BreakawayConsulting/xyz | rules/binutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Domain models fields.\"\"\"\n\n\nclass Field(property):\n \"\"\"Base field.\"\"\"\n\n def __init__(self):\n \"\"\"Initializer.\"\"\"\n self.name = None\n self.value = None\n self.model = None\n ... | python | edit | 1 | 1 | bsd-3-clause | 676c2a67877c32ad8845f374955ac07fdfbab561 | ets-labs/domain_models,rmk135/domain_models,ets-labs/python-domain-models | domain_models/fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django import forms\nfrom django.contrib.contenttypes.admin import GenericStackedInline\n\nfrom .forms import object_version_choices\nfrom .models import PublishAction\n\n\nclass ActionInline(... | python | edit | 1 | 1 | bsd-3-clause | bb4a67d2817ccca3b15e09db1d72823626bd2ed6 | developersociety/django-glitter,blancltd/django-glitter,blancltd/django-glitter,developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter | glitter/publisher/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass MessageModel:\n def __init__(self, message, duration, creation_date, message_category):\n # We will automatically generate the new id\n self.id = 0\n self.message = message\n self.duration = duration\n ... | python | edit | 1 | 1 | mit | 86f8ccedae6bf671a88aa342cf993bab55057406 | candidate48661/BEA | api/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.sites.models import Site\n\n\ndef set_site_info(domain='datahub-local.mit.edu', name='MIT DataHub'):\n site = Site.objects.get_current()\n if site.domain != domain:\n site.domain = domain\n site.name ... | python | edit | 1 | 3 | mit | 5490939f5b94b15c154e027abcd295f14ac17a45 | datahuborg/datahub,datahuborg/datahub,anantb/datahub,RogerTangos/datahub-stub,anantb/datahub,RogerTangos/datahub-stub,datahuborg/datahub,anantb/datahub,RogerTangos/datahub-stub,RogerTangos/datahub-stub,RogerTangos/datahub-stub,datahuborg/datahub,datahuborg/datahub,anantb/datahub,anantb/datahub,RogerTangos/datahub-stub,... | src/config/site_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# from the __future__ package, import division\n# to allow float division\n\nfrom __future__ import division\n\ndef estimate_probs(trigram_counts_dict):\n '''\n # Estimates probabilities of trigrams using\n # trigram_counts_dict an... | python | edit | 2 | 3 | unlicense | 8c704a01aa935f8fea1cb88683853dffa0ee5464 | jvasilakes/language_detector,jvasilakes/language_detector | src/estimate_probs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import request, jsonify, session, g\nimport numpy as np\nfrom DatasetCreation import ConstructDataset\n\nfrom . import app\nfrom . import firebase\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn import prepro... | python | edit | 1 | 2 | mit | 1b3ec35857a8eff88b8984c83564e18a25ff081e | MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction | app/routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.views.generic.base import TemplateView\nadmin.autodiscover()\n\nurlpatterns = [\n url(r'^accounts/', include('allauth.urls')),\n url(r'^$', Templ... | python | edit | 1 | 0 | mit | 537655c2c60522d5776fbd9c35cead4dc766806b | AltSchool/django-allauth,rsalmaso/django-allauth,pennersr/django-allauth,pztrick/django-allauth,bittner/django-allauth,AltSchool/django-allauth,pztrick/django-allauth,pennersr/django-allauth,rsalmaso/django-allauth,rsalmaso/django-allauth,lukeburden/django-allauth,pennersr/django-allauth,lukeburden/django-allauth,pztri... | example/example/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Example for spinner that looks like loader\n\"\"\"\nfrom __future__ import unicode_literals, absolute_import, print_function\nimport os\nimport time\nimport random\n\nos.sys.path.append(os.path.dirname(os.path... | python | edit | 1 | 0 | mit | af14c06b0a8443f28d92c6eee884d125b2504b00 | manrajgrover/halo,ManrajGrover/halo | examples/loader_spin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom contextlib import contextmanager\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\nfrom sqlalchemy.exc import SQLAlchemyError\nfrom rtrss.exceptions import OperationInterruptedException\nfr... | python | edit | 1 | 4 | apache-2.0 | 53239498023a2ebe6d25a99d09430046b3b40e83 | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | rtrss/database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# vim: set ts=4 sw=4 et sts=4 ai:\n#\n# Test some basic functionality.\n#\n\nimport unittest\nimport os\nimport sys\nsys.path.append('..')\n\n\nclass TestQBasic(unittest.TestCase):\n\n def setUp(self):\n if ... | python | edit | 1 | 2 | apache-2.0 | 7fdea303be0c3f182d0e99719c89975294112975 | zestyping/q | test/test_basic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\n\nENGINE_BIN = \"stockfish\"\nDEPTH = 20\n\ndef evaluate_position(board, depth=DEPTH):\n \"\"\"Evaluates the board's current position.\n\n Returns the Stockfish scalar score, at the given depth, in centipawns.\n ... | python | edit | 1 | 6 | mit | 181ac9d91d826b1c1a71ec14ff8f500cb79261d2 | Bojanovski/ChessANN | Code/Evaluator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n'''\n@author: Tsuyoshi Hombashi\n'''\n\n\nclass MinMaxContainer(object):\n\n @property\n def min_value(self):\n return self.__min_value\n\n @property\n def max_value(self):\n return self.__max_... | python | edit | 1 | 4 | mit | 7fc4a8d2a12100bae9b2ddb5c0b08fbfd94091f2 | thombashi/DataProperty | dataproperty/_container.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom rsvp.models import Guest, Location, Table, Event, Hotel, Party, Song\n\nclass AdminModel(admin.ModelAdmin):\n\tlist_display = ['name']\n\nclass GuestAdmin(admin.ModelAdmin):\n\tlist_display = ['last_na... | python | edit | 1 | 0 | mit | 2ee34d2d74a8fb41dfe49cd3933d0d7abb25fee4 | gboone/wedding.harmsboone.org,gboone/wedding.harmsboone.org | rsvp/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Dec 20, 2011\n\n@author: Tyranic-Moron\n\"\"\"\n\nfrom IRCMessage import IRCMessage\nfrom IRCResponse import IRCResponse, ResponseType\nfrom CommandInterface import CommandInterface\nimport Global... | python | edit | 4 | 4 | mit | cda417454578cb8efe315850b06b047239c7796d | MatthewCox/PyMoronBot,DesertBot/DesertBot | Commands/Leave.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\n# Copyright (c) 2011 Google Inc. 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\"\"\"\nSmoke-tests 'settings' blocks.\n\"\"\"\n\nimpo... | python | edit | 1 | 0 | bsd-3-clause | bca736ac15b06263c88d0265339b93b8c2b20d79 | witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp | test/settings/gyptest-settings.py | rejected_duplicate | Near-duplicate of sample 403 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom textblob import TextBlob\n\n\nclass SentimentAnalysis(object):\n \"\"\"Get sentiment analysis with only positive and negative considered.\n\n Positive means normal logs and negative sentiment refers to possible attacks.\n This... | python | edit | 1 | 4 | mit | f3c7504cf3c7982e295883ccf5448e19c1ba2814 | studiawan/pygraphc | pygraphc/anomaly/SentimentAnalysis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSaves every file to have new save() logic index those files.\n\"\"\"\nimport sys\nimport logging\n\nfrom website.app import init_app\nfrom website.files.models.osfstorage import OsfStorageFile\n\nlogger = logging.getLogger(__name__)... | python | edit | 1 | 4 | apache-2.0 | faf067ec4f5189a7a0b12fc78b62373a8f997ac8 | billyhunt/osf.io,brianjgeiger/osf.io,zachjanicki/osf.io,brandonPurvis/osf.io,haoyuchen1992/osf.io,abought/osf.io,caseyrygt/osf.io,crcresearch/osf.io,mluo613/osf.io,caneruguz/osf.io,zamattiac/osf.io,danielneis/osf.io,leb2dg/osf.io,kwierman/osf.io,SSJohns/osf.io,aaxelb/osf.io,haoyuchen1992/osf.io,HalcyonChimera/osf.io,am... | scripts/migration/migrate_index_for_existing_files.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Tests\n\nimport os\n\nfrom tests.base import BaseTestZSTD\n\nclass TestZSTD(BaseTestZSTD):\n\n def setUp(self):\n if os.getenv(\"ZSTD_EXTERNAL\"):\n self.ZSTD_EXTERNAL = True\n self.VERSION = os.getenv(\"VERSIO... | python | edit | 2 | 4 | bsd-2-clause | 314c6bf4159d4a84e76635a441fb62dba0122b2f | sergey-dryabzhinsky/python-zstd,sergey-dryabzhinsky/python-zstd | tests/test_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import AnnexBase\n\n__all__ = ('Annex',)\n\n# -----------------------------------------------------------------------------\n\n\ndef get_annex_class(storage):\n if storage == 'file':\n from .file import FileAnnex\n ... | python | edit | 1 | 2 | mit | e5ed3e877e24d943096fa5e48c1f8c9bc30c3160 | 4Catalyzer/flask-annex,taion/flask-annex | flask_annex/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for feedback submission view.\n\nhttps://trello.com/c/Uak7y047/8-feedback-forms"
},
{
"role": "assistant",
"content": "import mock\nfrom ...helpers import BaseApplicationTest\n\n\nclass TestFeedbackForm(BaseApplicationT... | python | new_file | 1 | 1 | mit | df4a437142be6dff08c7039c1b586391c922f70e | alphagov/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend | tests/main/views/test_feedback.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.gis.forms import widgets\n\nclass LeafletPointWidget(widgets.BaseGeometryWidget):\n template_name = 'leaflet/leaflet.html'\n\n class Media:\n css = {\n 'all': ('http://cdn.leafletjs.com/leaflet/v0... | python | edit | 1 | 2 | bsd-3-clause | 8136a0badc5c3eebb4e7772c1ff9a950f82e04fe | EMSTrack/WebServerAndClient,EMSTrack/WebServerAndClient,EMSTrack/WebServerAndClient | emstrack/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'tom'\nfrom setuptools import setup\n\n# Makes use of the sphinx and sphinx-pypi-upload packages. To build for local development\n# use 'python setup.py develop'. To upload a version to pypi use 'python setup.py clean sdist upl... | python | edit | 1 | 0 | apache-2.0 | 0527cea9db518b5b8fb63fe2bb3792a806fa421d | ApproxEng/approxeng.input | src/python/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom trac.db import Table, Column, Index, DatabaseManager\r\nfrom trac.core import TracError\r\nfrom trac.versioncontrol.cache import CACHE_YOUNGEST_REV\r\n\r\ndef do_upgrade(env, ver, cursor):\r\n \"\"\"Modify the repository cache schem... | python | edit | 6 | 3 | bsd-3-clause | 02ca3946662fd996f77c30d9e61d8fc8d9243de7 | exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,dokipen/trac,dafrito/trac-mirror,dafrito/trac-mirror,moreati/trac-gitsvn,dafrito/trac-mirror,dafrito/trac-mirror,exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,moreati/trac-gitsvn | trac/upgrades/db20.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for respite.middleware.\"\"\"\n\nfrom nose.tools import *\n\nfrom urllib import urlencode\n\nfrom django.utils import simplejson as json\nfrom django.test.client import Client, RequestFactory\n\nfrom respite.middleware import *\... | python | edit | 10 | 1 | mit | a2c69058316971cd753edba607160d62df337b77 | jgorset/django-respite,jgorset/django-respite,jgorset/django-respite | tests/test_middleware.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nimport datetime\nfrom ._base import db\n\n\nclass User(db.Model):\n id = db.Column(db.Integer, primary_key=True)\n name = db.Column(db.String(50), unique=True)\n email = db.Column(db.String(50))\n avatar = db.Co... | python | edit | 1 | 1 | mit | 3bc8a7208865bac6364ce65410dd828e576c30c1 | 1045347128/Flask-Boost,1045347128/Flask-Boost,hustlzp/Flask-Boost,1045347128/Flask-Boost,hustlzp/Flask-Boost,hustlzp/Flask-Boost,1045347128/Flask-Boost,hustlzp/Flask-Boost | flask_boost/project/application/models/user.py | rejected_duplicate | Near-duplicate of sample 16189 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom slot import basic_auth\nfrom flask_login import login_required\n\nfrom slot.main import app\nfrom slot import controller as con\n\n\n@app.route('/')\n@app.route('/dashboard')\n@login_required\ndef dashboard():\n return con.dashboard... | python | edit | 1 | 1 | mit | e0e1b41c93fdb0c148638f6c2f33e3d47c3ec17b | nhshd-slot/SLOT,nhshd-slot/SLOT,nhshd-slot/SLOT | slot/routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nfrom jupyter_core.paths import jupyter_data_dir\nimport subprocess\nimport os\nimport errno\nimport stat\n\nc = get_config()\nc.Noteboo... | python | edit | 2 | 0 | apache-2.0 | 1c3ff4552b82183263ead0aefe47b867a7b2022e | LamDang/docker-datascience,LamDang/docker-datascience | 10_anaconda/jupyter_notebook_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\n\nfrom opps.core.models import Post\n\n\n\nclass PostAdmin(admin.ModelAdmin):\n prepopulated_fields = {\"slug\": (\"title\",)}\n\n def save_model(self, request, obj, form, cha... | python | edit | 1 | 2 | mit | d30c3b9c574566d9c69fc1322b6a2dfec3a6eb67 | YACOWS/opps,YACOWS/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,williamroot/opps,opps/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,williamroot/opps | opps/core/admin/article.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef dummy_no_impl(*args, **kwargs):\n raise NotImplementedError(\"You may need to install another package (numpy, \"\n \"weave, or numba) to access a working implementation.\")\n\nfrom .aggregate_purepy impor... | python | edit | 14 | 1 | bsd-2-clause | 93913720a88c601db6d0094f346bbdeb7b45ed34 | ml31415/numpy-groupies | numpy_groupies/__init__.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import Column, Integer, String, BigInteger, ForeignKey\nfrom sqlalchemy.orm import relationship\n\nfrom uchan.database import ModelBase\n\n\nclass Post(ModelBase):\n __tablename__ = 'post'\n\n id = Column(Integer(), pr... | python | edit | 1 | 0 | mit | bb007f6a2c0563d9fb908fae98b0e950af936810 | Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan | uchan/lib/models/post.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# usr/bin/env python3\n# svgTest.py - Test Slither's SVG support\n\nimport slither\n\nif slither.svgSupport:\n print(\"We have SVG support!\")\nelse:\n print(\"No SVGs today :(\")\n\nsvg = slither.Sprite()\nsvg.addCostume(\"assets/svg... | python | edit | 1 | 1 | mit | 428a6cf3b0af58ba6b3a9514161db2a1151864b0 | PySlither/Slither,PySlither/Slither | slither/tests/svgTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport unittest\nfrom unittest import TestSuite\n\n\ndef suite(test_name):\n suite = unittest.TestSuite()\n suite.addTest(unittest.defaultTestLoader.loadTestsFromName(test_name))\n return suite\n\n\nif __name__ == \"__m... | python | edit | 3 | 1 | mit | 20f4a6ee8421a9827ff04f0fc3b065377775b860 | JakubPetriska/poker-cfr,JakubPetriska/poker-cfr | test/single_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\ntry:\n import simplejson as json\nexcept ImportError:\n import json\n\nfrom wsme.tests.protocol import WSTestRoot\nimport wsme.tests.test_restjson\nimport wsme.spore\n\n\nclass TestSpore(unittest.TestCase):\n def... | python | edit | 1 | 1 | mit | db45239e050e6699a2c49fe4156b100c42481c9f | stackforge/wsme | wsme/tests/test_spore.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\n\nfrom competencies.models import *\nimport testing_utilities as tu\n\nclass TestForkSchools(TestCase):\n\n def setUp(self):\n # Create a school.\n self.school_0 = tu.create_school(name=\"S... | python | edit | 3 | 4 | mit | 13f8d069f63b9bb22a268a27daae1434587807fc | openlearningtools/opencompetencies,openlearningtools/opencompetencies | competencies/tests/test_fork_schools.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis script refreshes production varsnap snaps\n\"\"\"\n\nimport os\n\nfrom syspath import git_root # NOQA\n\nfrom app import serve\n\n\nos.environ['ENV'] = 'production'\napp = serve.app.test_client()\napp.get('/')\napp.get('/healt... | python | edit | 1 | 0 | mit | 10e26b52f94bb1a6345d2c1540a0a09a82b7831c | albertyw/base-flask,albertyw/base-flask,albertyw/base-flask,albertyw/base-flask | baseflask/refresh_varsnap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom os.path import dirname, join\nimport uuid\n\nimport qiniu.conf\nimport qiniu.io\nimport qiniu.rs\nimport qiniu.rsf\n\n\nQINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY')\nQINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_K... | python | edit | 2 | 2 | mit | 77e237ce2d95e28c9b4ac7b5716131b3da268aec | jeffrey4l/django-qiniu-storage,jackeyGao/django-qiniu-storage,Mark-Shine/django-qiniu-storage,glasslion/django-qiniu-storage | tests/test_qiniu.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport time\n\nimport rethinkdb as r\nimport requests\n\nfrom krunchr.vendors.celery import celery, db\n\n\n@celery.task(bind=True)\ndef get_file(self, url, path):\n name, ext = os.path.splitext(url)\n name = str(int(time.time(... | python | edit | 2 | 1 | apache-2.0 | eb47f234b865fb3ffc0d91c44ba114a73423595e | vtemian/kruncher | analyser/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\nfrom badwolf.utils import sanitize_sensitive_data\n\n\ndef test_sanitize_basic_auth_urls():\n text = 'abc http://user:pwd@example.com def'\n sanitized ... | python | edit | 1 | 1 | mit | 18808b6594d7e2b1c81a2cf4351708e179fb29bb | bosondata/badwolf,bosondata/badwolf,bosondata/badwolf | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make some changes to the bci package file."
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport platform\nimport shutil\nimport inspect\n\n#\n#def machine():\n# \"\"\"Return type of machine.\"\"\"\n# if os.n... | python | new_file | 2 | 4 | bsd-3-clause | 79fb90779e5d85978cdb7dbb36f51baa96190f77 | NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock | bci/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ndef render_template(template_name, **kwargs):\n from jinja2 import Environment, FileSystemLoader\n\n env = Environment(loader=FileSystemLoader('templates'))\n tmpl = env.get_template(template_name)\n\n return tmpl.r... | python | edit | 3 | 2 | mit | 0c91b7546dcf770c5c1f90bb41ad2de1998a62bb | akheron/stango | lib/stango/shortcuts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess, io, shlex, os\nimport pandas as pd\n\ndef read_pdf_table(input_path, options=\"\"):\n jar_path = os.path.abspath(os.path.dirname(__file__))\n JAR_NAME = \"tabula-0.9.1-jar-with-dependencies.jar\"\n args = [\"java\", \"... | python | edit | 1 | 2 | mit | 9f6b12b2579f228fd9d04151771a22474a2744a3 | chezou/tabula-py | tabula/wrapper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\n\nfrom linked_accounts.handlers import AuthHandler\n\nfrom oauth_flow.handlers import OAuth20Token\n\n\nclass LinkedAccountsBackend(object):\n\n supports_object_permissions = False\n suppor... | python | edit | 2 | 3 | mit | 55c16e409d2919d0a32f7fce24c01059576ce867 | zen4ever/django-linked-accounts,zen4ever/django-linked-accounts | linked_accounts/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ui\n\n\ndef get_path_image(path):\n \"\"\" Get an image of a path \"\"\"\n bounds = path.bounds\n with ui.ImageContext(bounds.max_x, bounds.max_y) as ctx:\n path.fill()\n return ctx.get_image()\n\n\ndef copy_pa... | python | edit | 1 | 2 | mit | caddef7500241135965e6d91ca94a38224bfd0cd | controversial/ui2 | ui2/path_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime\nimport sublime_plugin\nimport json\n\ns = sublime.load_settings(\"Pretty JSON.sublime-settings\")\n\n\nclass PrettyjsonCommand(sublime_plugin.TextCommand):\n \"\"\" Pretty Print JSON\n \"\"\"\n def run(self, edit):\... | python | edit | 4 | 5 | mit | e3604b5f0cdae3889cfe7531f7a5b9d1c09f56bd | dzhibas/SublimePrettyJson | PrettyJson.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport logging\nimport timeit\n\nimport cv2\n\nfrom util import Action\nfrom game import GameEnvironment\n\n\ndef main(args):\n if args.debug_frames:\n cv2.namedWindow('debug-frames')\n\n prev_score = 0\n ga... | python | edit | 3 | 5 | mit | fb67b85938d15cbb503bc0a0b0fde3bfb3436137 | matthiasplappert/pibot | src/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# tests.__init__\n\nimport os\nimport os.path\nimport shutil\nimport tempfile\n\nimport yvs.shared as yvs\nfrom mock import patch\n\n\ntemp_dir = tempfile.gettempdir()\nlocal_data_dir_patcher = patch(\n 'yvs.shared.LOCAL_DATA_DIR_PATH',\... | python | edit | 1 | 3 | mit | cdb7dfd529f4078ab5995e38a8ae2f3b61c3fe98 | caleb531/youversion-suggest,caleb531/youversion-suggest | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime, sublime_plugin\n\nclass SumCommand(sublime_plugin.TextCommand):\n def run(self, edit):\n sum_view = self.view.window().new_file()\n sum_view.set_name('Sum')\n\n file_text = self.view.substr(sublime.Re... | python | edit | 1 | 4 | mit | cf336ac17ba194066517ab93ea7079415adba0c2 | jbrudvik/sublime-sum,jbrudvik/sublime-sum | sum.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 30 20:22:29 2013\n\n@author: chris\n\nTest script for the pytnt project\n\"\"\"\n\nimport unittest\n\nfrom numpy.testing import assert_allclose\n\nfrom processTNT import TNTfile\n\n\nclass... | python | edit | 5 | 1 | bsd-3-clause | f256fc04361dc1a0e57c2a17d2216eadee03f987 | chatcannon/pytnt,chatcannon/pytnt | test_pytnt.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nimport ckan.model as model\nimport ckan.plugins as p\n\ndef get_site_url(config):\n return config.get('ckan.site_url_internally') or config['ckan.site_url']\n\ndef get_user_and_context(site_url):\n user = p.toolkit.get_... | python | edit | 1 | 2 | mit | 773f78ae283a062818394743dea4535456ac9aeb | ckan/ckanext-qa,ckan/ckanext-qa,ckan/ckanext-qa | ckanext/qa/lib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"R markdown notebook format for Jupyter\n\nUse this module to read or write Jupyter notebooks as Rmd documents (methods 'read', 'reads', 'write', 'writes')\n\nUse the 'pre_save_hook' method (see its documentation) to automatically dump... | python | edit | 12 | 0 | mit | 4ab06b1a8298656af5d0eee6587ff4ab63282901 | mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext | nbrmd/__init__.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport json\nfrom random import randrange, seed, sample\n\nMAX_LEN = 50\n\n\ndef shift(s, new):\n space = s.find(' ')\n if space == -1:\n raise Exception('bad shift string ' + s)\n return s[space+1:] + ' ' + new\n... | python | edit | 2 | 3 | mit | 89762635e5772376e191825aeb6f6b8d6f530792 | oychang/Markovsecrets,oychang/Markovsecrets | markovsecrets/process/get_secret.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# The source code is compiled into a Roblox Model right into the plugins folder.\n#\n# Simply run `python build.py` and everything will be taken care of. You can\n# then load up any game and test out the plugin.\n\nimport os\nimport os.path... | python | edit | 1 | 0 | mit | 85ca1534dc5d1f9b45cfec27d247f0932b2d7c52 | vocksel/studio-bridge-cli | plugin/build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import getenv\nimport sqlite3\nimport win32crypt\n\nappdata = getenv(\"APPDATA\") \nconnection = sqlite3.connect(appdata + \"\\..\\Local\\Google\\Chrome\\User Data\\Default\\Login Data\")\ncursor = connection.cursor()\ncursor.execut... | python | edit | 3 | 0 | mit | 4f6ab3cf6effd2a7e05c56535c426f33e689f627 | hassaanaliw/chromepass | chromepass.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport os\nfrom kokki import *\n\nPackage(\"erlang\")\n# ubuntu's erlang is a bit messed up.. remove the man link\nFile(\"/usr/lib/erlang/man\",\n action = \"delete\")\n\n# Package(\"mercurial\",\n# provider = \"kokki.providers.pac... | python | edit | 10 | 0 | bsd-3-clause | 66ed7a95dff156ff8083ea9f0651a8b1d436c25e | samuel/kokki | kokki/cookbooks/busket/recipes/default.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass ValidationError(Exception):\n pass\n\n\nclass EmptyField(ValidationError):\n def __init__(self, field_name):\n self.field_name = field_name\n\n def __str__(self) -> str:\n return '{} field cannot be empty'.forma... | python | edit | 1 | 1 | mit | fd85d735e1b4fafba470c91846faa23393cc26f7 | lamenezes/simple-model | simple_model/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# vim: set fileencoding=UTF-8 :\n\n\nfrom __future__ import print_function\n\n\nADD_OP = '+'\nMULTIPLY_OP = '*'\n\nOPERATORS = [ADD_OP, MULTIPLY_OP]\n\n\n_cache_map = dict()\n\n\ndef cached(f):\n def decorated(*arg... | python | edit | 1 | 5 | mit | f2dc9b260e6ca1fcf46b9f23fad5478ab7ff28f8 | admk/soap | ce/expr/common.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nfrom clean_tweet import TweetClassifier as TC\nfrom gather_data import GatherData\n\n\ndef run_test(val, expected):\n print \"{0} (exp {1}) >> {2}\".format(t.predict(val), expected, val)\n\n# Start by gathering some data\n... | python | edit | 8 | 1 | mit | 21df4ca35588993b00e610523f264be51e631b77 | will-hart/twitter_sentiment,will-hart/twitter_sentiment | classifier/run.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) Ecometrica. All rights reserved.\n# Distributed under the BSD license. See LICENSE for details.\nfrom collections import namedtuple\nfrom decorator import decorator\nfrom functools import wraps\n\nfrom django.db.models impor... | python | edit | 4 | 3 | bsd-3-clause | ad1b7cb8dda0dc2565aab6cd8c6a392753682875 | ecometrica/django-wapiti | wapiti/helpers.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Created By: Andrew Ryan DeFilippis\"\"\"\n\nprint('Lambda cold-start...')\n\nfrom json import dumps, loads\n\n\ndef lambda_handler(event, context):\n print('LOG RequestId: {}\\tResponse:\\n\\n{}'.format(\n context.aws_reques... | python | edit | 1 | 2 | apache-2.0 | b2b1443753894ccb4835b8667b63d95ee7a1303f | andrewdefilippis/aws-lambda | Functions/echo-python/lambda_function.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Just barely tests things to make sure they work\n\nfrom uwaterlooapi import UWaterlooAPI; api = UWaterlooAPI(api_key='fda8e642f9c9480800e8c02896744288')\n\nexclude = ['api_key', 'base_url']\n\nfor attr in dir(api):\n if attr.startswith... | python | edit | 1 | 0 | mit | cca6a727063c63d78d61ee81c892811238139462 | albertoconnor/uwaterlooapi | lame_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.conf import settings\nfrom django.template.loader import render_to_string\n\n\nclass MultipleUpload(forms.FileInput):\n\n def render(self, name, value, attrs=None):\n _value = \"\"\n if... | python | edit | 1 | 2 | mit | d309fba3d07b3122bdb05d511968b53f1c59b357 | williamroot/opps,opps/opps,jeanmask/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,opps/opps,opps/opps,williamroot/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,YACOWS/opps | opps/images/widgets.py | rejected_duplicate | Near-duplicate of sample 15417 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nlog = logging.getLogger(__name__)\n\nfrom pyramid.config import Configurator\nfrom sqlalchemy import engine_from_config\n\nfrom .models import DBSession\n\nrequired_settings = [\n 'pyramid.secret.session',\n 'p... | python | edit | 1 | 4 | isc | 44e8f8db3e39d083de74e4534403e327cb5d389a | cdunklau/alexandria,cdunklau/alexandria,bertjwregeer/alexandria,cdunklau/alexandria,bertjwregeer/alexandria | alexandria/__init__.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.