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 __future__ import unicode_literals\n\nimport base32_crockford\nimport logging\n\nfrom django.db.models import F\nfrom django.http import Http404\nfrom django.http import HttpResponsePermanentRedirect\nfrom django.shortcuts import get_o... | python | edit | 1 | 2 | bsd-3-clause | e7ee29f03dd83a795828de92aba654e9a7db3dd4 | jbittel/django-deflect | deflect/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\nimport sphinx_rtd_theme\n\n# Provide path to the python modules we want to run autodoc on\nsys.path.insert(0, os.path.abspath('../qp'))\n# Avoid imports that may be unsatisfied when running sphinx, see:\n# http://stac... | python | edit | 1 | 0 | mit | dd1c220606a1d7a40b9d3def1acbbfd03a865004 | aimalz/qp | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Server Specific Configurations\nserver = {\n 'port': '8080',\n 'host': '0.0.0.0'\n}\n\n# Pecan Application Configurations\napp = {\n 'root': 'ceilometer.api.controllers.root.RootController',\n 'modules': ['ceilometer.api'],\n ... | python | edit | 1 | 0 | apache-2.0 | 5b0dde337bbad6361e32fc99f12d51af534e6278 | ityaptin/ceilometer,citrix-openstack-build/ceilometer,luogangyi/Ceilometer-oVirt,dreamhost/ceilometer,JioCloud/ceilometer,openstack/ceilometer,tanglei528/ceilometer,pkilambi/ceilometer,JioCloud/ceilometer,dreamhost/ceilometer,isyippee/ceilometer,openstack/aodh,maestro-hybrid-cloud/ceilometer,citrix-openstack-build/ceil... | ceilometer/api/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nfrom netmiko.base_connection import BaseConnection\n\n\nclass NetscalerSSH(BaseConnection):\n \"\"\" Netscaler SSH class. \"\"\"\n\n def session_preparation(self):\n \"\"\"Prepare the session after the connection... | python | edit | 1 | 2 | mit | 3ba8af66d0c6ebbdd4a3799b819a72292da2c6c5 | ktbyers/netmiko,ktbyers/netmiko | netmiko/citrix/netscaler_ssh.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, re\nfrom base64 import b64encode as encode\nfrom qipipe.staging import airc_collection as airc\nfrom qipipe.staging.staging_helper import SUBJECT_FMT\nfrom qipipe.helpers import xnat_helper\n\nimport logging\nlogger = logging.get... | python | edit | 6 | 3 | bsd-2-clause | 43ab1f2015b71ba5b63152dee524d0ccc1864302 | ohsu-qin/qipipe | test/helpers/xnat_test_helper.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\r\n# Pomito - Pomodoro timer on steroids\r\n# Base package for plugins\r\n\r\n__all__ = ['initialize', 'get_plugin']\r\n\r\n# TODO Enable plugin discovery, support for drop-in plugins\r\n# TODO Validate plugins\r\n# ... | python | edit | 1 | 2 | mit | bfce7465713edbc4e596138c9ce24c67454d533c | codito/pomito | pomito/plugins/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom consistent_hash_ring import ConsistentHashRing\nfrom error_code import ErrorCode\nimport util\n\n\ndef get_hash(value):\n return hashlib.sha256(value).hexdigest()\n\nclass MembershipStage(object):\n \"\"\" Stage for managing memb... | python | edit | 3 | 2 | mit | 78a40488ee1adabb77400708e7d091e94807c1b5 | samuelwu90/PynamoDB | PynamoDB/membership_stage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom unittest.mock import MagicMock\n\nimport pytest\n\nfrom isort import setuptools_commands\n\n\ndef test_isort_command_smoke(src_dir):\n \"\"\"A basic smoke test for the setuptools_commands command\"\"\"\n from distutils... | python | edit | 5 | 3 | mit | 477a6334482b7cfad0a4b1edb1cf1528824e82e4 | PyCQA/isort,PyCQA/isort | tests/test_setuptools_command.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\"\"\"Run static analysis on the project.\"\"\"\nfrom shutil import rmtree\nfrom subprocess import CalledProcessError, check_call\nfrom tempfile import mkdtemp\nimport sys\n\n\ndef do_process(*args):\n \"\"\"Run pr... | python | edit | 1 | 3 | bsd-2-clause | efe3c6acb6b5336461adc18d993ad74a31205c06 | 13steinj/praw,leviroth/praw,gschizas/praw,praw-dev/praw,gschizas/praw,13steinj/praw,praw-dev/praw,leviroth/praw | pre_push.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models import get_model\n\nCategory = get_model('catalogue', 'category')\n\n\ndef create_from_sequence(bits):\n \"\"\"\n Create categories from an iterable\n \"\"\"\n if len(bits) == 1:\n # Get or create ro... | python | edit | 1 | 6 | bsd-3-clause | 62017dc7dc210d09e8f6753ad86365ac679f4a0a | vovanbo/django-oscar,adamend/django-oscar,MatthewWilkes/django-oscar,manevant/django-oscar,django-oscar/django-oscar,WadeYuChen/django-oscar,elliotthill/django-oscar,sasha0/django-oscar,WillisXChen/django-oscar,jinnykoo/wuyisj,Jannes123/django-oscar,makielab/django-oscar,WadeYuChen/django-oscar,lijoantony/django-oscar,... | oscar/apps/catalogue/categories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file... | python | edit | 1 | 1 | apache-2.0 | cbd6097cc070967963587441e6fdcf40f7c5293b | Plexxi/st2,nzlosh/st2,lakshmi-kannan/st2,StackStorm/st2,lakshmi-kannan/st2,tonybaloney/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,tonybaloney/st2,peak6/st2,tonybaloney/st2,StackStorm/st2,peak6/st2,nzlosh/st2,StackStorm/st2,peak6/st2,nzlosh/st2,lakshmi-kannan/st2,Plexxi/st2,Plexxi/st2 | st2common/st2common/jinja/filters/data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.encoding import smart_str\n\nfrom kitsune.products.models import Product\nfrom kitsune.taggit.models import Tag\nfrom kitsune.questions.models import Question\n\ntags_to_migrate = {\n # source tag -> product\n 'deskt... | python | edit | 4 | 5 | bsd-3-clause | 00a7f018b80d7ddf9cad775ee39d90813879253b | MikkCZ/kitsune,dbbhattacharya/kitsune,MziRintu/kitsune,dbbhattacharya/kitsune,YOTOV-LIMITED/kitsune,rlr/kitsune,turtleloveshoes/kitsune,feer56/Kitsune1,Osmose/kitsune,mythmon/kitsune,Osmose/kitsune,safwanrahman/kitsune,Osmose/kitsune,YOTOV-LIMITED/kitsune,rlr/kitsune,Osmose/kitsune,NewPresident1/kitsune,feer56/Kitsune2... | migrations/194-questions-product-migration.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# views.py\n# wide-language-index-demo\n#\n\n\"\"\"\nPublic facing frontpage.\n\"\"\"\n\nimport json\nimport random\n\nfrom flask import (Blueprint, request, render_template, redirect)\n\nfrom . import forms\nf... | python | edit | 1 | 3 | bsd-3-clause | 402d30d840e7e1d8885412cce7bee2897150a1cf | larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo | widelanguagedemo/public/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url, include\nfrom django.conf.urls.static import static\nfrom core.views import Home, register\n\n# Use this file to import all other url\nfrom game_website import settings\n\nurlpatterns = patterns(\... | python | edit | 1 | 0 | mit | e9605bd92e67c7f5daf7011f871c3a9d915abe76 | joshsamara/game-website,joshsamara/game-website,joshsamara/game-website | core/urls/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conans.model import Generator\nfrom conans.paths import BUILD_INFO_XCODE\n\n\nclass XCodeGenerator(Generator):\n\n template = '''\nHEADER_SEARCH_PATHS = $(inherited) {include_dirs}\nLIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}\nOT... | python | edit | 1 | 5 | mit | 198181baa0b095d120b456e7191c0c49c98b3c03 | conan-io/conan,conan-io/conan,luckielordie/conan,dragly/conan,lasote/conan,dragly/conan,tivek/conan,luckielordie/conan,memsharded/conan,conan-io/conan,memsharded/conan,birsoyo/conan,lasote/conan,memsharded/conan,mropert/conan,Xaltotun/conan,memsharded/conan,Xaltotun/conan,mropert/conan,birsoyo/conan,tivek/conan | conans/client/generators/xcode.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# pyQode - Python/Qt Code Editor widget\n# Copyright 2013, Colin Duquesnoy <<EMAIL>>\n#\n# This software is released under the LGPLv3 license.\n# You should have received a copy of the GNU ... | python | edit | 1 | 1 | mit | 853108e1c5cd9fca27d0f1dc8324b4b2a4d4b871 | pyQode/pyqode.python,mmolero/pyqode.python,pyQode/pyqode.python,zwadar/pyqode.python | pyqode/python/plugins/pyqode_python_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import namedtuple\n\n\nMobileFlag = namedtuple('MobileFlag', 'slug label')\n\n\nMULTIPLE_APPS_UNLIMITED = MobileFlag(\n 'multiple_apps_unlimited',\n 'Enable unlimited multiple apps'\n)\n\n```\n\nApply this change: Add... | python | edit | 1 | 0 | bsd-3-clause | 80bb5557f78268545139cd37f593278e35979fd5 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/mobile_flags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.db import models\n\nfrom common.mixins import ForceCapitalizeMixin\n\n\nclass Weekday(ForceCapitalizeMixin, models.Model):\n \"\"\"Model representing the day of the week.\"\"\"\n\n ... | python | edit | 1 | 2 | mit | 26e2feb6f2dfe74ade46cf871167101599c0acba | teamtaverna/core | app/timetables/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport logging; logger = logging.getLogger()\n\nfrom checks.db.mysql import MySql\n\nclass TestMySql(unittest.TestCase):\n def setUp(self):\n # This should run on pre-2.7 python so no skiptest\n try:\n ... | python | edit | 3 | 1 | bsd-3-clause | 287609cc21ae7024507a662b2afe13520fdf8eb7 | eeroniemi/dd-agent,indeedops/dd-agent,relateiq/dd-agent,Shopify/dd-agent,remh/dd-agent,huhongbo/dd-agent,darron/dd-agent,jamesandariese/dd-agent,jraede/dd-agent,eeroniemi/dd-agent,urosgruber/dd-agent,jvassev/dd-agent,eeroniemi/dd-agent,polynomial/dd-agent,lookout/dd-agent,jvassev/dd-agent,Mashape/dd-agent,Shopify/dd-ag... | tests/test_mysql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom optparse import OptionParser\nfrom datetime import *\nfrom git import *\n\nif __name__==\"__main__\":\n usage = \"\"\"\n%prog outfile.txt\"\"\"\n\nparser = OptionParser(usage=usage)\n(options, args) = parser.parse_args()\n... | python | edit | 4 | 0 | apache-2.0 | 7d6ecfe52f60ac07c57bbd6e966cded11ce40e4c | Baldanos/hydrafw,hydrabus/hydrafw,hydrabus/hydrafw,hydrabus/hydrafw,Baldanos/hydrafw,Baldanos/hydrafw | scripts/hydrafw-version.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# -*- coding: utf-8 -*-\n\nfrom optparse import make_option\nfrom optparse import OptionParser\n\nfrom scaffolder.core.commands import BaseCommand\nfrom scaffolder.vcs import VCS\n\n\nclass VcsCommand(BaseCommand):\n ... | python | edit | 3 | 1 | mit | 922c6350fda965068927611348bdd9127ee405d9 | goliatone/minions | scaffolder/commands/vcs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\r\nimport os\r\nimport sphinx_tests_util\r\nfrom xml.etree import ElementTree\r\nfrom xml.dom import minidom\r\n\r\n\r\n# =============================================================================\r\n# Utility functions\r\n\r\ndef srcdi... | python | edit | 2 | 3 | apache-2.0 | 5b99fa7adf8ce65309f47d6456ecba32b02995a4 | t4ngo/sphinxcontrib-traceables | tests/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom django.conf import settings\n\nDEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG',\n {'theme': \"simple\", 'relative_urls': False})\n\nUSE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False)\n\nUS... | python | edit | 1 | 0 | mit | 7420d9208067f5144b301ff00d962b0b84e2a0f3 | pterk/django-tinymce,pterk/django-tinymce | tinymce/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Sample extension: zoom a window to maximum height\n\nimport re\nimport sys\n\nclass ZoomHeight:\n\n menudefs = [\n ('windows', [\n ('_Zoom Height', '<<zoom-height>>'),\n ])\n ]\n\n windows_keydefs = {\n ... | python | edit | 1 | 4 | mit | ffd1ba9eee804fdd55e86908b158a4ad94f2f366 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Tools/idle/ZoomHeight.py | rejected_duplicate | Near-duplicate of sample 2964 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass BolusArrivalError(Exception):\n pass\n\n\ndef bolus_arrival_index(time_series):\n \"\"\"\n Determines the DCE bolus arrival series index. The bolus arrival is\n the first series with a difference in average signal larger t... | python | edit | 2 | 4 | bsd-2-clause | dd2c92bea635d7cfc93b437ce32266126bceb1e9 | ohsu-qin/qipipe | qipipe/helpers/bolus_arrival.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''Virtual datasets: The 'Eiger' use case\n\nhttps://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf\n'''\n\nimport h5py\nimport numpy as np\n\n\nfiles = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']\n... | python | edit | 1 | 0 | bsd-3-clause | f54fd0bf65d731b4f25cfc2ddffb8d6f472e0d7c | h5py/h5py,h5py/h5py,h5py/h5py | examples/eiger_use_case.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils.importlib import import_module\n\ndef get_backend():\n \"\"\"\n Return an instance of the registration backend for use on thi... | python | edit | 4 | 3 | bsd-3-clause | da0ba836636f6ce78d8606a5932de34a8e1160a1 | Geffersonvivan/django-registration,tanjunyen/django-registration,rulz/django-registration,allo-/django-registration,furious-luke/django-registration,kinsights/django-registration,yorkedork/django-registration,mick-t/django-registration,torchingloom/django-registration,alawnchen/django-registration,furious-luke/django-r... | registration/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom BKKCrypt import BKKCrypt\nimport urllib.request\n\nclass TestEncodeStrings(unittest.TestCase):\n\n def test_simple_strings(self):\n self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin')\n self.assertE... | python | edit | 1 | 2 | mit | d70e563c3119e59de2ae23a77724e0fd803b768b | moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCr... | Python/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport traceback\nfrom .settings import settings, PLUGIN_NAME\n\n\ndef debug(*args):\n \"\"\"Print args to the console if the \"debug\" setting is True.\"\"\"\n if settings.log_debug:\n printf(*args)\n\n\ndef exception_log(mess... | python | edit | 1 | 2 | mit | 819b968a3bb73c1e8fed1a9c5440c8122a6dec9e | tomv564/LSP | plugin/core/logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.core.management import call_command\n\n\ndef pytest_configure():\n settings.configure(\n ROOT_URLCONF='tests.urls',\n\n ALLOWED_HOSTS=['testserver'],\n\n DATABASES={\n ... | python | edit | 1 | 2 | bsd-2-clause | 96776b33fcf2ebbd2de4748c38d8be9c63fdec71 | yprez/django-rest-assured,pombredanne/django-rest-assured,ydaniv/django-rest-assured | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\n# get hits from miranda scans\ncap = \"\"\nwith open (sys.argv[1]) as infile1:\n for line1 in infile1:\n line1 = line1.strip()\n if \"%\" in line1 and \"Forward:\" not in line1:\n #print(line1)\n ... | python | edit | 1 | 0 | mit | f2294b289b6eaa9c103f667dd3252429aac360e1 | anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,TGAC/tgac-galaxytools,PerlaTroncosoRey/tgac-galaxytools,wjurkowski/earlham-galaxytools,TGAC/tgac-galaxytools,anilthanki/tgac-galaxytools,anilthanki/tgac-galaxytools... | tools/miranda/miranda_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom bs4 import BeautifulSoup\n\n\ndef download_url(url):\n r = requests.get(url)\n if r.status_code != 200:\n raise Exception('Non-OK status code: {}'.format(r.status_code))\n return r.text\n\n\ndef parse_t... | python | edit | 2 | 4 | mit | 1d0570ca75419f441aa1324de78051534efba74b | tori-smile/JustSearch | search_engine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# (C) Pywikipedia bot team, 2007\n#\n# Distributed under the terms of the MIT license.\n#\n__version__ = '$Id$'\n\nimport os\nimport pywikibot.data.api\nfrom pywikibot.data.api import Request as _original_Reques... | python | edit | 1 | 1 | mit | db0ef5f31d82729f654d1d07fa39c1168aa5e5f7 | npdoty/pywikibot,PersianWikipedia/pywikibot-core,trishnaguha/pywikibot-core,jayvdb/pywikibot-core,emijrp/pywikibot-core,wikimedia/pywikibot-core,xZise/pywikibot-core,happy5214/pywikibot-core,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,magul/pywikibot-core,h4ck3rm1k3/pywikibot-core,TridevGuha/pywikibot-core,hasteur/g... | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport socket\n\ntry:\n import requests.packages.urllib3 as urllib3\nexcept ImportError:\n import urllib3\n\n\nclass CancellableStream(object):\n \"\"\"\n Stream wrapper for real-time events, logs, etc. from the server.\n\n E... | python | edit | 1 | 6 | apache-2.0 | 40711cb50189c4c39ed5a60c16910646a00f9acc | youhong316/docker-py,docker/docker-py,funkyfuture/docker-py,funkyfuture/docker-py,docker/docker-py,vdemeester/docker-py,youhong316/docker-py,vdemeester/docker-py | docker/types/daemon.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport unittest\n\n\ndef suite():\n MODULE_DIR = os.path.join(os.path.dirname(__file__), '..')\n MODULE_DIR = os.path.abspath(MODULE_DIR)\n sys.path.insert(0, MODULE_DIR)\n sys.path.insert(0, os.path.dirna... | python | edit | 1 | 5 | mit | d3f0d83b0c783d2f15a6f5eaf6fd4ace426307a6 | Mause/pytransperth,Mause/pytransperth | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom kat.harness import Query\n\nfrom abstract_tests import AmbassadorTest, ServiceType, EGRPC\n\nclass AcceptanceGrpcBridgeTest(AmbassadorTest):\n\n target: ServiceType\n\n def init(self):\n self.target = EGRPC(... | python | edit | 1 | 1 | apache-2.0 | 07b7efdc848deeb7634f23cdb878774a99c9c535 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | ambassador/tests/t_grpc_bridge.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport mongoengine as me\n\n\n# Based on: https://flask-mongoengine.readthedocs.org/en/latest/\n\nclass Post(me.Document):\n title = me.StringField(max_length=120, required=True)\n created_at = me.DateTimeField(defaul... | python | edit | 2 | 1 | mit | 032d1061454482db730e35a17fa058ba1ed5f66a | CodeSelfStudy/codeselfstudy_flask,CodeSelfStudy/codeselfstudy_flask,CodeSelfStudy/codeselfstudy_flask,harli123/codeselfstudy_flask,harli123/codeselfstudy_flask,harli123/codeselfstudy_flask | app/codeselfstudy/models/posts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom chassis.models import db\nfrom chassis import models\n\nfrom faker import Factory as Fake\nfrom factory.alchemy import SQLAlchemyModelFactory\nimport factory\n\nimport logging\n\n#Suppress factory-boy debug data\nfactory_log = logging.... | python | edit | 1 | 0 | mit | 054f9ce0a8d08b0ec740d7b6d26a8b5553962490 | makmanalp/flask-chassis | src/factories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this... | python | edit | 1 | 2 | apache-2.0 | 957422118d31def826d336f26152de1d0399fe4e | h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water | py/src/ai/h2o/sparkling/H2OConf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..rman_constants import RFB_PREFS_NAME\nimport bpy\n\ndef get_addon_prefs():\n try:\n addon = bpy.context.preferences.addons[RFB_PREFS_NAME]\n return addon.preferences\n except:\n return None\n\ndef get_pref(... | python | edit | 1 | 4 | mit | daf68a1475530f4f0cb2e78e2ccf6ecbca821a8e | prman-pixar/RenderManForBlender,adminradio/RenderManForBlender,prman-pixar/RenderManForBlender | rfb_utils/prefs_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014 Mirantis Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.ap... | python | edit | 1 | 0 | apache-2.0 | 753b2b6d04d0808e92dec0337d75a821d171e8e6 | openstack/sahara,openstack/sahara | sahara/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom go.billing import views\n\nurlpatterns = patterns(\n '',\n url(\n r'^(?P<statement_id>[\\d]+)', views.statement_view,\n name='pdf_statement')\n)\n\n```\n\nApply this chang... | python | edit | 1 | 0 | bsd-3-clause | 0b152333c30d061df64376bb036c5fcd20896c36 | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/billing/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\n\nfrom .base import Base as Settings\n\n\nclass Testing(Settings):\n # Database Configuration.\n # ------------------------------------------------------------------\n DATABASES = {\n 'def... | python | edit | 3 | 0 | apache-2.0 | 901bd73c61fbc6d9d8971ec1ce12e64100e633cb | hello-base/web,hello-base/web,hello-base/web,hello-base/web | base/settings/testing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nVerseBot for reddit\nBy Matthieu Grieger\nregex.py\nCopyright (c) 2015 Matthieu Grieger (MIT License)\n\"\"\"\n\nimport re\n\ndef find_verses(message_body):\n \"\"\" Uses regex to search comment body for verse quotations. Returns... | python | edit | 1 | 2 | mit | 86ec56b0de1e822af2e03fedd2a67a3c555a7d18 | Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot | versebot/regex.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\n\n@check.arg(0, check.int_value(min=0))\n@check.arg(1, check.int_value(min=0))\ndef add_positive_integers(int1, int2):\n return int1 + int2\n\n\ndef main():\n print(add_positive_integers(1, 5))... | python | edit | 1 | 3 | mit | 9bebf1c0cc9c0a03cde23fb1b92ae983f1fc3fa8 | explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc | examples/check_args.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Turn Excel metadata from SMVK into JSON-file for further processing.\n\nInput: Excel-file\nProcessing: strip whitespace etc\nOutput: JSON-file `cypern_metadata.json\" containg dict in... | python | edit | 1 | 2 | mit | 369b0499d02531e7058f4f0d6c5051b9058701aa | mattiasostmar/SMVK-Cypern_2017-01 | metadata_to_json_and_fnamesmap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport inspect\nimport sys\nimport types\n\nfrom rmake.lib.apiutils import thaw, freeze\n\nclass NodeType(object):\n nodeType = 'UNKNOWN'\n def __init__(self):\n pass\n\n def freeze(self):\n return (self.nodeType, sel... | python | edit | 7 | 1 | apache-2.0 | f58cce56103b98e783fa0df5bae0ae0985f7dc8e | sassoftware/rmake3,sassoftware/rmake3,sassoftware/rmake,sassoftware/rmake,sassoftware/rmake3,sassoftware/rmake | rmake_plugins/multinode_client/nodetypes.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, date\n\nfrom django.utils import timezone\n\n\ndef datetime_midnight(year, month, day):\n \"\"\"\n Returns a timezone aware datetime object of a date at midnight, using the\n current timezone.\n \"... | python | edit | 1 | 1 | bsd-2-clause | 563a905a48a5d4059463f25c5467a52a9d9c79c5 | funkbit/django-groove | groove/timezone.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division\n\nimport unittest as ut\nimport numpy as np\n\nimport ARG.arg as arg\n\n\nclass ARGTestCase(ut.TestCase):\n\n def test_truisms(self):\n ... | python | edit | 1 | 1 | mit | b2de891e75dc84e809b9c35222e6bc8fe44c3d37 | khrapovs/argamma | test_arg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.views.generic import TemplateView\n\n\nclass SimpleWellView(TemplateView):\n def render_to_response(self, context, **response_kwargs):\n if not 'params' in conte... | python | edit | 1 | 5 | apache-2.0 | cf9ba0d497127d5261c8bee5eebe0e8f12aabf3a | armstrong/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells | armstrong/core/arm_wells/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Download the helper library from https://www.twilio.com/docs/python/install\nfrom twilio.rest import Client\n\n# Your Account Sid and Auth Token from twilio.com/console\naccount_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'\nauth_token = 'yo... | python | edit | 2 | 0 | mit | b7f07248834857e89f2f8312785a3a1f343c27c3 | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets | quickstart/python/understand/example-2/create_joke_intent.6.x.py | rejected_duplicate | Near-duplicate of sample 17158 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom python_cowbull_game.GameController import GameController\nfrom python_cowbull_game.GameMode import GameMode\n\n\nclass ExtGameController(GameController):\n additional_modes = [\n GameMode(mode=\"SuperTough\", priority=6, digi... | python | edit | 1 | 1 | apache-2.0 | 7cf4578297667bc8b6405e99828818de87e3ba9a | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | extensions/ExtGameController.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nimport universe\n\n\nseed = 91231\nn_trials = 20\nn_steps = 1000\n\nsteps_to_reward = 9\nmax_reward = n_steps // steps_to_reward * 5.\n\nuni = universe.Universe('grid_world', world='2d_world0... | python | edit | 1 | 0 | mit | 0c4bdc2d27fb289979004c7e0a0b9d0bf0a764cf | jakobj/python-tdl | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom schools.models import School\n\n\ndef index(request):\n schools = School.objects.all().filter(is_active=True).order_by('name')\n\n # current_year = get_current_year()\n # courses = Course.o... | python | edit | 1 | 1 | mit | 84254935bc78e86dadcde7ad3a09e8f1036c4051 | znick/anytask,znick/anytask,znick/anytask,znick/anytask | anytask/index/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom data_util import DataManager\nimport sys\nimport data_util\nimport numpy as np\nsys.path.append(\"../\")\n# DataInstance = DataManager(\"../../data/train\", \"../../data/test\", 128)\n# batch_input, batch_output, is_epoch_increase = Da... | python | edit | 3 | 0 | apache-2.0 | b32614df983402081cad272f486fcffcd3a18fc1 | Lucklyric/NLP-NER-CNN | scripts/tests/data_util_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add spm imports at package level. Most tests pass now.\n\ngit-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1141 ead46cd0-7350-4e37-8683-fc4c6f79bf00"
},
{
"role": "assistant",
"content": "\"\"\"Top-level namespace for spm.\"... | python | new_file | 18 | 0 | bsd-3-clause | 592bbd24b0711be5c3e87133fc27429c83eabc01 | JohnGriffiths/nipype,carolFrohlich/nipype,blakedewey/nipype,christianbrodbeck/nipype,fprados/nipype,FCP-INDI/nipype,carlohamalainen/nipype,grlee77/nipype,dgellis90/nipype,sgiavasis/nipype,rameshvs/nipype,fprados/nipype,blakedewey/nipype,FredLoney/nipype,dgellis90/nipype,carlohamalainen/nipype,dmordom/nipype,sgiavasis/n... | nipype/interfaces/spm/__init__.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom framework.transactions import handlers\n\nclass TokuTransactionsMiddleware(object):\n \"\"\"TokuMX transaction middleware.\"\"\"\n\n def process_request(self, request):\n handlers.transaction_before_request()\n\n def pr... | python | edit | 1 | 1 | apache-2.0 | 1941cba46978fb7f8182ddb3eddf2d77002b28f7 | TomHeatwole/osf.io,asanfilippo7/osf.io,fabianvf/osf.io,chrisseto/osf.io,dplorimer/osf,monikagrabowska/osf.io,chrisseto/osf.io,TomBaxter/osf.io,doublebits/osf.io,cwisecarver/osf.io,cwisecarver/osf.io,icereval/osf.io,jnayak1/osf.io,haoyuchen1992/osf.io,laurenrevere/osf.io,ckc6cz/osf.io,doublebits/osf.io,njantrania/osf.io... | api/base/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tornado.wsgi import WSGIContainer\nfrom tornado.httpserver import HTTPServer\nfrom tornado.ioloop import IOLoop\n\nimport tornado.options\nimport server\nimport os\n\n\nuse_https = False\n\n\nif use_https:\n default_port = 80\nelse:... | python | edit | 1 | 0 | apache-2.0 | b1c9aaa6551902b285c96c94c269a787701bb020 | edmundo096/MoodMusic,edmundo096/MoodMusic,edmundo096/MoodMusic | start_tornado.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport getopt\nimport sys\n\nimport player\nfrom logger import *\n\n\ndef usage():\n print(\"clientPlayer -t number [-v number]\")\n print(\"-t track number\")\n print(\"-v volume\")\n print(\"-d set de... | python | edit | 5 | 7 | mit | 4e7bcc26cb17af3879be62206231ab60d2b45fe5 | jmigual/projecte2,jmigual/projecte2 | Code/clientPlayer.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pypuppetdb\n\n\ndef test_connect_api():\n puppetdb = pypuppetdb.connect()\n assert puppetdb.version == 'v4'\n\n```\n\nApply this change: Add test for creating connection with 'with' statement."
},
{
"role": "assistant",... | python | edit | 1 | 1 | apache-2.0 | 7a7856d9ec56de91325c7bf7c62ff25c0241badc | puppet-community/pypuppetdb,voxpupuli/pypuppetdb | tests/test_connect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport dj_database_url\nfrom hotohete.settings import *\n\n\ndb_from_env = dj_database_url.config(conn_max_age=500)\nDATABASES['default'].update(db_from_env)\n\nALLOWED_HOSTS = [\n 'hotohete.herokuapp.com',\n 'localhost',\n '127.0.... | python | edit | 3 | 0 | mit | 27f409721a9f59b61d6fe01bad11733a7559bda0 | wen96/hotohete,wen96/hotohete,wen96/hotohete,wen96/hotohete | hotohete/production.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function, division, absolute_import\n\nfrom argparse import ArgumentParser\n\n\ndef main(args=None):\n if args is None:\n parser = ArgumentParser('Tool for generating skeleton package-'\n ... | python | edit | 1 | 3 | bsd-3-clause | 4723e5aaf60d7fcf823d5fa72b67ef3331daa049 | astropy/conda-build-tools,astropy/conda-build-tools | extruder/extrude_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from django.conf.urls import url\nexcept ImportError:\n from django.core.urlresolvers import reverse\n\nfrom masquerade.views import mask, unmask\n\nurlpatterns = [\n url(r'^mask/$', mask, name='masquerade-mask'),\n url(r... | python | edit | 3 | 0 | apache-2.0 | a877a578f0e71f9d667b5845c96b913ea51fa195 | erikcw/django-masquerade,erikcw/django-masquerade,erikcw/django-masquerade | masquerade/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Contains a class for custom particle filters in Python.\"\"\"\nfrom abc import ABCMeta, abstractmethod\n\nclass CustomFilter(metaclass=ABCMeta):\n \"\"\"Abstract base class for custom particle filters.\n\n The class allows the d... | python | edit | 3 | 1 | bsd-3-clause | 073fc87b0641685bf228ca530927d793c919d40d | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/filter/custom.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport pytest\nimport tweepy\nimport vcr\n\nfrom secrets import TWITTER_ACCESS, TWITTER_SECRET\nfrom secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET\n\n\nclass TestTweepyIntegration():\n \"\"\"Tes... | python | edit | 1 | 1 | mit | da1518d1e810ca227e84f110d4d42d1480040bc8 | nestauk/inet | tests/test_twitter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Add auto-completion and a stored history file of commands to your Python\n# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is\n# bound to the Esc key by default (you can change it - see readline docs).\n#\n# Set an ... | python | edit | 1 | 1 | mit | bfc0ce1298b9fe7a640dc31c6e5729d1c6360945 | keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles | langs/pystartup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Check that we handle an ImportError in a special way when command script importing files.\"\"\"\n\nimport os, sys, time\nimport unittest2\nimport lldb\nfrom lldbtest import *\n\nclass Rdar12586188TestCase(TestBase):\n\n mydir = os.... | python | edit | 8 | 1 | apache-2.0 | 3a11712925ca1038a1c8c8c8eef29ca4d5fd1c6f | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb | test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: Prabhu Ramachandran, Gael Varoquaux\n# Copyright (c) 2004-2014, Enthought, Inc.\n# License: BSD Style.\n\"\"\" A tool for easy and interactive visualization of data.\n Part of the Mayavi project of the Enthought Tool Suite.\n\"... | python | edit | 1 | 0 | bsd-3-clause | 4036ef2ac8435070d8850e1dab4187890bccd7c5 | dmsurti/mayavi,dmsurti/mayavi | mayavi/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport Queue\nimport wx, wx.stc\nfrom editor_fonts import init_stc_style\n\nclass ThreadOutputCtrl(wx.stc.StyledTextCtrl):\n def __init__(self, parent, style=wx.TE_READONLY):\n wx.stc.StyledTextCtrl.__init__(self, parent)\n ... | python | edit | 1 | 2 | mit | 2489ed6ff3d812888de4a0a2c45995389499d648 | shaurz/devo | thread_output_ctrl.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\nfrom numpy.testing import assert_array_equal\nfrom nose.tools import raises, assert_true\n\nfrom landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary\nfrom landlab.grid.structured_quad.links impo... | python | edit | 3 | 1 | mit | 336313ac982b9de278aca6e0f74f6820ef5b2526 | ManuSchmi88/landlab,amandersillinois/landlab,SiccarPoint/landlab,cmshobe/landlab,amandersillinois/landlab,SiccarPoint/landlab,cmshobe/landlab,laijingtao/landlab,RondaStrauch/landlab,Carralex/landlab,Carralex/landlab,ManuSchmi88/landlab,cmshobe/landlab,Carralex/landlab,landlab/landlab,csherwood-usgs/landlab,ManuSchmi88/... | landlab/grid/structured_quad/tests/test_links.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox\nfrom rorn.Session import delay\n\nfrom User import User\nfrom Button import Button\nfrom utils import *\n\n@get('login')\ndef login(handler, request):\n\thandler.title('Login'... | python | edit | 7 | 3 | mit | 7310fdd86cebd1c8b28d960f0211e350fbf07a62 | mrozekma/Sprint,mrozekma/Sprint,mrozekma/Sprint | handlers/login.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n#\n# A module for working with HydroTrend.\n#\n# Mark Piper (<EMAIL>)\n\nimport numpy as np\n\n\ndef load_series(output_file):\n '''\n Reads a column of text containing HydroTrend output. Returns a numpy array,... | python | edit | 2 | 2 | mit | 2be4b1b67ca17a400c6d22e8e29e0a4f1c69c0cc | mdpiper/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments | dakota_utils/models/hydrotrend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport matplotlib\nimport numpy as np\nimport pymc as pm\nfrom matplotlib import pyplot as plt\n\n\ndef main():\n matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json'\n matplotlib.rcParams.update(json.load(o... | python | edit | 3 | 2 | mit | c8ef9e7271796239de2878bbf40a2c2d388427e4 | noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit | bayesian_methods_for_hackers/simulate_messages_ch02.py | rejected_duplicate | Near-duplicate of sample 13058 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator\nimport django_tables2 as tables\n\n\ndef get_django_tables2_from_dict(data_dict):\n c = ClassAttributeCreator()\n tabl... | python | edit | 1 | 2 | bsd-3-clause | 018eab65881a2279efca88e1448dba0708a4dfe1 | weijia/django-excel-to-model,weijia/django-excel-to-model | django_excel_to_model/management/commands/model_create_utils/django_tables2_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.db import models\nfrom django.utils import timezone\n\nfrom taggit.managers import TaggableManager\n\n\nclass Bookmark(models.Model):\n title = models.CharField(max_length=200, blank... | python | edit | 1 | 1 | mit | db8dea37028432c89e098728970fbaa265e49359 | tom-henderson/bookmarks,tom-henderson/bookmarks,tom-henderson/bookmarks | bookmarks/core/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Here's an example of stuff to copy and paste into an interactive Python interpreter to get a connection loaded.\n# Or you can load it with 'python -i interactive-mode.py'.\n\n# Set some variables.\n\nbmrc = \"~/.bmrc\"\nsite = \"www\"\nbm... | python | edit | 3 | 0 | bsd-3-clause | 2f28efa4bef5759392a46fe3457c87c94911e1ba | dwvanstone/buttonmen,dwvanstone/buttonmen,dwvanstone/buttonmen,dwvanstone/buttonmen,dwvanstone/buttonmen,dwvanstone/buttonmen | tools/api-client/python/interactive_mode.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: UTF-8 -*-\nfrom geopy.geocoders import Teleport\nfrom test.geocoders.util import GeocoderTestBase\n\n\nclass TeleportTestCaseUnitTest(GeocoderTestBase):\n\n def test_user_agent_custom(self):\n geocoder = Teleport(\n ... | python | edit | 1 | 1 | mit | 17c81bb4acb51907f6a4df9a1a436611e730c15d | magnushiie/geopy,magnushiie/geopy | test/geocoders/teleport.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nfrom reportlab import platypus\nfrom facturapdf import flowables, helper\n\n\ndef element(item):\n elements = {\n 'framebreak': {'class': platypus.FrameBreak},\n 'simpleline': {'class': flowables.SimpleLine, 'cas... | python | edit | 1 | 7 | bsd-3-clause | f3b87dcad47e77a3383de6fef17080661471a4a3 | initios/factura-pdf | facturapdf/generators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# include settimgs from daiquiri\nfrom daiquiri.core.settings.django import *\nfrom daiquiri.core.settings.celery import *\nfrom daiquiri.core.settings.daiquiri import *\nfrom daiquiri.core.settings.logging import *\nfrom daiquiri.core.sett... | python | edit | 22 | 0 | apache-2.0 | d29e87eeb062df4d52c0c744919be4cae770fc2c | aipescience/django-daiquiri,aipescience/django-daiquiri,aipescience/django-daiquiri | testing/config/settings/__init__.py | rejected_lint | Too many lint violations: 22 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nconfig = {\n 'description': 'Python Connector for Mongrel2',\n 'author': 'Zed A. Shaw',\n 'url': 'http://pypi.python.org/pypi/mo... | python | edit | 1 | 0 | bsd-3-clause | b3f5aed7097241adffd54d9b1ff705cd44455165 | ged/mongrel2,ged/mongrel2,ged/mongrel2,ged/mongrel2 | examples/python/setup.py | rejected_duplicate | Near-duplicate of sample 649 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twilio.rest import TwilioPricingClient, TwilioLookupsClient\n\n#auth credentials\naccount_sid = \"ACCOUNT_SID\"\nauth_token = \"AUTH_TOKEN\"\n\n#Use Lookup API to get country code / MCC / MNC that corresponds to given phone number\nph... | python | edit | 5 | 0 | mit | 069d658291276e237ce6304c306a1676ba94a650 | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snip... | pricing/get-lookup-pricing/get-lookup-pricing.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\nfrom applications import views\n\napp_name = 'application'\n\nurlpatterns = [\n # url(r'^notyet$', views.no_application, name='no_application'),\n # url(r'^$', views.project_application_form, name='pr... | python | edit | 1 | 0 | mit | fe870120076454e1baf72831e4346e9ad575771b | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | applications/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pipestrconcat.py #aka stringbuilder\n#\n\nfrom pipe2py import util\n\ndef pipe_strconcat(context, _INPUT, conf, **kwargs):\n \"\"\"This source builds a string.\n \n Keyword arguments:\n context -- pipeline context\n _INPUT... | python | edit | 1 | 5 | mit | 3b8dd8c41e78146a1d3914e03f99ce89b1624d26 | nerevu/riko,nerevu/riko | modules/pipestrconcat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nAWS_VPCS = [\n {\n 'CidrBlock': '15.0.0.0/16',\n 'Tags': [\n {\n 'Key': 'Name',\n 'Value': 'symaps-prod-proxies'\n }\n ],\n 'creat... | python | edit | 1 | 0 | mit | d9971a831a622f606d62825957c970a791d53d75 | davidlonjon/aws-proxies,davidlonjon/aws-proxies | symaps_proxies/settings/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glob\nfrom mitmproxy import utils, script\nfrom mitmproxy.proxy import config\nfrom . import tservers\n\n\ndef test_load_scripts():\n example_dir = utils.Data(__name__).path(\"../../examples\")\n scripts = glob.glob(\"%s/*.py\"... | python | edit | 1 | 9 | mit | a2274f52e4567de4209e3394060fe62276ad3546 | xaxa89/mitmproxy,vhaupert/mitmproxy,ddworken/mitmproxy,gzzhanghao/mitmproxy,Kriechi/mitmproxy,zlorb/mitmproxy,StevenVanAcker/mitmproxy,vhaupert/mitmproxy,ddworken/mitmproxy,dwfreed/mitmproxy,mosajjal/mitmproxy,jvillacorta/mitmproxy,gzzhanghao/mitmproxy,mhils/mitmproxy,dwfreed/mitmproxy,tdickers/mitmproxy,cortesi/mitmpr... | test/mitmproxy/test_examples.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ndef get_starting_chunk(filename):\n with(filename, 'r') as f:\n chunk = open(filename).read(1024)\n return chunk\n\n\ndef is_binary_string(bytes_to_check):\n \"\"\"\n ... | python | edit | 1 | 1 | bsd-3-clause | b7cee426db61801fd118758bb2f47944f3b8fd37 | hackebrot/binaryornot,0k/binaryornot,hackebrot/binaryornot,hackebrot/binaryornot,pombredanne/binaryornot,audreyr/binaryornot,pombredanne/binaryornot,audreyr/binaryornot,0k/binaryornot,pombredanne/binaryornot,audreyr/binaryornot | binaryornot/check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\n# While we support Python 2.4, use a convoluted technique to import\n# platform from the stdlib.\n# With Python 2.5 or later, just do \"from __future__ import absolute_import\"\n# and \"import platform\"\nexec('__... | python | edit | 1 | 2 | mit | bab058be7b830a38d75eebf53170a805e726308c | jaraco/keyring | keyring/util/platform.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport warnings\n\nwarnings.warn(\n 'wtforms.ext.sqlalchemy is deprecated, and will be removed in WTForms 3.0. '\n 'Instead transition to the excellent WTForms-Alchemy package: '\n 'https://github.com/kvesteri/wtforms-alchemy',\n ... | python | edit | 1 | 0 | bsd-3-clause | 7ddaa5a5f9bee7e21c1221950c50c8688e815e01 | crast/wtforms,cklein/wtforms,wtforms/wtforms | wtforms/ext/sqlalchemy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2017 Ansible, Inc.\n# All Rights Reserved.\n\nfrom social.strategies.django_strategy import DjangoStrategy\n\n\nclass AWXDjangoStrategy(DjangoStrategy):\n \"\"\"A DjangoStrategy for python-social-auth containing\n f... | python | edit | 1 | 3 | apache-2.0 | 4c7c1aa8b3bb1994183618ee44f8dd5a89884bfa | wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx | awx/sso/strategies/django_strategy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCustom signals sent during the registration and activation processes.\n\n\"\"\"\n\nfrom django.dispatch import Signal\n\n\n# A new user has registered.\nuser_registered = Signal(providing_args=[\"user\", \"request\"])\n\n# A user ha... | python | edit | 1 | 0 | bsd-3-clause | eb22ca95b79e115130c957614ca9d07237360cf8 | ubernostrum/django-registration | src/django_registration/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n\nfrom flask import render_template\nfrom . import main\nfrom dmapiclient import APIError\n\n\n@main.app_errorhandler(APIError)\ndef api_error_handler(e):\n return _render_error_page(e.status_code)\n\n\n@main.app_errorhan... | python | edit | 1 | 2 | mit | 60c62cea5d0775ce443280c0973ce323d26eaa28 | AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend | app/main/errors.py | rejected_duplicate | Near-duplicate of sample 13084 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport importlib\nimport sys\nfrom contextlib import contextmanager\n\n\ndef load(path):\n \"\"\"\n Loads a module member from a lookup path (using ``path.to.module:member``\n syntax.)\n \"\"\"\n module, name = path.split(':'... | python | edit | 12 | 3 | apache-2.0 | 303384ff5345e08dfd50ef78871742f0dd2903b6 | fuziontech/pgshovel,disqus/pgshovel,fuziontech/pgshovel,disqus/pgshovel,fuziontech/pgshovel | src/main/python/pgshovel/utilities/__init__.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# (c) Crown Owned Copyright, 2016. Dstl.\n\nfrom django.core.urlresolvers import reverse\nfrom django.shortcuts import redirect\nfrom django.views.generic.base import View\n\n\nclass Home(View):\n\n # Get the homepage. If the user isn'... | python | edit | 5 | 6 | mit | 4c1116f592731885f87421d8d3e85fa51fc785f9 | dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse | apps/home/views.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nEnclose property names in double quotes in order to JSON serialize the contents in the API\n'''\nCUSTOMIZATIONS = {\n \"serializers\":\n {\n \"Location\":\n {\n \"includeFie... | python | edit | 1 | 0 | apache-2.0 | 564e611d7cb0b94e71c53e69971a49c312a0f7f8 | swcurran/TheOrgBook,WadeBarnes/TheOrgBook,swcurran/TheOrgBook,swcurran/TheOrgBook,WadeBarnes/TheOrgBook,swcurran/TheOrgBook,WadeBarnes/TheOrgBook,WadeBarnes/TheOrgBook,WadeBarnes/TheOrgBook,swcurran/TheOrgBook | tob-api/tob_api/custom_settings_ongov.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"calc.py: A simple Python calculator.\"\"\"\n\nimport sys\n\ndef add_all(nums):\n return sum(nums)\n\ndef multiply_all(nums):\n return reduce(lambda a, b: a * b, nums)\n\n\nif __name__ == '__main__':\n command = sys.argv[1]\n ... | python | edit | 2 | 1 | bsd-3-clause | d63eec8ec53b4a20d4ac5149b7eb7cfa2d094e2d | martaenciso/calc | calc.py | rejected_duplicate | Near-duplicate of sample 18740 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTests for qutip.nonmarkov.heom.\n\"\"\"\n\nfrom qutip.nonmarkov.heom import (\n BathExponent,\n Bath,\n BosonicBath,\n DrudeLorentzBath,\n DrudeLorentzPadeBath,\n UnderDampedBath,\n FermionicBath,\n Lorentzia... | python | edit | 1 | 1 | bsd-3-clause | f6540575792beb2306736e967e5399df58c50337 | cgranade/qutip,qutip/qutip,qutip/qutip,cgranade/qutip | qutip/tests/test_heom.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Django\nfrom django.contrib.auth.models import BaseUserManager\n\n\nclass UserManager(BaseUserManager):\n\n def create_user(self, email, password='', **kwargs):\n user = self.model(\n email=email,\n passwor... | python | edit | 2 | 1 | bsd-2-clause | 1f7c21280b7135f026f1ff807ffc50c97587f6fd | barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore,dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api | project/api/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom argparse import ArgumentParser\nfrom matplotlib import pyplot as plt\nfrom graph import Greengraph\n\n\ndef process():\n parser = ArgumentParser(\n description=\"Produce graph quantifying the amount of green land between two ... | python | edit | 1 | 7 | mit | 06bfabc328c4aa32120fd7e52302db76974c2d1b | MikeVasmer/GreenGraphCoursework | greengraph/command.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom rest_framework_json_api.views import ModelViewSet\n\nfrom .models import Collection, Item\n\n\nclass ItemSerializer(serializers.ModelSerializer):\n class Meta:\n model = Item\n f... | python | edit | 1 | 0 | mit | b773186f4e39e531e162e3d56a129a21129864e7 | GSC-RNSIT/bookmark-manager,GSC-RNSIT/bookmark-manager,rohithpr/bookmark-manager,rohithpr/bookmark-manager | bookmarks/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add MispTransportError in package import"
},
{
"role": "assistant",
"content": "from .misp import MispTag, MispEvent, MispServer, MispAttribute, MispShadowAttribute, MispTransportError\n"
}
] | python | new_file | 8 | 0 | apache-2.0 | 0b82a5c10a9e728f6f5424429a70fd2951c9b5c5 | nbareil/python-misp | pythonmisp/__init__.py | rejected_lint | Too many lint violations: 8 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.