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": "Write python code for the following: Test of the constant variable."
},
{
"role": "assistant",
"content": "import unittest\nfrom mep.genetics.gene import VariableGene\nimport numpy as np\n\n\nclass TestVariableGene(unittest.TestCase):\n \"\"\"\n Tests for the ... | python | new_file | 1 | 1 | mit | 2cc26cd92bd2c2fc6300021bc4b7a0a219cf97cd | paulfjacobs/py-mep,paulfjacobs/py-mep | tests/mep/genetics/test_gene.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ndef import_question(posts, namespaces, upsert, id, title, body, tags, last_activity_date, last_updated_date, score, answers, has_accepted_answer):\n namespaces_for_post = {}\n for name, n in namespaces.items():\n namespace_ta... | python | edit | 2 | 8 | bsd-3-clause | e75b79fb5dd614d117289acdab758c5c86b89e35 | alnorth/stackdoc,alnorth/stackdoc,alnorth/stackdoc | update-database/stackdoc/questionimport.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport phiface\n\nsc = phiface.Context()\n\nyloc = 30\n\nfor weight in [1, 3, 6, 10]:\n xloc = 30\n A = phiface.AGlyph(x=xloc, y=yloc)\n\n xloc += A.width() + 40\n E = phiface.EGlyph(x=xloc, y=yloc)\n\n ... | python | edit | 1 | 0 | bsd-2-clause | 2abb0ff8d8f57ca1ae05e0abfc17bdcbbc758e19 | hortont424/phiface | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom common.bounty import *\nfrom common.peers import *\nfrom common import settings\n\ndef main():\n settings.setup()\n print \"settings are:\"\n print settings.config\n \nif __name__ == \"__main__\":\n main()\n\n```\n\nAppl... | python | edit | 3 | 2 | mit | 82bfc3ad8c39ffe51677eecbdc5c6904ae1ade41 | gappleto97/Senior-Project | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik\n# Author: Dominik Gresch <<EMAIL>>\n\nimport pytest\nimport numpy as np\n\nfrom parameters import T_VALUES, KPT\n\n\n@pytest.m... | python | edit | 1 | 3 | apache-2.0 | bd4812a1ef93c51bedbc92e8064b3457b5d88992 | Z2PackDev/TBmodels,Z2PackDev/TBmodels | tests/test_slice.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n pyMonitor first Version\n\n Written By :Ahmed Alkabir\n\"\"\"\n\n#!/usr/bin/python3\n\nimport main_ui as Ui\nimport sys\n\n# Main Thread of Program\ndef main():\n app = Ui.QtWidgets.QApplication(sys.argv)\n main_window ... | python | edit | 3 | 2 | mit | ffc4d6db188b9ad8ece655c8221f2e5a34e7c66b | ahmedalkabir/pyMonitor | main.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 | 36c4e01f5bfb6ba00bd018f5bca4e8652a63ca8d | JoshuaBrockschmidt/dictbuilder | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nc.ServerProxy.servers = {\n 'lab-dev': {\n 'command': [\n 'jupyter',\n 'lab',\n '--no-browser',\n '--dev-mode',\n '--port={port}',\n '--NotebookApp.token=\"\"',\n ... | python | edit | 3 | 0 | bsd-3-clause | d07e1c020185fb118b628674234c4a1ebcc11836 | jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab | binder/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: set fileencoding=utf-8 :\n#\n# Copyright (c) 2014 Daniel Truemper <truemped at googlemail.com>\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... | python | edit | 1 | 1 | apache-2.0 | 6e7923413bb0729a288c36f10e22ad7a777bf538 | truemped/supercell,truemped/supercell | supercell/testing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\n\n\nclass EasyThumbnailsTestConfig(AppConfig):\n name = 'easy_thumbnails.tests'\n label = 'easy_thumbnails_tests'\n\n```\n\nApply this change: Fix an import error for old django versions\n\nFixes #37... | python | edit | 1 | 0 | bsd-3-clause | 1c0ea1a102ed91342ce0d609733426b8a07cd67d | SmileyChris/easy-thumbnails | easy_thumbnails/tests/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Thread(models.Model):\n \"\"\"Model for representing threads.\"\"\"\n title = models.TextField()\n views = models.PositiveIntegerField(default=0)\n sticky = models.BooleanField()\n closed... | python | edit | 1 | 0 | mit | a6dc99096870b186aafe85e9777b7c29de488a51 | xfix/NextBoard | forum/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport boto3\n\nfrom infrastructure.models import Environment\n\n\ndef run(job, logger=None, **kwargs):\n service = job.service_set.first()\n env_id = service.attributes.get(field__name__startswith='aws_environment').valu... | python | edit | 4 | 1 | apache-2.0 | 2aae7b1718bfc21267922f7fe09dcf47be69582b | CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge | blueprints/aws_rds_instance/delete_aws_rds_instance.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.mail.message import EmailMultiAlternatives\nfrom django.template.loader import get_template\n\nfrom project.settings import EMAIL_FROM_ADDRESS, BASE_URL\n\n\n# TODO: celery taskify\ndef send_mail(template_name, subject, to_... | python | edit | 1 | 5 | apache-2.0 | 384c4ebb1712837b0610f90b6973520e7bbedca1 | pattisdr/lookit-api,pattisdr/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api,CenterForOpenScience/lookit-api | studies/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\nfrom thunderdome.connection import setup\nimport thunderdome\n\nsetup([\"localhost\"], \"machete\")\n\n\nclass BaseVertex(thunderdome.Vertex):\n created_at = thunderdome.DateTime(default=datetime.now)\n\ncl... | python | edit | 1 | 1 | bsd-3-clause | 8ce6aa788573aa10758375d58881f03ff438db16 | rustyrazorblade/machete,rustyrazorblade/machete,rustyrazorblade/machete | machete/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom kivy.base import runTouchApp\nfrom kivy.lang import Builder\n\nrunTouchApp(Builder.load_string('''\nActionBar:\n pos_hint: {'top':1}\n ActionView:\n use_separator: True\n ActionPrevious:\n title: 'Action ... | python | edit | 1 | 0 | mit | 4af812f9189a7bd29b9aea274eeed5cbd277dbcb | LogicalDash/kivy,LogicalDash/kivy,Cheaterman/kivy,Cheaterman/kivy,inclement/kivy,kivy/kivy,rnixx/kivy,bionoid/kivy,akshayaurora/kivy,bionoid/kivy,Cheaterman/kivy,LogicalDash/kivy,kivy/kivy,LogicalDash/kivy,matham/kivy,inclement/kivy,akshayaurora/kivy,inclement/kivy,matham/kivy,kivy/kivy,bionoid/kivy,akshayaurora/kivy,C... | examples/widgets/actionbar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport urllib\n\nTRUSTED_ROOT_FILE = os.path.join(\n os.path.dirname(os.path.abspath(__file__)), \"AppleIncRootCertificate.cer\"\n)\n\nSECRET_KEY = \"notsecr3t\"\n\nIAP_SETTINGS = {\n \"TRUSTED_ROOT_FILE\": TRUSTED_ROOT_FIL... | python | edit | 1 | 0 | mit | a2142fb8a592a9ad9b4870d4685ec02cfa621a77 | educreations/python-iap | tests/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport argparse\nimport os\nimport subprocess\n\nif __name__ == \"__main__\":\n\n # Use wrappers for compilers (native)\n c_compiler_name = \"gcc\"\n\n if \"CC\" in os.environ:\n c_compiler_name = os.... | python | edit | 3 | 0 | bsd-3-clause | 8d73c71a0c9b8d4a226b90b9310562b490296038 | szeged/csibe,bgabor666/csibe,bgabor666/csibe,szeged/csibe,szeged/csibe,szeged/csibe,bgabor666/csibe,bgabor666/csibe,bgabor666/csibe,szeged/csibe,szeged/csibe,bgabor666/csibe,bgabor666/csibe,szeged/csibe | gen/CSiBE-v2.1.1/preprocessed-source-compiler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nDATABASE_ENGINE = 'sqlite3' \nDATABASE_NAME = ':memory:' \nDATABASE_USER = '' \nDATABASE_PASSWORD = '' \nDATABASE_HOST = '' \nDATABASE_PORT = ''\n\nINSTALLED_APPS = (\n 'djmoney',\n 'te... | python | edit | 1 | 0 | bsd-3-clause | 1c7487e50def0bb6bffd7af30e4f1a948197bee8 | tsouvarev/django-money,recklessromeo/django-money,iXioN/django-money,pjdelport/django-money,recklessromeo/django-money,rescale/django-money,tsouvarev/django-money,iXioN/django-money,AlexRiina/django-money | tests/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\r\nsys.path.append('../..')\r\n\r\nfrom SALib.analyze import rbd_fast\r\nfrom SALib.sample import latin\r\nfrom SALib.test_functions import Ishigami\r\nfrom SALib.util import read_param_file\r\n\r\n# Read the parameter range file... | python | edit | 1 | 0 | mit | ccbceb486dd4775ec6dfe3764e522a869860703b | jdherman/SALib,SALib/SALib,jdherman/SALib | examples/rbd_fast/rbd_fast.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\nfrom mock import Mock\n\nfrom nyuki.events import EventManager, Event, on_event\n\n\nclass Loop(Mock):\n STACK = list()\n\n def async(self, cb, *args):\n self.STACK.append(cb)\n\n\n\nclass TestEve... | python | edit | null | null | apache-2.0 | c0808574aaf410683f9c405e98be74a3ad4f4f2c | optiflows/nyuki,optiflows/nyuki,gdraynz/nyuki,gdraynz/nyuki | tests/events_test.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport cv2\nimport ImageReader\n\nescape_key = 27\n\nreader = ImageReader.ImageReader()\n\nfgbg = cv2.createBackgroundSubtractorMOG2()\n\nwhile True:\n imgread, img = reader.decode()\n if imgread:\n fgmask ... | python | edit | 1 | 0 | mit | 18603df8d13cf0eff753cb713e6c52ae30179f30 | Mindavi/Positiebepalingssysteem | experiments/camera-stdin-stdout/bg-subtract.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import Author, Book, BookInstance, Genre, Language\n\n# admin.site.register(Book)\n# admin.site.register(Author)\nadmin.site.register(Genre)\n# admin.site.register(BookInstance)\nadmin.site.r... | python | edit | 1 | 0 | bsd-3-clause | 8771bbdba5b10a3b9fab2822eccdec64d221edb4 | pavlenk0/my-catalog,pavlenk0/my-catalog | catalog/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom flask import Flask, request, json\nfrom flask.ext.cors import CORS\nimport database\nimport rsser\n\n# Update data before application is allowed to start\ndatabase.update_database()\n\... | python | edit | 1 | 3 | bsd-3-clause | 252b0f5e69b7dddb0560e1ac37de1e6ea6e38bb9 | philipbl/talk_feed,philipbl/SpeakerCast | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport tempfile\n\nfrom flask import json\n\nimport config\n\n\ndef before_scenario(context, scenario):\n context.db_fd, context.db_url = tempfile.mkstemp()\n config.SQLALCHEMY_DATABASE_URI = 'sqlite:///' + context.db_url\n... | python | edit | 1 | 2 | mit | 6ef3e8778ad05c1dddcf6660f24f762f1725b906 | m4tx/techswarm-server | features/environment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n\nfrom algorithm import Algorithm\n\n\nclass Server(object):\n\n def __init__(self... | python | edit | 1 | 4 | mit | 946ef89ea55c30b9eb6684b4d73e96b05cf5d23d | gratipay/aspen.py,gratipay/aspen.py | aspen/server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals, print_function\n\nimport logging\nimport os\n\nfrom pelican.readers import BaseReader\n\nlogger = logging.getLogger(__name__)\n\nclass SlokaReader(BaseReader):\n enabled... | python | edit | 1 | 2 | mit | 965b459717302b674a8b06a243f2d002ce182aaa | mananam/pelican-prajna,mananam/pelican-prajna | prajna/readers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.blueprints.snippet_admin.service\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2016 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom difflib impo... | python | edit | 1 | 3 | bsd-3-clause | fe34a904af1d691f96b19c87ee11129eecb09dc5 | m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps | byceps/blueprints/snippet_admin/service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy\n\nimport chainer\nfrom chainer.utils import type_check\n\n\nclass ScaleGrad(chainer.Function):\n\n def __init__(self, scale=1.0):\n self.scale = scale\n\n def check_type_forward(self, in_types):\n type_chec... | python | edit | 1 | 2 | mit | e198eb0fe6e4a916e2207588f4123675afe15bcf | toslunar/chainerrl,toslunar/chainerrl | functions/scale_grad.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n# Erik Stein <<EMAIL>>, 2015\n\nimport re\n\nfrom django import template\nfrom django.template.defaultfilters import stringfilter\nfrom django.utils.html import conditional_e... | python | edit | 1 | 4 | mit | ec0a27694454f0765f63f9c762d42190759fd672 | sha-red/django-shared-utils,sha-red/django-shared-utils | utils/templatetags/text_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom opentracing import Format\nfrom basictracer import BasicTracer\n\ndef test_propagation():\n tracer = BasicTracer()\n sp = tracer.start_span(operation_name=\"test\")\n sp.set_baggage_item(\"foo\", \"bar\")\n opname = 'op'\n\... | python | edit | 1 | 2 | apache-2.0 | 6aa53f1fda74eb10051cb0bcc315f7db7dee1b57 | opentracing/basictracer-python | tests/test_propagation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls.defaults import patterns, include, url\nfrom django.contrib import admin\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfrom django.views.generic.simple import d... | python | edit | 1 | 0 | mit | dd15767944a3ec37a0ff568323384200d3fb540c | twaddington/django-olcc,twaddington/django-olcc,twaddington/django-olcc | django_olcc/urls.py | rejected_duplicate | Near-duplicate of sample 17562 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom dmaws.stacks import Stack\nfrom dmaws.context import Context\n\n\ndef is_true(x):\n assert x\n\n\ndef is_in(a, b):\n assert a in b\n\n\ndef valid_stack_json(stack):\n text = stack.build('stage', 'env', {}).templ... | python | edit | 1 | 7 | mit | 13a0c8b822582f84ff393298b13cf1e43642f825 | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | tests/test_stacks_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Helpers for codejail.\"\"\"\n\nimport contextlib\nimport os\nimport shutil\nimport tempfile\n\n\nclass TempDirectory(object):\n def __init__(self):\n self.temp_dir = tempfile.mkdtemp(prefix=\"codejail-\")\n # Make dir... | python | edit | 2 | 2 | apache-2.0 | 4dfe50691b911d05be9a82946df77e234283ffe2 | edx/codejail,StepicOrg/codejail | codejail/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"Tests window.py for vimiv's test suite.\"\"\"\n\nfrom unittest import main\nfrom vimiv_testcase import VimivTestCase, refresh_gui\n\n\nclass WindowTest(VimivTestCase):\n \"\"\"Window Tests.... | python | edit | 1 | 1 | mit | 9712183d01ef95fcd28ed1632346371127ec8a3e | karlch/vimiv,karlch/vimiv,karlch/vimiv | tests/window_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A module containing constants required throughout IATI library code.\n\nWarning:\n This contents of this module should currently be deemed private.\n\nTodo:\n Allow logging constants to be user-definable.\n\"\"\"\n\nSTANDARD_VER... | python | edit | 1 | 0 | mit | 3f99d7728714aed4bc19d68d2e2d410d792fe4e9 | IATI/iati.core,IATI/iati.core | iati/core/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.contrib.auth import authenticate\n\nfrom .models import *\n\nclass SignInForm(forms.Form):\n\tusername = forms.CharField(max_length=100, label='Username')\n\tpassword = forms.CharField(max_length=100, l... | python | edit | 6 | 2 | apache-2.0 | 56a2848a131e411ed687eec4d6a68f1901d942dc | rdujardin/icforum,rdujardin/icforum,rdujardin/icforum | icforum/forum/forms.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom src.Move import Move\nfrom src.NaiveCube import NaiveCube\nfrom src.Cubie imort Cube\nfrom src.Solver import Kociemba\nimport timeout_decorator\nimport unittest\n\n\nclass TestKociembaSolver(unittest.TestCase):\n @timeout_decorator.... | python | edit | null | null | mit | 64d109e975eb42bc06bb6b5e1deb26536e6f1def | Wiston999/python-rubik | tests/test_KociembaSolver.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\n\n\nclass TestURLs(TestCase):\n pass\n\n```\n\nApply this change: Add lots of URL tests.\n\n* The URLsMixin from incuna_test_utils/testcases/urls.py\n isn't quite doing what we want here, so rip it off and... | python | edit | 1 | 1 | bsd-2-clause | 7917716ebd11770c5d4d0634b39e32e4f577ab71 | incuna/incuna-auth,ghickman/incuna-auth,ghickman/incuna-auth,incuna/incuna-auth | tests/test_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom archivebox import util\n\ndef test_download_url_downloads_content():\n text = util.download_url(\"https://example.com\")\n assert \"Example Domain\" in text\n```\n\nApply this change: test: Refactor util tests to use local webser... | python | edit | 1 | 1 | mit | 322997e229457bf43ee2281993ccdc30c8455244 | pirate/bookmark-archiver,pirate/bookmark-archiver,pirate/bookmark-archiver | tests/test_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Tests for the Types module \"\"\"\n\nimport unittest\n\n# pylint: disable=import-error\nfrom res import types\n\nclass TestTypes(unittest.TestCase):\n \"\"\" Tests for the Types module \"\"\"\n\n def test_getPieceAbbreviation_e... | python | edit | 1 | 1 | mit | 10554ed0c44f819985f9f6d1c97a265d281541a2 | blairck/jaeger | test/test_types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDefine the names making up the domain specific language\n\"\"\"\n\nfrom .expectation import (\n Expectation, ExpectationNot,\n ExpectationAll, ExpectationAny,\n ExpectationNone, OPERATOR_OR\n)\n\n# Create instan... | python | edit | 1 | 2 | mit | d4f63a22df8bb7a866737150064d92ce7227c875 | drslump/pyshould | pyshould/dsl.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'matt'\n\nimport datetime\nimport blockbuster\n\nblockbuster.app.debug = blockbuster.config.debug_mode\n\nblockbuster.bb_logging.logger.info(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\")\nblockbuster.bb_logging... | python | edit | 1 | 0 | mit | 6d1b20bd047a47c46e3aa33a920e71f890f2b1fa | mattstibbs/blockbuster-server,mattstibbs/blockbuster-server | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\nfrom model_utils.models import TimeStampedModel\n\n\nclass Reader(TimeStampedModel):\n\n IBOOKS = 'iBooks'\n KIND... | python | edit | 1 | 1 | mit | 79f7d8052333fcace914fa27ea2deb5f0d7cdbfc | phildini/bockus,phildini/bockus,phildini/bockus | readers/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.contenttypes import generic\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db import models\n\nfrom . import managers\n\n\nclass RelatedType(models.Model):\n title = models.CharField(max_leng... | python | edit | 1 | 2 | apache-2.0 | 9f43d877aed9eeca9fe1b2a8c3a19c034b5f3dfb | texastribune/armstrong.apps.related_content,armstrong/armstrong.apps.related_content,texastribune/armstrong.apps.related_content,armstrong/armstrong.apps.related_content | armstrong/apps/related_content/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\"\"\"\nUtilities to compute the power of a device\n\"\"\"\nfrom UliEngineering.EngineerIO import normalize_numeric\nfrom UliEngineering.Units import Unit\nimport numpy as np\n\n__all__ = [\"current_by_power\", \"pow... | python | edit | 1 | 1 | apache-2.0 | e525a819724f149186b5b156520afe2549e5902a | ulikoehler/UliEngineering | UliEngineering/Electronics/Power.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.services.email.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nfrom __future__ import annotations\nfrom d... | python | edit | 1 | 1 | bsd-3-clause | 8258c451de6d94936d15d772fcbf3da24f6fb4b2 | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/services/email/transfer/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Double Blind Auction implementation \"\"\"\nfrom penelophant.models.Auction import Auction\n\nclass DoubleBlindAuction(Auction):\n \"\"\" Double Blind Auction implementation \"\"\"\n\n __type__ = 'doubleblind'\n __name__ = 'Double... | python | edit | 1 | 0 | apache-2.0 | 4bb72952c934dd6aea3db393226d37eb1b0eb72e | kevinoconnor7/penelophant,kevinoconnor7/penelophant | penelophant/models/auctions/DoubleBlindAuction.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport logging\n\nfrom flask import Flask, abort, g\n\nfrom config import config\nfrom api_v1 import bp as api_v1_bp\nfrom ui import bp as ui_bp\n\napp = Flask(__name__)\napp.config.from_object(config)\n\napp.register_blueprint(a... | python | edit | 3 | 3 | apache-2.0 | fb54f741783ddefd0f452216b96808dea52c055e | sivel/sai | sai/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCreated on Dec 04, 2016\n\n@author: john papa\n\nCopyright 2016 John Papa. All rights reserved.\nThis work is licensed under the MIT License.\n\"\"\"\nimport unittest\n\nfrom cards.card import Card\n\n\nclass Test_Card(unittest.Tes... | python | edit | 1 | 1 | mit | 780a330e1f185d7c19953edb5bc1767582501197 | johnpapa2/twenty-one,johnpapa2/twenty-one | tests/test_card.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.exceptions import ObjectDoesNotExist\nfrom countries_plus.models import Country\n\nfrom .models import Language, CultureCode\n\n\ndef associate_countries_and_languages():\n for country in Country.objects.all():\n ... | python | edit | 2 | 8 | mit | 50f3233a8560120cc0c55b02849f1b586cf1aa27 | cordery/django-languages-plus | languages_plus/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\nfrom ..utils import Timer\n\n__all__ = ['PureTransformer', 'identity']\n\n\nlogger = logging.getLogger(__name__)\n\n\n# Helper class. A tran... | python | edit | 1 | 3 | apache-2.0 | bcef6c233fd607d160bc9042c7957abcea1e43cd | skylander86/ycml | ycml/transformers/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\"\"\"\nExample for rewriting response headers by middleware.\n\"\"\"\n\nimport asyncio\nfrom aiohttp.web import Application, Response\n\n\n@asyncio.coroutine\ndef handler(request):\n return Response(text=\"Everyt... | python | edit | 1 | 3 | apache-2.0 | e264224ee69cb37a02f28a6c78a231dd6d41db58 | alex-eri/aiohttp-1,jettify/aiohttp,hellysmile/aiohttp,z2v/aiohttp,juliatem/aiohttp,rutsky/aiohttp,AlexLisovoy/aiohttp,KeepSafe/aiohttp,mind1master/aiohttp,rutsky/aiohttp,Eyepea/aiohttp,jojurajan/aiohttp,mind1master/aiohttp,jashandeep-sohi/aiohttp,mind1master/aiohttp,alexsdutton/aiohttp,elastic-coders/aiohttp,pathcl/aio... | examples/web_rewrite_headers_middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Route(object):\n def __init__(self, ip, domain):\n self.ip = ip\n self.domain = domain\n\n def __str__(self):\n return self.domain\n\n def query(self):\n \"\"\" search domain routing info \"\"\"\n ... | python | edit | 5 | 4 | apache-2.0 | b75a9eab312a2ac787e4b0e44115f8bad4508418 | bunseokbot/proxy_register,bunseokbot/proxy_register | route/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Lint as: python3\n\"\"\"Tests for spectral.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport os\n\nimport layers... | python | edit | 1 | 1 | apache-2.0 | d1614d3747f72c1f32e74afb6e4b98eb476c7266 | googleinterns/audio_synthesis | utils/layers_test.py | rejected_duplicate | Near-duplicate of sample 20830 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, print_function\n\nimport logging\nimport pkg_resources as _pkg_resources\n\nfrom .scheduler import QueueScheduler\nfrom .executor import OneOffExecutor\nfrom .messages import PythonTask, Pyt... | python | edit | 1 | 0 | apache-2.0 | 9b255d781e3b0aefa708e1366810d14700384d10 | lensacom/satyr | satyr/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.contrib.auth import get_user\nfrom django.shortcuts import redirect\n\n\ndef custom_login_required(view):\n # view argument must be a function\n\n def new_view(request, *args, **kwargs):\n... | python | edit | 1 | 2 | bsd-2-clause | 546a4681aa54ba183e956d220e98ef67ae6de691 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | user/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Vumi Go HTTP API client library.\"\"\"\n\nfrom .send import HttpApiSender, LoggingSender\n\n__version__ = \"0.3.1a0\"\n\n__all__ = [\n 'HttpApiSender', 'LoggingSender',\n]\n\n```\n\nApply this change: Add AccountApiClient to top-le... | python | edit | 1 | 0 | bsd-3-clause | 4955e830d3130a6ae86d4a1c37db23777ee792d7 | praekelt/go-http-api,praekelt/go-http-api | go_http/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom django.contrib import admin\n\nclass UploadedFile(models.Model):\n user = models.ForeignKey(User, verbose_name=u'Käyttäjä')\n d... | python | edit | 1 | 1 | mit | 1cb7581f63d0d9d4e6eca69316930912c41a4fb5 | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | Instanssi/admin_upload/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os.path import basename\n\nfrom website import settings\n\ndef serialize_addon_config(config, user):\n lookup = config.template_lookup\n\n return {\n 'addon_short_name': config.short_name,\n 'addon_full_name': confi... | python | edit | 1 | 4 | apache-2.0 | a778a41c8deb6fd9812e405143e34679122c18db | ZobairAlijan/osf.io,leb2dg/osf.io,doublebits/osf.io,mluo613/osf.io,jolene-esposito/osf.io,alexschiller/osf.io,mattclark/osf.io,laurenrevere/osf.io,jolene-esposito/osf.io,SSJohns/osf.io,billyhunt/osf.io,pattisdr/osf.io,samanehsan/osf.io,DanielSBrown/osf.io,cslzchen/osf.io,caseyrygt/osf.io,zachjanicki/osf.io,Nesiehr/osf.... | website/addons/base/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport h2o\nimport numpy as np\nfrom h2o.estimators.gam import H2OGeneralizedAdditiveEstimator\nfrom tests import pyunit_utils\n\ndef knots_error():\n # load and prepare California housing dataset\n np.random.seed(1234)\n data = h2... | python | edit | 1 | 2 | apache-2.0 | d213aa242b6293a67ba13859a81af4354d81f522 | h2oai/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3 | h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7798_overlapped_knots.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import request\n\ndef get_ip():\n if not request.headers.get(\"X-Forwarded-For\"):\n return request.remote_addr\n\n return request.headers.get(\"X-Forwarded-For\")\n\n```\n\nApply this change: Select the first IP add... | python | edit | 1 | 2 | bsd-2-clause | 7fc3867e7b8a01854116b43d9961e1063c051006 | ryanc/mmmpaste,ryanc/mmmpaste | mmmpaste/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom mock import patch, Mock, MagicMock\nimport os\nimport sys\n\nfrom bind.provider import Provider\n\n\nclass TestBindProvider(unittest.TestCase):\n\n\n @patch('subprocess.check_output')\n @patch('bind.provider.unit... | python | edit | 4 | 1 | mit | 140ff37058eefe4ab79932d96cff4a90aa7b113e | chuckbutler/DNS-Charm,chuckbutler/DNS-Charm | contrib/tests/test_bind_provider.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\n\nheader = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']\nprint '\\t'.join(header)\nfor fi in sys.argv[1:]:\n sample = os.path.basename(fi).split('.')[0]\n with open(fi) as screen_results:\n ... | python | edit | 3 | 0 | apache-2.0 | 1cda84c7f23c6a5e89c9f871dba5d12c00789d1a | pombo-lab/gamtools,pombo-lab/gamtools | extract_contamination.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import RedirectURL\n\n\nclass RedirectURLAdmin(admin.ModelAdmin):\n list_display = ('url', 'short_url', 'hits', 'last_used', 'creator', 'campaign', 'medium',)\n list_filter = ('creator_... | python | edit | 1 | 2 | bsd-3-clause | 380baa34af7e8a704780f0ec535b626f4a286e23 | jbittel/django-deflect | deflect/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.core.mail import send_mail\nfrom django.template.loader import render_to_string\n\ntry:\n from django.contrib.sites.shortcuts import get_current_site # Django 1.9+\nexcept ImportError:\n ... | python | edit | 1 | 4 | apache-2.0 | d9ab07c9c984d50ff93040d0220e4a3997e29f79 | edoburu/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments | fluent_comments/email.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mono_master import MonoMasterPackage\nfrom bockbuild.util.util import *\n\nclass MonoMasterEncryptedPackage (MonoMasterPackage):\n \n def __init__(self):\n MonoMasterPackage.__init__ (self)\n\n self.configure_flags.... | python | edit | 9 | 5 | mit | cc48ad87026b57b02530322b3c27f2d60e94f2e4 | mono/bockbuild,mono/bockbuild | packages/mono_crypto.py | rejected_lint | Too many lint violations: 9 | 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-transforms\n\n\"\"\"\n\nfrom unittest import TestCase, main\nfrom grammpy import *\nfrom grammpy_transforms import ContextFre... | python | edit | 8 | 1 | mit | b242de3217ad9cf6a98ca2513ed1e4f66d2537ad | PatrikValkovic/grammpy | tests/NongeneratingSymbolsRemove/SimpleTest.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.utils import timezone\n\nfrom opps.articles.models import ArticleBox, Article\n\n\ndef set_context_data(self, SUPER, **kwargs):\n context = super(SUPER, self).get_context_data(**kwargs)\n\n article... | python | edit | 1 | 3 | mit | 31d0af7d5f3a984d4f6c7be62d599553a3bc7c08 | YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,williamroot/opps,williamroot/opps,opps/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps | opps/articles/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport shutil\nimport os\n\nopsutils_logger = logging.getLogger('opsutils')\nopsutils_logger.setLevel(logging.DEBUG)\nopsutils_logger.addHandler(logging.StreamHandler())\n\nPATH = os.path.join(os.path.realpath(os.path.dirnam... | python | edit | 1 | 5 | mit | 736388eaf2b408ec28c2948aa412411067f8346d | silas/ops | tests/helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nimport os\nimport shutil\n\nfrom django.core.files.storage import get_storage_class\n\n\ndef delete_user_storage(username):\n\n storage = get_storage_class()()\n\n def _recursive_delete(path):\n directories, fi... | python | edit | 1 | 3 | bsd-2-clause | 815c246f1ef185e24991efc4075b2358c7955c6c | kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat | onadata/libs/utils/storage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nDeploy builds to a Rancher orchestrated stack using rancher-compose\n\"\"\"\nimport os\n\nimport drone\nimport subprocess\n\n\ndef main():\n \"\"\"The main entrypoint for the plugin.\"\"\"\n payload = dr... | python | edit | 1 | 1 | apache-2.0 | eb8884ce0c7dec3433d76c49942f0531cc96d915 | dangerfarms/drone-rancher | plugin/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# '2+3' -> {type:num, value: 2}, {type:op, value:'+'}, {type:num, value: 3}\nclass TokenStream:\n def __init__(self, input_stream):\n self.input_stream = input_stream\n\n def is_whitespace(self, char):\n return char in '... | python | edit | 1 | 4 | mit | dd8c4843b7872023e276247a4d8de052b42fa9a6 | babu-thomas/calculator-parser | token_stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n SQLAlchemy migrate provides two APIs :mod:`migrate.versioning` for\n database schema version and repository management and\n :mod:`migrate.changeset` that allows to define database schema changes\n using Python.\n\"\"\"\n\n... | python | edit | 3 | 0 | mit | 73df211afe212124a69f8585e30d03332b20767c | rcherrueau/sqlalchemy-migrate,rcherrueau/sqlalchemy-migrate,andras-tim/sqlalchemy-migrate,dannon/sqlalchemy-migrate,stackforge/sqlalchemy-migrate,openstack/sqlalchemy-migrate,openstack/sqlalchemy-migrate | migrate/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import ListView, DetailView\nfrom config.utils import get_active_event\nfrom workshops.models import Workshop\n\n\nclass WorkshopListView(ListView):\n template_name = 'workshops/list_workshops.html'\n model =... | python | edit | 1 | 1 | bsd-3-clause | ad07405ca877d65f30c9acd19abb4e782d854eaa | WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web | workshops/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom kivy.uix.button import Button\nimport audio as a_m\n\nclass MyButton(Button):\n def on_touch_up(self, touch, *args, **kwargs):\n if self.collide_point(*touch.pos):\n if not hasattr(self, \"silent\"):\n ... | python | edit | 2 | 3 | mit | a7028ca3d3dea5a9f8891dfd2947b671bbe02b7e | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | pentai/gui/my_button.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import ModelForm\nfrom django.forms.fields import CharField\nfrom models import UserProfile\n\nclass UserProfileForm(ModelForm):\n first_name = CharField(label='First name', required=False)\n last_name = CharField(la... | python | edit | 1 | 2 | mit | 882fc867ab115f2b84f2f185bcebf3eb4a1d2fc8 | kenwang76/readthedocs.org,soulshake/readthedocs.org,nyergler/pythonslides,gjtorikian/readthedocs.org,tddv/readthedocs.org,kenshinthebattosai/readthedocs.org,ojii/readthedocs.org,LukasBoersma/readthedocs.org,mhils/readthedocs.org,sid-kap/readthedocs.org,michaelmcandrew/readthedocs.org,michaelmcandrew/readthedocs.org,oji... | core/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014, Warren Weckesser\n# All rights reserved.\n# See the LICENSE file for license information.\n\nfrom numpy.testing import Tester as _Tester\n\nfrom ._odeintw import odeintw\n\n\n__version__ = \"0.1.2.dev3\"\n\ntest = _Tes... | python | edit | 3 | 0 | bsd-3-clause | a39a7eb7d43282337d3e3df10921a1b0d9f0e3e4 | WarrenWeckesser/odeintw | odeintw/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport pathlib\nimport argparse\nimport pkg_resources\n\nfrom jacquard.config import load_config\n\n\ndef argument_parser():\n parser = argparse.ArgumentParser(description=\"Split testing server\")\n parser.add_argument(\n... | python | edit | 1 | 2 | mit | 83a517ad963e08e0200e4eeb3a817acc069ba7a4 | prophile/jacquard,prophile/jacquard | jacquard/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport logging\n\nfrom freight import notifiers\nfrom freight.config import celery, redis\nfrom freight.models import Task\nfrom freight.notifiers import queue\nfrom freight.utils.redis import lock\... | python | edit | 1 | 5 | apache-2.0 | a116b22a76b0f833aa9f7f2e2ce4b36a95bc9ba0 | getsentry/freight,klynton/freight,rshk/freight,rshk/freight,rshk/freight,klynton/freight,rshk/freight,getsentry/freight,klynton/freight,klynton/freight,getsentry/freight,getsentry/freight,getsentry/freight | freight/tasks/send_pending_notifications.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport data_loader\nimport descriptives\nimport network as module_network\nimport timeline as module_timeline\nimport wordclouds as module_wordclouds\n\n__sources = dir( data_loader )\n__sources = filter( lambda x: x.startswith('load_') , _... | python | edit | 1 | 7 | mit | 0874b3e5d5316c53d1d941e4e337bec45469bf6d | HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core | core/hybra.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update URL for generic graph api url"
},
{
"role": "assistant",
"content": "FACEBOOK_MESSAGES_POST_URL = \"https://graph.facebook.com/v2.6/\""
}
] | python | new_file | 1 | 0 | mit | 28ee229284459402d73f41e756dc95fe99f0227b | ben-cunningham/python-messenger-bot,ben-cunningham/pybot | pybot/resources/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport urlparse\n\nimport celery\nimport requests\nfrom celery.utils.log import get_task_logger\nfrom django.conf import settings\n\nfrom framework.tasks import app as celery_app\n\nlogger = get_task_logger(__name__)\n\nclass VarnishTask(ce... | python | edit | 1 | 4 | apache-2.0 | 6c19a46f4ef146a67c43ca46c3e71dd2a05358fc | adlius/osf.io,billyhunt/osf.io,baylee-d/osf.io,GageGaskins/osf.io,caneruguz/osf.io,doublebits/osf.io,mluke93/osf.io,felliott/osf.io,asanfilippo7/osf.io,icereval/osf.io,billyhunt/osf.io,emetsger/osf.io,saradbowman/osf.io,doublebits/osf.io,mluke93/osf.io,zamattiac/osf.io,chennan47/osf.io,doublebits/osf.io,acshi/osf.io,cs... | api/caching/tasks.py | rejected_duplicate | Near-duplicate of sample 19875 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass BaseModel(models.Model):\n model_name = None\n #title\n #description\n #preview\n #table_fields = []\n\n def admin_url(self):\n name = self.model_name.replace(\"-\", \"_\").lowe... | python | edit | 1 | 2 | mit | ed45016c7319d2df1f894ec17971d0d1c4d8abe1 | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | museum_site/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nfrom bs4 import BeautifulSoup\nfrom source.models.rt_rating import RTRating\n\n\nclass RottenTomatoesService:\n\n __URL = 'http://www.rottentomatoes.com/m/'\n __SEPERATOR = '_'\n\n def __init__(self, title):\n ... | python | edit | 1 | 3 | mit | 996e862befb339165a801673754343fc643ffa86 | jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu | source/services/rotten_tomatoes_service.py | rejected_duplicate | Near-duplicate of sample 17189 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom . import deps\nfrom . import commands\nfrom . import launch\nfrom . import scripts\n\n\ndef run(args=None):\n\tif args is None:\n\t\targs = sys.argv[1:]\n\tpip_args, params = commands.parse_script_args(args)\n\tcommands.i... | python | edit | 1 | 2 | mit | 6aea2f1c3a478be0c6926f442924e1f263955430 | jaraco/rwt | pip_run/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom __future__ import unicode_literals, print_function\nfrom sys import platform\n\nif platform == 'darwin':\n from .osx import OSXVolumeController as VolumeController\nelse:\n raise NotImplementedError(\n 'Vo... | python | edit | 3 | 0 | bsd-3-clause | cd9048f64c6a2184e148daf0baa7bb3be51b3268 | Microcore/AGT,Microcore/YAS | vol/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2017 Luke San Antonio Bialecki\n# All rights reserved.\n\nfrom datetime import datetime, timezone\n\nDATE_FMT = '%Y-%m-%d'\n\n\ndef date_to_str(day):\n return day.strftime(DATE_FMT)\n\n\ndef str_to_date(s):\n return da... | python | edit | 3 | 2 | mit | 5dcdfa510e62d754bce6270286e42a76b37c23c4 | lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend | inpassing/worker/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.conf import settings\nfrom django.http import HttpResponse\nfrom rest_framework.generics import ListAPIView\nfrom registries.models import Organization\nfrom registries.serializers import Dri... | python | edit | 4 | 1 | apache-2.0 | 1e0ac4612937583dec22a81db833c7962e91edc8 | rstens/gwells,bcgov/gwells,bcgov/gwells,rstens/gwells,rstens/gwells,bcgov/gwells,rstens/gwells,bcgov/gwells | registries/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom sqlalchemy import (\n Column,\n Date,\n Integer,\n MetaData,\n Numeric,\n String,\n Table,\n create_engine,\n)\n\n\nmetadata = MetaData()\n\nmeasurement = Table('measurement', metadata... | python | edit | 1 | 1 | mit | 7f863c30f7e49da29530d141a76c1976e0a679ee | jaapverloop/massa | massa/domain.py | rejected_duplicate | Near-duplicate of sample 19787 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .compress import Compress\nfrom .copy import Copy\nfrom .fix_dicom import FixDicom\nfrom .group_dicom import GroupDicom\nfrom .map_ctp import MapCTP\nfrom .move import Move\nfrom .glue import Glue\nfrom .uncompress import Uncompress\nf... | python | edit | 14 | 0 | bsd-2-clause | e58688d87ba1c4af718ea3e427d94f68c3df3b16 | ohsu-qin/qipipe | qipipe/interfaces/__init__.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division\n\nfrom .module import Module\n\n\nclass DCMotor(object):\n def __init__(self, name, delegate):\n self._name = name\n self._delegate = delegate\n self._speed = None\n\n @property\n ... | python | edit | 1 | 2 | mit | d74908f5acb5c1a88965ed086d41435e0041d85b | pollen/pyrobus | pyluos/modules/l0_dc_motor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom fabric.api import run, env, settings, cd, put, sudo\nfrom fabric.contrib import files\n\nimport private\n\ndef prod():\n env.hosts = list(private.PROD_SERVERS)\n\n\ndef local():\n env.hosts = ['localhost']\n\n\ndef d... | python | edit | 4 | 2 | mit | e0c07b4078caaa4220040d0e8c4ed86e3a2bf087 | lextoumbourou/lextoumbourou.com-old,lextoumbourou/lextoumbourou.com-old | lextoumbourou/fabfile.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom django.contrib import auth\n\nurlpatterns = patterns('',\n url(r'^login/$', 'django.contrib.auth.views.login',{'template_name': 'members/login_form.html'}, name='login'),\n url(r'^logou... | python | edit | 1 | 0 | mit | 70efbd90d9d5601d368ddb5ea20a3b9910539b78 | Hackfmi/Diaphanum,Hackfmi/Diaphanum | members/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ni = input()\nfloor = 0\nfor x in range(0, len(i)):\n if i[x] == '(':\n floor +=1;\n elif i[x] == ')':\n floor -=1;\nprint(floor)\n```\n\nApply this change: Add second part of puzzle"
},
{
"role": "assistant",
... | python | edit | 1 | 0 | mit | 1aa050f2d50fb206ffb1a7d06e75cc2ba27cc91b | Walther/adventofcode,Walther/adventofcode,Walther/adventofcode | 1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pygame\nimport random\nfrom demodulate.cfg import *\nfrom gen_tone import *\n\nif __name__ == \"__main__\":\n\tpygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1)\n\tpygame.mixer.init()\n\tWPM = random.uniform(2,20)\n\t... | python | edit | 7 | 0 | mit | b2e537c2d054854d0b36ccee7567c9ba9c2a5516 | nickodell/morse-code | modulation_test.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# this contains imports plugins that configure py.test for astropy tests.\n# by importing them here in conftest.py they are discoverable by py.test\n# no matter how it is invoked within the astropy tree.\n\nfrom .tests.pytest_plugins import... | python | edit | 4 | 0 | bsd-3-clause | 6bc6a07ee60f68e2003b5afcc752c3820a176541 | kelle/astropy,tbabej/astropy,lpsinger/astropy,joergdietrich/astropy,pllim/astropy,MSeifert04/astropy,AustereCuriosity/astropy,saimn/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,tbabej/astropy,mhvk/astropy,DougBurke/astropy,pllim/astropy,StuartLittlefair/astropy,astropy/astropy,kelle/astropy,AustereCuriosi... | astropy/conftest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2020, Kay Hayen, mailto:<EMAIL>\n#\n# Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n# integrates with CPython, but also works on its own.\n#\n# Licensed under the Apache License, Versi... | python | edit | 2 | 0 | apache-2.0 | d9d0af04ea76c6c6bd346ce417e9feb61580c90e | kayhayen/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka | nuitka/plugins/commercial/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http.response import HttpResponse\nfrom django.template import Context, loader\n\nfrom .models import Tag\n\n\ndef homepage(request):\n tag_list = Tag.objects.all()\n template = loader.get_template(\n 'organizer/tag... | python | edit | 1 | 1 | bsd-2-clause | 84eb438c966d5c2794a0842dccaefea726c0dbb9 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\n\nfrom django.core.management.base import BaseCommand\nfrom django.contrib.auth.models import User\n\nfrom mla_game.apps.accounts.models import Profile\n\nfrom ...models import (\n Transcript, TranscriptPhraseDownvote\n)\n... | python | edit | 1 | 4 | mit | ad0f4e793ea010df243b87f42fff94037432e7b2 | WGBH/FixIt,WGBH/FixIt,WGBH/FixIt | mla_game/apps/transcript/management/commands/fake_game_one_gameplay.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\n\n\nclass PublishableAdmin(admin.ModelAdmin):\n \"\"\"\n Overrides standard admin.ModelAdmin save_model method\n It sets user (author) based on data ... | python | edit | 1 | 2 | mit | 1056bb70699f2c480f887b13dd28b412a7aeb6c5 | YACOWS/opps,jeanmask/opps,williamroot/opps,williamroot/opps,opps/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,opps/opps | opps/core/admin.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.