conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Replace Glue interface by more restrictive Unpack.\n" }, { "from": "human", "value": "from .compress import Compress\nfrom .copy import Copy\nfrom .fix_dicom import FixDicom\nfrom .group_dicom import GroupDicom\nfrom .map_ctp import MapCTP\nfrom .move import Move\nf...
python
chosen
[ { "from": "system", "value": "Make modulation test wait for sound to stop playing before exiting\n" }, { "from": "human", "value": "import pygame\nimport random\nfrom demodulate.cfg import *\nfrom gen_tone import *\n\nif __name__ == \"__main__\":\n\tpygame.mixer.pre_init(frequency = int(SAMPLE_F...
python
chosen
[ { "from": "system", "value": "Move inital_build task into own function\n" }, { "from": "human", "value": "import os\n\nfrom fabric.api import run, env, settings, cd, put, sudo\nfrom fabric.contrib import files\n\nimport private\n\ndef prod():\n env.hosts = list(private.PROD_SERVERS)\n\n\ndef ...
python
chosen
[ { "from": "system", "value": "Change url and views for login/logout to django Defaults\n" }, { "from": "human", "value": "from django.conf.urls import patterns, url\nfrom django.contrib import auth\n\nurlpatterns = patterns('',\n url(r'^login/$', 'django.contrib.auth.views.login',{'template_n...
python
chosen
[ { "from": "system", "value": "Add second part of puzzle\n" }, { "from": "human", "value": "i = input()\nfloor = 0\nfor x in range(0, len(i)):\n if i[x] == '(':\n floor +=1;\n elif i[x] == ')':\n floor -=1;\nprint(floor)" }, { "from": "gpt", "value": "i = input()\n...
python
chosen
[ { "from": "system", "value": "Add Cython to py.test header" }, { "from": "human", "value": "# this contains imports plugins that configure py.test for astropy tests.\n# by importing them here in conftest.py they are discoverable by py.test\n# no matter how it is invoked within the astropy tree.\...
python
chosen
[ { "from": "system", "value": "Fix fake game one script again\n" }, { "from": "human", "value": "import random\n\nfrom django.core.management.base import BaseCommand\nfrom django.contrib.auth.models import User\n\nfrom mla_game.apps.accounts.models import Profile\n\nfrom ...models import (\n T...
python
chosen
[ { "from": "system", "value": "Remove channel (list_display, list_filter and search_fields) on PublishableAdmin core\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\n\n\nclass PublishableAdmin(admin.ModelAdmin):\n \"\"\"\n ...
python
chosen
[ { "from": "system", "value": "Ch05: Tag Detail: get slug from URL pattern.\n" }, { "from": "human", "value": "from django.http.response import HttpResponse\nfrom django.template import Context, loader\n\nfrom .models import Tag\n\n\ndef homepage(request):\n tag_list = Tag.objects.all()\n t...
python
chosen
[ { "from": "system", "value": "Plugins: Make it easier to integrate commercial plugins.\n" }, { "from": "human", "value": "# Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n# Part of \"Nuitka\", an optimizing Python compiler that is compatible and\n# integrates with CPython,...
python
chosen
[ { "from": "system", "value": "Relocate core status codes to the 450-499 range\n" }, { "from": "human", "value": "#\n# Copyright (c) 2010 rPath, Inc.\n#\n# This program is distributed under the terms of the Common Public License,\n# version 1.0. A copy of this license should have been distributed...
python
chosen
[ { "from": "human", "value": "Set up run tests file.\n" }, { "from": "gpt", "value": "#!/usr/bin/env python3\n#\n# Affero GPL\n#\nimport unittest\n\ndef alltests():\n return unittest.TestSuite([\n ])\n\nunittest.TextTestRunner(verbosity = 2).run(alltests())\n" } ]
python
chosen
[ { "from": "system", "value": "Fix bug with omitting v\n" }, { "from": "human", "value": "data = open(\"input.txt\").read().strip()\n\nimport re\nfrom collections import Counter\n\ndef solve1(data):\n prevData = None\n while data != prevData:\n prevData = data\n for a,b in zip...
python
chosen
[ { "from": "system", "value": "Update copyright years of the interpreter\n" }, { "from": "human", "value": "import help_formatter\nimport argparse\n\ndef process_options():\n parser = _make_options_parser()\n return parser.parse_args()\n\ndef _make_options_parser():\n parser = argparse.A...
python
chosen
[ { "from": "system", "value": "Fix references not available after pulling up two instances of roamer\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"\nargh\n\"\"\"\n\nimport os\nfrom roamer.python_edit import file_editor\nfrom roamer.directory import Directory\nfrom roamer.edit_...
python
chosen
[ { "from": "system", "value": "Update to next version number following release of 1.1.0\n" }, { "from": "human", "value": "\"\"\" pywind module.\n\n For more information visit https://github.com/zathras777/pywind\n\n\"\"\"\n__version__ = '1.1.0'\n" }, { "from": "gpt", "value": "\"\"\"...
python
chosen
[ { "from": "system", "value": "Add Artist ordering by name\n" }, { "from": "human", "value": "from django.db import models\n\n\nclass Artist(models.Model):\n name = models.CharField(max_length=100)\n image_url = models.URLField(blank=True)\n thumb_url = models.URLField(blank=True)\n\n ...
python
chosen
[ { "from": "system", "value": "Add the base_name to the API routers for the custom query_set\n" }, { "from": "human", "value": "from django.conf.urls import url, include\nfrom django.contrib import admin\nfrom rest_framework import routers\nfrom task.views import *\nfrom userprofile.views import ...
python
chosen
[ { "from": "system", "value": "Remove unnecessary fixtures attribute, already set by base class.\n" }, { "from": "human", "value": "from wagtail.wagtailcore.models import Page\n\nfrom .base import SeleniumTestCase\n\n\nclass PagesTest(SeleniumTestCase):\n fixtures = ['basic_site.json']\n\n ...
python
chosen
[ { "from": "system", "value": "Replace deprecated fractions.gcd with Euclid's Algorithm\n" }, { "from": "human", "value": "\"\"\"Solution to Project Euler Problem 5\nhttps://projecteuler.net/problem=5\n\"\"\"\n\nfrom fractions import gcd\nfrom functools import reduce\n\nMAXIMUM = 20\n\n\ndef comp...
python
chosen
[ { "from": "system", "value": "Change unit test syntax for pandas > 0.12.0 compat\n" }, { "from": "human", "value": "import os\nimport numpy as np\nimport pandas as pd\nimport unittest\nfrom urllib2 import urlopen\n\nfrom bom_data_parser import read_soi_html\n\nclass SOITest(unittest.TestCase):\n...
python
chosen
[ { "from": "system", "value": "Add announcebot to default module root for ease of import\n" }, { "from": "human", "value": "__all__ = [\"roll\", \"tracery\"]\nfrom .roll import DiceBot\nfrom .tracery import TraceryBot\n" }, { "from": "gpt", "value": "__all__ = [\"roll\", \"tracery\"]\...
python
chosen
[ { "from": "system", "value": "Expand on the Chart Maker example tests\n" }, { "from": "human", "value": "from seleniumbase import BaseCase\n\n\nclass MyChartMakerClass(BaseCase):\n\n def test_chart_maker(self):\n self.create_pie_chart(title=\"Automated Tests\")\n self.add_data_p...
python
chosen
[ { "from": "system", "value": "[SwiftLanguageRuntime] Mark a test relying on foundation as darwin only.\n" }, { "from": "human", "value": "\"\"\"\nTest that variables passed in as a class constrained protocol type\nare correctly printed.\n\"\"\"\nimport lldbsuite.test.lldbinline as lldbinline\n\n...
python
chosen
[ { "from": "system", "value": "Remove / from the beginning of the '/reactivate' url\n\nFixes #10\n" }, { "from": "human", "value": "from django.conf.urls import include, url\nfrom .views import reactivate_user\n\napp_name = \"useraudit\"\n\nurlpatterns = [\n url(r'/reactivate/(?P<user_id>\\d+)...
python
chosen
[ { "from": "system", "value": "Mark PDUs as not implemented to avoid false positives in reboots.\n" }, { "from": "human", "value": "class PDU(object):\n def __init__(self, fqdn, port):\n self.fqdn = fqdn\n self.port = port\n\n def off(self):\n pass\n def on(self):\n ...
python
chosen
[ { "from": "system", "value": "Make normalize lower case as well.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\nProvides a translation method that strips Turkish characters and replaces\nthem with ASCII equivalents.\n\"\"\"\n\n\ntranslate_table = {\n ord(u\"ğ\"): u\"g\",\...
python
chosen
[ { "from": "system", "value": "Add test for article view\n" }, { "from": "human", "value": "import datetime\nfrom django.test import TestCase\nfrom django.utils import timezone\n\nfrom myblog.models import Article, Author\n\n\nclass ArticleMethodTest(TestCase):\n \"\"\"docstring for ArticleMet...
python
chosen
[ { "from": "system", "value": "Remove greenkeeper directories from gh-pages\n" }, { "from": "human", "value": "#! python\n\nimport sys\nimport requests\nimport urllib3\nfrom os import listdir\nfrom shutil import rmtree\nfrom json import loads\n\nurllib3.disable_warnings()\n\n\ndef main():\n ur...
python
chosen
[ { "from": "system", "value": "Fix tiny errors in Python code\n" }, { "from": "human", "value": "\n# This is fairly specific to using a Yourls server: see http://yourls.org/\n\nimport urllib\nimport urllib2\n\nimport Util\n\nSHORTEN_PART = 'yourls-api.php'\n\ndef shorten(url, config):\n def sho...
python
chosen
[ { "from": "system", "value": "Replace exporter registry keys with short_name derivative\n\nFix #203\n\nSigned-off-by: Byron Ruth <e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98@devel.io>\n" }, { "from": "human", "value": "from avocado.core import loader\nfrom avocado.conf import OPTIONAL_DEPS\nfrom _b...
python
chosen
[ { "from": "system", "value": "Add auto select port function\n" }, { "from": "human", "value": "\nfrom select import select\nimport logging\nimport socket\n\nlogger = logging.getLogger(\"HTTPServer\")\n\nfrom fluxghost.http_handlers.websocket_handler import WebSocketHandler\nfrom fluxghost.http_h...
python
chosen
[ { "from": "system", "value": "Add lost handler for puppet\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom solar.core.handlers.ansible_template import AnsibleTemplate\nfrom solar.core.handlers.ansible_playbook import AnsiblePlaybook\nfrom solar.core.handlers.base import Empty\nfr...
python
chosen
[ { "from": "system", "value": "Switch to default mail from variable\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.core.mail import EmailMultiAlternatives\nfrom django.template.loader import get_template\nfrom django.template import Context\n\ndef send_group_mail...
python
chosen
[ { "from": "system", "value": "Fix example of how to run script, and make it executable\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\nAdd a series of users from a file of JSON objects, one per line.\n\nThe JSON user object lines can have the following fields:\n\n{\"name\": \"A...
python
chosen
[ { "from": "system", "value": "Add ability to manually fail instructor tasks in batches.\n\nWhen an InstructorTask is stuck in QUEUING (say if there was a\nproblem with celery), the support team needs to manually intervene\nand mark the task as \"FAILED\" so that new tasks of that type can\nbe created for th...
python
chosen
[ { "from": "system", "value": "Update license header to reference BSD.\n" }, { "from": "human", "value": "# hgallpaths.py - pull and push too all paths\n#\n# Copyright 2012 Keegan Carruthers-Smith <keegan.csmith@gmail.com>\n#\n# This software may be used and distributed according to the terms of ...
python
chosen
[ { "from": "system", "value": "Fix to make user profile display\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding:utf8 -*-\n# Copyright (C) 2013 FinalsClub Foundation\n\nfrom django.contrib.auth.models import User\nfrom django.views.generic import TemplateView\nfrom django.v...
python
chosen
[ { "from": "system", "value": "Access weights using new interface.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport climate\nimport matplotlib.pyplot as plt\nimport theanets\n\nfrom utils import load_cifar, plot_layers, plot_images\n\ng = climate.add_arg_group('CIFAR Example')\n...
python
chosen
[ { "from": "system", "value": "Make the types available in the main \"stl\" module.\n" }, { "from": "human", "value": "\nimport stl.ascii\nimport stl.binary\n\n\ndef read_ascii_file(file):\n return stl.ascii.parse(file)\n\n\ndef read_binary_file(file):\n return stl.binary.parse(file)\n\n\nd...
python
chosen
[ { "from": "system", "value": "Rename the reading functions \"read_\" rather than \"parse_\".\n\n\"Parsing\" is what they do internally, but \"read\" is a better opposite to\n\"write\" and matches the name of the underlying raw file operation.\n" }, { "from": "human", "value": "\nimport stl.ascii...
python
chosen
[ { "from": "system", "value": "BUG: Fix a failing test due to refactor\n" }, { "from": "human", "value": "\"\"\"\nTesting the MlabSceneModel\n\"\"\"\nimport unittest\n\nfrom enthought.traits.api import HasTraits, Instance\nfrom enthought.mayavi.tools.mlab_scene_model import MlabSceneModel\nfrom e...
python
chosen
[ { "from": "system", "value": "Add another test for CallExplorer.history_glob\n" }, { "from": "human", "value": "# Copyright (c) 2013 The SAYCBridge 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\nimport unit...
python
chosen
[ { "from": "system", "value": "Add the directory of the project module to system path\n" }, { "from": "human", "value": "from ideascaly.auth import AuthNonSSO\nfrom ideascaly.api import API\n\nimport ConfigParser\nimport unittest\n\nconfig = ConfigParser.ConfigParser()\nconfig.read('config')\n\n\...
python
chosen
[ { "from": "system", "value": "Send results to the server\n" }, { "from": "human", "value": "import requests\nimport config\n\ndef request(slug):\n url = \"%s%s\" % (config.server_url, slug)\n req = requests.get(url)\n\n if req.status_code != requests.codes.ok:\n raise req.raise_f...
python
chosen
[ { "from": "system", "value": "libs: Add automodule sphinx directive for wlgen package\n" }, { "from": "human", "value": "# Copyright 2015-2015 ARM Limited\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License...
python
chosen
[ { "from": "system", "value": "Add the import hook to sys.meta_path\n" }, { "from": "human", "value": "import sys\n\nclass SempaiLoader(object):\n def __init__(self, *args):\n print args\n\n def find_module(self, fullname, path=None):\n print 'finding', fullname, path\n ...
python
chosen
[ { "from": "system", "value": "Fix normalization of tags in case is None\n" }, { "from": "human", "value": "\"\"\"\nThis library offers an API to use Tacyt in a python environment.\nCopyright (C) 2015-2020 Eleven Paths\n\"\"\"\ntry:\n import simplejson as json\nexcept ImportError:\n import ...
python
chosen
[ { "from": "system", "value": "Use 'my_counts' as name for MyCountsListView\n" }, { "from": "human", "value": "from django.conf.urls import patterns, include, url\nfrom django.views.generic.simple import direct_to_template\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\n\nfr...
python
chosen
[ { "from": "system", "value": "Remove import of version 1.0 feature\n" }, { "from": "human", "value": "# flake8: noqa (ignore unused imports)\n\n# Version 1.0\n\nfrom . import ripasso\nfrom .element import Element\nfrom .segment import Segment\nfrom .sequence import Sequence\nfrom .blueprint imp...
python
chosen
[ { "from": "system", "value": "Test exclude equality with sets\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\nTests for the barebones example project\n\"\"\"\nimport os\nimport py.path\n\nfrom tarbell.app import EXCLUDES, TarbellSite\n\nPATH = os.path.realpath('examples/bareb...
python
chosen
[ { "from": "system", "value": "CLEAN simplify useless dep and methods\n" }, { "from": "human", "value": "class sheet(object):\n\t\"\"\" sheet: Top level object. \n\t\tModels the entire music sheet \"\"\"\n\tdef __init__(self, name):\n\t\tsuper(sheet, self).__init__()\n\t\tself.name = name\n\t\tse...
python
chosen
[ { "from": "system", "value": "Update preamble: no indent on quote, smaller verbatim font size.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport docutils.core as dc\n\nfrom writer import writer\n\nimport os.path\nimport sys\nimport glob\n\npreamble = '\\n'.join([r'% PDF Standard...
python
chosen
[ { "from": "system", "value": "Fix Django 1.7 migration support\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations, connection\nimport django.db.models.deletion\n\nis_index = connection.vendor != 'mysql'\...
python
chosen
[ { "from": "system", "value": "Remove useless import of OpenCV\n" }, { "from": "human", "value": "from SUASImageParser import ImageParser\nfrom SUASImageParser.utils.color import bcolors\n\nfrom options import parseOptions\nfrom options import getOption\n\nimport cv2\n\n\n# ----------------------...
python
chosen
[ { "from": "system", "value": "Test for creating a new node\n" }, { "from": "human", "value": "\"\"\"Testing dll.py.\"\"\"\nimport pytest\n\n\n@pytest.fixture\ndef new_dll():\n \"\"\"Return empty dll.\"\"\"\n from dll import DoublyLinkedList\n return DoublyLinkedList()\n\n\ndef test_init...
python
chosen
[ { "from": "system", "value": "Make it easier to use corporate keys\n" }, { "from": "human", "value": "from django.db import models\nfrom django.contrib.auth.models import AbstractUser\nfrom django_pgjson.fields import JsonField\n\nclass Capsuler(AbstractUser):\n settings = JsonField(blank=Tru...
python
chosen
[ { "from": "system", "value": "Fix for django trying to rollback connections on request exceptions.\n\n\n\ngit-svn-id: 98eea730e22c7fb5f8b38c49248ce5c7e9bb5936@525 be7adf91-e322-0410-8f47-e6edb61c52aa\n" }, { "from": "human", "value": "\"\"\"Contains code needed to initialize channelguide. This ...
python
chosen
[ { "from": "system", "value": "Update script to build rust code via cargo\n\nSigned-off-by: Luca Bruno <d11e81b0438fe9a6fbb85b72e5bb4c36a65f49c7@debian.org>\n" }, { "from": "human", "value": "import os\nimport os.path\nimport inspect\n\nbase_path = os.path.dirname(inspect.getframeinfo(inspect.cur...
python
chosen
[ { "from": "system", "value": "Add route waypoints to list display in Admin interface\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom planner.models import Route, Waypoint, RoadTrip, TripDetail\n\n\nclass WaypointInline(admin.StackedInline):\n model = Waypoint\n ...
python
chosen
[ { "from": "system", "value": "Add name to User model.\n" }, { "from": "human", "value": "from django.db import models\nfrom django.contrib.auth.models import AbstractUser\nfrom django.utils.translation import ugettext_lazy as _\n\nclass Organization(models.Model):\n name = models.CharField(_(...
python
chosen
[ { "from": "system", "value": "Set integrations for the index page now\n" }, { "from": "human", "value": "from werkzeug import redirect\nfrom werkzeug.exceptions import NotFound\n\nfrom websod.utils import session, expose, url_for, serve_template\nfrom websod.models import Integration\n\nfrom dat...
python
chosen
[ { "from": "system", "value": "Add Wikivoyage Bengali to pywikibot\n\nBug: T196363\nChange-Id: Ifc49b3b3734eaac20ef4f909c83d68b11bc8d91d\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"Family module for Wikivoyage.\"\"\"\n#\n# (C) Pywikibot team, 2012-2018\n#\n# Distributed unde...
python
chosen
[ { "from": "system", "value": "Add MockHandler for future testing of logging\n" }, { "from": "human", "value": "from django.db import models\n\nclass Office(models.Model):\n location = models.CharField(max_length=50)\n\n\nclass Title(models.Model):\n name = models.CharField(max_length=50)\n...
python
chosen
[ { "from": "system", "value": "Fix query to exclude objects without relevant pages\n" }, { "from": "human", "value": "from sopn_parsing.helpers.command_helpers import BaseSOPNParsingCommand\nfrom sopn_parsing.helpers.extract_tables import extract_ballot_table\nfrom sopn_parsing.helpers.text_helpe...
python
chosen
[ { "from": "system", "value": "Fix image model in migration\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2016-10-24 09:25\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclas...
python
chosen
[ { "from": "system", "value": "Use the stored broker_config instead of working it out ourselves\n\nFixes SSL\nMeans we're verifying the config is written properly too\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom os.path import join, dirname\n\nfrom cloudify import ctx\n\nctx.d...
python
chosen
[ { "from": "system", "value": "Disable append_slash in test config\n\nThis interferes with the ability to test proxying downstream redirects\n" }, { "from": "human", "value": "DEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nSECRET_KEY = 'fake_secret'\n\nROOT_URLCONF = 'tests.test_urls'\n\nDATABASES = {\n...
python
chosen
[ { "from": "system", "value": "Add module imports to noweats init.\n" }, { "from": "human", "value": "\"\"\"\nThe NowEats application scrapes Twitter for what people are eating now.\n\"\"\"\n" }, { "from": "gpt", "value": "\"\"\"\nThe NowEats application scrapes Twitter for what peopl...
python
chosen
[ { "from": "system", "value": "Add a new exception to handle a non-callable handler.\n" }, { "from": "human", "value": "\n\nclass ConeyException(Exception):\n def __repr__(self):\n return 'An unspecified error has occurred'\n\n\nclass CallTimeoutException(ConeyException):\n def __rep...
python
chosen
[ { "from": "system", "value": "Fix for Python 2.6 that lacks timedelta.total_seconds()\n" }, { "from": "human", "value": "'''Functions that perform the different reduction strategies.'''\nimport numpy as np\n\n\ndef closest(times, values, center_time):\n abs_delta = np.abs(np.array([(t - cente...
python
chosen
[ { "from": "system", "value": "Prepare development of new version." }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# Copyright © 2009 Ben Finney <ben+python@benfinney.id.au>\n# Copyright © 2006 Robert Niederreiter\n#\n# This is free software: you may copy, modify, and/or distribute th...
python
chosen
[ { "from": "system", "value": "Add method __call__ to _weaksetref.WeakSet\n" }, { "from": "human", "value": "class ProxyType:\n\n def __init__(self,obj):\n self.obj = obj\n\nCallableProxyType = ProxyType\nProxyTypes = [ProxyType,CallableProxyType]\n\nclass ReferenceType:\n\n def __in...
python
chosen
[ { "from": "system", "value": "Change dirty little helper script\n\n" }, { "from": "human", "value": "import csv\n\nstart = 900\n\nnewcsv = []\n\nwith open('50_percent_cheaters.csv', 'rb') as csvfile:\n experiment50 = csv.DictReader(csvfile)\n for row in experiment50:\n row['Run'] =...
python
chosen
[ { "from": "system", "value": "Remove connection from pycassa package import\n" }, { "from": "human", "value": "from pycassa.columnfamily import *\nfrom pycassa.columnfamilymap import *\nfrom pycassa.types import *\nfrom pycassa.index import *\nfrom pycassa.pool import *\nfrom pycassa.connection ...
python
chosen
[ { "from": "system", "value": "Add dev token for licensing_journey bucket\n" }, { "from": "human", "value": "TOKENS = {\n '_foo_bucket': '_foo_bucket-bearer-token',\n 'bucket': 'bucket-bearer-token',\n 'foo': 'foo-bearer-token',\n 'foo_bucket': 'foo_bucket-bearer-token',\n 'licensi...
python
chosen
[ { "from": "system", "value": "Add push task (but not use it yet)\n" }, { "from": "human", "value": "from fabric.api import cd, env, local, lcd, run\n\n\nPUPPET_MASTER_IP = '192.168.33.10'\n\n\ndef puppet():\n env.hosts = [\n 'vagrant@' + PUPPET_MASTER_IP + ':22',\n ]\n env.passwo...
python
chosen
[ { "from": "system", "value": "Add new fixture to fabric script\n" }, { "from": "human", "value": "# -*- coding: UTF-8 -*-\nfrom fabric.api import *\n\ndef move_sampledocs_to_fixture():\n local(\"cp fs_doc/fixtures/foreskrift/*.pdf uploads/foreskrift/\")\n local(\"cp fs_doc/fixtures/bilaga/...
python
chosen
[ { "from": "system", "value": "Fix website URL in kpi_dashboard module\n" }, { "from": "human", "value": "# Copyright 2020 Creu Blanca\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\n{\n \"name\": \"Kpi Dashboard\",\n \"summary\": \"\"\"\n Create Dashboards using ...
python
chosen
[ { "from": "system", "value": "Add reference to csrf tests in tests loader list\n\n" }, { "from": "human", "value": "\"\"\"\nPackage with all tests for dashboard_app\n\"\"\"\n\nimport unittest\n\nfrom testscenarios.scenarios import generate_scenarios\n\nTEST_MODULES = [\n 'models.attachment',\...
python
chosen
[ { "from": "system", "value": "[IMP] Add debug assets to HTTP cases\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright <YEAR(S)> <AUTHOR(S)>\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\nfrom openerp.tests.common import HttpCase, TransactionCase\n\n\ncla...
python
chosen
[ { "from": "system", "value": "Add util function to score sentences with kendall's tau\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n'''\nPreprocessing utilities\n'''\nfrom nltk import sent_tokenize\nfrom random import shuffle, sample\n\n\ndef shuffle_sents(text, times):\n sents ...
python
chosen
[ { "from": "system", "value": "Mark dojango as 0.5.6 alpha\n" }, { "from": "human", "value": "VERSION = (0, 5, 5, 'final', 0)\n\ndef get_version():\n version = '%s.%s' % (VERSION[0], VERSION[1])\n if VERSION[2]:\n version = '%s.%s' % (version, VERSION[2])\n if VERSION[3:] == ('alp...
python
chosen
[ { "from": "system", "value": "Add a CLI command for Postgres backend\n" }, { "from": "human", "value": "import click\n\nfrom .loader import load_yaml\nfrom .blueprint import Blueprint\nfrom .exceptions import ValidationError, YAMLError\n\n\ndef get_blueprint(*files):\n try:\n return Bl...
python
chosen
[ { "from": "system", "value": "Put numpy namespace in scipy for backward compatibility...\n" }, { "from": "human", "value": "\"\"\"\\\nSciPy --- A scientific computing package for Python\n===================================================\n\nYou can support the development of SciPy by purchasing...
python
chosen
[ { "from": "system", "value": "FIX deprecation warning for using assertEquals\n" }, { "from": "human", "value": "\"\"\"\nTest utilities.\n\"\"\"\nfrom __future__ import (absolute_import, division,\n print_function, unicode_literals)\nfrom builtins import *\n\nimport json\nf...
python
chosen
[ { "from": "system", "value": "Make the exception message check for malformed UTF-8 source looser so that SyntaxError triggered from UnicodeDecodeError is also acceptable.\n" }, { "from": "human", "value": "# This file is marked as binary in the CVS, to prevent MacCVS from recoding it.\n\nimport ...
python
chosen
[ { "from": "system", "value": "Change function name to Camel\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\ndef parser(roman):\n '''\n This function receives a Roman Numeral String and convert it to an\n Arabic Number.\n\n parameters:\n ------------------------------...
python
chosen
[ { "from": "system", "value": "Test step change in pitch in aeroelastic simulation\n" }, { "from": "human", "value": "\"\"\"\nRotor model using mbwind\n\"\"\"\n\nfrom numpy import pi, dot\nfrom mbwind import rotations, RigidConnection, RigidBody\nfrom mbwind.elements.modal import ModalElementFrom...
python
chosen
[ { "from": "system", "value": "Use official URL for sample client.\n" }, { "from": "human", "value": "import zlib\nimport zmq\nimport simplejson\nimport sys\n\ndef main():\n context = zmq.Context()\n subscriber = context.socket(zmq.SUB)\n\n subscriber.connect('tcp://localhost:9500')\n ...
python
chosen
[ { "from": "system", "value": "Set default logging level to ERROR, to avoid excessive \"No handlers could be found\" messages.\n" }, { "from": "human", "value": "# urllib3/__init__.py\n# Copyright 2008-2011 Andrey Petrov and contributors (see CONTRIBUTORS.txt)\n#\n# This module is part of urllib3...
python
chosen
[ { "from": "system", "value": "Return namespace class after decorating.\n" }, { "from": "human", "value": "import logging\n\nfrom socketio import socketio_manage\nfrom django.conf.urls import patterns, url, include\nfrom django.http import HttpResponse\nfrom django.views.decorators.csrf import cs...
python
chosen
[ { "from": "system", "value": "Include the python module in the package\n\nThe top level files, parse_this and parse_this_test, were not included.\nBy using the 'py_modules' option these files are now actually included in the\nparse_this pacakge.\n" }, { "from": "human", "value": "#!/usr/bin/env ...
python
chosen
[ { "from": "system", "value": "Add simplejson as test requirements for python 2.5\n" }, { "from": "human", "value": "\"\"\"\nFlask-Testing\n--------------\n\nFlask unittest integration.\n\nLinks\n`````\n\n* `documentation <http://packages.python.org/Flask-Testing>`_\n* `development version\n <ht...
python
chosen
[ { "from": "system", "value": "Add python-keystoneclient to dependencies\nThis is needed for keystone authentication\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()\n\n# allow setup.py to be r...
python
chosen
[ { "from": "system", "value": "Change Tweet upper length limit\n" }, { "from": "human", "value": "from datetime import date\r\nimport calendar\r\n\r\n\r\ndef get_time_index(update):\r\n if \"warning\" in update:\r\n return 7\r\n if \"pollution\" in update:\r\n return 8\r\n ...
python
chosen
[ { "from": "system", "value": "Make it compile on windows" }, { "from": "human", "value": "from distutils.core import setup\nfrom Cython.Build import cythonize\nfrom distutils.extension import Extension\nimport numpy as np\n\n# To compile and install locally run \"python setup.py build_ext --inpl...
python
chosen
[ { "from": "system", "value": "Bump the version to 0.2\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"selectivesearch\",\n version=\"0.1\",\n url=\"https://github.com/AlpacaDB/selectivesearch\",\n description=\"Selective Search implem...
python
chosen
[ { "from": "system", "value": "Add PySerial to the test requirements\n\nIt is needed for the doctests.\n" }, { "from": "human", "value": "import sys\nfrom setuptools import setup\nfrom setuptools.command.test import test as TestCommand\nimport schunk\n\nclass PyTest(TestCommand):\n def finaliz...
python
chosen
[ { "from": "system", "value": "Change the command: wonderful_bing -> bing.\n\nClose #15\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup\n\nfrom wonderful_bing import wonderful_bing\n\ntry:\n import pypandoc\n long_description...
python
chosen