conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix tests python 2.6 support\n"
},
{
"from": "human",
"value": "from s3authbasic.testing import BaseAppTest, AUTH_ENVIRON\n\n\nclass ViewsTests(BaseAppTest):\n\n def test_validpath(self):\n for (path, expect) in (\n ('/', 'home'),\n (... | python | chosen |
[
{
"from": "system",
"value": "Add classifier for Python 3.7.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\n\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\n\nsetup(\n name=\"django-pgallery\",\n ver... | python | chosen |
[
{
"from": "system",
"value": "Add 'notebook' as a dependency\n"
},
{
"from": "human",
"value": "import setuptools\n\nsetuptools.setup(\n name=\"nbresuse\",\n version='0.1.0',\n url=\"https://github.com/yuvipanda/nbresuse\",\n author=\"Yuvi Panda\",\n description=\"Simple Jupyter e... | python | chosen |
[
{
"from": "system",
"value": "Update to get newest nose version.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nimport os\n\nversion = '0.4.3'\nhere = os.path.abspath(os.path.dirname(__file__))\nlong_description = open(os.path.join(here, 'README.rst')).read()\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add long description content type\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Packaging implementation\"\"\"\nfrom os.path import dirname, join\nfrom setuptools import setup\n\n\ndef read_file(filename):\n with open(join(dirname(__file__), f... | python | chosen |
[
{
"from": "system",
"value": "Add a description for the package\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom setuptools import setup, find_packages\n\nsetup(\n name = 'envitro',\n version = '0.1.0',\n packages = find_packages(),\n description = '',\n license = ... | python | chosen |
[
{
"from": "system",
"value": "Make minimum cffi versions consistent\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom setuptools import setup, find_packages\n\n\nsetup(\n name='webp',\n version='0.1.0a17',\n url='https://github.com/anibali/pywebp',\n packages=find_pac... | python | chosen |
[
{
"from": "system",
"value": "Add new version to PyPi\n"
},
{
"from": "human",
"value": "\"\"\"\nSetup and installation for the package.\n\"\"\"\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nsetup(\n name=\"three\",\n version=\"0.... | python | chosen |
[
{
"from": "system",
"value": "Remove python prefix from name\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport re\nfrom setuptools import setup, find_packages\n\n\ndef get_version(filename):\n content = open(filename).read()\n metadata = dict(re.findall(\... | python | chosen |
[
{
"from": "system",
"value": "Update to new version :)\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()\n\nos.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))\n\nse... | python | chosen |
[
{
"from": "system",
"value": "Update Trove classifier to include Python 3.7\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='snappass',\n version='1.3.0',\n description=\"It's like SnapChat... for Passwords.\",\n long_description=(open('README.rst').r... | python | chosen |
[
{
"from": "system",
"value": "Fix typo when renaming ingestor -> ingester\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(\n name='datacube-experiments',\n description='Experimental Datacube v2 Ingestor',\n version='0.0.1',\n packages... | python | chosen |
[
{
"from": "system",
"value": "Allow to fake the currency rates.\n\n- The envidonment variable KICOST_CURRENCY_RATES can be used to fake\n the cunrrency rates.\n- It must indicate the name of an XML file containing the desired\n rates.\n- The format is the one used by the European Central Bank.\n"
},
{... | python | chosen |
[
{
"from": "system",
"value": "Clean up in Qt API switcher.\n"
},
{
"from": "human",
"value": "\"\"\" A Qt API selector that can be used to switch between PyQt and PySide.\n\"\"\"\n\nimport os\n\n# Use PyQt by default until PySide is stable.\nqt_api = os.environ.get('QT_API', 'pyqt')\n\nif qt_api... | python | chosen |
[
{
"from": "system",
"value": "Return response instead of print on client side\n"
},
{
"from": "human",
"value": "import socket\nimport sys\n\n\ndef client(msg):\n client_socket = socket.socket(\n socket.AF_INET,\n socket.SOCK_STREAM,\n socket.IPPROTO_IP)\n client_socke... | python | chosen |
[
{
"from": "system",
"value": "Disable the annotationSpec so that CI will pass until we fix it.\n"
},
{
"from": "human",
"value": "import os\nimport pytest\nfrom pytest_girder.web_client import runWebClientTest\n\nfrom .girder_utilities import girderWorker # noqa\n\n\n@pytest.mark.usefixtures('g... | python | chosen |
[
{
"from": "system",
"value": "Fix parsing irc messages with empty list of parameters\n"
},
{
"from": "human",
"value": "from collections import namedtuple\n\nIRCMsg = namedtuple('IRCMsg', 'prefix cmd params postfix')\n\ndef parse(line):\n \"\"\" Parses line and returns a named tuple IRCMsg\n ... | python | chosen |
[
{
"from": "system",
"value": "Add Range header for GET that should be HEAD\n"
},
{
"from": "human",
"value": "import json\nimport requests\nimport requests_jwt\n\ntry:\n from config import credentials, urls\nexcept ImportError:\n print('Config.py not found. Copy config.in to config.py and ... | python | chosen |
[
{
"from": "system",
"value": "Add author note and description\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nimport csv\nimport json\n\ndef main(argv):\n if len(argv) < 1:\n print \"Usage: ./stops.py outFile.js [/path/to/stops.txt]\"\n\n csvFile = open(argv[1] i... | python | chosen |
[
{
"from": "system",
"value": "Fix st2actions tests so they pass under Python 3.\n"
},
{
"from": "human",
"value": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information r... | python | chosen |
[
{
"from": "system",
"value": "Use SCM feature to build Conan package\n\n- SCM could export all project files helping to build\n\nSigned-off-by: Uilian Ries <d4bad57018205bdda203549c36d3feb0bfe416a7@gmail.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Check that response is not a StreamingResponse.\n"
},
{
"from": "human",
"value": "\"\"\"\nMiddleware for injecting the live-reload script.\n\"\"\"\nfrom bs4 import BeautifulSoup\n\nfrom django.utils.encoding import smart_str\nfrom django.conf import settings\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add new caps variable, fix line length"
},
{
"from": "human",
"value": "from zirc import Sasl\n\n# zIRC\nsasl = Sasl(username=\"BigWolfy1339\", password=\"\")\n\n# IRC\nchannels = [\"##wolfy1339\", \"##powder-bots\", \"##jeffl35\"]\n\n# Logging\nlogFormat = '%(level... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Add partner view injerit and model inherit\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom openerp import models, fields\n\nclass Partner(models.Model):\n _inherit = 'res.partner'\n\n instructor = fields.Boolean(help=\"Thi... | python | chosen |
[
{
"from": "system",
"value": "Allow a fake gear client to be supplied\n"
},
{
"from": "human",
"value": "# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n# -*- test-case-name: flocker.node.test.test_deploy -*-\n\n\"\"\"\nDeploy applications on nodes.\n\"\"\"\n\nclass Deployment(obje... | python | chosen |
[
{
"from": "system",
"value": "Make tests pass in Django 1.4.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n },\n}\n\n\nCACHES = {\n 'default': {\n 'BACKEND': 'django.core.cache.backen... | python | chosen |
[
{
"from": "system",
"value": "Load the version from the package metadata.\n"
},
{
"from": "human",
"value": "\"\"\"\nThis project aims to bring the power of the Google Voice API to\nthe Python language in a simple,\neasy-to-use manner. Currently it allows you to place calls, send sms,\ndownload ... | python | chosen |
[
{
"from": "system",
"value": "Add parameter for frame rate.\n"
},
{
"from": "human",
"value": "import climate\n\nimport database\n\n\n@climate.annotate(\n root='load data files from this directory tree',\n output='save smoothed data files to this directory tree',\n accuracy=('fit SVT wi... | python | chosen |
[
{
"from": "system",
"value": "Disable some tests in test_hbase_insert to fix the build.\n\nChange-Id: I037b292d0eb93c5c743a201b2045eb2ba0712ae7\nReviewed-on: http://gerrit.ent.cloudera.com:8080/387\nReviewed-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485a125d802@cloudera.com>\nTested-by: Ishaan Joshi <d... | python | chosen |
[
{
"from": "system",
"value": "Use pathlib to read ext.conf\n"
},
{
"from": "human",
"value": "import os\n\nfrom mopidy import config, exceptions, ext\n\n__version__ = \"2.0.0\"\n\n\nclass Extension(ext.Extension):\n\n dist_name = \"Mopidy-MPRIS\"\n ext_name = \"mpris\"\n version = __ver... | python | chosen |
[
{
"from": "system",
"value": "Fix Syntax error for Python<3.5\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nimport jinja2\n\nfrom django.utils.safestring import mark_safe\nfrom django_jinja import library\n\nfrom .. import json\nfrom ..jsonld import graph\n\n\n@library.filt... | python | chosen |
[
{
"from": "system",
"value": "Core: Enable modifying orders with taxes\n\nRefs SHOOP-2338 / SHOOP-2578\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# This file is part of Shoop.\n#\n# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.\n#\n# This source code is licensed under... | python | chosen |
[
{
"from": "system",
"value": "tornado: Remove a misleading comment and reformat.\n\ntornado.web.Application does not share any inheritance with Django at\nall; it has a similar router interface, but tornado.web.Application is\nnot an instance of Django anything.\n\nRefold the long lines that follow it.\n"
... | python | chosen |
[
{
"from": "system",
"value": "Add support for per Argument help data\n"
},
{
"from": "human",
"value": "class Argument(object):\n def __init__(self, name=None, names=(), kind=str, default=None):\n if name and names:\n msg = \"Cannot give both 'name' and 'names' arguments! Pi... | python | chosen |
[
{
"from": "system",
"value": "Make tox with with py3.2: the .so is named differently there.\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport zipfile\n\nfrom nose import core as nose_core\n\nif sys.argv[1] == \"remove_extension\":\n try:\n os.remove(\"coverage/tracer.so\... | python | chosen |
[
{
"from": "system",
"value": "Test DAP getitem and setitem together."
},
{
"from": "human",
"value": "import unittest\nimport numpy as np\nfrom IPython.parallel import Client\nfrom distarray.client import DistArrayContext\n\n\nclass TestDistArrayContext(unittest.TestCase):\n\n def setUp(self)... | python | chosen |
[
{
"from": "system",
"value": "Update to next dev version"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom celery.signals import setup_logging\nimport orchestrator.logger\n\n__version__ = '0.5.0'\n__author__ = 'sukrit'\n\norchestrator.logger.init_logging()\nsetup_logg... | python | chosen |
[
{
"from": "system",
"value": "Remove alpha clipping as it did not help\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport tensorflow as tf\n\ndef prelu(features, initializer=None, scope=None)... | python | chosen |
[
{
"from": "system",
"value": "Allow resource definitions from standard input.\n"
},
{
"from": "human",
"value": "import sys\nimport json\n\nfrom openshift3.resources import load, dumps\n\nresources = load(sys.argv[1])\nprint(repr(resources))\n\nimport pprint\npprint.pprint(json.loads(dumps(resou... | python | chosen |
[
{
"from": "system",
"value": "Exclude QuickFilesNodes that don't have contributors\n"
},
{
"from": "human",
"value": "import logging\nimport sys\n\nfrom django.db import transaction\nfrom django.db.models import F\n\nfrom website.app import setup_django\nsetup_django()\nfrom osf.models import Qu... | python | chosen |
[
{
"from": "system",
"value": "Make sitemap yet more efficient\n"
},
{
"from": "human",
"value": "from django.contrib.sitemaps import Sitemap\nfrom .papers.models import Paper\n\n\nclass PaperSitemap(Sitemap):\n changefreq = \"monthly\"\n priority = 0.5\n limit = 5000\n\n def items(se... | python | chosen |
[
{
"from": "system",
"value": "Fix templates path error (template -> templates)\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\nfrom flask_bootstrap import Bootstrap\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_login import LoginManager\nimport telegram\n\nfrom co... | python | chosen |
[
{
"from": "system",
"value": "Fix method docstring (copy paste error)\n\nGuess there was a copy paste error in this PR: https://github.com/google/timesketch/commit/64157452b7b8285ea928e4949434d46592791d47\r\n\r\nAs the method does not return user info."
},
{
"from": "human",
"value": "# Copyrigh... | python | chosen |
[
{
"from": "system",
"value": "Add some more views tests\n"
},
{
"from": "human",
"value": "import os\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"api.api.settings\")\n\nimport pytest\nimport django\nfrom django.test import TestCase\nfrom rest_framework.test import APIRequestFactory\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Support -'s in github repo and owner name\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom metaci.repository import views as repository_views\n\n\nurlpatterns = [\n url(\n r'(?P<owner>\\w+)/(?P<name>[^/].*)/branch/(?P<branch>.*)$... | python | chosen |
[
{
"from": "system",
"value": "Fix failing tests by injecting an empty koji module.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\n\"\"\"\nTests for koji_sign module.\n\"\"\"\n\n\nimport unittest\n\nimport os\nimport sys\n\nDIR = os.path.dirname(__file__)\nsys.... | python | chosen |
[
{
"from": "system",
"value": "tests/scale: Make a separate test for negative lengths\n\nPreviously, we didn't check that negative lengths raise a ValueError,\nbut that *if* a ValueError was raised, then the length was negative.\n"
},
{
"from": "human",
"value": "from hypothesis import assume, gi... | python | chosen |
[
{
"from": "system",
"value": "Add tests for `extract_regex` function.\n"
},
{
"from": "human",
"value": "from parsel.utils import shorten\n\nfrom pytest import mark, raises\nimport six\n\n\n@mark.parametrize(\n 'width,expected',\n (\n (-1, ValueError),\n (0, u''),\n (1... | python | chosen |
[
{
"from": "system",
"value": "Add profile view - default login redirect\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom django.contrib.auth.views import (\n password_change,\n password_change_done,\n password_reset,\n password_reset_done,\n password_reset... | python | chosen |
[
{
"from": "system",
"value": "Return members in roster cmd out.\n"
},
{
"from": "human",
"value": "import json\n\nimport click\n\nfrom spanky.cli import pass_context\nfrom spanky.lib.enroll import roster\n\n\n@click.command('roster', short_help='Enroll / leave')\n@click.argument('name')\n@pass_c... | python | chosen |
[
{
"from": "system",
"value": "Fix urlparse name collision with method\n"
},
{
"from": "human",
"value": "\"\"\"Utilities to make Python 3 support easier, providing wrapper methods which\ncan call the appropriate method for either Python 2 or Python 3 but creating\na single API point for rabbitpy... | python | chosen |
[
{
"from": "system",
"value": "Replace buggy NotImplemented with NotImplementedError().\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom typing import Any, Text\nfrom bs4 import BeautifulSoup\n\n\nclass BaseParser(object):\n def __init__(self, html_source):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use normal Resource as default for ResourceList\n\nto avoid potential circular import.\n"
},
{
"from": "human",
"value": "from pale.fields.base import BaseField, ListField\nfrom pale.resource import Resource\n\n\nclass ResourceField(BaseField):\n \"\"\"A field th... | python | chosen |
[
{
"from": "system",
"value": "Increase daemon shutdown timeout to 20s for slow Travis CI Windows runs"
},
{
"from": "human",
"value": "import time\n\nimport pytest\n\n\n\ndef test_version(client):\n\texpected_keys = {\"Repo\", \"Commit\", \"Version\"}\n\tresp_version = client.version()\n\tassert... | python | chosen |
[
{
"from": "system",
"value": "TST: Add real tests of replay History.\n"
},
{
"from": "human",
"value": "import nose\nfrom dataportal.replay.persist import History\n\nh = None\n\ndef setup():\n h = History(':memory:')\n\ndef test_history():\n pass\n"
},
{
"from": "gpt",
"value":... | python | chosen |
[
{
"from": "system",
"value": "Allow for Day name and ordinal suffix to be translated\n"
},
{
"from": "human",
"value": "import datetime\n\n\ndef time_choice(time):\n display_format = \"%I:%M %p\"\n end = time + datetime.timedelta(minutes=30)\n display_string = time.strftime(display_form... | python | chosen |
[
{
"from": "system",
"value": "Comment out our global stuff for now\n"
},
{
"from": "human",
"value": "\"\"\"The application's Globals object\"\"\"\n\nimport logging\nimport inspect\n\nfrom tg import config\nfrom shove import Shove\n\nfrom moksha.exc import CacheBackendException\nfrom moksha.lib.... | python | chosen |
[
{
"from": "system",
"value": "Fix python3 build: Set byte encoding when writing to file.\n"
},
{
"from": "human",
"value": "import os\nfrom testfixtures import tempdir\nimport unittest\nimport yaml\nfrom i2ssh.config import Config\n\nFILENAME = '.i2sshrc'\n\nclass ConfigTest(unittest.TestCase):\... | python | chosen |
[
{
"from": "system",
"value": "Use the extracted json for getting data from OSEObject to not extract it every time\n"
},
{
"from": "human",
"value": "class OSEObject(object):\n \"\"\"Superclass to all OSE objects that hold data about remote API.\"\"\"\n def __init__(self, ose):\n sel... | python | chosen |
[
{
"from": "system",
"value": ":hammer: Add test for testing config\n"
},
{
"from": "human",
"value": "from labsys.app import create_app\n\n\ndef test_production_config():\n app = create_app('production')\n assert app.config['DEBUG'] is False\n\ndef test_development_config():\n app = cre... | python | chosen |
[
{
"from": "system",
"value": "Use an Unicode object format string when building HTML for the admin, since the arguments can be Unicode as well.\n\nFixes #2. Translated labels are now displayed correctly.\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.conf import sett... | python | chosen |
[
{
"from": "system",
"value": "Implement test to ensure the replay dir existence is verified\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_replay\n-----------\n\"\"\"\n\nimport os\nimport pytest\n\n\nfrom cookiecutter import replay\nfrom cookiecutter.config import get... | python | chosen |
[
{
"from": "system",
"value": "Add checkboxselectmultiple widget for admin form\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django import forms\nfrom django.contrib.auth.models import Group\n\nfrom osf.models import AdminProfile\n\n\nclass LoginForm(forms.For... | python | chosen |
[
{
"from": "system",
"value": "Add an instance profile for container instances\n"
},
{
"from": "human",
"value": "from troposphere import (\n Parameter,\n Ref,\n)\n\nfrom troposphere.ecs import (\n Cluster,\n)\n\nfrom .template import template\n\n\ncontainer_instance_type = Ref(template.... | python | chosen |
[
{
"from": "system",
"value": "Put some recurring things into a loop to simply code.\n"
},
{
"from": "human",
"value": "import json\n\n\nclass D3_Schedule:\n\n def __init__(self, schedule):\n self.schedule = schedule\n\n def get_d3_schedule(self, by_year=None):\n d3_data =... | python | chosen |
[
{
"from": "system",
"value": "Change rel paths into abspaths and use helper module\n"
},
{
"from": "human",
"value": "#!/bin/env python\n#\n# glidein_cat\n#\n# Execute a cat command on the job directory\n#\n# Usage:\n# glidein_ls.py <cluster>.<process> [-name <schedd_name>] [-pool <pool_name> ]... | python | chosen |
[
{
"from": "system",
"value": "Remove category slug from the API\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport json\n\nfrom rest_framework import serializers\n\nfrom catalog.models import Course, Category\nfrom documents.serializers ... | python | chosen |
[
{
"from": "system",
"value": "Add a regression test for the bug fixed in r28485.\n\n* subversion/bindings/swig/python/tests/core.py\n (SubversionCoreTestCase.test_SubversionException): Test explicit\n exception fields.\n"
},
{
"from": "human",
"value": "import unittest, os\n\nimport svn.core... | python | chosen |
[
{
"from": "system",
"value": "Remove not needed request argument in view decorator.\n\nPatch by: Pawel Solyga\nReview by: to-be-reviewed\n\n--HG--\nextra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%40826\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2.5\n#\n# Copy... | python | chosen |
[
{
"from": "system",
"value": "Fix variable name in Python snippet\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Generate fixtures.\"\"\"\n\nimport os\nimport json\nimport math as m\nimport numpy as np\nfrom scipy import special\n\n\n# Get the file path:\nFILE = os.path.realpath... | python | chosen |
[
{
"from": "system",
"value": "Use argument list instead of lhs/rhs pari in ArithmeticOperation\n"
},
{
"from": "human",
"value": "from thinglang.common import ObtainableValue\nfrom thinglang.parser.tokens import BaseToken\n\n\nclass ArithmeticOperation(BaseToken, ObtainableValue):\n OPERATION... | python | chosen |
[
{
"from": "system",
"value": "Declare public interface for api.sms.api module\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright 2016 Messente Communications OÜ\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in c... | python | chosen |
[
{
"from": "system",
"value": "Remove extraneous print, comment out naked detect_tone call\n"
},
{
"from": "human",
"value": "import cProfile\nfrom cfg import *\nfrom detect_tone import *\nfrom gen_test import *\nfrom element_resolve import *\n\n\n\nif __name__ == \"__main__\":\n\t#gen_test_data(... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong pagination param in ListNoteCallMixin\n\nsee #17\n"
},
{
"from": "human",
"value": "from highton.call_mixins import Call\nfrom highton import fields\n\n\nclass ListNoteCallMixin(Call):\n \"\"\"\n A mixin to get all notes of inherited class\n These... | python | chosen |
[
{
"from": "system",
"value": "Use == for permission check\n"
},
{
"from": "human",
"value": "from sentry.constants import MEMBER_USER\nfrom sentry.models import Team, Project, User\n\n\nclass PermissionError(Exception):\n pass\n\n\ndef has_perm(object, user, access=MEMBER_USER):\n if user.... | python | chosen |
[
{
"from": "system",
"value": "Fix events.MessageDeleted setting readonly properties\n"
},
{
"from": "human",
"value": "from .common import EventBuilder, EventCommon, name_inner_event\nfrom ..tl import types\n\n\n@name_inner_event\nclass MessageDeleted(EventBuilder):\n \"\"\"\n Event fired ... | python | chosen |
[
{
"from": "system",
"value": "chore(fixture-tests): Improve app test and silence pylint\n"
},
{
"from": "human",
"value": "\"\"\"\nTest fixtures.\n\n:copyright: (c) 2017 Derek M. Frank\n:license: MPL-2.0\n\n\"\"\"\n\n\ndef test_simple_app(app):\n \"\"\"Verify basic application.\"\"\"\n ass... | python | chosen |
[
{
"from": "system",
"value": "Add test capturing error when attribute assignment occurs in the top of the script\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport textwrap\nimport sys\nimport subprocess\n\n\ndef test_pkg_imported(tmpdir):\n\t\"\"\"\n\tCreate a ... | python | chosen |
[
{
"from": "system",
"value": "Create CLIENT for auction on start\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom openprocurement.auth.provider_app import oauth_provider, db\n\nimport openprocurement.auth.models\nimport openprocurement.auth.views\n\n\ndef make_oath_provider_app(\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove survey2 route to close the survey\n\nClose the survey for the Manchester researchers.\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url, include\n\nfrom survey.views import *\n\nurlpatterns = patterns('',\n url(r'^about', 'surve... | python | chosen |
[
{
"from": "system",
"value": "Remove site_root from template context, it's never used\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\n\ndef branding(request):\n return {\n \"site_name\": settings.SITE_NAME,\n \"site_root\": settings.SITE_ROOT,\n \"s... | python | chosen |
[
{
"from": "system",
"value": "Fix usage of iter_all_repos in integration tests\n"
},
{
"from": "human",
"value": "from .helper import IntegrationHelper\n\n\nclass TestGitHubIterator(IntegrationHelper):\n def test_resets_etag(self):\n cassette_name = self.cassette_name('resets_etag')\n ... | python | chosen |
[
{
"from": "system",
"value": "Increase request buffer as workaround for stackoverflow in asyncio\n"
},
{
"from": "human",
"value": "from japronto import Application\nfrom services.articles import ArticleService\nfrom mongoengine import *\n\narticle_service = ArticleService()\n\ndef index(req):\n... | python | chosen |
[
{
"from": "system",
"value": "Set port depending on environment\n"
},
{
"from": "human",
"value": "import http.server\n\nPORT = 8000\nHOST = \"127.0.0.1\"\n\n# This will display the site at `http://localhost:8000/`\nserver_address = (HOST, PORT)\n\n# The CGIHTTPRequestHandler class allows us to ... | python | chosen |
[
{
"from": "system",
"value": "Fix one more place where STAGING_HOSTNAME uses settings\n"
},
{
"from": "human",
"value": "import os\n\nfrom django import template\nfrom wagtail.wagtailcore.models import Page\nfrom django.conf import settings\n\nregister = template.Library()\n\n\n@register.filter\... | python | chosen |
[
{
"from": "system",
"value": "Clear unnecessary code, add comments on sorting\n"
},
{
"from": "human",
"value": "#!/dls_sw/prod/tools/RHEL6-x86_64/defaults/bin/dls-python\n\nfrom utilities import get_pv_names, write_pvs_to_file\nimport argparse\n\nparser = argparse.ArgumentParser('optional named... | python | chosen |
[
{
"from": "system",
"value": "Add function to outputter that returns the raw string to print\n"
},
{
"from": "human",
"value": "'''\nUsed to manage the outputter system. This package is the modular system used\nfor managing outputters.\n'''\n\n# Import salt utils\nimport salt.loader\n\n\nSTATIC ... | python | chosen |
[
{
"from": "system",
"value": "Add filter text to signs\n"
},
{
"from": "human",
"value": "def playerIcons(poi):\n if poi['id'] == 'Player':\n poi['icon'] = \"http://overviewer.org/avatar/%s\" % poi['EntityId']\n return \"Last known location for %s\" % poi['EntityId']\n\ndef sign... | python | chosen |
[
{
"from": "system",
"value": "Add a repr for twelve.Environment\n"
},
{
"from": "human",
"value": "import os\n\nimport extensions\n\n\nclass Environment(object):\n\n def __init__(self, adapter=None, environ=None, names=None, *args, **kwargs):\n super(Environment, self).__init__(*args, ... | python | chosen |
[
{
"from": "system",
"value": "Split out subtitle pattern from compilation phase\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport re\nimport datetime\nfrom collections import namedtuple\n\nSUBTITLE_REGEX = re.compile(r'''\\\n(\\d+)\n(\\d+:\\d+:\\d+,\\d+) --> (\\d+:\\d+:\\d+,\\d+... | python | chosen |
[
{
"from": "system",
"value": "Add more thorough testing to user app\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\n# Create your tests here.\nclass BasicTestCase(TestCase):\n \"\"\"Test getting various urls for user app\"\"\"\n def test_getting_login(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Halt emails for time being\n"
},
{
"from": "human",
"value": "import datetime\nimport os\nimport requests\nimport sys\n\n\ndef update(lines):\n url = 'http://api.tfl.gov.uk/Line/Mode/tube/Status'\n resp = requests.get(url).json()\n result = []\n\n for el... | python | chosen |
[
{
"from": "system",
"value": "Update main module with facebook integration\n"
},
{
"from": "human",
"value": "\"\"\"destroyer.py - Main module file for the application. Includes the code for\nthe command line interface.\"\"\"\n\n\nimport click\n\nfrom .services.twitter import TwitterDestroyer\n\... | python | chosen |
[
{
"from": "human",
"value": "Add tests for mk_item and mk_menu.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"Tests for wafer menu utilities.\"\"\"\n\nfrom django.test import TestCase\n\nfrom wafer.menu import Menu\n\n\nclass MenuTests(TestCase):\n\n def test_mk_item_defau... | python | chosen |
[
{
"from": "system",
"value": "Update test to use standard scenario\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom django.db import IntegrityError\nfrom django.test import TestCase\n\nfrom crm.tests.model_maker import (\n make_contact,\n make_user_conta... | python | chosen |
[
{
"from": "system",
"value": "Solve warning coming from django 4.0\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom django.apps import AppConfig\nfrom django.conf import settings\nfrom django.utils.module_loading import import_string\n\nfrom django_fsm.signals imp... | python | chosen |
[
{
"from": "system",
"value": "Fix gravatar hashing error on py3\n"
},
{
"from": "human",
"value": "import hashlib\nfrom django import template\n\nregister = template.Library()\n\n\n@register.filter\ndef to_gravatar_url(email):\n return ('https://gravatar.com/avatar/%s?d=retro' %\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix logout view so django stops complaining\n"
},
{
"from": "human",
"value": "\"\"\"voteswap URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.9/topics/http/urls/\nExamples:\n... | python | chosen |
[
{
"from": "system",
"value": "Check more possibilitie for File.\n"
},
{
"from": "human",
"value": "\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os.path\n\nimport pytest\n\nfrom eccodes_grib import eccodes\nfrom eccodes_grib import message\n\n\nTE... | python | chosen |
[
{
"from": "system",
"value": "Update the user guide URL.\n"
},
{
"from": "human",
"value": "import requests\n\ndef user_guide():\n r = requests.get(\"http://drweeaboo.net/msparp/userguide/duplicateguide.html\")\n r.encoding = r.apparent_encoding\n return r.text, r.status_code\n\n"
},
... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.