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 os\nimport json\nimport psutil\nfrom notebook.utils import url_path_join\nfrom notebook.base.handlers import IPythonHandler\n\ndef get_metrics():\n cur_process = psutil.Process()\n all_processes = [cur_process] + cur_process.ch... | python | edit | 1 | 3 | bsd-2-clause | 8cb4f5d8879c573a4fe690c4f53c2b0a99d18d69 | yuvipanda/nbresuse,yuvipanda/nbresuse | nbresuse/handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndatabases = {\n 'mysql': {\n 'driver': 'mysql',\n 'host': '',\n 'database': '',\n 'user': '',\n 'password': '',\n 'prefix': ''\n }\n}\n\n```\n\nApply this change: Change db configs to default ... | python | edit | 1 | 0 | mit | 3fa14c2c1663fe04301b4f98cc59f2d385d8f876 | erjanmx/salam-bot | config/database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom pathlib import Path\nimport sys\n\n\ndef force_path(location, require_exists=True):\n if not isinstance(location, Path):\n location = Path(location)\n if require_e... | python | edit | 1 | 4 | mit | 13ba81df82f2c43838066ec9cd0fa1222324349f | explosion/srsly,explosion/srsly,explosion/srsly,explosion/srsly | srsly/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\n\ndef load_datadict(filepath, trim_index=True, trim_all=False):\n df = pd.read_csv(filepath, index_col=0)\n if trim_index:\n df.index = df.index.str.strip()\n if trim_all:\n df = df.applymap(lambd... | python | edit | 1 | 4 | bsd-3-clause | 74815ade33a3e9e76da43e01e74752ff502e99d1 | sibis-platform/ncanda-data-integration,sibis-platform/ncanda-datacore,sibis-platform/ncanda-datacore,sibis-platform/ncanda-datacore,sibis-platform/ncanda-data-integration | datadict/datadict_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom haystack import indexes\nfrom tx_salaries.models import Employee\n\n\nclass EmployeeIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharField(document=True, use_template=True)\n content_auto = indexes.EdgeNgramFie... | python | edit | 1 | 1 | apache-2.0 | f0a143065981d2dcee9ceacd3c2f30cfeb073025 | texastribune/tx_salaries,texastribune/tx_salaries | tx_salaries/search_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sympy.abc import *\n\nfrom flask import Flask, request\napp = Flask(__name__)\n\n@app.route('/code', methods=['GET', 'POST'])\ndef code():\n return str(eval(request.json['code']))\n\nif __name__ == \"__main__\":\n app.run(debug=T... | python | edit | 4 | 0 | mit | 15dd5b534e8c16c78195739eb78cc1e271564542 | boppreh/symcalc | symcalc.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport flask\nfrom cref.app.web import app\nfrom cref.app.web.tasks import predict_structure\n\n\ndef success(result):\n return flask.jsonify({\n 'status': 'success',\n 'retval': result\n })\n\n\ndef failure(reason='Unkn... | python | edit | 1 | 2 | mit | 24e48a82c627996332a73608d139f9ce8713642d | mchelem/cref2,mchelem/cref2,mchelem/cref2 | cref/app/web/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport coverage\nfrom flask_script import Manager, Shell\nfrom flask_migrate import Migrate, MigrateCommand\n\nfrom config import basedir\nfrom app import create_app, db\nfrom app.models import User\n\napp = create_app(os.getenv(... | python | edit | 1 | 3 | mit | fc7c52a489a6113b7b26607c42c6f5b38b2feb85 | Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary | manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nFuzz tests an object after the default construction to make sure it does not crash lldb.\n\"\"\"\n\nimport sys\nimport lldb\n\ndef fuzz_obj(obj):\n obj.GetFileAddress()\n obj.GetLoadAddress(lldb.SBTarget())\n obj.SetLoadAdd... | python | edit | 1 | 1 | apache-2.0 | 161cdf644aa9b8575f42dab537c5e3e01a186ec6 | llvm-mirror/lldb,llvm-mirror/lldb,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 | test/python_api/default-constructor/sb_address.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version_info__ = ('1', '14', '0rc1')\n__version__ = '.'.join(__version_info__)\n\nfrom .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,\n BoundFunctionWrapper, WeakFunctionProxy, PartialCallableObjectProxy,\n ... | python | edit | 26 | 0 | bsd-2-clause | 7e2a14079d9b3112371facf3e31e20600e0136d4 | GrahamDumpleton/wrapt,GrahamDumpleton/wrapt | src/wrapt/__init__.py | rejected_lint | Too many lint violations: 26 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\n\nclass Cache:\n EXPIRE_IN = 'expire_in'\n\n def __init__(self):\n self.store = {}\n\n def get(self, key):\n \"\"\"Gets a value based upon a key.\"\"\" \n self._check_expiry(key) \n ... | python | edit | 1 | 5 | mit | d1504f3c3129c926bd9897a6660669f146e64c38 | patrickbird/cachupy | cachupy/cachupy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nName: Paul Briant\nDate: 11/22/16\nClass: Introduction to Python\nSession: 08\nAssignment: circle lab\n\nDescription:\nTests for Circle lab\n\"\"\"\n\n# -------------------------------Imports----------------------------------------\... | python | edit | 3 | 1 | unlicense | 6973cc19a9d4fb4e0867a98fced1c4c33fc0cee8 | weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016 | students/psbriant/session08/test_circle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom cps2_zmq.gather import MameSink\n\n@pytest.mark.parametrize(\"message, expected\",[\n ({'wid': 420, 'message': 'closing'}, 'worksink closing'),\n ({'wid': 420, 'message': 'threaddead'}, '420 is dead'),\n ({'wid'... | python | edit | 1 | 3 | mit | cdf3686150309800cb28f584b64b9175aa4b5662 | goosechooser/cps2-zmq | tests/unit_tests/gather_tests/MameSink_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.contenttypes.fields import GenericForeignKey\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db import models\n\nPOSITIONS = (\n ('HERO', 'Hero'),\n ('SEC_1', 'Secondary 1'),\n ('SEC_2',... | python | edit | 1 | 0 | mit | 70e7b932c1c6013306a53f47c14d969d4ada8ab4 | urfonline/api,urfonline/api,urfonline/api | api/home/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport ssl\n\nfrom src.testers.decorators import requires_userinfo\n\n\n@requires_userinfo\ndef available(test):\n \"\"\"\n Check if MongoDB is compiled with OpenSSL support\n \"\"\"\n return 'OpenSSLV... | python | edit | 1 | 3 | mit | a470ce2a7557216be5cb36cdf3d895ea486e6d64 | stampery/mongoaudit | src/testers/tls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom celery import Celery\nimport requests\n\nfrom .config import get_engine, _set_connection_string\nfrom .loader import FDPLoader\n\napp = Celery('fdp_loader')\napp.config_from_object('babbage_fiscal.celeryconfig')\n\n@app.task\ndef load_... | python | edit | 1 | 3 | mit | 36e00778befd9e6763236b771a77184d31c3c885 | openspending/babbage.fiscal-data-package | babbage_fiscal/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.cache import cache\nfrom django.utils import crypto\n\n\nGENERATION_KEY_NAME = 'metric:generation'\n\n\ndef generation_key(timeout=60 * 60 * 365):\n \"\"\"\n A random key to be used in cache calls that allows\n inv... | python | edit | 1 | 2 | bsd-3-clause | 5762826eb7b44d36bf4a3b1e50acd637ef7375c1 | gnarf/djangoproject.com,nanuxbe/django,xavierdutreilh/djangoproject.com,django/djangoproject.com,django/djangoproject.com,vxvinh1511/djangoproject.com,django/djangoproject.com,rmoorman/djangoproject.com,django/djangoproject.com,nanuxbe/django,rmoorman/djangoproject.com,xavierdutreilh/djangoproject.com,django/djangoproj... | dashboard/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms.widgets import Input, ClearableFileInput\nfrom django.template.loader import render_to_string\n\n\nclass CIImgWidget(ClearableFileInput):\n\n def render(self, name, value, attrs=None):\n try:\n attrs[\... | python | edit | 1 | 2 | mit | 24fd3b98f06b30d8827ba472dc305514ed71a5e5 | rewardz/cropimg-django,rewardz/cropimg-django,rewardz/cropimg-django | cropimg/widgets.py | rejected_duplicate | Near-duplicate of sample 983 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The Basic Model Interface.\"\"\"\nfrom .bmi import Bmi\n\n\n__all__ = ['Bmi']\n__version__ = 0.1.0\n\n```\n\nApply this change: Fix error with version number"
},
{
"role": "assistant",
"content": "\"\"\"The Basic Model Int... | python | edit | 1 | 0 | mit | 8a446ddb58615c7d5258887b7a0684fdcf85a356 | bmi-forum/bmi-python,bmi-forum/bmi-python | basic_modeling_interface/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom seed_stage_based_messaging.settings import * # flake8: noqa\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = 'TESTSEKRET'\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG =... | python | edit | 1 | 0 | bsd-3-clause | 69a7ec786841dc9d8422e31d8f0a513300d80c29 | praekelt/seed-stage-based-messaging,praekelt/seed-stage-based-messaging,praekelt/seed-staged-based-messaging | seed_stage_based_messaging/testsettings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Standard library imports\nfrom cStringIO import StringIO\n\n# System library imports.\nfrom matplotlib.backends.backend_svg import new_figure_manager\nfrom matplotlib._pylab_helpers import Gcf\n\n# Local imports.\nfrom backend_payload imp... | python | edit | 3 | 2 | bsd-3-clause | 8ecc9ec44437fea301ab8bdf6ed8b9b9a2a5c242 | ipython/ipython,ipython/ipython | IPython/zmq/pylab/backend_payload_svg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport logging\nimport faulthandler\n\nfrom . import analysis\nfrom . import codegen\n\n_f = open('faulthandler.err', 'w')\nfaulthandler.enable(_f)\n\n\ndef wrap(f, debug=True, p=False, ir=False, lazy=False, opt=None,... | python | edit | 1 | 6 | apache-2.0 | 4f88bc0022417872002d0c19a32cb26c3eb0c7ae | squisher/stella,squisher/stella,squisher/stella,squisher/stella | stella/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport flask\nimport psycopg2\n\napp = flask.Flask(__name__)\ndb = psycopg2.connect('postgres://rpitours:rpitours@localhost:5432/rpitours')\n\ndef make_tour():\n\ttour = {\n\t\t'id': 1,\n\t\t'name': 'Test Tour',\n\t\t'waypoints': [\n\t\t\t(... | python | edit | 1 | 2 | mit | 6d7c91419c128fde3f3a9a68942dedf61c7c8b3c | wtg/RPI_Tours_Server | server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport numpy as np\n\n\ndef hellinger(data1, data2):\n '''\n Calculate the Hellinger Distance between two datasets.\n\n Parameters\n ----------\n data1 : numpy.ndarray\n 1D array.\n data2 : numpy.ndarray\n ... | python | edit | 1 | 1 | mit | 6adbbe71dcde926fbd9288b4a43b45ff1a339cdc | e-koch/TurbuStat,Astroua/TurbuStat | turbustat/statistics/stats_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fontbakery.checkrunner import Section\nfrom fontbakery.fonts_spec import spec_factory\n\n\ndef check_filter(checkid, font=None, **iterargs):\n if checkid in (\n \"com.google.fonts/check/035\", # ftxvalidator\n \"com.google.... | python | edit | 1 | 2 | apache-2.0 | eacc66e5a9ab3310c75924dcb340e4944e9424d4 | googlefonts/fontbakery,graphicore/fontbakery,graphicore/fontbakery,googlefonts/fontbakery,googlefonts/fontbakery,moyogo/fontbakery,moyogo/fontbakery,moyogo/fontbakery,graphicore/fontbakery | tests/specifications/external_spec_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nMocks for tests on other HW than Raspberry Pi.\n\"\"\"\n\n\nclass GPIO(object):\n\n BOARD = 'board'\n IN = 'in'\n OUT = 'out'\n PUD_UP = 'pud_up'\n FALLING = 'falling'\n HIGH = 'high'\n ... | python | edit | 1 | 1 | mit | a459c9bd1135ede49e9b2f55a633f86d7cdb81e2 | werdeil/pibooth,werdeil/pibooth | tests/mocks/RPi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (1, 0, 'post-release-SVN')\n\ndef get_version():\n \"Returns the version as a human-format string.\"\n v = '.'.join([str(i) for i in VERSION[:-1]])\n if VERSION[-1]:\n from django.utils.version import get_svn_revis... | python | edit | 1 | 5 | bsd-3-clause | 8e608c2155a4a466f1a4bf87df05c4e4ebd90c1c | blindroot/django,lsqtongxin/django,jgoclawski/django,blighj/django,fenginx/django,riklaunim/django-custom-multisite,jn7163/django,alrifqi/django,ryangallen/django,charettes/django,eugena/django,AndrewGrossman/django,yakky/django,eugena/django,denys-duchier/django,EliotBerriot/django,dwightgunning/django,hassanabidpk/dj... | django/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom corehq.apps.users.models import CommCareUser\n\n\ndef _users_by_location(location_id, include_docs):\n return CommCareUser.view(\n 'locations/users_by_location_id',\n startkey=[location_id],\n endkey=[location_i... | python | edit | 1 | 2 | bsd-3-clause | c568f4d3ea475f341490bc81e89c28016e8412a2 | qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq | corehq/apps/locations/dbaccessors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Main function\n\nCopyright (c) 2015 Francesco Montesano\nMIT Licence\n\"\"\"\n\nimport sys\n\nimport colorama\n\nfrom dodocs.cmdline import parse\n\n__version__ = \"0.0.1\"\n\ncolorama.init(autoreset=True)\n\n\ndef main(argv=None):\n ... | python | edit | 1 | 5 | mit | cd219d5ee0ecbd54705c5add4239cef1513b8c2a | montefra/dodocs | dodocs/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Global configuration information used across all the\n# translations of documentation.\n#\n# Import the base theme configuration\nfrom cakephpsphinx.config.all import *\n\n# The version info for the project you're documenting, acts as rep... | python | edit | 2 | 0 | mit | e50fdd79a49adce75559ea07024d056b6b386761 | cakephp/chronos | docs/config/all.py | rejected_duplicate | Near-duplicate of sample 1220 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport collections\n\nfrom src.puzzle.problems import crossword_problem\n\n\n_PROBLEM_TYPES = set()\n\n\ndef identify(line):\n scores = {}\n for t in _PROBLEM_TYPES:\n score = t.score(line)\n if score:\n scores[t] = t.score(lin... | python | edit | 1 | 3 | mit | 0b7686f14f47cc00665cfe3d6a396a5c14e6b9b3 | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | src/puzzle/heuristics/analyze.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom rest_framework_gis import serializers as gis_serializers\n\nfrom .models import Location, Office, Organisation\n\n\nclass DistanceField(serializers.ReadOnlyField):\n def to_representation(self... | python | edit | 1 | 1 | mit | 7e015e6955dfe392649b5ca0cdeb5a7701700f24 | ministryofjustice/laa-legal-adviser-api,ministryofjustice/laa-legal-adviser-api,ministryofjustice/laa-legal-adviser-api | laalaa/apps/advisers/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n__version__ = open(os.path.join(os.path.dirname(__file__), \"VERSION\")).read().strip()\n\ntry:\n from fields import TimedeltaField\n from helpers import (\n divide, multiply, modulo, \n parse, nice_repr, \n... | python | edit | 10 | 0 | bsd-3-clause | 39256f49c952dbd5802d5321c8a74b2c41934e38 | sookasa/django-timedelta-field | timedelta/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Dispatch from command-line arguments to functions.\"\"\"\nimport re\nfrom collections import OrderedDict\n\nfrom docopt import docopt\n\n\n__all__ = ('dispatch', 'DispatchError')\n__author__ = 'Vladimir Keleshev <<EMAIL>>'\n__version_... | python | edit | 1 | 3 | mit | 7a7b6351f21c95b3620059984470b0b7619c1e9d | keleshev/docopt-dispatch | docopt_dispatch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nCopyright 2018 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ... | python | edit | 1 | 2 | apache-2.0 | 2a5da76476fe3b13274b5c6d14f605d4b768047e | GoogleCloudPlatform/gke-managed-certs,GoogleCloudPlatform/gke-managed-certs | hack/utils/command.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pkgutil\nfrom importlib import import_module\n\nimport click\n\nfrom . import commands as commands_module\ncommand_modules = sorted(c[1] for c in pkgutil.iter_modules(commands_module.__path__))\n\n\nclass PluginCLI(click.MultiCommand... | python | edit | 1 | 5 | mit | 96c08c28ac9c812a209bde504dfbb3d0aea023d3 | valohai/valohai-cli | valohai_cli/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nimport sys\n\n\nclass ProcessorImporter(object):\n \"\"\"\n The processors were moved to the PILKit project so they could be used\n separtely from ImageKit (which has a bunch of Django dependencies). However,\n there'... | python | edit | 1 | 2 | bsd-3-clause | 3732b2ee099989ed46e264f031b9b47c414cf6c6 | tawanda/django-imagekit,FundedByMe/django-imagekit,tawanda/django-imagekit,FundedByMe/django-imagekit | imagekit/importers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom ..models import Temperature, HeartBeats\n\n\nclass TemperatureTest(TestCase):\n \"\"\"Test class for temperature model\"\"\"\n\n def setUp(self):\n Temperature.objects.create(temperature=2... | python | edit | 1 | 1 | mit | 5daf394146660b28d5d51795e5220729a9836347 | BabyOnBoard/BabyOnBoard-API,BabyOnBoard/BabyOnBoard-API | babyonboard/api/tests/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom d1lod.sesame import Store, Repository, Interface\nfrom d1lod import dataone\n\ndef test_interface_can_be_created(interface):\n assert isinstance(interface, Interface)\n\n```\n\nApply this change: Add repository test... | python | edit | 3 | 1 | apache-2.0 | 1f59870fd321be570ce6cfead96307fcc3366e09 | ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod | d1lod/tests/test_sesame_interface.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .models import *\nfrom django.contrib import admin\n\nclass StoreAdmin(admin.ModelAdmin):\n list_display = (\"__unicode__\",)\n\nclass ItemAdmin(admin.ModelAdmin):\n pass\n\nadmin.site.register(Store, StoreAdmin)\nadmin.site.regi... | python | edit | 4 | 0 | mit | 825f2ff3726bc4bc04ad8adb5583bfbf26fe6319 | peterkuma/fileshackproject,peterkuma/fileshackproject,peterkuma/fileshackproject | fileshack/admin.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 subprocess as subp\n\n\nclass DependencyChecker(object):\n\n def _check_test_dependencies(self):\n for dep in self.DEPENDENCIES:\n cmd = 'if hash {} 2/dev/null; then ' \\\n ... | python | edit | 3 | 5 | bsd-3-clause | bdcfb1ff4c076485a5fc3b00beaf81becec0717b | nok/sklearn-porter | tests/utils/DependencyChecker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass VirtualMachine:\n def __init__(self, ram_size=256, executing=True):\n self.data = [None]*ram_size\n self.stack = []\n self.executing = executing\n self.pc = 0\n\n def push(self, value):\n \"\"\... | python | edit | 4 | 3 | bsd-3-clause | 44c74743d25b1fa15d1cb1337f2c4e2d306ac6da | darbaga/simple_compiler | virtual_machine.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nimport logging\nfrom datetime import datetime, timedelta\nfrom celery.decorators import task\nfrom eve_proxy.models import CachedDocument\n\n@task(ignore_result=True)\ndef clear_stale_cache(cache_extension=... | python | edit | 3 | 1 | bsd-3-clause | 69742860652f84fccf0bac80f0e72bb03ddf64b1 | nikdoof/test-auth | eve_proxy/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass VirtualMachine:\n def __init__(self, ram_size=256, stack_size=32):\n self.data = [None]*ram_size\n self.stack = [None]*stack_size\n self.stack_size = stack_size\n self.stack_top = 0\n\n def push(self,... | python | edit | 1 | 3 | bsd-3-clause | 9b8f1dc59b528c57122c6bebef52cfe0545fa3a5 | darbaga/simple_compiler | virtual_machine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport StringIO\n\nimport angus\nimport cv2\nimport numpy as np\n\nif __name__ == '__main__':\n ### Web cam index might be different from 0 on your setup.\n stream_index = 0\n cap = cv2.VideoCapture(stream_in... | python | edit | 4 | 0 | apache-2.0 | 255dd790c1075c5caaf21042dc8b056330a9e846 | angus-ai/angus-doc,angus-ai/angus-doc,angus-ai/angus-doc | services/qrcode/qrcode_fromwebcam.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom core.models import ApplicationVersion as ImageVersion\nfrom rest_framework import serializers\nfrom api.v2.serializers.summaries import (\n LicenseSummarySerializer,\n UserSummarySerializer,\n IdentitySummarySerializer,\n I... | python | edit | 1 | 0 | apache-2.0 | df48b6854b8c57cfc48747a266c10a0fc4e78d70 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/v2/serializers/details/image_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Python script Exporter class\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2013, the IPython Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n... | python | edit | 1 | 0 | bsd-3-clause | ca4cede86022cc7784214cc1823e9b2886e3625b | cornhundred/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,ju... | IPython/nbconvert/exporters/python.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom terminado import NamedTermManager\nfrom .handlers import TerminalHandler, NewTerminalHandler, TermSocket\nfrom . import api_handlers\n\ndef initialize(webapp):\n shell = os.environ.get('SHELL', 'sh')\n webapp.terminal_... | python | edit | 1 | 1 | bsd-3-clause | 8ddd296052cfe9c8293806af397bb746fd2ebd19 | ipython/ipython,ipython/ipython | IPython/html/terminal/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom marshmallow import Schema, fields\n\n__author__ = 'lundberg'\n\n\nclass FluxStandardAction(Schema):\n\n class Meta:\n strict = True\n\n type = fields.String(required=True)\n payload = fields.R... | python | edit | 1 | 3 | bsd-3-clause | 2e0030966f1f0baed8b9fda5e18cd01d8d0495d5 | SUNET/eduid-common | src/eduid_common/api/schemas/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\n\nfrom .. import factories\n\n\nclass CoreFactoriesTest(TestCase):\n \"\"\"\n Ensure factories work as expected.\n Here we just call each one to ensure they do not trigger any random\n error wit... | python | edit | 1 | 1 | bsd-2-clause | 29315da6d17dd30c957afb1b297cc4d6d335a284 | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek | geotrek/core/tests/test_factories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.utils import timezone\n\nimport pytz\n\n\ndef core_context(self):\n \"\"\"Context processor for elements appearing on every page.\"\"\"\n context = {}\n context[\"google_analytics_id\"]... | python | edit | 1 | 1 | mit | c692038646417dfcd2e41f186b5814b3978847b6 | pydata/conf_site,pydata/conf_site,pydata/conf_site | conf_site/core/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport hashlib\nimport datetime\n\nimport peewee\n\n\ndatabase = peewee.Proxy()\n\n\nclass BaseModel(peewee.Model):\n class Meta:\n database = database\n\n\nclass User(BaseModel):\n id = peewee.IntegerField(primary_k... | python | edit | 1 | 2 | mit | 526b1028925a59957e805b29fc624dae318661ef | Afonasev/YourFinances | finances/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nimport os\n\nfrom tempfile import NamedTemporaryFile\nfrom sys import platform as _platform\n\nfrom gtts import gTTS\nfrom pygame import mixer\n\nfrom .playsound import playsound\nfrom ..components import _BaseComponent\n\n\ncl... | python | edit | 1 | 6 | mit | 1101ce85635e49ad3cbd1f88e7dae1b77f45514c | ava-project/AVA | ava/text_to_speech/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-------------------------------------------------------------------------------\n## Description\n\"\"\"\nCreate Cache Dependency by just cliking.\n\"\"\"\n#-------------------------------------------------------------------------------\n\n... | python | edit | 2 | 8 | mit | 15b3e52e75dddcd09b1fff807e836c60a0c62a03 | takavfx/Bento | python2.7libs/createDlp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport re\n\nfrom django import template\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.contrib.syndication.views import add_domain\nfrom django.template import TemplateS... | python | edit | 1 | 3 | bsd-3-clause | 149e9e2aab4922634e0ab5f130f9a08f9fda7d17 | richardcornish/django-itunespodcast,richardcornish/django-itunespodcast,richardcornish/django-applepodcast,richardcornish/django-applepodcast | podcast/templatetags/podcast_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom celery import Celery\nfrom celery.schedules import crontab\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings')\n\napp = Celery('lims', broker='redis://localhost', backend='redis')\napp.config_from_object('dja... | python | edit | 1 | 0 | mit | 931fca0b7cca4a631388eeb6114145c8d4ff6e18 | GETLIMS/LIMS-Backend,GETLIMS/LIMS-Backend | lims/celery.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# IdeaScaly\n# Copyright 2015 Jorge Saldivar\n# See LICENSE for details.\n\nimport six\nimport dateutil.parser\n\n\ndef parse_datetime(str_date):\n try:\n date_is = dateutil.parser.parse(str_date)\n return date_is\n exce... | python | edit | 1 | 3 | mit | 53b920751de0e620792511df406805a5cea420cb | joausaga/ideascaly | ideascaly/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport numpy as np\n\n\nclass TestMNISTTutorialJSMA(unittest.TestCase):\n def test_mnist_tutorial_jsma(self):\n\n np.random.seed(42)\n import tensorflow as tf\n tf.set_random_seed(42)\n\n from... | python | edit | 1 | 1 | mit | 06ce6272209b9a8749156b69dfa22aa9130f743a | fartashf/cleverhans,openai/cleverhans,carlini/cleverhans,cleverhans-lab/cleverhans,cihangxie/cleverhans,carlini/cleverhans,cleverhans-lab/cleverhans,cleverhans-lab/cleverhans | tests_tf/test_mnist_tutorial_jsma.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Do not commit secrets to VCS.\n\n# Local environment variables will be loaded from `.env.local`.\n# Additional environment variables will be loaded from `.env.$DOTENV`.\n# Local settings will be imported from `icekit_settings_local.py`\n\... | python | edit | 6 | 0 | mit | 1e14cf9011820c4e65fc779df976596dae225735 | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | project_template/icekit_settings.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport youtube_dl, os\nfrom multiprocessing.pool import ThreadPool\nfrom youtube_dl.utils import DownloadError\nfrom datetime import datetime\nfrom uuid import uuid4\n\n\nclass Download:\n link = \"\"\n done = False\n error = False... | python | edit | 3 | 3 | mit | a34ce653f262888c17ae92e348adb0892b74a94c | pielambr/PLDownload,pielambr/PLDownload | download.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Django DDP utils for DDP messaging.\"\"\"\nfrom dddp import THREAD_LOCAL as this\n\n\ndef obj_change_as_msg(obj, msg):\n \"\"\"Generate a DDP msg for obj with specified msg type.\"\"\"\n serializer = this.serializer\n data = ... | python | edit | 2 | 7 | mit | 8931025d53f472c3f1cb9c320eb796f0ea14274e | django-ddp/django-ddp,commoncode/django-ddp,django-ddp/django-ddp,commoncode/django-ddp,commoncode/django-ddp,commoncode/django-ddp,django-ddp/django-ddp,django-ddp/django-ddp | dddp/msg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ._version import __version_info__, __version__ # noqa\nfrom .tasks import task, ctask, Task # noqa\nfrom .collection import Collection # noqa\nfrom .context import Context # noqa\n\n\ndef run(command, **kwargs):\n \"\"\"\n In... | python | edit | 1 | 1 | bsd-2-clause | c81cc838d6e8109020dafae7e4ed1ff5aa7ebb88 | pyinvoke/invoke,mattrobenolt/invoke,frol/invoke,mkusz/invoke,pfmoore/invoke,mkusz/invoke,pyinvoke/invoke,mattrobenolt/invoke,pfmoore/invoke,kejbaly2/invoke,kejbaly2/invoke,tyewang/invoke,frol/invoke,singingwolfboy/invoke | invoke/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom .. import run_python_module, run_command\nfrom .base import BaseTestApp\n\n\nclass TestNbGrader(BaseTestApp):\n\n def test_help(self):\n \"\"\"Does the help display without error?\"\"\"\n run_python_module... | python | edit | 1 | 2 | bsd-3-clause | 94172dc29d9ccbce1c2ac752ce09baefafbf8a6c | jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jhamrick/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader | nbgrader/tests/apps/test_nbgrader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2.7\n\nimport os\nimport json\n\nclass OAEnv(object):\n @property\n def static_http_root(self):\n if self.envcfg['httpinfo']['secure'] is True:\n security = \"https://\"\n else:\n ... | python | edit | 1 | 2 | bsd-3-clause | 8af349128b725e47b89f28ddc005d142a44c5765 | kchoudhu/openarc | openarc/env.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Configuration file for Jupyter Hub\n\nc = get_config()\n\n# spawn with Docker\nc.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'\n\n# The docker instances need access to the Hub, so the default loopback port doesn't work:\nfrom I... | python | edit | 2 | 0 | bsd-3-clause | ededa7c9c616ac97dd6ce8638c6b959a0c51663c | jhamrick/dockerspawner,jupyter/dockerspawner,quantopian/dockerspawner,Fokko/dockerspawner,Fokko/dockerspawner,minrk/dockerspawner,quantopian/dockerspawner,minrk/dockerspawner,jupyter/dockerspawner,jhamrick/dockerspawner | examples/oauth/jupyterhub_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns, include, url\nimport settings\nimport os\n\nfrom django.contrib import admin\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n\n url(r'^$',\n 'django.views.generic.simple.direct_... | python | edit | 1 | 0 | mit | 64d838897a38398074433ce1e6a50393fc414a03 | nikolas/django-interval-field,mpasternak/django-interval-field,mpasternak/django-interval-field,nikolas/django-interval-field | test_project/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\n\nclass JIRAError(Exception):\n \"\"\"General error raised for all problems in operation of the client.\"\"\"\n def __init__(self, status_code=None, text=None, url=None):\n self.status_code = status_code\n ... | python | edit | 1 | 10 | bsd-2-clause | 381e89972bf4d12daae7aa399f1348a215fa85d9 | pycontribs/jira,jameskeane/jira-python,rayyen/jira,pycontribs/jira,dbaxa/jira,coddingtonbear/jira,milo-minderbinder/jira,systemadev/jira-python,tsarnowski/jira-python,kinow/jira,jameskeane/jira-python,awurster/jira,stevencarey/jira,VikingDen/jira,awurster/jira,kinow/jira,m42e/jira,VikingDen/jira,tsarnowski/jira-python,... | jira/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport sys\nimport warnings\nfrom distutils.version import StrictVersion as SV\n\nimport pykka\n\n\nif not (2, 7) <= sys.version_info < (3,):\n sys.exit(\n 'Mopidy requires Python >= 2.7,... | python | edit | 2 | 0 | apache-2.0 | 2050385a5f5fdcffe333ae17463d6469af0b5cd8 | jmarsik/mopidy,adamcik/mopidy,priestd09/mopidy,woutervanwijk/mopidy,glogiotatidis/mopidy,tkem/mopidy,bencevans/mopidy,hkariti/mopidy,jcass77/mopidy,pacificIT/mopidy,vrs01/mopidy,ali/mopidy,bencevans/mopidy,mokieyue/mopidy,rawdlite/mopidy,swak/mopidy,tkem/mopidy,rawdlite/mopidy,jcass77/mopidy,woutervanwijk/mopidy,swak/m... | mopidy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n__version_info__ = (0, 4, 1)\n__version__ = '.'.join(map(s... | python | edit | 1 | 0 | mit | 9bdd2cbb545c56c660be9933a06f7eea2f9ad059 | IngoHeimbach/shallow-appify | shallow_appify/_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport imp\n\nmodules = {}\n\ndef load_modules(path=\"./modules/\"): # Consider adding recursive searching at some point in the future\n modules['juliet_module'] = imp.load_source('juliet_module', path + \"juliet_module.py\")\... | python | edit | 2 | 6 | bsd-2-clause | 5831ce15a94d1941e0521bae328f0ede48bfbe8b | halfbro/juliet | juliet_importer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mock\nimport github3\nimport unittest\n\nMockedSession = mock.create_autospec(github3.session.GitHubSession)\n\n\ndef build_url(self, *args, **kwargs):\n # We want to assert what is happening with the actual calls to the\n # In... | python | edit | 1 | 2 | bsd-3-clause | 6621bef05b2d4cb3fc138622194fe39765ebcb7c | krxsky/github3.py,jim-minter/github3.py,agamdua/github3.py,degustaf/github3.py,christophelec/github3.py,wbrefvem/github3.py,h4ck3rm1k3/github3.py,sigmavirus24/github3.py,ueg1990/github3.py,icio/github3.py,balloob/github3.py,itsmemattchung/github3.py | tests/unit/helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom datetime import timedelta\n\nfrom django.conf import settings\nfrom rest_framework.settings import APISettings\n\nUSER_SETTINGS = getattr(settings, 'SIMPLE_JWT', None)\n\nDEFAULTS = {\n 'AU... | python | edit | 1 | 0 | mit | a10c02e6bac0ff87576e359316901d576bed8d9d | davesque/django-rest-framework-simplejwt,davesque/django-rest-framework-simplejwt | rest_framework_simplejwt/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport collections\n\nfrom reportlab.platypus import (\n PageBreak,\n FrameBreak,\n NextPageTemplate,\n)\n\n\nclass Story(collections.Mutab... | python | edit | 1 | 1 | mit | c953a1435b6f20b337ee1d7410d29868d17bc6d9 | cecedille1/PDF_generator | pdf_generator/pdf_generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.blueprints.news_admin.forms\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2017 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nimport re\n\nfrom wtforms import StringField, TextArea... | python | edit | 1 | 0 | bsd-3-clause | fc6806608c5e407882248185bca57afa712e065a | m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/blueprints/news_admin/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom operator import attrgetter, itemgetter\nfrom itertools import chain\n\nfrom ...utils.py3_hook import with_hook\n\nwith with_hook():\n from arcrest import Catalog\nimport numpy as np\n\n\ndef get_layers(service):\n layers = servic... | python | edit | 1 | 5 | mit | e000f5db7bf8aee6b3ae267824491d03b20fbb36 | Mause/statistical_atlas_of_au | saau/sections/transportation/data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nimport re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.plugin.api.utils import itertags\nfrom streamlink.stream import HLSStream\n\n\nclass EuropaP... | python | edit | 1 | 4 | bsd-2-clause | 780f7f2b9546bc7f1c87ad3744559de3287fee21 | back-to/streamlink,streamlink/streamlink,gravyboat/streamlink,melmorabity/streamlink,back-to/streamlink,chhe/streamlink,bastimeyer/streamlink,beardypig/streamlink,wlerin/streamlink,wlerin/streamlink,streamlink/streamlink,chhe/streamlink,beardypig/streamlink,bastimeyer/streamlink,melmorabity/streamlink,gravyboat/streaml... | src/streamlink/plugins/europaplus.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# pylint: disable=W0614,W0401,W0611\n\nimport numpy as np\n\nfrom pandas.core.algorithms import factorize, match, unique, value_counts\n\nfrom pandas.core.common import isnull, notnull, save, load\nfrom pandas.core.categorical import Cate... | python | edit | 41 | 0 | bsd-3-clause | 0167e246b74789cc0181b603520ec7f58ef7b5fe | pandas-dev/pandas,GuessWhoSamFoo/pandas,TomAugspurger/pandas,toobaz/pandas,MJuddBooth/pandas,cython-testbed/pandas,TomAugspurger/pandas,nmartensen/pandas,cython-testbed/pandas,DGrady/pandas,DGrady/pandas,datapythonista/pandas,kdebrab/pandas,dsm054/pandas,Winand/pandas,linebp/pandas,dsm054/pandas,toobaz/pandas,jmmease/p... | pandas/core/api.py | rejected_lint | Too many lint violations: 41 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..learner import Learner\nfrom ..policies import RandomPolicy\nfrom ..util import max_action_value\nfrom ..value_functions import TabularF\nfrom ...utils import check_random_state\n\n\nclass QLearning(Learner):\n\n def __init__(self... | python | edit | 2 | 3 | mit | 4bd41e0e9381ef1c29b1a912a5d8d6ac99b03f4c | davidrobles/mlnd-capstone-code | capstone/rl/learners/qlearning.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\nregister = template.Library()\n\n# Don't really like using relative imports, but no choice here!\nfrom ..helpers import nice_repr, iso8601_repr, total_seconds as _total_seconds\n\n@register.filter(name='timedelt... | python | edit | 2 | 2 | bsd-3-clause | fb042cd3ff15f35672e543f040053859c18cff24 | sookasa/django-timedelta-field | timedelta/templatetags/timedelta.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n__author__ = 'nickl-'\n\nfrom aero.__version__ import __version__\nfrom .base import BaseAdapter\n\n\nclass Brew(BaseAdapter):\n \"\"\"\n Homebrew adapter.\n \"\"\"\n adapter_command = 'brew'\n\n def ... | python | edit | 3 | 6 | bsd-3-clause | a12a027ba027ebb23e18da38e444dc51e57a91bc | Aeronautics/aero | aero/adapters/brew.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# vim:ts=4:sw=4:noexpandtab\n\nfrom __future__ import absolute_import\n\nimport socket\nimport logging\n\nfrom .dictlib import ConfigDict\n\nconfig = ConfigDict(\n\tbot_nickname = 'pmxbot',\n\tdatabase = 'sqlite:pmx... | python | edit | 1 | 0 | bsd-3-clause | 2cb7c80bc4358631b897e3ea91d3c7eff684f69b | jawilson/pmxbot,jawilson/pmxbot | pmxbot/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Project: retdec-python\n# Copyright: (c) 2015-2016 by Petr Zemek <<EMAIL>> and contributors\n# License: MIT, see the LICENSE file for more details\n#\n\n\"\"\"The main package of a Python library and tools providing easy access to ... | python | edit | 1 | 0 | mit | 513fa57c8062310a1e852316f51a4382acf6f9b0 | s3rvac/retdec-python | retdec/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ndef printSnapshot(doc):\n print(u'Created {} => {}'.format(doc.id, doc.to_dict()))\n\ndef queryUsers(db):\n users_ref = db.collection(u'users')\n docs = users_ref.get()\n docList = list()\n for doc in docs:\n docList.append(doc)\n... | python | edit | 1 | 3 | mit | c5c2d3c411ba38a7b110044e04657ae6584be861 | frinder/frinder-app,frinder/frinder-app,frinder/frinder-app | scripts/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef isblank(value):\n return (\n value is not False\n and value != 0\n and value != float(0)\n and not bool(value)\n )\n\n\ndef concatenate(delimiter=''):\n def _concatenate(row):\n ... | python | edit | 1 | 6 | mit | 75092d41fc93306ddc640463886e80620cbcbf46 | inside-track/pemi | pemi/transforms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nimport logging\nfrom os.path import abspath, dirname\n\nbasepath = abspath(dirname(abspath(__file__)) + '/..')\nsys.path.insert(0, basepath)\n\nfrom server import Server\nfrom deflate_frame import DeflateF... | python | edit | null | null | bsd-3-clause | 348b79cfd68afa91a71009a6481f2d45495909cf | taddeus/wspy,taddeus/wspy | test/server.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nPython support for Alexa applications.\n\nBecause like everything Amazon it involves a ton of tedious boilerplate.\n\"\"\"\n\nimport logging\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\n\n\nfrom alexandra.app impo... | python | edit | 1 | 0 | isc | ebcdf90a44d3ae87be8032f89bec26697e22cbf3 | erik/alexandra | alexandra/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gitlab_personalaccesstoken import generate_personal_access_token\nfrom terraform_external_data import terraform_external_data\n\nimport gitlab\n\n\n@terraform_external_data\ndef get_gitlab_group(query):\n token = generate_personal_a... | python | edit | 3 | 1 | apache-2.0 | 4f1f5b22a92876f9eb61058fc1911dda73a2acf7 | tmobile/jazz-installer,tmobile/jazz-installer,tmobile/jazz-installer,tmobile/jazz-installer | installer/terraform/jazz-terraform-unix-noinstances/scripts/configure-gitlab.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\n__version__ = '0.1.3'\n\nBASE_JAR = \"pyleus-base.jar\"\nBASE_JAR_INSTALL_DIR = \"share/pyleus\"\nBASE_JAR_PATH = os.path.join(sys.prefix, BASE_JAR_INSTALL_DIR, BASE_JAR)\n\n```\n\nApply this change: Bump pyleus ver... | python | edit | 1 | 0 | apache-2.0 | 916affcb04fe24f353da918aa707685f7768ea62 | ecanzonieri/pyleus,imcom/pyleus,imcom/pyleus,patricklucas/pyleus,patricklucas/pyleus,jirafe/pyleus,dapuck/pyleus,mzbyszynski/pyleus,jirafe/pyleus,dapuck/pyleus,imcom/pyleus,stallman-cui/pyleus,mzbyszynski/pyleus,poros/pyleus,stallman-cui/pyleus,Yelp/pyleus,Yelp/pyleus,poros/pyleus,ecanzonieri/pyleus | pyleus/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport time\n\nfrom dj_experiment.tasks.tasks import longtime_add, netcdf_save\nfrom example.settings import (DJ_EXPERIMENT_BASE_DATA_DIR,\n DJ_EXPERIMENT_DATA_DIR)\n\nif __name__ == '__main__':\n ... | python | edit | 9 | 0 | mit | 563e7d5bc2fadd35b0fc71d45c949aa0b2e872a9 | francbartoli/dj-experiment,francbartoli/dj-experiment | example/example/tasksapp/run_tasks.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Case Conductor is a Test Case Management system.\n# Copyright (C) 2011-2012 Mozilla\n#\n# This file is part of Case Conductor.\n#\n# Case Conductor is free software: you can redistribute it and/or modify\n# it under the terms of the GNU G... | python | edit | 10 | 0 | bsd-2-clause | b19707479410c04a19e6cf224e048260edbf0155 | mozilla/moztrap,shinglyu/moztrap,shinglyu/moztrap,mozilla/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mozilla/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,mozilla/moztrap... | cc/settings/default.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# logger module\n\nfrom datetime import datetime\nimport os\n\nlogfile = None\nlogbuf = []\n\ndef init(analysis_path):\n global logfile\n if not os.path.isdir(analysis_path):\n log(\"logger: analysis_path missing:\", analysis_p... | python | edit | 1 | 6 | mit | 64750693969bda63dae28db0b43eaca09c549ab4 | UASLab/ImageAnalysis | scripts/lib/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport tarfile\nimport contextlib\n\ndef _tarfile_open_ex(*args, **kwargs):\n\t\"\"\"\n\tExtend result as a context manager.\n\t\"\"\"\n\treturn contextlib.closing(tarfile.open(*args, **kwargs))\n\ntarfile_open = _tarfile_open_e... | python | edit | 1 | 1 | mit | fd7fb7ade0fc879e24543f13c39b00de073004bc | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/tests/py26compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.... | python | edit | 1 | 0 | apache-2.0 | 6830f29022746838677ecca420aeff190943c5ed | google/tf-quant-finance,google/tf-quant-finance | random/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nDefine simple search patterns in bulk to perform advanced matching on any string\n\"\"\"\n\nfrom .rebulk import Rebulk\nfrom .match import Match\nfrom .rules import Rule\nfrom .pattern... | python | edit | 8 | 0 | mit | 2f6c82d74592c80b5042c0b808a658650896cbec | Toilal/rebulk | rebulk/__init__.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nfrom helpers import models as helpermodels\n\n\n# Create your models here.\nclass Networks(models.Model):\n POLICIES = (\n ('reject', 'Reject'),\n ('drop', 'Ignore'),\n (... | python | edit | 1 | 0 | mit | 0eb7ddce9f425c30c70bc1442618deb72c530911 | Kromey/piroute,Kromey/piroute,Kromey/piroute | networks/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Base objects to be exported for use in Controllers\"\"\"\n# Import pkg_resources first so namespace handling is properly done so the\n# paste imports work\nimport pkg_resources\nfrom paste.registry import StackedObjectProxy\n\nfrom py... | python | edit | 3 | 3 | bsd-3-clause | e50b95143ce4a807c434eaa0e6ef38d36f91a77a | Pylons/pylons,Pylons/pylons,moreati/pylons,moreati/pylons,Pylons/pylons,moreati/pylons | pylons/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport sys\n\n\ndef main():\n if len(sys.argv) != 2:\n print('Usage: %s version' % sys.argv[0])\n os.system('git tag | sort -n | tail -n 1')\n sys.exit()\n\n version = sys.argv[... | python | edit | 1 | 4 | apache-2.0 | 28d933b351f58fabad464deedb57af55b499b7c8 | Floobits/floobits-sublime,Floobits/floobits-sublime | tag_release.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\nfrom marathon.models.base import MarathonObject\nimport unittest\n\n\nclass MarathonObjectTest(unittest.TestCase):\n\n def test_hashable(self):\n \"\"\"\n Regression test for issue #203\n\n Marat... | python | edit | 1 | 1 | mit | 0519824c537a96474e0501e1ac45f7a626391a31 | thefactory/marathon-python,thefactory/marathon-python | tests/test_model_object.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Module with specification of all supported command line arguments.\"\"\"\n\nimport argparse\n\ncli_parser = argparse.ArgumentParser()\n\ncli_parser.add_argument('--log-level',\n help='log level as defined in ' +... | python | edit | 1 | 0 | apache-2.0 | 9f0b77ba9d98c6f78e5320d2b4515f3152a6f38c | jpopelka/fabric8-analytics-common,tisnik/fabric8-analytics-common,tisnik/fabric8-analytics-common,jpopelka/fabric8-analytics-common,jpopelka/fabric8-analytics-common,tisnik/fabric8-analytics-common | db-integrity-tests/src/cliargs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport numpy as np\n\ndef read_phi(flname, n_steps, n_loci):\n\tsampled_phis = np.zeros((n_steps, n_loci))\n\tfl = open(flname)\n\tcurrent_iter_idx = 0 # index used for storage\n\tlast_iter_idx = 0 # index used to identify when ... | python | edit | 1 | 3 | apache-2.0 | 1e19a78652e8fed32eb6e315fca3346b3bc31044 | rnowling/pop-gen-models | bamova/bamov2npy.py | rejected_duplicate | Near-duplicate of sample 5933 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.