conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Adjust for compatibility with Python 2.5\n"
},
{
"from": "human",
"value": "import collections\n\ndef quacks_like_dict(object):\n \"\"\"Check if object is dict-like\"\"\"\n return isinstance(object, collections.Mapping)\n \ndef deep_merge(a, b):\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Validate that Article.slug and press are unique_together.\n"
},
{
"from": "human",
"value": "from django import forms\nfrom micropress.models import Article, Section, Press\n\n\nclass ArticleForm(forms.ModelForm):\n section = forms.ModelChoiceField(Section.object... | python | chosen |
[
{
"from": "system",
"value": "Improve error output when detect unsupported color\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nfrom os import path\nimport sys\n\nimport yaml\n\n\ndef get_config():\n \"\"\"Get the... | python | chosen |
[
{
"from": "system",
"value": "Fix get_host() to return host list\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nAnsibleInventory:\n\nINTRO:\n\nUSAGE:\n\n\"\"\"\n\nimport os\nimport ansible.inventory\n\n\nclass AnsibleInventory(object):\n '''\n ... | python | chosen |
[
{
"from": "system",
"value": "Make UserDict usage compatible with Python3\n"
},
{
"from": "human",
"value": "# Original algorithm by Xavier Defrang.\n# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81330\n# This implementation by alane@sourceforge.net.\n\nimport re\nimport UserDict\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix import SUPERUSER_ID in project_issue migration scripts\n\nFound error:\r\n\r\n2014-07-18 17:04:11,710 8772 ERROR v8mig openerp.modules.migration: module project_issue: Unable to load post-migration file project_issue/migrations/8.0.1.0/post-migration.py\r\nTraceback (most r... | python | chosen |
[
{
"from": "system",
"value": "Use a slightly friendlier string than UUID for email addresses.\n"
},
{
"from": "human",
"value": "from google.appengine.ext import db\nimport uuid\n\nclass EmailUser(db.Model):\n # the email address that the user sends events to:\n email_address = db.StringPr... | python | chosen |
[
{
"from": "system",
"value": "Test that teardown methods are actually called\n"
},
{
"from": "human",
"value": "import uuid\nfrom handler_fixture import StationHandlerTestCase\n\nfrom groundstation.transfer.request_handlers import handle_fetchobject\nfrom groundstation.transfer.response_handlers... | python | chosen |
[
{
"from": "system",
"value": "Add doc printing for salt-run\n"
},
{
"from": "human",
"value": "'''\nExecute salt convenience routines\n'''\n\n# Import python modules\nimport sys\n\n# Import salt modules\nimport salt.loader\n\nclass Runner(object):\n '''\n Execute the salt runner interface\... | python | chosen |
[
{
"from": "system",
"value": "Create metaproject with user-provided description.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Ingestion service: create a metaproject (tag) with user-defined name in given space\n\ndef process(transaction, parameters, tableBuilder):\n \"\"\"C... | python | chosen |
[
{
"from": "system",
"value": "Add literal dependency so migration 0031 won't fail if run in the wrong order\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.10 on 2016-12-16 15:03\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, m... | python | chosen |
[
{
"from": "system",
"value": "Connect to psql on server\n"
},
{
"from": "human",
"value": "import os\nfrom flask import Flask\n\napp = Flask(__name__)\nbasedir = os.path.abspath(os.path.dirname('data'))\nbasedir_img = os.path.abspath(os.path.dirname('angular_flask'))\napp.config[\"SECRET_KEY\"] ... | python | chosen |
[
{
"from": "system",
"value": "Add some test geometry which includes file node.\n\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#-------------------------------------------------------------------------------\n## Description\n\"\"\"\nDefine file for Cache Manager Tool.\n\"\"\"\n#---... | python | chosen |
[
{
"from": "system",
"value": "Add SimilarityRecommender to init file\n"
},
{
"from": "human",
"value": "from .collaborative_recommender import CollaborativeRecommender\nfrom .locale_recommender import LocaleRecommender\nfrom .legacy_recommender import LegacyRecommender\nfrom .recommendation_mana... | python | chosen |
[
{
"from": "system",
"value": "Use 2 different methods for single/many lookup\n\nthe 'components' method had 2 different return types depending of the\n'multi' argument.\n\nNow we have 'component' or 'many_components' that return a Component\ninstance or a list of Component instances.\n"
},
{
"from":... | python | chosen |
[
{
"from": "system",
"value": "TST: Add fixture for FOM for test_optimal_parameters\n"
},
{
"from": "human",
"value": "import pytest\nimport odl\nimport odl.contrib.fom\nimport odl.contrib.param_opt\nfrom odl.util.testutils import simple_fixture\n\nspace = simple_fixture('space',\n ... | python | chosen |
[
{
"from": "system",
"value": "Initialize the machine assignments and assertions\n"
},
{
"from": "human",
"value": "import string\n\n\nclass Steckerbrett:\n def __init__(self):\n pass\n\n\nclass Umkehrwalze:\n def __init__(self, wiring):\n self.wiring = wiring\n\n def encod... | python | chosen |
[
{
"from": "system",
"value": "Update instead of save when normalizing bug fields.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.utils.encoding import smart_text\n\nfrom import_export.admin import ExportMixin\n\nfrom remo.remozilla.models import Bug, Status\n\n\... | python | chosen |
[
{
"from": "human",
"value": "Complete example of checking requirements\n"
},
{
"from": "gpt",
"value": "\"\"\"Example of checking the requirements of bibtext and biblatex.\"\"\"\n\nfrom __future__ import print_function\n\nimport bibpy\nimport os\n\n\ndef format_requirements_check(required, optio... | python | chosen |
[
{
"from": "system",
"value": "Create test database in memory.\n"
},
{
"from": "human",
"value": "\"\"\"\nTest settings for ``eventkit`` app.\n\"\"\"\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': 'db.sqlite3',\n }\n}\n\nDEBUG = True\nEMAIL... | python | chosen |
[
{
"from": "system",
"value": "Update test results using new return type\n"
},
{
"from": "human",
"value": "\"\"\"Data transformation utilities test cases.\"\"\"\n\nimport unittest\n\nfrom datagrid_gtk3.utils.transformations import degree_decimal_str_transform\n\n\nclass DegreeDecimalStrTransform... | python | chosen |
[
{
"from": "system",
"value": "Rewrite put method for not found handler\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n'''NotFoundHandler\n'''\n\nfrom tornado.web import HTTPError\n\nfrom twork_app.web.action.base import BaseHandler\n\n\nclass NotFoundHandl... | python | chosen |
[
{
"from": "system",
"value": "Remove assert_ functions from nose.\n"
},
{
"from": "human",
"value": "\"\"\"Tests directories set in the permamodel package definition file.\"\"\"\n\nimport os\nfrom nose.tools import assert_true\nfrom .. import (permamodel_directory, data_directory,\n ... | python | chosen |
[
{
"from": "system",
"value": "Add support for only searching specified column\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf8 -*-\n\"\"\"\nUsage:\nexgrep TERM [options] EXCEL_FILE...\n\nOptions:\nTERM The term to grep for. Can be any valid (python) regular ex... | python | chosen |
[
{
"from": "system",
"value": "Use direct subreddit stylesheet update function\n\nInstead of updating the wiki, uses the praw-defined function.\n\nAlso adds an UID function for subreddit reason\n"
},
{
"from": "human",
"value": "\"\"\"updates subreddit css with compiled sass\"\"\"\nimport subproc... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Added \"add_rest(length)\" method. Changed iterate and generate functions to be outside of the class.\"\n\nThis reverts commit 672069e8f8f7ded4537362707378f32cccde1ae6.\n"
},
{
"from": "human",
"value": "from melopy import *\n\nm = Melopy('canon', 50)\nmelo... | python | chosen |
[
{
"from": "human",
"value": "Add blinkenlights metrics workers to vumi.blinkenlights package namespace (for convenience).\n"
},
{
"from": "gpt",
"value": "\"\"\"Vumi monitoring and control framework.\"\"\"\n\nfrom vumi.blinkenlights.metrics_workers import (MetricTimeBucket,\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove use of deprecated abstractproperty\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n"
},
{
"from": "human",
"value": "from __future__ import annotations\n\nimport abc\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n fr... | python | chosen |
[
{
"from": "system",
"value": "Add unit test to test for bad response on api delete\n"
},
{
"from": "human",
"value": "\"\"\"\nTest api_objects.py\n\"\"\"\nimport unittest\n\nfrom fmcapi import api_objects\n\n\nclass TestApiObjects(unittest.TestCase):\n\n def test_ip_host_required_for_put(self... | python | chosen |
[
{
"from": "system",
"value": "Complete diffsum idx dict sol w/ time/space complexity\n"
},
{
"from": "human",
"value": "\"\"\"Leetcode 525. Contiguous Array\nMedium\n\nURL: https://leetcode.com/problems/contiguous-array/\n\nGiven a binary array, find the maximum length of a contiguous subarray\n... | python | chosen |
[
{
"from": "system",
"value": "Use more reliable test data as pointed in IDEA-COMMUNITY-CR-936\n"
},
{
"from": "human",
"value": "class A:\n pass\n\na = A()\nprint(a.f<caret>oo)\n\nx = A() or None\nprint(x.foo)"
},
{
"from": "gpt",
"value": "class A:\n pass\n\na = A()\nprint(a.f... | python | chosen |
[
{
"from": "system",
"value": "Comment out code to test first_date variable.\n"
},
{
"from": "human",
"value": "\"\"\"\nName: Paul Briant\nDate: 12/11/16\nClass: Introduction to Python\nAssignment: Final Project\n\nDescription:\nCode for Final Project\n\"\"\"\n\nimport pandas\nfrom datetime impor... | python | chosen |
[
{
"from": "system",
"value": "Make migration to fix Topic's attachments\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nfrom django.db import models\n\n\nclass Topic(models.Model):\n name = models.CharField(max_length=100)\n description = models.TextField()\n attachm... | python | chosen |
[
{
"from": "system",
"value": "Make sure tumor-type config ignores spaces\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os.path as path\nimport sys\nimport csv\n\nTUMOR_CONFIG_DIALECT = \"tumor-type-config\"\ncsv.register_dialect(TUMOR_CONFIG_DIALECT, delimiter=',', linetermi... | python | chosen |
[
{
"from": "system",
"value": "Make this test an expected fail on darwin until we can fix this bug.\n\n\n\ngit-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@197087 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from": "human",
"value": "\"\"\"\nTest example snippets from the lldb 'help expressi... | python | chosen |
[
{
"from": "system",
"value": "[FIX] medical_prescription_sale_stock_us: Add dependency\n* Add dependency on medical_prescription_us to manifest file. This is needed\nfor successful installation.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# © 2016 LasLabs Inc.\n# License AGPL-3.0... | python | chosen |
[
{
"from": "system",
"value": "Add missing symbols for tokenization layers\n\nTokenization layers are now exposed by adding them to the list of allowed symbols.\r\n\r\nCheers"
},
{
"from": "human",
"value": "# coding=utf-8\n# Copyright 2021 TF.Text Authors.\n#\n# Licensed under the Apache License... | python | chosen |
[
{
"from": "system",
"value": "Remove no longer used setting.\n"
},
{
"from": "human",
"value": "# *** DON'T MODIFY THIS FILE! ***\n#\n# Instead copy it to stormtracks_settings.py\n#\n# Default settings for project\n# This will get copied to $HOME/.stormtracks/\n# on install.\nimport os\n\nSETTIN... | python | chosen |
[
{
"from": "system",
"value": "Change ICA default to extended Infomax\n"
},
{
"from": "human",
"value": "# Released under The MIT License (MIT)\n# http://opensource.org/licenses/MIT\n# Copyright (c) 2013-2016 SCoT Development Team\n\n\"\"\"Use internally implemented functions as backend.\"\"\"\n\... | python | chosen |
[
{
"from": "system",
"value": "Replace db host to localhost\n"
},
{
"from": "human",
"value": "from decouple import config\n\nfrom jobs.settings import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'test_db',\n 'USER': 'p... | python | chosen |
[
{
"from": "system",
"value": "Add missing argument specification for cwd argument.\n"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom boto.utils import ShellCommand, get_ts\nimport boto\nimport boto.utils\n\nclass ScriptBase:\n\n def __init__(self, config_file=None):\n self... | python | chosen |
[
{
"from": "system",
"value": "Stop invoking get_model for each request\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nfrom django.http import Http404\n\nfrom feincms import settings\nfrom feincms._internal import get_model\nfrom feincms.module.mixi... | python | chosen |
[
{
"from": "system",
"value": "Fix rpc_message_to_error failing to construct them"
},
{
"from": "human",
"value": "import re\n\nfrom .common import (\n ReadCancelledError, InvalidParameterError, TypeNotFoundError,\n InvalidChecksumError\n)\n\nfrom .rpc_errors import (\n RPCError, Invalid... | python | chosen |
[
{
"from": "system",
"value": "Fix an issue where the `_cards` attribute in StudySet was used.\n"
},
{
"from": "human",
"value": "import click\nimport os\n\nfrom flashcards import storage\nfrom flashcards.study import BaseStudySession\nfrom flashcards.commands import sets as sets_commands\nfrom f... | python | chosen |
[
{
"from": "system",
"value": "Add a topic search form (currently not used)"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import ugettext as _\n\nfrom helper.widgets import EmailInput\n\n\nclass PublicBodyForm(forms.Form):\n name = forms.CharField(lab... | python | chosen |
[
{
"from": "system",
"value": "Remove API User section from example config file\n"
},
{
"from": "human",
"value": "# General Settings\ntimerestriction = False\ndebug_mode = True\nlog_directory = './logs'\n\n# Email Settings\n# emailtype = \"Gmail\"\nemailtype = \"Console\"\n\n# SMS Settings\n# ou... | python | chosen |
[
{
"from": "system",
"value": "Update +l with new checkSet parameter\n"
},
{
"from": "human",
"value": "from twisted.plugin import IPlugin\nfrom twisted.words.protocols import irc\nfrom txircd.module_interface import IMode, IModuleData, Mode, ModuleData\nfrom txircd.utils import ModeType\nfrom zo... | python | chosen |
[
{
"from": "system",
"value": "Add if/else to first_letter compression to handle empty names\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nfrom jellyfish... | python | chosen |
[
{
"from": "system",
"value": "Fix SerialConnection.close() with invalid device.\n"
},
{
"from": "human",
"value": "from serial import serial_for_url\n\nfrom .connection import BufferTooShort, Connection, TimeoutError\n\n\nclass SerialConnection(Connection):\n def __init__(self, url, timeout=N... | python | chosen |
[
{
"from": "system",
"value": "Fix no log in /var/log/kuryr/kuryr.log\n\ncode misuse \"Kuryr\" in log.setup, it should be \"kuryr\".\n\nChange-Id: If36c9e03a01dae710ca12cf340abbb0c5647b47f\nCloses-bug: #1617863\n"
},
{
"from": "human",
"value": "# Licensed under the Apache License, Version 2.0 (t... | python | chosen |
[
{
"from": "system",
"value": "Refactor LatestFeaturedNode to use GenericContentNode and accept a configurable number of entries to fetch\n\n\ngit-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@54 5f8205a5-902a-0410-8b63-8f478ce83d95\n"
},
{
"from": "human",
"value": "from django.db.models impo... | python | chosen |
[
{
"from": "system",
"value": "Add ModelForm of Menu, MenuItems and Subscriber\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\n#STDLIB importa\n\n#Core Django Imports\nfrom django import forms\n#Third Party apps imports\n\n#Imports local apps\nfrom .models import Menu, MenuItems\n... | python | chosen |
[
{
"from": "system",
"value": "WebRTC: Switch chromium.webrtc Linux builders to chromium recipe.\n\nWith https://codereview.chromium.org/1406253003/ landed this is the\nfirst CL in a series of careful rollout to the new recipe.\n\nBUG=538259\nTBR=phajdan.jr@chromium.org\n\nReview URL: https://codereview.chro... | python | chosen |
[
{
"from": "system",
"value": "Add coverage ignore to debug URLs\n"
},
{
"from": "human",
"value": "\"\"\"URL configuration for the Django system.\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/dev/topics/http/urls/\n\"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Install celery beat, register tasks (untested)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.utils import timezone\n\nfrom celery import Task\nfrom celery.utils.log import get_task_logger\n\nlogger = get_task_logger(__name__)\n\n\nclass Pur... | python | chosen |
[
{
"from": "system",
"value": "Fix bad syntax in migration"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\nfrom corehq.blobs.migrate import assert_migration_complete\nfrom corehq.sql_db.operations imp... | python | chosen |
[
{
"from": "system",
"value": "Implement teardown on Station mock\n"
},
{
"from": "human",
"value": "import unittest\nimport tempfile\nimport shutil\nimport uuid\n\nimport groundstation.node\nimport groundstation.transfer.response\nimport groundstation.transfer.request\nfrom groundstation.station... | python | chosen |
[
{
"from": "system",
"value": "Improve logs and refactor to pep8\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.utils.module_loading import import_by_path\nfrom notification.models import TaskHistory\nimport logging\n\nLOG = logging.getLogger(__name__)\n\ndef start_workfl... | python | chosen |
[
{
"from": "system",
"value": "Support more than on path when building a DirScanner\n"
},
{
"from": "human",
"value": "import os\nimport zope.interface\nimport mutagen\n\nimport jukebox.song\n\n\nclass IScanner(zope.interface.Interface):\n def scan():\n \"\"\"\n Start the scannin... | python | chosen |
[
{
"from": "system",
"value": "Add \\r\\n to the end of each header too\n"
},
{
"from": "human",
"value": "\"\"\"\nModule for a Response object.\n\nA Response is returned by Routes when the underlying coroutine is done.\n\"\"\"\nfrom http_parser.util import IOrderedDict\n\nfrom .util import HTTP_... | python | chosen |
[
{
"from": "system",
"value": "Use git describe --always in _get_version()\n\nTravis CI does a truncated clone and causes 'git describe' to fail if\nthe version tag is not part of the truncated history.\n"
},
{
"from": "human",
"value": "\"\"\"Adaptive configuration dialogs.\n\nAttributes:\n _... | python | chosen |
[
{
"from": "system",
"value": "Add \"idir\" as default value.\n"
},
{
"from": "human",
"value": "from rest_framework.response import Response\nfrom rest_framework.views import APIView\n\nfrom gwells.settings.base import get_env_variable\n\n\nclass KeycloakConfig(APIView):\n \"\"\" serves keycl... | python | chosen |
[
{
"from": "system",
"value": "[flexbe_core] Add method to set a custom execute rate for states\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport rospy\n\nfrom flexbe_core.core.lockable_state import LockableState\n\nclass LoopbackState(LockableState):\n \"\"\"\n A state that ... | python | chosen |
[
{
"from": "system",
"value": "Add some test for method signature inspection\n"
},
{
"from": "human",
"value": "import pytest\nfrom tornado import gen\n\n_used_fixture = False\n\n\n@gen.coroutine\ndef dummy(io_loop):\n yield gen.Task(io_loop.add_callback)\n raise gen.Return(True)\n\n\n@pyte... | python | chosen |
[
{
"from": "system",
"value": "Allow tests to be run from example_project\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom django.core.management import execute_manager\nimport imp\ntry:\n imp.find_module('settings') # Assumed to be in the same directory.\nexcept ImportError:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add tests requested by @joernhees\n"
},
{
"from": "human",
"value": "from rdflib import Graph, Namespace, URIRef, Literal\nfrom rdflib.compare import to_isomorphic\nimport unittest\n\n\nclass TestIssue655(unittest.TestCase):\n\n def test_issue655(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Rework based on examples in docs\n"
},
{
"from": "human",
"value": "import pytest\n\n@pytest.mark.parametrize(\"name\", [\n (\"bash-completion\"),\n (\"bind-utils\"),\n (\"bridge-utils\"),\n (\"docker\"),\n (\"epel-release\"),\n (\"git\"),\n (\"iptables-servi... | python | chosen |
[
{
"from": "system",
"value": "Use only long form arguments\n\nDo not use any short (single character) arguments for command line\noptions.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport begin\n\nimport twitterlib\n\n\n@begin.subcommand\ndef timeline():\n \"Display recent twe... | python | chosen |
[
{
"from": "system",
"value": "Fix regex for pyflakes output format since `2.2.0`\n"
},
{
"from": "human",
"value": "from SublimeLinter.lint import PythonLinter\nimport re\n\n\nclass Pyflakes(PythonLinter):\n cmd = 'pyflakes'\n regex = r'''(?x)\n ^(?P<filename>[^:\\n]+):(?P<line>\\d+... | python | chosen |
[
{
"from": "system",
"value": "Move tests for Resource.wait_until_finished() into a separate class.\n"
},
{
"from": "human",
"value": "#\n# Project: retdec-python\n# Copyright: (c) 2015 by Petr Zemek <s3rvac@gmail.com> and contributors\n# License: MIT, see the LICENSE file for more details\n#... | python | chosen |
[
{
"from": "system",
"value": "Send email notifications in asynchronous mode\n\nEach mail notification is done on a thread in order to not block the main thread\nof the web app.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import render_template,g\nfrom flask.ext.mail ... | python | chosen |
[
{
"from": "system",
"value": "4: Create script to save documentation to a file \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christop... | python | chosen |
[
{
"from": "system",
"value": "8: Create documentation of DataSource Settings \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.... | python | chosen |
[
{
"from": "system",
"value": "Add a check to see if the bot's in the channel the message should go to\n"
},
{
"from": "human",
"value": "from CommandTemplate import CommandTemplate\n\nclass Command(CommandTemplate):\n\ttriggers = ['say']\n\thelptext = \"Makes the bot say the provided text in the... | python | chosen |
[
{
"from": "system",
"value": "Fix regex as the `:` after the column is optional\n\nFixes SublimeLinter/SublimeLinter#1847\nCloses #17\n\nOutput from pyflakes can be\n\n```\n<stdin>:1044:12 undefined name 'settingss'\n<stdin>:34:45: invalid syntax\n```\n\nt.i. the `:` after the column is optional. In the la... | python | chosen |
[
{
"from": "system",
"value": "Support argument name in the CodeCollector helper.\n"
},
{
"from": "human",
"value": "from inspect import getdoc\n\nimport pytest\n\n\nclass CodeCollector(object):\n\n def __init__(self):\n\n self.collected = []\n\n def __call__(self, f):\n\n sel... | python | chosen |
[
{
"from": "system",
"value": "Hide IP from input form\n\n--HG--\nbranch : bookmarks\n"
},
{
"from": "human",
"value": "from lingcod.features.forms import FeatureForm\nfrom lingcod.bookmarks.models import Bookmark\nfrom django import forms\n\nclass BookmarkForm(FeatureForm):\n name = forms.Cha... | python | chosen |
[
{
"from": "system",
"value": "Add a 5 second pause\n"
},
{
"from": "human",
"value": "\"\"\"\nThe django clearsessions commend internally calls:\n cls.get_model_class().objects.filter(\n expire_date__lt=timezone.now()).delete()\nwhich could lock the DB table for a long time when\nhaving ... | python | chosen |
[
{
"from": "system",
"value": "Remove unused import from tests\n"
},
{
"from": "human",
"value": "import inspect\nfrom collections import defaultdict\n\nimport pytest\nfrom funcy.funcmakers import *\n\n\ndef test_callable():\n assert make_func(lambda x: x + 42)(0) == 42\n\n\ndef test_int():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a test for `notes` attribute\n"
},
{
"from": "human",
"value": "# coding: utf-8\nimport unittest\nfrom lastpass.account import Account\n\n\nclass AccountTestCase(unittest.TestCase):\n def setUp(self):\n self.id = 'id'\n self.name = 'name'\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix template name on entry home page (/) on list page\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom django.views.generic.detail import DetailView\nfrom django.views.generic.list import ListView\n\nfrom opps.article.models ... | python | chosen |
[
{
"from": "system",
"value": "Add cache page on sitemap fixed\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url\nfrom django.contrib.sitemaps import views as sitemap_views\n\nfrom opps.sitemaps.sitemaps import GenericSit... | python | chosen |
[
{
"from": "system",
"value": "Fix demo. And *actually* test new Django versions\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\n\ndef read_relative_file(filename):\n \"\"\"Returns contents of the given file, which path is supposed relative\n to this module.\"\... | python | chosen |
[
{
"from": "system",
"value": "Disable form submit for now\n"
},
{
"from": "human",
"value": "from crispy_forms.bootstrap import FormActions\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Fieldset, Layout, Submit\nfrom django import forms\nfrom django.utils.functiona... | python | chosen |
[
{
"from": "system",
"value": "Update the example to use the new access baton stuff.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n#\n# USAGE: geturl.py FILE_OR_DIR1 FILE_OR_DIR2 ...\n#\n# prints out the URL associated with each item\n#\n\nimport sys\nimport svn._wc\nimport svn.util\... | python | chosen |
[
{
"from": "system",
"value": "Add command to seed database\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nfrom app import create_app, db\nfrom app.models import User, Role, Permission\nfrom flask.ext.script import Manager, Shell\nfrom flask.ext.migrate import Migrate, Migra... | python | chosen |
[
{
"from": "system",
"value": "Update the path to the setting file.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"tests.settings.dev\")\n\n from django.core.management imp... | python | chosen |
[
{
"from": "system",
"value": "Use uniform instead of random\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# coding:utf-8\n\n\nfrom mod import Mod\nimport random\nimport os\n\n\nclass ModDefault(Mod):\n def __init__(\n self,\n filename=None,\n logger=None\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix copy paste typo caused by cloud to butt\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nimport hashlib\n\nfrom website import settings\n\n\nDOMAIN = settings.DOMAIN\nUPLOAD_SERVICE_URLS = ['changeme']\nPING_TIMEOUT = 5 * 60\n\nSIGNED_REQUEST_KWARGS = {}\... | python | chosen |
[
{
"from": "system",
"value": "Add routes for new views"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\n\nfrom django.contrib import admin\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n url(r'^$', 'event_manager.views.home', name='home'),\n url(r... | python | chosen |
[
{
"from": "human",
"value": "Add avacon-style payment ids like the ones used at svscon\n"
},
{
"from": "gpt",
"value": "\nfrom selvbetjening.core.events.models import request_attendee_pks_signal, find_attendee_signal, Attend\n\n\ndef avacon_style_attendee_pks_handler(sender, **kwargs):\n atte... | python | chosen |
[
{
"from": "system",
"value": "Fix bug when create the datebase table\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import, unicode_literals\n\nfrom peewee import Model, IntegerField, CharField\n\nfrom zhihudaily.configs impor... | python | chosen |
[
{
"from": "system",
"value": "Add hr_contract_security.xml file entry in update_xml section\n\nbzr revid: mga@tinyerp.com-cceb329e8e30908ba1f6594b9502506150d105b2"
},
{
"from": "human",
"value": "{\n\t\"name\" : \"Human Resources Contracts\",\n\t\"version\" : \"1.0\",\n\t\"author\" : \"Tiny\",\n... | python | chosen |
[
{
"from": "system",
"value": "Remove user_id requirement for FB endpoint\n"
},
{
"from": "human",
"value": "from flask import Blueprint\nfrom models import db, Status\nimport json\n\nstatus_renderer = Blueprint('status', __name__)\n\n@status_renderer.route('/status/<int:user_id>')\ndef get_tweet... | python | chosen |
[
{
"from": "system",
"value": "Correct regex in unit test\n\nSummary: Correct regex used in unit tests.\n\nTest Plan: Unit test\n\nReviewed By: @alikhtarov\n\nDifferential Revision: D1804582"
},
{
"from": "human",
"value": "# Copyright (c) 2015, Facebook, Inc.\n# All rights reserved.\n#\n# This s... | python | chosen |
[
{
"from": "system",
"value": "Allow underscores as the user profile slug.\n\nhttps://github.com/madewithbytes/us_ignite/issues/316\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\nurlpatterns = patterns(\n 'us_ignite.people.views',\n url(r'^$', 'profile_list... | python | chosen |
[
{
"from": "system",
"value": "Add custom URL alias paths to URLconf\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns\nfrom django.conf.urls import url\n\nfrom .views import redirect\n\n\nurlpatterns = patterns('',\n url(r'^(?P<key>[a-zA-Z0-9]+)$', redirect, name='defle... | python | chosen |
[
{
"from": "system",
"value": "Add transaction support to the orders view\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom rest_framework.views import APIView\nfrom rest_framework.response import Response\nfrom rest_framework import status\nfrom rest_framework.permissi... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Modify copy method into inherit\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom openerp import models, fields, api\n\n'''\nThis module create model of Course\n'''\n\nclass Course(models.Model):\n '''\n This class create mo... | python | chosen |
[
{
"from": "system",
"value": "Add experimental every-timestep tendency function\n"
},
{
"from": "human",
"value": "\"\"\"Calculations involved in mass and energy budgets.\"\"\"\nimport numpy as np\nfrom aospy.utils import coord_to_new_dataarray\n\nfrom .. import TIME_STR\n\n\ndef first_to_last_v... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.