conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Store stack analysis in the context\n"
},
{
"from": "human",
"value": "from behave import when, then\nfrom features.src.support import helpers\nfrom features.src.stackAnalyses import StackAnalyses\nfrom pyshould import should_not\n\n@when(u'I send Maven package mani... | python | chosen |
[
{
"from": "system",
"value": "Make canonical domain transition more smooth\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef migrate_canonical(apps, schema_editor):\n Project = apps.get_model(\"proj... | python | chosen |
[
{
"from": "system",
"value": "Allow callables for AdminThumbnail image_field arg\n\nThis allows images from related models to be displayed. Closes #138.\n"
},
{
"from": "human",
"value": "from django.utils.translation import ugettext_lazy as _\nfrom django.template.loader import render_to_string... | python | chosen |
[
{
"from": "system",
"value": "Reformat string representation of Credentials\n"
},
{
"from": "human",
"value": "import os\n\n\nclass Credential(object):\n def __init__(self, name, login, password, comments):\n self.name = name\n self.login = login\n self.password = passwor... | python | chosen |
[
{
"from": "system",
"value": "Stop getwork store from displaying Not Founds\n"
},
{
"from": "human",
"value": "#License#\n#bitHopper by Colin Rice is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.\n#Based on a work at github.com.\n\nimport time\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "[Telemetry] Fix browser restart in TimelineBasedPageTest\n\nThe TimelineBasedPageTest constructor was passing in error a string where\nits parent constructor expects a Boolean value for the\nneeds_browser_restart_after_each_page option.\n\nBUG=504368\n\nReview URL: https://code... | python | chosen |
[
{
"from": "system",
"value": "Change carrot serialization from JSON to 'pickle'\n"
},
{
"from": "human",
"value": "import logging\nfrom carrot.messaging import Publisher\nfrom carrot.connection import BrokerConnection\n\nfrom lamson.routing import route, route_like, stateless\nfrom config.settin... | python | chosen |
[
{
"from": "system",
"value": "Use env variables for postgres conn in tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport pytest\n\nimport pg_bawler.core\n\n\ndef test_register_handlers():\n listener = pg_bawler.core.ListenerMixin()\n assert listener.register_handler(None... | python | chosen |
[
{
"from": "system",
"value": "Use updated corner plot API\n"
},
{
"from": "human",
"value": "import numpy as np\nimport triangle\nimport astropy.io.ascii as ascii\nimport matplotlib.pyplot as plt\n\npyout = ascii.read('test.pyout')\nidlout = ascii.read('test.idlout')\n\nfig, axarr = plt.subplots... | python | chosen |
[
{
"from": "system",
"value": "Raise NotImplementedError instead of NotImplemented\n\n"
},
{
"from": "human",
"value": "\"\"\"\nInterface for all launch-control-tool commands\n\"\"\"\nimport inspect\n\nfrom launch_control.utils.registry import RegistryBase\n\n\nclass Command(RegistryBase):\n \... | python | chosen |
[
{
"from": "system",
"value": "Create root page for api.openresolve.com\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\nfrom flask_restful import Api\nfrom dns.resolver import Resolver\nfrom flask_cors import CORS\n\n\ndns_resolver = Resolver()\n\n\ndef create_app(config_... | python | chosen |
[
{
"from": "system",
"value": "Change about link to github wiki\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport webbrowser\nfrom Foundation import NSBundle\nimport rumps\nimport modules.google_calendar\n#rumps.debug_mode(True) # turn on command line logg... | python | chosen |
[
{
"from": "system",
"value": "Add primitive server option for easier debugging"
},
{
"from": "human",
"value": "import optparse, os, pickle\n\nconfig = {'charity':False,\n 'propagate_factor':2,\n 'accept_latency':2000}\n\ndef setup():\n parser = optparse.OptionParser()\n pars... | python | chosen |
[
{
"from": "system",
"value": "Add URI param that queries freegeoip\n"
},
{
"from": "human",
"value": "import sys\nfrom http.server import HTTPServer, BaseHTTPRequestHandler\n\n\nclass MyHTTPRequestHandler(BaseHTTPRequestHandler):\n def do_GET(self):\n\n client_ip = self.client_address[... | python | chosen |
[
{
"from": "system",
"value": "Add the ID unique constraint\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nfrom osv import fields,osv\n#the ID for the purchase requisition and the material request\nclass sale_product(osv.osv):\n _name = \"sale.product\"\n _description = \"Sal... | python | chosen |
[
{
"from": "system",
"value": "Use the refactored timeline helpers for remaining time.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.5\n#\n# Copyright 2011 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except ... | python | chosen |
[
{
"from": "system",
"value": "Fix order of classifiers\nThe list should be alphabetical. N comes after L.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.... | python | chosen |
[
{
"from": "system",
"value": "gateware: Add xadc if device supports it.\n"
},
{
"from": "human",
"value": "\"\"\"\nModule for info embedded in the gateware / board.\n\"\"\"\n\nfrom litex.build.generic_platform import ConstraintError\nfrom litex.gen import *\nfrom litex.soc.interconnect.csr impor... | python | chosen |
[
{
"from": "system",
"value": "Fix incomplete update to botocross 1.1.1\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom distutils.core import setup\nfrom setuptools import find_packages\nimport stackformation\nimport sys\n\nif sys.version_info <= (2, 5):\n error = \"ERROR: stack... | python | chosen |
[
{
"from": "system",
"value": "Add thread/processes to map method.\nAdd substream method\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(name='streampy',\n version='0.4',\n description='Java like stream pipelines, supports parallel operations',\n url='https... | python | chosen |
[
{
"from": "system",
"value": "sdk: Introduce \"preview\" suffix in the version number\n\nThis will allow versioning of pre-releases for people that doesn't use\nthe RPM packaging.\n\nChange-Id: Id5972c0fbf8bdc7f5714101d8dfad4c6b4758ceb\nSigned-off-by: Juan Hernandez <59e5b8140de97cc91c3fb6c5342dce948469af8c... | python | chosen |
[
{
"from": "system",
"value": "Add markdown and BeautifulSoup to requires.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nfrom setuptools import setup, find_packages\n\nsetup(name=\"github-comments\",\n version='1.3',\n url=\"https://github.com/alikins/github-comments\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Set execution timeout to be lower\n\nOtherwise the test would be much slower\n"
},
{
"from": "human",
"value": "from mythril.analysis.callgraph import generate_graph\nfrom mythril.analysis.symbolic import SymExecWrapper\nfrom mythril.ethereum import util\nfrom mythr... | python | chosen |
[
{
"from": "system",
"value": "Use find_packages() to export all packages automatically on install\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup\n\n\ndef get_version_from_git_most_recent_tag():\n return os.popen(\"git tag -l v* | tail --lines=1\").read().strip().... | python | chosen |
[
{
"from": "system",
"value": "Fix to find entire package hierarchy\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n__version__ = '0.1'\n\nsetup(\n name='wanikani',\n description='WaniKani Tools for Python',\n long_description=open('README.md').read(),\n author='Pau... | python | chosen |
[
{
"from": "system",
"value": "Use the correct module name for 'msgpack' Python module\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nfrom serfclient import __version__\n\ntry:\n from setuptools import setup\n from setuptools.command.test import test as T... | python | chosen |
[
{
"from": "system",
"value": "Update Tweet method for api change\n"
},
{
"from": "human",
"value": "import tweepy\nimport time\n\n\nclass TwitterBot:\n def __init__(self, auth, listen_msg, response_msg):\n auth = tweepy.OAuthHandler(auth['consumer_key'], auth['consumer_secret'])\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove / in the sitemap url\n"
},
{
"from": "human",
"value": "from django.urls import path\nfrom django.contrib.sitemaps.views import sitemap\n\nfrom story.views import StoryListView\nfrom story.sitemap import BlogSiteMap\n\nsitemaps = {\n \"blog\": BlogSiteMap\... | python | chosen |
[
{
"from": "system",
"value": "Add optional installation requirements to pvlib installation\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n@author: uwe\n\"\"\"\n\nimport sys\nimport os\nfrom setuptools import setup\n\nsetup(name='feedinlib',\n version='0.0.12',\n de... | python | chosen |
[
{
"from": "system",
"value": "Change rel paths into abspaths\n"
},
{
"from": "human",
"value": "#!/bin/env python\n#\n# glidein_ls\n#\n# Execute a ls command on the job directory\n#\n# Usage:\n# glidein_ls.py <cluster>.<process> [-name <schedd_name>] [-pool <pool_name> ] [-timeout <nr secs>\n#\... | python | chosen |
[
{
"from": "system",
"value": "Set minimum pyop version to v3.4.0 to ensure the needed methods are available\n\nSigned-off-by: Ivan Kanakarakis <f60d6943d72436645c4304926eeeac2718a1142c@gmail.com>\n"
},
{
"from": "human",
"value": "\"\"\"\nsetup.py\n\"\"\"\n\nfrom setuptools import setup, find_pa... | python | chosen |
[
{
"from": "system",
"value": "Add python-magic as a requirement for mime detection.\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nfrom setuptools import setup\n\nwith open(\"./pushbullet/__version__.py\") as version_file:\n version = version_file.read().split(\"\\\"\")[1]\n\nif ... | python | chosen |
[
{
"from": "system",
"value": "Add six to test requirements.\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\nsetup(\n name='pygcvs',\n version=__import_... | python | chosen |
[
{
"from": "system",
"value": "Add h5py as a dep\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nfrom setuptools import setup, find_packages\nfrom setuptools.command.install import install as _install\n\n\nsetup(name='tagnews',\n version='1.0.1... | python | chosen |
[
{
"from": "system",
"value": "Increment version number for added ELT combiner tool\n"
},
{
"from": "human",
"value": "from codecs import open\nfrom os import path\nfrom setuptools import setup\n\nhere = path.abspath(path.dirname(__file__))\n\nwith open(path.join(here, 'README.rst'), encoding='ut... | python | chosen |
[
{
"from": "system",
"value": "Bump version and set license to MIT\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()\n\n# allow setup.py to be run... | python | chosen |
[
{
"from": "system",
"value": "Make jmespath dependency version more lenient.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='eliot-tree',\n version='15.0.0',\n description='Render Eliot logs as an ASCII tree',\n author='Jonathan Jacobs',\n url='ht... | python | chosen |
[
{
"from": "system",
"value": "Add client part of package\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name='xirvik-tools',\n version='0.0.1',\n author='Fa An',\n author_email='2998784916@qq.com',\n packages=['xirvik'],\n url='https://faan/xirv... | python | chosen |
[
{
"from": "system",
"value": "Change version number for release\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.ch... | python | chosen |
[
{
"from": "system",
"value": "Add Framework::Pytest to list of classifiers\n"
},
{
"from": "human",
"value": "import re\n\nfrom setuptools import setup\n\nwith open('pytest_mock.py') as f:\n m = re.search(\"version = '(.*)'\", f.read())\n assert m is not None\n version = m.group(1)\n\ns... | python | chosen |
[
{
"from": "system",
"value": "Remove spaces around `=` operator\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name = 'AtomSeeker',\n version = '0.0.1',\n description = 'Analyzer for MP4/MOV format file',\n packages = find_packages(),\n ... | python | chosen |
[
{
"from": "system",
"value": "Update requests requirement from <2.20,>=2.4.2 to >=2.4.2,<2.21\n\nUpdates the requirements on [requests](https://github.com/requests/requests) to permit the latest version.\n- [Release notes](https://github.com/requests/requests/releases)\n- [Changelog](https://github.com/requ... | python | chosen |
[
{
"from": "system",
"value": "Add changelog to readme, and open/close both files properly\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='django-logentry-admin',\n author='Yuri Prezument',\n author_email='y@yprez.com',\n version='0.1.5',\n packa... | python | chosen |
[
{
"from": "system",
"value": "Exclude the test/ directory & files from being installed as a package.\n"
},
{
"from": "human",
"value": "\"\"\"setup.py file.\"\"\"\n\nimport uuid\n\nfrom setuptools import setup, find_packages\nfrom pip.req import parse_requirements\n\n__author__ = 'David Barroso ... | python | chosen |
[
{
"from": "system",
"value": "Add classifiers for the supported versions"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\n\nfrom setuptools import find_packages, setup\n\n\ninstall_requires = [\n 'cssselect',\n 'cssutils',\n 'lxml',\n]\n\ntests_require = [\n 'exam'... | python | chosen |
[
{
"from": "system",
"value": "[Feature] Include packages in requirements.txt to install_requires().\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name = 'dictsheet',\n version = '0.0.3',\n keywords = ('dictsheet', 'spreadsheet', 'gspread'),\n... | python | chosen |
[
{
"from": "system",
"value": "Fix accessing settings for debit account number\n"
},
{
"from": "human",
"value": "from decimal import Decimal\n\nfrom django.conf import settings\nfrom django.core.mail import EmailMessage\n\nfrom celery.utils.log import get_task_logger\n\nfrom .csv_attach import C... | python | chosen |
[
{
"from": "system",
"value": "Mark package as Python 3.6-compatible.\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-envelope',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add DIR to HOME\n* Add .pyrosar directory to HOME-path.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(name='pyroSAR',\n packages=find_packages(),\n include_package_data=True,\n version='0.1',\n descriptio... | python | chosen |
[
{
"from": "system",
"value": "Mark requirement for python 3.6\n"
},
{
"from": "human",
"value": "try:\n from setuptools import setup\n from setuptools import find_packages\n packages = find_packages()\nexcept ImportError:\n from distutils.core import setup\n import os\n package... | python | chosen |
[
{
"from": "system",
"value": "Add save for registration & login logic\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, redirect\n\nfrom models import *\n\n# Create your views here.\n\ndef index(req):\n\treturn render(req, \"landing.html\", {'request': req})\n\ndef login(re... | python | chosen |
[
{
"from": "system",
"value": "Return 501 on pip search requests\n"
},
{
"from": "human",
"value": "\"\"\"Simple blueprint.\"\"\"\nimport os\n\nfrom flask import Blueprint, current_app, render_template\n\nblueprint = Blueprint('simple', __name__, url_prefix='/simple',\n template... | python | chosen |
[
{
"from": "system",
"value": "TST: Remove `compat` and `core` from the tests\n"
},
{
"from": "human",
"value": "import numpy as np\n\nreveal_type(np) # E: ModuleType\n\nreveal_type(np.char) # E: ModuleType\nreveal_type(np.compat) # E: ModuleType\nreveal_type(np.core) # E: ModuleType\nreveal_... | python | chosen |
[
{
"from": "system",
"value": "Allow `PBar` to accept any kwargs (e.g. those used by `tqdm`)\n"
},
{
"from": "human",
"value": "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module provides utilities to chunk large s... | python | chosen |
[
{
"from": "system",
"value": "Modify TsvTableFileLoader/TsvTableTextLoader to accept additional keyword arguments\n"
},
{
"from": "human",
"value": "\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom .._validator import FileValidator, TextValidator\nfrom ..cs... | python | chosen |
[
{
"from": "system",
"value": "Use NIST-BLEU instead of GLEU for oracle.\n"
},
{
"from": "human",
"value": "\nfrom itertools import groupby\n\nfrom nltk.translate.gleu_score import sentence_gleu as gleu\nfrom nltk.tokenize.toktok import ToktokTokenizer\n\n_tokenize = ToktokTokenizer().tokenize\n\... | python | chosen |
[
{
"from": "system",
"value": "Correct unicde function so UserProfile is correctly displayed in the admin form\n"
},
{
"from": "human",
"value": "import os\nimport simplejson as json\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom django_extensions.db.fields.jso... | python | chosen |
[
{
"from": "system",
"value": "Remove downloaded file before updating counter\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport ftplib\nimport gzip\nimport os\nimport sys\n\nhost = 'ftp.ncdc.noaa.gov'\nbase = '/pub/data/noaa'\nretries = 3\n\nftp = ftplib.FTP(host)\nftp.login()\n... | python | chosen |
[
{
"from": "system",
"value": "Add sysvarfile and env config loaders to simpledb.\n"
},
{
"from": "human",
"value": "from .service import SimpleDatabaseService\n\n__meta__ = {\n \"name\": \"Simple Database\",\n \"class\": SimpleDatabaseService,\n \"deps\": [\"messaging\", \"appmanager\"]... | python | chosen |
[
{
"from": "system",
"value": "Include correct documentation URL in error message"
},
{
"from": "human",
"value": "import subprocess\nimport pf\n\n\"\"\"\n Doing this the \"right\" way by using DIOCNATLOOK on the pf device turns out\n to be a pain. Apple has made a number of modifications t... | python | chosen |
[
{
"from": "system",
"value": "Add comments to Singleton about usage.\n"
},
{
"from": "human",
"value": "\"\"\"\n\nFile: singleton.py\n\nPurpose: Defines a class whose subclasses will act like the singleton pattern.\n\n\"\"\"\n\n\nclass Singleton(object):\n \"\"\"\n This is a class that imp... | python | chosen |
[
{
"from": "system",
"value": "Add Window functions to attempt partial sum\n"
},
{
"from": "human",
"value": "\n# Knapsack 0-1 function wieights, values and size n.\nfrom pyspark.sql import Row\nfrom pyspark.sql.functions import lit\nfrom pyspark.sql.functions import col\n\n# Greedy implementatio... | python | chosen |
[
{
"from": "system",
"value": "Make the new helper function public\n"
},
{
"from": "human",
"value": "# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n\n\"\"\"\nShared flocker components.\n\"\"\"\n\n__all__ = [\n 'INode', 'FakeNode', 'ProcessNode', 'gather_deferreds',\n 'auto_t... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8 to pass super checks\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2012 Daniel Reis\n#\n# This program is free software: you can redistrib... | python | chosen |
[
{
"from": "system",
"value": "Correct content type (png image) is now reported for the url /plot\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template\nfrom synth.synth import generate_reflectivity, plot_logs\nfrom StringIO import StringIO \n\napp = Flask(__name__)\n\n@ap... | python | chosen |
[
{
"from": "system",
"value": "Check if original object is None\n"
},
{
"from": "human",
"value": "from django import template\nimport json\nfrom django.conf import settings\nregister = template.Library()\n\n@register.simple_tag(takes_context=True)\ndef get_admin_context(context):\n\n ctx = {'... | python | chosen |
[
{
"from": "system",
"value": "Fix spacing in last method of file.\n\nSigned-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com>\n"
},
{
"from": "human",
"value": "import os\nfrom threading import Thread\n\ndef _delete(path):\n\tos.remove(path)\n\ndef _link(src, path):\n\tos.s... | python | chosen |
[
{
"from": "system",
"value": "Update web export manage command to generate static/jekyll site\n"
},
{
"from": "human",
"value": "from eulfedora.server import Repository\nfrom django.core.management.base import BaseCommand\n\nfrom readux.books import export\nfrom readux.books.models import Volume... | python | chosen |
[
{
"from": "system",
"value": "Support for DRF 3.0 and above\n\nSee http://www.django-rest-framework.org/topics/3.0-announcement/"
},
{
"from": "human",
"value": "from rest_framework import serializers\nfrom sorl.thumbnail import get_thumbnail\n\n\nclass HyperlinkedSorlImageField(serializers.Imag... | python | chosen |
[
{
"from": "system",
"value": "Prepare for next development iteration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n__version__ = '0.3.4'\n__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']\n\nfrom .application_master import ApplicationMaster\nfrom .h... | python | chosen |
[
{
"from": "system",
"value": "Make stack limit check more tollerant.\n"
},
{
"from": "human",
"value": "'''\nCreated on 6 Apr 2016\n\n@author: fressi\n'''\n\nimport unittest\n\nimport python_course_1604.class_01.exercize_04_stack_limit as exercize\n\nfrom python_course_1604.tests.utils import sk... | python | chosen |
[
{
"from": "system",
"value": "Move status to database instead of status file (server side)\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport os\nimport logging\n\nfrom . import helper\n\n\ndef readStatus(config, student):\n student = student.lower()\n pat... | python | chosen |
[
{
"from": "system",
"value": "Add another test demonstrating that multiple assignment doesn't affect __requires__ parsing.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport textwrap\nimport sys\nimport subprocess\n\nfrom rwt import scripts\n\n\ndef test_pkg_imp... | python | chosen |
[
{
"from": "system",
"value": "Make /lava-server/scheduler/ be a valid URL\n\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import url, patterns\n\nurlpatterns = patterns(\n 'lava_scheduler_app.views',\n url(r'index$', 'index'))\n"
},
{
"from": "gpt",
"value":... | python | chosen |
[
{
"from": "system",
"value": "Handle true/false as well as True/False arguments"
},
{
"from": "human",
"value": "'''\nUtilities for scripts\n'''\n\nimport sys\n\n__all__ = ['parse_args']\n\ndef parse_args(num_args, allowed_params, msg, string_args=set()):\n msg += '\\nAllowed arguments and de... | python | chosen |
[
{
"from": "system",
"value": "Set a URL to download the humanitarian CSV from\n\nand fix a copypaste error\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\n\nimport requests\n\n\n# local configuration\nremote_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)... | python | chosen |
[
{
"from": "system",
"value": "Use getattr for expando props\n"
},
{
"from": "human",
"value": "from django import forms\n\nclass EditUserForm(forms.Form):\n about_me = forms.CharField(widget=forms.Textarea, required=False)\n url = forms.CharField(max_length=255, required=False)\n facebo... | python | chosen |
[
{
"from": "system",
"value": "Reimplement ddb import from file as celery task.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom celery.utils.log import get_task_logger\nfrom ogn.collect.celery import app\n\nfrom ogn.model import Flarm\nfrom ogn.utils import get_d... | python | chosen |
[
{
"from": "system",
"value": "Add avddlen property to Collection\n"
},
{
"from": "human",
"value": "from collections import defaultdict\n\nclass Collection(object):\n DOC_FROM = [\"question_body\", \"best_answer_body\"]\n\n def __init__(self):\n '''\n Compute the following st... | python | chosen |
[
{
"from": "system",
"value": "Handle EOFError on pickle load\n"
},
{
"from": "human",
"value": "from DataModel import DataModel\nfrom DataModelAdapter import DataModelAdapter\nfrom Ledger import Ledger\n\nimport pickle\n\nDATA_FILE='ledger.pickle'\n\ndef get_ledger() :\n result = None\n tr... | python | chosen |
[
{
"from": "system",
"value": "Change the static copy command so it works with new layout.\n"
},
{
"from": "human",
"value": "from django.core.management.base import NoArgsCommand\nimport os\nimport shutil\n\nclass Command(NoArgsCommand):\n help = \"Copy the satchmo static directory and files ... | python | chosen |
[
{
"from": "system",
"value": "Use environment variable PORT for flask port\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template\nfrom names import get_full_name\n\n\napp = Flask(__name__)\n\n\n@app.route(\"/\")\ndef index():\n return render_template('index.html', name=g... | python | chosen |
[
{
"from": "human",
"value": "Add some documentation to integration tests\n"
},
{
"from": "gpt",
"value": "\"\"\"\nThis package contains data files for our API integration tests.\n\nIn order to add a new integration test, create a new package with the following contents:\n```\nyunity/resources/te... | python | chosen |
[
{
"from": "human",
"value": "Add (failing) Python command line parsing tests\n"
},
{
"from": "gpt",
"value": "import px_commandline\n\n\ndef test_get_command_python():\n assert px_commandline.get_command(\"python\") == \"python\"\n assert px_commandline.get_command(\"/apa/Python\") == \"Py... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8 error on psycopg2cffi hack"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2015, 2016 OpenMarket Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lic... | python | chosen |
[
{
"from": "system",
"value": " Fix for the static analysis acceptance test.\n"
},
{
"from": "human",
"value": "import unittest\n\nclass TestSimpleClass(unittest.TestCase):\n def test_simple_method(self):\n assert False # TODO: implement your test here\n\n def test_simple_method_wit... | python | chosen |
[
{
"from": "system",
"value": "Increase rest client connection pool size to 50\n"
},
{
"from": "human",
"value": "from .base_settings import *\nimport os\n\nINSTALLED_APPS += [\n 'data_aggregator.apps.DataAggregatorConfig',\n 'webpack_loader',\n]\n\nif os.getenv('ENV') == 'localdev':\n D... | python | chosen |
[
{
"from": "system",
"value": "Add comment to clarify coordinate order\n\ncoordinates are (y,x) in the track.\n"
},
{
"from": "human",
"value": "\"\"\" Created by Max 12/2/2017 \"\"\"\nimport pprint\n\nimport numpy as np\n\n\nclass TrackParser:\n\n @staticmethod\n def parse_track(path_to_tr... | python | chosen |
[
{
"from": "system",
"value": "Check the ELB service url\n"
},
{
"from": "human",
"value": "import otc\n\nclass TestElbClient:\n \"\"\"ELB client tests\"\"\"\n\n def setUp(self):\n \"\"\"Setup test cloud\"\"\"\n self.cloud = otc.OtcCloud(cloud='test')\n\n def tearDown(self)... | python | chosen |
[
{
"from": "system",
"value": "Make flatten more portable again\n"
},
{
"from": "human",
"value": "\nimport bisect\n\ndef binary_search(a, x):\n i = bisect.bisect_left(a, x)\n return i != len(a) and a[i] == x\n\n\ndef flatten(lst):\n res = []\n def dfs(l):\n try:\n f... | python | chosen |
[
{
"from": "system",
"value": "Add an other provider to config\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ncredentials = {\n 'verify-email.org': {\n 'username': 'YOURUSERNAME',\n 'password': 'YOURPASSWORD',\n }\n 'emailhippo.com': {\... | python | chosen |
[
{
"from": "system",
"value": "Create tests for login page\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom unittest import TestCase\nfrom findaconf import app, db\nfrom findaconf.tests.config import set_app, unset_app\n\n\nclass TestSiteRoutes(TestCase):\n\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Implement Sharpen (unused Blingtron Brawl Hero Power)\n"
},
{
"from": "human",
"value": "\"\"\"\nBlingtron's Beauteous Brawl\n\"\"\"\nfrom ..utils import *\n\n\n# Cash In\nclass TP_Bling_HP2:\n\tactivate = Destroy(FRIENDLY_WEAPON)\n\n\n# Blingtron's Blade\nclass TB_... | python | chosen |
[
{
"from": "system",
"value": "Use a better variable name instead of one character\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom crossword import Crossword\n\n\nclass CrosswordTestCase(unittest.TestCase):\n\n def test_crossword_set_and_get_element(self):\n c = Crossword(10,... | python | chosen |
[
{
"from": "system",
"value": "Add delete example in CURL job\n"
},
{
"from": "human",
"value": "\"\"\"A job to send a HTTP GET periodically.\"\"\"\n\nimport logging\nimport requests\n\nfrom ndscheduler import job\n\nlogger = logging.getLogger(__name__)\n\n\nclass CurlJob(job.JobBase):\n TIMEO... | python | chosen |
[
{
"from": "system",
"value": "Add CDN url to allowed hosts.\n"
},
{
"from": "human",
"value": "import os\nimport socket\n\nfrom .base import * # noqa\n\n\nSERVER_ENV = os.getenv('DJANGO_SERVER_ENV')\nSECRET_KEY = os.getenv('SECRET_KEY')\nSTATIC_URL = os.getenv('STATIC_URL', STATIC_URL)\nDEBUG =... | python | chosen |
[
{
"from": "system",
"value": "Make Error behavior consistent across Pythons\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport unittest\n\nimport six\nimport spotify\n\n\nclass ErrorTest(unittest.TestCase):\n def test_error_has_error_code(self):\n erro... | python | chosen |
[
{
"from": "system",
"value": "Fix lines in auth.py to to be 79 chars or less\n"
},
{
"from": "human",
"value": "from . import database\n\ndef getAllSettings():\n\tdatabaseConnection = database.ConnectionManager.getConnection(\"main\")\n\tquery = databaseConnection.session.query(database.tables.S... | python | chosen |
[
{
"from": "system",
"value": "Define __repr__ for pdtools Camera class.\n"
},
{
"from": "human",
"value": "import base64\n\nimport requests\nimport six\n\n\nclass Camera(object):\n def __init__(self, host):\n self.host = host\n\n def get_image(self):\n \"\"\"\n Get an ... | python | chosen |
[
{
"from": "system",
"value": "Add individual email field to activity serializer\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom agir.events.serializers import EventSerializer\nfrom agir.groups.serializers import SupportGroupSerializer\nfrom agir.lib.serializers ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.