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\n#!/usr/bin/env python\n\"\"\"\nRandom graph from given degree sequence.\n\"\"\"\n__author__ = \"\"\"Aric Hagberg (<EMAIL>)\"\"\"\n__date__ = \"$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $\"\n__credits__ = \"\"\"\"\"\"\n__revision__... | python | edit | 5 | 0 | bsd-3-clause | dfe1213ba9de5e5e5aaf9690a2cf5e3b295869fa | RMKD/networkx,jakevdp/networkx,JamesClough/networkx,jni/networkx,harlowja/networkx,debsankha/networkx,andnovar/networkx,tmilicic/networkx,ghdk/networkx,goulu/networkx,RMKD/networkx,dmoliveira/networkx,beni55/networkx,chrisnatali/networkx,wasade/networkx,nathania/networkx,jakevdp/networkx,blublud/networkx,kernc/networkx... | examples/graph/degree_sequence.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport matplotlib.pyplot as plt\nfrom operator import gt, lt, itemgetter\nfrom lxml.etree import fromstring, XMLSyntaxError\n\n\ndef frange(start, stop, step):\n cur = start\n op = gt if start > stop else lt\n\n while op(cur, stop)... | python | edit | 1 | 5 | mit | 981a74b116081f3ce1d97262c3c88104a953cdf4 | Mause/statistical_atlas_of_au | saau/sections/misc/header.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\nfrom haystack import indexes\nfrom haystack import site\n\nfrom publicbody.models import PublicBody\nfrom helper.searchindex import QueuedRealTimeSearchIndex\n\n\nPUBLIC_BODY_BOOSTS = getattr(settings, \"... | python | edit | 2 | 2 | mit | b3ddba27c92f36ee9534903b43ff632daa148585 | CodeforHawaii/froide,ryankanno/froide,okfse/froide,stefanw/froide,CodeforHawaii/froide,catcosmo/froide,LilithWittmann/froide,ryankanno/froide,stefanw/froide,fin/froide,okfse/froide,LilithWittmann/froide,catcosmo/froide,fin/froide,okfse/froide,okfse/froide,fin/froide,ryankanno/froide,LilithWittmann/froide,catcosmo/froid... | froide/publicbody/search_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose.tools import raises\n\nimport panoptes\nfrom panoptes.mount.ioptron import Mount\n\nclass TestIOptron():\n\n\t@raises(AssertionError)\n\tdef test_no_config_no_commands(self):\n\t\t\"\"\" Mount needs a config \"\"\"\n\t\tmount = Mo... | python | edit | 6 | 1 | mit | 6ad4796030aab2f6dbf8389b4030007d0fcf8761 | Guokr1991/POCS,joshwalawender/POCS,AstroHuntsman/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,Guokr1991/POCS,Guokr1991/POCS,Guokr1991/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,fmin2958/POCS,joshwalawender/POCS,fmin2958/POCS,fmin2958/POCS | panoptes/test/mount/test_ioptron.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass IRCMessage:\n\n \"\"\" Class to store and parse an IRC Message. \"\"\"\n\n def __init__(self, msg):\n \"\"\" Parse a raw IRC message to IRCMessage. \"\"\"\n self.sender = None\n self.nick = None\n sel... | python | edit | 1 | 3 | mit | 9926cbb1919b96999d479f5a8d67e17ce71a1091 | Motoko11/MotoBot | motobot/irc_message.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n\n\"\"\" Main script. Executes the XML Server implementation with an HTTP\n connection and default parameters.\n\"\"\"\n\nimport sys\nimport argparse\nfrom server import ... | python | edit | 3 | 0 | apache-2.0 | 24d4fee92c1c2ff4bac1fe09d9b436748234a48c | Solucionamos/dummybmc | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# coding: utf-8\n# Raytheon BBN Technologies 2016\n# Contributiors: Graham Rowlands\n#\n# This file runs the main loop\n\n# Use PyQt5 by default\nimport os\nos.environ[\"QT_API\"] = 'pyqt5'\n\nfrom qtpy.QtWidgets imp... | python | edit | 4 | 0 | apache-2.0 | 366ecdd77520004c307cbbf127bb374ab546ce7e | BBN-Q/Quince | run-quince.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nimport os\nfrom .endpoints import *\n\n\nclass UnauthorizedToken(Exception):\n pass\n\n\nclass ReviewsAPI:\n\n def __init__(self):\n token = os.environ.get('UDACITY_AUTH_TOKEN')\n self.headers = {'Author... | python | edit | 4 | 4 | mit | 4ca8889396595f9da99becbb88fb7e38ab0ed560 | anapaulagomes/reviews-assigner | hunter/reviewsapi.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pytf.dataprovider import DataProvider\n\ntry:\n from unittest.mock import call\nexcept ImportError:\n from mock import call\n\n\n@DataProvider([call(max=5), call(max=10), call(max=15)])\nclass TestCase(object):\n def __init__(... | python | edit | 1 | 1 | mit | bdca4889442e7d84f8c4e68ecdbee676d46ff264 | Lothiraldan/pytf | examples/test_with_data_provider.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n Sphinx - Python documentation toolchain\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: 2007 by Georg Brandl.\n :license: Python license.\n\"\"\"\n\nimport sys\n\nif __name__ == '__mai... | python | edit | 2 | 0 | mit | 346e296872e1ca011eb5e469505de1c15c86732f | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Doc/tools/sphinx-build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport time\n\nfrom constants import *\nfrom dbhelper import *\nfrom dbItemManagerV2 import DbItemManagerV2\nfrom link import Link\n\nLINK_EXPIRY_TIME_IN_DAYS = 80\n\nclass LinkManager(DbItemManagerV2):\n \"\"\"\n Manage li... | python | edit | 3 | 2 | mit | 547c9e36255870bcee8a800a3fa95c3806a95c2c | adityabansal/newsAroundMe,adityabansal/newsAroundMe,adityabansal/newsAroundMe | newsApp/linkManager.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport shopify\n\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\n\n\nVERSION = (0, 1, 5)\n__version__ = '.'.join(map(str, VERSION))\n__author__ = 'Gavin Ballard'\n\n\ndef initialize():\n i... | python | edit | 1 | 3 | mit | 2e042201d6c0e0709d7056d399052389d1ea54b0 | RafaAguilar/django-shopify-auth,discolabs/django-shopify-auth,RafaAguilar/django-shopify-auth,funkybob/django-shopify-auth,funkybob/django-shopify-auth,discolabs/django-shopify-auth | shopify_auth/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass Camera(models.Model):\n ssid = models.CharField(max_length=255)\n password = models.CharField(max_length=255)\n date_added = models.DateTimeField(auto_now_add=True)\n last_attempt = models... | python | edit | 1 | 1 | apache-2.0 | 38de795103748ca757a03a62da8ef3d89b0bf682 | Nzaga/GoProController,joshvillbrandt/GoProController,Nzaga/GoProController,joshvillbrandt/GoProController | GoProController/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nBase line settings\n\"\"\"\n\nCONFIG = {\n 'input_path': None,\n 'backup_path': None,\n 'dest_path': None,\n 'life_all': None,\n 'db': {\n 'host': None,\n 'port': None,\n 'name': None,\n 'u... | python | edit | 1 | 0 | mit | caff96633ce29a2139bc61bb5ee333efd69d50ef | ruipgil/ProcessMySteps,ruipgil/ProcessMySteps | processmysteps/default_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..error import IdentifierError\nfrom ..objects.profile import Profile\nfrom .base import Base\n\n\nclass Profiles(Base):\n RESOURCE_ID_PREFIX = 'pfl_'\n\n def get_resource_object(self, result):\n return Profile(result, sel... | python | edit | 1 | 4 | bsd-2-clause | 7b3f239964c6663a9b655553202567fccead85c8 | mollie/mollie-api-python | mollie/api/resources/profiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom datetime import datetime\n\nfrom app import db\n\n\nclass Checkup(db.Model):\n __tablename__ = 'checkup'\n\n id = db.Column(db.Integer, primary_key=True)\n created = db.Column(db.DateTime, default=date... | python | edit | 1 | 0 | mit | 5f522cf58a1566513e874002bdaeb063e8a02497 | harunurhan/repologist,harunurhan/repodoctor,harunurhan/repologist,harunurhan/repodoctor | server/models/checkup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright 2016 Randal S. Olson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software\nand associated documentation files (the \"Software\"), to deal in the Softwa... | python | edit | 1 | 0 | mit | 3989abf6de879af6982a76ea3522f11f789c6569 | rhiever/MarkovNetwork,rhiever/MarkovNetwork | MarkovNetwork/_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n_basedir = os.path.abspath(os.path.dirname(__file__))\n# Plugin settings\nDATABASE_NAMES = ['atc', 'nhs', 'sms']\n# Using sqlite for local development, will be SQL on production.\nSQLALCHEMY_BINDS = {\n 'atc': 'sqlite:///' + o... | python | edit | 1 | 0 | mit | 4657acf6408b2fb416e2c9577ac09d18d81f8a68 | jawrainey/sris | nameless/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django\"\"\"\n\nimport os\nfrom flask import Flask\n\napp = Flask(__name__)\n\n@app.route('/')\ndef home_page():\n return 'Hello from the SPARK learn-... | python | edit | 1 | 2 | apache-2.0 | f20eb91dcf04bc8e33fbb48ebfbef1b56acbf02d | samanehsan/spark_github,samanehsan/spark_github,samanehsan/learn-git,samanehsan/learn-git | web.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Activity(models.Model):\n name = models.CharField(max_length=200)\n description = models.TextField()\n\n```\n\nApply this change: Add string representation for Activity model"
},
{
"role":... | python | edit | 1 | 1 | mit | 8064be72de340fca963da2cade2b73aa969fbdbd | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/activities/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" app.py \"\"\"\n\nfrom flask import Flask, render_template\nimport requests\n\n\napp = Flask(__name__)\n\n\ndef get_time():\n try:\n response = requests.get('http://localhost:3001/time')\n except requests.exceptions.Conne... | python | edit | 1 | 2 | mit | 91ff11cde50ce2485c0a6725651931f88a085ca7 | danriti/short-circuit,danriti/short-circuit | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom wrappers import bowtie2, picard, samtools\r\n\r\n\r\ndef create_reference_indices(ref_fn):\r\n '''\r\n For a given reference FASTA file, generate several indices.\r\n '''\r\n bowtie2.build(ref_fn)\r\n samtools.faidx_inde... | python | edit | 1 | 5 | mit | d9189f91370abd1e20e5010bb70d9c47efd58215 | NIEHS/muver | muver/reference.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom bottle.ext import auth\n\nfrom utils import conf\n\n\ntry:\n auth_import = conf('auth')['engine'].split('.')[-1]\n auth_from = u\".\".join(conf('auth')['engine'].split('.')[:-1])\n ... | python | edit | 2 | 0 | mit | e62db9661295ff3912dbaaaff0d9f267f0b7ffe1 | AndrzejR/mining,mining/mining,mlgruby/mining,mining/mining,mlgruby/mining,mlgruby/mining,jgabriellima/mining,avelino/mining,jgabriellima/mining,seagoat/mining,chrisdamba/mining,seagoat/mining,avelino/mining,AndrzejR/mining,chrisdamba/mining | auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\ndef sum_seq_squares(n):\n return (n * (n+1) * ((2*n)+1)) / 6\n\ndef sum_seq(n):\n return (n * (n + 1)) / 2\n\ndef main():\n\tsum_seq_sq_100 = sum_seq_squares(100)\n\tsum_seq_100 = sum_seq(100)\n\tsq_sum_seq_10... | python | edit | 1 | 1 | mit | d60dea7b7b1fb073eef2c350177b3920f32de748 | cveazey/ProjectEuler,cveazey/ProjectEuler | 6/e6.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\ntry:\n from itertools import zip_longest\nexcept ImportError:\n from itertools import izip_longest as zip_longest\n\nfrom django.template import Library\nfrom django.utils.http import urlencode... | python | edit | 1 | 2 | bsd-3-clause | b077df615eb4354f416877cc2857fb9848e158eb | UITools/saleor,mociepka/saleor,mociepka/saleor,UITools/saleor,maferelo/saleor,maferelo/saleor,UITools/saleor,UITools/saleor,mociepka/saleor,maferelo/saleor,UITools/saleor | saleor/core/templatetags/shop.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery\n\nimport shlex\nimport string\n\ndef parseSearchString(search_string):\n search_strings = shlex.split(search_string)\n translator = str.maketrans({key: ... | python | edit | 1 | 4 | bsd-3-clause | 8b944f04ebf9b635029182a3137e9368edafe9d2 | groundupnews/gu,groundupnews/gu,groundupnews/gu,groundupnews/gu,groundupnews/gu | pgsearch/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# MONOTONE\n\n# Produce a monotonically decreasing output plot from noisy data\n# Input: columns: t x\n# Output: columns: t_i x_i , sampled such that x_i <= x_j\n# for j > i.\n\nfrom string import *\nimport sys... | python | edit | 5 | 0 | mit | 2652919c8d2e6fad8f7b3d47f5e82528b4b5214e | ECP-CANDLE/Database,ECP-CANDLE/Database | plots/monotone.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom django.test.client import Client\nfrom django.core.urlresolvers import reverse\nfrom whats_fresh_api.models import *\nfrom django.contrib.gis.db import models\nimport json\n\n\nclass StoriesTestCase(Te... | python | edit | 4 | 1 | apache-2.0 | 8157af3da0e535074b18c76f0e5391d8cac806e8 | osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api | whats_fresh/whats_fresh_api/tests/views/test_stories.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jack Brewer\n# Copyright (c) 2015 Jack Brewer\n#\n# License: MIT\n\n\"\"\"This module exports the Stylint plugin class.\"\"\"\n\nfrom... | python | edit | 1 | 0 | mit | 4c66010cf0cd4f763b362b6e84eb67d7ef1278b8 | jackbrewer/SublimeLinter-contrib-stylint | linter.py | rejected_duplicate | Near-duplicate of sample 13413 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\ntry:\n from flask import Flask, render_template, send_file, Response \n import requests\nexcept ImportError:\n INTERP = \"venv/bin/python\"\n\n if os.path.relpath(sys.executable, os.getcwd()) != INTER... | python | edit | 5 | 1 | mit | f2139cad673ee50f027164bda80d86979d5ce7a0 | GregBrimble/boilerplate-web-service,GregBrimble/boilerplate-web-service | passenger_wsgi.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport io\nimport json\nimport logging\nimport os\nimport pdb\nimport traceback\n\nfrom logging import config\n\nfrom functools import wraps\n\nfrom flask import (\n Flask,\n render_template,\n request,\n send_file,\n send_... | python | edit | 8 | 2 | mit | 3fbbba8dae5c97cedf414eea8a39482c01a269e6 | danoneata/video_annotation,danoneata/video_annotation,danoneata/video_annotation | main.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport pytz\nfrom nose.tools import (assert_is_none)\n\nfrom qipipe.helpers.qiprofile_helper import QIProfile\nfrom qiprofile.models import Project\nfrom test import project\nfrom test.helpers.logging_helper import logger\n... | python | edit | 4 | 2 | bsd-2-clause | 7119c07b422f823f40939691fa84f0c2581ae70d | ohsu-qin/qipipe | test/unit/helpers/test_qiprofile_helper.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom flask_script import Manager\nfrom flask_migrate import Migrate, MigrateCommand\n\nfrom service import app, db\n\n# db.create_all() needs all models to be imported\nfrom service.db_access import *\n\n\nmigrate ... | python | edit | 3 | 0 | mit | 08b54819a56d9bfc65225045d97a4c331f9a3e11 | LandRegistry/login-api,LandRegistry/login-api | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom flask.ext.script import Manager, Server\nfrom yoyo import create_app\n\n\nmanager = Manager(create_app)\nmanager.add_option('-c', '--configfile', dest='configfile', required=False)\n\nif __name__ == '__main__... | python | edit | 1 | 0 | mit | a3923263a100dd39772533aa37ea7ff956e6c874 | jaapverloop/massa | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom PySide.QtCore import QSettings\n\nfrom inselect.lib.sort_document_items import sort_document_items\n\n# QSettings path\n_PATH = 'sort_by_columns'\n\n# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes\n_SORT_DOCUMEN... | python | edit | 1 | 2 | bsd-3-clause | a3ad91928f7d4753204a2443237c7f720fed37f1 | NaturalHistoryMuseum/inselect,NaturalHistoryMuseum/inselect | inselect/gui/sort_document_items.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport optparse, sys, StringIO\nsys.path.append(\"..\")\nimport ctypesgencore\n\n\"\"\"ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a\nsingle function, test(). test() takes a string that rep... | python | edit | 4 | 2 | bsd-3-clause | 826f23f0fc7eea4c72dcc26f637f3752bee51b47 | kanzure/ctypesgen,kanzure/ctypesgen,novas0x2a/ctypesgen,davidjamesca/ctypesgen,kanzure/ctypesgen | test/ctypesgentest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Example showing the Ask User dialog controls and overall usage.\"\"\"\n\nimport fusionless as fu\n\ndialog = fu.AskUserDialog()\ndialog.add_text(\"text\", default=\"Default text value\")\ndialog.add_position(\"position\", default=(0.2... | python | edit | 1 | 0 | bsd-3-clause | f8eb93f1845a7776c61a59bafc6fdeb689712aff | BigRoy/fusionless,BigRoy/fusionscript | examples/comp/ask_user_dialog.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass KeyMaker(object):\n def __init__(self, prefix):\n self.prefix = prefix\n\n def convert(self, arg):\n return str(arg)\n\n def args_to_key(self, args):\n return \":\".join(map(self.convert, args))\n\n de... | python | edit | 3 | 3 | bsd-3-clause | 783f7a5d17b3db83e1f27ad3bebb4c165c4e66ca | jrutila/django-settings,jrutila/django-settings,jrutila/django-settings,jrutila/django-settings | django_settings/keymaker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\n\nfrom .datadicts import diary\n\n\ndef read_diary_file(path_to_file):\n return pd.read_csv(\n path_to_file,\n delimiter='\\t',\n nrows=50,\n converters=_column_name_to_type_mapping(diary)... | python | edit | 1 | 3 | mit | 04c3cac3054626773bc0434453378cb295f7e38c | timtroendle/pytus2000 | pytus2000/read.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"Provide the mako templating engine.\"\"\"\n\nfrom __future__ import print_function\n\n\nfrom mako.template import Template\nfrom mako.lookup import TemplateLookup\n\nfrom . import Engine\n\n\nclass MakoEngine(En... | python | edit | 1 | 4 | mit | 818d89c897603eeb33caf1ca2cdaeae5c3010880 | blubberdiblub/eztemplate | engines/mako_engine.py | rejected_duplicate | Near-duplicate of sample 19810 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .random_walker_segmentation import random_walker\nfrom ._felzenszwalb import felzenszwalb\nfrom ._slic import slic\nfrom ._quickshift import quickshift\nfrom .boundaries import find_boundaries, visualize_boundaries, mark_boundaries\nfr... | python | edit | 1 | 0 | bsd-3-clause | 69eafa95df4bdeb143d40c321f0a312d06efff1f | Midafi/scikit-image,pratapvardhan/scikit-image,michaelaye/scikit-image,bsipocz/scikit-image,blink1073/scikit-image,robintw/scikit-image,oew1v07/scikit-image,Britefury/scikit-image,chriscrosscutler/scikit-image,Hiyorimi/scikit-image,vighneshbirodkar/scikit-image,paalge/scikit-image,newville/scikit-image,ajaybhat/scikit-... | skimage/segmentation/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import jsonify\nfrom flask_classy import FlaskView\nfrom flask_user import current_user, login_required\nfrom ..models import CommentModel, PostModel\nfrom ..forms import CommentForm\n\n\nclass Comment(FlaskView):\n\n def get(... | python | edit | 1 | 2 | mit | 7060f48df582dcfae1768cc37d00a25e0e2e1f6f | oldani/nanodegree-blog,oldani/nanodegree-blog,oldani/nanodegree-blog | app/views/comment_view.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom django.conf import settings\n\nDEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')\nDEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)\nDEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60... | python | edit | 1 | 0 | bsd-3-clause | d59f3259875ffac49668ffb3ce34ca511385ebb7 | funkybob/django-rated | rated/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport evdev\nimport requests\nimport json\nimport datetime\nimport yaml\n\ndef main():\n config = load_config()\n\n dev = evdev.InputDevice(config['device_path'])\n output_line('Initialized - Capturing device: ' + str(dev))\n\n for eve... | python | edit | 1 | 3 | mit | c1ae43fd33cd0f8eb3e270907a8ed7e728d1e268 | nicolas-fricke/keypost | server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyqode.core.api import TextHelper\nfrom pyqode.qt.QtTest import QTest\n\n\ndef test_toggle_button(editor):\n editor.file.open('test/files/example.json')\n editor.show()\n TextHelper(editor).goto_line(6)\n QTest.qWait(500)\n... | python | edit | 1 | 1 | mit | 4c5550420b8a9f1bf88f4329952f6e2a161cd20f | pyQode/pyqode.json,pyQode/pyqode.json | test/test_panels/test_navigation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = '0.2'\nfrom .mzml_loader import mzml_to_hdf\nfrom .h5_query import plot_heatmap, plot_spectrogram, plot_xic\nfrom .h5_query import get_data, get_XIC, get_HeatMapRTMZ, get_spectrogram\n\n```\n\nApply this change: Clean up packa... | python | edit | 10 | 0 | bsd-3-clause | 6e7dfe97cdce58f892f88560e4b4709e6625e6bd | aitatanit/metatlas,aitatanit/metatlas,aitatanit/metatlas,metabolite-atlas/metatlas,biorack/metatlas,biorack/metatlas,metabolite-atlas/metatlas,metabolite-atlas/metatlas | metatlas/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.utils import timezone\nfrom django.conf import settings\nfrom django.contrib.sites.models import get_current_site\n\nfrom .models import Channel\n\n\ndef channel_context(request):\n \"\"\" Channel con... | python | edit | 1 | 3 | mit | 8e6662a4aaf654ddf18c1c4e733c58db5b9b5579 | YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps | opps/channels/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"\nThis subpackage contains classes and functions for defining and converting\nbetween different physical units.\n\nThis code is adapted from the `pynbody\n<http://code... | python | edit | 11 | 0 | bsd-3-clause | 7eb10376b585e56faad4672959f6654f2500a38d | kelle/astropy,aleksandr-bakanov/astropy,bsipocz/astropy,kelle/astropy,mhvk/astropy,funbaker/astropy,larrybradley/astropy,MSeifert04/astropy,aleksandr-bakanov/astropy,saimn/astropy,DougBurke/astropy,AustereCuriosity/astropy,AustereCuriosity/astropy,StuartLittlefair/astropy,astropy/astropy,lpsinger/astropy,AustereCuriosi... | astropy/units/__init__.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n This module sets up the view for handling ``500 Internal Server Error`` errors.\n\"\"\"\n\nimport datetime\n\nimport flask\nimport flask_classful\n\nfrom orchard.errors import blueprint\n\n\nclass Erro... | python | edit | 1 | 2 | mit | 8a9fa06c36a89e3fde93059cfbe827506d5b8b62 | BMeu/Orchard,BMeu/Orchard | orchard/errors/e500.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Blueprint, jsonify\n\nfrom .security import validate_request_authentication\nfrom qiime.sdk import PluginManager\n\nPLUGIN_MANAGER = PluginManager()\nv1 = Blueprint('v1', __name__)\nv1.before_request(validate_request_authe... | python | edit | 1 | 2 | bsd-3-clause | 2b3281863f11fa577dd6504e58f6faec8ada2259 | jakereps/qiime-studio-frontend,jakereps/qiime-studio,qiime2/qiime-studio,qiime2/qiime-studio,jakereps/qiime-studio,qiime2/qiime-studio-frontend,qiime2/qiime-studio-frontend,qiime2/qiime-studio,jakereps/qiime-studio,jakereps/qiime-studio-frontend | qiime_studio/api/v1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.decorators import login_required\nfrom stronghold import conf\n\n\nclass LoginRequiredMiddleware(object):\n \"\"\"\n Force all views to use login required\n\n View is deemed to be public if the @public deco... | python | edit | 1 | 5 | mit | 282ac04e49c6adef237ea30fa4dcae64e6f959d8 | mgrouchy/django-stronghold,SunilMohanAdapa/django-stronghold,SunilMohanAdapa/django-stronghold | stronghold/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nScheduler queues\n\"\"\"\n\nimport marshal\nfrom six.moves import cPickle as pickle\n\nfrom queuelib import queue\n\ndef _serializable_queue(queue_class, serialize, deserialize):\n\n class SerializableQueue(queue_class):\n\n ... | python | edit | 1 | 2 | bsd-3-clause | 6edd4114c4e715a3a0c440af455fff089a099620 | pablohoffman/scrapy,pawelmhm/scrapy,finfish/scrapy,Ryezhang/scrapy,ssteo/scrapy,pawelmhm/scrapy,ssteo/scrapy,scrapy/scrapy,pawelmhm/scrapy,starrify/scrapy,ArturGaspar/scrapy,ssteo/scrapy,wujuguang/scrapy,dangra/scrapy,pablohoffman/scrapy,dangra/scrapy,elacuesta/scrapy,starrify/scrapy,scrapy/scrapy,kmike/scrapy,pablohof... | scrapy/squeues.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nPython introspection helpers.\n\"\"\"\n\nfrom types import CodeType as code, FunctionType as function\n\n\ndef copycode(template, changes):\n if hasattr(code, \"replace\"):\n return template.replace(**{\"co_\" + k : v for ... | python | edit | 1 | 6 | mit | 35293cecc99a629b3a185e69cf9ed3a339d9d1cf | glyph/automat | automat/_introspection.py | rejected_duplicate | Near-duplicate of sample 14711 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom plex.objects.core.base import Property\nfrom plex.objects.container import Container\nfrom plex.objects.library.section import Section\n\n\nclass MediaContainer(Container):\n section = Property(resolver=lambda: MediaContainer.constr... | python | edit | 1 | 2 | mit | 92febbffb91943f13cfac8c00e55103b20645b70 | fuzeman/plex.py | plex/objects/library/container.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nHarvester for the Smithsonian Digital Repository for the SHARE project\n\nExample API call: http://repository.si.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc\n'''\nfrom __future__ import unicode_literals\n\nfrom scrapi.base i... | python | edit | 1 | 4 | apache-2.0 | 7f113399e4277ecbbfdde41d683c22082f7e19bd | CenterForOpenScience/scrapi,alexgarciac/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,fabianvf/scrapi,mehanig/scrapi,mehanig/scrapi,fabianvf/scrapi,erinspace/scrapi,erinspace/scrapi,felliott/scrapi,CenterForOpenScience/scrapi | scrapi/harvesters/smithsonian.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom pyogi.board import Board\nfrom pyogi.plot import plot_board\n\n\nif __name__ == '__main__':\n\n board = Board()\n board.set_initial_state()\n\n board.players = ['先手', '後手']\n\n... | python | edit | 1 | 0 | mit | 06cb55639d2bc504d0ec1b9fb073c40e00751328 | tosh1ki/pyogi,tosh1ki/pyogi | doc/sample_code/demo_plot_state.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\nfrom ..platform_name import platform_name\n\nif platform_name() == 'windows':\n from .windows import *\nelse:\n from .posix import *\n\n\nclass shell_list(list):\n \"\"\"A special subclass of list us... | python | edit | 3 | 4 | bsd-3-clause | 53a2d8781e3e5d8e5879d4ef7c62752483323cf9 | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | bfg9000/shell/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .models import Category, Keyword\r\nfrom rest_framework import serializers\r\n\r\n\r\nclass CategorySerializer(serializers.ModelSerializer):\r\n class Meta(object):\r\n model = Category\r\n fields = ('pk', 'name', 'wei... | python | edit | 1 | 0 | apache-2.0 | 5a682fccfb6d8e6db3eb100262cf628bfc10e829 | belatrix/BackendAllStars | categories/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n\"\"\"TODO:\n * more flexible sorting options\n * use -o to specify output file\n * check more explicitly for errors in JSON files\n\"\"\"\n\nimport json, sys\n\nif len(sys.argv) > 1:\n inFn = sys.argv[1]\n\nwit... | python | edit | 1 | 0 | mit | fa3c02a164dd81d91d105a4c1a1ddea8ca50d702 | JoshuaBrockschmidt/dictbuilder | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\n\nfrom homepage.models import Tab\n\nregister = template.Library()\n\n@register.tag(name=\"get_tabs\")\ndef get_tabs(parser, token):\n \n return GetElementNode()\n \nclass GetElementNode(template.Node):... | python | edit | 1 | 1 | mit | 19326b0b96e053c4b4fab402a379a03c39fbe46d | cartwheelweb/packaginator,nanuxbe/djangopackages,miketheman/opencomparison,audreyr/opencomparison,audreyr/opencomparison,cartwheelweb/packaginator,QLGu/djangopackages,pydanny/djangopackages,cartwheelweb/packaginator,benracine/opencomparison,nanuxbe/djangopackages,pydanny/djangopackages,pydanny/djangopackages,QLGu/djang... | apps/homepage/templatetags/homepage_tags.py | rejected_duplicate | Near-duplicate of sample 2139 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nfrom cms.sitemaps import CMSSitemap\nfrom cms.utils import get_cms_setting\nfrom django.conf import settings\nfrom django.utils.translation... | python | edit | 1 | 0 | bsd-3-clause | 2c6ccdacc2c4e54cf0a12618d60c963d9c67ef62 | nephila/djangocms-page-sitemap | djangocms_page_sitemap/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom testrunner import testhelp\n\nclass BaseServer(object):\n \"Base server class. Responsible with setting up the ports etc.\"\n # We only want standalone repositories to have SSL support added via\n # useSSL\n sslEnabled = Fa... | python | edit | 3 | 3 | apache-2.0 | 2b7bdf39497809749c504d10399dffabe52e97ca | sassoftware/testutils,sassoftware/testutils,sassoftware/testutils | testutils/base_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"\n\nfrom django.test import TestCase\n\n\ncla... | python | edit | 1 | 1 | bsd-3-clause | 0433623b8e15559fe304e6406e58b1cd2639493f | datphan/teracy-tutorial | apps/polls/tests.py | rejected_duplicate | Near-duplicate of sample 2454 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This is a software index handler that gives a score based on the\n# number of mentions in open access articles. It uses the CORE\n# aggregator (http://core.ac.uk/) to search the full text of indexed\n# articles.\n# \n# Inputs:\n# - ident... | python | edit | 1 | 1 | bsd-3-clause | 4244f9c4d9e64783d391139457d7761dbc19e546 | softwaresaved/softwareindex,softwaresaved/softwareindex | softwareindex/handlers/coreapi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# PYTHON_ARGCOMPLETE_OK\nimport os, imp, inspect\nfrom interpreter import cli_interface\n\ndef k_runner():\n \"\"\"CLI interpreter for the k command.\"\"\"\n # Check every directory from the current all the way ... | python | edit | 3 | 4 | mit | 7897b985a1ec8fe240c9edead2b53567221cd095 | crdoconnor/projectkey | projectkey/k_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .common import name_inner_event\nfrom .newmessage import NewMessage\nfrom ..tl import types\n\n\n@name_inner_event\nclass MessageEdited(NewMessage):\n \"\"\"\n Event fired when a message has been edited.\n \"\"\"\n @classme... | python | edit | 1 | 2 | mit | 85be48f42b03273ea458b7c4db3303ae8b991558 | LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,expectocode/Telethon | telethon/events/messageedited.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'matt'\n\nfrom flask import Flask\napp = Flask(__name__)\n\n\ndef startup():\n import blockbuster.bb_dbconnector_factory\n import blockbuster.bb_logging as log\n import blockbuster.bb_auditlogger as audit\n\n try:\n... | python | edit | 3 | 3 | mit | 096a8972d610379356d668d57d92010707fcf9e1 | mattstibbs/blockbuster-server,mattstibbs/blockbuster-server | blockbuster/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom roglick.engine.ecs import Entity,EntityManager\nfrom roglick.components import SkillComponent,SkillSubComponent\nfrom roglick.systems import SkillSystem\nfrom roglick.engine import event\nfrom roglick.events import SkillCheckEvent\n\n\... | python | edit | 3 | 3 | mit | c4c2845d2be318a3aaa23e1f279df9b2180add41 | Kromey/roglick | test/systems/test_skill_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nHarvester for the ScholarsArchive@OSU for the SHARE project\n\nExample API call: http://ir.library.oregonstate.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc\n'''\nfrom __future__ import unicode_literals\n\nfrom scrapi.base imp... | python | edit | 1 | 1 | apache-2.0 | 1e3b23597e5bff437dca0f94fdbd644b1454e395 | erinspace/scrapi,CenterForOpenScience/scrapi,felliott/scrapi,alexgarciac/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,erinspace/scrapi,mehanig/scrapi,mehanig/scrapi,fabianvf/scrapi | scrapi/harvesters/scholarsarchiveosu.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport uuid\nfrom django.db import models\n\n\nclass Submission(models.Model):\n uuid = models.UUIDField(default=uuid.uuid4,editable=False)\n application_date = models.DateTimeField()\n submission_date = models.DateTimeField()\n ... | python | edit | 1 | 1 | mit | d4f7178decbb55a9d6f559e7f94ad2cc6d806b18 | daltonamitchell/rating-dashboard,daltonamitchell/rating-dashboard,daltonamitchell/rating-dashboard | dashboard/ratings/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 's7a'\n\n# All imports\nfrom nltk.tree import Tree\n\n\n# The infix coordination class\nclass InfixCoordination:\n\n # Constructor for the infix coordination\n def __init__(self):\n self.has_infix_coordination = Fa... | python | edit | 6 | 7 | mit | a61a09a08322c3e74800c0635c4848280ad9341e | Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify | src/syntax/infix_coordination.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__project__ = 'TemplateDemo'\n__version__ = '0.0.0'\n\nVERSION = \"{0} v{1}\".format(__project__, __version__)\n\n```\n\nApply this change: Deploy Travis CI build 1156 to GitHub"
},
{
"role": "assistant",
"content": "from pkg_re... | python | edit | 1 | 0 | mit | bb4a0ca8626f0287a5366e97313018fcc59bcf8f | jacebrowning/template-python-demo | demo/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponse\nfrom django.utils.deprecation import MiddlewareMixin\n\n\nclass PingMiddleware(MiddlewareMixin):\n def process_request(self, request):\n if request.method == \"GET\":\n if request.p... | python | edit | 1 | 3 | mit | 35bbc1d720ba36631fc0a821f7aa953dd8736f2a | ministryofjustice/laa-legal-adviser-api,ministryofjustice/laa-legal-adviser-api,ministryofjustice/laa-legal-adviser-api | laalaa/apps/advisers/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"URLs for django-annoying's tests\"\"\"\nfrom __future__ import absolute_import\n\nfrom django.conf.urls import url\nfrom . import views\n\nurlpatterns = [\n url(r'^ajax-request/$', views.ajax_request_view),\n url(r'^ajax-request... | python | edit | 1 | 0 | bsd-3-clause | e665154e1b522feac8cd46c39ba523bc7197afab | kabakchey/django-annoying,skorokithakis/django-annoying,YPCrumble/django-annoying,kabakchey/django-annoying,skorokithakis/django-annoying | annoying/tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function, division, absolute_import\n\nimport subprocess\nimport sys\nimport os\n\ndef test_IPython():\n ipython = os.path.join(sys.prefix, 'bin', 'ipython')\n if not os.path.exists(ipython):\n rais... | python | edit | 4 | 1 | mit | 0a7c6011607bccc61570c8f027c547425e8d53cf | asmeurer/iterm2-tools | iterm2_tools/tests/test_ipython.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\n# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik\n# Author: Dominik Gresch <<EMAIL>>\n\nimport pytest\n\nimport numpy as np\n\nfrom parameters import T_VALUES, KPT\n\n\n@pytest... | python | edit | 4 | 2 | apache-2.0 | df8efcc0f86fa9a311ec444da7e6488de2e86d8a | Z2PackDev/TBmodels,Z2PackDev/TBmodels | tests/test_repr.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom funcy.decorators import *\n\n\ndef test_decorator_no_args():\n @decorator\n def inc(call):\n return call() + 1\n\n @inc\n def ten():\n return 10\n\n assert ten() == 11\n\n\ndef test_decorator... | python | edit | 8 | 1 | bsd-3-clause | 56f7c35722b4d90e04bf2da3d7d72ef0bfd52602 | musicpax/funcy,ma-ric/funcy,Suor/funcy | tests/test_decorators.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom thecure.levels.base import Level\nfrom thecure.sprites import Direction, InfectedHuman\n\n\nclass Level1(Level):\n name = 'level1'\n start_pos = (900, 6200)\n\n def setup(self):\n boy = InfectedHuman('boy1')\n se... | python | edit | 1 | 1 | mit | fc123442727ae25f03c5aa8d2fa7bc6fae388ae2 | chipx86/the-cure | thecure/levels/level1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# (c) Copyright IBM Corp. 2021\n# (c) Copyright Instana Inc. 2020\n\nimport os\nfrom .app import flask_server as server\nfrom ..utils import launch_background_thread\n\napp_thread = None\n\nif not os.environ('CASSANDRA_TEST') and app_thread... | python | edit | 1 | 0 | mit | bcc2e41717e5287908867958c60ceb09ca824d7a | instana/python-sensor,instana/python-sensor | tests/apps/flask_app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Log Parser for RTI Connext.\n#\n# Copyright 2016 Real-Time Innovations, 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 ob... | python | edit | 1 | 3 | apache-2.0 | 4f577eabc45acb6e9a8880d062daa225cc76d64c | rticommunity/rticonnextdds-logparser,rticommunity/rticonnextdds-logparser | logparser/logs/micro/micro.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport logging\nimport os\nimport shutil\n\nlogger = logging.getLogger('polyaxon.libs.paths')\n\n\ndef delete_path(path):\n if not os.path.exist... | python | edit | 1 | 4 | apache-2.0 | f5369b9b0175e221743101abb936b5a2947a3808 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/libs/paths.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Describe methods to work with kubeconfig file.\"\"\"\nimport pytest\nimport yaml\n\n\ndef get_current_context_name(kube_config) -> str:\n \"\"\"\n Get current-context from kubeconfig.\n\n :param kube_config: absolute path to ... | python | edit | 1 | 3 | apache-2.0 | 4c3a21a73dbdf47d5cac04bfda20df7f85596b22 | nginxinc/kubernetes-ingress,nginxinc/kubernetes-ingress,nginxinc/kubernetes-ingress,nginxinc/kubernetes-ingress | tests/suite/kube_config_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# for local run, before pygraphc packaging\nimport sys\nsys.path.insert(0, '../pygraphc/misc')\nfrom IPLoM import *\nsys.path.insert(0, '../pygraphc/clustering')\nfrom ClusterUtility import *\nfrom ClusterEvaluation import *\n\n# set path\n... | python | edit | 2 | 0 | mit | 5619b04f55418c943e7a7af606b5247ce4441160 | studiawan/pygraphc | examples/IPLoM_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\r\n\r\n#-------------------------------------------------------------------------\r\n# Copyright (c) Microsoft. All rights reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you... | python | edit | 1 | 0 | apache-2.0 | 2df1c9f6b9833c1ae44a62d3dfbe208e2e42805a | fivejjs/PTVS,fivejjs/PTVS,xNUTs/PTVS,DEVSENSE/PTVS,Microsoft/PTVS,fivejjs/PTVS,DinoV/PTVS,gilbertw/PTVS,MetSystem/PTVS,crwilcox/PTVS,christer155/PTVS,bolabola/PTVS,DinoV/PTVS,int19h/PTVS,gomiero/PTVS,zooba/PTVS,Habatchii/PTVS,mlorbetske/PTVS,MetSystem/PTVS,xNUTs/PTVS,christer155/PTVS,fjxhkj/PTVS,Microsoft/PTVS,gomiero/... | Python/Product/PythonTools/ptvsd/setup.py | rejected_duplicate | Near-duplicate of sample 13743 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom flask import Flask, render_template, g\nfrom .container import build\nfrom .web import bp as web\nfrom .api import bp as api\n\n\ndef create_app(config=None):\n app = Flask('massa')\n app.config.from_ob... | python | edit | 3 | 2 | mit | 9e40fbd1992854db138157d9a7c2fd995722f5ea | jaapverloop/massa | massa/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport pytest\nimport tempfile\n\nimport pandas\nfrom skan import pipe\n\n@pytest.fixture\ndef image_filename():\n rundir = os.path.abspath(os.path.dirname(__file__))\n datadir = os.path.join(rundir, 'data')\n return os.... | python | edit | 1 | 1 | bsd-3-clause | bb48c975cfb4f43b8ffc5c7edfd42a8253fa7d66 | jni/skan | skan/test/test_pipe.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nimport subprocess\n\nmep_version = \"MEP_VERSION\"\nos_family = \"OS_FAMILY\"\n\noutput = subprocess.check_output( [\n \"curl\", \"-s\",\n \"http://package.mapr.com/releases/MEP/MEP-%s/%s... | python | edit | 2 | 0 | apache-2.0 | 2ef20e1658eaf5631395940bbb8583be628e6483 | qinjunjerry/MapRSetup,qinjunjerry/MapRSetup,qinjunjerry/MapRSetup | utils/package_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\n\nimport powershift.endpoints as endpoints\nimport powershift.resources as resources\n\nclient = endpoints.AsyncClient()\n\nasync def run_query():\n projects = await client.oapi.v1.projects.get()\n\n #print(projects)\n... | python | edit | 1 | 5 | bsd-2-clause | 2e0c4940b208d0b029e7b43f8c3595fa3b6d2f18 | getwarped/powershift | examples/list-pods-watch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python\n# Code Fights Weak Numbers Problem\n\n\ndef weakNumbers(n):\n def get_divisors(n):\n divs = []\n for i in range(1, n + 1):\n count = 0\n for d in range(1, i + 1):\n ... | python | edit | 1 | 4 | mit | 1303890759afb3ae0466066dcdc9309b50dd73ef | HKuz/Test_Code | CodeFights/weakNumbers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport xyz\n\nclass ArmToolchain(xyz.BuildProtocol):\n group_only = True\n pkg_name = 'arm-toolchain'\n deps = [('gcc', {'target': 'arm-none-eabi'}),\n ('binutils', {'target': 'arm-none-eabi'}),\n ('gdb', {'ta... | python | edit | 1 | 0 | mit | da65e041a7d05eee1cdda7c6f5a23ae2fea70103 | BreakawayConsulting/xyz | rules/arm-toolchain.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom functools import partial\n\ndef pipeline_trigger(parent_task):\n \"\"\"\n Use this function with TriggerDagOperator to always trigger a DAG and\n pass pipeline information to the next DAG\n \"\"\"\n\n def trigger(p... | python | edit | 1 | 2 | apache-2.0 | a225eb1925c54c2c0fef857b1bf78fbc93375f1f | LREN-CHUV/airflow-imaging-plugins,LREN-CHUV/airflow-imaging-plugins | airflow_pipeline/pipelines.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom django.conf import settings\n\nclass BasicTests(TestCase):\n \"\"\"Basic tests like setup and connectivity.\"\"\"\n \n def test_api_key_present(self):\n self.assertTrue('HOPTOAD_API_KEY... | python | edit | 1 | 2 | mit | c25d55643953d5bce511b1d3d32e6fce162b4ccd | sjl/django-hoptoad,sjl/django-hoptoad | hoptoad/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.exceptions import ObjectDoesNotExist\nfrom django.utils.translation import ugettext as _\nfrom couchdbkit.exceptions import ResourceNotFound\n\ndef get_object_or_not_exist(cls, doc_id, domain, additional_doc_types=None):\n ... | python | edit | 1 | 7 | bsd-3-clause | c045dc59bc313055eb74513e2961ce2cbae87450 | dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq | corehq/apps/api/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__all__ = [\"to_nibabel\", \"from_nibabel\"]\n\nimport os\nfrom tempfile import mktemp\nimport numpy as np\nfrom ..core import ants_image_io as iio2\n\n\ndef to_nibabel(image):\n \"\"\"\n Convert an ANTsImage to a Nibabel image\n \... | python | edit | 3 | 1 | apache-2.0 | 804696126480f36fddd74a8a0d24b0c4274f0f54 | ANTsX/ANTsPy,ANTsX/ANTsPy,ANTsX/ANTsPy,ANTsX/ANTsPy | ants/utils/convert_nibabel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\ntry:\n import simplejson as json\nexcept ImportError:\n import json\n\nfrom wsme.tests.protocol import WSTestRoot\nimport wsme.spore\n\n\nclass TestSpore(unittest.TestCase):\n def test_spore(self):\n spore... | python | edit | 2 | 1 | mit | 0f5aeeedd580cce2970127d4b7e69c4a6427d343 | stackforge/wsme | wsme/tests/test_spore.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 John Reese\n# Licensed under the MIT license\n\nfrom ..lib import is_bot\nfrom ..ent import Message\nfrom ..graphs import NetworkKeyComparison, NetworkUserComparison\nfrom .base import Plugin\n\n\nclass Totals(Plugin):\n ... | python | edit | 1 | 3 | mit | 25cf03a2ecfb80e0866680a7781adfe11c54ebe9 | jreese/ircstat,jreese/ircstat | ircstat/plugins/totals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport busbus\nfrom busbus.provider.lawrenceks import LawrenceTransitProvider\n\nimport arrow\nimport pytest\n\n\n@pytest.fixture(scope='module')\ndef lawrenceks_provider(engine):\n return LawrenceTransitProvider(engine)\n\n\ndef test_ag... | python | edit | 1 | 1 | mit | 423c29e859440b4a774a924badb7da4417dbd5c6 | spaceboats/busbus | tests/test_provider_lawrenceks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pythonforandroid.toolchain import PythonRecipe\n\n\nclass RuamelYamlRecipe(PythonRecipe):\n version = '0.14.5'\n url = 'https://pypi.python.org/packages/5c/13/c120a06b3add0f9763ca9190e5f6edb9faf9d34b158dd3cff7cc9097be03/ruamel.ya... | python | edit | 1 | 0 | mit | d8d01d89710cd1d752809b8cd91d934092e99adf | kronenpj/python-for-android,kronenpj/python-for-android,germn/python-for-android,kivy/python-for-android,kronenpj/python-for-android,kivy/python-for-android,rnixx/python-for-android,rnixx/python-for-android,germn/python-for-android,kivy/python-for-android,PKRoma/python-for-android,germn/python-for-android,germn/python-... | pythonforandroid/recipes/ruamel.yaml/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\r\nimport json\r\n\r\nfrom discord.ext.commands import when_mentioned_or\r\n\r\nfrom bot import BeattieBot\r\n\r\ntry:\r\n import uvloop\r\nexcept ImportError:\r\n pass\r\nelse:\r\n asyncio.set_event_loop_policy(uvlo... | python | edit | 3 | 0 | mit | d54f7a769ccb60bd5feaab46a68d636dab38b02b | BeatButton/beattie-bot,BeatButton/beattie | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cart\n\ndef test_valid_cart_from_csv():\n _cart = cart.cart_from_csv('test/cart_files/default_cart.csv')\n assert _cart._product_prices == {'apple': 0.15,\n 'ice cream': 3.49,\n ... | python | edit | 1 | 1 | mit | 3dbdc8581bcb366e5b6749d523f25589d3ede9ed | davidhalter-archive/shopping_cart_example | test/test_cart.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.