conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Set default version for cloud databases.\n"
},
{
"from": "human",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# ... | python | chosen |
[
{
"from": "system",
"value": "Fix custom template tag to work with django 1.8\n"
},
{
"from": "human",
"value": "from django import template\n\nregister = template.Library()\n\n\nclass InContextNode(template.Node):\n def __init__(self, nodelist, subcontext_names):\n self.nodelist = nod... | python | chosen |
[
{
"from": "system",
"value": "Move module time to main()\n"
},
{
"from": "human",
"value": "\"\"\"Fibonacci series:\n\n0, 1, 1, 2, 3, 5, 8,... \n\n- Fib(0) = 0\n- Fib(1) = 1\n- Fib(n) = Fib(n - 1) + Fib(n - 2)\n\"\"\"\n\nfrom __future__ import print_function\nimport time\n\n\ndef fibonacci(n):\n... | python | chosen |
[
{
"from": "system",
"value": "Check in fix for py3k and urlparse.\n"
},
{
"from": "human",
"value": "import sys\nimport itertools\n\nPY3 = sys.version_info[:2] >= (3,0)\n\nif PY3:\n def dict_iteritems(d):\n return d.items().__iter__()\n xrange = range\n _inttypes = (int,)\n _s... | python | chosen |
[
{
"from": "system",
"value": "Substitute a more realistic jurisdiction_id\n"
},
{
"from": "human",
"value": "from pupa.scrape import Jurisdiction\n\nfrom .people import PersonScraper\n\n\nclass Example(Jurisdiction):\n jurisdiction_id = 'ex'\n\n def get_metadata(self):\n return {\n ... | python | chosen |
[
{
"from": "system",
"value": "Use os.exelp to launch psql\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright (C) 2011 Lukas Lalinsky\n# Distributed under the MIT license, see the LICENSE file for details.\n\nfrom acoustid.script import run_script\nimport subprocess\n\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Add name for entry view URL\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns\n\n\nurlpatterns = patterns(\n 'buysafe.views',\n (r'^entry/(?P<order_id>\\d+)/$', 'entry'),\n (r'^start/$', 'start'),\n (r'^success/(?P<payment_type>[01... | python | chosen |
[
{
"from": "system",
"value": "Add test for handling Infinity in json\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport datetime\nimport uuid\n\nfrom sentry.utils import json\n\nfrom sentry.testutils import TestCase\n\n\nclass JSONTest(... | python | chosen |
[
{
"from": "system",
"value": "Add a version base on djangocms version from where the code was cloned\n"
},
{
"from": "human",
"value": "\"\"\"\n\"cms.plugins.snippet\" (from djangocms) clone to extend it with some facilities\n\"\"\""
},
{
"from": "gpt",
"value": "\"\"\"\n\"cms.plugin... | python | chosen |
[
{
"from": "system",
"value": "Remove buggy log message if prctl is missing\n\n- it's not that important that you need to be informed of it, and\nimporting logging may cause cyclic dependencies/other problems\n"
},
{
"from": "human",
"value": "import threading\ntry:\n import prctl\n def set... | python | chosen |
[
{
"from": "system",
"value": "check_invariant(): Use the same child->parent \"formula\" used by heapq.py.\n"
},
{
"from": "human",
"value": "\"\"\"Unittests for heapq.\"\"\"\n\nfrom test.test_support import verify, vereq, verbose, TestFailed\n\nfrom heapq import heappush, heappop\nimport random... | python | chosen |
[
{
"from": "system",
"value": "Add FT specs and use unittest.\n"
},
{
"from": "human",
"value": "from selenium import webdriver\n\nbrowser = webdriver.Firefox()\nbrowser.get('http://localhost:8000')\n\nassert 'Django' in browser.title\n"
},
{
"from": "gpt",
"value": "from selenium imp... | python | chosen |
[
{
"from": "system",
"value": "Remove the usage of nargs to avoid different behaviors between chronograph and command line.\n"
},
{
"from": "human",
"value": "import logging\nimport docker\nfrom djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase\n\n\nlog = logging.getLogger... | python | chosen |
[
{
"from": "system",
"value": "Simplify f-string to remove cast\n"
},
{
"from": "human",
"value": "import subprocess\nfrom pathlib import Path\n\npo_path: Path = Path(__file__).resolve().parent\n\n\ndef run_babel(command: str, input: Path, output_file: Path, locale: str):\n subprocess.run(\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix catch-all URLs with prefix\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\nfrom django.views.generic import TemplateView... | python | chosen |
[
{
"from": "system",
"value": "Make sure land filters are set up when testing\n"
},
{
"from": "human",
"value": "from geotrek.land.tests.test_filters import LandFiltersTest\n\nfrom geotrek.trekking.filters import TrekFilterSet\nfrom geotrek.trekking.factories import TrekFactory\n\n\nclass TrekFil... | python | chosen |
[
{
"from": "system",
"value": "Update wront port script to Python3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\nPer kobotoolbox/kobo-docker#301, we have changed the uWSGI port to 8001. This\nprovides a helpful message to anyone still trying to use port 8000\n\"\"\"\n\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Add gtk implementation of open_file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Copyright 2011 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# ... | python | chosen |
[
{
"from": "system",
"value": "Add name to the snapshot extension\n"
},
{
"from": "human",
"value": "from chainer.serializers import npz\nfrom chainer.trainer import extension\n\n\ndef snapshot(savefun=npz.save_npz,\n filename='snapshot_iter_{.updater.iteration}'):\n \"\"\"Return a... | python | chosen |
[
{
"from": "system",
"value": "Check for a user from previously in the pipeline before checking for duplicate user.\n"
},
{
"from": "human",
"value": "from django.contrib.auth import get_user_model\nfrom django.utils.translation import ugettext\nfrom social_auth.exceptions import AuthAlreadyAssoc... | python | chosen |
[
{
"from": "system",
"value": "Add comments on variable settings\n"
},
{
"from": "human",
"value": "import os\nimport re\n\nfrom imap import EmailCheckError, EmailServer\nfrom postgresql import DatabaseServer\n\n\nCSV_FOLDER = os.getcwd()\n\nCSV_NAME_FORMAT = '{year}-{month}-{day}T{hour}{minute}.... | python | chosen |
[
{
"from": "system",
"value": "Bump version 0.19.0rc3 --> 0.19.0rc4\n\nSigned-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io>\n"
},
{
"from": "human",
"value": "import logging\n\n__version__ = \"0.19.0rc3\"\nversion = tuple(__version__.split('.'))\n\nlogging.getLogger(__na... | python | chosen |
[
{
"from": "system",
"value": "Remove Python 2.4 support monkey patch and bump rev\n"
},
{
"from": "human",
"value": "# ***** BEGIN LICENSE BLOCK *****\n#\n# For copyright and licensing please refer to COPYING.\n#\n# ***** END LICENSE BLOCK *****\n__version__ = '0.9.13p1'\n\nfrom pika.connection ... | python | chosen |
[
{
"from": "system",
"value": "Enumerate much more elegant to loop through list elements and regex each.\n"
},
{
"from": "human",
"value": "__author__ = 'shawnmehan'\n\nimport csv, os, re\n\n\n# # first lets open the file, which is tab delimited because of , in description field and others\nwith ... | python | chosen |
[
{
"from": "system",
"value": "Test with Flask-Testing to test POST request\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask_testing import LiveServerTestCase\nfrom myflaskapp.app import create_app\nfrom myflaskapp.settings import DevConfig, ProdConfig\nimport requests\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Print out the new track id.\n"
},
{
"from": "human",
"value": "import fore.apikeys\nimport fore.mixer\nimport fore.database\nimport pyechonest.track\n\nfor file in fore.database.get_many_mp3(status='all'):\n\tprint(\"Name: {} Length: {}\".format(file.filename, file.... | python | chosen |
[
{
"from": "system",
"value": "Replace assertGreaterEqual with assertTrue(a >= b)\n"
},
{
"from": "human",
"value": "from unittest import TestCase\nfrom itertools import repeat, imap, izip, cycle\n\nfrom spicedham.bayes import Bayes\nfrom spicedham import Spicedham\n\n\nclass TestBayes(TestCase):... | python | chosen |
[
{
"from": "system",
"value": "Add author and lincense variables\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\n__version__ = VERSION = '0.0.0'"
},
{
"from": "gpt",
"value": "# -*- encoding: utf-8 -*-\n\n__author__ = 'Sebastian Vetter'\n__version__ = VERSION = '0.0.0'... | python | chosen |
[
{
"from": "system",
"value": "Fix plate-solving on local development mode\n"
},
{
"from": "human",
"value": "# Python\nimport urllib2\n\n# Django\nfrom django.conf import settings\nfrom django.core.files import File\nfrom django.core.files.temp import NamedTemporaryFile\n\n\ndef getFromStorage(i... | python | chosen |
[
{
"from": "system",
"value": "Allow debug and verbose modes to be set directly from config.\n"
},
{
"from": "human",
"value": "import argparse\nimport botconfig\nfrom settings import wolfgame as var\n\n# Todo: Allow game modes to be set via config\n\n# Carry over settings from botconfig into set... | python | chosen |
[
{
"from": "system",
"value": "Test that we reject bad TLS versions\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nTests for the standard library PEP 543 shim.\n\"\"\"\nimport pep543.stdlib\n\nfrom .backend_tests import SimpleNegotiation\n\n\nclass TestSimpleNegotiationStdlib... | python | chosen |
[
{
"from": "system",
"value": "Make Message a subclass of bytes\n"
},
{
"from": "human",
"value": "from .utils import to_bytes\n\n\nclass Message:\n \"\"\"A message recieved from the IRC network.\"\"\"\n\n def __init__(self, raw_message):\n self.raw = raw_message\n self.prefix... | python | chosen |
[
{
"from": "system",
"value": "Use requests to fetch emoji list\n"
},
{
"from": "human",
"value": "# pylint: disable = C0103, C0111\n\n# Standard Library\nimport json\nimport mimetypes\nfrom os import makedirs\nfrom subprocess import check_output\n\n# Third Party\nimport requests\n\ndef list_emoj... | python | chosen |
[
{
"from": "system",
"value": "Add \"since\" parameter to this command\n\nFixes #25\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom creditor.models import RecurringTransaction\nfrom django.core.management.base import BaseCommand, CommandError\n\n\nclass Command(BaseCommand):\n ... | python | chosen |
[
{
"from": "system",
"value": "Test modified a second time, to keep Travis happy.\n"
},
{
"from": "human",
"value": "import json\nimport sys\n\nsys.path.append('..')\nfrom skytap.Labels import Labels # noqa\n\nlabels = Labels()\n\n\ndef test_labels():\n \"\"\"Peform tests relating to labels.\... | python | chosen |
[
{
"from": "system",
"value": "Format new migration file with black\n"
},
{
"from": "human",
"value": "# Generated by Django 3.0.5 on 2020-04-23 12:37\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('product', '0116_auto_20... | python | chosen |
[
{
"from": "system",
"value": "Fix a test with generate_thumbnail\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\nimport os\n\nfrom sigal.image import generate_image, generate_thumbnail\n\nCURRENT_DIR = os.path.dirname(__file__)\nTEST_IMAGE = 'exo20101028-b-full.jpg'\n\n\ndef test_im... | python | chosen |
[
{
"from": "system",
"value": "Use big company list for regex entity extraction\n"
},
{
"from": "human",
"value": "\"\"\"\nFind all company names in a piece of text\n\nextractor = EntityExtractor()\nentities = extractor.entities_from_text(text)\n> ['acme incorporated', 'fubar limited', ...]\n\nTO... | python | chosen |
[
{
"from": "system",
"value": "Add summary to book listing\n"
},
{
"from": "human",
"value": "DEFAULT_FIELDS = [\n 'locales.title',\n 'locales.summary',\n 'locales.description',\n 'locales.lang',\n 'author',\n 'editor',\n 'activities',\n 'url',\n 'isbn',\n 'book_type... | python | chosen |
[
{
"from": "system",
"value": "Decrease pattern timebase to 0.01 sec now that slow-mo bug is fixed\n"
},
{
"from": "human",
"value": "class BlinkyPattern(object):\n def __init__(self, blinkytape):\n self._blinkytape = blinkytape\n self._animated = False\n self._timebase_se... | python | chosen |
[
{
"from": "system",
"value": "Add Widget and WidgetList to namespace\n"
},
{
"from": "human",
"value": "\"\"\"\nWidget functions to generate widgets faster.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nfrom .animation_widget import animation_widget\nfrom .category_widget import category_... | python | chosen |
[
{
"from": "system",
"value": "Fix for whitespace.py so that Windows will save Unix EOLs.\n"
},
{
"from": "human",
"value": "\"\"\"Remove trailing whitespace from files in current path and sub directories.\"\"\"\n\nimport os, glob\n\ndef scanpath(path):\n for filepath in glob.glob(os.path.join(p... | python | chosen |
[
{
"from": "system",
"value": "Fix for the new cloudly APi.\n"
},
{
"from": "human",
"value": "from cloudly.pubsub import Pusher\nfrom cloudly.tweets import Tweets\nfrom cloudly.twitterstream import Streamer\n\nfrom webapp import config\n\n\nclass Publisher(Pusher):\n def publish(self, tweets,... | python | chosen |
[
{
"from": "system",
"value": "Return status code 200 when Device instance already exists\n"
},
{
"from": "human",
"value": "from django.db import IntegrityError\n\nfrom rest_framework.permissions import IsAuthenticated\nfrom rest_framework.views import APIView\nfrom rest_framework.response impor... | python | chosen |
[
{
"from": "system",
"value": "Add versioned path for dynamic library lookup\n"
},
{
"from": "human",
"value": "import glob, os.path, sys\n\n# Add path to hiredis.so load path\npath = glob.glob(\"build/lib*/hiredis/*.so\")[0]\nsys.path.insert(0, os.path.dirname(path))\n\nfrom unittest import *\nf... | python | chosen |
[
{
"from": "system",
"value": "Remove unused Python 2 support\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import # Python 2 only\n\nfrom django.contrib.staticfiles.storage import staticfiles_storage\nfrom django.core.urlresolvers import reverse\nfrom django.template.defaul... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Add domain or and ilike\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom openerp import fields, models\n\nclass Session(models.Model):\n _name = 'openacademy.session'\n\n name = fields.Char(required=True)\n start_date = fi... | python | chosen |
[
{
"from": "system",
"value": "Revert \"change from string to int\"\n\nThis reverts commit a89f8f251ee95609ec4c1ea412b0aa7ec4603252.\n"
},
{
"from": "human",
"value": "'''parse cards according to deck issue mode'''\n\nfrom .pautils import exponent_to_amount\n\n\ndef none_parser(cards):\n '''pa... | python | chosen |
[
{
"from": "system",
"value": "Add query to json output in json generation test"
},
{
"from": "human",
"value": "import unittest\nimport json\n\nimport raco.fakedb\nfrom raco import RACompiler\nfrom raco.language import MyriaAlgebra\nfrom myrialang import compile_to_json\n\n\nclass DatalogTestCas... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Try not importing basal_area_increment to init\"\n\nThis reverts commit 30f9d5367085285a3100d7ec5d6a9e07734c5ccd.\n"
},
{
"from": "human",
"value": "\"\"\"pygypsy\n\nBased on Hueng et all (2009)\n\nHuang, S., Meng, S. X., & Yang, Y. (2009). A growth and yie... | python | chosen |
[
{
"from": "system",
"value": "Add possibility of passing priority for adding an observer\n"
},
{
"from": "human",
"value": "\"\"\"\nInteractor\n\nThis class can be used to simply managing callback resources.\nCallbacks are often used by interactors with vtk and callbacks\nare hard to keep track ... | python | chosen |
[
{
"from": "system",
"value": "Make workload optional when editing vacancies\n\n"
},
{
"from": "human",
"value": "from flask_wtf import Form\nfrom flask_babel import lazy_gettext as _ # noqa\nfrom wtforms import StringField, SubmitField, TextAreaField, \\\n DateField, SelectField\nfrom wtform... | python | chosen |
[
{
"from": "system",
"value": "Fix module packaging thanks to landscape.io hint\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n#\n# In here you will find all the handlers that are tasked with handling the\n# requests specified in the API.\n#\n# From these handlers we will be instan... | python | chosen |
[
{
"from": "system",
"value": "Comment out audo-discovery of addons\n\n"
},
{
"from": "human",
"value": "import sys\nfrom PyQt5.QtWidgets import QApplication\n\nfrom datalogger.bin.workspace import Workspace\nfrom datalogger.analysis_window_testing import AnalysisWindow\n\n\ndef full():\n app ... | python | chosen |
[
{
"from": "system",
"value": "Add ability to specify which settings are used via `export PRODUCTION=0'\n"
},
{
"from": "human",
"value": "# Project Settings - Settings that don't exist in settings.py that you want to\n# add (e.g. USE_THOUSAND_SEPARATOR, GRAPPELLI_ADMIN_TITLE, CELERYBEAT_SCHEDULE... | python | chosen |
[
{
"from": "system",
"value": "Rename misleading parameter name: UnicodeDictReader should have the same interface as csv.DictReader\n"
},
{
"from": "human",
"value": "# work around python2's csv.py's difficulty with utf8\n# partly cribbed from http://stackoverflow.com/questions/5478659/python-mod... | python | chosen |
[
{
"from": "system",
"value": "Add missing username conf for mercurial.\n"
},
{
"from": "human",
"value": "import subprocess\nfrom pytest import mark\nfrom pytest_benchmark.utils import clonefunc, get_commit_info\n\nf1 = lambda a: a\n\n\ndef f2(a):\n return a\n\n\n@mark.parametrize('f', [f1, f... | python | chosen |
[
{
"from": "system",
"value": "Tag provisioning instances to make them easier to identify\n"
},
{
"from": "human",
"value": "# trigger-provision.py <indexer-provision.sh | web-server-provision.sh>\n\nimport boto3\nfrom datetime import datetime, timedelta\nimport sys\nimport os.path\n\nprovisioner... | python | chosen |
[
{
"from": "system",
"value": "Clear S3 API key from code\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nSECRETS = {\n \"AWS_ACCESS_KEY_ID\": \"AKIAI2TRFQV2HZIHUD4A\",\n \"AWS_SECRET_ACCESS_KEY\": \"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\"\n}\n\n"
},
{
"from": "gpt",
"v... | python | chosen |
[
{
"from": "system",
"value": "Add a location destroyed hook\n"
},
{
"from": "human",
"value": "import pytest\n\n\n@pytest.hookspec\ndef pytest_lab_configure(envmanager):\n \"\"\"pytestlab startup\"\"\"\n\n\n@pytest.hookspec(historic=True)\ndef pytest_lab_addroles(config, rolemanager):\n \"... | python | chosen |
[
{
"from": "system",
"value": "Return 0 as an int rather than a string.\n\nThis was causing an ocassional crash in bumblebee/engine.py threshold_state\nwhen checkupdates fails, perhaps due to wifi not being up yet.\n\nFor me this showed up regularly on login.\n"
},
{
"from": "human",
"value": "\"... | python | chosen |
[
{
"from": "system",
"value": "Revert to old entry point.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# Single entry point / dispatcher for simplified running of 'pman'\n\nimport os\nfrom argparse import RawTextHelpFormatter\nfrom argparse import Argu... | python | chosen |
[
{
"from": "system",
"value": "Remove 'lights' command for a while\n"
},
{
"from": "human",
"value": "def proc(command, message):\n return {\n \"data\": {\n \"status\": \"ok\",\n \"html\": \"\"\"\n <p>\n Hi! I can control your Raspberr... | python | chosen |
[
{
"from": "system",
"value": "Make it easier to load the initial page\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Sets up a basic site that can allow two browsers to connect to each\n# other via WebRTC DataChannels, sending connection events via WebSockets.\n\n\nfrom flask import... | python | chosen |
[
{
"from": "system",
"value": "Add error when serializer setup has error\n"
},
{
"from": "human",
"value": "class BaseExcelError(Exception):\n\n def __init__(self, message):\n super(BaseExcelError, self).__init__()\n self.message = message\n\n\nclass ValidationError(BaseExcelErro... | python | chosen |
[
{
"from": "system",
"value": "Make the query docstring a bit clearer\n"
},
{
"from": "human",
"value": "# Copyright ClusterHQ Inc. See LICENSE file for details.\n\"\"\"\nInterfaces for the benchmarking results server.\n\"\"\"\n\nfrom zope.interface import Interface\n\n\nclass IBackend(Interface... | python | chosen |
[
{
"from": "system",
"value": "Fix the path to read the sample file from\n\nGah! so annoying!\n"
},
{
"from": "human",
"value": "import json\n\nsample_path = \"conf/net/int_service/giles_conf.json.sample\"\nf = open(path, \"r\")\ndata = json.loads(f.read())\nf.close()\n\nreal_path = \"conf/net/in... | python | chosen |
[
{
"from": "system",
"value": "Use previews in ranger fzf\n"
},
{
"from": "human",
"value": "from ranger.api.commands import Command\n\nclass fzf_select(Command):\n \"\"\"\n :fzf_select\n\n Find a file using fzf.\n\n With a prefix argument select only directories.\n\n See: https://... | python | chosen |
[
{
"from": "system",
"value": "Add exception for cli command line to run interactively.\n"
},
{
"from": "human",
"value": "# Exception abstract class\nclass CamocoError(Exception):\n pass\n\nclass CamocoExistsError(CamocoError):\n '''\n You tried to create a camoco object which alrea... | python | chosen |
[
{
"from": "system",
"value": "Exclude inactive comics from sets editing, effectively throwing them out of the set when saved\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django import forms\nfrom django.template.defaultfilters import slugify\n\nfrom comics.core.models import Comic\... | python | chosen |
[
{
"from": "system",
"value": "Allow /dev/urandom for PHP 7"
},
{
"from": "human",
"value": "from .php_executor import PHPExecutor\nfrom dmoj.judgeenv import env\n\n\nclass Executor(PHPExecutor):\n name = 'PHP7'\n command = env['runtime'].get('php7')\n fs = ['.*\\.so', '/etc/localtime$',... | python | chosen |
[
{
"from": "system",
"value": "Add few oc wrappers for future resiliency testing\n\nNot used anywhere yet.\n"
},
{
"from": "human",
"value": "\"\"\"Unsorted utility functions used in integration tests.\"\"\"\nimport requests\n\n\ndef download_file_from_url(url):\n \"\"\"Download file from the ... | python | chosen |
[
{
"from": "system",
"value": "Clean the code with autopen8\n"
},
{
"from": "human",
"value": "#[PROTEXCAT]\n#\\License: ALL RIGHTS RESERVED\n\n\"\"\"System boot time\"\"\"\nimport os\nfrom oeqa.oetest import oeRuntimeTest\nfrom oeqa.runtime.helper import collect_pnp_log\n\nclass BootTimeTest(oeR... | python | chosen |
[
{
"from": "system",
"value": "Add pickle convert to json method\n"
},
{
"from": "human",
"value": "import os\nimport cPickle as pickle\nimport simplejson as json\n\n\ndef update_pickle(new_cache):\n # print('Updated pickle')\n pickle.dump(new_cache, open('url_cache.pkl', 'wb'), 2)\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Print out file being processed, need to do to other modules, add -v flag\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom os import path\nimport sh\nfrom nib import Processor, resource\n\n@... | python | chosen |
[
{
"from": "system",
"value": "Make ilock lock name user specific\n"
},
{
"from": "human",
"value": "import pytest\nimport logging\nimport multiprocessing as mp\nfrom oggm import cfg, utils\nimport pickle\n\nlogger = logging.getLogger(__name__)\n\ndef pytest_configure(config):\n if config.plug... | python | chosen |
[
{
"from": "system",
"value": "Fix lemma ordering in test\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nimport pytest\n\n\n# Note: \"chromosomes\" worked previous the bug fix\n@pytest.mark.models('en')\n@pytest.mark.parametrize('word,lemmas', [(\"c... | python | chosen |
[
{
"from": "system",
"value": "Add equality operator to EnvironCredential\n\nEquality operator is useful for testing EnvironCredential\n"
},
{
"from": "human",
"value": "import os\nimport abc\n\n\nclass Credential(metaclass=abc.ABCMeta):\n \"\"\"Abstract class to manage credentials\"\"\"\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Make tests run on sqlite by default\n"
},
{
"from": "human",
"value": "import os\nimport dj_database_url\n\nDATABASES = {\n \"default\": dj_database_url.parse(os.environ[\"DATABASE_URL\"]),\n}\n\nINSTALLED_APPS = (\"django_dbq\",)\n\nMIDDLEWARE_CLASSES = (\n \... | python | chosen |
[
{
"from": "system",
"value": "Update error message of UnsupportedOperationException.\n"
},
{
"from": "human",
"value": "__author__ = 'karl.gong'\n\nfrom .exceptions import UnsupportedOperationException\n\n\ndef SupportedBy(*web_driver_types):\n def handle_func(func):\n def handle_args(... | python | chosen |
[
{
"from": "system",
"value": "Use a better function (lambda) name\n\ngit-svn-id: b0ea89ea3bf41df64b6a046736e217d0ae4a0fba@40 806ff5bb-693f-0410-b502-81bc3482ff28\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Copyright 2007 Neal Norwitz\n# Portions Copyright 2007 Google Inc.\n#\n... | python | chosen |
[
{
"from": "system",
"value": "Fix management command to send notification about new blog post.\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom django.contrib.auth.models import User\n\nfrom zinnia.models import Entry\n\nfrom astrobin.notifications imp... | python | chosen |
[
{
"from": "system",
"value": "Set the tiddlywebwiki binary limit to 1MB.\n"
},
{
"from": "human",
"value": "\"\"\"\nBase configuration for TiddlySpace.\n\nThis provides the basics which may be changed in tidlywebconfig.py.\n\"\"\"\nfrom tiddlywebplugins.instancer.util import get_tiddler_location... | python | chosen |
[
{
"from": "system",
"value": "Add first set of exercises.\n"
},
{
"from": "human",
"value": "# Charles Robison\n# 2016.10.18\n# Dictionary and Set Lab\n\n# Create a dictionary containing “name”, “city”, and “cake”\n# for “Chris” from “Seattle” who likes “Chocolate”.\n\nd = {'name': 'Chris', 'cit... | python | chosen |
[
{
"from": "system",
"value": "Customize a ChunkList just for IFF chunks\n"
},
{
"from": "human",
"value": "import collections\r\nimport io\r\n\r\nfrom steel.fields.numbers import BigEndian\r\nfrom steel import fields\r\nfrom steel.chunks import base\r\n\r\n__all__ = ['Chunk', 'Form']\r\n\r\n\r\n... | python | chosen |
[
{
"from": "system",
"value": "Use the newer PostUpdate instead of PostMedia\n"
},
{
"from": "human",
"value": "import twitter\nfrom django.core.management.base import BaseCommand\nfrom django.conf import settings\n\nfrom core.models import Tweet\n\nclass Command(BaseCommand):\n help = \"Send ... | python | chosen |
[
{
"from": "system",
"value": "[NG] Set max celery connections to 1.\n"
},
{
"from": "human",
"value": "import os\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n\nclass Config(object):\n DEBUG = False\n TESTING = False\n CSRF_ENABLED = True\n SQLALCHEMY_TRACK_MODIFICATIONS =... | python | chosen |
[
{
"from": "system",
"value": "Extend base settings for test settings. Don't use live cache backend for tests.\n"
},
{
"from": "human",
"value": "from ._develop import *\n\n# DJANGO ######################################################################\n\nDATABASES['default'].update({\n 'TEST'... | python | chosen |
[
{
"from": "system",
"value": "Make assert statement rich in pytest\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom .api import record # noqa: F401\n\n__version__ = '1.0.0'\n"
},
{
"from... | python | chosen |
[
{
"from": "system",
"value": "Add test for commit to empty repo case\n"
},
{
"from": "human",
"value": "import git_pre_commit_hook_utils as utils\n\n\ndef test_is_python_code_by_path():\n file_at_index = utils.FileAtIndex(\n contents='',\n size=0,\n mode='',\n sha1... | python | chosen |
[
{
"from": "system",
"value": "Test importing of module with unexisting target inside\n\nThere's a coverage case where a module exists, but what's inside it\nisn't covered.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, unicode_... | python | chosen |
[
{
"from": "system",
"value": "Use nose.tools explicitly; test for port\n"
},
{
"from": "human",
"value": "from nose.tools import raises\n\nimport panoptes\nfrom panoptes.mount.ioptron import Mount\n\nclass TestIOptron():\n\n\t@raises(AssertionError)\n\tdef test_no_config_no_commands(self):\n\t\t... | python | chosen |
[
{
"from": "system",
"value": "Access docutils standard nodes through nodes.*\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n sphinxcontrib-reviewbuilder\n ~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: Copyright 2013 by the WAKAYAMA Shirou\n :license: LGPLv2, see LICE... | python | chosen |
[
{
"from": "system",
"value": "Use FileField instead of ImageField, we don't need PIL in this demo.\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Picture(models.Model):\n\n file = models.ImageField(upload_to=\"pictures\")\n slug = models.SlugField(max_length=50, b... | python | chosen |
[
{
"from": "system",
"value": "Implement base json extraction to collection functionality\n"
},
{
"from": "human",
"value": "from DataObjects.Collection import Collection\nfrom ObjectFactories.ItemFactory import ItemFactory\nimport json\n\ndef main():\n updateCollection(\n Collection('i... | python | chosen |
[
{
"from": "system",
"value": "Fix duplicate captcha import check\n"
},
{
"from": "human",
"value": "from django.core.exceptions import ImproperlyConfigured\n\ntry:\n from captcha.fields import ReCaptchaField as CaptchaField\nexcept ImportError:\n try:\n from captcha.fields import Ca... | python | chosen |
[
{
"from": "system",
"value": "TST: Update test to match API.\n"
},
{
"from": "human",
"value": "\"\"\"\nDraw a solid circle off center in a blank image.\nUse the same array as both the image and the mask.\nThe tiles should subdivide along the curved edge to trace out a smooth circle.\n\"\"\"\nfr... | python | chosen |
[
{
"from": "system",
"value": "Add print function to demonstrate func calling\n"
},
{
"from": "human",
"value": "import datetime\nimport csv\n\n\n# Question 1\n# ----------\n# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app\n# users sh... | python | chosen |
[
{
"from": "system",
"value": "Add period to end of long comment\n"
},
{
"from": "human",
"value": "import errno\nimport os\n\n\ndef file_exists(path):\n \"\"\"Return True if a file exists at `path` (even if it can't be read),\n otherwise False.\n\n This is different from os.path.isfile ... | python | chosen |
[
{
"from": "system",
"value": "Remove debugging print statement from changeMarginWidth\n"
},
{
"from": "human",
"value": "from PyQt5.Qsci import QsciScintilla, QsciLexerPython\n\n\nclass TextArea(QsciScintilla):\n def __init__(self):\n super().__init__()\n\n self.filePath = \"Unt... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.