messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Write python code for the following: Change to a better shebang"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nfrom app import telomere\ntelomere.run(host='0.0.0.0', debug=True)\n\n"
}
] | python | new_file | 1 | 0 | mit | 755d8f6438ac8f7c3da6c5959e54915e7835b483 | rabramley/telomere,rabramley/telomere,rabramley/telomere | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom slacker import Slacker\nfrom blackbelt.config import config\n\nclass Slack(object):\n def __init__(self, token=None):\n if not token:\n token = config['slack']['access_token']\n slack = Slacker(token)\n ... | python | edit | 1 | 3 | mit | abe1f4fbc846b51f1069f3e7da48524876f2caf6 | apiaryio/black-belt | blackbelt/slack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom discord import app_commands\nfrom discord.ext import commands\n\nimport logging\nimport sys\nimport traceback\n\nimport sentry_sdk\n\n\nclass CommandTree(app_commands.CommandTree):\n\n async def on_error(self, interaction, error):... | python | edit | 1 | 6 | mit | d4f8746f6423c528009f02a4bdc193b311ccfd23 | Harmon758/Harmonbot,Harmon758/Harmonbot | Discord/tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\n\nfrom admin.desk import views\n\nurlpatterns = [\n url(r'^$', views.DeskCaseList.as_view(), name='cases'),\n url(r'^customer/(?P<user_id>[a-z0-9]+)/$', views.DeskCustomer.as_view(),\n name='cu... | python | edit | 1 | 0 | apache-2.0 | c87f75334aa7253ad209bdd4d88c2429723e51d1 | hmoco/osf.io,aaxelb/osf.io,laurenrevere/osf.io,pattisdr/osf.io,caneruguz/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,chrisseto/osf.io,cwisecarver/osf.io,mfraezz/osf.io,monikagrabowska/osf.io,leb2dg/osf.io,acshi/osf.io,crcresearch/osf.io,alexschiller/os... | admin/desk/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014 Wieland Hoffmann\n# License: MIT, see LICENSE for details\nfrom mbdata import models\nfrom . import modelext\nfrom .searchentities import SearchEntity as E, SearchField as F\n\n\nSearchRecording = E(modelext.CustomRecor... | python | edit | 3 | 0 | mit | 3d1edf98284979ae8eade5804e44fb312bece1b0 | jeffweeksio/sir | sir/schema/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pic import Picture\nfrom path import Path\nimport argparse, json\nparser = argparse.ArgumentParser(\n description=\n \"Process the picture or the directory, given the json config file\")\nparser.add_argument(\"path\", help=\"Path... | python | edit | 4 | 3 | mit | 93ea521678c283d8211aed9ca88db6c5dc068362 | Dixneuf19/fuzzy-octo-disco | process_pic.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\nimport os\n\n\ndef where():\n \"\"\"\n Return the installation location of BrewData\n \"\"\"\n f = os.path.split(__file__)[0]\n return os.path.abspath(f)\n\n\ndef cereals():\n return(os.path.join(w... | python | edit | 1 | 1 | mit | 8a966a2cf96009d078ee0ba6fa020e2de782ae7a | chrisgilmerproj/brewdata,chrisgilmerproj/brewdata | brewdata/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Common services code\"\"\"\n\n\nfrom datetime import datetime\nimport importlib\n\nAVAILABLE_SERVICES = ['habit_list', 'idonethis', 'nikeplus']\nSERVICES_PKG = 'dayonetools.services'\n\ndef get_service_module(service_name):\n \"\"\... | python | edit | 1 | 1 | mit | 3141b73ddeb14184062ab5ff4436ebb87de02253 | durden/dayonetools | dayonetools/services/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_login import current_user\n\nfrom app.brain.user_management.change_password_result import ChangePasswordResult\nfrom app.brain.utilities import hash_password\n\n\nclass AccountUpdater(object):\n @staticmethod\n def change_p... | python | edit | 1 | 4 | mit | 4218d2a4d711f5a516423b1f4aa2685fc5a456b3 | pbraunstein/trackercise,pbraunstein/trackercise,pbraunstein/trackercise,pbraunstein/trackercise,pbraunstein/trackercise | app/brain/user_management/account_updater.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\nimport _pybinding\nfrom .results import LDOSpoint\n\n__all__ = ['Greens', 'make_kpm']\n\n\nclass Greens:\n def __init__(self, impl: _pybinding.Greens):\n self.impl = impl\n\n def calc_ldos(self, energy: np... | python | edit | 1 | 1 | bsd-2-clause | 88238ca8a0c3169e9350434ecd517eafdb118b88 | dean0x7d/pybinding,MAndelkovic/pybinding,MAndelkovic/pybinding,dean0x7d/pybinding,MAndelkovic/pybinding,dean0x7d/pybinding | pybinding/greens.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom ..layer import Layer\n\n\ndef color_category_layer(source, value, top=11, palette='bold', title='', othersLabel='Others'):\n return Layer(\n source,\n style={\n 'poi... | python | edit | 1 | 3 | bsd-3-clause | d7b89cf5e8a0102034b0d9ed7f28fbe7fb0bc167 | CartoDB/cartoframes,CartoDB/cartoframes | cartoframes/viz/helpers/color_category_layer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"This module contains functions for making plots relevant to regressors.\"\"\"\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ ... | python | edit | 1 | 1 | isc | 63cf6f6228490c9944711106cd134254eafac3ca | nsh87/regressors | regressors/plots.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python\n# Code Fights Sum Up Problem\n\nimport re\n\n\ndef sumUpNumbers(inputString):\n return sum([int(n) for n in re.findall(r'\\d+', inputString)])\n\n\ndef main():\n tests = [\n [\"2 apples, 12 oranges\", 1... | python | edit | 1 | 3 | mit | 46d2b85e7df1b8e247a9ab09ea390de15cc84fb6 | HKuz/Test_Code | CodeFights/sumUpNumbers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom PyOpenWorm import *\n\n\nclass Plot(DataObject):\n \"\"\"\n Object for storing plot data in PyOpenWorm.\n\n Must be instantiated with a 2D list of coordinates.\n \"\"\"\n\n def __init__(self, data=False, *args, **kwargs)... | python | edit | 4 | 2 | mit | 7e71e011fc4266b1edf21a0028cf878a71ab23fe | gsarma/PyOpenWorm,openworm/PyOpenWorm,openworm/PyOpenWorm,gsarma/PyOpenWorm | PyOpenWorm/plot.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nimport os\nimport shutil\n\nclient_id = '' # Imgur application Client ID, fill this in.\ndirectory_name = 'Imgur Albums\\\\' # Directory for the images to be stored\n\n\ndef scrape(album_id):\n ''' (str) -> list of str... | python | edit | 1 | 5 | mit | c39e824119498fb6d669367fb53249b609edbaf2 | kevinleung987/Imgur-Album-Scraper | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom filter import FilterException\nfrom common import PluginType\nfrom yapsy.IPlugin import IPlugin\nimport logging\n\n\nclass DepthFilter(IPlugin):\n\n category = PluginType.FILTER\n id = \"depth\"\n\n def __init__(self):\n ... | python | edit | 1 | 3 | mit | 6059bff12c159fbe43e789c4b55fe5eb012517e9 | eghuro/crawlcheck | src/checker/plugin/filters/depth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport threading\nimport select\n\n\nclass Client(object):\n def __init__(self, sock, address, host):\n self.socket = sock\n self.server = host\n self.address = address\n self.connected = True\n self.ex... | python | edit | 1 | 4 | mit | 8f84ce069159cb7d0dfb95a2a28f992a8a4f3556 | Mariusz-v7/WebSocketServer-Python- | client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ftplib\r\nimport ntpath\r\nimport logging\r\nimport urllib.parse\r\nimport win32clipboard\r\n\r\nclass FileUploader:\r\n \r\n def __init__(self, config):\r\n self._host = config['Server']['host']\r\n self._user =... | python | edit | 1 | 3 | mit | dfca6054fd32c0904bc027dcddb347c378adf954 | yschua/dumper | dumper/file_uploader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Screen size\nWIDTH = 320\nHEIGHT = 240\nSCREEN_SIZE = (WIDTH, HEIGHT)\n\n# Update delay in ms\nDELAY = 100\n\nALIVE_IMG_PATH=\"data/alive.png\"\nDEAD_IMG_PATH=\"data/dead.png\"\nCURSOR_DEAD_IMG_PATH=\"data/cursor.png\"\nCURSOR_ALIVE_IMG_P... | python | edit | 1 | 0 | mit | 2dde683b0a43a6339e446e37aab2726aaca65d83 | dzeban/PyGameOfLife | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom telnetlib import Telnet\nimport time\ntn = Telnet('192.168.1.15', 13666, None)\n\n#tn.interact()\n\ntn.write(\"hello\\n\")\ntn.write(\"screen_add s1\\n\")\ntn.write(\"screen_set s1 -priority 1\\n\")\ntn.write(\"widget_add s1 w1 string\... | python | edit | 1 | 4 | mit | 93b1f8e67b1154fd595a938ca41877eb76c7e995 | zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie | lcd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pydirections.director import Director\nfrom unittest import TestCase\n\nclass TestModeValidity(TestCase):\n\tdef test_invalid_mode(self):\n\t\t\"\"\"\n\t\t Tests the is_valid_mode function for an invalid input\n\t\t\"\"\"\n\t\tdefau... | python | edit | 3 | 1 | apache-2.0 | 61c6c2687af9de1d5ccded1f1cb866a7638d8c31 | apranav19/pydirections | tests/test_director.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#$HeadURL$\r\n#$LastChangedDate$\r\n#$LastChangedRevision$\r\nimport sys\r\nfrom reportlab.platypus import PageBreak, Spacer\r\nfrom flowables import *\r\nimport shlex\r\nfrom log import log\r\n\r\ndef parseRaw (data):\r\n '''Parse and p... | python | edit | 9 | 6 | mit | b4cefb5f1a5541b9b7312878790f6fe65412e010 | rafaelmartins/rst2pdf,rafaelmartins/rst2pdf | rst2pdf/utils.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nMISSING_CORPUS_MESSAGE = \"\"\"\nLooks like you are missing some required data for this feature.\n\nTo download the necessary data, simply run\n\n curl https://raw.github.com/sloria/TextBlob/master/download_cor... | python | edit | 1 | 1 | mit | a3330105ca36ec758723e2f456ed56e107afec9e | adelq/TextBlob,IrisSteenhout/TextBlob,freakynit/TextBlob,beni55/TextBlob,dipeshtech/TextBlob,sloria/TextBlob,nvoron23/TextBlob,jonmcoe/TextBlob,sargam111/python,jcalbert/TextBlob,Windy-Ground/TextBlob,laugustyniak/TextBlob | textblob/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom livestreamer.exceptions import NoStreamsError\nfrom livestreamer.plugin import Plugin\nfrom livestreamer.stream import HLSStream\nfrom livestreamer.utils import urlget, parse_json\n\nimport re\n\nclass DMCloud(Plugin):\n\n @classmet... | python | edit | 1 | 6 | bsd-2-clause | 529e2b54ed90ab215facb8d8c35d708253b0a6d4 | flijloku/livestreamer,gtmanfred/livestreamer,blxd/livestreamer,beardypig/streamlink,back-to/streamlink,lyhiving/livestreamer,Dobatymo/livestreamer,Saturn/livestreamer,bastimeyer/streamlink,derrod/livestreamer,hmit/livestreamer,chhe/livestreamer,wolftankk/livestreamer,sbstp/streamlink,wlerin/streamlink,bastimeyer/stream... | src/livestreamer/plugins/dmcloud.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nimport textwrap\n\nimport html2text\n\ntext_maker = html2text.HTML2Text()\ntext_maker.body_width = 0\n\n\ndef strip_html_tags(text):\n return re.sub('<[^<]+?>', '', text)\n\n\ndef html_to_md(string, strip_html=True, markdown=F... | python | edit | 1 | 4 | mit | be1e23f068fbc34587caa0a796e259e42ed6f7c6 | avinassh/Laozi,avinassh/Laozi | utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom rest_framework import serializers\nfrom roledb.models import User\n\n\nclass UserSerializer(serializers.ModelSerializer):\n roles = serializers.SerializerMethodField('role_data')\n attributes = serializers.SerializerMethodField('at... | python | edit | 1 | 2 | mit | f43248112a867bc819ced274901db25cebe397b7 | educloudalliance/eca-auth-data,educloudalliance/eca-auth-data | roledb/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport builtins\nimport operator\nimport functools\n\nfrom ..compile import varary\n\n\nbuiltins.__dict__.update({\n # Runtime counterparts of some stuff in `Compiler.builtins`.\n '$': lambda f, *xs: f(*xs)\n , ':': lambda f, *xs: f(... | python | edit | 1 | 0 | mit | 94ec32865674f9f9b0dcecafec73d1e2930ccfdb | pyos/dg | runtime/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add API wrapper to saltapi"
},
{
"role": "assistant",
"content": "'''\nMake api awesomeness\n'''\n\n# Import python libs\n#\n# Import Salt libs\nimport salt.utils\nimport salt.client\nimport salt.runner\n\nclass API(object):\n ... | python | new_file | 7 | 3 | apache-2.0 | 3bade9d6258fb8df849b32f68de6343cfdd83720 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | saltapi/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom search.searchers.instagram import MediaSearchInstagram\nfrom search.searchers.vkontakte import MediaSearchVK\nfrom search.searchers.youtube import MediaSearchYouTube\nfrom search.searchers.podacisearcher import DocumentSearchPodaci\nfr... | python | edit | 1 | 0 | mit | 9299b8216c809e795af5f22457fe7c9b615195bb | occrp/id-backend | search/searchers/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nd = dict.fromkeys([1, 2, 3, 4])\nl = list(d.keys())\nl.sort()\nprint(l)\n\nd = dict.fromkeys([1, 2, 3, 4], 42)\nl = list(d.values())\nl.sort()\nprint(l)\n\n\n```\n\nApply this change: tests/basics: Add test for dict.fromkeys where arg is a ... | python | edit | 1 | 0 | mit | a31a3a9fd5f9f26bc9e06b7c682a9544f71806ad | AriZuu/micropython,toolmacher/micropython,deshipu/micropython,infinnovation/micropython,swegener/micropython,adafruit/micropython,adafruit/micropython,TDAbboud/micropython,torwag/micropython,hiway/micropython,MrSurly/micropython,TDAbboud/micropython,trezor/micropython,cwyark/micropython,swegener/micropython,pozetroninc... | tests/basics/dict_fromkeys.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Configuration file for the Sphinx documentation builder.\n#\n# For the full list of built-in configuration values, see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n# -- Project information -------... | python | edit | 3 | 0 | mit | a9b225d033d0462f47e4adecef2ef90fc0bf2318 | galaxyproject/gravity | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom twisted.python import usage\n\nfrom ooni.resources import __version__\nfrom ooni.resources import update\n\n\nclass Options(usage.Options):\n synopsis = \"\"\"%s\"\"\"\n\n optParameters = []\n\n def opt_version(s... | python | edit | 5 | 3 | bsd-2-clause | ceef52c348bb3f4477c3d031d024c89eb7379039 | Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,lor... | ooni/resources/cli.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom django.views.generic import TemplateView\n\n\nurlpatterns = patterns(\n '',\n url(r'^$',\n TemplateView.as_view(\n template_name='soapboxtest/test_success.html')),\n ... | python | edit | 1 | 0 | bsd-3-clause | 8dd41fab9a43ef43d5f2dc27e11bdbda3c23bc56 | ubernostrum/django-soapbox,ubernostrum/django-soapbox | soapbox/tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis module contains the logic which returns the set of\nschedulers to use for the build master.\n\"\"\"\n\nfrom buildbot.changes.filter import ChangeFilter\nfrom buildbot.schedulers.basic import SingleBranchScheduler\n\ndef get_sch... | python | edit | 1 | 1 | mit | 9ee301c525600cfeb8b8ca3d59f75ff9b7823008 | zsjohny/vagrant,bheuvel/vagrant,lonniev/vagrant,dharmab/vagrant,petems/vagrant,tjanez/vagrant,senglin/vagrant,benh57/vagrant,lonniev/vagrant,tomfanning/vagrant,cgvarela/vagrant,gpkfr/vagrant,krig/vagrant,philoserf/vagrant,philwrenn/vagrant,modulexcite/vagrant,tschortsch/vagrant,bmhatfield/vagrant,mitchellh/vagrant,tbar... | test/buildbot/buildbot_config/master/schedulers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n'Dusk' command system for Amethyst.\nBased loosely (heh) off of discord.py's ext command system.\n\nTODO: refactor arg parsing probably.\n\"\"\"\n\nfrom .context import Context # NOQA\nfrom .command import * # NOQA\nfrom .command_... | python | edit | 1 | 0 | mit | 69e6db7a4a28ff1f50bd4f12f550a2b65f05eb38 | awau/Amethyst,HexadecimalPython/Xeili | utils/dusk/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Use x, y coords for unit positions\n# (97, 56) ... (104, 56)\n# ... ...\n# (97, 49) ... (104, 49)\n#\n# Algebraic notation for a position is:\n# algebraic_pos = chr(x) + chr(y)\n\n\ndef _coord_to_algebraic(coord):\n x, y = ... | python | edit | 1 | 3 | mit | 9cc3cf8a2911fedce7f08d2412388154c24a9ed1 | EyuelAbebe/gamer,EyuelAbebe/gamer | engine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\ndef LU(A):\n m = A.shape[0]\n U = A.copy()\n L = np.eye( m )\n for j in range(m):\n for i in range(j+1,m):\n L[i,j] = U[i,j]/U[j,j]\n U[i,:] -= L[i,j]*U[j,:]\n\n return L, U... | python | edit | 1 | 3 | bsd-2-clause | 3784b04109b2ca92633a788cc02562898064282c | ketch/rock-solid-code-demo | factor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\nimport os\n\ndef get_hash(path):\n\treturn get_md5(path)\n\ndef get_md5(path):\n\thash_md5 = hashlib.md5()\n\tif os.path.isfile(path):\n\t\twith open(path, \"rb\") as file:\n\t\t\twhile True:\n\t\t\t\tbuffer = file.read(4096... | python | edit | 1 | 4 | mit | 727939269aef168513ad6d62913e20f0af95b4e6 | messiasthi/dduplicated-cli | dduplicated/hashs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\n\nos.environ[\"QT_PREFERRED_BINDING\"] = \"PySide\"\nfrom Qt import QtWidgets, load_ui\n\n\ndef setup_ui(uifile, base_instance=None):\n ui = load_ui(uifile)\n if not base_instance:\n return ui\n else:\... | python | edit | 4 | 5 | mit | e26a49220835cd3df14820be7b400dc045092bb9 | mottosso/Qt.py,fredrikaverpil/Qt.py,mottosso/Qt.py,fredrikaverpil/Qt.py | examples/load_ui_base_instance.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport requests\nimport requests_mock\nimport unittest\n\nfrom .. import Client\n\n@requests_mock.Mocker()\nclass TestClient(unittest.TestCase):\n \"\"\"Tests the Acquia Cloud API client class.\"\"\"\n\n req = None\n\n \... | python | edit | 4 | 1 | mit | 36213a31a1870cf38ec0ce3d208c6a2072e2b133 | skwashd/python-acquia-cloud | acapi/tests/test_client.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom celery.schedules import crontab\nfrom celery.task import periodic_task\nfrom django.utils.timezone import now\n\nfrom bluebottle.clients.models import Client\nfrom bluebottle.clients.utils import LocalTenant\nimport logging\n\nfrom blu... | python | edit | 1 | 3 | bsd-3-clause | d5d2bff8ad68f6a3d743d9eb80b26d6d0bba4a0f | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/events/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_create_template\n--------------------\n\"\"\"\n\n\nimport os\nimport pytest\nimport subprocess\n\n\ndef run_tox(plugin):\n \"\"\"Run the tox suite of the newly created plugin.\"\"\"\n try:\n ... | python | edit | 1 | 2 | mit | 1975b33b5f251198b59a772a38b6302fbea89017 | pytest-dev/cookiecutter-pytest-plugin | tests/test_create_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"imagersite URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from my_app ... | python | edit | 1 | 0 | mit | 07517c43b3d61431e8c7c40ea5e8b545b353bee4 | jesseklein406/django-imager,jesseklein406/django-imager,jesseklein406/django-imager | imagersite/imagersite/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nSystem information for Tmux status line\n\nAuthor: Roman Belikin roman[dot]sstu[at]gmail.com\n\n\"\"\"\n\nimport os\nimport sys\nimport psutil\n\ndef info():\n mem = psutil.virtual_memory()\n return \"... | python | edit | 2 | 2 | mit | 6226d620078089b961fa2782d1bddb99534485ba | emmit8/dotfiles,emmit8/dotfiles,emmit8/dotfiles,trippyroman/dotfiles,trippyroman/dotfiles,trippyroman/dotfiles | bin/system-info.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom lib.version import AMON_VERSION\nfrom lib.keybase import KeybaseUser\nfrom lib.gmail import GmailUser\nfrom lib.addresses import AddressBook\nimport lib.gpg as gpg\n\nimport sys\nimport logging\nimport json\nfrom PyQt4 import QtGui\n\n... | python | edit | 6 | 1 | unlicense | ee24b8b57bc73947cd5140aca15389861b33ab00 | CodingAnarchy/Amon | gui/qt.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, print_function\n\nfrom . import _arrayprint\nfrom ...datadescriptor import RemoteDataDescriptor\n\n\ndef array_repr(a):\n # TODO: create a mechanism for data descriptor to override\n #... | python | edit | 1 | 2 | bsd-3-clause | fb1a5f892e684143cd254447b5e1607a4b9e2c03 | xlhtc007/blaze,cowlicks/blaze,alexmojaki/blaze,FrancescAlted/blaze,maxalbert/blaze,mrocklin/blaze,dwillmer/blaze,ContinuumIO/blaze,nkhuyu/blaze,jdmcbr/blaze,jcrist/blaze,FrancescAlted/blaze,aterrel/blaze,AbhiAgarwal/blaze,AbhiAgarwal/blaze,alexmojaki/blaze,mwiebe/blaze,dwillmer/blaze,AbhiAgarwal/blaze,maxalbert/blaze,j... | blaze/io/_printing/array_repr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\nclass Factory(object):\n\n def __init__(self, generator, roi):\n\n self.generator = generator\n self.roi = roi\n\n def iterator(self):\n\n for point in self.generator.iterator():\n if self.roi.conta... | python | edit | 1 | 3 | apache-2.0 | eb606f58b695dbb215b46cec3c895045e811bbad | dls-controls/scanpointgenerator | scanpointgenerator/maskedgenerator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nimport logging\nfrom pythonjsonlogger import jsonlogger\n\nfrom flumine import FlumineBacktest, clients\nfrom strategies.lowestlayer import LowestLayer\n\nlogger = logging.getLogger()\n\ncustom_format = \"%(asctime) %(levelname... | python | edit | 1 | 0 | mit | 7dced29bcf8b2b5f5220f5dbfeaf631d9d5fc409 | liampauling/flumine | examples/backtest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nclass loader:\n modules = {};\n\n def __init__(self):\n self.load_modules();\n\n def load_modules(self, path=\"./modules/\"): # Consider adding recursive sorting at some point in the future\n names = os.l... | python | edit | 1 | 4 | bsd-2-clause | 861d4f9773193a03d1f53c6e0c3f78d48b096d45 | halfbro/juliet | juliet_importer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport sys\nimport os\nsys.path.append('hooks/')\nimport subprocess\nfrom charmhelpers.core.hookenv import action_fail\nfrom utils import (\n pause_unit,\n resume_unit,\n)\n\ndef pause(args):\n \"\"\"Pause the ... | python | edit | 3 | 3 | apache-2.0 | 99592279585c27ad2c41f50d49c1e3264173eae6 | CanonicalBootStack/charm-hacluster,CanonicalBootStack/charm-hacluster,CanonicalBootStack/charm-hacluster | actions/actions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport json\nimport feedparser\nfrom bs4 import BeautifulSoup\n\nFEED_URL = 'http://g1.globo.com/dynamo/rss2.xml'\n\ndef cleanHtml(html):\n return BeautifulSoup(html, 'lxml').get_text()\n\nfp = feedparser.parse(FEE... | python | edit | 3 | 0 | apache-2.0 | 16945303e5092bbd37f914ea10936d95e054f703 | fabriciojoc/redes-sociais-web,fabriciojoc/redes-sociais-web | harvesting_blog_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWSGI config for api 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.8/howto/deployment/wsgi/\n\"\"\"\nfrom web... | python | edit | 1 | 0 | apache-2.0 | bb045a6be1deacb1ee1c0e8746079ae77ec906f0 | caseyrollins/osf.io,mattclark/osf.io,Nesiehr/osf.io,acshi/osf.io,laurenrevere/osf.io,pattisdr/osf.io,cwisecarver/osf.io,acshi/osf.io,felliott/osf.io,felliott/osf.io,adlius/osf.io,pattisdr/osf.io,Nesiehr/osf.io,erinspace/osf.io,cslzchen/osf.io,chennan47/osf.io,crcresearch/osf.io,HalcyonChimera/osf.io,felliott/osf.io,Joh... | admin/base/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom aiodownload import AioDownloadBundle, AioDownload\nimport asyncio\n\n\ndef one(url, download=None):\n\n return [s for s in swarm([url], download=download)][0]\n\n\ndef swarm(urls, download=None):\n\n re... | python | edit | 1 | 7 | mit | 9c2951d794bb27952606cae77da1ebcd0d651e72 | jelloslinger/aiodownload | aiodownload/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nimport config\n\ndef get_recommended_versions():\n return request(\"/versions\")\n\ndef get_experiments():\n return request(\"/experiments\")\n\ndef get_results():\n return request(\"/results\")\n\ndef get_clients(... | python | edit | 2 | 2 | mit | 7da1326848cba8ff7bf61dde4583a12e5bad8ae2 | JASONews/centinel,iclab/centinel,lianke123321/centinel,lianke123321/centinel,Ashish1805/centinel,rpanah/centinel,rpanah/centinel,ben-jones/centinel,iclab/centinel,lianke123321/centinel,iclab/centinel,rpanah/centinel | centinel/backend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Local workflow executor\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nimport shlex\nimport subprocess\n\nfrom django.conf import settings\n\nfrom .local import FlowExecutor as ... | python | edit | 1 | 2 | apache-2.0 | 5225392a305e8e83a5a0fae91d3c2090914f2e5c | jberci/resolwe,jberci/resolwe,genialis/resolwe,genialis/resolwe | resolwe/flow/executors/docker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport core.provider.authentication as authentication\nimport core.notify.dispatcher as notify\nimport core.notify.plugins.available.changes as changes\nimport core.provider.storage as storage\nimport core.resource.base as resource\nimport ... | python | edit | 1 | 4 | mit | 633f84411e26201233e3c68c584b236363f79f62 | slaff/attachix,slaff/attachix,slaff/attachix | server/conf/vhosts/available/token.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file is exec'd from settings.py, so it has access to and can\n# modify all the variables in settings.py.\n\n# If this file is changed in development, the development server will\n# have to be manually restarted because changes will n... | python | edit | 1 | 0 | apache-2.0 | d0bea0fa49eb6c70f4c014d210fddf3a3a500ce6 | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | ci/testsettings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .models import School, User\nimport re\nfrom django.contrib.auth.models import User as Django_User\nfrom django.contrib.auth.hashers import make_password\n\n\ndef get_school_list():\n schools = School.objects.all()\n school_list ... | python | edit | 1 | 3 | mit | fccc3be65ee5b82c8ac4f4810193ecaa7c6aed6c | dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet | backend/unichat/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this f... | python | edit | 2 | 5 | apache-2.0 | 748e2e51a9ead7be4047e112aad2ed07a3d7a2c9 | GabrielBrascher/cloudstack,resmo/cloudstack,resmo/cloudstack,resmo/cloudstack,jcshen007/cloudstack,GabrielBrascher/cloudstack,wido/cloudstack,wido/cloudstack,DaanHoogland/cloudstack,wido/cloudstack,wido/cloudstack,GabrielBrascher/cloudstack,DaanHoogland/cloudstack,resmo/cloudstack,DaanHoogland/cloudstack,wido/cloudstac... | systemvm/patches/debian/config/opt/cloud/bin/cs_dhcp.py | accepted | null | 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 | null | null | mit | 532bebd01822917f89ec18080bf8e5a75c16832d | nachoaguadoc/aimlx-demos,nachoaguadoc/aimlx-demos,nachoaguadoc/aimlx-demos | config_template.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n url(r'^(?P<url_username>[a-z0-9]*)$', views.user_feed, {'page_nr':'1'}, name='user_feed'),\n url(r'^(?P<url_username>[a-z0-9]*)/(?P<page_nr>\\d+)$', ... | python | edit | 1 | 0 | apache-2.0 | 855724c4e52a55d141e2ef72cf7181710fb33d44 | lionleaf/dwitter,lionleaf/dwitter,lionleaf/dwitter | dwitter/user/urls.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\"\"\"\ncookiecutter.vcs\n----------------\n\nHelper functions for working with version control systems.\n\"\"\"\n\nimport logging\nimport os\nimport shutil\nimport subprocess\nimport sys\n\... | python | edit | 1 | 4 | bsd-3-clause | 2a72b26f63c81e3ceb64d8fd920f3a1327aa0e13 | atlassian/cookiecutter,benthomasson/cookiecutter,luzfcb/cookiecutter,drgarcia1986/cookiecutter,moi65/cookiecutter,alex/cookiecutter,tylerdave/cookiecutter,drgarcia1986/cookiecutter,Vauxoo/cookiecutter,cguardia/cookiecutter,vintasoftware/cookiecutter,cichm/cookiecutter,agconti/cookiecutter,lgp171188/cookiecutter,nhomar/... | cookiecutter/vcs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\n# Model Field Reference\n# https://docs.djangoproject.com/en/1.8/ref/models/fields/\n\n\nclass Tag(models.Model):\n name = models.CharField(max_length=31)\n slug = models.SlugField()\n\n\nclass Startu... | python | edit | 1 | 0 | bsd-2-clause | 304a7da03072dbe6e099bbda37fb8aca0567e64b | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport argparse\nfrom git import Repo\n\nimport configprocessor\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"-p\", \"--path\", help=\"Path to git working copy\")\n parser.add_... | python | edit | 1 | 1 | apache-2.0 | 8993ad7d2b15d05e26788c9bf39ed81794f724dc | igoris/branch-config | branchconfig.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pylint: disable=unused-wildcard-import,wildcard-import\nfrom .settings import *\n\nDATABASES = {\"default\": {\"ENGINE\": \"django.db.backends.sqlite3\", \"NAME\": \":memory:\", \"TEST\": {}}}\nDEBUG = True\nADMINS = [\"<EMAIL>\"]\nEMAIL_... | python | edit | 3 | 0 | mit | badfa5c7c0572e36a94598ec6cc8a845e453d233 | chicagopython/chipy.org,chicagopython/chipy.org,chicagopython/chipy.org,chicagopython/chipy.org | chipy_org/settings_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cupy\n\n\ndef all(a, axis=None, out=None, keepdims=False):\n assert isinstance(a, cupy.ndarray)\n return a.all(axis=axis, out=out, keepdims=keepdims)\n\n\ndef any(a, axis=None, out=None, keepdims=False):\n assert isinstance(... | python | edit | 1 | 1 | mit | 93a7616d949494888f5357f5491aa3278e7de234 | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | cupy/logic/truth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport torch\nfrom torch import FloatTensor, LongTensor\nfrom torch.autograd import Variable\nfrom torch import nn, optim\nfrom torch.nn import Parameter\nfrom tqdm import trange\n\nimport util, logging, os, psutil\n\nimport hyper\n\nloggin... | python | edit | 9 | 0 | mit | 6e1a211ff1834f8047261d51737afcb0412075b5 | MaestroGraph/sparse-hyper | memleak.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\nimport os\n\n\ndef get_files(path, ext=None):\n \"\"\"\n Get all files in directory path, optionally with the specified extension\n \"\"\"\n if ext is None:\n ext = ''\n\n return [\n os... | python | edit | 1 | 5 | mit | 95d71d5a84f05de7d655fd788a4139c3a1316d74 | IanLee1521/utilities | text/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\n\nfrom mock import patch\nimport pytest\n\nfrom inmemorystorage.storage import InMemoryStorage\n\nTEST_DATA_PATH = os.path.join(os.path.dirname(__file__), 'images')\n\n\n@pytest.mark.django_db\ndef test_alternate_sto... | python | edit | 1 | 1 | mit | c1ab2795152d50de9f535e90b550d033feadf778 | theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper | tests/test_storage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\n\nclass Grid(object):\n\n def __init__(self):\n self.board = [[None] * 10 for i in range(22)]\n self.score = 0\n self.lines_clear = 0\n\n def draw_board(self):\n\n curre... | python | edit | 4 | 5 | mit | 7ebd46c4a698b642dd1da355e413eb1bc9ce2727 | mosegontar/learntris | learntris.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python3\n# ^^^ this is bad practice, DON'T do as I did!\nimport cgitb # debugging\nimport footer\nimport header\nfrom htmlify import *\n\n\nprint(\"Content-Type: text/html;charset=utf-8\\n\")\ncgitb.enable() # enable deb... | python | edit | 8 | 0 | apache-2.0 | 038ea41054c3b7d07a7297d392e5e5d5f9c59d6a | ISD-Sound-and-Lights/InventoryControl | logout.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom django.apps import AppConfig\n\nfrom .ckeditor_config import DEFAULT_CONFIG\n\ndefault_app_config = 'leonardo_ckeditor.Config'\n\nLEONARDO_APPS = [\n 'leonardo_ckeditor',\n 'ckeditor',\n 'ckeditor_uploader'\n]\n\nLEONARDO_CO... | python | edit | 1 | 1 | bsd-3-clause | 9891fa25d905bb2aa34c9c55fc420d29438f9499 | leonardo-modules/leonardo-ckeditor,leonardo-modules/leonardo-ckeditor | leonardo_ckeditor/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.decorators import login_required\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db.models import Q\nfrom django.shortcuts import render_to_response\nfrom django.template.context import Requ... | python | edit | 3 | 4 | apache-2.0 | 57a477985f3591258dee8a5cbf4ba2a173c749fc | snswa/swsites,snswa/swsites,snswa/swsites | dashboard/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\nimport os\nimport yaml\nfrom panoptes_client import Panoptes\n\n@click.group()\n@click.option(\n '--endpoint', type=str\n)\n@click.pass_context\ndef cli(ctx, endpoint):\n ctx.config_dir = os.path.join(os.environ['HOME'],... | python | edit | 6 | 3 | apache-2.0 | e4452ff7e8c27e2e8315c2edb8627a2e92ca86e3 | zooniverse/panoptes-cli | panoptes_cli/scripts/panoptes.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom __future__ import division, print_function\nimport pytest\n\nimport sys\n# Add Spectrum location to path\nsys.path.append('../')\nimport Spectrum\n\n# Test using hypothesis\n\ndef test_spectrum_assigns_data():... | python | edit | 3 | 1 | mit | c126950f653169ad3d5035ea1580a7c4c7250f22 | jason-neal/spectrum_overload,jason-neal/spectrum_overload,jason-neal/spectrum_overload | test/test_Spectrum.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\n\nwith open('README.md') as readme:\n with open('HISTORY.md') as history:\n long_description = readme.read() + '\\n\\n' + history.read()\n\ntry:\n import pypandoc\n\n long_description = pypa... | python | edit | 1 | 0 | mit | 1c01423e0cccd64ab249a9749f04cf3e155d3f53 | sashgorokhov/argparse-autogen | setup.py | rejected_duplicate | Near-duplicate of sample 14292 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport scrapy\nfrom locations.items import GeojsonPointItem\nimport json\nimport re\n\nclass LaSalsaSpider(scrapy.Spider):\n name = \"la_salsa\"\n allowed_domains = [\"www.lasalsa.com\"]\n start_urls = (\n ... | python | edit | 1 | 2 | mit | 604102af89c0f3ab3b9562b3baa246f24de3fe90 | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | locations/spiders/la_salsa.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix import for python2 and pypy"
},
{
"role": "assistant",
"content": "import sys\n\n\nis_python3 = sys.version_info >= (3, 0)\n\nif is_python3:\n from mdx_linkify.mdx_linkify import makeExtension\nelse:\n from mdx_linkify ... | python | new_file | 1 | 0 | mit | 08335e060311994a897b95302fc54a0a2b196614 | daGrevis/mdx_linkify | mdx_linkify/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from importlib.metadata import entry_points\nexcept ImportError: # python < 3.8\n try:\n from importlib_metadata import entry_points\n except ImportError:\n entry_points = None\n\n\nfrom . import caching\nfrom... | python | edit | 1 | 0 | bsd-3-clause | 7588bab65a098cbc0b5e2ba2c1b9a45b08adfc46 | intake/filesystem_spec,fsspec/filesystem_spec,fsspec/filesystem_spec | fsspec/__init__.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\nsetup(\n name='django-oscar-fancypages',\n version=\":versiontools:fancypages:\",\n url='https://github.com/tangentlabs/django-oscar-fancypages',\n author=\"S... | python | edit | 1 | 0 | bsd-3-clause | 7844aa93d4f6836fbb8bba3a0af6b2e0e17c6fde | tangentlabs/django-oscar-fancypages,tangentlabs/django-oscar-fancypages | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function, division\n\nfrom sympy.logic.utilities import load_file\nfrom sympy.logic import satisfiable\nimport time\nimport os\nimport sys\n\ninput_path = os.getcwd() + '/' + '/'.join(sys.argv[0].split('/')[:-1]... | python | edit | 3 | 0 | bsd-3-clause | 15030074c73f41a2a298c5de77b584875b7a5441 | abloomston/sympy,wyom/sympy,madan96/sympy,sunny94/temp,liangjiaxing/sympy,kaichogami/sympy,Davidjohnwilson/sympy,shikil/sympy,AunShiLord/sympy,shipci/sympy,sahilshekhawat/sympy,pbrady/sympy,jaimahajan1997/sympy,MechCoder/sympy,Davidjohnwilson/sympy,mcdaniel67/sympy,atreyv/sympy,debugger22/sympy,madan96/sympy,sampadsaha... | sympy/logic/benchmarks/run-solvers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\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\nimport os.path\n\ntests_r... | python | edit | 3 | 0 | apache-2.0 | 3fd264c4927a11bb3915dee38a17b169ea801c63 | disqus/mule | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\n\nurlpatterns = patterns(\n 'buysafe.views',\n url(r'^entry/(?P<order_id>\\d+)/$', 'entry', name='buysafe_pay'),\n (r'^start/$', 'start'),\n (r'^success/(?P<payment_type>[01])/$', 's... | python | edit | 1 | 0 | bsd-3-clause | ca917fa28c5bf8fe3c431868951f429c48b58e0a | uranusjr/django-buysafe | buysafe/urls.py | rejected_duplicate | Near-duplicate of sample 11556 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass FixFoldStrategy:\n \"\"\"This strategy folds every time there is a small card available.\"\"\"\n def __init__(self, N=3):\n self.N = N\n def play(self, info):\n if info.bestFold(self.player)[1] > self.N:\n ... | python | edit | 1 | 4 | mit | 0f9d3b0ed9efc72b8b3fd4d466caa4517691546c | AlexMooney/pairsTournament | strategies/alexStrategies.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = \"0.13.0-dev\"\n__kubernetes_plugin_version__ = \"v0.6.0\"\n__rkt_plugin_version__ = \"v0.1.0\"\n__libnetwork_plugin_version__ = \"v0.6.0\"\n__libcalico_version__ = \"v0.6.0\"\n__felix_version__ = \"1.2.1\"\n\n```\n\nApply thi... | python | edit | 1 | 0 | apache-2.0 | adfcd15e8c9f3c4b08bdb358d041401bf77d2a25 | caseydavenport/calico-containers,Metaswitch/calico-docker,caseydavenport/calico-containers,projectcalico/calico-containers,quater/calico-containers,Metaswitch/calico-docker,insequent/calico-docker,projectcalico/calico-containers,TrimBiggs/calico-containers,tomdee/calico-docker,TrimBiggs/calico-docker,caseydavenport/cal... | calicoctl/calico_ctl/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# File: luhn.py\n# Purpose: Write a program that can take a number and determine whether\n# or not it is valid per the Luhn formula.\n# Programmer: Amal Shehu\n# Course: Exercism\n# Date: Sunday 18 Septe... | python | edit | 7 | 2 | mit | 5c341fc463840bc2e237e1529a43aa5915a70c77 | amalshehu/exercism-python | luhn/luhn.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2017-2018 Data61, CSIRO\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 Lice... | python | edit | 1 | 1 | apache-2.0 | 2060a89cc008e3fc19b90b2278001350ef6b49ad | stellargraph/stellargraph,stellargraph/stellargraph | stellar/data/stellargraph.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding:utf-8 -*-\nfrom django.db import models\n\n\nclass Project(models.Model):\n STATUS = (\n ('unrevised', u'Неразгледан'),\n ('returned', u'Върнат за корекция'),\n ('pending', u'Предстои да бъде разгледан... | python | edit | 1 | 1 | mit | c4d2e4c4f49db961dae59780fa8f5ec351a11353 | Hackfmi/Diaphanum,Hackfmi/Diaphanum | projects/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\nimport requests \nimport json\nimport os\n\nmyElasticServerIp = os.environ.get('ES_SERVER_IP', 'localhost')\nmyIndexName = os.environ.get('ES_INDEX_NAME', 'bestbuy-products')\n\ndef main():\n deleteIndex()\n createI... | python | edit | 4 | 1 | mit | 7cf2d39f4822a50f4a9347ba6c82498abc8e9bb7 | zpurcey/bestbuy-demo,zpurcey/bestbuy-demo,zpurcey/bestbuy-demo | index/createIndex.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose import with_setup\nfrom nose.tools import *\nimport os\nimport sys\nfrom gitdata import GitData\nimport simplejson as json\n\ndef test_fetch():\n gd = GitData(repo=\"./treenexus\")\n\n study_id = 438\n study_nexson ... | python | edit | 4 | 2 | bsd-2-clause | 30a16da0089d0f7afa46fb129a6f426c75cbcd3b | leto/new_opentree_api,leto/new_opentree_api | modules/test_gitdata.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass FakeHttpRequest(object):\n def __init__(self, method='GET', body=''):\n self.method = method.upper()\n self.body = body\n\n\nclass FakeHttpResponse(object):\n def __init__(self, body, content_type='text/html'):\n ... | python | edit | 1 | 2 | bsd-3-clause | f35494ebc7c710af45c8973eb1c2b4d31ec1c7c0 | pobear/restless,viniciuscainelli/restless,toastdriven/restless,tonybajan/restless,CraveFood/restkiss,jangeador/restless | tests/fakes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.urls import path, re_path\n\n# This version 1.x way of defining urls is deprecated in Django 3.1, but still works\nfrom django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n path(\"foo/\", views.foo), # $ro... | python | edit | 1 | 0 | mit | 304713ca8731c2ef27743abb772456d55ad0f3a8 | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | python/ql/test/library-tests/frameworks/django-v2-v3/testapp/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\nimport collections\nimport dashi.config\nimport dashi.db\nimport dashi.time\nimport datetime\nimport functools\nimport jinja2\nimport logging\nimport os\nimport pprint\n\nLOGGER = logging.getLogger(__name__)\n\n@asyncio.coro... | python | edit | 9 | 2 | mit | cb1de4cc77e3368ed730c14044f76f2d20c3d909 | EliRibble/dashi,EliRibble/dashi | dashi/generator.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\nfrom quotes.models import Quote\n\nregister = template.Library()\n\n@register.inclusion_tag('quotes/random_quote.html')\ndef show_random_quote():\n \"\"\"\n For generating a single random quote\n \"\"\"... | python | edit | 2 | 2 | bsd-3-clause | bb0728a6e73f3995968ee7c59ffcb03fae65d983 | davemerwin/django-quotes | quotes/templatetags/quote_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .model import Model\n\nclass Record(Model, object):\n\n def __init__(self, request, domain, attributes):\n self.domain = domain\n\n super(Record, self).__init__(request, attributes)\n\n def update(self, attributes)... | python | edit | 1 | 1 | mit | ed85bde14d8c37144352d7526c674c26fa577407 | vigetlabs/dnsimple | dnsimple/record.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport requests\nimport os\n\n\ndef get_apod():\n\n os.makedirs(\"APODs\", exist_ok=True)\n try:\n apod_data = requests.get(\"https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY\").json()\n image_url = apod_data[\"url... | python | edit | 1 | 5 | mit | 9beb8378831f33c2256b5a7bf73f24d155122bea | FXelix/space_facts_bot | nasa_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport io\n\nfrom wsgiref.util import FileWrapper\nfrom django.http import StreamingHttpResponse\n\n\ndef WrapWithQuotes(text):\n # TODO - Make this better\n if not text.startswith('\"'):\n text = '\"' + text\n\n if not text... | python | edit | 1 | 3 | mit | 8948536f0faf12d36b0da48ae5f45d00a022ebb7 | inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree | InvenTree/InvenTree/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Wrappers around the logging module.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport functools\nimport logging\n\nfrom colorlog.colorlog import ColoredFormatter\n\nBASIC_FORMAT = \"%(log_color)s%(levelname)s%(reset)s:%(name)s... | python | edit | 1 | 2 | mit | 3c01227bfef6e8cabdca9fe9fe620763a28bff88 | borntyping/python-colorlog | colorlog/logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tensorflow as tf\n\nfrom . import var_init\nfrom .util import static_shape\nfrom .variable import variable\n\n\n\ndef linear(x, output_layer_size):\n weight = variable([static_shape(x)[1], output_layer_size])\n bias = variable([out... | python | edit | 1 | 1 | unlicense | fbb532473bc6434628c6f01fabb8eae3ad60a171 | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | nn/linear.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSignals relating to comments.\n\"\"\"\nfrom django.dispatch import Signal\n\n# Sent just before a comment will be posted (after it's been approved and\n# moderated; this can be used to modify the comment (in place) with posting\n# d... | python | edit | 1 | 0 | bsd-3-clause | dcecd75cae428bb27ec8759a21e52267a55f149a | django/django-contrib-comments,django/django-contrib-comments | django_comments/signals.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.