conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Rename email_user method to send_email and fix parameters\n"
},
{
"from": "human",
"value": "import logging\n\nfrom django.core import mail\n\nfrom .tasks import task_email_user\n\nlogger = logging.getLogger(__name__)\n\n\ndef email_user(user, template, context, att... | python | chosen |
[
{
"from": "system",
"value": "Use the app string version of foreign keying. It prevents a circular import.\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Activity(models.Model):\n group = models.CharField(max_length=4)\n grouptype = models.TextField()\n groupde... | python | chosen |
[
{
"from": "system",
"value": "Modify parent filter to return variants and self\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.contrib.admin import SimpleListFilter\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Use local memory as cache so ratelimit tests don't fail\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nimport os\n\nos.environ['INBOX_TESTING'] = '1'\nfrom settings import *\n\nCACHES = {\n \"default\": {\n \"BACKEND\": \"django... | python | chosen |
[
{
"from": "system",
"value": "Add missing container callbacks with debug log statements\n"
},
{
"from": "human",
"value": "import logging\n\nfrom spotify.manager import SpotifyContainerManager as \\\n PyspotifyContainerManager\n\nlogger = logging.getLogger('mopidy.backends.spotify.container_m... | python | chosen |
[
{
"from": "system",
"value": "Rename the 'line_ending' argument to 'line_endings'. Breaking change.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom decimal import Decimal\n\n\nclass FixedWidthWriter():\n\n def __init__(self, fd, fields, line_ending='linux'):\n self.fd = fd\n ... | python | chosen |
[
{
"from": "system",
"value": "Add tests for CSV and XLS reporting\n\nCSV export currently fails due to epubcheck passing the delimiting\ncharacter as bytes although Tablib expects it to be of type str.\nThe issue will not be fixed as Python 2 has reached end of life [1].\n\n[1] https://github.com/jazzband/t... | python | chosen |
[
{
"from": "system",
"value": "Make it possible to eval() output instead of execing another shell.\n"
},
{
"from": "human",
"value": "import argparse\n\nfrom awscli.customizations.commands import BasicCommand\n\nimport os\n\ndef awscli_initialize(event_hooks):\n event_hooks.register('building-... | python | chosen |
[
{
"from": "system",
"value": "Remove commented-out reference to v1\n\nSigned-off-by: Nicholas Rempel <b7f0f2181f2dc324d159332b253a82a715a40706@gmail.com>\n"
},
{
"from": "human",
"value": "\"\"\"\nDefinition of urls for tob_api.\n\"\"\"\n\nfrom django.conf.urls import include, url\nfrom django.v... | python | chosen |
[
{
"from": "system",
"value": "Print HTTP content in verbose mode\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"Python implementation of the Readability Shortener API\"\"\"\n\nimport requests\ntry:\n import simplejson as json\nexcept ImportError:\n import json\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": ":speech_balloon: Make members verbose name translatable\n"
},
{
"from": "human",
"value": "from django.apps import AppConfig\n\n\nclass MembersConfig(AppConfig):\n name = 'members'\n verbose_name = 'UTN Member Management'\n"
},
{
"from": "gpt",
"va... | python | chosen |
[
{
"from": "system",
"value": "Add a constant for WB root URL\n"
},
{
"from": "human",
"value": "\"\"\"\nSimple Python 3-safe package for accessing Wayback Machine archives\nvia its JSON API\n\"\"\"\n\nimport datetime\nimport requests\n\nFORMAT_STRING = \"%Y%m%d%H%M%S\" # Looks like \"2013091904... | python | chosen |
[
{
"from": "system",
"value": "Add email and API template"
},
{
"from": "human",
"value": "# Enter the password of the email address you intend to send emails from\npassword = \"\""
},
{
"from": "gpt",
"value": "# Enter the password of the email address you intend to send emails from\... | python | chosen |
[
{
"from": "system",
"value": "Add test for default values.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport knot\n\n\nclass TestContainer(unittest.TestCase):\n def test_wrapper_looks_like_service(self):\n c = knot.Container()\... | python | chosen |
[
{
"from": "system",
"value": "Use a single string for the author\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n dsmtpd\n ~~~~~~\n\n :copyright: (c) 2013 by Stephane Wirtel <stephane@wirtel.be>\n :license: BSD, see LICENSE for more details\n\"\"\"\n__name__ = \"d... | python | chosen |
[
{
"from": "system",
"value": "Include einsum in main library\n"
},
{
"from": "human",
"value": "__author__ = 'Alex Rogozhnikov'\n__version__ = '0.4.1'\n\n\nclass EinopsError(RuntimeError):\n \"\"\" Runtime error thrown by einops \"\"\"\n pass\n\n\n__all__ = ['rearrange', 'reduce', 'repeat'... | python | chosen |
[
{
"from": "human",
"value": "Make jokes and functions available globally in the module\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import\nfrom .pyjokes import get_local_joke\nfrom .chuck import get_chuck_nerd_joke\nfrom .jokes import jokes\n\n\n__version__ = '0.1.1'\n"
}
... | python | chosen |
[
{
"from": "system",
"value": "Bump version to 1.9.22.1 and depend on the CloudStorageClient 1.9.22.1\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Setup specs for packaging, distributing, and installing Pipeline lib.\"\"\"\n\nimport setuptools\n\n# To debug, set DISTUTILS_DEBUG... | python | chosen |
[
{
"from": "system",
"value": "Load sign in page and collect password.\n"
},
{
"from": "human",
"value": "\"\"\"\nInterface for web scraping\n\"\"\"\nimport os\nimport sys\n\nfrom selenium import webdriver\n\ndef scrape():\n browser = webdriver.Chrome('/home/lowercase/Desktop/scheduler/chromed... | python | chosen |
[
{
"from": "system",
"value": "Remove optional lock input (I can't see when it would be useful)\nDocument when Listener should be used\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nimport rospy\nfrom threading import Lock\n\n\nclass Listener:\n def __init__(self, topic_name, top... | python | chosen |
[
{
"from": "system",
"value": "Check for existing Last.fm creds before scrobbling\n"
},
{
"from": "human",
"value": "import os, sys, json, pylast, calendar\nfrom datetime import datetime\n\nresultJson = json.loads(sys.stdin.read())\n# exit immediately if recognition failed\nif resultJson[\"status... | python | chosen |
[
{
"from": "system",
"value": "Revert to having static version numbers again.\n"
},
{
"from": "human",
"value": "\"\"\"distutils\n\nThe main package for the Python Module Distribution Utilities. Normally\nused from a setup script as\n\n from distutils.core import setup\n\n setup (...)\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Correct bug with metadata ref\n"
},
{
"from": "human",
"value": "import urllib\n\nfrom playa import app\n\n@app.template_filter('duration')\ndef duration(seconds):\n return '%s:%s' % (int(seconds / 60), ('0' + str(int(seconds % 60)))[-2:])\n\n@app.template_filter... | python | chosen |
[
{
"from": "system",
"value": "Update GLOBAL_EXCLUDE_FUNC default to exclude admins\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# models definitions for request_profiler\nfrom django.conf import settings\n\n# cache key used to store enabled rulesets.\nRULESET_CACHE_KEY = getattr(s... | python | chosen |
[
{
"from": "system",
"value": "Make it possible to extend common completions\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport completor\nimport itertools\nimport re\n\nfrom completor.compat import text_type\n\nfrom .filename import Filename # noqa\nfrom .buffer import Buffer ... | python | chosen |
[
{
"from": "system",
"value": "Modify exception_handler for a string error like AuthenticationError\n"
},
{
"from": "human",
"value": "from django.utils import encoding\nfrom django.utils.translation import ugettext_lazy as _\nfrom rest_framework import status\nfrom rest_framework.exceptions impo... | python | chosen |
[
{
"from": "system",
"value": "Move register code to User class\n"
},
{
"from": "human",
"value": "from flask import Flask, jsonify, request\nfrom modals.modals import User\nfrom api import create_app, db\nfrom validate_email import validate_email\n\napp = create_app('DevelopmentEnv')\n\n\n@app.r... | python | chosen |
[
{
"from": "system",
"value": "Add callback to url_callbacks so url module doesn't query it\n"
},
{
"from": "human",
"value": "from willie import web\nfrom willie import module\nimport time\nimport json\n\nimport urllib\n\n@module.rule('.*(play.spotify.com\\/track\\/)([\\w-]+).*')\ndef spotify(bo... | python | chosen |
[
{
"from": "system",
"value": "Remove some code that wasn't in use anymore.\n"
},
{
"from": "human",
"value": "import pkg_resources\n\nENTRY_POINT = 'fanstatic.libraries'\n\nclass LibraryRegistry(dict):\n \"\"\"A dictionary-like registry of libraries.\n\n This is a dictionary that mains lib... | python | chosen |
[
{
"from": "system",
"value": "Use bare WSGI application for testing and benchmarking\n"
},
{
"from": "human",
"value": "import guv\n\nguv.monkey_patch()\nimport json\n\nimport bottle\n\nimport guv.wsgi\nimport logger\n\nlogger.configure()\n\napp = bottle.Bottle()\n\n\n@app.route('/')\ndef index(... | python | chosen |
[
{
"from": "system",
"value": "Test of invalid equality test\n"
},
{
"from": "human",
"value": "\"\"\"Various tests of type safety.\"\"\"\nimport unittest\n\nfrom raco.fakedb import FakeDatabase\nfrom raco.scheme import Scheme\nfrom raco.myrial.myrial_test import MyrialTestCase\nfrom collections ... | python | chosen |
[
{
"from": "system",
"value": "Add input parameters and test function\n\nAdded input parameters at time of instantiation.\r\n\r\nRef #23"
},
{
"from": "human",
"value": "\"\"\"Creates the station class\"\"\"\n\n\nclass Station:\n \"\"\"\n Each train station is an instance of the Station cla... | python | chosen |
[
{
"from": "system",
"value": "Add an option to force recomputing of image dimensions.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nsys.path.insert(0, \"/usr/local/opencv-2.4.11/lib/python2.7/site-packages/\")\n\nimport argparse\nimport commands\nimport cv2\nimport fnmatch\... | python | chosen |
[
{
"from": "system",
"value": "Update dsub version to 0.4.1.\n\nPiperOrigin-RevId: 328637531\n"
},
{
"from": "human",
"value": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complian... | python | chosen |
[
{
"from": "system",
"value": "Test math and cmath module.\n"
},
{
"from": "human",
"value": "print 2**3\nprint pow(2,3)\nprint abs(-10)\nprint round(1.536,2)\nprint 1/2\nprint 1.0//2.0\nprint 0xAF\nprint 010\n"
},
{
"from": "gpt",
"value": "print 2**3\nprint pow(2,3)\nprint abs(-10)\... | python | chosen |
[
{
"from": "system",
"value": "Fix KeyboardInterrupt exception filtering.\nAdd exception information and not just the stack trace.\nMake the url easier to change at runtime.\n\nReview URL: http://codereview.chromium.org/2109001\n\ngit-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@47179 4ff67af0-8c30-449e-... | python | chosen |
[
{
"from": "system",
"value": "Fix crash if view returns no valid path\n"
},
{
"from": "human",
"value": "import os\nimport re\n\n_findBackslash = re.compile(\"/\") \n\n# http://rosettacode.org/wiki/Find_common_directory_path#Python\ndef __commonprefix(*args, sep='/'):\n return os.path.commonpr... | python | chosen |
[
{
"from": "system",
"value": "Add install command (import from ARCTasks)\n\nBecause `run install -u` is so much easier to type than\n`pip install -U -r requirements.txt`.\n"
},
{
"from": "human",
"value": "from runcommands.commands import show_config # noqa: F401\n\nfrom arctasks.base import li... | python | chosen |
[
{
"from": "system",
"value": "Make the ratelimited error URL follow established conventions.\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.core.urlresolvers import reverse_lazy\n\nfrom MyInfo import views as my_info_views\nfrom django_cas imp... | python | chosen |
[
{
"from": "system",
"value": "Complete find_min_max_dc() with divide and conquer method\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\ndef find_min_max_naive(a_ls):\n \"\"\"Find mix & max in ... | python | chosen |
[
{
"from": "system",
"value": "Add support for multi-way pots.\n"
},
{
"from": "human",
"value": "# usage: python one_time_eval.py as8sqdtc\n# usage: python one_time_eval.py as8sqdtc 2skskd\n\nfrom convenience import find_pcts, pr, str2cards\nimport sys\n\n## argv to strings\nhole_cards_str = sys... | python | chosen |
[
{
"from": "system",
"value": "Add back the stable_build variable which is needed in the _revert_settings() function. Woops.\n"
},
{
"from": "human",
"value": "from fabric.api import *\nfrom fabric.contrib.files import sed\nimport random\nimport string\nimport time\n# Custom Code Enigma modules\n... | python | chosen |
[
{
"from": "system",
"value": "Update the Edge example test\n"
},
{
"from": "human",
"value": "\"\"\"\nThis test is only for Microsoft Edge (Chromium)!\n\"\"\"\nfrom seleniumbase import BaseCase\n\n\nclass EdgeTests(BaseCase):\n\n def test_edge(self):\n if self.browser != \"edge\":\n ... | python | chosen |
[
{
"from": "system",
"value": "Use sys.executable when invoking python interpreter from tests\n\nWhen we only have python3 installed, the test for missing argument is\nfailing because there is no \"python\" executable. Use `sys.executable`\ninstead. Also set environment correctly, like done in 7024d3b36176.\... | python | chosen |
[
{
"from": "system",
"value": "Fix spelling mistake in path for certificates\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport datetime\nfrom subprocess import call\n\nfrom ca import app, db, mail\nfrom ca.models import Request\n\nfrom flask import Flask,... | python | chosen |
[
{
"from": "system",
"value": "parse(): Allow passing a string since we're just going to .read() the FH\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport re\nimport datetime\nfrom collections import namedtuple\n\nSUBTITLE_REGEX = re.compile(r'''\\\n(\\d+)\n(\\d+:\\d+:\\d+,\\d+) -... | python | chosen |
[
{
"from": "system",
"value": "Disable IppetPowerMonitorTest.testFindOrInstallIppet which is failing on new trybots.\n\nBUG=424027\nTBR=dtu@chromium.org\n\nReview URL: https://codereview.chromium.org/643763005\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#299833}\n"
},
{
"from": "... | python | chosen |
[
{
"from": "system",
"value": "Hide Game ID input since it is automatically set\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django import forms\nfrom django.core.exceptions import NON_FIELD_ERRORS\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom core import mo... | python | chosen |
[
{
"from": "system",
"value": "Split ElasticsearchInterface into ElasticsearchInterface1 and ElasticsearchInterface2\n"
},
{
"from": "human",
"value": "class ElasticsearchInterface(object):\n def __init__(self, es):\n self.es = es\n\n def update_index_settings(self, index, settings_d... | python | chosen |
[
{
"from": "system",
"value": "Reduce chunk lock timeout for testing\n"
},
{
"from": "human",
"value": "config = {\n \"CREATE_RETRIES\": 5,\n \"CHUNK_LOCK_TIMEOUT_SECONDS\": 30\n}\n"
},
{
"from": "gpt",
"value": "config = {\n \"CREATE_RETRIES\": 5,\n \"CHUNK_LOCK_TIMEOUT_S... | python | chosen |
[
{
"from": "system",
"value": "Use the nature theme as it's nicer on our logo\n"
},
{
"from": "human",
"value": "project = 'django-bcrypt'\nversion = ''\nrelease = ''\ncopyright = '2010, 2011 UUMC Ltd.'\n\nhtml_logo = 'playfire.png'\nextensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']\n... | python | chosen |
[
{
"from": "system",
"value": "Fix error if anonymous user is logged in, instead redirect to login page\n"
},
{
"from": "human",
"value": "from flask import Blueprint, request, url_for, render_template\nfrom flask.ext.security import current_user\n\nplay = Blueprint('play', __name__, template_fol... | python | chosen |
[
{
"from": "system",
"value": "Add groups key in response to zotero/settings.\n"
},
{
"from": "human",
"value": "from addons.base.serializer import CitationsAddonSerializer\n\nclass ZoteroSerializer(CitationsAddonSerializer):\n addon_short_name = 'zotero'\n\n @property\n def serialized_n... | python | chosen |
[
{
"from": "system",
"value": "tests: Fix a check for specific formatting of an error message\n\nInstead of checking for the specific formatting of pytest's wrapper\naround an exception, check the error message with `ExceptionInfo.match`.\nThis improves compatibility with different versions of pytest.\n"
}... | python | chosen |
[
{
"from": "system",
"value": "Change to work with django 1.7\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\n\nfrom notification.views import notices, mark_all_seen, feed_for_user, single, notice_settings\n\n\nurlpatterns = patterns(\"\",\n url(r\"^$\", notices, na... | python | chosen |
[
{
"from": "system",
"value": "Add clearing if not recording and remove useless member\n"
},
{
"from": "human",
"value": "import configparser\nimport time\nimport RPi.GPIO as GPIO\n\nfrom client import MumbleClient\n\nclass InterCom:\n\n def __init__(self):\n config = configparser.Confi... | python | chosen |
[
{
"from": "system",
"value": "Fix saving passwords in Register API\n\noverride the create method in UserSerializer and set password there\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\nfrom django.contrib.auth.models import User\nfrom login.models import UserProfile\n... | python | chosen |
[
{
"from": "system",
"value": "Allow all characters for layer title\n"
},
{
"from": "human",
"value": "# This file is part of the GBI project.\n# Copyright (C) 2013 Omniscale GmbH & Co. KG <http://omniscale.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may no... | python | chosen |
[
{
"from": "system",
"value": "Declare imageNames with var, use .format() instead of %, remove tab before closing bracket\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport os\n\nif __name__ == '__main__':\n\tjs_file = open('cropList.js', 'w')\n\tjs_file.write('imageNames = [\\n')\n\tjs... | python | chosen |
[
{
"from": "system",
"value": "Add a has_expired() method to the Timer class.\n"
},
{
"from": "human",
"value": "inf = infinity = float('inf')\n\nclass Timer:\n\n def __init__(self, duration, *callbacks):\n self.duration = duration\n self.callbacks = list(callbacks)\n\n se... | python | chosen |
[
{
"from": "system",
"value": "Set the Theano case name closer to the numpy test name.\n"
},
{
"from": "human",
"value": "# Authors: James Bergstra\n# License: MIT\nimport theano\nimport theano.tensor as TT\n\n\ndef pairwise_theano_tensor_prepare(dtype):\n X = TT.matrix(dtype=str(dtype))\n ... | python | chosen |
[
{
"from": "system",
"value": "Improve StringIterator to allow for more general usage\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# This work was created by participants in the DataONE project, and is\n# jointly copyrighted by participating institutions in DataONE. For\n# more i... | python | chosen |
[
{
"from": "system",
"value": "Add configuration parsing to CLI.\n"
},
{
"from": "human",
"value": "import click\nfrom . import etl\n\n\n@click.command()\n@click.option('--test', default=False)\ndef run(test):\n if not test:\n etl.run_excel_etl()\n else:\n click.echo('Capmetri... | python | chosen |
[
{
"from": "system",
"value": "Update class for 2D bubbles\n"
},
{
"from": "human",
"value": "\nimport numpy as np\n\n\nclass Candidate(object):\n \"\"\"\n Class for candidate bubble portions from 2D planes.\n \"\"\"\n def __init__(self, mask, img_coords):\n super(Candidate, se... | python | chosen |
[
{
"from": "system",
"value": "Add a test that uses the cookiecutter python API\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_create_template\n--------------------\n\"\"\"\n\n\nimport os\nimport pip\nimport pytest\nimport shutil\nimport subprocess\n\nTEMPLATE = os.pat... | python | chosen |
[
{
"from": "system",
"value": "Clean up the error imports\n\nThe new errors that had been added for _intersphinx.py had left\nthe sphobjinv.error import line split. No need, when it all fits on\none line.\n"
},
{
"from": "human",
"value": "r\"\"\"``sphobjinv`` *package definition module*.\n\n``sp... | python | chosen |
[
{
"from": "system",
"value": "Fix eclipse build: “UnicodeDecodeError: 'ascii' codec can't decode byte”\n\nCloses https://github.com/espressif/esp-idf/pull/6505\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Wrapper to run make and preprocess any paths in the output from MSYS Unix... | python | chosen |
[
{
"from": "system",
"value": "Adjust post-user-create receiver to check database state\n\nNeed to avoid situation where this signal gets raised by syncdb and the\ndatabase isn't in the correct state.\n\nFixes #475\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.d... | python | chosen |
[
{
"from": "system",
"value": "Support nested generator inside the realm.\n"
},
{
"from": "human",
"value": "from django.contrib.contenttypes.models import ContentType\nfrom rest_framework import serializers\n\nfrom . import models\n\n\nclass ContentTypeField(serializers.Field):\n def to_repre... | python | chosen |
[
{
"from": "system",
"value": "Fix crash on invalid int\n"
},
{
"from": "human",
"value": "'''\nProvides commands to the xkcd system\n'''\nfrom stickord.helpers.xkcd_api import get_random, get_by_id, print_comic, get_recent\nfrom stickord.registry import Command\n\n@Command('xkcd', category='xkcd... | python | chosen |
[
{
"from": "system",
"value": "Fix test command, esp. wrt. coverage\n"
},
{
"from": "human",
"value": "from runcommands import command\nfrom runcommands.commands import local as _local\n\n\n@command\ndef format_code(check=False):\n _local(f\"black . {'--check' if check else ''}\")\n\n\n@comman... | python | chosen |
[
{
"from": "system",
"value": "Fix for new version of station\n"
},
{
"from": "human",
"value": "import pytest\nimport station\n\n@pytest.fixture(scope='module', params=['local', 'spark'])\ndef eng(request):\n if request.param == 'local':\n return None\n if request.param == 'spark':\... | python | chosen |
[
{
"from": "system",
"value": "Update extensions and GameController subclass\n"
},
{
"from": "human",
"value": "from python_cowbull_game.GameController import GameController\nfrom python_cowbull_game.GameMode import GameMode\n\n\nclass ExtGameController(GameController):\n additional_modes = [\... | python | chosen |
[
{
"from": "system",
"value": "Fix Kickasstorrents by using one of many mirrors.\n"
},
{
"from": "human",
"value": "from providers.popularity.provider import PopularityProvider\nfrom utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches\n\nIDENTIFIER = \"kickasstorrents\"\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Use auto generated celery queues\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Asynchronous task queue module.\"\"\"\n\nfrom celery import Celery\nfrom celery.utils.log import get_task_logger\nfrom kombu import Exchange, Queue\n\nfrom raven impor... | python | chosen |
[
{
"from": "system",
"value": "Change default loglevel to INFO\n"
},
{
"from": "human",
"value": "import logging\nfrom os import environ as env\n\n__all__ = []\n\n_log_level_default = logging.WARN\n_log_level = getattr(logging, env.get('GHTOOLS_LOGLEVEL', '').upper(), _log_level_default)\n\nloggi... | python | chosen |
[
{
"from": "system",
"value": "Change ValidTime to a mixbox Entity\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\nfrom mixbox import fields\n\nimport stix\nfrom stix.common import DateTimeWithPrecision\n... | python | chosen |
[
{
"from": "system",
"value": "Delete users before importing them\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand, CommandError\nfrom match.models import User\n\nimport csv\nimport sys\n\nclass Command(BaseCommand):\n help = 'Import a list of users from s... | python | chosen |
[
{
"from": "system",
"value": "Add test for part of gosper's algorithm.\n"
},
{
"from": "human",
"value": "def test_normal():\n pass\n\ndef test_gosper():\n pass\n"
},
{
"from": "gpt",
"value": "from sympy import Symbol, normal\nfrom sympy.abc import n\n\ndef test_normal():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add ability to print out studies view from command line.\n"
},
{
"from": "human",
"value": "import argparse\n\nfrom lenrmc.nubase import System\nfrom lenrmc.terminal import TerminalView\n\n\nclass App(object):\n\n def __init__(self, **kwargs):\n self.kwarg... | python | chosen |
[
{
"from": "system",
"value": "Handle julian leap days separately.\n"
},
{
"from": "human",
"value": "from datetime import date, timedelta\n\nclass DateWithCalendar(object):\n def __init__(self, calendar_class, date):\n self.calendar = calendar_class\n self.date = date\n\n def... | python | chosen |
[
{
"from": "system",
"value": "Add test case for 404 on docs pages\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.test import Client, TestCase\nfrom django.core.urlresolvers import reverse\nfrom django.core.management import call_command\n\nimport views\n\n\nclass DocsTestCase(TestCa... | python | chosen |
[
{
"from": "system",
"value": "Add float coercion, datetime comparison support\n"
},
{
"from": "human",
"value": "try:\n from functools import total_ordering\nexcept ImportError:\n # Use Python 2.6 port\n from total_ordering import total_ordering\n\n\n@total_ordering\nclass Infinity(obje... | python | chosen |
[
{
"from": "system",
"value": "Make imports work for formatters module.\n"
},
{
"from": "human",
"value": "from cc.license.interfaces import ILicenseFormatter\nimport zope.interface\n\nclass Formatter(object):\n zope.interface.implements(ILicenseFormatter)\n id = \"HTML + RDFa formatter\"\n... | python | chosen |
[
{
"from": "system",
"value": "Clean up, comments, liveness checking, robust data transfer\n"
},
{
"from": "human",
"value": "import random\nimport json\nimport time\n\nimport SocketExtend as SockExt\nimport config as conf\nimport parser as p\n\ndef ping(sock):\n\ttry:\n\t\trand = random.randint(... | python | chosen |
[
{
"from": "system",
"value": "Allow control of download process via command line\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom utils.summary_downloader import SummaryDownloader\n\nif __name__ == '__main__':\n\n # setting target dir and time interval... | python | chosen |
[
{
"from": "system",
"value": "Print JSON document upon parse error\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\nimport json\n\n\ndef _experiment_runner_path():\n this_path = os.path.dirname(os.path.realpath(__file__))\n return this_path + \"/../../target/release/experim... | python | chosen |
[
{
"from": "system",
"value": "Fix chatroom url pattern to include '-'\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\nfrom . import views\n\nurlpatterns = patterns('',\n url(\n regex=r'^step([1234])/$',\n view=views.edit_initial_config,\n ... | python | chosen |
[
{
"from": "system",
"value": "Use appropriate version naming scheme."
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\n__version__ = '1.0-dev'\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, print_function\n\n__version... | python | chosen |
[
{
"from": "system",
"value": "Correct my cowboy fix that broke.\n"
},
{
"from": "human",
"value": "import sublime_plugin\nfrom bower.utils.api import API\n\nclass InstallCommand(sublime_plugin.WindowCommand):\n def run(self, *args, **kwargs):\n self.list_packages()\n\n def list_pack... | python | chosen |
[
{
"from": "system",
"value": "Bump the number for a minor release to fix the mysql migrations issue.\n"
},
{
"from": "human",
"value": "VERSION = (1, 0, 'alpha', 14)\n\n\ndef get_version(join=' ', short=False):\n \"\"\"\n Return the version of this package as a string.\n\n The version n... | python | chosen |
[
{
"from": "system",
"value": "Check for older Postgresql engine name for JSONField\n\nThe Postgresql database engine name was changed from\n'django.db.backends.postgresql_psycopg2' to\n'django.db.backends.postgresql' in Django 1.9. However, the former name\nstill works in newer versions of Django for compat... | python | chosen |
[
{
"from": "system",
"value": "Change to the correct version.\n"
},
{
"from": "human",
"value": "from shortuuid.main import (\n encode,\n decode,\n uuid,\n random,\n get_alphabet,\n set_alphabet,\n ShortUUID,\n)\n\n__version__ = \"0.4.2\"\n"
},
{
"from": "gpt",
"v... | python | chosen |
[
{
"from": "system",
"value": "Patch job scheduler avoiding possibilities for concurrent runs of the same\n"
},
{
"from": "human",
"value": "# -*- coding: UTF-8\n# jobs/base\n# *********\n#\n# Base class for implement the scheduled tasks\n\nimport sys\n\nfrom twisted.internet import task\nfro... | python | chosen |
[
{
"from": "system",
"value": "Downgrade to INFO, since runbots install this.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nimport logging\nfro... | python | chosen |
[
{
"from": "system",
"value": "Fix extra in case of fragmented sources\n"
},
{
"from": "human",
"value": "from collections import namedtuple\n\n\nEvent = namedtuple('Event', ['id', 'type', 'data'])\n\ndef parse(source):\n eid = None\n etype = None\n data = []\n retry = None\n ex... | python | chosen |
[
{
"from": "system",
"value": "fix: Update data explorations data sets to samples\n"
},
{
"from": "human",
"value": "# importing modules/ libraries\nimport pandas as pd\nimport random\n\n# loading the data\naisles_df = pd.read_csv('Data/aisles.csv')\nprint(aisles_df.head())\n\ndepartments_df = pd... | python | chosen |
[
{
"from": "system",
"value": "Add 2d list to ConfigProperty.\n"
},
{
"from": "human",
"value": "\n__all__ = ('to_bool', 'ConfigPropertyList')\n\nfrom kivy.properties import ConfigParserProperty\nfrom re import compile, split\nfrom functools import partial\n\nto_list_pat = compile(', *')\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Fix detect Git-LFS in tests\n"
},
{
"from": "human",
"value": "import email\nfrom os.path import dirname, join\n\nfrom django.utils import six\nfrom django_mailbox.models import Mailbox\n\nfrom feder.letters.signals import MessageParser\n\n\nclass MessageMixin(objec... | python | chosen |
[
{
"from": "system",
"value": "Raise TypeError if links is not a link.Collection\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\n\"\"\"\nflask_hal.document\n==================\n\nModule for constructing ``HAL`` documents.\n\nExample:\n >>> from flask_hal.document... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.