conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Fix locators used in needle example on BBC site\n"
},
{
"from": "human",
"value": "from needle.cases import NeedleTestCase\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import e... | python | chosen |
[
{
"from": "system",
"value": "Order character listing by name\n"
},
{
"from": "human",
"value": "from django.shortcuts import get_object_or_404, redirect, render\nfrom django.views import generic\n\nfrom characters.forms import CharacterForm\nfrom characters.models import Character, Class, Race\... | python | chosen |
[
{
"from": "system",
"value": "pluggable-backends: Use get_app over to include django-mailer support over a standard import and ImportError exception handling.\n\ngit-svn-id: 12265af7f62f437cb19748843ef653b20b846039@130 590c3fc9-4838-0410-bb95-17a0c9b37ca9\n"
},
{
"from": "human",
"value": "\nfro... | python | chosen |
[
{
"from": "system",
"value": "twitch: Add error checking in API response\n"
},
{
"from": "human",
"value": "import requests\n\nfrom allauth.socialaccount.providers.oauth2.views import (\n OAuth2Adapter,\n OAuth2CallbackView,\n OAuth2LoginView,\n)\n\nfrom .provider import TwitchProvider\... | python | chosen |
[
{
"from": "system",
"value": "Add comment for object types\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\n\nprint(\"argv: %d\" % len(sys.argv))\n\n# Object related test\nprint(type(sys.argv))\nprint(id(sys.argv))\nprint(type(sys.argv) is list)\n\nif len(sys.argv) != 2:\n ... | python | chosen |
[
{
"from": "system",
"value": "Implement the Room base class\n"
},
{
"from": "human",
"value": "from models.people.people import Staff, Fellow\nfrom models.rooms.rooms import Office, LivingSpace\nimport random\n\n\nclass Dojo(object):\n def __init__(self):\n self.offices = []\n s... | python | chosen |
[
{
"from": "system",
"value": "Update parser to the changes in the report format\n"
},
{
"from": "human",
"value": "# This is an example of how to parse ooniprobe reports\n\nimport yaml\nimport sys\nprint \"Opening %s\" % sys.argv[1]\nf = open(sys.argv[1])\nyamloo = yaml.safe_load_all(f)\n\nrepor... | python | chosen |
[
{
"from": "system",
"value": "Create model in config file.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nFile: __init__.py\nAuthor: huxuan <i(at)huxuan.org>\nDescription: Initial file for app.\n\"\"\"\n\nfrom flask import Flask\n\napp = Flask(__name__... | python | chosen |
[
{
"from": "system",
"value": "Add log to encoding output (still fails due to objects)\n"
},
{
"from": "human",
"value": "import json\nimport hunting.sim.entities as entities\n\n\nclass GameObjectEncoder(json.JSONEncoder):\n def default(self, o):\n d = o.__dict__\n d.pop('owner',... | python | chosen |
[
{
"from": "system",
"value": "Simplify adding spaces and add time/space complexity\n"
},
{
"from": "human",
"value": "\"\"\"Codewars: Draw stairs\n8 kyu\n\nURL: https://www.codewars.com/kata/draw-stairs/\n\nGiven a number n, draw stairs using the letter \"I\", n tall and n wide,\nwith the talles... | python | chosen |
[
{
"from": "system",
"value": "Change DataIndex to restrict on published and archived flags only\n\nIn addition, the warnings of the deprecated settings have been removed.\n\nFix #290\n\nSigned-off-by: Byron Ruth <e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98@devel.io>\n"
},
{
"from": "human",
"value"... | python | chosen |
[
{
"from": "system",
"value": "Remove debug toolbar in test settings\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\n\nimport os\n\nfrom .common import * # noqa\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix compatible error about capsys.\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\nfrom os.path import curdir, devnull\nfrom subprocess import check_call\n\nfrom pytest import fixture, mark, raises\n\nfrom csft import __main__ as main\n\n\n@fixture\ndef... | python | chosen |
[
{
"from": "system",
"value": "Determine winning hand & compare to nut hand.\n"
},
{
"from": "human",
"value": "from itertools import combinations\nfrom deuces.deuces import Card, Evaluator, Deck\nfrom nuts import nut_hand\n\nevaluator = Evaluator()\ndeck = Deck()\nflop = deck.draw(3)\n\ndef omah... | python | chosen |
[
{
"from": "system",
"value": "Allow passing the rackattack connection string as an argument to the client factory\n"
},
{
"from": "human",
"value": "import os\nfrom rackattack.tcp import client\n\n\n_VAR_NAME = \"RACKATTACK_PROVIDER\"\n\n\ndef factory():\n if _VAR_NAME not in os.environ:\n ... | python | chosen |
[
{
"from": "system",
"value": "Use the Mojang API directly; reduces overhead.\n"
},
{
"from": "human",
"value": "\"\"\" Username to UUID\n Converts a Minecraft username to it's UUID equivalent.\n\nParses http://www.lb-stuff.com/Minecraft-Name-History output to retrieve the UUID\n of an old name t... | python | chosen |
[
{
"from": "system",
"value": "Make _ip_address_for_interface easier to use\n"
},
{
"from": "human",
"value": "import fcntl\nimport socket\nimport struct\nfrom contextlib import contextmanager\n\n\n@contextmanager\ndef use_interface(ifname):\n \"\"\"\n :type ifname: str\n\n \"\"\"\n i... | python | chosen |
[
{
"from": "system",
"value": "Add proto of average page. Without sorting.\n"
},
{
"from": "human",
"value": "from flask import render_template, g, redirect, request\nfrom db import connect_db, get_all_sum\n\nfrom statistics import app\n\n@app.before_request\ndef before_request():\n g.db = con... | python | chosen |
[
{
"from": "system",
"value": "Make a shortcut for debugging with pdb\n"
},
{
"from": "human",
"value": "INFINITY = 1e+31\n\nDIRECTIONS = ((-1,-1),(-1,0),(-1,1),\n (0,-1), (0,1),\n (1,-1), (1,0), (1,1))\n\nEMPTY = 0\nBLACK = 1\nWHITE = 2\n\ndef opposite_colour(c... | python | chosen |
[
{
"from": "system",
"value": "Add test for unimplemented get_response_statements function\n"
},
{
"from": "human",
"value": "from unittest import TestCase\nfrom chatterbot.storage import StorageAdapter\n\n\nclass StorageAdapterTestCase(TestCase):\n \"\"\"\n This test case is for the Storag... | python | chosen |
[
{
"from": "system",
"value": "Add PSMPlayer and SamsungTVPlayer platforms\n"
},
{
"from": "human",
"value": "from enum import IntEnum\n\n\nclass RuntimePlatform(IntEnum):\n\tOSXEditor = 0\n\tOSXPlayer = 1\n\tWindowsPlayer = 2\n\tOSXWebPlayer = 3\n\tOSXDashboardPlayer = 4\n\tWindowsWebPlayer = 5\... | python | chosen |
[
{
"from": "system",
"value": "Update method to check both username and password\n"
},
{
"from": "human",
"value": "__author__ = 'matt'\n\nfrom blockbuster import bb_dbconnector_factory\n\n\ndef credentials_are_valid(username, password):\n db = bb_dbconnector_factory.DBConnectorInterfaceFactor... | python | chosen |
[
{
"from": "system",
"value": "Add VM valid profile model\n"
},
{
"from": "human",
"value": "from geonature.utils.env import DB\nfrom utils_flask_sqla.serializers import serializable\n\n@serializable\nclass VmCorTaxonPhenology(DB.Model):\n __tablename__ = \"vm_cor_taxon_phenology\"\n __tabl... | python | chosen |
[
{
"from": "system",
"value": "Use client_name instead of schema_name\n"
},
{
"from": "human",
"value": "import json\n\nfrom rest_framework.authtoken.models import Token\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.core.management.base import BaseCommand\n\nfrom bluebo... | python | chosen |
[
{
"from": "system",
"value": "Change url in favor of the re_path\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import url, include\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\nfrom djs_playground.views import index\n\... | python | chosen |
[
{
"from": "system",
"value": "Make Fabric honor .ssh/config settings\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom contextlib import nested\n\nfrom fabric.api import *\n\n\ndef prepare_project():\n u\"\"\"\n Enters the directory and sources environment configuration.\n... | python | chosen |
[
{
"from": "system",
"value": "Use self.stdout.write() instead of print().\n\nThis is the recommended way in the Django documentation:\n\n https://docs.djangoproject.com/en/1.7/howto/custom-management-commands/\n"
},
{
"from": "human",
"value": "import requests\n\nfrom django.core.management i... | python | chosen |
[
{
"from": "system",
"value": "Create a document in DdlTextWriterTest.test_full()\n\nSigned-off-by: Squareys <0f6a03d4883e012ba4cb2c581a68f35544703cd6@googlemail.com>\n"
},
{
"from": "human",
"value": "import io\nimport os\nimport unittest\nfrom pyddl import *\n\n__author__ = \"Jonathan Hale\"\n\... | python | chosen |
[
{
"from": "system",
"value": "Add base set of rule's invalid syntax tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import main, TestCase\nfrom grammpy import Ru... | python | chosen |
[
{
"from": "system",
"value": "Remove xfail from replay test\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport pytest\n\nfrom django.core.urlresolvers import reverse\nfrom exam import fixture\n\nfrom sentry.testutils import TestCase\n\n... | python | chosen |
[
{
"from": "system",
"value": "Check to see if qt is loaded; if so, export QtProgress class\n\n\ngit-svn-id: d468cea6ffe92bc1eb1f3bde47ad7e70b065426a@224 5acbf244-8a03-4a8b-a19b-0d601add4d27\n"
},
{
"from": "human",
"value": "__revision__ = \"$Revision$\"\n\nfrom textprogress import TextProgress\... | python | chosen |
[
{
"from": "system",
"value": "Add a real roll command\n"
},
{
"from": "human",
"value": "import discord\nimport duckbot_settings\nimport random\nfrom discord.ext import commands\n\n_DESCRIPTION = '''quack'''\n\nbot = commands.Bot(command_prefix='/', description=_DESCRIPTION)\n\n@bot.event\nasync... | python | chosen |
[
{
"from": "system",
"value": "Fix broken initial version creation.\n"
},
{
"from": "human",
"value": "from django.contrib.contenttypes.models import ContentType\nfrom django.db.models.signals import pre_save\nfrom django.dispatch import receiver\nfrom reversion.models import Version\nfrom revers... | python | chosen |
[
{
"from": "system",
"value": "Make sure the filter arg is a string.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom django.template import Library\nfrom ..html import TermsHTMLReconstructor\n\nregister = Library()\n\n\n@register.filter\ndef replace_terms(html):\n parser = TermsHTML... | python | chosen |
[
{
"from": "system",
"value": "Allow sub-commands to use same main function\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os.path\nimport sys\nimport imp\nimport argparse\nfrom api import App, add_subparsers\n\n\ndef load_plugins(dir):\n for f in os.listdir(dir):\n module_n... | python | chosen |
[
{
"from": "system",
"value": "tests/dot: Test that x² == |x|²\n"
},
{
"from": "human",
"value": "from ppb_vector import Vector2\n\nfrom math import isclose, sqrt\nimport pytest # type: ignore\nfrom hypothesis import assume, given, note\nfrom utils import floats, vectors\n\n\n@given(x=vectors(),... | python | chosen |
[
{
"from": "system",
"value": "Fix use of Python 2 print\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nimport os\nimport traceback\n\nfrom .handlers import find_handler\n\n\n_activate_debugger = os.environ.get('DEBUG') == 'yes'\nif _activate_debugger:\n try:\n from trepan.api im... | python | chosen |
[
{
"from": "system",
"value": "Fix bench error on scipy import when nose is not installed\n"
},
{
"from": "human",
"value": "''' Null tester (when nose not importable)\n\nMerely returns error reporting lack of nose package\n\nSee pkgtester, nosetester modules\n\n'''\n\nnose_url = 'http://somethin... | python | chosen |
[
{
"from": "system",
"value": "Add url field to Dataset web item\n"
},
{
"from": "human",
"value": "from scrapy.item import Item, Field\n\nclass DatasetItem(Item):\n\n name = Field()\n frequency = Field()\n "
},
{
"from": "gpt",
"value": "from scrapy.item import Item, Field\n... | python | chosen |
[
{
"from": "system",
"value": "Add options trailing slashes to the Enrollment API.\n\nThis allows the edX REST API Client to perform a sucessful GET against\nthis API, since Slumber (which our client is based off of) appends the\ntrailing slash by default.\n"
},
{
"from": "human",
"value": "\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Mark pixel tests as failing on all platform\n\nBUG=511580\nR=kbr@chromium.org\n\nReview URL: https://codereview.chromium.org/1245243003\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340191}\n"
},
{
"from": "human",
"value": "# Copyright 2014 The ... | python | chosen |
[
{
"from": "system",
"value": "Update Cloudtrail per 2021-09-10 changes\n"
},
{
"from": "human",
"value": "from . import AWSObject, AWSProperty, Tags\nfrom .validators import boolean\n\n\nclass DataResource(AWSProperty):\n props = {\n \"Type\": (str, True),\n \"Values\": ([str], ... | python | chosen |
[
{
"from": "system",
"value": "Clean up dynamodb table when deleting an archive\n"
},
{
"from": "human",
"value": "import boto\nfrom boto.glacier.exceptions import UnexpectedHTTPResponseError\n\nclass CommandDeleteArchiveFromVault(object):\n\n def execute(self, args, config):\n glacier_connec... | python | chosen |
[
{
"from": "system",
"value": "Move reload doc before get query\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017, Frappe and Contributors\n# License: GNU General Public License v3. See license.txt\n\nfrom __future__ import unicode_literals\n\nimport frappe\n\n\ndef execute():\n\titems_barc... | python | chosen |
[
{
"from": "system",
"value": "Repair bug in the Farmer model\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass Farmer(models.Model):\n first_name = models.CharField(_('first name'), max_length=50)\n surname =... | python | chosen |
[
{
"from": "system",
"value": "Fix new lint errors now that we've dropped python 2 support.\n"
},
{
"from": "human",
"value": "import responses\n\n\nclass AuthenticationTestMixin(object):\n \"\"\" Mixin for testing authentication. \"\"\"\n def setUp(self):\n super(AuthenticationTestM... | python | chosen |
[
{
"from": "system",
"value": "Fix checking of limit parameter\n"
},
{
"from": "human",
"value": "from twisted.words.protocols import irc\nfrom txircd.modbase import Mode\n\nclass LimitMode(Mode):\n def checkSet(self, user, target, param):\n intParam = int(param)\n if str(intPara... | python | chosen |
[
{
"from": "system",
"value": "Change the feature calculation to match the new unified format\n\n- the timestamps are now in seconds, so no need to divide them\n- the field is called ts, not mTime\n"
},
{
"from": "human",
"value": "# Standard imports\nimport math\nimport logging\nimport numpy as ... | python | chosen |
[
{
"from": "system",
"value": "Add test for sock path length\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Mike Place <mp@saltstack.com>`\n'''\n\n# Import Salt Testing libs\nfrom salttesting import TestCase, skipIf\nfrom salttesting.helpers import ensur... | python | chosen |
[
{
"from": "system",
"value": "Make sure this value is always an integer"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.management.base import BaseCommand\n\nimport stripe\n\n\nclass Command(BaseCommand):\n\n help = \"Make sure your Stripe account has the p... | python | chosen |
[
{
"from": "system",
"value": "Print all hourly temperatures from run date\n"
},
{
"from": "human",
"value": "import tcxparser\nfrom configparser import ConfigParser\nfrom datetime import datetime\nimport urllib.request\nimport dateutil.parser\n\nt = '1984-06-02T19:05:00.000Z'\n# Darksky weather ... | python | chosen |
[
{
"from": "system",
"value": "Add search functionality to permissions endpoint\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import Permission\n\nfrom rest_framework import viewsets\n\nfrom .serializers import PermissionSerializer\n\n\nclass PermissionViewSet(viewsets.ReadOn... | python | chosen |
[
{
"from": "system",
"value": "BUG: Remove double import of find contours.\n"
},
{
"from": "human",
"value": "from .find_contours import find_contours\nfrom ._regionprops import regionprops\nfrom .find_contours import find_contours\nfrom ._structural_similarity import ssim\n"
},
{
"from":... | python | chosen |
[
{
"from": "system",
"value": "FIX sale_available integration with delivery\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom openerp import http\nfrom openerp.http import request\n\nfrom openerp.addons.website_sale.controllers.main import website_sale\n\n\nclass controller(website... | python | chosen |
[
{
"from": "system",
"value": "Revert back to older Catch2, part 2\n\nToo quick on the commit button"
},
{
"from": "human",
"value": "from conans import ConanFile, CMake\n\nclass CausalSetsExplorer(ConanFile):\n settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n requires = \"boost/... | python | chosen |
[
{
"from": "system",
"value": "Use ascii in logging message\n"
},
{
"from": "human",
"value": "import logging\n\nfrom flask import current_app, request, abort\nfrom flask.blueprints import Blueprint\n\nfrom sipa.utils.git_utils import update_repo\n\n\nlogger = logging.getLogger(__name__)\n\nbp_ho... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary testing code from atbash\n"
},
{
"from": "human",
"value": "\"\"\"Tests for the Caeser module\"\"\"\n\nimport pycipher\n\nfrom lantern.modules import atbash\n\n\ndef _test_atbash(plaintext, *fitness_functions, top_n=1):\n ciphertext = pycipher.... | python | chosen |
[
{
"from": "system",
"value": "test: Update test for Stan 2.29\n"
},
{
"from": "human",
"value": "\"\"\"Test that stanc warnings are visible.\"\"\"\nimport contextlib\nimport io\n\nimport stan\n\n\ndef test_stanc_no_warning() -> None:\n \"\"\"No warnings.\"\"\"\n program_code = \"parameters... | python | chosen |
[
{
"from": "system",
"value": "Fix string using py3 only feature.\n"
},
{
"from": "human",
"value": "\"\"\"\nThese functions are written assuming the under a moto call stack.\nTODO add check is a fake bucket?\n\"\"\"\nimport boto3\n\n\ndef pre_load_s3_data(bucket_name, prefix, region='us-east-1')... | python | chosen |
[
{
"from": "system",
"value": "Fix indentation problem and line length (PEP8)\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\nfrom django.utils.translation import ugettext_la... | python | chosen |
[
{
"from": "system",
"value": "Remove application flag, not an application\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2013-2017 Camptocamp SA\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)\n\n{'name': 'Connector',\n 'version': '10.0.1.0.0',\n 'au... | python | chosen |
[
{
"from": "system",
"value": "Add top-level cli debugging and verbosity options\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function\nimport click\nfrom .. import __version__\n\n\n# Monkey patch\nclick.core._verify_python3_env = lambda: None... | python | chosen |
[
{
"from": "system",
"value": "Extend example to include non-ASCII characters\n"
},
{
"from": "human",
"value": "import gtk\n\nfrom kiwi.ui.widgets.entry import Entry\n\nentry = Entry()\nentry.set_completion_strings(['apa', 'apapa', 'apbla',\n 'apppa', 'aaspa'])\n\nwi... | python | chosen |
[
{
"from": "system",
"value": "Test isexecutable check in utils.Shell\n"
},
{
"from": "human",
"value": "import helper\nfrom rock import utils\n\n\nclass UtilsTestCase(helper.unittest.TestCase):\n\n def test_shell(self):\n utils.Shell.run = lambda self: self\n s = utils.Shell()\n... | python | chosen |
[
{
"from": "system",
"value": "Add IdentityEncoder to top-level exports\n"
},
{
"from": "human",
"value": "from model import BaseModel\n\nfrom feature import Feature,JSONFeature,TextFeature,CompressedFeature,PickleFeature\n\nfrom extractor import Node,Graph,Aggregator,NotEnoughData\n\nfrom bytest... | python | chosen |
[
{
"from": "system",
"value": "Add nicer drink order logging\n"
},
{
"from": "human",
"value": "class DrinkOrder():\n def __init__(self, mug_size, add_ins, name=None):\n self.mug_size = mug_size\n self.add_ins = add_ins\n self.name = name\n\n @classmethod\n def deser... | python | chosen |
[
{
"from": "system",
"value": "Add test cases for module post_manager, refactor part of class PostManager and update TODO list.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''module for unit test and task for CI'''\nimport sys\nimport unittest\n\nfrom yatest import testpost, testp... | python | chosen |
[
{
"from": "system",
"value": "Fix build failure for mac/ubuntu, which relies on an old version for keras-preprocessing.\n\nPiperOrigin-RevId: 273405152\n"
},
{
"from": "human",
"value": "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Versio... | python | chosen |
[
{
"from": "system",
"value": "Fix tag creation with non-ascii chars. (Dammit bottle!)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom common import init, globaldata, tag_clean, tag_prefix, tag_post, tagtypes\nfrom bottle import post, request, redirect, m... | python | chosen |
[
{
"from": "system",
"value": "Include superusers in web user domaing access record\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom datetime import datetime, timedelta\n\nfrom django.utils.deprecation import MiddlewareMixin\... | python | chosen |
[
{
"from": "system",
"value": "Use correct env to check if on github\n"
},
{
"from": "human",
"value": "\"\"\"Tests for execute commands function\"\"\"\nimport os\nimport subprocess\n\nimport pytest\n\nfrom scout.server.extensions.loqus_extension import execute_command\n\nTRAVIS = os.getenv(\"TRA... | python | chosen |
[
{
"from": "system",
"value": "Update the default settings file to include the database threaded option\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright [2009-2014] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this ... | python | chosen |
[
{
"from": "system",
"value": "Mark TimeStampedMixin.modified as an onupdate FetchedValue\n"
},
{
"from": "human",
"value": "from sqlalchemy.dialects import postgresql as pg\nfrom sqlalchemy.sql import func\nfrom sqlalchemy.sql.expression import text\n\nfrom warehouse import db\nfrom warehouse.da... | python | chosen |
[
{
"from": "system",
"value": "Fix migration file for Python 3.2 (and PEP8)\n"
},
{
"from": "human",
"value": "# encoding: utf8\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ]\n\n operations = [\n migrations.CreateMode... | python | chosen |
[
{
"from": "system",
"value": "Remove successful OpenID login live test.\nIt's redundant with our message-related live tests.\n"
},
{
"from": "human",
"value": "import time\n\nimport pytest\n\nfrom chatexchange.browser import SEChatBrowser, LoginError\n\nimport live_testing\n\n\nif live_testing.e... | python | chosen |
[
{
"from": "system",
"value": "Stop forwarding flash by default, it breaks more than it doesn't.\n\ngit-svn-id: 87d19257dd11500985d055ec4730e446075a5f07@1279 78c7df6f-8922-0410-bcd3-9426b1ad491b\n"
},
{
"from": "human",
"value": "# Copyright (c) 2006-2007 Open Source Applications Foundation\n# ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Testing NoOpDSH() when database commands are executed without a connection being opened.\"\n\nThis reverts commit 57dd36da6f558e9bd5c9b7c97e955600c2fa0b8e.\n"
},
{
"from": "human",
"value": "# ----- Info -----------------------------------------------------... | python | chosen |
[
{
"from": "system",
"value": "Add win32 to platform information\n"
},
{
"from": "human",
"value": "\"\"\"\nReturn information about the given platform.\n\"\"\"\n\n\nimport sys\n\n\nclass Platform(object):\n\n @staticmethod\n def is_darwin(name=None):\n name = name or sys.platform\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix extension detection in JSON generation\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nimport os\nimport json\nimport glob\n\ndata = {}\ndata['comparisonfiles'] = {}\n\nfor subset in next(os.walk(\"comparisonfiles/\"))[1]:\n data['comparisonfiles'][s... | python | chosen |
[
{
"from": "system",
"value": "Fix version detection for tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n\r\nimport setuptools_scm\r\n\r\nextensions = [\r\n 'sphinx.ext.autodoc',\r\n]\r\n\r\n# General information about the project.\r\nproject = 'ja... | python | chosen |
[
{
"from": "system",
"value": "Load DB migrations before testing and use verbose=2 and failfast\n\nNote that we use `manage.py test` instead of\n`manage.py migrate` and manually running the tests. This\nlets Django take care of applying migrations before running tests.\nThis works around https://code.djangop... | python | chosen |
[
{
"from": "system",
"value": "Add missing config that caused test to fail\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\n\nfrom django.conf import settings\nfrom django.core.management import execute_from_command_line\n\n\nif not settings.configured:\n params = dict(\... | python | chosen |
[
{
"from": "system",
"value": "Add ability to proportionally assign to different users\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand, CommandError\nfrom data_collection.models import User, Firm, Assignment\nimport itertools\n\nclass Command(BaseCommand):\n... | python | chosen |
[
{
"from": "system",
"value": "Remove code that was causing a problem running syncdb. Code seems to be redundant anyway.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.db.models.signals import post_save\nimport mimetypes\nimport wellknown\n\n#\n# create default host-... | python | chosen |
[
{
"from": "system",
"value": "Remove `EOF` -- update examples\n\nrefs #64\n"
},
{
"from": "human",
"value": "from parglare import Grammar\n\n\ngrammar = Grammar.from_string(\"\"\"\n start: ab EOF;\n ab: \"a\" ab \"b\" | EMPTY;\n\"\"\")\n\nstart_symbol = 'start'\n"
},
{
"from": "gpt... | python | chosen |
[
{
"from": "system",
"value": "fix: Fix the placeholder for better understanding\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n * Project: udacity-fsnd-p4-conference-app\n * Author name: Iraquitan Cordeiro Filho\n * Author login: iraquitan\n * File: settings\n * Date: 3/23/1... | python | chosen |
[
{
"from": "system",
"value": "Fix import of Callable for Python 3.9\n\nPython 3.3 moved Callable to collections.abc and Python 3.9 removes Callable from collections module"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport re\nimport collections\n\n\ndef user_is_a... | python | chosen |
[
{
"from": "system",
"value": "Remove dependency for ReviewedVersionTracker in migrations\n\nThe base widgy migrations had references to ReviewedVersionTracker,\nwhich is not part of the base widgy install. This commit changes the\ndependency to VersionTracker instead, which is part of the base widgy\ninsta... | python | chosen |
[
{
"from": "system",
"value": "Remove uvloop from test run.\n"
},
{
"from": "human",
"value": "from cellulario import iocell\nimport asyncio\nimport uvloop\n\nasyncio.set_event_loop_policy(uvloop.EventLoopPolicy())\n\niocell.DEBUG = True\n\n"
},
{
"from": "gpt",
"value": "from cellula... | python | chosen |
[
{
"from": "system",
"value": "Fix --crx arg error reporting.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# chameleon-crawler\n#\n# Copyright 2014 ghostwords.\n#\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was no... | python | chosen |
[
{
"from": "system",
"value": "Add forward function declaration to Class Node\n"
},
{
"from": "human",
"value": "class Node(object):\n def __init__(self):\n # Node(s) from which this Node receives values\n self.inbound_nodes = inbound_nodes\n # Node(s) to which this Node passes values\n... | python | chosen |
[
{
"from": "system",
"value": "Use auto_register's filter_func to filter tests\n"
},
{
"from": "human",
"value": "from fontbakery.checkrunner import Section\nfrom fontbakery.fonts_spec import spec_factory\n\n\ndef check_filter(checkid, font=None, **iterargs):\n if checkid in (\n \"com.googl... | python | chosen |
[
{
"from": "system",
"value": "Add possibilty to get ResultMessage"
},
{
"from": "human",
"value": "from mangopaysdk.entities.entitybase import EntityBase\nfrom mangopaysdk.types.money import Money\n\n\nclass Transaction (EntityBase):\n \"\"\"Transaction entity.\n Base class for: PayIn, Pay... | python | chosen |
[
{
"from": "system",
"value": "Fix ConnectedSWFObject: pass default value to pop()\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\n# Copyright (c) 2013, Theo Crevon\n# Copyright (c) 2013, Greg Leclercq\n#\n# See the file LICENSE for copying permission.\n\nimport boto.swf\n\nfrom . im... | python | chosen |
[
{
"from": "system",
"value": "Allow attribute to be customized in TagRegistered\n"
},
{
"from": "human",
"value": "\"\"\"\nmeta.py\n\nSome useful metaclasses.\n\"\"\"\n\nfrom __future__ import unicode_literals\n\nclass LeafClassesMeta(type):\n\t\"\"\"\n\tA metaclass for classes that keeps track ... | python | chosen |
[
{
"from": "system",
"value": "Add better instructions to the Gitter example\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom chatterbot import ChatBot\nfrom chatterbot.trainers import ChatterBotCorpusTrainer\nfrom settings import GITTER\n\n\n# Uncomment the following lines to ena... | python | chosen |
[
{
"from": "system",
"value": "Add diversity to test script\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nu\"\"\"\n:author: Joseph Martinot-Lagarde\n\nCreated on Sat Jan 19 14:57:57 2013\n\"\"\"\n\nfrom __future__ import (\n print_function, division, unicode_li... | python | chosen |
[
{
"from": "system",
"value": "Fix the test bot's TPB initialization\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\r\n\r\nfrom tpb import TPB\r\n\r\nt = TPB()\r\n\r\n# when using a proxy site\r\n# t = TPB('http://uberproxy.net/thepiratebay.sx')\r\n\r\n\r\nfor to in t.get_recent_torrent... | python | chosen |
[
{
"from": "system",
"value": "Use argparse instead of sys.argv\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python3\nimport sys\nfrom gitaccount import GitAccount\n\n\ndef main():\n if len(sys.argv) < 2:\n print(\"\"\"Usage:\n gitcloner.py [OPTION] [NAME]\n\n OPTIONS:\n ... | python | chosen |
[
{
"from": "system",
"value": "Use get/set_property rather than direct accessors\n"
},
{
"from": "human",
"value": "import random\n\nclass IconLayout:\n\tdef __init__(self, width, height):\n\t\tself._icons = []\n\t\tself._width = width\n\t\tself._height = height\n\n\tdef add_icon(self, icon):\n\t... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.