messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\nimport models\nimport os\nimport os.path\n\ndef init():\n models.db.connect()\n models.db.create_tables([models.Entry])\n\ndef digest(file_path):\n h = hashlib.sha1()\n file = open(file_path, 'rb')\n buf = fil... | python | edit | 1 | 4 | mit | c1f221b638405af81c637ddd79bd8c9eef24b488 | rschiang/pineapple.py | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nfrom importlib.metadata import version\n\nfrom packaging.version import parse\n\nextensions = [\n \"sphinx.ext.autodoc\",\n \"sphinx.ext.intersphinx\",\n \"sphinx.ext.extlinks\",\n \"sphinx_autodoc_typehi... | python | edit | 1 | 0 | apache-2.0 | 2faf0facda08df07fbe9ed5363a3546d726326f6 | asphalt-framework/asphalt-web | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"This module implements a client to the Gilda grounding web service,\nand contains functions to help apply it during the course of INDRA assembly.\"\"\"\n\nimport requests\nfrom .mapper import GroundingMapper\n\ngrounding_service_url =... | python | edit | 1 | 7 | bsd-2-clause | ae0e2a481f91e94cf05ac2df63f1d66f76a5e442 | bgyori/indra,johnbachman/belpy,johnbachman/belpy,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/indra,bgyori/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra | indra/preassembler/grounding_mapper/gilda.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models.signals import pre_save, post_save\nfrom django.dispatch import receiver\nfrom django.utils import timezone\nfrom cityhallmonitor.models import DirtyFieldsModel, \\\n Matter, MatterAttachment\n\n \n@receiver(pre... | python | edit | 1 | 14 | mit | c7cc0e24ea5d4cbb44665c1267a771f08f1bda4f | NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor | cityhallmonitor/signals/handlers.py | rejected_complexity | Cyclomatic complexity too high: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis demonstrates the most basic drawing capabilities using Enable. A new\ncomponent is created and added to a container.\n\"\"\"\nfrom enable.example_support import DemoFrame, demo_main\nfrom enable.api import Component, Container... | python | edit | 1 | 1 | bsd-3-clause | 38ed00b38d9cb005f9b25643afa7ce480da6febe | tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable | examples/enable/resize_tool_demo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -------------------------------------------------------------------------------------------------\n# RANGE\n# -------------------------------------------------------------------------------------------------\n\nprint('\\n\\t\\tRANGE\\n')\... | python | edit | 1 | 0 | mit | b4806b4650f576c7b5cd7f33742ccb108e37321c | CaptainMich/Python_Project | StartWithPython/StartWithPython/Theory/Loops/Range.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nfrom __future__ import absolute_import\nimport os\nimport texttable\n\n\ndef get_tty_width():\n tty_size = os.popen('stty size', 'r').read().split()\n if len(tty_size) != 2:\n return 80\... | python | edit | 1 | 2 | apache-2.0 | 8157f0887d5fe9b78f484b5a556555b8ee26145f | LuisBosquez/docker.github.io,simonista/compose,simonista/compose,jorgeLuizChaves/compose,calou/compose,gtrdotmcs/compose,joeuo/docker.github.io,charleswhchan/compose,ouziel-slama/compose,VinceBarresi/compose,goloveychuk/compose,Dakno/compose,shubheksha/docker.github.io,RobertNorthard/compose,dbdd4us/compose,sanscontext... | fig/cli/formatter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ndef copy_files(src, target_node, parent=None, name=None):\n \"\"\"Copy the files from src to the target node\n :param Folder src: The source to copy children from\n :param Node target_node: The node settings of the project to cop... | python | edit | 1 | 8 | apache-2.0 | 091f3c6eafcf2041517463e48f7209716a925b9f | aaxelb/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,saradbowman/osf.io,brianjgeiger/osf.io,adlius/osf.io,adlius/osf.io,cslzchen/osf.io,cslzchen/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,mfraezz/osf.io,mfraezz/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,cas... | website/files/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cv2\n\n\nclass FaceDetector:\n def __init__(self, face_cascade_path):\n self.faceCascade = cv2.CascadeClassifier(face_cascade_path)\n\n def detect(self, image, scale_factor=1.1, min_neighbors=5, min_size=(30, 30)):\n ... | python | edit | 1 | 2 | bsd-3-clause | 6420eca5e458f981aa9f506bfa6354eba50e1e49 | javaTheHutts/Java-the-Hutts | processing/face_detect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Setup Django\n\nfrom django.conf import settings\n\nsettings.configure(\n DEBUG=True,\n DATABASES={\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n },\n },\n CACHES=... | python | edit | 1 | 0 | mit | b654ce911d458fc623929ac2a2e04c995201eb1e | educreations/django-ormcache | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\n\nimport requests\n\n\n# local configuration\nremote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'remote')\n\n\n# URLs at which data can be found\ncsv_url_summary_sta... | python | edit | 1 | 0 | mit | 7d1f471f9723b7f8c12b5713a1a61f6391665009 | devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring | src/load_remote_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom django.test import TestCase\nfrom django.core.urlresolvers import reverse\n\nfrom molo.core.tests.base import MoloTestCaseMixin\n\n\n@pytest.mark.django_db\nclass TestImportFromGit(TestCase, MoloTestCaseMixin):\n\n ... | python | edit | 1 | 1 | bsd-2-clause | 93dfefff12569c180e20fefc9380358753c6771e | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | molo/core/tests/test_import_from_git_view.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"pep257 docstrings convention needs error code and class parser for be\nincluded as module into flakes8\n\"\"\"\nimport pep257\n\n__version__ = '0.2.0'\n\n\nclass pep257Checker(object):\n\n \"\"\"flake8 need... | python | edit | 1 | 3 | mit | 0989682ad858a6f14a1d387c24511b228881d645 | PyCQA/flake8-docstrings | flake8_docstrings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, abort, jsonify\nfrom flask_caching import Cache\nfrom flask_cors import CORS\n\nimport main\n\napp = Flask(__name__)\ncache = Cache(app, config={'CACHE_TYPE': 'simple'})\ncors = CORS(app, resources={r\"/*\": {\"orig... | python | edit | 1 | 3 | bsd-3-clause | a8b9e999a34039d64a2fe27b53a938feeb07a013 | talavis/kimenu | flask_app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport glob\nimport os\nimport pep8\n\n\nclass TestCodeFormat:\n def test_pep8(self):\n def match(*p):\n s = ['theanets'] + list(p) + ['*.py']\n return glob.glob(os.path.join(*s))\n pep8style = pep8.St... | python | edit | 1 | 1 | mit | dafbe424546020cc5a53eae5d10391d3dbf81870 | rodrigob/downhill,lmjohns3/downhill | test/style_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import NodeType, Node\n\n\nclass NodeTypeAdmin(admin.ModelAdmin):\n list_display = ('name',)\n\n\nclass NodeAdmin(admin.ModelAdmin):\n list_display = ('name', 'abbreviation',)\n\n\nadmi... | python | edit | 1 | 0 | mit | a3bb5ca86cbba530718e55f97407d7c5d3ad0a57 | alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft | stagecraft/apps/organisation/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom wafer.pages.models import Page\n\n\nclass PageSerializer(serializers.ModelSerializer):\n\n class Meta:\n model = Page\n\n def create(self, validated_data):\n # TODO: Impleme... | python | edit | 1 | 1 | isc | 11ab81f67df3f7579cb1b85d87499480c3cea351 | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | wafer/pages/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nmsg = {\n\t'en': {\n 'commons-file-moved' : u'[[:File:%s|File]] moved to [[:commons:File:%s|commons]].',\n 'commons-file-now-available' : u'File is now available on Wikimedia Commons.',... | python | edit | 1 | 0 | mit | 5b50b96b35c678ca17b069630875a9d86e2cbca3 | legoktm/pywikipedia-rewrite | scripts/i18n/commons.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.utils.translation import pgettext\nfrom satchless import cart\nfrom satchless.item import ItemList, ClassifyingPartitioner\n\nfrom ..product.models import DigitalShip\n\n\nclass Shipped... | python | edit | 1 | 2 | bsd-3-clause | a01d306a887eabc912a9e57af0ad862e6c45f652 | dashmug/saleor,taedori81/saleor,avorio/saleor,avorio/saleor,tfroehlich82/saleor,arth-co/saleor,laosunhust/saleor,dashmug/saleor,rchav/vinerack,arth-co/saleor,Drekscott/Motlaesaleor,taedori81/saleor,rchav/vinerack,josesanch/saleor,arth-co/saleor,KenMutemi/saleor,paweltin/saleor,KenMutemi/saleor,jreigel/saleor,Drekscott/... | saleor/cart/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\tThis file includes several data structures used in LeetCode question.\n\"\"\"\n# Definition for a list node.\nclass ListNode(object):\n\tdef __init__(self, n):\n\t\tself.val = n\n\t\tself.next = None\n\ndef createLinkedList(nodeli... | python | edit | 4 | 3 | mit | d2eb23a0dcf768d3d47966122b6f3717009eb2fd | comicxmz001/LeetCode,comicxmz001/LeetCode | Python/ds.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 __future__ import absolute_import\n\nimport mock\nfrom exam import fixture\n\nfrom sentry.testutils import TestCase\nfrom sentry.interfaces import User\nfrom sentry.models import Event\n\n\nclass UserTest(Tes... | python | edit | 1 | 1 | bsd-3-clause | 801a209eb208c629d4ea84199b7779e8c6a0396d | imankulov/sentry,BayanGroup/sentry,songyi199111/sentry,ifduyue/sentry,kevinlondon/sentry,JackDanger/sentry,zenefits/sentry,pauloschilling/sentry,kevinlondon/sentry,TedaLIEz/sentry,looker/sentry,camilonova/sentry,gg7/sentry,daevaorn/sentry,gg7/sentry,ngonzalvez/sentry,JamesMura/sentry,mitsuhiko/sentry,mvaled/sentry,wong... | tests/sentry/interfaces/user/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Handle handlers.\"\"\"\n\nimport logging\n\nclass Handlers(object):\n \"\"\"Handlers.\"\"\"\n\n def __init__(self, *handlers):\n self.handlers = handlers\n\n def handle(self, event, packet):\n \"\"\"Handle incom... | python | edit | 1 | 5 | mit | 9eafc01ef8260a313f2e214924cfd5bda706c1c0 | CactusDev/CactusBot | cactusbot/handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nclass Money(object):\n\n def __init__(self, amount, currency):\n self.amount = amount\n self.currency = currency.upper()\n\n def __repr__(self):\n return \"%.2f %s\" % (self.amount, self.currency)\n\n```\n\nAppl... | python | edit | 1 | 1 | mit | 3befcbaf3a78a46edc31cc1910fcd8e0a9381102 | mdsrosa/money-conversion-py | money_conversion/money.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport unittest\nimport glob\nimport sys\n\n\ndef create_test_suite(mod):\n if mod is None:\n test_file_strings = glob.glob('jinger/test/test_*.py')\n module_strings = [str[0:len(str)-3].replace('/'... | python | edit | 3 | 4 | mit | 48e63186b3f3912134c167a6f74ffe8a98de3b16 | naiquevin/jinger,naiquevin/jinger | testrunner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom elasticsearch_dsl.query import Q\n\nfrom froide.helper.search.views import BaseSearchView\nfrom froide.helper.search.filters import BaseSearchFilterSet\n\nfrom filingcabinet.models import Page\n\nfrom .documents import PageDocument\n\n... | python | edit | 1 | 2 | mit | 503e8f4ba3cbf388ffd9e88d58f783349d8354a3 | fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide | froide/document/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n## Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...\n## Ex: ./scalaBee 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,100000000\n\n# Importing everything needed\nimport ... | python | edit | 8 | 0 | mit | 121c76f6af1987ba8ebef4f506604d37e6608a64 | danielholanda/ScalaBee,danielholanda/ScalaBee | scalaBee.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic.list import ListView\nfrom django.views.generic import DetailView\n\nfrom rest_framework import viewsets\nfrom rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly\n\nfrom wafer.sponsors.models im... | python | edit | 1 | 1 | isc | 3a30074c13d1740ae24c8e381bd9d170ed6b6808 | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | wafer/sponsors/views.py | rejected_duplicate | Near-duplicate of sample 5228 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'gicmo'\nimport unittest\nimport nix.core\n\n\nclass TestFile(unittest.TestCase):\n def setUp(self):\n self.nix_file = nix.core.File.open('test.h5')\n assert(self.nix_file.version == '1.0')\n\n def basic_tes... | python | edit | 1 | 1 | bsd-3-clause | 4607e0d837829621a2da32581137cc6dcab306f5 | stoewer/nixpy,stoewer/nixpy | nix/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport kindred\n\ndef test_pubtator_pmid():\n\tcorpus = kindred.pubtator.load(19894120)\n\n\tassert isinstance(corpus,kindred.Corpus)\n\n\tdocCount = len(corpus.documents)\n\tentityCount = sum([ len(d.entities) for d in corpus.documents ]... | python | edit | 2 | 3 | mit | 5ffc1cc1d65b1e1bb364a8270b2a6a563c362733 | jakelever/kindred,jakelever/kindred | tests/test_pubtator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom modularodm import Q\n\n\nPREREG_CAMPAIGNS = {\n 'prereg': 'Prereg Challenge',\n 'erpc': 'Election Research Preacceptance Competition',\n}\n\ndef drafts_for_user(user, campaign):\n from osf import models # noqa\n\n PREREG_C... | python | edit | 1 | 2 | apache-2.0 | 1119a249d2e5dcbb2dd965a6e162d24e390d77f5 | chennan47/osf.io,monikagrabowska/osf.io,cwisecarver/osf.io,felliott/osf.io,mfraezz/osf.io,pattisdr/osf.io,binoculars/osf.io,hmoco/osf.io,laurenrevere/osf.io,TomBaxter/osf.io,Johnetordoff/osf.io,cwisecarver/osf.io,cslzchen/osf.io,sloria/osf.io,acshi/osf.io,mattclark/osf.io,hmoco/osf.io,laurenrevere/osf.io,monikagrabowsk... | website/prereg/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\n\n\nclass BaseHandler:\n def __init__(self, file, file_name):\n self.file = file\n self.file_name = file_name\n self.info = OrderedDict()\n\n def read(self, offset, size):\n ... | python | edit | 1 | 1 | mit | c61929f0d0d8dbf53ef3c9ff2a98cf8f249bfca4 | drx/rom-info | handlers/base_handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.exceptions import ObjectDoesNotExist\nfrom django.core.management.base import BaseCommand, CommandError\n\nfrom subscriptions.models import Subscription\n\n\nclass Command(BaseCommand):\n help = (\"Active subscription ho... | python | edit | 1 | 7 | bsd-3-clause | b20e236bd40c0d3c1d06aa1393f02b98e13e58bb | praekelt/seed-staged-based-messaging,praekelt/seed-stage-based-messaging,praekelt/seed-stage-based-messaging | subscriptions/management/commands/add_missed_call_service_audio_notification_to_active_subscriptions.py | rejected_duplicate | Near-duplicate of sample 10884 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# (C) 2015 Jean Nassar\n# Released under BSD version 4\n\"\"\"\nReduce /ardrone_camera framerate to 2 Hz.\n\n\"\"\"\nimport rospy\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvB... | python | edit | 1 | 2 | mit | 6f87c12306e0daaae2bcee3da3229f34fa7f464c | masasin/spirit,masasin/spirit | src/reduce_framerate.py | rejected_duplicate | Near-duplicate of sample 3994 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cfgen import cfgen\nfrom nose.tools import assert_equals\nimport os\n\ndef setup():\n os.chdir(\"test_dir\")\n clean()\n \n\ndef test_cmd_write():\n cfgen.cmd_write(\"test.cfg\")\n \n with open(\"test.cfg\") as actual... | python | edit | 1 | 3 | mit | 9e131c863c7ff147b95a016b0dfd52c03c60341e | rzhilkibaev/cfgen | tests/test_cmd_write.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Set up access to important employer data for IPython\"\"\"\n\nfrom dataclasses import dataclass\n\n@dataclass\nclass EmployerData:\n name: str\n\nwwts = EmployerData('wwts')\n\n```\n\nApply this change: Add functuion to ibots to na... | python | edit | 1 | 1 | mit | ea22192c9debe171db5d4b6b83d581fe079d6fa4 | jalanb/jab,jalanb/dotjab,jalanb/jab,jalanb/dotjab | ipython/profile_bots/startup/05-import-company.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add WindowAndTextCommand class to sublime_lib\n\nProbably has limited use but w/e."
},
{
"role": "assistant",
"content": "import sublime_plugin\nfrom sublime import Window, View\n\n\nclass WindowAndTextCommand(sublime_plugin.Wind... | python | new_file | 1 | 3 | mit | 61d42efa009525e5efd90d147ba70e038f978ae3 | SublimeText/PackageDev,SublimeText/AAAPackageDev,SublimeText/AAAPackageDev | Lib/sublime_lib/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom flask import Flask\nfrom flask.ext.autodoc import Autodoc\n\n\nclass TestAutodocWithFlask(unittest.TestCase):\n def setUp(self):\n self.app = Flask(__name__)\n self.autodoc = Autodoc(self.app)\n\n ... | python | edit | 1 | 1 | mit | b435bc206bfa6dc6654c5a904363faedc856835d | jwg4/flask-autodoc,jwg4/flask-autodoc | tests/test_flask_get.py | rejected_duplicate | Near-duplicate of sample 5816 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apa... | python | edit | 1 | 1 | apache-2.0 | eaea466e29725c04ccb31a24807668dee1a09a91 | turbomanage/training-data-analyst,GoogleCloudPlatform/training-data-analyst,GoogleCloudPlatform/training-data-analyst,turbomanage/training-data-analyst,GoogleCloudPlatform/training-data-analyst,GoogleCloudPlatform/training-data-analyst,GoogleCloudPlatform/training-data-analyst,turbomanage/training-data-analyst,turboman... | courses/developingapps/python/devenv/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\n\nimport djangae.sandbox as sandbox\n\n\ndef execute_from_command_line(argv=None):\n \"\"\"Wraps Django's `execute_from_command_line` to initialize a djangae\n sandbox before running a management command.\n\n Note:... | python | edit | 1 | 2 | bsd-3-clause | 9cb485e97873eff66ba283f30765bb9c66a3c864 | kirberich/djangae,nealedj/djangae,asendecka/djangae,stucox/djangae,martinogden/djangae,chargrizzle/djangae,stucox/djangae,armirusco/djangae,leekchan/djangae,armirusco/djangae,trik/djangae,jscissr/djangae,grzes/djangae,SiPiggles/djangae,trik/djangae,kirberich/djangae,armirusco/djangae,trik/djangae,asendecka/djangae,stuc... | djangae/core/management/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#_*_ coding: UTF-8 _*_\n\nfrom flask import render_template\n\nfrom application import app\nimport data_models\nimport views\n\nimport funds\nimport projects\nimport grants\nimport pledges\nimport suppliers\nimport supplier_funds\nimport in... | python | edit | 10 | 1 | mit | dc887df974cc9a060b048543d6280c5492ef8ac8 | keith-lewis100/pont-workbench,keith-lewis100/pont-workbench,keith-lewis100/pont-workbench | main/main.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.contrib.syndication.feeds import Feed\nfrom django.contrib.sites.models import Site\nfrom django.contrib import comments\n\nclass LatestCommentFeed(Feed):\n \"\"\"Feed of latest comments on t... | python | edit | 1 | 2 | bsd-3-clause | 788e6c081ba21fb75bc00195a82cb212542f7135 | jhoos/django,mttr/django,Leila20/django,GaussDing/django,h4r5h1t/django-hauthy,schinckel/django,ASCrookes/django,django-nonrel/django-nonrel,asser/django,whs/django,ckirby/django,whs/django,scorphus/django,nealtodd/django,beni55/django,leeon/annotated-django,andrewsmedina/django,nju520/django,taaviteska/django,marceloc... | django/contrib/comments/feeds.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport os\nimport pandas as pd\n\ndata_files = \"./data\"\n\ndef movingAv(interval, window_size):\n window = np.ones(int(window_size))/float(window_size)\n return np.convolve(inter... | python | edit | 1 | 1 | mit | 2cbbf3d2175f35370ca4e9a0a8d9e6f01f3a2240 | agurusa/practice_code,agurusa/practice_code | python_plot/plot_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom slackclient import SlackClient\n\nclass SlackBotConf(object):\n def __init__(self):\n self.username = 'Luigi-slack Bot'\n\nclass SlackAPI(object):\n \n def __init__(self, token, bot_conf=SlackBotConf()):\n ... | python | edit | 1 | 4 | mit | f2db056d4da23b96034f7c3ac5c4c12dd2853e91 | bonzanini/luigi-slack | luigi_slack/slack_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMisc. general utility functions, not tied to Kubespawner directly\n\"\"\"\nfrom concurrent.futures import ThreadPoolExecutor\nimport random\n\nfrom jupyterhub.utils import DT_MIN, DT_MAX, DT_SCALE\nfrom tornado import gen, ioloop\nf... | python | edit | 1 | 4 | bsd-3-clause | f106a434df84497e12cfbdf1e693e28b6c567711 | yuvipanda/jupyterhub-kubernetes-spawner,jupyterhub/kubespawner | kubespawner/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom django.conf import settings\nfrom django.core.mail import send_mail\nfrom django.contrib.sites.models import Site\nfrom django.template.loader import render_to_string\nfrom django.template import Context\n\nlogger = log... | python | edit | 1 | 3 | mit | b914fee46220633c81f244e388c9385614db7d60 | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | karspexet/ticket/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\n\nRESOURCE_METHODS = ['GET', 'POST', 'DELETE']\nITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']\nDATE_FORMAT = '%Y-%m-%d %H:%M:%S GMT'\n\nschema = {\n 'name': {\n 'type': 'string',\n ... | python | edit | 3 | 0 | mit | 0fe9fdce0ed5f0200450fd7e0e2bc9842ea4375d | waoliveros/historia | settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-06-27 19:14\nfrom __future__ import unicode_literals\n\nimport django.contrib.postgres.fields.ranges\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):... | python | edit | 1 | 0 | apache-2.0 | f155668bb622e442daffef86a2efddc89b48239a | qubs/data-centre,qubs/climate-data-api,qubs/climate-data-api,qubs/data-centre | climate_data/migrations/0026_auto_20170627_1914.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Adapted from https://raw.githubusercontent.com/hzy/django-polarize/master/runtests.py\n\nimport sys\n\nfrom django.conf import settings\nfrom django.core.management import execute_from_command_line\n\n\nif not set... | python | edit | 1 | 1 | bsd-3-clause | bb522a33096d7db252c02fda02e6419548094813 | limbera/django-nap,MarkusH/django-nap | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test file for syntax highlighting of editors.\n\nMeant to cover a wide range of different types of statements and expressions.\nNot necessarily sensical.\n\n\"\"\"\nassert True\ndef foo(): pass\nfoo() # Uncoloured\nwhile False: pass\... | python | edit | null | null | mit | 8548befae1c2fa2f0e607a39917f789c0a078235 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Misc/Vim/syntax_test.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport six\nfrom django.core.handlers.wsgi import WSGIHandler\n\nwsgi_tb = None\n\n\ndef null_technical_500_response(request, exc_type, exc_value, tb, status_code=500):\n \"\"\"Function to override django.views.d... | python | edit | 1 | 3 | mit | cd14ff6463d12c1e97be014766094ef90945e783 | django-extensions/django-extensions,django-extensions/django-extensions,django-extensions/django-extensions | django_extensions/management/technical_response.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom django.core.management.base import BaseCommand\nfrom apps.processing.ala.util import util\nfrom dateutil.parser import parse\nfrom datetime import date, timedelta\n\nlogger = logging.getLogger(__name__)\n\n\nclass Comma... | python | edit | 1 | 4 | bsd-3-clause | a5b3e991d128693e0d1f1ed6892c9c1c4a507a3d | gis4dis/poster,gis4dis/poster,gis4dis/poster | src/apps/processing/ala/management/commands/ala_import.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom AFQ import dki\nimport numpy.testing as npt\n\n\ndef test_fit_dki_inputs():\n data_files = [\"String in a list\"]\n bval_files = \"just a string\"\n bvec_files = \"just another string\"\n npt.assert_raises(ValueError, dki.f... | python | edit | 3 | 1 | bsd-2-clause | 1540d76aff3d01ea4d94eacab362a82458e65dd7 | yeatmanlab/pyAFQ,arokem/pyAFQ,yeatmanlab/pyAFQ,arokem/pyAFQ | AFQ/tests/test_dki.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport newrelic.agent\n\nlog = logging.getLogger(__name__)\n\n\ndef send_saved_search_alerts():\n from pmg import app\n from pmg.models import SavedSearch\n\n application = newrelic.agent.application()\n with new... | python | edit | 1 | 2 | apache-2.0 | 2cb8db4ba908fe0e28dc95287d57fcb013d3a6cd | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | pmg/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this... | python | edit | 1 | 2 | apache-2.0 | 5d50ab9457ef52d3b0a4d75966143245ed5ca305 | chamikaramj/beam,chamikaramj/beam,apache/beam,robertwb/incubator-beam,lukecwik/incubator-beam,robertwb/incubator-beam,robertwb/incubator-beam,chamikaramj/beam,apache/beam,lukecwik/incubator-beam,apache/beam,chamikaramj/beam,chamikaramj/beam,lukecwik/incubator-beam,robertwb/incubator-beam,robertwb/incubator-beam,chamika... | sdks/python/apache_beam/runners/worker/channel_factory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport os\n\nfrom apscheduler.schedulers.blocking import BlockingScheduler\nfrom raven.base import Client as RavenClient\n\nimport warner\nimport archiver\nimport announcer\nimport flagger\n\n\nraven_client = RavenClient()\n... | python | edit | 1 | 5 | apache-2.0 | 522e5e04b2a75a1c4c863116d8ada8c04e122c1a | royrapoport/destalinator,TheConnMan/destalinator,randsleadershipslack/destalinator,royrapoport/destalinator,TheConnMan/destalinator,randsleadershipslack/destalinator | scheduler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWhip's REST API\n\"\"\"\n\n# pylint: disable=missing-docstring\n\nfrom socket import inet_aton\n\nfrom flask import Flask, abort, make_response, request\n\nfrom .db import Database\n\napp = Flask(__name__)\napp.config.from_envvar('W... | python | edit | 1 | 2 | bsd-3-clause | 4ea6a11341c2bbd978d5e0e416c398a442158da6 | wbolster/whip | whip/web.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport re\nimport socket\nimport urllib\nfrom bs4 import BeautifulSoup\n\nlogger = logging.getLogger(__name__)\nWURSTBALL_RE = re.compile(\"^http[s]://wurstball.de/[0-9]+/\")\n\n\ndef default_handler(metadata):\n return {... | python | edit | 1 | 3 | mit | 4562f84191cde7b43ffb7e028eb33996789b1ea4 | horazont/xmpp-crowd | foomodules/link_harvester/common_handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9 on 2016-02-08 15:29\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('event... | python | edit | 1 | 0 | mit | 98bf53dd350869e31c89f14cb0ebfa6a467dd0ec | City-of-Helsinki/linkedevents,aapris/linkedevents,tuomas777/linkedevents,City-of-Helsinki/linkedevents,tuomas777/linkedevents,City-of-Helsinki/linkedevents,aapris/linkedevents,tuomas777/linkedevents,aapris/linkedevents | events/migrations/0017_auto_20160208_1729.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\n\nfrom globus_cli.parsing import common_options\nfrom globus_cli.safeio import FORMAT_TEXT_RAW, formatted_print\nfrom globus_cli.services.transfer import get_client\n\n\n@click.command(\n \"generate-submission-id\",\n sh... | python | edit | 1 | 1 | apache-2.0 | b2268ae4ecad477c46a4b99ec17511e2e535b9d0 | globus/globus-cli,globus/globus-cli | globus_cli/commands/task/generate_submission_id.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom Crypto.Cipher import AES\nimport json\nimport os\n\nKEY_LENGTH = 256\nBLOCK_LENGTH = 16\n\nKEY_FILE = 'key'\nENCRYPTED_FILE = 'data'\nDECRYPTED_FILE = 'tmp'\n\nEOT_CHAR = '\\x04'\n\ndef get_cipher(iv):\n try:\n key = open(KEY... | python | edit | 3 | 2 | unlicense | 487382ab2aafe1c92aa64192432379b4f3809732 | kvikshaug/pwkeeper | pywkeeper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ckan.plugins import toolkit as tk\n\n\ndef archiver_resource_show(resource_id):\n data_dict = {'id': resource_id}\n return tk.get_action('archiver_resource_show')(data_dict)\n\n\ndef archiver_is_resource_broken_html(resource):\n ... | python | edit | 1 | 3 | mit | 09ebeb873c83d51053ef6aa2d7c6ce47b4be5070 | ckan/ckanext-archiver,datagovuk/ckanext-archiver,datagovuk/ckanext-archiver,ckan/ckanext-archiver,datagovuk/ckanext-archiver,ckan/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver | ckanext/archiver/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright (C) 2014 PolyBeacon, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obta... | python | edit | 1 | 1 | apache-2.0 | 4ebc13ac1913dfe3fcd7bdb7c7235b7b88718574 | kickstandproject/fastdraw | fastdraw/api/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis plugin implements :func:`startTestRun`, setting a test executor\n(``event.executeTests``) that just collects tests without executing\nthem. To do so it calls result.startTest, result.addSuccess and\nresult.stopTest for ech test... | python | edit | 1 | 3 | bsd-2-clause | cb5591228408ccd22cfb3df9106d4ecdeac295a9 | ptthiem/nose2,ptthiem/nose2 | nose2/plugins/collect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Interface for Models.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport abc\nimport tensorflow as tf\n\nfrom keras import models\nfrom tf_trainer.common i... | python | edit | 5 | 1 | apache-2.0 | d587cc4f87276be1a95966a82293c4bc7bb02e26 | conversationai/conversationai-models,conversationai/conversationai-models | experiments/tf_trainer/common/base_model.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tablib\n\nfrom multi_import.fields import FieldHelper\n\n__all__ = [\n 'Exporter',\n]\n\n\nclass Exporter(FieldHelper):\n\n def __init__(self, queryset, serializer):\n self.queryset = queryset\n self.serializer = ... | python | edit | 1 | 3 | mit | fdf0d3240f7c2ccdfdd65d223f7949c98c9dc527 | sdelements/django-multi-import | multi_import/exporter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.\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... | python | edit | 1 | 1 | apache-2.0 | 9b5202ef3c27b44e70567b72a0657ae40557c041 | KristianJensen/cameo,biosustain/cameo,biosustain/cameo | tests/test_cobrapy_compatibility.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport argparse\n\nfrom lettuce.bin import main as lettuce_main\nfrom lettuce import world\nfrom selenium.webdriver.common.desired_capabilities import DesiredCapabilities\n\nBROWSER_CHOICES = [browser.lower()\n ... | python | edit | 1 | 1 | bsd-3-clause | 9121c8c074a31fd3668f8281c7f093360ed72988 | salad/salad,salad/salad,beanqueen/salad,beanqueen/salad | salad/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"Call the main setup_git.py. This should be\ncopied to the main directory of your project and named setup_git.py.\"\"\"\n\nimport os\nimport os.path\nos.system(os.path.join(\"tools\", \"dev_tools\", \"git\", \"... | python | edit | 1 | 0 | apache-2.0 | 21ac10919e4c63e8bb8760e186438e335a8f188c | salilab/rmf,salilab/rmf,salilab/rmf,salilab/rmf | setup_git.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\n\n\nclass ModelSmsAppConfig(AppConfig):\n name = 'ievv_opensource.ievv_sms'\n verbose_name = \"IEVV SMS\"\n\n def ready(self):\n from ievv_opensource.ievv_sms import sms_registry\n f... | python | edit | 1 | 1 | bsd-3-clause | c79944c39cb109430839cd92a366ab734aee0f64 | appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource | ievv_opensource/ievv_sms/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport numpy as np\nfrom six import string_types\n\nfrom ..plot_object import PlotObject\nfrom ..properties import Any, Float, Color\nfrom .. import palettes\n\nclass ColorMapper(PlotObject):\n '... | python | edit | 1 | 7 | bsd-3-clause | fc740373b772d46c8a0a3bf2cacef503df7e69ad | timsnyder/bokeh,khkaminska/bokeh,KasperPRasmussen/bokeh,almarklein/bokeh,rhiever/bokeh,matbra/bokeh,schoolie/bokeh,aavanian/bokeh,draperjames/bokeh,srinathv/bokeh,rs2/bokeh,rothnic/bokeh,CrazyGuo/bokeh,evidation-health/bokeh,ericmjl/bokeh,philippjfr/bokeh,stuart-knock/bokeh,DuCorey/bokeh,gpfreitas/bokeh,ptitjano/bokeh,... | bokeh/models/mappers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/env python\n\n# A-John-Shots - Python module/library for saving Security Hash Algorithms into JSON format.\n# Copyright (C) 2017 Funilrys - Nissar Chababy <contact at funilrys dot com>\n#\n# This program is free software: y... | python | edit | 1 | 1 | mit | a9b1d08e2e248b606ef269ebc7e3fb44698d3efc | funilrys/A-John-Shots | a_john_shots/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: UTF-8 -*-\n\"\"\"\n trytond_async.celery\n\n Implementation of the celery app\n\n This module is named celery because of the way celery workers lookup\n the app when `--proj` argument is passed to the worker. For m... | python | edit | 1 | 0 | bsd-3-clause | 16d99a20088e81045e34999b6045e9222d510cd5 | fulfilio/trytond-async,tarunbhardwaj/trytond-async | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef test_metronome(dcos_api_session):\n job = {\n 'description': 'Test Metronome API regressions',\n 'id': 'test.metronome',\n 'run': {\n 'cmd': 'ls',\n 'docker': {'image': 'busybox:latest'},\n ... | python | edit | null | null | apache-2.0 | e3d00e6c3e62e5cfa457529fc2dddfb814382db6 | dcos/dcos,amitaekbote/dcos,branden/dcos,mesosphere-mergebot/mergebot-test-dcos,surdy/dcos,mesosphere-mergebot/mergebot-test-dcos,surdy/dcos,kensipe/dcos,mellenburg/dcos,mellenburg/dcos,GoelDeepak/dcos,dcos/dcos,mellenburg/dcos,mesosphere-mergebot/dcos,kensipe/dcos,amitaekbote/dcos,kensipe/dcos,GoelDeepak/dcos,mesospher... | packages/dcos-integration-test/extra/test_metronome.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Facility to load plugins.\"\"\"\n\nimport sys\nimport os\n\nfrom importlib import import_module\n\n\nclass StraightPluginLoader(object):\n \"\"\"Performs the work of locating and loading straight plugins.\n \n This looks for ... | python | edit | 1 | 7 | mit | 954dd1a5ebafbe32c092265f5f508158f8b2742d | ironfroggy/straight.plugin,pombredanne/straight.plugin | straight/plugin/loader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors\n# MIT License. See license.txt\nfrom __future__ import unicode_literals\nimport frappe\nimport unittest\n\nfrom frappe.tests.test_website import set_request\nfrom frappe.... | python | edit | 1 | 1 | mit | 1a0eaa4aaab42fbdc26a4e5ab460d0042fa19509 | tmimori/frappe,paurosello/frappe,ESS-LLP/frappe,RicardoJohann/frappe,bohlian/frappe,bohlian/frappe,saurabh6790/frappe,mbauskar/frappe,adityahase/frappe,mbauskar/frappe,tundebabzy/frappe,yashodhank/frappe,bohlian/frappe,maxtorete/frappe,StrellaGroup/frappe,adityahase/frappe,frappe/frappe,ESS-LLP/frappe,maxtorete/frappe,... | frappe/website/doctype/blog_post/test_blog_post.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.template import Context, loader\n# Create your views here.\nfrom django.http import HttpResponse\n\nfrom Oar.models import Poll\nfrom django.http import HttpResponse\n\ndef main(request):\n return HttpResponse('<html><body>He... | python | edit | 4 | 1 | apache-2.0 | dcf11d2d26519cdea10813530d2bde85f8fe8180 | int19h/PTVS,huguesv/PTVS,zooba/PTVS,Microsoft/PTVS,Microsoft/PTVS,zooba/PTVS,Microsoft/PTVS,zooba/PTVS,zooba/PTVS,int19h/PTVS,int19h/PTVS,Microsoft/PTVS,Microsoft/PTVS,Microsoft/PTVS,int19h/PTVS,zooba/PTVS,zooba/PTVS,huguesv/PTVS,huguesv/PTVS,int19h/PTVS,huguesv/PTVS,int19h/PTVS,huguesv/PTVS,huguesv/PTVS | Python/Tests/TestData/DjangoProject/Oar/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ============================================================================\n# PAVER EXTENSION/UTILITY: Read PIP requirements files\n# ============================================================================\n# REQUIRES: paver >= 1.0... | python | edit | 1 | 3 | bsd-2-clause | be52bd5e578c54a816f8b786da5d8cf22fcc3ca8 | jenisys/behave,jenisys/behave | paver_ext/python_requirements.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rwt import launch\n\n\ndef test_with_path(tmpdir, capfd):\n\tparams = ['-c', 'import sys; print(sys.path)'\t]\n\tlaunch.with_path(str(tmpdir), params)\n\tout, err = capfd.readouterr()\n\tassert str(tmpdir) in out\n\n```\n\nApply this c... | python | edit | 1 | 1 | mit | 3ca03031599e2a1673c6349710489938f60f6a4d | jaraco/rwt | rwt/tests/test_launch.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add regression test for base_fieldsets fix."
},
{
"role": "assistant",
"content": "import re\nfrom django.contrib.admin.sites import AdminSite\nfrom django_webtest import WebTest\nfrom django.core.urlresolvers import reverse\nfro... | python | new_file | 1 | 1 | mit | bb3dfe39075876107fa992a66c16a5566a442d23 | ixc/django-polymorphic-auth | polymorphic_auth/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\ngargoyle\n~~~~~~~~\n\n:copyright: (c) 2010 DISQUS.\n:license: Apache License 2.0, see LICENSE for more details.\n\"\"\"\n\nfrom gargoyle.manager import gargoyle\n\ntry:\n VERSION = __import__('pkg_resources').get_distribution('ga... | python | edit | 3 | 3 | apache-2.0 | 7d81de637288ca694c139b3a7830f6e8ca00aa01 | nkovshov/gargoyle,YPlan/gargoyle,nkovshov/gargoyle,YPlan/gargoyle,roverdotcom/gargoyle,nkovshov/gargoyle,YPlan/gargoyle,roverdotcom/gargoyle,roverdotcom/gargoyle | gargoyle/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import request\nfrom flask.views import MethodView\nfrom flask_helpers.build_response import build_response\nfrom flask_helpers.ErrorHandler import ErrorHandler\nfrom python_cowbull_game.GameObject import GameObject\n\n\nclass Ga... | python | edit | 3 | 3 | apache-2.0 | 9c40c070b6c55d6eda2cabf4c1ebe062cebcfe8f | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | flask_controllers/GameModes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# (c) 2014 Bjoern Ricks <<EMAIL>>\n#\n# See LICENSE comming with the source of 'trex' for details.\n#\n\nfrom django.conf.urls import patterns, url\nfrom django.views.generic import TemplateView\n\nfrom trex.view... | python | edit | 1 | 0 | mit | de7e29622d6b8f18c25e483bc8bdac629e07964c | bjoernricks/trex,bjoernricks/trex | trex/urls.py | rejected_duplicate | Near-duplicate of sample 12976 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport abc\nimport copy\nimport werkzeug.routing\n\n\nclass Endpoint(metaclass=abc.ABCMeta):\n @abc.abstractproperty\n def url(self):\n pass\n\n @abc.abstractclassmethod\n def handle(self, **kwargs):\n pass\n\n ... | python | edit | 1 | 2 | mit | 9baae7a5c633399fe25ca6961e992b50adcd72b4 | prophile/jacquard,prophile/jacquard | jacquard/service/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility function for retrieving the active registration backend."
},
{
"role": "assistant",
"content": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils.importlib im... | python | new_file | 4 | 3 | bsd-3-clause | 953ffccae266f123a3b50f260af259bed1d1d336 | lubosz/django-registration,lubosz/django-registration | registration/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make @worker available for import on ass.ets."
},
{
"role": "assistant",
"content": "\nfrom bundles import Environment, Assets, Bundle, Manifest\nimport filters as f\nfrom options import Option, Options, Undefined, dict_getter\nf... | python | new_file | 12 | 0 | bsd-2-clause | f57c9643a32cca012fdccac40899c6de38e35af9 | kaste/ass.ets,kaste/ass.ets | ass/ets/__init__.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom app import create_app, db\nfrom app.utils.forms import RedirectForm\n\n\nclass TestRedirectForm(unittest.TestCase):\n def setUp(self):\n self.app = create_app('testing')\n self.app_ctx = self.app.app... | python | edit | 1 | 1 | mit | c1dff6850a0d39c39b0c337f4f5473efb77fc075 | Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger | tests/utils/test_forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Models.\"\"\"\nfrom django.db import models\nfrom django.contrib.auth.models import User\n\n\n# Create your models here.\n\n\nclass ImagerProfile(models.Model):\n \"\"\"Imager Profile Model.\"\"\"\n\n camera_model = models.CharF... | python | edit | 2 | 1 | mit | fdd1604ae64d72dc2391abe137adba07da830bcd | DZwell/django-imager | imagersite/imager_profile/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\n# Maximum airports to return as JSON.\nMAX_AIRPORTS = 100 \n\n# Maximum flights to return as JSON.\nMAX_FLIGHTS = 100 \n\n# Pixel size of gravatar icons.\nGRAVATAR_SIZE = 32 \n\n```\n\nApply this change: Reduce MAX_FLIGHTS on screen to ... | python | edit | 1 | 0 | bsd-2-clause | ad54fa1eae6ea255f8fc57f3bb7c36d410dab705 | stephenmcd/ratemyflight,stephenmcd/ratemyflight | ratemyflight/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" CLI logger \"\"\"\nfrom __future__ import unicode_literals\n\nimport logging\n\nimport coloredlogs\nimport requests\n\n\ndef init_logger(log_requests=False):\n \"\"\" Initialize the logger \"\"\"\n\n logger = logging.getLogger(... | python | edit | 1 | 5 | bsd-3-clause | 5d83c039391b83ce16f7499f463554b89168a55f | SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI | cumulusci/cli/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cement.ext.ext_argparse import expose\n\nfrom clowder.cli.abstract_base_controller import AbstractBaseController\n\n\nclass SaveController(AbstractBaseController):\n class Meta:\n label = 'save'\n stacked_on = 'base'\n... | python | edit | 1 | 4 | mit | c83a680603b83edafe61f6d41b34989c70a4e4ae | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder | clowder/clowder/cli/save_controller.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport distutils.core\nimport distutils.extension\n\nimport Cython.Distutils\nimport numpy as np\n\ncompile_args = ['-O3', '-march=native', '-ffast-math', '-std=c++14', '-fopenmp']\next_module = distutils.extension.Extension('spectrum_match... | python | edit | 1 | 0 | apache-2.0 | b6ee793158d549f3d04d42ecbeb1c63605d6258f | bittremieux/ANN-SoLo,bittremieux/ANN-SoLo | src/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for running TopoFlow components in CMI.\"\"\"\nimport os\n\n\ndef locate_topoflow(cache_dir):\n for x in os.listdir(cache_dir):\n if x.startswith('topoflow'):\n return x\n\n\nroot_dir = '/home/csdms/wmt/topo... | python | edit | 1 | 3 | mit | be23c953f8f27a8d178022d3ecb44f461100bbc5 | mdpiper/topoflow-cmi-testing | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom ddsc_incron.celery import celery\n\n# Note that logging to a single file from multiple processes is NOT supported.\n# See: http://docs.python.org/2/howto/logging-cookbook.html\n# #logging-to-a-... | python | edit | 1 | 0 | mit | b8ac4107535910e257de903d89f4879869035710 | ddsc/ddsc-incron | ddsc_incron/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom future.builtins import ( # noqa\n bytes, dict, int, list, object, range, str,\n ascii, chr, hex, input, next, oct, open,\n pow, round, filter, map, zip)\n\nimport re\n\n__author__ = 'sukrit'\n\n\"\"\"\nPackage that includes c... | python | edit | 1 | 2 | mit | 0f966f1622b5b61fc0a385eb13a7d270013104f9 | totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator | orchestrator/jinja/filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .api import (\n Distribution, PackageNotFoundError, distribution, distributions,\n entry_points, files, metadata, requires, version)\n\n# Import for installation side-effects.\nfrom . import _hooks # noqa: F401\n\n\n__all__ = [\... | python | edit | 1 | 0 | apache-2.0 | 1f3164f95f0ce40bac38ac384bf5fdd181ab5fa1 | python/importlib_metadata | importlib_metadata/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom indra.statements import Influence, Concept\nfrom indra.preassembler.ontology_mapper import OntologyMapper, wm_ontomap\n\n\ndef test_map():\n c1 = Concept('x', db_refs={'UN': [('entities/x', 1.0)]})\n c2 = Concept('y', db_refs={'B... | python | edit | 1 | 1 | bsd-2-clause | 7bece2c307cb05504c4b778446a4867ab8b6c196 | pvtodorov/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/belpy,bgyori/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,pvtodorov/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/indra,bgyori/indra,pvtodorov/indra,sorgerlab/indra,johnbachman/belpy,johnbachman/indra | indra/tests/test_ontmapper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport virtool.file\nfrom virtool.handlers.utils import json_response\n\n\nasync def find(req):\n db = req.app[\"db\"]\n\n cursor = db.files.find({\"eof\": True}, virtool.file.LIST_PROJECTION)\n\n found_count = await cursor.count()... | python | edit | 1 | 2 | mit | fe92323dfa1067d552abefa60910e758500f0920 | igboyes/virtool,virtool/virtool,virtool/virtool,igboyes/virtool | virtool/handlers/files.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\n\nimport botocore.exceptions\n\nfrom click import ClickException\n\n\nEXC_TO_ECHO = [\n botocore.exceptions.NoRegionError,\n]\n\n\ndef handle_exception(func):\n @wraps(func)\n def wrapper(*args, **kwarg... | python | edit | 1 | 3 | mit | 0c9bf270a7a2d8a4184f644bbe8a50995e155b0a | pior/buddy | buddy/error.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Game():\n def __init__(self):\n self._rolls = [0] * 21\n self._current_roll = 0\n\n def roll(self, pins):\n self._rolls[self._current_roll] += pins\n self._current_roll += 1\n\n def score(self):\n ... | python | edit | 1 | 4 | mit | f1e516e8002425f5f4f9904096848798b2bc97fa | JesusMtnez/devexperto-challenge,JesusMtnez/devexperto-challenge | jesusmtnez/python/kata/game.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport datetime\n\ncurrent_year = datetime.datetime.now().year\nyears_with_data = range(2011, current_year + 1)\nremote_path = \"https://ssl.netfile.com/pub2/excel/COAKBrowsable/\"\n\nfor year in years_with_data:\n print \"Downl... | python | edit | 2 | 0 | bsd-3-clause | ef82619995ce71b5877228988bce2830eb25baff | daguar/netfile-etl,daguar/netfile-etl | download_and_unzip_files.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.