conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Add cached_property as a requirement.\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nfrom setuptools import find_packages\n\nsetup(\n name='katagawa',\n version='0.1.0',\n packages=find_packages(),\n url='https://github.com/SunDwa... | python | chosen |
[
{
"from": "system",
"value": "Add trove classifier for Python 3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(\n name='dbtools',\n version=open(\"VERSION.txt\").read().strip(),\n description='Lightweight SQLite interface',\n aut... | python | chosen |
[
{
"from": "system",
"value": "Update maintainer to Blanc Ltd\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) for v... | python | chosen |
[
{
"from": "system",
"value": "Use open instead of file.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf8 -*-\nfrom setuptools import setup, find_packages\n\nimport os\n\nsetup(\n name = \"django-prefetch\",\n version = \"0.1.1\",\n url = 'https://github.com/ionelmc/django-prefetc... | python | chosen |
[
{
"from": "system",
"value": "Read the __version__ from whichpkg directly\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nwhichpkg\n========\nLocate the path of a specific python module\n\"\"\"\n\nfrom setuptools import setup\n\nsetup(\n name='whichpkg',\n version='0.3.0'... | python | chosen |
[
{
"from": "system",
"value": "Add catch for Travis CI testing.\n"
},
{
"from": "human",
"value": "__all__ = [\n 'test',\n]\n\ndef test():\n \"\"\"\n @desc: This is a convienance method to run all of the tests in `PVGeo`.\n\n @notes:\n This can be executed from either the command l... | python | chosen |
[
{
"from": "system",
"value": "Increment version to reflect change\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\n\nsetup(\n name = \"tagman\",\n version = \"0.1.8\",\n author = \"ReThought Ltd\",\n author_email = \"matthew@retho... | python | chosen |
[
{
"from": "system",
"value": "Use a custom version of the requests package to default to SSLv3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\ntempodb/setup.py\n\nCopyright (c) 2012 TempoDB Inc. All rights reserved.\n\"\"\"\n\nimport os\nfrom setuptools impor... | python | chosen |
[
{
"from": "system",
"value": "chore: Use m2r to convert the changelog to rst\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\nimport sys\n\n\ndef read(filename):\n return open(os.path.join(os.path.dirname(__file__), filename)).read()\n\n\nversion_dependant_requireme... | python | chosen |
[
{
"from": "system",
"value": "Bump version to 0.0.3 for pip.\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport os\n\nsetup(\n name = \"conduit\",\n version = \"0.0.2\",\n author = \"Steve Leibman\",\n author_email = \"sleibman@alum.mit.edu\",\n description = ... | python | chosen |
[
{
"from": "system",
"value": "Create a test for Account creation\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom rest_framework.test import APITestCase\nfrom rest_framework import status\nimport factory\nimport json\nfrom .models import BaseAccount\nfrom .se... | python | chosen |
[
{
"from": "system",
"value": "Allow to filter invoices by date [WAL-2340]\n"
},
{
"from": "human",
"value": "import django_filters\nfrom waldur_core.core import filters as core_filters\n\nfrom . import models\n\n\nclass InvoiceFilter(django_filters.FilterSet):\n customer = core_filters.URLFil... | python | chosen |
[
{
"from": "system",
"value": "Raise a more specific exception when the source root cannot be found.\n"
},
{
"from": "human",
"value": "# Copyright 2017 The Chromium Authors.\n#\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file or at\n# https:/... | python | chosen |
[
{
"from": "system",
"value": "Update chatroom view to process new messages\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.http import HttpResponse, Http404\nfrom .models import Message\nfrom django.contrib.auth.decorators import login_required\n\n# Create you... | python | chosen |
[
{
"from": "system",
"value": "Fix test data plotting to use the changed interfaces"
},
{
"from": "human",
"value": "\r\nimport zephyr.util\r\nfrom zephyr.collector import MeasurementCollector\r\nfrom zephyr.bioharness import BioHarnessSignalAnalysis, BioHarnessPacketHandler\r\nfrom zephyr.messag... | python | chosen |
[
{
"from": "system",
"value": "Update tests to remove completion blocks\n"
},
{
"from": "human",
"value": "import unittest\n\nimport httpretty\n\nfrom fbmsgbot.http_client import HttpClient\nfrom fbmsgbot.resources.urls import FACEBOOK_MESSAGES_POST_URL\n\n\nclass TestHttpClient(unittest.TestCase... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary cruft from Bookmark.infer_dataset\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models\nfrom django.utils import timezone\nfrom morango.models import UUIDField\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add more tests to the local process integration test\n"
},
{
"from": "human",
"value": "from twisted.trial.unittest import TestCase\nfrom carnifex.localprocess import LocalProcessInductor\nfrom twisted.internet import reactor\n\n\nclass InductorTest(TestCase):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add dossier title to API\n"
},
{
"from": "human",
"value": "from rest_framework import serializers, viewsets\n\nfrom document.models import Document, Kamerstuk, Dossier\n\n\nclass DossierSerializer(serializers.HyperlinkedModelSerializer):\n documents = serializer... | python | chosen |
[
{
"from": "system",
"value": "Create test for console output.\n"
},
{
"from": "human",
"value": "\"\"\"Test suite for Mann.\"\"\"\n# -*- coding: utf-8 -*-\nimport unittest\nfrom colour_runner import runner as crunner\n# from mypleasure.mann import Mann\n\n\nclass ConsoleTestCase(unittest.TestCas... | python | chosen |
[
{
"from": "system",
"value": "Update AWS::CodeGuruProfiler::ProfilingGroup per 2020-06-03 changes\n"
},
{
"from": "human",
"value": "# Copyright (c) 2020, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject\n\n\nclass ProfilingGro... | python | chosen |
[
{
"from": "system",
"value": "Define function for getting setting value by key\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\nfrom .models import SiteSetting\n\n\ndef get_site_settings(request):\n if not hasattr(request, 'site_settings'):\n site_settings_id = ge... | python | chosen |
[
{
"from": "system",
"value": "Add rotation of CSRF token to prevent form resubmission\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, HttpResponse\nfrom django.shortcuts import HttpResponseRedirect\nfrom django.template import Context, Template\n\nfrom models import Uploa... | python | chosen |
[
{
"from": "system",
"value": "Make work with any filesystem\n"
},
{
"from": "human",
"value": "from .base import DataSourceMixin\n\n\nclass ZarrSource(DataSourceMixin):\n \"\"\"Open a xarray dataset.\n\n Parameters\n ----------\n urlpath: str\n Path to source. This can be a lo... | python | chosen |
[
{
"from": "system",
"value": "Make urlencode load properly in python 3.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# encoding: utf-8\n\nfrom __future__ import absolute_import\n\nimport urllib\nfrom .base import AuthenticationMixinBase\nfrom . import GrantFailed\n\ntry:\n bases... | python | chosen |
[
{
"from": "system",
"value": "Fix tests to match updated defs.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_templatetags\n-------------------\n\nTests for `columns.templatetags` module.\n\"\"\"\n\nimport unittest\n\nfrom columns.templatetags.c... | python | chosen |
[
{
"from": "system",
"value": "Use new column for score.\n"
},
{
"from": "human",
"value": "import sqlite3\n\ndef main():\n conn = sqlite3.connect(\"database\")\n cursor = conn.cursor()\n # I claim this gives the current score. Another formulation is\n # select trackid, score, max(sco... | python | chosen |
[
{
"from": "system",
"value": "Remove the allocation of a variable in make_course_path\n"
},
{
"from": "human",
"value": "details_source = './source/details/'\nxml_source = './source/raw_xml/'\nterm_dest = './courses/terms/'\ncourse_dest = './source/courses/'\ninfo_path = './cour... | python | chosen |
[
{
"from": "system",
"value": "Make import mock.Mock or unittest.mock.Mock easier\n"
},
{
"from": "human",
"value": "import sys\n\nif sys.version_info[:2] < (2, 7):\n import unittest2 as unittest\nelse:\n import unittest\n"
},
{
"from": "gpt",
"value": "import sys\n\nif sys.vers... | python | chosen |
[
{
"from": "system",
"value": "Set the `self.user` property on the `AuthorshipFormMixin`.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\n\n\nclass AuthorshipFormMixin(object):\n \"\"\"Set the ``created_by`` and ``updated_by... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in unit test\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n#------------------------------------------------------------------------\n# Copyright (c) 2015 SGW\n#\n# Distributed under the terms of the New BSD License.\n#\n# The full License is i... | python | chosen |
[
{
"from": "system",
"value": "Declare subclass of `UploadType` to be `str`\n\n* Fixes issues with JSON serializing\n* Revert `__repr__` string format changes as the newlines created large gaps of whitespace"
},
{
"from": "human",
"value": "import enum\n\nfrom sqlalchemy import Column, String, Bo... | python | chosen |
[
{
"from": "system",
"value": "Write access to new output file\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport re\nimport subprocess\n\ndef lemmatize( text ):\n\n text = text.encode('utf8')\n text = re.sub( '[\\.,?!:;]' , '' , text )\n\n out = subprocess.check_output( 'm... | python | chosen |
[
{
"from": "system",
"value": "Fix default_app_config problem with Django >= 3.20\n"
},
{
"from": "human",
"value": "version_info = (0, 8, 11, 6)\n\n__version__ = version = '.'.join(map(str, version_info))\n__project__ = PROJECT = 'django-summernote'\n__author__ = AUTHOR = \"django-summernote con... | python | chosen |
[
{
"from": "system",
"value": "Use 'wraps' from 'functools', to keep wrapped function's docstring, name and attributes.\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n'''\nDecorators for using specific routing state for particular requests.\nUsed in cases when automatic switching base... | python | chosen |
[
{
"from": "system",
"value": "Update database backends analyzer to target 1.5\n"
},
{
"from": "human",
"value": "import ast\n\nfrom .base import BaseAnalyzer, Result\n\n\nclass DB_BackendsVisitor(ast.NodeVisitor):\n\n def __init__(self):\n self.found = []\n\n deprecated_items = {\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix reference to wall factory\n"
},
{
"from": "human",
"value": "from django.contrib.auth import get_user_model\nfrom factory import DjangoModelFactory, CREATE_STRATEGY, LazyAttribute, PostGeneration, SubFactory\nfrom yunity.base.factories import Wall\nfrom yunity.u... | python | chosen |
[
{
"from": "system",
"value": "Call django.setup() from zappa only for django < 1.7.0\n\n* because since django 1.7 it leads to double initialization, which is problematic on some installations\n"
},
{
"from": "human",
"value": "import sys\n\n# add the Lambda root path into the sys.path\nsys.path... | python | chosen |
[
{
"from": "system",
"value": "Fix critical bug with patched Lock\n"
},
{
"from": "human",
"value": "from asyncio.locks import Lock as _Lock\nfrom asyncio import coroutine\nfrom asyncio import futures\n\nfrom .util import create_future\n\n# Fixes an issue with all Python versions that leaves pend... | python | chosen |
[
{
"from": "system",
"value": "dropbox: Fix incorrect placement of notify_bot_owner_on_invalid_json.\n\nThis was an error I introduced in editing\nb79213d2602291a4c7ccbafe0f775f77db60665b.\n"
},
{
"from": "human",
"value": "from django.http import HttpRequest, HttpResponse\nfrom zerver.lib.respon... | python | chosen |
[
{
"from": "system",
"value": "Fix revision numbers in migration 0177\n"
},
{
"from": "human",
"value": "\"\"\"\n\nRevision ID: 0177_add_virus_scan_statuses\nRevises: 0176_alter_billing_columns\nCreate Date: 2018-02-21 14:05:04.448977\n\n\"\"\"\nfrom alembic import op\n\n\nrevision = '0176_alter_... | python | chosen |
[
{
"from": "system",
"value": "Enforce requirement of email field on member invite\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django import forms\nfrom django.db import transaction, IntegrityError\n\nfrom sentry.models import (\n AuditLogEntry, AuditLogEn... | python | chosen |
[
{
"from": "system",
"value": "Expand docstring for get conversions.\n\nAdd parameter and return value descriptions.\n"
},
{
"from": "human",
"value": "from settings import CONVERSIONS\n\n\ndef get_conversions(index):\n\t\"\"\"\n\tGet the list of conversions to be performed.\n\n\tDefaults to doin... | python | chosen |
[
{
"from": "system",
"value": "Remove code field from API /auth/test response\n"
},
{
"from": "human",
"value": "# Copyright (C) 2016 University of Zurich. All rights reserved.\n#\n# This file is part of MSRegistry Backend.\n#\n# MSRegistry Backend is free software: you can redistribute it and/o... | python | chosen |
[
{
"from": "system",
"value": "Fix Python 3 string type checking\n"
},
{
"from": "human",
"value": "from six.moves.urllib.parse import urlparse\n\nfrom dache.backends.base import CacheKeyWarning # noqa\nfrom dache.backends.filebased import FileBasedCache\nfrom dache.backends.locmem import LocMem... | python | chosen |
[
{
"from": "system",
"value": "Add reset method for erasing graph database.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nfrom fabric.api import *\nfrom fab_shared import (test, webpy_deploy as deploy,\n setup, development, production, localhost, staging, restart_web... | python | chosen |
[
{
"from": "system",
"value": "Move vcard template to real multi-line string\n"
},
{
"from": "human",
"value": "\n# -*- coding: utf-8 -*-\n'''\n vdirsyncer.tests.storage.test_carddav\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: (c) 2014 Markus Unterwaditzer\n :license: MIT,... | python | chosen |
[
{
"from": "system",
"value": "Fix test for Python 3\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom django.test import TestCase\n\nimport json\n\nfrom myshop.models.polymorphic.product import Product\nfrom myshop.models.manufacturer import Manufacturer\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Use newly added save on new users.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import render_template, redirect, request, url_for, flash\nfrom flask.ext.login import login_user, logout_user, login_required, \\\n current_user\n\nfrom .... | python | chosen |
[
{
"from": "system",
"value": "Add timeout to downloading custom background images\n"
},
{
"from": "human",
"value": "import aiofiles\nimport aiohttp\nimport aiohttp.client_exceptions\nfrom aiopath import AsyncPath\nfrom sanic.log import logger\n\nEXCEPTIONS = (\n aiohttp.client_exceptions.Cli... | python | chosen |
[
{
"from": "system",
"value": "Add doctring for `to_python` [ci-skip].\n\n`to_python` is called when assigning and retrieving a value from the\ndatabase.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.db import models\nfrom django.utils.encoding import force_byte... | python | chosen |
[
{
"from": "system",
"value": "Fix error 'unorderable types: int() > NoneType()'\n"
},
{
"from": "human",
"value": "from sqlalchemy import Column, String, Integer\n\nfrom . import Base\n\n\nclass Channel(Base):\n __tablename__ = 'channels'\n\n channel_id = Column(String, primary_key=True, n... | python | chosen |
[
{
"from": "system",
"value": "Return 400 status for incomplete API queries\n"
},
{
"from": "human",
"value": "\"\"\"\nMichael duPont - michael@mdupont.com\navwx_api.views - Routes and views for the flask application\n\"\"\"\n\n# pylint: disable=W0702\n\n# library\nfrom flask import jsonify\n# mo... | python | chosen |
[
{
"from": "system",
"value": "Add function for printing full DataFrame"
},
{
"from": "human",
"value": "import numpy as np\n\n\ndef dataframe_size(df):\n \"\"\"Return a dict with the size of DataFrame components in MB.\n :param df: pandas.DataFrame\n :return dictionary with index, colum... | python | chosen |
[
{
"from": "system",
"value": "Add 'pretty_print' option to the ConsoleWritter\n\nSimply tries to use the json module to print the item as a formated\njson.\n"
},
{
"from": "human",
"value": "from exporters.writers.base_writer import BaseWriter, ItemsLimitReached\n\n\nclass ConsoleWriter(BaseWrit... | python | chosen |
[
{
"from": "system",
"value": "Use project member email if given\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n folivora.utils.notification\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Framework for user/project notifications.\n\"\"\"\nfrom django.conf import settings\nfrom dj... | python | chosen |
[
{
"from": "system",
"value": "Add calls to gyield() to ensure that we're in the same OS thread\n"
},
{
"from": "human",
"value": "import guv\n\nguv.monkey_patch()\n\nimport threading\nimport greenlet\n\ngreenlet_ids = {}\n\n\ndef debug(i):\n print('{} greenlet_ids: {}'.format(i, greenlet_ids)... | python | chosen |
[
{
"from": "system",
"value": "Add general error handler for unhandled exceptions in api\n"
},
{
"from": "human",
"value": "from flask import Blueprint\nfrom flask_restplus import Api\nfrom .tools import api as tools\nfrom .project import api as project\nfrom .inputs import api as inputs\nfrom .d... | python | chosen |
[
{
"from": "system",
"value": "Bump version: 0.1.9 → 0.1.10\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*\n\"\"\"\n`grappa` provides two different testing styles: `should` and `expect`.\n\nshould\n------\n\nExample using ``should`` style::\n\n from grappa import should\n\n shoul... | python | chosen |
[
{
"from": "system",
"value": "Use XDG_CONFIG_HOME for configuration directory.\n"
},
{
"from": "human",
"value": "import sys, os, subprocess\n\ndef run(args, workdir=None):\n p = subprocess.Popen(args, close_fds=True, cwd=workdir)\n return p.wait()\n\nif sys.platform == \"darwin\":\n sh... | python | chosen |
[
{
"from": "system",
"value": "Use only filename; without path\n"
},
{
"from": "human",
"value": "#!python\nimport os\nimport sys\nimport json\nimport requests\n\nif __name__ == '__main__':\n # create release\n version = sys.argv[1]\n filename = sys.argv[2]\n github_token = os.environ['GITHUB... | python | chosen |
[
{
"from": "system",
"value": "Use less vertical space in query formatting\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport sqlparse\nfrom django import template\n\nregister = template.Library()\n\n\n@register.filter\ndef sqlformat(sql):\n return sqlparse.fo... | python | chosen |
[
{
"from": "system",
"value": "Increase Gunicorn worker eventlet connections, 10 -> 100.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nRelated article: https://sebest.github.io/post/protips-using-gunicorn-inside-a-docker-image/\n\nParameters you might want to override:\n GU... | python | chosen |
[
{
"from": "system",
"value": "Remove an unrelated, unnecessary extra line break"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nJSON-LD extractor\n\"\"\"\n\nimport json\nimport re\n\nimport lxml.etree\n\nfrom extruct.utils import parse_html\n\nHTML_OR_JS_COMMENTLINE = re.compil... | python | chosen |
[
{
"from": "system",
"value": "Update User class to match Telegram API\n"
},
{
"from": "human",
"value": "from collections import namedtuple\n\n\nclass User:\n def __init__(self, id_, first_name, last_name='', username=''):\n self.id = id_\n self.first_name = first_name\n ... | python | chosen |
[
{
"from": "system",
"value": "Adjust the output parsing of git name-rev to handle the output of the latest git version.\n\nSigned-off-by: Simon Hausmann <0a3c2b6956b68ea9079d8d9063677b62a646d61b@kde.org>\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#\n# p4-debug.py\n#\n# Author: Simon H... | python | chosen |
[
{
"from": "system",
"value": "Add extra booger-like properties before transferring\n"
},
{
"from": "human",
"value": "from ui import *\nimport traceback\n\n################################################################################\n# example usage\n\nstatus = Text('Tests something | ok: 0 ... | python | chosen |
[
{
"from": "system",
"value": "Kill obsolete case in pointer_offset\n"
},
{
"from": "human",
"value": "import struct\n\nfrom hsdecomp.types import *\n\ndef read_half_word(settings, file_offset):\n return struct.unpack(settings.rt.halfword.struct, settings.binary[file_offset:file_offset+setting... | python | chosen |
[
{
"from": "system",
"value": "Consolidate some behavior and re-use 'set' comparison for less strict unordered comparisons.\n"
},
{
"from": "human",
"value": "import unittest\nimport importlib_resources as resources\n\nfrom . import data01\nfrom . import util\n\n\nclass ContentsTests:\n @prope... | python | chosen |
[
{
"from": "system",
"value": "Increase release number to 4 (1.3.0 Beta 3)\n"
},
{
"from": "human",
"value": "version = '1.3.0'\nmilestone = 'Chami'\nrelease_number = '3'\nprojectURL = 'http://syncplay.pl/'\n"
},
{
"from": "gpt",
"value": "version = '1.3.0'\nmilestone = 'Chami'\nrelea... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8 in init file"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\r\n##############################################################################\r\n#\r\n# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)\r\n# Releasing children fro... | python | chosen |
[
{
"from": "system",
"value": "Make sure to add the apple id\n"
},
{
"from": "human",
"value": "import json\nimport xml.etree.ElementTree as etree\n\ntable = etree.Element(\"table\", attrib={\n \"class\": \"tablesorter\",\n \"cellspacing\": \"1\",\n \"cellpadding\": \"0\",\n })\n\nthe... | python | chosen |
[
{
"from": "system",
"value": ":bug: Fix a bug in the template tag.\n"
},
{
"from": "human",
"value": "from django.template.loader_tags import register\nfrom django.template import loader, Context, defaultfilters, TemplateDoesNotExist\n\nimport markdown\n\n\npresenters = {\n 'Speaker': 'presen... | python | chosen |
[
{
"from": "system",
"value": "Clean up and document default config values\n"
},
{
"from": "human",
"value": "# Copyright 2013 John Reese\n# Licensed under the MIT license\n\nfilename_regex = r'(?:[a-z]+_)#(?P<channel>[a-z]+)_(?P<date>\\d{8}).log'\n\nchannel_regex_group = 1\ndate_regex_group = 2\... | python | chosen |
[
{
"from": "system",
"value": "Remove warning \"deprecated\" in url.py\n\nversion django=1.9.6\nRemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.\n"
},
{
"from": "h... | python | chosen |
[
{
"from": "system",
"value": "Fix the order of assignments\n"
},
{
"from": "human",
"value": "# Copyright 2013 Rooter Analysis S.L.\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... | python | chosen |
[
{
"from": "system",
"value": "Add subdomain and context to mock\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\n\n\nclass MockFulfil(object):\n \"\"\"\n A Mock object that helps mock away the Fulfil API\... | python | chosen |
[
{
"from": "system",
"value": "Switch off the output file generation.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# coding: utf-8\n\n\"\"\"\n================================================\nOptimization Benchmark: Plot the Sphere Function\n=========================================... | python | chosen |
[
{
"from": "system",
"value": "Fix Mid Sussex Import script\n\nSet polling_district_id\nUse mserid as internal_council_id to avoid importing duplicate points\n"
},
{
"from": "human",
"value": "\"\"\"\nImports Mid Sussex\n\"\"\"\nimport sys\n\nfrom django.contrib.gis.geos import Point, GEOSGeometr... | python | chosen |
[
{
"from": "system",
"value": "Remove failing expectations for the pixel tests.\n\nThe expectations were only in temporarily to allow a rebaseline.\n\nBUG=416450\n\nReview URL: https://codereview.chromium.org/591213002\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#296061}\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Enable logstash formatter for console logs\n"
},
{
"from": "human",
"value": "from cla_public.config.common import *\n\n\nDEBUG = os.environ.get('SET_DEBUG', False) == 'True'\n\nSECRET_KEY = os.environ['SECRET_KEY']\n\nSESSION_COOKIE_SECURE = os.environ.get('CLA_ENV... | python | chosen |
[
{
"from": "system",
"value": "Fix conversion of PNG \"palette\" or \"P\" mode images to JPEG.\r\n\"P\" mode images need to be converted to 'RGB' if target image format is not PNG or GIF."
},
{
"from": "human",
"value": "import tempfile\nimport types\n\nfrom django.utils.functional import wraps\n... | python | chosen |
[
{
"from": "system",
"value": "Change log format (added PID)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79\n\n\"\"\"\npearbot.py\n\nThe PearBot IRC bot entry point.\nIt sets up logging and starts up the IRC client.\n\nCopyright (c) 20... | python | chosen |
[
{
"from": "system",
"value": "Update variables names in exam tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.test import TestCase\nfrom should_dsl import should\n\nfrom exam.dynamic_import import create_specific_exam\nfrom core.tests import FormatTest\nfrom sys im... | python | chosen |
[
{
"from": "system",
"value": "Decompress a zip given a list file\n"
},
{
"from": "human",
"value": "import zipfile\n\ndef bf_extract(zfile, password):\n zip = zipfile.ZipFile(zfile)\n try:\n zip.setpassword(password)\n zip.extractall()\n except:\n pass\n finally:... | python | chosen |
[
{
"from": "system",
"value": "Make the config object lazy for old Djangos.\n\nThis should prevent import time side effects from instantiating the config object directly there.\n"
},
{
"from": "human",
"value": "from .base import Config\n\n__version__ = '1.0a1'\n\ntry:\n from django.apps impor... | python | chosen |
[
{
"from": "system",
"value": "Add xspress3 to step-scan detector list\n"
},
{
"from": "human",
"value": "# vim: sw=4 ts=4 sts expandtab smarttab\n# HXN step-scan configuration\n\nimport hxntools.scans\nfrom bluesky.global_state import get_gs\n\ngs = get_gs()\n\nhxntools.scans.setup()\nct = hxnto... | python | chosen |
[
{
"from": "system",
"value": "Update the pic download base url.\n"
},
{
"from": "human",
"value": "import requests\nimport bs4\nimport os\nimport urllib.request\nimport shutil\nimport re\n\nbase_url = 'http://www.j8vlib.com/cn/vl_searchbyid.php?keyword='\nsrcDir = 'F:\\\\utorrent\\\\WEST'\nfilte... | python | chosen |
[
{
"from": "system",
"value": "Fix and update script test"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim: sw=4:ts=4:expandtab\n\n\"\"\" A script to test CKAN Utils functionality \"\"\"\n\nfrom __future__ import (\n absolute_import, division, print_functi... | python | chosen |
[
{
"from": "system",
"value": "[Tests] Test correct encoding for trivia answer\n\nRename test_wrong_encoding to test_incorrect_encoding\n"
},
{
"from": "human",
"value": "\nimport unittest\n\nfrom units.trivia import check_answer\n\n\nclass TestCheckAnswer(unittest.TestCase):\n\n def test_corr... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug that caused JSON to be serialized as a byte stream with unicode code points\n"
},
{
"from": "human",
"value": "try:\n import json\nexcept ImportError:\n from django.utils import simplejson as json\n \nfrom base import Serializer\n \nclass JSONS... | python | chosen |
[
{
"from": "system",
"value": "Decrease accepted file size to 128MB\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Submit\n\nfrom .models import FileSubmission, VideoSubmission\n\n\nclass VideoSubmissionFo... | python | chosen |
[
{
"from": "system",
"value": "Add exception for people who dont read the docs\n"
},
{
"from": "human",
"value": "from troposphere.settings.default import *\nfrom troposphere.settings.local import *\n"
},
{
"from": "gpt",
"value": "from troposphere.settings.default import *\ntry:\n ... | python | chosen |
[
{
"from": "system",
"value": "Resolve math functions from LLVM math library\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nPostpasses over the LLVM IR.\nThe signature of each postpass is postpass(env, ee, lmod, lfunc) -> lfunc\n\"\"\"\n\nfrom __future__ import print_functi... | python | chosen |
[
{
"from": "system",
"value": "Remove all temporary files from disk\n"
},
{
"from": "human",
"value": "import unittest\nimport os\nfrom tempfile import NamedTemporaryFile\n\nfrom .. import archivebot\n\n\nclass TestRename(unittest.TestCase):\n def test_valid_rename(self):\n try:\n ... | python | chosen |
[
{
"from": "system",
"value": "Disable loopy-jacob test on old gcc version\n\nThis one consumes too much memory and fails the validation, but it compiles fine\nwith a modern gcc or clang, so let's just blacklist it.\n"
},
{
"from": "human",
"value": "\"\"\" Tests for test cases directory. \"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Change code of speed test\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding: utf-8\nfrom grab.spider import Spider, Task\nfrom grab.tools.logs import default_logging\nimport time\nimport logging\nfrom random import randint\n\nfrom grab.util.py3k_sup... | python | chosen |
[
{
"from": "system",
"value": "Add new variable to cache blacklist\n"
},
{
"from": "human",
"value": "# When using openfisca for a large population, having too many variables in cache make openfisca performances drop.\n# The following variables are intermadiate results and do not need to be cache... | python | chosen |
[
{
"from": "system",
"value": "Remove panel group Other in dashboard\n"
},
{
"from": "human",
"value": "# The name of the panel to be added to HORIZON_CONFIG. Required.\nPANEL = 'monitoring'\n# The name of the dashboard the PANEL associated with. Required.\nPANEL_DASHBOARD = 'overcloud'\n# The na... | python | chosen |
[
{
"from": "system",
"value": "Remove optional arg that's now always used\n"
},
{
"from": "human",
"value": "import re\n\nfrom .models import CommCareBuild, CommCareBuildConfig\n\n\ndef get_all_versions(versions=None):\n \"\"\"\n Returns a list of all versions found in the database,\n pl... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.