conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add PART to tag map\n\n16 of the 17 PoS tags in the UD tag set is added; PART is missing." }, { "from": "human", "value": "# encoding: utf8\nfrom __future__ import unicode_literals\n\nfrom ..symbols import *\n\n\nTAG_MAP = {\n \"ADV\": {POS: ADV},\n \"NOU...
python
chosen
[ { "from": "system", "value": "Fix potential unicode issues with Like.__unicode__()\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.db import models\nfrom django.utils import timezone\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.contrib...
python
chosen
[ { "from": "system", "value": "Split into own method for clariy and \"return\" support\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nimport traceback\n\nfrom celery import shared_task\nfrom celery.utils.log import get_task_logger\n\nfrom django.contrib.staticfiles.s...
python
chosen
[ { "from": "system", "value": "Make sure correct project name is used throughout" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nparsescrapegenerate\n---------------\n\nMain package for ParseScapeFeed\n\"\"\"\n\n__title__ = 'ParseScrapeGenerate'\n__version__ = '0.1.0'\n" }...
python
chosen
[ { "from": "system", "value": "Raise a nicer CommandError instead of showing the ValueError on the command line.\n" }, { "from": "human", "value": "\"\"\"Run scheduled jobs.\"\"\"\n\nimport datetime\nfrom optparse import make_option\nfrom django.core.management.base import NoArgsCommand\n\nfrom d...
python
chosen
[ { "from": "system", "value": "Create exactly one users function.\n" }, { "from": "human", "value": "_defaults = {\n 'api_url': 'api/v3',\n}\n\nfrom .apirequest import ApiRequest, RequestType\nfrom .users import Users\n\nclass Pyglab(object):\n def __init__(self, url, token, api_url=_defaul...
python
chosen
[ { "from": "system", "value": "Include consumer and export tests when running testsuite\n" }, { "from": "human", "value": "# import tests so django will discover and run them\n\nfrom readux.books.tests.models import *\nfrom readux.books.tests.views import *\nfrom readux.books.tests.tei import *\n...
python
chosen
[ { "from": "system", "value": "Remove unnecessary protection against using \"default\" as a subdomainconf\n\nThanks to Jannis Leidel <jezdez@enn.io> for the pointer.\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com>\n" }, { "from": "human", "value": "from django...
python
chosen
[ { "from": "system", "value": "Add DendriticLayerBase to init to ease experimentation\n" }, { "from": "human", "value": "# ----------------------------------------------------------------------\n# Numenta Platform for Intelligent Computing (NuPIC)\n# Copyright (C) 2021, Numenta, Inc. Unless you ...
python
chosen
[ { "from": "system", "value": "tests/equality: Replace test for != with an Hypothesis test\n" }, { "from": "human", "value": "import ppb_vector\n\ndef test_equal():\n test_vector_1 = ppb_vector.Vector2(50, 800)\n test_vector_2 = ppb_vector.Vector2(50, 800)\n\n assert test_vector_1 == test_vect...
python
chosen
[ { "from": "system", "value": "Add INTEGER type as alias of INT type\n" }, { "from": "human", "value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\n\n\nclass Typecode(object):\n NONE = 0\n INT = 1 <<...
python
chosen
[ { "from": "system", "value": "Fix eq/hash for FlowSpec NLRI\n\nBogus eq/hash was preventing withdraws from behaving\nproperly.\n" }, { "from": "human", "value": "from exabgp.bgp.message.update.nlri.flow import Flow as ExaBGPFlow\nfrom exabgp.bgp.message.update.nlri.nlri import NLRI\n\nfrom exabg...
python
chosen
[ { "from": "system", "value": "Make click2dial work in real life\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Base Phone module for Odoo\n# Copyright (C) 2014-2015 Alexis de Lattre (alexis@vi...
python
chosen
[ { "from": "system", "value": "Add options to better control CLI command\n\nInstead of trying to guess the `pyprojec.toml` file by looking at the\nfiles controlled by the SCM, use explicit options to control it.\n" }, { "from": "human", "value": "import sys\n\nfrom setuptools_scm import _get_vers...
python
chosen
[ { "from": "system", "value": "Revert to non-parallel chmod (argument list too long)\n" }, { "from": "human", "value": "import os\n\nfrom django.core.management.base import BaseCommand\nfrom django.conf import settings\n\nclass Command(BaseCommand):\n args = ''\n help = \"Set all permission...
python
chosen
[ { "from": "system", "value": "Fix a bug introduced by the last commit.\n" }, { "from": "human", "value": "from django.contrib.syndication.views import Feed\nfrom posts.models import Post\nfrom helpers import get_post_url, post_as_components\nfrom settings import BLOG_FULL_TITLE, BLOG_DESCRIPTION...
python
chosen
[ { "from": "system", "value": "tests/helper: Make regex helper accept more types\n" }, { "from": "human", "value": "import re\nfrom contextlib import contextmanager\nfrom datetime import timedelta\n\nfrom django.utils import timezone\nfrom freezegun import freeze_time\n\n\n@contextmanager\ndef ac...
python
chosen
[ { "from": "system", "value": "Refactor logging in celery router\n\nSend logging for celery router tasks to the 'rapidsms' logger rather than the 'celery' logger, and make sure celery knows the task failed by re-raising the exception." }, { "from": "human", "value": "import celery\nfrom celery.ut...
python
chosen
[ { "from": "system", "value": "Make use allow more connections per pool. Now capped at 10.\n" }, { "from": "human", "value": "#Copyright (C) 2011,2012 Colin Rice\n#This software is licensed under an included MIT license.\n#See the file entitled LICENSE\n#If you were not provided with a copy of th...
python
chosen
[ { "from": "system", "value": "Make fedmsg message attribute 'image_name', not just 'image'\n" }, { "from": "human", "value": "#!/bin/env python\n# -*- coding: utf8 -*-\n\nimport fedmsg\n\n\ndef message(image_name, dest, status):\n \"\"\" Takes an upload destination (ex. \"EC2-east\") and a st...
python
chosen
[ { "from": "system", "value": "Add some Route model tests\n" }, { "from": "human", "value": "from django.test import TestCase\n\nfrom org.models import Organization\nfrom ..models import Bus\n\n\nclass BusModelTest(TestCase):\n\n def setUp(self):\n self.org = Organization.objects.create...
python
chosen
[ { "from": "system", "value": "Add url for 'list all bookings' view.\n" }, { "from": "human", "value": "from django.conf.urls import include, url\n\nfrom . import views\n\napp_name = \"students\"\nurlpatterns = [\n url(r'^home/$', views.home, name='home'),\n url(r'^booking/$', views.booking...
python
chosen
[ { "from": "system", "value": "Set the next patch release number\n" }, { "from": "human", "value": "__version__ = (0, 2, 2, '', 0)\n\ndef get_version():\n version = '%d.%d.%d' % __version__[0:3]\n if __version__[3]:\n version = '%s-%s%s' % (version, __version__[3],\n ...
python
chosen
[ { "from": "system", "value": "Fix the backup url to match the docs (and retain backwards compatibility)\n" }, { "from": "human", "value": "from django.conf.urls import include, url\n\nfrom . import views\n\nurlpatterns = (\n url(\n '^create-datastore-backup$',\n views.create_dat...
python
chosen
[ { "from": "system", "value": "Add GradientModel to the API\n" }, { "from": "human", "value": "# Overwrite behavior of sympy objects to make more sense for this project.\nimport symfit.core.operators\n\n# Expose useful objects.\nfrom symfit.core.fit import (\n Fit, Model, Constraint, ODEModel,...
python
chosen
[ { "from": "system", "value": "Return empty string if result output is disabled\n" }, { "from": "human", "value": "import jinja2\nimport six\nimport os\n\nfrom st2actions.runners.pythonrunner import Action\nfrom st2client.client import Client\n\n\nclass FormatResultAction(Action):\n def __init...
python
chosen
[ { "from": "system", "value": "Add tests for marker_comment from ascott1/appendix-ref\n" }, { "from": "human", "value": "from unittest import TestCase\n\nfrom regparser.grammar.unified import *\n\n\nclass GrammarCommonTests(TestCase):\n\n def test_depth1_p(self):\n text = '(c)(2)(ii)(A)...
python
chosen
[ { "from": "system", "value": "Increment version number to 0.18.5\n" }, { "from": "human", "value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.18.4\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"...
python
chosen
[ { "from": "system", "value": "Add CQL-splitting test case for double-dollar-sign strings\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nimport pytest\n\nfrom cassandra_migrate.cql import CqlSplitter\n\n\n@pytest.mark.parametrize('cql,statements', [\n # Two state...
python
chosen
[ { "from": "system", "value": "tests: Add \"Installation finished check\" step\n\nStep that asks libvirt every minute if VM state is installed. Step\nfails after specified amount of time, if not.\n\nhttps://bugzilla.gnome.org/show_bug.cgi?id=748006\n" }, { "from": "human", "value": "#!/usr/bin/py...
python
chosen
[ { "from": "system", "value": "Remove uuid display from user string\n" }, { "from": "human", "value": "from django.db import models\nfrom helusers.models import AbstractUser\n\n\nclass User(AbstractUser):\n def __str__(self):\n return ' - '.join([super().__str__(), self.get_display_name...
python
chosen
[ { "from": "system", "value": "Add fuzz call to SBStringList.AppendString(None). LLDB should not crash.\n\n\ngit-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@146935 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "\"\"\"\nFuzz tests an object after the default construc...
python
chosen
[ { "from": "system", "value": "Use os.pathsep instead of ':' for windows compat\n" }, { "from": "human", "value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nCommon definitions for Mica subpackages\n\"\"\"\nimport os\n\n\nclass MissingDataError(Exception):\n pass\...
python
chosen
[ { "from": "system", "value": "Add utility method to print all settings\n" }, { "from": "human", "value": "import sys\n\nfrom future.utils import iteritems\n\nfrom . import base\n\n\ndef put_setting(key, value):\n setattr(sys.modules[__name__], key, value)\n _keys.add(key)\n\n\ndef configur...
python
chosen
[ { "from": "system", "value": "Revert \"Revert \"log to file, don't email\"\"\n\nThis reverts commit 95245bb7fab6efe5a72cb8abbf4380a26b72a720.\n" }, { "from": "human", "value": "from django.middleware.csrf import CsrfViewMiddleware, REASON_NO_CSRF_COOKIE, REASON_BAD_TOKEN\n\nfrom corehq.util.soft...
python
chosen
[ { "from": "system", "value": "Make sure we're testing the right function!\n" }, { "from": "human", "value": "import pytest\nimport pytz\nfrom astral import LocationInfo\n\n\nclass TestLocationInfo:\n def test_Default(self):\n loc = LocationInfo()\n assert loc.name == \"Greenwich...
python
chosen
[ { "from": "system", "value": "Make imagenet server tester logging better.\n" }, { "from": "human", "value": "#!/usr/bin/python\n\nimport logging\nimport os\n\nimport cv2\n\nimport numpy as np\n\nimport image_getter\n\ndef main():\n # Configure root logger.\n root = logging.getLogger()\n root....
python
chosen
[ { "from": "system", "value": "Add MotoNyan to mad hax\n" }, { "from": "human", "value": "from motobot import command, action\n\n\n@command('say')\ndef say_command(bot, message, database):\n masters = [\n \"Moto-chan\",\n \"Motoko11\",\n \"Akahige\",\n \"betholas\",...
python
chosen
[ { "from": "system", "value": "Customize scripts to work with menu\n" }, { "from": "human", "value": "import ibmcnx.test.loadFunction\n\nloadFilesService()\n\nFilesPolicyService.browse( \"title\", \"true\", 1, 25 )\n" }, { "from": "gpt", "value": "import ibmcnx.test.loadFunction\n\nib...
python
chosen
[ { "from": "system", "value": "Remove job when done and match servicelayer api\n" }, { "from": "human", "value": "import logging\nfrom followthemoney import model\nfrom servicelayer.worker import Worker\nfrom servicelayer.jobs import JobStage as Stage\n\nfrom ingestors.manager import Manager\n\nl...
python
chosen
[ { "from": "system", "value": "Add avocado dependency to metadata migration.\n\nSigned-off-by: Aaron Browne <a437ff1f67cf5e38cd2f6119addad5bba3897ae0@gmail.com>\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom south.v2 import DataMigration\n\nclass Migration(DataMigration):\n\n ...
python
chosen
[ { "from": "system", "value": "Fix filename in django-compress settings\n" }, { "from": "human", "value": "COMPRESS_CSS = {\n 'common_styles': {\n 'source_filenames': ('feedzilla/css/reset.css', 'feedzilla/css/style.css'),\n 'output_filename': 'css/common_styles.r?.css',\n }\n...
python
chosen
[ { "from": "system", "value": "Handle sensors / types that aren't in config file\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport mosquitto\nimport os\nimport time\nimport json\nimport random\nimport yaml\n\n# Load config\nstream = open(\"config.yml\", 'r')\nconfig = yaml.load(s...
python
chosen
[ { "from": "system", "value": "[IMP] Use constraint decorator on account_constraints+\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author Joel Grand-Guillaume. Copyright 2012 Camptocamp SA\n#\n#...
python
chosen
[ { "from": "system", "value": "Replace group with static username\n" }, { "from": "human", "value": "\"\"\"\nPermissions classes for User accounts API views.\n\"\"\"\nfrom __future__ import unicode_literals\n\nfrom rest_framework import permissions\n\nUSERNAME_REPLACEMENT_GROUP = \"username_repla...
python
chosen
[ { "from": "system", "value": "Allow topic to be nullable in schema\n" }, { "from": "human", "value": "from asyncqlio.orm.schema.column import Column\nfrom asyncqlio.orm.schema.table import table_base\nfrom asyncqlio.orm.schema.types import BigInt, Serial, Text, Timestamp\n\nTable = table_base()\...
python
chosen
[ { "from": "system", "value": "Move string formatting onto two lines for readability\n" }, { "from": "human", "value": "import string\nimport socket\nimport sys\nimport time\nimport threading\n\n\nclass SimpleSocket:\n def __init__(self, hostname=\"localhost\", port=8888, timeout=2):\n ...
python
chosen
[ { "from": "system", "value": "Fix badge impact migration if badges are present\n\nIf badges are already present in the system, their impact value must be set to something other than NULL. (default=0 is misleading, since it just applies to newly created badges, see http://stackoverflow.com/q/16097149/35070)....
python
chosen
[ { "from": "system", "value": "Increase iterations. Add assertion of max board cards.\n" }, { "from": "human", "value": "# usage: python one_time_eval.py hole_cards [board_cards]\n# examples:\n# python one_time_eval.py as8sqdtc\n# python one_time_eval.py as8sqdtc 2skskd\n# ...
python
chosen
[ { "from": "system", "value": "Add shadow changing support according to our new passwd.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nimport sys\n\n_args = sys.argv\n\nif __name__ == \"__main__\":\n if len(_args) == 5:\n keys_file = _args[1]\n target_file = _args[2...
python
chosen
[ { "from": "system", "value": "FIX l10n_it_website_portal_fiscalcode check after invoice issuing\n\nSteps:\n\n - Create a partner (type company) and give them portal access\n - With the new user, access to portal\n - Edit partner details setting fiscal code with 11 digits\n - Using admin, create an invoice f...
python
chosen
[ { "from": "system", "value": "Allow logging to console as well as disk\n" }, { "from": "human", "value": "import os\nimport logging\n\nfrom datetime import datetime\n\n\nlog_name = '{}/../logs/{}.log'.format(os.path.dirname(os.path.abspath(__file__)),\n datet...
python
chosen
[ { "from": "system", "value": "config-perf: Enable port list optimization by default for new install+provision\n\nFrom R1.05 onwards port is created as child of project. This leads to\nbetter list performance.\n\nChange-Id: Id0acbd1194403c500cdf0ee5851ef6cf5dba1c97\nCloses-Bug: #1441924\n" }, { "from...
python
chosen
[ { "from": "system", "value": "Set wait variable to 10 seconds.\n" }, { "from": "human", "value": "Class Application(object):\n\n def __init__(sefl, driver):\n self.driver = driver\n\n def go_to_homepage(self):\n self.driver.get(\"http://hub.wart.ru/php4dvd/\")\n\n def logi...
python
chosen
[ { "from": "system", "value": "Use client_id as url identifier.\n" }, { "from": "human", "value": "from django.contrib.auth.decorators import login_required\nfrom django.utils.decorators import method_decorator\nfrom django.views import generic\nfrom django.core.urlresolvers import reverse\n\nfro...
python
chosen
[ { "from": "system", "value": "migrations: Enforce evaluation order in 0306 WHERE clause.\n\nDepending on PostgreSQL’s query plan, it was possible for the value\ncondition to be evaluated before the field_type condition was checked,\nleading to errors like\n\npsycopg2.errors.InvalidDatetimeFormat: invalid va...
python
chosen
[ { "from": "system", "value": "Remove print statements for syncdb receivers\n" }, { "from": "human", "value": "from django.db.models.signals import post_syncdb\nfrom django.conf import settings\n\nfrom accounts import models\n\n\ndef ensure_core_accounts_exists(sender, **kwargs):\n create_sour...
python
chosen
[ { "from": "system", "value": "Set the MySQL related configuration.\n" }, { "from": "human", "value": "from flask import Flask\n\napp = Flask(__name__)\nfrom app import views" }, { "from": "gpt", "value": "from flask import Flask\n\napp = Flask(__name__)\nfrom app import views\n\n# Fl...
python
chosen
[ { "from": "system", "value": "Add altitude cross event detector\n" }, { "from": "human", "value": "from astropy import units as u\nfrom numpy.linalg import norm\n\n\nclass LithobrakeEvent:\n \"\"\"Terminal event that detects impact with the attractor surface.\n\n Parameters\n ----------...
python
chosen
[ { "from": "system", "value": "Fix behavioural bug in shuffling\n\nPreviously shuffling would create a new deck, implying that all the\ncards had been \"picked up\" and were being shuffled for a new hand.\nHowever, this did not pick up the visible cards from the game, so the\nvisible cards would just continu...
python
chosen
[ { "from": "system", "value": "Delete both pending bases and translations\n" }, { "from": "human", "value": "# Generated by Django 3.2.15 on 2022-08-25 17:25\n\nfrom django.db import migrations\nfrom django.conf import settings\n\n\ndef delete_pending_exercises(apps, schema_editor):\n \"\"\"\n...
python
chosen
[ { "from": "system", "value": "Rename force flag to force-revalidation\n" }, { "from": "human", "value": "from optparse import make_option\nfrom django.core.management.base import BaseCommand\nfrom django.db.models.loading import cache\nfrom ...utils import validate_app_cache\n\n\nclass Command(B...
python
chosen
[ { "from": "system", "value": "Add a test case to see that we're making a request with the url we pass in\n" }, { "from": "human", "value": "import unittest\nfrom unittest.mock import patch\n\nfrom concurrency.get_websites import load_url as load_url\n\nclass TestGetWebsites(unittest.TestCase):\n...
python
chosen
[ { "from": "system", "value": "Remove many to many key generation in test\n" }, { "from": "human", "value": "from model_mommy import mommy\nfrom tests.BaseTestWithDB import BaseTestWithDB\nfrom topics.models import CurriculumIntegration\nfrom topics.models import CurriculumArea\nfrom topics.model...
python
chosen
[ { "from": "system", "value": "Add re import for regex\n" }, { "from": "human", "value": "from flask import request, flash, render_template\nimport bcrypt\n\nfrom app import app, helpers\n\n\n@app.route('/create_user', methods=['GET', 'POST'])\ndef create_user():\n if request.method == 'POST':...
python
chosen
[ { "from": "system", "value": "Remove unused functions from general solution.\n" }, { "from": "human", "value": "'''generalsolution.py\nHolds the general solution base class\n\nCreated on 22 Apr 2010\n\n@author: Ian Huston\n'''\n\nimport numpy as np\n\nclass GeneralSolution(object):\n \"\"\"Ge...
python
chosen
[ { "from": "system", "value": "Add some doc to the tests\n" }, { "from": "human", "value": "#!/usr/bin/python\n# -*- coding:Utf-8 -*-\n\nimport unittest\nfrom tododb import TodoDB, TodoAlreadyExist\n\nclass MaTest(unittest.TestCase):\n\n def reinitialise(self):\n tododb = TodoDB()\n ...
python
chosen
[ { "from": "system", "value": "Use pkg_resources.get_distribution instead of .require for version\n" }, { "from": "human", "value": "\"\"\"\ndj-stripe - Django + Stripe Made Easy\n\"\"\"\nimport pkg_resources\nfrom django.apps import AppConfig\n\n__version__ = pkg_resources.require(\"dj-stripe\")...
python
chosen
[ { "from": "system", "value": "Make a test of multiple header values insensitve to their order\n\nThis test sometimes failed on Python 3 because the values in the header\nwere ordered differently - splitting them and comparing as a set should\nfix that.\n" }, { "from": "human", "value": "from __f...
python
chosen
[ { "from": "system", "value": "Add binding to random port with identity\n" }, { "from": "human", "value": "import netifaces\n\ndef get_my_ip():\n eth_interfaces = [ifname for ifname in netifaces.interfaces() if ifname.startswith('eth')]\n if len(eth_interfaces) < 1:\n ifname = 'lo'\n...
python
chosen
[ { "from": "system", "value": "Fix repeated prompt bug in keep run\n" }, { "from": "human", "value": "import json\nimport os\nimport re\nimport click\nfrom keep import cli, utils\n\n\n@click.command('run', short_help='Executes a saved command.')\n@click.argument('pattern')\n@cli.pass_context\ndef...
python
chosen
[ { "from": "system", "value": "Add tests which test default parameters for nap api\n" }, { "from": "human", "value": "\"\"\"\nTests for nap module.\n\nThese tests only focus that requests is called properly.\nEverything related to HTTP requests should be tested in requests' own tests.\n\"\"\"\n\n...
python
chosen
[ { "from": "system", "value": "Remove PeeringDB sync records on migrate\n" }, { "from": "human", "value": "# Generated by Django 3.1.3 on 2020-12-07 21:33\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\"peeringdb\", \"0012_peerre...
python
chosen
[ { "from": "system", "value": "Add compute_formula method to MrpPropertyFormula to use in modules which depending on it\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2014-15 Agile B...
python
chosen
[ { "from": "system", "value": "Add configuration values for length of newly generated aliases\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n''' Default configuration for the application\n\nThis data must be supplemented with custom configuration to which\nURL_SHORTENER_CONFIGURATION...
python
chosen
[ { "from": "system", "value": "Update requirements where it matters\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom setuptools import setup, find_packages\n\nwith open('README.rst') as f:\n readme = f.read()\n\nwith open('LICENSE') as f:\n license = f.read()\n\n# I wish the...
python
chosen
[ { "from": "system", "value": "Update extract language package to use inner delete commands to reduce the\namount of space used at any given point in time.\n" }, { "from": "human", "value": "import optparse\nimport os\nimport glob\n\noptparser = optparse.OptionParser()\noptparser.add_option(\"-f\...
python
chosen
[ { "from": "system", "value": "Add XPath Query filter to report\n" }, { "from": "human", "value": "from __future__ import absolute_import, unicode_literals\n\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom corehq.apps.es.case_search import CaseSearchES\nfrom corehq.apps.reports.s...
python
chosen
[ { "from": "system", "value": "TST: Add coverage for basic broker usage.\n" }, { "from": "human", "value": "import unittest\nfrom datetime import datetime\nimport numpy as np\nimport pandas as pd\nfrom ..sources import channelarchiver as ca\nfrom ..sources import switch\n\n\nclass TestBroker(unit...
python
chosen
[ { "from": "system", "value": "Fix s3 upload file extra_args named paramether\n" }, { "from": "human", "value": "import boto3\nfrom boto3.s3.transfer import S3Transfer\nfrom config import AWS_ACCESS_KEY, AWS_SECRET_KEY\n\n\ndef delete_s3_file(file_id):\n client = boto3.client(\n 's3',\n...
python
chosen
[ { "from": "system", "value": "Allow slugs in url patterns\n" }, { "from": "human", "value": "from django.conf.urls.defaults import *\nfrom .feed import blogFeed\n\nurlpatterns = patterns('copywriting',\n (r'^feed\\.rss$', blogFeed()),\n (r'^feed/$', ...
python
chosen
[ { "from": "system", "value": "Fix error in thumbnail deletion.\n" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\n\nfrom gallery import models\nfrom gallery.tasks import create_thumbnail\n\n\nclass Command(BaseCommand):\n help = 'Generates thumbnails for g...
python
chosen
[ { "from": "system", "value": "Add rtd import to master\n" }, { "from": "human", "value": "import shutil\nimport os\n\nfrom projects.models import Project\n\nslugs = [p.slug for p in Project.objects.all()]\nbuild_projects = os.listdir('/home/docs/checkouts/readthedocs.org/user_builds/')\n\nfinal ...
python
chosen
[ { "from": "system", "value": "Make sure np.array is used for PCA in measureLength\n" }, { "from": "human", "value": "import numpy as np\nfrom sklearn.decomposition import PCA\n \ndef measureLength(pointCloud):\n \"\"\"Returns the length of a point cloud in its longest direction.\"\"\" \n ...
python
chosen
[ { "from": "system", "value": "Fix render() kwargs for Django 2.1\n" }, { "from": "human", "value": "import mimetypes\nfrom django.contrib.admin.widgets import AdminFileWidget\nfrom django.template.loader import render_to_string\n\n\nclass ImagePreviewWidget(AdminFileWidget):\n \"\"\"\n An ...
python
chosen
[ { "from": "system", "value": "Change import util to .util to support python 3\n" }, { "from": "human", "value": "import pandas as pd\n\n\nfrom util import *\nimport dataset\n\nfrom pkg_resources import get_distribution\ntry:\n __version__ = get_distribution('great_expectations').version\nexce...
python
chosen
[ { "from": "system", "value": "Add list filtering for alerts\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom nodeconductor.logging import models\n\n\nclass AlertAdmin(admin.ModelAdmin):\n list_display = ('uuid', 'alert_type', 'closed', 'scope', 'severity')\n orde...
python
chosen
[ { "from": "system", "value": "Fix a rather stupid bug.\n" }, { "from": "human", "value": "#! /usr/bin/env python\n#\n# Copyright (c) 2011 SEOmoz\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Sof...
python
chosen
[ { "from": "system", "value": "Test translations now uses instance.language.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.test import TestCase\nfrom django.test.utils import override_settings\n\nfrom ..registry import LinguistRegistry as Registry\n\nfrom . import settin...
python
chosen
[ { "from": "system", "value": "Update example to demo various tessellations\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.\n# Distribute...
python
chosen
[ { "from": "system", "value": "Move positional argument to the end.\n\nThis doesn't seem to work on a Mac when option comes after the positional\nargument, not sure why this is, something to do with options parsing.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom integrationtest ...
python
chosen
[ { "from": "system", "value": "Refactor TextWidgetConfig out of TextWidget\n" }, { "from": "human", "value": "from pkg_resources import resource_string\n\nfrom twisted.web.template import renderer, XMLString\n\nfrom diamondash.widgets.widget.widget import Widget\n\n\nclass TextWidget(Widget):\n ...
python
chosen
[ { "from": "system", "value": "Add volume disk usage to snapshot tags\n" }, { "from": "human", "value": "\"\"\"Place of record for the package version\"\"\"\n\n__version__ = \"1.1.15\"\n__rpm_version__ = \"WILL_BE_SET_BY_RPM_BUILD\"\n__git_hash__ = \"WILL_BE_SET_BY_EGG_BUILD\"\n" }, { "fr...
python
chosen
[ { "from": "system", "value": "Use __file__ to find find the module\n\n`inspect.getfile(inspect.currentframe())` seems to return a relative path that\nends up with the virtualfish functions not being loaded.\n" }, { "from": "human", "value": "from __future__ import print_function\nimport os\nimpo...
python
chosen
[ { "from": "system", "value": "Disable indexing through celery when it's disabled.\n" }, { "from": "human", "value": "from haystack.indexes import *\nfrom haystack import site\nfrom celery_haystack.indexes import CelerySearchIndex\n\n\nimport djangobb_forum.models as models\n\nclass PostIndex(Cel...
python
chosen
[ { "from": "system", "value": "[caps] Mark CAPA= as None instead of True\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# Written by Daniel Oaks <daniel@danieloaks.net>\n# Released under the ISC license\nfrom .utils import CaseInsensitiveDict, CaseInsensitiveList\n\n\nclass Capabiliti...
python
chosen
[ { "from": "system", "value": "Remove attributes instead of setting a false value like [].\n" }, { "from": "human", "value": "from eduid_am.exceptions import UserDoesNotExist\n\n\nWHITELIST_SET_ATTRS = (\n 'givenName',\n 'sn',\n 'displayName',\n 'photo',\n 'preferredLanguage',\n ...
python
chosen
[ { "from": "system", "value": "Fix command center selection in example\n" }, { "from": "human", "value": "import sc2\nfrom sc2 import run_game, maps, Race, Difficulty\nfrom sc2.player import Bot, Computer\nfrom sc2.constants import *\n\n\nclass TerranBot(sc2.BotAI):\n async def on_step(self, i...
python
chosen
[ { "from": "system", "value": "Add reload routines to DebianUtils plugin\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n#\n# Debian Changes Bot\n# Copyright (C) 2008 Chris Lamb <chris@chris-l...
python
chosen
[ { "from": "system", "value": "Fix identity scales, override map & train methods\n" }, { "from": "human", "value": "from __future__ import absolute_import, division, print_function\n\nfrom ..utils import identity, alias\nfrom .scale import scale_discrete, scale_continuous\n\n\nclass scale_color_i...
python
chosen