conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add setting for fancypages base template dir\n"
},
{
"from": "human",
"value": "__version__ = (0, 0, 1, 'alpha', 1)\n"
},
{
"from": "gpt",
"value": "import os\n\n__version__ = (0, 0, 1, 'alpha', 1)\n\nFP_MAIN_TEMPLATE_DIR = os.path.join(\n os.path.dir... | python | chosen |
[
{
"from": "system",
"value": "Revert 193850 \"Remove references to new-run-webkit-tests\"\n\nTries to execute the perl script \"run-webkit-tests\" using \"cmd\" which is python.\n\n> Remove references to new-run-webkit-tests\n> \n> We are going to rename it to run-webkit-tests soon.\n> \n> BUG=\n> \n> Revie... | python | chosen |
[
{
"from": "human",
"value": "Make sure Celery is always loaded when Django is.\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import\n\n# This will make sure the app is always imported when\n# Django starts so that shared_task will use this app.\nfrom .celery import app as cele... | python | chosen |
[
{
"from": "system",
"value": "Make ``PeriodicTrigger`` inherent from ``Trigger``\n\nFixes bug in checking state and preprocessing ``Triggers`` for duck\ntyping.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2009-2019 The Regents of the University of Michigan\n# This file is part of the HOOM... | python | chosen |
[
{
"from": "system",
"value": "Use the program name as the prefix.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\"\"\"\ncommon.py\n\"\"\"\n\nimport sys\n\n\ndef log(msg, *args):\n if args:\n msg = msg % args\n print >>sys.stderr, 'webpipe:', msg\n\n\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Set the githubIssue field to the actual GitHub URL fo the issue instead of the issue number.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom AbstractVisitor import AbstractVisitor\n\nfrom duralex.alinea_parser import *\n\nfrom github import Github... | python | chosen |
[
{
"from": "system",
"value": "Increase ack on broker to 4 hours.\n\nChange-Id: I4a1f0fc6d1c07014896ef6b34336396d4b30bfdd\n"
},
{
"from": "human",
"value": "# Copyright (C) 2014 Linaro Ltd.\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU... | python | chosen |
[
{
"from": "system",
"value": "Make the dev server advertise on your local ip as well as localhost (for easier testing on mobile)\n"
},
{
"from": "human",
"value": "import werkzeug.serving\nimport standalone_app\n\nwerkzeug.serving.run_simple('localhost', 8080, standalone_app.app, use_reloader=Tr... | python | chosen |
[
{
"from": "system",
"value": "Make the regular expression not require a gif image.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.forms import widgets\nfrom django.utils.safestring import mark_safe\n\nCOUNTRY_CHANGE_HANDLER = \"\"\"\nthis.nextSibling.src = this.... | python | chosen |
[
{
"from": "system",
"value": "Update release version checking to include documentation\n"
},
{
"from": "human",
"value": "import re\nimport sys\n\nchanges_file = open('CHANGES.txt', 'r')\nchanges_first_line = changes_file.readline()\nchanges_version = re.match(r'v(\\d\\.\\d\\.\\d).*', changes_fi... | python | chosen |
[
{
"from": "system",
"value": "Fix the file url for Django 1.6\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns, url\nfrom django.contrib import admin\nfrom ckeditor import views\n\nurlpatterns = patterns(\n '',\n url(r'^upload/', admin.site.admin_view(views... | python | chosen |
[
{
"from": "system",
"value": "Add function to create a seat category test fixture\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\ntestfixtures.seating\n~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2016 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in offer manager with new datetimes\n"
},
{
"from": "human",
"value": "from django.utils.timezone import now\n\nfrom django.db import models\n\n\nclass ActiveOfferManager(models.Manager):\n \"\"\"\n For searching/creating offers within their date range... | python | chosen |
[
{
"from": "system",
"value": "Add support for searching subject\n"
},
{
"from": "human",
"value": "import datetime\n# TODO - Validate query arguments\n\n\nIMAP_MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\n \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n\... | python | chosen |
[
{
"from": "system",
"value": "Enforce that arguments must implement non-zero methods."
},
{
"from": "human",
"value": "import unittest\nfrom mock import MagicMock, Mock\nfrom nose.tools import *\nfrom gargoyle.inputs.arguments import *\n\n\nclass BaseArgument(object):\n\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "tests/normalize: Test that direction is preserved\n"
},
{
"from": "human",
"value": "from hypothesis import assume, given\n\nfrom utils import isclose, vectors\n\n\n@given(v=vectors())\ndef test_normalize_length(v):\n \"\"\"v.normalize().length == 1 and v == v.le... | python | chosen |
[
{
"from": "system",
"value": "Improve formatting for NoIdItem in ResultSet tests\n\n"
},
{
"from": "human",
"value": "from .config import TweepyTestCase\n\nfrom tweepy.models import ResultSet\n\nclass NoIdItem: pass\n\nclass IdItem:\n def __init__(self, id):\n self.id = id\n\nids_fixtu... | python | chosen |
[
{
"from": "system",
"value": "Update the docs on twimport and imwiki to indicate that imwiki is deprecated.\n"
},
{
"from": "human",
"value": "\"\"\"\nTiddlyWebWiki-specific twanager commands\n\"\"\"\n\nfrom tiddlyweb.store import Store\nfrom tiddlyweb.manage import make_command, usage\n\nfrom t... | python | chosen |
[
{
"from": "system",
"value": "Bug: Make fullmatch work on python 2.7.\n"
},
{
"from": "human",
"value": "try:\n from io import StringIO\nexcept ImportError:\n from StringIO import StringIO\n\ntry:\n from contextlib import redirect_stdout\nexcept ImportError:\n import sys\n import ... | python | chosen |
[
{
"from": "system",
"value": "Allow local development without running webpack\n"
},
{
"from": "human",
"value": "from .settings import *\n\nDEBUG = True\nSECRET_KEY = 42\n\nINTERNAL_IPS = ['127.0.0.1']\nCSRF_COOKIE_SECURE = False\nSESSION_COOKIE_SECURE = False\n\nDATABASES = {\n 'default': {\... | python | chosen |
[
{
"from": "system",
"value": "Create BaseClipboardForm for easy extending if needed"
},
{
"from": "human",
"value": "from django import forms\n\nfrom .models import Clipboard\n\n\nclass ClipboardFileForm(forms.ModelForm):\n class Meta:\n model = Clipboard\n fields = ('file',)\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove wrong migration of contracts.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\r\n##############################################################################\r\n#\r\n# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)\r\n# Relea... | python | chosen |
[
{
"from": "system",
"value": "Fix Function RichTextFormField now received a new parameter max_lenght for django 1.7\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django import forms\n\nfrom ckeditor.widgets import CKEditorWidget\n\n\nclass RichTextField(models.TextField):... | python | chosen |
[
{
"from": "system",
"value": "Remove the -p command-line option.\n\nIt's pretty useless anyway. Use instead.\n"
},
{
"from": "human",
"value": "import sys\nimport argparse\n\nfrom . import parse\nfrom . import compile\nfrom . import runtime\nfrom .interactive import Interactive\n\n\nclass Inter... | python | chosen |
[
{
"from": "system",
"value": "Add support for multiple users, format types\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport argparse\n\nfrom githublist.parser import main as get_data\nfrom githublist.serve import serve_content\n\nparser = argparse.ArgumentParser(description='Vi... | python | chosen |
[
{
"from": "system",
"value": "Make use of a register decorator\n"
},
{
"from": "human",
"value": "import asyncio\n\nfrom waterbutler import settings\n\n\n@asyncio.coroutine\ndef fetch_rest_identity(params):\n response = yield from aiohttp.request(\n 'get',\n settings.IDENTITY_AP... | python | chosen |
[
{
"from": "system",
"value": "Order facets and add sub facet feature\n"
},
{
"from": "human",
"value": "\"\"\"\nProject: META-SHARE prototype implementation\n Author: Christian Spurk <cspurk@dfki.de>\n\"\"\"\nfrom haystack.exceptions import SearchFieldError\nfrom haystack.indexes import SearchFi... | python | chosen |
[
{
"from": "system",
"value": "Read and fix Sparser jsons\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function, unicode_literals\nfrom builtins import dict, str\nimport os\nimport glob\nfrom indra import sparser\n\nbase_folder = 'sources/sparser-20170330'\nsen... | python | chosen |
[
{
"from": "system",
"value": "Fix string resolution for filesystem\n"
},
{
"from": "human",
"value": "import angr\nimport logging\n\nl = logging.getLogger(name=__name__)\n\nclass getcwd(angr.SimProcedure):\n def run(self, buf, size):\n cwd = self.state.fs.cwd\n size = self.state... | python | chosen |
[
{
"from": "system",
"value": "Make sure the module space won't be polluted by \"from grpc import aio\"\n"
},
{
"from": "human",
"value": "# Copyright 2019 The gRPC Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance w... | python | chosen |
[
{
"from": "system",
"value": "Check that update script is successful\n"
},
{
"from": "human",
"value": "import os\r\nimport subprocess\r\n\r\nif __name__ == '__main__':\r\n os.chdir('microdrop/plugins')\r\n \r\n if not os.path.exists('dmf_control_board'):\r\n print 'Clone dmf_con... | python | chosen |
[
{
"from": "system",
"value": "Change xrange to range for forward-competability\n"
},
{
"from": "human",
"value": "def batch_iterator(iterable, batch_size):\n iterator = iter(iterable)\n iteration_stopped = False\n\n while True:\n batch = []\n for _ in xrange(batch_size):\n... | python | chosen |
[
{
"from": "system",
"value": "Remove colors from REPL prompt\n\nThey weren't playing nice with Readline.\n\nThere's still an optional dependency on Blessings, but that is only\nused to strip away the trailing ps2.\n"
},
{
"from": "human",
"value": "from . import *\n\nimport readline\n\nps1 = '\\... | python | chosen |
[
{
"from": "system",
"value": "Drop Installpath controller, whilst it's single option.\n"
},
{
"from": "human",
"value": "# Copyright 2015 Canonical, Ltd.\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n... | python | chosen |
[
{
"from": "system",
"value": "Increase the frequency of the sensing checks (important for the color sensor/simple line following.\n"
},
{
"from": "human",
"value": "import threading\nimport time\n\nclass SensorThread(object):\n\n def __init__(self, notify, delay=0):\n self.notify = not... | python | chosen |
[
{
"from": "system",
"value": "Print list of concepts per area\n"
},
{
"from": "human",
"value": "import csv\n\n\ndef area(entry):\n if entry[\" UsageType\"].startswith(\"EUC1-\"):\n return \"EU (Frankfurt)\"\n\n\nif __name__ == \"__main__\":\n usage = []\n\n with open(\"tests/fix... | python | chosen |
[
{
"from": "system",
"value": "Make sure user is in room's user list before removing\n"
},
{
"from": "human",
"value": "class ChatRoom:\n\n def __init__(self, name, user):\n self.name = name\n self.users = [user]\n\n def add_user(self, user):\n self.users.apend(user... | python | chosen |
[
{
"from": "system",
"value": "Add ioloop fixture that works with tornado 5\n"
},
{
"from": "human",
"value": "\"\"\"Py.Test fixtures\"\"\"\n\nfrom tornado.httpclient import AsyncHTTPClient\nfrom pytest import fixture\n\nfrom .mocks import MockAsyncHTTPClient\n\n@fixture\ndef client(io_loop, requ... | python | chosen |
[
{
"from": "system",
"value": "Add method on DataPoint to get numpy matrices with all the ML data\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass DataPoint(models.Model):\n name = models.CharField(max_length=600)\n exact_name = models.CharField(max_length=1000, nu... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Move code outside of exception\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# See README file for full copyright and licensing details.\n\nimport time\nfrom openerp import models, api\nfrom openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix unit test python3 compatibility.\n"
},
{
"from": "human",
"value": "import base64\nimport os\nfrom distutils.core import Command\n\n\nclass TestCommand(Command):\n description = \"Launch all tests under fusion_tables app\"\n user_options = []\n\n def in... | python | chosen |
[
{
"from": "system",
"value": "Add version to API URL\n"
},
{
"from": "human",
"value": "\"\"\"fantasyStocks 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:\nFunction views\n... | python | chosen |
[
{
"from": "system",
"value": "Add a few more builtins\n\n - print $obj without newline\n - input\n - input with prompt $prompt\n"
},
{
"from": "human",
"value": "import object as obj\nimport ast\nfrom evaluator import NULL, TRUE, FALSE\n\n\nclass Builtin(object):\n builtins = []\n \n \"... | python | chosen |
[
{
"from": "system",
"value": "Fix translations for homepage stats\n"
},
{
"from": "human",
"value": "from rest_framework import generics, response\n\nfrom .models import HomePage\nfrom .serializers import HomePageSerializer\n\n\n# Instead of serving all the objects separately we combine Slide, Q... | python | chosen |
[
{
"from": "system",
"value": "Increment patch version to 0.7.3\n"
},
{
"from": "human",
"value": "\"\"\"yolk.\n\nAuthor: Rob Cakebread <cakebread at gmail>\n\nLicense : BSD\n\n\"\"\"\n\n__version__ = '0.7.2'\n"
},
{
"from": "gpt",
"value": "\"\"\"yolk.\n\nAuthor: Rob Cakebread <cake... | python | chosen |
[
{
"from": "system",
"value": "Fix string formatting to work with python 2.6.\n"
},
{
"from": "human",
"value": "from winrm.protocol import Protocol\n\n\nclass Response(object):\n \"\"\"Response from a remote command execution\"\"\"\n def __init__(self, args):\n self.std_out, self.st... | python | chosen |
[
{
"from": "system",
"value": "Update the example script to work with python3.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport pytaf\n\ntaf_str = \"\"\"\nTAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001 \n TEMPO 2914/2915 1SM -BR CLR\n FM291500 04006KT P6SM SKC\n ... | python | chosen |
[
{
"from": "system",
"value": "Add test store unicode object\n"
},
{
"from": "human",
"value": "from .base import IntegrationTest, AsyncUnitTestCase\n\n\nclass BasicKVTests(IntegrationTest, AsyncUnitTestCase):\n def test_no_returnbody(self):\n async def go():\n bucket = self.... | python | chosen |
[
{
"from": "system",
"value": "Add a test for list comprehensions with more than two ifs\n"
},
{
"from": "human",
"value": "from ..utils import TranspileTestCase\n\n\nclass ListComprehensionTests(TranspileTestCase):\n def test_syntax(self):\n self.assertCodeExecution(\"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove unittest and mock for now\n"
},
{
"from": "human",
"value": "import mock\nimport unittest\nfrom django.test import TestCase\n\nfrom datetime import datetime, timedelta\n\nfrom notifications.models import District, DistrictExceptions, Municipality\n\nclass Dis... | python | chosen |
[
{
"from": "system",
"value": "Fix true test, add false test\n"
},
{
"from": "human",
"value": "class TestEnumberable(object):\n def test_inject(self, ec):\n w_res = ec.space.execute(ec, \"\"\"\n return (5..10).inject(1) do |prod, n|\n prod * n\n end\n \"... | python | chosen |
[
{
"from": "system",
"value": "Remove callback from join_on_invite during close()\n"
},
{
"from": "human",
"value": "class InviteJoinPlugin(object):\n def __init__(self, cardinal):\n cardinal.event_manager.register_callback(\"irc.invite\", self.join_channel)\n\n def join_channel(self... | python | chosen |
[
{
"from": "system",
"value": "Check that input to port is an integer\n"
},
{
"from": "human",
"value": "def parse(s):\n try:\n return Port(int(s))\n except ValueError:\n if s == \"all\":\n return Port(None)\n else:\n start, _, end = s.partition('-... | python | chosen |
[
{
"from": "system",
"value": "Switch to looking for separate solutions files\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\n\nimport json\nimport os\nimport re\n\ndef main():\n session_cells = {n: [] for n in range(1, 6+1)}\n f = open(os.path.dirname(__file__) + '/../All.ipyn... | python | chosen |
[
{
"from": "system",
"value": "Add a bit more info about rational surfaces\n"
},
{
"from": "human",
"value": "import sqlite3\nconn = sqlite3.connect('surfaces.db')\nc = conn.cursor()\nc.execute('''CREATE TABLE bibliography (\nkdim INT,\npg INT, \nq INT,\nK2 INT,\nchi INT,\ne INT,\nh11 ... | python | chosen |
[
{
"from": "system",
"value": "Integrate listener and irc parts\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nimport asyncore\nimport logging\n\nfrom irc import Bot\n\nlogging.basicConfig(level=logging.DEBUG, format=\"%(asctime)s - %(message)s\")\n\nbot = Bot('localhost')\n\... | python | chosen |
[
{
"from": "system",
"value": "Speed up for a while\n"
},
{
"from": "human",
"value": "import os\nimport time\nfrom crawl import crawl\n\nimport tweepy\n\nclass TwitterAPI:\n \"\"\"\n Class for accessing the Twitter API.\n\n Requires API credentials to be available in environment\n va... | python | chosen |
[
{
"from": "system",
"value": "Fix critical error on ReduceMixin\n"
},
{
"from": "human",
"value": "from .forms import ReduceMixinForm\n\n__all__ = ['ReduceMixin']\n\n\"\"\"\nMutation mixin to work with form applying the ReduceMixinForm\n\"\"\"\n\n\nclass ReduceMixin(object):\n def get_form_kw... | python | chosen |
[
{
"from": "system",
"value": "Use update instead of setting key directly\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\n\nclass Registry(object):\n \n def __init__(self):\n self._partitions = {}\n \n def register(self, key, app_model, expression):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove comments as part of lexing\n"
},
{
"from": "human",
"value": "# This is the lexer. We could build a state machine which would parse\n# each token character by character, but the point of this project is to\n# be as simple as possible, so we will literally jus... | python | chosen |
[
{
"from": "system",
"value": "Generalize fixer for old->new-style classes to accept \"class C():\"\n"
},
{
"from": "human",
"value": "u\"\"\"\nFixer for \"class Foo: ...\" -> \"class Foo(object): ...\"\n\"\"\"\n\nfrom lib2to3 import fixer_base\nfrom lib2to3.fixer_util import LParen, RParen, Name... | python | chosen |
[
{
"from": "system",
"value": "Remove _name attribute on hr.employee\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# © 2011 Michael Telahun Makonnen <mmakonnen@gmail.com>\n# © 2016 OpenSynergy Indonesia\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nfrom op... | python | chosen |
[
{
"from": "system",
"value": "Fix order of imports to comply with isort\n"
},
{
"from": "human",
"value": "from flask import Blueprint, abort, jsonify, request\nfrom flask.ext.mail import Message\n\nfrom kuulemma.extensions import db, mail\nfrom kuulemma.models import Feedback\nfrom kuulemma.set... | python | chosen |
[
{
"from": "system",
"value": "Add emails to auth details\n"
},
{
"from": "human",
"value": "from flask import session\n\nfrom zeus import auth\nfrom zeus.models import Identity, User\n\nfrom .base import Resource\nfrom ..schemas import IdentitySchema, UserSchema\n\nuser_schema = UserSchema(stric... | python | chosen |
[
{
"from": "system",
"value": "Use .set() rather than direct assignment"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand, CommandError\n\nfrom judge.models import Language\n\n\nclass Command(BaseCommand):\n help = 'allows the problems allowed to be submitted... | python | chosen |
[
{
"from": "system",
"value": "Complete e-mail, Graphite and push notification support\n"
},
{
"from": "human",
"value": "import config\n\ndef sendMail():\n print config.config\n print \"Sent e-mail\"\n\ndef sendToGrapite():\n pass\n"
},
{
"from": "gpt",
"value": "from config... | python | chosen |
[
{
"from": "system",
"value": "Update example for bank account debits for confirm()\n"
},
{
"from": "human",
"value": "'''\nLearn how to verify a bank account so you can debit with it.\n'''\nfrom __future__ import unicode_literals\n\nimport balanced\n\n\ndef init():\n key = balanced.APIKey().s... | python | chosen |
[
{
"from": "system",
"value": "Update scripts to reflect new MOOSE_DIR definition\n\nr25009\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys, os\n\n# get the location of this script\napp_path = os.path.abspath(os.path.dirname(sys.argv[0]))\n# this script is actually in the scr... | python | chosen |
[
{
"from": "system",
"value": "Change structure of the redirect\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.contrib.auth.forms import UserCreationForm\nfrom django.http import HttpResponseRedirect, HttpResponse\nfrom django.shortcuts import render_to_response\nfrom dj... | python | chosen |
[
{
"from": "system",
"value": "Add directory validation to argument parsing\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Elastic Search Index & Search.\"\"\"\n\nimport argparse\n\n\ndef main():\n \"\"\"Entry point for the esis.py script.\"\"\"\n args = parse_arguments()... | python | chosen |
[
{
"from": "system",
"value": "Set \"notify_email\" in default scope only if settings allow it\n"
},
{
"from": "human",
"value": "\"\"\"The UWUM (Unified WeGovNow User Management) provider.\"\"\"\n\nfrom allauth.socialaccount import app_settings\nfrom allauth.socialaccount.providers import regist... | python | chosen |
[
{
"from": "system",
"value": "Change args to show repl if no FILEs are given.\n"
},
{
"from": "human",
"value": "#!env python\n\n\"\"\"Eche - a simple, lisp like language.\n\nUsage:\n eche FILE ...\n eche (-h | --help)\n eche --version\n\nOptions:\n -h --help Show this screen.\n -... | python | chosen |
[
{
"from": "system",
"value": "Fix typo messsage -> message\n"
},
{
"from": "human",
"value": "from github2.core import BaseData, GithubCommand, Attribute, DateAttribute\n\n\nclass Commit(BaseData):\n messsage = Attribute(\"Commit message.\")\n parents = Attribute(\"List of parents for this... | python | chosen |
[
{
"from": "system",
"value": "Fix for enum type docker_storage_driver\n\nCreate enum type \"docker_storage_driver\" for migration\n\nThis is fixing\n oslo_db.exception.DBError: (psycopg2.ProgrammingError) type\n \"docker_storage_driver\" does not exist\n\nCloses-Bug: #1609776\n\nChange-Id: I92d427e90bd7... | python | chosen |
[
{
"from": "system",
"value": "Add '_updated' property to revisions\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\nimport json\n\nfrom .load_data_from_file import load_data_from_file\nfrom .get_old_dict_values import get_old_dict_values\nfrom .log import log\nfrom .paths ... | python | chosen |
[
{
"from": "system",
"value": "Integrate additional checks of base.py with slight improvements\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport pytest\n\n@pytest.fixture\ndef context():\n return {\n \"project_name\": \"My Test Project\",\n \"repo_name\": \"my_... | python | chosen |
[
{
"from": "system",
"value": "Add partially implemented list option.\n"
},
{
"from": "human",
"value": "\"\"\" A simple CLI tool for quickly copying common emoticon/emoji to your\nclipboard. \"\"\"\nimport pyperclip\nimport json\nimport sys\nimport argparse\n\nwith open(\"mapping.json\") as f:\n... | python | chosen |
[
{
"from": "system",
"value": "Save test results to XML added"
},
{
"from": "human",
"value": "import unittest\nimport requests\nimport lxml.html\n\n\nclass TestHtmlTask(unittest.TestCase):\n def setUp(self):\n self.ulr_google = \"https://www.google.com.ua/\"\n self.url_habr = \"... | python | chosen |
[
{
"from": "system",
"value": "Clarify comment around inclusion of static serving\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.contrib.auth i... | python | chosen |
[
{
"from": "system",
"value": "Use the API as it was intended\n"
},
{
"from": "human",
"value": "import sys\n\nfrom django.conf import settings\n\n\nclass classproperty(property):\n \"\"\"\n Use it to decorate a classmethod to make it a \"class property\".\n \"\"\"\n def __get__(self,... | python | chosen |
[
{
"from": "system",
"value": "Mark HTML generated by custom template filter as safe if auto-escaping is enabled.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.util.templatefilters\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nProvide and register custom template filters.\n\n:Cop... | python | chosen |
[
{
"from": "human",
"value": "SYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nimport PIL.Image\n\n# check for JPEG support.\ntry:\n PIL.Image._getdecoder(\"rgb\", \"jpe... | python | chosen |
[
{
"from": "system",
"value": "Use comma in CSV POST.\n"
},
{
"from": "human",
"value": "# (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.\nfrom __future__ import unicode_literals\n\nfrom rest_framework.parsers import BaseParser, DataAndFiles\n\n\nclass SimpleFileUploadParser(BaseParser):... | python | chosen |
[
{
"from": "system",
"value": "Fix bugs with code for multiple gateways"
},
{
"from": "human",
"value": "import socket, struct\nimport scapy.all as scapy\n\ndef get_default_gateway_linux():\n \"\"\"Read the default gateway directly from /proc.\"\"\"\n routes = []\n with open(\"/proc/net/... | python | chosen |
[
{
"from": "system",
"value": "Add default argument when looking up sentry dsn setting\n"
},
{
"from": "human",
"value": "import os\nimport logging\nfrom django.conf import settings\n\nlog = logging.getLogger(__name__)\n\ndef static(request):\n \"Shorthand static URLs. In debug mode, the JavaS... | python | chosen |
[
{
"from": "system",
"value": "Make compatible with freezegun when testing.\n"
},
{
"from": "human",
"value": "import datetime\nfrom decimal import Decimal\n\nfrom django.core.serializers.json import DjangoJSONEncoder\n\nclass TZAwareJSONEncoder(DjangoJSONEncoder):\n def default(self, obj):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add method to find by event and player id\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport uuid\n\nfrom db.common import Base\nfrom db.specific_event import SpecificEvent\n\n\nclass ShotAttempt(Base, SpecificEvent):\n __... | python | chosen |
[
{
"from": "system",
"value": "Disable querystrings if a storage backend with hashed filenames is active\n"
},
{
"from": "human",
"value": "import hashlib\n\nfrom django.conf import settings\nfrom django.templatetags.static import static\n\nfrom wagtail import __version__\n\n\nif getattr(settings... | python | chosen |
[
{
"from": "system",
"value": "Fix version prior to release\n"
},
{
"from": "human",
"value": "\"\"\"\nConstants for the PyOWM library\n\"\"\"\n\nPYOWM_VERSION = '2.2.0'\nLATEST_OWM_API_VERSION = '2.5'\n"
},
{
"from": "gpt",
"value": "\"\"\"\nConstants for the PyOWM library\n\"\"\"\n\... | python | chosen |
[
{
"from": "human",
"value": "Create method that retrieves coursefinder URLS\n"
},
{
"from": "gpt",
"value": "import requests\nimport http.cookiejar\nimport time\n\ndef get_raw_data():\n url = 'http://coursefinder.utoronto.ca/course-search/search/courseSearch/course/search'\n data = {\n ... | python | chosen |
[
{
"from": "system",
"value": "Make URLField compatible with Django 1.4 and remove verify_exists attribute\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom tagging.forms import TagField\n\nfrom bookmarks.models import Boo... | python | chosen |
[
{
"from": "system",
"value": "Make createDb and createUser idempotent.\n"
},
{
"from": "human",
"value": "from fabric.api import sudo\nfrom braid import package\n\n\ndef install():\n package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])\n\n\ndef createUser(name):\n sudo('createu... | python | chosen |
[
{
"from": "system",
"value": "Read the file content, if it is not read when the request is multipart then the client get an error\n"
},
{
"from": "human",
"value": "\"\"\"\n@author: Ferdinand E. Silva\n@email: ferdinandsilva@ferdinandsilva.com\n@website: http://ferdinandsilva.com\n\"\"\"\nimport... | python | chosen |
[
{
"from": "system",
"value": "Allow JXAAS_URL to be configured as an env var\n"
},
{
"from": "human",
"value": "import logging\n\nfrom cliff.command import Command\n\nimport jujuxaas.client\n\ndef get_jxaas_client(command):\n tenant = 'abcdef'\n username = '123'\n password= '123'\n\n client ... | python | chosen |
[
{
"from": "system",
"value": "Revert default webdriver to Firefox\n\nChrome doesn't yet work, anyway... :-(\n"
},
{
"from": "human",
"value": "from threading import RLock, local\nfrom multiprocessing.pool import ThreadPool\nfrom os import environ as ENV\nimport logging.config\n\nfrom flask impor... | python | chosen |
[
{
"from": "system",
"value": "Reorder keys that were being declared in the wrong place\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nThis thorium state is used to track the status beacon events and keep track of\nthe active status of minions\n\n.. versionadded:: 2016.11.0\n'''... | python | chosen |
[
{
"from": "system",
"value": "Increase key length for larger datasets."
},
{
"from": "human",
"value": "import numpy as np\n\nimport constants\n\ndef mean_normalize(entry):\n \"\"\"\n Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with\n two side by sid... | python | chosen |
[
{
"from": "system",
"value": "Use raw command method to run all commands in wrapper\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport subprocess\n\n\nclass SessionExists(Exception):\n description = \"Session already exists.\"\n pass\n\n\nclass ServerConnectionError(Excep... | python | chosen |
[
{
"from": "system",
"value": "Remove this line - it is redundant and missing code coverage.\n"
},
{
"from": "human",
"value": "class OverflowDate(object):\n def __init__(self, **info):\n self.info = info\n\n def isocalendar(self):\n if 'isocalendar' in self.info:\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix installation version info type\n"
},
{
"from": "human",
"value": "import contextlib\nimport itertools\nimport os\nimport pathlib\nimport re\nimport subprocess\n\nimport attr\n\n\n@attr.s\nclass Installation:\n\n path = attr.ib(convert=pathlib.Path)\n\n @pr... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.