conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix type mismatches in the django_comment_common migrations.\n\nMixing byte and unicode strings causes migrations to fail.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\n\nfrom django.db import m... | python | chosen |
[
{
"from": "system",
"value": "Exclude certain fields from json serialization in raster_stats web service\n"
},
{
"from": "human",
"value": "# Create your views here.\nfrom django.http import HttpResponse\nfrom lingcod.raster_stats.models import zonal_stats, RasterDataset, ZonalStatsCache\nfrom d... | python | chosen |
[
{
"from": "system",
"value": "Fix encoding of store serialisation. "
},
{
"from": "human",
"value": "import json\n\nfrom datawire.views.util import JSONEncoder\n\n\nclass Store(object):\n\n def __init__(self, url):\n self.url = url\n\n def store(self, frame):\n urn = frame.ge... | python | chosen |
[
{
"from": "system",
"value": "Implement per-app/model template overrides for ImagePlugin.\n"
},
{
"from": "human",
"value": "\"\"\"\nDefinition of the plugin.\n\"\"\"\nfrom django.utils.translation import ugettext_lazy as _\nfrom fluent_contents.extensions import ContentPlugin, plugin_pool\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Change Development status to 5 - Production/Stable for next release\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\ntry:\n long_description = open(\"README.rst\").read()\nexcept IOError:\n long_description = \"\"\n\nsetup(\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove bash_completition references in consumer-manager\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nfrom kafka_info import __version__\n\n\nsetup(\n name=\"kafka_info\",\n version=__version__,\n author=\"Federico Giraud\",\n author... | python | chosen |
[
{
"from": "system",
"value": "Update the PyPI version to 7.0.13.\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": "Fix specification of Python 3.6 and 3.7\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nsetup(\n name='exchangerates',\n version='0.3.3',\n description=\"A module to make it easier to handle historical exchange rates\",\n... | python | chosen |
[
{
"from": "system",
"value": "Fix build errors because of README extension\n"
},
{
"from": "human",
"value": "\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name='file2dna',\n version='0.1',\... | python | chosen |
[
{
"from": "system",
"value": "Update boto3 requirement to latest version\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport codecs\nfrom setuptools import setup, find_packages\n\n\n# Utility function to read the README file.\n# Used for the long_description. It's nice... | python | chosen |
[
{
"from": "system",
"value": "Add more Python version classifiers\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import find_packages, setup\n\n# Use quickphotos.VERSION for version numbers\nversion_tuple = __import__('quickphotos').VERSION\nversion = '.'.join([str(v) ... | python | chosen |
[
{
"from": "system",
"value": "Add more Python 3 classifiers"
},
{
"from": "human",
"value": "#!/usr/bin/env python\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\"\"\"\n\nfrom s... | python | chosen |
[
{
"from": "system",
"value": "Split python 3 and python 2 requirements\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='yargy',\n version='0.4.0',\n description='Tiny rule-based facts extraction package',\n url='https://github.com/burea... | python | chosen |
[
{
"from": "system",
"value": "Update package version for PyPI\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nVERSION=\"0.1\"\n\ntry:\n long_description=open('DESCRIPTION.rst', 'rt').read()\nexcept Exception:\n long_description=\"Universal Analytics in Python; an impleme... | python | chosen |
[
{
"from": "system",
"value": "Fix django_extensions < 1.6.8 as higher versions do not support Django 1.6*\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='qmpy',\n version='0.4.9a',\n author='S. Kirklin',\n author_email='scott.kirklin@g... | python | chosen |
[
{
"from": "system",
"value": "Add python 3.4 to trove classifiers\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nversion = '0.1'\n\nsetup(\n name='python-editor',\n version=version,\n description=\"Programmatically open an editor, capture the result.\",\n #long_de... | python | chosen |
[
{
"from": "system",
"value": "Allow new version of requires"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nlong_description = open('./README.rst').read()\n\nsetup(\n name='ebi',\n version='0.6.2',\n install_requires=[\n 'awsebcli==3.7.3',\n ... | python | chosen |
[
{
"from": "system",
"value": "Change metadata of the project\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport sys\n\nfrom setuptools import setup, Extension\n\nfrom ifconfigpy import get_version\n\nmodules = []\n\nif os.uname()[0].lower().start... | python | chosen |
[
{
"from": "system",
"value": "Include all packages (and become 0.9.3 in the process)\n"
},
{
"from": "human",
"value": "# encoding=utf8\n\nfrom setuptools import setup\n\nsetup(\n name='django-form-designer-ai',\n version='0.9.2',\n url='http://github.com/andersinno/django-form-designer... | python | chosen |
[
{
"from": "system",
"value": "Add cliff as a requirement\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name='Juju XaaS CLI',\n version='0.1.0',\n author='Justin SB',\n author_email='justin@fathomdb.com',\n packages=['jxaas'],\n url='http://pypi... | python | chosen |
[
{
"from": "system",
"value": "Add sphinxcontrib-httpdomain for readthedocs build\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# from distutils.core import setup\nfrom setuptools import setup, find_packages\nimport multiprocessing # nopep8\n\nsetup(name='orlo',\n version='0.0... | python | chosen |
[
{
"from": "system",
"value": "ZON-4007: Declare dependency (belongs to commit:6791185)\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nsetup(\n name='zeit.push',\n version='1.21.0.dev0',\n author='gocept, Zeit Online',\n author_email='zon-backend@z... | python | chosen |
[
{
"from": "system",
"value": "Use master branch of content instead of specific release"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name = 'marquee-composer',\n version = '0.2.3-dev',\n description = '',\n ... | python | chosen |
[
{
"from": "system",
"value": "Make it easier to enter DEBUG mode\n"
},
{
"from": "human",
"value": "import click\nimport logging\n\nfrom dotenv import load_dotenv, find_dotenv\nfrom grazer.config import Config\nfrom grazer.core import crawler\n\n\n@click.command()\n@click.option(\"--env\", defau... | python | chosen |
[
{
"from": "system",
"value": "Read license and fix missing comma\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport changes\n\nsetup(\n name=changes.__name__,\n version=changes.__version__,\n description=changes.__doc__,\n author=changes.__author__\n author_em... | python | chosen |
[
{
"from": "system",
"value": "Make copy of reference image with same name modification as the rest of the images\n"
},
{
"from": "human",
"value": "from image import ImageWithWCS\nimport numpy as np\nfrom os import path\n\n\ndef shift_images(files, source_dir, output_file='_shifted'):\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix utility being picked up as test, display expected-and-got values in assertion error"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#encoding:utf-8\n#author:dbr/Ben\n#project:tvnamer\n#repository:http://github.com/dbr/tvnamer\n#license:Creative Commons G... | python | chosen |
[
{
"from": "system",
"value": "Make index now lists all wheels on FTP server\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 31 18:29:35 2013\n\n@author: stuart\n\"\"\"\nimport os\nimport glob\n\nwheels = glob.glob(\"./wheelhouse/*whl\")\n\noutf = open(\"./w... | python | chosen |
[
{
"from": "system",
"value": "Fix for checking the context processors on Django 1.8\n\nIf the user has not migrated their settings file to use the new TEMPLATES\nmethod in Django 1.8, settings.TEMPLATES is an empty list.\n\nInstead, if we check django.templates.engines it will be populated with the\nautomat... | python | chosen |
[
{
"from": "system",
"value": "Make it DESC order by id.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport json\nfrom django.conf import settings\nfrom django.views.decorators.csrf import csrf_exempt\nfrom django.http import HttpResponse... | python | chosen |
[
{
"from": "system",
"value": "Add support for branch arg to LocalHost.clone\n"
},
{
"from": "human",
"value": "import gitdir.host\n\nclass LocalHost(gitdir.host.Host):\n def __iter__(self):\n for repo_dir in sorted(self.dir.iterdir()):\n if repo_dir.is_dir():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add function for next_fit algorithm\n"
},
{
"from": "human",
"value": "import collections\nfrom stock import Stock\n\n# simple structure to keep track of a specific piece\nPiece = collections.namedtuple('Piece', 'id, length')\n\nclass Planner(object):\n\n def __i... | python | chosen |
[
{
"from": "system",
"value": "Enable user and site model policies\n"
},
{
"from": "human",
"value": "from .model_policy_Slice import *\nfrom .model_policy_User import *\nfrom .model_policy_Network import *\nfrom .model_policy_Site import *\nfrom .model_policy_SitePrivilege import *\nfrom .model_... | python | chosen |
[
{
"from": "system",
"value": "Stop killing run-tests and run-ci\n"
},
{
"from": "human",
"value": "import subprocess\nimport sys\nimport setup_util\nimport os\n\ndef start(args, logfile, errfile):\n try:\n subprocess.check_call(\"mvn clean compile assembly:single\", shell=True, cwd=\"grizzly... | python | chosen |
[
{
"from": "system",
"value": "Call HugoPrinter to save config file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport sys\nfrom pprint import pprint\nfrom lxml import etree\nimport html2text\n\nfrom wp_parser import WordpressXMLParser\nfrom hugo_printer import HugoPrinter\n\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Add a manager to make getting preferences prettier.\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in complia... | python | chosen |
[
{
"from": "system",
"value": "Add hack to allow specifying newlines in scripts\n"
},
{
"from": "human",
"value": "class InstructionBase(object):\n BEFORE=None\n AFTER=None\n\n def __init__(self, search_string):\n self.search_string = search_string\n\n @property\n def search... | python | chosen |
[
{
"from": "system",
"value": "Set time back four hours to EST\n"
},
{
"from": "human",
"value": "from flask import request, Response\nfrom .base import *\nfrom server import app\nimport requests\nimport re\nimport sys\nreload(sys)\nsys.setdefaultencoding('utf-8')\n\n@app.route('/nso')\ndef get_n... | python | chosen |
[
{
"from": "system",
"value": "Add pytest fixture to avoid leakage of cwd changes\n"
},
{
"from": "human",
"value": "from pytest import fixture\nfrom cumulusci.core.github import get_github_api\n\n\n@fixture\ndef gh_api():\n return get_github_api(\"TestOwner\", \"TestRepo\")\n"
},
{
"f... | python | chosen |
[
{
"from": "system",
"value": "Test passes on OS X\n"
},
{
"from": "human",
"value": "import sys\n\nfrom ..test_backend import BackendBasicTests\nfrom ..py30compat import unittest\nfrom keyring.backends import OS_X\n\ndef is_osx_keychain_supported():\n return sys.platform in ('mac','darwin')\n... | python | chosen |
[
{
"from": "system",
"value": "Bump to v0.9.3 (MANIFEST.in fix)\n"
},
{
"from": "human",
"value": "VERSION_TUPLE = (0, 9, 2)\n__version__ = \".\".join(map(str, VERSION_TUPLE))\n"
},
{
"from": "gpt",
"value": "VERSION_TUPLE = (0, 9, 3)\n__version__ = \".\".join(map(str, VERSION_TUPLE))... | python | chosen |
[
{
"from": "system",
"value": "Handle lookup stats update on a slave server\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright (C) 2012 Lukas Lalinsky\n# Distributed under the MIT license, see the LICENSE file for details.\n\nimport re\nfrom contextlib import closing\nfrom ac... | python | chosen |
[
{
"from": "system",
"value": "Add python 3.5 to trove classifiers"
},
{
"from": "human",
"value": "import setuptools\n\nsetuptools.setup(\n name=\"{{ cookiecutter.package_name }}\",\n version=\"{{ cookiecutter.package_version }}\",\n url=\"{{ cookiecutter.package_url }}\",\n\n author... | python | chosen |
[
{
"from": "system",
"value": "Tag commit for v0.0.19-master generated by gitmake.py\n"
},
{
"from": "human",
"value": "major = 0\nminor=0\npatch=18\nbranch=\"master\"\ntimestamp=1376526164.38"
},
{
"from": "gpt",
"value": "major = 0\nminor=0\npatch=19\nbranch=\"master\"\ntimestamp=13... | python | chosen |
[
{
"from": "system",
"value": "Make command-keyword compatible with DFW implementation\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nAn extension for a command-based keyword.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom Cauldron.types import Boolean, DispatcherKey... | python | chosen |
[
{
"from": "system",
"value": "Correct typing issues in string interp.\n\nSigned-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Debian Changes Bot\n# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.u... | python | chosen |
[
{
"from": "system",
"value": "Increase loglevel during test execution\n"
},
{
"from": "human",
"value": "# Copyright 2015 SAP SE.\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 a copy o... | python | chosen |
[
{
"from": "system",
"value": "Update email task test for members\n"
},
{
"from": "human",
"value": "from app.na_celery.email_tasks import send_emails\n\n\nclass WhenProcessingSendEmailsTask:\n\n def it_calls_send_email_to_task(self, mocker, db, db_session, sample_admin_user, sample_email):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the postcode form so that it's actually validating the input\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom django import forms\nfrom django.core.exceptions import ValidationError\n\nfrom candidates.... | python | chosen |
[
{
"from": "system",
"value": "Use the build in static() method instead of building a static URL manually\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright 2016, Digital Reasoning\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use t... | python | chosen |
[
{
"from": "system",
"value": "Change tabs with spaces. Sorry.\n"
},
{
"from": "human",
"value": "\n\nclass Params(object):\n\t'''\n The purpose of this class is for accesing params via dot notation.\n '''\n pass"
},
{
"from": "gpt",
"value": "\n\nclass Params(object):\n '... | python | chosen |
[
{
"from": "system",
"value": "Remove StringIO in favor of BytesIO.\n"
},
{
"from": "human",
"value": "\"\"\" Test the virtual IO system. \"\"\"\nfrom StringIO import StringIO\nimport sys\nimport os\n\nfrom mock import call\nfrom mock import patch\nimport pytest\n\nsys.path.append(os.path.join('.... | python | chosen |
[
{
"from": "system",
"value": "Update example for image stacking CSS instuction\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n====================================\nPlotting simple exponential function\n====================================\n\nA simple example of the plot of a... | python | chosen |
[
{
"from": "system",
"value": "Test framework fix - url replacing handles jenkins url with 'prefix'\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT\n# All rights reserved. This work is under a BSD license, see LICENSE.TXT.\n\nimport os, re\nfrom o... | python | chosen |
[
{
"from": "system",
"value": "Allow to set role while creating a person\n"
},
{
"from": "human",
"value": "from flask import abort\nfrom flask_restful import Resource, reqparse\nfrom flask_jwt_extended import jwt_required\n\nfrom zou.app.services import persons_service\nfrom zou.app.utils import... | python | chosen |
[
{
"from": "system",
"value": "Set prefix to static url patterm call\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfrom djang... | python | chosen |
[
{
"from": "system",
"value": "Add aiohttp.web.Application into type aliases\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright (c) 2017 Genome Research Ltd.\n\nAuthors:\n* Simon Beal <sb48@sanger.ac.uk>\n* Christopher Harrison <ch12@sanger.ac.uk>\n\nThis program is free software: you can redis... | python | chosen |
[
{
"from": "system",
"value": "Add a 'blacken/folders' configuration flag for blacken\n"
},
{
"from": "human",
"value": "\"\"\"\nShortcuts for common development check tasks\n\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom invoke import task\n\n@task(name='blacken', iterable=['folder'])... | python | chosen |
[
{
"from": "system",
"value": "Add privacy parameter to User.find_videos\n"
},
{
"from": "human",
"value": "from datetime import datetime\nimport time\nimport json\n\nfrom videolog.core import Videolog\n\nclass User(Videolog):\n def find_videos(self, user):\n content = self._make_reques... | python | chosen |
[
{
"from": "system",
"value": "Set Meta class model default on ContainerAdminForm\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django import forms\nfrom django.conf import settings\n\nfrom opps.db.models.fields.jsonf import JSONFormField\nfrom opps.field... | python | chosen |
[
{
"from": "system",
"value": "Update historical export with latest data model changes\n"
},
{
"from": "human",
"value": "\"\"\"\nClasses and functions for writing Host Records.\n\nHost Records are IndicatorRecords with a record type of \"HR.\"\n\"\"\"\nimport dateutil.parser\n\nfrom pivoteer.wri... | python | chosen |
[
{
"from": "system",
"value": "Use the existing class property job_class.\n"
},
{
"from": "human",
"value": "import rq\nimport redis\nimport django\n\nfrom django.conf import settings\n\n\nREDIS_CLIENT = redis.Redis(settings.REDIS_HOST, settings.REDIS_PORT, db=0)\n\n\nclass CustomJob(rq.job.Job):... | python | chosen |
[
{
"from": "system",
"value": "Set some fields as tranlate\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in root directory\n################... | python | chosen |
[
{
"from": "system",
"value": "Fix 'Labels' class in Python 3.\n\nIn Python 3, the attrs dict will already be an _EnumDict, which has a\nseparate list of member names (in Python 2, it is still a plain dict at this\npoint).\n"
},
{
"from": "human",
"value": "import inspect\nfrom django.utils.encod... | python | chosen |
[
{
"from": "system",
"value": "Increment patch version to 0.7.4\n"
},
{
"from": "human",
"value": "\"\"\"yolk.\n\nAuthor: Rob Cakebread <cakebread at gmail>\n\nLicense : BSD\n\n\"\"\"\n\n__version__ = '0.7.3'\n"
},
{
"from": "gpt",
"value": "\"\"\"yolk.\n\nAuthor: Rob Cakebread <cake... | python | chosen |
[
{
"from": "system",
"value": "Solve all test cases but 2\n"
},
{
"from": "human",
"value": "p = int(input().strip())\nfor a0 in range(p):\n n = int(input().strip())\n"
},
{
"from": "gpt",
"value": "from collections import deque\n\n\nclass Sieve(object):\n\n def __init__(self, u... | python | chosen |
[
{
"from": "system",
"value": "Add facade to mocked components\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\"\"\" Utility functions to help testing. \"\"\"\nfrom unittest.mock import Mock\n\n\nclass dummy(object):\n\n def __init__(self):\n self.components = {}\n\n def get(s... | python | chosen |
[
{
"from": "system",
"value": "Remove closed_at field from Task model\n"
},
{
"from": "human",
"value": "from mongoengine import Document, DateTimeField, EmailField, IntField, \\\n ReferenceField, StringField\nimport datetime, enum\n\nclass Priority(enum.IntEnum):\n LOW = 0,\n MIDDLE = ... | python | chosen |
[
{
"from": "human",
"value": "Add utility function for retrieving the active registration backend.\n"
},
{
"from": "gpt",
"value": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils.importlib import import_module\n\ndef get_backend():\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove some traces of this module's predecessor\n"
},
{
"from": "human",
"value": "from datetime import datetime\nimport unittest\n\nfrom normalize import (\n JsonCollectionProperty,\n JsonProperty,\n JsonRecord,\n Record,\n RecordList,\n)\n\n\nclass ... | python | chosen |
[
{
"from": "system",
"value": "Check minimum required version of ecCodes engine\n"
},
{
"from": "human",
"value": "from .gribapi import * # noqa\nfrom .gribapi import __version__\nfrom .gribapi import bindings_version\n"
},
{
"from": "gpt",
"value": "from .gribapi impor... | python | chosen |
[
{
"from": "system",
"value": "Fix failing test since switching to use bare dates and not full timestamps when appropriate\n"
},
{
"from": "human",
"value": "import unittest\nimport bill_info\nimport fixtures\n\nimport datetime\n\nclass BillHistory(unittest.TestCase):\n\n def test_normal_enacted... | python | chosen |
[
{
"from": "system",
"value": "Test for GitHub Paste reaction."
},
{
"from": "human",
"value": "#This is a test to see how GitHub will react when I change things from this webpage instead of as usual.\nprint \"Hello, world!\"\n"
},
{
"from": "gpt",
"value": "#This is a test to see how... | python | chosen |
[
{
"from": "system",
"value": "Add method to get waifu according user and sharing status.\n"
},
{
"from": "human",
"value": "from models.base_model import BaseModel\nfrom datetime import datetime\nfrom models.user_model import UserModel\nfrom peewee import CharField, TextField, DateTimeField, Int... | python | chosen |
[
{
"from": "system",
"value": "Test exact return value of flow_export.curl_command\n"
},
{
"from": "human",
"value": "import netlib.tutils\nfrom libmproxy import flow_export\nfrom . import tutils\n\nreq_get = netlib.tutils.treq(\n method='GET',\n headers=None,\n content=None,\n)\n\nreq_p... | python | chosen |
[
{
"from": "system",
"value": "Update snippet script to work with newlines.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# A hacky script to do dynamic snippets.\n\nimport sys\nimport os\nimport datetime\n\nsnippet_map = {\n 'date' : datetime.datetime.now().strftime('%b %d %G %I:%... | python | chosen |
[
{
"from": "system",
"value": "Allow searching restricted courses by key\n"
},
{
"from": "human",
"value": "\"\"\"\nDjango admin page for embargo models\n\"\"\"\nimport textwrap\n\nfrom config_models.admin import ConfigurationModelAdmin\nfrom django.contrib import admin\n\nfrom .forms import IPFi... | python | chosen |
[
{
"from": "system",
"value": "Fix problem lines in nmap parsing.\n"
},
{
"from": "human",
"value": "import pandas as pd\nimport logging, os\nimport IPy as IP\n\n\nlog = logging.getLogger(__name__)\n\n\ndf3 = pd.read_csv('nmap.tsv', delimiter='\\t')\ndf3.columns = ['host_and_fingerprint', 'port']... | python | chosen |
[
{
"from": "system",
"value": "Remove conditional import for py2 support\n"
},
{
"from": "human",
"value": "from contextlib import contextmanager\nimport sys\n\ntry:\n from StringIO import StringIO\nexcept ImportError:\n from io import StringIO\n\n\n@contextmanager\ndef captured_output():\n... | python | chosen |
[
{
"from": "system",
"value": "Add error message when wrong AWS Profile Name is given\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport boto3\n\n\ndef create_session(profile_name):\n if not profile_name:\n return boto3\n else:\n return boto3.Session(profile_na... | python | chosen |
[
{
"from": "system",
"value": "Fix off by 1000 error\n"
},
{
"from": "human",
"value": "from collections import defaultdict\nimport time\n\n\nTIMEOUTS = defaultdict(list)\n\n\ndef windows(*args, **kwargs):\n return []\n\n\ndef set_timeout(func, timeout, *args, **kwargs):\n then = time.time(... | python | chosen |
[
{
"from": "system",
"value": "Make use of root object and WebCore extensions.\n\nThe Wiki root object is now the root of the sample application and the\nfollowing extensions have been configured:\n\n- [`AnnotationExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/annotation.py)\n- [`DebugExt... | python | chosen |
[
{
"from": "system",
"value": "Use string.format for performance reasons\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django import template\nfrom django.core import urlresolvers\n\nfrom ..utils import get_app_instance\n\n\nregister = template.Library()\n\n\n@register.simple... | python | chosen |
[
{
"from": "system",
"value": "Update style to be consistent with project"
},
{
"from": "human",
"value": "from django.core.management import call_command\nfrom django.core.management.commands.syncdb import Command as SyncDBCommand\n\n\nclass Command(SyncDBCommand):\n def handle_noargs(self, *... | python | chosen |
[
{
"from": "system",
"value": "Test assumption, composition for RPC Java proofs\n"
},
{
"from": "human",
"value": "import unittest\nfrom pathlib import Path\n\nimport saw_client as saw\n\nfrom saw_client.jvm import Contract, java_int, cryptol\n\nclass Add(Contract):\n def __init__(self) -> Non... | python | chosen |
[
{
"from": "system",
"value": "Make outlook emit single files\n"
},
{
"from": "human",
"value": "import logging\nfrom followthemoney import model\n\nfrom ingestors.ingestor import Ingestor\nfrom ingestors.support.temp import TempFileSupport\nfrom ingestors.support.shell import ShellSupport\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add ability to query if a user is away\n"
},
{
"from": "human",
"value": "from tenyksservice import TenyksService, run_service\n\n\nclass AFK(TenyksService):\n direct_only = False\n irc_message_filters = {\n 'depart': [r'^(?i)(xopa|away|afk|brb)'],\n ... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Modify copy method into inherit\n"
},
{
"from": "human",
"value": "from openerp import models, fields, api\n\n'''\nThis module create model of Course\n'''\n\n\nclass Course(models.Model):\n '''\n This class create model of Course\n '''\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix : range output datas format validation\n"
},
{
"from": "human",
"value": "from .base import Client\n\n\nclass RangeIter(object):\n def __init__(self, range_datas):\n self._container = range_datas if self._valid_range(range_datas) else None\n\n def _... | python | chosen |
[
{
"from": "system",
"value": "Add Volume and Pitch methods\n"
},
{
"from": "human",
"value": "#import pygame.midi.Output\nfrom pygame.midi import Output\n\n\nclass Output(Output):#pygame.midi.Output):\n def set_pan(self, pan, channel):\n assert (0 <= channel <= 15)\n assert pan ... | python | chosen |
[
{
"from": "system",
"value": "Add `clowder diff` logic to Cement controller\n"
},
{
"from": "human",
"value": "from cement.ext.ext_argparse import expose\n\nfrom clowder.cli.abstract_base_controller import AbstractBaseController\n\n\nclass DiffController(AbstractBaseController):\n class Meta:... | python | chosen |
[
{
"from": "system",
"value": "Make request.POST be only json content when using expect_json\n"
},
{
"from": "human",
"value": "from functools import wraps\nimport copy\nimport json\n\n\ndef expect_json(view_function):\n \"\"\"\n View decorator for simplifying handing of requests that expec... | python | chosen |
[
{
"from": "system",
"value": "Startup: Make test room shorter for ease of testing\n"
},
{
"from": "human",
"value": "import sge\n\nfrom . import config\nfrom . import game\nfrom . import player\nfrom . import rooms\n\n\ndef initialize(config):\n \"\"\"Load assets and initialize the game objec... | python | chosen |
[
{
"from": "system",
"value": "Add todo item for handling extract_version errors better\n"
},
{
"from": "human",
"value": "import os\nimport re\n\n\nmigration_filter = re.compile('migration_[0-9]{14}.*')\n\n\ndef extract_version(name):\n try:\n version = int(name.split(\"_\")[1])\n ... | python | chosen |
[
{
"from": "system",
"value": "colors: Convert colors to rgb for putty.\n"
},
{
"from": "human",
"value": "\"\"\"\nExport colors in various formats.\n\"\"\"\nimport os\nimport pathlib\n\nfrom pywal.settings import CACHE_DIR, TEMPLATE_DIR\nfrom pywal import util\n\n\ndef template(colors, input_fil... | python | chosen |
[
{
"from": "system",
"value": "Add a line between outputs.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\nfrom __future__ import print_function\nimport os\nimport sys\nimport json\n\ndef pretty_print(equation):\n print(equation[\"description\"][\"terse\"])\n eqn_dict = equation[... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug in dynamic benchmark loading.\n\nperfkitbenchmarker/benchmarks/__init__.py used ImpImporter.load_module\nto import benchmarks, which caused an error when they were later\nimported directly by an import statement. Switched to 'importlib' to resolve.\n"
},
{
"fr... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Add domain or and ilike\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom openerp import fields, models\n\nclass Session(models.Model):\n _name = 'openacademy.session'\n\n name = fields.Char(required=True)\n start_date = fi... | python | chosen |
[
{
"from": "system",
"value": "Work on daemons and TCP servers.\n"
},
{
"from": "human",
"value": "# dmntest.py\n\nfrom .core import Daemon\n\nclass TestDmn(Daemon):\n pass\n\ndef main():\n td = TestDmn('testd')\n td.start()"
},
{
"from": "gpt",
"value": "# dmntest.py\n\n#fro... | python | chosen |
[
{
"from": "system",
"value": "Add a comment to custom yaml_safe_load() method.\n"
},
{
"from": "human",
"value": "# Copyright 2020 The StackStorm Authors.\n# Copyright 2019 Extreme Networks, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.