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 skimage import data\nfrom skimage.viewer import ImageViewer\nfrom skimage.viewer.plugins.lineprofile import LineProfile\n\n\nimage = data.chelsea()\nviewer = ImageViewer(image)\nviewer += LineProfile()\nline, profiles = viewer.show()[0... | python | edit | 1 | 0 | bsd-3-clause | 548423bb940a38c599ac3b82bf8a1207b5112646 | paalge/scikit-image,pratapvardhan/scikit-image,jwiggins/scikit-image,dpshelio/scikit-image,bsipocz/scikit-image,paalge/scikit-image,rjeli/scikit-image,Britefury/scikit-image,GaZ3ll3/scikit-image,blink1073/scikit-image,ClinicalGraphics/scikit-image,juliusbierk/scikit-image,robintw/scikit-image,Hiyorimi/scikit-image,Warr... | viewer_examples/plugins/lineprofile_rgb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport sys\n\nclass SentryHandler(logging.Handler):\n def emit(self, record):\n from sentry.client.models import get_client\n from sentry.client.middleware import SentryLogMiddleware\n\n # Fetch the r... | python | edit | 5 | 3 | bsd-3-clause | d8557db156e277078e10584b2ee32320ac808772 | icereval/raven-python,patrys/opbeat_python,smarkets/raven-python,beeftornado/sentry,gg7/sentry,NickPresta/sentry,JamesMura/sentry,hzy/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,jokey2k/sentry,dirtycoder/opbeat_python,icereval/raven-python,jmagnusson/raven-python,johansteffner/raven-python,mvaled/sentry,J... | sentry/client/handlers.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\nfrom aiohttp.web import Response\nfrom zope.interface import Attribute\nfrom zope.interface import Interface\n\n\nclass ITodo(Interface):\n title = Attribute(\"\"\"Title\"\"\")\n done = Attribute(\"\"\"Done\... | python | edit | 1 | 1 | bsd-2-clause | 89fcfbd71a4fc9e8a5aaea65c106a092cbd27ac0 | plone/plone.server,plone/plone.server | src/plone.example/plone/example/todo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport hashlib\nfrom datetime import datetime\n\nVCS_NAMES = ['.svn', '.git', '.bzr', '.hg']\nIGNORED_EXTENSIONS = ['.swp', '.tmp', '.pyc', '.pyo']\n\n\ndef list_directory(path, include_directories=True):\n # Skip over any VCS... | python | edit | 1 | 7 | bsd-3-clause | 97bdc9679e9162a4ce101824dc37ac0f6e57e3d7 | MiCHiLU/fanstatic-tools,MiCHiLU/fanstatic-gae,MiCHiLU/fanstatic-gae | fanstatic/checksum.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport mylib\nos.system('make all')\n\n\ndef test_squared():\n assert 16. == mylib.squared(4) \n\n\ndef test_myfunction():\n assert 16. == mylib.myfunction(mylib.squared, 4) \n\n\nos.system('make clean')\n\n```\n\nApply thi... | python | edit | 1 | 1 | bsd-2-clause | 199aee78cb494169eb8b73fbb65de5ae40a5d436 | fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python | other/wrapping-cpp/swig/c++/test_mylib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright 2014 the V8 project authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\"\"\"\nThis file emits the list of reasons why ... | python | edit | 8 | 1 | mit | 08a09d1b258eb775f641c5edf3aba4ac1c522652 | UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh | build/get_landmines.py | rejected_lint | Too many lint violations: 8 | 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#\nimport logging\nimport pytest\nfrom copy import copy\nfrom tests.common.test_vector import *\nfrom tests.common.impala_test_suite import *\n\nclass TestStri... | python | edit | 9 | 2 | apache-2.0 | 32d5f2bfcaad65230632f1854fabd2e9de1c151b | ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC | tests/query_test/test_chars.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2018 The Bitcoin Unlimited developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nfrom test_framework.ionlib.ionlib import ini... | python | edit | 19 | 0 | mit | fa08cec02a0cddfbb2fca4962b01044c323f3737 | ionomy/ion,ionomy/ion,ionomy/ion,ionomy/ion,ionomy/ion,ionomy/ion | test/functional/test_framework/__init__.py | rejected_lint | Too many lint violations: 19 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2016, the cclib development team\n#\n# This file is part of cclib (http://cclib.github.io) and is distributed under\n# the terms of the BSD 3-Clause License.\n\n\"\"\"A library for parsing and int... | python | edit | 7 | 0 | bsd-3-clause | d2cbcad65914ccd26b57dcec12c048c3524ecdc4 | langner/cclib,gaursagar/cclib,ATenderholt/cclib,cclib/cclib,berquist/cclib,berquist/cclib,langner/cclib,berquist/cclib,ATenderholt/cclib,gaursagar/cclib,langner/cclib,cclib/cclib,cclib/cclib | src/cclib/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport github3\n\nfrom .helper import IntegrationHelper\n\n\ndef find(func, iterable):\n return next(filter(func, iterable))\n\n\nclass TestDeployment(IntegrationHelper):\n def test_create_status(self):\n \"\"\"\n Test t... | python | edit | 1 | 2 | bsd-3-clause | 807f0e14acf7685c2655c6843423104ffc9bb015 | icio/github3.py,jim-minter/github3.py,itsmemattchung/github3.py,agamdua/github3.py,wbrefvem/github3.py,christophelec/github3.py,balloob/github3.py,h4ck3rm1k3/github3.py,krxsky/github3.py,degustaf/github3.py,ueg1990/github3.py,sigmavirus24/github3.py | tests/integration/test_repos_deployment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom starlette.applications import Starlette\nfrom starlette.middleware.httpsredirect import HTTPSRedirectMiddleware\nfrom starlette.responses import PlainTextResponse\nfrom starlette.testclient import TestClient\n\n\ndef test_https_redirec... | python | edit | 1 | 1 | bsd-3-clause | be202ab0f991dad50a4eaf200f4a719c99b8bab2 | encode/starlette,encode/starlette | tests/middleware/test_https_redirect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Solution:\n def bubbleSortOptimized(self, nums: List[int]) -> None:\n if len(nums) == 1:\n return nums\n else:\n swapped = False\n while not swapped:\n swapped = True\n ... | python | edit | 1 | 5 | cc0-1.0 | 5fbf5bac84a7ededde99e109d206681af99c112c | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | sort/bubble_sort_optimized/python/bubble_sort_optimized.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom imhotep.tools import Tool\nfrom collections import defaultdict\nimport re\n\n\nclass JSL(Tool):\n regex = re.compile(\n r'^(?P<type>[WE]) '\n r'(?P<filename>.*?) L(?P<line_number>\\d+): (?P<message>.*)$')\n\n def in... | python | edit | 1 | 6 | mit | 76ca05a20fcdf36dc81d3ec98048f89f98325d68 | hayes/imhotep_jsl | imhotep_jsl/plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A module containg a core representation of IATI Rulesets.\"\"\"\n\n\nclass Ruleset(object):\n \"\"\"Representation of a Ruleset as defined within the IATI SSOT.\"\"\"\n\n pass\n\n\nclass Rule(object):\n \"\"\"Representation o... | python | edit | 1 | 0 | mit | 0e7be2adf1101ae842dddb3db3217957a8e5957f | IATI/iati.core,IATI/iati.core | iati/core/rulesets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django import template\nfrom Instanssi.kompomaatti.models import Compo, Competition\n\nregister = template.Library()\n\n@register.inclusion_tag('kompomaatti/compo_nav_items.html')\ndef render_base_compos_nav(... | python | edit | 1 | 1 | mit | 77ff64c858aa21c9651ccf58c95b739db45cd97b | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | Instanssi/kompomaatti/templatetags/kompomaatti_base_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import defaultdict\nimport json\nimport sys \n\nfrom base_edx import EdXConnection\nfrom generate_csv_report import CSV \n\ndb_name = sys.argv[1]\n\n# Change name of collection as required\nconnection = EdXConnection(db_nam... | python | edit | 4 | 0 | mit | 04eae79deb30e63f68534784f1eaf0412cfb1aa9 | andyzsf/edx_data_research,andyzsf/edx_data_research,McGillX/edx_data_research,McGillX/edx_data_research,McGillX/edx_data_research | reporting_scripts/forum_data.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom steel.common import Remainder\r\nfrom steel.common.fields import *\r\n\r\nfrom steel.byte.base import *\r\nfrom steel.fields import *\r\n\n```\n\nApply this change: Update the bits package to use new imports"
},
{
"role": "assi... | python | edit | 6 | 0 | bsd-3-clause | a977f0540410e5994405f3f6e579e866f1e3c119 | gulopine/steel | steel/bits/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# coding UTF-8\n\nimport yaml\n\nimport rospy\nfrom goal_sender_msgs.srv import ApplyGoals\nfrom goal_sender_msgs.msg import GoalSequence\nfrom goal_sender_msgs.msg import Waypoint\n\ndef read_yaml(path):\n f = ope... | python | edit | 4 | 2 | bsd-3-clause | bf46ceea3c77f87768be7773fe2b26112a151606 | CIR-KIT/fifth_robot_pkg,CIR-KIT/fifth_robot_pkg,CIR-KIT/fifth_robot_pkg | src/waypoints_reader/scripts/yaml_reader.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\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.apach... | python | edit | 1 | 2 | apache-2.0 | 2c357a54e30eecb1d7b717be3ed774dcfecc2814 | stratis-storage/stratis-cli,stratis-storage/stratis-cli | src/stratis_cli/_actions/_stratis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf8\nfrom __future__ import unicode_literals\nimport pytest\nfrom flexmock import flexmock\nfrom hypothesis import given, strategies\nimport abc\n\nfrom .... import vec2vec\nfrom ....ops import NumpyOps\n\n\n@pytest.fixture\nde... | python | edit | 7 | 4 | mit | c2fd8515666476cc0b6760b72b6cd71ef030e6f4 | explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | thinc/neural/tests/unit/Affine/test_init.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add stub for inactive project test"
},
{
"role": "assistant",
"content": "\"\"\"\nTests for inactive projects.\n\"\"\"\n\nimport pytest\n\nfrom tests.utils import VuforiaServerCredentials\n\n\n@pytest.mark.usefixtures('verify_moc... | python | new_file | 1 | 1 | mit | f0daa1674ef6fd59173fe7d1904f8598f7418f8b | adamtheturtle/vws-python,adamtheturtle/vws-python | tests/mock_vws/test_inactive_project.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.conf import settings\nfrom django.contrib import admin\n\nfrom molly.conf import applications\n\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n (r'adm/(.*)', admin.site.root),\n\... | python | edit | 6 | 0 | apache-2.0 | 3e4eacae396f2101b677859ea01f8b225fa957d2 | mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject | branches/extracting_oxford/molly/demos/molly_oxford/urls.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2012 theo crevon\n#\n# See the file LICENSE for copying permission.\n\nfrom clint.textui import puts, colored\n\nfrom elevator.utils.patterns import destructurate\n\nfrom .helpers import FAILURE_ST... | python | edit | 2 | 3 | mit | d0f18bed554c58873776eefba5b2be1d60926f95 | oleiade/Elevator | elevator_cli/io.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom geoserver.support import ResourceInfo, atom_link\n\nclass Style(ResourceInfo):\n def __init__(self,catalog, node):\n self.catalog = catalog\n self.name = node.find(\"name\").text \n self.href = atom_link(node)\n self.up... | python | edit | 1 | 3 | mit | 22499afe4e434377e449226c5b073251165f4151 | cristianzamar/gsconfig,Geode/gsconfig,scottp-dpaw/gsconfig,boundlessgeo/gsconfig,afabiani/gsconfig,garnertb/gsconfig.py | src/geoserver/style.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from django.conf.urls import patterns, url\nexcept ImportError:\n # Django < 1.4\n from django.conf.urls.defaults import patterns, url\n\nfrom avatar import views\n\nurlpatterns = patterns('',\n url(r'^add/$', views.add, ... | python | edit | 2 | 0 | bsd-3-clause | af45e43c46a22f3168ab946bf914a45eae9ade19 | ad-m/django-avatar,ad-m/django-avatar,grantmcconnaughey/django-avatar,grantmcconnaughey/django-avatar,jezdez/django-avatar,jezdez/django-avatar,MachineandMagic/django-avatar,MachineandMagic/django-avatar | avatar/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import ModelForm, Textarea, ChoiceField\nfrom django.utils.functional import lazy\n\nfrom .models import Meeting, Folder\n\nMD_INPUT = {\n 'class': 'markdown-input'\n}\n\n\ndef sorted_folders():\n return sorted([(x.p... | python | edit | 1 | 2 | isc | f48066555e6a4f778887b0600e13b304d36c9529 | ashbc/tgrsite,ashbc/tgrsite,ashbc/tgrsite | minutes/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef get_dtype(parameter_value):\n \"\"\"Get the TopoFlow data type of a parameter.\n\n Parameters\n ----------\n parameter_value : object\n An object, a scalar.\n\n \"\"\"\n try:\n float(parameter_value)\n e... | python | edit | 1 | 4 | mit | 99952c977eee74ecc95a6af4b2867738850bc435 | csdms/topoflow-utils | topoflow_utils/hook.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport os\nimport unittest\nfrom flask import Flask\nfrom coaster.utils import buid\nfrom coaster.sqlalchemy import BaseMixin\nfrom nodular.db import db\n\n\nclass User(BaseMixin, db.Model):\n __tablename__ = '... | python | edit | 1 | 1 | bsd-2-clause | 3341ba14250f086ab11aa55d8d72de14fe95aceb | hasgeek/nodular,hasgeek/nodular | tests/test_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom s2f.Sanitize import (\n sanitize_prefix,\n sanitize_for_latex\n)\n\nclass TestSanitize(unittest.TestCase):\n \"\"\" Test case for the Sanitize module \"\"\"\n def testSanitizePrefix(self):\n \"\"\"... | python | edit | 1 | 1 | mit | 0f51a231b3b11e89a82a429be0adb6422fd01d8b | kdungs/lhcb-hltflow | tests/test_Sanitize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom coverage import coverage\n\ncov = coverage(source=('doubles',))\ncov.start()\n\nfrom doubles.pytest import pytest_runtest_call # noqa\n\n\ndef pytest_sessionfinish(session, exitstatus):\n cov.stop()\n\n\ndef pytest_terminal_summary... | python | edit | 2 | 1 | mit | 1b325d5d910039a3702db8a1b00127870625b209 | uber/doubles | test/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nDATABASES = {'default':{\n 'NAME':':memory:',\n 'ENGINE':'django.db.backends.sqlite3'\n}}\n\n# install the bare minimum for\n# testing django-brake\nINSTALLED_APPS = (\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n ... | python | edit | 3 | 0 | bsd-3-clause | 95c2f9b9b0a64611a482d25993b0fa289f19ece8 | SilentCircle/django-brake,skorokithakis/django-brake,skorokithakis/django-brake,SilentCircle/django-brake | test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nROOT_URLCONF = 'tests.urls'\nINSTALLED_APPS = [\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.sites',\n 'tests.app',\n]\n\nSTATIC_URL = '/static/'\nSECRE... | python | edit | 1 | 0 | bsd-3-clause | e6a1e9670e857119c7e6c9250849ee4edd026bad | ktosiek/pytest-django,RonnyPfannschmidt/pytest_django,pombredanne/pytest_django,hoh/pytest-django,davidszotten/pytest-django,ojake/pytest-django,bforchhammer/pytest-django,reincubate/pytest-django,pelme/pytest-django,thedrow/pytest-django,aptivate/pytest-django,tomviner/pytest-django,felixonmars/pytest-django | tests/settings_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nversion='0.9.7'\n\nimport os\nsvn_version_file = os.path.join(os.path.dirname(__file__),\n 'core','__svn_version__.py')\nif os.path.isfile(svn_version_file):\n import imp\n svn = imp.load_module('numpy.c... | python | edit | 1 | 0 | bsd-3-clause | 2bbc289ce21365e18b04cb865328c494b75075fd | Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,Ademan/NumPy-GSoC,chadnetzer/numpy-gaurdro,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,efiring/numpy-work,jasonmccampbell/numpy-refactor-sprint,teoliphant/numpy-refactor,chadnetzer/numpy-gaurdro,teoliphant/numpy-refactor,chadnetzer/numpy... | numpy/version.py | rejected_duplicate | Near-duplicate of sample 3688 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .umap_ import UMAP\n\n# Workaround: https://github.com/numba/numba/issues/3341\nimport numba\n\nimport pkg_resources\n\n__version__ = pkg_resources.get_distribution(\"umap-learn\").version\n\n```\n\nApply this change: Patch init import... | python | edit | 4 | 0 | bsd-3-clause | 64750014a91669b6067459a14743a6c5e6257856 | lmcinnes/umap,lmcinnes/umap | umap/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest, rainflow\r\n\r\nclass TestRainflowCounting(unittest.TestCase):\r\n series = [0, -2, 1, -3, 5, -1, 3, -4, 4, -2, 0]\r\n cycles = [(3, 0.5), (4, 1.5), (6, 0.5), (8, 1.0), (9, 0.5)]\r\n \r\n def test_rainflow_count... | python | edit | 1 | 2 | mit | c4c9115e7f67a6cc80b283cb0c2cc0e378e08ab8 | iamlikeme/rainflow | tests/test_rainflow.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns, url\n\nfrom oscar.core.application import Application\n\nfrom ticketing import views\n\n\nclass TicketingApplication(Application):\n name = 'ticketing'\n\n ticket_list_view = views.Ticke... | python | edit | 1 | 1 | bsd-3-clause | 63f7ba49a3577a35de59490185ae9c06c20e1cc8 | snowball-one/django-oscar-support,snowball-one/django-oscar-support,snowball-one/django-oscar-support | ticketing/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nSECRET_KEY = 'fake_secret'\n\nROOT_URLCONF = 'tests.test_urls'\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': ':memory:',\n }\n}\n\nMIDDLEWARE_... | python | edit | 1 | 0 | mit | 757c2552c360be67ee5841c12c0da005afe631b0 | thomasw/djproxy | tests/test_settings.py | rejected_duplicate | Near-duplicate of sample 19175 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom matrix import Matrix\n\n\nclass MatrixTest(unittest.TestCase):\n def test_extract_a_row(self):\n matrix = Matrix(\"1 2\\n10 20\")\n self.assertEqual([1, 2], matrix.rows[0])\n\n def test_extract_sa... | python | edit | 1 | 1 | mit | 8bebd6f9c785333f670167e477f96944d1f45534 | mweb/python,jmluy/xpython,ZacharyRSmith/xpython,outkaj/xpython,pheanex/xpython,Peque/xpython,behrtam/xpython,exercism/python,exercism/xpython,N-Parsons/exercism-python,behrtam/xpython,smalley/python,mweb/python,pombredanne/xpython,de2Zotjes/xpython,orozcoadrian/xpython,wobh/xpython,exercism/xpython,oalbe/xpython,rootul... | matrix/matrix_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport testinfra.utils.ansible_runner\n\ntestinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(\n os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')\n\n# check if MongoDB is listen concrete host and port\ndef t... | python | edit | 1 | 1 | mit | a0114088c9b9ec1bf52ef2c9cfb46743754fe4e1 | DmitriySh/infra,DmitriySh/infra,DmitriySh/infra | vagrant/roles/db/molecule/default/tests/test_default.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport renpy\nimport os\nimport sys\nimport modinfo\nimport importlib\n\nprint('AWSW Mod Loader Init')\n\ndef get_mod_path():\n \"\"\"Get the mod path\n\n Returns:\n The full path to the mods folder\n \"\"\"\n #TODO: Use ... | python | edit | 1 | 1 | mit | 3dc92d34f80762899959b2721bfcfcac78bcb069 | AWSW-Modding/AWSW-Modtools | modloader/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport logging\nimport time\n\nimport base\nfrom kcaa import screens\n\n\nlogger = logging.getLogger('kcaa.manipulators.automission')\n\n\nclass CheckMissionResult(base.Manipulator):\n\n def run(self):\n l... | python | edit | 2 | 7 | apache-2.0 | 01f2e41608e83fb4308c44c30ac9bb4fc6d49c86 | kcaa/kcaa,kcaa/kcaa,kcaa/kcaa,kcaa/kcaa | server/kcaa/manipulators/automission.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport itertools as it\n\nall_sizes = [0.7, 1.0, 1.6, 3.5, 5.0]\nall_types = ['Color', 'Texture', 'Edge', 'Orientation']\n\nfull_feature_set = list(it.product(all_types, all_sizes))\ndefault_feature_set = list(it.product(all_ty... | python | edit | 2 | 4 | bsd-3-clause | 0fbd183a95c65eb80bb813368eeb045e9c43b630 | janelia-flyem/gala,jni/gala,jni/ray | ray/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rich import filesize\n\n\ndef test_traditional():\n assert filesize.decimal(0) == \"0 bytes\"\n assert filesize.decimal(1) == \"1 byte\"\n assert filesize.decimal(2) == \"2 bytes\"\n assert filesize.decimal(1000) == \"1.0 k... | python | edit | 1 | 1 | mit | bad2fea8a3a8e7a7d1da9ee83ec48657824eaa07 | willmcgugan/rich | tests/test_filesize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport os\n\n__version__ = VERSION = \"0.3.0\"\n\n\ndef get_fancypages_paths(path, use_with_oscar=False):\n \"\"\" Get absolute paths for *path* relative to the project root \"\"\"\n paths = [... | python | edit | 1 | 2 | bsd-3-clause | 390f7ff95755feadc25236feb1eb92655e113b38 | tangentlabs/django-fancypages,tangentlabs/django-fancypages,tangentlabs/django-fancypages | fancypages/__init__.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.utils.safestring import mark_safe\n\n\nclass ColorPickerWidget(forms.TextInput):\n class Media:\n css = {\n \"all\": (\"%s/%s\" % (settings.STATIC_... | python | edit | 1 | 1 | mit | 402f71cc65f714cf880c9c9569e83f5bcd47ec72 | jamescw/django-paintstore,jamescw/django-paintstore | paintstore/widgets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom web_test_base import *\n\nclass TestIATIValidator(WebTestBase):\n requests_to_load = {\n 'IATI Validator': {\n 'url': 'http://validator.iatistandard.org/'\n }\n }\n\n def test_contains_l... | python | edit | 9 | 1 | mit | 43edc7a519cb2e7c49a112f816c5192908ac7e6b | IATI/IATI-Website-Tests | tests/test_validator.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSimple Bar Chart with Labels\n============================\nThis example shows a basic horizontal bar chart with labels created with Altair.\n\"\"\"\n# category: bar charts\nimport altair as alt\nimport pandas as pd\n\nsource = pd.D... | python | edit | 1 | 0 | bsd-3-clause | bc1e8baeb2698462dae5556e033c37a505cfcb2c | altair-viz/altair,jakevdp/altair | altair/examples/bar_chart_with_labels.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nfrom px import px_rambar\nfrom px import px_terminal\n\n\ndef test_render_bar_happy_path():\n names_and_numbers = [(u\"apa\", 1000), (u\"bepa\", 300), (u\"cepa\", 50)] + [\n (u\"long tail\", 1)\n ] * 30... | python | edit | 4 | 1 | mit | 7b9b144ce8e7fca38500f5f0c4e2f5ec3b5d9e0f | walles/px,walles/px | tests/px_rambar_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__all__ = (\n 'Category',\n)\n\n\nclass Category(tuple):\n \"\"\"\n This type acts as tuple with one key difference - two instances of it are\n equal only when they have the same type. This allows you to easily mitigate\n col... | python | edit | 1 | 2 | apache-2.0 | c32165b680356fe9f1e422a1d11127f867065f94 | msiedlarek/wiring,msiedlarek/wiring | wiring/categories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"General tools which don't depend on other parts of Parsimonious\"\"\"\n\nimport ast\nfrom sys import version_info\n\nfrom six import python_2_unicode_compatible\n\n\nclass StrAndRepr(object):\n \"\"\"Mix-in to add a ``__str__`` and... | python | edit | 1 | 1 | mit | c2789dd620a6f6d4c08e4608e94656a0d2b906c7 | lucaswiman/parsimonious,erikrose/parsimonious | parsimonious/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import division\nimport sys\n\nimport pytest\n\nfrom profiling.sampling import SamplingProfiler\nfrom profiling.sampling.samplers import ItimerSampler\nfrom utils import find_stat, spin\n\n\ndef spin... | python | edit | 1 | 1 | bsd-3-clause | 72f93daa9d47a37e374605610043a24731aef7a8 | sublee/profiling,JeanPaulShapo/profiling,JeanPaulShapo/profiling,what-studio/profiling,what-studio/profiling,sublee/profiling | test/test_sampling.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013, Mark Peek <<EMAIL>>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject, AWSProperty\n\n\nclass Target(AWSProperty):\n props = {\n 'Arn': (basestring, True),\n '... | python | edit | 10 | 0 | bsd-2-clause | 94a55dfc68fcd2352f867b01fc703a202c87f453 | pas256/troposphere,pas256/troposphere,ikben/troposphere,7digital/troposphere,ikben/troposphere,cloudtools/troposphere,7digital/troposphere,johnctitus/troposphere,johnctitus/troposphere,cloudtools/troposphere | troposphere/events.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\nfrom sklearn.feature_selection import SelectKBest, f_classif\n\ndef select_kbest_clf(data_frame, target, k=4):\n \"\"\"\n Selecting K-Best features for classification\n :param data_frame: A pandas dataFrame wit... | python | edit | 1 | 1 | mit | d7d1200846a3e19eb9399b3c47ec553e8c118046 | samshara/Stock-Market-Analysis-and-Prediction | smap-nepse/preprocessing/feat_select.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport npc\nimport os\nfrom tests.util import fixture_dir\n\n@pytest.fixture\ndef settings():\n return npc.settings.Settings()\n\ndef test_creation(settings):\n assert settings is not None\n\ndef test_override(settings)... | python | edit | 4 | 1 | mit | 2bebbbfc12e1013e3c5c0a42329bac520c574b9b | aurule/npc,aurule/npc | tests/test_settings.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\nimport os\nimport sys\nimport subprocess\nfrom importlib import import_module\n\n\nif __name__ == '__main__':\n # Test using django.test.runner.DiscoverRunner\n os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.se... | python | edit | 1 | 0 | mit | 6b9c9f98ce10db9e9a767c1ae81c0655c9d4d28c | henriquebastos/django-test-without-migrations,henriquebastos/django-test-without-migrations | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" MongoHN.forms - WTForms used by MongoHN \"\"\"\n\nfrom MongoHN.models import User\nfrom flask.ext.wtf import Form\nfrom wtforms import SubmitField, TextField, BooleanField, PasswordField\nfrom wtforms.validators import Required, Data... | python | edit | 1 | 4 | mit | 79ff39c4d6a5ad91a32cfdc7b59a89fa5461d244 | bsandrow/MongoHN,bsandrow/MongoHN | MongoHN/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom django.contrib import admin\nfrom .models import Report\n\nclass ReportAdmin(admin.ModelAdmin):\n list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at')\n list_filt... | python | edit | 1 | 0 | mit | 543c7307f26553d78bf3f18b5f93a2bc23cfb875 | Hackfmi/Diaphanum,Hackfmi/Diaphanum | reports/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2\nfrom scapy.all import *\n\ndef airplay_callback(pkt):\n\ttry:\n\t\tif pkt['Raw'].load[0:5] == 'SETUP':\n\t\t\t# Someone is starting to play! Add them to the list yo\n\t\t\twith open('/tmp/playing.txt', 'w') as f:\n\t... | python | edit | 3 | 6 | bsd-2-clause | d50703ee3da5feb264c53d622c039a0bde67d233 | ss23/airplay-control-intercept,ss23/airplay-control-intercept,ss23/airplay-control-intercept | airplay-sniff.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport construct\n\nfrom tlsenum import hello_constructs\n\n\nclass ClientHello(object):\n\n @property\n def protocol_version(self):\n return self._protocol_version\n\n @protocol_version.setter\n def protocol_version(self... | python | edit | 1 | 5 | mit | 7a8569fb28a1214b4898b113c384eb3967c656ef | Ayrx/tlsenum,Ayrx/tlsenum | tlsenum/parse_hello.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# third party\nfrom pydantic import BaseSettings\n\n# relative\nfrom ...adp.adversarial_accountant import AdversarialAccountant\nfrom ..abstract.node_service_interface import NodeServiceInterface\nfrom ..common.node_manager.association_requ... | python | edit | 1 | 0 | apache-2.0 | c553db9e84344897ca995f56c710944da88c0a56 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/syft/src/syft/core/node/domain/domain_interface.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport enum\n\nfrom sqlalchemy import Column, String, Boolean, Integer, DateTime, Enum\n\nfrom virtool.postgres import Base\n\n\nclass UploadType(str, enum.Enum):\n hmm = \"hmm\"\n reference = \"reference\"\n reads = \"reads\"\n ... | python | edit | 1 | 1 | mit | c64a9a586a5997c3a5a8683913e6a52075618ac8 | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool | virtool/uploads/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom base import BaseMatcher\nimport os\nimport requests\nimport re\nimport json\n\n\nNUM_REGEX = r'\\b\\#?(\\d\\d\\d\\d?\\d?)\\b'\nAPI_KEY = os.environ.get('SIFTER')\n\n\ndef find_ticket(number):\n headers = {\n 'X-Sifter-Token':... | python | edit | 1 | 3 | bsd-2-clause | 1089413956f3eff9d233d276ebe728e89d814096 | honza/nigel | matchers/sifter.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\"\"\" Test load qc configurations (utils.load_cfg)\n\"\"\"\n\nimport pkg_resources\n\nfrom cotede.utils import load_cfg\n\n\nCFG = [f[:-5] for f in pkg_resources.resource_listdir('cotede', ... | python | edit | 1 | 2 | bsd-3-clause | 662791d49deb945e911be5e07af2bbb3499a45ca | castelao/CoTeDe | tests/test_load_cfg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom tests.integrations.base import BaseTest\n\n\nclass TestReadCurrentView(BaseTest):\n def test_listdirs(self):\n dirs = set(os.listdir(\"%s/current\" % self.mount_path))\n assert dirs == set(['testing', 'me'... | python | edit | 3 | 2 | apache-2.0 | f6df4f359b3d949b3f87a22bda1a78237c396aef | bussiere/gitfs,PressLabs/gitfs,ksmaheshkumar/gitfs,rowhit/gitfs,PressLabs/gitfs | tests/integrations/current/test_read.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport uuid\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom opencivicdata.models.people_orgs import Person\n\n\nclass Preferences(models.Model):\n user = models.OneToOneField(User, related_name='preferenc... | python | edit | 1 | 0 | mit | c95d78378c7b3b234439e1d9a9bc41539b9080f5 | jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot | preferences/models.py | rejected_duplicate | Near-duplicate of sample 4762 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n# Represents a category which articles can be part of\nclass Category(models.Model):\n name = models.CharField(max_length=255)\n slug = models.SlugField(max_length=255)\n\n def __str__(self):\n ... | python | edit | 4 | 3 | mit | d79fde9a1bceea2ea8bc9aa8d14e5ec66a44600d | grundleborg/mesosphere | mesoblog/models.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\"\"\" pykwalify \"\"\"\n\n# python stdlib\nimport logging\nimport logging.config\nimport os\n\n__author__ = 'Grokzen <<EMAIL>>'\n__version_info__ = (1, 6, 0)\n__version__ = '.'.join(map(str, __version_info__))\n\... | python | edit | 1 | 2 | mit | dc8a2d710acbdf79444d05cc266b9f1ef13e838e | grokzen/pykwalify | pykwalify/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport matplotlib.pyplot as plt\nfrom matplotlib.dates import DateFormatter\nfrom matplotlib.ticker import FormatStrFormatter\nfrom tempfile import NamedTemporaryFile\n\n\ndef plot_to_file(symbol, timestamp, close, score):\n fig, ax1 = p... | python | edit | 1 | 1 | mit | c91e42c32d8314d3d156c577f854fa311c5b1b67 | cjluo/money-monkey | model_presenter.py | rejected_duplicate | Near-duplicate of sample 774 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport os\nimport logging\nimport threading\n\n\nclass Logger(object):\n def configure_logging(self):\n log_level = getattr(logging, os.environ.get('LOGLEVEL', 'INFO').upper())\n logging.getLogger... | python | edit | 1 | 4 | mit | 8492e70a50abe4641d96b7ecdd0e7f583167b755 | CloudHeads/lambda_utils | lambda_utils/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" This module contains functions used by the test cases to hide the\narchitecture and/or the platform dependent nature of the tests. \"\"\"\n\ndef check_first_register_readable(test_case):\n if test_case.getArchitecture() in ['x86_6... | python | edit | 1 | 3 | apache-2.0 | 0aac6e12a66cec9021a7f5ad0e6beb8821a82d1d | apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb | test/lldbplatformutil.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom allauth.socialaccount import providers\nfrom allauth.socialaccount.providers.base import ProviderAccount\nfrom allauth.socialaccount.providers.oauth2.provider import OAuth2Provider\n\n\nclass HelsinkiAccount(ProviderAccount):\n def ... | python | edit | 1 | 5 | bsd-2-clause | 9e1ea2d7ec5c8e7cfd0c1a15f552b1d5dcdd7546 | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | helusers/providers/helsinki/provider.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport httplib as http\n\nfrom flask import redirect\n\nfrom framework.auth.decorators import must_be_logged_in\nfrom framework.exceptions import HTTPError\nfrom website.oauth.models import ExternalAccount\nfrom website.oauth.utils import g... | python | edit | 1 | 4 | apache-2.0 | cc99acd8381522e02703497121201cafd2f820a4 | caseyrygt/osf.io,hmoco/osf.io,mluo613/osf.io,baylee-d/osf.io,erinspace/osf.io,amyshi188/osf.io,zkraime/osf.io,Johnetordoff/osf.io,zachjanicki/osf.io,mfraezz/osf.io,caneruguz/osf.io,himanshuo/osf.io,revanthkolli/osf.io,GageGaskins/osf.io,HalcyonChimera/osf.io,zachjanicki/osf.io,HalcyonChimera/osf.io,ZobairAlijan/osf.io,... | website/oauth/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Taken from jinja2. Thanks, Armin Ronacher.\n# See also http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide\n\n\nfrom lib2to3 import fixer_base\nfrom lib2to3.fixer_util import Name, BlankLine\n\n\nclass FixAltUnicode(fixer_base.B... | python | edit | 1 | 1 | mit | b37814280dc06dbf8aefec4490f6b73a47f05c1a | live-clones/pybtex | custom_fixers/fix_alt_unicode.py | rejected_duplicate | Near-duplicate of sample 137 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python2.5\n#\n# Copyright 2009 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licen... | python | edit | 1 | 1 | apache-2.0 | 1dfb9fd979206af415e20fc58b905c435a187008 | MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging | app/soc/models/grading_project_survey.py | rejected_duplicate | Near-duplicate of sample 11623 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python3\n# Python Challenge - 31\n# http://www.pythonchallenge.com/pc/ring/grandpa.html\n# http://www.pythonchallenge.com/pc/rock/grandpa.html\n# Username: repeat; Password: switch\n# Keyword: kohsamui, thailand;\n\n'''\nUs... | python | edit | 6 | 2 | mit | 2edd0ee699cfc0ef66d27ccb87ddefad26aa1a77 | HKuz/PythonChallenge | Challenges/chall_31.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file handles differences between BGL and PyOpenGL, and provides various\n# utility functions for OpenGL\n\ntry:\n\tfrom OpenGL.GL import *\n\tfrom OpenGL.GLU import *\n\tfrom bgl import Buffer\n\tUSING_BGL = False\nexcept ImportError... | python | edit | 11 | 3 | mit | e08799591061e5b30723758a8c74e6118e9fe342 | Moguri/bgui,Moguri/bgui,Remwrath/bgui,marcioreyes/bgui | bgui/gl_utils.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add comment clarifying how it operates."
},
{
"role": "assistant",
"content": "import string\ndef untokenize(tokens):\n\t#Joins all tokens in the list into a single string.\n\t#If a token doesn't start with an apostrophe and isn'... | python | new_file | 1 | 4 | mit | 0a97195dc8bb5f6caf68d84b96631c26e0c8c348 | jmp3833/linguine-python,rigatoni/linguine-python,kmp3325/linguine-python,Pastafarians/linguine-python | linguine/untokenize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom prompt_toolkit.layout.toolbars import Toolbar\nfrom prompt_toolkit.layout.utils import TokenList\nfrom pygments.token import Token\n\nclass PGToolbar(Toolbar):\n def __init__(self, token=None):\n token = token or Token.Toolba... | python | edit | 1 | 4 | bsd-3-clause | 5ddaf8f653df98752ca67b8bfec9b8adfcf168b1 | nosun/pgcli,TamasNo1/pgcli,d33tah/pgcli,MattOates/pgcli,suzukaze/pgcli,zhiyuanshi/pgcli,dbcli/vcli,bitemyapp/pgcli,janusnic/pgcli,thedrow/pgcli,dbcli/pgcli,bitemyapp/pgcli,n-someya/pgcli,koljonen/pgcli,johshoff/pgcli,d33tah/pgcli,koljonen/pgcli,lk1ngaa7/pgcli,darikg/pgcli,w4ngyi/pgcli,j-bennet/pgcli,MattOates/pgcli,dar... | pgcli/pgtoolbar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nfrom geonature.core.command.main import main\nimport geonature.core.command.create_gn_module\n\n\n# Load modules commands\nfrom geonature.utils.env import ROOT_DIR\nplugin_folder = os.path.join(str(ROOT_DIR), 'exter... | python | edit | 6 | 2 | bsd-2-clause | 7ac48c9a474f5a0edd10121f58442326d6e8d75c | PnEcrins/GeoNature,PnEcrins/GeoNature,PnEcrins/GeoNature,PnEcrins/GeoNature | backend/geonature/core/command/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom .local import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': ':memory:',\n 'USER': '',\n 'PASSWORD': '',\n 'HOST': '',\n 'PORT': '',... | python | edit | 4 | 0 | mit | e1819c59cc5debde7da26a76fb9d2589b2ad6879 | sarutobi/flowofkindness,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/Rynda | Rynda/settings/test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom infosystem.database import db\nfrom infosystem.common.subsystem import entity\n\n\nclass Domain(entity.Entity, db.Model):\n\n attributes = ['active', 'name', 'parent_id']\n attributes += entity.Entity.attributes\n\n active = d... | python | edit | 1 | 1 | apache-2.0 | cb83a61df5ed82dd9af7ebd3c01d00a3d88e3491 | samueldmq/infosystem | infosystem/subsystem/domain/resource.py | rejected_duplicate | Near-duplicate of sample 13356 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAssembles the zone configurations for each quest\ninto one file. Every quest that is in quest_dir\nand every zone that is in each quest will be\nincluded.\n\nExample output:\n\n {\n quest1: [\n {\n ... | python | edit | 2 | 0 | apache-2.0 | 5a8275a498a84d2110f58c1dbde4e67ddfa3748c | lliss/pwd-waterworks-revealed,lliss/pwd-waterworks-revealed,azavea/pwd-waterworks-revealed,azavea/pwd-waterworks-revealed,azavea/pwd-waterworks-revealed,lliss/pwd-waterworks-revealed,azavea/pwd-waterworks-revealed,azavea/pwd-waterworks-revealed,lliss/pwd-waterworks-revealed,lliss/pwd-waterworks-revealed,lliss/pwd-water... | scripts/assemble_quests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\nfrom st2actions.runners.pythonrunner import Action\nfrom clicrud.device.generic import generic\nimport sys\n\n\nclass ConfigCommand(Action):\n\n def run(self, host, command, save):\n self.method = self.config['m... | python | edit | 1 | 6 | apache-2.0 | 044f1169b518628c8409a38845ffa5c18b7cb748 | StackStorm/st2contrib,StackStorm/st2contrib,StackStorm/st2contrib | packs/clicrud/actions/config_command.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport yaml\n\n_defaults = {\n \"bind_client\": [ \"tcp:6667:interface={::}\", \"ssl:6697:interface={::}\" ],\n \"bind_server\": []\n}\n\nclass Config(object):\n def __init__(self, configFileName):\n self._configData = {}\n ... | python | edit | 1 | 7 | bsd-3-clause | 6d924b21c40b5881d0b2c56b5550bf93f073e049 | ElementalAlchemist/txircd,Heufneutje/txircd | txircd/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport SimpleHTTPServer\n\n\nclass GitHubHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):\n \"\"\"\n Overrides the default request handler to handle GitHub custom 404 pages.\n (Pretty much a 404.html page in your root... | python | edit | 1 | 2 | mit | f4b50b12ae8ad4da6e04ddc186c077c31af00611 | clokep/SimpleHTTP404Server,clokep/SimpleHTTP404Server | SimpleHTTP404Server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tempfile\nimport h5py\nfrom numpy.testing import assert_allclose\nfrom os import path\nfrom distarray.local import LocalArray, save, load, save_hdf5\nfrom distarray.testing import comm_null_passes, MpiTestCase\n\n\nclass TestFlatFile... | python | edit | 1 | 1 | bsd-3-clause | f617c1ce192739594c161f717d5d04cc17ede22e | RaoUmer/distarray,enthought/distarray,RaoUmer/distarray,enthought/distarray | distarray/local/tests/paralleltest_io.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport itertools\n\nfrom rest_framework.response import Response\n\nfrom sentry import status_checks\nfrom sentry.api.base import Endpoint\nfrom sentry.api.permissions import SuperuserPermission\n\n... | python | edit | 1 | 2 | bsd-3-clause | 43291c827d2d7b0a350971b2efa26ca9e1c1e593 | gencer/sentry,zenefits/sentry,looker/sentry,alexm92/sentry,JackDanger/sentry,zenefits/sentry,alexm92/sentry,ifduyue/sentry,ifduyue/sentry,beeftornado/sentry,fotinakis/sentry,jean/sentry,JamesMura/sentry,BuildingLink/sentry,mvaled/sentry,BuildingLink/sentry,mvaled/sentry,mvaled/sentry,mvaled/sentry,JamesMura/sentry,beef... | src/sentry/api/endpoints/system_health.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a AioSparkApi class to set up the whole thing"
},
{
"role": "assistant",
"content": "import aiosparkapi.requests\nfrom .api.messages import Messages\nfrom .api.webhooks import Webhooks\nfrom .api.people import People\n\nimpor... | python | new_file | 1 | 1 | mit | cca17afe5ed3937713e86f9a8d9c3be0dcdf60b0 | martiert/aiosparkapi | aiosparkapi/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create some more nice figures"
},
{
"role": "assistant",
"content": "\"\"\"\n Create nice looking publication figures\n\"\"\"\n\nimport numpy as np\nimport networkx as nx\n\nimport seaborn as sns\nimport matplotlib as mpl\nimport... | python | new_file | 3 | 4 | mit | 8a16f7d51d34573d41846da25664b084ff6eb071 | kpj/SDEMotif,kpj/SDEMotif | publication_figures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Exports all data for the particular user for the particular day\n# Used for debugging issues with trip and section generation \nimport sys\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\nimport gzip\nimport json\n\nimport emiss... | python | edit | 2 | 0 | bsd-3-clause | 75cec3cef9fb73ec3a4068cc35dc33f3f492275b | sunil07t/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,shankari/e-mission-server | bin/public/extract_challenge_uuids.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nConstants used in UConnRCMPy.\n\"\"\"\nimport cantera\n\none_atm_in_torr = 760.0\n\"\"\"Conversion between atmosphere and Torr.\"\"\"\none_atm_in_bar = 1.01325\n\"\"\"Conversion between atmosphere and bar.\"\"\"\none_bar_in_pa = 1E5... | python | edit | 1 | 0 | bsd-3-clause | 139eac65c71c729e7500dfe894dc9686bd384ab4 | bryanwweber/UConnRCMPy | UConnRCMPy/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\n\nclass AttrDict(object):\n \"A case-insensitive attribute accessible dict-like object\"\n def __init__(self, name, *args, **kwargs):\n for key, value in dict(*args, **kwargs).iteritems():\n if not isins... | python | edit | 2 | 5 | bsd-2-clause | 610eeb064ba95e79617650d939ae5e9110b6ab89 | bruth/restlib2 | restlib2/structures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom flaskext.mongoalchemy import MongoAlchemy\nimport requests\n\nfrom api import app\nfrom api import db\n\n\nENDPOINT = 'http://data.nasa.gov/api/'\n\nclass Dataset(db.Document):\n \"\"\" Represents a dataset,\n we cou... | python | edit | 4 | 1 | mit | acbace21652d45a5fb17bbb487692ab6057313df | oxford-space-apps/open-data-api | api/parsers/datanasa.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nSYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {\n 'ExpressibleAsConditionElement': [\n 'ExpressibleAsConditionElementList'\n ],\n 'ExpressibleAsDeclBuildable': [\n 'ExpressibleAsCodeBlockItem',\n 'ExpressibleA... | python | edit | 1 | 0 | apache-2.0 | dd1e6cdf2f6f040f532863549df606083f3f4bf2 | JGiola/swift,apple/swift,gregomni/swift,atrick/swift,roambotics/swift,benlangmuir/swift,atrick/swift,roambotics/swift,ahoppen/swift,glessard/swift,apple/swift,ahoppen/swift,gregomni/swift,gregomni/swift,glessard/swift,atrick/swift,benlangmuir/swift,apple/swift,roambotics/swift,glessard/swift,benlangmuir/swift,gregomni/... | utils/gyb_syntax_support/protocolsMap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nGeneral management functions for salt, tools like seeing what hosts are up\nand what hosts are down\n'''\n\n# Import salt modules\nimport salt.client\nimport salt.cli.key\n\ndef down():\n '''\n Print a list of all the down or unr... | python | edit | 3 | 3 | apache-2.0 | 3535ea637112ef21fefd8df811721d271c109581 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/runners/manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glob\nimport numpy as np\nimport pandas as pd\n\ndef load_df(file_name):\n model_id = file_name.split('/')[4]\n df = pd.read_csv(file_name)\n df.rename(columns={'Unnamed: 0': 'split'}, inplace=True)\n df['model_id'] = mod... | python | edit | 1 | 2 | mit | b80eae0285af97d8fe954a5df667e03b004efa12 | bzamecnik/ml-playground,bzamecnik/ml-playground,bzamecnik/ml,bzamecnik/ml,bzamecnik/ml | instrument-classification/leaderboard.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom random import choice\n\nfrom sazabi.types import SazabiBotPlugin\n\n\nclass Joke(SazabiBotPlugin):\n async def parse(self, client, message, *args, **kwargs):\n if message.content == \"~joke\":\n re... | python | edit | 3 | 4 | mit | c34960e07ccce749a7fb5e53ff7593b87fe453d7 | frankzhao/sazabi,frankzhao/sazabi | sazabi/plugins/joke.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport mock\nimport completor\nfrom completor.compat import to_unicode\nfrom completers.go import Go # noqa\n\n\ndef test_format_cmd(vim_mod):\n vim_mod.funcs['line2byte'] = mock.Mock(return_value=20)\n vim... | python | edit | 1 | 1 | mit | 4377cb01932fb6cb9d324f98c55b4467e803add5 | maralla/completor.vim,maralla/completor.vim | tests/test_go.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport multiprocessing\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand, CommandError\n\nfrom core.models import WebPage, PageScrapeResult\nfrom core.views import scrape_url\n\n\nclas... | python | edit | 4 | 4 | mit | c5fe052756f9fe2bfe091d24fabcb6be02bda763 | theju/atifier,theju/atifier | server/core/management/commands/poll_urls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom app import create_app, configure_settings, db\n\n\nclass AppTestCase(unittest.TestCase):\n def setUp(self):\n self.app = create_app('testing')\n self.app_ctx = self.app.app_context()\n self.ap... | python | edit | 1 | 2 | mit | 3642fefbb1d4b5f2aeead54135ac37f0a5b635cd | Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger | tests/general.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.