messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport re\nimport sys\n\nfrom bs4 import BeautifulSoup\nfrom urllib.request import urlopen\n\nSCP_SERIES_REGEX = re.compile(r'/scp-[0-9]{3,4}')\n\ndef count_slots(url):\n with urlopen(url) as response:\n data ... | python | edit | 1 | 6 | mit | 27e14d057aad81f4686ed3def25cfffc8156fd4c | ammongit/scripts,ammongit/scripts,ammongit/scripts,ammongit/scripts | scp-slots.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom chainer import function\n\n\nclass Reshape(function.Function):\n\n \"\"\"Reshapes an input array without copy.\"\"\"\n\n def __init__(self, shape):\n self.shape = shape\n\n def forward(self, x):\n return x[0].res... | python | edit | 1 | 1 | mit | 76784dc06bc1d7fedb7e2e85f87fc4a2c2a489fc | muupan/chainer,niboshi/chainer,AlpacaDB/chainer,ktnyt/chainer,keisuke-umezawa/chainer,ytoyama/yans_chainer_hackathon,elviswf/chainer,wkentaro/chainer,jfsantos/chainer,chainer/chainer,ikasumi/chainer,hvy/chainer,okuta/chainer,bayerj/chainer,tigerneil/chainer,okuta/chainer,cupy/cupy,muupan/chainer,sinhrks/chainer,anaruse... | chainer/functions/reshape.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef is_palindrome_number(n): return n == n[::-1]\nlargest_number = 0\nfor x in xrange(100, 999):\n for y in xrange(100, 999):\n v = x * y\n if v > largest_number:\n if is_palindrome_number(str(v)):\n ... | python | edit | 3 | 5 | mit | 640e0d0c9ec58c534f4d08962dd558e87401abb2 | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | problem_4/solution.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport boto\nimport boto.s3\n\n# AWS ACCESS DETAILS\nAWS_ACCESS_KEY_ID = ''\nAWS_SECRET_ACCESS_KEY = ''\n\n# a bucket per author maybe\nbucket_name = 'boto-demo-1421108796'\nconn = boto.connect_s3(AWS_ACCESS_KEY_ID, AWS_SECRET_A... | python | edit | 1 | 1 | bsd-2-clause | f53f8b7cb7c45bc9bb7db65ebeb8791fd2e62873 | LeMeteore/ballin-octo-ninja | send_boto.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom fixtures import PostSerializer\n\n\ndef test_single(post):\n data = PostSerializer().to_json(post)\n\n assert json.loads(data) == {'posts': [{'id': 1, 'title': 'My title'}]}\n\n\ndef test_meta(post):\n data = Po... | python | edit | 1 | 1 | mit | 06dd856ce57193f34395f8ee6e7c7d3030356609 | kalasjocke/hyp | tests/test_single.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom troposphere import (\n Ref,\n)\n\nfrom troposphere.ec2 import (\n InternetGateway,\n Route,\n RouteTable,\n VPC,\n VPCGatewayAttachment,\n)\n\nfrom .template import template\n\n\nvpc = VPC(\n \"Vpc\",\n template... | python | edit | 1 | 0 | mit | 619033bc8daf3b8f5faafa95b04c06d98c39969f | caktus/aws-web-stacks,tobiasmcnulty/aws-container-basics | stack/vpc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass PythonWriter:\n def __init__(self, constants):\n self.constants = constants\n\n def write(self, out):\n out.write(\"# This file was generated by generate_constants.\\n\\n\")\n out.write(\"from enum import En... | python | edit | 1 | 4 | bsd-3-clause | 0a628ed81ca11fc4175b480aad9a136b8a4fe1c2 | barracudanetworks/constantsgen,barracudanetworks/constantsgen,barracudanetworks/constantsgen | constantsgen/pythonwriter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport StringIO\nimport os\nfrom rock.exceptions import ConfigError\n\n\nROCK_SHELL = os.environ.get('ROCK_SHELL', '/bin/bash -l -c').split()\n\n\nclass Shell(object):\n\n def __init__(self):\n self.stdin = StringIO.StringIO()\n\n... | python | edit | 1 | 2 | mit | 26e16c6229f12ca75c4bbf224eb9d1cf3b250b9c | silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock | rock/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Gevent needed for sockets\nfrom gevent import monkey\nmonkey.patch_all()\n\n# Imports\nimport os\nfrom flask import Flask, render_template\nfrom flask_socketio import SocketIO\nimport boto3\n\n# Configure app\nsocketio = SocketIO()\napp =... | python | edit | 3 | 1 | mit | 3c30166378d37c812cecb505a3d9023b079d24be | PapaCharlie/SteamyReviews,PapaCharlie/SteamyReviews,PapaCharlie/SteamyReviews,PapaCharlie/SteamyReviews | app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport re\n\nfrom collections import Counter\n\n\ndef check_for_flag_words(message, words_array):\n cnt = Counter()\n delims = '!\"#$%&()*+,./:;<=>?@[\\\\]^_`{|}~\\t\\n\\x0b\\x0c\\r '\n pa... | python | edit | 1 | 3 | apache-2.0 | 2a9c213c02abbabeddbf2a699fd6caf5e18bf6dd | jkvoorhis/cheeseburger_backpack_bot | utils/word_checking.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'mdavid'\n\nimport json\nimport re\nimport requests\n\nfrom blockexplorer.settings import WNS_URL_BASE\n\nWALLET_NAME_RE = re.compile('^([0-9a-z][0-9a-z\\-]*\\.)+[a-z]{2,}$')\nTIMEOUT_IN_SECONDS = 20\n\ndef is_valid_wallet_name... | python | edit | 1 | 5 | apache-2.0 | 19c46fd57e04a026c6e52e1be9ba265a82d651f1 | ychaim/explorer,blockcypher/explorer,blockcypher/explorer,ychaim/explorer,ychaim/explorer,blockcypher/explorer | walletname/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport msgpack\nimport logging\n\nfrom .constants import FAILURE_STATUS\n\n\nclass MessageFormatError(Exception):\n pass\n\n\nclass Request(object):\n \"\"\"Handler objects for frontend->backend objects messages\"\"\"\n def __new__... | python | edit | 1 | 5 | mit | 6c564ebe538d2723cc5f9397e09e5945796a257e | oleiade/py-elevator | pyelevator/message.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2013-2015, Sebastian Linke\n\n# Released under the Simplified BSD license\n# (see LICENSE file for details).\n\n\"\"\"\nConstants that are used by `shcol` in many places. This is meant to modified (i... | python | edit | 1 | 0 | bsd-2-clause | a7b1bc006c23f534820fe06dea2da3b6553b64df | seblin/shcol | shcol/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom re import search\nfrom flask import g\nfrom flask_restplus import abort\nfrom flask_httpauth import HTTPBasicAuth\nfrom app.models.user import User\nfrom instance.config import Config\n\nauth = HTTPBasicAuth()\n```\n\nApply this change... | python | edit | 2 | 2 | mit | 502ef2c155aeaed7a2b9a2e4ad0471f34ef3790f | Elbertbiggs360/buckelist-api | app/utils/utilities.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Increase permessable interval to +- 5 min"
},
{
"role": "assistant",
"content": "# допустимое отклонение от начала часа для фиксации замера\nPERMISSIBLE_PREC = 5\n"
}
] | python | new_file | 1 | 0 | bsd-3-clause | b0362233c278ed37c8d10ccdd60388e0fa749b4a | Igelinmist/etools,Igelinmist/etools | etools/apps/pcs/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom mongoengine import *\n\nfrom core.observables import Observable\nfrom core.observables import Hash\n\n\nclass File(Observable):\n\n value = StringField(verbose_name=\"SHA256 hash\")\n\n ... | python | edit | 10 | 1 | apache-2.0 | 74faea73440c4ff8b94493d5864e23e3fae7a53f | yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti | core/observables/file.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport sys, fileinput, subprocess\n\nerr=0\ncols=78\n\ntry:\n result=subprocess.check_output([ \"git\", \"config\", \"core.autocrlf\" ])\n autocrlf=result.strip() == b\"true\"\nexcept CalledProcessError:\n auto... | python | edit | 1 | 1 | apache-2.0 | 1d10582d622ce6867a85d9e4e8c279ab7e4ab5ab | ejjeong/rust,omasanori/rust,quornian/rust,mvdnes/rust,barosl/rust,aturon/rust,carols10cents/rust,mdinger/rust,AerialX/rust,krzysz00/rust,krzysz00/rust,sarojaba/rust-doc-korean,SiegeLord/rust,l0kod/rust,philyoon/rust,KokaKiwi/rust,nwin/rust,ktossell/rust,victorvde/rust,dwillmer/rust,0x73/rust,waynenilsen/rand,fabricedes... | src/etc/tidy.py | rejected_duplicate | Near-duplicate of sample 5423 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.template import Library\nfrom django.conf import settings\n\nregister = Library()\n\n\n@register.simple_tag()\ndef get_site_static_prefix():\n return settings.SITE_STATIC_PREFIX\n\n\n@register.filter('fieldtype')\ndef fieldty... | python | edit | 1 | 3 | bsd-2-clause | 2805eb26865d7a12cbc0e6f7a71dbd99ba49224e | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | gem/templatetags/gem_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Test the atexit module.\nfrom test_support import TESTFN, vereq\nimport atexit\nimport os\n\ninput = \"\"\"\\\nimport atexit\n\ndef handler1():\n print \"handler1\"\n\ndef handler2(*args, **kargs):\n print \"handler2\", args, kargs\... | python | edit | 5 | 0 | mit | b528b2cf4379369da8277a0a1c904267b5c7cf6f | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_atexit.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom flask import Flask\nfrom flaskext.seasurf import SeaSurf\n\n\nclass SeaSurfTestCase(unittest.TestCase):\n \n def setUp(self):\n app = Flask(__name__)\n app.debug = True\n app.secret_key = '... | python | edit | 1 | 1 | bsd-3-clause | eb98db3ceedca1a7dd043eb3579c35dd2257c2ee | heamon7/flask-seasurf,killpanda/flask-seasurf | test_seasurf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyramid.renderers import get_renderer\nfrom pyramid.view import view_config\n\nfrom . import get_report_info\nfrom . import list_employees\nfrom . import list_reports\n\ndef get_main_template(request):\n main_template = get_renderer... | python | edit | 1 | 3 | apache-2.0 | f1cf2d2e9cbdd4182a5a755b5958e499fc9d9585 | GoogleCloudPlatform/google-cloud-python-expenses-demo,GoogleCloudPlatform/google-cloud-python-expenses-demo | gcloud_expenses/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom contextlib import contextmanager\nfrom django.conf import settings\ntry:\n from django.conf.urls.defaults import patterns, url, include\nexcept ImportError:\n from django.conf.urls import patterns, url, i... | python | edit | 1 | 2 | bsd-3-clause | 099545e7a68ef82af8e8db15dc21746553143310 | ojii/django-statictemplate,bdon/django-statictemplate,yakky/django-statictemplate | statictemplate/management/commands/statictemplate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport yaml\nfrom .util import string\n\nclass ConfigReader(object):\n def __init__(self, config_file_path):\n self._config = self._read(config_file_path)\n\n def _read(self, config_file_path):\n try:\n with o... | python | edit | 1 | 2 | mit | 4381c4cabbeb870f3fe18da4e7bbdee9a39c55fd | anishathalye/dotbot,pulgalipe/dotbot,pulgalipe/dotbot,imattman/dotbot,imattman/dotbot,pulgalipe/dotbot,bchretien/dotbot,imattman/dotbot,anishathalye/dotbot,bchretien/dotbot,bchretien/dotbot | dotbot/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\nfrom pysyte.types.paths import path\n\n\ndef value(key):\n \"\"\"A value from the shell environment, defaults to empty string\n\n >>> value('SHELL') is not None\n True\n \"\"\"\n try:\n return os.environ... | python | edit | 1 | 6 | mit | 208081800ab7e6217ec0f88e76c2dffd32187db1 | jalanb/what,jalanb/what | whyp/shell.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMiscellaneous utilities used throughout the library.\n\"\"\"\nimport collections.abc\n\n\nclass IterToAiter(collections.abc.Iterator, collections.abc.AsyncIterator):\n \"\"\"\n Transforms an `__iter__` method into an `__aiter_... | python | edit | 1 | 2 | mit | 4409823a5611d0f426ca09541d7e9dc982bc8c9f | SunDwarf/asyncqlio | asyncqlio/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nSnipped to download current IKEA ZLL OTA files into ~/otau\ncompatible with python 3.\n\"\"\"\n\nimport os\nimport json\ntry:\n\tfrom urllib.request import urlopen, urlretrieve\nexcept ImportError:\n\tfrom url... | python | edit | 1 | 0 | bsd-3-clause | 5e5f5c8bfb5b61bd87ff4e55004e80c0e7edf408 | dresden-elektronik/deconz-rest-plugin,dresden-elektronik/deconz-rest-plugin,dresden-elektronik/deconz-rest-plugin,dresden-elektronik/deconz-rest-plugin,dresden-elektronik/deconz-rest-plugin | ikea-ota-download.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Team nameSpace@HINT2017\n\n#\n# This script contains a function which takes a URL as input\n# and returns the content of the content in the webpage\n\n# 'newspaper' library is used here to extract only the main\n# content in a webpage\nfr... | python | edit | 4 | 2 | mit | d8965e937a0f5b649c80c9ac14a3d5652d5a1859 | urdarinda/LISTS,urdarinda/LISTS,urdarinda/LISTS | getContentFromURL.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Internal modules #\nfrom plumbing.graphs import Graph\nfrom plumbing.autopaths import FilePath\n\n# Third party modules #\nfrom matplotlib import pyplot\n\n# Constants #\n__all__ = ['LengthDist']\n\n#######################################... | python | edit | 1 | 3 | mit | c727f8382237c177d508d5113a7e3b8ca8ea7066 | xapple/fasta | fasta/graphs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\nimport logging\n\nfrom celery import shared_task\nfrom django.utils import timezone\n\nfrom invoice.models import InvoiceUser\nfrom mail.service import queue_mail_message\nfrom mail.tasks import process_mail\nfrom... | python | edit | 1 | 8 | apache-2.0 | 243bb615c579c0598a2f2be5791d3d5092dcd556 | pkimber/invoice,pkimber/invoice,pkimber/invoice | invoice/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Lises team\n@contact: <EMAIL>\n@license: The MIT license\n\nCopyright (C) 2015\n\"\"\"\n```\n\nApply this change: Create decorator for catching plugin errors"
},
{
"role": "assistant",
... | python | edit | 1 | 2 | mit | 1851190543d24d6f4c26a5d7a3a04f56aeba511d | lises/sheldon | sheldon/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport training_data\nimport re\nimport math\n\nclass Classifier:\n\tdef classify(self,text,prior=0.5,c=10e-6):\n\t\t\"\"\" Remove a pontuacao do texto \"\"\"\n\t\twords = re.findall(r\"[\\w']+\",text)\n\t\t\"\"\"words = text.split()\"\"\"... | python | edit | 1 | 3 | mit | 301fd00ea31346126d78696c50ac9daf1b76a428 | anishihara/SpamFilter | classifier.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom osgtest.library import core\nfrom osgtest.library import service\n\ndef name():\n if core.el_release() < 7:\n return 'mysql'\n else:\n return 'mariadb'\n\ndef daemon_name():\n if core.el_release() < ... | python | edit | 1 | 2 | apache-2.0 | bc083087cd7aadbf11fba9a8d1312bde3b7a2a27 | efajardo/osg-test,efajardo/osg-test | osgtest/library/mysql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom app.views.export import write_all_measurements_csv\nimport tempfile\nimport os\n\nf = open(\"app/static/exports/AllMeasurements_inprogress.csv\", \"w\")\n\ntry:\n write_all_measurements_csv(f)\n\nfinally:\n ... | python | edit | 3 | 0 | mit | 4cd0d2a947bbfa9ba830c4dc543b1688ecf2e54f | rabramley/telomere,rabramley/telomere,rabramley/telomere | produceEports.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport snapcraft\n\nclass ShellPlugin(snapcraft.BasePlugin):\n\t@classmethod\n\tdef schema(cls):\n\t\tschema = super().schema()\n\n\t\tschema['required'] = []\n\n\t\tschema['properties']['shell'] = {\n\t\t\t'type': 'string',\n\t\t\t'default... | python | edit | 1 | 1 | mit | 4072f8ec6e1908d6e84859c8a0bd6c96562ea5cc | infosiftr/snap-docker,docker-snap/docker,docker-snap/docker | parts/plugins/x-shell.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\n\n\nclass DataStore(object):\n def __init__(self, storagePath=\"desertbot_data.json\"):\n self.storagePath = storagePath\n self.data = {}\n self.load()\n\n def load(self):\n if not o... | python | edit | 1 | 3 | mit | f035ca424504a37e350fd009e973b89ba7e00670 | DesertBot/DesertBot | desertbot/datastore.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Node(object):\n def __init__(self, val, next=None):\n self.val = val\n self.next = next\n\n def __repr__(self):\n return '{val}'.format(val=self.val)\n\n\nclass LinkedList(object):\n def __init__(self, it... | python | edit | 1 | 3 | mit | 1d828dfdb77cf69ce88386c3bb98036d851a891a | sjschmidt44/python_data_structures | data_structures/linked_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nimport os.path\nimport site\n\ndef main():\n '''\\\n Check if the given prefix is included in sys.path for the given\n python version; if not find an alternate valid prefix. Print the\n resu... | python | edit | 1 | 6 | bsd-2-clause | 338672c4f79fe01b4801346594bcd0d95a925e75 | D3f0/coreemu,abn/coreemu,cudadog/coreemu,cudadog/coreemu,abn/coreemu,D3f0/coreemu,abn/coreemu,D3f0/coreemu,eiginn/coreemu,eiginn/coreemu,cudadog/coreemu,eiginn/coreemu | python-prefix.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.decorators import login_required\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render\nfrom django.urls import reverse\n\nfrom .forms import *\nfrom .models import *\n\n\n@login_require... | python | edit | 12 | 6 | mit | bbb12dd60222ae617e5ed70d37c0ea3d350b9f3a | saanobhaai/apman,saanobhaai/apman | satsound/views.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nfrom flask import Request\n\n\nclass AcceptRequest(Request):\n\n _json_mimetypes = ['application/json',]\n\n _html_mimetypes = ['text/html', 'application/xhtml+xml']\n\n _xml_mimetypes = ['a... | python | edit | 1 | 3 | bsd-2-clause | 788f9f3d917491355e819263c754ec637caaf261 | paxswill/evesrp,paxswill/evesrp,paxswill/evesrp | evesrp/util/request.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Ensure filenames for test-*.bash scripts match the config name registered\ninside them.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport sys\n\nfor line in sys.stdin.readline... | python | edit | 1 | 0 | apache-2.0 | 46ab82bf387b6f7d13abc94bacb16b76bc292080 | chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,chizarlicious/chapel,chizarlicious/chapel... | util/cron/verify_config_names.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A set of functions to standardize some options for python scripts.\"\"\"\n\n\ndef setup_parser_help(parser, additional_docs=None):\n \"\"\"\n Set formatting for parser to raw and add docstring to help output\n\n Parameters\n ... | python | edit | 1 | 2 | bsd-3-clause | a967b62c5f11b35ac3b31d64975ea62471be8295 | mwcraig/msumastro | script_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom boltiot.urls import url\nimport requests\n\ndef request_from(url, *kwargs):\n try:\n response = str(requests.get(url.format(*kwargs)).text)\n return response\n except requests.exceptions.ConnectionError as err:\n ... | python | edit | 8 | 6 | mit | 3699cc594d9a4f02d24308cb41b8757124616f78 | Inventrom/bolt-api-python | boltiot/requesting.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n flask_cors\n ~~~~\n Flask-CORS is a simple extension to Flask allowing you to support cross\n origin resource sharing (CORS) using a simple decorator.\n\n :copyright: (c) 2014 by Cory Dolphin... | python | edit | 3 | 1 | mit | 3b30a036f9f9fb861c0ed1711b5bd967756a072d | corydolphin/flask-cors,ashleysommer/sanic-cors | flask_cors/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..layers.core import Layer\nfrom ..utils.theano_utils import shared_zeros\nfrom .. import initializations\n\nclass BatchNormalization(Layer):\n '''\n Reference: \n Batch Normalization: Accelerating Deep Network Tra... | python | edit | 1 | 3 | mit | 54691f9be052e5564ca0e5c6a503e641ea3142e1 | yingzha/keras,imcomking/Convolutional-GRU-keras-extension-,jayhetee/keras,why11002526/keras,marchick209/keras,relh/keras,mikekestemont/keras,florentchandelier/keras,jbolinge/keras,tencrance/keras,meanmee/keras,kuza55/keras,nehz/keras,keras-team/keras,EderSantana/keras,kemaswill/keras,abayowbo/keras,dhruvparamhans/keras... | keras/layers/normalization.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom compat import patterns, url\nfrom django.conf import settings\n\nurlpatterns = patterns('hijack.views',\n url(r'^release-hijack/$', 'release_hijack', name='release_hijack'),\n)\n\nif getattr(settings, \"HIJACK_NOTIFY_ADMIN\", False)... | python | edit | 1 | 0 | mit | 7feb7eeba7e591f7a0c1cbf3b72efb099bd9f644 | arteria/django-hijack,arteria/django-hijack,arteria/django-hijack | hijack/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gettext import gettext as _\n\n\nclass Fixed:\n _(\"A mixin that ensures the presence of a predetermined value\")\n\n def __init__(self, value, *args, **kwargs):\n self.value = value\n super(Fixed, self).__init__(*a... | python | edit | 1 | 2 | bsd-3-clause | e0308672543d0bbe8309351c9d63732d0d0e3e30 | gulopine/steel-experiment | steel/fields/mixin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom cStringIO import StringIO\nfrom nose.tools import *\n\nfrom parse import EeyoreLexer\n\ndef _lex( string ):\n return list( EeyoreLexer.Lexer( StringIO( string ) ) )\n\ndef _assert_token( token, ( text, tp ) ):\n assert_equal( t... | python | edit | 7 | 3 | mit | 5f6ba1b3a1f2798df1e17d2c29785f04939bd847 | andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper | src/test/testlexer.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport subprocess\nimport sys\n\nfrom githistorydata.csv import Csv\nfrom githistorydata.expand_commits import expand_authors, expand_lines\nfrom githistorydata.git import Git\nfrom githistorydata.rawgit import RawGit\n\n\ndef main( argv,... | python | edit | 3 | 4 | bsd-2-clause | ad477313b38ff97c69c5bd281a540138c04354e2 | andybalaam/git-history-data,andybalaam/git-history-data | githistorydata/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nfrom app import create_app\nfrom flask.ext.script import Manager, Server\nimport watchtower\nimport logging\n\n\napplication = create_app(\n os.getenv('EQ_ENVIRONMENT') or 'development'\n)\napplication... | python | edit | 1 | 0 | mit | a6a405cbcb3ba2696d63473f0f7892b18ac0e6dc | ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner | application.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport logging\n\nfrom version import __version__\n\nlogger = logging.getLogger(__name__)\nlogger.debug('Loading %s ver %s' % (__name__, __version__))\n\n\n# Actions represents the available textual items that can be passed to main\n# to ... | python | edit | 1 | 4 | mit | a8811b5a746533467281437575b1fbaf776e5df9 | fancystats/nhlstats | nhlstats/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom PIL import Image\n\nfrom appconf import AppConf\n\n\nclass AvatarConf(AppConf):\n DEFAULT_SIZE = 80\n RESIZE_METHOD = Image.ANTIALIAS\n STORAGE_DIR = 'avatars'\n GRAVATAR_BASE_URL = 'http:/... | python | edit | 1 | 2 | bsd-3-clause | 6184fb10b7a48df4e7c75485ed12b4a389dd3c3c | therocode/django-avatar,dannybrowne86/django-avatar,brajeshvit/avatarmodule,barbuza/django-avatar,imgmix/django-avatar,grantmcconnaughey/django-avatar,jezdez/django-avatar,ad-m/django-avatar,MachineandMagic/django-avatar,jezdez/django-avatar,grantmcconnaughey/django-avatar,brajeshvit/avatarmodule,therocode/django-avata... | avatar/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n#\n# Author: Massimo Menichinelli\n# Homepage: http://www.openp2pdesign.org\n# License: MIT\n#\n\nimport xlsxwriter\n\n# Create the file\nworkbook = xlsxwriter.Workbook('FabLab-BusinessPlan.xlsx')\n\n# Create the ... | python | edit | 1 | 0 | mit | 637953efa1f71b123bb28c8404b79219a6bd6b3e | openp2pdesign/FabLab-BusinessPlan | fablab-businessplan.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom catinabox import cattery\n\n\n###########################################################################\n# add_cats\n###########################################################################\n\ndef test__add_cats__... | python | edit | 1 | 1 | mit | 2d94532e316e9ad563b3b7506d47cfd78ca7f689 | indexOutOfBound5/catinabox | tests/test_cattery.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nimport Adafruit_BBIO.GPIO as GPIO\nimport Adafruit_BBIO.UART as UART\nimport serial\n\nDYLOS_POWER_PIN = \"P8_10\"\nLOGGER = logging.getLogger(__name__)\n\nclass Dylos:\n def __init__(self, port='/dev/ttyO1', baudrate=9... | python | edit | 1 | 5 | apache-2.0 | 01fce49f6ecb0a5c6ff5db858efd0ea1e88608b3 | VDL-PRISM/dylos | sensors/dylos.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import routers, serializers, viewsets\nimport models\n\n# Serializers define the API representation.\nclass AttributeSerializer(serializers.ModelSerializer):\n class Meta:\n model = models.Attribute\nclass Attribu... | python | edit | 3 | 1 | bsd-2-clause | 80de36ddbe4e2eb2e0d00d5910ab8c199d1a6edb | jhogg41/gm-o-matic,jhogg41/gm-o-matic,jhogg41/gm-o-matic | gom_server/char_attr/router.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nsentry.app\n~~~~~~~~~~\n\n:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n\nfrom sentry.conf import settings\nfrom sentry.utils.imports import import... | python | edit | 1 | 2 | bsd-3-clause | 2ecdd2feb18ef23610e55242b70b64ce0d6f6fe9 | mvaled/sentry,llonchj/sentry,argonemyth/sentry,songyi199111/sentry,1tush/sentry,fotinakis/sentry,BayanGroup/sentry,alexm92/sentry,NickPresta/sentry,fotinakis/sentry,jokey2k/sentry,looker/sentry,fuziontech/sentry,imankulov/sentry,felixbuenemann/sentry,boneyao/sentry,Kryz/sentry,drcapulet/sentry,rdio/sentry,SilentCircle/... | src/sentry/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Work around Django bug in manage.py\n\nmanage.py is ignoring DJANGO_SETTINGS_MODULE, so this way we can run it without specifying the settings during development"
},
{
"role": "assistant",
"content": "# this is a hack to work aro... | python | new_file | 2 | 0 | mit | 177418e6331f8fb02f8176ea37dc7aef2f586586 | QLGu/djangopackages,nanuxbe/djangopackages,miketheman/opencomparison,miketheman/opencomparison,benracine/opencomparison,pydanny/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,benracine/opencomparison,QLGu/djangopackages,audreyr/opencomparison,pydanny/djangopackages,nanuxbe/djangopackages,audreyr/opencomparis... | settings/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os.path import expanduser\n\nfrom photofolder import Photofolder\nfrom folder import RealFolder\nfrom gphotocamera import Gphoto\nfrom main import Photobox\nfrom switch import KeyboardSwitch\n# from rcswitch import RCSwitch\n\n########... | python | edit | 3 | 0 | mit | 6d859d72ac2091b1f5bc50c5a5c8d13cd13ff697 | MarkusAmshove/Photobox | photobox/photobox.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nfrom isserviceup.services.models.service import Service, Status\n\n\nclass Heroku(Service):\n name = 'Heroku'\n status_url = 'https://status.heroku.com/'\n icon_url = '/images/icons/heroku.png'\n\n def get_sta... | python | edit | 1 | 5 | apache-2.0 | 6611641fec2342fa8dcfdbf12d74558df65ed2eb | marcopaz/is-service-up,marcopaz/is-service-up,marcopaz/is-service-up | isserviceup/services/heroku.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom tasks import task1, task2\nimport flask\n\n\ndef index():\n return flask.render_template('index.html', title='index')\n\n\ndef app_factory():\n app = flask.Flask(import_name=__package__)\n app.add_ur... | python | edit | 1 | 1 | bsd-2-clause | c79bec872f1bd9158d202cade39d5e2351688c22 | cutoffthetop/hireme | src/hireme/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django import forms\nfrom django.db.models import get_model\nfrom django.forms.models import inlineformset_factory, fields_for_model\n\nWishList = get_model('wishlists', 'WishList')\nLine = get_model('wishlists... | python | edit | 3 | 1 | bsd-3-clause | fcddaececf4d30fa8588f72812338e551efea056 | faratro/django-oscar,vovanbo/django-oscar,ademuk/django-oscar,jinnykoo/wuyisj.com,kapt/django-oscar,eddiep1101/django-oscar,itbabu/django-oscar,nfletton/django-oscar,jlmadurga/django-oscar,solarissmoke/django-oscar,jinnykoo/wuyisj.com,MatthewWilkes/django-oscar,mexeniz/django-oscar,jinnykoo/wuyisj,michaelkuty/django-os... | oscar/apps/wishlists/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom diary.models import DiaryItem, EventLocation, ImageItem\n\nclass DiaryAdmin(admin.ModelAdmin):\n list_display = ('title', 'start_date', 'start_time', 'author', 'location')\n\n# Register your models he... | python | edit | 1 | 2 | mit | a5dd30e38e58c08d67a2f831e2ae3cbc4a288337 | DevLoL/devlol.at,DevLoL/devlol.at,DevLoL/devlol.at,DevLoL/devlol.at | diary/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n# (c) 2013 Mike Lewis\nimport logging; log = logging.getLogger(__name__)\n\nfrom . import BaseAuthenticatedEndpointTestCase, BaseUserlessEndpointTestCase\n\nimport os\n\nTEST_DATA_DIR = os.pat... | python | edit | 3 | 2 | mit | 27a7e589ec3f5b29d99cede4af66780509ab6973 | mLewisLogic/foursquare,mLewisLogic/foursquare | foursquare/tests/test_photos.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\nThis runner is designed to mirror the execution module config.py, but for\nmaster settings\n'''\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport salt.utils\n\n\ndef get(k... | python | edit | 3 | 2 | apache-2.0 | 8812341b705e6cec98b2708d0a1481d769f5f476 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/runners/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\ntry:\n # Configure a generator if the user is using model_mommy\n\n from model_mommy import generators\n\n def gen_translatablecontent(max_length):\n from fluent.fields import TranslatableContent\n return Translat... | python | edit | 1 | 1 | mit | faa4125dd8c491eb360ccfea5609a0dabb3cccda | potatolondon/fluent-2.0,potatolondon/fluent-2.0 | fluent/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom click.testing import CliRunner\n\nfrom cli import main\n\n\n@pytest.fixture\ndef runner():\n return CliRunner()\n\n\n@pytest.fixture(params=['fr', 'en', 'tlh'])\ndef lang(request):\n return request.param\n\n\n@pyte... | python | edit | 1 | 1 | mit | 1020bf478da327ddb805b28c6676c58ccef6675e | hackebrot/cookiedozer,hackebrot/cookiedozer | {{cookiecutter.repo_name}}/tests/test_cli.py | rejected_duplicate | Near-duplicate of sample 6241 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom .defaults import * # noqa\n\ntry:\n from .local import * # noqa\nexcept ImportError as error:\n logging.warn('No local.py settings file found')\n\n```\n\nApply this change: Use namespaces logger in mendeley sett... | python | edit | 3 | 0 | apache-2.0 | a292f2978f07839af07a8963a51fd48b046f0c73 | brianjgeiger/osf.io,Johnetordoff/osf.io,samchrisinger/osf.io,KAsante95/osf.io,crcresearch/osf.io,arpitar/osf.io,danielneis/osf.io,cslzchen/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,asanfilippo7/osf.io,kwierman/osf.io,SSJohns/osf.io,GageGaskins/osf.io,GageGaskins/osf.io,danielneis/osf.io,brandonPurvis/osf.io,emetsger/o... | website/addons/mendeley/settings/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\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.apache.org/licenses/LICENSE-2.0\n#\n# U... | python | edit | 1 | 7 | apache-2.0 | 4e9c0cb3cd0d74ce008f0279bc6e9ec353c03fee | openstack/senlin-dashboard,stackforge/senlin-dashboard,stackforge/senlin-dashboard,openstack/senlin-dashboard,stackforge/senlin-dashboard,openstack/senlin-dashboard,openstack/senlin-dashboard | senlin_dashboard/api/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nFunctions for performing test setup/teardown etc.\n\"\"\"\n\nimport os\n\nMODELDIR = \"etc/defaultmodels\" \n\n\ndef symlink_model_fixtures():\n \"\"\"\n Create symlinks between the files referenced in the OcrModel\n fixtur... | python | edit | 17 | 6 | apache-2.0 | a5ceaa6401c53fc99a85ef69ee1357996877e141 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | ocradmin/core/tests/testutils.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#==============================================================================\n# Script for creating MySQL user\n#==========================================================================... | python | edit | 4 | 0 | mit | 5812aae9059ede1a3cb19be9033ebc435d5ebb94 | alberand/tserver,alberand/tserver,alberand/tserver,alberand/tserver | scripts/create_user.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nLog file parsers provided by Sentry Logs\n\"\"\"\nimport tailer # same functionality as UNIX tail in python\n\nfrom ..helpers import send_message\n\n\nclass Parser(object):\n \"\"\"Abstract base class for any parser\"\"\"\n\n ... | python | edit | 1 | 3 | bsd-3-clause | d8b13dcb884046ee43d54fcf27f1bbfd0ff3263a | bittner/sentrylogs,mdgart/sentrylogs | sentrylogs/parsers/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom persistent.mapping import PersistentMapping\n\n\nclass Root(PersistentMapping):\n __parent__ = __name__ = None\n\n\ndef appmaker(zodb_root):\n if not 'app_root' in zodb_root:\n app_root = Root()\n zodb_root['app_roo... | python | edit | 1 | 2 | bsd-3-clause | 9ea7e49e11c3e05b86b9eeaffd416285c9a2551a | ucla/PushHubCore | pushhub/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Python Packages\r\nimport random\r\n\r\n# External Packages\r\nimport numpy as np\r\n\r\n\r\ndef sin_theta_sum(variables):\r\n\r\n theta = 0\r\n for var in variables:\r\n theta += var\r\n return np.sin(theta)\r\n\r\n\r\nde... | python | edit | 3 | 3 | mit | a7e87621b3223e0c4df9d417129fcb7da545c629 | lemming52/white_knight | integration/integration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os,sys,re\nfrom time import sleep\nfrom pprint import pprint\nhome = os.path.expanduser('~')\nfrom math import log,ceil\ndef clog2(num):\n return int(ceil(log(num,2)))\nif (sys.version_info > (3, 0)):\n # Python 3 code in this bloc... | python | edit | 7 | 1 | mit | d187a8434c9d64171f76efa3055bdc06afbc8981 | jdanders/homedir,jdanders/homedir,jdanders/homedir,jdanders/homedir | scripts/pystart.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nModule for standard hash algorithms, always returning the hash in hexadecimal\nstring format.\n\"\"\"\nimport hashlib\nfrom .formats import to_bytes\n\ndef md5(message):\n \"\"\"\n Returns the hexadecimal representation of the... | python | edit | 1 | 1 | mit | 1b84734f9f016e098fa82e596ae851f3b9d4fe2b | boppreh/simplecrypto | simplecrypto/hashes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.urls import path\nfrom invite import views\n\napp_name = 'invite'\nurlpatterns = [\n path('', views.index, name='index'),\n path('invite/', views.invite, name='invite'),\n path('resend/(<slug:code>)/', views.resend, nam... | python | edit | 1 | 0 | bsd-3-clause | 1c41a79dc46bf717ee43ad46ac499f5310ad792e | unt-libraries/django-invite,unt-libraries/django-invite | invite/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nimport parsl\nfrom parsl.app.app import App\nfrom parsl.data_provider.files import File\nfrom parsl.tests.configs.local_threads import config\n\nparsl.clear()\nparsl.load(config)\n\n\n@App('python')\ndef sort_strings(inputs... | python | edit | 1 | 2 | apache-2.0 | 98a79f8caf90cfed01f9dceaa70e71892ea42116 | Parsl/parsl,Parsl/parsl,Parsl/parsl,Parsl/parsl,swift-lang/swift-e-lab,swift-lang/swift-e-lab | parsl/tests/test_staging/test_implicit_staging_ftp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mistune\nfrom unittest import TestCase\n\nclass TestMiscCases(TestCase):\n def test_none(self):\n self.assertEqual(mistune.html(None), '')\n\n def test_before_parse_hooks(self):\n def _add_name(md, s, state):\n s... | python | edit | 1 | 1 | bsd-3-clause | 61253510bc859ec1695484d11cbadcd92ad4b107 | lepture/mistune | tests/test_misc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.exceptions import ObjectDoesNotExist\n\nfrom db.models.repos import CodeReference\n\n\ndef get_internal_code_reference(instance, commit=None):\n project = instance.project\n\n if not project.has_code:\n return ... | python | edit | 1 | 10 | apache-2.0 | a922c8ed94670a70d9c3351ac7fa59e4d4a8ae65 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/libs/repos/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport string\nimport textwrap\n\nfrom veryprettytable import VeryPrettyTable\n\nfrom plugins import BasePlugin\n\n\n__author__ = 'peter'\n\n\nclass BasicInfoPlugin(BasePlugin):\n short_description = 'Basic info:'\n default = True\n ... | python | edit | 1 | 6 | mit | ac55f6936551a0927b25aa520ab49649a6b4a904 | Sakartu/stringinfo | plugins/basic_info_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 's7a'\n\n# All imports\nfrom logger import Logger\nfrom sanitizer import Sanitizer\nfrom kucera_francis import KuceraFrancis\n```\n\nApply this change: Add Stemmed Kucera Francis to extras package"
},
{
"role": "assista... | python | edit | 6 | 0 | mit | 213b889a580f58f5dea13fa63c999ca7dac04450 | Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify | src/extras/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import,print_function\nfrom itertools import groupby\nimport PyICU\nimport six\n# ตัดคำภาษาไทย\ndef segment(txt):\n \"\"\"รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU\"\"\"\n bd = ... | python | edit | 4 | 2 | apache-2.0 | aa69ae87a947ee17d72d7881dc61a5091772ff6c | PyThaiNLP/pythainlp | pythainlp/segment/pyicu.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, shutil\nfrom nose import with_setup\nfrom mbutil import mbtiles_to_disk, disk_to_mbtiles\n\ndef clear_data():\n try: shutil.rmtree('test/output')\n except Exception: pass\n\n try: os.path.mkdir('test/output')\n except... | python | edit | 1 | 2 | bsd-3-clause | 06349ea257219e8ad1808fa4fd77f34f7371894a | davvo/mbutil-eniro,mapbox/mbutil,mapbox/mbutil | test/test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nimport string\nimport urlparse\n\nfrom pale.arguments.string import StringArgument\nfrom pale.errors import ArgumentError\n\nclass URLArgument(StringArgument):\n\n def validate_url(self, original_s... | python | edit | 3 | 3 | mit | ff14a65284603e27cff9628cd8eec0c4cfd8e81d | Loudr/pale | pale/arguments/url.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import unlink\nfrom configobj import ConfigObj\nfrom tests.ch_mock import Twitter\n\ndef Dispatch(channels, msgFile):\n msgConfig = ConfigObj(msgFile)\n Topic = msgConfig['Topic']\n To_Email = msgConfig['To_Email']\n Mes... | python | edit | 4 | 3 | mit | cbea20e07807df21645c0edd52ccfdef2c5f72f1 | alfie-max/Publish | modules/dispatcher.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom rest_framework.response import Response\n\nfrom sentry.api.bases.project import ProjectEndpoint\nfrom sentry.api.serializers import serialize\nfrom sentry.models import EnvironmentProject\n\n\n... | python | edit | 1 | 2 | bsd-3-clause | 0ce7a7b396dd62c7e52e355108f8f037335bc5ca | beeftornado/sentry,beeftornado/sentry,mvaled/sentry,ifduyue/sentry,ifduyue/sentry,mvaled/sentry,mvaled/sentry,beeftornado/sentry,mvaled/sentry,looker/sentry,looker/sentry,looker/sentry,ifduyue/sentry,ifduyue/sentry,mvaled/sentry,looker/sentry,mvaled/sentry,ifduyue/sentry,looker/sentry | src/sentry/api/endpoints/project_environments.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport base64\nimport xmltodict\nimport json\n\nimport colorama\nfrom . safe_print import safe_print\nfrom . exceptions import SAMLAssertionParseError\n\n\ndef parse_assertion(assertion: str) -> list:\n roles = []\n response = xmltodi... | python | edit | 5 | 8 | mit | c94be38207dc9ec0cdf9c3d406954a249ff6e6ac | trek10inc/awsume,trek10inc/awsume | awsume/awsumepy/lib/saml.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tastypie.resources import ModelResource\nfrom models import Event\n\nclass EventResource(ModelResource):\n class Meta:\n queryset = Event.objects.all()\n resource_name = 'events'\n\n```\n\nApply this change: Rename dat... | python | edit | 1 | 2 | mit | d91b8f96290498f1e36d64bd797fcea5e43d3df1 | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | apps/events/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''Example settings/local.py file.\nThese settings override what's in website/settings/defaults.py\n\nNOTE: local.py will not be added to source control.\n'''\n\nfrom . import defaults\n\nDB_PORT = 27017\n\nDEV_MODE... | python | edit | 3 | 0 | apache-2.0 | 02bacade9f9680662196e09b9d95086113e03da9 | erinspace/osf.io,zachjanicki/osf.io,kch8qx/osf.io,brianjgeiger/osf.io,icereval/osf.io,brandonPurvis/osf.io,alexschiller/osf.io,felliott/osf.io,mfraezz/osf.io,billyhunt/osf.io,Johnetordoff/osf.io,caneruguz/osf.io,GageGaskins/osf.io,chennan47/osf.io,pattisdr/osf.io,Johnetordoff/osf.io,leb2dg/osf.io,crcresearch/osf.io,ale... | website/settings/local-travis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\n\nfrom . import pipeline\n\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--creator\", action=\"store_true\",\n help=\"Launch Instance Creator in stan... | python | edit | 1 | 0 | mit | bf4c26907522a04ec77274d8f862e853a64f7d6a | mindbender-studio/core,getavalon/core,mindbender-studio/core,getavalon/core | avalon/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf8 -*-\n\nimport sys\nimport os\nimport libcrowds_statistics as plugin\n\n# Use the PyBossa test suite\nsys.path.append(os.path.abspath(\"./pybossa/test\"))\n\nos.environ['STATISTICS_SETTINGS'] = '../settings_test.py'\n\n\nd... | python | edit | 1 | 1 | bsd-3-clause | 79ee512bb989056c521e3e38d9d8a52c2bd3d3fc | LibCrowds/libcrowds-statistics,LibCrowds/libcrowds-statistics,LibCrowds/libcrowds-statistics | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport smtplib\nimport time\nfrom email.mime.text import MIMEText\n\nto_list = ('',) # add recipient (your remote account) here\nfrom_email = '' # email from which the e-mail is sent; must be accepted by SMTP\n\ns = smtplib.SMTP('') # SM... | python | edit | 2 | 0 | mit | 27668d5e5c1c40b342ca4d280ed3aaa49532c845 | krzysztofr/gmail-force-check | email-ping.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nCreate a stock database with a built in nesting key index\n'''\n\n# Import maras libs\nimport maras.database\nimport maras.tree_index\n\n\n# We can likely build these out as mixins, making it easy to apply high level\n# constructs to m... | python | edit | 1 | 2 | apache-2.0 | 1abf1add68f9a1224fe5f754b0f01a86dbb1008c | thatch45/maras_old | maras/nestdb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sqlite3\n\ndef migrate(database_path):\n print \"migrating to db version 5\"\n conn = sqlite3.connect(database_path)\n conn.text_factory = str\n cursor = conn.cursor()\n\n # update settings table to include smtp server... | python | edit | 2 | 1 | mit | bc9656c1ced31f0592b6d73a0678386843afa5b5 | tyler-smith/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,OpenBazaar/OpenBazaar-Server,cpacia/OpenBazaar-Server,cpacia/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,OpenBazaar/Network,OpenBazaar/OpenBazaar-Server,OpenBazaar/Network,saltduck/OpenBazaar-Server,OpenBazaar/Network,tomgalloway/OpenBazaar-Server,cpacia/O... | db/migrations/migration5.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"namuhub --- namu.wiki contribution graph\"\"\"\nfrom flask import Flask, jsonify, render_template, request, url_for\n\napp = Flask('namuhub')\n\n@app.route('/', methods=['GET'])\ndef index():\n return render_template('index.html')\... | python | edit | 3 | 6 | apache-2.0 | a2713927beb4b80ba62cc0273df24d33cca4a689 | ssut/namuhub,ssut/namuhub,ssut/namuhub | namuhub/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom unittest import TestCase, main\n\nfrom antfarm import App, Response\nfrom antfarm.response import STATUS\n\nBASE_ENV = {\n 'REQUEST_METHOD': 'GET',\n}\n\nclass AppTest(TestCase):\n\n def test_001_basic(self):\n app = App... | python | edit | 3 | 2 | mit | b7c0f274b227acad4d4b76e619a75ef7ac252732 | funkybob/antfarm | tests/test_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAn enum describing the various possible game states.\n\nAuthor: Isaac Arvestad\n\"\"\"\nclass GameState(Enum):\n playing = 1\n over = 2\n\n```\n\nApply this change: Change name from 'over' to 'ended'."
},
{
"role": "as... | python | edit | 2 | 0 | mit | 5b48bab8c884dd66dc40bc591fc0c66621fa01a1 | isaacarvestad/four-in-a-row | game_state.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nnbtutor - a small utility to indicate which cells should be cleared (exercises).\n\"\"\"\n\nimport os\n\ntry:\n from nbconvert.preprocessors.base import Preprocessor\nexcept ImportError:\n from IPython... | python | edit | 1 | 3 | bsd-2-clause | f3978f2bee9fdbef4e2d415e4a6e584e451f4da4 | jorisvandenbossche/nbtutor,jorisvandenbossche/nbtutor | nbtutor/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\n# Model Field Reference\n# https://docs.djangoproject.com/en/1.8/ref/models/fields/\n\n\nclass Tag(models.Model):\n name = models.CharField(max_length=31)\n slug = models.SlugField()\n\n\nclass Startu... | python | edit | 1 | 0 | bsd-2-clause | a0bb9cbcb2999d06747dec78b4959baad8d374d8 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom registration.models import RegistrationProfile\n\n\nclass RegistrationAdmin(admin.ModelAdmin):\n list_display = ('__unicode__', 'activation_key_expired')\n search_fields = ('user__username', 'u... | python | edit | 1 | 0 | bsd-3-clause | 94596f036270f8958afd84eb9788ce2b15f5cbd4 | rafaduran/django-pluggable-registration,rbarrois/django-registration,maraujop/django-registration,thedod/django-registration-hg-mirror,CoatedMoose/django-registration,AndrewLvov/django-registration,AndrewLvov/django-registration,aptivate/django-registration,fedenko/django-registration,CoatedMoose/django-registration,ch... | registration/admin.py | rejected_duplicate | Near-duplicate of sample 444 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.