conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix themes.json with internal WMS\n"
},
{
"from": "human",
"value": "from pyramid.view import view_config\nfrom c2cgeoportal_commons.models import DBSession\nfrom c2cgeoportal_commons.models.main import Theme\nimport logging\n\nlog = logging.getLogger(__name__)\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix KeyError in alerts implementation\n\n- Fix for alert that wasn't dismissing after refreshing the page\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom django.http.response import HttpResponse, HttpResponseRedirect\nfrom djang... | python | chosen |
[
{
"from": "system",
"value": "Fix set notation for Python 2.6\n"
},
{
"from": "human",
"value": "\"\"\"Application-specific settings for django-authorizenet\"\"\"\n\nfrom django.conf import settings as django_settings\n\n\nclass Settings(object):\n\n \"\"\"\n Retrieves django.conf settings... | python | chosen |
[
{
"from": "system",
"value": "Remove middleware classes which are currently unnecessary\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# This file is part of Casia - CAS server based on Django\n# Copyright (C) 2013 Mateusz Małek\n\n# Casia is free software: you can redistribute it... | python | chosen |
[
{
"from": "system",
"value": "Improve proper using of property decorator and logic\n"
},
{
"from": "human",
"value": "from buffer.models.update import Update\n\nPATHS = {\n 'GET_PENDING': 'profiles/%s/updates/pending.json',\n}\n\nclass Updates(list):\n\n def __init__(self, api, profile_id):\n ... | python | chosen |
[
{
"from": "system",
"value": "Return a -1 .. 1 sentiment score.\n"
},
{
"from": "human",
"value": "from synt.utils.redis_manager import RedisManager\nfrom synt.utils.extractors import best_word_feats\nfrom synt.utils.text import sanitize_text\n\nMANAGER = RedisManager()\nDEFAULT_CLASSIFIER = MAN... | python | chosen |
[
{
"from": "system",
"value": "Add tests for number 0 to 9"
},
{
"from": "human",
"value": "import unittest\nfrom number_to_words import NumberToWords\n\n\nclass TestNumberToWords(unittest.TestCase):\n def setUp(self):\n self.n2w = NumberToWords()\n\n def tearDown(self):\n sel... | python | chosen |
[
{
"from": "system",
"value": "Add Clean class to remove files/folders.\n"
},
{
"from": "human",
"value": "import GutterColor.settings as settings\n\nclass Clean:\n \"\"\"Clean up the cache and generated icons\"\"\"\n\n def __init__(self, view):\n pass\n"
},
{
"from": "gpt",
"val... | python | chosen |
[
{
"from": "system",
"value": "Add basic subscription fetcher / creator\n"
},
{
"from": "human",
"value": "# Copyright 2013 Russell Heilling\n\nfrom google.appengine.ext import ndb\n\nclass Subscription(ndb.Model):\n '''Subscription object in datastore.\n\n Holds subscription data. Parent shoul... | python | chosen |
[
{
"from": "system",
"value": "Use class for logout instead of href, to please IE8\n"
},
{
"from": "human",
"value": "from djangosanetesting import SeleniumTestCase\n\nclass NewmanTestCase(SeleniumTestCase):\n fixtures = ['newman_admin_user']\n\n SUPERUSER_USERNAME = u\"superman\"\n SUPE... | python | chosen |
[
{
"from": "system",
"value": "Make the should_trace_cache test a little more bullet-proof.\n"
},
{
"from": "human",
"value": "\"\"\"Tests of coverage/collector.py and other collectors.\"\"\"\n\nimport re\n\nimport coverage\nfrom coverage.backward import StringIO\n\nfrom tests.coveragetest import... | python | chosen |
[
{
"from": "system",
"value": "Use the item access variant instead\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.timezone import now\n\nfrom towel import deletion\nfrom towel.managers import SearchManager\nfrom towel.modelview import ModelViewURLs\n\n\nclass P... | python | chosen |
[
{
"from": "system",
"value": "Remove this emboldening thing again\n"
},
{
"from": "human",
"value": "from collections import defaultdict\nimport re\n\nfrom lxml import etree\n\nfrom IATISimpleTester import app\n\n\n# given an expression list and the name of an expression,\n# select it,\ndef sele... | python | chosen |
[
{
"from": "system",
"value": "Add API error handling similar to supplier app\n\nCurrently 404s returned by the API are resulting in 500s on the buyer\napp for invalid supplier requests. This change takes the model used in\nthe supplier frontend to automatically handle uncaught APIErrors. It is\nnot identica... | python | chosen |
[
{
"from": "system",
"value": "Raise exceptions for common errors rather than returning invalid data.\n"
},
{
"from": "human",
"value": "import mechanize\nimport re\n\n\ndef fetchLatest():\n br = mechanize.Browser()\n br.open(\"http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?l... | python | chosen |
[
{
"from": "system",
"value": "Define flask security object for login stuff"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.mail import Mail\nfrom flask.ext.mongoengine import MongoEngine\nfrom flask.ext.security import MongoEngineUserDatastore, Security\n\n# Create app\n... | python | chosen |
[
{
"from": "system",
"value": "[build-script] Make --show-sdks fail if calling `xcodebuild` failed\n"
},
{
"from": "human",
"value": "# swift_build_support/debug.py - Print information on the build -*- python -*-\n#\n# This source file is part of the Swift.org open source project\n#\n# Copyright ... | python | chosen |
[
{
"from": "system",
"value": "Fix issues with class naming\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8\nfrom __future__ import absolute_import\n\nimport six\n\nfrom .common import ObjectMeta\nfrom ..base import Model\nfrom ..fields import Field, ListField\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Add consume_tokens function to Token.\n"
},
{
"from": "human",
"value": "\"\"\"\nSQL generators for Katagawa.\n\"\"\"\nimport abc\nimport typing\n\n\nclass Token(abc.ABC):\n \"\"\"\n Base class for a token.\n \"\"\"\n\n __slots__ = ()\n\n def __init__... | python | chosen |
[
{
"from": "system",
"value": "Update helpers for generating releases\n"
},
{
"from": "human",
"value": "from .models import (\n Release,\n ReleasePackage,\n Record,\n RecordPackage\n)\nfrom .schema import Tender\nfrom .helpers import (\n mode_test,\n get_ocid\n)\n\n\ndef releas... | python | chosen |
[
{
"from": "system",
"value": "Use objects manager that automatically filters out archived forms\n\nCo-authored-by: Ethan Soergel <c1732a0c832c5c8cbfae77286e6475129315f488@users.noreply.github.com>"
},
{
"from": "human",
"value": "from corehq.apps.api.resources.auth import RequirePermissionAuthen... | python | chosen |
[
{
"from": "system",
"value": "Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).\n"
},
{
"from": "human",
"value": "# Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko t... | python | chosen |
[
{
"from": "system",
"value": "Fix AnyUrlField migration issue on Django 1.11.\n"
},
{
"from": "human",
"value": "\"\"\"\nOptional integration with django-any-urlfield\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom django.db import models\n\nfrom fluent_utils.django_compat import is_inst... | python | chosen |
[
{
"from": "system",
"value": "Remove FutureWarning for capi import\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module provides bindings to C functions defined by OpenMC shared library.\nWhen the :mod:`openmc` package is imported, the OpenMC shared library is\nautomatically loaded. Calls to t... | python | chosen |
[
{
"from": "system",
"value": "Fix broken test (not the intermittent one, this was just a dumb thing)\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.conf import settings\nfrom django.template import Context, Template\nfrom bongo.apps.bongo.tests import factories\... | python | chosen |
[
{
"from": "system",
"value": "Restructure jobs interface to match job description docs.\n\nSigned-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com>\n"
},
{
"from": "human",
"value": "from job import *\nfrom jvms import *\nfrom tools import *\nfrom filters import *... | python | chosen |
[
{
"from": "system",
"value": "Adjust AES import a bit\n"
},
{
"from": "human",
"value": "import base64\n\nfrom Crypto import Cipher\n\nfrom jumpgate import config\n\n\nBLOCK_SIZE = 32\nPADDING = '#'\n\n\ndef pad(string):\n return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix error on loading other languages\n"
},
{
"from": "human",
"value": "# Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License... | python | chosen |
[
{
"from": "system",
"value": "Add request_rectange to HybridLayoutDemo - no clue why this never was here, but it stops it actually working\n"
},
{
"from": "human",
"value": "from base import SubLayout, Rect\nfrom sublayouts import VerticalStack, Floating\nfrom subtile import SubTile\n\nclass Hyb... | python | chosen |
[
{
"from": "system",
"value": "Add GuranteeUnicode function which always returns a unicode object\n"
},
{
"from": "human",
"value": "\"\"\"Utilities for general operations.\"\"\"\n\n\ndef IsNumeric(num_str):\n try:\n val = int(num_str)\n except ValueError:\n return False\n ... | python | chosen |
[
{
"from": "system",
"value": "Send the core count as a metric\n"
},
{
"from": "human",
"value": "import psutil\nfrom checks import AgentCheck\n\nclass SystemCore(AgentCheck):\n\n def check(self, instance):\n cpu_times = psutil.cpu_times(percpu=True)\n\n for i, cpu in enumerate(c... | python | chosen |
[
{
"from": "system",
"value": "Fix order of date parts"
},
{
"from": "human",
"value": "from django import template\nfrom django.utils.dateformat import format\nfrom django.utils.safestring import mark_safe\n\nregister = template.Library()\n\n\n@register.filter(is_safe=True)\ndef iso_time_tag(dat... | python | chosen |
[
{
"from": "system",
"value": "Fix dependency cmis_web -> cmis_field\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n{\n 'name': \"CMIS Web interface\",\n 's... | python | chosen |
[
{
"from": "system",
"value": "Return the address from the marker.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom model_utils import Choices\n\n\nMARKER_COLOURS = Choices(\n ('blue', 'Blue'),\n ('red', 'Red')\n)\n\n\nclass Marker(models.Model):\n name = models.Char... | python | chosen |
[
{
"from": "system",
"value": "Kill all running greenlets when ctrl+c (works a charm in Python 3, not so much in 2).\n"
},
{
"from": "human",
"value": "# pyinfra\n# File: pyinfra_cli/__main__.py\n# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point\n\nimport signal\nimport sys... | python | chosen |
[
{
"from": "system",
"value": "Move reader() generator out of file hasher\n"
},
{
"from": "human",
"value": "\"\"\"File information\"\"\"\nimport os\nimport time\nimport pwd\nimport stat\nimport hashlib\n\nfrom .config import CONFIG\n\ndef get_file_hash(path):\n \"\"\"Get md5 hash of a file\"\... | python | chosen |
[
{
"from": "system",
"value": "Remove line that causes a form feed upon every call to PrintController.output_epl.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nimport simplejson\nimport os\nimport base64\nimport openerp\nfrom ..helpers.zebra import zebra\n\nclass Pri... | python | chosen |
[
{
"from": "system",
"value": "Add comment about SScursor and nextset.\n"
},
{
"from": "human",
"value": "from pymysql.tests import base\nfrom pymysql import util\n\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\n\nclass TestNextset(base.PyMySQLTestCase):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Return exit code when running tests\n"
},
{
"from": "human",
"value": "from SCons.Script import *\n\n\ndef run_tests(env):\n import shlex\n import subprocess\n import sys\n\n subprocess.call(shlex.split(env.get('TEST_COMMAND')))\n sys.exit(0)\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Refactor to remove nested for loop\n"
},
{
"from": "human",
"value": "from collections import Counter\n\n\nclass Solution:\n def findTheDifference(self, s, t):\n\n s = dict(Counter(s))\n t = dict(Counter(t))\n\n for key in t.keys():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add 5s timeout to checkproxy (in an effort to prevent bot hanging\n"
},
{
"from": "human",
"value": "import discord\nimport requests\nfrom discord.ext import commands\n\n\nclass checkproxy:\n \"\"\"Cog for proxy checking\"\"\"\n\n def __init__(self, bot):\n ... | python | chosen |
[
{
"from": "system",
"value": "Send timezone-aware datetime for task expiry\n\nNeeded because this task would consistantly fail if django is set to a\nlater-than-UTC timezone, due to celery thinking the task expired the instant\nit's sent.\n"
},
{
"from": "human",
"value": "from datetime import d... | python | chosen |
[
{
"from": "system",
"value": "Add before_all method to set configuration files\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nu\"\"\"\nCopyright 2015 Telefónica Investigación y Desarrollo, S.A.U.\nThis file is part of Toolium.\n\nLicensed under the Apache License, Version 2.0 (the \... | python | chosen |
[
{
"from": "system",
"value": "Disable colored logging for Windows\n"
},
{
"from": "human",
"value": "\"\"\" Formatter for the logging module, coloring terminal output according to error criticity. \"\"\"\n\nimport enum\nimport logging\nimport sys\n\n\nColors = enum.Enum(\"Colors\", (\"RED\", \"G... | python | chosen |
[
{
"from": "system",
"value": "Update ID to match others\n"
},
{
"from": "human",
"value": "from ansiblelint import AnsibleLintRule\ntry:\n from types import StringTypes\nexcept ImportError:\n # Python3 removed types.StringTypes\n StringTypes = str,\n\n\nclass NoFormattingInWhenRule(Ansi... | python | chosen |
[
{
"from": "system",
"value": "Add some UI and logic for handling workers\n"
},
{
"from": "human",
"value": "from PyQt5.QtWidgets import QDockWidget, QTreeView\n\nclass WorkerDockWidget(QDockWidget):\n def __init__(self, title=\"Dock Widget\", parent=None, flags=None):\n super().__init_... | python | chosen |
[
{
"from": "system",
"value": "Adjust to modifications in Morepath. But now to enable real\nexplicit file support.\n"
},
{
"from": "human",
"value": "import morepath\nimport chameleon\n\n\nclass ChameleonApp(morepath.App):\n pass\n\n\n@ChameleonApp.setting_section(section='chameleon')\ndef get... | python | chosen |
[
{
"from": "system",
"value": "Fix failing test on Python 3"
},
{
"from": "human",
"value": "import click\n\nfrom django.core.exceptions import ObjectDoesNotExist\n\n\nclass ModelInstance(click.ParamType):\n def __init__(self, qs):\n from django.db import models\n\n if isinstance... | python | chosen |
[
{
"from": "system",
"value": "Rename descriptors -> rval to avoid confusion\n"
},
{
"from": "human",
"value": "\"\"\"\nBasic molecular features.\n\"\"\"\n\n__author__ = \"Steven Kearnes\"\n__copyright__ = \"Copyright 2014, Stanford University\"\n__license__ = \"BSD 3-clause\"\n\nfrom rdkit.Chem ... | python | chosen |
[
{
"from": "system",
"value": "Add minimal amount of 1 to form validation\n"
},
{
"from": "human",
"value": "from flask_wtf import Form\n\nfrom wtforms.fields import StringField, HiddenField, BooleanField, DecimalField\nfrom wtforms import validators\n\nfrom flask import request\n\nclass DonateFo... | python | chosen |
[
{
"from": "system",
"value": "Rename the result image to avoid overwriting the original image\n"
},
{
"from": "human",
"value": "# Source:https://github.com/Show-Me-the-Code/show-me-the-code\n# Author:renzongxian\n# Date:2014-11-30\n# Python 3.4\n\n\"\"\"\n\n第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,... | python | chosen |
[
{
"from": "system",
"value": "Remove static file serve url\n"
},
{
"from": "human",
"value": "from project.settings_common import *\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\n# CACHE\nfrom memcacheify import memcacheify\n\nCACHES = memcacheify()\n\nMIDDLEWARE_CLASSES += (\n 'django.middlewar... | python | chosen |
[
{
"from": "system",
"value": "Fix formfield to return an empty string if an empty value is given. This allows empty input for not null model fields with blank=True.\n"
},
{
"from": "human",
"value": "#-*- coding: utf-8 -*-\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.for... | python | chosen |
[
{
"from": "system",
"value": "Change autocorrelation to autocov. Variance infromation improves ABC results.\n"
},
{
"from": "human",
"value": "import numpy as np\n\n\"\"\"Example implementation of the MA2 model\n\"\"\"\n\n# TODO: add tests\n\ndef MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=No... | python | chosen |
[
{
"from": "system",
"value": "Support endpoint name in route.\n"
},
{
"from": "human",
"value": "import logging\n\n\n__license__ = \"MIT\"\n__project__ = \"Flask-Restler\"\n__version__ = \"1.6.2\"\n\n\nlogger = logging.getLogger('flask-restler')\nlogger.addHandler(logging.NullHandler())\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Add book url route matcher\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom . import views\n\nurlpatterns = [\n url(r'^$', views.index, name='index'),\n url(r'^register/', views.register, name='register'),\n url(r'^login/', views.lo... | python | chosen |
[
{
"from": "system",
"value": "Set fake_s3_upload view to be CSRF exempt\n"
},
{
"from": "human",
"value": "from django.core.files.storage import default_storage\nfrom django.views.decorators.http import require_POST\nfrom django.http import HttpResponse\n\n\n@require_POST\ndef fake_s3_upload(req... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.9.3\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.9.2\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\", ... | python | chosen |
[
{
"from": "system",
"value": "Fix import following namespace movement\n\nDocker-DCO-1.1-Signed-off-by: Mangled Deutz <olivier@webitup.fr> (github: dmp42)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport logging\nimport os\n\nfrom . import app\n\n\nif __... | python | chosen |
[
{
"from": "system",
"value": "Implement correct derivation of SoftMax\n"
},
{
"from": "human",
"value": "import numpy as np\n\n\nclass Activator:\n @staticmethod\n def sigmoid(signal, deriv=False):\n if deriv:\n return np.multiply(signal, 1 - signal)\n activation =... | python | chosen |
[
{
"from": "system",
"value": "Fix version info, and bump to 1.0.3\n"
},
{
"from": "human",
"value": "__version__ = '1.0.2'\n\ntry:\n from eventlet import greenthread\n from eventlet import greenpool\n from eventlet import queue\n from eventlet import timeout\n from eventlet import... | python | chosen |
[
{
"from": "system",
"value": "Add south introspection rule for MoneyField.\n"
},
{
"from": "human",
"value": "from decimal import Decimal\nfrom django.db import models\n\n\nclass MoneyField(models.DecimalField):\n def __init__(self, *args, **kwargs):\n kwargs.setdefault('max_digits', 9... | python | chosen |
[
{
"from": "system",
"value": "Add configurable path to hosts file for HostLookup()\n\nRequired for unit testing so that tests don't have to rely on\n/etc/hosts file.\n"
},
{
"from": "human",
"value": "from .. import idiokit\nfrom ._iputils import parse_ip\nfrom ._conf import hosts\nfrom ._dns im... | python | chosen |
[
{
"from": "system",
"value": "Add a _recorded bool to events\n"
},
{
"from": "human",
"value": "from simple_es.identifier.identifies import Identifies\n\n\nclass DomainEvent():\n \"\"\"\n Base class for all domain driven events\n \"\"\"\n identifier = None\n\n def __init__(self, i... | python | chosen |
[
{
"from": "system",
"value": "Return a list of dicts for data.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function, unicode_literals\nfrom builtins import dict, str\n\n__all__ = []\n\nimport requests\n\nDATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets... | python | chosen |
[
{
"from": "system",
"value": "Use professional vs instead of community if found\n"
},
{
"from": "human",
"value": "#!/bin/python3.5\nimport os\n\nconfig = \"\"\"\n.VSBasePath = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community'\n.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Wi... | python | chosen |
[
{
"from": "system",
"value": "Fix MetaPathFinder compatibility stub on Python 2.7\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n\nimport abc\nimport sys\n\nif sys.version_info >= (3,): # pragma: nocover\n from importlib.abc import MetaPathFinder\nelse: # pragm... | python | chosen |
[
{
"from": "system",
"value": "Use 'stable' Django version for intersphinx\n\nThis will ensure documentation references always point at the latest version."
},
{
"from": "human",
"value": "import os\nimport sys\nimport sphinx_rtd_theme\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"settin... | python | chosen |
[
{
"from": "system",
"value": "Fix : response datas list should not be unicoded\n"
},
{
"from": "human",
"value": "import msgpack\nimport logging\n\n\nclass MessageFormatError(Exception):\n def __init__(self, value):\n self.value = value\n\n def __str__(self):\n return repr(se... | python | chosen |
[
{
"from": "system",
"value": "Remove 100K-second max runtime, just run until ^C or server crash.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\n\"\"\"\nRun a local instance of Boulder for testing purposes.\n\nThis runs in non-monolithic mode and requires RabbitMQ on localhost.\n\nK... | python | chosen |
[
{
"from": "system",
"value": "Add instance detach and terminate\n"
},
{
"from": "human",
"value": "import boto3\n\ndef main(event, context):\n client = boto3.client(u'ecs')\n\n inspect_clusters = [u'staging1']\n\n for cluster in inspect_clusters:\n resp = client.list_container_instances(\n... | python | chosen |
[
{
"from": "system",
"value": "Use dash to be compliant with XXX-devel pattern.\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport subprocess\n\ndef get_version_from_git():\n cmd = [\"git\", \"describe\", \"--tags\", \"--long\", \"--always\"]\n\n proc = subpr... | python | chosen |
[
{
"from": "system",
"value": "Add transforming function to pref_encodings\n"
},
{
"from": "human",
"value": "from math import floor\nfrom collections import Counter\n\n\ndef floored_percentage(val, digits):\n \"\"\"\n Return string of floored value with given digits after period\n\n :pa... | python | chosen |
[
{
"from": "system",
"value": "Configure GET response via Proxyfile\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nimport json\nfrom BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer\n\nclass ErrorHTTPRequestHandler(BaseHTTPRequestHandler):\n def do_GET(self):\n... | python | chosen |
[
{
"from": "system",
"value": "Increase timeout for slow test\n"
},
{
"from": "human",
"value": "from doajtest.helpers import DoajTestCase\nfrom portality.core import app\nfrom portality.tasks import sitemap\nfrom portality.background import BackgroundApi\nimport os, shutil, time\nfrom portality.... | python | chosen |
[
{
"from": "system",
"value": "Move initialization of logger and cfg parser to separate function.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport xmlrpclib, logging\nfrom ConfigParser import SafeConfigParser\n\n# Configure logging.\nlogging.basicConfig(level=logging.INFO,\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix broken content rendered by PhJS\n"
},
{
"from": "human",
"value": "# Copyright (C) Ivan Kravets <me@ikravets.com>\n# See LICENSE for details.\n\nfrom subprocess import check_output, CalledProcessError\nfrom urllib import unquote\n\n\ndef application(env, start_r... | python | chosen |
[
{
"from": "system",
"value": "Replace re_path with path wherever possible\n"
},
{
"from": "human",
"value": "from django.urls import re_path\nfrom controlled_vocabularies.views import (\n vocabulary_list, verbose_vocabularies, about,\n all_vocabularies, term_list, vocabulary_file\n)\n\nurl... | python | chosen |
[
{
"from": "system",
"value": "Make it clearer that you get an email when the build completes\n"
},
{
"from": "human",
"value": "from django.http import HttpResponseRedirect\nfrom django.contrib import messages\nfrom django.shortcuts import get_object_or_404\nfrom django.views.decorators.http imp... | python | chosen |
[
{
"from": "system",
"value": "Drop wagtail 1.13 support from example\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nfrom django.core.paginator import EmptyPage, PageNotAnInteger, Paginator\nfrom django.shortcuts import render\n\nimport wagtail\nif ... | python | chosen |
[
{
"from": "system",
"value": "Add ip argument to agent running step\n"
},
{
"from": "human",
"value": "from collections import defaultdict\n\nfrom behave import given, then, when, step, use_step_matcher\n\n\nuse_step_matcher(\"parse\")\n\n\n@given('something with the agent')\ndef step_something_... | python | chosen |
[
{
"from": "system",
"value": "Fix URL error with Geotrek light\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import patterns, url\n\nfrom mapentity import registry\n\nfrom geotrek.altimetry.urls import AltimetryEntityOptions\nfrom geotrek.core.models ... | python | chosen |
[
{
"from": "system",
"value": "Update fetch config with new Syzygy location.\n\nChange-Id: Iacc2efd6974f1a161da6e33a0d25d6329fcaaf4f\nReviewed-on: https://chromium-review.googlesource.com/692697\nCommit-Queue: Sébastien Marchand <b98658856fe44d267ccfa37efbb15fc831b08ae9@chromium.org>\nReviewed-by: Aaron Gabl... | python | chosen |
[
{
"from": "system",
"value": "Add band members as unassigned to new bands\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom members.models import Band\nfrom members.models import BandMember\n\n\nclass BandMemberSerializer(serializers.ModelSerializer):\n\n class... | python | chosen |
[
{
"from": "system",
"value": "Make Ruby work on Travis\n"
},
{
"from": "human",
"value": "import os\n\nfrom .base_executor import ScriptExecutor\n\n\nclass RubyExecutor(ScriptExecutor):\n ext = '.rb'\n name = 'RUBY'\n address_grace = 65536\n test_program = 'puts gets'\n\n def get_... | python | chosen |
[
{
"from": "system",
"value": "Make worker exit after a build\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\nimport json\nimport threading\nimport time\nimport logging\n\nfrom frigg.worker import config\nfrom frigg.worker.jobs import Build\n\nlogger = logging.getLogger(__name__)\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Bump fireant version to 0.13.0\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\n__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=12, patch=0)\n"
},
{
"from": "gpt",
"value": "# coding: utf-8\n\n__version__ = '{major}.{minor}.{patch}'.fo... | python | chosen |
[
{
"from": "system",
"value": "Switch tests to fake redis implementation\n"
},
{
"from": "human",
"value": "import django_rq\nfrom fakeredis import FakeStrictRedis\nfrom redis import Redis\nfrom rq import Queue\n\n\nclass FakeRedisTestCaseMixin:\n \"\"\"TestCase mixin that provides easy setup ... | python | chosen |
[
{
"from": "system",
"value": "Write test for error checks\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\nfrom ..pyautoupdate.launcher import Launcher\n\nimport pytest\n\ndef test_check_urlslash():\n launch = Launcher('not here',\n ... | python | chosen |
[
{
"from": "system",
"value": "[pig] Rename app to Pig Editor\n"
},
{
"from": "human",
"value": "# Licensed to Cloudera, Inc. under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. Cloud... | python | chosen |
[
{
"from": "system",
"value": "Update CLI example to use nested argparse\n"
},
{
"from": "human",
"value": "\"\"\"\nExample for running Application using the `aiohttp.web` CLI.\n\nRun this app using::\n\n $ python -m aiohttp.web web_app.init\n\"\"\"\n\nfrom aiohttp.web import Application, Resp... | python | chosen |
[
{
"from": "system",
"value": "Add a long description based on README.rst\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='fakeredis',\n version='0.1',\n description=\"Fake implementation of redis API for testing purposes.\",\n license='... | python | chosen |
[
{
"from": "system",
"value": "Add python version trove classifiers\n"
},
{
"from": "human",
"value": "from setuptools import find_packages, setup\n\n\nsetup(\n name='django-migration-testcase',\n version='0.0.14',\n author='Andrew Plummer',\n author_email='plummer574@gmail.com',\n ... | python | chosen |
[
{
"from": "system",
"value": "Use install_requires instead of requires.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='eclipsegen',\n version='0.1',\n description='Generate Eclipse instances in Python',\n url='http://github.com/Gohla/eclipsegen',\n author=... | python | chosen |
[
{
"from": "system",
"value": "Add new paths for audit/\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# ==============================\n# Copyright 2011 Whamcloud, Inc.\n# ==============================\n\nfrom distutils.core import setup\nfrom hydra_agent import __version__\n\nset... | python | chosen |
[
{
"from": "system",
"value": "Update to follow latest py.test recommendations\n\nhttp://pytest.org/latest/goodpractises.html#integrating-with-setuptools-python-setup-py-test\n"
},
{
"from": "human",
"value": "import sys\nimport setuptools\nfrom setuptools.command.test import test as TestCommand\... | python | chosen |
[
{
"from": "system",
"value": "FIX no data in pip file\n"
},
{
"from": "human",
"value": "import sys\nfrom setuptools import setup, find_packages\n\nINSTALL_REQUIRES = ['pytz', 'workalendar']\n\nif sys.version_info < (2, 7):\n INSTALL_REQUIRES += ['backport_collections']\n\nsetup(\n name='e... | python | chosen |
[
{
"from": "system",
"value": "Drop support for EOL Python 2.6 and 3.3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\n\nfrom setuptools import setup\n\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\nrequirements = [\n 'six >= 1.4.0',\n]\n\n... | python | chosen |
[
{
"from": "system",
"value": "Bump deps to match d3m==v2020.5.18\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n__version__ = '0.6.0'\n\nsetup(\n name = 'metalearn',\n packages = find_packages(include=['metalearn', 'metalearn.*']),\n version = __versio... | python | chosen |
[
{
"from": "system",
"value": "Update to version number to 0.2.4\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport subprocess\nfrom setuptools import setup, find_packages\nimport os\n\n\ndef git_version():\n def _minimal_ext_cmd(cmd):\n # construct minimal environment\n... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.