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# -*- coding: utf-8 -*-\n\n\ntry:\n irange = xrange\nexcept NameError:\n irange = range\n\n```\n\nApply this change: Add izip for Python 2/3 compatibility\n\nSimply use `izip` from `itertools` on Python 2 and alias `izip` as `zip`\non... | python | edit | 1 | 0 | bsd-3-clause | 8e4d77636a9846296225ddbfab872be4c7486261 | jakirkham/dask-distance | dask_distance/_pycompat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport docker\n\n\ndef execute_batch(batch_id: int):\n container_name = f'mobydq-batch-{batch_id}'\n client = docker.from_env()\n client.containers.run(\n name=container_name,\n image='mobydq-scripts',\n networ... | python | edit | 1 | 1 | apache-2.0 | 114f6eb7fc6e7bf7e2cbc885ded0063adce3eccc | alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality | api/init/graphqlapi/batch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url\n\nfrom .views import LocalitiesAPI, LocalityAPI\n\nurlpatterns = patterns(\n '',\n url(\n r'^localities$', LocalitiesAPI.as_view(),\n name='api_localit... | python | edit | 1 | 0 | bsd-2-clause | a81e3f43b83fb003b9708e3a7a581da1dc9190c1 | ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites | django_project/api/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.views.generic import RedirectView\n\nfrom .views import AwayView, DiscussionView, GameView, PrologueView\n\n\nurlpat... | python | edit | 4 | 0 | apache-2.0 | 8b04e4de91f60a2727f9c7a6f5a56d86279c667d | bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv | avalonstar/apps/live/urls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import jsonify\nfrom sqlalchemy.types import String\nfrom sqlalchemy import func\nimport datetime\n\nfrom .. import main\nfrom ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent\n\... | python | edit | 3 | 2 | mit | 04f8e26d2dfd29c0958372098f4199d833977c62 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | app/main/views/frameworks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\nimport yaml\n\nimport parse\nimport deparse\n\n\ndef main():\n with open('data/features.csv', 'r') as f:\n segments = [segment for segment in csv.DictReader(f)]\n\n with open('data/diacritics.yaml') as f:\n d... | python | edit | 1 | 4 | mit | 21541a4a1b2fcdfaa4bb7d2fbebf7db702eebacc | kdelwat/LangEvolve,kdelwat/LangEvolve,kdelwat/LangEvolve | app/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import TestCase, main\nfrom grammpy import *\n\n\nclass NonterminalAddingTest(TestCase):\n pass... | python | edit | 10 | 1 | mit | 1b18d81f673e9f982e9778823198cbc336285db4 | PatrikValkovic/grammpy | tests/grammar_creation_test/NonterminalAddingTest.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('wagtailimages', '0... | python | edit | 1 | 0 | mit | 77a6ff9fa19349bcb9428e79b7a7bf05cb4fb2a2 | pgovers/oscar-wagtail-demo,pgovers/oscar-wagtail-demo | demo/apps/catalogue/migrations/0011_auto_20160616_1335.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Upgrade the version to 1.3.0"
},
{
"role": "assistant",
"content": "version_info = (1, 3, 0)\nversion = '.'.join(map(str, version_info))\n"
}
] | python | new_file | 1 | 0 | apache-2.0 | 78ec6813df74c153501b109b31383a07f02bde07 | beaulyddon-wf/furious,Workiva/furious,mattsanders-wf/furious,beaulyddon-wf/furious,mattsanders-wf/furious,andreleblanc-wf/furious,Workiva/furious,andreleblanc-wf/furious | furious/_pkg_meta.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os.path as op\nimport numpy as np\nimport nibabel as nib\nimport seaborn as sns\n\ndef plot_mask_distribution(fname, hist=False):\n \"\"\"Plot the distribution of voxel coordinates in a mask file.\n\n Parameters\n ----------... | python | edit | 1 | 4 | bsd-3-clause | 5cbbe25d9bbfbea804d22f399ec16ed438c492e4 | mwaskom/moss,mwaskom/moss | moss/plots.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: pyxl\nimport pytest\n\nfrom pyxl.codec.register import pyxl_decode\nfrom pyxl.codec.parser import ParseError\n\ndef test_malformed_if():\n with pytest.raises(ParseError):\n pyxl_decode(b\"\"\"\n <frag>\n ... | python | edit | 1 | 1 | apache-2.0 | 4510a4a22965d002bd41293fd8fe629c8285800d | pyxl4/pyxl4 | tests/test_errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# -*- coding: utf-8 -*-\n\n\"\"\" Function related to logging \"\"\"\n\n# stp import\nimport sys\nimport logging\n\n# fief import\nfrom fief import filter_effective_parameters as fief\n\nlog = logging.getLogger()\n\n@fief\ndef setup_loggi... | python | edit | 1 | 2 | mit | 99f862b6c123b8c6d81e931254c061e64431bccc | Fougere87/pysingcells | pysingcells/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport colorlog\n\nlogging.STRONGINFO = logging.DEBUG + 5\nlogging.addLevelName(logging.STRONGINFO, 'STRONGINFO')\n\n\ndef logStrongInfo(msg, *args, **kwargs):\n \"\"\"Log a message with severity 'STRONGINFO' on the root ... | python | edit | 1 | 1 | bsd-3-clause | 6b777abcc694ff8991cd522300d8d545fb49586a | awacha/cct,awacha/cct,awacha/cct | cct/core2/stronginfo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns\nfrom django.conf.urls import url\nfrom django.views.generic.base import RedirectView\nfrom django.core.urlresolvers import reverse_lazy\nfrom django.contrib.auth.views import login\nfrom django.contrib... | python | edit | 1 | 2 | bsd-3-clause | 6de1eb3e3279af6fa09ddafd0e220becac7edf21 | stefantsov/blackbox3,stefantsov/blackbox3,stefantsov/blackbox3 | author/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nThis is the main file for a script that reads info off a game on kongregate.com and acts upon it.\n\n\"\"\"\n# import line/s for builtin modules\n# import pyautogui\n\n__author__ = \"Alex Flores Escarcega\"\n_... | python | edit | null | null | mit | 67ea33e9e46ff321c2915d46a354d66756ff9c2b | hydrophilicsun/Automating-Endless-Expansion | main.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport math\nimport sys\n\ndef sigmoid(x):\n try:\n val = 1/(1 + math.exp(-x))\n except OverflowError:\n val = sys.float_info.max\n return val\n\ndef sigmoidprime(x):\n return (1 - sigmoid(x))*sigmoid(x)\n\n```\n\n... | python | edit | 3 | 2 | mit | f30d2f5b09ae3a62bff02165a173af6e25345a60 | tmerr/trevornet | trevornet/nets/pynet/aimath.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport factory\n\nfrom symposion.schedule.tests.factories import ConferenceFactory\nfrom symposion.sponsorship.models import SponsorLevel, Sponsor\n\n\nclass SponsorLevelFactory(factory.django.DjangoModelFactory):\n conference = factory.... | python | edit | 1 | 0 | mit | 3860e0a9ac99c4c4422630e4133bf3b35927bf41 | pydata/conf_site,pydata/conf_site,pydata/conf_site | conf_site/sponsorship/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\\\nGistMail\n\nEmail <EMAIL> with a link and get a response with that article's summary.\n\"\"\"\n\nfrom summarize import summarize_page\nfrom flask import Flask, render_template\n\n\n# Flask application\napp = Flask(__name__)\n# Con... | python | edit | 2 | 2 | mit | c80c9aa63426f138d725eeecf74f386fbee61aed | joeyespo/gistmail.com,joeyespo/gistmail.com | gistmail.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom downloads.download import _progress_bar\n\n\n@pytest.mark.parametrize(\n \"current,block_size,total_size\",\n [\n (\n 100,\n 32,\n 100 * 32,\n ),\n (\n ... | python | edit | 1 | 1 | mit | caaf8e40c99f410b09580b81c4fa7a094395319c | audy/downloads | test/test_progress_bar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport sentry_sdk\nfrom flask import Flask\nfrom sentry_sdk.integrations.flask import FlaskIntegration\nfrom sentry_sdk.integrations import logging\n\nfrom app import create_app\n\nsentry_sdk.init(\n dsn=os.environ['SENTRY_D... | python | edit | 1 | 0 | mit | 1bc174d357423964191625faad6733466320face | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | application.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# MIT License\n# Copyright (c) 2017 MassChallenge, Inc.\n\nfrom __future__ import unicode_literals\n\nimport swapper\nfrom factory import (\n DjangoModelFactory,\n Sequence,\n)\n\nfrom accelerator.apps import AcceleratorConfig\n\nProg... | python | edit | 1 | 0 | mit | 69029424035c8506a46b94422fd347871ee51269 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/tests/factories/program_family_factory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n#\n# This file is part of ckanext-nhm\n# Created by the Natural History Museum in London, UK\n\n\ndef list_to_form_options(values, allow_empty=False, allow_empty_text='None'):\n '''Format a list ... | python | edit | 1 | 5 | mit | d2079a26f1a259aa69dea061be2b192137030fd1 | NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm | ckanext/nhm/lib/form.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"Display standard input on LEDs.\"\"\"\n\nimport sys\nimport RPi.GPIO as GPIO\nfrom seven_segment import print_leds\n\npins = [17, 23, 24, 22, 27, 25, 5]\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(pins, GPIO.OUT)\n\np... | python | edit | 1 | 0 | mit | 58321c0471f10169ea5c0f705cdb35825036d77f | zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie | cat_leds.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport os\nimport ctypes\n\n# We need to manually load the _core SO the first time so that we can specify\n# that it use the RTLD_GLOBAL flag. Otherwise (when not on a Mac) the runtime\n# linker will not be able to resolve undefined symbo... | python | edit | 1 | 1 | bsd-3-clause | 25e4730c4614a26cdecd60eb0846e69578353d2c | mikeboers/PyTomCrypt,mikeboers/PyTomCrypt,mikeboers/PyTomCrypt | tomcrypt/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app import create_app\nfrom credstash import getAllSecrets\nimport os\n\ndefault_env_file = '/home/ubuntu/environment'\nenvironment = 'live'\n\nif os.path.isfile(default_env_file):\n with open(default_env_file, 'r') as environment_f... | python | edit | 1 | 0 | mit | d044576e08e06dd6a2c68ab7868c281cd2979764 | gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin | wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update the code of visualization."
},
{
"role": "assistant",
"content": "import struct\n\n\nid_i = 0\nvalue_i = 0.0\nid_i_1 = 0\nvalue_i_1 = 1.0\nnumber = 0\nwith open(\"sort.dat\", \"r\") as f:\n for line in f:\n line ... | python | new_file | 3 | 0 | mit | 625307615f0dac8801b35ac5689a92706556ad01 | SigmaQuan/NTM-Keras | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nASSETS = {\n 'debug': False,\n 'media_url': '/',\n}\n\n\ndef configure(data):\n ASSETS.update(data)\n\n```\n\nApply this change: Return config when calling configure def"
},
{
"role": "assistant",
"co... | python | edit | 1 | 2 | mit | f61aa6a8088721c31510beef2145e3de7a46b1f4 | rcmachado/mako-pipeline | mako_pipeline/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Adapted from http://stackoverflow.com/questions/110803/dirty-fields-in-django\nfrom django.db.models.signals import post_save\n\nclass DirtyFieldsMixin(object):\n def __init__(self, *args, **kwargs):\n super(DirtyFieldsMixin, se... | python | edit | 1 | 3 | bsd-3-clause | b4ce1a023bf047524f40ac63f40d46a70c8f6f77 | stanhu/django-dirtyfields | src/dirtyfields/dirtyfields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'alex'\n\n\nprint 45\n\nprint 54\n```\n\nApply this change: Read and parse xml to Matrix"
},
{
"role": "assistant",
"content": "_author__ = 'alex'\nimport sys\nimport xml.dom.minidom as dom\n\ndef get_Res_Matrix(len... | python | edit | 3 | 8 | mit | 8b6daefb98c20ddb288604f7aa2202c21df2c526 | BaydinAlexey/proglangs_baydin,BaydinAlexey/proglangs_baydin | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom RPi import GPIO\n\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setwarnings(False)\n\n\nclass InputDevice(object):\n def __init__(self, pin):\n self.pin = pin\n GPIO.setup(pin, GPIO.IN, GPIO.PUD_UP)\n\n def is_pressed(self):\n ... | python | edit | 1 | 2 | bsd-3-clause | 3e52078450a4205fdfaa2d4ba2448bce3d3d19d7 | lurch/python-gpiozero,waveform80/gpio-zero,agiledata/python-gpiozero,Gadgetoid/python-gpiozero,cymplecy/python-gpioone,RPi-Distro/python-gpiozero,MrHarcombe/python-gpiozero | gpio_components/input_devices.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom botus_receptus.app_commands import test_guilds_only\nfrom discord import app_commands\n\nfrom .daily_bread.daily_bread_preferences_group import DailyBreadPrefere... | python | edit | 1 | 1 | bsd-3-clause | fa2fb3387912474eff2b6c2a14d6304fcf5cd1f8 | bryanforbes/Erasmus | erasmus/cogs/bible/testing_server_preferences_group.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nclass Meta(object):\n '''Generic container for Meta classes'''\n\n def __new__(cls, meta=None):\n # Return a new class base on ourselves\n attrs = dict(\n (name, geta... | python | edit | 1 | 4 | bsd-3-clause | 0a9f378784e8c30cdf16d4d1caaf3b98f112bb90 | MarkusH/django-nap,limbera/django-nap | nap/meta.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nfrom bs4 import BeautifulSoup\n\ndef nouda( url , out ):\n\n\tr = requests.get( url )\n\tr.encoding = 'UTF-8'\n\tsoup = BeautifulSoup( r.text )\n\n\tteksti = soup.find_all( class_ ='post-meta' )\n\n\tfor string in teksti[... | python | edit | 2 | 2 | mit | ea5bfe240cc349144e089f606534726863f2c21b | HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015 | media/sites/lapinkansa.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\nimport os\nimport sys\n\nSTEPS = \"Step:\"\nRESULT = \"Result:\"\nSETUP = \"Setup:\"\n\ndef enter_depend_test():\n\n # Simple magic for using scripts within a source tree\n BASEDIR = os.path.dirname(os.path.dirname(... | python | edit | 1 | 5 | mit | c2355829706b2b728ca369474157cac58f9c35d1 | LuyaoHuang/depend-test-framework | examples/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom operator import itemgetter\n\nmapping = {\n 'has_header': True,\n 'currency': 'EUR',\n 'delimiter': ';',\n 'bank': 'GLS Bank',\n 'account': itemgetter('Kontonummer'),\n\n # Chop up the dotted German date format and pu... | python | edit | 1 | 0 | mit | f3ec0593bb67db25c4f5af4b3b00d82d5e4e0f04 | reubano/csv2ofx,reubano/csv2ofx | csv2ofx/mappings/gls.py | rejected_duplicate | Near-duplicate of sample 4818 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# (c) Copyright IBM Corp. 2021\n# (c) Copyright Instana Inc. 2020\n\nimport os\nimport sys\nfrom ...helpers import testenv\nfrom ..utils import launch_background_thread\n\napp_thread = None\n\nif not any((app_thread, os.environ.get('GEVENT_... | python | edit | 3 | 0 | mit | 7a5ad08262afa4b7f4b8f580755136145d681ace | instana/python-sensor,instana/python-sensor | tests/apps/tornado_server/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function, unicode_literals\n\nimport django.views.generic\n\npouet = [\n 'ArchiveIndexView', 'YearArchiveView', 'MonthArchiveView',\n 'WeekArchiveView', 'DayArchiveView', 'TodayArchiveView', 'DateDetailVie... | python | edit | 1 | 3 | mit | 2f55855ed1c1ea7862e239af76fab57f32affc0c | Psycojoker/HamlPy,nyaruka/django-hamlpy,Psycojoker/HamlPy,nyaruka/django-hamlpy,Psycojoker/HamlPy | hamlpy/views/generic/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom subprocess import check_output as co\nfrom sys import exit\n\n# Actually run bin/mn rather than importing via python path\nversion = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True )\nversion = version... | python | edit | 2 | 0 | bsd-3-clause | 24520fc982d0a1a2b1b6fa7b493888fbdd3ef6a8 | mininet/mininet,mininet/mininet,mininet/mininet | util/versioncheck.py | rejected_duplicate | Near-duplicate of sample 1884 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport argparse\n\nfrom qlmdm import set_gpg\nfrom qlmdm.server import patch_hosts\n\nset_gpg('server')\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='Queue a patch for one or '\n ... | python | edit | 1 | 3 | apache-2.0 | 6d17a7becc0ddebceba0bd77f876bf9744a2d62e | quantopian/PenguinDome,quantopian/PenguinDome | server/patch_hosts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nfrom scipy.optimize import curve_fit\nfrom astropy import units as u\nfrom planck import planck_function\n\ndef bb_flux(wavelength, temperature, angular_radius):\n bb_flux = (np.pi) * planck_function(wavelength, tempe... | python | edit | 3 | 1 | mit | 69a417c421d774c4998ae721b85211a60757ce85 | JALusk/SNoBoL,JALusk/SuperBoL,JALusk/SNoBoL | fit_blackbody.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Add user roles\n\nRevision ID: 16ef0d8ffae1\nRevises: 8acb1453abb\nCreate Date: 2015-03-17 15:45:05.406297\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '16ef0d8ffae1'\ndown_revision = '8acb1453abb'\n\nfrom alembic... | python | edit | 1 | 2 | mit | fcc4eb6feaf05c950bcb0cb3f5861e631dacd8d4 | koorukuroo/findaconf,cuducos/findaconf,koorukuroo/findaconf,cuducos/findaconf,cuducos/findaconf,koorukuroo/findaconf | migrations/versions/16ef0d8ffae1_add_user_roles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nfrom .base import * # noqa\n\nINTERNAL_IPS = ['127.0.0.1']\n\nDEBUG_TOOLBAR_CONFIG = {\n \"SHOW_TOOLBAR_CALLBACK\": lambda x: True,\n}\n\nMIDDLEWARE_CLASSES = (... | python | edit | 1 | 0 | mit | 045c1405c4b8c7bc502814672c0da36e3e4a8a15 | mrpau/kolibri,mrpau/kolibri,MingDai/kolibri,DXCanas/kolibri,DXCanas/kolibri,jonboiser/kolibri,lyw07/kolibri,benjaoming/kolibri,benjaoming/kolibri,christianmemije/kolibri,learningequality/kolibri,learningequality/kolibri,christianmemije/kolibri,lyw07/kolibri,MingDai/kolibri,jonboiser/kolibri,benjaoming/kolibri,mrpau/kol... | kolibri/deployment/default/settings/debug_panel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n###----------------------------------------------------------------------------\n\n\nfrom .help import HyperHelpCommand, HyperHelpNavigateCommand\nfrom .help import HyperHelpListener\n\n\n###-------------------------------------------------... | python | edit | 6 | 1 | mit | 56902792b2a7fdd25bd64781e9e98a63db2ee348 | OdatNurd/hyperhelp | all/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport six\n\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import reverse\nfrom django.conf import settings\n\nfrom openid.consumer import consumer\n\nimport wargaming\n\nwot = wargaming.WoT(settings.WARGAMING_KEY, la... | python | edit | 1 | 2 | mit | b21d63d8df7d17e150702c531ef449f409100eff | monester/wot-battles,monester/wot-battles,monester/wot-battles,monester/wot-battles | wot_clan_battles/views_auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nversion_info = (1, 0, 1)\n\n__version__ = \".\".join(map(str, version_info))\n\ntry:\n import collectd\n collectd_present = True\nexcept ImportError:\n collectd_present = False\n\nfrom .plugin import HAProxyPlugin\n\n\nif collectd_... | python | edit | 1 | 0 | mit | eef8c0c99a6a02602cc9da75eadf180e65ad55b0 | wglass/collectd-haproxy | collectd_haproxy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pygame\n\nclass Sprite():\n def __init__(self, name):\n self.name = name\n self.costumes = []\n\n def addCostume(self, costumePath):\n costume = pygame.image.load(costumePath)\n self.costumes.append(... | python | edit | 6 | 1 | mit | 28d48dd681dd20d839aa0748ee478947a0eb3da0 | PySlither/Slither,PySlither/Slither | hiss/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport json, os, requests\nfrom awsauth import S3Auth\nfrom datetime import datetime\nfrom pytz import timezone\nfrom flask import Flask, render_template, url_for\nfrom models import app, db, FoodMenu, FoodServices\n\... | python | edit | 7 | 1 | mit | 6dd1881fc2631602d7e34aede208abf42ed688aa | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | renderMenu.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom opps.core.models.publishable import Publishable\n\n\n\nclass Image(Publishable):\n\n title = models.CharField(_(u\"Tit... | python | edit | 1 | 1 | mit | 8e10801ab28b3db02b301c27966aeaabc154329b | opps/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,opps/opps | opps/core/models/image.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nfrom measurements import startup\nimport page_sets\nfrom telemetry import... | python | edit | 1 | 0 | bsd-3-clause | 3b79447e1027cc4965ab3272c34740b82d79c66c | axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,jaruba/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,dushu1... | tools/perf/benchmarks/start_with_url.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: AlexBanks97\n# Purpose: LIFO Stack implementation using python array.\n# Date: October 15th 2017\n\nclass Stack(object):\n def __init__(self):\n # Initialize stack as empty array\n self.stack = [] \n```\n\nApply t... | python | edit | 1 | 2 | cc0-1.0 | f177e6acbafa514f6e6ac4563cb92c49f3213618 | ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-rithms,ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,manikTharaka/al-go-rithms,Deepak345/a... | data_structures/Stack/Python/Stack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# MIT License\n# Copyright (c) 2017 MassChallenge, Inc.\n\nfrom __future__ import unicode_literals\n\nfrom django.test import TestCase\n\nfrom accelerator.tests.factories import ProgramCycleFactory\n\n\nclass TestProgramCycle(TestCase):\n ... | python | edit | 1 | 1 | mit | 342515edc89d6666a5dc9064de7d2ceea9a7b468 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/tests/test_program_cycle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tensorflow as tf\n\nfrom .. import config\nfrom ..distribution import Distribution\n\n\n@Distribution\ndef Exponential(lambda_, name=None):\n X = tf.placeholder(config.dtype, name=name)\n\n Distribution.logp = tf.log(lambda_) -... | python | edit | 1 | 1 | mit | eddf3ec729fd385fd3ec2ec425db1d777a302e46 | ibab/tensorprob,tensorprob/tensorprob,ibab/tensorfit | tensorprob/distributions/exponential.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mock import patch\nimport sure # noqa\n\nfrom moto.server import main\n\n\ndef test_wrong_arguments():\n try:\n main([\"name\", \"test1\", \"test2\", \"test3\"])\n assert False, (\"main() when called with the incorrec... | python | edit | 1 | 2 | apache-2.0 | f764e9e0f3cba7c387952fe8f19aa702825e8378 | william-richard/moto,Affirm/moto,Brett55/moto,gjtempleton/moto,whummer/moto,Affirm/moto,rocky4570/moto,ZuluPro/moto,spulec/moto,Brett55/moto,gjtempleton/moto,okomestudio/moto,ZuluPro/moto,alexdebrie/moto,rouge8/moto,william-richard/moto,gjtempleton/moto,botify-labs/moto,braintreeps/moto,2rs2ts/moto,spulec/moto,okomestu... | tests/test_core/test_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom paver.easy import task, needs, path, sh, cmdopts, options\nfrom paver.setuputils import setup, install_distutils_tasks\nfrom distutils.extension import Extension\nfrom distutils.dep_util import newer\n\nsys.path.insert(0,... | python | edit | 8 | 1 | bsd-3-clause | 98405875fd8ec682caa04244a900e6ce9eac9acb | wheeler-microfluidics/mpm | pavement.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import connection\nfrom django.db.models.fields import *\nfrom south.db import generic\n\nclass DatabaseOperations(generic.DatabaseOperations):\n \"\"\"\n django-pyodbc (sql_server.pyodbc) implementation of database ope... | python | edit | 5 | 5 | apache-2.0 | e0ce0095fd488852a7d565ecaf49eba0b8dbd7d5 | theatlantic/django-south,theatlantic/django-south | db/sql_server/pyodbc.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport boto3\nfrom os import path, chdir\nfrom subprocess import check_call\nfrom nose.plugins.attrib import attr\n\nfrom indra.tools.reading import submit_reading_pipeline as srp\n\n\ns3 = boto3.client('s3')\n\n\nHERE = path.dirname(path... | python | edit | 1 | 3 | bsd-2-clause | 54add3fa95ab450e5afcbbf7fe8a3205bfc5889c | bgyori/indra,pvtodorov/indra,pvtodorov/indra,sorgerlab/indra,sorgerlab/indra,sorgerlab/indra,pvtodorov/indra,bgyori/indra,johnbachman/indra,pvtodorov/indra,sorgerlab/belpy,johnbachman/indra,johnbachman/indra,johnbachman/belpy,johnbachman/belpy,sorgerlab/belpy,sorgerlab/belpy,johnbachman/belpy,bgyori/indra | indra/tests/test_reading_scripts_aws.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Setup specs for packaging, distributing, and installing gcs lib.\"\"\"\n\nimport distribute_setup\ndistribute_setup.use_setuptools()\n\n\nimport setuptools\n\n\nsetuptools.setup(\n name=\"GoogleAppEngineCloudStorageClient\",\n v... | python | edit | 1 | 0 | apache-2.0 | db2c50de660228745cc9a7fafaaa9b3d9e451aee | aozarov/appengine-gcs-client,GoogleCloudPlatform/appengine-gcs-client,GoogleCloudPlatform/appengine-gcs-client,aozarov/appengine-gcs-client,GoogleCloudPlatform/appengine-gcs-client,aozarov/appengine-gcs-client | python/src/setup.py | rejected_duplicate | Near-duplicate of sample 116 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom mcapi.mcapp import app\nfrom mcapi import tservices, public, utils, private, access, process, machine, template, tservices\nfrom mcapi.user import account, datadirs, datafiles, reviews, ud, usergroups, projects... | python | edit | 20 | 0 | mit | 2b18bc0e0f3b9e0ca14935e2648fb9e6d637c8d0 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/rest.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.services.user.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom typing import Optional\n\nfrom attr import at... | python | edit | 1 | 0 | bsd-3-clause | 75a70e31791c523da6bf6b0ce4409a77f2784ed5 | m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/services/user/transfer/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Import Python libs\nfrom __future__ import absolute_import\nimport time\n\n# Import Salt libs\nimport salt.utils.decorators\n\n\ndef _fallbackfunc():\n return False, 'fallback'\n\n\ndef working_function():\n ... | python | edit | 1 | 1 | apache-2.0 | 435e8fc4d9ad8c071a96e37e483fcbc194a94fc6 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/integration/files/file/base/_modules/runtests_decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom thinglang.lexer.symbols.base import LexicalIdentifier\n\n\nclass ThingInstance(object):\n\n def __init__(self, cls):\n self.cls = cls\n self.methods = {\n x.name: x for x in self.cls.children\n }\n ... | python | edit | 3 | 2 | mit | e51d35545d038b5cb7035cc74f39e4a5c2b0756a | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/execution/classes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom selinon import StoragePool\nfrom cucoslib.models import WorkerResult, Analysis\n\nfrom .base import BaseHandler\n\n\nclass CleanPostgres(BaseHandler):\n \"\"\" Clean JSONB columns in Postgres \"\"\"\n def execute(self):\n ... | python | edit | 1 | 6 | apache-2.0 | fbe78315efcbf646710da6bf7d6a9d6c26fa8645 | fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs | bayesian_jobs/handlers/clean_postgres.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n\"\"\"TODO:\n * more flexible sorting options\n * use -o to specify output file\n * check more explicitly for errors in JSON files\n\"\"\"\n\nimport json, sys\n\nif len(sys.argv) > 1:\n inFn = sys.argv[1]\n\nwit... | python | edit | 1 | 0 | mit | 428938d5775d973822a0f72aa2ce54ae9e14d429 | JoshuaBrockschmidt/dictbuilder | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport io\nfrom typing import BinaryIO, ClassVar\n\nfrom ._fastobo import FastoboSerializer\nfrom .base import BaseSerializer\n\n\nclass OboSerializer(FastoboSerializer, BaseSerializer):\n\n format = \"obo\"\n\n def dump(self, file):\... | python | edit | 4 | 12 | mit | 60a4da0ea090e95ad566743b5ceba874d051d8d9 | althonos/pronto | pronto/serializers/obo.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\n\nimport jinja2\nimport webapp2\n\nJINJA_ENVIRONMENT = jinja2.Environment(\n loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),\n extensions = ['jinja2.ext.autoescape... | python | edit | 1 | 1 | bsd-3-clause | d51bc62e18a3589ad840bbc26952bac14acaf264 | siddhantgoel/so-instant,siddhantgoel/so-instant | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nimport json\nfrom pprint import pprint\ntry:\n import requests\nexcept ImportError:\n print(\n 'Script requires requests package. \\n'\n 'You can install it by running \"pip install req... | python | edit | 1 | 3 | mit | 324f05e1cbffdad2da209a7ee515f1d9a32cf93b | sevazhidkov/rest-wrapper | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\ndef get_fat_mounts():\n fat_mounts = []\n mounts = os.popen('mount')\n for line in mounts.readlines():\n device, ign1, mount_point, ign2, filesystem, options = line.split()\n if 'fat' in filesystem:\n ... | python | edit | 1 | 6 | apache-2.0 | baa088e1e6cc503b9f0bcfbacf62327a6527550b | chrrrisw/kmel_db,chrrrisw/kmel_db | kmeldb/mounts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a backwards-compatibility import for ServiceTests.\n\nWe had a class, ServiceTests, which was a base testcase class for\nhosting service unit tests. This was moved recently, which broke\nextensions that provided hosting service unit test... | python | new_file | 1 | 0 | mit | 8d9acd9447400608ddc2ab46948c7d05430b3e0b | davidt/reviewboard,chipx86/reviewboard,chipx86/reviewboard,davidt/reviewboard,davidt/reviewboard,chipx86/reviewboard,brennie/reviewboard,sgallagher/reviewboard,reviewboard/reviewboard,brennie/reviewboard,brennie/reviewboard,sgallagher/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,br... | reviewboard/hostingsvcs/tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n\n protolint\n ~~~~~~~~~\n\n\"\"\"\n\nfrom . import cli\nfrom . import linter\nfrom . import output\n\n__version__ = (1, 0, 0)\n\n```\n\nApply this change: Fix CLI module during build"
},
{
"role... | python | edit | 5 | 0 | mit | 42804d3182b9b7489583250856e31a8daaef5fa3 | sgammon/codeclimate-protobuf,sgammon/codeclimate-protobuf | protolint/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom contextlib import contextmanager\n\nfrom fabric.context_managers import settings, hide\nfrom fabric.state import env\n\n\n@contextmanager\ndef sudo(user=None):\n with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=Tr... | python | edit | 1 | 3 | mit | 4a29b5169524205bfa50a89379f4439d0de40296 | 5monkeys/refabric | refabric/context_managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an simple abstract user model for school administrators which will be used later"
},
{
"role": "assistant",
"content": "from django.contrib.auth.models import AbstractUser\nfrom django.db import models\nfrom django.utils.tran... | python | new_file | 4 | 0 | mit | d89e43c649aba78ac9722ca39f9e0c67be0cc897 | FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management | precision/accounts/models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nimport os\n\n# import our default settings\nfrom settings_production import * # noqa\n\nPODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405\n 'REGISTRATION_CONTACT_ID_FIELDNAME',\n ... | python | edit | 1 | 0 | bsd-3-clause | 15e713f76f1fbfef26d9a7d3d3c95fac2d8f213e | praekelt/casepro,praekelt/casepro,praekelt/casepro | casepro/settings_production_momza.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings # noqa\nfrom appconf import AppConf\n\n\nclass AccountConf(AppConf):\n \"\"\"\n Custom settings for the account module. Mainly settings required for\n the login on the remote system.\n \"\"\"\n ... | python | edit | 1 | 0 | apache-2.0 | 622b81296b292035b970891cd259eaac113d20c1 | CDE-UNIBE/qcat,CDE-UNIBE/qcat,CDE-UNIBE/qcat,CDE-UNIBE/qcat | apps/accounts/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport http.server\nimport os\n\nimport oldfart.make\n\n\n__all__ = ['make_http_request_handler_class']\n\n\ndef _send_head(self):\n # FIXME: We die here if the directory doesn't exist ('make clean' anyone?)\n path = self.translate_pa... | python | edit | 1 | 3 | bsd-3-clause | 746d3e5aba7b4fb9bfd6c258c80b6a4565de4844 | mjhanninen/oldfart,mjhanninen/oldfart,mjhanninen/oldfart | py/oldfart/handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2021, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#... | python | edit | 1 | 1 | apache-2.0 | 5748b1a7dc4a5be3b2b9da9959eabe586347078a | tensorflow/federated,tensorflow/federated,tensorflow/federated | tensorflow_federated/python/program/value_reference.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright (c) 2012 Cloudera, Inc. All rights reserved.\n# Targeted tests for decimal type.\n#\nimport logging\nimport pytest\nfrom copy import copy\nfrom tests.common.test_vector import *\nfrom tests.common.impala_t... | python | edit | 8 | 2 | apache-2.0 | a0c23b5c27c4209cc22e138c72173842664fa98a | AtScaleInc/Impala,placrosse/ImpalaToGo,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpala,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpala,rampage644/impala-cut,placrosse/ImpalaToGo,rampage644/impala-cut,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpala,ImpalaToGo/ImpalaToGo,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpal... | tests/query_test/test_decimal_queries.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- encoding: utf-8\n\nimport collections\nimport os\nimport subprocess\nimport unittest\n\n\nResult = collections.namedtuple('Result', 'rc stdout stderr')\n\nROOT = subprocess.check_output([\n 'git', 'rev-parse'... | python | edit | 1 | 1 | mit | a6e0d8bab8e886688527372a4de267d274df7c51 | alexwlchan/safari.rs,alexwlchan/safari.rs | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\nimport time\n\nfrom autoreiv import AutoReiv\n\ndef main():\n\twhile True:\n\t\tbot = AutoReiv()\n\t\tbot.load()\n\n\t\ttry:\n\t\t\tbot.run(bot.config.get('login'), bot.config.get('password'))\n\t\texcept Exception as e:\n\t... | python | edit | 1 | 6 | mit | 694ea053fe87e4811acf0dde47826fec3eb1c9f7 | diath/AutoReiv | source/run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mock import patch\n\nfrom django.test import TestCase\nfrom breach.sniffer import Sniffer\n\n\nclass SnifferTest(TestCase):\n def setUp(self):\n self.endpoint = 'http://localhost'\n self.sniffer = Sniffer(self.endpoint... | python | edit | 1 | 1 | mit | 6e3151cd9e4c5309959c93b2ed683bb74d88a640 | esarafianou/rupture,esarafianou/rupture,dimriou/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,esarafianou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,esarafianou/rupture,dionyziz/rupture,dionyziz/rupture,dionyziz/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,dionyziz/rupture,dimkarako... | backend/breach/tests/test_sniffer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!python\nimport os\nimport sys\nimport json\nimport requests\n\nif __name__ == '__main__':\n version = sys.argv[1]\n filepath = sys.argv[2]\n filename = filepath.split('/')[-1]\n github_token = os.environ['GITHUB_TOKEN']\n auth = (git... | python | edit | 1 | 0 | bsd-2-clause | 7bf391e772cbece78b521f1e357ced4bef6908f4 | pubnative/redash,pubnative/redash,imsally/redash,hudl/redash,denisov-vlad/redash,M32Media/redash,chriszs/redash,easytaxibr/redash,M32Media/redash,jmvasquez/redashtest,crowdworks/redash,pubnative/redash,ninneko/redash,hudl/redash,denisov-vlad/redash,amino-data/redash,EverlyWell/redash,imsally/redash,vishesh92/redash,44p... | bin/upload_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom diesel import quickstart, sleep\nfrom diesel.util.pool import ThreadPool\nfrom diesel.protocols.http import HttpClient, HttpHeaders\nimport random\n\ndef handle_it(i):\n print 'S', i\n sleep(random.random())\n print 'E', i\n\n... | python | edit | 3 | 2 | bsd-3-clause | 27efc29b76ff0a65cd5ff12360701ca61231f53f | dieseldev/diesel | examples/thread_pool.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\nimport subprocess\nimport getopt\n\n\nclass Chdir:\n def __init__(self, newPath):\n self.savedPath = os.getcwd()\n os.chdir(newPath)\n\n\nclass Checker:\n def __init__(self, ... | python | edit | 2 | 4 | mit | 91bf74104c0eee2ca3d8d4fdd293390daf173166 | bsuweb/checker | checker/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\nclass SyncProducer(object):\n \"\"\"Transmits a SYNC message periodically.\"\"\"\n\n #: COB-ID of the SYNC message\n cob_id = 0x80\n\n def __init__(self, network):\n self.network = network\n self.period = None\... | python | edit | 1 | 3 | mit | 5a4e8ec1179b2ae3b37190ea45fb0d72ce4d7a90 | christiansandberg/canopen,christiansandberg/canopen | canopen/sync.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport pymongo\nimport os\nfrom courtreader import readers\n\n# Connect to database\nclient = pymongo.MongoClient(os.environ['DISTRICT_DB'])\ndb = client.va_district_court_cases\n\n# Connect to District Court Reader\nreader... | python | edit | 3 | 0 | mit | a32f7cab9ce32c1c2169b55b1e37957a093e47f8 | bschoenfeld/va-court-scraper,bschoenfeld/va-court-scraper | collect_district_court_case_details.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\n\n# TODO: make the form return the valid JSON response\nclass MainImportForm(forms.Form):\n url = forms.CharField(\n max_length=100,\n )\n\n def __init__(self, **kwargs):\n self.importer = ... | python | edit | 3 | 4 | bsd-2-clause | 34e36b77095d42f2d9e6a3634d86d09fffcc3411 | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | molo/core/content_import/api/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom poliastro.twobody.mean_elements import get_mean_elements\n\n\ndef test_get_mean_elements_raises_error_if_invalid_body():\n body = \"PlanetNine\"\n\n with pytest.raises(ValueError) as excinfo:\n get_mean_el... | python | edit | 1 | 1 | mit | 2395d08c672250b5df273eb36415c8200dd7f801 | poliastro/poliastro | tests/tests_twobody/test_mean_elements.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nfrom os.path import abspath, dirname\n\nfrom django.conf import settings\nimport django\n\n\nsys.path.insert(0, abspath(dirname(__file__)))\n\n\nif not settings.configured:\n settings.configure(\n ... | python | edit | 1 | 3 | mit | e5a872bd128e6b3ea3cc82df4094d41843148bce | treyhunner/django-email-log,treyhunner/django-email-log | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging, json\nimport bitHopper.Tracking\nimport bitHopper.util\nimport bitHopper.Network\n\nimport flask\n\napp = flask.Flask(__name__, template_folder='./templates', \n static_folder = './static')\napp.Debug = False\n\n@... | python | edit | 5 | 4 | mit | 8b82e15e3c5d8eb98dc9bf32d1d4b9e5d55be2c7 | c00w/bitHopper,c00w/bitHopper | bitHopper/Website/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nimport requests\nimport six\n\n\nclass SlackRequest(object):\n\n @staticmethod\n def do(token, request=\"?\", post_data=None, domain=\"slack.com\"):\n '''\n Perform a POST request to the Slack Web API\n\n ... | python | edit | 1 | 6 | mit | 9639eb34f53444387621ed0a27ef9b273b38df79 | slackhq/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient | slackclient/_slackrequest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.template import Context, loader\n\nfrom maintenancemode import http\n\ndef temporary_unavailable(request, template_name='503.html'):\n \"\"\"\n Default 503 handler, which looks for the requested URL in the redirects\n t... | python | edit | 1 | 1 | bsd-3-clause | 599811e2a80b6f123d3beeb8906c0b82e975da86 | aarsan/django-maintenancemode,21strun/django-maintenancemode,shanx/django-maintenancemode,21strun/django-maintenancemode,shanx/django-maintenancemode,aarsan/django-maintenancemode | maintenancemode/views/defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport config\nimport cliparser\nimport indexer\nimport io\nimport os\n\ndef command_ls(index):\n with index.index.searcher() as searcher:\n results = searcher.documents()\n print \"Indexed files:\"\n for result in results:\n ... | python | edit | 9 | 3 | mit | d2b4810d74364394e7e7ecf8f8c5b1011a250f77 | phss/notes-cli | notescli/commands.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom shop.views import ShopListView, ShopDetailView\nfrom shop_richcatalog.models import Catalog\nfrom shop.models import Product\n\n\nclass CatalogListView(ShopListView):\n '''\n TODO.\n '''\n\n model = Catalog\n #generic_te... | python | edit | 3 | 2 | bsd-3-clause | a5b4a657a1717e2fb9e4c53f93b5232dd58a1c68 | nimbis/django-shop-richcatalog,nimbis/django-shop-richcatalog | shop_richcatalog/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport dem\nimport tasks\nfrom celery import *\n\ncarrizo = dem.DEMGrid('tests/data/carrizo.tif')\n\nd = 100\nmax_age = 10**3.5\nage_step = 1\nnum_ages = max_age/age_step\nnum_angles = 180\nages = np.linspace(0, max_age, num=num_ages)\nangl... | python | edit | 8 | 0 | mit | e0e2b4fc60a945e9680c171109fd1cbb6f21e304 | stgl/scarplet,rmsare/scarplet | celery/run_carrizo.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Discovers Belkin Wemo devices. \"\"\"\n\nfrom . import SSDPDiscoverable\n\n\nclass Discoverable(SSDPDiscoverable):\n \"\"\" Adds support for discovering Belkin WeMo platform devices. \"\"\"\n\n def info_from_entry(self, entry):... | python | edit | 1 | 1 | mit | 2a1a5073e069b1fbf5b7803417b59339ec72d026 | sfam/netdisco,brburns/netdisco,balloob/netdisco | netdisco/discoverables/belkin_wemo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nRequestContext stores state relevant to the current request, as well as\nkeeping track of the plugin execution order and providing a simple method\n`advance` for calling the next plugin in the chain.\n\"\"\"\nimport collections\n\n\... | python | edit | 1 | 7 | mit | 2a6399a74110b6a9e0d48349c68775986c13a579 | numberoverzero/pyservice | pyservice/context.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport guv\n\nguv.monkey_patch()\nimport guv.server\nimport logging\nimport time\n\nfrom util import create_example\nimport logger\nfrom pympler import tracker\n\ntr = tracker.SummaryTracker()\n\nif not hasattr(time, 'perf_counter'):\n t... | python | edit | 1 | 1 | mit | 1e32cddfa5c9999f02c896e13666004260f8047a | veegee/guv,veegee/guv | examples/guv_simple_http_response.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models.functions import Lower\nfrom django.db.models import Count\n\nfrom bluebottle.members.models import Member\n\nfrom bluebottle.clients.models import Client\nfrom bluebottle.clients.utils import LocalTenant\n\nfrom blueb... | python | edit | 1 | 0 | bsd-3-clause | 553731a0ea12a8303076dc3d83bfbba91e6bc3e8 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | scripts/merge_duplicate_users.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom geartracker.models import *\n\n\nclass ItemAdmin(admin.ModelAdmin):\n prepopulated_fields = {\"slug\": (\"make\", \"model\", \"size\")}\n list_display = ('__unicode__', 'type', 'metric_weight', '... | python | edit | 7 | 0 | bsd-3-clause | 42b69fdb0d9267c339200185feddefb430aea6ae | pigmonkey/django-geartracker | geartracker/admin.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport requests\nimport os\n\n\ndef get_apod():\n\n os.makedirs(\"APODs\", exist_ok=True)\n try:\n apod_data = requests.get(\"https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY\").json()\n image_url = apod_data[\"url... | python | edit | 1 | 5 | mit | 6c6021cd1a206a91432da096400358e5eb0255fe | FXelix/space_facts_bot | nasa_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom rgbmatrix import RGBMatrix\nfrom random import randint\nimport numpy\nimport math\nimport time\n\nrows = 16\nchains = 1\nparallel = 1\nledMatrix = RGBMatrix(rows, chains, parallel)\n\nheight = ledMatrix.height\nw... | python | edit | 4 | 0 | mit | cd342448675f3174bf74118de0447c1b0f169f3e | DarkAce65/rpi-led-matrix,DarkAce65/rpi-led-matrix | python/volumeBars.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.