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\nimport pytest\nimport mock\nimport synapseclient\nfrom genie import validate\ncenter = \"SAGE\"\nsyn = mock.create_autospec(synapseclient.Synapse)\n\n\n@pytest.fixture(params=[\n # tuple with (input, expectedOutput)\n ([\"data_CNA_SAG... | python | edit | 3 | 1 | mit | e4d5fa8c70dd283d4511f155da5be5835b1836f7 | thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie | tests/unit/test_validate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nimport shlex\nfrom traceback import format_exception\n\nfrom obj import Obj\n\nimport click\nfrom click.testing import CliRunner\n\nrunner = CliRunner()\n\n@click.group(name='')\n@click.argument('use... | python | edit | 3 | 2 | mit | 1d5175beedeed2a2ae335a41380280a2ed39901b | ilg/LambdaMLM | lambda/control/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 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 | 1 | 0 | apache-2.0 | 1f55fe2e67df7826c6f99ca2874a56ccbe2bfc02 | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nHook into the test runner\n\"\"\"\n\nimport subprocess\n\nfrom django.test.simple import DjangoTestSuiteRunner\nfrom django.utils import unittest\n\nfrom ixdjango.test_suite.utils import (CoreUtilsTests)\n\n\nclass TestRunner(Django... | python | edit | 3 | 1 | mit | f7fa8b72b8d8d1b7bfcd6c738520fc87cd20e320 | infoxchange/ixdjango | ixdjango/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\n\nclass TenantSyncRouter(object):\n \"\"\"\n A router to control which applications will be synced,\n depending if we are syncing the shared apps or the tenant apps.\n \"\"\"\n\n def allow_... | python | edit | 1 | 4 | mit | 6692476cc7523516275f4512c32b0378574210bf | sigma-geosistemas/django-tenants,tomturner/django-tenants,tomturner/django-tenants,tomturner/django-tenants,sigma-geosistemas/django-tenants | django_tenants/routers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom opps.core.admin.channel import *\nfrom opps.core.admin.profile import *\nfrom opps.core.admin.source import *\n\n```\n\nApply this change: Add article on core admin"
},
{
"role": "assistant",
"conte... | python | edit | 5 | 0 | mit | 24b8e2f7440926d6d1c384a7289dfb5d1124e82f | YACOWS/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps | opps/core/admin/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis is a setup.py script generated by py2applet\n\nUsage:\n python setup.py py2app\n\"\"\"\n\nfrom setuptools import setup\nfrom glob import glob\nimport syncplay\n\nAPP = ['syncplayClient.py']\nDATA_FILES = [\n ('resources',... | python | edit | 1 | 0 | apache-2.0 | 0e60863d43a5b230839191743f72818763eeee71 | Syncplay/syncplay,NeverDecaf/syncplay,NeverDecaf/syncplay,alby128/syncplay,Syncplay/syncplay,alby128/syncplay | buildPy2app.py | rejected_duplicate | Near-duplicate of sample 972 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom importlib import import_module\n\nfrom .testdriver import TestDriver\n\n\nclass Driver(TestDriver):\n drivers = {}\n\n def __new__(cls, type, *args, **kwargs):\n if type not in cls.drivers:\n try:\n ... | python | edit | 1 | 5 | mit | 2a32fc912a5839f627a216918e4671e6547ee53b | onitu/onitu,onitu/onitu,onitu/onitu | tests/utils/driver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport os\nimport signal\nimport subprocess\nimport time\n\nimport pytest\n\n\nlog = logging.getLogger(\"test\")\n\nlogging.basicConfig(\n level=logging.DEBUG,\n format='%(asctime)s %(levelname)s [%(name)s] %(message)s... | python | edit | 1 | 5 | bsd-2-clause | 5f62f830d184c0f99b384f0653231dab52fbad50 | nirs/slowfs | conftest.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 2013 Hewlett-Packard Development Company, L.P.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in... | python | edit | 1 | 1 | apache-2.0 | 5a7f88a7d033a8005d09792d62827689d6d5230d | openstack/mox3 | mox3/fixture.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport httplib\nimport urllib\nimport json\n\n\nclass Slack:\n def __init__(self, webhook_path, url='hooks.slack.com', channel='#sigbridge', \n username=\"sb-bot\", icon=\":satellite:\"):\n self.web_hook_url = u... | python | edit | 1 | 2 | mit | a15ace7fdabbfd9943fe388e4177627f09894f4b | nafooesi/sigbridge | slack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2016,2019 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Configure pytest for metpy.\"\"\"\n\nimport os\n\nimport matplotlib\nimport matplotlib.p... | python | edit | 1 | 1 | bsd-3-clause | 8154b206160cde249c474f5905a60b9a8086c910 | Unidata/MetPy,dopplershift/MetPy,Unidata/MetPy,dopplershift/MetPy | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import qt_api\n\nif qt_api == 'pyside':\n from PySide.QtCore import *\nelif qt_api == 'pyqt':\n from PyQt4.QtCore import *\nelse:\n # Mock objects\n Qt = None\n def pyqtSignal(*args, **kwargs):\n pass\n\n```\n\n... | python | edit | 3 | 1 | bsd-3-clause | 484e5693b2f3e0bc8c238cd64afeaad17bfa6673 | ajaybhat/scikit-image,chintak/scikit-image,warmspringwinds/scikit-image,vighneshbirodkar/scikit-image,SamHames/scikit-image,SamHames/scikit-image,SamHames/scikit-image,michaelpacer/scikit-image,jwiggins/scikit-image,rjeli/scikit-image,blink1073/scikit-image,almarklein/scikit-image,bsipocz/scikit-image,almarklein/scikit... | skimage/viewer/qt/QtCore.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nMathematical tools for dit.\n\"\"\"\n\nfrom __future__ import absolute_import\n\n# Global random number generator\nimport numpy as np\nprng = np.random.RandomState()\n# Set the error... | python | edit | 17 | 0 | bsd-3-clause | 05db0c3dc6affdc3938d45195fb807be78ae5ff1 | Autoplectic/dit,chebee7i/dit,chebee7i/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,dit/dit,dit/dit,chebee7i/dit,dit/dit,dit/dit,chebee7i/dit,dit/dit | dit/math/__init__.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, unicode_literals\n\nimport argparse\nimport unittest\n\nfrom streamparse.cli import sparse\n\nfrom nose.tools import ok_\n\n\nclass SparseTestCase(unittest.TestCase):\n\n def test_load_subparsers(s... | python | edit | 1 | 1 | apache-2.0 | 94a91f128b046a818acb873579c8aadd41aa5c3a | msmakhlouf/streamparse,codywilbourn/streamparse,petchat/streamparse,petchat/streamparse,Parsely/streamparse,msmakhlouf/streamparse,petchat/streamparse,petchat/streamparse,msmakhlouf/streamparse,msmakhlouf/streamparse,codywilbourn/streamparse,eric7j/streamparse,petchat/streamparse,crohling/streamparse,hodgesds/streampar... | test/streamparse/cli/test_sparse.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nwith open('README.rst') as f:\n long_description = f.read()\n\nsetup(\n name='jiradoc',\n version='0.1',\n description='A small Python module to parse JIRAdoc markup files and inser... | python | edit | 1 | 0 | mit | 25df3a8b74e9e7f03d6239fcb5f2afaa38d4b4ee | lucianovdveekens/jiradoc | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom webassets.filter import Filter\n\n\n__all__ = ('CleverCSS',)\n\n\nclass CleverCSS(Filter):\n \"\"\"Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup\n to real CSS.\n\n ... | python | edit | 1 | 1 | bsd-2-clause | 15240d40ad027dd9fa058d07b289f681e7d3e487 | 0x1997/webassets,john2x/webassets,wijerasa/webassets,0x1997/webassets,aconrad/webassets,heynemann/webassets,florianjacob/webassets,florianjacob/webassets,heynemann/webassets,JDeuce/webassets,aconrad/webassets,glorpen/webassets,JDeuce/webassets,glorpen/webassets,john2x/webassets,aconrad/webassets,scorphus/webassets,wije... | src/webassets/filter/clevercss.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Support for python 2 and 3"
},
{
"role": "assistant",
"content": "import sys\n\nif sys.version_info > (3, 0): # Python 3 and above\n from delayed_assert.delayed_assert import expect, assert_expectations\nelse: # for Python 2... | python | new_file | 4 | 0 | unlicense | 45c7e910f13a43427359801782eef7ce537d6f5f | pr4bh4sh/python-delayed-assert | delayed_assert/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, logging\nfrom flask import Flask\nfrom flask.ext.basicauth import BasicAuth\nfrom raven.contrib.flask import Sentry\nfrom lrutils import dateformat\n\napp = Flask(__name__)\n\napp.config.from_object(os.environ.get('SETTINGS'))\n\... | python | edit | 1 | 1 | mit | dc377e246e65db8257298eb604c032313d8a113e | LandRegistry/property-frontend-alpha,LandRegistry/property-frontend-alpha,LandRegistry/property-frontend-alpha,LandRegistry/property-frontend-alpha | propertyfrontend/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom contextlib import contextmanager\nfrom os import path\nfrom unittest import TestCase\n\nfrom canaryd_packages import six\nfrom dictdiffer import diff\nfrom jsontest import JsonTest\nfrom mock import patch\n\nfrom canaryd.plugin import ... | python | edit | 1 | 2 | mit | ab4ae040895c50da6cb0827f6461d1733c7fe30a | Oxygem/canaryd,Oxygem/canaryd | tests/test_plugin_states.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name='stix2-matcher',\n version=\"0.1.0\",\n packages=find_packages(),\n description='Match STIX content against STIX patterns',\n install_requires=[\n \"antlr4-p... | python | edit | 1 | 0 | bsd-3-clause | 8b4d4ace387d2d366ae03ef14883942908167ad4 | chisholm/cti-pattern-matcher,oasis-open/cti-pattern-matcher | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport dukpy\n\n\nclass TestReactJS(object):\n def test_hello_world(self):\n jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')\n jsi = dukpy.JSInterpreter()\n result = jsi.... | python | edit | 2 | 1 | mit | ebf52caf6ee09ef1f15cb88815a1fb8008899c79 | amol-/dukpy,amol-/dukpy,amol-/dukpy | tests/test_reactjs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\ndef readObj(filename):\n vert = []\n face = []\n\n with open(filename, 'r') as file:\n for line in file:\n l = line.split()\n if len(l) > 0:\n if l[0] == 'v':\n vert.append(l[1:])\n ... | python | edit | 1 | 5 | bsd-2-clause | 6beefdaf46e3febbb106bd72da58ed62fc1349f0 | gergondet/RBDyn,gergondet/RBDyn,gergondet/RBDyn,gergondet/RBDyn,jrl-umi3218/RBDyn,jrl-umi3218/RBDyn,jrl-umi3218/RBDyn,gergondet/RBDyn,jrl-umi3218/RBDyn | scripts/graph/wavefront_obj.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom aiohttp import BasicAuth\nfrom plumeria import config\nfrom plumeria.command import commands, CommandError\nfrom plumeria.message import Response\nfrom plumeria.util import http\nfrom plumeria.util.ratelimit import rate_limit\n\nSEARCH... | python | edit | 1 | 3 | mit | c827afe434d1d106ad7747e0c094188b8d5cc9a9 | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | plumeria/plugins/bing_images.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 Dave Kludt\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.o... | python | edit | 1 | 0 | apache-2.0 | 7e8623f750abb9d5d46be25ca184ab0036e7a572 | oldarmyc/anchor,oldarmyc/anchor,oldarmyc/anchor | runapp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import openmath as om\n\nopenmath_ns = \"http://www.openmath.org/OpenMath\"\n\nomtags = {\n \"OMOBJ\": om.OMObject,\n \"OMR\": om.OMReference,\n \"OMI\": om.OMInteger,\n \"OMF\": om.OMFloat,\n \"OMSTR\": om.OMString,\n... | python | edit | 1 | 3 | mit | 8de8da05bb9461aaa48d3058f5b1e2caab6191f1 | OpenMath/py-openmath | openmath/xml.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Unit tests for cat2cohort.\"\"\"\n\nimport unittest\nfrom mw_util import str2cat\n\n\nclass TestMWutil(unittest.TestCase):\n\n \"\"\"Test methods from mw_util.\"\"\"\n\n pass\n\n```\n\nApply this change: Add unit test for str2ca... | python | edit | 1 | 2 | mit | 362c8dacda35bac24aa83e4fcaa2f6bac37150fd | Commonists/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics,Commonists/wm_metrics,danmichaelo/wm_metrics,danmichaelo/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics | tests/test_mw_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name='django-facebook',\n version='0.1',\n description='Replace Django Authentication with Facebook',\n long_description=open('README.md').read(),\n author='Aidan Lister... | python | edit | 1 | 0 | mit | 7fe0a7d03a13834f390180907265b8f83a978385 | tino/django-facebook2,tino/django-facebook2 | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nif True:\n if True:\n if True:\n self.__heap.sort(\n ) # pylint: builtin sort probably faster than O(n)-time heapify\n\n if True:\n foo = '( ... | python | edit | 3 | 0 | mit | 8d02d9cf5e07951a80bf424334ba59af92cfd6cc | vauxoo-dev/autopep8,SG345/autopep8,MeteorAdminz/autopep8,Vauxoo/autopep8,SG345/autopep8,hhatto/autopep8,Vauxoo/autopep8,MeteorAdminz/autopep8,hhatto/autopep8,vauxoo-dev/autopep8 | test/suite/out/long_lines.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\nfrom .utils import absolute_reverse\n\n@api_view(('GET',))\ndef root(request, format=None):\n\n if request.user and not request.user.is_anony... | python | edit | 1 | 3 | apache-2.0 | 87778eec6425c9bc8ae80f6ad8a0264986d1e7c1 | HarryRybacki/osf.io,cosenal/osf.io,jeffreyliu3230/osf.io,leb2dg/osf.io,erinspace/osf.io,aaxelb/osf.io,Ghalko/osf.io,chennan47/osf.io,abought/osf.io,saradbowman/osf.io,barbour-em/osf.io,TomHeatwole/osf.io,ZobairAlijan/osf.io,dplorimer/osf,DanielSBrown/osf.io,alexschiller/osf.io,samanehsan/osf.io,reinaH/osf.io,RomanZWang... | api/base/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDefaults for all settings used by AnchorHub\n\"\"\"\n\nWRAPPER = '{ }'\n\nINPUT = '.'\nOUTPUT = 'out-anchorhub'\n\nARGPARSER = {\n 'description': \"anchorhub parses through Markdown files and precompiles \"\n \"... | python | edit | 1 | 0 | apache-2.0 | 4ee182b5561fcd333b7368471038e2692c8e2661 | samjabrahams/anchorhub | anchorhub/settings/default_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/python\n\n# See README.txt for information and build instructions.\n\nimport addressbook_pb2\nimport sys\n\n# Iterates though all people in the AddressBook and prints info about them.\ndef ListPeople(address_book):\n for person... | python | edit | 9 | 7 | bsd-3-clause | b5653ac28ac8358127943bd1f40c22dfd8a274f3 | malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf | examples/list_people.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n\ntry:\n # Django >= 1.4.5\n from django.utils.encoding import force_bytes, force_text, smart_text # NOQA\n from django.utils.six import string_types, text_type, ... | python | edit | 3 | 0 | bsd-2-clause | 05c38777cb4a65199a605fbe75278a2170f84256 | lpomfrey/django-debreach,lpomfrey/django-debreach | debreach/compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nVERSION = '0.2.8'\n\n\nsetup(\n name='jinja2_standalone_compiler',\n packages=['jinja2_standalone_compiler', ],\n version=VERSION,\n author='Filipe Waitman',\n author_email='<EMAIL>',\n inst... | python | edit | 1 | 0 | mit | fddc1198d54a8a868bd8b97ed7318feeb00f6725 | filwaitman/jinja2-standalone-compiler | setup.py | rejected_duplicate | Near-duplicate of sample 594 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Eval metrics and related\n\nHacked together by / Copyright 2020 Ross Wightman\n\"\"\"\n\n\nclass AverageMeter:\n \"\"\"Computes and stores the average and current value\"\"\"\n def __init__(self):\n self.reset()\n\n d... | python | edit | 1 | 2 | apache-2.0 | 4a3df7842ab8f305ece134aa223801007d55c4f9 | rwightman/pytorch-image-models,rwightman/pytorch-image-models | timm/utils/metrics.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2.3\n\n\"\"\"\nRead a maf file from stdin and write out a new maf with only blocks having all\nof the required in species, after dropping any other species and removing\ncolumns containing only gaps.\n\nusage: %prog spe... | python | edit | 5 | 5 | mit | bd89dc8f6812ff824417875c9375499f331bf5e4 | uhjish/bx-python,uhjish/bx-python,uhjish/bx-python | scripts/maf_limit_to_species.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\npytest_plugins = [\n 'sentry.utils.pytest'\n]\n\n\ndef pytest_configure(config):\n from django.conf import settings\n settings.INSTALLED_APPS += ('sentry_jira',)\n\n```\n\nApply this change... | python | edit | 1 | 1 | bsd-3-clause | c5bfe6f408163267a16b8137e5871943657fb211 | getsentry/sentry-jira,thurloat/sentry-jira,thurloat/sentry-jira,getsentry/sentry-jira | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"back2back.settings\")\n\nfrom django.core.wsgi import get_wsgi_application\nfrom dj_static import Cling, MediaCling\n\napplication = Cling(MediaCling(get_wsgi_application()))\n\... | python | edit | 1 | 0 | bsd-2-clause | f996755665c9e55af5139a473b859aa0eb507515 | mjtamlyn/back2back,mjtamlyn/back2back,mjtamlyn/back2back,mjtamlyn/back2back | back2back/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.blueprints.api.decorators\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nfrom functools import wraps\nfrom typing import Opti... | python | edit | 1 | 3 | bsd-3-clause | d9a6071674857ceae566d29c7c77a31a5ed5214d | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/blueprints/api/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='django-bitfield',\n version='1.9.0',\n author='DISQUS',\n author_email='<EMAIL>',\n url='https://github.com/disqus/django-bitfield',\n ... | python | edit | 1 | 0 | apache-2.0 | 34eadaca8901706fd51dc12df5c63cf4c966249e | disqus/django-bitfield,Elec/django-bitfield,joshowen/django-bitfield | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport rml.machines\n\n\ndef test_machine_load_elements():\n lattice = rml.machines.get_elements(machine='SRI21', elemType='BPM')\n assert len(lattice) == 173\n for element in lattice.get_elements():\n assert element.get_pv_... | python | edit | 1 | 2 | apache-2.0 | 9d041287e5e0d1950d5dcda23f6f68522d287282 | willrogers/pml,willrogers/pml,razvanvasile/RML | tests/test_machine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport sys\n\nimport pytest\n\n\nclass ExpectedException(Exception):\n pass\n\n\nclass ExpectedMessage(Exception):\n pass\n\n\n@pytest.hookimpl(hookwrapper=True)\ndef pytest_runtest_call(item):\n outcome = ... | python | edit | 1 | 13 | mit | d90dadca57437def08416638267f2b2db2e7fe3f | Authentise/pytest-raises,Authentise/pytest-raises | pytest_raises/pytest_raises.py | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.\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 Licen... | python | edit | 1 | 0 | apache-2.0 | b16c49cfd6a0ee659e4493ef959e0483e93d350a | openstack/python-openstacksdk,stackforge/python-openstacksdk,redhat-openstack/os-client-config,dtroyer/python-openstacksdk,openstack/os-client-config,dtroyer/python-openstacksdk,switch-ch/os-client-config,stackforge/python-openstacksdk,dtroyer/os-client-config,openstack/python-openstacksdk | os_client_config/defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport datetime\nimport subprocess as spr\nimport time\n\n\ndef main():\n start = datetime.datetime.now()\n spr.call(['notify-send', 'Started new pomodoro'])\n time.sleep(30 * 60)\n... | python | edit | 1 | 2 | bsd-2-clause | 1a98b29293ccfab6534a48402414e89726d8e5bb | familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG | Python/pomodoro.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\n\next_files = [\"pyreBloom/bloom.c\"]\n\nkwargs = {}\n\ntry:\n from Cython.Distutils import build_ext\n from Cython.Distutils import Extension\n print \"Building from Cython\"\n ext_files.append... | python | edit | 3 | 0 | mit | c470da4fcf5bec84c255aa4514f6fd764781eb1a | seomoz/pyreBloom,seomoz/pyreBloom,seomoz/pyreBloom | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom locust import HttpLocust, TaskSet, task\n\n\nclass UserBehavior(TaskSet):\n tasks = []\n\n def on_start(self):\n pass\n\n @task\n def index(self):\n self.client.get(\"/\")\n\n @task\n def move_map(self):... | python | edit | 7 | 1 | mit | 8a6144fc3918856cb2259f65f9ee5cc9cfaf1fdc | recombinators/snapsat,recombinators/snapsat,recombinators/snapsat | locustfile.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom flask import render_template, jsonify, request\nfrom app import app\nimport pymysql as mdb\n\ncon = mdb.connect('localhost', \"root\", \"ozfgefgvrwix\", 'test1') \n\n@app.route('/')\n@app.route('/index')\ndef index():\n w... | python | edit | 5 | 2 | mit | 9db490d5d175f108231cc87afd87a593359837e8 | jbwhit/hammer-pricer,jbwhit/hammer-pricer | app/views.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import request, render_template\n\nfrom ca import app, db\nfrom ca.forms import RequestForm\nfrom ca.models import Request\n\n\n@app.route('/', methods=['GET'])\ndef index():\n return render_template('index.html')\n\n\n@app.ro... | python | edit | 1 | 2 | mit | 06542afc4becb4cf3cf96dd15ab240ab4353bf2b | freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net | ca/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\nfrom utils import *\n\n\n@all_files_in_dir('wavedrom_0')\ndef test_wavedrom_0(datafiles):\n with datafiles.as_cwd():\n subprocess.check_call(['python3', 'wavedrom-test.py'])\n\n\n@all_files_in_dir('wavedrom_1')\... | python | edit | 6 | 1 | apache-2.0 | 3b41e2166adde50f36f8f7ea389c80b76b83acaf | nosnhojn/svunit-code,svunit/svunit,nosnhojn/svunit-code,svunit/svunit,svunit/svunit,nosnhojn/svunit-code | test/test_wavedrom.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 F5 Networks Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apa... | python | edit | 1 | 2 | apache-2.0 | 6b7e32c98fa8a11dcd7bbbadaa2a057e4ff0ce90 | F5Networks/f5-openstack-test,pjbreaux/f5-openstack-test | f5_os_test/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom model_utils.models import TimeStampedModel\nfrom ordered_model.models import OrderedModel\n\n\nclass SponsorLevel(OrderedModel):\n name = models.... | python | edit | 1 | 1 | mit | 3cccb20cb9de803867084cab47f43401bf044e63 | patrick91/pycon,patrick91/pycon | backend/sponsors/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\nimport py2pack\n\nwith open('README') as f:\n README = f.read()\n\nsetup(\n name = py2pack.__name__,\n version = py2pack.__version__,\n license = \"GPLv2\",\n description = py2pack.__doc__,\n... | python | edit | 1 | 0 | apache-2.0 | 0574705dcbc473805aee35b482a41bdef060b0c9 | saschpe/py2pack,toabctl/py2pack | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = \"Richard Lindsley\"\n\nimport sys\n\nimport sip\nsip.setapi('QDate', 2)\nsip.setapi('QDateTime', 2)\nsip.setapi('QString', 2)\nsip.setapi('QTextStream', 2)\nsip.setapi('QTime', 2)\nsip.setapi('QUrl', 2)\nsip.setapi('QVariant',... | python | edit | 5 | 1 | mit | 1c1f2cab677ead5f3cf3aa59c5094a741378e5bc | richli/dame | dame/dame.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom mica.stats import update_acq_stats\nupdate_acq_stats.main()\n\nimport os\ntable_file = mica.stats.acq_stats.table_file\nfile_stat = os.stat(table... | python | edit | 1 | 0 | bsd-3-clause | 49e95022577eb40bcf9e1d1c9f95be7269fd0e3b | sot/mica,sot/mica | scripts/update_acq_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask import render_template, url_for\n\nimport parse_data\n\napp = Flask(__name__)\n\n\n@app.route(\"/dashboard\")\ndef dashboard():\n data = parse_data.load_and_format_data()\n\n title = 'Grand Bargain ... | python | edit | 3 | 1 | mit | 78a03f0b0cbc948a6c9fb215e9051d099c528a82 | devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring | src/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\n\nfrom graphql.type.definition import GraphQLObjectType\nfrom marshmallow import Schema, SchemaOpts\n\n\nclass ObjectTypeOpts(SchemaOpts):\n def __init__(self, meta, **kwargs):\n SchemaOpts.__i... | python | edit | 1 | 2 | mit | 52a07b32eb499d74b1770a42ac0851be71da8288 | polygraph-python/polygraph | polygraph/types/object_type.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_replay\n-----------\n\"\"\"\n\nimport pytest\n\nfrom cookiecutter import replay, main, exceptions\n\n\ndef test_get_replay_file_name():\n \"\"\"Make sure that replay.get_file_name generates a valid... | python | edit | 1 | 1 | bsd-3-clause | cb08d25f49b8b4c5177c8afdd9a69330992ee854 | christabor/cookiecutter,luzfcb/cookiecutter,hackebrot/cookiecutter,cguardia/cookiecutter,pjbull/cookiecutter,dajose/cookiecutter,michaeljoseph/cookiecutter,moi65/cookiecutter,terryjbates/cookiecutter,takeflight/cookiecutter,terryjbates/cookiecutter,luzfcb/cookiecutter,agconti/cookiecutter,cguardia/cookiecutter,christab... | tests/replay/test_replay.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWSGI config for core project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/\n\"\"\"\n\nimpor... | python | edit | 1 | 0 | mit | bb04512cdf264a3ef87f3d0093db9fe10723a668 | n2o/guhema,n2o/guhema | core/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThe API for s3s3.\n\"\"\"\nimport tempfile\n\nfrom boto.s3.connection import S3Connection\n\n\ndef create_connection(connection_args):\n connection_args = connection_args.copy()\n connection_args.pop('bucket_name')\n return... | python | edit | 1 | 4 | mit | e77042c914b9725da0fef7e56ede12635c1a876b | lsst-sqre/s3s3,lsst-sqre/s3-glacier | s3s3/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport urlparse\n\nimport requests\nfrom celery.utils.log import get_task_logger\n\nfrom api.base import settings\n\nlogger = get_task_logger(__name__)\n\ndef get_varnish_servers():\n # TODO: this should get the varnish servers from HAP... | python | edit | 1 | 4 | apache-2.0 | 74d402684d4c949bfc69b9fa5e34f5f560339da7 | doublebits/osf.io,aaxelb/osf.io,aaxelb/osf.io,Nesiehr/osf.io,wearpants/osf.io,aaxelb/osf.io,doublebits/osf.io,samchrisinger/osf.io,zamattiac/osf.io,asanfilippo7/osf.io,HalcyonChimera/osf.io,rdhyee/osf.io,abought/osf.io,cwisecarver/osf.io,RomanZWang/osf.io,chrisseto/osf.io,emetsger/osf.io,brianjgeiger/osf.io,laurenrever... | api/caching/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect\n\nclass FacebookProfileModel(models.Model):\n '''\n Abstract class to add to your profile model.\n \n NOTE... | python | edit | 1 | 1 | bsd-3-clause | efa36e1013e44fa75f6a77a74bd8bf21f3120976 | fivejjs/Django-facebook,troygrosfield/Django-facebook,danosaure/Django-facebook,rafaelgontijo/Django-facebook-fork,abendleiter/Django-facebook,pjdelport/Django-facebook,fivejjs/Django-facebook,abendleiter/Django-facebook,abendleiter/Django-facebook,andriisoldatenko/Django-facebook,ganescoo/Django-facebook,VishvajitP/Dj... | django_facebook/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import render_template, current_app, flash, redirect, url_for\nfrom . import main\nfrom forms import ContactForm\nfrom ..email import send_email\n\n@main.route('/')\ndef index():\n return render_template('index.html')\n\n@main... | python | edit | 1 | 2 | mit | 9a121f309ded039f770339d51b43d0933a98d982 | jordandietch/workforsushi,jordandietch/workforsushi,jordandietch/workforsushi,jordandietch/workforsushi | app/main/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.internet.defer import inlineCallbacks\n\nfrom vumi.application.tests.utils import ApplicationTestCase\nfrom vumi.demos.static_reply import StaticReplyApplication\n\n\nclass TestStaticReplyApplication(ApplicationTestCase):\n ... | python | edit | 1 | 1 | bsd-3-clause | 4622c1d2623468503b5d51683f953b82ca611b35 | vishwaprakashmishra/xmatrix,TouK/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi,harrissoerja/vumi | vumi/demos/tests/test_static_reply.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='django-markwhat',\n version=\".\".join(map(str, __import__('django_markwhat').__version__)),\n packages=['django_markwhat', 'django_markwhat.templatetags'],\n url='http://pypi.pytho... | python | edit | 1 | 0 | bsd-3-clause | c7a0f94eced9c2ac6f8a27c10a7a93da4b97f7d7 | Alir3z4/django-markwhat | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\niOS Compass\n---------------------\n'''\n\nfrom plyer.facades import Compass\nfrom pyobjus import autoclass\n\n\nclass IosCompass(Compass):\n\n def __init__(self):\n super(IosCompass, self).__init__()\n self.bridge = a... | python | edit | 1 | 1 | mit | 703ff26008525bce769b137fafe51ac080a6af81 | kivy/plyer,KeyWeeUsr/plyer,kivy/plyer,kivy/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer | plyer/platforms/ios/compass.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom feincms.module.page.models import Page\n\n\ndef add_page_if_missing(request):\n # If this attribute exists, the a page object has been registered already\n # by some other part of the code. We let it decide, which page object it\... | python | edit | 1 | 3 | bsd-3-clause | 2a8c4790bd432fc4dc0fdda64c0cea4f76fac9ff | matthiask/feincms2-content,hgrimelid/feincms,nickburlett/feincms,michaelkuty/feincms,michaelkuty/feincms,hgrimelid/feincms,feincms/feincms,pjdelport/feincms,joshuajonah/feincms,pjdelport/feincms,michaelkuty/feincms,joshuajonah/feincms,matthiask/feincms2-content,matthiask/django-content-editor,matthiask/django-content-e... | feincms/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nMINUTES = 60\nHOURS = MINUTES * 60\nDAYS = HOURS * 24\nWEEKS = DAYS * 7\nYEARS = DAYS * 365\n\n# Allows you to do `3 * DAYS` to make configuration clearer.\n# Technically the value for YEARS is wrong, but it's close enough.\n\nPOW_DIGITS = ... | python | edit | 1 | 0 | mit | 6d9b9d043e1d27e93f9cbf221ddc29db8760f789 | 5225225/node,5225225/node | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom src import coordinate\n\nclass TestRules(unittest.TestCase):\n \"\"\" Tests for the coordinate module \"\"\"\n\n def test_get_x_board(self):\n board_location = coordinate.Coordinate(4, 6)\n expected... | python | edit | 1 | 1 | mit | 37333506e6866e7d0859c5068f115a3e1b9dec3a | blairck/jaeger | test/test_coordinate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport subprocess\nfrom setuptools import setup, find_packages\nimport os\n\n\ndef git_version():\n def _minimal_ext_cmd(cmd):\n # construct minimal environment\n env = {}\n for k in ['SYSTEM... | python | edit | 1 | 3 | mit | 8597b77de45621292801a51f6a72a678a19dee57 | awhite40/pymks,davidbrough1/pymks,fredhohman/pymks,davidbrough1/pymks,XinyiGong/pymks | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Configuration settings\n\n# ID of HPO to validate (see resources/hpo.csv)\nhpo_id = 'hpo_id'\n\n# location of files to validate, evaluate\ncsv_dir = 'path/to/csv_files'\n\n# sprint number being validated against\nsprint_num = 0\n\n# Submi... | python | edit | 1 | 0 | mit | d7ed79ec53279f0fea0881703079a1c5b82bf938 | cumc-dbmi/pmi_sprint_reporter | _settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ast\n\n\ndef get_imported_libs(code):\n tree = ast.parse(code)\n # ast.Import represents lines like 'import foo' and 'import foo, bar'\n # the extra for name in t.names is needed, because names is a list that\n # would be... | python | edit | 3 | 8 | bsd-3-clause | f70bbbdadc044a76f7b90b2cac0191353a6a5048 | ericdill/depfinder | depfinder.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nHandles LED output for the Raspberry Pi 3\nImage tracking software. Imported using 'import ui'\nVersion: 5/06/17\nDependencies: RPi.GPIO\nNote: will only work on a Raspberry Pi!\n\"\"\"\nimport RPi.GPIO as gpio\nimport time\n\nledPi... | python | edit | 1 | 2 | mit | 624276b80b6d69b788b2f48691941cd89847237b | AdlerFarHorizons/eclipse-tracking,AdlerFarHorizons/eclipse-tracking,AdlerFarHorizons/eclipse-tracking,AdlerFarHorizons/eclipse-tracking | software/Pi/ui.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\nfrom datetime import datetime, timedelta\nframe_counter = 1\n\n# Time in seconds\n# 1 Hour = 3600\n# 1 Day = 86400\n\n# Time between each photo (seconds)\ntime_between_frames = 3\n\n# Duration of Time Lapse (seconds)\ndu... | python | edit | 1 | 1 | mit | 6cacf9c97e485308b95ad9a075aa5caf67f2b574 | tiimgreen/pi_lapse | pi_lapse.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport math\n\nfrom flask import Markup\nfrom peewee import Model, TextField, DateTimeField\n\nfrom app import db\n\n\nclass Quote(Model):\n content = TextField()\n timestamp = DateTimeField(default=datetime.datetime.... | python | edit | 1 | 1 | apache-2.0 | d60b0ee8c212728721f47cc57303ae24888cc387 | agateau/tmc2,agateau/tmc2 | models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom getpass import getpass\nfrom bessie import BaseClient\n\nimport config \n\n\nclass MicroBlogApi(BaseClient):\n\n\tendpoints = config.available_endpoints\n\tseparator = '/'\n\tbase_url='https://micro.blog'\n\n\tdef __init__(self, path='... | python | edit | 1 | 1 | mit | f3df3b2b8e1167e953457a85f2297d28b6a39729 | andymitchhank/bessie | examples/Micro.Blog/microblog.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\n# Match releases to redis-py versions\n__version__ = '2.7.2'\n\n# Jenkins will replace __build__ with a unique value.\n__build__ = ''\n\nsetup(name='mockredis',\n ... | python | edit | 1 | 0 | apache-2.0 | 9d180976b27213cf2c59e34a5aefec6335a1deca | matejkloska/mockredis,locationlabs/mockredis,optimizely/mockredis,yossigo/mockredis,path/mockredis | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom core.models import Comment, Tag\n\nfrom django import template\n\nregister = template.Library()\n\n#May want to ditch this for a middleware that passes in the comments object so that I can do the manipulations in the actual template\n@... | python | edit | 1 | 4 | bsd-2-clause | f8ae44cb19584a2b7d08b08dc4f32651acfe90f9 | mburst/burstolio,mburst/burstolio,mburst/burstolio | core/templatetags/tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport matplotlib.pyplot as plt\nimport theanets\n\nfrom utils import load_mnist, plot_layers, plot_images\n\n\ntrain, valid, _ = load_mnist()\n\ne = theanets.Experiment(\n theanets.Autoencoder,\n layers=(784,... | python | edit | 1 | 0 | mit | 22f305a7cb1daab3dc61b0d22b796916417de9d2 | lmjohns3/theanets,chrinide/theanets,devdoer/theanets | examples/mnist-deepautoencoder.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time, pexpect, re\nimport nose.tools as nt\nimport subprocess as spr\n\nPROMPT = \"root@\\w+:[^\\r]+\"\nUP_ARROW = \"\\x1b[A\"\n\ndef type(process, input_):\n process.send(input_.encode())\n process.expect(PROMPT)\n # Remo... | python | edit | 9 | 1 | mit | 473121ce5a3caa20576d02c79669408fd4177a43 | michaelbarton/command-line-interface,pbelmann/command-line-interface,bioboxes/command-line-interface,pbelmann/command-line-interface,michaelbarton/command-line-interface,bioboxes/command-line-interface | features/steps/interactive.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#Package startup stuff so people can start their iPython session with\n#\n#run PyQLab /path/to/cfgFile and be up and running\n\n\n#Package imports\nimport numpy as np\n\n#Load the configuration from the json file and populate the global con... | python | edit | 4 | 0 | apache-2.0 | 47f2ee4587df189864029a2260b642547ea7355f | Plourde-Research-Lab/PyQLab,BBN-Q/PyQLab,rmcgurrin/PyQLab,calebjordan/PyQLab | config.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nboilerplate = {\n 'chart': {\n 'renderTo': 'container',\n 'plotBackgroundColor': 'none',\n 'backgroundColor'': 'none',\n },\n 'title': {'text': 'null'}\n 'subtitle': {'text': 'null'}\n 'credits': {\n ... | python | edit | 1 | 0 | mit | 4e882ef7025581014520311734e0b6d626f3fd8d | total-impact/impactstory-analytics,Impactstory/impactstory-analytics,Impactstory/impactstory-analytics,Impactstory/impactstory-analytics,Impactstory/impactstory-analytics,total-impact/impactstory-analytics,total-impact/impactstory-analytics,total-impact/impactstory-analytics | impactstoryanalytics/highcharts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from setuptools import setup, find_packages\nexcept ImportError:\n from ez_setup import use_setuptools\n use_setuptools()\n from setuptools import setup, find_packages\n\nsetup(\n name='debexpo',\n version=\"\",\n ... | python | edit | 1 | 0 | mit | 3165cbdd418a38f72f2b638797b692589452528c | jonnylamb/debexpo,jonnylamb/debexpo,jadonk/debexpo,jonnylamb/debexpo,jadonk/debexpo,swvist/Debexpo,swvist/Debexpo,swvist/Debexpo,jadonk/debexpo | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\"\"\"\n__version__ = '0.1'\n__release__ = '0.1a2'\n\ndef inject_app_defaults():\n try:\n import settings as app_settings\n from django.conf import settings, global_settings\n from django.core.exceptions impo... | python | edit | 1 | 6 | bsd-3-clause | c178e9aba40f6cf775dce5badf60cff9acd9e908 | schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse | boardinghouse/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .io import preprocess\nfrom .train import train\nfrom .network import mlp\n\n\ndef autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,\n mask=None, type='normal', activation='relu', testset=False,\n ... | python | edit | 1 | 1 | apache-2.0 | 58a96c65f1e9868fb607cd3ce56dbf60905f62a7 | theislab/dca,theislab/dca,theislab/dca | autoencoder/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom scripts.util import documents\n\nfrom scrapi import settings\nfrom scrapi.linter import RawDocument\nfrom scrapi.processing.elasticsearch import es\nfrom scrapi.tasks import normalize, process_normalized, process_raw\... | python | edit | 2 | 7 | apache-2.0 | 1ed040f9d64e12adf964e9f86cc1e18bd8d21593 | erinspace/scrapi,mehanig/scrapi,alexgarciac/scrapi,felliott/scrapi,fabianvf/scrapi,icereval/scrapi,jeffreyliu3230/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,ostwald/scrapi,fabianvf/scrapi,felliott/scrapi | scripts/rename.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom http import server\nfrom socketserver import TCPServer\nimport os\n\n\nclass Server:\n def __init__(self, own_config, config, builder):\n self.directory = config.folders['output']\n self.port = own_config.get('port', 5... | python | edit | 1 | 2 | mit | 853c727c472efc09df90cb016bd05f81d4cf5e8e | cknv/beetle-preview | beetle_preview/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom registration.models import RegistrationProfile\n\n\nclass RegistrationAdmin(admin.ModelAdmin):\n list_display = ('__unicode__', 'activation_key_expired')\n search_fields = ('user__username', 'u... | python | edit | 1 | 0 | bsd-3-clause | 94596f036270f8958afd84eb9788ce2b15f5cbd4 | rafaduran/django-pluggable-registration,rbarrois/django-registration,maraujop/django-registration,thedod/django-registration-hg-mirror,CoatedMoose/django-registration,AndrewLvov/django-registration,AndrewLvov/django-registration,aptivate/django-registration,fedenko/django-registration,CoatedMoose/django-registration,ch... | registration/admin.py | rejected_duplicate | Near-duplicate of sample 444 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# This file is part of beets.\n# Copyright 2016, Adrian Sampson.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"So... | python | edit | 1 | 2 | mit | dafde564f3ea18655b1e15f410df70d05b3eb8f5 | mosesfistos1/beetbox,ibmibmibm/beets,mosesfistos1/beetbox,MyTunesFreeMusic/privacy-policy,artemutin/beets,jackwilsdon/beets,sampsyo/beets,pkess/beets,xsteadfastx/beets,shamangeorge/beets,diego-plan9/beets,MyTunesFreeMusic/privacy-policy,jackwilsdon/beets,beetbox/beets,sampsyo/beets,beetbox/beets,madmouser1/beets,beetbo... | beets/util/collections.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='flask_flaskwork',\n description='A Flask plugin to talk with the Flaskwork Chrome extension.',\n version='0.1.12',\n license='BSD',\n author='Tim Radke',\n author_email='<EMAI... | python | edit | 1 | 0 | mit | 8646a5a111993dc58c322d3c6154b2d6197fdb06 | countach74/flask_flaskwork | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport os\nimport optparse\nimport sys\nimport unittest\n\nUSAGE = \"\"\"%prog SDK_PATH TEST_PATH\nRun unit tests for App Engine apps.\n\nSDK_PATH Path to the SDK installation.\nTEST_PATH Path to package containi... | python | edit | 2 | 1 | bsd-3-clause | a5cc18bab108f83ab45073272fa467fc62a2649b | pquochoang/samples,jiayliu/apprtc,todotobe1/apprtc,jan-ivar/adapter,82488059/apprtc,shelsonjava/apprtc,procandi/apprtc,4lejandrito/adapter,overtakermtg/samples,mvenkatesh431/samples,JiYou/apprtc,martin7890/samples,Zauberstuhl/adapter,TribeMedia/samples,jiayliu/apprtc,bpyoung92/apprtc,aadebuger/docker-apprtc,xdumaine/ad... | run_python_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom spec import Spec, eq_\n\nfrom fabric import ThreadingGroup as Group\n\n\nclass Group_(Spec):\n def simple_command_on_multiple_hosts(self):\n \"\"\"\n Run command on localhost...twice!\n \"\"\"\n group = G... | python | edit | 1 | 2 | bsd-2-clause | b9ac30b0e428038986de64e069954ee340b991a9 | fabric/fabric | integration/group.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Data set split\nTRAIN_FRACTION = 0.75\nVALIDATE_FRACTION = 0.1\nTEST_FRACTION = 0.15\nTOTAL_NUM_EXAMPLES = 147052 # Total number of tracks\nassert(TRAIN_FRACTION + VALIDATE_FRACTION + TEST_FRACTION == 1.0)\n\n# Validation and check po... | python | edit | 1 | 0 | mit | 6797c9b705b0cfd5c770f68695402baf044510ff | harpribot/representation-music,harpribot/representation-music | utils/training_utils/params.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMerge function for 2048 game.\n\"\"\"\n\ndef merge(line):\n \"\"\"\n Function that merges a single row or column in 2048.\n \"\"\"\n l = len(line)\n s1 = [0]*l\n j = 0\n for i in range(l):\n \tif l[i] != 0:\n... | python | edit | 1 | 3 | mit | 00ddeefdcdacb811f5e665a91139e165d7217f84 | Crescent-Saturn/Principles-of-Computing | week1/poc_2048_merge_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\nfrom setuptools.command.install import install as _install\n\nclass install(_install):\n def run(self):\n _install.run(self)\n\nsetup(\n cmdclass = { 'install' : install },\n name = 'hydra',\n ... | python | edit | 1 | 1 | mit | cb4421529e9564f110b84f590f14057eda8746c8 | tatsy/hydra | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os.path\nimport sys\n\n# This bit of evil should inject third_party into the path for relative imports.\nsys.path.append(os.path.dirname(__file__))\n\n```\n\nApply this change: Insert third_party into the second slot of sys.path rath... | python | edit | 1 | 0 | apache-2.0 | bcc0fbf9d8dd75b776c6a2137975912bcd0831d5 | nishad/namebench,jimb0616/namebench,cah0211/namebench,iamang/namebench,tcffisher/namebench,HerlonNascimento/namebench,RomanHargrave/namebench,tectronics/namebench,llaera/namebench,renatogames2/namebench,bluemask2001/namebench,Bandito43/namebench,ran0101/namebench,cloudcache/namebench,deepak5/namebench,thanhuwng/nameben... | third_party/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom distribute_setup import use_setuptools\nuse_setuptools()\n\nfrom setuptools import setup, find_packages\nsetup(\n name=\"ShowTransmission\",\n version=\"0.1\",\n packages=find_packages(),\n\n author=\... | python | edit | 1 | 0 | apache-2.0 | cb528fbb990e8cd3d301fcbf60069b33a68b9cac | cscutcher/showtransmission | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport io\nimport os\n\nfrom ...tests.helper import pytest\nfrom .. import gzip\n\ndef test_gzip(tmpdir):\n fd = gzip.GzipFile(str(tmpdir.join(\"test.gz\")), 'wb')\n fd = io.TextIOWrapper(fd, encoding='utf8')\n\n```\n\nApply this chan... | python | edit | 3 | 1 | bsd-3-clause | 6064db3000f2aeec66a775345d22b8a2b421497f | tbabej/astropy,bsipocz/astropy,lpsinger/astropy,MSeifert04/astropy,StuartLittlefair/astropy,larrybradley/astropy,DougBurke/astropy,stargaser/astropy,pllim/astropy,stargaser/astropy,MSeifert04/astropy,tbabej/astropy,lpsinger/astropy,joergdietrich/astropy,astropy/astropy,joergdietrich/astropy,dhomeier/astropy,kelle/astro... | astropy/utils/tests/test_gzip.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Define initial schema for user and email notifications"
},
{
"role": "assistant",
"content": "from django.db import models\nfrom django.contrib.auth.models import User\nfrom django.db.models.signals import post_save\nfrom django.... | python | new_file | 2 | 2 | apache-2.0 | 0e53ae11cb1cc53979edb1f17162e8b1d89ad809 | ritstudentgovernment/PawPrints,ritstudentgovernment/PawPrints,ritstudentgovernment/PawPrints,ritstudentgovernment/PawPrints | user/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom setuptools import setup, find_packages\n\n\nwith open('README.rst') as readme_file:\n README = readme_file.read()\n\n\ninstall_requires = [\n 'click==6.6',\n 'botocore>=1.5.40,<2.0.0',\n 'typing==3.5.... | python | edit | 1 | 0 | apache-2.0 | 1963d144362a66ca39ffdb909163ef4301a8048d | awslabs/chalice | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport requests\nimport datetime\nimport time\nimport json\n\nimport random\nfrom random import choice\n\nrandom.seed(datetime.datetime.now())\n\nnames = (\"vehicle_speed\", \"fuel_consumed_since_restart\", \"latitude... | python | edit | 3 | 1 | bsd-3-clause | 38603c8b35c15c134a0499ac92a7c1f7dee4f526 | openxc/web-logging-example,openxc/web-logging-example | send_test_data.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.