messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport appconfigpy\n\nfrom ._const import PROGRAM_... | python | edit | 1 | 0 | mit | 69d013b768edabb6bc7dbe78b1f219ea1b49db16 | thombashi/sqlitebiter,thombashi/sqlitebiter | sqlitebiter/_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n#\n# Copyright (c) SAS Institute Inc.\n#\n\nimport sys\nimport os\nimport pwd\nfrom conary.server import schema\nfrom conary.lib import cfgtypes, tracelog\nfrom conary import dbstore\n\nfrom .config import UpsrvConfig\n\n... | python | edit | 3 | 1 | apache-2.0 | 71677afa8e5146023dc63c28a187ad5610d5b90a | sassoftware/rbm,sassoftware/rbm,sassoftware/rbm | upsrv/conary_schema.py | rejected_duplicate | Near-duplicate of sample 3254 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport os\n\nfrom stevedore.extension import ExtensionManager\n\nENGINES = [\n 'lammps',\n 'openfoam',\n 'kratos',\n 'jyulb']\n\nif os.getenv(\"HAVE_NUMERRIN\", \"no\") == \"yes\":\n ENGINES.append(\"numerrin... | python | edit | 1 | 3 | bsd-2-clause | a25d7cbe7a2fb583e08e642e846edd7d647f2013 | simphony/simphony-framework | tests/test_engine_import.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*\n\"\"\"\n`grappa_http` provides HTTP protocol assertion for `grappa` testing library.\n\nExample::\n\n import grappa\n import grappa_http\n\n # Register plugin\n grappa.use(grappa_http)\n\n # Use plugin... | python | edit | 1 | 0 | mit | 91f1accf58e0446eb9ac6421cbf148b619c09ea9 | grappa-py/http | grappa_http/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport unittest\nimport pandas as pd\n\nfrom fetch_trends import fetch_hourly_data\n\n\nclass TestFetch(unittest.TestCase):\n\n def test_fetch_type(self):\n result = fetch_hourly_data(\"test\", 2021, 1, 1... | python | edit | 1 | 3 | apache-2.0 | 261883f80174873af38a17ac7b0ebe7a79263d85 | googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks | project/scripts/unit_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ----------------------------------------------------------------------------\n# Copyright (c) 2016--, Ben Kaehler\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed wi... | python | edit | 1 | 2 | bsd-3-clause | 1d555c184a10ae4fd84d758105e19b10828543c2 | BenKaehler/q2-feature-classifier | q2_feature_classifier/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport warnings\n\nfrom signac import *\n\nmsg = \"compdb was renamed to signac. Please import signac in the future.\"\nwarnings.warn(DeprecationWarning, msg)\n\n```\n\nApply this change: Add surrogate compdb package, linking to signac.\n\n... | python | edit | 5 | 0 | bsd-3-clause | f4c8f003a4ffdd8e64468d261aa2cd34d58f1b9d | csadorf/signac,csadorf/signac | src/compdb/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom controller import c3bottles, db\nfrom view.user import User\n\n\nNAME = 'user'\nPASSWORD = 'test'\n\n\ndef load_config():\n c3bottles.config['SQLALCHEMY_DATABASE_URI'] = \"sqlite://\"\n c3bottles.config['TESTIN... | python | edit | 1 | 1 | mit | 52c9768b30bf758a3ffeb2a94e10e28ab52541ab | der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles | test/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n\ndef pytest_addoption(parser):\n parser.addoption(\"--travis\", action=\"store_true\", default=False,\n help=\"Only run tests marked for Travis\")\n\n\ndef pytest_configure(config):\n config.addin... | python | edit | 2 | 3 | mit | 095d77b74a3bfad6d97387a860ac67f82f31c478 | tkarna/cofs | test/conftest.py | rejected_duplicate | Near-duplicate of sample 12259 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom scriptcwl import WorkflowGenerator as WFGenerator\n\n\nclass WorkflowGenerator(WFGenerator):\n def __init__(self):\n module_path = os.path.dirname(os.path.realpath(__file__))\n steps_dir = os.path.join(mod... | python | edit | 1 | 1 | apache-2.0 | 2582eaeb27bf5cb6185cd2400edf56fe3c5cbacc | WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln | nlppln/wfgenerator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth import authenticate\nfrom rest_framework import serializers\n\n\nclass AuthTokenSerializer(serializers.Serializer):\n username = serializers.CharField()\n password = serializers.CharField()\n\n def validate... | python | edit | 1 | 5 | bsd-2-clause | c15dab903d3759578449279cc034d766d362d41f | linovia/django-rest-framework,nhorelik/django-rest-framework,rafaelang/django-rest-framework,iheitlager/django-rest-framework,fishky/django-rest-framework,bluedazzle/django-rest-framework,damycra/django-rest-framework,HireAnEsquire/django-rest-framework,jerryhebert/django-rest-framework,gregmuellegger/django-rest-frame... | rest_framework/authtoken/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport pytest\nimport os\nimport json\nimport sys\n\nif sys.version_info[0] == 2:\n from codecs import open\n\n# This pair of generator expressions are pretty lame, but building lists is a\n# bad idea as I plan t... | python | edit | 1 | 1 | mit | 733f116125e7c061cf9f0e11e5b1008ee5272131 | python-hyper/hpack,python-hyper/hpack | test/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Tweepy\n# Copyright 2010-2022 Joshua Roesslein\n# See LICENSE for details.\n\nimport datetime\n\n\ndef list_to_csv(item_list):\n if item_list:\n return ','.join(map(str, item_list))\n\n\ndef parse_datetime(datetime_string):\n ... | python | edit | 1 | 2 | mit | 50bd3ae1cac853d34d29c697573ccf8a3fc4cd96 | svven/tweepy,tweepy/tweepy | tweepy/utils.py | rejected_duplicate | Near-duplicate of sample 2289 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport django\n\nfrom os import path\n\n\nSECRET_KEY = 'not secret'\nINSTALLED_APPS = ('dumper', 'test', 'django.contrib.contenttypes')\nTEMPLATE_DEBUG = DEBUG = True\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.s... | python | edit | 1 | 0 | mit | 52b11c93eed257622d169ab037b3b4918b936ddd | saulshanabrook/django-dumper | test/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This configuration has been configured for this demo, not all\n# normal sigal settings have an effect in this theme.\n\n# ---------------------\n# General configuration\n# ---------------------\n\nsource = 'source'\ndestination = 'output'... | python | edit | 1 | 0 | mit | ffa0fe66512aada62ba2778ea2edba28fd34de88 | 153957/153957-theme,153957/153957-theme | demo/sigal.conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\nimport smtplib\nfrom email.mime.text import MIMEText\nfrom django.conf import settings\n\n\ndef send_text(sender, receiver, subject, body):\n msg = MIMEText(body, _charset='utf-8')\n msg['Subject'] = subje... | python | edit | 1 | 1 | mit | 7fe3495398b8663cee420e3d3f8ad8d1135e2df9 | t103z/interview,t103z/interview,t103z/interview,t103z/interview | api_server/interview/send_email.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Exchange(object):\n def get_markets(self):\n \"\"\"\n Returns a list of tuples of the form ('XXX', 'YYY') representing the \n available markets on the exchange, where XXX and YYY are the currency \n code... | python | edit | 1 | 1 | mit | fef4e4ce6b05506babc2c325b08aed77af8b9a3c | coink/cryptex | cryptex/exchange.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"The OCSPdash homepage UI blueprint.\"\"\"\n\nfrom flask import Blueprint, render_template\n\nfrom ocspdash.web.proxies import manager\n\n__all__ = [\n 'ui',\n]\n\nui = Blueprint('ui', __name__)\n\n\n@ui.r... | python | edit | 1 | 1 | mit | e586b8ba3bb896dabe97d65d1b564c749faa4d42 | scolby33/OCSPdash,scolby33/OCSPdash,scolby33/OCSPdash | src/ocspdash/web/blueprints/ui.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# TestPOUnwrapping.py\n#\n# This source file is part of the Swift.org open source project\n#\n# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors\n# Licensed under Apache License v2.0 with Runtime Library Exception\n#\n# Se... | python | edit | 1 | 1 | apache-2.0 | e214e46e748881e6418ffac374a87d6ad30fcfea | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb | packages/Python/lldbsuite/test/repl/pounwrapping/TestPOUnwrapping.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\nregister=template.Library()\n\n@register.filter\ndef stringformat(value, fmt='{}'):\n '''\n format the value\n '''\n return fmt.format(value)\n\n```\n\nApply this change: Add named format support if dict... | python | edit | 1 | 2 | apache-2.0 | 082e34ae8d336d2fe93ea428db0b9a72bbfd649e | kensonman/webframe,kensonman/webframe,kensonman/webframe | templatetags/stringformat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import AuthenticationBase\n\n\nclass Enterprise(AuthenticationBase):\n\n def __init__(self, domain):\n self.domain = domain\n\n def saml_metadata(self, client_id):\n return self.get(url='https://%s/samlp/metad... | python | edit | 1 | 1 | mit | ab845dfd7eb2142ee8bf2fb86f58544e65ac97b8 | auth0/auth0-python,auth0/auth0-python | auth0/v2/authentication/enterprise.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.contrib.auth import authenticate\nfrom django.contrib.auth.forms import AuthenticationForm as Form\nfrom django.utils.translation import ugettext_lazy as _\n\nclass AuthenticationForm(Form):\n \"\"\"... | python | edit | 1 | 7 | bsd-3-clause | 1a9e83262201ad7256c5f02c91dc38c2bdccd908 | strange/django-email-auth | email_auth/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import MetaData, Table, Column, types, create_engine, select\n\nfrom .base import BaseBackend\n\n\nclass SQLBackend(BaseBackend):\n\n def __init__(self, url, table_name='gimlet_channels'):\n engine = create_engine(... | python | edit | 1 | 2 | mit | 6b42983178f2a6fc3c485dc23825b748859351e5 | storborg/gimlet | gimlet/backends/sql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import * # noqa\n\n\nSECRET_KEY = 'test'\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': base_dir_join('db.sqlite3'),\n }\n}\n\nSTATIC_ROOT = base_dir_join('staticfiles')\n... | python | edit | 2 | 0 | mit | e502c906e0515dc753c972656751c9fd1ef939f9 | vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate | backend/project_name/settings/test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\nfrom subprocess import check_output\nimport sys\n\nfish_df = pd.read_csv(sys.argv[1],names=['fish'])\n\nurl_dict = {}\nfor fish in fish_df.fish:\n output = check_output(['node','scrape_image_urls.js',fish,sys.argv[2]... | python | edit | 1 | 0 | mit | cf44260d057e289a089c1c3c440e5f64366facfa | matthew-sochor/fish.io.ai,matthew-sochor/fish.io.ai,matthew-sochor/fish.io.ai,matthew-sochor/fish.io.ai | scraping/urls/scrape_fish.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n This example demonstrates a client fetching images from a server running img_server.py.\n\n The first packet contains the number of chunks to expect, and then that number of chunks is read.\n Lost pa... | python | edit | 1 | 0 | mit | a41f468f667869a433e5fbb2bd2dde797ae24586 | thusoy/nuts-auth,thusoy/nuts-auth | examples/img_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nCreated on 20 Apr 2010\n\n@author: Chris Filo Gorgolewski\n'''\nimport ConfigParser, os\nfrom io import StringIO\n\ndefault_cfg = StringIO(\"\"\"\n[logging]\nworkflow_level = INFO\nnode_level = INFO\nfilemanip_level = INFO\n\n[executio... | python | edit | 1 | 0 | bsd-3-clause | 6115590cde40c05b92cb6fa9e7358e08c964f4d1 | blakedewey/nipype,wanderine/nipype,fprados/nipype,gerddie/nipype,iglpdc/nipype,mick-d/nipype,arokem/nipype,rameshvs/nipype,iglpdc/nipype,FredLoney/nipype,mick-d/nipype_source,JohnGriffiths/nipype,dmordom/nipype,glatard/nipype,carlohamalainen/nipype,arokem/nipype,blakedewey/nipype,glatard/nipype,rameshvs/nipype,carolFro... | nipype/utils/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Factorial series:\n\n1!, 2!, 3!, ...\n\n- Factorial(1) = 1! = 1\n- Factorial(2) = 2! = 2\n- Factorial(n) = n! = n * (n - 1)! = n * Factorial(n - 1)\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import print_functi... | python | edit | 3 | 2 | bsd-2-clause | fa0d138ce465efdd630b83ba4a7ee10888a68b4a | bowen0701/algorithms_data_structures | alg_factorial.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Lint as: python3\n\"\"\"This script is used to run the amaranth.ml module as an executable.\n\nFor now, this script just delegates it's main to amaranth.ml.train\n\"\"\"\n\nfrom amaranth.ml import train\n\n\ndef main():\n train.main()\n\... | python | edit | 1 | 5 | apache-2.0 | a2a4b9f400fa6d62d3671d69d9742d06c165f7da | googleinterns/amaranth,googleinterns/amaranth | amaranth/ml/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n\"\"\"\n\n__version__ = \"0.0.1.1\"\n__author__ = \"Fyndiq\"\n__license__ = \"MIT\"\n__copyright__ = \"Copyright 2016 Fyndiq AB\"\n\n```\n\nApply this change: Add a one-liner about module functionality and t... | python | edit | 1 | 0 | mit | b7d8daf8377fff86662bb8721b1008667e8a4767 | fyndiq/django-gstorage | gstorage/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom argparse import ArgumentParser\nfrom itertools import groupby\n\n\ndef iterate(n):\n result = 0\n digits = [int(i) for i in str(n)]\n for k, g in groupby(digits):\n result = result * 100 + len(... | python | edit | 1 | 3 | unlicense | cd67e3d2419fd84fd11e469d17562bba19131099 | jajakobyly/looknsay | looknsay.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyxb.binding.generate\nimport pyxb.utils.domutils\nfrom xml.dom import Node\n\nimport os.path\nschema_path = '%s/../schemas/test-facets.xsd' % (os.path.dirname(__file__),)\ncode = pyxb.binding.generate.GeneratePython(schema_location=... | python | edit | 5 | 3 | apache-2.0 | 3cc8f2f212199d956c0132cc0aa12bd33e94e8dc | jonfoster/pyxb2,jonfoster/pyxb-upstream-mirror,balanced/PyXB,jonfoster/pyxb1,jonfoster/pyxb-upstream-mirror,balanced/PyXB,CantemoInternal/pyxb,jonfoster/pyxb-upstream-mirror,pabigot/pyxb,jonfoster/pyxb2,balanced/PyXB,CantemoInternal/pyxb,pabigot/pyxb,jonfoster/pyxb1,CantemoInternal/pyxb,jonfoster/pyxb2 | tests/drivers/test-facets.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nCreated on Aug 1, 2017\n\n@author: alkaitz\n'''\n\nif __name__ == '__main__':\n pass\n```\n\nApply this change: Include quick sample for water level identification"
},
{
"role": "assistant",
"content": "'''\nCreated on A... | python | edit | 1 | 0 | mit | cd7a8b999280e0e834e196066068f78375cfb88a | alkaitz/general-programming | water_level/water_level.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Django project fabfile.\"\"\"\n\nimport os\nfrom fabric.api import puts, task\nfrom fabric.utils import indent\n\nfrom deploy import deploy_to_heroku, prepare_to_deploy, tag_project\nfrom publish import update_staticfiles, upload_stat... | python | edit | 1 | 2 | mit | 72d193956d1be4e0fbbe92b417d9022770de823b | PrecisionMojo/pm-www,PrecisionMojo/pm-www | fabfile/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n # eg: /footballseason/\n url(r'^$', views.index, name='index'),\n\n # eg: /footballseason/3\n url(r'^(?P<week_id>[0-9]+)/$', views.display, name='displ... | python | edit | 1 | 0 | mit | 3d1dba15097ac8b746c138b75fe1763aa4b8ac12 | mkokotovich/footballpicks,mkokotovich/footballpicks,mkokotovich/footballpicks,mkokotovich/footballpicks | footballseason/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.exceptions import ValidationError\nfrom django.template.defaultfilters import slugify\nimport re\n\nNAME_REGULAR_EXPRESSION = re.compile(r'^[a-zA-Z0-9]+[\\w\\-\\.: ]*$')\n\n\ndef greater_than_zero(value):\n \"\"\"Checks ... | python | edit | 1 | 4 | bsd-3-clause | f28d1c7b1daba6a2ca4d8b2537e861d8146bc998 | michaelwisely/django-competition,michaelwisely/django-competition,michaelwisely/django-competition | src/competition/validators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import RedirectView\n\n\nclass RouteRedirectView(RedirectView):\n \"\"\"Redirect to the target Route.\"\"\"\n def get_redirect_url(self, *args, **kwargs):\n \"\"\"\n Return the route's target ur... | python | edit | 1 | 1 | bsd-2-clause | 25f2692d5865a76533f8087c2f566299ae777c8e | meshy/django-conman,meshy/django-conman,Ian-Foote/django-conman | conman/redirects/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom .core import LogFileOutput, Mapper, IniConfigFile, LegacyItemAccess # noqa: F401\nfrom .core.plugins import mapper, reducer, make_response, make_metadata # noqa: F401\nfrom .mappers import get_active_lines # noqa: F401\nf... | python | edit | 1 | 1 | apache-2.0 | e0055226a9d10d726fcde948ea72ac2e84f8109a | RedHatInsights/insights-core,RedHatInsights/insights-core | falafel/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask.ext.hookserver import Hooks\n\nfrom .models import db, User\n\n\nhooks = Hooks()\n\n\n@hooks.hook('ping')\ndef ping(data, guid):\n return 'pong'\n\n\n@hooks.hook('membership')\ndef membership(data, guid):\n if data['scope']... | python | edit | 1 | 5 | mit | 7cc1a78d4fefcb216a6c8d5128d05ba9e70f5246 | jazzband/website,jazzband/website,jazzband/website,jazzband/site,jazzband/jazzband-site,jazzband/site,jazzband/jazzband-site,jazzband/website | jazzband/hooks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gather.organiser import NotEnoughPlayersError\n\n\ndef strip_help(bot):\n messages = []\n\n for regex, action in bot.actions.values():\n if action.__doc__:\n messages.append(action.__doc__.strip())\n return m... | python | edit | 1 | 3 | mit | acb348ae14bbbef6ea6a51d926fef975f8684fdd | veryhappythings/discord-gather | gather/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport importlib\nimport logging\nfrom volttron.platform.agent import utils\n\n_log = logging.getLogger(__name__)\nutils.setup_logging()\n__version__ = \"0.1\"\n\n__all__ = ['Model']\n\n\nclass Model(object):\n def __init__(self, config,... | python | edit | 1 | 3 | bsd-3-clause | 6d1dcaa08969e369b25debc010d7675ec8099724 | VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications | pnnl/models/__init__.py | rejected_duplicate | Near-duplicate of sample 15614 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fontTools.pens.cocoaPen import CocoaPen\n\n# Some configuration\npage_format = 'A4' # See http://drawbot.readthedocs.org/content/canvas/pages.html#size for other size-values\nmy_selection = CurrentFont() # May also be CurrentFont.selec... | python | edit | 5 | 1 | mit | 20d766de4d20355303b5b423dd30bf0cd4c8ee8e | AlphabetType/DrawBot-Scripts | createGlyphsPDF.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport signal\nimport sys\n\nimport click\nimport gevent\n\nimport pyinfra\n\nfrom .legacy import run_main_with_legacy_arguments\nfrom .main import cli, main\n\n\n# Set CLI mode\npyinfra.is_cli = True\n\n# Don't write out deploy.... | python | edit | 1 | 2 | mit | 7e6de52fd77ab865164368d90f7c2cfc8369b4fe | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra_cli/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import throttling\n\n\nclass ThrottlingBySession(throttling.SimpleRateThrottle):\n \"\"\"\n Limits the rating of facility service to only 10 per day per IP.\n This rate is configurable at the DRF settings.DEFAUL... | python | edit | 1 | 2 | mit | 46e20cb4ac6571b922968674f2127318eef68821 | MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api | common/utilities/throttling.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Copyright (C) 2014 The Android Open Source Project\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 c... | python | edit | 1 | 2 | apache-2.0 | f00e8bcadd3d71ed8ab797073a744f5d3d9648ea | jcfrank/myrepo,jcfrank/myrepo | wrapper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nversion_info = (7, 0, 0, 'beta', 9)\n\n_specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': ''}\n\n__version__ = '%s.%... | python | edit | 1 | 0 | bsd-3-clause | 45d27a34b0254123f8eb681a90d1cecfaab0b838 | ipython/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets | ipywidgets/_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom csvkit.unicsv import UnicodeCSVReader, UnicodeCSVWriter\n\nclass CSVKitReader(UnicodeCSVReader):\n \"\"\"\n A unicode-aware CSV reader with some additional features.\n \"\"\"\n pass\n\nclass CSVKitW... | python | edit | 2 | 4 | mit | 7125760a5d824ebe4bab81d688113a877f1c78c3 | archaeogeek/csvkit,Tabea-K/csvkit,Jobava/csvkit,kyeoh/csvkit,moradology/csvkit,tlevine/csvkit,doganmeh/csvkit,bmispelon/csvkit,reubano/csvkit,wireservice/csvkit,wjr1985/csvkit,aequitas/csvkit,barentsen/csvkit,dannguyen/csvkit,arowla/csvkit,themiurgo/csvkit,KarrieK/csvkit,haginara/csvkit,onyxfish/csvkit,metasoarous/csvk... | csvkit/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013 Mirantis Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.ap... | python | edit | 1 | 1 | apache-2.0 | 3fb772c8d5958a8a93ab1cedc87c61d513b84eea | rnirmal/savanna,bigfootproject/sahara,openstack/sahara,tellesnobrega/storm_plugin,zhangjunli177/sahara,bigfootproject/sahara,xme1226/sahara,tellesnobrega/sahara,esikachev/sahara-backup,crobby/sahara,zhujzhuo/Sahara,citrix-openstack-build/sahara,matips/iosr-2015,keedio/sahara,matips/iosr-2015,henaras/sahara,xme1226/saha... | savanna/utils/crypto.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pywatson.question.question import Question\n\n\nclass TestQuestion:\n def test___init___basic(self, questions):\n question = Question(questions[0]['questionText'])\n assert question.question_text == questions[0]['quest... | python | edit | 1 | 2 | mit | d9ffd877f646b3a5c020ed823d3541135af74fef | sherlocke/pywatson | tests/test_question.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyxform.tests_v1.pyxform_test_case import PyxformTestCase\n\nclass WhitespaceTest(PyxformTestCase):\n def test_over_trim(self):\n self.assertPyxformXform(\n name='issue96',\n md=\"\"\"\n | sur... | python | edit | 1 | 1 | bsd-2-clause | 7ce8e8e217e80098ce2b6371dd6c117009843602 | XLSForm/pyxform,XLSForm/pyxform | pyxform/tests_v1/test_whitespace.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals, absolute_import\n\nimport sys\nimport unittest\nimport mock\n\nfrom fm import Fm\n\n\nclass TestFm(unittest.TestCase):\n\n def setUp(self):\n self.mock_stdin = mock.create_autospec(sys.stdi... | python | edit | 1 | 1 | bsd-3-clause | 01b8b80bd694a93bce9cbdd2541f3e262f95c015 | roman-kachanovsky/cmd.fm-python | tests/test_commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Part of the masterfile package: https://github.com/njvack/masterfile\n# Copyright (c) 2017 Board of Regents of the University of Wisconsin System\n# Written by Nate Vack <<EMAIL>> at the Center for Healthy Minds... | python | edit | 1 | 4 | mit | f8d3477dc4a496d648ac6bfd8d26eeacd853200f | njvack/masterfile | src/masterfile/formatters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef transform_scalars(dataset):\n \"\"\"Reinterpret a signed integral array type as its unsigned counterpart.\n This can be used when the bytes of a data array have been interpreted as a\n signed array when it should have been inte... | python | edit | 1 | 3 | bsd-3-clause | 3979e0a2ebdba434a215d5f89cc58f2737ac0111 | thewtex/tomviz,cjh1/tomviz,OpenChemistry/tomviz,cjh1/tomviz,thewtex/tomviz,OpenChemistry/tomviz,cryos/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,cryos/tomviz,cjh1/tomviz,mathturtle/tomviz,mathturtle/tomviz,cryos/tomviz,mathturtle/tomviz,thewtex/tomviz | tomviz/python/ReinterpretSignedToUnsigned.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\nimport tempfile\nimport unittest\nimport shutil\nimport copy\n\nCURDIR = os.path.abspath(os.path.dirname(__file__))\nTOPDIR = os.path.split(CURDIR)[0]\nsys.path.insert(0, TOPDIR)\n\nfrom ez_setup import (use_setuptool... | python | edit | 1 | 1 | mit | 3be0c6c18a61f35ae5804464cc0da867fd0065f5 | pypa/setuptools,pypa/setuptools,pypa/setuptools | tests/test_ez_setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\nfrom health_monitor import views\n\n\nurlpatterns = [\n url(r'^health/(?P<uid>[\\w-]*)/$', views.read, name='read'),\n url(r'^health/(?P<uid>[\\w-]*)/update/(?P<test_name>[\\w-]*)/$', views.update, na... | python | edit | 1 | 0 | apache-2.0 | 4b06210ddcff50e9aa99a86edeb99e1a6200d5a9 | seanchon/django-health-monitor,gracenote/django-health-monitor,gracenote/django-health-monitor,seanchon/django-health-monitor | health_monitor/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest2 import TestCase\nimport simplejson as json\nimport boto3\nfrom moto import mock_s3\nimport permission_lambda\n\n\nclass PermissionLambdaTests(TestCase):\n def _get_permission_statements(self, client, queue_url):\n \... | python | edit | 1 | 1 | apache-2.0 | 5e25577d067f891474c722000327026744068e88 | ImmobilienScout24/aws-set-sqs-permission-lambda | src/unittest/python/permission_lambda_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom concurrent.futures import ThreadPoolExecutor\nfrom myDevices.utils.singleton import Singleton\nimport inspect\n\nexecutor = ThreadPoolExecutor(max_workers=4)\nclass ThreadPool(Singleton):\n\tdef Submit(something):\n\t\tfuture = execut... | python | edit | 1 | 1 | mit | 5fd04a337dd6fec1afc9bf53b437cce01e4fef9e | myDevicesIoT/Cayenne-Agent,myDevicesIoT/Cayenne-Agent | myDevices/os/threadpool.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, sys\r\n\r\nglobal nest\r\nnest = 0\r\n\r\ndef trace(frame, event, arg):\r\n #if event == 'line':\r\n global nest\r\n \r\n print \"%s%s %s %d (%r)\" % (\r\n \" \" * nest,\r\n event,\r\n os.path.b... | python | edit | 2 | 3 | apache-2.0 | 43776062a15640c62d94d8a9c19edadb21a773be | hugovk/coveragepy,jayhetee/coveragepy,larsbutler/coveragepy,7WebPages/coveragepy,hugovk/coveragepy,nedbat/coveragepy,7WebPages/coveragepy,nedbat/coveragepy,nedbat/coveragepy,hugovk/coveragepy,blueyed/coveragepy,jayhetee/coveragepy,blueyed/coveragepy,blueyed/coveragepy,7WebPages/coveragepy,nedbat/coveragepy,blueyed/cove... | lab/trace_sample.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nRun IEPY core loop\n\nUsage:\n iepy_runner.py <dbname> <seeds_file>\n iepy_runner.py -h | --help | --version\n\nOptions:\n -h --help Show this screen\n --version Version number\n\"\"\"\nimport pprint\... | python | edit | 3 | 0 | bsd-3-clause | 1028e1a6e15af5a20caedd5598cebc49c5486f64 | mrshu/iepy,machinalis/iepy,machinalis/iepy,mrshu/iepy,machinalis/iepy,mrshu/iepy | scripts/iepy_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMaking it easy to import in classes.\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\n__author__ = \"Bharath Ramsundar\"\n__copyright__ = \"Copyright 2016, S... | python | edit | 13 | 0 | mit | a79bb92e976eee795cb3118b3a03f5f0df11e14d | ktaneishi/deepchem,ktaneishi/deepchem,ktaneishi/deepchem,miaecle/deepchem,joegomes/deepchem,peastman/deepchem,miaecle/deepchem,rbharath/deepchem,miaecle/deepchem,Agent007/deepchem,rbharath/deepchem,peastman/deepchem,deepchem/deepchem,lilleswing/deepchem,joegomes/deepchem,Agent007/deepchem,deepchem/deepchem,Agent007/dee... | deepchem/feat/__init__.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add default import for crystal and kernel"
},
{
"role": "assistant",
"content": "from .atom import * # NOQA\nfrom .molecule import * # NOQA\nfrom .crystal import * # NOQA\nfrom .kernel import * # NOQA\n"
}
] | python | new_file | 1 | 0 | mit | a65eea671a605bdeef70160e2d967a59888fcd1b | crcollins/molml | molml/features.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# __BEGIN_LICENSE__\n# Copyright (C) 2008-2010 United States Government as represented by\n# the Administrator of the National Aeronautics and Space Administration.\n# All Rights Reserved.\n# __END_LICENSE__\n\n\"\"\"\nThis app may define s... | python | edit | 1 | 0 | apache-2.0 | 41d379fcb1e3d1828e7898045cca0505cb47ae61 | xgds/xgds_data,xgds/xgds_data | xgds_data/defaultSettings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n Command line script main\n\"\"\"\n\nfrom rapydo.do.app import Application\nimport better_exceptions as be\n\n\ndef main():\n be # activate better exceptions\n Application()\n\n\nif __name__ == '__... | python | edit | 1 | 2 | mit | 84bf7bd05b683890e817efb6d26f7176cf555f04 | rapydo/do | rapydo/do/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\n\n\ndef date_features(input_df, datetime_column='tms_gmt'):\n \"\"\"\n Given a datetime column, extracts useful date information\n (minute, hour, dow...)\n \"\"\"\n df = input_df.copy()\n\n return (df.... | python | edit | 4 | 1 | mit | fe974197217eff350f1dc0bc5687c83066d6dd34 | yassineAlouini/kaggle-tools,yassineAlouini/kaggle-tools | kaggle_tools/features_engineering/dates_engineering.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\ndescription = 'ssheepdog'\nlong_desc = description\n\nsetup(\n name='ssheepdog',\n version='0.0.1',\n url='https://github.com/SheepDogInc/ssheepdog',\n install_requires=[\n 'django-celery',... | python | edit | 1 | 0 | bsd-3-clause | 98df7851355f81f8b6119781c003dc2f84b4dc85 | SheepDogInc/ssheepdog,SheepDogInc/ssheepdog,SheepDogInc/ssheepdog | django-ssheepdog/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests the message framework.\"\"\"\n\nimport threading\nimport time\nimport unittest\n\nfrom messaging.message_consumer import consume_messages\nfrom messaging.message_producer import MessageProducer\n\n\nclass TestMessage(unittest.Te... | python | edit | 1 | 3 | mit | cdb10489382144f77dbe720f230ae92020ffb66c | bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc | messaging/test/test_message.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nVERSION = (0, 0, 92, 'alpha')\n\n# pragma: no cover\nif VERSION[-1] != \"final\":\n __version__ = '.'.join(map(str, VERSION))\nelse:\n # pragma: no cover\n __version__ = '.'.join(map(str, VERSION[:-1]))\n\n... | python | edit | 1 | 0 | mit | 3a781fe4b579af41b2c4f0cb7ef30a36085152ed | KerkhoffTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise | djconnectwise/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask.ext.pymongo import PyMongo\nfrom flask.ext.babel import Babel\nfrom flask.ext.cache import Cache\nfrom brew.io import TemperatureController\nfrom brew.state import Machine\n\n\napp = Flask(__name__)\napp.... | python | edit | 3 | 0 | mit | 8b7d8919afa12f33bed096f49780914f8878163f | brewpeople/brewmeister,brewpeople/brewmeister,brewpeople/brewmeister | brew/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__title__ = 'unihan-db'\n__package_name__ = 'unihan_db'\n__description__ = 'SQLAlchemy models for UNIHAN database'\n__version__ = '0.1.0'\n__author__ = 'Tony Narlock'\n__github__ = 'https://github.com/cihai/unihan-db'\n__pypi__ = 'https://p... | python | edit | 1 | 0 | mit | 7576d63bc2061074a41685c69546a4a5d57bc3fb | cihai/unihan-db | unihan_db/__about__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.backends import ModelBackend\nfrom django.contrib.auth.models import User\n\nclass LazySignupBackend(ModelBackend):\n\n def authenticate(self, username=None):\n users = [u for u in User.objects.filter(user... | python | edit | 1 | 2 | bsd-3-clause | 7ed3ba20aae568d0c12ec361210d1189ecd534cf | stefanklug/django-lazysignup,rwillmer/django-lazysignup,rwillmer/django-lazysignup,danfairs/django-lazysignup,stefanklug/django-lazysignup,danfairs/django-lazysignup | lazysignup/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom config import config\nimport ldap\n\n# DEFAULTS\nldap_config = {\n\t'timeout': 5\n}\n# /DEFAULTS\n\n# CONFIG\nif \"ldap\" in config:\n\tldap_config.update(config[\"ldap\"])\n# /CONFIG\n\ndef chec... | python | edit | 1 | 2 | mit | cdb66acf92dae34d1b17c2a429738c73fb06caad | ubnetdef/scoreengine,ubnetdef/scoreengine | scoring/checks/ldap.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\ncmds = [\n 'python runtests_bootstrap.py',\n 'python runtests_bootstrap3.py',\n 'python runtests_uniform.py',\n]\n\nfor cmd in cmds:\n retval = os.system(cmd)\n if retval:\n ... | python | edit | 1 | 0 | mit | e64acbdf756839adf28320641124ee696d38be54 | ngenovictor/django-crispy-forms,jtyoung/django-crispy-forms,VishvajitP/django-crispy-forms,davidszotten/django-crispy-forms,jtyoung/django-crispy-forms,schrd/django-crispy-forms,django-crispy-forms/django-crispy-forms,dzhuang/django-crispy-forms,davidszotten/django-crispy-forms,ngenovictor/django-crispy-forms,RamezIssa... | crispy_forms/tests/runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.typing\n~~~~~~~~~~~~~\n\nBYCEPS-specific type aliases for PEP 484 type hints\n\n:Copyright: 2006-2017 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom uuid import UUID\n\n\nUserID = UUID\... | python | edit | 1 | 0 | bsd-3-clause | 501bcb9aab561f9155857e1601a303374ae5698c | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/typing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Boxout module for Dribdat projects.\"\"\"\n\nimport pystache\n\nTEMPLATE_PROJECT = r\"\"\"\n<div class=\"onebox honeycomb\">\n <a href=\"{{link}}\"\n class=\"hexagon\n {{#is_challenge}}challenge{{/is_challenge}}\n ... | python | edit | 1 | 4 | mit | b66171d0b3d8cdf361f4341976d7eb0830fb38ce | loleg/dribdat,loleg/dribdat,loleg/dribdat,loleg/dribdat | dribdat/boxout/dribdat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import * # NOQA\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfrom django.contrib import admin\nfrom django.conf import settings\nimport django.views.static\n\nadmin.autodiscover()\n\nurlpatter... | python | edit | 6 | 0 | mit | c93a7d6536b2a88ecf8c831714531837f4febd1b | r0x73/django-template,r0x73/django-template,r0x73/django-template | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/urls.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom __future__ import unicode_literals\n\n\n__version__ = 1, 8, 3\nget_version = lambda: '.'.join(str(i) for i in __version__)\n__verbose_name__ = 'Dezède'\n\n```\n\nApply this change: Change le numéro de version pour 2.... | python | edit | 1 | 0 | bsd-3-clause | a7058352df6cd8c0e411df5e1b0948729f8ffe60 | dezede/dezede,dezede/dezede,dezede/dezede,dezede/dezede | dezede/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app_factory import db\nfrom models.session import Session\n\n\nclass User(db.Model):\n __tablename__ = 'users'\n id = db.Column(db.Integer, primary_key=True)\n name = db.Column('name', db.String(50))\n username = db.Column(... | python | edit | 3 | 2 | mit | 8f04b56a842fa1a84e704af3c5b724c14006315e | ganemone/ontheside,ganemone/ontheside,ganemone/ontheside | server/models/user.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -----------------------------------------------------------------------------\n\n__title__ = 'lamana'\n__version__ = '0.4.10'\n__author__ = 'P. Robinson II'\n__license__ = 'BSD3'\n__copyright__ = 'Copyright 2015 P. Robinson II'\n\n# DEPRE... | python | edit | 3 | 0 | bsd-3-clause | a6b2aeb6a6f28e6b5a00719a34454894f933288e | par2/lamana-test | lamana/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAn implementation of JSON Schema for Python\n\nThe main functionality is provided by the validator classes for each of the\nsupported JSON Schema versions.\n\nMost commonly, `validate` is the quickest way to simply validate a given\... | python | edit | 20 | 0 | mit | fe772c380c48eb14fc47bbd0a0c95888b9ea700a | Julian/jsonschema,Julian/jsonschema,python-jsonschema/jsonschema | jsonschema/__init__.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nAutocompletion example that displays the autocompletions like readline does by\nbinding a custom handler to the Tab key.\n\"\"\"\nfrom __future__ import unicode_literals\n\nfrom prompt_toolkit.shortcuts import... | python | edit | 1 | 1 | bsd-3-clause | caf554698fd55f2911742b2cdfb7f1579c0738a5 | jonathanslenders/python-prompt-toolkit | examples/prompts/autocompletion-like-readline.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef removed_user_deactivate(user):\n if user.is_active:\n user.is_active = False\n user.save()\n\n\ndef removed_user_delete(user):\n user.delete()\n\n```\n\nApply this change: Add callback to disable users by AD userAcco... | python | edit | 1 | 3 | bsd-3-clause | dfc885784a869dc3f3ef200557be4303aa2752e9 | jbittel/django-ldap-sync,alexsilva/django-ldap-sync,alexsilva/django-ldap-sync | ldap_sync/callbacks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nif __name__ == \"__main__\":\n run()\n\n```\n\nApply this change: Build interface w/ docopt and add POD"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"Simple Genetic Algorithm f... | python | edit | 1 | 1 | unlicense | 1f6cb706d16153814ff5821998f0fb9216357573 | dideler/intro-to-genetic-algorithms | src/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom .util import (DestructiveYubikeyTestCase, is_fips, ykman_cli)\n\n\nclass TestYkmanInfo(DestructiveYubikeyTestCase):\n\n def test_ykman_info(self):\n info = ykman_cli('info')\n self.assertIn('Device t... | python | edit | 1 | 1 | bsd-2-clause | f632c56310ce527d0773e64fed9fa4e7e0eae36a | Yubico/yubikey-manager,Yubico/yubikey-manager | test/on_yubikey/test_cli_misc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# libthumbor - python extension to thumbor\n# http://github.com/heynemann/libthumbor\n\n# Licensed under the MIT license:\n# http://www.opensource.org/licenses/mit-license\n# Copyright (c) 2011 ... | python | edit | 3 | 0 | mit | d478082c93125212f07a7b73e2d9d04d1b2c1058 | APSL/libthumbor,thumbor/libthumbor,DomainGroupOSS/libthumbor | libthumbor/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport collections\nimport re\n\nfrom data import crossword, warehouse\nfrom puzzle.problems.crossword import _base_crossword_problem\n\n_CROSSWORD_REGEX = re.compile(r'^.*\\(([\\d\\s,|]+)\\)$')\n_INTS = re.compile(r'(\\d+)')\n\n\nclass Cro... | python | edit | 1 | 6 | mit | c688a587d49d6186462737ab00c429a30c0a4d4c | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | src/puzzle/problems/crossword/crossword_problem.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nclass UnionFind(object):\n \"\"\"A collection of distjoint sets.\"\"\"\n\n def __init__(self, n = 0):\n \"\"\"Creates a collection of n disjoint unit sets.\"\"\"\n self.p = [-1]*n\n self.leaders = set( i for i i... | python | edit | 1 | 3 | bsd-3-clause | 1364470725a55232556d8856be7eb910f3376fb3 | PermutaTriangle/Permuta | permuta/misc/union_find.py | rejected_duplicate | Near-duplicate of sample 554 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom requests.exceptions import ConnectionError\n\n\nclass SmartFileException(Exception):\n pass\n\n\nclass SmartFileConnException(SmartFileException):\n \"\"\" Exception for issues regarding a request. \"\"\"\n def __init__(self, ... | python | edit | 1 | 3 | mit | 727f221767c662e95585f54e06c0c8b4e4a77d88 | smartfile/client-python | smartfile/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bs4 import BeautifulSoup\nfrom urllib.request import urlopen\nfrom urllib.request import Request\nfrom .const import constant\n\nclass BSOpener(object):\n \"\"\" A wrapper arround urllib and BeautifulSoup used a helper for url reque... | python | edit | 2 | 3 | mit | fb488a27b16943709327c7a9f31c26aba418055f | iluxonchik/lyricist | lyricist/bsopener.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Combinators of modules, such as a Sequential.\"\"\"\n\nfrom typing import Callable, Sequence\n\nfrom flax.linen.module import Module\n\nclass Sequential(Module):\n \"\"\"Applies a linear chain of Modules.\n\n Meant to be used only f... | python | edit | 1 | 3 | apache-2.0 | 02c74c5235b8ad821786213a3bcf5f824162454d | google/flax,google/flax | flax/linen/combinators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nimport requests\n\n\ndef send_message_android(destination, title, message):\n headers = {\n 'Authorization': 'key=' + settings.FIREBASE_SERVER_KEY,\n 'Content - Type': 'application/json'\n ... | python | edit | 3 | 4 | apache-2.0 | 7818f9aa2d66ab0f4a99f731ecfb03e711e9ad6c | belatrix/BackendAllStars | utils/send_messages.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport pika\n\n\nclass Publisher(object):\n\n def __init__(self, rabbit_url, exchange):\n self._rabbit_url = rabbit_url\n self._exchange = exchange\n self._connection = pika.BlockingConnection(pika.URLPa... | python | edit | 1 | 1 | mit | fc6b3df720ac05b715ae6478367f79e834c47c26 | projectweekend/Pi-Broadcast-Service | pi_broadcast_service/rabbit.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals, absolute_import\n\n\nclass SearchBackend(object):\n pass\n\n\nclass Field(object):\n \"\"\"\n Base class for any field.\n \"\"\"\n\n name = None\n\n def _... | python | edit | null | null | bsd-3-clause | e14ca7e0a71e558ae9d8327248012d8109f9e0c5 | niwinz/needlestack | needlestack/base.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pathlib import Path\n\nUSER_DIR = Path.expanduser(Path('~')).joinpath('.matchzoo')\nif not USER_DIR.exists():\n USER_DIR.mkdir()\nUSER_DATA_DIR = USER_DIR.joinpath('datasets')\nif not USER_DATA_DIR.exists():\n USER_DATA_DIR.mkdir... | python | edit | 28 | 0 | apache-2.0 | a39a91b406be3965addc613021f0c94007c42cf6 | faneshion/MatchZoo,faneshion/MatchZoo | matchzoo/__init__.py | rejected_lint | Too many lint violations: 28 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ------------------------------------------------------------\n# __main__.py\n#\n# The main program which expects a jiradoc formatted file to\n# be passed in as a cmdline option. It reads the file and\n# parses its content to Story objects... | python | edit | 4 | 3 | mit | 0043fe9c8de4d8341afbcea388f472a50017de2c | lucianovdveekens/jiradoc | jiradoc/__main__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom django.utils import timezone\n\nfrom salt_observer.models import Minion\nfrom . import ApiCommand\n\nimport json\n\n\nclass Command(ApiCommand, BaseCommand):\n help = 'Fetch and s... | python | edit | 3 | 4 | mit | c90e9798881630c2f956e08901f5bd35d948df6d | hs-hannover/salt-observer,hs-hannover/salt-observer,hs-hannover/salt-observer | salt_observer/management/commands/fetchpackages.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add enrichment function in gsa module"
},
{
"role": "assistant",
"content": "\"\"\"Gene Set Analysis Module\n\"\"\"\nfrom GeneSetCollection import GeneSetCollect\n\ndef enrichment(gene_list, gene_set, background, alternative=\"tw... | python | new_file | 7 | 2 | mit | 67c58e3941491d276318daf568354f1e17ef3892 | choyichen/omics | omics/gsa/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ==============================\n# Copyright 2011 Whamcloud, Inc.\n# ==============================\n\nfrom hydra_agent.plugins import AgentPlugin\n\n\ndef set_server_conf(args = None):\n import simplejson as json\n data = json.loads... | python | edit | 1 | 2 | mit | 0e6de6bc5890d6028a7115a62289bf26b0dd043b | intel-hpdd/intel-manager-for-lustre,intel-hpdd/intel-manager-for-lustre,intel-hpdd/intel-manager-for-lustre | hydra_agent/actions/server_conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n###\n# Copyright (c) 2012-2013, spline\n# All rights reserved.\n#\n#\n###\n\nimport supybot.conf as conf\nimport supybot.registry as registry\nfrom supybot.i18n import PluginInternationalization, internationalizeDocstring\n\n_ = PluginInter... | python | edit | 6 | 1 | mit | af2c9647e64ad0e0575b191e35e38f8bf23ed6f8 | cottongin/NFL,fasteddie2/NFL,reticulatingspline/NFL | config.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\ndynmen - A simple python interface to dynamic menus like dmenu or rofi\n\nimport dynmen\nmenu = dynmen.Menu(['dmenu', '-fn', 'Sans-30'])\noutput = menu({'a': 1, 'b': 2, 'c': 3})\n\nYou can make the menu non-... | python | edit | 6 | 1 | mit | 637c19a54c6bee656ba3effd9316ad3d5587a963 | frostidaho/dynmen | src/dynmen/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, date\n\nfrom sqlalchemy import Integer, UnicodeText, Float, BigInteger\nfrom sqlalchemy import Boolean, Date, DateTime, Unicode\nfrom sqlalchemy.types import TypeEngine\n\n\nclass Types(object):\n \"\"\"A h... | python | edit | 1 | 7 | mit | d51fcb604f9e4a0f9b7d4178d4c85209594afbde | pudo/dataset | dataset/types.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.