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\"\"\"\n bind_texture\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport logging\nfrom OpenGL import GL\nfrom mcedit2.rendering.scenegraph import rendernode\nfrom mcedit2.rendering.scenegr... | python | edit | 3 | 3 | bsd-3-clause | 8fadb2bb766bd3a18e7920a5dbf23669796330ff | vorburger/mcedit2,vorburger/mcedit2 | src/mcedit2/rendering/scenegraph/bind_texture.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2005-2006 Itamar Shtull-Trauring.\n# Copyright (c) 2008-2009 ITA Software, Inc.\n# See LICENSE.txt for details.\n\n\"\"\"Coil: A Configuration Library.\"\"\"\n\n__version_info__ = (0,3,8)\n__version__ = \".\".join([str(x) fo... | python | edit | 5 | 1 | mit | 75c1d4a1c28efc690e230a6ad1d5244c9a84eb45 | tectronics/coil,tectronics/coil,marineam/coil,kovacsbalu/coil,marineam/coil,kovacsbalu/coil | coil/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom os.path import dirname, join\n\nfrom .evaluator import evaluate\nfrom .parser import parse, unparse, parse_multiple\nfrom .types import Environment\n\n\ndef interpret(source, env=None):\n \"\"\"\n Inter... | python | edit | 1 | 3 | bsd-3-clause | b3c8ffd334df2c7669eb9f3a037ef6fa33fc521b | codecop/diy-lang,codecop/diy-lang | diylang/interpreter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (1, 0, 'post-release-SVN')\n\ndef get_version():\n \"Returns the version as a human-format string.\"\n v = '.'.join([str(i) for i in VERSION[:-1]])\n if VERSION[-1]:\n from django.utils.version import get_svn_revis... | python | edit | 1 | 5 | bsd-3-clause | 8e608c2155a4a466f1a4bf87df05c4e4ebd90c1c | blindroot/django,lsqtongxin/django,jgoclawski/django,blighj/django,fenginx/django,riklaunim/django-custom-multisite,jn7163/django,alrifqi/django,ryangallen/django,charettes/django,eugena/django,AndrewGrossman/django,yakky/django,eugena/django,denys-duchier/django,EliotBerriot/django,dwightgunning/django,hassanabidpk/dj... | django/__init__.py | rejected_duplicate | Near-duplicate of sample 11354 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#Initialize the logging.\n# InitLogging() should be called at the startup of each process in Procfile\n\nimport logging\n\ndef InitLogging():\n \"\"\"\n Initizalize the logging.\n \"\"\"\n\n logging.basicConfig(format='%(module)... | python | edit | 1 | 1 | mit | d8e5545a2397198b0f95854f86a4c4b0e39a42be | adityabansal/newsAroundMe,adityabansal/newsAroundMe,adityabansal/newsAroundMe | newsApp/loggingHelper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyramid.config import Configurator\n\n\ndef main(global_config, **settings):\n \"\"\" This function returns a Pyramid WSGI application.\n \"\"\"\n config = Configurator(settings=settings)\n config.include('pyramid_mako')\n ... | python | edit | 4 | 1 | mit | 4b018935c4729aff0dfcff709331f840dd05e8b6 | matslindh/kimochi-consumer | kimochiconsumer/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.translation import ugettext_lazy as _\n\nKEY_SIZE = 16\nSECRET_SIZE = 16\nVERIFIER_SIZE = 10\nCONSUMER_KEY_SIZE = 256\nMAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html\n\nPENDING = 1\nACCEPTED = 2\... | python | edit | 1 | 0 | bsd-3-clause | dccc51fcc51290648964c350cfff2254cfa99834 | e-loue/django-oauth-plus | oauth_provider/consts.py | rejected_duplicate | Near-duplicate of sample 1470 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass MockStatement(object):\n \"\"\"A class to imitate real INDRA Statements for calculating belief.\"\"\"\n def __init__(self, mk_hash, evidence, supports=None, supported_by=None):\n if isinstance(evidence, list):\n ... | python | edit | 1 | 4 | bsd-2-clause | 36b5bbba101b421234b4b776f4f4c2ac47516027 | johnbachman/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,pvtodorov/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/belpy,johnbachman/belpy,johnbachman/indra,pvtodorov/indra | indra/db/belief.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os.path\nimport re\n\nfrom pyramid.httpexceptions import HTTPBadRequest\nfrom pyramid.response import Response\nfrom pyramid.view import view_config\n\n\n@view_config(route_name='echo')\ndef echo(request):\n if request.method != '... | python | edit | 4 | 3 | bsd-2-clause | ebc5d1024c45a12595507fa1caa0bfc6353a9a32 | tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal | c2cgeoportal/views/echo.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Settings to be used when running unit tests\n# python manage.py test --settings=lazysignup.test_settings lazysignup\n\nDATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.\nDATABASE_... | python | edit | 1 | 0 | bsd-3-clause | 089af405b331ecfa2cb0cf9a74423c392beea4e4 | rwillmer/django-lazysignup,stefanklug/django-lazysignup,rwillmer/django-lazysignup,danfairs/django-lazysignup,danfairs/django-lazysignup,stefanklug/django-lazysignup | lazysignup/test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nfrom sqlalchemy.sql import func\nfrom models import MatchResult, BotSkill, BotRank\n\n\nclass SkillUpdater(object):\n def run(self, db):\n session = db.session\n today = datetime.date.today()\n skill... | python | edit | 1 | 3 | mit | eace27e618187860564de9501aabcb360112025a | gnmerritt/casino,gnmerritt/casino,gnmerritt/casino,gnmerritt/casino | matchmaker/skill.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\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.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | python | edit | 2 | 1 | apache-2.0 | fa9fc567e9dcbfa5f301e3c998f87699f9ee11d5 | openstack/python-magnumclient,ramielrowe/python-magnumclient,ramielrowe/python-magnumclient | magnumclient/magnum.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .conf import get_default_language\nfrom .translator import get_i18n_field\nfrom .utils import get_language\n\n\nclass ActiveLanguageMixin(object):\n '''\n Hide all translated fields, except:\n - The field for the default lang... | python | edit | 1 | 6 | bsd-3-clause | be27ec6d2567b85b94b40c79570ca5d9c20fd0bf | zostera/django-modeltrans,zostera/django-modeltrans | modeltrans/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration, DataMigration\nfrom django.db import models\n\n\nclass Migration(DataMigration):\n\n def forwards(self, orm):\n\n db.create_t... | python | edit | 5 | 1 | bsd-2-clause | 6d4573445692b86c4b406a4b1d93ce19199c328a | chop-dbhi/biorepo-portal,chop-dbhi/biorepo-portal,chop-dbhi/biorepo-portal,chop-dbhi/biorepo-portal | brp/accounts/migrations/0001_initial.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import date as vanilla_date\n\nfrom calendar_testing import CalendarTest\n\nfrom calexicon.calendars.other import JulianDayNumber\n\nclass TestJulianDayNumber(CalendarTest):\n def setUp(self):\n self.calendar = Julia... | python | edit | 1 | 1 | apache-2.0 | 8c097f07eca52dc37e8d3d4591bb9ee1c05fa310 | jwg4/qual,jwg4/calexicon | calexicon/calendars/tests/test_other.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport matplotlib.pyplot as plt\n\n\ndef save_all_figs(directory='./', fmt=None, default_name='untitled%i'):\n \"\"\"Save all open figures.\n\n Each figure is saved with the title of the plot, if possible.\n\n Parameters... | python | edit | 2 | 6 | bsd-3-clause | c32de922e3e7419d58a8cd7c1a00cf53833c49c7 | matteoicardi/mpltools,tonysyu/mpltools | mpltools/io/core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2010 United States Government as represented by the\n# Administrator of the National Aeronautics and Space Administration.\n# All Rights Reserved.\n#\n# Licensed under the Apache... | python | edit | 1 | 1 | apache-2.0 | 5161d6c0023151d39fb56a85f739063205e676f4 | noironetworks/nova,orbitfp7/nova,eayunstack/nova,badock/nova,JioCloud/nova,CEG-FYP-OpenStack/scheduler,badock/nova,mikalstill/nova,gooddata/openstack-nova,LoHChina/nova,rahulunair/nova,jeffrey4l/nova,shahar-stratoscale/nova,vmturbo/nova,scripnichenko/nova,mandeepdhami/nova,cyx1231st/nova,felixma/nova,luogangyi/bcec-nov... | nova/api/manager.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport graph\nfrom corpus.mysql.reddit import RedditMySQLCorpus\n\nimport cred\n\nif __name__ == '__main__':\n corpus = RedditMySQLCorpus()\n corpus.setup(**(cred.kwargs))\n\n result = corpus.run_sql('SELECT ari FROM comment_featur... | python | edit | 1 | 0 | mit | c7c1fa91a0ec213bd648f2f50f95f5652891d3ab | worldwise001/stylometry | main/readability_graph.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Config(object):\n \"\"\"\n Base configuration class. Contains one method that defines the database URI.\n\n This class is to be subclassed and its attributes defined therein.\n \"\"\"\n\n def __init__(self):\n s... | python | edit | 1 | 2 | mit | 3588c52060b540f6d3ca791c7309b4e9185a60aa | soccermetrics/marcotti-mls | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Touchscreen Kivy Interface for Lidar Project\n\nfrom kivy.app import App\nfrom kivy.uix.gridlayout import GridLayout\nfrom kivy.core.window import Window\n\n#Window.clearcolor=(1,1,1,1)\n\nclass Init_Screen(GridLayout):\n\tpass\n\nclass M... | python | edit | 2 | 2 | mit | e3f6b604c90032dc1fb9dcc9838f11aa10498dae | the-raspberry-pi-guy/lidar | pi_approach/UI/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport discord\n\nclass MyClient(discord.Client):\n async def on_ready(self):\n print('Logged in as')\n print(self.user.name)\n print(self.user.id)\n print('------')\n\n async def on_member_join(self, membe... | python | edit | 1 | 2 | mit | 00ee7549c900d8c3bcae94141a8b8c774d943731 | imayhaveborkedit/discord.py,Harmon758/discord.py,Rapptz/discord.py,Harmon758/discord.py,khazhyk/discord.py,rapptz/discord.py | examples/new_member.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by generate.js. Commit this file, but do not edit it.\n\nfrom manager.helpers import EnumChoice\n\n# The version of Thema to use\nversion = \"2.20.0\"\n\n\nclass Themes(EnumChoice):\n \"\"\"The list of Thema themes.\"\"\"\n\n... | python | edit | 1 | 0 | apache-2.0 | 7d988a0d622496065e3b1acbb9f4a32fa3678c9e | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | manager/manager/themes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDoc string here.\n\n@author mje\n@email: mads [] cnru.dk\n\n\"\"\"\nimport sys\nimport subprocess\n\ncmd = \"/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis\"\n\nsubjects = [\"0004\", \"0005\", \"0006\", \"0007\", \"00... | python | edit | 1 | 0 | mit | 91835ee095aaa36cb44ed0bca691045678a32703 | MadsJensen/malthe_alpha_project,MadsJensen/malthe_alpha_project | wrapper_functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mailu import db, models, app, limiter\nfrom mailu.internal import internal, nginx\n\nimport flask\nimport flask_login\n\n\n@internal.route(\"/auth/email\")\n@limiter.limit(\n app.config[\"AUTH_RATELIMIT\"],\n lambda: flask.reques... | python | edit | 4 | 5 | mit | 17b184e5c8d41eb083dc6400f6fca2a3eeb8f742 | kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io | core/admin/mailu/internal/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2012 OpenStack LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# ... | python | edit | 1 | 1 | apache-2.0 | ecea45689fdebf409b06311cc8e84b2e609967e1 | vponomaryov/manila,weiting-chen/manila,jcsp/manila,openstack/manila,sajuptpm/manila,sajuptpm/manila,scality/manila,bswartz/manila,NetApp/manila,scality/manila,vponomaryov/manila,jcsp/manila,redhat-openstack/manila,redhat-openstack/manila,openstack/manila,NetApp/manila,weiting-chen/manila,bswartz/manila | manila/tests/fake_driver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom sentry.models import ApiKey, OrganizationMemberType\nfrom sentry.web.forms.fields import OriginsField\nfrom ... | python | edit | 1 | 3 | bsd-3-clause | 512ec31a3c022bc8a31d57bc51e4e6dac29dcf83 | hongliang5623/sentry,TedaLIEz/sentry,gg7/sentry,ifduyue/sentry,wujuguang/sentry,boneyao/sentry,fuziontech/sentry,fuziontech/sentry,pauloschilling/sentry,mvaled/sentry,JackDanger/sentry,imankulov/sentry,kevinlondon/sentry,kevinlondon/sentry,vperron/sentry,looker/sentry,Natim/sentry,looker/sentry,beeftornado/sentry,Kryz/... | src/sentry/web/frontend/organization_api_key_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.contrib.auth.models import User\n\nclass Subscriber(models.Model):\n user_rec = models.ForeignKey(User)\n address_one = models.CharField(max_length=100)\n address_two = models.CharField(max... | python | edit | 1 | 1 | mit | fd4c7e3af81a4a37462dfcd7c3ac4eb43bdafcb2 | deenaariff/Django,tabdon/crmeasyapp,tabdon/crmeasyapp | crmapp/subscribers/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\"\"\"\nFunctions to dynamically attach attributes to classes.\nMost of parsing result is cached because of immutability of input data.\n\"\"\"\n\n\nclass cached_property(object):\n \"\"\"\n Copied from Django.\n \... | python | edit | 1 | 1 | mit | 89971ece16ee1c062a8a54fa5cd83c473628c2ba | gorlemik/pyanyapi,Stranger6667/pyanyapi | pyanyapi/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Save graphical representations of all the lyman workflows.\"\"\"\nimport os\nimport re\nfrom glob import glob\nfrom lyman import workflows as wf\nfrom nipype import config\n\n\ndef main():\n\n config.set('logging', 'workflow_level'... | python | edit | 2 | 10 | bsd-3-clause | 25a95d34fcfa9447302ec399affdee14e0362cd7 | tuqc/lyman,mwaskom/lyman,kastman/lyman | write_graphs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Builds a test suite for all tests in the 'core' directory.\n\nThe django-admin command `tests` looks for a tests.py file and expects a suite()\nroutine to return a unittest.TestSuite.\n\"\"\"\nimport unittest\n\nimport KegbotJsonServe... | python | edit | 1 | 2 | mit | fd0c368d6527c1a20e904ff911238d4e75811e4f | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | pykeg/core/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom context_managers import warnings_only\nfrom decorators import hosts, roles, runs_once\nfrom operations import require, prompt, put, get, run, sudo, local\nfrom state import env\nfrom utils import abort, warn\n\n```\n\nApply this change... | python | edit | 17 | 0 | bsd-2-clause | c0d84ec83dcd62f556cbd236abd40d54e15b1008 | xLegoz/fabric,pashinin/fabric,tekapo/fabric,pgroudas/fabric,bitmonk/fabric,jaraco/fabric,amaniak/fabric,cmattoon/fabric,askulkarni2/fabric,StackStorm/fabric,haridsv/fabric,TarasRudnyk/fabric,ericholscher/fabric,ploxiln/fabric,kxxoling/fabric,fernandezcuesta/fabric,rbramwell/fabric,hrubi/fabric,raimon49/fabric,bspink/fa... | fabric/__init__.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTests for StopWordFactory\n\"\"\"\nimport os\n\nfrom unittest import TestCase\n\nfrom mots_vides.stop_words import StopWord\nfrom mots_vides.factory import StopWordFactory\n\n\nclass StopWordFactoryTestCase(TestCase):\n\n def set... | python | edit | 1 | 1 | bsd-3-clause | 3301e7101cb73674047613ef8a20c16cd2d504da | Fantomas42/mots-vides,Fantomas42/mots-vides | mots_vides/tests/factory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.timezone import now\nfrom django.utils.translation import get_language\nfrom django.utils.translation import ugettext_lazy as _\nfrom rdmo.core.utils import get_languages\n\n\nclass Model(mode... | python | edit | 1 | 7 | apache-2.0 | 59c9b0a3914920c19c9ccdbf5d77e4ce990d7d58 | rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo | rdmo/core/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom dataviva import db\n\nclass Call(db.Model):\n __tablename__ = 'partner_call'\n id = db.Column(db.Integer, primary_key=True)\n title = db.Column(db.String(400))\n link = db.Column(db.String(250))\n\n\n```\n\nApply this chang... | python | edit | 1 | 0 | mit | 91de92361ae02d796da4ef6b58ac8e63ca437614 | DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site | dataviva/apps/partners/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import hide, settings\nfrom fabric.colors import blue\nfrom contextlib import contextmanager\n\n\ndef header(txt):\n \"\"\"Decorate a string to make it stand out as a header. \"\"\"\n wrapper = \"----------------------... | python | edit | 1 | 2 | mit | 550c9754f3e3a93c5ece36befb3ecbcffc6a3d2b | scimusmn/transit | helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport importlib\n\nfrom simpleflow.activity import Activity\n\nfrom .exceptions import DispatchError\n\n\nclass Dispatcher(object):\n \"\"\"\n Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_... | python | edit | 1 | 2 | mit | f2abc1d265d7eed57223a14009900db7e622d7f6 | botify-labs/simpleflow,botify-labs/simpleflow | simpleflow/swf/process/worker/dispatch/dynamic_dispatcher.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# ############# version ##################\nfrom pkg_resources import get_distribution, DistributionNotFound\nimport os.path\nimport subprocess\nimport re\n\n\nGIT_DESCRIBE_RE = re.compile('^(?P<version>v\\d+\\.\\d+... | python | edit | 1 | 0 | mit | b4207380bc5b8639397e3d1d9a4b70069ef8d6e7 | HydraChain/hydrachain,wangkangda/hydrachain,HydraChain/hydrachain,wangkangda/hydrachain | hydrachain/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python3.6\n\n# read nginx access log\n# parse and get the ip addresses and times\n# match ip addresses to geoip\n# possibly ignore bots\n\nimport re\n\n\ndef get_log_lines(path):\n \"\"\"Return a list of regex matched log ... | python | edit | 1 | 3 | mit | 4636fc514b0ebf7b16e82cc3eb7de6b69431cd43 | mouhtasi/basic_site_analytics | site_analytics.py | rejected_duplicate | Near-duplicate of sample 9761 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .validation import valid_hostname, valid_port\n\n\ndef resolve(path_or_address=None, address=None, *ignored):\n \"\"\"Returns (path, address) based on consecutive optional arguments, [path] [address].\"\"\"\n if path_or_address i... | python | edit | 1 | 9 | mit | c27020fc832ce9cba8efee72034c32bb7a3e6b30 | joeyespo/path-and-address | path_and_address/parsing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom bejmy.categories.models import Category\n\n\n@admin.register(Category)\nclass CategoryAdmin(admin.ModelAdmin):\n list_display = (\n 'name',\n 'user',\n 'transaction_type',\n ... | python | edit | 1 | 2 | mit | 0483563fd08063e856915099075b203379e61e7c | bejmy/backend,bejmy/backend | bejmy/categories/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nBenchExec is a framework for reliable benchmarking.\nThis file is part of BenchExec.\n\nCopyright (C) 2007-2015 Dirk Beyer\nAll rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use ... | python | edit | 3 | 1 | apache-2.0 | c0c7222f4ab1c39dadd78c9bde40d882780ce741 | ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,dbeyer/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec | benchexec/tools/legion.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport msgpack\nfrom datetime import datetime\nfrom . import Serializer\n\n\ndef default_handler(obj):\n\ttry:\n\t\titerable = iter(obj)\n\texcept TypeError:\n\t\tpass\n\telse:\n\t\treturn list(iterable)\n\t\n\tif isinstance(obj, datetime):... | python | edit | 2 | 3 | mit | ed36889bbac47015722d50e0253f72a609203c5e | cooper-software/cellardoor | cellardoor/serializers/msgpack_serializer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models.signals import post_save, post_delete\nfrom django.db import models\n\nfrom wagtail.wagtailsearch.index import Indexed\nfrom wagtail.wagtailsearch.backends import get_search_backends\n\n\ndef post_save_signal_handler(i... | python | edit | 1 | 4 | bsd-3-clause | b4fdec74ac1af2b50ab5c79f6127d87033a9d297 | rv816/wagtail,serzans/wagtail,serzans/wagtail,FlipperPA/wagtail,iansprice/wagtail,nrsimha/wagtail,Toshakins/wagtail,kurtrwall/wagtail,jorge-marques/wagtail,stevenewey/wagtail,darith27/wagtail,kaedroho/wagtail,iho/wagtail,WQuanfeng/wagtail,nealtodd/wagtail,quru/wagtail,mikedingjan/wagtail,timorieber/wagtail,timorieber/w... | wagtail/wagtailsearch/signal_handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom translate import Translator\ntranslator= Translator(to_lang=\"ru\")\ntranslation = translator.translate(\"Hello, world!\")\nprint translation\n\n```\n\nApply this change: Add langs list, add random lang\n\nAdd langs list that includes ... | python | edit | 3 | 0 | mit | 4a7ef27e895ec0f22890062931a2ed68f17a1398 | powderblock/PyBad-Translator | BadTranslator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import ListView\n\nfrom bills.mixins import AllSubjectsMixin\nfrom core.mixins import ConveneTimeMixin\nfrom legislators.mixins import AllLegislatorsMixin, ChambersMixin\n\nfrom explainers.models import Explainer\n... | python | edit | 1 | 1 | mit | 87707340ac82f852937dae546380b5d5327f5bc7 | texastribune/txlege84,texastribune/txlege84,texastribune/txlege84,texastribune/txlege84 | txlege84/core/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport uplink\n\n# Local imports\nimport github\n\nBASE_URL = \"https://api.github.com/\"\n\nif __name__ == \"__main__\":\n # Create a client that uses the marshmallow converter\n gh = github.GitHub(\n base_url=BASE_URL, conver... | python | edit | 1 | 0 | mit | 2264e4195e873760b922e6d346eb56d8e1ec6e09 | prkumar/uplink | examples/marshmallow/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nMATCH_LIST_URL = \"http://data.vexvia.dwabtech.net/mobile/events/csv\"\nDIVISION_URL = \"http://data.vexvia.dwabtech.net/mobile/{}/divisions/csv\"\nMATCH_URL = \"http://data.vexvia.dwabtech.net/mobile/{}/{}/matches/csv\"\n\... | python | edit | 1 | 6 | mit | 4c69a59f99fd5f425c31e3fdcbf6e3f78d82d9e4 | DLProgram/Project_Snake_Sort,DLProgram/Project_Snake_Sort | vex_via_wrapper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n# Create your models here.\nclass Calendar(models.Model):\n name = models.CharField(max_length=30, unique=True)\n remote_id = models.CharField(max_length=60)\n css_class = models.CharField(max_length... | python | edit | 1 | 1 | mit | 47d507bdc4dc0ecd54e9956a40741f3b75664ab2 | Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano | events/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\n\nif sys.argv.__len__() < 3:\n print \"Usage : Enter time needed for each portion of the code\"\n print \" % overhead <advance> <exchange> <regrid>\"\n sys.exit();\n\na = float(sys.argv[1])\ne... | python | edit | 10 | 0 | bsd-2-clause | 215fba180eee818b123e31a15e4b9d6a6a895c79 | ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw | scripts/overhead.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\nimport os\nimport httplib\nimport string\n\n# To install run:\n# sudo wget http://$JENKINS_URL/plugin/ec2/AMI-Scripts/ubuntu-init.py -O /usr/bin/userdata\n# sudo chmod +x /etc/init.d/userdata\n# add the following line to ... | python | edit | 1 | 0 | mit | f47c5e3d5ef32f1d02b78c1de9737c26754404b2 | mkozell/ec2-plugin,jenkinsci/ec2-plugin,jenkinsci/ec2-plugin,jenkinsci/ec2-plugin,jenkinsci/ec2-plugin,mkozell/ec2-plugin,mkozell/ec2-plugin,mkozell/ec2-plugin | src/main/webapp/AMI-Scripts/ubuntu-init.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n# $Header$\nimport sys\nfrom distutils.core import setup\n\n_url = \"http://www.zolera.com/resources/opensrc/zsi\"\n\nimport ConfigParser\ncf = ConfigParser.ConfigParser()\ncf.read('setup.cfg')\n_version = \"%d.%d\" ... | python | edit | 2 | 0 | mit | 6a71271ed00ba164cf2755f728f0dbf2ed310f6b | acigna/pywez,acigna/pywez,acigna/pywez | zsi/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom aiohttp import web\n\nfrom . import __version__\n\n\nclass Server:\n def __init__(self, host='127.0.0.1', port=8080):\n self._host = host\n self._port = port\n self.app = web.Application()\n self.app.rout... | python | edit | 1 | 2 | bsd-3-clause | 74d668cb8291822a167d1ddd0fecf7e580375377 | slivingston/rcomp,slivingston/rcomp,slivingston/rcomp | serv/rcompserv/serv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .compiler import ParseResult\n\nfrom .expressions import (\n Alt,\n And,\n Any,\n Backtrack,\n Bind,\n End,\n Expect,\n Fail,\n ForwardRef,\n Left,\n List,\n Literal,\n Not,\n Opt,\n Or,\n ... | python | edit | 52 | 0 | mit | 682010eafe28eed1eeb32ba9d34e213b4f2d7d4b | jvs/sourcer | sourcer/__init__.py | rejected_lint | Too many lint violations: 52 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\ndef next_palindrome(k):\n\tpalin = list(k)\n\tn = len(k)\n\tmid = n // 2\n\t\n\t# case 1: forward right\n\tjust_copy = False\n\tfor i in range(mid, n):\n\t\tmirrored = n - 1 - i\n\t\tif k[i] < k[mirrored]:\n\t\t\tjus... | python | edit | 1 | 10 | mit | 9e07a21df955b599d27eb8b98b53395fa7170257 | mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming | spoj/00005/palin.py | rejected_duplicate | Near-duplicate of sample 4255 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom thinglang import utils\nfrom thinglang.execution.execution import ExecutionEngine\nfrom thinglang.lexer.lexer import lexer\nfrom thinglang.parser.analyzer import Analyzer\nfrom thinglang.parser.parser import parse\nfrom th... | python | edit | 1 | 3 | mit | 708b519e066b8d443ed4768293db4517021d68fc | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/__init__.py | rejected_duplicate | Near-duplicate of sample 3898 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nsentry.utils.social_auth\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom ... | python | edit | 1 | 3 | bsd-3-clause | 960436b17211a225a729805a528653f2aff675d7 | BuildingLink/sentry,gg7/sentry,kevinlondon/sentry,zenefits/sentry,ewdurbin/sentry,daevaorn/sentry,looker/sentry,zenefits/sentry,BuildingLink/sentry,1tush/sentry,wujuguang/sentry,ewdurbin/sentry,rdio/sentry,pauloschilling/sentry,songyi199111/sentry,argonemyth/sentry,wong2/sentry,jokey2k/sentry,zenefits/sentry,beeftornad... | src/sentry/utils/social_auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n\ndef test_basic_import():\n import foyer\n assert 'forcefields' in dir(foyer)\n import foyer.forcefields.forcefields\n\n```\n\nApply this change: Update test to check more internals"
},
{
"role": "assistan... | python | edit | 4 | 1 | mit | b6941b35f5bb20dbc2c7e05bbf6100bf0879be3f | mosdef-hub/foyer,iModels/foyer,iModels/foyer,mosdef-hub/foyer | foyer/tests/test_plugin.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport feedparser\nimport pickle\nimport requests\n\nhub = \"http://feeds.feedburner.com/ampparit-politiikka\" ## collect from ampparit all politics related sites\n\nfeed = feedparser.parse( hub )\n\nstored = []\n\ntry:\n stored = pickle... | python | edit | 1 | 0 | mit | f7a9f65e68b2fe78a0180acb1b2bef552e9633f3 | HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015 | media/collector.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'pascal'\n\nfrom crawler.Crawler import Crawler\nfrom utils.path import RessourceUtil\n\n# _____ _\n# | ____|_ ____ _ _ __ ___ _ __ | | ___\n# | _| \\ \\/ / _` | '_ ` _ \\| '_ \\| |/ _ \\\n# | |___... | python | edit | 1 | 2 | cc0-1.0 | c8100c89298091179c9ad7f84452328e28efaa03 | pascalweiss/SearchEngine,yveskaufmann/SearchEngine,yveskaufmann/SearchEngine | crawler/CrawlerExample.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\nimport datetime\nfrom django.utils.timezone import utc\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom django.contrib.contenttypes.models import ContentType\nfrom ... | python | edit | 1 | 1 | mit | 332f275b3ac4b93c523b474c94268bac834c180c | DummyDivision/Tsune,DummyDivision/Tsune,DummyDivision/Tsune | memorize/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nfrom dj_experiment.tasks.tasks import longtime_add\n\nif __name__ == '__main__':\n result = longtime_add.delay(1, 2)\n # at this time, our task is not finished, so it will return False\n print 'Task finished? ', resu... | python | edit | 9 | 0 | mit | 19a8a0e2f85b7ab01cbd3e2dd283e8e1e9b97373 | francbartoli/dj-experiment,francbartoli/dj-experiment | example/example/tasksapp/run_tasks.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom skvideo.stuff import *\nfrom skvideo.version import __version__\n\n# If you want to use Numpy's testing framerwork, use the following.\n# Tests go under directory tests/, benchmarks under directory benchmarks/\nfrom numpy.testing impor... | python | edit | 3 | 0 | bsd-3-clause | ec613fe1df31dd65d8a52351a29482b54ce007b3 | aizvorski/scikit-video | skvideo/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .settings import * # NOQA\n\n\n# Django 1.8 still has INSTALLED_APPS as a tuple\nINSTALLED_APPS = list(INSTALLED_APPS)\nINSTALLED_APPS.append('djoyapp')\n\n```\n\nApply this change: Remove handling of apps tuple, it is always list now... | python | edit | 2 | 0 | mit | d6500b3d9af37fb2cd0fa14c82f78b165f9d221b | jamescooke/factory_djoy | test_framework/test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import migrations\n\nTENANT_TYPE = 'Packages.Template'\nLIMIT = 'limit'\n\n\ndef process_components(apps, schema_editor):\n OfferingComponent = apps.get_model('marketplace', 'OfferingComponent')\n OfferingComponent.obje... | python | edit | 1 | 0 | mit | aeefef1f80ba92c7900c95c436b61b019d8ffb6a | opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur | src/waldur_mastermind/marketplace_openstack/migrations/0011_limit_components.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nfrom django.conf import settings\nfrom celery.task import Task\nfrom celery.utils.log import get_task_logger\n\nfrom .models import Account\n\nlogger = get_task_logger(__name__)\n\n\nclass Hotsocket_Login(Task):\n\n \"... | python | edit | 1 | 1 | bsd-3-clause | 46af8faf699d893a95ecec402030ef74e07e77ed | westerncapelabs/gopherairtime,westerncapelabs/gopherairtime | recharges/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .common import *\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\n# Database\n# https://docs.djangoproject.com/en/1.9/ref/settings/#databases\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'd... | python | edit | 12 | 0 | mit | 2932698f81a17204b824763e648cd56dbab5f5b2 | whitesmith/hawkpost,whitesmith/hawkpost,whitesmith/hawkpost | hawkpost/settings/development.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\n\nimport const\nimport uniformdh\n\nimport obfsproxy.network.buffer as obfs_buf\n\nclass UniformDHTest( unittest.TestCase ):\n\n def setUp( self ):\n weAreServer =... | python | edit | 1 | 2 | bsd-3-clause | 745c03d3cc5ae31fb852ba7bfc9d0ad6a9ac4716 | isislovecruft/scramblesuit,isislovecruft/scramblesuit | unittests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport os\nimport shutil\nimport sys\nimport readline\nimport traceback\n\nreadline.parse_and_bind('tab: complete')\nreadline.parse_and_bind('set editing-mode vi')\nbuiltin_cmds = {'cd', 'pwd', 'exit',}\n\ndef prom... | python | edit | 1 | 5 | mit | da47bca1bbdffff536d240cafe780533ee79809e | mmichie/mesh | mesh.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\nimport pytest\nimport holviapi\n\n@pytest.fixture\ndef connection():\n pool = os.environ.get('HOLVI_POOL', None)\n key = os.environ.get('HOLVI_KEY', None)\n if not pool or not key:\n raise... | python | edit | 1 | 3 | mit | 353ad2e4d03d5ad5a8c5a1e949e8cd3251c7d85b | rambo/python-holviapi,rambo/python-holviapi | holviapi/tests/test_api_idempotent.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom util import pklload\nfrom collections import defaultdict\nimport indra.tools.assemble_corpus as ac\n\n\nif __name__ == '__main__':\n # Load cached Statements just before going into the model\n stmts = pklload('pysb_stmts')\n\n ... | python | edit | 3 | 0 | bsd-2-clause | 6c932dc133ca2e6608297a93489e5c57ad73d5c2 | johnbachman/belpy,sorgerlab/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/belpy,pvtodorov/indra,bgyori/indra,pvtodorov/indra,pvtodorov/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,sorgerlab/indra,bgyori/indra,johnbachman/indra,bgyori/indra | models/fallahi_eval/evidence_sources.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Third-party modules\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import KFold\n# Hand-made modules\nfrom .base import BloscpackMixin\n\nKWARGS_READ_CSV = {\n \"sep\": \"\\t\",\n \"header\": 0,\n \"parse_... | python | edit | 3 | 2 | mit | 62c5e911689555c62931692e0d6ff87ed7340559 | gciteam6/xgboost,gciteam6/xgboost | src/models/split.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test plugin.\"\"\"\n\n\ndef load(*args, **kwargs):\n pass\n\n\ndef dump(*args, **kwargs):\n pass\n\n\ndef plugin():\n import sys\n return (__name__.split('.')[-1], sys.modules.get(__name__))\n\n```\n\nApply this change: Pu... | python | edit | 1 | 0 | bsd-3-clause | f081906482bf080363dd494a6ab0ca6ed63b49f5 | monkeython/loremipsum | loremipsum/tests/plugs_testpackage/plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pysqlite2 import dbapi2 as sqlite\nimport sys, os.path\n\nclass Statistics:\n def __init__(self):\n self.total = 0\n self.passed = 0\n self.failed = 0\n\n def register(self, manager, parser):\n manager... | python | edit | 1 | 2 | mit | 61f710b64f32da26bd36c7c95a3f46e4d21c991a | asm0dey/Flexget,gazpachoking/Flexget,vfrc2/Flexget,X-dark/Flexget,ianstalk/Flexget,patsissons/Flexget,tvcsantos/Flexget,ibrahimkarahan/Flexget,Flexget/Flexget,ibrahimkarahan/Flexget,lildadou/Flexget,LynxyssCZ/Flexget,antivirtel/Flexget,drwyrm/Flexget,jawilson/Flexget,offbyone/Flexget,ZefQ/Flexget,thalamus/Flexget,malka... | modules/output_statistics.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Test the frozen module defined in frozen.c.\nfrom __future__ import with_statement\n\nfrom test.test_support import captured_stdout, run_unittest\nimport unittest\nimport sys, os\n\nclass FrozenTests(unittest.TestCase):\n def test_froz... | python | edit | 5 | 6 | mit | ee485b086e66f6c423e6c9b728d43a6ace071d55 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_frozen.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport pytest\n\nfrom cheetah_lint import five\n\n\n@pytest.yield_fixture(autouse=True)\ndef no_warnings(recwarn):\n yield\n ret = len(tuple(\n warning for warning in recwarn\n # cheetah raises t... | python | edit | 1 | 4 | mit | 28252bbc3c5f784e5f6267788a7f4196473d7292 | asottile/cheetah_lint | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n# Database configurations.\nDB_HOST = os.environ.get('OBJECTCUBE_DB_HOST', 'localhost')\nDB_USER = os.environ.get('OBJECTCUBE_DB_USER', os.environ.get('LOGNAME'))\nDB_PORT = int(os.environ.get('OBJECTCUBE_DB_PORT', 5432))\nDB_D... | python | edit | 1 | 0 | bsd-2-clause | 47b751c5578d2419eaf1a7bb90c53b46eea80c9f | rudatalab/python-objectcube,rudatalab/python-objectcube,rudatalab/python-objectcube | objectcube/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom steamfiles import acf\n\n\n@pytest.yield_fixture\ndef acf_data():\n with open('tests/test_data/appmanifest_202970.acf', 'rt') as f:\n yield f.read()\n\n\n@pytest.mark.usefixtures('acf_data')\ndef test_loads_dum... | python | edit | 1 | 1 | mit | 23075e994d081a90a1b3ed48b7e30b82c4614854 | leovp/steamfiles | tests/test_acf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.views.generic import FormView\n\nfrom .crypto import Parchment\nfrom .forms import ParchmentForm\n\n\nclass ParchmentView(FormView):\n form_class = ParchmentForm\n template_name = 'parchme... | python | edit | 1 | 2 | bsd-3-clause | 3f57221af38a25dceb9d1024c225481ec2f49328 | jbittel/django-parchment,jbittel/django-parchment | parchment/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport flask\n\napp = flask.Flask(__name__)\n\n@app.route('/')\ndef index():\n\treturn flask.jsonify(hello='world')\n\nif __name__ == '__main__':\n\tapp.run(debug=True)\n\n```\n\nApply this change: Add /tours endpoint with dummy data"
},
... | python | edit | 1 | 1 | mit | 93ebb6982851a710ff17c856059b1368bed24168 | wtg/RPI_Tours_Server | server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nimport git, os\n\nclass Github (models.Model):\n username = models.CharField(max_length=39)\n repository = models.CharField(max_length=100)\n\n def __str__(self):\n return self.repository\n\n ... | python | edit | 1 | 1 | bsd-3-clause | 45d442cfe9c737332ca75e68e1488667937015ed | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | src/repository/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom default_settings import *\n\nimport dj_database_url\n\nDATABASES = {\n 'default': dj_database_url.config(),\n}\n\nSECRET_KEY = os.environ['SECRET_KEY']\n\nSTATICFILES_STORAGE = 's3storage.S3HashedFilesStorage'\n\nAWS_ACCESS_KEY_ID =... | python | edit | 8 | 0 | mit | b86bcfd1f1762cbb956b3eb42b515107249cb66e | brutasse/djangopeople,brutasse/djangopeople,django/djangopeople,django/djangopeople,django/djangopeople,brutasse/djangopeople,polinom/djangopeople,polinom/djangopeople,brutasse/djangopeople,polinom/djangopeople,polinom/djangopeople | production_settings.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Python 3\n\nimport glob\nimport os\n\nuglifyjs = os.path.abspath(\"../lib/uglifyjs\")\ninput_dir = os.path.abspath(\"./Resources/Tracker/scripts\")\noutput_dir = os.path.abspath(\"./Resources/Tracker/scripts.min\")\n\nfor file in glob.glo... | python | edit | 1 | 0 | mit | 51a2ac2d66d4245626f3d8830bb47f596b3d9879 | chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker | app/minify.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nimport falcon\n\nimport models\nimport schemas\nimport api_util\n\n\nsettings_schema = schemas.SettingSchema(many=True)\nsetting_schema = schemas.SettingSchema()\n\n\nclass SettingsResource:\n\n def on_get(self, req, resp)... | python | edit | 3 | 4 | mit | ca43660869bbd390979a928dc219e016c1a0607a | thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline | api/route_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom test_api import *\nfrom view_tests import *\nfrom test_doc_building import *\nfrom test_backend import *\n\n```\n\nApply this change: Kill the view tests for now, to get them greeeeeen"
},
{
"role": "assistant",
"content": ... | python | edit | 4 | 0 | mit | f3c95f9875c59564faff909b0cf5a8869515b1f3 | agjohnson/readthedocs.org,kdkeyser/readthedocs.org,laplaceliu/readthedocs.org,LukasBoersma/readthedocs.org,fujita-shintaro/readthedocs.org,davidfischer/readthedocs.org,cgourlay/readthedocs.org,stevepiercy/readthedocs.org,soulshake/readthedocs.org,hach-que/readthedocs.org,SteveViss/readthedocs.org,raven47git/readthedocs... | readthedocs/rtd_tests/tests/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\n\nparser = argparse.ArgumentParser()\n\nparser.add_argument(\"-subjects\", nargs=\"*\", dest=\"subjects\",\n help=(\"list of subject ids, name of file in lyman \"\n \"directory, o... | python | edit | 1 | 0 | bsd-3-clause | 105d46937babb7a43901d8238fb9cc0a7b00c8c9 | mwaskom/lyman,tuqc/lyman,kastman/lyman | lyman/tools/commandline.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Python library to enable Axis devices to integrate with Home Assistant.\"\"\"\n\nimport requests\nfrom requests.auth import HTTPDigestAuth\n\nclass Configuration(object):\n \"\"\"Device configuration.\"\"\"\n\n def __init__(self... | python | edit | 1 | 1 | mit | ac95449e6774538756d7813d73c8b113f9dcb6e6 | Kane610/axis | axis/configuration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom feature import Feature\nfrom output import good, bad, info\nfrom tabulate import tabulate\n\n\nclass Addons(Feature):\n def run(self, args):\n with open(self.profile_path('extensions.json')) as f:\n ad... | python | edit | 1 | 7 | mit | f8b83fc7976768c2b9d92ab35297aa17637eeb92 | numirias/firefed | firefed/feature/addons.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Convenience functions for matplotlib plotting and image viewing.\"\"\"\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n\ndef show(image, blocking=False, title='', **kwargs):\n \"\"\"Show *image*. If *blocking* is False... | python | edit | 1 | 1 | mit | 0e30e73ffa928b11fd6ee6c0ea12709100623e5f | tfarago/pltpreview | pltpreview/view.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport six\n\nfrom formats import FormatBank, discover_json, discover_yaml\n\n\nformats = FormatBank()\n\ndiscover_json(formats, content_type='application/json')\ndiscover_yaml(formats, content_type='application/x... | python | edit | 1 | 4 | mit | 0f2ccc881e8d2b8b0f4064e3e1fae39b14875821 | redodo/tortilla | tortilla/utils.py | rejected_duplicate | Near-duplicate of sample 1445 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app import db\n\n\nclass User(db.Model):\n __tablename__ = 'users'\n\n username = db.Column(db.String(64), nullable=False, unique=True, primary_key=True)\n password = db.Column(db.String(192), nullable=False)\n\n def __ini... | python | edit | 1 | 1 | mit | c3c8c566c8294715b07614c1d18a2c6de3a7c212 | jawrainey/atc,jawrainey/atc | app/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, date, timedelta\nimport unittest\n\nfrom businesstime.holidays.aus import QueenslandPublicHolidays, BrisbanePublicHolidays\n\n\nclass QueenslandPublicHolidaysTest(unittest.TestCase):\n\n def test_2016_08(se... | python | edit | 4 | 1 | bsd-2-clause | 314b8cf14eb3bed9b116b78ce0199e73399a4dab | seatgeek/businesstime | businesstime/test/holidays/aus_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Request handler of the module.\"\"\"\n\nfrom functools import partial\n\nfrom ppp_datamodel import Sentence, TraceItem, Response\nfrom ppp_datamodel.parsers import parse_triples, ParseError\n\ndef tree_to_response(measures, trace, tre... | python | edit | 3 | 3 | mit | f3cdd316f9e0859f77389c68b073134a6076374b | ProjetPP/PPP-DatamodelNotationParser,ProjetPP/PPP-DatamodelNotationParser | ppp_datamodel_notation_parser/requesthandler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Filesystem utilities.\"\"\"\nimport contextlib\nimport os\nimport shutil\n\nRUN_RE = '^\\d{6}_[a-zA-Z\\d\\-]+_\\d{4}_[AB0][A-Z\\d\\-]+$'\n\n@contextlib.contextmanager\ndef chdir(new_dir):\n \"\"\"Context manager to temporarily chan... | python | edit | 3 | 2 | mit | 9ec8949d62188efe8c40e859c20fc55339f4e7e2 | SciLifeLab/TACA,SciLifeLab/TACA,SciLifeLab/TACA | taca/utils/filesystem.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport subprocess\n\nfrom lib import functional\n\nfrom util import find_all\n\n\ndef coverage_module(package, module):\n command = (\n 'coverage run --branch'\n ' --source=%s.%s tests/%s... | python | edit | 4 | 2 | mit | 5736e8314d5af3346a15224b27448f1c795f665c | Tactique/game_engine,Tactique/game_engine | bin/coverage_check.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport logging\nimport pytz\n\nBOT_URL = os.getenv(\"BOT_URL\", \"\")\nENVIRONMENT = os.getenv(\"ENVIRONMENT\", \"local\")\nWEBHOOK = os.getenv(\"WEBHOOK\", \"\")\nBOTTLE_PORT = os.getenv(\"BOTTLE_PORT\", \"8080\")\nBOTTLE_HOST =... | python | edit | 1 | 0 | mit | bd31b43fc6f282f2f6cc4bf11a6ae5c51e0e3501 | cesar0094/telegram-tldrbot | bot/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom scipy.sparse import csr_matrix\n\nfrom . import _cpp\nfrom .system import System\nfrom .lattice import Lattice\nfrom .support.sparse import SparseMatrix\n\n\nclass Model(_cpp.Model):\n def __init__(self, *params):\n super()._... | python | edit | 1 | 4 | bsd-2-clause | 4dd5dbf6c1f693c54b31a84756350cb9588921d1 | dean0x7d/pybinding,MAndelkovic/pybinding,MAndelkovic/pybinding,dean0x7d/pybinding,dean0x7d/pybinding,MAndelkovic/pybinding | pybinding/model.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'docs',\n 'USER': 'postgres', # Not used with sqlite3.\n 'PASSWORD': '',... | python | edit | 3 | 0 | mit | e6d216077a683aa07b811b5f131dd07809f741bc | michaelmcandrew/readthedocs.org,ojii/readthedocs.org,safwanrahman/readthedocs.org,Tazer/readthedocs.org,CedarLogic/readthedocs.org,kdkeyser/readthedocs.org,GovReady/readthedocs.org,Tazer/readthedocs.org,nikolas/readthedocs.org,dirn/readthedocs.org,espdev/readthedocs.org,johncosta/private-readthedocs.org,gjtorikian/read... | readthedocs/settings/postgres.py | rejected_duplicate | Near-duplicate of sample 11103 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.2.24 on 2021-09-14 17:54\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('app_manager', '0018_migrate_case_search_labels'),\n ]\n\n oper... | python | edit | 1 | 0 | bsd-3-clause | 6749c5a4541836fcf25abbc571082b4c909b0bbb | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/app_manager/migrations/0019_exchangeapplication_required_privileges.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove opps package on opps-polls"
},
{
"role": "assistant",
"content": "# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages\ntry:\n __import__('pkg_resources').declare_namespace(__name__)\nexcept Impor... | python | new_file | 2 | 0 | mit | 77fc06c0ee8ca2c8669ca1cd7f45babb21d75ba5 | opps/opps-polls,opps/opps-polls | opps/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport shlex\nimport sys\n\nfrom canaryd_packages import six\n\nfrom canaryd.log import logger\n\n\nif os.name == 'posix' and sys.version_info[0] < 3:\n from canaryd_packages.subprocess32 import * # noqa\nelse:\n from subp... | python | edit | 1 | 4 | mit | 1918ed65e441057724b82a3cb710898f8742214b | Oxygem/canaryd,Oxygem/canaryd | canaryd/subprocess.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.