conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix HardwareDevice constructor to provide 'description' argument\n\n" }, { "from": "human", "value": "\"\"\"\nModule with the HardwareDevice model.\n\"\"\"\n\nfrom launch_control.utils.json import PlainOldData\n\n\nclass HardwareDevice(PlainOldData):\n \"\"\"\n ...
python
chosen
[ { "from": "system", "value": "Add encryption properties to Workspace\n" }, { "from": "human", "value": "# Copyright (c) 2015, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject\n\n\nclass Workspace(AWSObject):\n resource_type ...
python
chosen
[ { "from": "system", "value": "Add agency chain to Booking\n" }, { "from": "human", "value": "# Python 2 and 3\nfrom __future__ import unicode_literals\n\nfrom gapipy.resources.checkin import Checkin\n\nfrom ..base import Resource\nfrom .transaction import Payment, Refund\nfrom .document import I...
python
chosen
[ { "from": "system", "value": "Rename internal variables to start with a _\n" }, { "from": "human", "value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nimport urllib.parse\n\n\nclass BaseTransport(object):\n\n @property\...
python
chosen
[ { "from": "system", "value": "Increase case search limit to 100 results\n" }, { "from": "human", "value": "from corehq.pillows.mappings.case_mapping import CASE_ES_TYPE\nfrom corehq.pillows.mappings.utils import mapping_from_json\nfrom corehq.util.elastic import es_index\nfrom pillowtop.es_utils...
python
chosen
[ { "from": "system", "value": "Remove all scores before populating the sorted set.\n" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\nfrom django.conf import settings\nfrom ...models import OverallDriverPrediction, OverallConstructorPrediction\n\n\nclass Comma...
python
chosen
[ { "from": "system", "value": "Change of the module version\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2017 Eficent Business and IT Consulting Services S.L.\n# (http://www.eficent.com)\n# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).\n\n{\n ...
python
chosen
[ { "from": "system", "value": "Revise docstring and add space line\n" }, { "from": "human", "value": "\"\"\"Leetcode 461. Hamming Distance\nMedium\n\nURL: https://leetcode.com/problems/hamming-distance/description/\n\nThe Hamming distance between two integers is the number of positions at which \...
python
chosen
[ { "from": "system", "value": "Fix ohe type in ce\n" }, { "from": "human", "value": "\"\"\" Contains base tf losses \"\"\"\nimport tensorflow as tf\n\n\ndef softmax_cross_entropy(labels, logits, *args, **kwargs):\n \"\"\" Multi-class CE which takes plain or one-hot labels\n\n Parameters\n ...
python
chosen
[ { "from": "system", "value": "Make fix_updated migration (sort of) reversible\n" }, { "from": "human", "value": "import django.contrib.gis.db.models.fields\nfrom django.db import migrations\nfrom django.contrib.gis.db.models import Max\n\n\ndef fix_updated(apps, _):\n Proposal = apps.get_mode...
python
chosen
[ { "from": "system", "value": "Add the missing category-detail urlconf to not to break bookmarked users\n" }, { "from": "human", "value": "from django.conf.urls import patterns, url\n\nfrom .views import CategoriesList, GalleryDetail, StoryDetail\n\nurlpatterns = patterns('category.views',\n u...
python
chosen
[ { "from": "system", "value": "Use reverse function for urls in carusele app\n" }, { "from": "human", "value": "from django.db import models\n\n\nclass News (models.Model):\n \"\"\"\n News model represent detail description and\n content of each carusele element.\n \"\"\"\n title =...
python
chosen
[ { "from": "system", "value": "Make compatible with python 3.4\n" }, { "from": "human", "value": "from django_filters.widgets import RangeWidget\n\n\nclass CustomRangeWidget(RangeWidget):\n def __init__(self, widget, attrs=None):\n attrs_start = {'placeholder': 'От', **(attrs or {})}\n ...
python
chosen
[ { "from": "system", "value": "Add constant for settings schema file path\n" }, { "from": "human", "value": "\"\"\"This module provides functions for saving to and loading data from\nthe settings XML file.\n\nAttributes:\n SETTINGS_PATH Filepath for the settings file.\n\"\"\"\n\nSETT...
python
chosen
[ { "from": "system", "value": "Add utility function to dump flask env\n" }, { "from": "human", "value": "from flask.ext.script import Manager\n\nfrom app import get_app\n\nfrom create_db import drop_all_tables, create_barebones_data, create_all_data, create_server\n\napp = get_app('config.DockerC...
python
chosen
[ { "from": "system", "value": "Add custom debug toolbar URL mount point.\n" }, { "from": "human", "value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\nurlpatterns = patterns(\n '',\n url(r'^', includ...
python
chosen
[ { "from": "system", "value": "Use the package name when looking up version\n\nWe need to give PBR the full package name when it looks up the version\nfrom a pip installed package. keystoneclient_kerberos is the module\nname, not the package name.\n\nChange-Id: I638d0975d77db3767c3675dceb05466388abebc9\nClos...
python
chosen
[ { "from": "system", "value": "FIX a bug, you fuck'in forgot to rename the new function\n" }, { "from": "human", "value": "'''Copyright(C): Leaf Johnson 2011\n\n This file is part of makeclub.\n\n makeclub is free software: you can redistribute it and/or modify\n it under the terms of th...
python
chosen
[ { "from": "system", "value": "Update to the latest XSP.\n" }, { "from": "human", "value": "GitHubTarballPackage('mono', 'xsp', '2.11', 'd3e2f80ff59ddff68e757a520655555e2fbf2695', configure = './autogen.sh --prefix=\"%{prefix}\"') \n" }, { "from": "gpt", "value": "GitHubTarballPackag...
python
chosen
[ { "from": "system", "value": "Fix raw_input() error in python 3\n" }, { "from": "human", "value": "import json\nimport runpy\nimport sys\n\ndef run():\n args = sys.argv\n\n if len(args) < 3:\n raise Exception('Both module name and function name are required.')\n\n module, functio...
python
chosen
[ { "from": "system", "value": "Fix sorting dict items in python 3\n" }, { "from": "human", "value": "from ipywidgets import widgets\nfrom jinja2 import Template\nfrom traitlets import (\n observe,\n Unicode,\n)\n\nfrom dallinger.config import get_config\n\nheader_template = Template(u\"\"\"...
python
chosen
[ { "from": "system", "value": "Increase timeouts for the python test.\n" }, { "from": "human", "value": "# Copyright 2019 DeepMind Technologies Ltd. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with ...
python
chosen
[ { "from": "system", "value": "Change GPG password encryption to AES256\n" }, { "from": "human", "value": "from glob import glob\nimport os\nimport shutil\n\nfrom .credential import Credential\nfrom .crypt import create_gpg, load_gpg\n\n\nclass Database(object):\n\n def __init__(self, path, gp...
python
chosen
[ { "from": "system", "value": "Change the way semantic is called to allow for looping and handling [SS]\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom sys import *\nfrom myreglexer import *\nfrom getopt import *\nfrom myparser import *\nfrom tree import *\nfrom semantic import *\n...
python
chosen
[ { "from": "system", "value": "Enable default warnings while testing.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\nimport os\nimport subprocess\nimport sys\n\n\nargs = [\n sys.executable or 'python', # Python interpreter to call for testing.\n '-B', # Don't write .pyc files ...
python
chosen
[ { "from": "system", "value": "Fix style nit, line end for test file\n" }, { "from": "human", "value": "\"\"\"\n SoftLayer.tests.CLI.modules.subnet_tests\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :license: MIT, see LICENSE for more details.\n\"\"\"\nfrom SoftLayer import testing\n\n...
python
chosen
[ { "from": "system", "value": "Fix building migration SRID logic\n\nHardcoding the SRID in the migration could result in a mismatch\nbetween the model srid and the migration srid.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.1 on 2016-11-10 08:46\nfrom __...
python
chosen
[ { "from": "system", "value": "Fix to indexer integration tests\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom nose import tools as nose\nimport unittest\n\nfrom shiva.app import app\nfrom shiva.indexer import Indexer\n\n\nclass IndexerTestCase(unittest.TestCase):\n\n def tes...
python
chosen
[ { "from": "system", "value": "Rewrite the config to disable the response cache, too.\n\ngit-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@6929 e27351fd-9f3e-4f54-a53b-843176b1656c\n" }, { "from": "human", "value": "##\n# Copyright (c) 2010 Apple Inc. All rights reserved.\n#\n# Licensed under ...
python
chosen
[ { "from": "system", "value": "Fix legacy use of action result\n" }, { "from": "human", "value": "#!/usr/bin/env python\n#\n# Print the list of sysdig captures.\n#\n\nimport os\nimport sys\nsys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))\nfrom sdcclient impo...
python
chosen
[ { "from": "system", "value": "Write pi code to use button\n" }, { "from": "human", "value": "#!/home/pi/coffee/venv/bin/python\n\nimport os\nimport sys\nimport time\n\nfrom coffee.models import Status\n\nsys.path.append(os.path.dirname(os.path.dirname(__file__)))\n\n\nDEBUG = 1\nPIN = 14\n\n\nde...
python
chosen
[ { "from": "system", "value": "Write output to .sty file.\n" }, { "from": "human", "value": "import re\n\n# Input file created from http://astronautweb.co/snippet/font-awesome/\nINPUT_FILE = 'htmlfontawesome.txt'\n\nwith open(INPUT_FILE) as r:\n for line in r:\n # Expects to find 'fa-NAME' en...
python
chosen
[ { "from": "system", "value": "Add test for opal test py -t\n" }, { "from": "human", "value": "\"\"\"\nUnittests fror opal.core.test_runner\n\"\"\"\nimport ffs\nfrom mock import MagicMock, patch\n\nfrom opal.core.test import OpalTestCase\n\nfrom opal.core import test_runner\n\nclass RunPyTestsTes...
python
chosen
[ { "from": "system", "value": "Fix form field custom kwarg\n" }, { "from": "human", "value": "# coding=utf-8\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.db import models\nfrom django.utils.itercompat import is_iterable\nfrom six import string_types\n\nfrom . import setti...
python
chosen
[ { "from": "system", "value": "Add lenient to abstract BaseSource signature\n" }, { "from": "human", "value": "#\n#\n#\n\nfrom __future__ import absolute_import, division, print_function, \\\n unicode_literals\n\n\nclass BaseSource(object):\n\n def __init__(self, id):\n self.id = id\...
python
chosen
[ { "from": "system", "value": "Add missing tests for frontend views\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.test import TestCase, Client\nfrom django.core.urlresolvers import reverse\n\n\nclass TestViews(TestCase):\n def setUp(self):\n self.client = Clien...
python
chosen
[ { "from": "system", "value": "Append slash to urls in example project\n" }, { "from": "human", "value": "# Django settings for example_project project.\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': 'ex...
python
chosen
[ { "from": "system", "value": "Handle temp directory with absolute path\n" }, { "from": "human", "value": "_VERSION = 'CVS'\n_TEMP_DIR = '.SloppyCell'\n\nimport logging\nlogging.basicConfig()\nlogger = logging.getLogger('__init__')\n\n# Check for debugging option. I tried using optparse for this,...
python
chosen
[ { "from": "system", "value": "Remove spark settings from default config file\n" }, { "from": "human", "value": "import logging\nimport datetime\n\nDEBUG = True\n\n# Override this key with a secret one\nSECRET_KEY = 'default_secret_key'\nHASHIDS_SALT = 'default_secret_salt'\n\n## Authentication\n...
python
chosen
[ { "from": "system", "value": "Store password in session after successful login.\n" }, { "from": "human", "value": "#! coding: utf-8\nfrom django.shortcuts import render_to_response, render\nfrom django.http import HttpResponseRedirect\nfrom django.contrib.auth import login\n\nfrom forms import L...
python
chosen
[ { "from": "system", "value": "Add unique id for each wav file\n" }, { "from": "human", "value": "import os\nimport logging\nimport gevent\nfrom flask import Flask, render_template, url_for, redirect\nfrom flask_sockets import Sockets\nimport io\n\napp = Flask(__name__)\npath = os.getcwd()\napp.c...
python
chosen
[ { "from": "system", "value": "Add an empty line for style\n" }, { "from": "human", "value": "import functools, threading\n\n\ndef compose_events(events, condition=all):\n \"\"\"Compose a sequence of events into one event.\n Arguments:\n events: a sequence of objects looking like ...
python
chosen
[ { "from": "system", "value": "Use MonetDB friendly median query syntax in unit test.\n" }, { "from": "human", "value": "import unittest\nfrom tkp.db import execute, rollback\n\n\nclass testMedian(unittest.TestCase):\n def setUp(self):\n try:\n execute('drop table median_test...
python
chosen
[ { "from": "system", "value": "Change function content and pep257\n" }, { "from": "human", "value": "from __future__ import division\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef deconv(x, y, fs):\n X = np.fft.fft(x)\n Y = np.fft.fft(y)\n H = Y / X\n h = np.fft.ifft(H)...
python
chosen
[ { "from": "system", "value": "Change KAFKA_BROKER parameter, added a send producer\n" }, { "from": "human", "value": "import json\n\nfrom get_tmdb import GetTMDB\nfrom kafka import KafkaConsumer\n\ntry:\n from GLOBALS import KAFKA_BROKER, TMDB_API\nexcept ImportError:\n print('Get it somew...
python
chosen
[ { "from": "system", "value": "Handle null image attribute on publisher\n" }, { "from": "human", "value": "# Copyright 2013 Russell Heilling\n\nfrom google.appengine.ext import ndb\n\nclass Publisher(ndb.Model):\n '''Publisher object in datastore.\n\n Holds publisher data.\n '''\n identifier ...
python
chosen
[ { "from": "system", "value": "Test export email return an HttpResponse\n" }, { "from": "human", "value": "from django.test import TestCase\nfrom django.contrib.admin.sites import AdminSite\nfrom billjobs.admin import UserAdmin\n\nclass EmailExportTestCase(TestCase):\n \"\"\" Tests for email a...
python
chosen
[ { "from": "system", "value": "Implement demo 'exercises' api method.\n" }, { "from": "human", "value": "# Copyright 2016 Mirantis, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obt...
python
chosen
[ { "from": "system", "value": "Add delete action to PillowRetry\n" }, { "from": "human", "value": "from django.contrib import admin\nfrom .models import PillowError\n\n\nclass PillowErrorAdmin(admin.ModelAdmin):\n\n model = PillowError\n list_display = [\n 'pillow',\n 'doc_id'...
python
chosen
[ { "from": "system", "value": "Fix unit test after worker-uptime changed to worker_uptime\n" }, { "from": "human", "value": "from __future__ import absolute_import, unicode_literals\n\nimport argparse\nimport unittest\n\nfrom streamparse.cli.worker_uptime import subparser_hook\n\nfrom nose.tools ...
python
chosen
[ { "from": "system", "value": "Use dark theme if possible.\n" }, { "from": "human", "value": "import os\nimport signal\nimport sys\nfrom argparse import ArgumentParser\n\nimport gi\ngi.require_version('Gtk', '3.0')\ngi.require_version('GtkSource', '3.0')\n\nfrom gi.repository import Gio, GLib\n\n...
python
chosen
[ { "from": "system", "value": "Make the lib pretty complete\n\nShould be able to replicate set up and tear down now\n" }, { "from": "human", "value": "from os.path import abspath, dirname, join\n\nimport sh\nimport psycopg2\nimport requests\n\nPROJECT_FOLDER=dirname(dirname(abspath(__file__)))\nD...
python
chosen
[ { "from": "system", "value": "TST: Clean up parent temporary directory\n" }, { "from": "human", "value": "# coding: utf-8\n\nimport logging\nimport os\nimport shutil\nimport sys\nimport tempfile\nimport unittest\n\nimport six\n\nimport fiona\n\nlogging.basicConfig(stream=sys.stderr, level=loggin...
python
chosen
[ { "from": "system", "value": "Save the results of ras network\n" }, { "from": "human", "value": "from indra.tools.gene_network import GeneNetwork, grounding_filter\nimport csv\n\n# STEP 0: Get gene list\ngene_list = []\n# Get gene list from ras_pathway_proteins.csv\nwith open('../../data/ras_pat...
python
chosen
[ { "from": "system", "value": "Change dataSample to generate indices of random pair using list of values\n" }, { "from": "human", "value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nConvenience functions for in memory deduplication\n\"\"\"\n\nimport collections\nimport dedupe.core\n\n...
python
chosen
[ { "from": "system", "value": "Update to line by line dataset JSON file parsing\n\nNew format under Feed Exports\n" }, { "from": "human", "value": "import json\n\nwith open('dataset_item.json') as dataset_file:\n dataset = json.load(dataset_file)\n\nfor i in range(len(dataset)):\n if 'Conti...
python
chosen
[ { "from": "system", "value": "Fix typo, correcting failures on late Pythons when mock is not already installed.\n" }, { "from": "human", "value": "try:\n import unitest.mock as mock\nexcept ImportError:\n import mock\n\nfrom pkg_resources import evaluate_marker\n\n@mock.patch('platform.pyt...
python
chosen
[ { "from": "system", "value": "Change version of API client\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# Copyright 2017 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with th...
python
chosen
[ { "from": "system", "value": "Remove use of deprecated patterns function\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\n\nfrom testproject impo...
python
chosen
[ { "from": "system", "value": "Use itertools for better readability.\n" }, { "from": "human", "value": "from __future__ import print_function\nimport fileinput\nfrom operator import mul\nfrom functools import reduce\n\ntotalArea = 0\ntotalRibbon = 0\nfor line in fileinput.input():\n parts = [i...
python
chosen
[ { "from": "system", "value": "Fix package name to match PyPI\n" }, { "from": "human", "value": "from setuptools import setup\nimport os\nfrom appkit import __version__\n\n\ndata = list()\nfor d in os.walk('appkit/'):\n if len(d[2]) > 0:\n path_list = [str.join('/', os.path.join(d[0], x...
python
chosen
[ { "from": "system", "value": "Add classifiers to zencoder-py package\n" }, { "from": "human", "value": "\nfrom distutils.core import setup\n\nsetup(name='zencoder',\n version='0.5.2',\n description='Integration library for Zencoder',\n author='Alex Schworer',\n author_email='...
python
chosen
[ { "from": "system", "value": "Fix Python version detection for Python 2.6" }, { "from": "human", "value": "import sys\nfrom setuptools import setup, find_packages\n\n\npy26_dependency = []\nif sys.version_info.major == 2 and sys.version_info.minor < 7:\n py26_dependency = [\"argparse >= 1.2.1...
python
chosen
[ { "from": "system", "value": "Fix bug where page stops updating by forcing it to reload after a minute\nof no activity\n" }, { "from": "human", "value": "#!/bin/env python\nfrom selenium import webdriver\nfrom selenium.common.exceptions import StaleElementReferenceException\nfrom time import sle...
python
chosen
[ { "from": "system", "value": "Add missing package data for flickering\n" }, { "from": "human", "value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom chandra_aca import __version__\n\nfrom setuptools import setup\n\ntry:\n from testr.setup_helper import cmdclass\nexce...
python
chosen
[ { "from": "system", "value": "Change release tagging convention to vX.Y.Z\n" }, { "from": "human", "value": "from distutils.core import setup\n\nwith open('README.md') as f:\n long_description = f.read()\n\nsetup(\n name = 'dont_argue',\n packages = ['dont_argue'],\n version = '0.1.1...
python
chosen
[ { "from": "system", "value": "Make the package installable with python3\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport sys\nif sys.version_info[0] != 2:\n sys.exit(\"Sorry, Python 3 is not supported yet\")\n\nfrom setuptools import setup, find_packages\n\n\ninstall_requi...
python
chosen
[ { "from": "system", "value": "Add missing docs tring to QueryList._convert_iterable()\n" }, { "from": "human", "value": "from betterdict import BetterDict\n\n\nclass QueryList(list):\n def __init__(self, data=None, wrapper=BetterDict):\n \"\"\"Create a QueryList from an iterable and a ...
python
chosen
[ { "from": "system", "value": "Fix not imported os and format code\n" }, { "from": "human", "value": "from flask import Flask, send_file\napp = Flask(__name__)\n\n@app.route(\"/hello\")\ndef hello():\n return \"Hello World from Flask in a uWSGI Nginx Docker container with \\\n Python 3.6 (...
python
chosen
[ { "from": "system", "value": "Fix mock in unit test. Not sure why it passed locally with previous mock.\n" }, { "from": "human", "value": "from flask import Blueprint\n\nfrom app.errors import register_errors\n\nemail_branding_blueprint = Blueprint('letter_branding', __name__, url_prefix='letter...
python
chosen
[ { "from": "system", "value": "Add the missing `MGlobal` module to the `__all__` attribute.\n" }, { "from": "human", "value": "\"\"\"\n banana.maya.extensions.OpenMaya\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \n OpenMaya extensions.\n \n :copyright: Copyright 2014 by Christopher Crou...
python
chosen
[ { "from": "system", "value": "Remove is_upcoming field from Event response and Add explicit fields to EventActivity serializer\n" }, { "from": "human", "value": "from .models import Event, EventActivity\nfrom employees.serializers import LocationSerializer\nfrom rest_framework import serializers...
python
chosen
[ { "from": "system", "value": "Use send_mail in signup helper function\n" }, { "from": "human", "value": "from .models import School, User\nimport re\nimport string\nimport random\n\n\ndef get_school_list():\n schools = School.objects.all()\n school_list = []\n for s in schools:\n ...
python
chosen
[ { "from": "system", "value": "Refactor functions & add params\n" }, { "from": "human", "value": "import os\n\n# Splits a file using the dsplit mechanism\ndef dsplit(fromfile, todir, chunksize = 1024):\n if not os.path.exists(todir): # caller handles errors\n os.mkdir(t...
python
chosen
[ { "from": "system", "value": "atests: Fix getting Windows system encoding on non-ASCII envs\n" }, { "from": "human", "value": "from os.path import abspath, dirname, join, normpath\nimport locale\nimport os\nimport subprocess\n\nimport robot\n\n\n__all__ = ['ROBOTPATH', 'ROBOT_VERSION', 'DATADIR'...
python
chosen
[ { "from": "system", "value": "Fix universal extraction in non-universal wheel\n\nThe pypi-extract-universal.py would raise ConfigParser.NoOptionError\nwhen inspecting a setup.cfg with a wheel section but no universal\noption. Guard against this by actually testing whether the option is\nthere rather than me...
python
chosen
[ { "from": "system", "value": "Disable ProviderAllocation admin page, still accessible from Provider Inlines\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom core.admin.modeladmin import OneToOneUserAdmin\n\nfrom ..models import Provider, ProviderAllocation, Staff, OutO...
python
chosen
[ { "from": "system", "value": "Fix issue with multiple lines\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# © 2004-2009 Tiny SPRL (<http://tiny.be>).\n# © 2015 Pedro M. Baeza\n# © 2016 ACSONE SA/NV (<http://acsone.eu>)\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)...
python
chosen
[ { "from": "system", "value": "Delete escped variable, replaced with single quotes\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\n# Set arguments values\nif len(sys.argv) == 1:\n print \"Usage: clone-vm.py [new-vm-name]\"\n exit(1)\nelse:\n new_vm_name ...
python
chosen
[ { "from": "system", "value": "Add some basic tests for assignment. Note that slicing is not supported\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nlinear_math_tests.test_alignedobjectarray\n\"\"\"\nfrom __future__ import unicode_literals, print_funct...
python
chosen
[ { "from": "system", "value": "Add some logging to the EVE API task\n" }, { "from": "human", "value": "from celery.decorators import task\nfrom eve_api.api_puller.accounts import import_eve_account\nfrom eve_api.app_defines import *\nfrom sso.tasks import update_user_access\n\n@task()\ndef import...
python
chosen
[ { "from": "system", "value": "Add a wrapper for from_file/from_features methods\n" }, { "from": "human", "value": "from geopandas import GeoDataFrame\n\nfrom ..utils.geom_utils import generate_index, generate_geometry\n\n\nclass CartoDataFrame(GeoDataFrame):\n\n def __init__(self, *args, **kw...
python
chosen
[ { "from": "system", "value": "Improve logging of build failure\n" }, { "from": "human", "value": "import http.server\nimport os\n\nimport oldfart.make\n\n\n__all__ = ['make_http_request_handler_class']\n\n\n# The idea here is to modify the request handling by intercepting the\n# `send_head` call...
python
chosen
[ { "from": "system", "value": "Allow 'scenario-name' to be null if it does not exist\n" }, { "from": "human", "value": "from flask_restplus import Namespace, Resource, fields, abort\n\nimport cea.config\nimport cea.plots.cache\n\napi = Namespace('Dashboard', description='Dashboard plots')\n\n\nLA...
python
chosen
[ { "from": "system", "value": "Disable django debug toolbar until wagtail 1.12 is released\n\nsee https://github.com/jazzband/django-debug-toolbar/issues/950 for\nreference\n" }, { "from": "human", "value": "from .base import *\n\n# SECURITY WARNING: don't run with debug turned on in production!\...
python
chosen
[ { "from": "system", "value": "Remove error message when using MAQ module\n" }, { "from": "human", "value": "from impacket.ldap import ldapasn1 as ldapasn1_impacket\n\n\nclass CMEModule:\n '''\n Module by Shutdown and Podalirius\n\n Initial module:\n https://github.com/Shutdow...
python
chosen
[ { "from": "system", "value": "Handle if org.config is None\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport json\n\nfrom django.conf import settings\nfrom django.db import models, migrations\n\n\ndef add_available_languages(apps, schem...
python
chosen
[ { "from": "system", "value": "Add State to Address model definition.\n" }, { "from": "human", "value": "from .base import BaseModel\n\n\nclass Address(BaseModel):\n _as_is_fields = ['city', 'latitude', 'longitude', 'postal_zip', 'street']\n _resource_fields = [('country', 'Country')]\n\n ...
python
chosen
[ { "from": "system", "value": "Allow for static contents served over CDN\n" }, { "from": "human", "value": "import json\nimport stripe\n\nimport flask\nfrom flask import g\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask.ext.login import LoginManager, current_user\nfrom flask_redis import...
python
chosen
[ { "from": "system", "value": "Include start date, end date, and active flag in comics list\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom comics.core import models\n\n\nclass ComicAdmin(admin.ModelAdmin):\n list_display = ('slug', 'name', 'language', 'url', 'right...
python
chosen
[ { "from": "system", "value": "Fix workspace publish on the local catalogue\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# Copyright 2012 Universidad Politécnica de Madrid\n\n# This file is part of Wirecloud.\n\n# Wirecloud is free software: you can redistribute it and/or modify\...
python
chosen
[ { "from": "system", "value": "Revert to port 8889, as it appears that unicorn sets port 81.\n" }, { "from": "human", "value": "# Basic config for stuff that can be easily changed, but which is git-managed.\n# See also apikeys_sample.py for the configs which are _not_ git-managed.\n#server_domain...
python
chosen
[ { "from": "system", "value": "Use username as password default\n\nFor compatibility with TracProTest.login()\n" }, { "from": "human", "value": "import factory\nimport factory.django\nimport factory.fuzzy\n\nfrom tracpro.test.factory_utils import FuzzyEmail\n\n\n__all__ = ['User']\n\n\nclass User...
python
chosen
[ { "from": "system", "value": "Read in Flux Simulator expression profile with pandas.\n" }, { "from": "human", "value": "#!/usr/bin/python\n\n\"\"\"Usage:\n set_isoform_frequencies [{help}] [{version}] {pro_file}\n\n{help_short} {help} Show this message.\n{version_short} {versi...
python
chosen
[ { "from": "system", "value": "Add create_app and export to API.\n" }, { "from": "human", "value": "\"\"\"\\\nGrip\n----\n\nRender local readme files before sending off to Github.\n\n:copyright: (c) 2012 by Joe Esposito.\n:license: MIT, see LICENSE for more details.\n\"\"\"\n\n__version__ = '1.2....
python
chosen
[ { "from": "system", "value": "Change modfied variable to true\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\nThis class represents an interface of an image processing algorithm.\nThe class abstracts algorithm interface from user so he can fully focus on his\nalgorithm implem...
python
chosen
[ { "from": "system", "value": "Add paid_date to invoice list.\n" }, { "from": "human", "value": "from django.contrib import admin\nfrom django.conf.urls.defaults import patterns\nfrom invoice.models import Invoice, InvoiceItem\nfrom invoice.views import pdf_view\nfrom invoice.forms import Invoice...
python
chosen
[ { "from": "system", "value": "Allow waiting for multiple files" }, { "from": "human", "value": "import os\nfrom tempfile import mkstemp\nimport time\n\n\nclass atomic_write(object):\n \"\"\"Perform an atomic write to a file.\n\n Use as::\n\n with atomic_write('/my_file') as f:\n ...
python
chosen
[ { "from": "system", "value": "Use contextlib.closing on tarfile compat shim\n" }, { "from": "human", "value": "import sys\nimport unittest\nimport tarfile\n\ntry:\n\t# provide skipIf for Python 2.4-2.6\n\tskipIf = unittest.skipIf\nexcept AttributeError:\n\tdef skipIf(condition, reason):\n\t\tdef...
python
chosen
[ { "from": "system", "value": "Revert \"Re-enable profiler with CUDA Python\"\n\nThis reverts commit 0a7a8d891b946ad7328ac83854b18935f3cf23d6.\n\nThe Conda packages for the NVIDIA bindings do not support this API -\nonly the Github source version supports it, the profiler tests must be\ndisabled.\n" }, {...
python
chosen