conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add a function for commands to process parameters\n"
},
{
"from": "human",
"value": "# The purpose of this file is to provide base classes with the needed functions\n# already defined; this allows us to guarantee that any exceptions raised\n# during function calls a... | python | chosen |
[
{
"from": "system",
"value": "Revise doc string for selection sort’s concept\n"
},
{
"from": "human",
"value": "def selection_sort(a_list):\n \"\"\"Selection Sort algortihm.\n\n Concept: Find out the maximun item's original slot first,\n then switch it to the max slot. Iterate the proce... | python | chosen |
[
{
"from": "system",
"value": "Add debugging code to proxy generation\n\ngit-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@18806 4e558342-562e-0410-864c-e07659590f8c\n"
},
{
"from": "human",
"value": "import osgtest.library.core as core\nimport osgtest.library.osgunittest as osgunittest\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Move bar chart with highlighted segment chart into the bar charts section"
},
{
"from": "human",
"value": "\"\"\"\nBar Chart with Highlighted Segment\n----------------------------------\nThis example shows a bar chart that highlights values beyond a threshold.\n\"\"... | python | chosen |
[
{
"from": "system",
"value": "Add `can_delete=True` to the example formset\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.forms.formsets import formset_factory\nfrom django.shortcuts import render\nfrom djangoformsetjs.utils import formset_media_js\n\nclass MyForm(forms... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Relax ansible-test python version checking.\"\n\nThis reverts commit d6cc3c41874b64e346639549fd18d8c41be0db8b.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Show python and pip versions.\"\"\"\n\nimport os\nimport sys\n\ntry:\n import p... | python | chosen |
[
{
"from": "system",
"value": "Add error if latest is passed to deploy. Also check if the path exist before meaking the symlink.\n"
},
{
"from": "human",
"value": "from fabric.api import run, env, roles\nfrom fabric.contrib.project import rsync_project\n\nimport sys\nsys.path.append(\"source\")\n... | python | chosen |
[
{
"from": "system",
"value": "Add note describing array copy if discontiguous\n"
},
{
"from": "human",
"value": "import numpy as np\n\n\ndef unique_rows(ar):\n \"\"\"Remove repeated rows from a 2D array.\n\n Parameters\n ----------\n ar : 2D np.ndarray\n The input array.\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Test global ip with Sphinx\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nfrom .common import *\n\nsphinx_conf.listen = \"127.0.0.1:9312\"\nsphinx_conf.var_dir = \"C:\\\\Sphinx\"\n\ndb_conf.database = \"postgr... | python | chosen |
[
{
"from": "system",
"value": "Validate username and password on signup\n"
},
{
"from": "human",
"value": "from flask_wtf import FlaskForm\nfrom wtforms import StringField, BooleanField, PasswordField\nfrom wtforms.validators import DataRequired\n\n\nclass LoginForm(FlaskForm):\n username = St... | python | chosen |
[
{
"from": "system",
"value": "Create a speaker profile for each user that is registered.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\n\n\nclass Speaker(models.Model):\n \"\"\"\n T... | python | chosen |
[
{
"from": "system",
"value": "Add templatetag to check if user included in group\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.forms import CheckboxInput\n\n\nregister = template.Library()\n\n\n@register.filter(name='addclass')\ndef addclass(value, arg):\n return... | python | chosen |
[
{
"from": "system",
"value": "Add test for emergency compliments\n"
},
{
"from": "human",
"value": "import pytest\r\n\r\nfrom pmxbot import util\r\n\r\n@pytest.has_wordnik\r\ndef test_lookup():\r\n\tassert util.lookup('dachshund') is not None\r\n"
},
{
"from": "gpt",
"value": "import... | python | chosen |
[
{
"from": "system",
"value": "Make the 4 lights bounce backwards and forwards along each edge.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport unicornhathd\nimport os\n\ntry:\n unicornhathd.set_pixel(0, 0, 255, 255, 255)\n unicornhathd.set_pixel(15, 0, 255, 255, 255)\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix divide by zero error in vectors loading\n"
},
{
"from": "human",
"value": "import numpy\n\nSPACY_MODELS = {}\nVECTORS = {}\n\n\ndef get_spacy(lang, **kwargs):\n global SPACY_MODELS\n import spacy\n if lang not in SPACY_MODELS:\n SPACY_MODELS[lang... | python | chosen |
[
{
"from": "system",
"value": "Add FilePath to the gdb pretty printers.\n\nReview URL: http://codereview.chromium.org/6621017\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@76956 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# Copyright (c) 20... | python | chosen |
[
{
"from": "system",
"value": "Remove urbansimd from excluded packages.\n"
},
{
"from": "human",
"value": "from ez_setup import use_setuptools\r\nuse_setuptools()\r\n\r\nfrom setuptools import setup, find_packages\r\n\r\nsetup(\r\n name='urbansim',\r\n version='0.2dev',\r\n description='... | python | chosen |
[
{
"from": "system",
"value": "Add classifier for Python 3.6\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name='django-pgallery',\n version=__... | python | chosen |
[
{
"from": "system",
"value": "Clean up configuration check utility\n"
},
{
"from": "human",
"value": "import httplib2\nimport os\nimport sys\nimport time\n\nfrom apiclient import discovery\nfrom oauth2client import file\nfrom oauth2client import client\nfrom oauth2client import tools\n\nfrom con... | python | chosen |
[
{
"from": "system",
"value": "Test edit - to check svn email hook"
},
{
"from": "human",
"value": "from distutils.core import setup\nimport os, glob, string, shutil\n\n# Packages\n\npackages = ['neuroimaging', 'neuroimaging.statistics', 'neuroimaging.image', 'neuroimaging.reference', 'neuroimagi... | python | chosen |
[
{
"from": "system",
"value": "Use find_packages instead of an explicit list of packages for easier maintenance.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name=\"balrog\",\n version=\"1.0\",\n description=\"Mozilla's Update Server\",\n author=\"Ben ... | python | chosen |
[
{
"from": "system",
"value": "Fix swapped dates on invoices\n"
},
{
"from": "human",
"value": "from django.core.management import BaseCommand\nfrom spiff.membership.utils import monthRange\nfrom spiff.membership.models import Member, RankLineItem\nfrom spiff.payment.models import Invoice\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Fix passing arguments to ban_url\n\nh/t @cwisecarver\n"
},
{
"from": "human",
"value": "from functools import partial\n\nfrom api.caching.tasks import ban_url\nfrom framework.postcommit_tasks.handlers import enqueue_postcommit_task\nfrom modularodm import signals\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix import on stacked bar example.\n"
},
{
"from": "human",
"value": "from bokeh.charts import Bar, output_file, show\nfrom bokeh.charts.operations import blend\nfrom bokeh.charts._attributes import cat, color\nfrom bokeh.charts.utils import df_from_json\nfrom bokeh... | python | chosen |
[
{
"from": "system",
"value": "Make Estimator importable from pipeline.\n"
},
{
"from": "human",
"value": "\"\"\"\nThe :mod:`hcibench.pipeline` module provides a flexible infrastructure for\ndata processing and implements some common types of processing blocks.\n\"\"\"\n\nfrom .base import Pipeli... | python | chosen |
[
{
"from": "system",
"value": "Add bumpversion as a dev requirement.\n"
},
{
"from": "human",
"value": "\nfrom setuptools import setup, find_packages\n\nsetup(\n name='jawa',\n packages=find_packages(),\n version='2.1.1',\n python_requires='>=3.6',\n description='Doing fun stuff wi... | python | chosen |
[
{
"from": "system",
"value": "Add trove classifiers specifying Python 3 support.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Distutils installer for extras.\"\"\"\n\nfrom setuptools import setup\nimport os.path\n\nimport extras\ntesttools_cmd = extras.try_import('testtools.Te... | python | chosen |
[
{
"from": "system",
"value": "Add z Patch number as per symver.org\n"
},
{
"from": "human",
"value": "import os\nimport setuptools\n\n\nsetuptools.setup(\n name='factory_djoy',\n version='0.5',\n\n description='Factories for Django, creating valid instances every time',\n url='http:/... | python | chosen |
[
{
"from": "system",
"value": "Make abstract methods raise not implemented\n"
},
{
"from": "human",
"value": "import sys\nfrom abc import ABCMeta, abstractmethod\n\ndef printerr(msg, e=''):\n msg = \"Backend: \" + str(msg)\n print(msg.format(e), file=sys.stderr)\n\nclass CommandError(Except... | python | chosen |
[
{
"from": "system",
"value": "Change version to dev version\n"
},
{
"from": "human",
"value": "\n__author__ = 'matth'\n\nfrom distutils.core import setup\nfrom setuptools import find_packages\n\nsetup(\n name='py-exe-builder',\n version='0.1',\n packages = find_packages(),\n license=... | python | chosen |
[
{
"from": "system",
"value": "Add entry_point for profiler implementations\n"
},
{
"from": "human",
"value": "\"\"\"Setuptools packaging configuration for pyperf.\"\"\"\n\nfrom setuptools import setup\nfrom setuptools import find_packages\n\n\nwith open('README.rst') as f:\n\n README = f.read... | python | chosen |
[
{
"from": "system",
"value": "Add subdirs of nativeconfig package to build.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\nfrom sys import platform\n\n\nREQUIREMENTS = []\n\nif platform.startswith('darwin'):\n REQUIREMENTS.append('pyobjc-core >= 2.5')\n\n\nwith op... | python | chosen |
[
{
"from": "system",
"value": "Fix compatibility with Python 2 ;)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# © 2017 qsuscs, TobiX\n\nimport os\nimport sys\nfrom glob import glob\n\nos.chdir(os.path.dirname(__file__))\nexit = 0\n\nfor f in glob('dot.*'):\... | python | chosen |
[
{
"from": "system",
"value": "Clean up main a bit\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\nfrom splash import showSplash\n\nfrom functions import quit, getServiceFromUser, getPasswordFromUser, writeToFile\n\ndef main():\n while True:\n servi... | python | chosen |
[
{
"from": "system",
"value": "Remove whitespaces from lambda expression\n"
},
{
"from": "human",
"value": "import requests\nimport os\nfrom .endpoints import *\n\n\nclass UnauthorizedToken(Exception):\n pass\n\n\nclass ReviewsAPI:\n\n def __init__(self):\n token = os.environ['UDACIT... | python | chosen |
[
{
"from": "system",
"value": "Add update_reservation to dummy plugin\n\nupdate_reservation is now an abstract method. It needs to be added to\nall plugins.\n\nChange-Id: I921878bd5233613b804b17813af1aac5bdfed9e7\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013 Mirantis Inc.\n#\n# Licensed... | python | chosen |
[
{
"from": "system",
"value": "Fix test for locale route generation. "
},
{
"from": "human",
"value": "from .. import ControllerTestCase, url\n\nclass TestHomeController(ControllerTestCase):\n\n def test_index(self):\n response = self.app.get(url(controller='home', action='index'))\n ... | python | chosen |
[
{
"from": "system",
"value": "Advance PyPI version to 2.5.\n"
},
{
"from": "human",
"value": "from setuptools import setup\nsetup(name='q', version='2.4', py_modules=['q'],\n description='Quick-and-dirty debugging output for tired programmers',\n author='Ka-Ping Yee', author_email='pin... | python | chosen |
[
{
"from": "system",
"value": "Add VM valid profile model\n"
},
{
"from": "human",
"value": "from geonature.utils.env import DB\nfrom utils_flask_sqla.serializers import serializable\n\n@serializable\nclass VmCorTaxonPhenology(DB.Model):\n __tablename__ = \"vm_cor_taxon_phenology\"\n __tabl... | python | chosen |
[
{
"from": "system",
"value": "Update the PyPI version to 7.0.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n try:\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n except:\n return... | python | chosen |
[
{
"from": "system",
"value": "Add long description from README\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nfrom turbasen import VERSION\n\nname = 'turbasen'\n\nsetup(\n name=name,\n packages=[name],\n version=VERSION,\n description='Client for Nasjonal Turb... | python | chosen |
[
{
"from": "system",
"value": "Remove support for Python 2\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom os import path\nfrom setuptools import setup\n\n\nwith open(path.join(path.abspath(path.dirname(__file__)), 'README.rst')) as f:\n long_description = f.read()\n\n\nsetup(... | python | chosen |
[
{
"from": "system",
"value": "Include README for PyPI release\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom os.path import join\nfrom setuptools import setup, find_packages\n\n\nname = 'geokey-sapelli'\nversion = __import__(name.replace('-', '_')).__version__\nrepository = joi... | python | chosen |
[
{
"from": "system",
"value": "Remove lucene query builder and bumper version\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='neomodel',\n version='0.4.0',\n description='An object mapper for the neo4j graph database.',\n long_descripti... | python | chosen |
[
{
"from": "system",
"value": "Mark as compatible for python 2.7, 3.3 and 3.4\n\nAdd `classifiers` parameter to `setup` function call in `setup.py` file."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom distutils.core import setup\n\nreadme_file = open('README.rst')\n\nsetup(\n ... | python | chosen |
[
{
"from": "system",
"value": "Add to extras_require examples section\n"
},
{
"from": "human",
"value": "\"\"\"setup.py\"\"\"\n\nfrom codecs import open as codecs_open\nfrom setuptools import setup\n\nwith codecs_open('README.rst', 'r', 'utf-8') as f:\n README = f.read()\n\nwith codecs_open('H... | python | chosen |
[
{
"from": "system",
"value": "Cut out logo in README uploaded to PyPi\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import find_packages, setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as readme:\n README = readme.read()\n\nsetup(... | python | chosen |
[
{
"from": "system",
"value": "Update the PyPI version to 0.2.6.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n try:\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n except:\n retu... | python | chosen |
[
{
"from": "system",
"value": "Add cffi to the package requirements.\n"
},
{
"from": "human",
"value": "from setuptools import find_packages\nfrom setuptools import setup\n\nsetup(\n name='kms-encryption-toolbox',\n version='0.0.5',\n url='https://github.com/ApplauseOSS/kms-encryption-to... | python | chosen |
[
{
"from": "system",
"value": "Change HTTP method for validate endpoint\n"
},
{
"from": "human",
"value": "import flask\nfrom flask import request, json\n\ndef Response(data, status = 200):\n body = json.dumps(data)\n return flask.Response(body, status = status, mimetype = 'application/json... | python | chosen |
[
{
"from": "system",
"value": "Add Twitter API client initialization.\n"
},
{
"from": "human",
"value": "import json\nimport logging\nimport logging.config\nimport os\nimport sys\n\nimport config\nimport constants\n\n\ndef setup_logging(\n path='logging.json',\n log_level=logging.DE... | python | chosen |
[
{
"from": "system",
"value": "Change getter in to property"
},
{
"from": "human",
"value": "\nclass MailState():\n _reading_data = False\n\n def set_reading(self, val):\n self._reading_data = val\n\n def get_reading(self):\n return self._reading_data\n"
},
{
"from"... | python | chosen |
[
{
"from": "system",
"value": "Send exception message in response\n"
},
{
"from": "human",
"value": "from rpc import RPCService\nfrom pi_pin_manager import PinManager\n\n\nALLOWED_ACTIONS = ('on', 'off', 'read')\n\n\nclass GPIOService(RPCService):\n\n def __init__(self, rabbit_url, device_key,... | python | chosen |
[
{
"from": "system",
"value": "Add cards for Ideasbox in Burundi\n"
},
{
"from": "human",
"value": "\"\"\"Generic config for Ideasbox of Burundi\"\"\"\nfrom .idb import * # noqa\nfrom django.utils.translation import ugettext_lazy as _\n\nUSER_FORM_FIELDS = (\n ('Ideasbox', ['serial', 'box_awa... | python | chosen |
[
{
"from": "system",
"value": "Update testing stubs with helper lib changes\n"
},
{
"from": "human",
"value": "# Lint as: python3\n\"\"\"These tests ensure correctness for the helper functions in amaranth_lib.\"\"\"\n\nimport unittest\n\n\nclass TestAmaranthHelpers(unittest.TestCase):\n\n def te... | python | chosen |
[
{
"from": "system",
"value": "Fix bug when Opera Mini (and possibly others) present no X-OperaMini-Phone header.\n\n"
},
{
"from": "human",
"value": "from django.conf import settings\nimport geolocation\n\nfrom mobile_portal.wurfl.wurfl_data import devices\nfrom mobile_portal.wurfl import device... | python | chosen |
[
{
"from": "system",
"value": "Modify Zika fasta fields to match default VIPRBRC ordering.\n"
},
{
"from": "human",
"value": "import os, re, time, datetime, csv, sys\nimport rethinkdb as r\nfrom Bio import SeqIO\nfrom vdb_upload import vdb_upload\nfrom vdb_upload import parser\n\nclass Zika_vdb_u... | python | chosen |
[
{
"from": "system",
"value": "Fix sample test settings for use with travis-ci\n"
},
{
"from": "human",
"value": "# minimal django settings required to run tests\nDATABASES = {\n \"default\": {\n \"ENGINE\": \"django.db.backends.sqlite3\",\n \"NAME\": \"test.db\",\n }\n}\n\nSE... | python | chosen |
[
{
"from": "system",
"value": "Add SECURE_REDIRECT_EXEMPT to old HTTP callbacks"
},
{
"from": "human",
"value": "from os import environ\n\nimport dj_database_url\n\nfrom .base import *\n\n\nINSTALLED_APPS += (\n 'djangosecure',\n)\n\nPRODUCTION_MIDDLEWARE_CLASSES = (\n 'djangosecure.middlew... | python | chosen |
[
{
"from": "system",
"value": "Implement @matcher decorator to register matchers.\n"
},
{
"from": "human",
"value": "\"\"\"The compare module contains the components you need to \ncompare values and ensure that your expectations are met.\n\nTo make use of this module, you simply import the \"expe... | python | chosen |
[
{
"from": "system",
"value": "config: Make sure use_testing() is not detected as a unit test by nose\n"
},
{
"from": "human",
"value": "import os\n\nBASE_PATH = os.path.abspath(os.path.dirname(__file__))\n\nPRO_CONF_PATH = '/etc/skylines/production.py'\nDEV_CONF_PATH = os.path.join(BASE_PATH, 'd... | python | chosen |
[
{
"from": "system",
"value": "Allow trailing slash on select_seats url\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom karspexet.ticket import views\n\nurlpatterns = [\n url(r\"^show/(?P<show_id>\\d+)/select_seats$\", views.select_seats, name=\"select_seats\"),\n ... | python | chosen |
[
{
"from": "system",
"value": "Add db settings for angel.\n"
},
{
"from": "human",
"value": "from .base import *\nimport dj_database_url\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES['default'] = dj_database_url.config()\n\nALLOWED_HOSTS = [\n '.captainquail.com',\n '.quailcomics.co... | python | chosen |
[
{
"from": "system",
"value": "Undo that which was done.\n"
},
{
"from": "human",
"value": "from .base import *\nimport dj_database_url\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\ntry:\n DATABASES['default'] = dj_database_url.config()\nexcept ImproperlyConfigured:\n DATABASES = {\n '... | python | chosen |
[
{
"from": "system",
"value": "Modify the tool-info module according to Philipp's reviews\n"
},
{
"from": "human",
"value": "# This file is part of BenchExec, a framework for reliable benchmarking:\n# https://github.com/sosy-lab/benchexec\n#\n# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https:... | python | chosen |
[
{
"from": "system",
"value": "Move python3 custom runtime to sadl"
},
{
"from": "human",
"value": "# TOOL test-data-in-out3.py: \"Test data input and output in Python3\" (Data input output test.) \n# INPUT input TYPE GENERIC\n# OUTPUT output\n\nimport shutil\n\nshutil.copyfile('input', 'output')... | python | chosen |
[
{
"from": "system",
"value": "Test formatting errors with log level being emitted\n\nThe test to ensure that formatting errors are handled properly was being\nrun using info level logging, but the default log configuration for\ntests does not emit messages at that level, so switch to error.\n\nChange-Id: Ie... | python | chosen |
[
{
"from": "system",
"value": "Switch back to using the old SVN update location.\n\nWhile changing the download location would be nice, this keeps the option of putting a final data file that would force users to update.\n"
},
{
"from": "human",
"value": "\"\"\"Handle program wide resources (file... | python | chosen |
[
{
"from": "system",
"value": "Add version, utf-8 and some comments.\n"
},
{
"from": "human",
"value": "from robot.api import logger\n\nimport os\nimport signal\nimport subprocess\n\nROBOT_LIBRARY_DOC_FORMAT = 'reST'\n\n\nclass DjangoLibrary:\n \"\"\"A library for testing Django with Robot Fra... | python | chosen |
[
{
"from": "system",
"value": "Tweak support load path jazz\n"
},
{
"from": "human",
"value": "import os, sys\n\n\nsupport = os.path.join(os.path.dirname(__file__), '_support')\n\ndef load(name):\n sys.path.insert(0, support)\n mod = __import__(name)\n sys.path.pop(0)\n return mod\n"
... | python | chosen |
[
{
"from": "system",
"value": "Fix system form interface_type choices\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom cyder.base.eav.forms import get_eav_form\nfrom cyder.base.mixins import UsabilityFormMixin\nfrom cyder.core.system.models import System, SystemAV\n\n\nclass Sy... | python | chosen |
[
{
"from": "system",
"value": "Remove unused import from contentpages test\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.urls import reverse\n\nfrom contentpages.views import ContentPage\n\n\nclass TestContentPage(TestCase):\n\n def test_get_template(self):\n... | python | chosen |
[
{
"from": "system",
"value": "[ADD] Add checks list on tests init file\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n#\n# Authors: Adrien Peiffer\n# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)\n# All Rights Reserved\n#\n# WARNING: This program as such is i... | python | chosen |
[
{
"from": "system",
"value": "Make filtering invoices and payment details by customer consistent with serializer (WAL-231)\n"
},
{
"from": "human",
"value": "import django_filters\n\nfrom nodeconductor.core.filters import UUIDFilter, URLFilter\n\nfrom . import models\n\n\nclass InvoiceFilter(dja... | python | chosen |
[
{
"from": "system",
"value": "Exit if tuple of remote hosts is empty.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# update_remotes\n# Updates all my remote machines\n#\n# Author: Daniel Gonzalez Gasull\n\nimport sys\n\nfrom fabric import api as fab_api\nfrom fabric import exception... | python | chosen |
[
{
"from": "system",
"value": "Switch from deprecated assignment tags to simple tags\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.conf import settings\n\nregister = template.Library()\n\n\n@register.filter\ndef to_css_name(value):\n return value.lower().replace('... | python | chosen |
[
{
"from": "system",
"value": "Use dashes in url names\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\n\nurlpatterns = patterns('chats.views',\n url('^chats/$', 'index', name='chats_index'),\n url('^chats/new/$', 'new', name='chats_new'),\n url('^chats/(?P<id>... | python | chosen |
[
{
"from": "system",
"value": "Change NUMBER field format: None -> count\n"
},
{
"from": "human",
"value": "REDIS_HOST = '127.0.0.1'\nREDIS_PORT = 6379\nREDIS_DB = 0\n\nMONGO_HOST = '127.0.0.1'\nMONGO_PORT = 27017\nMONGO_DB_NAME = 'appstats'\n\nAPP_IDS = [dict(key='prom.ua', name='Prom.ua'),\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a test for queue_search_JSON.\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom django.core.urlresolvers import resolve\n\nfrom .. import views\n\n\npytestmark = pytest.mark.urls('coda_replication.urls')\n\n\ndef test_queue():\n assert resolve('/APP/qu... | python | chosen |
[
{
"from": "system",
"value": "Increment column to be printed by 1\n"
},
{
"from": "human",
"value": "import os\n\nfrom tailor.types.location import Location\n\n\nclass Printer:\n\n def __init__(self, filepath):\n self.__filepath = os.path.abspath(filepath)\n\n def warn(self, warn_ms... | python | chosen |
[
{
"from": "system",
"value": "Fix flake8 error in Python 3 build\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport logging\nfrom ina219 import INA219\n\nSHUNT_OHMS = 0.1\nMAX_EXPECTED_AMPS = 0.2\n\n\ndef read():\n ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.... | python | chosen |
[
{
"from": "system",
"value": "Remove incorrect check for institution_id\n\nFixes https://sentry.cos.io/sentry/osf-iy/issues/273424/\n"
},
{
"from": "human",
"value": "import logging\nfrom website.notifications.exceptions import InvalidSubscriptionError\nfrom website.notifications.utils import su... | python | chosen |
[
{
"from": "system",
"value": "Use _sendIq for handling pongs\n"
},
{
"from": "human",
"value": "from yowsup.layers import YowProtocolLayer\nfrom yowsup.common import YowConstants\nfrom .protocolentities import *\nclass YowIqProtocolLayer(YowProtocolLayer):\n def __init__(self):\n hand... | python | chosen |
[
{
"from": "system",
"value": "Hide preferences button for now.\n"
},
{
"from": "human",
"value": "from gi.repository import Gio, Gtk\n\nfrom rsr.commands import commands\n\n\nclass HeaderBar(Gtk.HeaderBar):\n\n def __init__(self, win):\n super(HeaderBar, self).__init__()\n self.... | python | chosen |
[
{
"from": "system",
"value": "Fix distributions of the white noise sampler\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\r\n# coding: utf-8\r\n\r\n'''\r\nCreate a white noise animation like a TV screen\r\n'''\r\n\r\nimport numpy as np\r\nfrom PIL import Image\r\n\r\nwidth = 128\r\nheight... | python | chosen |
[
{
"from": "system",
"value": "Fix clobber on crashpad recipe\n\nApparently (from looking at\nhttps://build.chromium.org/p/client.crashpad/builders/crashpad_mac_dbg/builds/25/steps/steps/logs/stdio\n)\n\nbuildbot only adds 'clobber' to the dict, but has a value of '', so just check for existence instead.\n\n... | python | chosen |
[
{
"from": "system",
"value": "Set password in env var\n"
},
{
"from": "human",
"value": "from fabric.api import env, run, local, sudo, settings\nfrom fabric.contrib.console import confirm\n\n\ndef build_local():\n local('docker-compose run app go build -v')\n local('mv app/app ./applicatio... | python | chosen |
[
{
"from": "system",
"value": "Set path to find _xxdata.so files\n"
},
{
"from": "human",
"value": "from .atomic_data import AtomicData\nfrom .collisional_radiative import CollRadEquilibrium\nfrom .time_dependent_rates import RateEquations, RateEquationsWithDiffusion\nfrom .radiation import Radia... | python | chosen |
[
{
"from": "system",
"value": "Add long and empty strings for testing\n"
},
{
"from": "human",
"value": "from echo_client import client\n\n\ndef test_1():\n assert client('This is a unicode test') == 'This is a unicode test'\n\n\ndef test_2():\n assert client(u'This is an é unicode test') =... | python | chosen |
[
{
"from": "system",
"value": "Remove defaults from the sitemap.py that should not be set in Mininews.\n"
},
{
"from": "human",
"value": "from django.contrib.sitemaps import Sitemap\n\n\nclass MininewsSitemap(Sitemap):\n\n # Let's assume that an article - once published - will not change.\n ... | python | chosen |
[
{
"from": "system",
"value": "Update `create_user` method manager to require person\n"
},
{
"from": "human",
"value": "# Django\nfrom django.contrib.auth.models import BaseUserManager\n\n\nclass UserManager(BaseUserManager):\n\n def create_user(self, email, password='', **kwargs):\n us... | python | chosen |
[
{
"from": "system",
"value": "Add timezone settings to the test project.\n"
},
{
"from": "human",
"value": "import os\nlocal_path = lambda path: os.path.join(os.path.dirname(__file__), path)\n\n\nAPP_ROOT = os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..'))\n\nDEBUG = True\n\nS... | python | chosen |
[
{
"from": "system",
"value": "Add tests for invalid and no provided sub-protocols\n"
},
{
"from": "human",
"value": "\"\"\"\nThe tests provided in this module make sure that the server is\ncompliant to the SaltyRTC protocol.\n\"\"\"\nimport pytest\n\n\nclass TestProtocol:\n @pytest.mark.async... | python | chosen |
[
{
"from": "system",
"value": "Add test settings for HipChatChannel\n"
},
{
"from": "human",
"value": "from os import environ\n\n\nSECRET_KEY = \"fake-secret-key\"\n\nINSTALLED_APPS = [\n \"tests\",\n]\n\nDATABASES = {\n \"default\": {\n \"ENGINE\": \"django.db.backends.sqlite3\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add is_uuid unit-tests, including garbage types.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom boltons import strutils\n\n\ndef test_asciify():\n ref = u'Beyoncé'\n b = strutils.asciify(ref)\n assert len(b) == len(b)\n assert b[-1:].... | python | chosen |
[
{
"from": "system",
"value": "Create the Contacts App - Part II > New Contact - Create View\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.contrib.auth.decorators import login_required\n\nfrom .models import Contact\n\n\n@login_required()\ndef contact_detail(... | python | chosen |
[
{
"from": "system",
"value": "BUG: Return code from script must reflect that of the test.\n"
},
{
"from": "human",
"value": "\"\"\" Driver script for testing sockets\n Unix only\n\"\"\"\nimport os, sys, time\n\n# Fork, run server in child, client in parent\npid = os.fork()\nif pid == 0:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add token type to test id\n"
},
{
"from": "human",
"value": "from tests.test import Test\n\n\ndef pytest_addoption(parser):\n parser.addoption('--transport-urls', action='store', help='Transport urls')\n parser.addoption('--admin-refresh-token', action='store'... | python | chosen |
[
{
"from": "system",
"value": "Allow filtering of event by title\n"
},
{
"from": "human",
"value": "from tastypie.resources import ModelResource\nfrom models import Event\n\n\nclass EventResource(ModelResource):\n class Meta:\n queryset = Event.objects.all()\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Set deprecated password hashing schemes\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.\n# This file is part of the Pycroft project and licensed under the terms of\n# the Apache License, Ver... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.