conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add reverse sorting of count_array" }, { "from": "human", "value": "'''\nCreated on May 3, 2016\n\n@author: Martin Koerner <info@mkoerner.de>\n'''\n\n\nclass CountGeneration(object):\n def generate_counts(self,collected_features_array,feature_name):\n feat...
python
chosen
[ { "from": "system", "value": "Fix the NDELAY test; avoid outputting binary garbage.\n" }, { "from": "human", "value": "#! /usr/bin/env python\n\"\"\"Test program for the fcntl C module.\n Roger E. Masse\n\"\"\"\nimport struct\nimport fcntl\nimport FCNTL\nimport os\nfrom test_support import ver...
python
chosen
[ { "from": "system", "value": "Add skos_registry to the request.\n\nAdd the skos_registry to the request through the add_request_method\ndirective.\n" }, { "from": "human", "value": "# -*- coding: utf8 -*-\n\nfrom zope.interface import Interface\n\nfrom skosprovider.registry import Registry\n\n\n...
python
chosen
[ { "from": "system", "value": "Use sendall instead of send for socket messages\n\nI kept getting Errno 111 connection refused errors; I hope this fixes\nit.\n" }, { "from": "human", "value": "\"\"\"Message broker that sends to Unix domain sockets.\"\"\"\n\nimport os\nimport socket\nimport time\n\...
python
chosen
[ { "from": "system", "value": "Set the start date for the new rate as July 1\n" }, { "from": "human", "value": "\"\"\"mmg rates now set to 1.65 pence per sms\n\nRevision ID: 0040_adjust_mmg_provider_rate\nRevises: 0039_fix_notifications\nCreate Date: 2016-07-06 15:19:23.124212\n\n\"\"\"\n\n# revi...
python
chosen
[ { "from": "system", "value": "Use `/` operator to assemble path\n" }, { "from": "human", "value": "\"\"\"\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nfrom pathlib import Path\n\nimport pytest\n\nfrom byceps.services.user_avatar i...
python
chosen
[ { "from": "system", "value": "Change help text wording to follow WorkflowStateMixin\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\...
python
chosen
[ { "from": "system", "value": "Fix regression on 6269f48ba356c4e7f in cygwin.\n\nsignal.SIGBREAK is not defined on cygwin, causing an exception.\n\nR=vadimsh@chromium.org\nBUG=\n\nReview URL: https://codereview.chromium.org/1349183005\n" }, { "from": "human", "value": "# Copyright 2015 The Swarmi...
python
chosen
[ { "from": "system", "value": "Fix typo breaking doc popups\n" }, { "from": "human", "value": "import re\nimport pydoc\nimport gtk\n\nfrom data_format import insert_with_tag, is_data_object\n\nBOLD_RE = re.compile(\"(?:(.)\\b(.))+\")\nSTRIP_BOLD_RE = re.compile(\"(.)\\b(.)\")\n\ndef insert_docs(b...
python
chosen
[ { "from": "system", "value": "Add some unit tests for install\n" }, { "from": "human", "value": "import os\n\nimport pytest\nimport salt.modules.win_servermanager as win_servermanager\nfrom tests.support.mock import MagicMock, patch\n\n\n@pytest.fixture\ndef configure_loader_modules():\n retu...
python
chosen
[ { "from": "system", "value": "Update delivery and billing status in SO\n" }, { "from": "human", "value": "# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors\n# License: GNU General Public License v3. See license.txt\n\nfrom __future__ import unicode_literals\nimport frappe\n...
python
chosen
[ { "from": "system", "value": "Throw exception if no login credentials are provided\n" }, { "from": "human", "value": "#\n# HamperAuthenticator is the class to handle the authentication part of the provisioning portal.\n# Instantiate with the email and password you want, it'll pass back the cooki...
python
chosen
[ { "from": "system", "value": "Use django TestCase in tutorial send email test\n\nIt was using regular Python unittest.TestCase for some\nreason, resulting in leaving old BulkEmail objects in\nthe database that other tests weren't expecting.\n" }, { "from": "human", "value": "\"\"\"Test for the t...
python
chosen
[ { "from": "system", "value": "Make 0006 migration of project more efficient.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\ndef update_total_milestones(apps, schema_editor):\n Project = apps.ge...
python
chosen
[ { "from": "system", "value": "Fix error if no data path\n" }, { "from": "human", "value": "# pylint: disable=missing-docstring\nimport os\nimport shutil\n\nfrom django.conf import settings\nfrom django.contrib.auth import get_user_model\nfrom django.test import TestCase\n\nfrom resolwe.flow.engi...
python
chosen
[ { "from": "system", "value": "Make a few fields editable from the changelist\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom newswall.models import Source, Story\n\n\nadmin.site.register(Source,\n list_display=('name', 'is_active', 'ordering'),\n list_filter=('i...
python
chosen
[ { "from": "system", "value": "Add wrapper functions to deal with EINTR and exceptions in dispatched-to-functions\n" }, { "from": "human", "value": "#!/usr/bin/python\n\nimport ctypes\nimport errno\nimport os\nimport select\nimport traceback\n\nimport cepoll\nimport ctimerfd\n\ndef on_timer ():\n...
python
chosen
[ { "from": "system", "value": "Change script to point to AWS\n" }, { "from": "human", "value": "from scapy.all import *\nimport unirest\nimport json\n\ndef callbackFunction(response):\n\tpass\n\t# \"http://54.68.246.202:3000/rssi\"\n\ndef main():\n print \"Reading pcap file %s\"%sys.argv[1]\n ...
python
chosen
[ { "from": "system", "value": "Convert direction to upper case\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nfrom nanagogo.api import NanagogoRequest, NanagogoError\n\n\ndef get(path, params={}):\n r = NanagogoRequest(path,\n method=\"GET\",\n ...
python
chosen
[ { "from": "system", "value": "Move AWS_ setting imports under the check for AmazonS3 so Norc doesn't break without them.\n" }, { "from": "human", "value": "\nimport os\n\nfrom norc.settings import (NORC_LOG_DIR, BACKUP_SYSTEM,\n AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET_NAME)\n\nif...
python
chosen
[ { "from": "system", "value": "_BaseEnumField: Make run_validators method a no-op\n\nSee the comment in this commit-- I can't see value in allowing custom\nvalidators on EnumFields and the implementation in the superclass causes\nwarnings in RichEnum.__eq__.\n\nArguably those warnings aren't useful (warning ...
python
chosen
[ { "from": "system", "value": "Clean up BQ test data properly\n\nIf you delete datasets while iterating over datasets, you eventually get\nerrors. This fixes that by building a list of all datasets before we\ndelete any.\n" }, { "from": "human", "value": "import os\nfrom django.core.management i...
python
chosen
[ { "from": "system", "value": "Allow some compatibility between python2 and updated python 3 files\n" }, { "from": "human", "value": "from robotsim import *\nimport atexit\natexit.register(destroy)\n\n__all__ = ['WorldModel','RobotModel','RobotModelLink','RigidObjectModel','TerrainModel','Mass','...
python
chosen
[ { "from": "system", "value": "Comment out failing test on Python3 env\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport yalix.utils as utils\n\nclass UtilsTest(unittest.TestCase):\n\n def test_log_progress_reports_FAILED(self):\n ...
python
chosen
[ { "from": "system", "value": "Add missing __future__ import to pass coding guidelines.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.apps import AppConfig\n\nclass RavenConfig(AppConfig):\n name = 'raven.contrib.django'\n label = 'raven.contrib.django'\n verbos...
python
chosen
[ { "from": "system", "value": "FIx render output (missing crf value)\n\n" }, { "from": "human", "value": "def render_video(render_type,\n out_frame_rate=30, overlay=None, extra_cmd=None):\n import os\n import subprocess\n\n from rocketleaguereplayanalysis.render.do_render...
python
chosen
[ { "from": "system", "value": "Fix default template of order received notification\n\nOrder lines were rendered on a single line. Fix that by adding a line\nbreak after each order line.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# This file is part of Shoop.\n#\n# Copyright (c) ...
python
chosen
[ { "from": "system", "value": "Make RequestType a normal class, not an enum.\n\nThis removes the restriction of needing Python >= 3.4. RequestType is\nnow a normal class with class variables (fixes #19).\n" }, { "from": "human", "value": "import enum\nimport json\nfrom pyglab.exceptions import Re...
python
chosen
[ { "from": "system", "value": "Fix channel shim test for gevent 1.0.0\n\nGevent 1.0 specifies this as its version, not 1.0.0, breaking the\ncomparison spuriously if one has version 1.0 installed exactly.\n" }, { "from": "human", "value": "import gevent\n\nfrom gevent import queue\nfrom wal_e impo...
python
chosen
[ { "from": "system", "value": "Fix a bug where user-agents could specify their own session ID.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nfrom __future__ import unicode_literals\n\nfrom web.auth import authenticate, deauthenticate\nfrom web.core import config, url\nfrom web.core.http...
python
chosen
[ { "from": "system", "value": "scripts: Fix typo in logging statement.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\nimport logging\nimport os\nimport sys\n\nZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nsys.path.insert(0, ZULIP_PATH)\nfro...
python
chosen
[ { "from": "system", "value": "Add logger to events.persons module\n" }, { "from": "human", "value": "# This file is part of Indico.\n# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).\n#\n# Indico is free software; you can redistribute it and/or\n# modify it under the...
python
chosen
[ { "from": "system", "value": "Sort files by last modification\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.contrib.auth.decorators import login_required\n\nfrom django.shortcuts import render\nfrom filer.models import File\nfrom filer.models import Folder\n\n\n@login_r...
python
chosen
[ { "from": "system", "value": "Install mercurial to install busket\n" }, { "from": "human", "value": "\nimport os\nfrom kokki import *\n\nPackage(\"erlang\")\n\nScript(\"install-busket\",\n not_if = lambda:os.path.exists(env.config.busket.path),\n cwd = \"/usr/local/src\",\n code = (\n ...
python
chosen
[ { "from": "system", "value": "Fix flake8 warning in test case\n" }, { "from": "human", "value": "from sqlobject import *\nfrom sqlobject.tests.dbtest import *\n\n\n########################################\n# Test hashing a column instance\n########################################\n\n\nclass Clas...
python
chosen
[ { "from": "system", "value": "Fix flake8 errors: E711 comparison to None should be 'if cond is not None:'\n" }, { "from": "human", "value": "import re\nfrom thefuck.utils import replace_command\n\n\ndef match(command):\n return (re.search(r\"([^:]*): Unknown command.*\", command.stderr) != No...
python
chosen
[ { "from": "system", "value": "Add a plugin displayName property\n\nThis allows the web client to display an arbitrary plugin title rather\nthan to be restricted to valid python/javascript tokens.\n" }, { "from": "human", "value": "#################################################################...
python
chosen
[ { "from": "system", "value": "[IMP] sale_coupon: Allow helpdesk users to send coupon by email\n\nPurpose\n=======\n\nHelpdesk users don't have the right to write on a coupon.\n\nWhen sending a coupon by email, the coupon is marked as 'sent'.\n\nAllow users to send coupons by executing the state change in su...
python
chosen
[ { "from": "system", "value": "Create generic quantity quota handler(saas-217)\n" }, { "from": "human", "value": "\ndef add_quotas_to_scope(sender, instance, created=False, **kwargs):\n if created:\n from nodeconductor.quotas import models\n for quota_name in sender.QUOTAS_NAMES:...
python
chosen
[ { "from": "system", "value": "Print out civil_number before and after [WAL-2172]\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.contrib.auth import get_user_model\nfrom django.db import transaction\n\nfrom waldur_core.c...
python
chosen
[ { "from": "system", "value": "Mark TraceTest.WebGLGreenTriangle as expected failure on Windows.\n\nBUG=517232\nTBR=dyen@chromium.org\n\nReview URL: https://codereview.chromium.org/1276403003\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#342511}\n" }, { "from": "human", "value...
python
chosen
[ { "from": "system", "value": "Set correct email config for salesforce sync.\n\nBB-1530\n" }, { "from": "human", "value": "try:\n from .secrets import *\nexcept ImportError:\n import sys\n sys.exit('secrets.py settings file not found. Please run `prepare.sh` to create one.')\n\nfrom .bas...
python
chosen
[ { "from": "system", "value": "Comment out what can't be checked\n" }, { "from": "human", "value": "import pytest\n\nfrom gitlabform.gitlabform import GitLabForm\nfrom gitlabform.gitlabform.test import create_group, create_project_in_group, get_gitlab, GROUP_NAME\n\nPROJECT_NAME = 'project_settin...
python
chosen
[ { "from": "system", "value": "Return a 404 error when no dstat csv can be loaded\n" }, { "from": "human", "value": "from django.http import HttpResponse\nfrom django.views.generic import View\n\nfrom stackviz import settings\n\n_cached_csv = None\n\n\ndef _load_csv():\n global _cached_csv\n\n...
python
chosen
[ { "from": "system", "value": "Update due to correction to E501 usage\n" }, { "from": "human", "value": "if True:\n if True:\n if True:\n self.__heap.sort(\n ) # pylint: builtin sort probably faster than O(n)-time heapify\n\n if True:\n ...
python
chosen
[ { "from": "system", "value": "Disable builtin tests for input() as it hangs\n" }, { "from": "human", "value": "from .. utils import TranspileTestCase, BuiltinFunctionTestCase\n\n\nclass InputTests(TranspileTestCase):\n pass\n\n\nclass BuiltinInputFunctionTests(BuiltinFunctionTestCase, Transpi...
python
chosen
[ { "from": "system", "value": "settings: Add some error states for the NCBI download option\n\nSigned-off-by: Kai Blin <94ddc6985b47aef772521e302594241f46a8f665@biotech.uni-tuebingen.de>\n" }, { "from": "human", "value": "from os import path\n############# Configuration #############\nDEBUG = Tru...
python
chosen
[ { "from": "system", "value": "Handle ctrl+c with signal\nFix more typos\n" }, { "from": "human", "value": "#ODB2 datalogger\n\nimport obd\n\nconnection = obd.OBD()\n\nwhile true:\n request = connection.query(obd.commands.RPM)\n\n if not r.is_null():\n print(r.value)" }, { "f...
python
chosen
[ { "from": "system", "value": "Modify example to calculate leaf position\n" }, { "from": "human", "value": "\"\"\"\nSteam and Leaf Plot\n-------------------\nThis example shows how to make a steam and leaf plot. \n\"\"\"\n\nimport altair as alt\nimport pandas as pd\nimport numpy as np\nnp.random....
python
chosen
[ { "from": "system", "value": "Fix an inconsistency is the bunch parser.\n\nMost of the exception handling is using the keyword 'as'.\nOne is using the comma. Change the comma style to 'as'.\n" }, { "from": "human", "value": "\"\"\"\n.. module:: config_parser\n :platform: linux\n :synopsis: M...
python
chosen
[ { "from": "system", "value": "Fix __COPYRIGHT__ and __REVISION__ in new Darwin module.\n\n\ngit-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@1037 fdb21ef1-2011-0410-befe-b5e4ea1792b1\n" }, { "from": "human", "value": "\"\"\"engine.SCons.Platform.darwin\n\nPlatform-specific initialization for...
python
chosen
[ { "from": "system", "value": "[FIX] account_fiscal_year: Use AGPL license, as it depends on `date_range` that uses that\n" }, { "from": "human", "value": "# Copyright 2016 Camptocamp SA\n# Copyright 2018 Lorenzo Battistini <https://github.com/eLBati>\n# License LGPL-3.0 or later (https://www.gnu...
python
chosen
[ { "from": "system", "value": "Build APIException all exceptions must be handled\n" }, { "from": "human", "value": "from rest_framework.views import exception_handler\n\nfrom rest_framework_friendly_errors import settings\nfrom rest_framework_friendly_errors.utils import is_pretty\n\n\ndef friend...
python
chosen
[ { "from": "system", "value": "Remove required from disease_id in medical_prescription_disease\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# © 2016 LasLabs Inc.\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nfrom openerp import models, fields, api\n\n\ncl...
python
chosen
[ { "from": "system", "value": "Add unit test for duplicate migration numbers\n\nDuplicate migration numbers can happen when merging changes from\ndifferent branches. This test ensures that we address the issue right\naway.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport os\n\...
python
chosen
[ { "from": "system", "value": "Mark this test as xfail\n" }, { "from": "human", "value": "# TestREPLThrowReturn.py\n#\n# This source file is part of the Swift.org open source project\n#\n# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors\n# Licensed under Apache License v2.0 wit...
python
chosen
[ { "from": "system", "value": "Remove duplicate call to generate_filetypes()" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\nimport crits.stats.handlers as stats\n\nclass Command(BaseCommand):\n \"\"\"\n Script Class.\n \"\"\"\n\n help = \"Runs ma...
python
chosen
[ { "from": "system", "value": "Add check_membership_elections_consistent to the data checking command\n" }, { "from": "human", "value": "from __future__ import print_function, unicode_literals\n\nimport sys\n\nfrom django.core.management.base import BaseCommand\n\nfrom candidates.models import ch...
python
chosen
[ { "from": "system", "value": "Allow for yellow color after specifying y\n" }, { "from": "human", "value": "#!/usr/bin/env python2\n\n'''\nGiven:\n1. status code: (0 - OK, other value - BAD)\n2. terminal window width\n\nshows red/green bar to visualize return code of previous command\n'''\n\nimpo...
python
chosen
[ { "from": "system", "value": "Add a usage in retry\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom functools import wraps\nimport time\n\nclass RetryExceededError(Exception):\n pass\n\nclass retry(object):\n '''A decorator encapsulated retry logic.\n\n Usage:\n\n @...
python
chosen
[ { "from": "system", "value": "Use json naming standards instead of camelCase\n" }, { "from": "human", "value": "from pprint import pprint\n#[{u'accountId': 2,\n #u'add': True,\n #u'broadcastUri': u'vlan://untagged',\n #u'firstIP': False,\n #u'networkRate': 200,\n #u'newNic': False,\n #u'ni...
python
chosen
[ { "from": "system", "value": "Revert basic bot random turtle factor\n\n\nFormer-commit-id: 53ffe42cf718cfedaa3ec329b0688c093513683c\nFormer-commit-id: 6a282c036f4e11a0aa9e954f72050053059ac557\nFormer-commit-id: c52f52d401c4a3768c7d590fb02f3d08abd38002" }, { "from": "human", "value": "from hlt im...
python
chosen
[ { "from": "system", "value": "Fix singleton to work with wrapped manager class\n\nSigned-off-by: Chris Harris <a361e89d1eba6c570561222d75facbbf7aaeeafe@kitware.com>\n" }, { "from": "human", "value": "from tomviz._wrapping import PipelineStateManagerBase\n\nclass PipelineStateManager(PipelineStat...
python
chosen
[ { "from": "system", "value": "Read credentials based on account.\n" }, { "from": "human", "value": "\"\"\"Transaction Downloader.\n\nUsage:\n transaction-downloader auth --account=<account-name>\n transaction-downloader -h | --help\n transaction-downloader --version\n\nOptions:\n -h --help ...
python
chosen
[ { "from": "system", "value": "Fix GST_PLUGIN_PATH in runtime hook\n\n- Only include `gst-plugins`\n- Also, semicolon was only correct on Windows\n" }, { "from": "human", "value": "import os\nimport sys\n\nroot = os.path.join(sys._MEIPASS, 'kivy_install')\n\nos.environ['KIVY_DATA_DIR'] = os.path....
python
chosen
[ { "from": "system", "value": "Fix typo in selection theorem\n\nChange-Id: Ieff9fe7e5783e0d3b995fb0ddbfc11015ca9197a\n" }, { "from": "human", "value": "#! /usr/bin/env python\n\n# Copyright Lajos Katona\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not...
python
chosen
[ { "from": "system", "value": "Fix the telemetry sample test\n\nThis test works fine on devstack, but on the test gate not all\nthe meters have samples, so only iterate over them if there are\nsamples.\n\nPartial-bug: #1665495\n\nChange-Id: I8f327737a53194aeba08925391f1976f1b506aa0\n" }, { "from": "h...
python
chosen
[ { "from": "system", "value": "Add comment to one_second_timeout assignment\n" }, { "from": "human", "value": "from time import sleep\n\nsleep(1)\n" }, { "from": "gpt", "value": "from time import sleep\n\n# Due to the overhead of Python, sleeping for 1 second will cause testing to\n# ...
python
chosen
[ { "from": "system", "value": "Update image every 0.5s till button gets pressed again\n" }, { "from": "human", "value": "#! /usr/bin/python3 \n\nimport sys\nfrom PyQt5.QtWidgets import (QWidget, QHBoxLayout, \n QLabel, QApplication, QPushButton)\nfrom PyQt5.QtGui import QPixmap\nfrom PyQt5.Qt...
python
chosen
[ { "from": "system", "value": "Allow plotting two types against one another.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n#Go through an OpenXC trace file and plot a time series graph using\n#matplotlib\n\nimport json\nimport sys\nimport argparse\nfrom pylab import *\n\ndef main():...
python
chosen
[ { "from": "system", "value": "Allow viewing the 404 page during development.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url\nfrom django.conf import settings\nimport os.path\n\nstatic_files_path = os.path.join(settings.PROJECT_DIR, \"static...
python
chosen
[ { "from": "system", "value": "Define groups for the invoice events.\n\n - wal-202\n" }, { "from": "human", "value": "from nodeconductor.logging.loggers import EventLogger, event_logger\n\n\nclass InvoiceLogger(EventLogger):\n month = int\n year = int\n customer = 'structure.Customer'\n\...
python
chosen
[ { "from": "system", "value": "[DB] Fix data migration when making scope non-null\n" }, { "from": "human", "value": "# encoding: utf8\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (...
python
chosen
[ { "from": "system", "value": "DOC: Clean up hinton example text.\n" }, { "from": "human", "value": "\"\"\"\n==============\nHinton diagram\n==============\n\nHinton diagrams are useful for visualizing the values of a 2D array. Positive\nand negative values represented by white and black squares,...
python
chosen
[ { "from": "system", "value": "Fix bug in migration script\n" }, { "from": "human", "value": "\"\"\"Added column 'weight' to Banner, Logo and Background.\n\nRevision ID: 587c89cfa8ea\nRevises: 2c0bfc379e01\nCreate Date: 2012-05-11 14:36:15.518757\n\n\"\"\"\n\n# downgrade revision identifier, used...
python
chosen
[ { "from": "system", "value": "Replace deprecated commit_on_success by atomic\n" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\nfrom django.db.transaction import commit_on_success\n\nfrom subscribe.models import IdealIssuer\n\nfrom lib import mollie\n\n# comm...
python
chosen
[ { "from": "system", "value": "Increment the oder in settings so ensure the order is preserved\n\nOtherwise, and depending on the database, when a set has supersets, the\nexercises could be ordered alphabetically.\n" }, { "from": "human", "value": "# Generated by Django 3.1.5 on 2021-02-28 14:10\...
python
chosen
[ { "from": "system", "value": "Check if the remote_repo was updated or not and log error\n" }, { "from": "human", "value": "import json\n\nfrom django.core.management.base import BaseCommand\n\nfrom readthedocs.oauth.models import RemoteRepository\n\n\nclass Command(BaseCommand):\n help = \"Lo...
python
chosen
[ { "from": "system", "value": "Initialize random generator seed for unit testing\n" }, { "from": "human", "value": "# -*- coding: utf-8\n\n\"\"\"\nPython implementation of Non-Stationary Gabor Transform (NSGT)\nderived from MATLAB code by NUHAG, University of Vienna, Austria\n\nThomas Grill, 2011...
python
chosen
[ { "from": "system", "value": "Encrypt password before saving user\n" }, { "from": "human", "value": "from index import db\n\nclass UserModel(db.Model):\n\n __tablename__ = 'User'\n id = db.Column(db.Integer, primary_key=True, nullable=False)\n name = db.Column(db.String(80), unique=True...
python
chosen
[ { "from": "system", "value": "Fix a broken export test\n\n\nFormer-commit-id: 4b369edfcb5782a2461742547f5b6af3bab4f759 [formerly e37e964bf9d2819c0234303d31ed2839c317be04]\nFormer-commit-id: 5b8a20fa99eab2f33c8f293a505a2dbadad36eee" }, { "from": "human", "value": "\n# Copyright (c) 2010-2014, GEM...
python
chosen
[ { "from": "system", "value": "Stop to use the __future__ module.\n\nThe __future__ module [1] was used in this context to ensure compatibility\nbetween python 2 and python 3.\n\nWe previously dropped the support of python 2.7 [2] and now we only support\npython 3 so we don't need to continue to use this mod...
python
chosen
[ { "from": "system", "value": "Use console EMAIL_BACKEND in development\n" }, { "from": "human", "value": "from configurations import values\nfrom .common import Common\n\nclass Local(Common):\n\n JWT_SECRET = values.Value('not-a-secret')\n DEBUG = values.BooleanValue(True)\n" }, { ...
python
chosen
[ { "from": "system", "value": "Handle cases when MEDUSA_URL_PREFIX isn't set\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.core.management.base import BaseCommand\nfrom django.core.urlresolvers import set_script_prefix\nfrom django_medusa.renderers import Static...
python
chosen
[ { "from": "system", "value": "Fix 'print_pos' templatetag for 2.7\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django import template\nfrom ..models import Season, Race\nfrom ..common import ordered_position\nregister = template.Library()\n\n@register.filter\ndef champion_fil...
python
chosen
[ { "from": "system", "value": "Remove blink scheduler from chromium.webkit\n\nFor context, please see:\n\nhttps://groups.google.com/a/chromium.org/d/msg/blink-dev/S-P3N0kdkMM/ohfRyTNyAwAJ\n\nhttps://groups.google.com/a/chromium.org/d/msg/blink-dev/3APcgCM52JQ/OyqNugnFAAAJ\n\nBUG=431478\n\nReview URL: https:/...
python
chosen
[ { "from": "system", "value": "Bump version to 0.14.999.1 (next release on this branch will be 0.15.0)\n\n\n20080110143356-53eee-be816768f9cc7e023de858d0d314cbbec894ffa1.gz\n" }, { "from": "human", "value": "__all__ = ('version', '__version__')\n\nversion = (0, 14, 0)\n__version__ = '.'.join(str(...
python
chosen
[ { "from": "system", "value": "Add back commented out Fibonacci benchmark.\n" }, { "from": "human", "value": "#import benchmark_fibonacci\nimport benchmark_twisted_names\n\n__all__ = ['benchmark_fibonacci', 'benchmark_twisted_names']\n" }, { "from": "gpt", "value": "import benchmark_f...
python
chosen
[ { "from": "system", "value": "Make it clear that the user must implement generate_from_int\n" }, { "from": "human", "value": "# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for...
python
chosen
[ { "from": "system", "value": "Fix tiffile hack to use os.path\n" }, { "from": "human", "value": "from __future__ import print_function, absolute_import, nested_scopes, generators, division, with_statement, unicode_literals\nfrom skimage.external import tifffile\n\ndef hack(input_tif):\n \"\"\...
python
chosen
[ { "from": "system", "value": "Fix for new km3hdf5 version 4\n" }, { "from": "human", "value": "\"\"\"\n==================\nToT histogram.\n==================\n\nCreate a simple histogram of the PMT signals (ToTs) in all events.\n\"\"\"\n\n# Author: Tamas Gal <tgal@km3net.de>\n# License: BSD-3\n\...
python
chosen
[ { "from": "system", "value": "Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours.\n" }, { "from": "human", "value": "\"\"\"Fix Folder, EASFolderSyncStatus unique constraints\n\nRevision ID: 2525c5245cc2\nRevises: 479b3b84a73e\nCreate Date: 2014-07-28 18:57:...
python
chosen
[ { "from": "system", "value": "Fix bug in changeling title fix - it used to remove some lines on the way...\n" }, { "from": "human", "value": "import json\nimport logging\n\nif __name__ == \"__main__\":\n input = sys.argv[1]\n output = sys.argv[2]\n processor = fix_changeline_budget_titl...
python
chosen
[ { "from": "system", "value": "tests: Allow multiple 'golden' results for agglomeration test on Linux\n" }, { "from": "human", "value": "import sys\nimport platform\nimport h5py\nimport numpy\n\nsegh5 = sys.argv[1]\npredh5 = sys.argv[2]\nclassifier = sys.argv[3]\nthreshold = float(sys.argv[4])\n\...
python
chosen
[ { "from": "system", "value": "Add gcn_notice_filename function to igrace\n" }, { "from": "human", "value": "# (c) Stefan Countryman 2017\n# set up an interactive environment with gracedb rest api access.\nimport ligo.gracedb.rest\nclient = ligo.gracedb.rest.GraceDb()\n" }, { "from": "gpt...
python
chosen
[ { "from": "system", "value": ":art: Improve NullBooleanField with Truthy/Falsy values\n" }, { "from": "human", "value": "from wtforms.fields import RadioField\n\nclass NullBooleanField(RadioField):\n DEFAULT_CHOICES = ((True, 'Sim'), (False, 'Não'), (None, 'Ignorado'))\n def __init__(self,...
python
chosen
[ { "from": "system", "value": "Use `with` for writing to file" }, { "from": "human", "value": "import json\r\nimport requests\r\nfrom flask import Flask, session, request, current_app\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route(\"/\", methods=[\"POST\"])\r\ndef main():\r\n f = open('bomb_st...
python
chosen
[ { "from": "system", "value": "Modify excel screenshot test so that it works with the new directory structure\n" }, { "from": "human", "value": "#!/usr/bin/python\n\"\"\"Program to execute a VBA macro in MS Excel\n\"\"\"\nimport os\nimport shutil\nimport win32com.client\nimport pythoncom\nimport ...
python
chosen
[ { "from": "system", "value": "Add more test cases to verify transformer behavior\n" }, { "from": "human", "value": "\"\"\"Data transformation utilities test cases.\"\"\"\n\nimport unittest\n\nfrom datagrid_gtk3.utils.transformations import degree_decimal_str_transform\n\n\nclass DegreeDecimalStr...
python
chosen
[ { "from": "system", "value": "Add dependency to website (not necessary before inheriting website.qweb.field.html, but makes sense anyway.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# © 2016 Therp BV <http://therp.nl>\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl...
python
chosen