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#pipe2py modules package\n#Author: Greg Gaughan\n\n__all__ = ['pipefetch',\n 'pipefetchdata',\n 'pipedatebuilder',\n 'pipeurlbuilder',\n 'pipetextinput',\n 'pipeurlinput',\n\n 'pip... | python | edit | 10 | 0 | mit | 1633b9a1ace74a5a7cbf445ce7ceb790d0411e79 | nerevu/riko,nerevu/riko | modules/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix manual path hack after relocate"
},
{
"role": "assistant",
"content": "import sys\n\nsys.path.append('/home/blake/b/build/lib.linux-x86_64-3.4')\n"
}
] | python | new_file | 1 | 0 | apache-2.0 | eff279b0824b4bfb569fa82092c7ce9ac6e8c723 | blake-sheridan/py,blake-sheridan/py | test/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Handle handlers.\"\"\"\n\nimport logging\n\n\nclass Handlers(object):\n \"\"\"Handlers.\"\"\"\n\n def __init__(self, *handlers):\n self.logger = logging.getLogger(__name__)\n\n self.handlers = handlers\n\n def h... | python | edit | 1 | 7 | mit | 8ef5b15c62960fb9abc43c9b30550faa0c0d7227 | CactusDev/CactusBot | cactusbot/handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport pwd\nimport subprocess\nfrom .exceptions import CommandFailed\n \ndef get_user_shell():\n return pwd.getpwuid(os.getuid()).pw_shell\n\ndef execute_command_assert_success(cmd, **kw):\n returned = execute_command(cm... | python | edit | 1 | 2 | bsd-3-clause | 1fe377ec1957d570a1dcc860c2bda415088bf6be | vmalloc/dwight,vmalloc/dwight,vmalloc/dwight | dwight_chroot/platform_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\n\n# Main Assets Directory. This will be a subdirectory within MEDIA_ROOT.\n# Set to None to use MEDIA_ROOT directly\nDIRECTORY = getattr(settings, \"ASSETS_DIR\", 'assets')\n\n# Which size should be used ... | python | edit | 1 | 0 | mit | 43a515ddfbe38686672fe00d4765d3f2e1bc5346 | ff0000/scarlet,ff0000/scarlet,ff0000/scarlet,ff0000/scarlet,ff0000/scarlet | scarlet/assets/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"DigitalOcean DNS Records.\"\"\"\n\nfrom certbot_dns_auth.printer import printer\nfrom do_record import http\n\n\nclass Record(object):\n \"\"\"Handle DigitalOcean DNS records.\"\"\"\n\n def __init__(self, api_key, domain, hostna... | python | edit | 1 | 2 | apache-2.0 | f83282b1747e255d35e18e9fecad1750d1564f9e | Jitsusama/lets-do-dns | do_record/record.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\n\n\nCIS_GROUPS = [\n 'cis_whitelist',\n 'nda'\n]\n\n\ndefault_app_config = 'mozillians.groups.GroupConfig'\n\n\nclass GroupConfig(AppConfig):\n name = 'mozillians.groups'\n\n```\n\nApply this chan... | python | edit | 1 | 0 | bsd-3-clause | 041b271baa7ae0bbd20c30ac4f70b42fda267e93 | mozilla/mozillians,akatsoulas/mozillians,mozilla/mozillians,johngian/mozillians,mozilla/mozillians,mozilla/mozillians,akatsoulas/mozillians,akatsoulas/mozillians,johngian/mozillians,johngian/mozillians,johngian/mozillians,akatsoulas/mozillians | mozillians/groups/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nhooks = {\n 'newproject': [], # (site)\n 'generate': [], # (site, dir, extra_context)\n 'publish': [], # (site, s3)\n 'install': [], # (site, project)\n 'preview': ... | python | edit | 1 | 3 | bsd-3-clause | 7a24f314c426e55735836dd2f805d9e0364dc871 | tarbell-project/tarbell,eyeseast/tarbell,tarbell-project/tarbell,eyeseast/tarbell | tarbell/hooks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.... | python | edit | 1 | 0 | apache-2.0 | 14fb663019038b80d42f212e0ad8169cd0d37e84 | openstack/neutron-lib,openstack/neutron-lib,openstack/neutron-lib,openstack/neutron-lib | neutron_lib/exceptions/address_group.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright 2015 OpenMarket Ltd\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\... | python | edit | 1 | 1 | apache-2.0 | 0eb7e6b9a8e4e38793b1e045ab5f0f0a4d4e6777 | matrix-org/synapse,illicitonion/synapse,iot-factory/synapse,TribeMedia/synapse,iot-factory/synapse,howethomas/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,rzr/synapse,howethomas/synapse,illicitonion/synapse,rzr/synapse,howethomas/synapse,illicitonion/synapse,matrix-org/synapse,howethomas/synapse,Tri... | synapse/metrics/resource.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport time\n\nfrom nib import jinja\n\n@jinja('time')\ndef timeformat(t=None, f='%Y-%m-%d %I:%M %p'):\n if t is None:\n t = time.gmtime()\n elif isinstance(t, datetime.date) or isinstance(t, datetime.datetime)... | python | edit | 1 | 5 | mit | d9f03ad1c73cc18276666f28e9a9360c71139a0d | jreese/nib | nib/plugins/time.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url, include\nfrom django.contrib import admin\nfrom rest_framework import routers\nfrom server import views\n\nrouter = routers.DefaultRouter()\nrouter.register(r'users', views.UserViewSet)\nrouter.register(r'g... | python | edit | 1 | 0 | mit | 263e517004df36938b430d8802d4fc80067fadf5 | willy-claes/django-react,willy-claes/django-react,willy-claes/django-react | djangoreact/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http.response import HttpResponse\n\nfrom .models import Tag\n\n\ndef homepage(request):\n tag_list = Tag.objects.all()\n html_output = \"<html>\\n\"\n html_output += \"<head>\\n\"\n html_output += \" <title>\"\n ... | python | edit | 1 | 1 | bsd-2-clause | 614a996dd8227808e796a369ed0faf1f9427f780 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\nfrom extra_countries.models import ExtraCountry\n\n\ndef add_currencies_with_countries(apps, schema_editor):\n # We can't import the ... | python | edit | 1 | 5 | mit | 822e6123cc598b4f6a0eafedfb2f0d0cbfba5f37 | openspending/cosmopolitan,kiote/cosmopolitan | currencies/migrations/0003_auto_20151216_1906.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport logging\nimport os\n\nfrom gensim.models import Word2Vec\n\nlogging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentP... | python | edit | 1 | 0 | apache-2.0 | 0df35e81754f703d1a8164cf0ea5169a53355185 | knub/master-thesis,knub/master-thesis,knub/master-thesis,knub/master-thesis | code/python/knub/thesis/word2vec_gaussian_lda_preprocessing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport time\n\nfrom infrastructure.models import Server\nfrom jobs.models import Job\n\nTIMEOUT = 600\n\n\ndef is_reachable(server):\n \"\"\"\n :type server: Server\n \"\"\"\n instance_id = server.ec2serverinfo.insta... | python | edit | 1 | 5 | apache-2.0 | 46741fdbda00a8b1574dfdf0689c8a26454d28f6 | CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge | actions/cloudbolt_plugins/aws/poll_for_init_complete.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport logging\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(prog=\"BTScreenshotAutomation\")\n parser.add_argument... | python | edit | 3 | 0 | mit | 7e464f70157c2ce7382912d65014bf9d872bed75 | josecolella/Dynatrace-Resources | portal/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Cloudbase Solutions Srl\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy o... | python | edit | 1 | 1 | apache-2.0 | 98c2c311ad1a0797205da58ce4d3b7d9b4c66c57 | openstack/nova,klmitch/nova,klmitch/nova,mahak/nova,mahak/nova,mahak/nova,klmitch/nova,openstack/nova,openstack/nova,klmitch/nova | nova/policies/pause_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom weakref import WeakValueDictionary\n\nclass DuplicateEntryError(Exception):\n def __init__(self, name, obj, registry):\n self.name = name\n self.obj = obj\n self.registry = registry\n\n def __str__(self):\n ... | python | edit | 1 | 3 | bsd-2-clause | fc7cadecb95fa798a8e8aaeb544ad5464f13a533 | cloudtools/nymms | nanomon/registry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom utils import preprocess_tweet\n\ndef check_existence_of_words(tweet, wordlist):\n \"\"\"\n Function for the slang or curse words and acronyms features\n :param tweet: semi process tweet (hashtags mentions removed)\n :param ... | python | edit | 1 | 3 | mit | 9ee39df85da16503d5212a81adac316fcb00a3f6 | iamhuy/rumour-veracity-verification | src/features/hasWord.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport vx\n\nfrom contextlib import contextmanager\nfrom functools import partial\n\nimport sys\nfrom io import StringIO\n\ndef _expose(f=None, name=None):\n if f is None:\n return partial(_expose, name=name)\n if name is None:... | python | edit | 1 | 4 | mit | 8f03f51c89aeea44943f9cb0b39330e676ae0089 | philipdexter/vx,philipdexter/vx | utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\nfrom xml.etree.ElementTree import ParseError\nimport xml.etree.ElementTree as ET\nimport glob\nimport sys\n\ndef eprint(*args, **kwargs):\n print(*args,... | python | edit | 1 | 4 | apache-2.0 | 7756236c5e1fa70f1173dbd58b7e57f56214c19f | wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework | unitTestUtils/parseXML.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom SimpleCV import *\nimport numpy\nimport cv2\n\n\ndef process_image(obj, img, config):\n \"\"\"\n :param obj: Object we're tracking\n :param img: Input image\n :param config: Controls\n :return: Mask with candidates surro... | python | edit | 4 | 6 | mit | f3e3b43abebfad0fcaa20df8eac20e3cb8c099d6 | mstojcevich/Flash-Vision | imgproc.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\n\nfrom .. import perms\nfrom ..settings import get_user_attr\n\n\nregister = template.Library()\n\n\n@register.filter\ndef is_masquerading(user):\n info = getattr(user, get_user_attr())\n return info['is_m... | python | edit | 1 | 2 | mit | 28c6af1381a1fc38b20ce05e85f494f3ae2beeb4 | PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils | arcutils/masquerade/templatetags/masquerade.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport logging\nimport yaml\nfrom pathlib import Path\n\n\nclass ConfigurationCore:\n\n config_from_file = None\n\n def __init__(self, config_path=None):\n try:\n if not config_path:\n confi... | python | edit | 3 | 4 | mit | 831c3f82abe5cc148f13f631f78b3c960460bbce | egnyte/gitlabform,egnyte/gitlabform | gitlabform/configuration/core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom flask import Flask, render_template\n\napp = Flask(__name__)\n\nBBC_id= \"bbc-news\"\nAPI_KEY = \"c4002216fa5446d582b5f31d73959d36\"\n\n@app.route(\"/\")\ndef index():\n r = requests.get(\n f\"https://newsapi... | python | edit | 1 | 1 | mit | 257686cfa72318c0b476d4623731080f848c4942 | alchermd/headlines,alchermd/headlines | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pkg_resources import resource_filename\n\nimport pandas as pd\nimport numpy as np\n\n\nclass LengthGenerator(object):\n def __init__(self,\n length_file=resource_filename(__name__,\n ... | python | edit | 1 | 1 | mit | 6091fccc90bb6b90c47a2e4fb7ee6821876eb1a1 | ebegoli/SynthNotes | synthnotes/generators/lengthgenerator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom collections import namedtuple\n\nSize = namedtuple(\"Size\", [\"width\", \"height\"])\nRectangle = namedtuple(\"Rectangle\", [\"x0\", \"y0\", \"x1\", \"y1\"])\n\nclass Point(namedtuple(\"Point\", [\"x\", \"y\"]... | python | edit | 1 | 5 | mit | ced218643784838d68961a926cc0dd18c3a3f01f | bjornarg/skald,bjornarg/skald | skald/geometry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\n# Copyright (c) 2009 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\"\"\"Makes sure that the app/ code is cpplint c... | python | edit | 1 | 1 | bsd-3-clause | 7a0c0e6ed56e847b7b6300c1a0b4a427f26b296d | wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser | app/PRESUBMIT.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n{%% for model_name, props in all_models.iteritems() %%}\n{%% set model_name = model_name|capitalize %%}\nclass {{{ model_name }}}(models.Model):\n {%%... | python | edit | null | null | apache-2.0 | d469a02c697a20d7db36a3a80d44cfca2257a5cd | christabor/Skaffold,christabor/Skaffold | django/models.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\nfrom . import views\n\nurlpatterns = [\n url(r'^question_set/', views.http_list_question_sets),\n url(r'^answer_set/', views.http_create_answer_set),\n url(r'^answer/', views.create_answer),\n u... | python | edit | 1 | 0 | mit | 832d59557dcf2b73797159b4acb96e727492d8fb | sevazhidkov/greenland,sevazhidkov/greenland | maps/api/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport redis\n\n\nclass Database(object):\n def __init__(self):\n self.redis = redis.StrictRedis(host='redis', port=6379, db=0)\n\n def set_data_of_server_channel(self, server, channel, data):\n self.redis.h... | python | edit | 1 | 2 | mit | fd77039104175a4b5702b46b21a2fa223676ddf4 | kevinkjt2000/discord-minecraft-server-status | bowser/Database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nfrom seleniumbase import BaseCase\n\n\nclass MyTestClass(BaseCase):\n\n def test_user_agent(self):\n self.open('http://www.whatsmyua.info/')\n user_agent = self.get_text(\"#custom-ua-string\")\n print(\"... | python | edit | 1 | 1 | mit | 3b0e80a159c4544a69adf35f4871b9167335795c | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | examples/user_agent_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, print_function\n\nimport pandas as pd\n\nfrom ggplotx import ggplot, aes, geom_point\n\n\ndef test_aesthetics():\n df = pd.DataFrame({\n 'a': range(5),\n 'b': 2,\n ... | python | edit | 1 | 1 | mit | 0e48b2130cc53caa9beb9a5f8ce09edbcc40f1b8 | has2k1/plotnine,has2k1/plotnine | ggplotx/tests/test_geom_point.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom urllib import urlencode\nfrom datetime import datetime\n\nfrom django.http import HttpResponseForbidden\nfrom django.contrib.auth.models import AnonymousUser\nfrom django.utils.timezone import now\n\nfrom api.models import AuthAPIKey, ... | python | edit | 3 | 6 | bsd-3-clause | 04328bb0ed84180aa9e5ce7f749eafb1ab96d4fc | nikdoof/test-auth | app/api/auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom flask import Flask, jsonify\nfrom flask_pymongo import PyMongo, BSONObjectIdConverter\nfrom werkzeug.exceptions import HTTPException, default_exceptions\n\nfrom core.api import settings\n\n\ndef create_app(environment=None... | python | edit | 3 | 3 | mit | 4651d3b5666fe3ddf3bd92b31ee6ffe4a72ce94e | onyb/veritrans-payment-portals | core/api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import Counter\nfrom matplotlib import pyplot as plt\nimport datetime\n\ndef create_timeline( data ):\n if len(data) == 0:\n print \"Dataset empty.\"\n return\n\n dates = map( lambda d: d['date'], data )... | python | edit | 2 | 3 | mit | ff9d613897774f3125f2b28905528962b1761deb | HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core | core/timeline.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef update_read_tracking(topic, user):\n tracking = user.readtracking\n\n #if last_read > last_read - don't check topics\n if tracking.last_read and tracking.last_read > (topic.last_post.updated or\n ... | python | edit | 2 | 7 | bsd-2-clause | 7872abf00b24a504fccba576b13ecdd140e0135f | ttyS15/pybbm,onecue/pybbm,katsko/pybbm,katsko/pybbm,wengole/pybbm,wengole/pybbm,webu/pybbm,acamposruiz/quecoins,springmerchant/pybbm,NEERAJIITKGP/pybbm,webu/pybbm,concentricsky/pybbm,skolsuper/pybbm,hovel/pybbm,NEERAJIITKGP/pybbm,hovel/pybbm,webu/pybbm,artfinder/pybbm,onecue/pybbm,katsko/pybbm,ttyS15/pybbm,wengole/pybb... | pybb/read_tracking.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom warnings import catch_warnings, simplefilter\n\n\ndef test_filter_import():\n with catch_warnings():\n simplefilter('ignore')\n from skimage import filter as F\n\n assert('sobel' in dir(F))\n assert any(['has bee... | python | edit | 1 | 2 | bsd-3-clause | 3260594268f19dcfe1ea5613f939c892d609b47e | Hiyorimi/scikit-image,juliusbierk/scikit-image,dpshelio/scikit-image,chriscrosscutler/scikit-image,Britefury/scikit-image,juliusbierk/scikit-image,vighneshbirodkar/scikit-image,jwiggins/scikit-image,WarrenWeckesser/scikits-image,rjeli/scikit-image,Britefury/scikit-image,youprofit/scikit-image,ajaybhat/scikit-image,benn... | skimage/filters/tests/test_filter_import.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ansiblelint import AnsibleLintRule\n\n\nclass NoFormattingInWhenRule(AnsibleLintRule):\n id = 'CINCH0001'\n shortdesc = 'No Jinja2 in when'\n description = '\"when\" lines should not include Jinja2 variables'\n tags = ['dep... | python | edit | 1 | 8 | mit | 445a150982f2119b340d95edc66940e0ec54afbd | willthames/ansible-lint,dataxu/ansible-lint,MatrixCrawler/ansible-lint | lib/ansiblelint/rules/NoFormattingInWhenRule.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\n\nfrom .loader import load_yaml\nfrom .blueprint import Blueprint\nfrom .exceptions import ValidationError, YAMLError\n\n\ndef get_blueprint(*files):\n try:\n return Blueprint.from_description(load_yaml(*files))\n ... | python | edit | 1 | 3 | mit | ab47c678b37527a7b8a970b365503b65ffccda87 | novafloss/populous | populous/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport functools\nimport numpy\nimport tensorflow as tf\n\n\n\ndef static_shape(tensor):\n return tf.convert_to_tensor(tensor).get_shape().as_list()\n\n\ndef static_rank(tensor):\n return len(static_shape(tf.convert_to_tensor(tensor)))\n\... | python | edit | 1 | 2 | unlicense | d604d17e8286b1c95a0faafd6d4fd79af11441ab | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | nn/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\n# Detect Python 3\nPY3 = (sys.hexversion >= 0x03000000)\n\nif PY3:\n types_not_to_encode = (int, str)\n string_type = str\n from urllib.parse import urlparse\nelse:\n types_not_to_encode = (int, long, basestring)\n... | python | edit | 6 | 0 | mit | bff72be24e44cec1d819de630afb91868fadeaa5 | LuminosoInsight/luminoso-api-client-python | luminoso_api/compat.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, request\nimport subprocess\nimport uuid\nimport os\nimport re\nimport json\n\napp = Flask(__name__)\n\n\n@app.route('/api/v1/', methods=[\"GET\"])\ndef lint():\n\n id = uuid.uuid4()\n filename = os.path.join(\... | python | edit | 1 | 2 | bsd-3-clause | 09dbb096a796f87e9b43e463d929796db7f96182 | amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nSystem tests for `jenkinsapi.jenkins` module.\n'''\nimport re\nimport time\nimport unittest\n\nfrom jenkinsapi_tests.systests.base import BaseSystemTest\nfrom jenkinsapi_tests.systests.job_configs import MATRIX_JOB\nfrom jenkinsapi_tes... | python | edit | 1 | 3 | mit | 10948cd88d51383e13af0a116703984752092c6a | imsardine/jenkinsapi,salimfadhley/jenkinsapi,JohnLZeller/jenkinsapi,JohnLZeller/jenkinsapi,aerickson/jenkinsapi,domenkozar/jenkinsapi,zaro0508/jenkinsapi,imsardine/jenkinsapi,zaro0508/jenkinsapi,jduan/jenkinsapi,mistermocha/jenkinsapi,domenkozar/jenkinsapi,salimfadhley/jenkinsapi,zaro0508/jenkinsapi,mistermocha/jenkins... | jenkinsapi_tests/systests/test_jenkins_matrix.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask.ext.login import login_user, logout_user, current_user, login_required, LoginManager\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask import Flask, session\nfrom flask.ext.session import Session\n... | python | edit | 10 | 0 | mit | bf5307afe52415960d0ffc794f687b0ecebb48da | ptitoliv/cineapp,ptitoliv/cineapp,ptitoliv/cineapp | app/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('kbadge', '0001_initial'),\n ]\n\n operations = [\n ... | python | edit | 1 | 0 | bsd-3-clause | 238ba8cec34ec02dc521f25ef1ada6e230194c32 | mozilla/kitsune,anushbmx/kitsune,anushbmx/kitsune,anushbmx/kitsune,mozilla/kitsune,mozilla/kitsune,mozilla/kitsune,anushbmx/kitsune | kitsune/kbadge/migrations/0002_auto_20181023_1319.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'zifnab'\nfrom flask_script import Manager, Server\nfrom app import app\n\nmanager=Manager(app)\n\nmanager.add_command('runserver', Server(host=app.config.get('HOST', '0.0.0.0'), port=app.config.get('PORT', 5000)))\n\n@manager.... | python | edit | 3 | 2 | mit | 0cda8aae3c5a8ad4d110c41007279a3364c6f33a | zifnab06/zifb.in,zifnab06/zifb.in | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom parsl.config import Config\nfrom parsl.data_provider.scheme import GlobusScheme\nfrom parsl.executors.threads import ThreadPoolExecutor\nfrom parsl.tests.utils import get_rundir\n\n# If you are a developer running tests, make sure to u... | python | edit | null | null | apache-2.0 | d2f3ff32e6d0a8c03a76f93669bb1f37d28ae124 | Parsl/parsl,Parsl/parsl,Parsl/parsl,swift-lang/swift-e-lab,Parsl/parsl,swift-lang/swift-e-lab | parsl/tests/configs/local_threads_globus.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.mail import send_mail\n\n\n# TODO: check whether this should be sent from Phuxivator\ndef mailApplicantSubmission(context, sender='<EMAIL>'):\n name = context['name']\n receiver = context['email']\n\n subject = 'Ta... | python | edit | 1 | 1 | mit | 31448c1e23d7dfcea65af20432511673533885b6 | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | teknologr/registration/mailutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\nimport json\nimport re\n\nfrom .resource import Resource\n\nclass Response(Resource):\n\n \"\"\"Represents an HTTP response that is hopefully a HAL document.\"\"\"\n\n def __init__(self, res... | python | edit | 3 | 3 | mit | e369824a1bd337e9245d010b93734832af4e0376 | nanorepublica/cetacean-python,benhamill/cetacean-python | cetacean/response.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Example of integration between Fabric and Datadog.\n\"\"\"\n\nfrom fabric.api import *\nfrom fabric.colors import *\nfrom dogapi.fab import setup, notify\n\nsetup(api_key = \"YOUR API KEY HERE\")\n\n# Make sure @notify is just above @... | python | edit | 12 | 1 | bsd-3-clause | 9c7d0895dca2909143d633a1e335a811f43481b2 | DataDog/dogapi,DataDog/dogapi | examples/fabfile.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2022 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.... | python | edit | 1 | 0 | apache-2.0 | d5df109f95dd47d63188e4b1d0017275adae172c | google-research/rlds,google-research/rlds | pip_package/rlds_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import url, patterns\n\nfrom shop.views.cart import CartDetails, CartItemDetail\n\n\nurlpatterns = patterns('',\n url(r'^delete/$', CartDetails.as_view(action='delete'), # DELETE\n name='cart_delete... | python | edit | 1 | 0 | bsd-3-clause | fd4539942dafe622d3f7a7d183db3d69f95a00c4 | schacki/django-shop,khchine5/django-shop,khchine5/django-shop,dwx9/test,febsn/django-shop,DavideyLee/django-shop,awesto/django-shop,jrief/django-shop,dwx9/test,thenewguy/django-shop,thenewguy/django-shop,bmihelac/django-shop,pjdelport/django-shop,creimers/django-shop,creimers/django-shop,jrief/django-shop,bmihelac/djan... | shop/urls/cart.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport factory\n\nimport random\nfrom django.conf import settings\nfrom TWLight.resources.models import Partner, Stream, Video, Suggestion\n\n\nclass PartnerFactory(factory.django.DjangoModelFactory):\n class Met... | python | edit | 1 | 0 | mit | b98e86ad9b3120dce9f163236b5e28f564547c27 | WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight | TWLight/resources/factories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- encoding:utf-8 -*-\n\nfrom xunleipy.remote import XunLeiRemote\n\n\ndef remote_download(username, password, rk_username, rk_password, download_links, proxy=None, path='C:/TD/', peer=0):\n remote_client = XunL... | python | edit | 3 | 2 | mit | 463abcce738ca1c47729cc0e465da9dc399e21dd | lazygunner/xunleipy | examples/remote_download.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom haystack import indexes\nfrom pylinks.links.models import Link\n\n\nclass LinkIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharField(document=True, use_template=True)\n\n def get_model(self):\n return Li... | python | edit | 1 | 1 | mit | e96ede7ad3753bfed461eca83b1cd77e8bccd180 | michaelmior/pylinks,michaelmior/pylinks,michaelmior/pylinks | pylinks/links/search_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'intsco'\n\nimport cPickle\nfrom engine.pyIMS.image_measures.level_sets_measure import measure_of_chaos_dict\nfrom unittest import TestCase\nimport unittest\nfrom os.path import join, realpath, dirname\n\n\nclass MeasureOfChaos... | python | edit | 3 | 2 | apache-2.0 | 6949339cda8c60b74341f854d9a00aa8abbfe4d5 | andy-d-palmer/pyIMS,alexandrovteam/pyImagingMSpec | test/level_sets_measure_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 datawire. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 0 | apache-2.0 | 9c9a2904ad79c2f05dacdabef9f3ad78ae78db3f | datawire/quark,datawire/quark,datawire/quark,datawire/quark,datawire/quark,datawire/quark | quarkc/_metadata.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nQUESTIONS = [\n {\n 'questionText': 'What is the Labour Code?'\n },\n {\n 'questionText': 'When can a union start a strike?'\n }\n]\n\n```\n\nApply this change: Add all blank parameters to sample question"
},
{... | python | edit | 1 | 0 | mit | 894203d67e88e8bac8ec4f8948d940789387b648 | sherlocke/pywatson | tests/data/questions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add abstract Broadcast protocol class"
},
{
"role": "assistant",
"content": "from abc import ABCMeta, abstractmethod\nfrom enum import Enum\n\n\nclass Broadcast(metaclass=ABCMeta):\n \"\"\"\n An interface for defining a bro... | python | new_file | 1 | 1 | mit | d4acff165712281cb7205cca1c39e7eaf1fdd23b | koevskinikola/ByzantineRandomizedConsensus | base/broadcast.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 | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# A romanesco script to convert a slide to a TIFF using vips.\nimport subprocess\nimport os\n\nout_path = os.path.join(_tempdir, out_filename)\n\nconvert_command = (\n 'vips',\n 'tiffsave',\n '\"%s\"' % in_path,\n '\"%s\"' % out... | python | edit | 4 | 0 | apache-2.0 | be19869d76bb655990464094ad17617b7b48ab3b | DigitalSlideArchive/large_image,DigitalSlideArchive/large_image,girder/large_image,DigitalSlideArchive/large_image,girder/large_image,girder/large_image | server/create_tiff.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Disable Floating IPs\nfrom openstack_dashboard.dashboards.project.access_and_security import tabs\nfrom openstack_dashboard.dashboards.project.instances import tables\nimport horizon\n\nNO = lambda *x: False\n\ntabs.FloatingIPsTab.allowed... | python | edit | 1 | 0 | apache-2.0 | c8ce1315caf762f2c0073ab0ebed8ef627be5581 | raykrist/himlar,tanzr/himlar,mikaeld66/himlar,raykrist/himlar,norcams/himlar,eckhart/himlar,mikaeld66/himlar,norcams/himlar,mikaeld66/himlar,raykrist/himlar,tanzr/himlar,TorLdre/himlar,tanzr/himlar,TorLdre/himlar,mikaeld66/himlar,tanzr/himlar,eckhart/himlar,norcams/himlar,raykrist/himlar,eckhart/himlar,TorLdre/himlar,n... | profile/files/openstack/horizon/overrides.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport data\nimport argparse\nfrom model import EDSR\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--dataset\",default=\"data/General-100\")\nparser.add_argument(\"--imgsize\",default=100,type=int)\nparser.add_argument(\"--scal... | python | edit | 3 | 0 | mit | eb31775a7dbbb2064cf64d85c2bb0912a92f4028 | jmiller656/EDSR-Tensorflow | train.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make database filepath configurable on History"
},
{
"role": "assistant",
"content": "import sqlite3\n\nclass History:\n def __init__(self, path):\n self.conn = sqlite3.connect(path)\n\n"
}
] | python | new_file | 1 | 1 | mit | 7ff6c9d85eef03c225b511f39bbb07796b47659f | ibab/datapipe | datapipe/history.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: <EMAIL>\n# Documentation: http://scripting101.stoeps.de\n#\n# Version: 2.0\n# Date: 2014-06-04\n#\n# License:... | python | edit | 2 | 0 | apache-2.0 | 0e766eb66eba099071b6cfae49bf79492e29e648 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ibmcnx/doc/DataSources.py | rejected_duplicate | Near-duplicate of sample 536 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport json\nfrom bson import json_util\n\nfrom flask.wrappers import Request, cached_property\n\ndef getBoolean(string):\n return {\n '1': True, 'yes': True, 'true': True, 'on': True,\n '0': False, 'no': False, 'false': ... | python | edit | 1 | 4 | apache-2.0 | aecff9764ef8d18b7016a6acba41e74a43e66085 | geodelic/clio,geodelic/clio | clio/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2.3\n\n\"\"\"\nRead a MAF from stdin and break into a set of mafs containing \nno more than a certain number of columns\n\"\"\"\n\nusage = \"usage: %prog\"\n\nimport sys, string\nimport bx.align.maf\nfrom optparse impor... | python | edit | 4 | 7 | mit | 1dfff48a5ddb910b4abbcf8e477b3dda9d606a49 | bxlab/bx-python,bxlab/bx-python,bxlab/bx-python | scripts/maf_split_by_src.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\r\nfrom __future__ import division\r\n\r\nimport math\r\n\r\n\r\nclass LorentzFactor(object):\r\n SPEED_OF_LIGHT = 299792458\r\n\r\n @staticmethod\r\n def get_beta(velocity, is_percent):\r\n if is_per... | python | edit | 2 | 2 | mit | b12418acf3883024be965f42ec8d3a16e76d384f | tdsymonds/relativity | special/special_relativity.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.contrib.auth.models import User\nimport string, random\nfrom django import forms\n# Create your models here.\ndef _generate_default_hashtag():\n return \"\".join(random.choice(string.lowercase) f... | python | edit | 3 | 2 | mit | 199c9bae8e2ad42ee1c8699c678dd56d6074b2de | Aaron1011/texting_wall | main/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 NEC Corporation. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the Lic... | python | edit | 1 | 0 | apache-2.0 | d42314b323aa0f8c764d72a5ebebc0e7d5ac88f3 | devendermishrajio/nova,affo/nova,projectcalico/calico-nova,whitepages/nova,klmitch/nova,jianghuaw/nova,cernops/nova,Stavitsky/nova,fnordahl/nova,blueboxgroup/nova,CEG-FYP-OpenStack/scheduler,Francis-Liu/animated-broccoli,j-carpentier/nova,joker946/nova,hanlind/nova,rajalokan/nova,zhimin711/nova,silenceli/nova,ruslanlom... | nova/api/openstack/compute/schemas/v3/create_backup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The vumi.application API.\"\"\"\n\n__all__ = [\"ApplicationWorker\", \"SessionManager\"]\n\nfrom vumi.application.base import ApplicationWorker\nfrom vumi.application.session import SessionManager\n\n```\n\nApply this change: Add Tagp... | python | edit | 1 | 0 | bsd-3-clause | 9a7100aaf0207fe93b28d7e473a4b5c1cd6061fe | vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,TouK/vumi,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,harrissoerja/vumi | vumi/application/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen\n\n\nclass RotorTestCase(unittest.TestCase):\n def test_rotor_encoding(self):\n rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')\n ... | python | edit | 5 | 1 | mit | e978b8be7ccfd9206d618f5a3de855a306ceccfe | ranisalt/enigma | test.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import ListView\nfrom haystack.query import SearchQuerySet\nfrom haystack.utils.geo import Point, D\nfrom ..models import Store\nfrom ..utils import caching_geo_lookup\n\n\nclass DistanceSearchView(ListView):\n\n ... | python | edit | 2 | 4 | bsd-3-clause | ca144b8254691e9633ddedb7ad11b2c4919b8b77 | nikdoof/vapemap,nikdoof/vapemap | app/stores/views/search.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nclass Random:\n\tdef __init__(self, seed):\n\t\tmultiplier = 0x6C078965\n\t\t\n\t\ttemp = seed\n\t\tself.state = []\n\t\tfor i in range(1, 5):\n\t\t\ttemp ^= temp >> 30\n\t\t\ttemp = (temp * multiplier + i) & 0xFFFFFFFF\n\t\t\tself.state.... | python | edit | 1 | 3 | mit | d2339fa094062c0672aef0ce938572aa3f5aead3 | Kinnay/NintendoClients | nintendo/sead/random.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Linux-specific code\"\"\"\n\nimport os\n\nfrom pysyte.types import paths\n\n\ndef xdg_home():\n \"\"\"path to $XDG_CONFIG_HOME\n\n >>> assert xdg_home() == os.path.expanduser('~/.config')\n \"\"\"\n return paths.environ_pa... | python | edit | 1 | 1 | mit | 87ea6fbc07c547a0c92f0b85811edc0645cb4303 | jalanb/dotsite | pysyte/oss/linux.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\nZeroMQ transport for napalm-logs.\n'''\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\n# Import stdlib\nimport json\n\n# Import third party libs\nimport zmq\n\n# Import napal... | python | edit | 1 | 3 | apache-2.0 | 375b26fbb6e5ba043a1017e28027241c12374207 | napalm-automation/napalm-logs,napalm-automation/napalm-logs | napalm_logs/transport/zeromq.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\n\nfrom .models import Game, Platform\n\n\nclass GameAdmin(admin.ModelAdmin):\n list_display = ['name', 'platform', 'gbid']\n\n raw_id_fields = ['platform']\n autocomplete_l... | python | edit | 1 | 0 | apache-2.0 | 49d831a61c5770d02609ff2df8fed3effc3869c2 | bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv | avalonstar/components/games/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\nimport sys\nimport os\nimport salt.client\n\n\ndef getNotification():\n notification_dict = {}\n isEndOfDictionary = False\n for line in sys.stdin:\n if not line.strip():\n isEndOfDictionary = T... | python | edit | 4 | 4 | apache-2.0 | c1edc666630c03b6d85d9749e0695a9f19dd7c13 | skyrings/skynet,skyrings/skynet | src/collectd_scripts/handle_collectd_notification.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding:utf-8 -*-\n\nfrom flask import request, redirect\nimport requests\n\ncookiename = 'openAMUserCookieName'\namURL = 'https://openam.example.com/'\nvalidTokenAPI = amURL + 'openam/identity/istokenvalid?tokenid='\nloginURL = amURL ... | python | edit | 3 | 3 | unlicense | 7ee86e9b52292a8824dfa7bab632526cbb365b51 | timhberry/openam-flask-decorator | routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom invoke import task, Collection\nfrom invocations.packaging import release\n\n\n# TODO: once this stuff is stable and I start switching my other projects to be\n# pytest-oriented, move this into invocations somehow.\n@task\ndef test(c):... | python | edit | 1 | 2 | bsd-2-clause | 84f9c189f62c6ab81de952cb9a7e9942237465ec | bitprophet/pytest-relaxed | tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nELECTRUM_VERSION = \"1.9.3\" # version of the client package\nPROTOCOL_VERSION = '0.6' # protocol version requested\nSEED_VERSION = 6 # bump this every time the seed generation is modified\nSEED_PREFIX = '01' # the h... | python | edit | 1 | 0 | mit | 7699c2922e6ac1c75b152028df53ea44ee55db11 | dabura667/electrum,protonn/Electrum-Cash,procrasti/electrum,dashpay/electrum-dash,pknight007/electrum-vtc,neocogent/electrum,pooler/electrum-ltc,cryptapus/electrum,protonn/Electrum-Cash,dabura667/electrum,romanz/electrum,cryptapus/electrum-myr,dashpay/electrum-dash,fyookball/electrum,argentumproject/electrum-arg,lbryio... | lib/version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom lemon.publications.querysets import PublicationQuerySet\n\n\nclass PublicationManager(models.Manager):\n \n def expired(self):\n return self.get_query_set().expired()\n\n def future(self)... | python | edit | 1 | 1 | bsd-3-clause | 48e4203bc87fda407d0e5f804c854b53f7bf54fc | trilan/lemon,trilan/lemon,trilan/lemon | lemon/publications/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n@fileoverview Digital Ocean API\n@author David Parlevliet\n@version 20130315\n@preserve Copyright 2013 David Parlevliet.\n\nDigital Ocean API\n=================\nClass to get the server details via the Digital Ocean API.\n\"\"\"\nim... | python | edit | 1 | 6 | mit | a10407bf4d9dd404d734985717aa7bcebfa0981d | dparlevliet/elastic-firewall,dparlevliet/elastic-firewall,dparlevliet/elastic-firewall | api/digital_ocean.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# With mod_python we'll have to delay importing trac.web.api until\n# modpython_frontend.handler() has been called since the\n# PYTHON_EGG_CACHE variable is set from there\n#\n# TODO: Remove this once the Genshi zip_safe issue has been reso... | python | edit | 5 | 0 | bsd-3-clause | c205742520f4d2882d666e13a06c487d886ec7bc | rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac | trac/web/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom haystack import indexes\n\nfrom widgy.contrib.widgy_mezzanine import get_widgypage_model\nfrom widgy.templatetags.widgy_tags import render_root\nfrom widgy.utils import html_to_plaintext\n\nfrom .signals import widgypage_pre_index\n\nW... | python | edit | 2 | 2 | apache-2.0 | a4b0830b7336694dacc822077c2ce6901be4929b | j00bar/django-widgy,j00bar/django-widgy,j00bar/django-widgy | widgy/contrib/widgy_mezzanine/search_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass License(models.Model):\n name = models.CharField(max_length=80, unique=True)\n symbols = models.CharField(max_length=5)\n url = models.URLField(unique=True)\n\n def __unicode__(self):\n ... | python | edit | 1 | 1 | unlicense | 52ef9217f954617283be54c889a317b2432651d7 | editorsnotes/django-licensing,editorsnotes/django-licensing | licensing/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cookiecutter.main import is_repo_url, expand_abbreviations\n\n\ndef test_is_repo_url():\n \"\"\"Verify is_repo_url works.\"\"\"\n assert is_repo_url('gitolite@server:team/repo') is True\n assert is_repo_url('<EMAIL>:audreyr/co... | python | edit | 1 | 1 | bsd-3-clause | 3c4565dcf6222af0e3b7cabf5c52f9ab18488be2 | luzfcb/cookiecutter,terryjbates/cookiecutter,michaeljoseph/cookiecutter,willingc/cookiecutter,pjbull/cookiecutter,stevepiercy/cookiecutter,hackebrot/cookiecutter,dajose/cookiecutter,Springerle/cookiecutter,dajose/cookiecutter,stevepiercy/cookiecutter,terryjbates/cookiecutter,audreyr/cookiecutter,pjbull/cookiecutter,aud... | tests/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nRelated article: https://sebest.github.io/post/protips-using-gunicorn-inside-a-docker-image/\n\nParameters you might want to override:\n GUNICORN_BIND=\"0.0.0.0:8005\"\n\"\"\"\n\nimport os\n\n\nworkers = 4\... | python | edit | 1 | 0 | mit | 0f3f9ac26e968eab788a9ee2e95c34f2fa05ddbf | business-factory/captain-hook | hooks/settings/settings_gunicorn.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# yvs.set_pref\n# coding=utf-8\n\nfrom __future__ import unicode_literals\n\nimport json\nimport sys\n\nimport yvs.shared as shared\n\n\n# Parse pref set data from the given JSON string\ndef parse_pref_set_data_str(pref_set_data_str):\n\n ... | python | edit | 1 | 2 | mit | 302d9797b7ccb46e7b9575513c0a2c5461e156a5 | caleb531/youversion-suggest,caleb531/youversion-suggest | yvs/set_pref.py | rejected_duplicate | Near-duplicate of sample 827 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nclass _FormatterMeta(type):\n registry = {}\n\n def __new__(mcls, name, bases, members):\n if 'name' in members:\n formatter_name = members['name'].l... | python | edit | 1 | 2 | bsd-3-clause | 135c84189720aa2b7c07e516c782f7fab7b4d8fe | astropy/astropy,saimn/astropy,mhvk/astropy,lpsinger/astropy,saimn/astropy,lpsinger/astropy,mhvk/astropy,pllim/astropy,astropy/astropy,lpsinger/astropy,saimn/astropy,aleksandr-bakanov/astropy,pllim/astropy,astropy/astropy,pllim/astropy,lpsinger/astropy,larrybradley/astropy,mhvk/astropy,pllim/astropy,StuartLittlefair/ast... | astropy/units/format/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http.response import HttpResponse\nfrom django.template import Context, loader\n\nfrom .models import Tag\n\n\ndef homepage(request):\n tag_list = Tag.objects.all()\n template = loader.get_template(\n 'organizer/tag... | python | edit | 4 | 1 | bsd-2-clause | ba4f692e00d87afdd65d3a1b88046089b709eaab | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pecan.deploy import deploy\napp = deploy('/opt/web/draughtcraft/src/production.py')\n\nfrom paste.exceptions.errormiddleware import ErrorMiddleware\napp = ErrorMiddleware(\n app,\n error_email=app.conf.error_email,\n from_addr... | python | edit | 1 | 0 | bsd-3-clause | 922acafc793b3d32f625fe18cd52b2bfd59a5f96 | ryanpetrello/draughtcraft,ryanpetrello/draughtcraft,ryanpetrello/draughtcraft,ryanpetrello/draughtcraft | ansible/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.core.urlresolvers import reverse\nfrom django.db.models import Q\n\n\ndef multitenancy_enabled():\n return \"decisiontree.multitenancy\" in settings.INSTALLED_APPS\n\n\ndef get_tenants_for_us... | python | edit | 1 | 3 | bsd-3-clause | 462d94ddd57d2385889d2c6ef09563e38ffcccc9 | caktus/rapidsms-decisiontree-app,caktus/rapidsms-decisiontree-app,caktus/rapidsms-decisiontree-app | decisiontree/multitenancy/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nclass Database:\n def __init__(self, db):\n self.db = db\n self.cursor = db.cursor()\n\n def disconnect(self):\n self.cursor.close()\n self.db.close()\n\n def query(self, sql):\n self.cursor.exe... | python | edit | 1 | 2 | mit | 4de9bee656041c9cfcd91ec61d294460f6427d77 | aquaticpond/pyqodbc | lib/database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Module containing functions to compile and differentiate Theano graphs.\n\nimport theano.tensor as T\nimport theano\n\n# Compile objective function defined in Theano.\ndef compile(objective, argument):\n return theano.function([argumen... | python | edit | 1 | 1 | bsd-3-clause | 6ad647899d044cb46be6172cbea9c93a369ddc78 | j-towns/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,tingelst/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,nkoep/pymanopt | pymanopt/solvers/theano_functions/comp_diff.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport shutil\nimport pytest\n\nimport hug\n\nfrom overtime_calculator.src import api\nfrom overtime_calculator.src.auth import get_user_folder\n\n\ndef test_register():\n user_name = 'test1'\n response = hug.test.post(\n api,\... | python | edit | 3 | 2 | mit | 1f03b2945b4e52ce22a3b9e6143d02d3bd9aef99 | x10an14/overtime-calculator | overtime_calculator/tests/auth_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models.signals import (\n post_save,\n)\n\nfrom django.dispatch import receiver\n\nfrom .models import (\n Performance,\n Session,\n)\n\n\n@receiver(post_save, sender=Performance)\ndef performance_post_save(sender, i... | python | edit | 1 | 5 | bsd-2-clause | 2bab1888b43a9c232b37cc26c37df992ea5df2c5 | barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api | project/apps/api/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Portuguese Language Test - Python 3 Only!\nfrom seleniumbase.translate.portuguese import CasoDeTeste\n\n\nclass MinhaClasseDeTeste(CasoDeTeste):\n\n def test_exemplo_1(self):\n self.abrir_url(\"https://pt.wikipedia.org/wiki/\")\... | python | edit | 1 | 1 | mit | dffbc7d79c67c3629f718c7a0330f9922499640d | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | examples/translations/portuguese_test_1.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.