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": "Write python code for the following: Update ES server config to make use of environment variables"
},
{
"role": "assistant",
"content": "import os\nimport ast\n\n\n# A list of ES hosts\n# Uncomment the following for debugging\n# ES_HOSTS = ['https://c3d581bfab179c11... | python | new_file | 1 | 0 | mit | fdcdb5416bccf85a1745ccd07915e15629128ff9 | justinchuby/cmu-courseapi-flask | es_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom . import _dukpy\n\ntry:\n from collections.abc import Iterable\nexcept ImportError:\n from collections import Iterable\n\ntry: # pragma: no cover\n unicode\n string_types = (str, unicode)\nexcept NameError: #... | python | edit | 3 | 5 | mit | ccf285c30a0110f2ff59b91ec0166f9b5306239d | amol-/dukpy,amol-/dukpy,amol-/dukpy | dukpy/evaljs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport traceback\n\nfrom laboratory.observation import Observation, Test\nfrom laboratory import exceptions\n\n\nclass Experiment(object):\n\n def __init__(self, name='Experiment', raise_on_mismatch=False):\n self.name = name\n ... | python | edit | 1 | 4 | mit | ad60b0cd3326c0729237afbb094d22f4415fb422 | joealcorn/laboratory,shaunvxc/laboratory | laboratory/experiment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport socket\nimport time\nfrom unittest import TestCase\nfrom PluginManager import PluginManager\n\nclass TestPluginManager(TestCase):\n def test_stop(self):\n class Plugin:\n def __init__(self):\n sock... | python | edit | 1 | 1 | mit | 72dd10849190fb191fdab4962996ea537322e103 | ckaz18/honeypot,laurenmalone/honeypot,theplue/honeypot,ckaz18/honeypot,laurenmalone/honeypot,theplue/honeypot,coyle5280/honeypot,coyle5280/honeypot,ckaz18/honeypot,theplue/honeypot,theplue/honeypot,coyle5280/honeypot,ckaz18/honeypot,laurenmalone/honeypot,laurenmalone/honeypot,coyle5280/honeypot | tests/TestPluginManager.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport os\nimport subprocess\n\n\nclass cd:\n \"\"\"Context manager for changing the current working directory.\"\"\"\n def __init__(self, new_path):\n self.new_path = os.path.expanduser(new_path)\n\n def __enter__(self):\... | python | edit | 1 | 2 | mit | 294c251d83bec3738ce54a67d718c2ba959a7b4b | 0xfoo/punchcard | git.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom enum import Enum\nfrom collections import Counter\nfrom yargy.interpretation import InterpretationObject\n\n\nclass PersonObject(InterpretationObject):\n\n class Attributes(Enum):\n\n Firstname = 0 # владимир\n Middlen... | python | edit | 1 | 8 | mit | 08fe9e7beb4285feec9205012a62d464b3489bcf | natasha/natasha | natasha/grammars/person/interpretation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Menu(object):\n def __init__(self, dialog, items, title, caller = None):\n self.d = dialog\n self.caller = caller\n\n self.entries = []\n self.dispatch_table = {}\n tag = 1\n\n self.title =... | python | edit | 1 | 3 | mit | 2117778d777120293e506eca9743f97619b5ad5c | jakogut/KiWI | kiwi/interface.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom webapp_health_monitor import errors\n\n\nclass Verificator(object):\n verificator_name = None\n\n def __init__(self, **kwargs):\n pass\n\n def run(self):\n raise NotImplementedError()\n\n def __str__(self):\n ... | python | edit | 1 | 3 | mit | a347c699be3ce5659db4b76a26ce253a209e232e | pozytywnie/webapp-health-monitor,serathius/webapp-health-monitor | webapp_health_monitor/verificators/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n ${NAME}\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport logging\nimport zipfile\n\nlog = logging.getLogger(__name__)\n\nclass ResourceNotFound(KeyError):\n pass\n\nclass Res... | python | edit | 3 | 4 | bsd-3-clause | 03eb0081a4037e36775271fb2373277f8e89835b | vorburger/mcedit2,vorburger/mcedit2,Rubisk/mcedit2,Rubisk/mcedit2 | src/mcedit2/resourceloader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"OpenAPI core module\"\"\"\nfrom openapi_core.shortcuts import (\n create_spec, validate_parameters, validate_body, validate_data,\n)\n\n__author__ = 'Artur Maciąg'\n__email__ = '<EMAIL>'\n__version__ = '0.5... | python | edit | 1 | 0 | bsd-3-clause | 23af33b7ca48c59ff58638b733437d8f348b279b | p1c2u/openapi-core | openapi_core/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\"\"\"\nPublic endpoint to import API classes\n\nInstead of importing each module individually (eg.\n``from pysuru.apps import AppsAPI``), import from this module.\n\"\"\"\nfrom __future__ import absolute_imports\n\nfrom .a... | python | edit | 5 | 0 | mit | 5fdedac2eae25d88d2595f0fe79ca3a332f24dfe | rcmachado/pysuru | pysuru/api.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Synchronization core module for Storj GUI Client #\n\n\nclass StorjFileSynchronization():\n def start_sync_thread(self):\n return 1\n\n def reload_sync_configuration(self):\n return 1\n\n de... | python | edit | 3 | 2 | mit | 47672fe44673fe9cae54a736bdc9eb496494ab58 | lakewik/storj-gui-client | UI/utilities/synchronization_core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\nimport json\nregister = template.Library()\n\n\n@register.filter(name=\"format_meters\")\ndef meters_to_kms(value):\n try:\n return round(value / 1000)\n except:\n return \"NaN\"\n\n@register... | python | edit | 1 | 3 | apache-2.0 | f4c9482e41ec2ee6c894a413e8fcb0349a9edbd1 | campbellr/tapiriik,niosus/tapiriik,gavioto/tapiriik,cheatos101/tapiriik,cheatos101/tapiriik,brunoflores/tapiriik,abhijit86k/tapiriik,mjnbike/tapiriik,dlenski/tapiriik,abhijit86k/tapiriik,cpfair/tapiriik,marxin/tapiriik,abhijit86k/tapiriik,dlenski/tapiriik,cheatos101/tapiriik,abs0/tapiriik,niosus/tapiriik,dmschreiber/ta... | tapiriik/web/templatetags/displayutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom sentry.filters.web_crawlers import WebCrawlersFilter\nfrom sentry.testutils import TestCase\n\n\nclass WebCrawlersFilterTest(TestCase):\n filter_cls = WebCrawlersFilter\n\n def apply_filt... | python | edit | 1 | 1 | bsd-3-clause | 3d3a81efc36e39888929e62287b9d895922d8615 | ifduyue/sentry,mvaled/sentry,gencer/sentry,gencer/sentry,mvaled/sentry,JackDanger/sentry,beeftornado/sentry,mvaled/sentry,mvaled/sentry,jean/sentry,looker/sentry,looker/sentry,jean/sentry,looker/sentry,mvaled/sentry,looker/sentry,ifduyue/sentry,ifduyue/sentry,mvaled/sentry,JackDanger/sentry,gencer/sentry,gencer/sentry,... | tests/sentry/filters/test_web_crawlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom celery.task import task\nfrom .models import MailerMessage\n\n@task(name=\"tasks.send_mail\")\ndef send_mail(pk):\n message = MailerMessage.objects.get(pk=pk)\n message._send()\n\n@task()\ndef clear_sent_messages():\n from mai... | python | edit | 1 | 2 | mit | 985dd1ada1b2ad9ceaae111fa32b1d8e54b61786 | Goury/django-mail-queue,dstegelman/django-mail-queue,winfieldco/django-mail-queue,Goury/django-mail-queue,styrmis/django-mail-queue,dstegelman/django-mail-queue | mailqueue/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013 gocept gmbh & co. kg\n# See also LICENSE.txt\n\nimport grokcore.component as grok\nimport zeit.cms.browser.preview\nimport zeit.magazin.interfaces\n\n\n@grok.adapter(zeit.magazin.interfaces.IZMOContent, basestring)\n@gr... | python | edit | 2 | 1 | bsd-3-clause | 9ee0f3f7be90046f796f3395b2149288a2b52a26 | ZeitOnline/zeit.magazin | src/zeit/magazin/preview.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2007 Pompeu Fabra University (Computational Imaging Laboratory), Barcelona, Spain. Web: www.cilab.upf.edu.\n# This software is distributed WITHOUT ANY WARRANTY;\n# without even the implied warranty of MERCHANTABILITY or FITNESS ... | python | edit | 2 | 0 | bsd-3-clause | de4f43613b5f3a8b6f49ace6b8e9585a242d7cb2 | csnake-org/CSnake,csnake-org/CSnake,msteghofer/CSnake,msteghofer/CSnake,csnake-org/CSnake,msteghofer/CSnake | src/build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import (absolute_import, print_function, division)\nfrom itertools import repeat\nfrom mitmproxy.main import mitmdump\nimport os\n\nfrom . import (cli, proxyswitch, say)\n\ndef main():\n parser = cli.args()\n args, ext... | python | edit | 4 | 9 | mit | 8d8798554d996776eecc61b673adcbc2680f327a | ustwo/mastermind,ustwo/mastermind | mastermind/main.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n # # #### ##### # # ##### # # # #\n # # # # # ## ## # # # ## # #\n ### #### #### # # # # # # # # #####\n # # # # # ... | python | edit | 6 | 1 | bsd-2-clause | 4ef5d9ae7a571f97242cf2cc44e539d039486549 | glasnost/kremlin,glasnost/kremlin,glasnost/kremlin | runserver.py | rejected_lint | Too many lint violations: 6 | 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 Ethan Zimmerman\n# Copyright (c) 2014 Ethan Zimmerman\n#\n# License: MIT\n#\n\n\"\"\"This module exports the RamlCop plugin class.\"\... | python | edit | 1 | 0 | mit | 928cbc47cb7430d8a2fef924b61179cd30f5ca34 | thebinarypenguin/SublimeLinter-contrib-raml-cop | linter.py | rejected_duplicate | Near-duplicate of sample 3973 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views import debug\n\n\ndef _patch_django_debug_view():\n\n new_data = \"\"\"\n <h3 style=\"margin-bottom:10px;\">\n <a href=\"http://stackoverflow.com/search?q=[python] or [django]+{{ exception_value|force_... | python | edit | 1 | 1 | mit | 01dc78bc4cea6c11744879c0f2066ab627314625 | emre/django-stackoverflow-trace | django_stackoverflow_trace/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom .backends import detect_backend, UnknownIdException, \\\n UnknownBackendException\n\n__all__ = ('EmbedVideoField', 'E... | python | edit | 1 | 4 | mit | a1f5a392d5270dd6f80a40e45c5e25b6ae04b7c3 | yetty/django-embed-video,jazzband/django-embed-video,jazzband/django-embed-video,mpachas/django-embed-video,yetty/django-embed-video,mpachas/django-embed-video | embed_video/fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licens... | python | edit | 1 | 0 | apache-2.0 | 3bb0e65eac5c93fa6e331d22252fd7b17ecdf964 | francoisluus/tensorboard-supervise,qiuminxu/tensorboard,qiuminxu/tensorboard,tensorflow/tensorboard,shakedel/tensorboard,qiuminxu/tensorboard,ioeric/tensorboard,shakedel/tensorboard,qiuminxu/tensorboard,tensorflow/tensorboard,qiuminxu/tensorboard,francoisluus/tensorboard-supervise,agrubb/tensorboard,tensorflow/tensorbo... | __main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom indra.databases import context_client\n\ndef test_get_protein_expression():\n res = context_client.get_protein_expression('EGFR', 'BT20_BREAST')\n assert(res is not None)\n assert(res.get('EGFR') is not None)\n assert(res['... | python | edit | 1 | 1 | bsd-2-clause | ddc03637b19059f6fb06d72dc380afaf4fba57c2 | johnbachman/belpy,sorgerlab/indra,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/indra,jmuhlich/indra,jmuhlich/indra,johnbachman/belpy,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,jmuhlich/indra,bgyori/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/ind... | indra/tests/test_context.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Extensions of standard exceptions for PyWXSB events.\n\nYeah, I'd love this module to be named exceptions.py, but it can't\nbecause the standard library has one of those, and we need to\nreference it below.\n\"\"\"\n\nimport exception... | python | edit | 1 | 0 | apache-2.0 | 7f6167ef9f62b9b79e3c30b358c796caae69a2e6 | jonfoster/pyxb-upstream-mirror,jonfoster/pyxb-upstream-mirror,balanced/PyXB,jonfoster/pyxb2,pabigot/pyxb,CantemoInternal/pyxb,jonfoster/pyxb2,balanced/PyXB,CantemoInternal/pyxb,jonfoster/pyxb1,pabigot/pyxb,jonfoster/pyxb2,CantemoInternal/pyxb,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb1,balanced/PyXB | PyWXSB/exceptions_.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport itertools\nfrom functools import partial\nimport math\n\nfrom typing import Any, Callable, Iterable\n\nfrom rechunker.types import CopySpec, StagedCopySpec, Executor\n\n\nThunk = Callable[[], None]\n\n\nclass PythonExecutor(Executor[... | python | edit | 1 | 4 | mit | ee0f28abd70396bf1e094592028aa693e5d6fe6c | pangeo-data/rechunker | rechunker/executors/python.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport numpy\n\nfrom ...neural._classes.model import Model\n\n\n\ndef test_mismatched_shapes_raise_ShapeError():\n X = numpy.ones((3, 4))\n model = Model(10, 5)\n with pytest.raises(ValueError):\n y = model.be... | python | edit | 6 | 1 | mit | 602c01caa23df0c6dad5963412a340087012f692 | explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc | thinc/tests/integration/test_shape_check.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Use custom decorator to allow ratelimiting only on successful POST - prevents blocking form errors"
},
{
"role": "assistant",
"content": "from functools import wraps\n\nfrom ratelimit.exceptions import Ratelimited\nfrom ratelimit... | python | new_file | 1 | 6 | mit | 838012c457d6c963707bb16259cd72d28c231672 | haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcounter | cellcounter/accounts/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The testing directory contains a small set of imaging files to be used\nfor doctests only. More thorough tests and example data will be stored in\na nipy-data-suite to be created later and downloaded separately.\n\nExamples\n--------... | python | edit | 6 | 0 | bsd-3-clause | 6ec3b50a087e68373f71162b3dd2421ce7655e4f | alexis-roche/nipy,nipy/nipy-labs,bthirion/nipy,alexis-roche/niseg,arokem/nipy,alexis-roche/nipy,arokem/nipy,bthirion/nipy,nipy/nireg,nipy/nipy-labs,alexis-roche/niseg,nipy/nireg,alexis-roche/nipy,arokem/nipy,arokem/nipy,alexis-roche/register,alexis-roche/nireg,alexis-roche/register,bthirion/nipy,alexis-roche/register,a... | neuroimaging/testing/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom optparse import make_option\nfrom django.core.management.base import BaseCommand\nfrom zephyr.models import Realm, UserProfile\nimport simplejson\n\ndef dump():\n pointers = []\n for u in UserProfile.objects.select_related(\"user... | python | edit | 2 | 3 | apache-2.0 | bda420a0f9abd31b78decdc43359d0dcff36381f | KingxBanana/zulip,zachallaun/zulip,themass/zulip,avastu/zulip,bastianh/zulip,bitemyapp/zulip,EasonYi/zulip,lfranchi/zulip,levixie/zulip,pradiptad/zulip,adnanh/zulip,hengqujushi/zulip,vaidap/zulip,ashwinirudrappa/zulip,reyha/zulip,brainwane/zulip,arpitpanwar/zulip,reyha/zulip,grave-w-grave/zulip,KJin99/zulip,Gabriel0402... | zephyr/management/commands/dump_pointers.py | rejected_duplicate | Near-duplicate of sample 7362 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nimport pytest\n\nfrom ...symbols import POS, VERB, VerbForm_inf\nfrom ...tokens import Doc\nfrom ...vocab import Vocab\nfrom ...lemmatizer import Lemmatizer\n\n\n@pytest.fixture\ndef index():\n re... | python | edit | 1 | 1 | mit | 77cf2fb0f63a5520de3b8b3456ce4c9181b91d16 | oroszgy/spaCy.hu,honnibal/spaCy,banglakit/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,raphael0202/spaCy,recognai/spaCy,recognai/spaCy,explosion/spaCy,banglakit/spaCy,Gregory-Howard/spaCy,recognai/spaCy,Gregory-Howard/spaCy,raphael0202/spaCy,honnibal/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,s... | spacy/tests/regression/test_issue595.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.internet.endpoints import TCP4ServerEndpoint\nfrom twisted.internet import reactor\n\nimport editorFactory\n\nif __name__ == \"__main__\":\n server = editorFactory.EditorFactory()\n TCP4ServerEndpoint(reactor, 4567).liste... | python | edit | 1 | 0 | apache-2.0 | 36298a9f9a7a373a716e44cac6226a0ec8c8c40c | Floobits/floobits-emacs | __main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .ignitiondelayexp import ExperimentalIgnitionDelay\nfrom .compare_to_sim import CompareToSimulation\nfrom .volume_trace import VolumeTraceBuilder\nfrom .nonreactive import NonReactiveExperiments\n\n__all__ = [\n 'ExperimentalIgnitio... | python | edit | 1 | 0 | bsd-3-clause | 4742f587e3e66fd1916dcb7200517e2ac06ddcf4 | bryanwweber/UConnRCMPy | uconnrcmpy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom settings import DeploymentType\n\ndef default(request):\n context = {}\n context['DEPLOYMENT'] = settings.DEPLOYMENT\n context['current_site'] = S... | python | edit | 1 | 3 | mit | 3770095f087309efe901c2f22afd29ba6f3ddd18 | bueda/django-comrade | comrade/core/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport randspectra as rs\nimport sys\nimport os.path as path\n\nsnapnum=sys.argv[1]\nsim=sys.argv[2]\n#base=\"/n/hernquistfs1/mvogelsberger/projects/GFM/Production/Cosmo/Cosmo\"+str(sim)+\"_V6/L25n512/output/\"\n#sa... | python | edit | 1 | 0 | mit | bca3c8f7b2c12b86e0d200009d23201bdc05d716 | sbird/vw_spectra | make_spectra.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Project-wide test configuration, including fixutres that can be\nused by any module.\n\nExample test: ::\n\n def test_my_renderer(fakefile):\n assert my_renderer(fakefile) == '..expected result..'\n\n\"\"\"\nimport io\nimpor... | python | edit | 2 | 1 | apache-2.0 | bed7f5c80f6c5b5ce9b9a17aea5c9eadd047ee47 | felliott/modular-file-renderer,CenterForOpenScience/modular-file-renderer,mfraezz/modular-file-renderer,CenterForOpenScience/modular-file-renderer,Johnetordoff/modular-file-renderer,mfraezz/modular-file-renderer,icereval/modular-file-renderer,icereval/modular-file-renderer,AddisonSchiller/modular-file-renderer,chrisset... | mfr/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\nfrom django.views import generic\n\nfrom . import views\n\napp_name = 'main'\nurlpatterns = [\n url(r'^$', views.AboutView.as_view(), name='about'),\n url(r'^chas/$', views.AboutChasView.as_view(), na... | python | edit | 3 | 0 | mit | 6f29293e6f447dfd80d10c173b7c5a6cc13a4243 | evanepio/dotmanca,evanepio/dotmanca,evanepio/dotmanca | main/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test praw.util.cache.\"\"\"\n\nfrom .. import UnitTest\n\nfrom praw.util.cache import cachedproperty\n\n\nclass TestCachedProperty(UnitTest):\n class Klass:\n @cachedproperty\n def nine(self):\n \"\"\"Retur... | python | edit | 1 | 1 | bsd-2-clause | 921e315e61355d80caea673ce09f8944388d86e2 | praw-dev/praw,gschizas/praw,praw-dev/praw,gschizas/praw | tests/unit/util/test_cache.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom firmant.db.relations import schema\n\n\nclass TestSchemaLoad(unittest.TestCase):\n\n def testLoad(self):\n if schema('loader-works') != 'SCHEMA LOAD WORKING PROPERLY':\n self.fail()\n\nsuite = un... | python | edit | 1 | 1 | bsd-3-clause | 3de9cd44ef803b7c7f3e05e29ecaa30113caf1ba | rescrv/firmant | test/db/relations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cherrypy\nimport os\nimport raatest\n\nfrom conary import dbstore\nfrom conary.server import schema\n\nclass webPluginTest(raatest.webTest):\n def __init__(\n self, module = None, init = True, preInit = None, preConst = Non... | python | edit | 4 | 2 | apache-2.0 | 33550cab832da5b90cf2fb5af2f211840dfe2caa | sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint | test/mintraatests.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom lib.login import Login\n\n\ndef pychat():\n login = Login\n login()\n \n\nif __name__ == '__main__':\n pychat()\n\n```\n\nApply this change: Rework to have a... | python | edit | 3 | 2 | mit | 4744f3b3e5193ad66a4bba64d8a8d8c4e328fdcc | tijko/PyChat | pychat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.contrib import messages\n\n# Create your views here.\n\ndef test(request):\n messages.debug(request, 'This is a debug alert')\n messages.info(request, 'This is an info alert')\n mess... | python | edit | 1 | 1 | mit | 78f2ff20e86a7801c9b28cff17f3fe7db93c2788 | Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/fbxnano,Kromey/fbxnano | alerts/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nTurn a Python script into Intel HEX format to be concatenated at the\nend of the MicroPython firmware.hex. A simple header is added to the\nscript.\n'''\n\nimport sys\nimport struct\nimport binascii\n\n# read script body\nwith open(sy... | python | edit | 1 | 0 | mit | f49c132f0bc90daf98b89bcf7270a2d37cd411d2 | JoeGlancy/micropython,JoeGlancy/micropython,JoeGlancy/micropython | tools/hexlifyscript.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose.tools import *\nfrom webtest_plus import TestApp\n\nfrom tests.base import OsfTestCase\nfrom tests.factories import AuthUserFactory\nfrom website.app import init_app\nfrom website.addons.twofactor.tests import _valid_code\n\napp =... | python | edit | 9 | 1 | apache-2.0 | 850c5c6f133fdfd131605eb1bf1e971b33dd7416 | doublebits/osf.io,brianjgeiger/osf.io,billyhunt/osf.io,cwisecarver/osf.io,CenterForOpenScience/osf.io,barbour-em/osf.io,wearpants/osf.io,MerlinZhang/osf.io,alexschiller/osf.io,brandonPurvis/osf.io,haoyuchen1992/osf.io,SSJohns/osf.io,HalcyonChimera/osf.io,dplorimer/osf,amyshi188/osf.io,SSJohns/osf.io,chrisseto/osf.io,ti... | website/addons/twofactor/tests/test_views.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nGrid-building functions\n-----------------------\n\n:func:`pixels_to_radius` and :func:`pixels_to_phi` were renamed to\n:func:`radial_grid` and :func:`angle_grid` respectively. The name and order\nof their arguments was also changed: see th... | python | edit | null | null | bsd-3-clause | e1c970d76dbd0eb631e726e101b09c0f5e5599ec | licode/scikit-xray,Nikea/scikit-xray,hainm/scikit-xray,celiafish/scikit-xray,licode/scikit-beam,CJ-Wright/scikit-beam,CJ-Wright/scikit-beam,tacaswell/scikit-xray,giltis/scikit-xray,ericdill/scikit-xray,scikit-xray/scikit-xray,yugangzhang/scikit-beam,scikit-xray/scikit-xray,giltis/scikit-xray,danielballan/scikit-xray,ta... | doc/api_changes/2015-04-27-core.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: latin-1 -*-\n\n\"\"\"Unit tests.\"\"\"\n\nimport unittest\nfrom daily_parser import url_from_args\n\n\nclass TestDailyParser(unittest.TestCase):\n\n \"\"\"Testing methods from daily_parser.\"\"\"\n\n ... | python | edit | 2 | 1 | mit | e40ef4cbe59c5c3d064e60f02f60f19b0bb202a4 | Commonists/DonationsLogParser,Commonists/DonationsLogParser | test_daily_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport logging\n\n__version__ = VERSION = '0.0.1'\n__project__ = PROJECT = 'django-misc'\n\nlog = logging.getLogger( __name__ )\n\n\n\n\n```\n\nApply this change: Change version to 0.0.2 to update pypi repo"
},
... | python | edit | 1 | 0 | mit | 9c5349595dca8013f1353785bbd34fb3d7cd4a6a | ilblackdragon/django-misc | misc/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef transform_scalars(dataset):\n from tomviz import utils\n import numpy as np\n\n #----USER SPECIFIED VARIABLES-----#\n ###XRANGE###\n ###YRANGE###\n ###ZRANGE###\n #---------------------------------#\n\n data_bs =... | python | edit | 7 | 3 | bsd-3-clause | ad7e1149081461d2d34578e06cf5f470d2d20e71 | cjh1/tomviz,cryos/tomviz,cjh1/tomviz,mathturtle/tomviz,thewtex/tomviz,OpenChemistry/tomviz,cryos/tomviz,cryos/tomviz,OpenChemistry/tomviz,thewtex/tomviz,thewtex/tomviz,cjh1/tomviz,mathturtle/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,mathturtle/tomviz | tomviz/python/Subtract_TiltSer_Background.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Blueprint, render_template, url_for, redirect, flash\nfrom flask.ext.login import login_required, logout_user, current_user, login_user\nfrom .forms import LoginForm\nfrom school.config import FLASH_SUCCESS, FLASH_INFO, FL... | python | edit | 3 | 3 | mit | 2377f500d4667623da9a2921c62862b00d7f404c | leyyin/university-SE,leyyin/university-SE,leyyin/university-SE | school/frontend/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nMSG_INFO = 0x01\nMSG_WARNING = 0x02\nMSG_ERROR = 0x04\nMSG_VERBOSE = 0x08\nMSG_ALL = MSG_INFO | MSG_WARNING | MSG_ERROR | MSG_VERBOSE\n\ndef logi(msg):\n print(\"[INFO] \" + msg)\ndef logv(msg):\n print(\"[VERBOSE] \" + msg)\... | python | edit | 1 | 2 | mit | 7a7729e9af8e91411526525c19c5d434609e0f21 | PyOCL/oclGA,PyOCL/OpenCLGA,PyOCL/OpenCLGA,PyOCL/oclGA,PyOCL/oclGA,PyOCL/TSP,PyOCL/TSP,PyOCL/oclGA,PyOCL/OpenCLGA | logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport logging\n\ndef logger_setup(name):\n loglevel = ''\n try:\n if os.environ['PB_LOGLEVEL'] == 'DEBUG':\n loglevel = logging.DEBUG\n\n if os.environ['PB_LOGLEVEL'] == 'INFO':\n loglev... | python | edit | 1 | 5 | mit | fc50a002e967f8e3b7de205a866e010dda717962 | zeusdeux/zulip-pairing-bot | logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n@pytest.mark.xfail\ndef test_missing_file(audiomgr):\n sound = audiomgr.get_sound('/not/a/valid/file.ogg')\n assert sound is None\n\n```\n\nApply this change: tests: Update audio test to recognize missing sounds as Nu... | python | edit | 3 | 1 | bsd-3-clause | 7aedc2151035174632a7f3e55be7563f71e65117 | chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d | tests/audio/test_loading.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tempfile\nimport tee\n\nfrom process import Process\nfrom exit import err_exit\n\n\nclass SCP(object):\n \"\"\"Secure copy and FTP abstraction.\"\"\"\n\n def __init__(self, process=None):\n self.process = process or Proc... | python | edit | 3 | 4 | bsd-2-clause | e291ae29926a3cd05c9268c625e14d205638dfe8 | Jarn/jarn.mkrelease | jarn/mkrelease/scp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport floppyforms.__future__ as floppyforms\nfrom django.test import TestCase\n\nfrom django_backend.backend.base.forms import BaseBackendForm\n\nfrom .models import OneFieldModel\n\n\nclass OneFieldForm(BaseBackendForm):\n class Meta:\... | python | edit | 1 | 1 | bsd-3-clause | f113123a3f31e176ae7165f1ca11118dc00625a3 | team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend | tests/test_backend_forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom .views import FaqQuestionList, FaqCategoryDetail, FaqQuestionDetail\n\nurlpatterns = patterns('',\n url(r'^$', FaqQuestionList.as_view(), name='faqquestion_index'),\n url(r'^(?P<slug>[^... | python | edit | 1 | 0 | apache-2.0 | 4f71339cad35b2444ea295fd4b518e539f1088bb | edoburu/django-fluent-faq,edoburu/django-fluent-faq | fluent_faq/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom unittest import TestCase\nfrom chipy8 import Memory\n\n\nclass TestMemory(TestCase):\n def setUp(self):\n self.memory = Memory()\n\n def test_write(self):\n 'Write a byte to memory then read it.'\n ... | python | edit | 1 | 1 | bsd-3-clause | 6974cba56413527c8b7cef9e4b6ad6ca9fe5049e | gutomaia/chipy8 | tests/test_memory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\n\nfrom celery import task\nfrom celery.utils.log import get_task_logger\nlogger = get_task_logger(__name__)\n\nfrom django.db.models import Q\n\nfrom thing.models import APIKey, TaskState\n\n# ------------------------------... | python | edit | 1 | 3 | bsd-2-clause | 6b9ccae880e9582f38e2a8aa3c451bc6f6a88d37 | madcowfred/evething,madcowfred/evething,Gillingham/evething,Gillingham/evething,cmptrgeekken/evething,madcowfred/evething,Gillingham/evething,cmptrgeekken/evething,cmptrgeekken/evething,Gillingham/evething,madcowfred/evething,cmptrgeekken/evething,cmptrgeekken/evething | thing/tasks/tablecleaner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under an MIT open source license - see LICENSE\n\n\n'''\nTest functions for SCF\n'''\n\nfrom unittest import TestCase\n\nimport numpy as np\nimport numpy.testing as npt\n\nfrom ..statistics import SCF, SCF_Distance\nfrom ._testin... | python | edit | 1 | 1 | mit | 61fecbed71129228e7020a9e95dbcd2487bbdbb3 | e-koch/TurbuStat,Astroua/TurbuStat | turbustat/tests/test_scf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.template import Library\nfrom django_prices.templatetags import prices_i18n\n\nfrom .. import exchange_currency\n\nregister = Library()\n\n\n@register.simple_tag # noqa\ndef gross_in_currency(price, currency): # noqa\n conv... | python | edit | 1 | 1 | bsd-3-clause | 698677a623722b63ec4cceb7690b62fa7e4ede37 | mirumee/django-prices-openexchangerates,artursmet/django-prices-openexchangerates | django_prices_openexchangerates/templatetags/prices_multicurrency_i18n.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom pyhmsa.datafile import DataFile\nfrom pyhmsa.type.language import langstr\ndatafile = DataFile()\n\nauthor = langstr('Fyodor Dostoyevsky', {'ru': u'Фёдор Миха́йлович Достое́вский'})\ndatafile.header.author = au... | python | edit | 1 | 0 | mit | ff489b1541f896025a0c630be6abe2d23843ec36 | pyhmsa/pyhmsa | examples/05_alternative_language.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\"\"\"\nfrom django.contrib.auth.models import User... | python | edit | 1 | 1 | mit | 32a54ff0588930efc5e0ee3c61f2efbf57e450e0 | caffeinehit/django-inviter | inviter/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = '1.0.0'\n\ndef configure(**settings):\n from .settings import Settings\n for key, value in settings.items():\n Settings.setattr(key, value)\n\n```\n\nApply this change: Add relevant models to turbasen module"
},
{... | python | edit | 4 | 2 | mit | 6db2bb9b1634a7b37790207e5b8d420de643a9cb | Turbasen/turbasen.py | turbasen/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n## PyMoira client library\n##\n## This file contains the more abstract methods which allow user to work with\n## lists and list members.\n#\n\nimport protocol\nimport utils\nimport datetime\nfrom errors import *\n\nclass Filesys(object):... | python | edit | 4 | 1 | mit | 770fd77e0fc7a0700b81e4418e5f97bd88d842d0 | vasilvv/pymoira | pymoira/filesys.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf8\nfrom __future__ import unicode_literals\n\n\n# These exceptions are used to add NORM values based on a token's ORTH value.\n# Individual languages can also add their own exceptions and overwrite them -\n# for example, Britis... | python | edit | 1 | 0 | mit | 9d6c8eaa491d0988bf16633bbba9847350f57778 | aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,explosion/spaCy,aikramer2/spaCy,recognai/spaCy,honnibal/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/s... | spacy/lang/norm_exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make imports a little more intuitive."
},
{
"role": "assistant",
"content": "__title__ = 'pylsdj'\n__version__ = '1.1.0'\n__build__ = 0x010100\n__author__ = 'Alex Rasmussen'\n__license__ = 'MIT'\n__copyright__ = 'Copyright 2014 A... | python | new_file | 19 | 0 | mit | 56c4de583847be5fb16818dcd1ca855fc6007b50 | alexras/pylsdj,alexras/pylsdj | pylsdj/__init__.py | rejected_lint | Too many lint violations: 19 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.internet import protocol, reactor\n\nfactory = protocol.ServerFactory()\nfactory.protocol = protocol.Protocol\n\nreactor.listenTCP(8000, factory)\nreactor.run()\n\n```\n\nApply this change: Convert to endpoints API and use cust... | python | edit | 1 | 0 | mit | e8b1cee54f679cbd6a2d158b3c2789f3f6a3d9c0 | cataliniacob/ep2012-tutorial-twisted | uppercase.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom urllib.parse import parse_qs\nfrom channels import Group\nfrom channels.sessions import channel_session\n\n\n@channel_session\ndef ws_add(message):\n message.reply_channel.send({\"accept\": True})\n qs = parse_qs(message['query_s... | python | edit | 1 | 1 | mit | 378f3bf0bb2e05260b7cbeeb4a4637d7d3a7ca7c | xflows/clowdflows-backend,xflows/clowdflows-backend,xflows/clowdflows-backend,xflows/clowdflows-backend | workflows/consumers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 3 | 1 | apache-2.0 | 6b179dc4fb95f4db380b9156381b6210adeef2e5 | GoogleCloudPlatform/getting-started-python,GoogleCloudPlatform/getting-started-python,GoogleCloudPlatform/getting-started-python | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport distutils.sysconfig\nfrom glob import glob\nimport os\nfrom os.path import join as pjoin, basename\nfrom shutil import copy\nfrom sys import platform\n\ndef main():\n \"\"\"\n Copy HDF5 DLLs into installed h5py package\n \"\... | python | edit | 1 | 5 | bsd-3-clause | 7394ba6eba50282bd7252e504a80e5d595dd12bc | h5py/h5py,h5py/h5py,h5py/h5py | ci/fix_paths.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Information used for locating nipy test data.\n\nNipy uses a set of test data that is installed separately. The test\ndata should be located in the directory ``~/.nipy/tests/data``.\n\nInstall the data in your home directory from the... | python | edit | 1 | 0 | bsd-3-clause | 9a7c80744bc1e57fe0ec5fc7cf149dada2d05121 | alexis-roche/register,bthirion/nipy,bthirion/nipy,nipy/nipy-labs,alexis-roche/nipy,bthirion/nipy,alexis-roche/register,alexis-roche/nireg,bthirion/nipy,arokem/nipy,alexis-roche/register,alexis-roche/niseg,alexis-roche/nipy,arokem/nipy,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/nipy,alexis-roche/nireg,arokem/nipy,aro... | neuroimaging/utils/tests/data/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import path\nimport shutil\nimport tempfile\nfrom sh import hovercraft\nfrom django.shortcuts import get_object_or_404\nfrom django.http import HttpResponse\nfrom waliki.models import Page\n\n\ndef slides(request, slug):\n page =... | python | edit | 1 | 2 | bsd-3-clause | 1c7bbeabe1c1f3eea053c8fd8b6649ba388c1d2e | RobertoMaurizzi/waliki,aszepieniec/waliki,aszepieniec/waliki,OlegGirko/waliki,RobertoMaurizzi/waliki,rizotas/waliki,beres/waliki,beres/waliki,santiavenda2/waliki,mgaitan/waliki,fpytloun/waliki,OlegGirko/waliki,OlegGirko/waliki,santiavenda2/waliki,santiavenda2/waliki,beres/waliki,mgaitan/waliki,RobertoMaurizzi/waliki,as... | waliki/slides/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom buildtools.bt_logging import log\nfrom buildtools.os_utils import cmd, ENV\n\nclass CMake(object):\n def __init__(self):\n self.flags = {}\n self.generator = None\n \n def setFlag(self, key, val)... | python | edit | 3 | 5 | mit | ceac9c401f80a279e7291e7ba2a9e06757d4dd1d | N3X15/python-build-tools,N3X15/python-build-tools,N3X15/python-build-tools | buildtools/wrapper/cmake.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import celery, celery_socketio\nfrom .game_instance import GameInstance\nimport time\n\n@celery.task(time_limit=5, max_retries=3)\ndef play_game(game_id, player_names, scripts, player_ids, colors, namespace, room, wave=1):\n\n cle... | python | edit | 3 | 3 | mit | 24a90b0aa38a21c9b116d4b8b9c4878678fda9cc | SuddenDevs/SuddenDev,SuddenDevs/SuddenDev,SuddenDevs/SuddenDev,SuddenDevs/SuddenDev | suddendev/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom buffer.models.profile import PATHS, Profile\n\nclass Profiles(list):\n\n def __init__(self, api, *args, **kwargs):\n super(Profiles, self).__init__(*args, **kwargs)\n\n self.api = api\n\n def all(self):\n resp... | python | edit | 1 | 4 | mit | 446400fa4e40ca7e47e48dd00209d80858094552 | bufferapp/buffer-python,vtemian/buffpy | buffer/managers/profiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport urllib2\nimport ssl\n\n\ndef poll(sites, timeout):\n for site in sites:\n print 'polling ' + site\n\n try:\n response = urllib2.urlopen(site, timeout=timeout)\n response.r... | python | edit | 2 | 4 | mit | 1b0428aaf77f1c6eadfb6b20611a2e2e6f30fbce | koodilehto/website-poller,koodilehto/website-poller | poller.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport codecs\n\nfrom setuptools import setup, find_packages\nfrom setuptools.command.test import test as TestCommand\n\nimport dmp\n\nsetup(\n name='dmp',\n version=dmp.__version__,\n description='MuG DMP API',\n ur... | python | edit | 6 | 0 | apache-2.0 | 13f1f2643c6f00a3f890d735e1ae2c8ac757fe75 | Multiscale-Genomics/mg-dm-api,Multiscale-Genomics/mg-dm-api | setup.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport gevent\n\nfrom gevent.queue import Queue\n\nfrom changes.config import pubsub\n\n\nclass EventStream(object):\n def __init__(self, channels, pubsub=pubsub):\n self.pubsub = pubsub\n... | python | edit | 1 | 4 | apache-2.0 | f04c451de83b66b733dc28eb13bc16ade2675b3a | bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes | changes/api/stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom flask import request\nfrom flask_restplus import Resource\n\nfrom gameserver.game import Game\nfrom gameserver.models import Player\n\nfrom gameserver.api.restplus import api\nfrom gameserver.api.serializers import pl... | python | edit | 2 | 2 | apache-2.0 | 788229f43eab992d6f4d79681604336e4d721b0c | hammertoe/didactic-spork,hammertoe/didactic-spork,hammertoe/didactic-spork,hammertoe/didactic-spork | gameserver/api/endpoints/players.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport scipy.ndimage as ndim\nfrom skimage.filters import gaussian\n\n\ndef patch_up_roi(roi, sigma=0.5, truncate=2):\n \"\"\"\n After being non-linearly transformed, ROIs tend to have holes in them.\n We perform a couple of comput... | python | edit | 1 | 1 | bsd-2-clause | 4c5cf98be65ee2564062cce2a43b7833eef1a6c9 | yeatmanlab/pyAFQ,arokem/pyAFQ,arokem/pyAFQ,yeatmanlab/pyAFQ | AFQ/utils/volume.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n======\nrororo\n======\n\nCollection of utilities, helpers, and principles for building Python backend\napplications. Supports `aiohttp.web <http://aiohttp.readthedocs.org/>`_,\n`Flask <http://flask.pocoo.org/>`_, and your web-frame... | python | edit | 1 | 0 | bsd-3-clause | 1479e89d65c3d3c3b3ce3da9f81dae73e91b5ae3 | playpauseandstop/rororo,playpauseandstop/rororo | rororo/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport rdflib\n\nfrom humfrey.utils.namespaces import NS\nfrom humfrey.linkeddata.uri import doc_forwards\n\ndef formats(request, context):\n graph, subject, doc_uri = context['graph'], context['subject'], context['doc_uri']\n formats... | python | edit | 3 | 3 | bsd-3-clause | 9e110d998532600a351ae35f79b0f46bce576c9f | ox-it/humfrey,ox-it/humfrey,ox-it/humfrey | humfrey/desc/rdf_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file is meant to be run inside lldb as a command after\n# the attach_linux.dylib dll has already been loaded to settrace for all threads.\ndef __lldb_init_module(debugger, internal_dict):\n # Command Initialization code goes here\... | python | edit | 1 | 9 | apache-2.0 | 9967d14a10c0c53094b65e0946beb2d1c1200916 | fnouama/intellij-community,samthor/intellij-community,ftomassetti/intellij-community,idea4bsd/idea4bsd,dslomov/intellij-community,ThiagoGarciaAlves/intellij-community,izonder/intellij-community,fnouama/intellij-community,holmes/intellij-community,MER-GROUP/intellij-community,idea4bsd/idea4bsd,ivan-fedorov/intellij-comm... | python/helpers/pydev/pydevd_attach_to_process/linux/lldb_threads_settrace.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import resolve, reverse\nfrom django.test import TestCase\n\n\nclass URLsTestCase(TestCase):\n \"\"\"A TestCase with a check_url helper method for testing urls\"\"\"\n\n def check_url(self, view_class, ur... | python | edit | 1 | 1 | bsd-2-clause | 0dc84650b2929d31c054882ad67570fda6f1ffb9 | incuna/incuna-test-utils,incuna/incuna-test-utils | incuna_test_utils/testcases/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''Helper code for theanets unit tests.'''\n\nimport numpy as np\nimport skdata.mnist\n\n\nclass MNIST:\n NUM_DIGITS = 100\n DIGIT_SIZE = 784\n\n def setUp(self):\n np.random.seed(3)\n\n mnist = skdata.mnist.dataset.M... | python | edit | 1 | 1 | mit | 99e164e2e4cf732485e6692a67c732cb657a1c11 | devdoer/theanets,chrinide/theanets,lmjohns3/theanets | test/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, render_template, flash\r\nfrom flask_wtf import Form\r\nfrom flask_wtf.file import FileField\r\nfrom tools import s3_upload, store_locally\r\nimport json \r\n\r\napp = Flask(__name__)\r\napp.config.from_object('conf... | python | edit | 4 | 3 | mit | a7e64e1594ffc1dba32e55f99779c79d85fd05b9 | Mouleshwar/Flask-S3-Uploader,themouli/Flask-S3-Uploader,themouli/Flask-S3-Uploader,Mouleshwar/Flask-S3-Uploader | app.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\nfrom inspect import getcallargs\n\nfrom timer import Timer\n\n\ndef bench(f):\n \"\"\"Times a function given specific arguments.\"\"\"\n\n timer = Timer(tick_now=False)\n\n @wraps(f)\n def wrapped(*a... | python | edit | 1 | 2 | mit | 52c0b5d678e062384b6d4682b85b632bdc0ab093 | ktbs/ktbs-bench,ktbs/ktbs-bench | ktbs_bench/utils/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\n\ndef navigate_maze_struct(strategy, f='input/MAZE.txt'):\n rooms = json.load(open(f))\n\n for row in rooms:\n for room in row:\n room['visited'] = False\n\n queue = [(0, 0)]\n\n while queue:\n ... | python | edit | 1 | 20 | mit | a0348f21ce7abb577b93913c6f1c805cc6ccc75f | matslindh/codingchallenges,matslindh/codingchallenges | knowit2019/13.py | rejected_complexity | Cyclomatic complexity too high: 20 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\n__author__ = 'ray'\n__date__ = '4/4/15'\n\nfrom stonemason.mason import Portrayal\nfrom stonemason.mason.theme import Theme\n\n\ndef jsonify_portrayal(portrayal):\n assert isinstance(portrayal, Portrayal)\n ... | python | edit | 1 | 2 | mit | 6520fde5be81eb3d1a91662edeef8bd2a1f6389c | Kotaimen/stonemason,Kotaimen/stonemason | stonemason/service/tileserver/helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport threading\nimport time\nfrom observer.event_loop import PlanetStackObserver\nfrom observer.event_manager import EventListener\nfrom util.logger import Logger, logging\n\nlogger = Logger(level=logging.INFO)\n\nclass Backend:\n \n ... | python | edit | 3 | 1 | apache-2.0 | a6a95afca2964756a7777ea43839da1709187a27 | opencord/xos,opencord/xos,zdw/xos,open-cloud/xos,cboling/xos,zdw/xos,cboling/xos,opencord/xos,open-cloud/xos,zdw/xos,cboling/xos,cboling/xos,cboling/xos,open-cloud/xos,zdw/xos | planetstack/openstack_observer/backend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport settings\nimport os\n\nimport yoyo\nimport yoyo.connections\n\ndef path():\n return os.path.join(os.path.dirname(__file__), 'migrations')\n\nif __name__ == '__main__':\n conn, paramstyle = yoyo.connections.connect(settings.DATA... | python | edit | 1 | 2 | mit | 283ba7e4a08aeac07b030700b58e672f3f54ed12 | Storj/accounts | utils/migrate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport json\n\nfrom django.conf import settings\nimport hypernova\nfrom hypernova.plugins.dev_mode import DevModePlugin\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass HypernovaService():\n def load_or_empty(self, co... | python | edit | 3 | 2 | mit | 3785b2804c88215114e0bb21f1aab6dc0554b30c | Frojd/django-react-templatetags,Frojd/django-react-templatetags,Frojd/django-react-templatetags | django_react_templatetags/ssr/hypernova.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyglet\n\nfrom life import WIDTH, HEIGHT, CELL_SIZE, DISPLAY_FPS, FULLSCREEN\nfrom life.creator import Creator\nfrom life.view import Field\n\n\ncreator = Creator(width=WIDTH, height=HEIGHT)\n\nif FULLSCREEN:\n window = pyglet.win... | python | edit | 1 | 2 | bsd-2-clause | d0c775dd7f7964db608dd56d1899aa4e3697cd1e | lig/life | life/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 Hewlett-Packard Development Company, L.P.\n#\n# Author: Endre Karlson <<EMAIL>>\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... | python | edit | 1 | 1 | apache-2.0 | c22894e1ac7071e19515321df8eaa639045c9ae5 | ekarlso/dlux-horizon,ekarlso/dlux-horizon,ekarlso/dlux-horizon | dlux/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef test_web(app):\n client = app.test_client()\n response = client.post(\n '/user/sign-in?next=/',\n follow_redirects=True,\n data=dict(\n username='test@test.com',\n password='Password1'\n ... | python | edit | 1 | 1 | apache-2.0 | ba499556cf3a1f09c55ba2631c1dbb988e95fb82 | vinntreus/training_stats,vinntreus/training_stats | web/test/test_web.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A dashboard for the status of the top certificate authorities' OCSP responders.\"\"\"\n# metadata\n__version__ = '0.1.0-dev'\n\n__title__ = 'OCSPdash'\n# keep the __description__ synchronized with the package docstring\n__description_... | python | edit | 1 | 0 | mit | d8168185aa0153fac55e3c59761a5e561a5b0137 | scolby33/OCSPdash,scolby33/OCSPdash,scolby33/OCSPdash | src/ocspdash/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# Secret passphrase\n# FIXME: Temporarily SECRET must have the same value as SECRET_KEYS\n# due to the current spring boot implementation\nSECRET = '/etc/keyczar/keys'\n# Secret keyczar keys\nSECRET_KEYS = '/etc/keyczar/keys'\n# Fi... | python | edit | 1 | 0 | apache-2.0 | 9bc3c6ef95bd3b229b019dcd0d39aa9940528cf4 | bigdatacesga/paas-service,bigdatacesga/paas-service,bigdatacesga/paas-service | config/development.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport random\nimport pprint\n\nclass Noah(object):\n def __init__(self, dictionary_file):\n self.dictionary = json.load(dictionary_file)\n\n def list(self):\n return '\\n'.join([entry['word'] for entry in s... | python | edit | 4 | 2 | mit | 00d835c3b4512b407033af280600d9428a155b22 | maxdeviant/noah | noah/noah.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\n# Touhou Community Reliant Automatic Patcher\n# Scripts\n#\n# ----\n#\n\"\"\"Utility functions shared among all the scripts.\"\"\"\n\nfrom collections import OrderedDict\nimport json\nimport os\n\njson_load_params ... | python | edit | 1 | 3 | unlicense | 6f1dc606b4c4f2702e0a5b48338488ac2eec197c | VBChunguk/thcrap,thpatch/thcrap,thpatch/thcrap,thpatch/thcrap,VBChunguk/thcrap,VBChunguk/thcrap,thpatch/thcrap,thpatch/thcrap | scripts/utils.py | rejected_duplicate | Near-duplicate of sample 1356 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom future import standard_library\nstandard_library.install_aliases()\n\nimport numpy... | python | edit | 12 | 0 | mit | 4bcf7f83351bc64ed47c5531cb66ccb20f762dd0 | dwfmarchant/pyMKL | pyMKL/__init__.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport multiprocessing\nimport unicornhathd as unicornhat\nimport importlib\nimport sys\nimport os\n\nimport app.programs.hd\n\n\nclass State:\n ''' Handles the Unicorn HAT state'''\n\n def __init__(self):\n self._process = Non... | python | edit | 5 | 4 | mit | 89929acbb2ee3c5617758966d8916139726d7b74 | njbbaer/unicorn-remote,njbbaer/unicorn-remote,njbbaer/unicorn-remote | app/state.py | rejected_lint | Too many lint violations: 5 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.