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: Add code for ridge prediction for solar energy"
},
{
"role": "assistant",
"content": "# import libraries\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn import linear_model\nfrom sklearn.mo... | python | new_file | 8 | 2 | mit | 7a0a82ea85fa9f09af7dc63437744db5d199c902 | uwkejia/Clean-Energy-Outlook | Clean_Energy_Outlook/Ridge_pred_solar.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a single testcase for the tracer"
},
{
"role": "assistant",
"content": "import os\nimport nose\nimport tracer\n\nimport logging\nl = logging.getLogger(\"tracer.tests.test_tracer\")\n\nbin_location = str(os.path.join(os.path.d... | python | new_file | 5 | 3 | bsd-2-clause | 7e4aab6980519fd8124e36a6f8fd4415eaf8a4e7 | schieb/angr,tyb0807/angr,tyb0807/angr,f-prettyland/angr,iamahuman/angr,angr/angr,angr/tracer,schieb/angr,iamahuman/angr,angr/angr,iamahuman/angr,schieb/angr,f-prettyland/angr,tyb0807/angr,f-prettyland/angr,angr/angr | tests/test_tracer.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool to insepct filesystems."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n#\n## mrfilesys\n##\n## This program provides an interface to retrieve information about Moira filesystems.\n## It could also prov... | python | new_file | 1 | 4 | mit | c108147bd1d421443010640ea4ed206d4d0131e5 | vasilvv/mrtools,vasilvv/mrtools | mrfilesys.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Drop dates and comments from Czech templates.\n\n\nFormer-commit-id: 2291964afbbb8f2d896bb069bb37f24afc2fb081"
},
{
"role": "assistant",
"content": "from base import *\n\nclass SnippetParser(SnippetParserBase):\n def strip_tem... | python | new_file | 4 | 2 | mit | 24cf12a47c95883fc431d4ee295bbe763a107c93 | eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,guilherme-pg/citationhunt | snippet_parser/cs.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a unit test for the logistic module."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom numpy import all, array, random\n\nfrom .. import logistic\n\n\ndef test_logistic():\n x = random.random_sample(100)... | python | new_file | 3 | 3 | isc | 71cd470f727c61330d22fda8b9a9f94e47b6353f | eliteraspberries/avena | avena/tests/test-logistic.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first draft of Google refresh-token script"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport os\nimport sys\nimport webbrowser\n\nfrom oauth2client.client import OAuth2WebServerFlow\n\n\ndef get_credentials... | python | new_file | 1 | 2 | bsd-2-clause | 15fec2dc39dbac26f006171b7a5d0547fb40f254 | myersjustinc/stitchbot | get_google_token.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add OpenStack Client Config module\n\nAll of the ansible OpenStack modules are driven by a clouds.yaml config\nfile which is processed by os-client-config. Expose the data returned by\nthat library to enable playbooks to iterate over availab... | python | new_file | 3 | 4 | mit | b87c9002aeabde283f2cf5e37de311fb3469af2b | thaim/ansible,thaim/ansible | lib/ansible/modules/cloud/openstack/os_client_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add logging module based on tensorflow"
},
{
"role": "assistant",
"content": "\"\"\"Logging utilities.\"\"\"\n\n# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (t... | python | new_file | 1 | 1 | bsd-3-clause | 91d37572785bb3a336407fb085ba47ea281f6729 | J535D165/recordlinkage,J535D165/recordlinkage | recordlinkage/rl_logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Kahn's algorithm in python"
},
{
"role": "assistant",
"content": "\nfrom collections import defaultdict\n \n#Class to represent a graph\nclass Graph:\n def __init__(self,vertices):\n self.graph = defaultdict(list) ... | python | new_file | 15 | 10 | cc0-1.0 | 0da1480903e965597fd4450c8dea28a7d8bd6a44 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | graph/Python/kahn_algorithm.py | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migrations for new fields."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(Sche... | python | new_file | 4 | 1 | mit | 682f942799c15acadea1a707261ed606b4c1e245 | winfieldco/django-mail-queue,styrmis/django-mail-queue,Goury/django-mail-queue,dstegelman/django-mail-queue,dstegelman/django-mail-queue,Goury/django-mail-queue | mailqueue/migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pyplot script for plotting prior miss timeseries"
},
{
"role": "assistant",
"content": "# Run h264dec on a single file compiled with PRIOR_STATS and then run this script\n# Outputs timeseries plot at /tmp/misses.pdf\nimport m... | python | new_file | 1 | 4 | bsd-2-clause | 358f94e58557f9c2cec21a2ec8fb55cb8def0e34 | eastlhu/losslessh264,erillfire/wusunyasuo,itplanes/losslessh264,xiangshuai/losslessh264,xiangshuai/losslessh264,noname007/losslessh264,TonySheh/losslessh264,common2015/losslessh264,krsjoseph/losslessh264,krsjoseph/losslessh264,sunfei/losslessh264,sunfei/losslessh264,aquar25/losslessh264,yurenyong123/losslessh264,lioonl... | plot_prior_misses.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some basic CLI tests\n\nWasn’t that hard!"
},
{
"role": "assistant",
"content": "from __future__ import print_function, division, absolute_import\n\nimport glob\nfrom os.path import basename\nimport py.path\nimport pytest\n\n... | python | new_file | 1 | 1 | apache-2.0 | 5e7866a897562b87f0c0ffa763c08f91c1aacccd | khaledhosny/psautohint,khaledhosny/psautohint | tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test to make sure no work isn't an error."
},
{
"role": "assistant",
"content": "import os\n\nfrom django.test import TestCase, tag\nfrom typing import List\nfrom unittest.mock import patch, call\nfrom urllib.error impor... | python | new_file | 10 | 1 | bsd-3-clause | 0433c32cd4212947517e57b6dc24d7d215123df9 | data-refinery/data_refinery,data-refinery/data_refinery,data-refinery/data_refinery | workers/data_refinery_workers/downloaders/test_utils.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of connected viewers/plugins"
},
{
"role": "assistant",
"content": "import numpy as np\n\nfrom skimage import data\nfrom skimage import draw\nfrom skimage.transform import probabilistic_hough_line\n\nfrom skimage.view... | python | new_file | 1 | 2 | bsd-3-clause | 177a1fdb394eee4a41a3667b0f138a1f2d8b59ca | chintak/scikit-image,blink1073/scikit-image,michaelpacer/scikit-image,rjeli/scikit-image,dpshelio/scikit-image,michaelaye/scikit-image,oew1v07/scikit-image,almarklein/scikit-image,paalge/scikit-image,robintw/scikit-image,bsipocz/scikit-image,ClinicalGraphics/scikit-image,SamHames/scikit-image,chintak/scikit-image,jwigg... | viewer_examples/plugins/probabilistic_hough.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Allow package to be installed with command line ingestor tool"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(\n name='datacube-experiments',\n description='Experimental... | python | new_file | 1 | 0 | bsd-3-clause | 6038c707fe91a4cbf54a364c12f7086b19505f8b | omad/datacube-experiments | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom time import sleep\nfrom threading import Timer\n\n# Sleep Sort ;)\n# Complexity: O(max(input)+n)\n\ndef sleep_sort(a):\n \"\"\"\n Sorts the list 'a' using Sleep sort algorithm\n\n >>> from pydsa import sleep_sort\n >>> a = ... | python | edit | 1 | 3 | bsd-3-clause | 81b1cf6973dde3ca23bbe5ac071d3decad81079a | rehassachdeva/pydsa,aktech/pydsa | pydsa/sleep_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file to create all files to rais."
},
{
"role": "assistant",
"content": "import os\nimport commands\nimport time\nimport logging\nimport sys\n\nif len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):\n print \"ERRO... | python | new_file | 2 | 0 | mit | 8f21fcc4611bba391761df517de8dec3c8e53d9a | DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site | scripts/data_download/rais/create_all_files.py | rejected_duplicate | Near-duplicate of sample 103 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass Organizer(models.Model):\n full_name = models.CharField(max_length=200)\n email = models.EmailField(\n default='', blank=True,\n help_text=\"This is private\")\n twitter = model... | python | edit | 1 | 1 | mit | 224abf5e0e8d5e7bad7a86c622b711e997e8ae10 | pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016 | pyconcz_2016/team/models.py | rejected_duplicate | Near-duplicate of sample 752 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add auto now fields to intern models"
},
{
"role": "assistant",
"content": "# Generated by Django 2.2.1 on 2019-05-25 20:21\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n dependencies... | python | new_file | 1 | 0 | mit | e9fe49f04c23580755f3c828e01fcdd4ddb9385f | n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb | intern/migrations/0038_auto_20190525_2221.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add smoke test for attendance excel export"
},
{
"role": "assistant",
"content": "from tests import PMGTestCase\nfrom tests.fixtures import dbfixture, CommitteeMeetingData\n\n\nclass TestCommitteeMeetingAttendanceExcelExport(PMGT... | python | new_file | 1 | 1 | apache-2.0 | c9ddb5075e5157ddecaea5b1a975700faabdfb4b | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | tests/api/test_committee_meeting_attendance_excel_export.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to lookup term dictionary."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# coding: utf-8\n\n# Copyright (C) USC Information Sciences Institute\n# Author: Vladimir M. Zaytsev <<EMAIL>>\n# URL: <http://nl... | python | new_file | 3 | 0 | apache-2.0 | f5c654941f8dd5eb64775d680d677993a829963c | zaycev/mokujin | lookupdict.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test our age calculation utilities."
},
{
"role": "assistant",
"content": "import datetime\n\nfrom components.people.utils import calculate_age, calculate_average_age\n\n\ndef test_calculate_age():\n birthdate = datetime.date.... | python | new_file | 1 | 1 | apache-2.0 | aff3f5dab0d01c1b7e74adca88ba3096cb0b9106 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | tests/people/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for post creation"
},
{
"role": "assistant",
"content": "from flask import url_for\n\nfrom app import user_datastore\nfrom app.models import Post\nfrom tests.general import AppTestCase\n\n\nclass TestClient(AppTestC... | python | new_file | 1 | 1 | mit | 1c5f2bd553666607328ca16816db882cd5496364 | Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger | tests/test_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for exporting values from tensorboard event file"
},
{
"role": "assistant",
"content": "\"\"\"\nThis script has to be called with the event file as argument\nThe resulting values can be plotted\n\"\"\"\nimport sys\nimp... | python | new_file | 1 | 0 | apache-2.0 | 7caf1988d5bf3c509f8c05c12cc3c9c6aa1ab33a | gangchill/nip-convnet,gangchill/nip-convnet | poster/graphics/export_tensorboard_values.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Apply Meta changed & field default to SiteMetadata"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migration... | python | new_file | 1 | 0 | apache-2.0 | 422b5c763039865d69ee15f3b95a84596ba41c77 | CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend | api/migrations/0006_alter_site_metadata_fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple sleep timer script for Windows"
},
{
"role": "assistant",
"content": "# Kills process by image name after a specified timeout\n# Useful as a sleep timer for some apps that don't support it natively, like VLC\n# Works o... | python | new_file | 3 | 1 | mit | 1921c82e1a8f0a60ed665184c49647b38ea4978c | iluxonchik/python-general-repo | scripts/proc_sleep_timer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create BrowserApp app hook for CMS"
},
{
"role": "assistant",
"content": "from cms.app_base import CMSApp\nfrom cms.apphook_pool import apphook_pool\nfrom django.utils.translation import ugettext_lazy as _\n\nclass BrowserApp(CMS... | python | new_file | 1 | 0 | bsd-3-clause | c275c2611643d80d275af0430c5df2a94594caf0 | mfcovington/djangocms-genome-browser,mfcovington/djangocms-genome-browser,mfcovington/djangocms-genome-browser | cms_genome_browser/cms_app.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add string permutation in python\n\nAdd a second implementation of string permutation in python.\nThe implementation doesn't use external libraries such as iterables."
},
{
"role": "assistant",
"content": "\"\"\"\nGives all permu... | python | new_file | 1 | 6 | cc0-1.0 | 54ad132d9abe545d61b1af34ffe9d7f5c2822a57 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | strings/string_permutation/python/spicyyboi_permute_string.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to split dataset into validation and training data"
},
{
"role": "assistant",
"content": "import glob\nimport os\nimport tqdm\nimport numpy as np\nimport shutil\nfrom bird import loader as l\n\nsource_dir = \"./dataset... | python | new_file | 3 | 0 | mit | 4a9d402b5917b052cae60f4d9d15cbf906dadf7d | johnmartinsson/bird-species-classification,johnmartinsson/bird-species-classification | split_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate old comments over jobs.JobReviewComment\n\nFixes #591"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.apps import apps as global_apps\nfrom django.con... | python | new_file | 3 | 6 | apache-2.0 | 74305170ee64a0129d5c8eec8d908e4a8696d038 | manhhomienbienthuy/pythondotorg,python/pythondotorg,manhhomienbienthuy/pythondotorg,manhhomienbienthuy/pythondotorg,proevo/pythondotorg,Mariatta/pythondotorg,Mariatta/pythondotorg,python/pythondotorg,python/pythondotorg,Mariatta/pythondotorg,Mariatta/pythondotorg,proevo/pythondotorg,proevo/pythondotorg,python/pythondot... | jobs/migrations/0012_auto_20170809_1849.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to calibrate the ESC"
},
{
"role": "assistant",
"content": "\"\"\"Programs the ESC.\"\"\"\nfrom control import driver as driver_module\nfrom control.driver import Driver\nfrom control.test.dummy_logger import DummyLogg... | python | new_file | 4 | 1 | mit | c4f1e95860febcb738d9b9c0cca5ad3c6365024b | bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc | control/calibrate_esc.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Move forvo downloads for easier Anki creation."
},
{
"role": "assistant",
"content": "\"\"\"Move and rename pronunciations downloaded from forvo for easier Anki creation.\"\"\"\r\n\r\nimport os\r\nimport shutil\r\nimport time\r\n... | python | new_file | 1 | 0 | mit | 50117a2576ab8d002d95e36b5dccfb4e16122622 | AndrzejR/Scripts | move_forvo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nNODE_VERSION = 'v0.11.10'\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONTENT_COMMIT = '1df8e7cdac8aa74c91c19ae0691ce512d560ab3e'\n\n```\n\nApply this change: Update li... | python | edit | 1 | 0 | mit | eca911a1b1623368f991dbf47002c0b59abc15db | jjz/electron,Ivshti/electron,howmuchcomputer/electron,simonfork/electron,takashi/electron,SufianHassan/electron,micalan/electron,tylergibson/electron,Gerhut/electron,mattdesl/electron,edulan/electron,edulan/electron,d-salas/electron,gerhardberger/electron,micalan/electron,brenca/electron,stevekinney/electron,pandoraui/... | script/lib/config.py | rejected_duplicate | Near-duplicate of sample 1583 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add export csv template tests"
},
{
"role": "assistant",
"content": "# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n... | python | new_file | 1 | 1 | apache-2.0 | cab9ef8d58adeceaf94d8855aa6d598d7fa01f33 | edofic/ggrc-core,edofic/ggrc-core,NejcZupec/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,jmakov/ggrc-core,hyperNURb/ggrc-core,hyperNURb/ggrc-core,hyperNURb/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,josthkko/ggrc... | src/tests/ggrc/converters/test_export_csv.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test API call that only returns a single Resource"
},
{
"role": "assistant",
"content": "from nose.plugins.attrib import attr\n\nfrom rightscale.rightscale import RightScale, Resource\n\n\n@attr('rc_creds', 'real_conn')\ndef test... | python | new_file | 1 | 1 | mit | 3127cface44165d3200657c3fa626a5051c6ad48 | diranged/python-rightscale-1,brantai/python-rightscale | tests/test_show_resource.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for url handling in Windows"
},
{
"role": "assistant",
"content": "from .url import (filename_to_uri, uri_to_filename)\nimport unittest\n\n\nclass WindowsTests(unittest.TestCase):\n\n @unittest.skipUnless(sys.platform... | python | new_file | 5 | 1 | mit | 8f7769a0122fb0d9479209ed2239dd0687f301a1 | tomv564/LSP | plugin/core/test_url.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add south migration for new field type."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom djang... | python | new_file | 4 | 1 | unlicense | b3ad1a33715f3db4b06e1196958b4248f9a8039d | 0x07Ltd/django-generic-counter,0x07Ltd/django-generic-counter | django_generic_counter/south_migrations/0003_auto__chg_field_counter_count.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool info for CoVeriTest"
},
{
"role": "assistant",
"content": "# This file is part of BenchExec, a framework for reliable benchmarking:\n# https://github.com/sosy-lab/benchexec\n#\n# SPDX-FileCopyrightText: 2007-2020 Dirk Be... | python | new_file | 1 | 1 | apache-2.0 | 2daf2087583b57c3339a923889c9bb4132f1db34 | sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec | benchexec/tools/coveritest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for friendly errors"
},
{
"role": "assistant",
"content": "from textwrap import dedent\n\nimport pytest\n\nfrom puppetboard.views.failures import get_friendly_error\n\n\n# flake8: noqa\n@pytest.mark.parametrize(\"raw_me... | python | new_file | 1 | 1 | apache-2.0 | 5b8518d3b7bdd55ee20dec81f18c4b9a8732decd | voxpupuli/puppetboard,voxpupuli/puppetboard,voxpupuli/puppetboard | test/views/test_failures.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for different verbosity levels"
},
{
"role": "assistant",
"content": "import unittest\nimport numpy as np\nimport cpnest.model\n\nclass GaussianModel(cpnest.model.Model):\n \"\"\"\n A simple gaussian model wi... | python | new_file | 1 | 2 | mit | 3189b82167955e713fcc6e92d34b220feeb122a7 | johnveitch/cpnest | tests/test_verbosity.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"EditorConfig version tools\n\nProvides ``join_version`` and ``split_version`` classes for converting\n__version__ strings to VERSION tuples and vice versa.\n\n\"\"\"\n\nimport re\n\n\n__all__ = ['join_version', 'split_version']\n\n\n_... | python | edit | 1 | 3 | bsd-2-clause | b4048b9a9ba9f7a9d1ac03e4a0d57c5c6e1b4471 | benjifisher/editorconfig-vim,benjifisher/editorconfig-vim,VictorBjelkholm/editorconfig-vim,pocke/editorconfig-vim,johnfraney/editorconfig-vim,pocke/editorconfig-vim,johnfraney/editorconfig-vim,pocke/editorconfig-vim,benjifisher/editorconfig-vim,VictorBjelkholm/editorconfig-vim,VictorBjelkholm/editorconfig-vim,johnfrane... | editorconfig/versiontools.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for helusers"
},
{
"role": "assistant",
"content": "import pytest\nimport random\nfrom uuid import UUID\nfrom helusers.utils import uuid_to_username, username_to_uuid\n\n\ndef test_uuid_to_username():\n assert u... | python | new_file | 3 | 3 | bsd-2-clause | 572f6d8e789495fc34ed67230b10b0c1f0b3572f | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | helusers/tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add upload and delay test"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nfrom datetime import datetime\nfrom datetime import timedelta\nimport subprocess\nimport time\nimport logging\n\nfrom wrappers import GPhoto\nf... | python | new_file | 6 | 6 | mit | 699f1f42e0387ac542cbe0905f825079e7aab755 | Lakerfield/timelapse | testupload.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Integrate initial version of player draft item"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom .common import Base, session_scope\n\n\nclass PlayerDraft(Base):\n __tablename__ = 'p... | python | new_file | 1 | 3 | mit | 0886d0fe49f4176bfe6860c643d240a9b7e0053d | leaffan/pynhldb | db/player_draft.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 659. Split Array into Consecutive Subsequences\n\n659. Split Array into Consecutive Subsequences: https://leetcode.com/problems/split-array-into-consecutive-subsequences/"
},
{
"role": "assistant",
"content": ... | python | new_file | 1 | 6 | apache-2.0 | d76809021c99f841cd8d123058d307404b7c025c | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/split-array-into-consecutive-subsequences.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to add requests"
},
{
"role": "assistant",
"content": "from google.cloud import firestore\nimport argparse\nimport datetime\nimport names\nimport random\n\ndef queryUsers(db):\n\tusers_ref = db.collection(u'users')\n\t... | python | new_file | 3 | 6 | mit | 31525d83ea74852709b1dd1596854a74c050f9f2 | frinder/frinder-app,frinder/frinder-app,frinder/frinder-app | scripts/add_requests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim:fileencoding=utf-8:noet\n\nfrom functools import wraps\nimport time\n\n\ndef default_cache_key(**kwargs):\n\treturn frozenset(kwargs.items())\n\n\nclass memoize(object):\n\t'''Memoization decorator with timeout.'''\n\tdef __init__(sel... | python | edit | 1 | 5 | mit | f8db46b40629cfdb145a4a000d47277f72090c5b | Liangjianghao/powerline,kenrachynski/powerline,darac/powerline,darac/powerline,bezhermoso/powerline,firebitsbr/powerline,bartvm/powerline,cyrixhero/powerline,junix/powerline,prvnkumar/powerline,s0undt3ch/powerline,S0lll0s/powerline,Luffin/powerline,EricSB/powerline,dragon788/powerline,prvnkumar/powerline,wfscheper/powe... | powerline/lib/memoize.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to do one-off imports."
},
{
"role": "assistant",
"content": "import csv\nfrom django.contrib.auth.models import User\nfrom opencivicdata.models import Jurisdiction, Division\nfrom upload.backend.parser imp... | python | new_file | 6 | 1 | bsd-3-clause | e5716c90e97d1364c551701f3bae772f08c9c561 | opencivicdata/opencivicdata.org,opencivicdata/opencivicdata.org,opencivicdata/opencivicdata.org | upload/management/commands/import_sheet.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test setup for registry case search"
},
{
"role": "assistant",
"content": "import uuid\n\nfrom django.test import TestCase\n\nfrom casexml.apps.case.mock import CaseBlock\n\nfrom corehq.apps.case_search.models import CaseSear... | python | new_file | 1 | 2 | bsd-3-clause | 127dbd5779280fc62f56f06f8ef2733b7aa4cdd9 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/case_search/tests/test_case_search_registry.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read a P4 file and get its HLIR."
},
{
"role": "assistant",
"content": "import os\nimport sys\nsys.path.append('../p4_hlir/')\nfrom p4_hlir.main import HLIR\n\np4_source = sys.argv[1]\nabsolute_source = os.path.join(os.getcwd(), ... | python | new_file | 2 | 0 | apache-2.0 | 3f55d16fb40acc07cf07588249126cc543d9ad07 | yo2seol/P4-Wireshark-Dissector | dissector/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add very low level state handlers."
},
{
"role": "assistant",
"content": "\"\"\"\nA lower-level State that doesn't do any special object handling.\n\"\"\"\nimport inspect\nimport typing\n\nfrom curious.gateway import Gateway\nfro... | python | new_file | 1 | 2 | mit | 67164cadc3f3445298da2fb490971cf22e2f146b | SunDwarf/curious | curious/ext/loapi/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a public-key cipher (RSA)"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n\n\"\"\"\nRSA.py\n\n@author Elliot and Erica\n\"\"\"\n\nimport random\nfrom cryptography_utilities import (block_split, decimal_t... | python | new_file | 5 | 2 | mit | af7b495b954bb624cbd95e0019fa3b2cb3be6b05 | ElliotPenson/cryptography | rsa.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create test for sandboxing via Heroku"
},
{
"role": "assistant",
"content": "\"\"\"Tests for the Wallace API.\"\"\"\n\nimport subprocess\nimport re\nimport requests\n\n\nclass TestHeroku(object):\n\n \"\"\"The Heroku test clas... | python | new_file | 1 | 1 | mit | 264b4112ccfdebeb7524036b6f32d49fa38bb321 | berkeley-cocosci/Wallace,suchow/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,suchow/Wallace,berkeley-cocosci/Wallace,jcpeterson/Dallinger,suchow/Wallace,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,berkeley-cocosci/Wallace,Dallinger/Dallinger,Dallinger/Dalli... | tests/test_heroku.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool for determining active SVN committers.\n\ngit-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@7427 94b884b6-d6fd-0310-90d3-974f1d3f35e1"
},
{
"role": "assistant",
"content": "\n# Run svn log -l <some number>\n\nimport... | python | new_file | 4 | 2 | bsd-3-clause | c20b1b8c2362f2484baacd15acd9d72ae1e2b6d7 | teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,jasonmccampbell/numpy-refactor-sprint,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,teoliphant/numpy-refactor,Ademan/NumPy-GSoC,Ademan/NumPy-GSoC,Ademan/Num... | tools/commitstats.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to set markdown template"
},
{
"role": "assistant",
"content": "import sublime\nimport sublime_plugin\nfrom os.path import exists, join\n\nTEMPLATE_NAME = \"custom-template.html\"\n\n\ndef set_template():\n path = j... | python | new_file | 3 | 2 | mit | d3df6283db7e9ed56c41f4e7a866c8622743da40 | facelessuser/SublimeRandomCrap,facelessuser/SublimeRandomCrap | set_markdown_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Store names of similar photos into sqlite database"
},
{
"role": "assistant",
"content": "import graphlab\nimport sqlite3\n\ndef main():\n \n # load photos with their deep features\n photos = graphlab.SFrame('photos_deep... | python | new_file | 2 | 4 | mit | d1afa600338bb0d9c1c040a42b6de5504e48d699 | aysent/yelp-photo-explorer | similar_photos_sqlite.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an XML-RPC downloader for bugzilla"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport json\nimport sys\nimport xmlrpc.client\n\n\n# XXX Edit this to your liking\nMAX_BUG_ID = 3210\nEXPORT_FILE = \"bugzilla... | python | new_file | 3 | 7 | mit | 53b17d83300d5d1607e0124229bf830cb1eb8a31 | jleclanche/bugzilla-to-github | xmlrpc_download.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unarchiver of the forecast"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport pickle\nimport sys\n\nclass Forecast:\n pass\n\nfor fn in sys.argv:\n with open(fn,\"rb\") as fp:\n forecast = pi... | python | new_file | 1 | 0 | mit | 272b2238ce9d0d8d1424a470bb7f4f7b41edd9e0 | nushio3/UFCORIN,nushio3/UFCORIN,nushio3/UFCORIN,nushio3/UFCORIN,nushio3/UFCORIN | script/unarchive-forecast.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for library loading"
},
{
"role": "assistant",
"content": "from .utils import TemplateTestCase, Mock\n\nfrom knights import Template\n\n\nclass LoadTagTest(TemplateTestCase):\n\n def test_load_default(self):\n ... | python | new_file | 3 | 1 | mit | 4173d3abeeda29ffbd81379233e88311780b6b09 | funkybob/knights-templater,funkybob/knights-templater | tests/test_load.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for new command"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, unicode_literals\n\nfrom django.test import TestCase\nfrom django.core.management import call_command\nfrom wagtail.wagtailc... | python | new_file | 1 | 1 | mit | 733726467c397ff530a556e9a624466994e7c13c | rkhleics/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus,ababic/wagtailmenus | wagtailmenus/tests/test_commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration which updates field / model metadata."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.6 on 2017-06-23 02:36\nfrom __future__ import unicode_literals\n\nfrom django.db impor... | python | new_file | 3 | 0 | apache-2.0 | 4cb37cabb3aa171391958f4d6e6d0eb5b8731989 | qubs/data-centre,qubs/climate-data-api,qubs/data-centre,qubs/climate-data-api | climate_data/migrations/0022_auto_20170623_0236.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for downloading latest dmf_control_board"
},
{
"role": "assistant",
"content": "import os\r\nimport subprocess\r\n\r\nif __name__ == '__main__':\r\n os.chdir('microdrop/plugins')\r\n \r\n if not os.path.exists... | python | new_file | 3 | 0 | bsd-3-clause | 66da5a6bd67ae3645eeff5856ae4614e4be9f5d8 | wheeler-microfluidics/microdrop | microdrop/tests/update_dmf_control_board.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple test for item dump."
},
{
"role": "assistant",
"content": "from django.test import Client, TestCase\n\nfrom ..models import Item\nfrom .factories import EventFactory, EventPermissionFactory, ItemFactory, ItemTypeFactor... | python | new_file | 1 | 2 | mit | 32525203ee392be60c0ea32a817323ccf5cace12 | jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu | kirppu/tests/test_itemdump.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTest suite for Reflex Axelrod PD player.\n\"\"\"\nimport axelrod\nfrom test_player import TestPlayer\n\n\nclass Reflex_test(TestPlayer):\n\n def test_initial_nice_strategy(self):\n \"\"\" First response should always be co... | python | edit | 1 | 1 | mit | e5e068c5fa94d68aa81dbcd3e498ba17dae37d2c | emmagordon/Axelrod,uglyfruitcake/Axelrod,kathryncrouch/Axelrod,emmagordon/Axelrod,mojones/Axelrod,drvinceknight/Axelrod,bootandy/Axelrod,uglyfruitcake/Axelrod,bootandy/Axelrod,risicle/Axelrod,risicle/Axelrod,mojones/Axelrod,kathryncrouch/Axelrod | axelrod/tests/test_reflex.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility function to retrieve default price list and to create a product from a good"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nfrom django.core.exceptions import ImproperlyConfigured\n\n... | python | new_file | 1 | 2 | bsd-2-clause | 357067b0cfe6fd781813404ba7d587f5bd00917a | evonove/django-bazaar,meghabhoj/NEWBAZAAR,meghabhoj/NEWBAZAAR,meghabhoj/NEWBAZAAR,evonove/django-bazaar,evonove/django-bazaar | bazaar/goods/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add MSI generating tool for python updating"
},
{
"role": "assistant",
"content": "'''Quick and dirty script to generate vs.payload blocks for a set of URLs.\n\nUsage:\n make_payload.py URL [URL ...]\n\n\n'''\n\n__author__ = '... | python | new_file | 1 | 0 | apache-2.0 | fe62ab5e609aba0c1739ca81d5cdd266d208a217 | int19h/PTVS,int19h/PTVS,int19h/PTVS,int19h/PTVS,int19h/PTVS,int19h/PTVS | Build/make_payload.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for update_languages utility"
},
{
"role": "assistant",
"content": "# tests.test_update_languagess\n# coding=utf-8\n\nfrom __future__ import unicode_literals\n\nimport nose.tools as nose\nfrom mock import patch\n\nimpor... | python | new_file | 1 | 1 | mit | 576c2a1565fe9860c1188a9862b54e24aab64ed4 | caleb531/youversion-suggest,caleb531/youversion-suggest | tests/test_update_languages.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to compute articles improved for media collection"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\"\"\"Analysing a Glamorous report to identify articles improved.\"\"\"\n\nimport sys\nimport xml.dom.... | python | new_file | 5 | 8 | mit | 72c38a8b67b23080ab9fea7a6fd3405b2f88ad7a | Commonists/wm_metrics,Commonists/wm_metrics,Commonists/wm_metrics,Commonists/wm_metrics | wm_metrics/count_articles_improved_for_image_collection.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example for just disabling password complexity"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport pyghmi.util.webclient as webclient\nimport json\nimport os\nimport sys\n\ntmppassword = 'to3BdS91ABrd'\nmi... | python | new_file | 1 | 0 | apache-2.0 | 739e302506cb542011b8f022c6175637feaf20b4 | jjohnson42/confluent,jjohnson42/confluent,xcat2/confluent,xcat2/confluent,jjohnson42/confluent,xcat2/confluent,jjohnson42/confluent,xcat2/confluent,xcat2/confluent,jjohnson42/confluent | misc/disablepasscomplexity.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add url parsing unit tests"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom lib.purl import Purl\nfrom lib.purl_exc import *\n\nclass TestParserFunctions(object):\n\n def test_simple_url(self):\n str_url = 'http:/... | python | new_file | 6 | 1 | mit | 604ce43cd9a66ae52224d174bc5743bcbfc86546 | ultrabluewolf/p.url | test/test_url_parser.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Move the lazy classes out for the serializer to be able to find them"
},
{
"role": "assistant",
"content": "# Lazy objects, for the serializer to find them we put them here\n\nclass LazyDriver(object):\n _driver = None\n \n... | python | new_file | 1 | 2 | apache-2.0 | 4a60fdf4896a41d52fc90e8a5f719976e605e8cc | holdenk/diversity-analytics,holdenk/diversity-analytics | lazy_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script which logs realtime data into the db."
},
{
"role": "assistant",
"content": "import os\nfrom datetime import datetime, timedelta\n\nimport django\nimport pytz\nimport requests\nfrom google.transit import gtfs_realtime_... | python | new_file | 1 | 6 | mit | 0b547b69c9e603f77de6d8855a2fe1f153ba49d5 | katharosada/bus-shaming,katharosada/bus-shaming,katharosada/bus-shaming,katharosada/bus-shaming,katharosada/bus-shaming | busshaming/fetch_realtime.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nfrom telemetry.page.actions import page_action\n\nclass NavigateAction(pa... | python | edit | 1 | 4 | bsd-3-clause | d247427d60944d529fa17865ac4e0556a9ccda3f | dushu1203/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,Just-D/ch... | tools/telemetry/telemetry/page/actions/navigate.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a state for send requests to Wonderland."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# encoding=utf8\n\nimport requests\nfrom flexbe_core import EventState, Logger\n\n\nclass Wonderland_Request(EventState):\... | python | new_file | 2 | 2 | bsd-3-clause | 2dfd9cfc42e17f36446ff5da36e497bfff8d1d89 | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Request.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first draft of Flask type check decorator"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nimport json\nfrom flask import Response, Flask, request\n\nimport inspect\nfrom typecheck import typecheck\nfrom typing ... | python | new_file | 1 | 7 | mit | bd2f302e2bcc02a3f222d0c00be9fe61351517e2 | jacopofar/runtime_typecheck | flask_typecheck_decorator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example using the gaussian smoother/filter.\n\ngit-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@292 150532fb-1d5b-0410-a8ab-efec50f980d4"
},
{
"role": "assistant",
"content": "import matplotlib.pyplot as plt\n\nx = np.lin... | python | new_file | 7 | 0 | bsd-3-clause | ee66b13c952118f85e0ce14264da29807e8ab814 | dopplershift/MetPy,dopplershift/MetPy,deeplycloudy/MetPy,jrleeman/MetPy,ahaberlie/MetPy,ahaberlie/MetPy,ahill818/MetPy,Unidata/MetPy,jrleeman/MetPy,Unidata/MetPy,ShawnMurd/MetPy | trunk/examples/gaussian_smoother.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make simple script for finding terms used in marcframe"
},
{
"role": "assistant",
"content": "import json\n\ndef get_terms(marcframe):\n terms = set()\n for k, v in marcframe['entityTypeMap'].items():\n terms.add(k)\... | python | new_file | 2 | 5 | apache-2.0 | 0fd33596d292f758a463f95dbbbcbbd729fd15cb | libris/librisxl,libris/librisxl,libris/librisxl | datatools/scripts/terms_from_marcframe.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new reschedule teacher weekly poll"
},
{
"role": "assistant",
"content": "'''\nCreated on Feb 21, 2013\n\n@author: raybesiga\n'''\n\nfrom django.core.management.base import BaseCommand\nfrom education.models import reschedule... | python | new_file | 4 | 3 | bsd-3-clause | a3dc1ebac114d1591dd9cdb211e6d975a10b0da3 | unicefuganda/edtrac,unicefuganda/edtrac,unicefuganda/edtrac | education/management/commands/reschedule_teacher_weekly_polls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plugin to parse values from log file"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# logfile_values.py\n#\n# Copyright (c) 2017, InnoGames GmbH\n#\n\"\"\"\nlogfile_values.py -- a python script to find metri... | python | new_file | 1 | 3 | mit | 62955786e7ffd2e961849860dfd2146ef611890c | innogames/igcollect | src/logfile_values.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: scripts: Add a script to fork all feedstocks one is a maintainer on."
},
{
"role": "assistant",
"content": "#!/usr/bin/env conda-execute\n\n\"\"\"\nThis script can be run to fork conda-forge feedstocks to which you are a maintain... | python | new_file | 5 | 0 | bsd-3-clause | f10b89d8c2b847555223a4a025d78e1223f57696 | conda-forge/conda-forge.github.io,conda-forge/conda-forge.github.io,conda-forge/conda-forge.github.io,conda-forge/conda-forge.github.io | scripts/fork_my_feedstocks.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add this little development tester for webapi"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n\n# This tester listens on port 8051 for a single http request, with\n# a URL that starts with /api/v....\n# It exits a... | python | new_file | 3 | 0 | bsd-3-clause | f226c81bbc7052dcac0993bacdaa4a93761b4dce | trshaffer/cvmfs,MicBrain/cvmfs,cvmfs-testing/cvmfs,alhowaidi/cvmfsNDN,Moliholy/cvmfs,alhowaidi/cvmfsNDN,trshaffer/cvmfs,DrDaveD/cvmfs,Moliholy/cvmfs,cvmfs/cvmfs,djw8605/cvmfs,reneme/cvmfs,MicBrain/cvmfs,cvmfs/cvmfs,Moliholy/cvmfs,trshaffer/cvmfs,cvmfs/cvmfs,alhowaidi/cvmfsNDN,cvmfs-testing/cvmfs,DrDaveD/cvmfs,Moliholy/... | cvmfs/webapi/test-api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add eventlet db_pool use for mysql\n\nThis adds the use of eventlet's db_pool module so that we can make mysql\ncalls without blocking the whole process.\n\nNew config options are introduced:\n\nsql_dbpool_enable -- Enables the use of eventl... | python | new_file | 1 | 2 | apache-2.0 | 64bb470bc58d6d467f4bd807f82cc56aa5e674bc | n0ano/gantt,n0ano/gantt | nova/tests/test_sqlalchemy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to migrate programs"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\nfrom corehq.apps.commtrack.models import Program\nfrom corehq.apps.domain.models import Domain... | python | new_file | 3 | 8 | bsd-3-clause | 8ce21d0d060fcaaea192f002d12c79101f4bc1a2 | dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq | corehq/apps/commtrack/management/commands/fix_default_program.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Spark Python word count program"
},
{
"role": "assistant",
"content": "from pyspark import SparkConf, SparkContext\nimport sys\n\n\nif __name__ == \"__main__\":\n if len(sys.argv) != 3:\n print \"Incorrect number of... | python | new_file | 3 | 0 | mit | bf3a32714e43fdb4abc226c5c353ccfc10448854 | bbengfort/hadoop-fundamentals,bbengfort/hadoop-fundamentals,bbengfort/hadoop-fundamentals,cycuq/hadoop-fundamentals-for-data-scientists,sssllliang/hadoop-fundamentals,nvoron23/hadoop-fundamentals | spark/wordcount.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for the logger"
},
{
"role": "assistant",
"content": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import unicode_litera... | python | new_file | 1 | 1 | mit | d727758e3db52327e7326b5f8546ecde06d409e7 | thombashi/DataProperty | test/test_logger.py | rejected_duplicate | Near-duplicate of sample 6033 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_wtf import Form\nfrom wtforms.fields import (TextField, SubmitField, BooleanField, DateField,\n DateTimeField)\nfrom wtforms.validators import Required\n\n\nclass SignupForm(Form):\n name = TextField... | python | edit | 1 | 0 | apache-2.0 | 0200c03f8f6232965f924a765c5ebb0f9c439f4d | vishnugonela/flask-bootstrap,BeardedSteve/flask-bootstrap,livepy/flask-bootstrap,suvorom/flask-bootstrap,vishnugonela/flask-bootstrap,JingZhou0404/flask-bootstrap,vishnugonela/flask-bootstrap,BeardedSteve/flask-bootstrap,suvorom/flask-bootstrap,eshijia/flask-bootstrap,JingZhou0404/flask-bootstrap,moha24/flask-bootstrap... | sample_app/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add regression test for the message options bug."
},
{
"role": "assistant",
"content": "import unittest\nfrom celery.messaging import MSG_OPTIONS, get_msg_options, extract_msg_options\n\n\nclass TestMsgOptions(unittest.TestCase):... | python | new_file | 3 | 1 | bsd-3-clause | 773a389f2ae69384f09cbada8b4b2615a7c430de | frac/celery,cbrepo/celery,frac/celery,ask/celery,ask/celery,WoLpH/celery,mitsuhiko/celery,cbrepo/celery,mitsuhiko/celery,WoLpH/celery | celery/tests/test_messaging.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for the new validation logic"
},
{
"role": "assistant",
"content": "from .helper import BJOTest\nfrom bernard.actors import Locker, Notifier\nfrom bernard.loader import YAMLLoader\nfrom praw.models import Comment, ... | python | new_file | 1 | 1 | mit | 8d9eae677ef81ba3dcb000e528985276a920ef05 | leviroth/bernard | test/test_loader.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python file with a list of simulation files."
},
{
"role": "assistant",
"content": "\n#List of input files and reference databases\nsim_files = [(\"./inputs/physor/1_Enrichment_2_Reactor.xml\", \"./benchmarks/physor_1_Enrichm... | python | new_file | 1 | 0 | bsd-3-clause | e97649a29a10ecc06eaa33b0898b2c22368e7102 | Baaaaam/cycamore,rwcarlsen/cycamore,Baaaaam/cyBaM,gonuke/cycamore,rwcarlsen/cycamore,gonuke/cycamore,cyclus/cycaless,Baaaaam/cyBaM,Baaaaam/cyCLASS,rwcarlsen/cycamore,Baaaaam/cyBaM,Baaaaam/cycamore,rwcarlsen/cycamore,gonuke/cycamore,Baaaaam/cyCLASS,jlittell/cycamore,Baaaaam/cyBaM,jlittell/cycamore,jlittell/cycamore,gonu... | tests/tests_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add minimal tests for PartHoleDrudge\n\nHere only the number of terms in the different forms of the Hamiltonian\nis checked. It should later be replaced with actual value inspection."
},
{
"role": "assistant",
"content": "\"\"\"... | python | new_file | 1 | 1 | mit | b4a7e92bb8f3876c12982ef5f63ed1ad56f30ac7 | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | tests/parthole_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add minimal feed sourcing example"
},
{
"role": "assistant",
"content": "# Chap07/blogs_rss_get_posts.py\nimport json\nfrom argparse import ArgumentParser\nimport feedparser\n\n\ndef get_parser():\n parser = ArgumentParser()\n... | python | new_file | 1 | 1 | mit | 2ff14d38266322d3e428c29a01a3de5015269166 | MrKriss/full-fact-rss-miner | package/src/get_rss_feeds.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test of g1.asyncs.kernels public interface"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom g1.asyncs import kernels\n\n\nclass KernelsTest(unittest.TestCase):\n \"\"\"Test ``g1.asyncs.kernels`` public i... | python | new_file | 1 | 1 | mit | 6c8cdc4460204cf4ffcb9b1a42da3ba7bb469031 | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | py/g1/asyncs/kernels/tests/test_public.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights pref sum problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Pref Sum Problem\n\nfrom itertools import accumulate\n\n\ndef prefSum(a):\n return list(accumulate(a))\n\n\ndef m... | python | new_file | 1 | 3 | mit | 244d95937c1fbae6a0f415cbdcbd4ed65cc6d8c4 | HKuz/Test_Code | CodeFights/prefSum.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add raven SSL fix mod.\n\nSee https://github.com/getsentry/raven-python/issues/1109."
},
{
"role": "assistant",
"content": "# See https://github.com/getsentry/raven-python/issues/1109\n\n\"\"\"\nraven.transport.http\n~~~~~~~~~~~~... | python | new_file | 3 | 5 | mit | c0496d83049e02db718941b7cdd6fa0bacd28ce2 | Mediamoose/python-tools | python-tools/mods/raven/transport/http.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration that sets score.user_id appropriately"
},
{
"role": "assistant",
"content": "\"\"\"Add score.user_id column\n\nRevision ID: 0c98b865104f\nRevises: 7b6a65c708b9\nCreate Date: 2016-10-27 19:03:44.901639\n\n\"\"\"\n\n#... | python | new_file | 3 | 1 | apache-2.0 | dccd8403a93a0c86054d61142198643d30b8d9af | Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok | migrations/versions/0c98b865104f_add_score_user_id_column.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add short_url column to Graph\n\nMake username a nullable field in Graph, so people don't have to\nregister to share graphs."
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 75f579d01f0d\nRevises: 25f4f2... | python | new_file | 1 | 1 | mit | c456ec0a5dd4c48b13d82930eab32c85bcc0e7be | stardust66/math3d,ChristopherChudzicki/math3d,ChristopherChudzicki/math3d,stardust66/math3d,ChristopherChudzicki/math3d,ChristopherChudzicki/math3d,stardust66/math3d,stardust66/math3d | migrations/versions/75f579d01f0d_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new case for function resolution of fp16 unary and binary operators"
},
{
"role": "assistant",
"content": "from numba.cuda.testing import unittest, skip_on_cudasim\nimport operator\nfrom numba.core import types, typing\n\n\n@... | python | new_file | 1 | 3 | bsd-2-clause | b2bef05e0490d161ecec07b4403964c19875ee5d | numba/numba,cpcloud/numba,cpcloud/numba,cpcloud/numba,numba/numba,numba/numba,numba/numba,cpcloud/numba,numba/numba,cpcloud/numba | numba/cuda/tests/nocuda/test_function_resolution.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a rudimentary test for the platform module that at least calls each documented function once."
},
{
"role": "assistant",
"content": "import unittest\nfrom test import test_support\nimport platform\n\nclass PlatformTest(unitte... | python | new_file | 20 | 3 | mit | d73dfec24b2b77edcab5a1daf1acb35640320aa4 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_platform.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for tuple option to nd.as_py"
},
{
"role": "assistant",
"content": "import sys\nimport unittest\nfrom dynd import nd, ndt\n\nclass TestArrayAsPy(unittest.TestCase):\n def test_struct_or_tuple(self):\n a = nd.a... | python | new_file | 3 | 1 | bsd-2-clause | 5b333f9547908db05663afacc7487749dda168fc | pombredanne/dynd-python,pombredanne/dynd-python,ContinuumIO/dynd-python,insertinterestingnamehere/dynd-python,izaid/dynd-python,pombredanne/dynd-python,izaid/dynd-python,insertinterestingnamehere/dynd-python,insertinterestingnamehere/dynd-python,mwiebe/dynd-python,michaelpacer/dynd-python,aterrel/dynd-python,cpcloud/dy... | dynd/tests/test_array_as_py.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write a basic test for filtering by user data"
},
{
"role": "assistant",
"content": "import uuid\n\nfrom django.test import TestCase\n\nfrom pillowtop.es_utils import initialize_index_and_mapping\n\nfrom corehq.apps.domain.shortc... | python | new_file | 1 | 1 | bsd-3-clause | 3a06a24c5ce0e5357dfc87eccfc198fd05e881e4 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/es/tests/test_user_es.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.