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\"\"\"\nThe manager class for the CMS models\n\"\"\"\nfrom datetime import datetime\nfrom django.db import models\nfrom django.db.models.query import QuerySet\nfrom django.db.models.query_utils import Q\n\n\nclass EntryQuerySet(QuerySet):\n... | python | edit | 1 | 1 | apache-2.0 | 14dcd8789c764743cfcb2e7a7b9b7d33b21a2779 | edoburu/django-fluent-blogs,edoburu/django-fluent-blogs | fluent_blogs/models/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport IPython\n\nimport ts_charting.lab.lab as tslab\nimport ipycli.standalone as sa\n\nfrom workbench import sharedx\n\nclass ID3Lab(tslab.Lab):\n def get_varname(self):\n \"\"\"\n Try to get the variable that this lab is... | python | edit | 1 | 4 | apache-2.0 | 65be9926d1e6d769fcf6d88a6a9788791beef187 | dalejung/id3lab,dalejung/id3lab | id3lab/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom src.circular.template.interpolatedstr import InterpolatedStr\nfrom src.circular.template.context import Context\nfrom tests.utils import TObserver\n\n\n\n\ndef test_string_interp():\n ctx = Context()\n ctx.name = \"James\"\n s... | python | edit | 3 | 1 | mit | f0871086222be67ba4add4574cf03d3cb9d39d63 | jonathanverner/circular,jonathanverner/circular,jonathanverner/circular | tests/circular/template/test_interpolatedstr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom classytags.core import Tag, Options\nfrom django import template\nfrom django.core.serializers.json import DjangoJSONEncoder\nfrom django.utils import simplejson\nfrom django.utils.text import javascript_quote\... | python | edit | 1 | 2 | bsd-3-clause | 7ce48df1dc525b214a5993853d313d7e1ab6050d | wyg3958/django-cms,cyberintruder/django-cms,josjevv/django-cms,jproffitt/django-cms,webu/django-cms,mkoistinen/django-cms,czpython/django-cms,ojii/django-cms,memnonila/django-cms,Jaccorot/django-cms,11craft/django-cms,mkoistinen/django-cms,isotoma/django-cms,jsma/django-cms,bittner/django-cms,jproffitt/django-cms,intgr... | cms/templatetags/cms_js_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef get_referrer_from_request(request):\n # determine what source led the user to the export directory\n # if navigating internally then return None\n return 'aaa'\n\n```\n\nApply this change: Add TODO to comment in registration he... | python | edit | 1 | 1 | mit | 27c451c8490e0f70ceb96327bc6d2aeb29605a40 | uktrade/directory-ui-supplier,uktrade/directory-ui-supplier,uktrade/directory-ui-supplier | ui/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Activity(models.Model):\n group = models.CharField(max_length=4)\n grouptype = models.TextField()\n groupdetail = models.TextField()\n details = models.TextField()\n disabled = models.Boo... | python | edit | 1 | 1 | bsd-3-clause | 4aa1623e08519127a06f49060d546c5ef18e906c | AeroNotix/django-timetracker,AeroNotix/django-timetracker,AeroNotix/django-timetracker | vcs/models.py | rejected_duplicate | Near-duplicate of sample 1122 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numba\n\n\ndef selfparams(f):\n def wrapped_func(obj, x1, x2):\n return f(x1.astype('f8', copy=False),\n x2.astype('f8', copy=False),\n *obj.params)\n wrapped_func.__name__ = f.__name__\n ... | python | edit | 1 | 2 | mit | 5a12255e0af4666a5a197bad94e2cbfe4229a310 | jhamrick/gaussian_processes,jhamrick/gaussian_processes | src/kernels/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n###################################################################################################\n#\n# chrome_extensions.py\n# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field\n#\n# ... | python | edit | 1 | 8 | apache-2.0 | 6018abc4a1c2dfa139bb104ae6db69fef5994ff6 | obsidianforensics/hindsight,obsidianforensics/hindsight | plugins/chrome_extensions.py | rejected_duplicate | Near-duplicate of sample 21059 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport json\n\nfrom django.http import HttpResponse\nfrom django.views.decorators.csrf import csrf_exempt\n\nfrom . import actions\n\n\ndef info(request, uuid):\n \"\"\"\n Return the Twillio ML that we generated when the us... | python | edit | 1 | 1 | mit | 1b23ca7327d5414233222fdb26c1c1e88d0137a6 | takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web | takeyourmeds/telephony/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pylint: disable=C0111\nimport pytest\nimport os\nimport tarfile\n\nBASEDIR = os.path.dirname(__file__)\n\n\n@pytest.fixture(autouse=True)\ndef set_up(tmpdir):\n#\tprint BASEDIR\n\ttmpdir.chdir()\n\ttar = tarfile.open(os.path.join(BASEDIR,... | python | edit | 1 | 1 | mit | 1c12843b251184d3e683d9cebf9948565bbfe518 | bilderbuchi/ofStateManager | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns\nfrom django.core import urlresolvers\n\nclass Router(object):\n \"\"\"\n Convenient wrapper around Django's urlresolvers, allowing them to be used \n from normal application code.\n\n... | python | edit | 1 | 1 | bsd-2-clause | b7b0724b7f663a8a0d0e5c46d66f42726d700f45 | simonw/djng | djng/router.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\ndef main():\n\n # print the header of output csv file\n print 'business_id,city,latitude,longitude'\n\n # for each entry in input json file print one csv row\n for line in open(\"data/yelp_academic_dataset_busines... | python | edit | 3 | 2 | mit | 88b198ff1de67d675b81c736eceeb7a2308851db | aysent/yelp-photo-explorer | json2csv_business.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\"\"\"\nfrom penn_chime.parameters import Parameters\n\n\ndef test_cli_defaults():\n \"\"\"Ensure if the cli defaults have been updated.\"\"\"\n # TODO how to make this work when the module is installed?\n _ = Parameters.crea... | python | edit | 1 | 1 | mit | e4717e8017b9a476db1ed016c19d883cd786c7ce | CodeForPhilly/chime,CodeForPhilly/chime,CodeForPhilly/chime | tests/penn_chime/test_parameters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport bluePoV\nimport pygame\n\nx,y = (480,64)\nMAC = \"00:00:00:00:00:00\"\n\npygame.init()\npygame.display.set_mode((x,y))\n\ns = pygame.display.get_surface()\n\ndriver = bluePoV.Driver([x,y],1)\n\n#driver.connect(MAC)\n\ns.fill([0,255,0... | python | edit | 1 | 0 | mit | 97e048d0a743808ab0ec62b39306940b59dd3c8a | ABorgna/BluePoV-PC,ABorgna/BluePoV-PC,ABorgna/BluePoV-PC | test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests.adapters\n\n\nclass BaseHTTPAdapter(requests.adapters.HTTPAdapter):\n def close(self):\n self.pools.clear()\n\n```\n\nApply this change: Fix BaseHTTPAdapter for the SSL case\n\nSigned-off-by: Ulysses Souza <<EMAIL>... | python | edit | 1 | 2 | apache-2.0 | 89485bf26ebb7cf4570549cda42543061d6b4fd7 | docker/docker-py,funkyfuture/docker-py,funkyfuture/docker-py,vdemeester/docker-py,vdemeester/docker-py,docker/docker-py | docker/transport/basehttpadapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Server extension for JupyterLab.\"\"\"\n\n# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\ntry:\n from ._version import __version__\nexcept ImportError as e:\n # when we ar... | python | edit | 5 | 1 | bsd-3-clause | 853490b9d89b6e72d3b3f0e83fa2edb17d684547 | jupyter/jupyterlab,charnpreetsingh185/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,eskirk/jupyterlab,jupyter/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,charnpreetsingh185/jupyterlab,esk... | jupyterlab/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Stdlib imports\n# E.g.: from math import sqrt\n\n# Core Django imports\nfrom django.contrib.auth.decorators import login_required\nfrom django.shortcuts import redirect, render\n\n# Third-party app imports\n# E.g.: from django_extensions.... | python | edit | 1 | 4 | apache-2.0 | 60c0f2b74d7459b955da28ff16f67db1e81f5789 | nimiq/moogle-project | moogle/search/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport lz4.frame as lz4frame\nimport pytest\n\ndef test_create_compression_context():\n context = lz4frame.create_compression_context()\n assert context != None\n\ndef test_create_decompression_context():\n context = lz4frame.creat... | python | edit | 4 | 1 | bsd-3-clause | 357db324df4b1bd8444c4bf2b89d210e968c8cd7 | python-lz4/python-lz4,python-lz4/python-lz4 | tests/frame/test_frame_1.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cutplanner\nimport unittest\n\nclass TestPlanner(unittest.TestCase):\n\n def setUp(self):\n sizes = [80, 120]\n needed = [10, 25, 75]\n loss = 0.25\n self.planner = cutplanner.Planner(sizes, needed, los... | python | edit | 1 | 1 | mit | ff4b34cda7c0b5bc516d9f9e3689818000301336 | alanc10n/py-cutplanner | tests/test_planner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import request, Blueprint, Response\nfrom flask import current_app\nimport json\n\n# This is the blueprint object that gets registered into the app in blueprints.py.\ngeneral = Blueprint('general', __name__)\n\n\n@general.route(\... | python | edit | 1 | 1 | mit | b4d86431806cc9ce3019aa65db2a3b22c2bd4ac3 | matthew-shaw/thing-api | flask_skeleton_api/views/general.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nimport serial\nimport matplotlib.pyplot as plt\nimport csv\nimport os\nimport brewkettle\nreload(brewkettle)\n\nfilename = time.strftime(\"%Y-%m-%d %H:%M\") + \".csv\"\npath = os.path.join(\"data\", filename)\nf = open(path, \"... | python | edit | 4 | 0 | mit | 34a3bf209c1bb09e2057eb4dd91ef426e3107c11 | beercanlah/ardumashtun,beercanlah/ardumashtun | monitor_temperature.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\n\ndef arrayManipulation(n, queries):\n array = [0] * n\n for a, b, k in queries:\n # Start is a - 1 because this is a one indexed array\n ... | python | edit | 6 | 5 | mit | a1679be616d6d0d6ee807a708690549ec1798d04 | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | python/array_manipulation.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nJob metadata stored along side the code\n\"\"\"\n\nfrom yaml_model import LoadOnAccess, Model, OnAccess\n\n\ndef get_job(slug):\n \"\"\"\n Wrapper to import, and return a Job object for the JobConfig to avoid\n cyclic impor... | python | edit | 1 | 1 | isc | 14e39e28c22da59049feeae0efd1a9fa2bfb51e6 | sprucedev/DockCI-Agent,sprucedev/DockCI-Agent | dockci/models/job_meta/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom __future__ import absolute_import, unicode_literals\n\nfrom django.db.models import QuerySet, Q\nfrom django.utils import timezone\n\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\nclass SessionTokenQueryS... | python | edit | 1 | 4 | mit | e1df9380be8891c813a8c87e8d8175393171ac17 | namespace-ee/django-rest-framework-sso,namespace-ee/django-rest-framework-sso | rest_framework_sso/querysets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\n\nfrom symposion.reviews.models import ReviewAssignment\n\n\nregister = template.Library()\n\n\n@register.assignment_tag(takes_context=True)\ndef review_assignments(context):\n request = context[\"request\"]\... | python | edit | 1 | 1 | mit | f748ed437bb37e10433d0ca1e695122b2c799a15 | pydata/conf_site,pydata/conf_site,pydata/conf_site | symposion/reviews/templatetags/review_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nDATABASES = {\n 'default': {\n 'ENGINE': 'sqlite3',\n 'NAME': ':memory:'\n }\n}\n\nMIDDLEWARE_CLASSES = [\n 'fandjango.middleware.FacebookMiddleware'\n]\n\nINSTALLED_APPS = [\n 'fandjango',\n 'south',\n 'test... | python | edit | 1 | 0 | mit | 253daeb2e826a9fe87cd93c9bc1a2060d9b8fead | jgorset/fandjango,jgorset/fandjango | tests/project/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport unittest\nimport sys\n\n# This line allows the tests to run if you just naively run this script.\n# But the preferred way is to use run_tests.sh\nsys.path.insert(0,'../MultiQC')\n\nfrom multiqc.modules.ccs.c... | python | edit | 1 | 1 | mit | cd996486b25ab35369994a4470f795ae31e06a9c | ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData | unit_tests/test_ccs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: <EMAIL>\n# Documentation: http://scripting101.stoeps.de\n#\n# Version: 2.0\n# Date: 2014-06-04\n#\n# License:... | python | edit | 5 | 0 | apache-2.0 | 50ba0c2c576a4b9eddaa64537dadfd8684463794 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ibmcnx/doc/DataSources.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"\n\nfrom django.test import TestCase\n\n\ncla... | python | edit | 1 | 1 | bsd-3-clause | 9a52024ff5b8175ee8b8d4665d3c8c667003019b | developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter,developersociety/django-glitter,blancltd/django-glitter,blancltd/django-glitter | glitter/blocks/redactor/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport bottle\nimport waitress\nimport controller\nimport breathe\nfrom pytz import timezone\nfrom apscheduler.schedulers.background import BackgroundScheduler\n\nbottle_app = bottle.app()\nscheduler = BackgroundScheduler()\nscheduler.confi... | python | edit | 1 | 1 | mit | 0b296bdef138ffc48363745e39d0d605e81b24cc | tipsqueal/duwamish-lighthouse,tipsqueal/duwamish-lighthouse,illumenati/duwamish-lighthouse,illumenati/duwamish-lighthouse,YonasBerhe/duwamish-lighthouse | server.py | rejected_duplicate | Near-duplicate of sample 12377 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport web\nimport cPickle as pickle\nimport json\n\nurls = (\n '/latest', 'latest',\n '/history', 'history'\n)\n\nclass latest:\n def GET(self):\n try:\n latest = pickle.load(open(\"latest.p\", \"r\"))\n ... | python | edit | 1 | 2 | mit | 0fa002e66f82eff593514c2249c4229604ec0f0a | martindisch/SensorTag,martindisch/SensorTag,martindisch/SensorTag,martindisch/SensorTag | server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import annotations\nfrom typing import List, Optional\n\nfrom sipa.model.pycroft.unserialize import unserializer\n\n\n@unserializer\nclass UserData:\n id: int\n user_id: str\n login: str\n ... | python | edit | 1 | 0 | mit | 36ac84a0c8967b994242903a4cd404eac33af381 | MarauderXtreme/sipa,agdsn/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa | sipa/model/pycroft/schema.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nGenerate nice plots providing additional information\n\"\"\"\nimport sys\n\nimport numpy as np\nimport matplotlib.pylab as plt\n\n\ndef neural_spike():\n \"\"\" Plot various neural spikes\n \"\"\"\n def do_plot(cell_evo):\n... | python | edit | 1 | 3 | mit | d936f53ae422fab360f5e1cd62f7114d91ba270c | kpj/PyWave | extra_plots.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\n\nparser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)\nparser.add_argument('-x', metavar='nameofx',... | python | edit | 1 | 0 | mit | 6c922f593dba7f3604763bbb489a910dee4c915a | SnoopJeDi/dotfiles,SnoopJeDi/dotfiles,SnoopJeDi/dotfiles | .vim/templates/argparse.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tastypie.resources import ModelResource\nfrom models import Event\n\nfrom mozcal.base.serializers import MozcalSerializer\n\n\nclass EventResource(ModelResource):\n class Meta:\n queryset = Event.objects.all()\n filtering = {\n ... | python | edit | 1 | 0 | bsd-3-clause | b382c57e84d239f3f239f9e2587a3559e704f071 | yvan-sraka/wprevents,yvan-sraka/wprevents,yvan-sraka/wprevents,ppapadeas/wprevents,ppapadeas/wprevents,ppapadeas/wprevents,yvan-sraka/wprevents | mozcal/events/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Tests for the clustering computation \"\"\"\nfrom nose.tools import *\nimport marble as mb\n\n\n# Test c = 0 in the checkerboard case\n# Test c = 1 in the fully clustered case\n# Test an intermediate situation with known result\n\n\n... | python | edit | 3 | 3 | bsd-3-clause | 3d1521892ba17120ca4461335713b9d2254311fe | walkerke/marble,scities/marble | marble/tests/test_clustering.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom girder.api import access\nfrom girder.api.describe import Description, autoDescribeRoute\nfrom girder.api.rest import Resource, RestException\nfrom girder.constants import AccessType, TokenScope\nfrom girder.models.setting import Setti... | python | edit | 5 | 3 | bsd-3-clause | b556bffeb5ed48812258b452e05cc00cfb160453 | OpenChemistry/mongochemserver | girder/app/app/configuration.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management import BaseCommand\nfrom django_pyowm.models import Location\nfrom pyowm.webapi25.location import Location as LocationEntity\n\nfrom weather_api.weather.singletons import owm\n\n\nclass Command(BaseCommand):\n ... | python | edit | 1 | 4 | mit | 3ad640e7881903caaa9faee12aaedf9990881513 | dimka2014/weather-api,dimka2014/weather-api | weather_api/weather/management/commands/save_locations_to_database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python3\n# Python Challenge - 6\n# http://www.pythonchallenge.com/pc/def/channel.html\n# http://www.pythonchallenge.com/pc/def/channel.zip\n# Keyword: hockey -> oxygen\n\nimport re\nimport zipfile\n\n\ndef main():\n '''\... | python | edit | 1 | 3 | mit | 71eeb919373787569034225e8047079075df5569 | HKuz/PythonChallenge | Challenges/chall_06.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport glob\n\nfrom django.apps import apps\nfrom django.db import connection\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCommand):\n \"\"\"\n Turn off auto system check for all apps\n We ... | python | edit | 1 | 2 | bsd-3-clause | 610fb9c9ac6a225df10ec770d44564e61af53ce0 | chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/addressbase/management/commands/import_cleaned_addresses.py | rejected_duplicate | Near-duplicate of sample 21317 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# set debug to False on non prod env\nIS_DEV = True\n\n# profile speed of methods and output it to terminal\nPROFILE_METHODS = False\n\n# set to false if you want to disable accessing redis\nCACHE_DATA = True\n\n```\n\nApply this change: Re... | python | edit | 1 | 0 | mit | 30c2463fbe5c14273bd23d05ac2d97450285132e | SAAVY/magpie,SAAVY/magpie | client/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .user.sequential_taskset import SequentialTaskSet\nfrom .user.task import task, TaskSet\nfrom .user.users import HttpUser, User\nfrom .event import Events\nfrom .wait_time import between, constant, constant_pacing\n\nevents = Events()\... | python | edit | 10 | 0 | mit | 7316d1cb953812ae0286d59d1abc014b2f90794b | locustio/locust,mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,locustio/locust,mbeacom/locust,locustio/locust | locust/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy.orm.exc import NoResultFound\nfrom .storage import (\n DBSession,\n UserMap,\n )\n\n\ndef groupfinder(login, request):\n if ':' not in login:\n return None\n namespace, localname = login.split(':', 1)\n... | python | edit | 3 | 7 | mit | dfbae8fd2f2346ecf7bb1e04c9c43c18e4da234d | kidaa/encoded,philiptzou/clincoded,ENCODE-DCC/snovault,T2DREAM/t2dream-portal,hms-dbmi/fourfront,hms-dbmi/fourfront,ClinGen/clincoded,ENCODE-DCC/snovault,ClinGen/clincoded,ENCODE-DCC/encoded,T2DREAM/t2dream-portal,philiptzou/clincoded,T2DREAM/t2dream-portal,4dn-dcic/fourfront,kidaa/encoded,kidaa/encoded,T2DREAM/t2dream... | src/encoded/authorization.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test that get last record method"
},
{
"role": "assistant",
"content": "from unittest import TestCase\nfrom unittest.mock import (\n Mock,\n patch,\n)\n\nimport requests.exceptions\n\nfrom py_nist_beacon import NistRandomne... | python | new_file | 1 | 2 | apache-2.0 | 6d333d74d75c346c922dc65d8e311b4d976a9dd6 | urda/nistbeacon | tests/test_NistRandomnessBeacon.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom werkzeug.security import generate_password_hash, check_password_hash\n\nclass User(object):\n \"\"\"represents a user who can CRUD his own bucketlists\"\"\"\n\n users = {}\n\n def __init__(self, email, username, password):\n ... | python | edit | 4 | 1 | mit | c4880ef0350d7cf58d9dff344f98f3b3096f2613 | borenho/flask-bucketlist,borenho/flask-bucketlist | this_app/models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\nfrom numpy.distutils.cpuinfo import cpu\nfrom numpy.distutils.fcompiler import FCompiler\n\nclass NAGFCompiler(FCompiler):\n\n compiler_type = 'nag'\n version_pattern = r'NAGWare Fortran 95 compiler Release (... | python | edit | 2 | 2 | bsd-3-clause | 8cfbbe13d9a2c94529e2d2c06a8e154d9892c8c4 | mingwpy/numpy,rmcgibbo/numpy,jakirkham/numpy,githubmlai/numpy,BabeNovelty/numpy,pizzathief/numpy,ogrisel/numpy,astrofrog/numpy,andsor/numpy,cowlicks/numpy,rhythmsosad/numpy,simongibbons/numpy,felipebetancur/numpy,stefanv/numpy,GrimDerp/numpy,CMartelLML/numpy,githubmlai/numpy,pyparallel/numpy,madphysicist/numpy,Dapid/nu... | numpy/distutils/fcompiler/nag.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom skidl import *\nfrom .setup_teardown import *\n\ndef test_parser_1():\n netlist_to_skidl(r'C:\\xesscorp\\KiCad\\tools\\skidl\\tests\\Arduino_Uno_R3_From_Scratch.net')\n\n```\n\nApply this change: Fix remaining absolut... | python | edit | 7 | 1 | mit | 1c07b3b29c18147578c94a21abf6c34647a7185d | xesscorp/skidl,xesscorp/skidl | tests/test_parse.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom three import Three\n\nfrom django.core.urlresolvers import reverse\nfrom django.http import Http404\n\nfrom .base import APIView\n\n\nQC_three = Three(\n\tendpoint = \"http://dev-api.ville.quebec.qc.ca/open311/v2/\",\n\tformat = \"json... | python | edit | 1 | 2 | mit | 85db14b8584995da667c92cda6a44e2b3395250e | ironweb/lesfeuxverts-backend | greenlight/views/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\n\nfrom ..interface import TableLoaderInterface\n\n\nclass TableLoaderManager(TableLoaderInterface):\n\n def __ini... | python | edit | 1 | 2 | mit | 192c7b01a34c3b9200005744790b63bcd7a7333c | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | pytablereader/loadermanager/_base.py | rejected_duplicate | Near-duplicate of sample 11799 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Django-Prometheus\n\nhttps://github.com/korfuri/django-prometheus\n\"\"\"\n\n# Import all files that define metrics. This has the effect that\n# `import django_prometheus` will always instanciate all metric\n# objects right away.\nimp... | python | edit | 4 | 0 | apache-2.0 | 57170909979d89c6887fde80510855c2ea4770e9 | obytes/django-prometheus,obytes/django-prometheus,korfuri/django-prometheus,korfuri/django-prometheus | django_prometheus/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndata = []\n\ndef plot(x, y, label=None):\n d = {\n \"data\": zip(x, y),\n }\n if label:\n d[\"label\"] = label\n data.append(d)\n\ndef show():\n from plotserver.runserver import main\n main()\n\ndef grid(... | python | edit | 1 | 2 | mit | 8b916c0d4b45427f4820bb63fcccc085375c405a | certik/jsplot,certik/jsplot | jsplot/plot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"kokekunster URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from my_app... | python | edit | 1 | 0 | mit | 478eb4908874167c472eed120d7ba49c737114e9 | afriestad/WikiLinks,afriestad/WikiLinks,afriestad/WikiLinks | kokekunster/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Prepare update Master to 0.12.0"
},
{
"role": "assistant",
"content": "# This is the only location where the version will be written and changed.\n# Based on https://packaging.python.org/single_source_version/\n__version__ = '0.1... | python | new_file | 1 | 0 | mit | 9abce17371ac1b2a0e29a90b39ce8560f05bf47e | gwtsa/gwtsa,pastas/pastas,pastas/pasta | pastas/version.py | rejected_duplicate | Near-duplicate of sample 1794 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\nurlpatterns = patterns('apps.auth.views',\n #\n # Authentication and Registration URLs\n #\n\n # Registration\n url(r'^register/activate/(?P<key>[a-zA-Z0-9]+)/$', 'activate', name... | python | edit | 1 | 0 | bsd-3-clause | 2d0ad125a63592fc64c52432fc8e697c681f465c | EVE-Tools/element43,EVE-Tools/element43 | webapp/element43/apps/auth/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (0, 9, 0, \"a\", 1) # following PEP 386\n\n\ndef get_version():\n version = \"%s.%s\" % (VERSION[0], VERSION[1])\n if VERSION[2]:\n version = \"%s.%s\" % (version, VERSION[2])\n if VERSION[3] != \"f\":\n ver... | python | edit | 1 | 4 | mit | fae501041857f1e4eea2b5157feb94a3f3c84f18 | amarandon/pinax,amarandon/pinax,amarandon/pinax,amarandon/pinax | pinax/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nHOST = ''\nPORT = 4080\n\ndef mia_server_start():\n pass\n\nif __name__ == \"__main__\":\n mia_server_start()\n\n```\n\nApply this change: Add python mia server UDP loop"
},
{
"role": "assistant",
"c... | python | edit | 5 | 6 | mit | 9a23ef917dbd22ad30237ca51ed4d5d43b1bfa4d | SteffenBauer/mia_elixir,SteffenBauer/mia_elixir | python/mia_server.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/env python\n#\n# Description:\n# Check if a glideinFrontend is running\n# \n# Arguments:\n# $1 = config file\n#\n# Author:\n# Igor Sfiligoi Jul 17th 2008\n#\n\nimport sys,os.path\nsys.path.append(os.path.join(sys.path[0],\"../l... | python | edit | 3 | 0 | bsd-3-clause | 55d372b4887bc9461d9e5ea958a5703ed19bdcae | holzman/glideinwms-old,bbockelm/glideinWMS,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS | frontend/checkFrontend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_comman... | python | edit | 1 | 0 | bsd-3-clause | ab3b2e9a681740159897ef8592c4f891df791119 | wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai | publisher_test_project/manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass Podcast(models.Model):\n title = models.CharField(max_length=100, blank=True)\n link = models.URLField(blank=True)\n feed = models.URLField()\n description = models.CharField(max_length=20... | python | edit | 1 | 2 | mit | daeda47aa33abad38f8f93ef9dde261809171c9b | matachi/sputnik,matachi/sputnik,matachi/sputnik,matachi/sputnik | podcasts/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .cli.info import info as cli_info\nfrom .glossary import explain\nfrom .deprecated import resolve_load_name\nfrom .about import __version__\nfrom . import util\n\n\ndef load(na... | python | edit | 4 | 1 | mit | e49cd7aeaf81ed12490d82b8a65ca93088ec916e | aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,recognai/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,recognai/spaCy,honnibal/spaCy,honnibal/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,recognai/spaC... | spacy/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\nfrom apscheduler.schedulers.blocking import BlockingScheduler\nimport logging\nimport subprocess\n\nlogging.basicConfig()\njob_defaults = {\n 'coalesce': False,\n 'max_instances': 2\n}\nscheduler... | python | edit | 1 | 1 | mit | 5b1eee618e57cd3cd84df4b819ef69876db55ddf | oinume/lekcije,oinume/lekcije,oinume/lekcije,oinume/lekcije,oinume/lekcije,oinume/lekcije | clock.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nimport random\nimport importlib\n\ndef get_joke(category='neutral', language='en'):\n \"\"\"\n Parameters\n ----------\n category: str\n Choices: 'neutral', 'explicit', 'chuck', 'al... | python | edit | 2 | 3 | bsd-3-clause | 215746e2fd7e5f78b6dae031aae6a935ab164dd1 | borjaayerdi/pyjokes,birdsarah/pyjokes,pyjokes/pyjokes,bennuttall/pyjokes,trojjer/pyjokes,gmarkall/pyjokes,martinohanlon/pyjokes,ElectronicsGeek/pyjokes | pyjokes/pyjokes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Allow usage directly from the code (fix the _version import)"
},
{
"role": "assistant",
"content": "import warnings\n\nfrom .loader import append_feed, delete_feed, overwrite_feed, list_feeds\nfrom .schedule import Schedule\n\ntr... | python | new_file | 7 | 0 | mit | c54240e6d9f6393370fe94f2cd05476680cf17f2 | jarondl/pygtfs | pygtfs/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render, redirect\nfrom django.conf import settings\nfrom django.views import View\nfrom members.programmes import DEGREE_PROGRAMME_CHOICES\nfrom registration.forms import RegistrationForm\nfrom registration.mail... | python | edit | 1 | 3 | mit | c9880fa56a6667d79bfc28fe4091f1cdbf3b2210 | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | teknologr/registration/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\n\nfrom django.conf import settings\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\n\n\nclass Milestone(models.Model):\n date = models.DateTimeField()\n\n\n@python_2_unicode_c... | python | edit | 1 | 1 | bsd-2-clause | 2e941cf1f6208b9ac2f6039681c24502b324ab5f | mblayman/lcp,mblayman/lcp,mblayman/lcp | planner/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurren... | python | edit | 6 | 5 | mit | fd5810c86f5998c2e2a7b96f09e82b40fbe2cc11 | derekmpham/interview-prep,derekmpham/interview-prep | string/first-str-substr-occr.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\nReturn data to the host operating system's syslog facility\n\nRequired python modules: syslog, json\n\nThe syslog returner simply reuses the operating system's syslog\nfacility to log return data\n\nTo use the ... | python | edit | 1 | 2 | apache-2.0 | 0994fb6a8c924e907151764f9c1eaa19f2c3aea7 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/returners/syslog_return.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nimport nipap\n\nlong_desc = open('README.rst').read()\nshort_desc = long_desc.split('\\n')[0].split(' - ')[1].strip()\n\nsetup(\n name = 'nipap',\n version = nipap.__version... | python | edit | 1 | 0 | mit | b4fbb4784b61001cc29c311e3b50c3fad3c60ef0 | SpriteLink/NIPAP,garberg/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,fredsod/NIPAP,fredsod/NIPAP,bbaja42/NIPAP,garberg/NIPAP,SpriteLink/NIPAP,ettrig/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,ettrig/NIPAP,garberg/NIPAP,SpriteLink/NIPAP,garberg/NIPAP,plajjan/NIPAP,plajjan/NIPAP,SoundGoof/NIPAP,plajjan/NIPAP,bbaja42/NIPAP,bbaja42... | nipap/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom pages.models import *\nfrom django.test.client import Client\n\nclass PagesTestCase(TestCase):\n fixtures = ['tests.json']\n\n def test_01_add_page(self):\n \"\"\"\n Test that the a... | python | edit | 2 | 1 | bsd-3-clause | 2fc13f58d8deba0f34c1e33ed78884630e8a7804 | akaihola/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,remik/django-page-cms,oliciv/django-page-cms,oliciv/django-page-cms,pombredanne/django-page-cms-1,remik/django-page-cms,pombredanne/django-page-cms-1,oliciv/django-page-cms,remik/django-page-cms,ba... | pages/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom django.test import RequestFactory\n\nfrom {{ cookiecutter.project_slug }}.users.api.views import UserViewSet\nfrom {{ cookiecutter.project_slug }}.users.models import User\n\npytestmark = pytest.mark.django_db\n\n\nclass... | python | edit | null | null | bsd-3-clause | 8aeee881bb32935718e767114256179f9c9bf216 | ryankanno/cookiecutter-django,ryankanno/cookiecutter-django,pydanny/cookiecutter-django,pydanny/cookiecutter-django,trungdong/cookiecutter-django,trungdong/cookiecutter-django,ryankanno/cookiecutter-django,pydanny/cookiecutter-django,pydanny/cookiecutter-django,ryankanno/cookiecutter-django,trungdong/cookiecutter-djang... | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport functools, time, unittest\nfrom bibliopixel.util.threads import sub\n\nWAIT_FOR_SUB = 0.1\n\n\ndef pause(delay=0.01):\n time.sleep(delay)\n\n\ndef run(input, output, *arg, **kwds):\n pause()\n\n output.put('first')\n\n if... | python | edit | 3 | 3 | mit | 2bf5809b651bc85e922c853d2dab27d35fee85b8 | ManiacalLabs/BiblioPixel,rec/BiblioPixel,rec/BiblioPixel,ManiacalLabs/BiblioPixel,rec/BiblioPixel,rec/BiblioPixel,ManiacalLabs/BiblioPixel,ManiacalLabs/BiblioPixel | test/bibliopixel/threads/sub_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom .models import Listing, HousingUser\n\nclass ListingForm(forms.ModelForm):\n furnished_details = forms.CharField(widget=forms.Textarea(attrs={\n \"placeholder\": \"Example: bed and desk only\"}))\n ... | python | edit | 1 | 0 | mit | 77136f1c7dc6159a040c17cf5143bea14e9462b3 | xyb994/housing,xyb994/housing,xyb994/housing,xyb994/housing | housing/listings/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Pykeg main settings file.\n# Note: YOU SHOULD NOT NEED TO EDIT THIS FILE. Instead, see the instructions in\n# common_settings.py.example.\n\nINSTALLED_APPS = (\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.... | python | edit | 4 | 0 | mit | a1bfb35bb5865cc45aded58b7cffab6da7cc0baf | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | pykeg/settings.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef set_defaults(app, *defaults):\r\n \"Installs a set of default values during syncdb processing\"\r\n from django.core.exceptions import ImproperlyConfigured\r\n from django.db.models import signals\r\n from dbsettings.loading... | python | edit | 2 | 6 | bsd-3-clause | ed71dc1e9163c5a7a7b0f623ea75393286804138 | johnpaulett/django-dbsettings,nwaxiomatic/django-dbsettings,MiriamSexton/django-dbsettings,DjangoAdminHackers/django-dbsettings,zlorf/django-dbsettings,nwaxiomatic/django-dbsettings,sciyoshi/django-dbsettings,helber/django-dbsettings,DjangoAdminHackers/django-dbsettings,helber/django-dbsettings,zlorf/django-dbsettings,... | dbsettings/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom django.core.management.base import BaseCommand\nfrom django.conf import settings\nfrom popuparchive.client import Client\n\nfrom ...models import Transcript\nfrom ...tasks import process_transcript\n\n\nlogger = logging... | python | edit | 1 | 4 | mit | 509ca9c2cad65b47e1a2a16a0c169434620b8c74 | WGBH/FixIt,WGBH/FixIt,WGBH/FixIt | mla_game/apps/transcript/management/commands/scrape_archive.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n''' Define standard warning codes and messages for Bokeh validation checks.\n\n1000 : *MISSING_RENDERERS*\n A |Plot| object has no renderers configured (will result in a blank plot).\n\n1001 : *NO_GLYPH_RENDERERS*\n A |Plot| object ha... | python | edit | 1 | 0 | bsd-3-clause | 4927a1c29d258b1ab7c70ffecff6904b808480eb | ericmjl/bokeh,timsnyder/bokeh,draperjames/bokeh,philippjfr/bokeh,mindriot101/bokeh,aavanian/bokeh,aavanian/bokeh,phobson/bokeh,daodaoliang/bokeh,KasperPRasmussen/bokeh,rothnic/bokeh,dennisobrien/bokeh,phobson/bokeh,DuCorey/bokeh,timsnyder/bokeh,jplourenco/bokeh,ericdill/bokeh,srinathv/bokeh,bokeh/bokeh,srinathv/bokeh,j... | bokeh/validation/warnings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2012 Cloudbase Solutions Srl\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# ... | python | edit | 1 | 2 | apache-2.0 | eeaa4251234cfbbefc8f24e7cba22d330d98eefc | alexpilotti/cloudbase-init,ader1990/cloudbase-init,stefan-caraiman/cloudbase-init,cmin764/cloudbase-init,openstack/cloudbase-init,stackforge/cloudbase-init | cloudbaseinit/shell.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom swingtime import views\n\nurlpatterns = patterns('',\n url(\n r'^(?:calendar/)?$', \n views.today_view, \n name='swingtime-today'\n ),\n\n url(\n r'^calen... | python | edit | 1 | 0 | mit | 87079b55d17edc4cc8bbcb2a7af80adf5799608e | jonge-democraten/mezzanine-fullcalendar | swingtime/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom subprocess import Popen, PIPE\nfrom django.test.runner import DiscoverRunner\n\n\nclass CustomTestRunner(DiscoverRunner):\n \"\"\"\n Same as the default Django test runner, except it also runs our node\n server as a subprocess... | python | edit | 1 | 1 | mit | e264d00fa37dd1b326f1296badd74fa4ab599a45 | jphalip/django-react-djangocon2015,jphalip/django-react-djangocon2015,jphalip/django-react-djangocon2015 | project/runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport inspect\nimport socket\nimport sys\nfrom io import BytesIO\nfrom threading import currentThread, Thread\n\nfrom IPython.core.display import HTML, display\nfrom werkzeug.local import LocalProxy\nfrom werkzeug.serving import ThreadingM... | python | edit | 1 | 3 | mit | cf60277951c7c4a23fe8672f5c21ed2ee8a7a0ee | alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye | birdseye/ipython.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, unicode_literals\n\n\n# http://stackoverflow.com/a/22723724/1798491\nclass Enum(object):\n def __init__(self, tuple_list):\n self.tuple_list = tuple_list\n\n def __getattr__(self, name):\... | python | edit | 1 | 2 | mit | 8f3fb41b8001c3f2dffc6086e89e782a9a46f79a | springload/draftjs_exporter,springload/draftjs_exporter,springload/draftjs_exporter | draftjs_exporter/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# This can be imported directly from coop_cms.forms\nfrom coop_cms.forms.articles import ArticleForm, ArticleSettingsForm, NewArticleForm\nfrom coop_cms.forms.newsletters import NewsletterForm, NewsletterSettingsF... | python | edit | 1 | 0 | bsd-3-clause | 2e1d1e5914d853a4da55dd0c8ea534df396697a0 | ljean/coop_cms,ljean/coop_cms,ljean/coop_cms | coop_cms/forms/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport math\n\ndef main():\n\n # do while len(spot.xds) > 100 (say)\n # index, no unit cell / symmetry set\n # copy out indexed spots, orientation matrix\n # done\n\n # compare list of orientation matri... | python | edit | 2 | 4 | bsd-3-clause | d8a46686f12de76381bf9c2cfde0e9482acc2259 | xia2/xia2,xia2/xia2 | Toolkit/PlayPen/rooster.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os.path\nfrom tempfile import mkdtemp\nfrom unittest import TestCase\nfrom unittest.mock import patch\nfrom shutil import copy2\n\nfrom rosie.chamber_of_deputies import settings\nfrom rosie.chamber_of_deputies.adapter import Adapter\... | python | edit | 1 | 2 | mit | e3ae701be163ccff7e2f64721752b0374dffdfc1 | marcusrehm/serenata-de-amor,datasciencebr/rosie,marcusrehm/serenata-de-amor,datasciencebr/serenata-de-amor,datasciencebr/serenata-de-amor,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor | rosie/chamber_of_deputies/tests/test_dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom . import TestCase\n\nfrom llvmlite import binding as llvm\nfrom llvmlite.binding import dylib\nimport platform\n\n\nclass TestDylib(TestCase):\n\n def setUp(self):\n llvm.initialize()\n llvm.initialize... | python | edit | 1 | 4 | bsd-2-clause | 2f635e890414f777fbe3ddde1aea74ab13558313 | m-labs/llvmlite,pitrou/llvmlite,ssarangi/llvmlite,m-labs/llvmlite,markdewing/llvmlite,pitrou/llvmlite,numba/llvmlite,markdewing/llvmlite,sklam/llvmlite,sklam/llvmlite,pitrou/llvmlite,numba/llvmlite,ssarangi/llvmlite,markdewing/llvmlite,squisher/llvmlite,ssarangi/llvmlite,m-labs/llvmlite,numba/llvmlite,numba/llvmlite,sq... | llvmlite/tests/test_dylib.py | rejected_duplicate | Near-duplicate of sample 12515 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 0 | apache-2.0 | bd49d3ab611a8715436987cf549097ed9cbc2a5d | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import migrations\n\n\ndef remove_bucket_list_program_roles(apps, schema_editor):\n BucketState = apps.get_model('accelerator', 'BucketState')\n ProgramRole = apps.get_model('accelerator', 'ProgramRole')\n ProgramRol... | python | edit | 1 | 1 | mit | 8cf5b328d7596a9b74490b7dfd4a1b8aa1577b55 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py | rejected_duplicate | Near-duplicate of sample 7598 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom celery import Celery\nfrom tornado.options import options\n\nfrom tasks.helpers import create_mq_url\n\nqueue_conf = {\n 'CELERY_TASK_SERIALIZER': 'json',\n 'CELERY_ACCEPT_CONTENT': ['json'],\n 'CELERY_RESULT_SERIALIZER': 'jso... | python | edit | 1 | 0 | apache-2.0 | 84fa71e639bc1b6fda246ddfd321f0f777b86216 | BishopFox/SpoofcheckSelfTest,BishopFox/SpoofcheckSelfTest,BishopFox/SpoofcheckSelfTest | tasks/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nfrom glue.qt.widgets.data_viewer import DataViewer\n\nfrom .options_widget import IsosurfaceOptionsWidget\nfrom .vtk_widget import QtVTKWidget\n\n\nclass GlueVTKViewer(DataViewer):\n\n LABEL = \"VTK Isosurfaces\"\n\n ... | python | edit | 1 | 1 | bsd-2-clause | 3350ace16ec8148b861985d59a399470655b4421 | astrofrog/cube-viewer | cube_viewer/glue_viewer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for module gramcore.features.descriptors\"\"\"\nimport numpy\n\nfrom nose.tools import assert_equal\n\nfrom gramcore.features import descriptors\n\n\ndef test_hog_size():\n \"\"\"Create a fixture and check hog result size\n\n... | python | edit | 1 | 1 | mit | f5922951bcabac81c41fd52e2ed5cd9b67c9a920 | cpsaltis/pythogram-core | src/gramcore/features/tests/test_descriptors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copy this file to development_environment.py\n# and replace OAuth credentials your dev credentials\nTOKENS = {\n '_foo_bucket': '_foo_bucket-bearer-token',\n 'bucket': 'bucket-bearer-token',\n 'foo': 'foo-bearer-token',\n 'foo... | python | edit | 1 | 0 | mit | 4ed64168541993e2ea85e7ea47139550d1daa206 | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | backdrop/write/config/development_environment_sample.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\n\nfrom pylons import g\n\n\ndef make_secret_code(meetup, user):\n hash = hashlib.md5(g.SECRET)\n hash.update(str(meetup._id))\n hash.update(str(user._id))\n return int(hash.hexdigest()[-8:], 16) % 100\n\n```\n\nA... | python | edit | 1 | 1 | bsd-3-clause | 0a04752396bdd57a8c197e2c76e5bda92d0bad1a | reddit/reddit-plugin-meatspace,reddit/reddit-plugin-meatspace,reddit/reddit-plugin-meatspace | reddit_meatspace/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n#for downloading the packages needed for this project.\nfrom setuptools import setup, find_packages\n\nsetup(\n name='buzzmobile',\n version='0.3',\n url='https://github.com/gtagency/buzzmobile',\n autho... | python | edit | 3 | 0 | mit | 95b4cdae136ea918279a4c8968f756dc15a629ed | gtagency/buzzmobile,gtagency/buzzmobile,jgkamat/buzzmobile,jgkamat/buzzmobile,jgkamat/buzzmobile,gtagency/buzzmobile | buzzmobile/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport yaml\nimport utils\n\n\nwith open('settings.yml') as settings_file:\n YML = yaml.safe_load(settings_file)\n IMAGE = utils.Settings(YML['image'])\n SNAP = utils.Settings(YML['snap'])\n\nDROPBOX_TOKEN_FILE = \"./dropbox.txt\"\... | python | edit | 1 | 3 | mit | 653ae451e204905b8295e424ca86c20d60ee686c | projectweekend/Pi-Camera-Time-Lapse,projectweekend/Pi-Camera-Time-Lapse | settings/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport sys, pickle\n\nfrom matplotlib import pyplot\nimport numpy\n\nfrom compare import select\n\ndef main():\n fig = pyplot.figure()\n ax = fig.add_subplot(111)\n\n data = []\n for fname in sys.argv[1:]:\n stats, samp... | python | edit | 2 | 4 | apache-2.0 | edc88421bec2798d82faeece2df5229888d97db9 | trevor/calendarserver,trevor/calendarserver,trevor/calendarserver | contrib/performance/graph.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n wakatime.projects.projectmap\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Information from ~/.waka-projectmap mapping folders (relative to home folder)\n to project names\n\n :author: 3onyc\n :license... | python | edit | 3 | 3 | bsd-3-clause | a4913289ce0672cfe60bb443db469356f970c353 | wakatime/wakatime,Djabbz/wakatime,prashanthr/wakatime,Djabbz/wakatime,wakatime/wakatime,Djabbz/wakatime,queenp/wakatime,gandarez/wakatime,wakatime/wakatime,wakatime/wakatime,wakatime/wakatime,wakatime/wakatime,wakatime/wakatime,queenp/wakatime,Djabbz/wakatime,gandarez/wakatime,wakatime/wakatime,Djabbz/wakatime,prashant... | wakatime/projects/projectmap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport shutil\nimport html_helper\nfrom Cheetah.Template import Template\n\n\ndef prep_out_dir(out_dir='out_report'):\n src_dir = os.path.dirname(__file__)\n report_files_dir = os.path.join(src_dir, 'report_files')\n if ... | python | edit | 1 | 1 | mit | cbdc24aeef9ffbd8e7400ab43112409509b3337d | openstack-infra/reviewday,openstack-infra/reviewday,dprince/reviewday | reviewday/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n##\n# Template file for site configuration - copy it to site_cfg.py:\n# $ cp site_cfg_template.py site_cfg.py\n\n# Force python version (e.g. '2.4'), or left 'auto' for autodetection.\npython_version = 'auto'\n\n# Operating system - one of ... | python | edit | 1 | 0 | bsd-3-clause | eabab4dcb52a8d63c74bb8b785696bc36b8b25e7 | BubuLK/sfepy,sfepy/sfepy,vlukes/sfepy,vlukes/sfepy,rc/sfepy,rc/sfepy,sfepy/sfepy,vlukes/sfepy,BubuLK/sfepy,sfepy/sfepy,BubuLK/sfepy,rc/sfepy | site_cfg_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Feature definitions for reviews.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom django.utils.translation import ugettext_lazy as _\nfrom djblets.features import Feature, FeatureLevel\n\n\nclass GeneralCommentsFeature(Feature... | python | edit | 1 | 0 | mit | 6bdc335ebb8ed009cbc926e681ee6be8f475f323 | sgallagher/reviewboard,brennie/reviewboard,chipx86/reviewboard,chipx86/reviewboard,chipx86/reviewboard,davidt/reviewboard,reviewboard/reviewboard,davidt/reviewboard,reviewboard/reviewboard,chipx86/reviewboard,brennie/reviewboard,sgallagher/reviewboard,davidt/reviewboard,sgallagher/reviewboard,davidt/reviewboard,brennie... | reviewboard/reviews/features.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n\n#\n# Must be called in roche root dir\n#\n\nimport sys\nimport os\n\nsys.path.append('.')\nimport roche.settings\n\nfrom os import walk\nfrom eulexistdb.db import ExistDB\nfrom roche.settings import EXISTDB_SERVER_URL\n\n#... | python | edit | 4 | 0 | mit | 8df3076b6315a74e57ee27fe3478d36737be0ff9 | beijingren/roche-website,beijingren/roche-website,beijingren/roche-website,beijingren/roche-website | roche/scripts/xml-load.py | rejected_lint | Too many lint violations: 4 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.