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\nfrom ez_setup import use_setuptools\nuse_setuptools()\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='crane',\n version='0.1.0',\n description=\"A simple tool for building Dockerfiles\",\n author='Victor Lin',\n... | python | edit | 1 | 0 | apache-2.0 | e2cdf1be3a9f1e9eb501332a4f2358f037dea0bd | victorlin/crane | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\nfrom os import path\n\nwith open(path.join(path.abspath(path.dirname(__file__)), 'README.rst')) as f:\n readme = f.read()\n\nsetup(\n name='ghstats',\n version='1.2.0',\n packages=['ghstats'],\n ... | python | edit | 1 | 0 | mit | fbd1407608505a1107042c14b8fc5cc6017d9e78 | kefir500/ghstats | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nsetup(\n name='pandas-profiling',\n version='0.1.0',\n author='Jos Polfliet',\n author_email='<EMAIL>',\n packages=['pandas_... | python | edit | 1 | 0 | mit | 4bc1810f6f04a639726f68b06273722b5fc6e87f | JosPolfliet/pandas-profiling,JosPolfliet/pandas-profiling | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Module:\t__init__\n# Date:\t\t8th November 2008\n# Author:\tJames Mills, prologic at shortcircuit dot net dot au\n\n\"\"\"Circuits Tools\n\ncircuits.tools contains a standard set of tools for circuits. These\ntools are installed as execut... | python | edit | 1 | 8 | mit | f8e800219ac2c2c76bb5ac10b2dfdac038edbb5d | treemo/circuits,eriol/circuits,eriol/circuits,treemo/circuits,treemo/circuits,nizox/circuits,eriol/circuits | circuits/tools/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.2.10 on 2020-04-09 21:24\n\nfrom django.db import migrations\n\n\ndef add_deferred_user_role(apps, schema_editor):\n DEFERRED_MENTOR = 'Deferred Mentor'\n UserRole = apps.get_model('accelerator', 'UserRole')\n ... | python | edit | 1 | 5 | mit | 1ad0ca50d1f4c61513bea33a4ffd999406c69600 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0019_add_deferred_user_role.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\n\nfrom django.conf import settings\nfrom django.core.urlresolvers import reverse\n\nfrom social.utils import setting_name, module_member\nfrom social.strategies.utils import get_strategy\n\n\nBACKENDS = settings... | python | edit | 1 | 3 | bsd-3-clause | ec24e051e9d10b4cb24d135a3c08e9e9f87c6b8c | fearlessspider/python-social-auth,MSOpenTech/python-social-auth,clef/python-social-auth,JJediny/python-social-auth,firstjob/python-social-auth,muhammad-ammar/python-social-auth,henocdz/python-social-auth,ariestiyansyah/python-social-auth,python-social-auth/social-app-django,falcon1kr/python-social-auth,lamby/python-soc... | social/apps/django_app/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for loading script."
},
{
"role": "assistant",
"content": "from django.test import TestCase\nfrom .models import Pregunta, Seccion, Subseccion\nfrom .load import load_data\n\n\nclass TestLoadPreguntas(TestCase):\n \"\... | python | new_file | 1 | 1 | mit | 397099cc8e2628a548c66957168dfab3de7f7f59 | erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online | estudios_socioeconomicos/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.trial.unittest import TestCase\n\nfrom go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend\nDummyBackend, DummyMetrics\n\n\nclass TestFixtures(TestCase):\n def test_add(self):\n fixtures = Fixtures()\... | python | edit | 1 | 1 | bsd-3-clause | 04f7f28ef3123452d8eb06ab1f3cbfa6dded8be4 | praekelt/go-metrics-api,praekelt/go-metrics-api | go_metrics/metrics/tests/test_dummy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\nimport tempfile\n\n# Local modules\nimport library.server as server\n\n\nclass ServerTestCase(unittest.TestCase):\n\n @classmethod\n def setUp(self):\n self.db_fd, server.app.config['DATABASE'] = tem... | python | edit | 1 | 1 | mit | 823e767f52bc6e3bf78a91950e9407a1acf811d2 | HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library | tests/test_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"pygametemplate module for making creating games with Pygame easier.\"\"\"\n\n\nfrom __future__ import absolute_import\n\n\n__version__ = \"0.2.0\"\n__author__ = \"Andrew Dean\"\n\n\nfrom pygametemplate.game import Game\n\n```\n\nApply... | python | edit | 4 | 0 | mit | 010de29acb284250667b393f9e1ba7b34b53aaf5 | AndyDeany/pygame-template | pygametemplate/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass PackageData(object):\n def __init__(self, local_file, name, version):\n self.local_file = local_file\n self.name = name\n self.version = version\n\nclass PypiData(PackageData):\n def __init__(self, local_fil... | python | edit | 1 | 2 | mit | c39c60de325f5ce827de423abc646bd8662c80fb | mcyprian/pyp2rpm,henrysher/spec4pypi,MichaelMraka/pyp2rpm,pombredanne/pyp2rpm,yuokada/pyp2rpm,fedora-python/pyp2rpm,joequant/pyp2rpm | pyp2rpmlib/package_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport re\n\nfrom pyfr.quadrules.base import BaseQuadRule, BaseTabulatedQuadRule\nfrom pyfr.quadrules.line import BaseLineQuadRule\nfrom pyfr.quadrules.tri import BaseTriQuadRule\nfrom pyfr.util import subclass_ma... | python | edit | 4 | 4 | bsd-3-clause | e5d88beba41de18ebab33e0770ddd8bb5174491e | tjcorona/PyFR,tjcorona/PyFR,iyer-arvind/PyFR,BrianVermeire/PyFR,tjcorona/PyFR,Aerojspark/PyFR | pyfr/quadrules/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport numpy as np\n\nclass CalculationMethodsTestCase(unittest.TestCase):\n def setUp(self):\n self.dem = DEMGrid()\n\n def test_calculate_slope(self):\n sx, sy = self.dem._calculate_slope()\n\n def ... | python | edit | null | null | mit | 1de254b56eba45ecdc88d26272ab1f123e734e25 | stgl/scarplet,rmsare/scarplet | tests/test_dem.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport numpy\n\nfrom chainer import cuda\nfrom chainer import datasets\nfrom chainer import testing\nfrom chainer.testing import attr\n\n\nclass TestTupleDataset(unittest.TestCase):\n\n def setUp(self):\n self.x... | python | edit | 1 | 2 | mit | 7f38276fddc3d94f791d29d3bcbff4bfc9d4ee98 | okuta/chainer,cupy/cupy,hvy/chainer,keisuke-umezawa/chainer,niboshi/chainer,anaruse/chainer,ronekko/chainer,keisuke-umezawa/chainer,jnishi/chainer,chainer/chainer,hvy/chainer,keisuke-umezawa/chainer,ktnyt/chainer,kikusu/chainer,okuta/chainer,delta2323/chainer,niboshi/chainer,niboshi/chainer,rezoo/chainer,wkentaro/chain... | tests/chainer_tests/datasets_tests/test_tuple_dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\n\nurlpatterns = patterns(\n 'tagging_autocomplete.views',\n url(r'^list$', 'list_tags', name='tagging_autocomplete-list'),\n)\n\n```\n\nApply this change: Drop the deprecated way of specif... | python | edit | 1 | 0 | mit | 16091eebd0242782715600df9f6db9596f5797fe | ludwiktrammer/django-tagging-autocomplete | tagging_autocomplete/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom paste.deploy.converters import asbool\n\nlog = logging.getLogger(__name__)\n\ndef _turbogears_backlash_context(environ):\n tgl = environ.get('tg.locals')\n return {'request':getattr(tgl, 'request', None)}\n\ndef E... | python | edit | 1 | 3 | mit | a92397bb2218f174a2df0b5090dd31bde2164561 | lucius-feng/tg2,lucius-feng/tg2 | tg/error.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app import app\nfrom flask import redirect, render_template\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\n# default 'catch all' route\n@app.route('/', defaults={'path': ''})\n@app.route('/<path:path>')\n... | python | edit | 1 | 3 | mit | 5a764e0b91db628efd20d63d70c5ed688695f8b1 | starcalibre/MNIST3D,starcalibre/MNIST3D,starcalibre/MNIST3D | app/routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nasync def init():\n me = input('Who are you? ').strip()\n wallet_name = '%s-wallet' % me\n\n # 1. Create Wallet and Get Wallet Handle\n try:\n await wallet.create_wallet(pool_name, wallet_name, None, None, None)\n exce... | python | edit | 1 | 5 | apache-2.0 | 012ab9bf79ae2f70079534ce6ab527f8e08a50f3 | anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,Art... | doc/tutorials/python/secure-msg-template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# vim: set fileencoding=UTF-8 :\n\n\nimport inspect\n\n\nclass DynamicMethods(object):\n\n def list_methods(self, predicate):\n \"\"\"Find all transform methods within the class that satisfies the\n p... | python | edit | 1 | 6 | mit | 5e4c12067ee2b1d9affceaea789405422f7233a1 | admk/soap | ce/common.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .utils import TestCase, skipUnless\nfrom dynsupdate import client\nimport os\n\n\nclass DnsTests(TestCase):\n\n @skipUnless(os.getenv(\"SLOW\"), \"To slow\")\n def test_build_resolver(self):\n domain = 'google-public-dns-a... | python | edit | 1 | 1 | bsd-3-clause | 28f25bb7ca5a415bbc3ca2aabd7e290339140a9f | bacher09/dynsupdate | tests/test_dns.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom openmdao.main.api import Component\nfrom openmdao.lib.datatypes.api import Float\n\n#put inside pod\nclass Aero(Component): \n \"\"\"Place holder for real aerodynamic calculations of the capsule\"\"\" \n #Inputs\n coef_drag = ... | python | edit | 1 | 1 | apache-2.0 | e6d9524d6e29077cfb805cbafd99caf2b080a1c6 | HyperloopTeam/Hyperloop,paulopperman/Hyperloop,whiplash01/Hyperloop,whiplash01/Hyperloop,UwHyperloop/Hyperloop,UwHyperloop/Hyperloop,HyperloopTeam/Hyperloop,paulopperman/Hyperloop,kishenr12/Hyperloop,kishenr12/Hyperloop | src/hyperloop/aero.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Data sources\ndatabase(\n thermoLibraries = ['primaryThermoLibrary'],\n reactionLibraries = [],\n seedMechanisms = [],\n kineticsDepositories = ['training'],\n kineticsFamilies = 'default',\n kineticsEstimator = 'rate ru... | python | edit | 12 | 0 | mit | e6cf8c244cdffa08d67a45c3a44236c3b91aab78 | chatelak/RMG-Py,pierrelb/RMG-Py,enochd/RMG-Py,comocheng/RMG-Py,chatelak/RMG-Py,nyee/RMG-Py,enochd/RMG-Py,nickvandewiele/RMG-Py,nyee/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,comocheng/RMG-Py | examples/rmg/liquid_phase/input.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport unittest\nimport os\nimport shutil\n\nfrom sqlalchemy import create_engine\n\nfrom rtrss import config, database\n\n\nlogging.disable(logging.ERROR)\n\nengine = create_engine(config.SQLALCHEMY_DATABASE_URI,\n ... | python | edit | 1 | 2 | apache-2.0 | a118e2b7133cf4391c1df41d95f9e4329a0bf5e9 | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n# ! python2\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n\"\"\"Tests for django-custom-500's decorators\"\"\"\n\nimport unittest\nimp... | python | edit | 1 | 1 | mit | 038e60b342367e3ea6499d16d4f8a9666d99d0bf | illagrenan/django-custom-500,illagrenan/django-custom-500 | django_custom_500/example_project/tests/test_basic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nSTEP_COUNTS = {\n \"delete_reference\": 2,\n \"import_reference\": 0,\n \"setup_remote_reference\": 0,\n \"update_remote_reference\": 0,\n \"update_software\": 0,\n \"install_hmms\": 0\n}\n\nFIRST_STEPS = {\n \"delete_r... | python | edit | 1 | 2 | mit | 36dd1493f329e82edd4ed514bfaaa0b58c882141 | virtool/virtool,virtool/virtool,igboyes/virtool,igboyes/virtool | virtool/processes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport mock\n\nimport chainer\nfrom chainer.functions.pooling import pooling_nd_kernel\nfrom chainer import testing\nfrom chainer.testing import attr\n\n\n@testing.parameterize(*testing.product({\n 'ndim': [2, 3, 4],\n... | python | edit | 1 | 1 | mit | cca7dee87863219b382321ba563cb48b1e58a4fb | cupy/cupy,hvy/chainer,jnishi/chainer,ysekky/chainer,kashif/chainer,jnishi/chainer,delta2323/chainer,keisuke-umezawa/chainer,jnishi/chainer,niboshi/chainer,niboshi/chainer,hvy/chainer,keisuke-umezawa/chainer,okuta/chainer,wkentaro/chainer,wkentaro/chainer,tkerola/chainer,ronekko/chainer,ktnyt/chainer,chainer/chainer,kei... | tests/chainer_tests/functions_tests/pooling_tests/test_pooling_nd_kernel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport uuid\n\nfrom django.db import models\nfrom django.utils.translation import pgettext_lazy\n\nfrom ..account.models import Address\nfrom ..shipping.models import ShippingZone\n\n\nclass WarehouseQueryset(models.QuerySet):\n def pref... | python | edit | 1 | 1 | bsd-3-clause | 616e542ee32b1ac83dd4d1977119ef670520c476 | mociepka/saleor,mociepka/saleor,mociepka/saleor | saleor/warehouse/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\nimport ruamel.yaml\nyaml = ruamel.yaml.YAML()\n\nclass Operation():\n def __init__(self, extension):\n self.extension = extension\n\nclass Merge(Operation):\n def apply(self, base):\n ... | python | edit | 1 | 4 | mit | 7653f2c6e4f72e40eefee5d70d83ceafb8bc4282 | Thom1729/YAML-Macros | lib/extend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# \n# MIT License\n\n# Copyright (c) 2017 Hampus Tågerud\n# \n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files\n# (the \"Software\"), to deal in the ... | python | edit | 1 | 5 | mit | f5bbdea74c0f8a0cc8ac4331ea8adc45c3f266c8 | hampustagerud/colorconverter | converter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\n\nclass Task(object):\n\n def __init__(self, number, description, maxPoints):\n self.number = number\n self.description = description\n self.maxPoints = maxPoints\n\n```\n\n... | python | edit | 1 | 1 | mit | a06ca6899062bab407cb4c6884d0bf148a380b1f | hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem | netsecus/task.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import migrations\n\nimport waldur_core.core.fields\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('core', '0007_changeemailrequest'),\n ]\n\n operations = [\n migrations.AddField(\... | python | edit | 1 | 0 | mit | b6d9e7c24b0185d6a715adee4fc457afda6078f4 | opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | src/waldur_core/core/migrations/0008_changeemailrequest_uuid.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python\n# coding: utf-8\n\nimport argparse\nimport asyncio\n\nimport lglass.dn42\nimport lglass.whois.engine\nimport lglass.whois.server\n\ndef create_database(db_path):\n return lglass.dn42.DN42Database(db_path)\n\nif __name__ ==... | python | edit | 1 | 1 | mit | 33e88c063fedb11211e3786a9d722a9d12f72ce8 | fritz0705/lglass | contrib/dn42_whoisd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom SVGGenerator import SVGGenerator\nfrom Label import Label\n\n\nclass Chart(SVGGenerator):\n def __init__(self, name, title, data):\n SVGGenerator.__init__(self, './chart.svg.mustache')\n self.name = name\n self.... | python | edit | 1 | 1 | mit | fdb3801a513357c4f5ba655a6216ba59ee1e3df9 | gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x,thelonious/g2x,gizmo-cda/g2x | overlay/Chart.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom performance_testing.result import Result, File\nimport os\nimport shutil\n\n\nclass ResultTestCase(unittest.TestCase):\n def setUp(self):\n self.current_directory = os.path.dirname(os.path.abspath(__file__))\... | python | edit | 3 | 2 | mit | 4a4a3eed7b959e342e3ff00dfc28f116158839d6 | BakeCode/performance-testing,BakeCode/performance-testing | tests/test_result.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSo this is where all the SQL commands live\n\"\"\"\n\nCREATE_SQL = \"\"\"\nCREATE TABLE component_type (\n id INT PRIMARY KEY AUTO_INCREMENT,\n type VARCHAR(255) UNIQUE\n);\n\n\nCREATE TABLE components (\n id INT PRIMARY KE... | python | edit | 1 | 0 | mit | 222628c6747bdc3574bcb7cf6257c785ffa6451d | worldcomputerxchange/inventory-control,codeforsanjose/inventory-control | inventory_control/database/sql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom unittest import mock\n\nfrom action import PrintAction\n\n\n@mock.patch(\"builtins.print\")\nclass PrintActionTest(unittest.TestCase):\n def test_executing_action_prints_message(self, mock_print):\n action = ... | python | edit | 3 | 1 | mit | a13829a0c2b95773832e68e6f0a1dc661a288ec4 | bsmukasa/stock_alerter | tests/test_action.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2017 LINE Corporation\n# These sources are released under the terms of the MIT license: see LICENSE\n\nimport requests.sessions\n\nfrom promgen.version import __version__\n\n\ndef post(url, **kwargs):\n with requests.sess... | python | edit | 1 | 1 | mit | a2997b5f76c658ba8ddd933275aa6f37c1bedc50 | kfdm/promgen,kfdm/promgen,kfdm/promgen,kfdm/promgen | promgen/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test that `s` as a Dask Array is preserved\n\nEnsure that if `s` is a Dask Array, it will still be a Dask Array after\ntype normalization is done on the input arguments of the Fourier\nfilters. This allows Fourier filters to construct a comp... | python | new_file | 4 | 1 | bsd-3-clause | 53acdb65defa43db67f11a5c5a41c1353e9498f7 | dask-image/dask-ndfourier | tests/test__utils.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Define __all__ in intelligibility_models package\n\nDefine to import all intelligibility models available if one imports\nwith *. Also, allows to import the models directly from\nintelligibility_models, rather than having to import the modul... | python | new_file | 1 | 0 | bsd-3-clause | aaf0d25cae834222f14303f33ab126be7ae29142 | achabotl/pambox | pambox/intelligibility_models/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The metrics module implements functions assessing prediction error for specific purposes.\"\"\"\n\nimport numpy as np\n\ndef trapz(x, y):\n \"\"\"Trapezoidal rule for integrating\n the curve defined by x-y pairs.\n Assume x a... | python | edit | 1 | 2 | mit | 56327baa67d5f05551bc52a1c0466e8d8b905797 | ceshine/isml15-wed | metrics.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponseBadRequest\r\nfrom django.contrib import auth\r\n\r\n\r\nclass TokenMiddleware(object):\r\n \"\"\"\r\n Middleware that authenticates against a token in the http authorization header.\r\n \"\"\"\r... | python | edit | 1 | 4 | mit | e90cc22226189b8950957cbf8637e49ee7798c4b | jasonbeverage/django-token | django_token/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This is an example test settings file for use with the Django test suite.\n#\n# The 'sqlite3' backend requires only the ENGINE setting (an in-\n# memory database will be used). All other backends will require a\n# NAME and potentially aut... | python | edit | 1 | 0 | bsd-3-clause | 0819957eda318205e17591dccd81482701eab25c | dbaxa/django,gunchleoc/django,varunnaganathan/django,yamila-moreno/django,dracos/django,savoirfairelinux/django,crazy-canux/django,mattseymour/django,charettes/django,MatthewWilkes/django,dsanders11/django,ccn-2m/django,beck/django,dgladkov/django,litchfield/django,MounirMesselmeni/django,jyotsna1820/django,ojake/djang... | tests/test_sqlite.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2021 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache... | python | edit | 1 | 3 | apache-2.0 | 43b8e4de31d0659561ffedfeb0ab4a42f035eade | google/j2cl,google/j2cl,google/j2cl,google/j2cl,google/j2cl | dev/test_all.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\nfrom hamcrest import *\nimport unittest\nfrom .hamcrest imp... | python | edit | 16 | 1 | bsd-3-clause | a3c3c5f4cbbea80aada1358ca52c698cf13136cc | daaang/blister | unittests/test_xmp.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nMain world controller.\n\"\"\"\n\nfrom appstate import AppState\nimport pygame\nimport events\n\nclass Controller(events.EventListener):\n \"\"\"\n Controller class.\n \"\"\"\n\n def __init__(self):\n pass\n\n ... | python | edit | 1 | 5 | mit | 721be562a175227fa496789e9ce642416c5993b7 | Beskhue/enactive-agents,Beskhue/enactive-agents,Beskhue/enactive-agents | enactiveagents/controller/controller.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2011 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\n\n\"\"\"Top-level presubmit script for GYP.\n\nSee http://dev.chromiu... | python | edit | 1 | 1 | bsd-3-clause | ef27b615702d9ce84db9087898c1f66286e66cf2 | csulmone/gyp,csulmone/gyp,csulmone/gyp,csulmone/gyp | PRESUBMIT.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# igcollect - Memcached\n#\n# Copyright (c) 2016, InnoGames GmbH\n#\n\nimport telnetlib\nimport sys\nimport socket\nimport time\n\n\ndef main(host='127.0.0.1', port='11211'):\n hostname = socket.gethostname().re... | python | edit | 1 | 3 | mit | 5ae5c27f69cdfb1c53ada0a2aa90d76c4d3ce421 | innogames/igcollect | memcached.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" A startup script for IPython to patch it to 'inspect' using cinspect. \"\"\"\n\n# Place this file in ~/.ipython/<PROFILE_DIR>/startup to patch your IPython to\n# use cinspect for the code inspection.\n\nimport inspect\n\nfrom cinspec... | python | edit | 2 | 3 | bsd-3-clause | 9942b7b6e550ec6f76def44a7470f747c47b13a8 | punchagan/cinspect,punchagan/cinspect | utils/00-cinspect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport logging\n\nfrom gensim.models import word2vec\n\ndef main():\n\n logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)\n sentences = word2vec.LineSentence(\"wiki_... | python | edit | 1 | 1 | mit | b3f516b91d118824bb90f834184aa25a5a5f1c68 | zake7749/word2vec-tutorial | train.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 0 | apache-2.0 | 3863bda6af40f62e49f4883468f4947d46f0cccc | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Configuration file for the Sphinx documentation builder.\n#\n# For the full list of built-in configuration values, see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n# -- Project information -------... | python | edit | 1 | 0 | mit | afd496ccdde07502e6f42ae1b4127d130aed050c | galaxyproject/gravity | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport json\nfrom indra.sources.trips.drum_reader import DrumReader\nfrom indra.sources.trips import process_xml\n\ndef read_content(content):\n sentences = []\n for k, v in content.items():\n sentences += v\n dr... | python | edit | 1 | 4 | bsd-2-clause | c5cf8df78106e15a81f976f99d26d361b036318a | bgyori/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,bgyori/indra,sorgerlab/indra,sorgerlab/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,pvtodorov/indra,bgyori/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra | indra/tools/reading/run_drum_reading.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport random\ntry:\n import json\nexcept ImportError:\n import simplejson as json\nfrom fake_useragent import settings\nfrom fake_useragent.build import build_db\n\n\nclass UserAgent(object):\n def __init__(self):\n ... | python | edit | 1 | 7 | apache-2.0 | 0e5b2af3fe04bd12b95b15215db0416b79c25df6 | sebalas/fake-useragent,hellysmile/fake-useragent,hellysmile/fake-useragent,hellysmile/fake-useragent,mochawich/fake-useragent | fake_useragent/fake.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [msm/flux] Include flux package in doc"
},
{
"role": "assistant",
"content": "r\"\"\"\n\n===================================================================\nflux - Reactive flux an transition pathways (:mod:`emma2.msm.flux`)\n==... | python | new_file | 2 | 0 | bsd-2-clause | a2e4e8593ec4c09d504b74544b134d27d1428ce3 | arokem/PyEMMA,trendelkampschroer/PyEMMA,trendelkampschroer/PyEMMA,arokem/PyEMMA | emma2/msm/flux/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom index import app\nfrom flask import render_template, request\nfrom config import BASE_URL\nfrom query import get_callout, get_billboard\n\nSHEET_ID = 'tzE2PsqJoWRpENlMr-ZlS8A'\n#SHEET_ID = 'tIk5itVcfOHUmakkmpjCcxw' # Demo sheet\n\n\n#... | python | edit | 1 | 1 | apache-2.0 | 5abe9a29ae586907304649fe6682e3e8997da310 | vprnet/audio-player,vprnet/audio-player,vprnet/audio-player | app/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\nif \"tastypie\" in settings.INSTALLED_APPS:\n\t# Tastypie resources are importable from the api package level (backwards compatibility)\n\tfrom .tastypie import APNSDeviceResource, GCMDeviceResource, WNSD... | python | edit | 1 | 0 | mit | adcb7af597c77d85eb9234d91e2c0bd8575630e1 | xtrinch/fcm-django | fcm_django/api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport libsinan\n\nfrom libsinan import handler, output, jsax\n\n\nclass VersionCheckTaskHandler(output.SimpleTaskHandler):\n\n def object_end(self):\n \"\"\" We only get one object per right now so\n lets print it out when... | python | edit | 3 | 3 | mit | 9a791b9c5e79011edaa2a9d2f25bf92e0bf17543 | erlware-deprecated/sinan,erlware-deprecated/sinan,ericbmerritt/sinan,ericbmerritt/sinan,erlware-deprecated/sinan,ericbmerritt/sinan | client/libsinan/version_check_handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nPerformance tests for the agent/dogstatsd metrics aggregator.\n\"\"\"\n\n\nfrom aggregator import MetricsAggregator\n\n\n\n\nclass TestAggregatorPerf(object):\n\n def test_aggregation_performance(self):\n ma = MetricsAggre... | python | edit | 4 | 4 | bsd-3-clause | 77b5680794a7a60dedf687f4a199e48121f96955 | yuecong/dd-agent,darron/dd-agent,oneandoneis2/dd-agent,AniruddhaSAtre/dd-agent,packetloop/dd-agent,remh/dd-agent,guruxu/dd-agent,jyogi/purvar-agent,relateiq/dd-agent,JohnLZeller/dd-agent,citrusleaf/dd-agent,lookout/dd-agent,citrusleaf/dd-agent,zendesk/dd-agent,zendesk/dd-agent,JohnLZeller/dd-agent,oneandoneis2/dd-agent... | tests/performance/benchmark_aggregator.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom froide.helper.form_utils import JSONMixin\n\nfrom .models import PublicBody\nfrom .widgets import PublicBodySelect\n\n\nclass PublicBodyForm(JSONMixin... | python | edit | 1 | 4 | mit | 13dc6443500d09432c6410b766c5c6eda05fdf7a | stefanw/froide,fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide | froide/publicbody/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Model for aircraft flights\"\"\"\n\n\nclass Flight:\n def __init__(self, number):\n if not number[:4].isalpha():\n raise ValueError(\"No airline code in '{}'\".format(number))\n\n if not number[:4].isupper(... | python | edit | 1 | 7 | mit | c9d1a3ad2c3c64f49ec83cf8d09cc6d35915990c | kentoj/python-fundamentals | airtravel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom oslo.config import cfg\n\nfrom st2common import log as logging\nfrom st2common.models.db import db_setup\nfrom st2common.models.db import db_teardown\nfrom st2common.constants.logging import DEFAULT_LOGGING_CONF_PATH\nfrom... | python | edit | 1 | 4 | apache-2.0 | 738b0e1344572d000f51e862000fb719c7035c2c | Itxaka/st2,punalpatel/st2,grengojbo/st2,grengojbo/st2,jtopjian/st2,nzlosh/st2,lakshmi-kannan/st2,peak6/st2,jtopjian/st2,peak6/st2,alfasin/st2,jtopjian/st2,Itxaka/st2,Itxaka/st2,pinterb/st2,StackStorm/st2,punalpatel/st2,tonybaloney/st2,punalpatel/st2,pixelrebel/st2,StackStorm/st2,pixelrebel/st2,lakshmi-kannan/st2,StackS... | st2reactor/st2reactor/cmd/rulesengine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"ARG parameters class\n\n\"\"\"\nfrom __future__ import print_function, division\n\n\nclass ARGparams(object):\n \"\"\"Class for ARG model parameters.\n\n Attributes\n ----------... | python | edit | 1 | 2 | mit | c465b1f0c995ac2cb7c6c8b4ad5f721f800e2864 | khrapovs/argamma | argparams.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Version tools set.\"\"\"\n\nimport os\n\nfrom setuptools_scm import get_version\n\n\ndef get_version_from_scm_tag(\n *,\n root='.',\n relative_to=None,\n local_scheme='node-and-date',\n) -> str:\n \"\"\"... | python | edit | 1 | 2 | mit | 037c2bc9857fc1feb59f7d4ad3cb81575177e675 | wk-tech/python-smsfly | src/smsfly/versiontools.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport os\nimport sys\n\n# Tweak import path so that httplib2 (which lives in datasources) can be\n# imported as httplib2 while the app is running.\n# TODO(mihaip): move httplib2 (and oauth2 and python-twitter) into a third_... | python | edit | 3 | 1 | apache-2.0 | 760447a190b2908d47b14adaa6b1ad1a9369524c | mihaip/streamspigot,mihaip/streamspigot,mihaip/streamspigot,mihaip/streamspigot | app/cron_tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport typing as tp\nimport itertools\n\nfrom metafunctions.concurrent import FunctionMerge\nfrom metafunctions.operators import concat\n\n\nclass MergeMap(FunctionMerge):\n def __init__(self, function:tp.Callable, merge_function:tp.Call... | python | edit | 1 | 1 | mit | 96cbe6cd5b1d86663fe44c7fb4351fdb9bf7b2eb | ForeverWintr/metafunctions | metafunctions/map.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom aspen import restarter\nfrom aspen.tests.fsfix import attach_teardown\n\nclass Foo:\n pass\n\ndef test_startup_basically_works():\n website = Foo()\n website.changes_kill = True\n website.dotaspen = 'bar'\n website.root ... | python | edit | 1 | 1 | mit | bca338a0f945e74c97b4d7dd044090ed3b3f5b11 | gratipay/aspen.py,gratipay/aspen.py | aspen/tests/test_restarter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport inspect\nimport os\nimport pytest\nimport numpy as np\nfrom subprocess import call\nfrom utils.preprocess_text_word_vectors import txtvec2npy\n\n\ndef test_text_word2vec2npy():\n # check whether files are present in folder\n ve... | python | edit | 1 | 2 | mit | c2598058722531662aab8831640fc367689d2a43 | lvapeab/nmt-keras,lvapeab/nmt-keras | tests/utils/test_process_word_vectors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom lxml import html\n\n\ndef document(resource_name):\n return html.parse(\"http://www.assist.org/web-assist/\" + resource_name)\n\n\n# TODO: catch IndexErrors in callers\ndef find_by_name(tag, name, *, parent):\n return parent.xpat... | python | edit | 1 | 1 | mit | dd39c73f9044815e82fa950f605b4b929d4f17f5 | karinassuni/assistscraper | assistscraper/lxml_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom olcc.models import ImportRecord\n\n\"\"\"\nInject the last import date into the request context.\n\"\"\"\ndef last_updated(request):\n record = ImportRecord.objects.latest()\n if record:\n return {\n 'last_updat... | python | edit | 1 | 2 | mit | 840dce03718947498e72e561e7ddca22c4174915 | twaddington/django-olcc,twaddington/django-olcc,twaddington/django-olcc | django_olcc/olcc/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyolite import Pyolite\n\n# initial olite object\nadmin_repository = '~/presslabs/ansible-playbooks/gitolite-admin'\nolite = Pyolite(admin_repository=admin_repository)\n\n# create a repo\nrepo = olite.repos.get_or_create('awesome_name'... | python | edit | 2 | 0 | bsd-2-clause | 6b5e0249374f1adc7e6eafb2e050cd6a2f03d1c9 | shawkinsl/pyolite,PressLabs/pyolite | examples/create_repository.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom openerp import models, fields, api\n\n\n'''\nThis module create model of Course\n'''\n\n\nclass Course(models.Model):\n '''\n This class create model of Course\n '''\n _name = 'openacademy.course' # Model odoo name\n\n ... | python | edit | 2 | 2 | apache-2.0 | 68f68a7c29dd49a9306445d02f5a7050aa84259e | KarenKawaii/openacademy-project | openacademy/model/openacademy_course.py | rejected_duplicate | Near-duplicate of sample 1697 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport Queue\nimport json\n\nimport EBQP\n\nfrom . import world\nfrom . import types\nfrom . import consts\nfrom . import loc\n\n\nclass GameRequestHandler:\n def __init__(self):\n self.world = None\n self.responses = {\n ... | python | edit | 4 | 4 | mit | dba918008892214e56bebc8684839f16ae7d7325 | Tactique/game_engine,Tactique/game_engine | src/engine/request_handler.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys \nimport logging\n\nlogger = logging.getLogger('grab.tools.progress')\n\nclass Progress(object):\n def __init__(self, step=None, total=None, stop=None, name='items', level=logging.DEBUG):\n if not total and not step:\n ... | python | edit | 1 | 6 | mit | c958a314dc8ceb72e34ed969d3cff3751d513a49 | codevlabs/grab,liorvh/grab,giserh/grab,alihalabyah/grab,SpaceAppsXploration/grab,istinspring/grab,DDShadoww/grab,subeax/grab,subeax/grab,istinspring/grab,pombredanne/grab-1,codevlabs/grab,giserh/grab,lorien/grab,huiyi1990/grab,maurobaraldi/grab,subeax/grab,lorien/grab,kevinlondon/grab,alihalabyah/grab,pombredanne/grab-... | grab/tools/progress.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport boto3\nimport botocore\nimport time\n\nec2 = boto3.resource('ec2', region_name='us-east-1')\nclient = boto3.client('ec2')\n\n# Create a security group\ntry:\n sg = ec2.create_security_group(GroupName='jupyter', Description='EC2 fo... | python | edit | 3 | 0 | apache-2.0 | 7c4e372ec901e88ed0c6193a5c06f94a4bbc418b | flashxio/FlashX,icoming/FlashX,flashxio/FlashX,icoming/FlashX,flashxio/FlashX,flashxio/FlashX,icoming/FlashX,flashxio/FlashX,icoming/FlashX,icoming/FlashX,flashxio/FlashX | EC2/create_instance.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n SoftLayer.tests.managers.object_storage_tests\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :license: MIT, see LICENSE for more details.\n\"\"\"\nimport SoftLayer\nfrom SoftLayer import fixtures\nfrom SoftLayer impor... | python | edit | 1 | 1 | mit | 6a63fc4abd524da96ee09bfa94f7eae534a9834e | softlayer/softlayer-python,nanjj/softlayer-python,allmightyspiff/softlayer-python,kyubifire/softlayer-python,Neetuj/softlayer-python,skraghu/softlayer-python | tests/managers/object_storage_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add testing publisher script for dummy myo data"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\nimport time\nimport sys\nimport random\n\nimport rospy\nimport cv_bridge\nimport cv\nimport rospkg\n\nfrom geometry_msgs.ms... | python | new_file | 3 | 3 | mit | 510117cb0f487232d1cd0c5392a4514e1dc1b46e | ipab-rad/myo_baxter_pc,ipab-rad/myo_baxter_pc,ipab-rad/baxter_myo,ipab-rad/baxter_myo | scripts/produce_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solutions for problem 10"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nfrom math import sqrt, ceil, floor\n\nLIMIT = 2000000\n\n\"\"\"\nThis is the first, brute force method, we search for primes,\nand put them ... | python | new_file | 3 | 3 | mit | 1cdc38742e6fc09595a45c28d179125d3771521c | cifvts/PyEuler | euler010.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n.. moduleauthor:: Adam Gagorik <<EMAIL>>\n\"\"\"\nimport pydarkstar.darkobject\nimport pydarkstar.database\n\nclass AuctionBase(pydarkstar.darkobject.DarkObject):\n \"\"\"\n Base class for Auction House objects.\n\n :param ... | python | edit | 1 | 2 | mit | dfce2472c81c84a6e73315f288c41683ede92363 | AdamGagorik/pydarkstar,LegionXI/pydarkstar | pydarkstar/auction/auctionbase.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add two unit-tests for LibraryInfo.\n\ngit-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@7223 94b884b6-d6fd-0310-90d3-974f1d3f35e1"
},
{
"role": "assistant",
"content": "import os\nfrom tempfile import mkstemp\n\nfrom numpy.te... | python | new_file | 3 | 3 | bsd-3-clause | 4e223603a0216a667acc888268f845b41d16ab03 | illume/numpy3k,jasonmccampbell/numpy-refactor-sprint,chadnetzer/numpy-gaurdro,chadnetzer/numpy-gaurdro,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,teoliphant/numpy-refactor,teoliphant/numpy-refactor,illume/numpy3k,Ademan/NumPy-GS... | numpy/distutils/tests/test_npy_pkg_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Automate comparison to best known solutions."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport json, sys, os\nimport numpy as np\n\n# Compare a set of computed solutions to best known solutions on the\n# same... | python | new_file | 8 | 4 | bsd-2-clause | 3bd35228c61d73d8a43ffcda70386b194c9123b2 | VROOM-Project/vroom-scripts,VROOM-Project/vroom-scripts | benchmark/TSP/TSPLIB/compare_to_BKS.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test that all functions defined in urls.py actually exist.\n\nThis would have caught the create_user_backend issue introduced recently."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import ab... | python | new_file | 3 | 5 | apache-2.0 | cbf9b7605a31cd67b1c94b8157cb6ae55fd36c69 | sharmaeklavya2/zulip,AZtheAsian/zulip,rishig/zulip,shubhamdhama/zulip,sup95/zulip,shubhamdhama/zulip,jphilipsen05/zulip,samatdav/zulip,Jianchun1/zulip,zulip/zulip,blaze225/zulip,PhilSk/zulip,vaidap/zulip,dattatreya303/zulip,eeshangarg/zulip,shubhamdhama/zulip,TigorC/zulip,verma-varsha/zulip,mahim97/zulip,hackerkid/zuli... | zerver/test_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool for converting in-line notes metadata to .csv"
},
{
"role": "assistant",
"content": "# Adapted from http://stackoverflow.com/questions/1871524/convert-from-json-to-csv-using-python\nimport csv\nimport json\n\nwith open(\... | python | new_file | 1 | 0 | mit | fc35730074f5af647579012b706e531e84da5ab6 | PovertyAction/github-download | src/main/python/json_to_csv.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the graphql_schema command"
},
{
"role": "assistant",
"content": "import io\nfrom unittest.mock import Mock, mock_open, patch\n\nimport strawberry\nfrom django.core.management import call_command\n\n\ndef test_gener... | python | new_file | 1 | 1 | mit | 2b4ed8cc91ef4f5cd56dae7fbfa9e1a8f5dabcb8 | patrick91/pycon,patrick91/pycon | backend/tests/api/test_commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for command compilation"
},
{
"role": "assistant",
"content": "from cisco_olt_client.command import Command\n\n\ndef test_simple_compile():\n cmd_str = 'cmd --arg1=val1 --arg2=val2'\n cmd = Command('cmd', (('arg1',... | python | new_file | 1 | 1 | mit | 31c7ed89e66c32c46650ee93bfa8c8b2b8fbfad1 | Vnet-as/cisco-olt-client | cisco_olt_client/tests/test_command.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of solving sudoku puzzle."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport sys\nsys.path.append(\"./src\")\nfrom sat import SAT_solver\nfrom sudoku import sudoku, printSudoku, processResult\n\n\npr... | python | new_file | 8 | 0 | bsd-3-clause | f6f022a4eb6af051becd5564c1b0de6943918968 | urska19/LVR-sat | sudoku_example.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test acquisition optimizer and multi source acquisition optimizer"
},
{
"role": "assistant",
"content": "import numpy as np\n\nfrom emukit.core import ParameterSpace\nfrom emukit.core import ContinuousParameter, InformationSource... | python | new_file | 1 | 1 | apache-2.0 | 2f450c0cb3d4c440b695696f88b72202c2f7d788 | EmuKit/emukit | tests/emukit/core/test_optimization.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add filter that gets items with the same .name from a list."
},
{
"role": "assistant",
"content": "from django import template\nfrom django.conf import settings\n\nregister = template.Library()\n\n\n@register.filter\ndef called_s... | python | new_file | 3 | 3 | bsd-2-clause | f574a74f99d1b8aa0fa107ba2416699104d1f36d | abhijo89/django-cbv-inspector,refreshoxford/django-cbv-inspector,abhijo89/django-cbv-inspector,abhijo89/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,abhijo89/django-cbv-inspector | inspector/cbv/templatetags/cbv_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to convert DET window file to VID window file."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport argparse\nimport scipy.io as sio\nimport os\nimport os.path as osp\nimport numpy as np\nfrom vdetlib.v... | python | new_file | 3 | 0 | mit | e872f249590244814e67894fc48b97d63ccad2c2 | myfavouritekk/TPN | tools/data/window_file_select_vid_classes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add deprecation warning and backward compatibility"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n\nimport warnings\n\nfrom glitter.blockadmin.blocks import BlockAdmin, ... | python | new_file | 1 | 0 | bsd-3-clause | 268d67b3b6e81ba3b01a3e106dbabd5f03f42a50 | developersociety/django-glitter,developersociety/django-glitter,blancltd/django-glitter,blancltd/django-glitter,developersociety/django-glitter,blancltd/django-glitter | glitter/block_admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add a test for the cardxml databases"
},
{
"role": "assistant",
"content": "from hearthstone import cardxml\n\n\ndef test_cardxml_load():\n\tcardid_db, _ = cardxml.load()\n\tdbf_db, _ = cardxml.load_dbf()\n\n\tassert cardi... | python | new_file | 1 | 3 | mit | 5f4580cdc2f46ef9294057372609e1b9a48f7041 | HearthSim/python-hearthstone | tests/test_cardxml.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Improve unit test coverage for cmd/conductor.py\n\nAdd new unit tests for cmd/conductor.py.\nIncrease the coverage for cmd/conductor.py from 0 to 100%.\n\nChange-Id: I0c65ee9bc161046bcbd2b0ef5a8faf2f50a0f43e\nPartial-Bug: #1511667"
},
{
... | python | new_file | 1 | 1 | apache-2.0 | 81771f60b00d605dfe1bc07f1af6660cd3c1e0f2 | ArchiFleKs/magnum,ArchiFleKs/magnum,openstack/magnum,openstack/magnum | magnum/tests/unit/cmd/test_conductor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for task settings"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nfrom rockit.core import holders\nfrom rockit.core import tasks\n\nclass TaskSettingsTestCase(TestCase):\n\n def test_it... | python | new_file | 1 | 1 | mit | 41ebf7cbb3c23ddbd47ef0259490d6669538faa1 | acreations/rockit-server,acreations/rockit-server,acreations/rockit-server,acreations/rockit-server | rockit/core/tests/test_task_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to tile images"
},
{
"role": "assistant",
"content": "\"\"\"Tile images.\"\"\"\n\nimport os\nimport random\nimport argparse\n\nfrom collections import defaultdict\n\nimport dtoolcore\n\nimport numpy as np\n\nfrom jicbi... | python | new_file | 5 | 7 | mit | d9a522df5827867897e4a2bbaf680db563fb983e | JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field | scripts/tile_images.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a little validation utility."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\nimport json\nimport fileinput\nimport dateutil.parser\n\nline_number = 0 ... | python | new_file | 3 | 0 | mit | 1a65b417129e0a32a079509c3e3868ced275b4b6 | DocNow/twarc,miku/twarc,kevinbgunn/twarc,edsu/twarc,remagio/twarc,hugovk/twarc,ericscartier/twarc,kevinbgunn/twarc,ericscartier/twarc,miku/twarc,remagio/twarc | utils/validate.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for engines package."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport unittest\n\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\... | python | new_file | 1 | 2 | mit | 17f14574a35d985571e71023587ddb858a8b3ba2 | blubberdiblub/eztemplate | tests/test_engines.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add scrit to finish preprocessing"
},
{
"role": "assistant",
"content": "import sys\nimport pandas as pd\nsys.path.append('..')\nfrom utils.preprocessing import one_hot_encoding\n\npath = '../datasets/processed/'\ntrain_users = p... | python | new_file | 1 | 0 | mit | 24ba638d16433ce298fca9dfd4e12cad01c86728 | davidgasquez/kaggle-airbnb | scripts/one_hot_encoding.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the script for people to download"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\n# Edit these constants if desired. NOTE that if you change DEFAULT_TAG_FORMAT,\n# you'... | python | new_file | 1 | 2 | mit | 56583a6e15bc4dbfb1c80739e3942eed733b91e3 | rmunn/version-numbers-from-git,rmunn/version-numbers-from-git,rmunn/version-numbers-from-git | get-version-from-git.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add dev env for malcolm"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nfrom .base import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sq... | python | new_file | 2 | 0 | apache-2.0 | 7af557a6c40508e758c020539647e6578c779018 | pkimber/crm,pkimber/crm,pkimber/crm | example_crm/dev_malcolm.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to test search speed"
},
{
"role": "assistant",
"content": "import cProfile\n\nimport time\n\nfrom res import types\nfrom src import ai\nfrom src import coordinate\nfrom src import historynode\n\nplyNum = 5\naiObject =... | python | new_file | 3 | 0 | mit | 7b18fd4e2f4b975e891d31994f15e30d7fd50d1b | blairck/jaeger | ply_speed.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for HTML retrieval."
},
{
"role": "assistant",
"content": "import unittest\n\nfrom flask import Flask\nfrom flask.ext.autodoc import Autodoc\n\n\nclass TestAutodocWithFlask(unittest.TestCase):\n def setUp(self):\n ... | python | new_file | 1 | 1 | mit | ea74801222231145421187a005756db752e9a2f8 | jwg4/flask-autodoc,jwg4/flask-autodoc | tests/test_flask_get.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.