messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport categories # nopep8\nimport plugins # nopep8\nimport submitted_plugins # nopep8\nimport tags # nopep8\n\n```\n\nApply this change: Update nopep8 instructions to NOQA\n\n`flake8` seems to have dropped support for `# nopep8` in the... | python | edit | 1 | 0 | mit | a56707d815271088c2c19f0c2c415d611886e859 | jonafato/vim-awesome,vim-awesome/vim-awesome,jonafato/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,jonafato/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,jonafato/vim-awesome,divad12/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,vim-awesome/vim-awesome | db/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport api\nimport db\nfrom utils import parse_timestamp\n\nimport hashlib\nimport json\n\ndef download_logs():\n \"\"\" Download mailgun logs and store them in the database \"\"\"\n logs = []\n skip = 0\n \n # Fetch all unsa... | python | edit | 1 | 7 | mit | 9c945162dfb60481c9f5d39c5e42617b030263a9 | p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc | mailgun/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Stand-in module for those without the speed-enhanced tuple-OID implementation\"\"\"\n\ndef OID( value ):\n\t\"\"\"Null function to pretend to be oid.OID\"\"\"\n\treturn str(value)\n\n\n```\n\nApply this change: Declare use of string O... | python | edit | 1 | 1 | bsd-3-clause | 1c4fbca7ce0b1ad16159f62e1485a3485f1878bb | mmattice/TwistedSNMP | oidstub.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nimport sys\nimport argparse\nfrom Bio import SeqIO\n\nparser = argparse.ArgumentParser(description='Partition a genome into a set of overlapping segments')\nparser.add_argument('--segment-length', ty... | python | edit | 1 | 0 | mit | e33a68f14a13c0340b2dfcbb13931d2185735951 | jts/nanopolish,jts/nanopolish,jts/nanopolish,jts/nanopolish,jts/nanopolish | scripts/nanopolish_makerange.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom uchicagohvz.game.models import *\n\nclass KillSerializer(serializers.ModelSerializer):\n\tclass Meta:\n\t\tmodel = Kill\n\t\tfields = ('id', 'killer', 'victim', 'location', 'date', 'points')\n\n\... | python | edit | 3 | 3 | mit | 945209957a26d8fc7673795b5bfc5c233ed00e0e | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz | uchicagohvz/game/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2021 The SeqIO Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.... | python | edit | 16 | 0 | apache-2.0 | 8db347eaae51ea5f0a591bcecd5ba38263379aae | google/seqio | seqio/__init__.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .io import IOAdapter\n\n\nclass MultiIOAdapter(IOAdapter):\n\n def __init__(self, **kwargs):\n super(MultiIOAdapter, self).__init__(**kwargs)\n\n self.adapters = []\n\n def process_input(self, *args, **kwargs):\n ... | python | edit | 3 | 2 | bsd-3-clause | c0a74c86e772185d35f0e6049e0ce04fcdb30793 | Reinaesaya/OUIRL-ChatBot,maclogan/VirtualPenPal,Reinaesaya/OUIRL-ChatBot,Gustavo6046/ChatterBot,davizucon/ChatterBot,gunthercox/ChatterBot,vkosuri/ChatterBot | chatterbot/adapters/io/multi_adapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom node import Node\nfrom model.cpu import CPU\nfrom extraction.http.cpu_cw_http import CpuCwHTTP\n\n\nclass CPUNode(Node):\n\n label = \"CPU\"\n\n def __init__(self, service, timespan):\n super(CPUNode, self).__init__(service, times... | python | edit | 3 | 3 | apache-2.0 | 431fdabc5c103c9581758543359a54f650d24bcf | sealuzh/ContextBasedAnalytics,sealuzh/ContextBasedAnalytics,sealuzh/ContextBasedAnalytics | nodes/cpu_node.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\n\nimport glob\nimport os\nimport copy\n\nimport zmq\nfrom distutils.core import Extension\n\ndef get_extensions(**kwargs):\n \"\"\"Get the Cython extensions\"\"\"\n this... | python | edit | 1 | 3 | bsd-3-clause | 484eaaf6349a631f483af12acd358bce5ca567d5 | alexrudy/Zeeko,alexrudy/Zeeko | zeeko/messages/setup_package.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom datetime import date as vanilla_date\n\nfrom calexicon.internal.julian import distant_julian_to_gregorian, julian_to_gregorian, is_julian_leap_year\n\n\nclass TestJulian(unittest.TestCase):\n def test_is_gregorian... | python | edit | 1 | 1 | apache-2.0 | 01e629b43be83cd5ba37f7a3ecbf60c73d8ed2e6 | jwg4/calexicon,jwg4/qual | calexicon/internal/tests/test_julian.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst\n\nclass bdist_wininst(_bdist_wininst):\n _good_upload = _bad_upload = None\n\n def create_exe(self, arcname, fullname, bitmap=None):\n _bdist_wininst.... | python | edit | 1 | 2 | mit | 5ae17b58d4823cb5e74ec1b7802c0debbc119dc9 | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/command/bdist_wininst.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom main import initiate_shame\n\n# Testing this\ninitiate_shame(1141922, 2016)\n\n```\n\nApply this change: Update script file for the season"
},
{
"role": "assistant",
"content": "from main import initiate_shame\n\ninitiate_s... | python | edit | 1 | 0 | mit | ec4b2fc266eb033dab9319c4d2f8ece6fd23170a | troym9731/fantasy_football | src/start_scraping.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWrite a function to find the longest common prefix string amongst an array of strings.\n\"\"\"\nclass Solution(object):\n def longestCommonPrefix(self, strs):\n \"\"\"\n :type strs: List[str]\n :rtype: str\n ... | python | edit | 1 | 8 | mit | 227d4c152367292e8b0b8801d9ce6179af92432a | ufjfeng/leetcode-jf-soln,ufjfeng/leetcode-jf-soln | python/014_longest_common_prefix.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom stun import cli\n\n\nclass TestCLI(unittest.TestCase):\n \"\"\"Test the CLI API.\"\"\"\n\n def test_cli_parser(self):\n cli.make_argument_parser()\n # TODO: Verify default arguments\n # TOD... | python | edit | 1 | 1 | mit | 4d38b5e391e222c6da371bb100f0bd84c33e3435 | b1naryth1ef/pystun,jtriley/pystun | tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport httplib2\nfrom config import SERVER\n\nhttp = httplib2.Http()\n\n# print json.loads(http.request(\"http://172.28.101.30:8080/api/v1/family/1/?format=json\", 'GET')[1])\n\ndef json_result(url, method='GET'):\n response... | python | edit | 1 | 4 | mit | 714611e3fdddc4f2cacb5be4753d22322cafd312 | iuliux/FamilyQuest-RPi | rest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport json\nimport logging\n\n\nLOGGER = logging.getLogger(__name__)\n\n\nclass DictFile(dict):\n \"\"\"A ``dict``, storable as a JSON file.\n \"\"\"\n def __init__(self, file_path):\n super(DictFile, self).__ini... | python | edit | 1 | 2 | mit | 71e9b63f2c39e2b93bc570edc4214f4910b876f3 | pmuller/ipkg | ipkg/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n\nimport api\nfrom project import Project\n\n\nclass Suite(object):\n def __init__(self, content):\n self._content = content\n self.api = api.API()\n\n @property\n def id(self):\n ... | python | edit | 1 | 2 | mit | 674fa7692c71524541d8797a65968e5e605454e7 | travispavek/testrail-python,travispavek/testrail | testrail/suite.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add lpcres in linpred namespace."
},
{
"role": "assistant",
"content": "import levinson_lpc\nfrom levinson_lpc import *\n__all__ = levinson_lpc.__all__\n\nfrom common import lpcres\n__all__ += ['lpcres']\n"
}
] | python | new_file | 2 | 0 | mit | d7c293fb430c31c237e3aca7ba469f0237b18d8d | cournape/talkbox,cournape/talkbox | scikits/talkbox/linpred/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\ntry:\n # noinspection PyPackageRequirements\n import unittest2 as unittest\n sys.modules['unittest'] = unittest\nexcept ImportError:\n import unittest\n\nfrom goless.backends import current as be\n\n\nclass BaseTests... | python | edit | 1 | 1 | apache-2.0 | e704d8cb63e76bb1f5b1da6fec7ae4f65d7710f1 | rgalanakis/goless,rgalanakis/goless | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom git import Repo, exc\nimport os\n\nclass GitRepo(object):\n def __init__(self, root=None, remote=\"origin\", lazy=True):\n self.remote_name = remote\n self.root = root\n self._repo = None\n if not lazy:\n... | python | edit | 2 | 5 | mit | e4e930587e6ad145dbdbf1f742b942d63bf645a2 | wandb/client,wandb/client,wandb/client | wandb/git_repo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n@pytest.mark.parametrize(\"name\", [\n (\"apt-file\"),\n (\"apt-transport-https\"),\n (\"atsar\"),\n (\"blktrace\"),\n (\"ca-certificates\"),\n (\"chromium-browser\"),\n (\"cron\"),\n (\"curl\"),\n (\"diod\"),\n (... | python | edit | 1 | 1 | mit | 347e3f9092bf1f48e116cafceef8db255e293b1f | wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build | test/test_packages.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport types\nfrom version import __version__\nfrom .model import Model\nfrom .collection import Collection\n\n\nclass Hammock(object):\n\t\n\tdef __init__(self, collections=(), authenticators=(), storage=None):\n\t\tif type(collections) ==... | python | edit | 4 | 11 | mit | 7c1a6fdc82ccdf8469d95e1e77897fab6e25d551 | cooper-software/cellardoor | hammock/__init__.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 pytest\n\nfrom cihai import exc\n\n\ndef test_base_exception():\n with pytest.raises(\n exc.CihaiException,\n message=\"Make sure no one removes or renames base CihaiException\",\n ):\n ... | python | edit | 1 | 1 | mit | 17d91eff7de5517aa89330a08f3c84fa46d02538 | cihai/cihai,cihai/cihai | tests/test_exc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import Counter, defaultdict\n\nimport numpy as np\n\nfrom tmhmm.model import parse\nfrom tmhmm.hmm import viterbi, forward, backward\n\n\n__all__ = ['predict']\n\n\nGROUP_NAMES = ('i', 'm', 'o')\n\n\ndef predict(sequence, ... | python | edit | 1 | 6 | mit | 1d0e75959f4511cbca10cb223b01c3a29d3660ec | dansondergaard/tmhmm.py | tmhmm/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tornado.web import RequestHandler\nimport bugsnag\n\nclass BugsnagRequestHandler(RequestHandler):\n def _handle_request_exception(self, e):\n # Set the request info\n bugsnag.configure_request(\n user_id = s... | python | edit | 1 | 1 | mit | cc46e4d251c479563318c93f419fead373fa0c12 | bugsnag/bugsnag-python,overplumbum/bugsnag-python,bugsnag/bugsnag-python,overplumbum/bugsnag-python | bugsnag/tornado/__init__.py | rejected_duplicate | Near-duplicate of sample 14022 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\ngargoyle.helpers\n~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010 DISQUS.\n:license: Apache License 2.0, see LICENSE for more details.\n\"\"\"\n\nfrom django.http import HttpRequest\n\nclass MockRequest(HttpRequest):\n \"\"\"\n A moc... | python | edit | 1 | 2 | apache-2.0 | ff8f1067ac95a8f3fbb4c02e510da033623edeee | disqus/gutter-django,nkovshov/gargoyle,nkovshov/gargoyle,nkovshov/gargoyle,frewsxcv/gargoyle,brilliant-org/gargoyle,frewsxcv/gargoyle,YPlan/gargoyle,roverdotcom/gargoyle,monokrome/gargoyle,monokrome/gargoyle,disqus/gutter,vikingco/gargoyle,disqus/gutter-django,blueprinthealth/gargoyle,YPlan/gargoyle,graingert/gutter-dj... | gargoyle/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\nclass Config(object):\n \"\"\"Parent configuration class\"\"\"\n DEBUG = False\n CSRF_ENABLED = True\n # ALT: <variable> = os.getenv('<env_var_name>')\n SECRET = 'HeathLEDGERwasTHEBESTidc'\n # database with ... | python | edit | 1 | 0 | mit | 187e55c8ad204c3a6196794aba1b59fd0fa62b00 | Elbertbiggs360/buckelist-api | instance/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.core.management import BaseCommand\n\nfrom ...event import sync_events\n\n\nclass Command(BaseCommand):\n def handle(self, *args, **options):\n num_new_events, num_updated_ids, num_deleted_id... | python | edit | 1 | 2 | mit | 194748bfbc67741275fd36eb2eaafbde55caeabb | machtfit/django-emarsys,machtfit/django-emarsys | django_emarsys/management/commands/emarsys_sync_events.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nr = requests.get('http://localhost:8081/monitor_results/1')\nprint(r.json())\nfor monitoring_data in r.json():\n print 'URL: ' + monitoring_data['urlToMonitor']['url']\n\n```\n\nApply this change: Add prototype for pl... | python | edit | 1 | 0 | mit | a2abc6342162c9158551b810f4d666d6d13dcd15 | gernd/simple-site-mon | client/python/plot_request_times.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bitHopper.Website import app, flask\nimport btcnet_info\nimport bitHopper.Configuration.Workers\nimport logging\n \n@app.route(\"/worker\", methods=['POST', 'GET'])\ndef worker():\n\n #Check if this is a form submission\n hand... | python | edit | 1 | 5 | mit | 494884ae3510c0cf23704cb772ad4a024040a9c7 | c00w/bitHopper,c00w/bitHopper | bitHopper/Website/Worker_Page.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport logging\n\ndef init_logging():\n logFormat = \"%(asctime)s %(levelname)s %(filename)s:%(lineno)s %(message)s\"\n logFormatter = logging.Formatter(fmt=logFormat)\n logHandler = logging.StreamHandler(stream=sys.std... | python | edit | 4 | 1 | apache-2.0 | 078f00ae743c2e16df76653090298ba56b277caf | pegasus-isi/pegasus-metrics,pegasus-isi/pegasus-metrics,pegasus-isi/pegasus-metrics | pegasus/metrics/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Begin: Python 2/3 compatibility header small\n# Get Python 3 functionality:\nfrom __future__ import\\\n absolute_import, print_function, division, unicode_literals\nfrom future.utils import raise_with_traceback, raise_from\n# catch exc... | python | edit | 10 | 6 | mit | 2d52b37e8ed868099f5e808402b6c966987589e5 | pikinder/nn-patterns | nn-patterns/utils/tests/networks/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom twisted.trial import unittest\nfrom twisted.python import failure\n\nfrom ..spawn import SpawnCommand\n\nclass DummyEvent(object):\n text = \"\"\n\nclass SpawnCommandProtocolTestCase(unittest.TestCase):\n def test_g... | python | edit | 1 | 2 | bsd-2-clause | 5ea25bc6c72e5c934e56a90c44f8019ad176bb27 | jdswinbank/Comet,jdswinbank/Comet | comet/utility/test/test_spawn.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\nsetup(\n name = 'furs_fiscal',\n packages = ['furs_fiscal'],\n version = '0.1.0',\n description = 'Python library for simplified communication with FURS (Financna uprava Republike Slovenije).',\n autho... | python | edit | 1 | 0 | mit | cc2f0900b02891e0ab23133778065a6f6768cd5c | boris-savic/python-furs-fiscal | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Copyright (C) 2011, 2012 Strahinja Val Markovic <<EMAIL>>\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU G... | python | edit | 1 | 7 | mit | 93ed6f7db7060893214571bf5ec8a633fffa48ab | nikmartin/dotfiles | python/completers/cpp/clang_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .gobject import GObject\nfrom . import signals\n\nclass Game(GObject):\n def __init__(self):\n self.maps = {}\n self.player = None\n\n def run(self):\n pass\n\n def handle_signals(self):\n signals.h... | python | edit | 1 | 2 | bsd-3-clause | dafa014fa5c4788affd2712b68ef5bee56b5e600 | entwanne/NAGM | engine/game.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom tapioca import (JSONAdapterMixin, TapiocaAdapter,\n generate_wrapper_from_adapter)\n\nfrom .resource_mapping import RESOURCE_MAPPING\n\n\nclass InstagramClientAdapter(JSONAdapterMixin, TapiocaAdap... | python | edit | 1 | 3 | mit | cb39de495da5256e6e44773036f78d704f0d563d | vintasoftware/tapioca-instagram | tapioca_instagram/tapioca_instagram.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Custom error for invalid yaml file.\"\"\"\n\nfrom .Error import Error\n\nERROR_MESSAGE = \"\"\"\nInvalid YAML file (.yaml)\n\nOptions:\n - Does the file match the expected layout?\n - Does the file contain at least one key:value pai... | python | edit | 1 | 1 | mit | 2cc9f1781691865222acb90fb8bbd5e721cc2549 | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/utils/errors/InvalidYAMLFileError.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nScan through the Samples table for oldish entries and remove them.\n\"\"\"\n\nimport json\nimport boto3\nimport time\nimport decimal\nfrom boto3.dynamodb.conditions import Key, Attr\n\ndef purge_item(item, batch):\n response = ba... | python | edit | 6 | 4 | mit | c33bbe44708ccf60f4a0cf759b3f38b739b7fb5d | SandcastleApps/partyup,SandcastleApps/partyup,SandcastleApps/partyup | PartyUPLambda/purge.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Module containing a preprocessor that removes the outputs from code cells\"\"\"\n\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n#---------------------------------------------... | python | edit | 1 | 2 | bsd-3-clause | 30e10449205763363fe8663765645796b0dc8fd5 | ipython/ipython,ipython/ipython | IPython/nbconvert/preprocessors/clearoutput.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom buffer.api import API\n\nfrom buffer.user import User\n\ntoken = '1/714ebdb617705ef9491a81fb21c1da42'\napi = API(client_id='51cc6dd5f882a8ba18000055', client_secret='83b019d154cae4d2c734d813b33e5e53')\n\nr = api.get('user.json?')\nprin... | python | edit | 2 | 0 | mit | 9858837add5105f2f4e78abe84930c4e164071b9 | vtemian/buffpy,bufferapp/buffer-python | examples/me.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom cms.plugin_base import CMSPluginBase\nfrom cms.plugin_pool import plugin_pool\nfrom django.utils.translation import ugettext as _\nfrom django.conf import settings\n\nfrom .models import Filer... | python | edit | 1 | 5 | bsd-3-clause | c7fb70585b0c488d523a4ff173e3b0675029e90b | yvess/cmsplugin-filer,divio/cmsplugin-filer,alsoicode/cmsplugin-filer,creimers/cmsplugin-filer,jschneier/cmsplugin-filer,stefanfoulis/cmsplugin-filer,brightinteractive/cmsplugin-filer,nephila/cmsplugin-filer,creimers/cmsplugin-filer,jschneier/cmsplugin-filer,brightinteractive/cmsplugin-filer,skirsdeda/cmsplugin-filer,d... | cmsplugin_filer_link/cms_plugins.py | rejected_duplicate | Near-duplicate of sample 17472 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nfrom flask.ext.babel import lazy_gettext as _\n\n\ndef time_choice(time):\n display_format = \"%I:%M %p\"\n end = time + datetime.timedelta(minutes=30)\n display_string = time.strftime(display_format).lstrip(\"0\")... | python | edit | 1 | 2 | mit | 60cbe21d95cc6e079979022a505dcc2099bd30c1 | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public | cla_public/libs/call_centre_availability.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nfrom . import fixers, utilities, deprecation, registry\n\n\n# TODO make it idempotent with registry of applied fixes, just log if double applications of same fixers... | python | edit | 4 | 3 | mit | f375fc031640c24dd7761283b931b402d8366421 | pakal/django-compat-patcher,pakal/django-compat-patcher | django_compat_patcher/patcher.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gpiozero import LED\nimport time\n\n# GPIO 24 ... LED ... 470 ohm resistor ... GND\n\nled = LED(24)\ntry:\n led.blink()\n time.sleep(20)\nexcept KeyboardInterrupt:\n led.off()\n\n\n```\n\nApply this change: Print message on co... | python | edit | 2 | 0 | mit | 0a9aed9427b0b36d71a2e8fee74db74690727b15 | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | hardware/gpio/LEDblink_gpiozero.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 Mirantis 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\n# a copy of the Lice... | python | edit | 1 | 1 | apache-2.0 | 3f750865762e7751ce0cbd4a171d68e9d1d5a8a6 | bswartz/manila,jcsp/manila,bswartz/manila,weiting-chen/manila,sajuptpm/manila,openstack/manila,NetApp/manila,redhat-openstack/manila,sajuptpm/manila,vponomaryov/manila,weiting-chen/manila,NetApp/manila,jcsp/manila,vponomaryov/manila,redhat-openstack/manila,openstack/manila,scality/manila,scality/manila | contrib/tempest/tempest/cli/manilaclient.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Enable greenthreading for ec2api services\n\nSince ec2api and metadata services based on greenthreading, it have to\nbe initialized properly. This patch initializes it for cmd modules,\nwhich allows to debug services from IDE.\n\nChange-Id: ... | python | new_file | 1 | 0 | apache-2.0 | 4f35af8502b8d091cd88ab61c0aca343918ac9f1 | openstack/ec2-api,stackforge/ec2-api,hayderimran7/ec2-api,stackforge/ec2-api,hayderimran7/ec2-api,openstack/ec2-api | ec2api/cmd/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport uuid\nclass Scope:\n def __init__(self):\n self.pc = 0;\n self.variables = {}\n self.lvalue = self\n self.rvalue = self\n self.stack = [1,2,3]\n self.name = uuid.uuid1()\n\n def GetVar(... | python | edit | 1 | 2 | mit | 92cb843c1b6ada9b63038ed1ce22f83ee6146aff | joewashear007/jazzy | jazzy/scope.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\"\"\"Benchmark listing all processes\n\nUsage:\n benchmark_proc_get_all.py\n\"\"\"\n\nimport os\nMYDIR = os.path.dirname(os.path.abspath(__file__))\n\nimport sys\nsys.path.insert(0, os.pat... | python | edit | 1 | 2 | mit | e87017a724b274ad3289f4af674ae88bf8f21b8a | walles/px,walles/px | devbin/benchmark_proc_get_all.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python\n\"\"\"\nreversebinary puzzle for Spotify.com\n\nv1\n\nJose Antonio Navarrete\n\nYou can find me at <EMAIL>\nFollow me on twitter @joseanavarrete\n\"\"\"\n\nimport unittest\n\nMAX_VALUE = 1000000000\n\ndef reverse_binary(n):\n... | python | edit | 1 | 2 | mit | b49844f2c6da136d4b4c350b2b176e5f4cbdcd88 | josenava/spotify_puzzle | reversebinary.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom numpy.testing import *\nimport numpy as np\n\nimport skimage.io as io\nfrom skimage import data_dir\n\n\ndef test_stack_basic():\n x = np.arange(12).reshape(3, 4)\n io.push(x)\n\n assert_array_equal(io.pop(), x)\n... | python | edit | 5 | 1 | bsd-3-clause | abc1d2095f18f6c7ff129f3b8bf9eae2d7a6239a | WarrenWeckesser/scikits-image,SamHames/scikit-image,chintak/scikit-image,chintak/scikit-image,juliusbierk/scikit-image,oew1v07/scikit-image,blink1073/scikit-image,bsipocz/scikit-image,bennlich/scikit-image,youprofit/scikit-image,dpshelio/scikit-image,newville/scikit-image,dpshelio/scikit-image,GaZ3ll3/scikit-image,ofgu... | skimage/io/tests/test_io.py | rejected_lint | Too many lint violations: 5 | 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 | ad1c654422413b90c78614f66af61c1410cc1a77 | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make metamodel factory methods and lang API available in textx package."
},
{
"role": "assistant",
"content": "from textx.metamodel import metamodel_from_file, metamodel_from_str # noqa\nfrom textx.langapi import get_language, i... | python | new_file | 1 | 0 | mit | c407c067495d76ebed7c36ef005861c80fdcfdce | igordejanovic/textX,igordejanovic/textX,igordejanovic/textX | textx/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n''' Copyright 2015 RTeam (Edgar Kaziahmedov, Klim Kireev, Artem Yashuhin)\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 ... | python | edit | 1 | 0 | apache-2.0 | f87cbadbbcfc9d67aa3e5d0662236c18f23ba63b | proffK/CourseManager | DataBase.py | rejected_duplicate | Near-duplicate of sample 5310 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2019 The TensorFlow Authors. 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 Licens... | python | edit | 1 | 1 | apache-2.0 | 4e699d94c84f1123f36a331926ca77af3f86b474 | cxxgtxy/tensorflow,karllessard/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,jhseu/tensorflow,yongtang/tensorflow,renyi533/tensorflow,petewarden/tensorflow,renyi533/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries... | tensorflow/python/profiler/traceme.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\r\n\r\nsubprocess.call('python setup.py sdist')\r\nsubprocess.call('python setup.py sdist bdist_wheel upload')\r\n\n```\n\nApply this change: Update pip deploy script to use twine"
},
{
"role": "assistant",
"co... | python | edit | 1 | 0 | mit | 343d0bcdeb6981ca90673de342eb6064ca62c24e | partrita/Gooey,chriskiehl/Gooey,codingsnippets/Gooey | pip_deploy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom .connectors import (GithubConnector, S3Connector,\n FTPConnector, LocalConnector)\nfrom .transporters import (BaltradToS3, LocalToS3)\nfrom .s3enram import S3EnramHandler\nfrom .utils import (parse_filename, e... | python | edit | 14 | 0 | mit | 0e044d1ad8b6fb2b0ac2126bb0fccfa05de9da14 | enram/data-repository,enram/data-repository,enram/data-repository,enram/infrastructure,enram/data-repository,enram/infrastructure | file_transfer/datamover/__init__.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('server', '0005_auto_20150717_1827'),\n ]\n\n o... | python | edit | 3 | 3 | apache-2.0 | 759f6a2e4ced9ce9beeda01e638f109d946050b1 | sheagcraig/sal,salopensource/sal,salopensource/sal,macjustice/sal,chasetb/sal,salopensource/sal,sheagcraig/sal,erikng/sal,macjustice/sal,erikng/sal,chasetb/sal,chasetb/sal,erikng/sal,macjustice/sal,macjustice/sal,sheagcraig/sal,erikng/sal,sheagcraig/sal,chasetb/sal,salopensource/sal | server/migrations/0006_auto_20150811_0811.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport setuptools\nfrom imgtool import imgtool_version\n\nsetuptools.setup(\n name=\"imgtool\",\n version=imgtool_version,\n author=\"The MCUboot commiters\",\n description=(\"MCUboot's image signing and key management\"),\n ... | python | edit | 1 | 0 | apache-2.0 | b916e8dbb08b6c4ebb2ff37e8515a41f05261f5b | utzig/mcuboot,utzig/mcuboot,ATmobica/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,tamban01/mcuboot,ATmobica/mcuboot,utzig/mcuboot,utzig/mcuboot,tamban01/mcuboot,tamban01/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,runtimeco/mcuboot,tamban01/mcuboot,tamban01/mcuboot,utzi... | scripts/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom requests_oauthlib import OAuth2Session\n\n\nclass Session(OAuth2Session):\n\n client_id = None\n client_secret = None\n\n def __init__(self, subdomain, **kwargs):\n client_id = self.client_id\n client_secret = se... | python | edit | 1 | 3 | isc | 32994f27d1644415e8cd4a22f1b47d4938d3620c | fulfilio/fulfil-python-api,sharoonthomas/fulfil-python-api | fulfil_client/oauth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"updates subreddit css with compiled sass\"\"\"\nimport time\n\nimport sass\nimport praw\n\n\ndef css() -> str:\n \"\"\"compiles sass and returns css\"\"\"\n return sass.compile(filename=\"index.scss\", output_style=\"compressed\... | python | edit | 1 | 7 | mit | 7a98cd1c58985da9230ba5861731b6f252d2c611 | neoliberal/css-updater | source/update.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.contrib.auth import views\nfrom django.http import HttpResponseRedirect\n\nurlpatterns = [\n url(r'^$', lambda u: HttpResponseRedirect('/repo')),\n\... | python | edit | 1 | 0 | mit | 9ee03ea335b438cf1005a2295360310456e27bad | giantas/elibrary,giantas/elibrary,giantas/elibrary | repos/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2013 - Noorul Islam K M\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the Lice... | python | edit | 1 | 1 | apache-2.0 | e6b5c93a8c23fcea84768a8b50708ef7ef78dcd8 | gilbertpilz/solum,ed-/solum,ed-/solum,gilbertpilz/solum,openstack/solum,devdattakulkarni/test-solum,gilbertpilz/solum,stackforge/solum,openstack/solum,ed-/solum,stackforge/solum,devdattakulkarni/test-solum,ed-/solum,gilbertpilz/solum | functionaltests/api/base.py | rejected_duplicate | Near-duplicate of sample 3420 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# 'physics' is a tentative name for this subpackage. Another\n# possibility is 'plasma'. The organization is to be decided by v0.1.\n\nfrom .parameters import Alfven_speed, ion_sound_speed, thermal_speed, kappa_thermal_speed, gyrofrequenc... | python | edit | 31 | 0 | bsd-3-clause | 387ca6153d0f584f3caf27add6cf01d1da081fc3 | StanczakDominik/PlasmaPy | plasmapy/physics/__init__.py | rejected_lint | Too many lint violations: 31 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n\nimport sys\nfrom message import Message\nfrom persistence import Persistence\nfrom const import XML_FILE_EXTENSION\n\n\nmessage = Persistence.get_message_from_file(sys.argv[1])\nif (message is not None):\n Per... | python | edit | 3 | 0 | apache-2.0 | e9541dbd1959b7a2ad1ee9145d3168c5898fe204 | fpbfabio/newsgroups1000s,fpbfabio/dblp_data_processing | python/generate_sorl_xml.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\"\"\"A fancy version of Python's builtin :func:`dir` function.\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (C) 2008-2011 The IPython Development Team\n#\n# Di... | python | edit | 1 | 4 | bsd-3-clause | 1370018ac3f96a5a04d119afa95d482a7504119e | ipython/ipython,ipython/ipython | IPython/utils/dir2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom gym import error, envs\nfrom gym.envs import registration\nfrom gym.envs.classic_control import cartpole\n\ndef test_make():\n env = envs.make('CartPole-v0')\n assert env.spec.id == 'CartPole-v0'\n ass... | python | edit | 1 | 3 | mit | 2d45775e3823cf5a27df92350cbc89963aecc84c | d1hotpep/openai_gym,d1hotpep/openai_gym,dianchen96/gym,machinaut/gym,Farama-Foundation/Gymnasium,machinaut/gym,dianchen96/gym,Farama-Foundation/Gymnasium | gym/envs/tests/test_registration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\n\nfrom us_ignite.snippets.models import Snippet\n\n\nFIXTURES = [\n {\n 'slug': 'home-box',\n 'name': 'UP NEXT: LOREM IPSUM',\n 'body': '',\n 'url_text': 'G... | python | edit | 3 | 3 | bsd-3-clause | 76afe0ef2f45ff7ff62dd5ea4d1217ce794770ba | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/snippets/management/commands/snippets_load_fixtures.py | rejected_duplicate | Near-duplicate of sample 3066 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.contrib.auth.models import User\n\nfrom rest_framework import serializers\n\nfrom core.models import Timesheet, Task, Entry\n\n\nclass UserSerializer(serializer... | python | edit | 1 | 0 | bsd-2-clause | b8386212826701131e3c5aaaadef726df97f6646 | Leahelisabeth/timestrap,overshard/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,overshard/timestrap,muhleder/timestrap,Leahelisabeth/timestrap,cdubz/timestrap,overshard/timestrap,muhleder/timestrap,cdubz/timestrap,muhleder/timestrap,Leahelisabeth/timestrap | api/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import main, TestCase\nfrom grammpy import Grammar, Nonterminal, Rule as _R\nfrom ..grammar import... | python | edit | 11 | 1 | mit | 7599f60a0e64f1d1d076695af67a212be751a89b | PatrikValkovic/grammpy | tests/rules_tests/grammarManipulation_tests/InactiveRulesTest.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import *\nimport subprocess\n\n__all__ = ['ssh', 'all', 'uptime', 'upgrade', 'restart']\n\n@task\ndef all():\n \"\"\"\n Select all hosts\n \"\"\"\n env.hosts = []\n for hosts in env.roledefs.values():\n ... | python | edit | 27 | 2 | bsd-3-clause | 38a2a2d6a1e8307e1e0ed58769df7b77d2ef9355 | nithinphilips/loom,bfirsh/loom,nithinphilips/loom,bfirsh/loom | loom/tasks.py | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nfrom snake.core import Snake\n\n\nSNAKEFILE_LOADED = False\n\n\ndef abort(msg):\n print >> sys.stderr, \"Error: %s\" % msg\n sys.exit(1)\n\n\ndef load_snakefile(path, fail_silently=False):\n global SNAKEFIL... | python | edit | 2 | 3 | bsd-2-clause | 9da3f2a835fa2aaba5d91ffe31b3fcaf8d83a4c9 | yumike/snake | snake/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Cloudbase Solutions Srl\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy o... | python | edit | 1 | 1 | apache-2.0 | 8c0d1acf6ea41adc3743a4e190eaf777188282c0 | mahak/nova,mahak/nova,klmitch/nova,openstack/nova,klmitch/nova,openstack/nova,mahak/nova,klmitch/nova,openstack/nova,klmitch/nova | nova/policies/floating_ip_pools.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom pal.services.service import Service\nfrom pal.services.service import wrap_response\n\n\nclass JokeService(Service):\n _JOKES = {\n 'open the pod bay doors pal':\n \"I'm sorry, Jeff, I'm afraid I can't... | python | edit | 1 | 3 | bsd-3-clause | b2239ab0329f129da21f3ab82eaf9543b95fc01b | Machyne/pal,Machyne/pal,Machyne/pal,Machyne/pal | pal/services/joke_service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom abc import ABCMeta, abstractmethod\n\nimport requests\n\nfrom bs4 import BeautifulSoup\n\n\ndef make_soup(url):\n\t\tresponse = requests.get(url)\n\t\tsoup = BeautifulSoup(response.text, 'html.parser')\n\t\treturn soup\n\n\nclass Aggre... | python | edit | 1 | 1 | apache-2.0 | 3c798673cfb5f7e63e2aebb300ba7cc92c72fa8a | footynews/fn_backend | aggregator/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\n\nfrom .factories import UserFactory\nfrom mama_cas.callbacks import user_model_attributes\nfrom mama_cas.callbacks import user_name_attributes\n\n\nclass CallbacksTests(TestCase):\n url = 'http://www.ex... | python | edit | 1 | 1 | bsd-3-clause | ffb42ba8e9b0a5d7a269ee9d13a5347f4ffee563 | jbittel/django-mama-cas,orbitvu/django-mama-cas,orbitvu/django-mama-cas,jbittel/django-mama-cas | mama_cas/tests/test_callbacks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url\n\nfrom piston.resource import Resource\n\nfrom opps.containers.api import ContainerHandler, ContainerBoxHandler\n\n\ncontainer = Resource(handler=Co... | python | edit | 1 | 0 | mit | c046d7915c08221e4a84a01edf3ca08a27a931a8 | williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps,williamroot/opps,opps/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps | opps/api/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nimport xchainer\n\n\ndef test_device():\n device = xchainer.get_current_device()\n\n xchainer.set_current_device('cpu')\n assert str(xchainer.get_current_device()) == '<Device cpu>'\n\n xchainer.set_current_devi... | python | edit | 1 | 1 | mit | 67c6ecff4d5c65cd5b919bb1316f188bc6ab1098 | okuta/chainer,keisuke-umezawa/chainer,chainer/chainer,ktnyt/chainer,ktnyt/chainer,ktnyt/chainer,wkentaro/chainer,hvy/chainer,jnishi/chainer,okuta/chainer,hvy/chainer,pfnet/chainer,niboshi/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer,tkerola/chainer,jnishi/chainer,niboshi/chainer,jnishi/chainer,keisuke-umezawa/c... | tests/python_tests/test_core_device.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .v4.base import *\nfrom .v4.primitive_generators import *\nfrom .v4.derived_generators import *\nfrom .v4.dispatch_generators import *\nfrom .v4.custom_generator import CustomGenerator\nfrom .v4.logging import logger\nfrom .v4.utils im... | python | edit | 8 | 0 | mit | 5b2a63706d2f9d2853ba1f6ad8d1cf80f8c07676 | maxalbert/tohu | tohu/__init__.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division\nimport time\nimport serial\nimport csv\nfrom datetime import datetime as dt\n\nDEBUG = True\n\n\ndef timestamp():\n ts = dt.now()\n return time.mktime(ts.timetuple())+(ts.microsecond/1e6)\n\nbufsize = ... | python | edit | 3 | 1 | mit | a18339c0d5ed9bbfcfc7b763d31a18c117a38069 | wonkoderverstaendige/telemetry,wonkoderverstaendige/telemetry,wonkoderverstaendige/telemetry | bed/record.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom django.conf import settings\n\n\nclass Command(BaseCommand):\n help = \"Print the active Django settings.\"\n\n def handle(self, *args, **options):\n for key in dir(sett... | python | edit | 3 | 6 | mit | dcb62a352b7473779f1cc907c920c9b42ee9ceac | lamby/django-extensions,barseghyanartur/django-extensions,dpetzold/django-extensions,jpadilla/django-extensions,Moulde/django-extensions,marctc/django-extensions,levic/django-extensions,kevgathuku/django-extensions,bionikspoon/django-extensions,atchariya/django-extensions,maroux/django-extensions,frewsxcv/django-extens... | django_extensions/management/commands/print_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# utility.py\n# PixPack Photo Organiser\n# It contains some useful functions to increase user experience\n\nimport locale\nimport os\n\n\ndef sys_trans_var():\n # check system language\n sys_loc = locale.getloc... | python | edit | 1 | 4 | mit | 3bf41213abc7ddd8421e11c2149b536c255c13eb | OrhanOdabasi/PixPack,OrhanOdabasi/PixPack | pixpack/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport threading, logging, time\n\nfrom kafka import KafkaConsumer\n\n\nclass Consumer(threading.Thread):\n daemon = True\n\n def run(self):\n #consumer = KafkaConsumer(bootstrap_servers='10.100.198.220:9... | python | edit | 1 | 2 | apache-2.0 | b99f0839a8c9ce88127634f507605d065c22e5a7 | opencord/voltha,opencord/voltha,opencord/voltha,opencord/voltha,opencord/voltha | kafka/kafkaConsumer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.utils.translation import gettext_lazy as _\n\nfrom django_comments.forms import (\n CommentForm as DjangoCommentForm,\n COMMENT_MAX_LENGTH\n)\n\n\nclass CommentForm(DjangoCommentForm):\n name =... | python | edit | 1 | 0 | mit | a1ec7fbf4bb00d2a24dfba0acf6baf18d1b016ee | fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide | froide/comments/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect\n\nfrom sentry.models import ApiKey, OrganizationMemberType\nfrom sentry.web.frontend.base import Organizat... | python | edit | 2 | 3 | bsd-3-clause | 439f0326cc71cf19e41137745aedeec391727207 | pauloschilling/sentry,llonchj/sentry,JamesMura/sentry,hongliang5623/sentry,gg7/sentry,gencer/sentry,BuildingLink/sentry,llonchj/sentry,ifduyue/sentry,kevinastone/sentry,drcapulet/sentry,BayanGroup/sentry,Kryz/sentry,1tush/sentry,kevinlondon/sentry,beeftornado/sentry,beeftornado/sentry,felixbuenemann/sentry,JamesMura/se... | src/sentry/web/frontend/organization_api_keys.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport tokenize\n\n\ndef run(cmdline):\n\t\"\"\"\n\tExecute the script as if it had been invoked naturally.\n\t\"\"\"\n\tnamespace = dict()\n\tfilename = cmdline[0]\n\tnamespace['__file__'] = filename\n\tnamespace['__name__'] = ... | python | edit | 1 | 5 | mit | 2c26434b7dcd71530d453989372b8d67d90ad3c7 | jaraco/rwt | rwt/scripts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nnon_alphanumeric = re.compile(r\"[^0-9a-z]+\", re.I)\n\nnon_namey = re.compile(r\"[^\\w\\-' ]+\", re.UNICODE)\n\ncomma_suffix = re.compile(r\", *(JR|SR|I+|IV|VI*)\\b\")\n\nlast_first = re.compile(r\"([^,]*), +([^,]*)\")\n\nstar... | python | edit | 1 | 0 | mit | b9a25c0bf991c0579a9c9f1ed371251337173214 | BuzzFeedNews/namestand | namestand/patterns.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views import defaults\nfrom sentry_sdk import capture_message, push_scope\n\n\ndef page_not_found(request, *args, **kwargs):\n with push_scope() as scope:\n scope.set_tag(\"type\", \"404\")\n scope.set_extra(\"p... | python | edit | 1 | 2 | mit | 767b9867a1e28063fae33ea46478372818b5a129 | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/core/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport glob\nimport os\n\nimport mmstats\n\n\nclass MmstatsTestCase(unittest.TestCase):\n def setUp(self):\n super(MmstatsTestCase, self).setUp()\n self.path = mmstats.DEFAULT_PATH\n\n # Clean out ... | python | edit | 2 | 3 | bsd-3-clause | e08c7352fc5de7e098e434bfc1f2df4384c3405a | schmichael/mmstats,schmichael/mmstats,schmichael/mmstats,schmichael/mmstats | tests/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\n\nfrom . import views\n\n\nurlpatterns = [\n url(r'^admin/', include(admin.site.urls)),\n url('foo/', views.MyView.as_view(), name='class-view'),\n url('b... | python | edit | 1 | 0 | bsd-2-clause | 35b08e6e7e60a440fe33b7120843766b9f2592c6 | incuna/incuna-test-utils,incuna/incuna-test-utils | tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n\nimport subprocess\nimport os\nfrom time import sleep\n\nenv = {}\nHOME = os.environ.get(\"HOME\", \"/root\")\nscannerConf = open(HOME+\"/scanner.conf\", \"rt\")\nwhile True:\n in_line = scannerConf.readline()\n i... | python | edit | 1 | 0 | apache-2.0 | 47ddf999dd7ef8cd7600710ad6ad7611dd55a218 | starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser | bin/testNetwork.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport rospy\n\nfrom vigir_synthesis_msgs.srv import LTLCompilation\n# from vigir_synthesis_msgs.msg import LTLSpecification, BSErrorCodes\n\ndef ltl_compilation_client(system, goals, initial_conditions, custom_ltl ... | python | edit | 2 | 2 | bsd-3-clause | efdb4f57f3fe18f3c9a16df0adb735f13cd7c567 | team-vigir/vigir_behavior_synthesis,team-vigir/vigir_behavior_synthesis | vigir_synthesis_manager/src/vigir_synthesis_manager/ltl_compilation_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom reddit.models import Blog\n\nfrom rest_framework import serializers\n\n\nclass BlogSerializer(serializers.Serializer):\n blog_id = serializers.UUIDField()\n created_at = serializers.DateTimeField()\n user = serializers.CharFie... | python | edit | 1 | 3 | mit | d12be3446cad8b3fa3ae9a1860b3bd6ed20a1d9e | WilliamQLiu/django-cassandra-prototype,WilliamQLiu/django-cassandra-prototype | cass-prototype/reddit/api/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass InviteJoinPlugin(object):\n \"\"\"Simple plugin that joins a channel if an invite is given.\"\"\"\n\n callback_id = None\n \"\"\"ID generated when callback was added for the irc.invite event\"\"\"\n\n def __init__(self, ca... | python | edit | 1 | 1 | mit | d8e0c07363069e664dcb6071bc84e8ecc0706739 | JohnMaguire/Cardinal,BiohZn/Cardinal | plugins/join_on_invite/plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport json, os, requests\nfrom awsauth import S3Auth\nfrom datetime import datetime\nfrom pytz import timezone\nfrom flask import Flask, render_template, url_for\n\napp = Flask(__name__)\n\n@app.route(\"/\")\ndef ren... | python | edit | 4 | 1 | mit | bbd98c7da097d4962d371cd5ff75d9f67a0e3fd1 | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | renderMenu.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase, override_settings, Client\nfrom django.test import RequestFactory\nfrom mock import MagicMock\nfrom wagtail.wagtailsearch.backends.elasticsearch import Elasticse... | python | edit | 9 | 1 | bsd-3-clause | 22e16ba6e2bf7135933895162744424e89ca514d | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | article/tests/article_admin_tests.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Geocode Contact objects.\"\"\"\n\nimport sys\n\nfrom geopy import geocoders\n\nfrom django.core.management.base import BaseCommand, CommandError\n\nfrom portal import models\n\n\nclass Command(BaseCommand):\n \"\"\"Set lat/long fie... | python | edit | 1 | 6 | mit | bc32e0aadfe2d83d8acb2f219f2fb6bf5f5bb150 | mikesname/ehri-collections,mikesname/ehri-collections,mikesname/ehri-collections | ehriportal/portal/management/commands/geocode_addresses.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nDATABASES = {\n 'default': {\n 'ENGINE': 'django_fdbsql',\n 'NAME': 'django_default',\n 'OPTIONS': {\n 'supports_sequence_reset': True,\n 'use_sequence_reset_function': True,\n },\n },... | python | edit | 1 | 0 | mit | 2db4fda62c2eec2d5424448fcd57bedd91ad2e64 | freyley/sql-layer-adapter-django | test_support/test_fdbsql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2011 Vit Suchomel and Jan Pomikalek\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received as part of this distribution.\n\ntry:\n __version__ = 'v' + _... | python | edit | 1 | 0 | bsd-2-clause | 082076cce996593c9959fc0743f13b62d2e4842b | gilesbrown/chared,xmichelf/chared | chared/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\r\n# $Id:$\r\n\r\nfrom pyglet.gl import *\r\n\r\ndef draw_client_border(window):\r\n glClearColor(0, 0, 0, 1)\r\n glClear(GL_COLOR_BUFFER_BIT)\r\n\r\n glMatrixMode(GL_PROJECTION)\r\n glLoadIdentity()\r\n glO... | python | edit | 21 | 1 | bsd-3-clause | 50146d9e3e43ca4d9c50d044c52714cf4234cee1 | adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,niklaskorz/pyglet,niklaskorz/pyglet,seeminglee/pyglet64,niklaskorz/pyglet,niklaskorz/pyglet | tests/window/window_util.py | rejected_lint | Too many lint violations: 21 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.