conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Order samples by date created of the newest Data\n" }, { "from": "human", "value": "from django.db.models import Q\n\nfrom rest_framework.decorators import list_route\nfrom rest_framework.response import Response\n\nfrom resolwe.flow.models import Collection\nfrom r...
python
chosen
[ { "from": "system", "value": "Set up test.py file and add skeleton for UserViewTests and RegistrationTests. Also add test to make sure user view exists\n" }, { "from": "human", "value": "import datetime\n\nfrom django.utils import timezone\nfrom django.test import TestCase\nfrom django.urls impo...
python
chosen
[ { "from": "system", "value": "Add error handling to VoteView\n" }, { "from": "human", "value": "import json\n\nfrom django.shortcuts import render, get_object_or_404, render_to_response\n\nfrom django.http import HttpResponse\nfrom django.views.generic import View\n\nfrom django.contrib.auth.dec...
python
chosen
[ { "from": "system", "value": "Add data to JobStep serializer\n" }, { "from": "human", "value": "from changes.api.serializer import Serializer, register\nfrom changes.models import JobStep\n\n\n@register(JobStep)\nclass JobStepSerializer(Serializer):\n def serialize(self, instance, attrs):\n ...
python
chosen
[ { "from": "system", "value": "Add the location of tests.\n" }, { "from": "human", "value": "import setuptools\n\nqu_ext = setuptools.Extension(\n 'quantuccia',\n include_dirs=['src/Quantuccia'],\n sources=['src/pyQuantuccia.cpp']\n)\n\nsetuptools.setup(\n name='pyQuantuccia',\n au...
python
chosen
[ { "from": "system", "value": "Simplify the help message for the -k/--api-key parameter.\n\nWe can use the '%(default)s' placeholder instead of string formatting.\n" }, { "from": "human", "value": "#\n# Project: retdec-python\n# Copyright: (c) 2015-2016 by Petr Zemek <s3rvac@gmail.com> and cont...
python
chosen
[ { "from": "system", "value": "Use in memory database for tests\n" }, { "from": "human", "value": "import os\n\n\nBASE_PATH = os.path.abspath(os.path.dirname(__file__))\nMEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))\n\nSECRET_KEY = 'not secret'\nINSTALLED_APPS = ('simpleimages',...
python
chosen
[ { "from": "system", "value": "Fix bug in generic script when running from checkout\n" }, { "from": "human", "value": "#!/usr/bin/python\nimport os\nimport sys\n\nmaybeRoot = os.path.dirname(os.path.dirname(__file__))\nif os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):\n sys.path.inser...
python
chosen
[ { "from": "system", "value": "Delete 'return' to refactor code\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nInterface to Redis-storage.\n\n@author: Seva Zhidkov\n@contact: zhidkovseva@gmail.com\n@license: The MIT license\n\nCopyright (C) 2015\n\"\"\"\nfrom .utils import ...
python
chosen
[ { "from": "system", "value": "captcha: Make ttf-bitstream-vera a managed package\n\nSigned-off-by: Joseph Nuthalpati <f3045f1a422c023fc6364ff0e3a18c260c53336e@thoughtworks.com>\nReviewed-by: James Valleroy <46e3063862880873c8617774e45d63de6172aab0@mailbox.org>\n" }, { "from": "human", "value": "...
python
chosen
[ { "from": "system", "value": "Check the server cert using matchesCertificate\n" }, { "from": "human", "value": "# -*- test-case-name: tlsep.test.test_scripts -*-\n# Copyright (c) Hynek Schlawack, Richard Wall\n# See LICENSE for details.\n\n\"\"\"\neg tlsep full.cert.getdnsapi.net 443 tcp\n\"\"\"...
python
chosen
[ { "from": "system", "value": "Use relative path location for mediawords.yml.\n" }, { "from": "human", "value": "#!/usr/bin/python\n \nimport yaml\n\ndef read_config():\n yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')\n config_file = yaml.load( yml_file )\n ...
python
chosen
[ { "from": "system", "value": "Test passes on my machine, dies on others. Skipping for now.\n\nr8830\n" }, { "from": "human", "value": "from options import *\n\ntest = { INPUT : 'catch_release.i',\n EXODIFF : ['catch_release_out.e']}\n\n" }, { "from": "gpt", "value": "from opt...
python
chosen
[ { "from": "system", "value": "Add loginerror blank to render call\n" }, { "from": "human", "value": "from amgut.handlers.base_handlers import BaseHandler\n\n\nclass FAQHandler(BaseHandler):\n def get(self):\n self.render('FAQ.html')\n" }, { "from": "gpt", "value": "from amg...
python
chosen
[ { "from": "system", "value": "Adjust K64F target file memory configuration to match K64F datasheet.\n" }, { "from": "human", "value": "\"\"\"\n mbed CMSIS-DAP debugger\n Copyright (c) 2006-2013 ARM Limited\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use th...
python
chosen
[ { "from": "system", "value": "BENCH: Make the pad benchmark pagefault in setup\n" }, { "from": "human", "value": "\"\"\"Benchmarks for `numpy.lib`.\"\"\"\n\n\nfrom __future__ import absolute_import, division, print_function\n\nfrom .common import Benchmark\n\nimport numpy as np\n\n\nclass Pad(Be...
python
chosen
[ { "from": "system", "value": "Remove line added by bad merge\n" }, { "from": "human", "value": "from xchainer._core import * # NOQA\n\n_global_context = Context()\nset_global_default_context(_global_context)\nset_default_device('native')\n" }, { "from": "gpt", "value": "from xchaine...
python
chosen
[ { "from": "system", "value": "Add timezone support to timestamp helper methods\n" }, { "from": "human", "value": "import datetime\n\n\ndef to_ticks(dt):\n \"\"\"Converts a timestamp to ticks\"\"\"\n return (dt - datetime.datetime(1970, 1, 1)).total_seconds()\n\n\ndef ticks_to_timestamp(tic...
python
chosen
[ { "from": "system", "value": "Fix tutorial zombie faction issue (co8)\n" }, { "from": "human", "value": "from toee import *\nfrom combat_standard_routines import *\nfrom utilities import *\n\ndef san_heartbeat( attachee, triggerer ):\n\tfor obj in game.obj_list_vicinity(attachee.location,OLC_PC)...
python
chosen
[ { "from": "system", "value": "Fix capital O missing umlaut" }, { "from": "human", "value": "# coding=utf-8\nfrom __future__ import unicode_literals\nfrom ..internet import Provider as InternetProvider\n\nimport re\n\n\nclass Provider(InternetProvider):\n\n free_email_domains = (\n 'web...
python
chosen
[ { "from": "system", "value": "Throw a ValueError if we get a non-JID for the JID\n" }, { "from": "human", "value": "import os\nimport json\nimport datetime\nfrom pupa.core import db\nfrom pupa.models import Organization\nfrom pupa.models.utils import DatetimeValidator\nfrom pupa.models.schemas.j...
python
chosen
[ { "from": "system", "value": "Drop our own get_int() function\n\nWe don't need a custom function to get an int parameter;\nflask/werkzeug already handles this.\n" }, { "from": "human", "value": "from flask import request\nimport saliweb.frontend\nimport collections\n\nTransform = collections.nam...
python
chosen
[ { "from": "system", "value": "Use argparse (instead of getopt) to get the usage information\n" }, { "from": "human", "value": "# This Python file uses the following encoding: utf-8\n\nimport sys\nimport getopt\nimport Convert\n\n\ndef usage():\n\tprint \"Usage: to be done.\"\n\ndef main(argv):\n...
python
chosen
[ { "from": "system", "value": "Convert item processing to pipeline module\n" }, { "from": "human", "value": "# Define your item pipelines here\n#\n# Don't forget to add your pipeline to the ITEM_PIPELINES setting\n# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html\n\nclass DatasetPi...
python
chosen
[ { "from": "system", "value": "Add DataDog monitoring to cron job runs\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\nfrom optparse import OptionParser\n\n\nTEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()\n\n\ndef main():\n parser = OptionPa...
python
chosen
[ { "from": "system", "value": "Use tracks 1-3 instead of 0-2, to make room for reserved track\n" }, { "from": "human", "value": "from s4ils import *\n\ns = Session()\n\nwith s[INIT]:\n s.engine = c.Engine() | s\n s.fm = s.engine.new_module(rv.m.Fm) | s\n s.engine.output << s.fm | s\n ...
python
chosen
[ { "from": "system", "value": "Remove all relative imports. We have always been at war with relative imports.\n\ngit-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@17009 bcc190cf-cafb-0310-a4f2-bffc1f526a37\n" }, { "from": "human", "value": "\"\"\"\nUK-specific Form helpers\n\"\"\"\n\nfrom dja...
python
chosen
[ { "from": "system", "value": "Load image processing tasks on startup\n" }, { "from": "human", "value": "from django.apps import AppConfig\n\n\nclass ProposalConfig(AppConfig):\n name = \"proposal\"\n\n def ready(self):\n # Register tasks with Celery:\n from . import tasks\n ...
python
chosen
[ { "from": "system", "value": "Change the redis returner to better use data structures\n" }, { "from": "human", "value": "'''\nReturn data to a redis server\nThis is a VERY simple example for pushing data to a redis server and is not\nnessisarily intended as a usable interface.\n'''\n\nimport red...
python
chosen
[ { "from": "system", "value": "Make the regex work on Python2.x\n" }, { "from": "human", "value": "import sublime\nimport sublime_plugin\nimport re\n\n\nclass CopyFromFindInFilesCommand(sublime_plugin.TextCommand):\n def run(self, edit, force=False):\n self.view.run_command('copy')\n\n ...
python
chosen
[ { "from": "system", "value": "config: Fix loading of default config values\n\nIf RawConfigParser is not able to find config\nusing get(), it doesn't return None, instead\nit raises an Exception.\n\nSigned-off-by: Vivek Anand <6cbec6cb1b0c30c91d3fca6c61ddeb9b64cef11c@gmail.com>\n" }, { "from": "human...
python
chosen
[ { "from": "system", "value": "FIX: Test needs to wait until the header values are updated after it changed the template\n\nI'm not sure how this previously has ever passed, to be honest.\n" }, { "from": "human", "value": "import zeit.content.article.edit.browser.testing\n\n\nclass HeaderModules(...
python
chosen
[ { "from": "system", "value": "Change unittest test in test suite : it is not run in module __main__\n" }, { "from": "human", "value": "import unittest\n\nclass IntegerArithmenticTestCase(unittest.TestCase):\n def testAdd(self): ## test method names begin 'test*'\n self.assertEqual((1 ...
python
chosen
[ { "from": "system", "value": "Make HTTP server fixture bind to an ephemeral port\n" }, { "from": "human", "value": "import threading\nimport time\n\nimport pytest\n\nimport cheroot.server\nimport cheroot.wsgi\n\n\nconfig = {\n 'bind_addr': ('127.0.0.1', 54583),\n 'wsgi_app': None,\n}\n\n\n...
python
chosen
[ { "from": "system", "value": "Add convenience function to start docker\n\nMainly to be used from supervisor." }, { "from": "human", "value": "import os\nimport subprocess\n\nimport docker_utils\nimport jinja2\nenv = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))\n\n\ndef supervi...
python
chosen
[ { "from": "human", "value": "Add fetching function for craddock 2012 experiment\n" }, { "from": "gpt", "value": "import os\nfrom nilearn.datasets import _get_dataset, _fetch_dataset\nfrom sklearn.datasets.base import Bunch\n\n\ndef fetch_craddock_2012_test(n_subjects=None, data_dir=None, resume=...
python
chosen
[ { "from": "system", "value": "Update : don't forget *args, **kwargs in bench_case methods\n" }, { "from": "human", "value": "import random\n\nimport hurdles\n\n\nclass BenchRandom(hurdles.BenchCase):\n def bench_this(self):\n return [random.randint(1, 100000) for x in [0] * 100000]\n\n...
python
chosen
[ { "from": "system", "value": "fix: Remove going back a directory for properties\n\nSee also: PSOBAT-1197\n" }, { "from": "human", "value": "\"\"\"Create Spinnaker Pipeline.\"\"\"\nimport argparse\nimport logging\n\nfrom ..args import add_debug\nfrom ..consts import LOGGING_FORMAT\nfrom .create_p...
python
chosen
[ { "from": "system", "value": "Add fixme for future revision\n" }, { "from": "human", "value": "\"\"\"\nURLCONF for the user accounts app (part 2/2).\n\"\"\"\n\nfrom django.conf.urls import url, include\nfrom django.contrib.auth import views as auth_views\n\nfrom . import views\n\n\n# User accoun...
python
chosen
[ { "from": "system", "value": "Fix the gc_content bug to get a clean Travis report.\n" }, { "from": "human", "value": "#!/usr/bin/env python2\n\ndef reverse(seq):\n return seq[::-1]\n\ndef complement(seq):\n from string import maketrans\n complements = maketrans('ACTGactg', 'TGACtgac')\n...
python
chosen
[ { "from": "system", "value": "Handle the situation where a SphinxModel is related to a non-sphinx model.\n" }, { "from": "human", "value": "from django.db import models\nfrom django.db.models.sql import Query\nfrom django.db.models.query import QuerySet\nfrom django_sphinx_db.backend.sphinx.comp...
python
chosen
[ { "from": "system", "value": "Add setup_logging during sktracker init\n" }, { "from": "human", "value": "\"\"\"Object detection and tracking for cell biology\n\n`scikit-learn` is bla bla bla.\n\nSubpackages\n-----------\ncolor\n Color space conversion.\n\n\"\"\"\n\ntry:\n from .version imp...
python
chosen
[ { "from": "system", "value": "Add support for nested lists in the excel renderer\n" }, { "from": "human", "value": "import xlsxwriter\nimport os\nfrom django.conf import settings\n\n\nfrom rest_framework import renderers\n\n\ndef _write_excel_file(data):\n result = data.get('results')\n ...
python
chosen
[ { "from": "system", "value": "Split Index view to AuthenticatedIndex view and NotAuthenticatedIndex view.\n" }, { "from": "human", "value": "from django.views.generic import TemplateView\n\nfrom commits.forms import RepositoryForm\nfrom commits.models import Repository, Commit\nfrom social.model...
python
chosen
[ { "from": "system", "value": "Make `is_authenticated` a property access rather than a function call.\n\nThis is a change in Django that was still functional for compatibility\nreasons until recently, but ultimately should be an attribute.\n" }, { "from": "human", "value": "from django.conf impor...
python
chosen
[ { "from": "system", "value": "Add cirectoy switch on loading\n" }, { "from": "human", "value": "from dogebuild.plugins import ContextHolder\nfrom dogebuild.common import DOGE_FILE\n\n\ndef load_doge_file(filename):\n with open(filename) as f:\n code = compile(f.read(), DOGE_FILE, 'exec...
python
chosen
[ { "from": "system", "value": "Fix course id separator at export all courses command\n" }, { "from": "human", "value": "\"\"\"\nScript for exporting all courseware from Mongo to a directory\n\"\"\"\nfrom django.core.management.base import BaseCommand, CommandError\nfrom xmodule.modulestore.xml_ex...
python
chosen
[ { "from": "system", "value": "Remove Context.get method and add docstrings\n" }, { "from": "human", "value": "class ContextPopException(Exception):\n pass\n\n\nclass Context(object):\n\n def __init__(self):\n self.dicts = [{}]\n\n def push(self):\n d = {}\n self.dic...
python
chosen
[ { "from": "system", "value": "Work around for watchdog problem on OS X.\n" }, { "from": "human", "value": "from watchdog.observers import Observer\nfrom watchdog.events import FileSystemEventHandler\nimport os\nimport time\n\n\nclass MyEventHandler(FileSystemEventHandler):\n\n def __init__(se...
python
chosen
[ { "from": "system", "value": "Remove leftover imports from testing" }, { "from": "human", "value": "import os\n\nfrom cs251tk.student import remove\nfrom cs251tk.student import clone_student\nfrom cs251tk.student import stash\nfrom cs251tk.student import pull\nfrom cs251tk.student import checkou...
python
chosen
[ { "from": "system", "value": "Add docstrings to generators' init file\n\n" }, { "from": "human", "value": "from .cubic import cubic\nfrom .delaunay import delaunay\nfrom .gabriel import gabriel\nfrom .voronoi import voronoi\nfrom .voronoi_delaunay_dual import voronoi_delaunay_dual\nfrom .templat...
python
chosen
[ { "from": "system", "value": "Clean up email notification message\n" }, { "from": "human", "value": "import smtplib\nfrom email.mime.text import MIMEText\n\ndef send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):\n\n mail_from = \"Inferno Daemon <inferno@loc...
python
chosen
[ { "from": "system", "value": "Fix plural form of Registry\n\nTIL how to use meta class\n" }, { "from": "human", "value": "from django.db import models\n\nclass Project(models.Model):\n project_name = models.CharField(max_length=200)\n playbook_path = models.CharField(max_length=200, defaul...
python
chosen
[ { "from": "system", "value": "api: Fix need to manually update list of integrations.\n\n(imported from commit 6842230f939483d32acb023ad38c53cb627df149)\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport humbug\n\nimport glob\nfrom distutils.core import se...
python
chosen
[ { "from": "system", "value": "[IMP] Remove 'author' and 'website' on odoo modules' manisfest\n\nAnd use the default values :\n- author : 'Odoo S.A.'\n- website: https://www.odoo.com/\n" }, { "from": "human", "value": "{\n 'name': 'Website Portal',\n 'category': 'Website',\n 'summary': '...
python
chosen
[ { "from": "system", "value": "Fix YUI arg passing, had CSS/JS flipped\n" }, { "from": "human", "value": "import subprocess\n\nfrom compress.conf import settings\nfrom compress.filter_base import FilterBase, FilterError\n\nclass YUICompressorFilter(FilterBase):\n\n def filter_common(self, cont...
python
chosen
[ { "from": "system", "value": "feat: Add pagination to build index\n" }, { "from": "human", "value": "from sqlalchemy.orm import joinedload, subqueryload_all\n\nfrom zeus import auth\nfrom zeus.models import Build\n\nfrom .base import Resource\nfrom ..schemas import BuildSchema\n\nbuilds_schema =...
python
chosen
[ { "from": "system", "value": "Use simplefilter('always') for testing the warning\n\n* Use `warnings.simplefilter('always')` for DeprecationWarning\n* More specific test on warning message\n" }, { "from": "human", "value": "# Copyright (c) Jupyter Development Team.\n# Distributed under the terms ...
python
chosen
[ { "from": "system", "value": "Use background queue for creating user cases\n" }, { "from": "human", "value": "from celery.task import task\nfrom corehq.apps.users.models import CommCareUser\n\n\n@task\ndef create_user_cases(domain_name):\n from corehq.apps.callcenter.utils import sync_usercas...
python
chosen
[ { "from": "system", "value": "Update to include typing, cleanup docstrings and code\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\"\"\"\nThe pamqp.body module contains the Body class which is used when\nunmarshaling body frames. When dealing with content frames, the message body...
python
chosen
[ { "from": "system", "value": "Clean up dir after move\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Parse source tree, get old files and move files info a new folder tree\"\"\"\n\nimport KmdCmd\nimport KmdFiles\nimport os\nimport re\nimport logging\n\nc...
python
chosen
[ { "from": "system", "value": "Fix confusing import (no change in functionality)" }, { "from": "human", "value": "\"\"\"\nExtend the Python Grammar\n==============================\n\nThis example demonstrates how to use the `%extend` statement,\nto add new syntax to the example Python grammar.\n\...
python
chosen
[ { "from": "system", "value": "Fix mapping for codon keys for Serine\n" }, { "from": "human", "value": "# Codon | Protein\n# :--- | :---\n# AUG | Methionine\n# UUU, UUC | Phenylalanine\n# UUA, UUG | Leucine\n# UCU, UCC, ...
python
chosen
[ { "from": "system", "value": "Fix config api class again\n" }, { "from": "human", "value": "from ..cw_controller import CWController\r\n# Class for /company/configurations\r\nfrom connectpyse.company import configuration\r\n\r\n\r\nclass ConfigurationsAPI(CWController):\r\n def __init__(self)...
python
chosen
[ { "from": "system", "value": "Add global method to convert binary string to plain string\n\n* wqflask/utility/db_tools.py: escape_string returns a binary string which\nintroduces a bug when composing sql query string. The escaped strings have to be\nconverted to plain text.\n" }, { "from": "human", ...
python
chosen
[ { "from": "system", "value": "FIX bug in event creation\n" }, { "from": "human", "value": "##############################################################################\n#\n# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)\n# Releasing children from poverty in Jesus' name\n# ...
python
chosen
[ { "from": "system", "value": "Raise exception on invalid URL\n" }, { "from": "human", "value": "import re\n\nfrom mongoengine import *\nimport urlnorm\n\nfrom core.datatypes import Element\nfrom core.helpers import is_url\n\nclass Url(Element):\n\n def clean(self):\n \"\"\"Ensures that...
python
chosen
[ { "from": "system", "value": "Add some more text used in migrations which need translation\n" }, { "from": "human", "value": "# This module exists just to list strings for translation to be picked\n# up by makemessages.\n\nfrom __future__ import unicode_literals\n\nfrom django.utils.translation ...
python
chosen
[ { "from": "system", "value": "[fix] Update project cost for draft project only\n" }, { "from": "human", "value": "# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors\n# License: GNU General Public License v3. See license.txt\n\nfrom __future__ import unicode_literals\nimport ...
python
chosen
[ { "from": "system", "value": "Use related_name to avoid \"missing\" security\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>\n" }, { "from": "human", "value": "from rest_framework import serializers, viewsets\nfrom rest_framework.response import Response\...
python
chosen
[ { "from": "system", "value": "Allow loading events from dump\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport json\n\nfrom intelmq.lib import utils\nfrom intelmq.lib.bot import ParserBot\n\n\nclass CZNICProkiParserBot(ParserBot):\n\n recover_line = ParserBot.recover_line_jso...
python
chosen
[ { "from": "system", "value": "Fix type check of column elements\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nfrom suit_dashboard.box import Box\n\n\nclass Grid(object):\n def __init__(self, *rows, **kwargs):\n if not all([isinst...
python
chosen
[ { "from": "system", "value": "Update extensions and GameController subclass\n" }, { "from": "human", "value": "from python_cowbull_game.GameController import GameController\nfrom python_cowbull_game.GameMode import GameMode\n\n\nclass ExtGameController(GameController):\n additional_modes = [\...
python
chosen
[ { "from": "system", "value": "Correct syntax while creating indexes\n\nChange-Id: I90625647d8723531dbc7498d5d25e84ef1a3ed2b\nReviewed-on: http://review.couchbase.org/50007\nTested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>\nReviewed-by: Michael Wiederhold <a17fed27eaa842282862ff7c...
python
chosen
[ { "from": "system", "value": "Fix comment after dropping the pytz dependency.\n" }, { "from": "human", "value": "\"\"\"\n@author: Bryan Silverthorn <bcs@cargo-cult.org>\n\"\"\"\n\nfrom datetime import tzinfo\n\nclass UTC(tzinfo):\n \"\"\"\n The one true time zone.\n \"\"\"\n\n def ut...
python
chosen
[ { "from": "system", "value": "Make context output behavior overridable\n" }, { "from": "human", "value": "from .settings import env\n\n\nclass AutoAPIBase(object):\n\n language = 'base'\n type = 'base'\n\n def __init__(self, obj):\n self.obj = obj\n\n\n def render(self, ctx=No...
python
chosen
[ { "from": "system", "value": "Fix bugs in item and user knn\n" }, { "from": "human", "value": "from distutils.core import setup\nfrom setuptools import find_packages\n\n__author__ = \"Arthur Fortes\"\n\nsetup(\n name='CaseRecommender',\n packages=find_packages(),\n version='0.0.11',\n ...
python
chosen
[ { "from": "system", "value": "Update GitHub repos from blancltd to developersociety\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import find_packages, setup\n\n\ninstall_requires = [\n 'Django>=1.8,<1.10',\n 'django-mptt>=0.7',\n 'django-mptt-admin>=0.3',\n ...
python
chosen
[ { "from": "system", "value": "Fix rasterio to version 0.36.0 now that 1.0 is out\n\nThere are some incompatibilities between the two. Until I can go to NHM\nto upgrade their setup, I'll pin it to the old version.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\n...
python
chosen
[ { "from": "system", "value": "Use utcfromtimestamp instead of fromtimestamp on Message\n" }, { "from": "human", "value": "import os\nfrom datetime import datetime\n\nfrom jinja2 import Environment, FileSystemLoader, select_autoescape\n\nfrom bottery.conf import settings\n\n\nclass Message:\n ...
python
chosen
[ { "from": "system", "value": "Add version number to reflect orderedict bug\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom distutils.core import setup\n\nsetup(name='Pipeless',\n version='1.0',\n description='Simple pipelines building framework.',\n long_description...
python
chosen
[ { "from": "system", "value": "Update classifiers through Python 3.6" }, { "from": "human", "value": "import codecs\nimport os\nimport re\nfrom setuptools import setup, find_packages\n\nwith open('README.rst') as f:\n readme = f.read()\n\n\ndef read(*parts):\n here = os.path.abspath(os.path...
python
chosen
[ { "from": "system", "value": "Bump minimal Django version in install_requires.\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-env...
python
chosen
[ { "from": "system", "value": "Patch from Chuck Thier to properly install subpackages (eventlet.hubs and eventlet.support) now that we have subpackages\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(\n name='eventlet',\n version='0.2',\n ...
python
chosen
[ { "from": "system", "value": "Add matplotlib to runtime dependencies.\n" }, { "from": "human", "value": "from setuptools import setup\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__))\nwith open(path.join(here, 'README.rst')) as readme_file:\n long_description = readme_file....
python
chosen
[ { "from": "system", "value": "Add PermissionsLogging for log files.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(name='SpaceScout-Web',\n version='1.0',\n description='Web frontend for SpaceScout',\n install_requires=[\n ...
python
chosen
[ { "from": "system", "value": "Fix URL to point to a valid repo\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup, find_packages\n\nsetup(name='Coffin',\n version=\".\".join(map(str, __import__(\"coffin\").__version__)),\n description='Jinja2 adapter for Django',\n ...
python
chosen
[ { "from": "system", "value": "Update the PyPI version to 7.0.11.\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": "Read the README file with UTF-8 encoding.\n\nThis commit fixes an install issue in Python 3.5 where the read() function raises an encoding error. It uses\nthe open function from the io module so that the code will be compatible with both Python 2 and 3.\n" }, { "from": ...
python
chosen
[ { "from": "system", "value": "Make test dependencies more explicit\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\n\nfrom setuptools import setup\n\nroot = os.path.abspath(os.path.dirname(__file__))\n\nversion = __import__('swf').__version__\n\nwit...
python
chosen
[ { "from": "system", "value": "Use the official notation of the Django package\n\nEven if pypi is case insensitive, all other packages include django with an uppercase D.\r\nThis package using lowercase will lead to uninstalls/reinstalls when using pip-compile and other tools.\r\nPlease accept the change to ...
python
chosen
[ { "from": "system", "value": "Change url to point to tagged release\n" }, { "from": "human", "value": "\"\"\"Setup for pymd5 module and command-line script.\"\"\"\nfrom setuptools import setup\n\ndef readme():\n \"\"\"Use text contained in README.rst as long description.\"\"\"\n with open(...
python
chosen
[ { "from": "system", "value": "Correct some Python package metadata\n" }, { "from": "human", "value": "from setuptools import find_packages, setup\n\nsetup(\n name='isic-discourse-sso',\n version='1.0.0',\n description='Girder plugin for a Discourse Single-Sign-On provider.',\n url='h...
python
chosen
[ { "from": "system", "value": "Remove scipy and numpy deps\n" }, { "from": "human", "value": "from setuptools import setup\nfrom codecs import open\nfrom os import path\n\n\n# Open up settings\nhere = path.abspath(path.dirname(__file__))\n\nabout = {}\n\nwith open(path.join(here, \"README.rst\"),...
python
chosen
[ { "from": "system", "value": "Tag version 0.5 with bytes/text fix\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# coding: utf-8\n\nfrom setuptools import setup\n\nsetup(\n name='requests-jwt',\n version='0.4',\n url='https://github.com/tgs/requests-jwt',\n modules=['reque...
python
chosen
[ { "from": "system", "value": "Update aiohttp version constraint to <3.5" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\n__name__ == '__main__' and setup(name='aiohttp-json-rpc',\n version='0.11.1',\n auth...
python
chosen
[ { "from": "system", "value": "Change package version to 0.5.0\n" }, { "from": "human", "value": "#!/usr/bin/env python\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nrequirements = [\n]\n\ntest_requirements = [\n]\n\nsetup(\n name='adb_an...
python
chosen
[ { "from": "system", "value": "Fix another problem where package data was not included\n" }, { "from": "human", "value": "import sys\n\nfrom chandra_aca import __version__\n\nfrom setuptools import setup\nfrom setuptools.command.test import test as TestCommand\n\n\nclass PyTest(TestCommand):\n ...
python
chosen
[ { "from": "system", "value": "Add python 3 compatibility in pip install\n" }, { "from": "human", "value": "from os.path import dirname, abspath, join, exists\nfrom setuptools import setup\n\nlong_description = None\nif exists(\"README.md\"):\n long_description = open(\"README.md\").read()\n\n...
python
chosen
[ { "from": "system", "value": "Add URLs to redirect to home_page\n\nAlso refine some other URLs, so that, for example, layers/blah will result in a 404.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nfrom...
python
chosen