conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "migrations: Add reverser for emoji_alt_code migration.\n\nThis is easy to do, and prevents this feature from getting a server\nadmin stuck in potentially a pretty uncomfortable way -- unable to\nroll back a deploy.\n"
},
{
"from": "human",
"value": "from django.db i... | python | chosen |
[
{
"from": "system",
"value": "Remove extra whitespace in newline\n"
},
{
"from": "human",
"value": "from cs251tk.student import remove\nfrom cs251tk.student import clone_student\nfrom cs251tk.student import stash\nfrom cs251tk.student import pull\nfrom cs251tk.student import checkout_date\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Fix off-by-one error, make it lazy\n"
},
{
"from": "human",
"value": "def linspace(start, stop, num):\n return [(stop*i + start*(num-i)) / num\n for i in range(num+1)]\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\nimport collec... | python | chosen |
[
{
"from": "system",
"value": "Remove cms dependency in test-runner\n"
},
{
"from": "human",
"value": "HELPER_SETTINGS = {\n 'SITE_ID': 1,\n 'TIME_ZONE': 'Europe/Zurich',\n 'LANGUAGES': (\n ('en', 'English'),\n ('de', 'German'),\n ('fr', 'French'),\n ),\n 'INST... | python | chosen |
[
{
"from": "system",
"value": "Fix redirect after success registration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.shortcuts import render_to_response\nfrom django.contrib.auth.models import User\nfrom django.views.generic.detail import DetailView\n\nfrom core.views ... | python | chosen |
[
{
"from": "system",
"value": "Use the correct Spider superclass in the example\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom scrapy_kafka.spiders import KafkaSpider\nfrom example.items import DmozItem\n\n\nclass CustomKafkaSpider(KafkaSpider):\n name = \"dmoz_kafka\"\n a... | python | chosen |
[
{
"from": "system",
"value": "Test file loops over all the mounts\n"
},
{
"from": "human",
"value": "from panoptes.mount.ioptron import iOptronMount\n\nclass TestOptronMount: \n\n mount = None\n\n def setup(self):\n print (\"TestMount:setup() before each test method\")\n \n def t... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect indexes in alembic revision\n"
},
{
"from": "human",
"value": "\"\"\"Add tracks\n\nRevision ID: 11890f58b1df\nRevises: 4d4b95748173\nCreate Date: 2016-08-16 16:48:27.441514\n\"\"\"\n\nimport sqlalchemy as sa\nfrom alembic import op\n\n\n# revision iden... | python | chosen |
[
{
"from": "system",
"value": "Use json instead of django.utils.simplejson."
},
{
"from": "human",
"value": "from django.http import HttpResponse\nfrom django.utils import simplejson\n\nfrom configuration_builder import DEFAULT_CONFIGURATION_BUILDER\n\n\ndef load_configuration(request):\n retu... | python | chosen |
[
{
"from": "system",
"value": "Clear queries list instead of overwriting it.\n"
},
{
"from": "human",
"value": "import functools\nimport unicodedata\nfrom django.core.cache import get_cache\nfrom django.conf import settings\n\n\ndef normalize_unicode(u):\n \"\"\"Replace non-ASCII characters wi... | python | chosen |
[
{
"from": "system",
"value": "Use new name for GetoptError, and pass it two arguments\nUse re module instead of regex\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\n# findlinksto\n#\n# find symbolic links to a path matching a regular expression\n\nimport os\nimport sys\nimport rege... | python | chosen |
[
{
"from": "system",
"value": "Return None or Empty List\n\nReturn None when an object cannot be found or an empty list when a list\ntype is expected.\n"
},
{
"from": "human",
"value": "from dcos import (marathon, mesos, package, util)\nfrom dcos.errors import DCOSException\n\n\ndef get_service(s... | python | chosen |
[
{
"from": "system",
"value": "Use indexed instead of integrated pickle files for detector refinement.\n\n"
},
{
"from": "human",
"value": "from __future__ import division\nimport os, sys\n\npaths = sys.argv[1:]\n\nfor path in paths:\n for filename in os.listdir(path):\n if \"integrated\" in ... | python | chosen |
[
{
"from": "system",
"value": "Add a validation to ensure that CSS selector actually works\n"
},
{
"from": "human",
"value": "try:\n from tn.plonehtmlpage import html_page\n HAS_HTML_PAGE = True\nexcept ImportError:\n HAS_HTML_PAGE = False\n\nif HAS_HTML_PAGE:\n from five import grok\... | python | chosen |
[
{
"from": "system",
"value": "Add in largest scale with high pb cutoff\n"
},
{
"from": "human",
"value": "\nimport sys\n\n'''\nCleans an MS with a single channel given a mask and a model\n'''\n\nvis = sys.argv[4]\nmodel = sys.argv[5]\nmask = sys.argv[6]\n\nout_root = vis[:-3]\n\nclean(vis=vis, i... | python | chosen |
[
{
"from": "system",
"value": "Fix - was flipping display twice\n\nGah. Here is a speedup for pygame -- don't flip the display twice.\n"
},
{
"from": "human",
"value": "\"\"\"enchanting2.py\n\nThis is the main entry point of the system\"\"\"\n\nimport sys\nimport xml.etree.cElementTree as Elemen... | python | chosen |
[
{
"from": "system",
"value": "Use super because only one superclass\n"
},
{
"from": "human",
"value": "from rest_framework.negotiation import DefaultContentNegotiation\n\n\nclass JSONAPIContentNegotiation(DefaultContentNegotiation):\n\n def select_renderer(self, request, renderers, format_suf... | python | chosen |
[
{
"from": "system",
"value": "Revert msgpack to json content message\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom datetime import timedelta\nfrom celery import Celery\nfrom accio.basetask import ManagedTask\nimport django.conf\n\ndefau... | python | chosen |
[
{
"from": "system",
"value": "Switch to django new url schema\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.conf.urls import url, patterns\n\nfrom .views import EntryListView\n\n\nurlpatterns = patterns(\n '',\n\n # Entry List\n url('^$', EntryListView.as_view(... | python | chosen |
[
{
"from": "system",
"value": "Use maximum instead of if-statement\n"
},
{
"from": "human",
"value": "import numpy\n\nfrom chainer import cuda\nfrom chainer import function\nfrom chainer.utils import type_check\n\n\nclass BinaryAccuracy(function.Function):\n\n ignore_label = -1\n\n def chec... | python | chosen |
[
{
"from": "system",
"value": "Use output_dir, not hard-coded dir name\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport os\nimport sys\n\nfrom django.core.management.base import BaseCommand\n\nfrom emailfwd.models import ForwardedEmailAddress\n\n\nclass Command(B... | python | chosen |
[
{
"from": "system",
"value": "Reduce the number of trees\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport unittest\nfrom unittest import TestCase\n\nfrom sklearn.ensemble import RandomForestClassifier\n\nfrom ..Classifier import Classifier\nfrom ...language.PHP import PHP\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add search by request_id field.\n"
},
{
"from": "human",
"value": "from django.db.models import Q\n\nfrom ..models import LogRecord\n\n\ndef _filter_records(request):\n getvars = request.GET\n logrecord_qs = LogRecord.objects.all().select_related('app')\n #... | python | chosen |
[
{
"from": "system",
"value": "Call build_index and use joinpath.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport shutil\n\nfrom pathlib import Path\nfrom shutil import copytree\n\nfrom logya.core import Logya\nfrom logya.content import write_collection, write_page\n\n\ndef gen... | python | chosen |
[
{
"from": "system",
"value": "Update test_render_PUT_valid_parameters to be an approximate first draft.\n"
},
{
"from": "human",
"value": "import json\nimport urllib\n\nfrom twisted.trial import unittest\n\nimport mock\n\nfrom mlabsim import update\n\n\nclass UpdateResourceTests (unittest.TestCa... | python | chosen |
[
{
"from": "system",
"value": "Add filters to analyzing admin\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\nfrom django_services import admin\nfrom dbaas_services.analyzing.service import AnalyzeRepositoryService\nfrom dbaas_... | python | chosen |
[
{
"from": "system",
"value": "Fix test funcs in algorithms packaging.\n"
},
{
"from": "human",
"value": "\"\"\"\nTODO\n\"\"\"\n__docformat__ = 'restructuredtext'\n\nimport intrinsic_volumes, rft\n\ndef test(level=1, verbosity=1, flags=[]):\n from neuroimaging.utils.testutils import set_flags\... | python | chosen |
[
{
"from": "system",
"value": "Replace uni linebreaks with simple linefeeds in order to make highlighting work"
},
{
"from": "human",
"value": "from django import template\nfrom django.utils.safestring import mark_safe\nfrom django.utils.html import escape\n\n\nregister = template.Library()\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Fix these class names and imports so it works\n"
},
{
"from": "human",
"value": "from armstrong import hatband\nfrom hatband_support import models\nfrom django.forms.widgets import TextInput\n\n\nclass ArticleAdmin(hatband.ModelAdmin):\n\n class Meta:\n mo... | python | chosen |
[
{
"from": "system",
"value": "Add code to show last commit message\n"
},
{
"from": "human",
"value": "from flask import Flask, request\nfrom pprint import pprint\nimport json\n\napp = Flask(__name__)\nlastCommit = \"No recorded commits!\"\n\n@app.route(\"/\")\ndef hello():\n return \"IntegralGi... | python | chosen |
[
{
"from": "system",
"value": "Make function return false or true."
},
{
"from": "human",
"value": "\"\"\"\nThis file is part of Lisa.\n\nLisa is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundatio... | python | chosen |
[
{
"from": "system",
"value": "Fix to ensure program echos \"bye\" whenever program is quit\n"
},
{
"from": "human",
"value": "import menus\nimport auth\nimport click\n\n\ndef main():\n \"\"\"Main function\"\"\"\n credentials = auth.authenticate_user()\n\n if credentials:\n menus.... | python | chosen |
[
{
"from": "system",
"value": "Add check to make sure resource exists\n"
},
{
"from": "human",
"value": "from django.http import HttpResponse\nfrom django.shortcuts import render_to_response\nfrom .models import Resource\n\ndef index(request):\n return render_to_response(\"index.html\")\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Set DEBUG = True to make WhiteNoise works\n"
},
{
"from": "human",
"value": "import dj_database_url\n\nfrom .base import *\n\n\nDEBUG = False\n\nALLOWED_HOSTS = ['*']\n\nMIDDLEWARE = MIDDLEWARE + [\n 'whitenoise.middleware.WhiteNoiseMiddleware',\n]\n\nSTATICFILES... | python | chosen |
[
{
"from": "system",
"value": "Add import models to app\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\n\napp = Flask(__name__)\n\n# load configuration file\napp.config.from_object('config')\n\n# database initialization\ndb = SQLAlchemy(a... | python | chosen |
[
{
"from": "system",
"value": "Fix cached graph out-of-sync when checking.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nfrom pprint import pprint as pp\n\nfrom cc.payment import flow\n\ndef verify():\n for ignore_balances in (True, False):\n graph = flow.build... | python | chosen |
[
{
"from": "system",
"value": "Modify forums directly in categories.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom forum.models import Category, Forum, Thread\n\nadmin.site.register(Category)\nadmin.site.register(Forum)\nadmin.site.register(Thread)\n"
},
{
"fro... | python | chosen |
[
{
"from": "system",
"value": "Update the mpl rcparams for mpl 2.0+\n"
},
{
"from": "human",
"value": "def setup_text_plots(fontsize=8, usetex=True):\n \"\"\"\n This function adjusts matplotlib settings so that all figures in the\n textbook have a uniform format and look.\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Add mandatory `on_delete` and allow nulls\n\nI assume it's better to allow nulls than to have auth stamped models\ndisappear with deleted users.\n"
},
{
"from": "human",
"value": "from django.db.models import Model\nfrom django.utils.translation import ugettext_lazy... | python | chosen |
[
{
"from": "system",
"value": "Add github as project URL\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n__copyright__ = \"Copyright (c) 2012, Chris Drake\"\n__license__ = \"All rights reserved.\"\n\n# standard library\nfrom distutils.core import setup\n\n# pyeda\nfrom pyeda import ... | python | chosen |
[
{
"from": "system",
"value": "Add a download url for the tarball from github\n"
},
{
"from": "human",
"value": "from os import path\nfrom setuptools import setup\n\nREADME = path.join(path.dirname(path.abspath(__file__)), \"README.rst\")\n\nsetup(\n name=\"minecart\",\n version=\"0.3.0\",\... | python | chosen |
[
{
"from": "system",
"value": "Add mock as a test dependency if running as python2\n\nTest dependencies only get used if running as python setup.py test, so\nneed to add test_suite\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport sys\nfrom setuptools import setup, find_packages\... | python | chosen |
[
{
"from": "system",
"value": "Fix url in distutils description.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(\n name=\"django-auth-ldap\",\n version=\"1.0b7\",\n description=\"Django LDAP authentication backend\",\n long_descri... | python | chosen |
[
{
"from": "system",
"value": "Add sentry_sdk to cxfreeze packages\n\n"
},
{
"from": "human",
"value": "from cx_Freeze import setup, Executable\n\nbuild_exe_options = {\n \"bin_includes\": [\n \"libssl.so\",\n \"libz.so\"\n ],\n \"bin_path_includes\": [\n \"/usr/lib... | python | chosen |
[
{
"from": "system",
"value": "Add strings in weak quotes\n"
},
{
"from": "human",
"value": "\"\"\"celery.backends\"\"\"\nfrom functools import partial\nfrom django.conf import settings\nimport sys\n\nDEFAULT_BACKEND = \"database\"\nCELERY_BACKEND = getattr(settings, \"CELERY_BACKEND\", DEFAULT_B... | python | chosen |
[
{
"from": "system",
"value": "Add tests for APM overrides\n"
},
{
"from": "human",
"value": "from kitten.util import AutoParadigmMixin\n\n\nclass TestAutoParadigmMixin(object):\n def setup_method(self, method):\n self.apm = AutoParadigmMixin()\n\n def test_first_load(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update integration test with actual...integration test\n"
},
{
"from": "human",
"value": "import unittest\n\nclass TestCLI(unittest.TestCase):\n\n def test_kubos_installed(self):\n self.assertEqual('foo'.upper(), 'FOO')\n self.assertTrue('FOO'.isupp... | python | chosen |
[
{
"from": "system",
"value": "Add addSettings call also to the testing code.\n"
},
{
"from": "human",
"value": "PATH = 0\nVALUE = 1\nMINIMUM = 2\nMAXIMUM = 3\n\n\n# Simulates the SettingsSevice object without using the D-Bus (intended for unit tests). Values passed to\n# __setitem__ (or the [] o... | python | chosen |
[
{
"from": "system",
"value": "Test commit for travis setup\n"
},
{
"from": "human",
"value": "from test_plus.test import TestCase as PlusTestCase\n\n\nclass TestCase(PlusTestCase):\n pass\n"
},
{
"from": "gpt",
"value": "from test_plus.test import TestCase as PlusTestCase\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Add sync quota task to celerybeat\n\n - nc-1009\n"
},
{
"from": "human",
"value": "from nodeconductor.core import NodeConductorExtension\n\n\nclass ExchangeExtension(NodeConductorExtension):\n\n @staticmethod\n def django_app():\n return 'nodeconductor_... | python | chosen |
[
{
"from": "system",
"value": "Fix requesthandler tests (new version of datamodel).\n"
},
{
"from": "human",
"value": "from ppp_datamodel import Sentence, Resource\nfrom ppp_datamodel.communication import Request, TraceItem, Response\nfrom ppp_libmodule.tests import PPPTestCase\nfrom ppp_natural_... | python | chosen |
[
{
"from": "system",
"value": "Fix test to catch options issues\n\nThe test should now catch the issue that was fixed in 79a453f.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom eadred.management.commands import generatedata\n\n\ndef test_generatedata():\n \"\"\"Basic test to make s... | python | chosen |
[
{
"from": "system",
"value": "coder/msgpack: Use umsgpack package for msgpack coder\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Ericsson AB\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compli... | python | chosen |
[
{
"from": "system",
"value": "Fix tests for tx tool\n"
},
{
"from": "human",
"value": "from unittest.mock import Mock\n\nfrom gi.repository import Gtk\n\nfrom gaphor.diagram.diagramtools.txtool import TxData, on_begin, transactional_tool\nfrom gaphor.transaction import TransactionBegin\n\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Add required to ethnicity code\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# #############################################################################\n#\n# Tech-Receptives Solutions Pvt. Ltd.\n# Copyright (C) 2004-TODAY Tech-Receptives(<http:... | python | chosen |
[
{
"from": "system",
"value": "Add testing of rich html_export\n"
},
{
"from": "human",
"value": "\"\"\"Tests for rich module.\"\"\"\nimport sys\n\nfrom subprocess_tee import run\nfrom subprocess_tee.rich import ConsoleEx\n\n\ndef test_rich_console_ex() -> None:\n \"\"\"Validate that ConsoleEx... | python | chosen |
[
{
"from": "system",
"value": "Use players 0 and 1 instead of 1 and 2\n\nMakes it easier to communicate with ANN, as 1 is truthy and 0 is falsy.\nPlayers are also slightly more clear when Connect4 is printed.\n"
},
{
"from": "human",
"value": "class Connect4(object):\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix linting issue with url line length\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.conf.urls import url, include\nfrom django.conf.urls.static import static\nfrom django.conf import settings\nfro... | python | chosen |
[
{
"from": "system",
"value": "Make log message a little clearer\n"
},
{
"from": "human",
"value": "__license__ = \"\"\"\nCopyright 2012 DISQUS\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a ... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8, remove blank line on DetailView\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.views.generic.detail import DetailView as DjangoDetailView\nfrom django.contrib.sites.models import get_current_site\nfrom django... | python | chosen |
[
{
"from": "system",
"value": "Create fullname user object locally in test\n"
},
{
"from": "human",
"value": "\"\"\"\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nimport pytest\n\nfrom testfixtures.user import create_user_with_detai... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Update Fiscal document cancel wizard\n"
},
{
"from": "human",
"value": "# Copyright 2019 KMEE\n# Copyright (C) 2020 Renato Lima - Akretion <renato.lima@akretion.com.br>\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\nfrom odoo import _, ap... | python | chosen |
[
{
"from": "system",
"value": "Remove duplicate JSON gaferences when concatenating\n"
},
{
"from": "human",
"value": "import json\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('json_file', nargs='+')\nparser.add_argument('output_file')\n\nif __name__ == \"__main__\":... | python | chosen |
[
{
"from": "system",
"value": "Fix test case with client\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import AnonymousUser\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\nfrom django.test import RequestFactory\n\nfrom presentation.models impo... | python | chosen |
[
{
"from": "system",
"value": "Update database URIs for C9."
},
{
"from": "human",
"value": "class DevelopmentConfig(object):\n DATABASE_URI = \"postgresql://action:action@localhost:5432/posts\"\n DEBUG = True\n\nclass TestingConfig(object):\n DATABASE_URI = \"postgresql://action:action@... | python | chosen |
[
{
"from": "system",
"value": "Add a database mixin for Timestamping models\n"
},
{
"from": "human",
"value": "from sqlalchemy.dialects import postgresql as pg\nfrom sqlalchemy.sql.expression import text\n\nfrom warehouse import db\n\n\nclass UUIDPrimaryKeyMixin(object):\n\n id = db.Column(pg.... | python | chosen |
[
{
"from": "system",
"value": "Add find import to oslib init\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# MIT License\n# \n# Copyright (c) 2017 Caian Benedicto\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated ... | python | chosen |
[
{
"from": "system",
"value": "Add accounts url for registration backend\n"
},
{
"from": "human",
"value": "\"\"\"imagersite URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\n... | python | chosen |
[
{
"from": "system",
"value": "Make Pylint ignore some unused imports\n\nIgnore them because they are required for the bot to work"
},
{
"from": "human",
"value": "from . import util\nfrom . import irc\nsysver = \"\".join(__import__(\"sys\").version.split(\"\\n\"))\ngitver = __import__(\"subproce... | python | chosen |
[
{
"from": "system",
"value": "Fix infinite recursion of comparing Comparable\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim: set fileencoding=UTF-8 :\n\n\nimport inspect\n\n\nclass DynamicMethods(object):\n\n def list_methods(self, predicate):\n \"\"\"Find all transfor... | python | chosen |
[
{
"from": "system",
"value": "Add test capturing need for an alternate keyring with an alternate keychain.\n"
},
{
"from": "human",
"value": "import pytest\n\nimport keyring\nfrom keyring.testing.backend import BackendBasicTests\nfrom keyring.backends import macOS\n\n\n@pytest.mark.skipif(\n ... | python | chosen |
[
{
"from": "system",
"value": "Order by ledger types by name\n"
},
{
"from": "human",
"value": "from openerp.osv import fields, osv\nfrom openerp.tools.translate import _\n\n_enum_ledger_type = [\n ('ledger_a', _('Ledger A')),\n ('ledger_b', _('Ledger B')),\n ('ledger_c', _('Ledger C')),... | python | chosen |
[
{
"from": "system",
"value": "Remove custom docker client initialization logic\n\nSigned-off-by: Aanand Prasad <94fc4f3e3d0be608b3ed7b8529ff28d2a445cce1@gmail.com>\n"
},
{
"from": "human",
"value": "import logging\nimport os\nimport ssl\n\nfrom docker import Client\nfrom docker import tls\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Add print debug to text function\n"
},
{
"from": "human",
"value": "from flask import request\nimport requests\nfrom ..utils.status import get_status\nfrom ..utils.reminders import create_reminder\nimport twilio.twiml\nimport json\nfrom datetime import datetime\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Add a test for wscompat conversion\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom . import models\nfrom sir.schema.searchentities import SearchEntity as E, SearchField as F\n\n\nclass QueryResultToDictTest(unittest.TestCase):\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove extra noise on install.\n\ngit-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@1549 d6536bca-fef9-0310-8506-e4c0a848fbcf\n"
},
{
"from": "human",
"value": "\nimport os\nfrom numpy.distutils.misc_util import Configuration\n\ndef configuration(parent_package='... | python | chosen |
[
{
"from": "system",
"value": "Remove use of context manager.\n"
},
{
"from": "human",
"value": "import time\nimport unittest\n\nimport pytest\n\n\nclass TerribleTerribleWayToWriteTests(unittest.TestCase):\n @pytest.fixture(autouse=True)\n def setupBenchmark(self, benchmark):\n self.... | python | chosen |
[
{
"from": "system",
"value": "Fix missing generator on Windows\n\n- Since compiler is not listed on settings, CMake is not\n able to detect a valid generator, using MingGW by default\n- Add topics to be used as tags for searching\n\nSigned-off-by: Uilian Ries <d4bad57018205bdda203549c36d3feb0bfe416a7@gmail... | python | chosen |
[
{
"from": "system",
"value": "Update Struct.__repr__ to show subclass names\n"
},
{
"from": "human",
"value": "# Copyright 2013 John Reese\n# Licensed under the MIT license\n\nclass Struct(object):\n \"\"\"A basic object type that, given a dictionary or keyword arguments,\n converts the ke... | python | chosen |
[
{
"from": "system",
"value": "Make whitespaces before TimeSeriesJSON for PEP8\n"
},
{
"from": "human",
"value": "import json\nimport ijson\n\nclass TimeSeriesJSON:\n\n def __init__(self, f=None, fn=None, tag='item'):\n \"\"\"\n :param f: file object (_io.TextIOWrapper)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a test (currently failing) ensuring that named fontsets created in python are propertly serialized\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom nose.tools import *\nfrom utilities import execution_path\n\nimport os, mapnik\n\ndef setup():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add test for storing dictionaries on ValidationError\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom marshmallow.exceptions import ValidationError\n\nclass TestValidationError:\n\n def test_stores_message_in_list(self):\n err = Validatio... | python | chosen |
[
{
"from": "system",
"value": "Comment out fix_fee_product_index from migration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.22 on 2019-10-31 16:33\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, OperationalError, Programming... | python | chosen |
[
{
"from": "system",
"value": "Modify example to emphasise importance of context.\n"
},
{
"from": "human",
"value": "\ndef print_numbers(numbers):\n for n in numbers:\n print(n)\n\nif random:\n numbers = 1\n print_numbers(numbers)\nelse:\n numbers = 1, 2, 3\n print_numbers(n... | python | chosen |
[
{
"from": "system",
"value": "Change raises class to UrlNotValidException\n"
},
{
"from": "human",
"value": "import unittest, os, sys\n\ncurrent_dir = os.path.dirname(__file__)\nbase_dir = os.path.join(current_dir, os.pardir, os.pardir)\nsys.path.append(base_dir)\n\nfrom requests.exceptions impo... | python | chosen |
[
{
"from": "system",
"value": "Change test name to be more descriptive\n\nAlso better conforms to the naming conventions for other tests in this module.\n"
},
{
"from": "human",
"value": "from web_test_base import *\n\nclass TestIATIStandard(WebTestBase):\n \"\"\"\n TODO: Add tests to asser... | python | chosen |
[
{
"from": "system",
"value": "Use single quotes instead of double quotes\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_identify_repo\n------------------\n\"\"\"\n\nimport pytest\n\nfrom cookiecutter import exceptions, vcs\n\n\ndef test_identify... | python | chosen |
[
{
"from": "system",
"value": "Read database user and password from environment.\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.conf import settings\n\n\nos.environ['REUSE_DB'] = '1'\n\n\nif not settings.configured:\n INSTALLED_APPS = (\n 'django.contrib.auth',\n 'dj... | python | chosen |
[
{
"from": "system",
"value": "Make pylpfile path more readable\n"
},
{
"from": "human",
"value": "\"\"\"\n\nRun a pylpfile.\n\nCopyright (C) 2017 The Pylp Authors.\nThis file is under the MIT License.\n\n\"\"\"\n\nimport runpy, os, sys\nimport traceback\nimport asyncio\nimport pylp, pylp.cli.log... | python | chosen |
[
{
"from": "system",
"value": "Add ADMINS to production settings\n"
},
{
"from": "human",
"value": "from local_settings import *\n\nDEBUG = False\n\nALLOWED_HOSTS = ['uchicagohvz.org']\n\n# Database\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Ad... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Allow Ref in StringValue\"\n\nThis reverts commit a1957fb04118ce13f2cb37a52bc93718eed0ae41.\n"
},
{
"from": "human",
"value": "from . import AWSObject, AWSProperty, Ref\nfrom .validators import boolean\n\n\nclass ParameterObjectAttribute(AWSProperty):\n ... | python | chosen |
[
{
"from": "system",
"value": "Test threshold increased because the Travis server is a bit slower :)\n"
},
{
"from": "human",
"value": "import datetime\n\nimport dnstwister.tools\n\n\ndef test2():\n \"\"\"Looooong domain names highlighted that the idna decoding is slooooow.\n\n This is a ba... | python | chosen |
[
{
"from": "system",
"value": "Exit non-zero if tests fail\n\nruntests.py was exiting 0 if test either failed or passed (which\nconfused tox, travis, etc).\n\nDetermine the status code based on the success of the test suite run.\n"
},
{
"from": "human",
"value": "# Unit test driver.\n\nimport os\... | python | chosen |
[
{
"from": "system",
"value": "Fix get gpg key from database\n"
},
{
"from": "human",
"value": "from glob import glob\nimport os\n\nfrom .credential import Credential\nfrom .crypt import create_gpg, load_gpg\n\n\nclass Database(object):\n\n def __init__(self, path, gpg):\n self.path = p... | python | chosen |
[
{
"from": "system",
"value": "Set fallback to true on get text to avoid crash on missing language file\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n \nimport os\nimport config\nimport gettext\n \n# Change this variable to your app name!\n# The translation files will be under\n# ... | python | chosen |
[
{
"from": "system",
"value": "Make it so we're using our own seed.\n"
},
{
"from": "human",
"value": "#! /usr/bin/python3\nimport random\n\nrandom.seed() # this initializes with the Date, which I think is a novel enough seed\n\nwhile True: # if we're going with a mimicing of cat /dev/random, it'... | python | chosen |
[
{
"from": "system",
"value": "Document the test filter better.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Test hook to launch an irker instance (if it doesn't already exist)\n# just before shipping the notification. We start it in in another terminal\n# so you can watch the d... | python | chosen |
[
{
"from": "system",
"value": "Use a Set to avoid duplicates\n"
},
{
"from": "human",
"value": "import re\n\nerrorFile = open('samples/foobar2000-errors.txt', 'r')\nerrors = errorFile.readlines()\n\nindex = -1\nfor i in range(len(errors)):\n\tline = errors[i]\n\tif re.search(r'List of undecodable... | python | chosen |
[
{
"from": "system",
"value": "Add sleep on start database\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nfrom util import full_stack\nfrom workflow.steps.util.base import BaseStep\nfrom workflow.exceptions.error_codes import DBAAS_0022\nfrom workflow.steps.util.resto... | python | chosen |
[
{
"from": "system",
"value": "Add NdGridSplinePPForm to csaps imports\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nCubic spline approximation (smoothing)\n\"\"\"\n\nfrom csaps._version import __version__ # noqa\n\nfrom csaps._base import (\n SplinePPForm,\n Univar... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.