conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Split `urls.py` to separate modules\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='mcrypto',\n version='0.1',\n author='Pavel Brodsky',\n author_email='mcouthon@gmail.com',\n packages=[\n 'mcrypto',\n ... | python | chosen |
[
{
"from": "system",
"value": "Bump version for new pypi dist\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(name='optfunc-ysimonson',\n version='0.1.1',\n description='Generate commandline flags from function arguments.',\n au... | python | chosen |
[
{
"from": "system",
"value": "Improve qpixmap test to support qstring and qsize arguments.\n\nReviewed by Marcelo Lira <marcelo.lira@openbossa.org>\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QPixmap\nfrom PySide.QtCore impo... | python | chosen |
[
{
"from": "system",
"value": "Add filename to image search\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom icekit.utils.admin.mixins import ThumbnailAdminMixin\n\nfrom . import models\n\n\nclass ImageAdmin(ThumbnailAdminMixin, admin.ModelAdmin):\n list_display = ['... | python | chosen |
[
{
"from": "system",
"value": "wa: Add ApkWorkload to default imports\n"
},
{
"from": "human",
"value": "from wa.framework import pluginloader, signal\nfrom wa.framework.command import Command, ComplexCommand, SubCommand\nfrom wa.framework.configuration import settings\nfrom wa.framework.configur... | python | chosen |
[
{
"from": "system",
"value": "fix(discord): Switch to new API domain\n"
},
{
"from": "human",
"value": "import requests\n\nfrom allauth.socialaccount.providers.discord.provider import DiscordProvider\nfrom allauth.socialaccount.providers.oauth2.views import (\n OAuth2Adapter,\n OAuth2Callb... | python | chosen |
[
{
"from": "system",
"value": "Fix * imports for building UML with Python3\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n"
},
{
"from": "human",
"value": "from gaphor.UML.collection import collection\n\nfrom gaphor.UML.uml2 import *\nfrom gaphor.UML.elementfactory... | python | chosen |
[
{
"from": "system",
"value": "Add search to events API\n"
},
{
"from": "human",
"value": "import json\n\nimport pytest\nfrom django.utils.encoding import force_text\n\nfrom gore.models import Event\nfrom gore.tests.data import exc_payload\n\n\n@pytest.mark.django_db\ndef test_events_api(project,... | python | chosen |
[
{
"from": "system",
"value": "Use xdg-screensaver instead of xset\n"
},
{
"from": "human",
"value": "# pylint: disable=C0111,R0903\n\n\"\"\"Enable/disable automatic screen locking.\n\nRequires the following executables:\n * xset\n * notify-send\n\"\"\"\n\nimport bumblebee.input\nimport bum... | python | chosen |
[
{
"from": "system",
"value": "Convert HTTP404 to a function.\n"
},
{
"from": "human",
"value": "\"\"\"\nClient Error HTTP Status Callables\n\"\"\"\n\n\nclass HTTP404(object):\n \"\"\"\n HTTP 404 Response\n \"\"\"\n\n def __call__(self, environ, start_response):\n start_respons... | python | chosen |
[
{
"from": "system",
"value": "Simplify configure of django settings\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom mock import Mock, patch\nfrom unittest2 import TestCase\n\nsettings.configure(\n DEFAULT_INDEX_TABLESPACE='',\n)\n\n\nclass TestPreference(object):\n ... | python | chosen |
[
{
"from": "system",
"value": "Set default logging level to INFO\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nimport logging\n\nlogging.basicConfig(level=logging.ERROR,\n format='%(relativeCreated)6d %(threadName)s %(mes... | python | chosen |
[
{
"from": "system",
"value": "Add __getitem__ test for AppSettings\n"
},
{
"from": "human",
"value": "from app.models import Setting\nfrom tests.general import AppTestCase\n\n\nclass TestAppSettings(AppTestCase):\n def test_setting_creation(self):\n self.app.config['SETTINGS']['foo'] =... | python | chosen |
[
{
"from": "system",
"value": "Add default imports back in\n"
},
{
"from": "human",
"value": "#\n# -*- coding: utf-8 -*-\n"
},
{
"from": "gpt",
"value": "#\n# -*- coding: utf-8 -*-\nfrom .cmd2 import __version__, Cmd, AddSubmenu, CmdResult, categorize\nfrom .cmd2 import with_argument_... | python | chosen |
[
{
"from": "system",
"value": "Correct the way we set ADMINS\n"
},
{
"from": "human",
"value": "from settings import *\n\nOHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'\nDEBUG=False\nADMINS=['all@openhatch.org']\n\nINVITE_MODE=True # Enabled on production site\nINVITATIONS_PER_USER=20\n\nTEMPLTE_DEBUG=Fal... | python | chosen |
[
{
"from": "system",
"value": "Set default server host address to 127.0.0.1\n"
},
{
"from": "human",
"value": "import os\n\napp_config = {\n 'DEBUG': bool(os.getenv('DEBUG', True)),\n 'REDIS_DB': int(os.getenv('REDIS_DB', 1)),\n 'REDIS_HOST': os.getenv('REDIS_HOST', '127.0.0.1'),\n 'R... | python | chosen |
[
{
"from": "system",
"value": "Set order getting the list of tasks\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.conf import settings\n\n\nclass Task(models.Model):\n title = models.CharField(max_length=50, unique=True)\n created_at = models.DateField()\n s... | python | chosen |
[
{
"from": "system",
"value": "Add pm2.5 avg view api\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nfrom rest_framework import viewsets\nfrom .models import AirCondition, AirAverage\nfrom .serializers import AirAverageSerializer, AirConditionSerializer\n\n\nclass AirConditionViewSets(views... | python | chosen |
[
{
"from": "system",
"value": "[libzookeeper] Enable Kerberos automatically based on HDFS security\n\nWe don't need another property that way and Kerberos is a all or nothing\nsetup.\nEven if HDFS is not used in Hue, the default hue.ini has security set\nto false.\n"
},
{
"from": "human",
"value"... | python | chosen |
[
{
"from": "system",
"value": "Use plat_specific site-packages dir in CI script\n"
},
{
"from": "human",
"value": "import distutils.sysconfig\nfrom glob import glob\nimport os\nfrom os.path import join as pjoin, basename\nfrom shutil import copy\nfrom sys import platform\n\ndef main():\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "DanielWagnerHall: Fix test as well :)\n\ngit-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@17825 07704840-8298-11de-bf8c-fd130f914ac9\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\n# Copyright 2012 Software Freedom Conservancy.\n#\n# Licensed under the A... | python | chosen |
[
{
"from": "system",
"value": "Remove leading underscores from variables.\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 self.fields = fields\... | python | chosen |
[
{
"from": "system",
"value": "Fix argparse of caffe model download script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom __future__ import print_function\nimport argparse\n\nimport six\n\n\nparser = argparse.ArgumentParser(\n descriptor='Download a Caffe reference model')\npar... | python | chosen |
[
{
"from": "system",
"value": "Check for `GNdr` grammeme in `gender-match` label\n"
},
{
"from": "human",
"value": "GENDERS = (\"masc\", \"femn\", \"neut\", \"Ms-f\")\n\ndef gram_label(token, value, stack):\n return value in token.grammemes\n\ndef gram_not_label(token, value, stack):\n ret... | python | chosen |
[
{
"from": "system",
"value": "Make sure the target of Say isn't in Unicode, otherwise Twisted complains\n"
},
{
"from": "human",
"value": "from CommandTemplate import CommandTemplate\nfrom IrcMessage import IrcMessage\n\n\nclass Command(CommandTemplate):\n\ttriggers = ['say', 'do', 'notice']\n\t... | python | chosen |
[
{
"from": "system",
"value": "Update blender plugin version to the next release number\n"
},
{
"from": "human",
"value": "\nbl_info = {\n 'name': \"Import: .EDM model files\",\n 'description': \"Importing of .EDM model files\",\n 'author': \"Nicholas Devenish\",\n 'version': (0,0,1),\n 'ble... | python | chosen |
[
{
"from": "system",
"value": "Add PYTHON_ARGCOMPLETE_OK to enable completion for argcomplete users\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argh\nimport argparse\n\nfrom cr8 import __version__\nfrom cr8.timeit import timeit\nfrom cr8.insert_json... | python | chosen |
[
{
"from": "system",
"value": "Check if error available on output\n"
},
{
"from": "human",
"value": "\"\"\"Test mixins.\"\"\"\n\nimport os\nimport sys\n\nimport six\n\nfrom django.core.management import call_command\n\n\nclass CallCommandMixin(object):\n \"\"\"A mixin to provide command execut... | python | chosen |
[
{
"from": "system",
"value": "MOX-182: Handle missing external files gracefully\n"
},
{
"from": "human",
"value": "from email.utils import formatdate\nfrom datetime import datetime, timedelta\nfrom time import mktime\n\nfrom django.shortcuts import get_object_or_404\nfrom django.http import Http... | python | chosen |
[
{
"from": "system",
"value": "Add embed site freeze generator\n\nFix tabs/spaces issue as well"
},
{
"from": "human",
"value": "\nfrom offenerhaushalt.core import freezer, pages, sites\n\n@freezer.register_generator\ndef page():\n\tfor page in pages:\n\t\tyield {'path': page.path}\n\n@freezer.re... | python | chosen |
[
{
"from": "system",
"value": "Handle missing accounts on HaveIBeenPwned properly.\n"
},
{
"from": "human",
"value": "import plumeria.util.http as http\nfrom plumeria import config\nfrom plumeria.command import commands, CommandError\nfrom plumeria.command.parse import Text\nfrom plumeria.message... | python | chosen |
[
{
"from": "system",
"value": "Allow plain values, not just methods\n"
},
{
"from": "human",
"value": "class context_variable(object):\n\n def __init__(self, func):\n self.func = func\n self.__doc__ = func.__doc__\n\n def __get__(self, obj, objtype=None):\n # Handle cas... | python | chosen |
[
{
"from": "system",
"value": "Update licensing info on version file\n"
},
{
"from": "human",
"value": "\n# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding c... | python | chosen |
[
{
"from": "system",
"value": "Make the widget experimental error a real python warning\n\nThis means it can easily be turned off too.\n"
},
{
"from": "human",
"value": "from .widget import Widget, DOMWidget, CallbackDispatcher, register\n\nfrom .widget_bool import Checkbox, ToggleButton\nfrom .w... | python | chosen |
[
{
"from": "system",
"value": "Add sound level to influx\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nfrom local_settings import *\nfrom utils import SensorConsumerBase\nimport redis\nimport datetime\nimport sys\n\nclass DustNode(SensorConsumerBase):\n def __init__(self):\n Sens... | python | chosen |
[
{
"from": "system",
"value": "Fix tests for Django 1.10\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\n\n# Uncomment the next two lines to enable the admin:\n# from django.contrib import admin\n# admin.autodiscover()\n\nurlpatterns = patterns('',\n # E... | python | chosen |
[
{
"from": "system",
"value": "Fix bill table missed column\n"
},
{
"from": "human",
"value": "{\n PDBConst.Name: \"bill\",\n PDBConst.Columns: [\n {\n PDBConst.Name: \"ID\",\n PDBConst.Attributes: [\"int\", \"not null\", \"auto_increment\", \"primary key\"]\n },\n {\... | python | chosen |
[
{
"from": "system",
"value": "Connect signal callback using the model class as sender.\n"
},
{
"from": "human",
"value": "# 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 not distributed with this\n# file, you can obtain one at ht... | python | chosen |
[
{
"from": "system",
"value": "Fix import of rotate function\n"
},
{
"from": "human",
"value": "from .hough_transform import *\nfrom .radon_transform import *\nfrom .finite_radon_transform import *\nfrom .integral import *\nfrom ._geometric import (estimate_transform,\n Si... | python | chosen |
[
{
"from": "system",
"value": "Remove left over merge conflict text\n"
},
{
"from": "human",
"value": "\"\"\"Base test class with methods implemented for Django testing.\"\"\"\n\nfrom django.test import TestCase\nfrom django.contrib.auth.models import User\nfrom django.test.client import Client\n... | python | chosen |
[
{
"from": "system",
"value": "Make NickServIdentify play nice with service specific configs\n"
},
{
"from": "human",
"value": "from twisted.plugin import IPlugin\nfrom heufybot.moduleinterface import BotModule, IBotModule\nfrom zope.interface import implements\nimport logging\n\n\nclass NickServ... | python | chosen |
[
{
"from": "system",
"value": "Comment out fix_fee_product_index from migration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.22 on 2019-10-31 16:33\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, OperationalError, Programming... | python | chosen |
[
{
"from": "system",
"value": "Remove assert line from import\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom contextlib import contextmanager\nfrom django.conf import settings\ntry:\n from django.conf.urls.defaults import patterns, url, include\n assert all((patterns, url,... | python | chosen |
[
{
"from": "system",
"value": "Fix undefined reference error in command line KeepKey plugin.\n"
},
{
"from": "human",
"value": "from electrum.util import print_msg, raw_input\nfrom .keepkey import KeepKeyPlugin\nfrom ..hw_wallet import CmdLineHandler\n\nclass Plugin(KeepKeyPlugin):\n handler =... | python | chosen |
[
{
"from": "system",
"value": "Add new-style TEMPLATES setting for tests\n"
},
{
"from": "human",
"value": "import sys\n\nimport django\nfrom colour_runner.django_runner import ColourRunnerMixin\nfrom django.conf import settings\n\n\nsettings.configure(\n DATABASES={\n 'default': {\n ... | python | chosen |
[
{
"from": "system",
"value": "Add api_key to filtered variables.\n\nWe don't use it yet, but the plan is the migrate there and it's better\nto just have the filtering in place.\n\n(imported from commit d0e7f40e8a439b8e8751da954e79b5f67226e5a9)\n"
},
{
"from": "human",
"value": "from __future__ i... | python | chosen |
[
{
"from": "system",
"value": "Change paths in PML-XML tool\n"
},
{
"from": "human",
"value": "#!/usr/bin/env/python\n\nimport sys\nimport os.path\nimport subprocess\n\n\n# Read in a pml file and save to an xml file\ndef translate_pml_file(xml_file, pml_file):\n\n pml_path = os.path.abspath(pm... | python | chosen |
[
{
"from": "system",
"value": "Adjust for pep8 package rename.\n\nCloses #1\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nAlways ignore lines with '# noqa'\n\"\"\"\n__version__ = 0.2\n\nimport pep8\n\n\nclass RespectNoqaReport(pep8.StandardReport):\n\n def error(self, lin... | python | chosen |
[
{
"from": "system",
"value": "Improve templatetag to use either prefix or ...\n\napp/model\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.conf import settings\n\nfrom generic_scaffold import get_url_names\n\nregister = template.Library()\n\n@register.simple_tag\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Add date and social media fields to proposal\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom pyconcz_2016.conferences.models import Conference\n\n\nclass Cfp(models.Model):\n conference = models.ForeignKey(Conference, related_name=\"cfps\"... | python | chosen |
[
{
"from": "system",
"value": "Modify main.py tests to use get_anchorhub_path()\n"
},
{
"from": "human",
"value": "\"\"\"\ntest_main.py - Tests for main.py\n\nmain.py:\nhttp://www.github.com/samjabrahams/anchorhub/main.py\n\"\"\"\nfrom nose.tools import *\n\nimport anchorhub.main as main\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Change logger messages to info\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nimport urllib2\n\nfrom openerp.http import request\nfrom openerp.osv import orm\n\nlogger = logging.getLogger(__name__)\n\nclass ir_http(orm.AbstractModel):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use an absolute Path for localization tests\n"
},
{
"from": "human",
"value": "import os\nimport platform\nimport subprocess\nimport unittest\n\n\nclass TestLocaleNormalization(unittest.TestCase):\n\n LOCALE_PATH = \"survey/locale/\"\n\n def test_normalization... | python | chosen |
[
{
"from": "system",
"value": "Use more robust quickfix parser.\n\nThe yamllint implementation had some issues that the common code does\nnot.\n"
},
{
"from": "human",
"value": "import os\nimport logging\nfrom lintreview.tools import Tool\nfrom lintreview.tools import run_command\nfrom lintreview... | python | chosen |
[
{
"from": "system",
"value": "Fix the failing dns test on Windows\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Import Python libs\nfrom __future__ import absolute_import\n\n# Import Salt Testing libs\nfrom tests.support.case import ModuleCase\nfrom tests.support.unit import sk... | python | chosen |
[
{
"from": "system",
"value": "Add keystone to the request\n"
},
{
"from": "human",
"value": "\ndefault_settings = [\n ('auth_url', str, 'http://localhost:5000/v3'),\n ('region', str, 'RegionOne'),\n ('user_domain_name', str, 'Default'),\n ('cacert', str, ''),\n]\n\nde... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Correct renamed module names for bank-statement-import repository.\n"
},
{
"from": "human",
"value": "\"\"\" Encode any known changes to the database here\nto help the matching process\n\"\"\"\n\nrenamed_modules = {\n 'base_calendar': 'calendar',\n 'mrp_... | python | chosen |
[
{
"from": "system",
"value": "Remove dependency check done by Mopidy\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport os\n\nfrom mopidy import config, exceptions, ext\n\n\n__version__ = '0.2.2'\n\n\nclass GMusicExtension(ext.Extension):\n\n dist_name = 'Mop... | python | chosen |
[
{
"from": "system",
"value": "API: Put fill_event in the public API.\n"
},
{
"from": "human",
"value": "from .simple_broker import (_DataBrokerClass, EventQueue, Header,\n LocationError, IntegrityError)\nfrom .handler_registration import register_builtin_handlers\nData... | python | chosen |
[
{
"from": "system",
"value": "Improve handling of SKIP_LONG_TESTS build variable.\n"
},
{
"from": "human",
"value": "import os, unittest\n\n\"\"\"This module long_test provides a decorator, @long_test, that you can use to\nmark tests which take a lot of wall clock time.\n\nIf the system environm... | python | chosen |
[
{
"from": "system",
"value": "Remove `_allowed_symbols`, this is no longer used by the document generation.\n\nPiperOrigin-RevId: 321657180\n"
},
{
"from": "human",
"value": "# Copyright 2018, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"... | python | chosen |
[
{
"from": "system",
"value": "Remove useless test about model representation\n"
},
{
"from": "human",
"value": "# -*- coding: UTF-8 -*-\nfrom tests.base import ApiDBTestCase\n\n\nclass BaseModelTestCase(ApiDBTestCase):\n\n def test_repr(self):\n self.generate_fixture_project_status()\n... | python | chosen |
[
{
"from": "system",
"value": "Test Cache root level dictionary update via apply_changes\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport unittest\nfrom collections import OrderedDict\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\"))\n\n# import logging\n# logging.... | python | chosen |
[
{
"from": "system",
"value": "Add _fields cache\nChange _update to _apply and add option for non-required fields\n"
},
{
"from": "human",
"value": "\nfrom collections import defaultdict\nfrom inspect import classify_class_attrs\n\nfrom django.forms import ValidationError\nfrom django.utils.funct... | python | chosen |
[
{
"from": "system",
"value": "Put Synchrophasor in a seperate file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport asyncio\nfrom .parser import Parser, PcapParser\nfrom .client import Client\nfrom .pdc import PDC\n\nimport logging\nlogging.getLogger(__name__).addHandler(logging... | python | chosen |
[
{
"from": "system",
"value": "Use ModelSelectField. Javascript still broken for some reason.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom django_se... | python | chosen |
[
{
"from": "system",
"value": "Enhance our plotter to use the new div_markers code\n\nAnd to generate popups correctly\n"
},
{
"from": "human",
"value": "import pandas as pd\nimport folium\n\ndef get_map_list(df, potential_splits):\n mapList = []\n potential_splits_list = list(potential_spl... | python | chosen |
[
{
"from": "system",
"value": "Fix error caused by moving function setup_logging\n"
},
{
"from": "human",
"value": "from bsAbstimmungen import setup_logging\n\nsetup_logging('tests/test-logging.json')\n"
},
{
"from": "gpt",
"value": "from bsAbstimmungen.utils import setup_logging\n\ns... | python | chosen |
[
{
"from": "system",
"value": "Add finalize method to Integration.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nclass Integration(object):\n\n name = None\n description = None\n icon = None\n banner = None\n requires_confirmation = False\n enabled_by_default =... | python | chosen |
[
{
"from": "system",
"value": "Remove unused and buggy import\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nfrom openfisca_core.tools import assert_near\n\n\nfrom openfisca_france.tests.base import get_cached_composed_reform, get_cached_reform\nfrom .. import france_data_tax_ben... | python | chosen |
[
{
"from": "system",
"value": "Update distutils patch to monkeypatch all paths from sys.path to ensure that distutils is never imported except from the same path as setuptools. Assert that 'distutils' is not already in sys.modules.\n"
},
{
"from": "human",
"value": "\"\"\"\nEnsure that the local ... | python | chosen |
[
{
"from": "system",
"value": "Add support for rendering with a URL prefix\n\nThis adds an optional MEDUSA_URL_PREFIX setting option that causes Django's URL\nreversing to render URLS prefixed with this string. This is necessary when\nhosting Django projects on a URI path other than /, as a proper WSGI envir... | python | chosen |
[
{
"from": "system",
"value": "Change URL scheme `user` to `users`\n"
},
{
"from": "human",
"value": "\"\"\"nightreads URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.9/topics/http/urls/\nExamples:\nFuncti... | python | chosen |
[
{
"from": "system",
"value": "Send email to client working\n"
},
{
"from": "human",
"value": "# coding: utf-8\n# ! /usr/bin/python\n__author__ = 'Shahariar Rabby'\n\n\n# # Sendy\n# ### Importing Send mail file\n\n# In[6]:\n\nfrom Sendmail import *\n\n\n# ** Take user email, text plan massage, HT... | python | chosen |
[
{
"from": "system",
"value": "Update the docblock of the example\n"
},
{
"from": "human",
"value": "\"\"\"`Factory` providers deep init injections example.\"\"\"\n\nfrom dependency_injector import providers\n\n\nclass Regularizer:\n def __init__(self, alpha):\n self.alpha = alpha\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Load at a distance content in updatadata command\n"
},
{
"from": "human",
"value": "\"\"\"Module for the custom Django updatedata command.\"\"\"\n\nfrom django.core import management\n\n\nclass Command(management.base.BaseCommand):\n \"\"\"Required command class ... | python | chosen |
[
{
"from": "system",
"value": "Make a real json response.\n"
},
{
"from": "human",
"value": "import json\n\nfrom flask import abort\nfrom flask import Flask\nfrom flask_caching import Cache\nfrom flask_cors import CORS\n\nimport main\n\n\napp = Flask(__name__)\ncache = Cache(app, config={'CACHE_T... | python | chosen |
[
{
"from": "system",
"value": "Fix usage of `url_title` in CategoryAdmin.\n"
},
{
"from": "human",
"value": "from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin\nfrom django.contrib import admin\n\nfrom .models import Category, Faq\n\n\n@admin.register(Faq)\nclass FaqAdmin(SearchMetaBaseAdmi... | python | chosen |
[
{
"from": "system",
"value": "Print Hello World in Python\n"
},
{
"from": "human",
"value": "# Python program for Programming for Everybody (Getting Started with Python) by University of Michigan - Charles Severance\n# Task 1 Python code with single print statement but not print hello world\npri... | python | chosen |
[
{
"from": "system",
"value": "Fix OAuth integration for all wiki families\n\nEarlier you needed to edit config file to set family to\nwhatever you were working on, even if you constructed a\nSite object referring to other website. This would cause\nfunky errors about 'Logged in as X, expected None' errors.\... | python | chosen |
[
{
"from": "system",
"value": "Ch05: Raise 404 Error if no Tag exists.\n"
},
{
"from": "human",
"value": "from django.http.response import HttpResponse\nfrom django.template import Context, loader\n\nfrom .models import Tag\n\n\ndef homepage(request):\n tag_list = Tag.objects.all()\n templa... | python | chosen |
[
{
"from": "system",
"value": "Declare immutable fields in SuperMessageNode\n\nSigned-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>\n"
},
{
"from": "human",
"value": "from .abstract_node import AbstractMessageNode\n\n\nclass SuperMessageNode(AbstractMessageNode):\n... | python | chosen |
[
{
"from": "system",
"value": "Handle ctrl-C-ing out of palm-log\n"
},
{
"from": "human",
"value": "import subprocess\n\nfrom paver.easy import *\n\n\ndef call(*args, **kwargs):\n return subprocess.call(args, **kwargs)\n\n\n@task\ndef build():\n \"\"\"Package up the app.\"\"\"\n call('pa... | python | chosen |
[
{
"from": "system",
"value": "Revert splitString to former value\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#splitString='images/clean/impc/'\nsplitString='images/holding_area/impc/'\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\nsplitString='images/clean/impc/'\n"
... | python | chosen |
[
{
"from": "system",
"value": "Use click.echo() for python 2.7 compatibility\n"
},
{
"from": "human",
"value": "import logging\n\nfrom regparser.tree.depth import optional_rules\nfrom regparser.tree.depth.derive import derive_depths\n\nimport click\n\nlogger = logging.getLogger(__name__)\n\n\n@cl... | python | chosen |
[
{
"from": "system",
"value": "Allow enum to be created more easily\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\n\n# http://stackoverflow.com/a/22723724/1798491\nclass Enum(object):\n def __init__(self, tuple_list):\n self.tuple_list = t... | python | chosen |
[
{
"from": "system",
"value": "Enable initial user via service so that an event gets written\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"Create an initial user with admin privileges to begin BYCEPS setup.\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD,... | python | chosen |
[
{
"from": "system",
"value": "Set up Flask-User to provide user auth\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_migrate import Migrate\nfrom flask_mail import Mail\n\napp = Flask(__name__)\napp.config.from_object('config')\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Set slug field readonly after channel create\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom .models import Channel\n\n\nclass ChannelAdminFo... | python | chosen |
[
{
"from": "system",
"value": "Remove skip of service-type management API test\n\nAdvanced services split is complete so remove the skip\nfor the service-type management API test.\n\n(Yes, there is only one placeholder test. More tests\nneed to be developed.)\n\nAlso remove the obsolete 'JSON' suffix from th... | python | chosen |
[
{
"from": "system",
"value": "Throw exceptions error responses from server\n"
},
{
"from": "human",
"value": "import requests\nimport json\nfrom datetime import datetime\n\n\ndef _json_serial(obj):\n \"\"\"JSON serializer for objects not serializable by default json code\"\"\"\n if isinsta... | python | chosen |
[
{
"from": "system",
"value": "Include recently added matchers in callee.__all__\n"
},
{
"from": "human",
"value": "\"\"\"\ncallee\n\"\"\"\n__version__ = \"0.0.1\"\n__description__ = \"Argument matcher for unittest.mock\"\n__author__ = \"Karol Kuczmarski\"\n__license__ = \"Simplified BSD\"\n\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Add nocov for lines that will never normally run\n"
},
{
"from": "human",
"value": "\"\"\"\nEntrypoint module, in case you use `python -mtmod_tools`.\n\n\nWhy does this file exist, and why __main__? For more info, read:\n\n- https://www.python.org/dev/peps/pep-0338/... | python | chosen |
[
{
"from": "system",
"value": "Fix the migration so it takes care of bad default for resource links.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n d... | python | chosen |
[
{
"from": "system",
"value": "Add stdout flushing statements to example.\n\nThis forces the prints to happen right away, so the example behaves a little\nmore like you'd expect.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\nfrom IPython.kernel import client\nimpo... | python | chosen |
[
{
"from": "system",
"value": "Fix catch all URL to allow APPEND_SLASH to work"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include\nfrom django.views.generic import TemplateView\nfrom django.contrib import admin\n\nadmin.autodiscover()\n\n\nurlpatterns = patterns(\n ... | python | chosen |
[
{
"from": "system",
"value": "Clear cache when user changes info.\n"
},
{
"from": "human",
"value": "from django.core.cache.utils import make_template_fragment_key\nfrom django.db.models.signals import post_save\nfrom django.dispatch import receiver\nfrom django.core.cache import cache\nfrom .mo... | python | chosen |
[
{
"from": "system",
"value": "Add count and allow errors to pass for now\n\n[skip ci]\n"
},
{
"from": "human",
"value": "import sys\nimport logging\n\nfrom scripts import utils as script_utils\nfrom framework.transactions.context import TokuTransaction\n\nfrom website.app import init_app\nfrom w... | python | chosen |
[
{
"from": "system",
"value": "Switch to automated git clone and pull\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\n\ndependencies = (\n ('bins/el-rando', 'https://github.com/EvanHahn/el-rando.git'),\n ('bins/is_github_up', 'https://github.com/EvanHahn/is-GitHub-up.... | python | chosen |
[
{
"from": "system",
"value": "Add comment about new script logic [skip CumulusCI-Test]\n"
},
{
"from": "human",
"value": "import argparse\nimport os\nimport sys\nfrom github3 import login\n\nclass HasOpenPull(object):\n\n def __init__(self):\n self._init_github()\n\n def _init_githu... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.