messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright 2011 VMware, Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\... | python | edit | 1 | 2 | apache-2.0 | 57a37c4a87e9757a109dfb5f3169fb8264d0795e | mahak/neutron,noironetworks/neutron,openstack/neutron,openstack/neutron,openstack/neutron,eayunstack/neutron,mahak/neutron,huntxu/neutron,eayunstack/neutron,noironetworks/neutron,huntxu/neutron,mahak/neutron | neutron/server/rpc_eventlet.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timezone, time\n\n\ndef zero_time_with_timezone(date, tz=timezone.utc):\n return datetime.combine(date, time(tzinfo=tz))\n```\n\nApply this change: Use dateparser for parsing scraped dates"
},
{
"ro... | python | edit | 1 | 2 | mit | 66462c231011f6418fc246789ce4feed10a74a66 | andrewgleave/whim,andrewgleave/whim,andrewgleave/whim | web/whim/core/time.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom BaseController import BaseController\nfrom api.util import settings\n\nclass ServerListController(BaseController):\n\n def get(self):\n servers = {\"servers\": self.read_server_config()}\n self.write(servers)\n\n de... | python | edit | 1 | 3 | mit | 77a1ee839da665fc1f97dabed1bf5639c980a17a | YongMan/RedisLive,merlian/RedisLive,heamon7/RedisLive,fengshao0907/RedisLive,heamon7/RedisLive,udomsak/RedisLive,merlian/RedisLive,jacklee0810/RedisLive,YongMan/RedisLive,jacklee0810/RedisLive,udomsak/RedisLive,jiejieling/RdsMonitor,udomsak/RedisLive,fengshao0907/RedisLive,nkrode/RedisLive,jacklee0810/RedisLive,jiejiel... | src/api/controller/ServerListController.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis package contains the bases classes of pyqode and some utility\nfunctions.\n\n\"\"\"\nfrom .code_edit import CodeEdit\nfrom .decoration import TextDecoration\nfrom .encodings import ENCODINGS_MAP, convert_to_codec_key\nfrom .man... | python | edit | 1 | 0 | mit | 69c72d47ebf57932b6e20e2c22a5f1c84d07d3eb | zwadar/pyqode.core,pyQode/pyqode.core,pyQode/pyqode.core | pyqode/core/api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Game():\n def __init__(self):\n self._score = 0\n\n def roll(self, pins):\n pass\n\n def score(self):\n return 0\n\n```\n\nApply this change: [Python] Update score in Game class methods"
},
{
"rol... | python | edit | 1 | 1 | mit | bc961992afeae978e95209606e0e7b1a9b73719f | JesusMtnez/devexperto-challenge,JesusMtnez/devexperto-challenge | jesusmtnez/python/kata/game.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport click\nimport json\nimport logging\nimport requests\nfrom datetime import datetime\nfrom certidude import config\n\n\ndef publish(event_type, event_data):\n \"\"\"\n Publish event on push server\n \"\"\"\n if not isinst... | python | edit | 2 | 6 | mit | 23d8942ffeeee72e21330bd8ecc5bfb5e91bbc3b | laurivosandi/certidude,laurivosandi/certidude,plaes/certidude,laurivosandi/certidude,plaes/certidude,plaes/certidude,laurivosandi/certidude,plaes/certidude | certidude/push.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tornado\nimport time\nfrom bson.json_util import dumps\nfrom tornado.options import options\n\n\nclass FilesServiceHandler(tornado.web.RequestHandler):\n def initialize(self, logger, mongodb):\n self.logger = logger\n ... | python | edit | 1 | 3 | apache-2.0 | 2497f494f0e3e7fb57aa8cb1deed0c05fd6b74b1 | jiss-software/jiss-file-service,jiss-software/jiss-file-service,jiss-software/jiss-file-service | handler/FilesService.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ninp = 3004953\n\nelves = list(range(1, inp + 1))\ni = 0\nwhile len(elves) > 1:\n index = (i + int(len(elves) / 2)) % len(elves)\n elves.pop(index)\n if index < i:\n i -= 1\n i = (i + 1) % len(elves)\n\nprint(elves[0])\nin... | python | edit | 1 | 1 | unlicense | 3e67993eb17aca7571381d59b7fd65eab53dac98 | ultramega/adventofcode2016 | day19/part2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\nfrom thefuck.utils import for_app, replace_command, eager\n\n\n@for_app('ifconfig')\ndef match(command):\n return 'error fetching interface information: Device not found' \\\n in command.stderr\n\n\n@eager\nd... | python | edit | 1 | 5 | mit | 78515c7bbb81263fa339a67c2aabfa1a4f3c9af9 | nvbn/thefuck,scorphus/thefuck,Clpsplug/thefuck,mlk/thefuck,nvbn/thefuck,SimenB/thefuck,mlk/thefuck,SimenB/thefuck,Clpsplug/thefuck,scorphus/thefuck | thefuck/rules/ifconfig_device_not_found.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\nimport cybox.utils\n\n\nclass ObjectTestCase(object):\n \"\"\"A base class for testing all subclasses of ObjectProperties.\n\n ... | python | edit | 1 | 2 | bsd-3-clause | 5bece700c7ebbb2c9ea3ce2781863baf189e2fc0 | CybOXProject/python-cybox | cybox/test/objects/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef xlsx_export_action(modeladmin, request, queryset):\n\n from django.http import HttpResponse\n from import_export.formats import base_formats\n formats = modeladmin.get_export_formats()\n file_format = base_formats.XLSX()\n\n... | python | edit | 3 | 2 | mit | d787039a58d63cd85068da996a12fc36c1d63804 | DjangoAdminHackers/ixxy-admin-utils,DjangoAdminHackers/ixxy-admin-utils | ixxy_admin_utils/admin_actions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n''' \nScript used to query Wikipedia for summary of object \n'''\n\nimport sys\nimport wikipedia \n\ndef main():\n\t# Check that we have the right number of arguments \n\tif (len(sys.argv) != 2): \n\t\tprint 'Incorrect number of arguments; ... | python | edit | 5 | 4 | apache-2.0 | a354a4f52bce3c3063678b046ba76a694c076652 | christopher18/Celsearch,christopher18/Celsearch,christopher18/Celsearch | web/celSearch/api/scripts/query_wikipedia.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .. import intern\n\ndef test_global_interning():\n try:\n intern.global_intern(\"hello\")\n except AssertionError as e:\n pass\n else:\n raise Exception(\"Expects complaint about uninitialized table\")\n\n... | python | edit | 3 | 2 | bsd-2-clause | 7dfe4381ecd252530cb7dc274b2dc6aaa39f81cc | stuartarchibald/numba,pitrou/numba,pitrou/numba,shiquanwang/numba,seibert/numba,jriehl/numba,shiquanwang/numba,stefanseefeld/numba,stuartarchibald/numba,cpcloud/numba,cpcloud/numba,gdementen/numba,seibert/numba,numba/numba,sklam/numba,ssarangi/numba,gmarkall/numba,cpcloud/numba,sklam/numba,pitrou/numba,IntelLabs/numba,... | deps/pyextensibletype/extensibletype/test/test_interning.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .io import preprocess\nfrom .train import train\nfrom .encode import encode\n\n\ndef autoencode(count_matrix, kfold=None, reduced=False,\n censor_matrix=None, type='normal',\n learning_rate=1e-2,\n ... | python | edit | 1 | 1 | apache-2.0 | 9c1190133a680717850a4d0f46a96591b7be4e33 | theislab/dca,theislab/dca,theislab/dca | autoencoder/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport tempfile\n\nlogger = logging.getLogger(\"LanguageClient\")\nwith tempfile.NamedTemporaryFile(\n prefix=\"LanguageClient-\",\n suffix=\".log\", delete=False) as tmp:\n tmpname = tmp.name\nfileHandler =... | python | edit | 1 | 0 | mit | 2a7ce1ac70f8767e9d2b2a9f1d335cfcc63a92b6 | autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/L... | rplugin/python3/LanguageClient/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\n\nfrom monitorframe.monitor import BaseDataModel\n\nfrom cosmo.filesystem import FileDataFinder\nfrom cosmo import FILES_SOURCE\nfrom cosmo.monitor_helpers import explode_df\n\n\nclass OSMDataModel(BaseDataModel):\n\n ... | python | edit | 1 | 1 | bsd-3-clause | e7e8972124d3336834f1c177f655e12528a49624 | justincely/cos_monitoring | cosmo/monitors/osm_data_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"This module has functions and classes useful for setting up simulations\"\"\"\n\n########################################################################\n# #\n# Thi... | python | edit | 9 | 0 | apache-2.0 | 996713fc6aefe20b28c729c46532ae566d5160a1 | theavey/ParaTemp,theavey/ParaTemp | paratemp/sim_setup/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef fib1(amount):\n \"\"\"\n Fibonacci generator example. The second variable is used to store\n the result.\n :param amount: Amount of numbers to produce.\n :return: Generator.\n\n >>> list(fib1(0))\n []\n >>> list(... | python | edit | 1 | 2 | mit | 21a392df73324f111fa80e2fd8ce88b0e32c954c | pesh1983/exercises,pesh1983/exercises | python/algorithms/fibonacci.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom learntools.core import *\nimport tensorflow as tf\n\n\nclass Q1A(ThoughtExperiment):\n _solution = \"\"\n\n\nclass Q1B(ThoughtExperiment):\n _solution = \"\"\n\nQ1 = MultipartProblem(Q1A, Q1B)\n\nclass Q2A(ThoughtExperiment):\n ... | python | edit | 11 | 1 | apache-2.0 | 8d7e4cf37e73c1ff9827e94a06327921f553e2f4 | Kaggle/learntools,Kaggle/learntools | learntools/computer_vision/ex4.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.blueprints.ticket.service\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2015 Jochen Kupperschmidt\n\"\"\"\n\nfrom ..party.models import Party\nfrom ..seating.models import Category\n\nfrom .... | python | edit | 1 | 2 | bsd-3-clause | 5523ae2278bb0ca055ef7a6e218ac40ed4172bf3 | m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps | webapp/byceps/blueprints/ticket/service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nf1, f2, s, n = 0, 1, 0, 4000000\nwhile f2 < n:\n f2, f1 = f1, f1 + f2\n if f2 % 2 == 0:\n s += f2\nprint s\n\n```\n\nApply this change: Add a second Python implementation of problem 2"
},
{
"role": "assistant",
"con... | python | edit | 1 | 3 | mit | 2ee895c61f546f83f4b7fa0c6a2ba72578c378be | 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_2/solution.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python3\n# Python challenge - 3\n# http://www.pythonchallenge.com/pc/def/equality.html\n\nimport re\n\n\n'''\nHint:\nOne small letter surrounded by EXACTLY three big bodyguards on each of\nits sides.\n'''\n\n\ndef main():\n... | python | edit | 1 | 1 | mit | 7dc08364cbe513ce4b81483d9330789f5893fcee | HKuz/PythonChallenge | Challenges/chall_03.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import with_statement\nimport os\nimport pickle\nfrom contextlib import closing\ntry:\n from redis import Redis\nexcept ImportError:\n Redis = None\n\n\nclass Cache(object):\n def __init__(self):\n self._cach... | python | edit | 1 | 2 | mit | da85d9660166f67133b10953104ccd81b89d0b92 | coleifer/micawber,coleifer/micawber | micawber/cache.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport dateutil.parser\nimport scrapy\n\nfrom jobs.items import JobsItem\n\n\nclass VisirSpider(scrapy.Spider):\n name = \"visir\"\n start_urls = ['https://job.visir.is/search-results-jobs/']\n\n def parse(self, response):\n ... | python | edit | 1 | 3 | apache-2.0 | 2f80f786be8e0d235dcb98c4fa562bfe2b9e783f | multiplechoice/workplace | jobs/spiders/visir.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function\nimport logging\nimport sys\n\nimport click\nfrom .. import __version__, get_logger\n\nlogging.basicConfig(stream=sys.stderr)\nlogger = get_logger()\nlogger.setLevel(l... | python | edit | 15 | 4 | bsd-3-clause | be07a935d041a6c2d1c641f9beebe1bb49891682 | mirnylab/cooler | cooler/cli/__init__.py | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fman import DirectoryPaneCommand, show_alert\r\nimport distutils\r\nfrom distutils import dir_util, file_util\r\nimport os.path\r\n\r\nclass DuplicateFileDir(DirectoryPaneCommand):\r\n def __call__(self):\r\n selected_files =... | python | edit | 1 | 9 | mit | 2c7dc769874766b230bc11c7ec6f67d3c1157005 | raguay/DuplicateFileDir | duplicatefiledir/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nprint(sys.version_info)\nimport random\nimport time\n\nimport networkzero as nw0\n\nquotes = [\n \"Humpty Dumpty sat on a wall\",\n \"Hickory Dickory Dock\",\n \"Baa Baa Black Sheep\",\n \"Old King Cole was a merry o... | python | edit | 1 | 6 | mit | a24d6a25cb7ee5101e8131a9719744f79b23c11b | tjguk/networkzero,tjguk/networkzero,tjguk/networkzero | examples/quotes/quotes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\n\n'''\n This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that where\n converted to conflict copies. So I just strip out the conflict string ie (some computer names's co... | python | edit | 1 | 0 | apache-2.0 | 0f95070880f40456fbb6d7b7ccd6e999cc6fb95a | alexwhb/Dropbox-bulk-conflict-resolver | dropbox_conflict_resolver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport pip\nimport tempfile\nimport subprocess\nimport opentis.version\n\n\nBUCKET_NAME = 'openpathsampling.org'\nif not opentis.version.release:\n PREFIX = 'latest'\nelse:\n PREFIX = opentis.version.short_version\n\nPREFIX... | python | edit | 1 | 0 | mit | 723ae54f260284aad442f076772189cb5820d62e | dwhswenson/openpathsampling,jhprinz/openpathsampling,choderalab/openpathsampling,openpathsampling/openpathsampling,choderalab/openpathsampling,dwhswenson/openpathsampling,jhprinz/openpathsampling,openpathsampling/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openpathsam... | devtools/ci/push-docs-to-s3.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.functional import memoize\n\nfrom . import app_settings\n\ndef get_render_method():\n return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)\nget_render_method = memoize(get_render_method, {}, 0)\n\ndef get_context_p... | python | edit | 1 | 2 | bsd-3-clause | eb391dde8a157252a98fc9bb9b617bc821f7285a | lamby/django-email-from-template | email_from_template/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom itertools import chain\nfrom typing import Sized, Iterable, Container, Set\n\n\nclass RangeSet(Sized, Iterable, Container):\n def __init__(self, *ranges):\n self.ranges = []\n\n for r in ranges:\n if isinsta... | python | edit | 1 | 6 | apache-2.0 | 4bef46ef98591d47d653eeb4f74bf00a8a1d5d69 | osantana/correios,solidarium/correios,olist/correios | correios/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Create sequences to be aligned.\nfrom alignment.sequence import Sequence\na = Sequence(\"what a beautiful day\".split())\nb = Sequence(\"what a disappointingly bad day\".split())\nprint \"Sequence A:\", a\nprint \"Sequence B:\", b\nprint\... | python | edit | 7 | 0 | bsd-3-clause | 75af7171d0245b528018c8e0d0d581916a9dc67d | eseraygun/python-entities,eseraygun/python-alignment | examples/profilealignment.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 0 | apache-2.0 | 55a4680bb07896f0bab06d836ade056d115f004f | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from .allauth import *\nexcept ImportError:\n from .chinup import *\n\nfrom .exceptions import *\n\n\n__version__ = '0.1'\n\n```\n\nApply this change: Configure package-level logging to avoid warning."
},
{
"role": "ass... | python | edit | 4 | 0 | mit | e2495040277fafdac4c0e060517cf667baa27c02 | pagepart/chinup | chinup/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file is part of Moksha.\n# Copyright (C) 2008-2010 Red Hat, 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... | python | edit | 1 | 1 | apache-2.0 | fc36b9bc2970c611a4fb5063463f27cfd96df21d | ralphbean/moksha,pombredanne/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,lmacken/moksha,ralphbean/moksha,pombredanne/moksha,pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,ralphbean/moksha,pombredanne/moksha,lmacken/moksha | moksha/hub/messaging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom odml import Property, Section, Document\n\n\nclass TestProperty(unittest.TestCase):\n\n def setUp(self):\n pass\n\n def test_value(self):\n p = Property(\"property\", 100)\n assert(p.value[0]... | python | edit | 1 | 1 | bsd-3-clause | a7fcc89755e01bf3dbe7090e2bf7f1211ce9af84 | lzehl/python-odml | test/test_property.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom optparse import make_option\nfrom django.core.management.base import NoArgsCommand\n\n\nclass Command(NoArgsCommand):\n\n option_list = NoArgsCommand.option_list + (\n ... | python | edit | 1 | 9 | mit | 56aa0448fb3cd1df1a0fd43abc9a0e37e8ddf55b | djentlemen/django-modeltranslation-sync | trans_sync/management/commands/save_trans.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry\n\n\nclass TrackSerializer(serializers.ModelSerializer):\n album = serializers.StringRelatedField(\n read_only=True\n )\n\n ... | python | edit | 1 | 0 | mit | 3fbbdec51cfd93217705adcae37b1bf22d5661fa | ThreeDRadio/playlists,ThreeDRadio/playlists,ThreeDRadio/playlists | backend/playlist/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass Word(models.Model):\n word = models.CharField(max_length=255)\n date_retired = models.DateTimeField(null=True, blank=True)\n date_active = models.DateTimeField(null=True, blank=True)\n vie... | python | edit | 1 | 2 | bsd-2-clause | bee93012144e033b02c05a1e586620dfa7f4c883 | kylegibson/how_to_teach_your_baby_tracker | words/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport logging\nimport traceback\n\nlog = logging.getLogger(__name__)\n\nclass LoggingMiddleware(object):\n def process_job(self, job):\n log.info(\"Running job %s\", job)\n\n def proce... | python | edit | 1 | 1 | bsd-3-clause | df216bdc25ef29da821f577a517ccdca61448cf4 | prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue,thread/django-lightweight-queue | django_lightweight_queue/middleware/logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add config key for default cache lifetime"
},
{
"role": "assistant",
"content": "PORT=1248\nBEACON_TIMEOUT=5\nDEFAULT_BUFSIZE=8192\nDEFAULT_CACHE_LIFETIME=900\n"
}
] | python | new_file | 1 | 0 | mit | eea647cf05d7143d800f834dd77aeafc32522100 | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | groundstation/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n@pytest.mark.parametrize(\"name, enabled, running\", [\n (\"cron\", \"enabled\", \"running\"),\n (\"docker\", \"enabled\", \"running\"),\n (\"firewalld\", \"enabled\", \"running\"),\n (\"haveged\", \"enabled\", \"runnin... | python | edit | 1 | 3 | mit | 6765cefc1a5a928b3cff16c0f1014096f82c3d3b | wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build | test/test_services.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\nfrom django.template.defaultfilters import stringfilter\nfrom django.template.base import TemplateSyntaxError\nimport hashlib\nfrom django_hash_filter.templatetags import get_available_hashes\n\nregister = templ... | python | edit | 1 | 4 | mit | ee4f8264d942d7af5f5b71ff6cd162f3ae1fe515 | andrewjsledge/django-hash-filter | django_hash_filter/templatetags/hash_filter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom PyQt5.QtWidgets import QApplication\n\nfrom datalogger.api.workspace import Workspace\nfrom datalogger.analysis_window import AnalysisWindow\nfrom datalogger import __version__\n\ndef run_datalogger_full():\n print(\"CUE... | python | edit | 1 | 1 | bsd-3-clause | 6a508d01fa3fa0d4084406fcb2b5e41d1b614b7c | torebutlin/cued_datalogger | datalogger/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport warnings\ntry:\n import pymongo # noqa\nexcept ImportError:\n warnings.warn(\"Failed to import pymongo. \"\n \"get_database will not be available.\", ImportWarning)\n\n def get_database(*args, **kwargs):\n ... | python | edit | 1 | 1 | bsd-3-clause | 81f3e4f10243cb31b600666a19112acee7c13f55 | csadorf/signac,csadorf/signac | signac/db/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport discord\r\nfrom discord.ext import commands\r\n\r\nclass Furry:\r\n \"\"\"A cog that adds weird furry commands or something\"\"\"\r\n\r\n def __init__(self, bot):\r\n self.bot = bot\r\n \r\n @commands.command()\r\n... | python | edit | 1 | 1 | apache-2.0 | 802b9c2df754b3acf78e9e1facc1802a901e97a2 | KazroFox/Kaz-Cogs | furry/furry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nMisc utilities\n'''\n\n# Import python libs\nimport os\nimport binascii\n\n\ndef rand_hex_str(size):\n '''\n Return a random string of the passed size using hex encoding\n '''\n return binascii.hexlify(os.urandom(size/2))\n... | python | edit | 1 | 1 | apache-2.0 | 70808a2243ebf04aa86d5b4539950b22cd96cc7d | thatch45/maras | maras/utils/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom logging import getLogger\nfrom scrapy.spiders import Rule, CrawlSpider\nfrom scrapy.linkextractors import LinkExtractor\n\n\nclass DataScienceJobsSpider(CrawlSpider):\n log = getLogger(__name__)\n name ... | python | edit | 1 | 1 | mit | ce873b24318fd6493f570f370db1d2c2d244bdcc | cyberbikepunk/job-spiders | joby/spiders/data_science_jobs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\n\n# Use the built-in version of scandir/walk if possible, otherwise\n# use the scandir module version\ntry:\n from os import scandir, walk\nexcept ImportError:\n from scandir import scandir, walk\n\n\ndef listMet... | python | edit | 1 | 4 | mit | a03b166f8297783819a43eeb78e5af4d52d11bcc | criteo-forks/carbonate,jssjr/carbonate,deniszh/carbonate,graphite-project/carbonate,jssjr/carbonate,graphite-project/carbonate,criteo-forks/carbonate,jssjr/carbonate,deniszh/carbonate,deniszh/carbonate,criteo-forks/carbonate,graphite-project/carbonate | carbonate/list.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom spacy.lang.hi import Hindi\n\ndef test_issue3625():\n \"\"\"Test that default punctuation rules applies to hindi unicode characters\"\"\"\n nlp = Hindi()\n doc = nlp(u\"hi. how हुए. ह... | python | edit | 1 | 2 | mit | ae2d52e323ea8959caf474d23de857d59b5b6ca8 | honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy | spacy/tests/regression/test_issue3625.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Unit tests configuration file.\"\"\"\n\n\ndef pytest_configure(config):\n \"\"\"Disable verbose output when running tests.\"\"\"\n terminal = config.pluginmanager.getplugin('terminal')\n base = terminal.TerminalReporter\n\n ... | python | edit | 1 | 1 | mit | 15f0a2e67fe942760707694370cc652f17e1c6b3 | jacebrowning/template-python-demo | demo/tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Default Config\n# Override these values in the instance/local_config.py file, not this one.\n\nDEBUG = None\n\nDOMAIN = 'localhost'\n\nHOST = 'localhost'\nPORT = 5000\n\n```\n\nApply this change: Use doc-string, not comments in default co... | python | edit | 1 | 0 | mit | 7ea053bfc1b557ce4a4df4905af4a5491517490b | joeyespo/tabhouse.org,joeyespo/tabhouse,joeyespo/tabhouse,joeyespo/tabhouse.org | default_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\r\n\r\nimport os.path\r\nimport os\r\nimport sys\r\nsys.path.append(\".\")\r\n\r\n#from pywinauto.timings import Timings\r\n#Timings.Fast()\r\n\r\nexcludes = ['test_sendkeys']\r\n\r\ndef run_tests():\r\n testfolder = os.p... | python | edit | 2 | 8 | bsd-3-clause | 119e95dedaf6633e1ca6367bfd13fa08192033bd | cessor/pywinauto,bombilee/pywinauto,ohio813/pywinauto,nameoffnv/pywinauto,yongxin1029/pywinauto,clonly/pywinauto,vsajip/pywinauto,cessor/pywinauto,LogicalKnight/pywinauto,ohio813/pywinauto,nameoffnv/pywinauto,ldhwin/pywinauto,airelil/pywinauto,drinkertea/pywinauto,prasen-ftech/pywinauto,vsajip/pywinauto,wilsoc5/pywinau... | pywinauto/unittests/testall.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nEliot: Logging as Storytelling\n\n Suppose we turn from outside estimates of a man, to wonder, with keener\n interest, what is the report of his own consciousness about his doings or\n capacity: with what hindrances he is c... | python | edit | 1 | 0 | apache-2.0 | a174fbd637bf9ccc7b8a97a251c016495f92f6a9 | ClusterHQ/eliot,ScatterHQ/eliot,iffy/eliot,ScatterHQ/eliot,ScatterHQ/eliot | eliot/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings as django_settings\nfrom django.core.urlresolvers import reverse\n\nfrom oidc_provider import settings\n\n\ndef get_issuer():\n \"\"\"\n Construct the issuer full url. Basically is the site url with so... | python | edit | 3 | 2 | mit | 1736d7b7aed3ce3049186ce97e24941de0187caf | ByteInternet/django-oidc-provider,torreco/django-oidc-provider,juanifioren/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,wojtek-fliposports/django-oidc-provider,nmohoric/django-oidc-provider,nmohoric/django-oidc-provider,... | oidc_provider/lib/utils/common.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom kivy.lang import Builder\nfrom kivy.properties import BoundedNumericProperty, ReferenceListProperty\nfrom kivy.uix.boxlayout import BoxLayout\nfrom kivymd.elevationbehavior import ElevationBehavior\nfrom kivymd... | python | edit | 4 | 0 | mit | 9a879fb583f7f4190a4601a9a488ba61414395e0 | cruor99/KivyMD | kivymd/card.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport datetime\nimport logging\n\nimport os\n\n\ndef set_up_logging():\n \"\"\"\n Main logger for usual bot needs\n \"\"\"\n logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), ... | python | edit | 1 | 2 | mit | dc0129224dc01f4e9cdaa57ee2aff307a4f5d7d3 | huangenyan/Lattish,MahjongRepository/tenhou-python-bot,MahjongRepository/tenhou-python-bot,huangenyan/Lattish | project/utils/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nos.environ[\"MPLBACKEND\"] = 'agg'\n\nimport matplotlib\nmatplotlib.use('agg')\n\nimport pytest\nimport oggm\nimport sys\n\nimport ssl\nssl._create_default_https_context = ssl._create_unverified_context\n... | python | edit | 1 | 0 | mit | fb1f6f30fc7ba2d3dcce357168a05669c934c234 | OGGM/OGGM-Anaconda | build/oggm/run_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .TDControlAgent import Q_Learning, SARSA\n# for compatibility of old scripts\nQ_LEARNING = Q_Learning\nfrom .Greedy_GQ import Greedy_GQ\nfrom .LSPI import LSPI\nfrom .LSPI_SARSA import LSPI_SARSA\nfrom .NaturalActorCritic import Natura... | python | edit | 9 | 0 | bsd-3-clause | acd376d854693cacf8ca20a9971dcd2653a22429 | imanolarrieta/RL,imanolarrieta/RL,imanolarrieta/RL | rlpy/Agents/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\n\n\nclass OratioIgnoreParser():\n def __init__(self):\n self.ignored_paths = [\"oratiomodule.tar.gz\"]\n\n def load(self, oratio_ignore_path):\n with open(oratio_ignore_path, \"r\") as f:\n ... | python | edit | 1 | 5 | mit | db84de91e665a131ad82be3ed49eb291afd5342d | oratio-io/oratio-cli,oratio-io/oratio-cli | oratioignoreparser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom etcd3.client import Etcd3Client\nfrom etcd3.client import client\nfrom etcd3.client import Transactions\n\n__author__ = 'Louis Taylor'\n__email__ = '<EMAIL>'\n__version__ = '0.1.0'\n\n__all__ =... | python | edit | 3 | 0 | apache-2.0 | 1983885acfccfe4ffa010401fd9ef0971bb6c12c | kragniz/python-etcd3 | etcd3/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# flake8: noqa: E501\n\nimport config.options\n\n\n# Flask-SQLAlchemy\nSQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(\n database_user=config.options.DATABASE_USER,\n dat... | python | edit | 1 | 0 | mit | 48bc050c59d60037fa719542db8f6a0c68752ed1 | LINKIWI/linkr,LINKIWI/linkr,LINKIWI/linkr | config/flask_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nProxy Server \"Phone Book\".\n\nSimplify running browser tests through a proxy server\nby adding your frequently-used proxies here.\n\nNow you can do something like this on the command line:\n\"pytest SOME_TEST.py --proxy=proxy1\"\n... | python | edit | 1 | 0 | mit | a7c40b43d90f32d0da4de1389d859865ae283180 | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | seleniumbase/config/proxy_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nimport requests\n\nfrom bs4 import BeautifulSoup as bs\nfrom jfr_playoff.logger import PlayoffLogger\n\nclass RemoteUrl:\n\n url_cache = {}\n\n @classmethod\n def fetch_raw(cls, url):\n PlayoffLogger.get('remote... | python | edit | 1 | 3 | bsd-2-clause | 592105b9ee6a9c6f3d9bd7358bc5ab18f8ded0c8 | emkael/jfrteamy-playoff,emkael/jfrteamy-playoff | jfr_playoff/remote.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Kimi language interpreter in Python 3\n# Anjana Vakil\n# http://www.github.com/vakila/kimi\n\nimport sys\n\ndef tokenize(program):\n '''Take a Kimi program as a string, return the tokenized program as a list of strings.\n\n >>> toke... | python | edit | 1 | 1 | mit | 3ed02baa8ad7fcd1f6ca5cccc4f67799ec79e272 | vakila/kimi | kimi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport urlparse\n\nfrom django.db import models\n\n\nclass ResponseModel(models.Model):\n\n # Debug information\n raw_request = models.TextField(max_length=512)\n raw_response = models.TextField(max_length=512)\n\n response_time... | python | edit | 1 | 2 | bsd-3-clause | a7083c3c70142f744ace0055c537d9217ed9cbfe | bharling/django-oscar-worldpay,embedded1/django-oscar-paypal,FedeDR/django-oscar-paypal,django-oscar/django-oscar-paypal,evonove/django-oscar-paypal,st8st8/django-oscar-paypal,nfletton/django-oscar-paypal,britco/django-oscar-paypal,britco/django-oscar-paypal,st8st8/django-oscar-paypal,ZachGoldberg/django-oscar-paypal,e... | paypal/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass OrganizationMixin(object):\n @property\n def organization(self):\n return {\n 'name': self.ORGANIZATION_NAME,\n 'children': [{\n 'name': unicode(self.department),\n }],\n ... | python | edit | 2 | 1 | apache-2.0 | c612b92847dc89bb4cd4b63502c43a7a9f63c52f | texastribune/tx_salaries,texastribune/tx_salaries | tx_salaries/utils/transformers/mixins.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport unittest\nimport sparqllib\n\nclass TestBasicFormatter(unittest.TestCase):\n def setUp(self):\n self.formatter = sparqllib.formatter.BasicFormatter()\n\n def test_newlines(self):\n self.assertEqual(self.formatte... | python | edit | 1 | 1 | mit | 946a2bcd57ac33cca0f48d29350a8f75b2fee2cf | ALSchwalm/sparqllib | sparqllib/tests/test_formatter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nimport unittest\nfrom test.factories import UserFactory\n\nfrom django.contrib.auth.models import User\nfrom django.db.models.signals import post_save\n\nfrom users.models import create_user_profile, Users\n\n\nclass User... | python | edit | 4 | 1 | mit | 2eac437b9d907fb60d53522633dd278aa277ea08 | sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/flowofkindness,sarutobi/ritmserdtsa | test/user_tests/test_models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n##\n# Package metadata\n##\n\nimport ah_bootstrap\n\nfrom astropy_helpers.git_helpers import get_git_devstr\n\n# Name\nname = 'plasmapy'\n\n# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH\n#\n# - The MAJOR version change... | python | edit | 3 | 0 | bsd-3-clause | 19fcd893b88fd2ac9891904af93baf76b49fd5c0 | StanczakDominik/PlasmaPy | plasmapy/_metadata.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom python_cowbull_game.GameController import GameController\nfrom python_cowbull_game.GameMode import GameMode\n\n\nclass ExtGameController(GameController):\n \"\"\"\n TBC\n \"\"\"\n\n #\n # Example of defining additional g... | python | edit | 1 | 4 | apache-2.0 | 76b0c364b8bfbc553d3eedc97e4805299b8d9974 | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | extensions/ExtGameController.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'Wenzhi Mao'\n\n__all__ = []\n\n\ndef _Startup():\n '''Get _path__ and compile files.'''\n from os import path\n from mbio import _ABSpath\n global _path__\n _path__ = _ABSpath()\n\n\n_Startup()\n\n\nfrom . impor... | python | edit | 5 | 1 | mit | afbcda104f9903bda2d82e34a6fdc63b6e2b52a9 | wzmao/mbio,wzmao/mbio,wzmao/mbio | mbio/Application/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nFile: braket.py\nAuthor: Ivan Gonzalez\nDescription: A function to implement quantum-mechanics brakets\n'''\nfrom numpy import inner\nfrom core.exceptions import DMRGException\n\ndef braket(bra, ket):\n \"\"\"Takes a bra and a ket a... | python | edit | null | null | mit | 75b221fa63b0f81b94ffbbe9f5cdc39a0adb848a | iglpdc/dmrg101 | dmrg101/core/braket.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom notification.backends.base import NotificationBackend\n\nclass WebBackend(NotificationBackend):\n slug = u'web'\n display_name = u'E-mail'\n formats = ['short.txt', 'full.txt']\n\n def send(self, sender, recipient, notice_t... | python | edit | 1 | 1 | mit | 233d52247d89bb39ccc9ada3a591296baae9cff5 | theatlantic/django-notification,theatlantic/django-notification | notification/backends/web.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nThis is the front end to the pcapfile test SUITE.\n\"\"\"\n\nimport unittest\n\n\nfrom pcapfile.test.linklayer_test import TestCase as LinklayerTest\nfrom pcapfile.test.savefile_test import TestCase as Savefil... | python | edit | 1 | 0 | isc | 020e8db7ed28c3c6e6968d2d107b23e1fa8eb284 | kisom/pypcapfile | pcapfile/test/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2\n\nimport subprocess\nimport sys\n\nargs = sys.argv\n\nexpected_exit_code = args[1]\n\nargs = args[2:]\nprint(\"Running \" + (\" \".join(args)))\nreal_exit_code = subprocess.call(args)\n\nif str(real_exit_code) != exp... | python | edit | 1 | 0 | apache-2.0 | 39406267d31ca428dc73d721ccc19285ff7599bd | apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb | lit/Quit/expect_exit_code.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2015, Vispy Development Team.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\"\"\"\nCircular Layout\n===============\n\nThis module contains several graph layouts which ... | python | edit | 1 | 1 | bsd-3-clause | a08005a03ccce63a541e8e41b0d98e9c7c30cc67 | michaelaye/vispy,Eric89GXL/vispy,drufat/vispy,drufat/vispy,drufat/vispy,michaelaye/vispy,ghisvail/vispy,ghisvail/vispy,Eric89GXL/vispy,ghisvail/vispy,michaelaye/vispy,Eric89GXL/vispy | vispy/visuals/graphs/layouts/circular.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-07-02 23:19\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('af... | python | edit | 1 | 0 | isc | 7aa84fbcc7a3af57ef62c29008fac4036d2d28af | hobarrera/django-afip,hobarrera/django-afip | django_afip/migrations/0021_drop_batches.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Mark as release candidate version"
},
{
"role": "assistant",
"content": "version = '0.60.0rc1'\ntime = '2018-04-18 08:12:59'\n"
}
] | python | new_file | 1 | 0 | mit | 14123d5e3544ab9dbee813e26536e43cbfb9f783 | pycroscopy/pycroscopy | pycroscopy/__version__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef insertion_sort(un_list):\n for idx in range(1, len(un_list)):\n current = un_list[idx]\n position = idx\n\n while position > 0 and un_list[position-1] > current:\n un_list[position] = un_list[position-... | python | edit | 1 | 5 | mit | e0ebd4cb41d3ed9168e819f7017dd98c2fbb599a | jonathanstallings/data-structures | insertion_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Create your views here.\nimport json\nfrom django.template import RequestContext\nfrom django.shortcuts import render_to_response\nfrom django.utils import simplejson\nfrom django.http import HttpResponse, Http404\nfrom .models import Ben... | python | edit | 2 | 3 | bsd-2-clause | a5697ddd595b929ef7261d62fd333c2cd2f56dd0 | ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark | plots/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.core.urlresolvers import reverse_lazy\n\nfrom singleurlcrud.views import CRUDView\nfrom .models import *\n\n# Create your views here.\nclass AuthorCRUDView(CRUDView):\n model = Author\n ... | python | edit | 7 | 1 | bsd-3-clause | 5a2212746bfabcfd64cf27846770b35f767d57a6 | harikvpy/crud,harikvpy/crud,harikvpy/crud | polls/views.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport bleach\n\n\nallowed_tags = [\n \"a\",\n \"img\", # links and images\n \"br\",\n \"p\",\n \"span\",\n \"blockquote\", # text layout\n \"strike\",\n \"strong\",\n \"u\",\n \"em\",\n \"sup\",\n \"su... | python | edit | 1 | 1 | mit | 1ff616fe4f6ff0ff295eeeaa4a817851df750e51 | tsiegleauq/OpenSlides,ostcar/OpenSlides,FinnStutzenstein/OpenSlides,normanjaeckel/OpenSlides,jwinzer/OpenSlides,OpenSlides/OpenSlides,tsiegleauq/OpenSlides,jwinzer/OpenSlides,FinnStutzenstein/OpenSlides,CatoTH/OpenSlides,CatoTH/OpenSlides,OpenSlides/OpenSlides,tsiegleauq/OpenSlides,CatoTH/OpenSlides,normanjaeckel/OpenS... | openslides/utils/validate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom citrination_client.base.errors import CitrinationClientError\n\n\nclass Target(object):\n \"\"\"\n The optimization target for a design run. Consists of\n the name of the output column to optimize and the objective\n (eithe... | python | edit | 1 | 3 | apache-2.0 | a9666ecaa7ed904cb9ded38e41ea381eb08d7d65 | CitrineInformatics/python-citrination-client | citrination_client/models/design/target.py | rejected_duplicate | Near-duplicate of sample 14437 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under an MIT open source license - see LICENSE\n\n'''\nTest functions for VCS\n'''\n\nfrom unittest import TestCase\n\nimport numpy as np\nimport numpy.testing as npt\n\nfrom ..statistics import VCS, VCS_Distance\nfrom ._testing_... | python | edit | 4 | 1 | mit | 9851430922f9c14583c9eb17062629f6ea99c258 | e-koch/TurbuStat,Astroua/TurbuStat | turbustat/tests/test_vcs.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# System Imports\nimport StringIO\nimport urllib\n\n# Twisted Imports\nfrom twisted.python.util import unsignedID\n\n# Package Imports\nfrom ..data.errors import Immutable\n\nclass Image (object):\n\n\t@property\n\tdef value (self):\n\t\tou... | python | edit | 1 | 2 | mit | f698dbc8b10aacf6ac8ee2a5d0d63ad01bd73674 | richardingham/octopus,rasata/octopus,rasata/octopus,richardingham/octopus,richardingham/octopus,richardingham/octopus,rasata/octopus | octopus/image/data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nfrom whalelinter.app import App\nfrom whalelinter.dispatcher import Dispatcher\nfrom whalelinter.commands.command import Command\nfrom whalelinter.commands.apt import Apt\n\n\n@Dispatch... | python | edit | 1 | 10 | mit | dc57eb8fa84f10ffa9ba3f8133563b7de3945034 | jeromepin/whale-linter | whalelinter/commands/common.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport etcd3.etcdrpc as etcdrpc\nfrom etcd3.client import Etcd3Client\nfrom etcd3.client import Transactions\nfrom etcd3.client import client\nfrom etcd3.leases import Lease\nfrom etcd3.locks import... | python | edit | 1 | 0 | apache-2.0 | bb3ba296038f45c2de6517c1f980843ce2042aa9 | kragniz/python-etcd3 | etcd3/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport os\nimport argparse\n\nfrom markdoc.cli import commands\nfrom markdoc.cli.parser import parser\nfrom markdoc.config import Config, ConfigNotFound\n\n\ndef main(cmd_args=None):\n \"\"\"The main entry poin... | python | edit | 6 | 7 | unlicense | de348d8816151f2674410566f3eaff9d43d9dcde | wlonk/markdoc,lrem/phdoc,lrem/phdoc,zacharyvoase/markdoc,snoozbuster/markdoc,wlonk/markdoc,snoozbuster/markdoc | src/markdoc/cli/main.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\nfrom feedback.models import Feedback\n\nclass FeedbackForm(forms.ModelForm):\n class Meta:\n model = Feedback\n exclude = (\"url\", \"resolved\", \"publish\",)\n```\n\nApply this change: Remove t... | python | edit | 1 | 0 | bsd-3-clause | 84a0aef34f8ab187de7e0c2b17c2e79d0e8f2330 | gabrielhurley/django-user-feedback | feedback/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\n\nfrom funcy import split, map\n\nfrom .analysis import global_usage, local_usage, FileSet\n\n\nimport sys, ipdb, traceback\n\ndef info(type, value, tb):\n traceback.print_exception(type, value, tb)\n ... | python | edit | 2 | 4 | bsd-2-clause | 1239128a082757c3a7d53e7b14c189dda06f4171 | Suor/flaws | flaws/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom factory import fuzzy\n\nfrom django.contrib.auth import get_user_model\nfrom django.test import TestCase\n\n\nclass AccountsTestCase(TestCase):\n def setUp(self):\n super(AccountsTestCase, self).setUp()\n\n self.passwo... | python | edit | 1 | 1 | mit | 0a5e2134fda46269626b6fac367a28218734b256 | pydata/conf_site,pydata/conf_site,pydata/conf_site | conf_site/accounts/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyxform.tests_v1.pyxform_test_case import PyxformTestCase\n\n\nclass AuditTest(PyxformTestCase):\n def test_audit(self):\n self.assertPyxformXform(\n name=\"meta_audit\",\n md=\"\"\"\n | surve... | python | edit | 1 | 1 | bsd-2-clause | 76e436daef154bdf6acd1b0569f6fa2baa61addd | XLSForm/pyxform,XLSForm/pyxform | pyxform/tests_v1/test_audit.py | rejected_duplicate | Near-duplicate of sample 1490 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nThe default rendering engine, process yaml with the jinja2 templating engine\n\nThis renderer will take a yaml file with the jinja2 template and render it to a\nhigh data format for salt states.\n'''\n\n# Import Python Modules\nimport ... | python | edit | 5 | 2 | apache-2.0 | fb25fa04cf553b1084425a1f2af6a9315266ffaf | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/renderers/yaml_jinja.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\n\npytest_plugins = 'setuptools.tests.fixtures'\n\n\ndef pytest_addoption(parser):\n parser.addoption(\n \"--package_name\", action=\"append\", default=[],\n help=\"list of package_name to pass to test function... | python | edit | 1 | 5 | mit | e645104656fda22f4c0c2b3d9841ed792b1e7103 | pypa/setuptools,pypa/setuptools,pypa/setuptools | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Ericsson AB\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 ... | python | edit | 1 | 1 | apache-2.0 | 84d9a421b33660f4ad17432fef8604a55b0e2302 | EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base | calvin/runtime/south/plugins/io/sensors/environmental/platform/raspberry_pi/sensehat_impl/environmental.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement\n\n\nclass BallClose(AbstractDecisionElement):\n def __init__(self, blackboard, dsd, parameters=None):\n super(BallClose, self).__init__(blackboar... | python | edit | 1 | 2 | bsd-3-clause | 3e41a447076c4aa183923700c1c8203afdf07377 | bit-bots/bitbots_behaviour | bitbots_body_behavior/src/bitbots_body_behavior/decisions/ball_close.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime\n\n\nclass SBTSettings(object):\n\n def __init__(self, window):\n self.window = window\n self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')\n\n def sbt_command(self):\n ret... | python | edit | 1 | 2 | mit | ec07e139b5585a8ed9bed14426dac987267ebf05 | jarhart/SublimeSBT | sbtsettings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nimport sys\n\n# $ zmmailbox -z -m <EMAIL> search -l 200 \"in:/inbox (before:today)\"\n# num: 200, more: true\n#\n# Id Type From Subject Date\n# ------- -... | python | edit | 2 | 7 | apache-2.0 | ba4953423450c3bf2924aa76f37694b405c8ee85 | hgdeoro/zimbra7-to-zimbra8-password-migrator | parse-zmmailbox-ids.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n'''\nBulk spectral line fitting with SDSS galaxy spectra\n'''\n\nimport os\nfrom astropy.io import fits\nfrom pandas import concat\n\n# Bring in the package funcs\nfrom specfit import do_specfit\nfrom download_spectra import download_spec... | python | edit | 1 | 4 | mit | 0b8b32a044e92f4e996af734d44a2d93d1492684 | e-koch/Phys-595 | project_code/bulk_fitting.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.