conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add custom wrapper code to pymongo for Modules\n"
},
{
"from": "human",
"value": "\"\"\"Handles database connection, and all that fun stuff.\n@package ppbot\n\n\"\"\"\nfrom pymongo import MongoClient\n\nfrom settings import *\n\nclient = MongoClient(MONGO_HOST, MONG... | python | chosen |
[
{
"from": "system",
"value": "Add diff option to blacken and document params\n"
},
{
"from": "human",
"value": "\"\"\"\nTasks for common project sanity-checking such as linting or type checking.\n\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom invoke import task\n\n\n@task(name=\"black... | python | chosen |
[
{
"from": "system",
"value": "Test CoM Jacobian with random configuration for shape, and then with 0 configuration for values\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport unittest\nimport numpy as np\nimport pydrake\nimport os.path\n\n\nclass TestRBTCoM(unitte... | python | chosen |
[
{
"from": "system",
"value": "Add a bunch of mostly-empty method stubs.\n"
},
{
"from": "human",
"value": "import sublime, sublime_plugin"
},
{
"from": "gpt",
"value": "import sublime, sublime_plugin\n\nclass DiffListener(sublime_plugin.EventListener):\n \"\"\"Listens for modifica... | python | chosen |
[
{
"from": "system",
"value": "Remove LMOD_CMD global from module scope\n\nDeclaring the variable at the module level\ncould cause problem when installing and\nenabling the extension when Lmod was not\nactivated.\n"
},
{
"from": "human",
"value": "import os\nfrom subprocess import Popen, PIPE\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix python 2.4 connectionless service\n"
},
{
"from": "human",
"value": "\"\"\"\nA Simple example for testing the SimpleServer Class. A simple connectionless\nserver. It is for studying purposes only.\n\"\"\"\n\nfrom simple.server import SimpleServer\n\n\n__author__... | python | chosen |
[
{
"from": "system",
"value": "Add test cases for testing SpecSet.\n"
},
{
"from": "human",
"value": "import unittest\n\n\nclass TestSpecSet(unittest.TestCase):\n pass\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom piptools.datastructures import SpecSet, Spec\n\n\nclass Tes... | python | chosen |
[
{
"from": "system",
"value": "Test for AttributeError when pickling objects (Python>=3.5)\n\nSame \"fix\" as in e.g. https://github.com/joblib/joblib/pull/246\n"
},
{
"from": "human",
"value": "\"\"\"\nScheduler queues\n\"\"\"\n\nimport marshal\nfrom six.moves import cPickle as pickle\n\nfrom qu... | python | chosen |
[
{
"from": "system",
"value": "Add output file type option\n"
},
{
"from": "human",
"value": "import ast\n\nimport click\n\nfrom graphing.graph import FunctionGrapher\nfrom parsing.parser import FileVisitor\n\n\n@click.command()\n@click.argument('code', type=click.File('rb'))\n@click.option('--pr... | python | chosen |
[
{
"from": "system",
"value": "Set light timer 1 hr back, 10pm-12am\n"
},
{
"from": "human",
"value": "import bottle\nimport waitress\nimport controller\nimport breathe\nfrom pytz import timezone\nfrom apscheduler.schedulers.background import BackgroundScheduler\n\nbottle_app = bottle.app()\nsche... | python | chosen |
[
{
"from": "system",
"value": "Clean up, comments, liveness checking, robust data transfer\n"
},
{
"from": "human",
"value": "import random\nimport json\nimport time\n\nimport SocketExtend as SockExt\nimport config as conf\nimport parser as p\n\ndef ping(sock):\n\ttry:\n\t\trand = random.randint(... | python | chosen |
[
{
"from": "system",
"value": "Set up logging for live environment.\n"
},
{
"from": "human",
"value": "\nDEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'\nFILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024\nFILE_UPLOAD_HANDLERS = (\n 'djangae.storage.BlobstoreFileUploadHandler',\n 'django.c... | python | chosen |
[
{
"from": "system",
"value": "Fix extra colon in status_code key\n"
},
{
"from": "human",
"value": "\nimport sys\nimport os\nimport json\nimport unittest\nimport xmlrunner\n\nfrom flask import Flask, Response\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_restful import Api\nfrom flask_scr... | python | chosen |
[
{
"from": "system",
"value": "Ch23: Add join date to UserAdmin list.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import User\n\n\n@admin.register(User)\nclass UserAdmin(admin.ModelAdmin):\n # list view\n list_display = (\n 'email',\n 'i... | python | chosen |
[
{
"from": "system",
"value": "Change \"Sklearn\" to \"Scikit-learn\" in error message\n"
},
{
"from": "human",
"value": "\"\"\"\nMachine Learning module for NeuroImaging in python\n==================================================\n\nSee http://nisl.github.com for complete documentation.\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Patch get_models to ensure plugins are properly patched\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\n\nfrom cms.utils.compat.dj import is_installed as app_is_installed\n\n\ndef validate... | python | chosen |
[
{
"from": "system",
"value": "Introduce factory for email config fixture\n\nThis allows to create local fixtures that use email config with a\nbroader scope than 'function'.\n"
},
{
"from": "human",
"value": "\"\"\"\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE... | python | chosen |
[
{
"from": "system",
"value": "Tracks: Remove useless field descs, increase rows\n"
},
{
"from": "human",
"value": "# This file is part of Indico.\n# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).\n#\n# Indico is free software; you can redistribute it and/or\n# modif... | python | chosen |
[
{
"from": "system",
"value": "Fix watson settings; add search for picture\n"
},
{
"from": "human",
"value": "from django.apps import AppConfig\nfrom watson import search as watson\n\n\nclass NotaroConfig(AppConfig):\n name = \"notaro\"\n verbose_name = \"Notizen\"\n\n def ready(self):\n... | python | chosen |
[
{
"from": "system",
"value": "Fix TypeError exception when parsing json\n\nThis change fixes the TypeError exception that is raised when it should\nnot while parsing json\n\nFile \"/usr/lib64/python2.7/json/__init__.py\", line 338, in loads\n return _default_decoder.decode(s)\n File \"/usr/lib64/python2... | python | chosen |
[
{
"from": "system",
"value": "Update for parser class\nAdd if/else tags\n"
},
{
"from": "human",
"value": "\nimport ast\n\nfrom .klass import build_method\nfrom .library import Library\n\nregister = Library()\n\n\ndef parse_args(bits):\n '''\n Parse tag bits as if they're function args\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix import of molwt in constants\n"
},
{
"from": "human",
"value": "import molwt\n\nM_ATMOS = 5.1352e18 # mass of atmosphere, kg\n\n# Conversion between ppm CO2 and GtC emissions\nppm_gtc = M_ATMOS/1e18*molwt.C/molwt.AIR\n"
},
{
"from": "gpt",
"value... | python | chosen |
[
{
"from": "system",
"value": "Use a list for DummyStorage() for ordering.\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import AnonymousUser\nfrom django.test import TestCase, RequestFactory\n\n\nclass DummyStorage:\n def __init__(self):\n self.store = set()\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove debug and all host listener\n"
},
{
"from": "human",
"value": "#!flask/bin/python\n\"\"\"\nAuthor: Swagger.pro\nFile: app.py\nPurpose: runs the app!\n\"\"\"\n\nfrom swagip import app\n\napp.config.from_object('config')\n\n\nif __name__ == \"__main__\":\n ... | python | chosen |
[
{
"from": "system",
"value": "Use unicode strings for 'no javascript' just so it's consistent with browser-retrieved values\n"
},
{
"from": "human",
"value": "class FingerprintAgent(object):\n\n def __init__(self, request):\n self.request = request\n\n def detect_server_whorls(self)... | python | chosen |
[
{
"from": "system",
"value": "Fix issue when running nosetests and django_nose is not required\n"
},
{
"from": "human",
"value": "from nose.plugins import Plugin\n\n\nclass DjangoNosePlugin(Plugin):\n ''' Adaptor that allows usage of django_nose package plugin from\n the nosetests command ... | python | chosen |
[
{
"from": "system",
"value": "Remove minify plugin to test search.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\n# This file is only used if you use `make publish` or\n# explicitly specify it as your config file.\n... | python | chosen |
[
{
"from": "system",
"value": "Add new configuration setting for log_directory\n"
},
{
"from": "human",
"value": "# General Settings\ntimerestriction = False\ndebug_mode = True\n\n# Email Settings\n# emailtype = \"Gmail\"\nemailtype = \"Console\"\n\n# SMS Settings\n# outboundsmstype = \"WebServic... | python | chosen |
[
{
"from": "system",
"value": "Use flask-script so command line parameters can be used.\n"
},
{
"from": "human",
"value": "from flask import Flask\napp = Flask(__name__)\n\n@app.route('/')\ndef index():\n\treturn '<H1>Measure Anything</H1>'\n\nif __name__ == '__main__':\n\tapp.run(debug=True)"
... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Update random number generator test\"\n\nThis reverts commit b63bda37aa2e9b5251cf6c54d59785d2856659ca.\n"
},
{
"from": "human",
"value": "import os\nimport mxnet as mx\nimport numpy as np\n\ndef same(a, b):\n return np.sum(a != b) == 0\n\ndef check_with_... | python | chosen |
[
{
"from": "system",
"value": "Fix pecan error message not available in body for Trigger.post\n\nWhen a trigger_id resource is not found, the API returns a 202 status\ncode, the error message could not be added in the body of the request\nbecause pecan.response.text was used instead of pecan.response.body.\n... | python | chosen |
[
{
"from": "system",
"value": "Remove shebang line from non-executable .py file.\n\nFixes checkperms failure on the main waterfall:\n\nhttp://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Full/builds/30316/steps/check_perms/logs/stdio\n/b/build/slave/Linux_ChromiumOS/build/src/chrome... | python | chosen |
[
{
"from": "system",
"value": "Fix really strange bug about conflicting models\n\nThe bug:\n\n Failure: RuntimeError (Conflicting 'c' models in application 'nose': <class 'manoseimas.compatibility_test.admin.TestGroup'> and <class 'nose.util.C'>.) ... ERROR\n\n =========================================... | python | chosen |
[
{
"from": "system",
"value": "Print a little bit more info.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\nSummarize dataset.\n\nExamples:\n\n\tc2s info data.pck\n\"\"\"\n\nimport sys\n\nfrom argparse import ArgumentParser\nfrom pickle import dump\nfrom scipy.io import savem... | python | chosen |
[
{
"from": "system",
"value": "Change name of package to roku\n"
},
{
"from": "human",
"value": "from roku import __version__\nfrom setuptools import setup, find_packages\nimport os\n\nf = open(os.path.join(os.path.dirname(__file__), 'README.rst'))\nreadme = f.read()\nf.close()\n\nsetup(\n nam... | python | chosen |
[
{
"from": "system",
"value": "Make script consistent with instructions.\n"
},
{
"from": "human",
"value": "import argparse\n\nimport PIL\nfrom PIL import Image\nimport subprocess\nimport os\nimport glob\n\ndef get_image(filename):\n p = Image.open(filename)\n docker_image = p.info['im2sim_... | python | chosen |
[
{
"from": "system",
"value": "Increment version number for release\n"
},
{
"from": "human",
"value": "import os\nfrom os.path import relpath, join\nfrom setuptools import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\ndef find_package_data(da... | python | chosen |
[
{
"from": "system",
"value": "Update requirements to include networkx\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\ndef readme():\n with open('README.rst') as readme_file:\n return readme_file.read()\n\nconfiguration = {\n 'name' : 'hypergraph',\n 'version' :... | python | chosen |
[
{
"from": "system",
"value": "Update to v1.0.3 given all the bug fixes.\n\n\nFormer-commit-id: 0aebb52391a2dea2aabf08879335df01775d02ab [formerly 65ccbe5c10f2c1b54e1736caf7d8d88c7345610f]\nFormer-commit-id: 1e823ba824b20ed7641ff7360c6b50184562b3bd"
},
{
"from": "human",
"value": "from setuptools... | python | chosen |
[
{
"from": "system",
"value": "Add templates to the build.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding: utf-8\n\"\"\"\n setup.py\n ~~~~~~~~\n\n Installs marvin as a package.\n\n\"\"\"\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='marvin',\n ... | python | chosen |
[
{
"from": "system",
"value": "Use null cache in tests\n"
},
{
"from": "human",
"value": "DEBUG = True\nSECRET_KEY = 'super-secret'\nSQLALCHEMY_DATABASE_URI = 'postgresql://vincent:vincent@localhost/odtaxi_test'\nREDIS_URL = \"redis://:@localhost:6379/0\"\nREDIS_GEOINDEX = 'geoindex'\nSQLALCHEMY_... | python | chosen |
[
{
"from": "system",
"value": "Add compat/ files in packaging\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\ntry:\n from setuptools import setup, find_packages\nexcept ImportError:\n from ez_setup import use_setuptools\n use_setuptools()\n from setuptools import setup, fi... | python | chosen |
[
{
"from": "system",
"value": "Remove trailing comma not compatible with Python 3.5\n"
},
{
"from": "human",
"value": "from enum import Enum\n\nfrom .base import Item\n\n\nclass KeepDirectories(Enum):\n NONE = 'none'\n SUFFIX = 'suffix'\n FULL = 'full'\n\n @classmethod\n def cast(c... | python | chosen |
[
{
"from": "system",
"value": "Simplify readlines() to add requirements\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nfrom setuptools import setup, find_packages\nfrom sii import __LIBRARY_VERSION__\n\nINSTALL_REQUIRES = [line for line in open('requirements.txt')]\n\nTESTS_REQUIRE = [line ... | python | chosen |
[
{
"from": "system",
"value": "Increment version to trigger auto build"
},
{
"from": "human",
"value": "\"\"\"Config for PyPI.\"\"\"\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\n\nsetup(\n author='Kyle P. Johnson',\n author_email='kyle@kyle-p-johnson.com',\n c... | python | chosen |
[
{
"from": "system",
"value": "Make README.rst the package's long description\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom setuptools import setup\n\nsetup(\n name='todoman',\n description='A simple CalDav-based todo manager.',\n author='Hugo Osvaldo Barrera',\n a... | python | chosen |
[
{
"from": "system",
"value": "Remove the Intended Audience classifier\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# coding: utf-8\n\n\"\"\"A setuptools based setup module.\n\nSee:\nhttps://packaging.python.org/en/latest/distributing.html\nhttps://github.com/pypa/sampleproject\n\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix url to use new homepage\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nimport sys, os\n\nfrom applib import __version__\n\nsetup(name='applib',\n version=__version__,\n description=\"Cross-platform application utilities... | python | chosen |
[
{
"from": "system",
"value": "Update to require sispy instead of sis"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nimport sisdb\n\nsetup (\n name='sisdb',\n version=sisdb.VERSION,\n description='SIS ORM like library',\n packages=['sisdb'],\n install_requires... | python | chosen |
[
{
"from": "system",
"value": "Remove <1.9 limit on Django version\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:\n README = readme.read()\n\n# allow setup.py to be run from any path\nos.... | python | chosen |
[
{
"from": "system",
"value": "Update the PyPI version to 7.0.17.\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 ret... | python | chosen |
[
{
"from": "system",
"value": "Set version number to 0.1.51.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nwith open(\"README.rst\", \"rt\") as f: readme = f.read()\n\n\nsetup(\n name='gimei',\n version=\"0.1.5\",\n description=\"generates the name ... | python | chosen |
[
{
"from": "system",
"value": "Switch to the new github release download links"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\n\ndef read(filename):\n return open(filename).read()\n\nsetup(name=\"lzo-indexer\",\n version=\"0.0.1\",\n description=... | python | chosen |
[
{
"from": "system",
"value": "Replace the __all__ specification with direct imports.\n"
},
{
"from": "human",
"value": "from .terms import *\nfrom .parser import *\n\n\n__all__ = [\n 'Alt',\n 'And',\n 'Any',\n 'AnyChar',\n 'AnyInst',\n 'Bind',\n 'Content',\n 'End',\n '... | python | chosen |
[
{
"from": "system",
"value": "Update Django requirement to latest LTS\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='django-validate-model-attribute-assignment',\n\n url=\"https://chris-lamb.co.uk/projects/django-va... | python | chosen |
[
{
"from": "system",
"value": "Upgrade dependency python-slugify to ==1.2.1\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nfrom withtool import __version__\n\n\ndef read(fname):\n path = os.path.join(os.path.dirname(__file__), fname)\n with open(path, encoding... | python | chosen |
[
{
"from": "system",
"value": "Add new Python versions to the supported languages\n\nNow that tests are passing for Python 3.1 and 3.2, they should go into the list of supported versions of Python listed on PyPI.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\... | python | chosen |
[
{
"from": "system",
"value": "Hide the option set from incompatible browsers\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom itertools import chain\n\nfrom django import forms\nfrom django.utils.encoding import force_text\nfrom django.utils.html import format_h... | python | chosen |
[
{
"from": "system",
"value": "Remove oversampling; use 20 percent instead\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport random\nfrom nott_params import *\n\nnum_samples = int(gridDim[0] * gridDim[1] * 10)\n\ndef generate_data(numx, numy):\n stimulus = (random.randint(0, n... | python | chosen |
[
{
"from": "system",
"value": "Fix test task (wrong package)\n"
},
{
"from": "human",
"value": "from invoke import run, task\n\nTESTPYPI = \"https://testpypi.python.org/pypi\"\n\n\n@task\ndef lint():\n \"\"\"Run flake8 to lint code\"\"\"\n run(\"python setup.py flake8\")\n\n\n@task(lint)\nd... | python | chosen |
[
{
"from": "system",
"value": "Insert example directories in path before all others in the example test.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#######################################################################\n# Name: test_examples\n# Purpose: Test that examples run wi... | python | chosen |
[
{
"from": "system",
"value": "Add description field to TenantSerializer\n\nThis might be just an oversight. Other data models do include the description in their serialisers. The API produces the description field with this change."
},
{
"from": "human",
"value": "from rest_framework import se... | python | chosen |
[
{
"from": "system",
"value": "Address review comment: Better function name.\n"
},
{
"from": "human",
"value": "\"\"\"\nCross-process log tracing: HTTP client.\n\"\"\"\nfrom __future__ import unicode_literals\n\nimport sys\nimport requests\n\nfrom eliot import Logger, to_file, start_action\nto_fi... | python | chosen |
[
{
"from": "system",
"value": "Handle case when token has a null expires\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django.db import models\n\nfrom django.contrib.auth.models import User\n\n\nclass UserAssociation(models.Model):\n \n user = models.ForeignKey(User)\n servi... | python | chosen |
[
{
"from": "system",
"value": "Fix a log display error\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding:utf-8 -*-\n# Powered By KK Studio\n# Index Page\n\nfrom BaseHandler import BaseHandler\nfrom tornado.web import authenticated as Auth\n\nclass IndexHandler(BaseHandler):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "tests: Fix tests for new quiet attribute\n"
},
{
"from": "human",
"value": "import os.path\nimport pytest\nimport rain.compiler as C\n\ndef ls(*path):\n path = os.path.join(*path)\n for file in os.listdir(path):\n yield os.path.join(path, file)\n\ndef lsrn(*pat... | python | chosen |
[
{
"from": "system",
"value": "Remove self references from setup/teardown\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_get_user_config\n--------------------\n\nTests formerly known from a unittest residing in test_config.py named\n\"\"\"\n\nimp... | python | chosen |
[
{
"from": "system",
"value": "Use numpy.random.choice in place of numpy.random.randint.\n\nAllows sampling without replacement; hence, removing the possibility\nof choosing equal initial centroids.\n"
},
{
"from": "human",
"value": "import numpy as np\n\nclass KMeans(object):\n def __init__(s... | python | chosen |
[
{
"from": "system",
"value": "Add module declaration for karenina\n"
},
{
"from": "human",
"value": "default_app_config = 'material.admin.apps.MaterialAdminConfig'"
},
{
"from": "gpt",
"value": "default_app_config = 'material.admin.apps.MaterialAdminConfig'\n\n\ntry:\n from . impo... | python | chosen |
[
{
"from": "system",
"value": "Add tests for alternate number pad.\n"
},
{
"from": "human",
"value": "from move import load_moves, encode_moves, normalize_index, move\nimport unittest\n\nclass TestMove(unittest.TestCase):\n def setUp(self):\n self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUU... | python | chosen |
[
{
"from": "system",
"value": "Fix error when import lamvery in function\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport re\nimport shlex\nimport subprocess\nfrom termcolor import cprint\n\nENV_PATTERN = re.compile('^(?P<name>[^\\s]+)\\s*=\\s*(?P<value>... | python | chosen |
[
{
"from": "system",
"value": "Add prints for output formatting\n"
},
{
"from": "human",
"value": "\nimport unittest\nfrom jktest.config import TestConfig\nfrom jktest.jkind import JKind\nfrom jktest.results import ResultList\n\nclass TestCase( unittest.TestCase ):\n def assertTrue( self, expr... | python | chosen |
[
{
"from": "system",
"value": "Change the Error show in command window.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##Pyslvs - Dimensional Synthesis of Planar Four-bar Linkages in PyQt5 GUI.\n##Copyright (C) 2016 Yuan Chang [daan0014119@gmail.com]\nfrom sys import exit\nif __name_... | python | chosen |
[
{
"from": "system",
"value": "Make sure to import the user monkeypatch before anything else that touches it\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls.defaults import url, patterns, include\nfrom django.conf.urls.static import static\nfrom django.c... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Use random.sample() rather than reinventing it.\"\n\nMy wrong. sample() doesn't allow repeating characters, so it's not\nexactly the same.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8\n\nimport random, string\n\ndef random_string(length,\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix for bcbio-nextgen-vm not passing the local_controller option.\n"
},
{
"from": "human",
"value": "\"\"\"Parsing of command line arguments into parallel inputs.\n\"\"\"\n\ndef to_parallel(args, module=\"bcbio.distributed\"):\n \"\"\"Convert input arguments into... | python | chosen |
[
{
"from": "system",
"value": "Revert unintented port change in example\n"
},
{
"from": "human",
"value": "import asyncio\nimport logging\n\nfrom aioredlock import Aioredlock, LockError\n\n\nasync def basic_lock():\n lock_manager = Aioredlock([{\n 'host': 'localhost',\n 'port': 6... | python | chosen |
[
{
"from": "system",
"value": "Update migration to fix existing CycleTaskGroupObjects\n"
},
{
"from": "human",
"value": "\n\"\"\"Add CycleTaskGroupObject.object\n\nRevision ID: 26d9c9c91542\nRevises: 19a67dc67c3\nCreate Date: 2014-07-15 21:49:34.073412\n\n\"\"\"\n\n# revision identifiers, used by... | python | chosen |
[
{
"from": "system",
"value": "Raise import errors for uwsgi decorators only if the task is called.\n"
},
{
"from": "human",
"value": "from uwsgidecorators import spool\nimport database as db\nfrom database.model import Team\nfrom geotools import simple_distance\nfrom geotools.routing import MapP... | python | chosen |
[
{
"from": "system",
"value": "Correct numbers. Now to format output\n"
},
{
"from": "human",
"value": "import pandas as pd\n\n\ndef fn(row):\n if row['Type'] == 'DIRECT DEBIT':\n return 'DD'\n if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':\n return... | python | chosen |
[
{
"from": "system",
"value": "Add functions for processing ScheduleInstances\n"
},
{
"from": "human",
"value": "\n\ndef save_schedule_instance(instance):\n instance.save()\n"
},
{
"from": "gpt",
"value": "from corehq.sql_db.util import (\n get_object_from_partitioned_database,\... | python | chosen |
[
{
"from": "system",
"value": "Support mysql2: prefixed database url's\n"
},
{
"from": "human",
"value": "from os import getenv, \\\n path\nfrom time import time\nfrom datetime import timedelta\n\n\nclass Config(object):\n AWS_ACCESS_KEY_ID = getenv('AWS_ACCESS_KEY_ID')\n AWS_... | python | chosen |
[
{
"from": "system",
"value": "Use pytoml instead of toml library\n"
},
{
"from": "human",
"value": "import toml\n\ndef parse(file):\n with open(file) as conffile:\n data = toml.loads(conffile.read())\n\n return data\n"
},
{
"from": "gpt",
"value": "import pytoml\n\ndef p... | python | chosen |
[
{
"from": "system",
"value": "Fix error handling in server\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport sys\nimport time\nimport glob\n\nimport serial\nimport psutil\n\n\nCPU_INTERVAL = 0.5\nCONNECT_TIMEOUT = 2\nBAUD = 4800\n\ndef update_loop(conn):\n while True:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add argument parsing for 'pygout' command\n"
},
{
"from": "human",
"value": "import sys\n\n\ndef main(argv=sys.argv):\n raise NotImplementedError\n"
},
{
"from": "gpt",
"value": "import sys\nimport argparse\n\nimport pygments.styles\n\nfrom pygout.app... | python | chosen |
[
{
"from": "system",
"value": "Enable authentication for rest api\n"
},
{
"from": "human",
"value": "import json\n\nfrom restless.dj import DjangoResource\nfrom restless.resources import skip_prepare\n\nfrom django.conf.urls import patterns, url\n\n\nfrom harvest.models import Job\nfrom harvest.... | python | chosen |
[
{
"from": "system",
"value": "Fix import error after removal of old csv table mixin\n"
},
{
"from": "human",
"value": "__version__ = '1.2.0'\n\ntry:\n from django.conf import settings\n getattr(settings, 'dummy_attr', 'dummy_value')\n _LOAD_PACKAGES = True\nexcept:\n # Just running s... | python | chosen |
[
{
"from": "system",
"value": "Fix code style issues with Black\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\n\nfrom scout.demo import cnv_report_path\nfrom scout.commands import cli\n\n\ndef test_load_cnv_report(mock_app, case_obj):\n \"\"\"Testing the load delivery r... | python | chosen |
[
{
"from": "system",
"value": "Add autoreload on settings default true\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\n\nimport tornado.ioloop\nimport tornado.web\nimport tornado.autoreload\n\nfrom tornado.options import parse_command_line, define, op... | python | chosen |
[
{
"from": "system",
"value": "Add SITE_ID to test settings since contrib.sites is in INSTALLED_APPS.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom os.path import dirname, abspath\nimport sys\n\nfrom django.conf import settings\n\nif not settings.configured:\n from django im... | python | chosen |
[
{
"from": "system",
"value": "Fix Django 1.9 import error\n"
},
{
"from": "human",
"value": "\"\"\"\nAn url to AutocompleteView.\n\nautocomplete_light_autocomplete\n Given a 'autocomplete' argument with the name of the autocomplete, this url\n routes to AutocompleteView.\n\nautocomplete_li... | python | chosen |
[
{
"from": "system",
"value": "Fix test, editor instance is required\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nThis is a simple test script to that is meant to be run by Travis CI to ensure\neverything works properly foreach bindings on each supported python\nversion (3.... | python | chosen |
[
{
"from": "system",
"value": "MAINT: Add a 'count_nonzero' function to use with numpy 1.5.1.\n"
},
{
"from": "human",
"value": "\"\"\"Functions copypasted from newer versions of numpy.\n\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport warnings\n\nimport numpy ... | python | chosen |
[
{
"from": "system",
"value": "Test the ability to add and get all persons in the group\n"
},
{
"from": "human",
"value": "from unittest import TestCase\n\n\nclass GroupTestCase(TestCase):\n\n def get_persons(self):\n pass"
},
{
"from": "gpt",
"value": "from unittest import ... | python | chosen |
[
{
"from": "system",
"value": "Apply i18n to First and Last name in registration form\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom flask_security.forms import RegisterForm\nfrom udata.forms import fields\nfrom udata.forms import valid... | python | chosen |
[
{
"from": "system",
"value": "Delete abstract method get name\n"
},
{
"from": "human",
"value": "from abc import ABCMeta, abstractmethod\n\n\nclass IdaTypes:\n __metaclass__ = ABCMeta\n\n @abstractmethod\n def decode(self, data):\n raise NotImplementedError()\n\n @abstractmeth... | python | chosen |
[
{
"from": "system",
"value": "Fix datastore delete field script.\n"
},
{
"from": "human",
"value": "\"\"\" Remove a property from the datastore.\nHow to use:\n\n$ cd experimental/db/\n$ PYTHONPATH=. remote_api_shell.py -s homeawesomation.appspot.com\n> import remove_property\n\"\"\"\n\nfrom goog... | python | chosen |
[
{
"from": "system",
"value": "Allow a null start date in search index.\n"
},
{
"from": "human",
"value": "import datetime\nfrom haystack import indexes\nfrom speeches.models import Speech\n\nclass SpeechIndex(indexes.SearchIndex, indexes.Indexable):\n # Use a template here to include speaker ... | python | chosen |
[
{
"from": "system",
"value": "Support Stylus blocks in Vue single-file components\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jack Brewer\n# Copyright (c) 2015 Jack Brewer\n#\n# License: MIT\n\n\"\"... | python | chosen |
[
{
"from": "system",
"value": "Add github releases to publishing\n"
},
{
"from": "human",
"value": "import logging\n\nfrom plumbum import local, CommandNotFound\n\nfrom changes.changelog import generate_changelog\nfrom changes.packaging import build_package, install_package, upload_package, insta... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.