conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Declare required version of zeit.cms\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='zeit.content.infobox',\n version='1.23.6dev',\n author='gocept',\n author_email='mail@gocept.com',\n url='https://svn... | python | chosen |
[
{
"from": "system",
"value": "Add contrib package to deployment\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nwith open('README.rst') as readme_file:\n ... | python | chosen |
[
{
"from": "system",
"value": "Change version because of an important bugfix\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"Package setup script; requires setuptools (or Python >=3.4 which\nbundles it).\"\"\"\n\nfrom setuptools import setup\n\nsetup(name='Treepace',\n vers... | python | chosen |
[
{
"from": "system",
"value": "Add another PyPI package classifier of Python 3.5 programming language\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport setuptools\nimport sys\n\nif not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)\n or sys.version_info.major >... | python | chosen |
[
{
"from": "system",
"value": "Fix a typo in the project URL\n\nSigned-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\"\"\"Setup module.\"\"\"\nfrom setuptools import setup, find_packages\nimport os\n\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Update to 0.2, pre-alpha. Fundamental tests are working.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom distribute_setup import use_setuptools\nuse_setuptools()\n\nfrom setuptools import setup\n\n\nsetup(\n name='cotede',\n version='0.1.2',... | python | chosen |
[
{
"from": "system",
"value": "Add rig_assets.json as package data.\n"
},
{
"from": "human",
"value": "version = '0.1.0'\n\nwith open('requirements.txt', 'r') as f:\n install_requires = [x.strip() for x in f.readlines()]\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='bodyl... | python | chosen |
[
{
"from": "system",
"value": "Support optional NameID element in SAML response\n\nPrior to pysaml2 v4.6.1 an exception is thrown when parsing a SAML\nresponse with no NameID element.\n\n satosa.exception.SATOSAAuthenticationError: Failed to parse authn request\n\npysaml2 v4.6.1 onwards supports SAML respon... | python | chosen |
[
{
"from": "system",
"value": "Use bottle to serve HTTP.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='weaveserver',\n version='0.8',\n author='Srivatsan Iyer',\n author_email='supersaiyanmode.rox@gmail.com',\n packages=find_packag... | python | chosen |
[
{
"from": "system",
"value": "Add python3 :: Only classifier\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom os import path\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nreadme_file = path.join(pa... | python | chosen |
[
{
"from": "system",
"value": "Make a new release with circleci detection\n"
},
{
"from": "human",
"value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nconfig = {\n 'description': 'Collect xUnit xml files and upload them to bob-bench.or... | python | chosen |
[
{
"from": "system",
"value": "Add the README as the long description to the package.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nimport wsgiservice\nsetup(\n name='WsgiService',\n version=wsgiservice.__version__,\n description=\"A lean WSGI framework ... | python | chosen |
[
{
"from": "system",
"value": "Remove sqlite3 (part of the standard library) from the list of requirements.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name = 'PyFVCOM',\n packages = ['PyFVCOM'],\n version = '1.3.4',\n description = (\"PyFVCOM is a coll... | python | chosen |
[
{
"from": "system",
"value": "Remove / from script path to make it search bin rather than /bin\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python3\nfrom distutils.core import setup\n\nsetup(\n description = 'File downloader for danbooru',\n author = 'Todd Gaunt',\n url = 'https:/... | python | chosen |
[
{
"from": "system",
"value": "Change homepage to github URL\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name='simplecrypto',\n version=open('CHANGES.txt').read().split()[0],\n author='Lucas Boppre Niehues',\n author_email='lucasboppre@gmail.com',\n... | python | chosen |
[
{
"from": "system",
"value": "Use find_packages to discover packages.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=utf8\n\nimport os\nimport sys\n\nfrom setuptools import setup\n\nif sys.version_info < (2, 7):\n tests_require = ['unittest2', 'mock']\n test_suite = 'un... | python | chosen |
[
{
"from": "system",
"value": "Update trove classifiers with Apache License.\n"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom setuptools import setup\n\nINSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']\nif sys.version_info < (2, 7, 0):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add missing console_scripts entry point.\n\nSigned-off-by: Chris Larson <8cf06b7089d5169434d5def8b2d1c9c9c95f6e71@mvista.com>\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nfrom os.path import join, dirname\n\nversion = 0.1\nshort_de... | python | chosen |
[
{
"from": "system",
"value": "Add classifiers for python 2 and 3 support\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='property-caching',\n version='1.0.1',\n description='Property caching',\n author='Yola',\n author_email='engineers@yola.com',\... | python | chosen |
[
{
"from": "system",
"value": "Update url to point / to the contractions app\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\n\n# Uncomment the next two lines to enable the admin:\nfrom django.contrib import admin\nadmin.autodiscover()\n\nimport contractions... | python | chosen |
[
{
"from": "system",
"value": "Implement cookies fixture along with Helper class\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport pytest\n\n\ndef pytest_addoption(parser):\n group = parser.getgroup('cookies')\n group.addoption(\n '--foo',\n action='store',\... | python | chosen |
[
{
"from": "system",
"value": "Expand pre loading on warmup\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.http import HttpResponse\nfrom django.utils.importlib import import_module\n\ndef warmup(request):\n \"\"\"\n Provides default procedure for handling ... | python | chosen |
[
{
"from": "system",
"value": "Use absolute imports, not relative ones."
},
{
"from": "human",
"value": "\"\"\"\nraven\n~~~~~\n\n:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n\n__all__ = ('VERSION', 'Client', 'load')\... | python | chosen |
[
{
"from": "system",
"value": "Remove the beacon for now\n"
},
{
"from": "human",
"value": "\nfrom .game_manager import GameManager\nfrom .robot_controller import RobotController\nfrom .snake_board import SnakeBoard\nfrom .snake_robot import SnakeRobot\nfrom .snake_beacon import SnakeBeacon\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Fix the Update ECS Service size Lambda\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\"\"\"\nChange the size of an ECS service.\n\nThis is used to schedule our service applications: by setting the desired\nsize to 0/greater-tha... | python | chosen |
[
{
"from": "system",
"value": "Add method for testing async function errors.\n"
},
{
"from": "human",
"value": "\"\"\"\nUnit test test case mixin class.\n\nThis mixin class is intended for use with a subclass of either\n`unittest.TestCase` or `django.test.TestCase`. It includes several\nconvenien... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 1.1.0\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\n__version__ = \"1.0.0\"\n\npackageDir = os.path.dirname(__file__)\nRESOURCE_DIR = os.path.join(os.path.abspath(packageDir), \"resources\")\nif not os.path.isdir(RESOURCE_DI... | python | chosen |
[
{
"from": "system",
"value": "core: Load modules in engine context.\n"
},
{
"from": "human",
"value": "import rave.events\nimport rave.modularity\nimport rave.backends\nimport rave.resources\nimport rave.rendering\n\n\ndef init_game(game):\n rave.events.emit('game.init', game)\n\n with gam... | python | chosen |
[
{
"from": "system",
"value": "Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.\n\nPiperOrigin-RevId: 315308368\nChange-Id: I608c9f6f5f4b9edbbf504ec321fc4c8e90ed8193\n"
},
{
"from": "human",
"value": "# python3\n# Copyright 2018 DeepMind Tech... | python | chosen |
[
{
"from": "system",
"value": "FIX web_demo upload was not processing grayscale correctly\n"
},
{
"from": "human",
"value": "\"\"\"\nThis script handles the skimage exif problem.\n\"\"\"\n\nfrom PIL import Image\nimport numpy as np\n\nORIENTATIONS = { # used in apply_orientation\n 2: (Image.... | python | chosen |
[
{
"from": "system",
"value": "Update API keys and phone number\n"
},
{
"from": "human",
"value": "from twilio.rest import TwilioRestClient\nimport project.utils.reminders\n\nACCOUNT_SID = \"AC6a9746370384b26236aae71013aa35b2\"\nAUTH_TOKEN = \"38b0bcc37788e553978c840929d54aa2\"\n\ndef send_remind... | python | chosen |
[
{
"from": "system",
"value": "Order displayed slides by weight\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\n\nfrom model_uti... | python | chosen |
[
{
"from": "system",
"value": "Set __version__ using param.Version (commit tagged as 'v0.7')\n"
},
{
"from": "human",
"value": "import sys, os\n\n# Add param submodule to sys.path\ncwd = os.path.abspath(os.path.split(__file__)[0])\nsys.path.insert(0, os.path.join(cwd, '..', 'param'))\n\nfrom .vie... | python | chosen |
[
{
"from": "system",
"value": "Indent only (PEP8) commit of simple counter.\n"
},
{
"from": "human",
"value": "# Copyright 2008 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain... | python | chosen |
[
{
"from": "system",
"value": "Remove references to deleted submodule common/\n\nFrom: Fabian Pedregosa <fabian.pedregosa@inria.fr>\n\ngit-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@384 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8\n"
},
{
"from": "human",
"value": "def configuration(parent_package=... | python | chosen |
[
{
"from": "system",
"value": "Remove trailing slash that was causing problems.\n"
},
{
"from": "human",
"value": "from settings import *\n\nOHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'\nDEBUG=False\nADMINS=[\n ('Everybody at OpenHatch', 'all@openhatch.org'),\n]\n\nINVITE_MODE=False # Suckas, invite ... | python | chosen |
[
{
"from": "human",
"value": "Build the actual C2W2C model"
},
{
"from": "gpt",
"value": "\nfrom models import C2W, LanguageModel, W2C\nfrom util import load_training_data\nfrom keras.models import Model\nfrom keras.layers import TimeDistributed, Input, Activation\n\n\nN_batch = 50\nN_ctx =... | python | chosen |
[
{
"from": "system",
"value": "Patch to send mails with UTF8 encoding\n\nJust a temp fix\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module contains the SESBackend class, which is what you'll want to set in\nyour settings.py::\n\n EMAIL_BACKEND = 'seacucumber.backend.SESBackend'\n\"\"\"\nf... | python | chosen |
[
{
"from": "system",
"value": "Read samples faster but log only once a second\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom sense_hat import SenseHat\nfrom pymongo import MongoClient\nimport time\n\n\nDELAY = 1 # in seconds\n\nsense = SenseHat()\nclient = MongoClient(\"mongo... | python | chosen |
[
{
"from": "system",
"value": "Make this part of the function simpler.\n"
},
{
"from": "human",
"value": "from datetime import date as vanilla_date\n\n\ndef ordinal(n):\n suffix = \"th\"\n if n % 10 == 1:\n suffix = \"st\"\n if n % 10 == 2:\n suffix = \"nd\"\n if n % 10 ... | python | chosen |
[
{
"from": "system",
"value": "Fix CPP problem on Linux\n"
},
{
"from": "human",
"value": "'''\nFunctions dealing with the compilation of code.\n'''\n\nfrom .exceptions import ValidatorBrokenException\n\nimport logging\nlogger = logging.getLogger('opensubmitexec')\n\nGCC = ['gcc', '-o', '{output}... | python | chosen |
[
{
"from": "system",
"value": "Add comment explaining why we disable ip_forward\n\n"
},
{
"from": "human",
"value": "# coding: latin-1\n\n\"\"\"\npax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.\n\"\"\"\n\nfrom mininet.node import Node\nfrom min... | python | chosen |
[
{
"from": "system",
"value": "Send and Connect frame tests\n"
},
{
"from": "human",
"value": "import unittest\nfrom Decode import Decoder\nimport Frames\n\nclass TestDecoder(unittest.TestCase):\n \"\"\"\n \"\"\"\n def setUp(self):\n self.decoder = Decoder()\n\n def test_decode... | python | chosen |
[
{
"from": "system",
"value": "Clean up socket file on exiting\n\nChange-Id: I34391c64408b5a35386913bd7be01d81feed61b6\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nimport asyncio, signal, os\nfrom blink import blink\nimport ipc.coordinator\n\nloop = asyncio.get_event_loop()\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Print everything out in csv and use tableau to do calculation\n"
},
{
"from": "human",
"value": "import os\nfrom utils import Reader\nimport code\nimport sys\n\nauthor_dict = dict()\n\n\ndef extract_authors(tweets):\n # code.interact(local=dict(globals(), **local... | python | chosen |
[
{
"from": "system",
"value": "Fix the add_media() hack for Django 2.0\n"
},
{
"from": "human",
"value": "\"\"\"\nInternal utils\n\"\"\"\nimport django\n\n\ndef add_media(dest, media):\n \"\"\"\n Optimized version of django.forms.Media.__add__() that doesn't create new objects.\n\n Only ... | python | chosen |
[
{
"from": "system",
"value": "Update file converter tooltip in tools menu\n"
},
{
"from": "human",
"value": "\"\"\"\nFile Converter Plugin\n\"\"\"\n\nimport logging\nfrom sas.sasgui.guiframe.plugin_base import PluginBase\nfrom sas.sasgui.perspectives.file_converter.converter_panel import Convert... | python | chosen |
[
{
"from": "system",
"value": "Allow execution module to update_ca_bundle\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nModule for making various web calls. Primarily designed for webhooks and the\nlike, but also useful for basic http testing.\n'''\nfrom __future__ import absol... | python | chosen |
[
{
"from": "system",
"value": "Use 20 as default page size\n"
},
{
"from": "human",
"value": "REST_FRAMEWORK = {\n 'DEFAULT_RENDERER_CLASSES': (\n # 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,\n 'rest_framework.renderers.JSONRenderer',\n ... | python | chosen |
[
{
"from": "system",
"value": "[test] Update test so it matches the Windows output\n\ngit-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from": "human",
"value": "# coding=utf8\n\"\"\"\nTest that C++ supports char8_t correctly.\n\"\"\"\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Add core view hangler class\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\n\n# Create your views here.\n"
},
{
"from": "gpt",
"value": "from django.http import HttpResponse, HttpResponseNotFound, Http404\nfrom django.shortcuts im... | python | chosen |
[
{
"from": "system",
"value": "Use typed function instead of lambda\n\n"
},
{
"from": "human",
"value": "from typing import Callable, Optional, TypeVar\n\nfrom rx import operators as ops\nfrom rx.core import Observable, pipe, typing\nfrom rx.internal.basic import default_comparer\n\n_T = TypeVar(... | python | chosen |
[
{
"from": "system",
"value": "Remove the noise default broken image\n"
},
{
"from": "human",
"value": "import os\n\nfrom fabric.api import local, settings, abort, run, cd, env, put, sudo\nfrom fabric.contrib.console import confirm\n\nimport time\nDEPLOY_WAIT_TIME = 15\n\ntimestamp=\"release-%s\"... | python | chosen |
[
{
"from": "system",
"value": "Repair validate single shape validator\n"
},
{
"from": "human",
"value": "import pyblish.api\n\n\nclass ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):\n \"\"\"One mesh per transform\"\"\"\n\n label = \"Validate Single Shape\"\n order = pyblish.a... | python | chosen |
[
{
"from": "system",
"value": "Revert \"increasing webdriver timeout on fake-service\"\n\nThis reverts commit a39a4b40a947db655c84af6eb62d5870cfd8b32c.\n"
},
{
"from": "human",
"value": "#\n# Copyright (c) 2014 ThoughtWorks, Inc.\n#\n# Pixelated is free software: you can redistribute it and/or mo... | python | chosen |
[
{
"from": "system",
"value": "Change scope of datadir fixture to function-level\n"
},
{
"from": "human",
"value": "from distutils import dir_util\nimport pytest\nimport os\n\n\n@pytest.fixture(scope=\"class\")\ndef datadir(tmpdir_factory, request):\n \"\"\"\n Fixture responsible for search... | python | chosen |
[
{
"from": "system",
"value": "Add commentary explaining and/or lists\n"
},
{
"from": "human",
"value": "from pyparsing import *\n\nfrom ...constants.math.deff import NUM, FULLNUM\nfrom ...constants.zones.deff import TOP, BOTTOM\nfrom ...constants.verbs.deff import *\nfrom ...mana.deff import col... | python | chosen |
[
{
"from": "system",
"value": "Check msg in a way that passes for all GDAL versions\n"
},
{
"from": "human",
"value": "# Testing use of cpl_errs\n\nimport pytest\n\nimport rasterio\nfrom rasterio.errors import RasterioIOError\n\n\ndef test_io_error(tmpdir):\n with pytest.raises(RasterioIOError... | python | chosen |
[
{
"from": "system",
"value": "Check if string before decoding\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport json\n\nimport websocket\n\nfrom polyaxon_client.logger import logger\n\n\nclass SocketTransportMix... | python | chosen |
[
{
"from": "system",
"value": "Add keys iterator for ``TypeParameter``\n"
},
{
"from": "human",
"value": "from hoomd.parameterdicts import AttachedTypeParameterDict\n\n\nclass TypeParameter:\n def __init__(self, name, type_kind, param_dict):\n self.name = name\n self.type_kind = ... | python | chosen |
[
{
"from": "system",
"value": "Add note for misleading test\n"
},
{
"from": "human",
"value": "\"\"\"Plot to test date axis\"\"\"\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport mpld3\n\n\ndef create_plot():\n fig, ax = plt.subplots()\n ax.plot([2000, 2050], [1, 2])\n ax.set_... | python | chosen |
[
{
"from": "system",
"value": "Set transport name as public\n"
},
{
"from": "human",
"value": "class BaseTransport(object):\n \"\"\"Base transport class.\"\"\"\n\n def __init__(self, name, data_format_class, data_format_options,\n handler_class, handler_options):\n se... | python | chosen |
[
{
"from": "system",
"value": "Clean up code and remove print statements\n"
},
{
"from": "human",
"value": "import os\nimport gzip\nimport urllib.request\nfrom celery import shared_task\nfrom django.core.mail import EmailMessage\nfrom celery.task import periodic_task\nfrom celery.schedules import... | python | chosen |
[
{
"from": "system",
"value": "Change quota inline display style (nc-417)\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.contenttypes import models as ct_models, generic\n\nfrom nodeconductor.quotas import models, utils\n\n\nclass QuotaScopeClassListFilte... | python | chosen |
[
{
"from": "system",
"value": "Fix test for optimize method\n"
},
{
"from": "human",
"value": "from __future__ import division, print_function, with_statement\n\nfrom nose.tools import eq_\n\nfrom orges.main import optimize\nfrom orges.optimizer.gridsearch import GridSearchOptimizer\nfrom orges.t... | python | chosen |
[
{
"from": "system",
"value": "Add support for CA certificates\n\nbetter SSL support"
},
{
"from": "human",
"value": "from logging.handlers import SocketHandler\nimport ssl\n\nclass LogstashHandler(SocketHandler):\n \"\"\"\n Sends output to an optionally encrypted streaming logstash TCP listene... | python | chosen |
[
{
"from": "system",
"value": "Revert accidental gums test change from previous commit.\n\ngit-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@17355 4e558342-562e-0410-864c-e07659590f8c\n"
},
{
"from": "human",
"value": "import os\nimport pwd\nimport unittest\n\nimport osgtest.library.core as co... | python | chosen |
[
{
"from": "system",
"value": "Remove adding field to View model\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-09-11 14:35\nfrom __future__ import unicode_literals\nfrom __future__ import absolute_import\n\nfrom django.db import migrations, mode... | python | chosen |
[
{
"from": "system",
"value": "Bring in encoder from webhooks.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nSerialize data to/from JSON\nInspired by https://github.com/django/django/blob/master/django/core... | python | chosen |
[
{
"from": "system",
"value": "Fix concurrency issue with Python 3.4 test\n\nWe have been seeing failures in parallel Py34\ntests caused by the test database being set up more\nthan once.\nThe existing mechanism is not thread-safe.\nAdd a lock around the database setup to ensure\nthe it is ever executed by o... | python | chosen |
[
{
"from": "system",
"value": "Debug method and add test cases\n"
},
{
"from": "human",
"value": "# Reverse each word in a sentence\n\ndef reverse_sentence(string, separator):\n\t# string_list = string.split()\n\t# flipped_list = string_list[::-1]\n\tflipped_list = (string.split())[::-1] # split ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"version bump to 1.4.10\"\n\nThis reverts commit e4ab8f004c0c4a8b631d0de77b72d85d5fdba221.\n\nChange-Id: Id8262405acec0f13314f27fbac02bd3cded60789\n"
},
{
"from": "human",
"value": "import gettext\n\n\nclass Version(object):\n def __init__(self, canonical... | python | chosen |
[
{
"from": "system",
"value": "Declare relevant queues in sync scheduler\n"
},
{
"from": "human",
"value": "from tapiriik.database import db\nfrom tapiriik.messagequeue import mq\nimport kombu\nfrom datetime import datetime\nimport time\n\nchannel = mq.channel()\nexchange = kombu.Exchange(\"tapir... | python | chosen |
[
{
"from": "system",
"value": "Add current dir to Python path\n"
},
{
"from": "human",
"value": "import pyDH\n\ndef test_pydh_keygen():\n d1 = pyDH.DiffieHellman()\n d2 = pyDH.DiffieHellman()\n d1_pubkey = d1.gen_public_key()\n d2_pubkey = d2.gen_public_key()\n d1_sharedkey = d1.ge... | python | chosen |
[
{
"from": "system",
"value": "Use r-strings for URL regexes\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n url(\"^$\", views.request_view, name=\"request_site\"),\n url(\"^approve$\", views.approve_view, name=\"approve_site\"... | python | chosen |
[
{
"from": "system",
"value": "Add munge_jar stub for InstallScript\n"
},
{
"from": "human",
"value": "# Copyright 2015-2017 John \"LuaMilkshake\" Marion\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# ... | python | chosen |
[
{
"from": "system",
"value": "Update Group API\n- ADD type hints\n- Remove unused imports\n"
},
{
"from": "human",
"value": "# stdlib\nfrom typing import Any\nfrom typing import Dict\n\n# third party\nfrom pandas import DataFrame\n\n# syft relative\nfrom ...messages.group_messages import CreateG... | python | chosen |
[
{
"from": "system",
"value": "Make reporter succeed in talking to the graph server\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# This Source Code Form is subject to the terms of the Mozilla Public License,\n# v. 2.0. If a copy of the MPL was not distributed with this file, You can\... | python | chosen |
[
{
"from": "system",
"value": "[Python] Add 'spare' support in when calculating scores\n"
},
{
"from": "human",
"value": "class Game():\n def __init__(self):\n self._score = 0\n\n def roll(self, pins):\n self._score += pins\n\n def score(self):\n return self._score\n... | python | chosen |
[
{
"from": "system",
"value": "Revert \"index on flow run responded field as well\"\n\nThis reverts commit cbbac0f0f23f6e0ad3ce15a784aad30a82a2fe5a.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nINDEX_S... | python | chosen |
[
{
"from": "system",
"value": "Document expected behaviour instead of leaving XXX comment\n"
},
{
"from": "human",
"value": "\"\"\" Fixtures in this file are available to all files automatically, no\n importing required. Only put general purpose fixtures here!\n\"\"\"\nimport pytest\nimport os... | python | chosen |
[
{
"from": "system",
"value": "Fix small bug introduced in 0b8e5d428e60.\n\nOpening file twice.\n"
},
{
"from": "human",
"value": "\"\"\"\nLWR HTTP Client layer based on Python Standard Library (urllib2)\n\"\"\"\nfrom __future__ import with_statement\nfrom os.path import getsize\nimport mmap\ntry... | python | chosen |
[
{
"from": "system",
"value": "Add setup to first integration test\n"
},
{
"from": "human",
"value": "class TestPropagation(object):\n def test_node_propagation(self):\n \"\"\"\n Tests that check node propagation\n\n 1) Spin up four servers.\n 2) Make the first one ... | python | chosen |
[
{
"from": "system",
"value": "Remove dependency on unicodecsv module\n"
},
{
"from": "human",
"value": "# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example\n\nfrom rest_framework import renderers\nimport unicodecsv as csv\nimport io\nimport logging\n\nlogger = lo... | python | chosen |
[
{
"from": "system",
"value": "Improve trainer logging and print every logged message to console\n"
},
{
"from": "human",
"value": "from sim.PathWorldGenerator import PathWorldGenerator\n\n\nclass SimplePathWorldGenerator(PathWorldGenerator):\n\n\tdef __init__(self, logger, view_size, world_size,... | python | chosen |
[
{
"from": "system",
"value": "Make it work in Python < 2.6\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\ndef importRelativeOrAbsolute(f):\n # maybe there's a way to do this more sanely with the |imp| module...\n if f.endswith(\".py\"):\n f = f[:-3]\n if f.endswith(\... | python | chosen |
[
{
"from": "system",
"value": "Add cases for either CSS or template not existing\n"
},
{
"from": "human",
"value": "import os\nimport os.path\nfrom . import database\n\nTHEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), \"../themes\"))\n\ndef getCurrentTheme():\n\tdatabaseConnec... | python | chosen |
[
{
"from": "system",
"value": "Make the RSS feed not slow.\n"
},
{
"from": "human",
"value": "from django.contrib.syndication.views import Feed\nfrom django.db.models import Max\n\nfrom projects.models import Project\n\nclass LatestProjectsFeed(Feed):\n title = \"Recently updated documentation... | python | chosen |
[
{
"from": "system",
"value": "Support old style Python doc links.\n"
},
{
"from": "human",
"value": "import re\nimport urllib\n\n\n############### Functions called by stackdoc\n\ndef get_version():\n return 1\n\ndef get_ids(title, body, tags):\n ids = []\n if \"http://docs.python.org/\"... | python | chosen |
[
{
"from": "system",
"value": "Change the testdata path to relative path.\n"
},
{
"from": "human",
"value": "import inspect\nimport os\n\n# Get testdata absolute path.\nabs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\npath = abs_path + \"/testdata\"\n\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Add explicit import for loaded_configs namespace to fix RuntimeWarning\n"
},
{
"from": "human",
"value": "\"\"\"Stupid simple Python configuration environments\"\"\"\n\nfrom __future__ import absolute_import\n\nimport os as _os\n\n__version__ = '0.6.0'\n\n\n\n_os.en... | python | chosen |
[
{
"from": "system",
"value": "Check configuration file rather than env variable\n"
},
{
"from": "human",
"value": "import os\nimport logging\nimport json\nfrom logging.config import dictConfig\nfrom gluon.storage import Storage\nfrom gluon.contrib.appconfig import AppConfig\n\n\n# app_config use... | python | chosen |
[
{
"from": "system",
"value": "Add support for a dir of client tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n'''\nDiscover all instances of unittest.TestCase in this directory.\n'''\n# Import python libs\nimport os\n# Import salt libs\nimport saltunittest\nfrom integration impor... | python | chosen |
[
{
"from": "system",
"value": "Add support for Django 4.0.\n"
},
{
"from": "human",
"value": "SECRET_KEY = 'not-anymore'\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n }\n}\n\nINSTALLED_APPS = [\n 'tests',\n]\n"
},
{
"from": "gpt",
"value":... | python | chosen |
[
{
"from": "system",
"value": "Use faster password hashing in tests.\n"
},
{
"from": "human",
"value": "\"\"\"\nSettings for tests.\n\n\"\"\"\nfrom moztrap.settings.default import *\n\nDEFAULT_FILE_STORAGE = \"tests.storage.MemoryStorage\"\nALLOW_ANONYMOUS_ACCESS = False\nSITE_URL = \"http://loca... | python | chosen |
[
{
"from": "system",
"value": "Allow email in profile urls\n"
},
{
"from": "human",
"value": "from django.conf.urls import *\n\nfrom profiles import views\n\n\nurlpatterns = patterns('',\n url(r'^(?P<username>[\\w.-]+)/$',\n views.profile_detail,\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"[FIX] mail: remove attachment as main at unlink\"\n\nThis reverts commit abc45b1\nSince by default the ondelete attribute of a many2one is `set null`,\nthis was completely unnecessary to begin with.\n\nBug caused by this commit:\nUnlink a record that has some attachmen... | python | chosen |
[
{
"from": "system",
"value": "Add missing trailing slash required by kittydar.\n"
},
{
"from": "human",
"value": "import sys, socket, time, logging\nimport shlex, subprocess\nfrom hdfs import *\n\nlogging.basicConfig()\n\nif len(sys.argv) < 4:\n print \"usage: napper_kittydar <job name> <worker... | python | chosen |
[
{
"from": "system",
"value": "Add documentation and some methods\n"
},
{
"from": "human",
"value": "class Transformer(object):\n class Feats():\n exclude = None\n\n def __init__(self):\n for field in self.get_feats():\n getattr(self.Feats, field).bind(field, self)\... | python | chosen |
[
{
"from": "system",
"value": "Fix where the seat number appears\n"
},
{
"from": "human",
"value": "from utils import CanadianJurisdiction\nfrom opencivicdata.divisions import Division\nfrom pupa.scrape import Organization\n\n\nclass OntarioEnglishPublicSchoolBoards(CanadianJurisdiction):\n cl... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.