conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove warning from jupyter 4\n"
},
{
"from": "human",
"value": "import json\nimport os\nimport sys\n\nfrom IPython.kernel.kernelspec import install_kernel_spec\nfrom IPython.utils.tempdir import TemporaryDirectory\n\nkernel_json = {\"argv\":[sys.executable,\"-m\",\... | python | chosen |
[
{
"from": "system",
"value": "Revert \"return json of message being sent to debug mail issue\"\n"
},
{
"from": "human",
"value": "from django.shortcuts import redirect\nfrom django.http import JsonResponse\nfrom django.core.mail import EmailMessage\nfrom django.middleware import csrf\n\nfrom res... | python | chosen |
[
{
"from": "system",
"value": "Fix user name addition to props\n"
},
{
"from": "human",
"value": "from flask import render_template\nfrom flask_login import current_user\n\nfrom goodtablesio import settings\n\n\n# Module API\n\ndef render_component(component, props=None):\n \"\"\"Render fronte... | python | chosen |
[
{
"from": "system",
"value": "Remove the initial value for WebHookTarget.extra_data in the evolution.\n\nThe original evolution adding the WebHookTarget.extra_data had an\ninitial value, and even with changing that in another field, it will\nstill apply on existing installs. This needs to be modified in ord... | python | chosen |
[
{
"from": "system",
"value": "Fix filtering criterion when updating contacts from message.\n"
},
{
"from": "human",
"value": "import uuid\nfrom inbox.models import Contact, MessageContactAssociation\n\n\ndef update_contacts_from_message(db_session, message, account_id):\n with db_session.no_a... | python | chosen |
[
{
"from": "system",
"value": "Add a subclass for the dot graph\n"
},
{
"from": "human",
"value": "\"\"\"\nPython in Astronomy 2016 is the second iteration of the Python in Astronomy\nconference series.\n\nThis is the docstring for the pyastro module, this gets included as the\ndescription for th... | python | chosen |
[
{
"from": "system",
"value": "Remove the redundant `else` condition.\n\nPiperOrigin-RevId: 302901741\nChange-Id: I65281a07fc2789fbc13775c1365fd01789a1bb7e\n"
},
{
"from": "human",
"value": "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Ver... | python | chosen |
[
{
"from": "system",
"value": "Use strptime at import time to avoid a race\n\nSummary:\nWe've observed funny AttributeErrors and similar in accessing _strptime, which\nare likely the result of a known race. This might possibly fix it.\n\nTest Plan: None\n\nReviewers: benjamin\n\nReviewed By: benjamin\n\nSubs... | python | chosen |
[
{
"from": "system",
"value": "Implement save functionality with POST request\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\n\napp = Flask(__name__)\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../logcollector.db'\ndb = SQLAlchemy... | python | chosen |
[
{
"from": "system",
"value": "Add test that aci was downloaded\n"
},
{
"from": "human",
"value": "try:\n from http.server import SimpleHTTPRequestHandler\nexcept ImportError:\n from SimpleHTTPServer import SimpleHTTPRequestHandler\n\ntry:\n from socketserver import TCPServer\nexcept Imp... | python | chosen |
[
{
"from": "system",
"value": "Unittests: Remove some more unneccesary code.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport sys\n\nfrom helpers.statuspage import StatusPage\nfrom test_postgresql import MockConnect\n\nif sys.hexversion ... | python | chosen |
[
{
"from": "system",
"value": "Switch from raw dict to context dict\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom event_manager.models import Suggestion, Event\nfrom django.contrib.auth.decorators import login_required\n\ndef home(request):\n\treturn render(request,... | python | chosen |
[
{
"from": "system",
"value": "Add very basic testing for Coap request.\n"
},
{
"from": "human",
"value": "from ..code_registry import MethodCode, MessageType\nfrom ..coap import Coap\n\ndef test_build_message():\n c = Coap('coap.me')\n result = c.get('hello')\n print str(bytearray(resul... | python | chosen |
[
{
"from": "system",
"value": "Make this a bit more readable.\n"
},
{
"from": "human",
"value": "__name__ = \"Year View\"\n__author__ = \"Decklin Foster <decklin@red-bean.com>\"\n__description__ = \"Calendar of all dates in a given year.\"\n\nimport time\n\ndef make(instance, entries, all, vars):... | python | chosen |
[
{
"from": "system",
"value": "Remove hard-coded data file path"
},
{
"from": "human",
"value": "from scipy.io import loadmat\n\ndef load_clean_data():\n data = loadmat('data/cleandata_students.mat')\n return data['x'], data['y']\n\ndef load_noisy_data():\n data = loadmat('data/noisydata... | python | chosen |
[
{
"from": "system",
"value": "Remove the intentional throwing of internal server errors.\n\nFixes failing tests.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n Simple testing blueprint. Will be deleted once real functionality is added.\n\"\"\"\n\nimport flask\nimport f... | python | chosen |
[
{
"from": "system",
"value": "Add trove classifiers for python versions\n\nThis marks the project as working on Python 2 and 3. As tests\ncurrently run on python 3.6 and 3.7, I've added those classifiers.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nPACKAGE = \"a... | python | chosen |
[
{
"from": "system",
"value": "Make importlib backwards-compatible to Python 2.2 (but this is not promised to\nlast; just doing it to be nice).\n\nAlso fix a message for an exception.\n"
},
{
"from": "human",
"value": "\"\"\"Backport of importlib.import_module from 3.x.\"\"\"\nimport sys\n\ndef _... | python | chosen |
[
{
"from": "system",
"value": "Add clarifying comment about avoiding pretty printing\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, jsonify\n\n\napp = Flask(__name__)\napp.config.update(\n JSONIFY_PRETTYPRINT_REGULAR=False,\n)\n\n# Read in the entire wordlist at s... | python | chosen |
[
{
"from": "system",
"value": "Allow \"writable\" if *any* field is writable\n\nFixes Internal Issue 598\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\n\nfrom django import template\nfrom treemap.... | python | chosen |
[
{
"from": "system",
"value": "Revert \"EAFP and removing redundant functions\"\n\nThis reverts commit fbb9eeded41e46c8fe8c3ddaba7f8d9fd1e3bff3.\n"
},
{
"from": "human",
"value": "import amqp\nfrom contextlib import closing\n\n\ndef publish_message(message_body, exchange, type, routing_key):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update the version to 1.6.1\n"
},
{
"from": "human",
"value": "__version_info__ = {\n 'major': 1,\n 'minor': 6,\n 'micro': 0,\n 'releaselevel': 'final',\n 'serial': 1\n}\n\n\ndef get_version(short=False):\n assert __version_info__['releaselevel'] i... | python | chosen |
[
{
"from": "system",
"value": "Add a public route table\n"
},
{
"from": "human",
"value": "from troposphere import (\n Ref,\n)\n\nfrom troposphere.ec2 import (\n InternetGateway,\n VPC,\n VPCGatewayAttachment,\n)\n\nfrom .template import template\n\n\nvpc = VPC(\n \"Vpc\",\n tem... | python | chosen |
[
{
"from": "system",
"value": "Clean error output when command is a string\n"
},
{
"from": "human",
"value": "import functools\nimport subprocess\n\nfrom doit.exceptions import TaskFailed\n\n\ndef capture_subprocess_error(fn):\n @functools.wraps(fn)\n def wrapper(*args, **kwargs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add load_enum and load_struct functions\n\nLoad enumeration list json\nLoad full struct into dictionary\n"
},
{
"from": "human",
"value": "import os\nimport json\n\nfrom lib import contract\n\ndata_dir = os.path.join(os.environ['PORTER'], 'data')\n\n\n@contract.acce... | python | chosen |
[
{
"from": "system",
"value": "Remove hr_holidays_meeting_id_fkey constrain to avoid migration issues.\n\n- The constraint will be reset by the ORM later.\n\n- Not doing it may both slow the migration and abort it altogether.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n###########... | python | chosen |
[
{
"from": "system",
"value": "Print audiolang in json output\n"
},
{
"from": "human",
"value": "\nimport json\n\n# save info from common.print_info()\nlast_info = None\n\ndef output(video_extractor, pretty_print=True):\n ve = video_extractor\n out = {}\n out['url'] = ve.url\n out['ti... | python | chosen |
[
{
"from": "system",
"value": "Move append out of if/else block\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\n Beacon to manage and report the status of\n one or more salt proxy processes\n\n .. versionadded:: 2015.8.3\n'''\n\n# Import python libs\nfrom __future__ impo... | python | chosen |
[
{
"from": "system",
"value": "Update report_rendering test to use ReportExport\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom django.test import SimpleTestCase\nfrom corehq.apps.userreports.reports.view im... | python | chosen |
[
{
"from": "system",
"value": "Fix command polling sessions for IX.\n\n"
},
{
"from": "human",
"value": "import logging\n\nfrom django.core.management.base import BaseCommand\n\nfrom peering.models import InternetExchange\n\n\nclass Command(BaseCommand):\n help = \"Update peering session state... | python | chosen |
[
{
"from": "system",
"value": "Format the code to black"
},
{
"from": "human",
"value": "import torchaudio\nimport librosa\n\n\n# resampling reference https://core.ac.uk/download/pdf/228298313.pdf\n# resampling input transformation defense for audio\n\nT = torchaudio.transforms\n\n# Read audio fi... | python | chosen |
[
{
"from": "system",
"value": "Add commented-out test for init with no args\n"
},
{
"from": "human",
"value": "import os\nfrom click.testing import CliRunner\n\nfrom morenines import application\n\n\ndef test_init(data_dir):\n runner = CliRunner()\n\n result = runner.invoke(application.main... | python | chosen |
[
{
"from": "system",
"value": "Add space for empty string.\n"
},
{
"from": "human",
"value": "import serial\n\ndef get_active_drones():\n\tport = serial.Serial('/dev/ttyUSB0', 9600)\n\tport.write('0;1;0;\\n')\n\tdrones = []\n\t\n\tmsg = port.readline()\n\tdrone_id = msg[2]\n\tdrones.append(drone_... | python | chosen |
[
{
"from": "system",
"value": "Remove mention of Log parser\n"
},
{
"from": "human",
"value": "from SUASImageParser.utils.image import Image\nfrom SUASImageParser.utils.color import bcolors\n\nimport cv2\nimport numpy as np\n\n\nclass CharacteristicIdentifier:\n \"\"\"\n Identify target cha... | python | chosen |
[
{
"from": "system",
"value": "Rename build_index to build and add logic to setup template env\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom logya.content import read_all\nfrom logya.template import init_env\nfrom logya.util import load_yaml, paths\n\n\nclass Logya:\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Fix test of math function testing helper.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom chainer import testing\n\n\nclass Dummy(object):\n pass\n\n\nclass TestNoNumpyFunction(unittest.TestCase):\n\n def test_no_numpy_function(self):\n with ... | python | chosen |
[
{
"from": "system",
"value": "Test simple complete run of pocket_parser.\n"
},
{
"from": "human",
"value": "import unittest\nimport utils\nimport os\nimport sys\nimport re\nimport subprocess\n\nTOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\nsys.path.append(os.path.join(... | python | chosen |
[
{
"from": "system",
"value": "Remove urlparse import as not used and also renamed in Python 3 to urllib.parse\n"
},
{
"from": "human",
"value": "from django.contrib.sites.shortcuts import get_current_site\nfrom urlparse import urljoin\ndef site_url(request):\n scheme = 'https' if request.is_s... | python | chosen |
[
{
"from": "system",
"value": "Update feeds url due to RemovedInDjango19Warning\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom django.views.generic.base import RedirectView\n\nfrom .google_merchant import get_feed_file_url\n\nurlpatterns = [\n url(r'google/$', Redire... | python | chosen |
[
{
"from": "system",
"value": "Update sample to reflect final destination in wiki documentation.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2.4\n# -*- coding: utf-8 -*-\n#\n# Copyright 2010 Google Inc. All Rights Reserved.\n\n\"\"\"Simple command-line example for Translate.\n\nCommand-li... | python | chosen |
[
{
"from": "system",
"value": "Allow empty data in value\n"
},
{
"from": "human",
"value": "def assign_to_variable_spec(data, spec, value):\n if not spec.startswith('@') or not spec.endswith('@'):\n raise ValueError(\"{} is not a reference\".format(spec))\n parts = spec.strip('@').sp... | python | chosen |
[
{
"from": "system",
"value": "Use index context manager for sync\n"
},
{
"from": "human",
"value": "# coding: utf-8\nimport hues\n\nfrom django.core.management.base import BaseCommand\n\nfrom elasticsearch import exceptions\nfrom elasticsearch_dsl.connections import connections\nfrom elasticsear... | python | chosen |
[
{
"from": "system",
"value": "Fix app crashing at startup if some auth methods are not configured\n\nChange-Id: I201dbc646c6da39c5923a086a0498b7ccb854982\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>\n#\n# Licensed under t... | python | chosen |
[
{
"from": "system",
"value": "Add possibility of using apis with dashes without any workarounds\n"
},
{
"from": "human",
"value": "from types import ModuleType\n\nfrom .resource import Resource\n\n\nclass SelfWrapper(ModuleType):\n def __init__(self, self_module, baked_args={}):\n for ... | python | chosen |
[
{
"from": "system",
"value": "Refactor the ever living hell out of this."
},
{
"from": "human",
"value": "from django.db import models\n\nclass TransformQuerySet(models.query.QuerySet):\n def __init__(self, *args, **kwargs):\n super(TransformQuerySet, self).__init__(*args, **kwargs)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a system for tests to register objects for deletion.\n\nThey should be deleted no matter the outcome of\nthe test."
},
{
"from": "human",
"value": "import os\nimport random\n\nfrom unittest2 import TestCase\n\nfrom chef.api import ChefAPI\n\nTEST_ROOT = os.path.... | python | chosen |
[
{
"from": "system",
"value": "Verify X-Requested-With is not set\n"
},
{
"from": "human",
"value": "from pyramid.view import (\n view_config,\n notfound_view_config,\n )\n\n# Always send the default index.html\n@notfound_view_config(renderer='templates/index.mako', accept='t... | python | chosen |
[
{
"from": "system",
"value": "Mark as dev release until 0.3 is ready.\n"
},
{
"from": "human",
"value": "\n# The version is defined in its own module so we can import it from setup.py\n# without introducing unwanted dependencies at that stage.\nVERSION = '0.3'\n\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Change config import strategy to config.from_pyfile()\n"
},
{
"from": "human",
"value": "import os\nfrom flask import Blueprint, Flask\nfrom flask import Flask, g\nfrom views import blueprint, Resources, UnixTime, PrintArg, ExampleApiUsage\nfrom flask.ext.restful im... | python | chosen |
[
{
"from": "system",
"value": "Revert back to using key\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\n__all__ = ['ProviderManager']\n\nfrom .exceptions import ProviderNotRegistered\n\n\n# Ideally this and PluginManager abstracted from the same base, ... | python | chosen |
[
{
"from": "system",
"value": "Update P2_combinePDF.py\nadded module reference in docstring\n"
},
{
"from": "human",
"value": "#! python3\n\"\"\"Combine PDFs\n\nCombines all the PDFs in the current working directory into a single PDF.\n\nNote:\n * Example PDFs can be downloaded from http://nos... | python | chosen |
[
{
"from": "system",
"value": "Use print() function to fix install on python 3\n\nclint 0.3.2 can't be installed on python 3.3 because of a print statement."
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\n\n\"\"\"\nclint.textui.prompt\n~~~~~~~~~~~~~~~~~~~\n\nModule for simple interactive... | python | chosen |
[
{
"from": "system",
"value": "Add expression slash to perhaps fix python3 bug\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for filetolist.py\n\nfiletolist.py:\nhttp://www.github.com/samjabrahams/anchorhub/lib/filetolist.py\n\"\"\"\nfrom anchorhub.lib.filetolist import FileToList\nfrom anchor... | python | chosen |
[
{
"from": "system",
"value": "Fix name of environment variable on appveyor tht contains tag name"
},
{
"from": "human",
"value": "import os\n\ntravis_tag = os.getenv('TRAVIS_TAG')\nappveyor_tag = os.getenv('APPVEYOR_REPO_TAG')\n\n\ndef generate_label(version):\n dev_names = ['dev', 'alpha', '... | python | chosen |
[
{
"from": "system",
"value": "Rewrite \"The Perry Bible Fellowship\" after feed change\n"
},
{
"from": "human",
"value": "from comics.aggregator.crawler import CrawlerBase, CrawlerImage\nfrom comics.core.comic_data import ComicDataBase\n\n\nclass ComicData(ComicDataBase):\n name = \"The Perry... | python | chosen |
[
{
"from": "system",
"value": "Fix flake8 error due to extra blank line in example\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=utf-8\n\"\"\"A simple example demonstrating support for unicode command names.\n\"\"\"\nimport math\nimport cmd2\n\n\nclass UnicodeApp(cmd2.Cmd):\n... | python | chosen |
[
{
"from": "system",
"value": "Set log level to WARNING when testing\n"
},
{
"from": "human",
"value": "import luigi\nimport sciluigi as sl\nimport os\n\nTESTFILE_PATH = '/tmp/test.out'\n\nclass TestTask(sl.Task):\n\n def out_data(self):\n return sl.TargetInfo(self, TESTFILE_PATH)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add `__all__` at package root level\n"
},
{
"from": "human",
"value": "\"\"\"Little helper application to improve django choices (for fields)\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom .choices import Choices, OrderedChoices\n\n__author__ = 'Stephane \... | python | chosen |
[
{
"from": "system",
"value": "Fix test to avoid weird period handling\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom nose.tools import assert_equal\n\nfrom openfisca_france.model.prelevements_obligatoires.prelevements_sociaux.cotisations_sociales.allegements import *\nfrom op... | python | chosen |
[
{
"from": "system",
"value": "Use url instead of path (to keep django 1 compat)\n"
},
{
"from": "human",
"value": "from django.urls import path\n\nfrom django_react_templatetags.tests.demosite import views\n\n\nurlpatterns = [\n path(\n 'static-react-view',\n views.StaticReactVi... | python | chosen |
[
{
"from": "system",
"value": "Fix Spanish noun_chunks failure caused by typo"
},
{
"from": "human",
"value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .tokenizer_exceptions import TOKENIZER_EXCEPTIONS\nfrom .tag_map import TAG_MAP\nfrom .stop_words import STOP_WORDS\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Use /etc/hosts to find redis"
},
{
"from": "human",
"value": "import collections\nimport pickle\n\nimport redis\n\nfrom .tools import location\n\n\nclass Store(collections.MutableMapping):\n\n def __init__(self, db=0):\n host, port = location('redis', 6379... | python | chosen |
[
{
"from": "system",
"value": "Use importlib in favour of imp\n"
},
{
"from": "human",
"value": "import utilities\n\n\ndef parse(src):\n\tif src == ':':\n\t\tfrom ..description import default as desc\n\telif src.startswith(':'):\n\t\timport importlib\n\t\tdesc = importlib.import_module(src[1:])\n... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings to starting py program\n"
},
{
"from": "human",
"value": "\nimport sys\n\ndef eprint(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs)\n\ndef main(argv=None):\n if argv is None:\n argv = sys.argv\n return 0\n\nif __name__ == ... | python | chosen |
[
{
"from": "system",
"value": "Add a demo for wwpp\n"
},
{
"from": "human",
"value": "test = {\n 'name': 'Question 1',\n 'points': 3,\n 'suites': [\n {\n 'cases': [\n {\n 'answer': 'Domain is numbers. Range is numbers',\n 'choices': [\n 'Domain is nu... | python | chosen |
[
{
"from": "system",
"value": "Undo previous commit (should not been on new branch) - Sorry!\n\nSigned-off-by: Matthias Stevens <3e0606afd16757d2df162884117429808539458f@gmail.com>\n"
},
{
"from": "human",
"value": "from geokey.extensions.base import register\n\n\nVERSION = (0, 2, 0)\n__version__... | python | chosen |
[
{
"from": "system",
"value": "[MixMaster] Fix displaying of errors when using Python 2\n"
},
{
"from": "human",
"value": "import string\nimport os, sys\nimport types, traceback\n\ntry:\n if sys.version_info[0] == 3:\n from tkinter import Tk\n from tkinter import messagebox\n ... | python | chosen |
[
{
"from": "system",
"value": "Patch django submit_row templatetag so it takes into account button config sent in context\n"
},
{
"from": "human",
"value": "# -*- encoding: UTF-8 -*-\n\n#\n# Copyright 2014-2015\n#\n# STIC-Investigación - Universidad de La Laguna (ULL) <gesinv@ull.edu.es>\... | python | chosen |
[
{
"from": "system",
"value": "Allow spaces in username, cont'd: forgotten url pattern.\n"
},
{
"from": "human",
"value": "from django.conf.urls import *\nfrom userena.contrib.umessages import views as messages_views\nfrom django.contrib.auth.decorators import login_required\n\nurlpatterns = patt... | python | chosen |
[
{
"from": "system",
"value": "[FIX] connector_carepoint: Fix prescription migration\n* Add try/catch & rollback to db alterations in case server re-upgrades\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2016 LasLabs Inc.\n# License AGPL-3.0 or later (http://www.gnu.org/... | python | chosen |
[
{
"from": "system",
"value": "Allow running tests without Django.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\nimport unittest\n\nfrom huey import tests\n\n\ndef _requirements_installed():\n try:\n import django\n return True\n except Excep... | python | chosen |
[
{
"from": "system",
"value": "Change file name to logger name in example settings\n"
},
{
"from": "human",
"value": "\"\"\"\nExample settings module.\n\nThis should be copied as `settings.py` and the values modified there.\n\nThat file is ignored by the repo, since it will contain environment\ns... | python | chosen |
[
{
"from": "system",
"value": "Make ORG_TITLE the complete pre-existing title."
},
{
"from": "human",
"value": "# Copy this file to config.py and change the settings. Don't forget to specify your own SECRET_KEY.\n\n# The app name will be used in several places.\nAPP_NAME = 'Yelp Love'\n\nAPP_BASE... | python | chosen |
[
{
"from": "system",
"value": "Return the token string instead of object with string\n"
},
{
"from": "human",
"value": "from jwt_auth.forms import JSONWebTokenForm\n\n\ndef loginUser(username, password):\n \"\"\"Should login user and return a jwt token, piggyback on jwt_auth\"\"\"\n request... | python | chosen |
[
{
"from": "system",
"value": "Fix bug where arc slug could be literally anything\n"
},
{
"from": "human",
"value": "from django.views import generic\n\nfrom gallery.models import GalleryImage\nfrom .models import Arc, Issue\n\n\nclass IndexView(generic.ListView):\n model = Arc\n template_n... | python | chosen |
[
{
"from": "system",
"value": "Use explicit template instead of 'gcc'\n\ncppcheck 1.84 changed the meaning of --template=gcc to add a second line of output that confuses the linter plugin, so explicitly request the old format\r\n\r\nsee https://github.com/danmar/cppcheck/commit/f058d9ad083a6111e9339b4b3506c5... | python | chosen |
[
{
"from": "system",
"value": "Use batches instead of raw sql for long migration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.4 on 2017-11-13 16:14\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nclass Migration(migration... | python | chosen |
[
{
"from": "system",
"value": "dblog: Fix log entry __unicode__ method functionality\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom Instanssi.kompomaatti.models import Event\n\n\nclass DBLogEntry(models... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in cob migrate down\n"
},
{
"from": "human",
"value": "import click\nimport logbook\n\nfrom .utils import appcontext_command\nfrom ..ctx import context\n\nimport flask_migrate\n\n_logger = logbook.Logger(__name__)\n\n\n@click.group()\ndef migrate():\n pa... | python | chosen |
[
{
"from": "system",
"value": "Add a new invariant check: check blackholes *or* loops\n"
},
{
"from": "human",
"value": "from sts.invariant_checker import InvariantChecker\n\ndef check_for_loops_or_connectivity(simulation):\n from sts.invariant_checker import InvariantChecker\n result = Invaria... | python | chosen |
[
{
"from": "system",
"value": "Make Whitenoise serve static assets\n\nCurrently it’s not configured properly, so isn’t having any effect.\nThis change makes it wrap the Flask app, so it intercepts any requests\nfor static content.\n\nFollows the pattern documented in http://whitenoise.evans.io/en/stable/flas... | python | chosen |
[
{
"from": "system",
"value": "Use a `TranslatableAdmin` for `Service`s\n\nFixes #70\n"
},
{
"from": "human",
"value": "from django.contrib.admin import site, ModelAdmin\n\nfrom .models import Issue, Jurisdiction, Service, Application\n\n\nclass ApplicationAdmin(ModelAdmin):\n list_display = (... | python | chosen |
[
{
"from": "system",
"value": "Test functional version of connecting to postgres\n"
},
{
"from": "human",
"value": "import os\nimport psycopg2\nimport urlparse\n\nurlparse.uses_netloc.append(\"postgres\")\nurl = urlparse.urlparse(os.environ[\"DATABASE_URL\"])\n\nconn = psycopg2.connect(\n data... | python | chosen |
[
{
"from": "system",
"value": "Add url entry container api\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url\nfrom django.conf import settings\nfrom django.views.decorators.cache import cache_page\n\nfrom .views import Co... | python | chosen |
[
{
"from": "system",
"value": "Fix crud controller for notifacation\n\nIt was not possible to get, update or retrieve a notification\n"
},
{
"from": "human",
"value": "from zou.app.models.notifications import Notification\nfrom zou.app.utils import permissions\n\nfrom .base import BaseModelResour... | python | chosen |
[
{
"from": "system",
"value": "Increase spacing for quadrature encoders\n"
},
{
"from": "human",
"value": "from genshi.template import TemplateLoader\nimport os\nimport sys\n\nif len(sys.argv) < 2:\n print(\"I need the name of a file as the first argument!\")\n exit(1)\n\nloader = TemplateL... | python | chosen |
[
{
"from": "system",
"value": "Call `configure_logging` to enable more debug information\n"
},
{
"from": "human",
"value": "# Goal: Init the application routes and read the settings\n#\n# @authors:\n# Andrei Sura <sura.andrei@gmail.com>\n# Ruchi Vivek Desai <ruchivdesai@gmai... | python | chosen |
[
{
"from": "system",
"value": "Add external IP for Flask\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom pianette.utils import Debug\nfrom flask import Flask, render_template, request\nfrom threading import Thread\n\napp = Flask(__name__, template_folder='../templates')\n\nimport logging... | python | chosen |
[
{
"from": "system",
"value": "Add base interface for rule\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\n\nclass Rule:\n pass\n"
},
{
"from": "gpt",
"value": "#!/usr... | python | chosen |
[
{
"from": "system",
"value": "Remove try/except from determing if mfa is enabled\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.conf import settings\n\n\nclass UserOTP(models.Model):\n\n OTP_TYPES = (\n ('HOTP', 'hotp'),\n ('TOTP', '... | python | chosen |
[
{
"from": "system",
"value": "Add import to stop warnings\n"
},
{
"from": "human",
"value": "# minNEURON.py\n\ncell = h.SectionList()\nsoma = h.Section(name='soma') #create soma\nsoma.push()\n#h.topology()\n\n# Geometry\nsoma.nseg = 1\nsoma.L = 20\nsoma.diam = 20\n\n# Biophysics\nfor sec in h.al... | python | chosen |
[
{
"from": "system",
"value": "Fix add_to_builtins import for Django 1.7 support\n\nOlder Django versions also use this location already.\n"
},
{
"from": "human",
"value": "# following PEP 386\n__version__ = \"1.2\"\n\nVERSION = (1, 2)\n\n# Make sure the ``{% print %}`` is always available, even ... | python | chosen |
[
{
"from": "system",
"value": "Add a context manager for PDF plot.\n"
},
{
"from": "human",
"value": "\"\"\"\n * Copyright (c) 2016. Mingyu Gao\n * All rights reserved.\n *\n\"\"\"\nimport matplotlib.backends.backend_pdf\nfrom .format import paper_plot\n\n\ndef plot_setup(name, dims, fontsize=9):... | python | chosen |
[
{
"from": "system",
"value": "Enable PyOpenSSL testing on Python 3.\n"
},
{
"from": "human",
"value": "from nose.plugins.skip import SkipTest\nfrom urllib3.packages import six\n\nif six.PY3:\n raise SkipTest('Testing of PyOpenSSL disabled on PY3')\n\ntry:\n from urllib3.contrib.pyopenssl i... | python | chosen |
[
{
"from": "system",
"value": "Add API number in get_config()\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim: set fileencoding=utf-8 :\n# Andre Anjos <andre.anjos@idiap.ch>\n# Fri 20 Sep 14:45:01 2013\n\n\"\"\"Blitz++ Array bindings for Python\"\"\"\n\nimport pkg_resources\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Enable ctrl-c control with rospy\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nfrom baxter_myo.arm_controller import ArmController\nfrom baxter_myo.config_reader import ConfigReader\n\n\ndef main():\n c = ConfigReader(\"demo_config\")\n c.parse_all()... | python | chosen |
[
{
"from": "system",
"value": "Check whether six has been installed before running tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom __future__ import unicode_literals\nimport os, sys\nimport six\n\ntry:\n from django.conf import settings\nexcept ImportError:\n print(\"... | python | chosen |
[
{
"from": "system",
"value": "Add ability to run tests with verbosity and failfast options\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\n# Force this to happen before loading django\ntry:\n os.environ[\"DJANGO_SETTINGS_MODULE\"] = \"testtinymce.settings\"\n test_dir = os.path... | python | chosen |
[
{
"from": "system",
"value": "Add basic execution tests for upload methods\n"
},
{
"from": "human",
"value": "import requests\nimport responses\nfrom teamscale_client.teamscale_client import TeamscaleClient\n\ndef get_client():\n return TeamscaleClient(\"http://localhost:8080\", \"admin\", \"... | python | chosen |
[
{
"from": "system",
"value": "Test default value of a function\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# function\ndef sum(op1, op2):\n return op1 + op2\n\nmy_sum = sum\nprint my_sum(1, 2)\nprint my_sum(\"I am \", \"zzz\");\n\n\n# pass\nprint \"press ctrl + c to continue\"\n... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.