messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport asyncio\nimport signal\nimport websockets\n\nasync def client():\n uri = \"ws://localhost:8765\"\n async with websockets.connect(uri) as websocket:\n # Close the connection when receiving SIGTERM... | python | edit | 1 | 2 | bsd-3-clause | 9e960b508988c4049eb9f3377c505f506a3af060 | aaugustin/websockets,aaugustin/websockets,aaugustin/websockets,aaugustin/websockets | example/shutdown_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom rgbmatrix import RGBMatrix\nfrom random import randint\nimport time\n\nrows = 16\nchains = 1\nparallel = 1\nledMatrix = RGBMatrix(rows, chains, parallel)\nheight = ledMatrix.height\nwidth = ledMatrix.width\n\nfor... | python | edit | 3 | 0 | mit | dc47c88d5f1c6f1e78322c5bfcb585e54b3a0c0a | DarkAce65/rpi-led-matrix,DarkAce65/rpi-led-matrix | python/colorTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom keras.applications.imagenet_utils import decode_predictions\nfrom keras.preprocessing import image\n\nimport numpy as np\nfrom mobilenets import MobileNets\... | python | edit | 1 | 1 | apache-2.0 | 5b4049b3aa27a8a2e02c768eb411b35f4518821e | titu1994/MobileNetworks | predict_imagenet.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n\nimport sys\nimport window\nfrom PyQt5.QtWidgets import QApplication\n\n\ndef main():\n startGUI()\n\n\ndef startGUI():\n app = QApplication(sys.argv)\n ex = window.MainWindow()\n ex.show()\n\n sys.exit(a... | python | edit | 1 | 1 | mit | 0fa9b1abef3c7310d8f840d35bb417f74093d5cf | grsakea/pyt | src/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pygraphc.clustering.ClusterDistance import *\nfrom pygraphc.clustering.ClusterEvaluation import *\nfrom pygraphc.clustering.ClusterUtility import *\nfrom pygraphc.clustering.ConnectedComponents import *\nfrom pygraphc.clustering.KCliqu... | python | edit | 8 | 0 | mit | 5b8fe62647eade5d9c060c027e5658cf0eb531f2 | studiawan/pygraphc | pygraphc/clustering/__init__.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom unittest import mock\n\nimport pytest\n\nfrom bottery.conf import Settings\n\n\n@pytest.fixture\ndef mocked_settings():\n settings = mock.MagicMock()\n sys.modules['settings'] = settings\n yield settings\n del s... | python | edit | 3 | 1 | mit | f4837fd60ce09b69d334fcad1403b721723d3504 | rougeth/bottery | tests/test_conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ndef index():\n def GET():\n return locals()\n\n@request.restful()\ndef api():\n response.view = 'generic.json'\n def GET(resource,resource_id):\n if not resource=='study': raise HTTP(400)\n # retur... | python | edit | 5 | 2 | bsd-2-clause | aca17ff2fddd35bd50d78d62dc6dab7e47fb8e4e | OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api | controllers/default.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2013 Mark Lee\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#\... | python | edit | 1 | 0 | apache-2.0 | 57428c3ef4c80733c2309aea2db71624b188a055 | malept/pyoath-toolkit,malept/pyoath-toolkit,malept/pyoath-toolkit | oath_toolkit/_compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\ntry:\n from urllib.parse import urljoin\n from urllib.request import urlopen\nexcept:\n # for Python 2.7 compatibility\n from urlparse import urljoin\n from urllib2 import urlopen\n\nfrom django.shortcuts import re... | python | edit | 4 | 3 | apache-2.0 | 4339b61aad98d10f91f44c82b72376bc88c3ec22 | uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot | pivot/views/data_api.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pylint: disable=missing-docstring, invalid-name, import-error\nimport pandas as pd\n\nfrom mltils.encoders import InfrequentValueEncoder\n\n\ndef test_infrequent_value_encoder_1():\n ive = InfrequentValueEncoder()\n assert ive is no... | python | edit | 1 | 1 | mit | 05551b6b7ed1ed9a97be635f3d32b5bd4f26f635 | rladeira/mltils | tests/mltils/test_infrequent_value_encoder.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nModule for reading DOTA 2 data using the Steam API\n\nCopyright (c) 2010, Anthony Garcia <<EMAIL>>\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided ... | python | edit | 1 | 2 | isc | 85698cd291753a9ef352250e03a77b14b3f1f9ab | miedzinski/steamodd,Lagg/steamodd | steam/d2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'adrie_000'\n\n\np = bytes('HELLO')\nquit('FINISHED')\nprint 'pHELLO'\n\n```\n\nApply this change: Add features : - Restart software in case of accidental unplug-replug - Minor bug fixes"
},
{
"role": "assistant",
"... | python | edit | 2 | 0 | apache-2.0 | 07f4d284df18c1e1be7ea9ff490fa14c1974b215 | adrien-bellaiche/ia-cdf-rob-2015 | testFile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom flask import Flask\nfrom .config import config\n\nfrom .api import api_bp\n\n__project__ = 'cf-predict'\n__version__ = '0.0.0'\n\nVERSION = \"{0} v{1}\".format(__project__, __version__)\n\nPYTHON_VERSION = 3, 4\n\nif sys.ve... | python | edit | 1 | 2 | mit | 86a44c855ebc84d422b2338090f4ca6d0d01cee5 | ronert/cf-predict,ronert/cf-predict | cf_predict/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Coefficients for polynomial fit to bolometric correction - color relation\ncoeff_BminusV = [-0.823, 5.027, -13.409, 20.133, -18.096, 9.084, -1.950]\ncoeff_VminusI = [-1.355, 6.262, -2.676, -22.973, 35.524, -15.340]\ncoeff_BminusI = [-1.09... | python | edit | 1 | 0 | mit | d879d74aa078ca5a89a7e7cbd1bebe095449411d | JALusk/SNoBoL,JALusk/SNoBoL,JALusk/SuperBoL | snobol/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport functools\nimport tempfile\nimport shutil\n\nclass makedirs(object):\n def __init__(self, num):\n self._num = num\n\n def __call__(self, fn):\n @functools.wraps(fn)\n def wrapper(*args, **kwargs):\n ... | python | edit | 5 | 6 | mit | d2e120606d2a6e817f0c20f55dcc4296807f19df | thelinuxkid/tempdirs | tempdirs.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########################################################################\n# SimpleFIX\n# Copyright (C) 2016, David Arnold.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this... | python | edit | 5 | 0 | mit | 39bf1013c5b2b4a18be6de3a3f2002908bf36014 | da4089/simplefix | test/all.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 Spotify AB. All rights reserved.\n#\n# The contents of this file are licensed under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with the\n# License. You may obtain a ... | python | edit | 1 | 0 | apache-2.0 | b5672d55beb837f21d761f50740b93c5b1e0dc5d | napalm-automation/napalm-base,napalm-automation/napalm-base,Netflix-Skunkworks/napalm-base,napalm-automation/napalm,Netflix-Skunkworks/napalm-base,spotify/napalm,bewing/napalm-base,spotify/napalm,bewing/napalm-base | napalm/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Author: Florian Mayer <<EMAIL>>\n\nfrom __future__ import absolute_import\n\nfrom sunpy.net import attr\n\ndef test_dummyattr():\n one = attr.DummyAttr()\n other = attr.ValueAttr({'a': 'b'})\n assert (one... | python | edit | 1 | 1 | bsd-2-clause | 7086b1967c3a3666260e6358c72cb15c74213bea | dpshelio/sunpy,dpshelio/sunpy,dpshelio/sunpy | sunpy/net/tests/test_attr.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some needed IRC numerics"
},
{
"role": "assistant",
"content": "IRC_numeric_to_name = {\"001\": \"RPL_WELCOME\", \"315\": \"RPL_ENDOFWHO\", \"352\": \"RPL_WHOREPLY\", \"372\": \"RPL_MOTD\", \"375\": \"RPL_MOTDSTART\", \"376\"... | python | new_file | 1 | 0 | mit | c35887025a2127a527862e664d1ef3bb5c4f528a | Didero/DideRobot | Constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom mopidy.backends.gstreamer import GStreamerBackend\n\nfrom tests.backends.basetests import (BasePlaybackControllerTest,\n BaseCurrentPlaylistControllerTest)\n\nclass GStreamerCurre... | python | edit | 1 | 0 | apache-2.0 | b0699b4683a241449889ee712ae57bb13f0e3eaa | dbrgn/mopidy,SuperStarPL/mopidy,kingosticks/mopidy,adamcik/mopidy,hkariti/mopidy,ali/mopidy,jodal/mopidy,jmarsik/mopidy,rawdlite/mopidy,tkem/mopidy,priestd09/mopidy,abarisain/mopidy,pacificIT/mopidy,vrs01/mopidy,diandiankan/mopidy,quartz55/mopidy,mopidy/mopidy,swak/mopidy,liamw9534/mopidy,mokieyue/mopidy,bencevans/mopi... | tests/backends/gstreamer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import core\nfrom . import plugin_interface\nfrom . import plugins\nfrom .core import File, validation\n\n# TODO remove versioneer\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n\n# co... | python | edit | 12 | 0 | mit | 6687d03808c454684c0df3e4b2605f6f86e575b7 | CINPLA/exdir,CINPLA/exdir,CINPLA/exdir | exdir/__init__.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"Utility for generating memorable passwords\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\n\nimport argparse\nimport sys\n\nimport niceware\n\n\ndef main(args=None):... | python | edit | 1 | 3 | mit | ecc1713dcd03894cca858910d702c32b0cdf1d42 | moreati/python-niceware | niceware/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nfrom cryptography.hazmat.backends import default_backend\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives.asymmetric import rsa\nfrom cryptography import x509\nfrom cryptography.x509 i... | python | edit | 1 | 1 | mit | af5100682eae8992af0ddfdfc4b8bd8043718bc6 | mosen/commandment,jessepeterson/commandment,mosen/commandment,mosen/commandment,mosen/commandment,mosen/commandment,jessepeterson/commandment | commandment/pki/ssl.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom resumeback import send_self\n\nfrom . import CustomError, defer, wait_until_finished, State\n\n\ndef test_subgenerator_next():\n ts = State()\n\n def subgenerator(this):\n yield defer(this.next)\n t... | python | edit | 1 | 1 | mit | 430246e54add2ef99fd3d8e87b05ba4b178e0336 | FichteFoll/resumeback | tests/test_subgenerators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef parseinfo_context(parseinfo, context_amount = 3):\n buffer = parseinfo.buffer\n context_start_line = max(parseinfo.line - 1 - context_amount, 0)\n before_context_lines = buffer.get_lines(context_start_line, parseinfo.line - 1)\... | python | edit | 1 | 2 | mit | fea7a2c0e4f4f3da50935d03db4b9e19a0fc477c | zmbc/shakespearelang,zmbc/shakespearelang,zmbc/shakespearelang | shakespearelang/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMiddleware to automatically set the schema (namespace).\n\nif request.user.is_superuser, then look for a ?schema=XXX and set the schema to that.\n\nOtherwise, set the schema to the one associated with the logged in user.\n\n\n\"\"\"... | python | edit | 1 | 6 | bsd-3-clause | 58d73429952a942d03b232242424946895ec3e8c | schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse | multi_schema/middleware.py | rejected_duplicate | Near-duplicate of sample 3559 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division, absolute_import, print_function\n\nfrom numpy import pad as numpy_pad\n\n\ndef pad(array, pad_width, mode, **kwargs):\n return numpy_pad(array, pad_width, mode, **kwargs)\n\n# Pull function info / docs fr... | python | edit | 1 | 1 | bsd-3-clause | da097ed41010961cc0814d55d8784787f3ea8a63 | rjeli/scikit-image,paalge/scikit-image,rjeli/scikit-image,vighneshbirodkar/scikit-image,vighneshbirodkar/scikit-image,vighneshbirodkar/scikit-image,paalge/scikit-image,rjeli/scikit-image,paalge/scikit-image | skimage/util/arraypad.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import division\nimport sys\n\nimport pytest\n\nfrom profiling.sampling import SamplingProfiler\nfrom profiling.sampling.samplers import ItimerSampler\nfrom utils import find_stats, spin\n\n\ndef spi... | python | edit | 1 | 2 | bsd-3-clause | eb90169c2d38244af61e135ed279b8d42f1a8ef5 | sublee/profiling,JeanPaulShapo/profiling,JeanPaulShapo/profiling,what-studio/profiling,sublee/profiling,what-studio/profiling | test/test_sampling.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport chatbot_brain\n\n\ndef test_initialize_bot():\n bot = chatbot_brain.Chatbot()\n assert len(bot.tri_lexicon) == 0\n assert len(bot.bi_lexicon) == 0\n\n\ndef test_fill_lexicon():\n bot = chatbot_brain.Chatbot()\n bot.fil... | python | edit | 1 | 2 | mit | 504ae635e08ccf0784db0a0586e8796f5bd360bb | corinnelhh/chatbot,corinnelhh/chatbot | test_chatbot_brain.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\nfrom Logger import Logger\n\nclass TestLogger(unittest.TestCase):\n def test_file_handling(self):\n testLog = Logger(\"testLog\")\n ## Check if program can create and open file\n self.asse... | python | edit | 1 | 1 | mit | 20147b8b8a80ef8ab202d916bf1cdfb67d4753d3 | TeaPackCZ/RobotZed,TeaPackCZ/RobotZed | SelfTests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom txircd.channel import IRCChannel\nfrom txircd.modbase import Module\n\nclass Autojoin(Module):\n\tdef joinOnConnect(self, user):\n\t\tif \"client_join_on_connect\" in self.ircd.servconfig:\n\t\t\tfor channel in self.ircd.servconfig[\"c... | python | edit | 1 | 4 | bsd-3-clause | 822ae0442bf5091be234dc9470a79c83f909ff35 | Heufneutje/txircd,DesertBus/txircd,ElementalAlchemist/txircd | txircd/modules/conn_join.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nimport time\nimport zmq\nimport numpy as np\ntry:\n import progressbar\nexcept ImportError:\n progressbar = None\n\ntry:\n import pylepton \nexcept ImportError:\n print \"Couldn't import pyle... | python | edit | 6 | 0 | mit | 0c00acb19274626241f901ea85a124511dfe4526 | wonkoderverstaendige/raspi_lepton | server/lepton_server.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom lettuce import world, step\nfrom nose.tools import assert_equals, assert_true\n\n@step(u'Then I see no results')\ndef then_i_see_spo_results(step):\n cell = world.browser.find_element_by_xpath('//*[@id=\"que... | python | edit | 4 | 1 | bsd-2-clause | 81fa7c857b9c7fc7cf0c48028be22071da5cb318 | cburgmer/deniz,cburgmer/deniz | test/execute-steps.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\"\"\"An abstract base class for all Dakota component plugins.\"\"\"\n\nfrom abc import ABCMeta, abstractmethod\n\n\nclass PluginBase(object):\n\n \"\"\"Describe features common to all Dakota plugins.\"\"\"\n\n ... | python | edit | 1 | 1 | mit | c498bb6ac7a80ac2668fef22fa6600de6fc9af89 | csdms/dakota,csdms/dakota | dakota/plugins/base.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 humbug\n\nimport glob\nimport os\nfrom distutils.core import setup\n\nsetup(name='humbug',\n version=humbug.__version__,\n description='Bindings for the Humbug message API',... | python | edit | 1 | 0 | apache-2.0 | 8ae102a99b4dab4d4b6273eaacd83db7616640c2 | avastu/zulip,brainwane/zulip,eastlhu/zulip,MariaFaBella85/zulip,hayderimran7/zulip,willingc/zulip,jainayush975/zulip,vaidap/zulip,voidException/zulip,alliejones/zulip,jessedhillon/zulip,bowlofstew/zulip,firstblade/zulip,suxinde2009/zulip,zofuthan/zulip,JPJPJPOPOP/zulip,huangkebo/zulip,hayderimran7/zulip,babbage/zulip,M... | api/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom openroad import Design, Tech\nimport helpers\nimport gpl_aux\n\ntech = Tech()\ntech.readLiberty(\"./library/nangate45/NangateOpenCellLibrary_typical.lib\")\ntech.readLef(\"./nangate45.lef\")\ndesign = Design(tech)\ndesign.readDef(\"./s... | python | edit | 1 | 0 | bsd-3-clause | 1eaae78c14b26378a606221eb61f97ec15134baa | The-OpenROAD-Project/OpenROAD,The-OpenROAD-Project/OpenROAD,The-OpenROAD-Project/OpenROAD,The-OpenROAD-Project/OpenROAD,QuantamHD/OpenROAD,The-OpenROAD-Project/OpenROAD,QuantamHD/OpenROAD,QuantamHD/OpenROAD,QuantamHD/OpenROAD,QuantamHD/OpenROAD | src/gpl/test/simple01-td.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport logging\nimport httplib2\nimport json\nimport time\nimport random\n\nfrom apiclient import errors\nfrom apiclient.discovery import build\nfrom oauth2client.client import SignedJwtAssertionCredentials\n\nclass... | python | edit | 7 | 4 | mit | 883ec0d68140995cfedc2d64d7d80cac1e234f39 | lumapps/lumRest | app/oauth.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport platform\nimport sys\n\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONTENT_COMMIT = '44c71d88d9c098ece5dbf3e1fcc93ab87d8193cd'\n\nARCH = {\n 'cygwin': '32bit'... | python | edit | 1 | 0 | mit | c36c4e36c5f2ef5f270923172be04d528ad37090 | pombredanne/electron,thompsonemerson/electron,jjz/electron,tonyganch/electron,bobwol/electron,electron/electron,voidbridge/electron,howmuchcomputer/electron,gbn972/electron,Jacobichou/electron,leftstick/electron,wolfflow/electron,jlord/electron,robinvandernoord/electron,eriser/electron,destan/electron,Jonekee/electron,... | script/lib/config.py | rejected_duplicate | Near-duplicate of sample 6588 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import viewsets, authentication\nfrom tweets import models\nfrom tweets import serializers\nfrom tweets.permissions import MessagePermission, ProfilePermissions\nfrom django.contrib.auth import get_user_model\n\n\nclass ... | python | edit | 1 | 3 | mit | cb1d686d5d0bb96e5a22f079aca34678167c19b1 | pennomi/openwest2015-twitter-clone,pennomi/openwest2015-twitter-clone,pennomi/openwest2015-twitter-clone | tweets/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom av.option import Option\n\nfrom common import *\n\n\nclass TestOptions(TestCase):\n\n def test_mov_options(self):\n\n mov = av.ContainerFormat('mov')\n options = mov.descriptor.options\n by_name = {opt.name: opt... | python | edit | 4 | 2 | bsd-3-clause | 18910b6cfa94a88763d2295c4b4644ed099ef382 | pupil-labs/PyAV,pupil-labs/PyAV,pupil-labs/PyAV,PyAV-Org/PyAV,pupil-labs/PyAV,mikeboers/PyAV,mikeboers/PyAV,PyAV-Org/PyAV | tests/test_options.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.dispatch import Signal\n\n#: Signal fired when a new issue is posted via the API.\nissue_posted = Signal(providing_args=('request', 'issue'))\n\n```\n\nApply this change: Remove documenting argument from Signal"
},
{
"ro... | python | edit | 1 | 0 | mit | d1bd82008c21942dee0ed29ba6d4f9eb54f2af33 | 6aika/issue-reporting,6aika/issue-reporting,6aika/issue-reporting | issues/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2009-2012 Simplistix Ltd\n#\n# See license.txt for more details.\n\nfrom doctest import REPORT_NDIFF,ELLIPSIS\nfrom glob import glob\nfrom manuel import doctest, capture\nfrom manuel.testing import TestSuite\nfrom os.path im... | python | edit | 1 | 1 | mit | 0230c94110e99f31aea413230a908bae8cce467d | nebulans/testfixtures,Simplistix/testfixtures | testfixtures/tests/test_docs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport base64\nimport json\nimport os\nimport random\nfrom dallinger.nodes import Source\n\n\nclass DrawingSource(Source):\n \"\"\"A Source that reads in a random image from a file and transmits it.\"\"\"\n\n __mapper_args__ = {\"poly... | python | edit | 1 | 1 | mit | 85c9206dd0a4af52a31d7b6e9283bc7c103e3953 | Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger | demos/dlgr/demos/iterated_drawing/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom time import time\n\nfrom sentry import options\n\nfrom .base import StatusCheck, Problem\n\n\nclass CeleryAliveCheck(StatusCheck):\n def check(self):\n last_ping = options.get('sentry... | python | edit | 1 | 3 | bsd-3-clause | c873fa541f58e2c8be35d0854da7d5aa3491267a | mvaled/sentry,beeftornado/sentry,mvaled/sentry,BuildingLink/sentry,mitsuhiko/sentry,BuildingLink/sentry,mvaled/sentry,fotinakis/sentry,jean/sentry,JamesMura/sentry,alexm92/sentry,zenefits/sentry,mvaled/sentry,mitsuhiko/sentry,jean/sentry,JamesMura/sentry,beeftornado/sentry,JackDanger/sentry,looker/sentry,jean/sentry,lo... | src/sentry/status_checks/celery_alive.py | accepted | null | 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 | 3 | apache-2.0 | 35c9740826d2b7636647e45afab4ec87075647a6 | 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 python\nimport os\nfrom flask import Flask, render_template\n\napp = Flask(__name__)\n\n@app.route('/')\ndef root():\n\tgenres = ('Hip Hop', 'Electronic', 'R&B')\n\tsongs = [\\\n\t\t\t{ 'rank':'1', 'title':'The Motto', 'artis... | python | edit | 1 | 1 | mit | f935a14967f8b66342d34efca9ceff9eecd384be | alykhank/Tunezout,alykhank/Tunezout | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nfrom .base import * # noqa\n\nKOLIBRI_SKIP_AUTO_DATABASE_MIGRATION = True\n\n```\n\nApply this change: Use migrations because `kolibri start` was added to tox matr... | python | edit | 1 | 0 | mit | 779b9223a0e57a00964fa73ce3e164ececfbf4cb | christianmemije/kolibri,lyw07/kolibri,benjaoming/kolibri,jonboiser/kolibri,benjaoming/kolibri,lyw07/kolibri,learningequality/kolibri,mrpau/kolibri,rtibbles/kolibri,lyw07/kolibri,DXCanas/kolibri,MingDai/kolibri,rtibbles/kolibri,MingDai/kolibri,learningequality/kolibri,MingDai/kolibri,rtibbles/kolibri,jonboiser/kolibri,j... | kolibri/deployment/default/settings/test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nfrom getpass import getpass\nimport readline\nimport sys\n\nimport annotator\nfrom annotator.model import Consumer, User\n\nif __name__ == '__main__':\n r = raw_input(\"This program will perform i... | python | edit | 7 | 0 | mit | 78c13173fadbdc3d261ab3690ffb9c37d8f8a72d | openannotation/annotator-store,nobita-isc/annotator-store,nobita-isc/annotator-store,ningyifan/annotator-store,nobita-isc/annotator-store,nobita-isc/annotator-store,happybelly/annotator-store | bootstrap.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nchatbot_ubuntu = {\n 'path': '',\n 'model_id': '',\n 'python_env': ''\n}\nchatbot_swisscom = {\n 'path': '',\n 'model_id': '',\n 'python_env': ''\n}\nchatbot_ubuntu_seq2seq = {\n 'socket_address': '',\n 'socket_port'... | python | edit | 1 | 0 | mit | 42cc93590bef8e97c76e79110d2b64906c34690d | nachoaguadoc/aimlx-demos,nachoaguadoc/aimlx-demos,nachoaguadoc/aimlx-demos | config_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url, include\nfrom django.contrib import admin\n\nfrom tests.urls import urlpatterns\n\n\nadmin.autodiscover()\nurlpatterns += patterns('',\n url(r'^admin/', include(admin.site.urls),\n)\n\n```\n\nA... | python | edit | 1 | 0 | isc | 0f35d965b19ce52fc1f3fd633dc9edae0a2e7fe7 | trilan/lemon-robots,trilan/lemon-robots | tests/test_django_admin/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef includeme(config):\n config.add_route('social.auth', '/login/{backend}')\n config.add_route('social.complete', '/complete/{backend}')\n config.add_route('social.disconnect', '/disconnect/{backend}')\n config.add_route('socia... | python | edit | 1 | 1 | bsd-3-clause | 72a5f58d7c7fe18f5ce4c2e02cf8a26146777f27 | SeanHayes/python-social-auth,SeanHayes/python-social-auth,JerzySpendel/python-social-auth,ariestiyansyah/python-social-auth,bjorand/python-social-auth,drxos/python-social-auth,tkajtoch/python-social-auth,ByteInternet/python-social-auth,VishvajitP/python-social-auth,lawrence34/python-social-auth,JerzySpendel/python-soci... | social/apps/pyramid_app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport boto\n\nclass CommandUploadFileToVault(object):\n\n def execute(self, args, config):\n glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configur... | python | edit | 3 | 5 | mit | c0a6a18363e3bdaab67c4abb15add441e7a975ca | carsonmcdonald/glacier-cmd | glaciercmd/command_upload_file_to_vault.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom PyQt5.QtCore import Qt\n\nFREQ = [\n\t6.666666666666667,\n#\t12.195121951219512,\n\t5.882352941,\n\t10,\n\t7.575757575757576\n]\n# fifth freq \n# 8.620689655172415\n# \n# TODO: Adjust colors\nCOLOR = [Qt.green, Qt.green, Qt.green, ... | python | edit | 1 | 0 | apache-2.0 | bf9a3b78e2d0da66deee8e8f140ba161d601a4c6 | brainbots/assistant | assisstant/keyboard/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fuelclient.commands import base\nfrom fuelclient.commands import environment as env_commands\nfrom fuelclient.common import data_utils\n\n\nclass EnvClone(env_commands.EnvMixIn, base.BaseShowCommand):\n \"\"\"Clone environment and t... | python | edit | 1 | 1 | apache-2.0 | f762c4e129db71ef7cfccba9b8e60582a3358617 | Mirantis/octane,stackforge/fuel-octane,Mirantis/octane,stackforge/fuel-octane | octane_fuelclient/octaneclient/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom luigi_td.targets.result import ResultTarget\n\nimport urllib\n\nimport logging\nlogger = logging.getLogger('luigi-interface')\n\nclass TableauServerResultTarget(ResultTarget):\n # required\n server = None\n username = None\n ... | python | edit | 1 | 5 | apache-2.0 | b00cc9aa45a455b187bec869e367422bb78785c1 | treasure-data/luigi-td | luigi_td/targets/tableau.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nUtilities for handling the cmap table\nand character mapping in general.\n\"\"\"\n\ndef extractCMAP(ttFont):\n cmap = {}\n cmapIDs = [(3, 10), (0, 3), (3, 1)]\n for i in range(len(cmapIDs)):\n if ttFont[\"cmap\"].get... | python | edit | 1 | 3 | mit | 5cc071958aa63f46ec7f3708648f80a8424c661b | typesupply/compositor,anthrotype/compositor,anthrotype/compositor,typesupply/compositor | Lib/compositor/cmap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pydantic import BaseModel\n\n\nclass Person(BaseModel):\n name: str\n age: int\n\n class Config:\n schema_extra = {\n \"examples\": [\n {\n \"name\": \"John Doe\",\n ... | python | edit | 1 | 0 | mit | 3cb52b94d2b5b3376a5dd965a976c398cd835e6d | samuelcolvin/pydantic,samuelcolvin/pydantic | docs/examples/schema4.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport attr\nimport pytest\n\nfrom eli5.base_utils import attrs\n\n\ndef test_attrs_with_default():\n\n @attrs\n class WithDefault(object):\n def __init__(self, x, y=1):\n self.x = x\n self.y = y\n\n x_... | python | edit | 1 | 1 | mit | e5c436dfc39f38007c1cf8ee5e42a2e33e71740c | TeamHG-Memex/eli5,TeamHG-Memex/eli5,TeamHG-Memex/eli5 | tests/test_base_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import deque\n\nfrom hypothesis import given\nfrom hypothesis.strategies import (frozensets, integers, lists, one_of, sets,\n tuples)\n\nfrom tests.hypothesis2 import examples\nfrom tests.h... | python | edit | 1 | 1 | mit | 601b35c2ad07d7927c9473c6cbf500d1fec3e307 | lidatong/dataclasses-json,lidatong/dataclasses-json | tests/test_invariants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: set fileencoding=utf-8 :\n\nclass Responder(object):\n def support(message):\n pass\n\n def generate(message):\n pass\n \n def on_start(self, consumer):\n return False\n\n def support(self, req... | python | edit | 20 | 1 | mit | 6cd9b0c731839a75cd8e8bd2ab1e5d2f2687c96a | rande/python-shirka,rande/python-shirka | shirka/responders/__init__.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport curses\n\nfrom .character import Character\nfrom .console import Console\nfrom .line import Line\nfrom .misc import ESCAPE_CHARS, DELETE_CHARS, BACKSPACE_CHARS, \\\n is_printable_char, ctrl, unctrl\n\n\n\ndef turn_on... | python | edit | 9 | 1 | unlicense | 25b5f88d5105ed1b9a2e39b8bea7238709238fd0 | raviqqe/shakyo | shakyo/consolekit/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMain class for doing the work.\n\"\"\"\n\nfrom helper import Helper\nfrom renderer import Renderer\n\n\nclass Generator(object):\n @classmethod\n def generate_statements(cls, class_list_def):\n \"\"\"\n\n :type c... | python | edit | 1 | 2 | apache-2.0 | cd8407831091d169677d278d3ad9b5b92600b30a | HappyRay/php-di-generator | generator/generator.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\nfrom subprocess import call\n\nfrom ca import app, db\nfrom ca.models import Request\n\nfor request in Request.query.filter(Request.generation_date == None).all(): # noqa\n... | python | edit | 5 | 1 | mit | 494b628ab57c38335368a1b7a2734c7abafc5277 | freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net | buildcert.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTests for our testing utilities.\n\"\"\"\nfrom itertools import product\nfrom unittest import TestCase\nfrom zipline.utils.test_utils import parameter_space\n\n\nclass TestParameterSpace(TestCase):\n\n x_args = [1, 2]\n y_args... | python | edit | 1 | 1 | apache-2.0 | cbb59747af48ae60473f27b6de976a08a741ab54 | magne-max/zipline-ja,florentchandelier/zipline,Scapogo/zipline,florentchandelier/zipline,bartosh/zipline,wilsonkichoi/zipline,bartosh/zipline,alphaBenj/zipline,wilsonkichoi/zipline,humdings/zipline,humdings/zipline,umuzungu/zipline,alphaBenj/zipline,enigmampc/catalyst,enigmampc/catalyst,magne-max/zipline-ja,quantopian/... | tests/test_test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nfrom bs4 import BeautifulSoup\nfrom source.models.rt_rating import RTRating\n\n\nclass RottenTomatoesService:\n\n __URL = 'http://www.rottentomatoes.com/m/'\n __SEPERATOR = '_'\n\n def __init__(self, title):\n ... | python | edit | 1 | 4 | mit | ce7d3e1da44d9f33474684db674f3a7660587320 | jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu | source/services/rotten_tomatoes_service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2020 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\nclass OwnersClient(object):\n \"\"\"Interact with OWNERS files in ... | python | edit | 3 | 1 | bsd-3-clause | b4f4226d153e993888f6e7429dcc9aca480e680e | CoherentLabs/depot_tools,CoherentLabs/depot_tools | owners_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conans import ConanFile\nfrom conans.tools import download, unzip\nimport os\n\nVERSION = \"0.0.2\"\n\n\nclass IWYUCTargetCmakeConan(ConanFile):\n name = \"iwyu-target-cmake\"\n version = os.environ.get(\"CONAN_VERSION_OVERRIDE\"... | python | edit | 1 | 1 | mit | 68a40f909294c5e2ad6c6bce9f6b7a970d133d21 | polysquare/iwyu-target-cmake,polysquare/include-what-you-use-target-cmake | conanfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport fileinput\n\nweekHours = 0.0\ndayHours = 0.0\n\ndef calcWorkTime(timeIn, timeOut):\n inSplit = timeIn.split(':')\n outSplit = timeOut.split(':')\n hourIn = int(inSplit[0])\n minuteIn = int(inSplit[1])\n hourOut = int(outSplit[0]... | python | edit | 4 | 3 | mit | 98988373899da3541f084e4c893628f028200d8c | NLSteveO/PunchCard,NLSteveO/PunchCard | PunchCard.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\nimport sys\n\n_args = sys.argv\n\nif __name__ == \"__main__\":\n if len(_args) == 4:\n keys_file = _args[1]\n target_file = _args[2]\n result_file = _args[3]\n\n try:\n wit... | python | edit | 1 | 0 | mit | 70245be1a4fbb22d20459383136887f0a9cc2ad4 | maxsocl/oldmailer | passwd_change.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Model for aircraft flights\"\"\"\n\n\nclass Flight:\n def __init__(self, number):\n if not number[:4].isalpha():\n raise ValueError(\"No airline code in '{}'\".format(number))\n\n if not number[:4].isupper(... | python | edit | 1 | 5 | mit | 5adc4a0637b31de518b30bbc662c3d50bc523a5a | kentoj/python-fundamentals | airtravel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright (c) 2014 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\n\"\"\"Run the webpages_playback automation s... | python | edit | 1 | 2 | bsd-3-clause | 52aeb0d37aa903c0189416bbafc2a75ea41f3201 | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Ti... | slave/skia_slave_scripts/do_skps_capture.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Check for errs in the AST.\n\nThe Python parser does not catch all syntax errors. Others, like\nassignments with invalid targets, are caught in the code generation\nphase.\n\nThe compiler package catches some errors in the transforme... | python | edit | 3 | 2 | mit | 36f59422fdf9d7dc76c31b096c3b7f909762109a | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/compiler/syntax.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright 2016 Steven Oud. All rights reserved.\n# Use of this source code is governed by a MIT-style license that can be found\n# in the LICENSE file.\n\nfrom flask import jsonify, Blueprint, abort, request\nfrom... | python | edit | 3 | 2 | mit | cf822ee4994915cf178c6e603e3cc8726cf7fb82 | Proj-P/project-p-api,Proj-P/project-p-api | api/locations/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport code\nimport collections\nimport logging\nimport sys\n\ntry:\n import matplotlib.pyplot as plt\nexcept ImportError:\n plt = None\n\nimport numpy\n\nimport rasterio\n\n\nlogger = logging.getLogger('rasterio')\n\nStats = collec... | python | edit | 4 | 3 | bsd-3-clause | 836fd354037a6aca6898b41a9d62ada31f1ee6ba | clembou/rasterio,brendan-ward/rasterio,kapadia/rasterio,clembou/rasterio,njwilson23/rasterio,perrygeo/rasterio,brendan-ward/rasterio,perrygeo/rasterio,youngpm/rasterio,johanvdw/rasterio,clembou/rasterio,kapadia/rasterio,njwilson23/rasterio,perrygeo/rasterio,youngpm/rasterio,brendan-ward/rasterio,njwilson23/rasterio,joh... | rasterio/tool.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, render_template, url_for, redirect\nfrom flask import session, escape, request\nfrom peewee import *\n#from datetime import date\n\napp = Flask(__name__)\n# http://docs.peewee-orm.com/en/latest/peewee/quickstart.htm... | python | edit | 18 | 1 | mit | 80f046bc851916de05ba90e4dc88b78043961061 | lcdi/Inventory,lcdi/Inventory,lcdi/Inventory,lcdi/Inventory | inventory.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\"\"\"\nMain entry point to run all tests\n\"\"\"\nimport sys\nfrom pathlib import Path\nfrom unittest import TestLoader, TestSuite, TextTestRunner\n\nPATH = Path(__file__).absolute()\n\nsys.path.append(PATH.parents[... | python | edit | 1 | 1 | bsd-3-clause | c4803aca65f05d30285c6b7cad0571cd4baa599b | smartdevicelink/sdl_android | generator/test/runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nclass GenomeException(Exception):\n pass\n\nclass Genome(object):\n def __init__(self, name):\n defaults = {\n \"name\": name,\n \"use_openings_book\": True,\n # Search params\n \"m... | python | edit | 1 | 2 | mit | 957b623ee36aaae7696cdfcbe33bafcd5cd8a42d | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | ai_genome.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom importlib import import_module\nimport json\n\ndef read_component_configuration(path):\n if path.endswith('.json'):\n with open(path) as f:\n config = json.load(f)\n return apply_defaults(config)\n el... | python | edit | 1 | 9 | bsd-3-clause | 6d6e83734d0cb034f8fc198df94bc64cf412d8d6 | ihmeuw/vivarium | ceam/framework/components.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glib\nimport dbus\nfrom dbus.mainloop.glib import DBusGMainLoop\nfrom pyee import EventEmitter\nimport logbook\nlogger = logbook.Logger('connman-dispatcher')\n\n__all__ = ['detector']\n\n\ndef property_changed(_, message):\n if me... | python | edit | 1 | 5 | isc | 5a6b19f956dfde65a1d8316fd4bebe4697846e45 | a-sk/connman-dispatcher | connman_dispatcher/detect.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\nclass URLResources(object):\n PROJECT = \"/project/\"\n FIELD = \"/field/\"\n INDEX = \"/index/\"\n QUERY_COUNT_ENTITY = \"/query/count/entity/\"\n QUERY_COUNT_ENTITY_TOTAL ... | python | edit | 1 | 0 | mit | cc92850fd6ebe5adc4064df1956377bb4f9aa30c | SlicingDice/slicingdice-python | pyslicer/url_resources.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom rest_framework import status\nfrom rest_framework.exceptions import APIException, ParseError\n\n\ndef json_api_exception_handler(exc, context):\n \"\"\" Custom exception handler that returns errors object as an array \"\"\"\n\n ... | python | edit | 1 | 9 | apache-2.0 | 5e7d73215d17aa52b6aae4dbb1d8e369d785b31d | SSJohns/osf.io,haoyuchen1992/osf.io,felliott/osf.io,danielneis/osf.io,icereval/osf.io,samchrisinger/osf.io,sloria/osf.io,ZobairAlijan/osf.io,mluke93/osf.io,alexschiller/osf.io,ticklemepierce/osf.io,GageGaskins/osf.io,acshi/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,doublebits/osf.io,njantrania/osf.io,kch8... | api/base/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom django.conf import settings\nfrom phonenumber_field.modelfields import PhoneNumberField\n\nfrom whats_fresh.models import *\nfrom django.contrib.gis.db import models\n\nimport os\nimport time\nimport s... | python | edit | 12 | 2 | apache-2.0 | df6cba06091132065dcbc571fa48a84cb5b11775 | osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api | project_fish/whats_fresh/tests/test_image_model.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport itertools\n\nfrom django.db import models\n\nimport amo\nfrom translations.fields import TranslatedField\nfrom translations.models import Translation\n\n\nclass Review(amo.ModelBase):\n\n version = models.ForeignKey('versions.Vers... | python | edit | 1 | 5 | bsd-3-clause | 53aecfed27a01ea3ae44f87e9223260c735c82c6 | Prashant-Surya/addons-server,andymckay/zamboni,elysium001/zamboni,eviljeff/zamboni,eviljeff/zamboni,lavish205/olympia,psiinon/addons-server,mozilla/olympia,andymckay/olympia,wagnerand/addons-server,tsl143/zamboni,kumar303/olympia,andymckay/addons-server,jbalogh/zamboni,wagnerand/zamboni,crdoconnor/olympia,Revanth47/add... | apps/reviews/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.urls import path\n\nfrom . import views\n\napp_name='ddcz'\n\nurlpatterns = [\n path('', views.index, name='news'),\n path('rubriky/<creative_page_slug>/', views.common_articles, name='common-article-list'),\n path('rub... | python | edit | 1 | 0 | mit | 8da134823a56567e09a09aefc44837a837644912 | dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard | ddcz/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport pyqtgraph as pg\n\npg.mkQApp()\n\n\ndef test_fft():\n f = 20.\n x = np.linspace(0, 1, 1000)\n y = np.sin(2 * np.pi * f * x)\n pd = pg.PlotDataItem(x, y)\n pd.setFftMode(True) \n x, y = pd.getD... | python | edit | 1 | 1 | mit | 7b9ba8634c0a02cb4c82313d9bef3197640c3187 | campagnola/acq4,pbmanis/acq4,meganbkratz/acq4,acq4/acq4,meganbkratz/acq4,acq4/acq4,pbmanis/acq4,acq4/acq4,pbmanis/acq4,meganbkratz/acq4,acq4/acq4,meganbkratz/acq4,campagnola/acq4,campagnola/acq4,pbmanis/acq4,campagnola/acq4 | pyqtgraph/graphicsItems/tests/test_PlotDataItem.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyjsparser\nfrom space import Space\nimport fill_space\nfrom byte_trans import ByteCodeGenerator\nfrom code import Code\nfrom simplex import MakeError\nimport sys\nsys.setrecursionlimit(100000)\n\n\npyjsparser.parser.ENABLE_JS2PY_ERR... | python | edit | 2 | 1 | mit | 7a3a1ffc6c153e4ea867988d12725f92d133ffc4 | PiotrDabkowski/Js2Py,PiotrDabkowski/Js2Py,PiotrDabkowski/Js2Py | js2py/internals/seval.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport functools\n\nfrom django.conf import settings\nfrom django.test import Client, TestCase\n\n__all__ = ['JsonTestClient', 'JsonTestMixin', 'JsonTestCase']\n\n\nclass JsonTestClient(Client):\n def _json_request(self, met... | python | edit | 1 | 6 | bsd-2-clause | b30be4ee2a9e7c656e78fd34c9b59a1653bed1a2 | fusionbox/django-argonauts | argonauts/testutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom chainer.functions.activation.elu import elu\n\n\ndef selu(x,\n alpha=1.6732632423543772848170429916717,\n scale=1.0507009873554804934193349852946):\n \"\"\"Scaled Exponential Linear Unit function.\n\n For paramete... | python | edit | 1 | 1 | mit | d3ee9e437d8fb0b35a5eb2df4ad0c2ba5127f39b | hvy/chainer,niboshi/chainer,pfnet/chainer,kashif/chainer,ktnyt/chainer,jnishi/chainer,chainer/chainer,ronekko/chainer,wkentaro/chainer,hvy/chainer,wkentaro/chainer,chainer/chainer,wkentaro/chainer,rezoo/chainer,tkerola/chainer,okuta/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,jnishi/chainer,niboshi/chainer,... | chainer/functions/activation/selu.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# path to ckan config file\nCKAN_CONFIG = '/home/okfn/pyenv/src/ckan/ckan.ini'\n\n# directory to save downloaded files to\nARCHIVE_DIR = '/tmp/archive'\n\n# Use this user name when requesting data from ckan\nARCHIVE_USER = u'okfn_maintenanc... | python | edit | 1 | 0 | mit | 347681637c7c9d28ba1c787bb77da1296a02d13f | ckan/ckanext-archiver,ckan/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,ckan/ckanext-archiver,datagovuk/ckanext-archiver,datagovuk/ckanext-archiver,datagovuk/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver | ckanext/archiver/default_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.forms import widgets\n\n#JS_URL is the url to the filepicker.io javascript library\nJS_VERSION = 1\nJS_URL = \"//api.filepicker.io/v%d/filepicker.js\" % (JS_VERSION)\n\nif hasattr(settings, 'FIL... | python | edit | 1 | 2 | mit | a103968558963c032db7294ed15560429861550d | filepicker/filepicker-django,filepicker/filepicker-django,FundedByMe/filepicker-django,FundedByMe/filepicker-django | django_filepicker/widgets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nlog of integration tests to write:\n\nwrite test_switch_branches_restarts_containers\n\ncommand:\n docker-compose up -d (in a directory with appropriate docker-compose.yml file)\nexpected behaviour:\n docker containers are sta... | python | edit | 1 | 0 | apache-2.0 | 4be85164344defc9d348594a26c4dab147a8de4a | ClusterHQ/dvol,ClusterHQ/dvol,ClusterHQ/dvol | dvol/test_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass APIError(Exception):\n pass\n\n\nclass ImproperlyConfigured(Exception):\n pass\n\n\nclass ValidationError(Exception):\n pass\n\n```\n\nApply this change: Return formatted messages in APIError"
},
{
"role": "assistant"... | python | edit | 1 | 1 | mit | 2ceb4f7195220d52ce92156da9332b50369fb746 | justyoyo/bluesnap-python,kowito/bluesnap-python,justyoyo/bluesnap-python,kowito/bluesnap-python | bluesnap/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom os.path import dirname, abspath\n\nsys.path.insert(0, dirname(dirname(abspath(__file__))))\n\nfrom django.conf import settings\n\nsettings.configure()\n\nproject = 'django-slack'\nversion = ''\nrelease = ''\ncopyright = '... | python | edit | 1 | 0 | bsd-3-clause | 0b122d1d4223844c1e53ce68b00a0cdb1e360573 | lamby/django-slack | docs/conf.py | rejected_duplicate | Near-duplicate of sample 12100 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom backend.app import app, db\nfrom backend.models import *\nfrom flask import url_for\n\n# read in json redirect dump\nwith open('data/prod_url_alias.json', 'r') as f:\n\n redirects = json.loads(f.read())\n\nprint len(red... | python | edit | 5 | 0 | apache-2.0 | 2402afe296191d3fddc98212564fb0158cfdcb51 | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | upload_redirects.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom aospy.run import Run\n\n\ntest_am2 = Run(\n name='test_am2',\n description=(\n 'Preindustrial control simulation.'\n ),\n data_in_direc=('/archive/Yi.Ming/sm2.1_fixed/'\n 'SM2.1U_Control-1860_lm2_ai... | python | edit | 1 | 0 | apache-2.0 | e6d6b39a2ec03c992f450fd99b42122bc5d9249f | spencerkclark/aospy,spencerahill/aospy | aospy/test/test_objs/runs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import listdir\nfrom os.path import abspath, isfile, join, splitext\n\n# C, C++, Obj-C, & Obj-C++\nSOURCE_EXTENSIONS = ('.h', '.hh', '.hpp', '.c', '.cpp', '.cxx', '.m', '.mm')\n\n\nclass SourceFile(object):\n \"\"\" A simple obje... | python | edit | 1 | 4 | unlicense | e8a0e7c3714445577851c5a84ecf7a036937725a | jwiggins/clang-corpus,jwiggins/clang-corpus,jwiggins/clang-corpus | clang_corpus/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom groupy import utils\n\n\nclass Manager:\n \"\"\"Class for interacting with the endpoint for a resource.\n\n :param session: the requests session\n :type session: :class:`~groupy.session.Session`\n :param str path: path rela... | python | edit | 1 | 2 | apache-2.0 | 1a761c9360f185d6bd07be9f16ea2cfa239f4bdd | rhgrant10/Groupy | groupy/api/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom collections import OrderedDict\nfrom .command import ShellCommand\nfrom .settings import FormatterSettings\n\n\nclass Formatter():\n def __init__(self, name, command=None, args=None, formatter=None):\n self.__nam... | python | edit | 1 | 2 | mit | a7311b1cd9a184af2a98130ba288157f62220da1 | Rypac/sublime-format | src/formatter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import date as vanilla_date\nfrom dates.base import BasicBCEDate\n\nfirst_julian_date = BasicBCEDate(-45, 1, 1)\n\nfirst_vanilla_date = vanilla_date(1, 1, 1)\nlast_vanilla_date = vanilla_date(9999, 12, 31)\n\njulian_day_number... | python | edit | 1 | 0 | apache-2.0 | 8626733d3a4960013189ffa90fe8e496dd8cc90a | jwg4/calexicon,jwg4/qual | calexicon/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport platform\n\nif platform.system() == 'Darwin':\n if os.environ.get('LINUX_WITHOUT_DBUS', '0') == '0':\n from .gatt_linux import *\n else:\n from .gatt_stubs import *\nelse:\n # TODO: Add support for m... | python | edit | 4 | 0 | mit | 195f4d25bdf30f355d029697675481ba3193ad77 | getsenic/gatt-python | gatt/gatt.py | rejected_lint | Too many lint violations: 4 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.