conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix - TaxedProductMixin is abstract model\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nclass TaxGroup(models.Model):\n\n name = models.CharField(_(\"group name\"), max_length=100)\n ... | python | chosen |
[
{
"from": "system",
"value": "Use the new settings loading method.\n"
},
{
"from": "human",
"value": "import logging\n\nfrom flask import (\n\tFlask,\n\trender_template,\n\tabort\n)\n\nfrom glanerbeard.server import Server\n\napp = Flask(__name__)\napp.config.from_pyfile('../settings.py')\n\nser... | python | chosen |
[
{
"from": "system",
"value": "Create folder if not exist\n"
},
{
"from": "human",
"value": "from Measurement import Measurement\n\nclass Recorder(object):\n def __init__(self, recorderType):\n self.recorderType = recorderType\n\n def record(self, measure: Measurement):\n None... | python | chosen |
[
{
"from": "system",
"value": "Enhance the dotted name lookup functionality.\n"
},
{
"from": "human",
"value": " # -*- coding: utf-8 -*-\n\nimport os\nimport pkgutil\n\nfrom mako.lookup import TemplateLookup\nfrom mako.template import Template\n\n\nclass DottedTemplateLookup(TemplateLookup):\n ... | python | chosen |
[
{
"from": "system",
"value": "Work without the Gyro sensor for retail set compatibility.\n"
},
{
"from": "human",
"value": "import threading\nimport time\n\nclass SensorThread(object):\n\n def __init__(self, notify, delay=0):\n self.notify = notify\n self.delay = delay\n ... | python | chosen |
[
{
"from": "system",
"value": "ac: Print stats on in/out byte count and increase in percent.\n"
},
{
"from": "human",
"value": "# == Requires python 3.4! ==\n# Changes Unicode symbols with other symbols that looks the same.\nfrom data import Data\n\nif __name__ == \"__main__\":\n data = Data()... | python | chosen |
[
{
"from": "system",
"value": "Fix queries and path to templates\n"
},
{
"from": "human",
"value": "from app import app\nfrom app.models import Post\nfrom flask import render_template\n\n\n@app.route('/')\n@app.route('/page/<int:page>')\ndef blog(page=1):\n \"\"\"View the blog.\"\"\"\n post... | python | chosen |
[
{
"from": "system",
"value": "Fix name parsing for roads\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf8 -*-\nimport json\nimport sys\n\n\nresult = {}\n\nINDEX = {\n \"AREA\": 5 + 3 * 3 + 3 * 3,\n \"CITY\": 5 + 3 * 3,\n \"CODE\": 5\n}\n\nfor line in open(\... | python | chosen |
[
{
"from": "system",
"value": "Add add report with copies functionality and permission\n"
},
{
"from": "human",
"value": "from django.contrib.auth.decorators import user_passes_test\nfrom django.shortcuts import render\nfrom django.core.paginator import Paginator\n\nfrom .forms import ReportForm\... | python | chosen |
[
{
"from": "system",
"value": "Add support for the Eco-Score for Offline-Scan\n\nAdd support for the Eco-Score for Offline-Scan"
},
{
"from": "human",
"value": "#!/usr/bin/python\nfrom __future__ import absolute_import, division, print_function\nimport csv\nfrom itertools import imap\nfrom operat... | python | chosen |
[
{
"from": "system",
"value": "Fix bad super calls causing infinite recursion"
},
{
"from": "human",
"value": "from django.contrib.auth import logout as auth_logout\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.decorators import login_required\nfrom django.views.generic.d... | python | chosen |
[
{
"from": "system",
"value": "Enable additional data on state creation\n\nThis should allow for the creation of custom states where the additional data can be used to associate external accounts."
},
{
"from": "human",
"value": "from logging import Logger\n\n\nclass OAuthStateStore:\n @proper... | python | chosen |
[
{
"from": "system",
"value": "Add bigautofield default in app conf\n"
},
{
"from": "human",
"value": "import importlib\nfrom typing import List, Tuple, Union\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.apps import AppConfig\n\n\nclass MqueueConfig(AppConfig):\n name ... | python | chosen |
[
{
"from": "system",
"value": "Make markdown unsafe and let django make it safe after\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n\nimport markdown\n\nfrom django import template\nfrom django.template.defaultfilters import stringfilter\nf... | python | chosen |
[
{
"from": "system",
"value": "Fix fixture for older versions\n"
},
{
"from": "human",
"value": "import pytest\nimport factory\n\nfrom factory.alchemy import SQLAlchemyModelFactory\nfrom pytest_factoryboy import register\n\nimport ckan.model as model\n\nfrom ckanext.googleanalytics.model import P... | python | chosen |
[
{
"from": "system",
"value": "Change the way of creating database's connection pool\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\nimport os,time,asyncio,json\nimport logging\nlogging.basicConfig(level=logging.ERROR)\ntry:\n\tfrom aiohttp import web\nexcept ImportError:\n\tlogging.er... | python | chosen |
[
{
"from": "system",
"value": "Piwik: Mark sidemenu entry as active\n"
},
{
"from": "human",
"value": "# This file is part of Indico.\n# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).\n#\n# Indico is free software; you can redistribute it and/or\n# modify it under th... | python | chosen |
[
{
"from": "system",
"value": "Fix demo URLs for Dajngo 1.10\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.conf.urls.static import static\nfrom django.conf import settings\nfrom django.contrib import admin\nfrom django.views.generic.base impor... | python | chosen |
[
{
"from": "system",
"value": "Cut a new release to incorporate the HashableDict fix.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"The top-level package for ``django-mysqlpool``.\"\"\"\n# These imports make 2 act like 3, making it easier on us to switch to PyPy or\n# some oth... | python | chosen |
[
{
"from": "system",
"value": "Clear up an unused import.\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom tower import ugettext_lazy as _\n\nfrom challenges.models import Submission\n\n\nclass EntryForm(forms.ModelForm):\n \n class Meta:\n model = Submission\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix unicode error on py2\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nimport os\nimport codecs\n\nimport kombu\n\nfrom kombulogger import default_broker_url, default_queue_name\n\n\nclass KombuLogServer(objec... | python | chosen |
[
{
"from": "system",
"value": "Build paper and hand articles to queue\n"
},
{
"from": "human",
"value": "import yaml\nimport newspaper\nfrom newspaper import news_pool\n\n\ndef get_config():\n with open('/options/config.yml') as file:\n config = yaml.safe_load(file)\n keys = config.k... | python | chosen |
[
{
"from": "system",
"value": "Add length to filename field\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Snap(models.Model):\n filename = models.CharField()\n downloaded = models.DateTimeField('date downloaded')\n\n"
},
{
"from": "gpt",
"value": "from... | python | chosen |
[
{
"from": "system",
"value": "Disable status tree check until we figure out what is wrong with dart-status.appspot.com\n\nR=kustermann@google.com, ngeoffray@google.com\n\nReview URL: https://codereview.chromium.org//23270003\n\ngit-svn-id: c93d8a2297af3b929165606efe145742a534bc71@26257 260f80e4-7a28-3924-81... | python | chosen |
[
{
"from": "system",
"value": "Remove file and line_number from Error class (may add at a later date)\n"
},
{
"from": "human",
"value": "from collections import namedtuple\n\n\nclass PackageError(Exception):\n \"\"\"Exception to be raised when user wants to exit on error.\"\"\"\n\n\nclass Reci... | python | chosen |
[
{
"from": "system",
"value": "Change test case user info\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase\n\nimport tmdbsimple as tmdb\nfrom .models import Movie\n\n\nclass MovieTestCase(TestCase):\n def setUp(... | python | chosen |
[
{
"from": "system",
"value": "Create book if one doesn't exist during tag creation\n"
},
{
"from": "human",
"value": "from braces.views import LoginRequiredMixin\nfrom django.core.exceptions import PermissionDenied\nfrom django.shortcuts import (\n get_object_or_404,\n redirect\n)\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Align foreign key field length with maximum party ID length\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.party.models.setting\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2018 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for d... | python | chosen |
[
{
"from": "system",
"value": "Prepare version 0.2.0.dev for next development cycle\n"
},
{
"from": "human",
"value": "\"\"\"Store the version info so that setup.py and __init__ can access it. \"\"\"\n__version__ = \"0.2.0\"\n"
},
{
"from": "gpt",
"value": "\"\"\"Store the version inf... | python | chosen |
[
{
"from": "system",
"value": "Use self> for selfbot prefix, and >/b> for normal bot prefix\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport asyncio\nimport logging\nimport sys\n\nimport discord\nfrom discord.ext.commands import when_mentioned_or\nimport yaml\n\nfrom bot import Be... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in reversescale translation\n\n- allows 'reversescl' (old key) to get map to 'reversescale' (new key)\n"
},
{
"from": "human",
"value": "def update_keys(keys):\n \"\"\"Change keys we used to support to their new equivalent.\"\"\"\n updated_keys = list... | python | chosen |
[
{
"from": "system",
"value": "Fix delete command in pod initializer\n"
},
{
"from": "human",
"value": "class InitCommands(object):\n COPY = 'copy'\n CREATE = 'create'\n DELETE = 'delete'\n\n @classmethod\n def is_copy(cls, command):\n return command == cls.COPY\n\n @clas... | python | chosen |
[
{
"from": "system",
"value": "Fix exit_on_error in case of return value\n"
},
{
"from": "human",
"value": "from functools import wraps\n\nimport gevent\nfrom greenlet import GreenletExit\n\n\ndef exit_on_error(func):\n @wraps(func)\n def wrapper(*args, **kw):\n try:\n fun... | python | chosen |
[
{
"from": "system",
"value": "Use pathlib in the filter\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\nimport json\nimport sys\nfrom os import scandir, remove\nfrom datetime import datetime\n\n\nSTART_DT = datetime(2016, 7, 1, 0, 0, 0)\nEND_DT = datetime(2016, 12, 1, 0, 0, 0)\nDRY... | python | chosen |
[
{
"from": "system",
"value": "Test access token csv download\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>\n"
},
{
"from": "human",
"value": "from takeyourmeds.utils.test import SuperuserTestCase\n\nclass SmokeTest(SuperuserTestCase):\n def test_inde... | python | chosen |
[
{
"from": "system",
"value": "Configure a simple index page\n\nFor now, this is a place-holder.\n"
},
{
"from": "human",
"value": "\"\"\"Memoir URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.9/topics/htt... | python | chosen |
[
{
"from": "system",
"value": "Change default database from sqlite to mysql.\n"
},
{
"from": "human",
"value": "import os\nimport boris\n\nfrom .base import STATIC_URL\n\n# helper for building absolute paths\nPROJECT_ROOT = os.path.abspath(os.path.dirname(boris.__file__))\np = lambda x: os.path.j... | python | chosen |
[
{
"from": "system",
"value": "Add support for colored output in embeds\n\n"
},
{
"from": "human",
"value": "from discord import Embed\n\n\ndef build_embed(ctx, desc: str, title: str = ''):\n\tname = ctx.message.server.me.nick if ctx.message.server.me.nick is not None else ctx.bot.user.name\n\tem... | python | chosen |
[
{
"from": "system",
"value": "Fix typo and minor formatting.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\nimport pprint\nimport warnings\n\nfrom gpn.node import Node\n\nsuffix = '.node'\nsuffix_default = '.node-default'\n\n\nclass Graph(object):\n def __init__(self, ... | python | chosen |
[
{
"from": "system",
"value": "Allow unit testing w/o internet connectivity\n\nurllib2.urlopen() is now patched when testing the internet connectivity\nhelper.\n\nChange-Id: I4ddf1dd8f494fe282735e1051986a0b5dd1a040f\nSigned-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com>\n"
},... | python | chosen |
[
{
"from": "system",
"value": "Add save functionality to the conversion script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# SPDX-License-Identifier: MIT\n\n\"\"\"Convert older RSON stylesheets to YAML format\n\nRun the script with the filename to convert, it outputs to stdout\n\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix test 184 for python 3\n"
},
{
"from": "human",
"value": "import sys\nfrom numba import *\nimport numpy as np\n\n@jit(object_(double[:, :]))\ndef func2(A):\n L = []\n n = A.shape[0]\n for i in range(10):\n for j in range(10):\n temp = A... | python | chosen |
[
{
"from": "system",
"value": "Add noqa flag to migration file\n"
},
{
"from": "human",
"value": "# Generated by Django 3.1 on 2020-08-19 21:10\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('nutrition', '0003_auto_2017011... | python | chosen |
[
{
"from": "system",
"value": "Simplify the label matches function\n\nFocus only creating a mask of selected labels and none of the other\nproducts that this function was creating before.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nimport operator\n\nimport numpy\n\nimport das... | python | chosen |
[
{
"from": "system",
"value": "Change search and list fields\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom .models import Protocol, Topic, Institution\n\n\nclass ProtocolAdmin(admin.ModelAdmin):\n list_display = ['number', 'start_time', 'get_topics', 'information', ... | python | chosen |
[
{
"from": "system",
"value": "Update SEGA Id in server side too\n"
},
{
"from": "human",
"value": "import blocks\n\nconnectedClients = {}\n\nclass ClientData(object):\n\t\"\"\"docstring for ClientData\"\"\"\n\tdef __init__(self, ipAddress, segaId, handle):\n\t\tself.ipAddress = ipAddress\n\t\tse... | python | chosen |
[
{
"from": "system",
"value": "Make tests pass in Python 2.5 by importing with_statement from __future__\n"
},
{
"from": "human",
"value": "import sys\nimport unittest\n\n\nclass TestAAPickle(unittest.TestCase):\n\n def test_no_cpickle(self):\n from celery.tests.utils import mask_module... | python | chosen |
[
{
"from": "system",
"value": "Add annotation for ORA2_FILEUPLOAD_BACKEND setting\n"
},
{
"from": "human",
"value": "\"\"\" File Upload backends. \"\"\"\n\n\nfrom django.conf import settings\n\nfrom . import django_storage, filesystem, s3, swift\n\n\ndef get_backend():\n # Use S3 backend by de... | python | chosen |
[
{
"from": "system",
"value": "Include `random` in imports from shortuuid.main\n\nWhen `random` was added to `main.py` the `__init__.py` file wasn't updated to expose it. Currently, to use, you have to do: `import shortuuid; shortuuid.main.random(24)`. With these changes you can do `import shortuuid; shortuu... | python | chosen |
[
{
"from": "system",
"value": "Use parseargs reference for docker_container\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\ntry:\n import crowdai\nexcept:\n raise Exception(\"Please install the `crowdai` python client by : pip install crowdai\")\nimport argparse\nparser = argparse... | python | chosen |
[
{
"from": "system",
"value": "Fix some error about session.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import (Blueprint, render_template, request,\n flash, url_for, redirect, session)\nfrom flask.ext.mail import Message\n\nfrom ..extensions import... | python | chosen |
[
{
"from": "system",
"value": "Rename the class named ArrayHeap to the class named MaxHeap. Simplify __init__ method code to make it readable\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\n\nimport numpy as np\n\n\nclass ArrayHeap(object):\n\n\n def __init__(self, sz, data = None... | python | chosen |
[
{
"from": "system",
"value": "Insert the path to the source tree at the front of the python path rather than at the end. Something broken got put into some one of the python include directories somehow.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys, os\nfrom paste.deploy imp... | python | chosen |
[
{
"from": "system",
"value": "Test broken - just demo\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport unittest\nimport subprocess\n\nclass TestWilkins(unittest.TestCase):\n\n def test_cliusage(self):\n output = subprocess.check_output(['./wilkins.py', '--word', 'remain',... | python | chosen |
[
{
"from": "system",
"value": "Create dict out of member info and append to list\n\nappend_members() work identically to append_contacts(). A for loop is\nalso needed to loop over every member entry in the XML file.\n"
},
{
"from": "human",
"value": "import requests\nimport xml.etree.ElementTree... | python | chosen |
[
{
"from": "system",
"value": "Set log level for test\n\nWhen moving to Python 3 the logger starts putting out loads of DEBUG\nand INFO lines, but we only really care about WARNING.\n"
},
{
"from": "human",
"value": "from gem.settings import * # noqa: F401, F403\n\nDATABASES = {\n 'default': ... | python | chosen |
[
{
"from": "system",
"value": "Remove Feature flag from the location security check for dashboard\n"
},
{
"from": "human",
"value": "from functools import wraps\n\nfrom django.http import HttpResponse\n\nfrom corehq.apps.locations.permissions import user_can_access_location_id\nfrom custom.icds_c... | python | chosen |
[
{
"from": "system",
"value": "Add url for getting credits.\n"
},
{
"from": "human",
"value": "# BULKSMS Config.\nCONFIG = {\n 'BULK_SMS': {\n 'AUTH': {\n 'USERNAME': '',\n 'PASSWORD': ''\n },\n 'URL': {\n 'SINGLE': 'https://bulksms.2way.co... | python | chosen |
[
{
"from": "system",
"value": "Allow passing in a raw key and homedir."
},
{
"from": "human",
"value": "import getpass\nimport os\n\nimport gnupg\n\n\nclass GPG(object):\n def __init__(self, keyid):\n self.gpg = gnupg.GPG(use_agent=False)\n self.keyid = keyid\n if not self... | python | chosen |
[
{
"from": "system",
"value": "Fix get_pending_updates not correctly returning all pending updates\n\nIt was only returning the first 100 ones returned in the first telegram API call.\n"
},
{
"from": "human",
"value": "from bot.api.domain import Message\nfrom bot.api.telegram import TelegramBotAp... | python | chosen |
[
{
"from": "system",
"value": "Add a bit of docs\n"
},
{
"from": "human",
"value": "'''\nCreated on 1 jun. 2013\n\n@author: sander\n'''\nfrom .container_node import ContainerNode\n\n\nclass DDTContainerNode(ContainerNode):\n pass\n"
},
{
"from": "gpt",
"value": "'''\nCreated on 1 j... | python | chosen |
[
{
"from": "system",
"value": "Make the return link work again\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom selenium.webdriver.support.ui import Select\nfrom page_objects import PageObject, PageElement, MultiPageElement\n\nclass SettingsPage(PageObject):\n return_link = Pag... | python | chosen |
[
{
"from": "system",
"value": "Fix import ordering in standard layout\n"
},
{
"from": "human",
"value": "from apistar import Route, Include\nfrom apistar.docs import docs_routes\nfrom apistar.statics import static_routes\nfrom project.views import welcome\n\nroutes = [\n Route('/', 'GET', welc... | python | chosen |
[
{
"from": "human",
"value": "Test report generation management command calls task correctly\n"
},
{
"from": "gpt",
"value": "import pytz\ntry:\n import mock\nexcept ImportError:\n from unittest import mock\n\ntry:\n from StringIO import StringIO\nexcept ImportError:\n from io import ... | python | chosen |
[
{
"from": "system",
"value": "Return http status code 400 (Bad Request) unless flask gives an error code\n"
},
{
"from": "human",
"value": "\"\"\"blueprint.py\"\"\"\n\nimport flask\nfrom werkzeug.exceptions import HTTPException\nfrom werkzeug.exceptions import default_exceptions\n\nfrom jsonrpcs... | python | chosen |
[
{
"from": "system",
"value": "Fix SessionKeyValueStore.has to use the correct indexing value when looking up data\n"
},
{
"from": "human",
"value": "from xblock.runtime import KeyValueStore, InvalidScopeError\n\n\nclass SessionKeyValueStore(KeyValueStore):\n def __init__(self, request, descri... | python | chosen |
[
{
"from": "system",
"value": "Use string of Rho Namespace\n\nInstead of the URI object, need to use the string.\n"
},
{
"from": "human",
"value": "\"\"\"\nKnowledge provider that will respond to requests made by the rdf publisher or another bot.\n\"\"\"\nfrom sleekxmpp.plugins.base import base_p... | python | chosen |
[
{
"from": "system",
"value": "Use AGG backend for generic visualization to avoid display dependency.\n"
},
{
"from": "human",
"value": "\nimport numpy as np\nimport neurokernel.LPU.utils.visualizer as vis\nimport networkx as nx\n\nnx.readwrite.gexf.GEXF.convert_bool = {'false':False, 'False':Fal... | python | chosen |
[
{
"from": "system",
"value": "Use Conan Center provided libcurl.\n"
},
{
"from": "human",
"value": "from conans import ConanFile, CMake, tools\n\n\nclass LibWFUTConan(ConanFile):\n name = \"libwfut\"\n version = \"0.2.4\"\n license = \"GPL-2.0+\"\n author = \"Erik Ogenvik <erik@ogenv... | python | chosen |
[
{
"from": "system",
"value": "Add apikey to get_report api\n"
},
{
"from": "human",
"value": "from threading import Semaphore\nfrom os.path import basename\nfrom rate import ratelimiter\nimport requests\n\n\nclass VirusTotal():\n\n def __init__(self, apikey, limit=4, every=60):\n self.... | python | chosen |
[
{
"from": "system",
"value": "ADD readback.name in iuv_gap to fix speck save prob\n"
},
{
"from": "human",
"value": "from ophyd import PVPositionerPC, EpicsSignal, EpicsSignalRO\nfrom ophyd import Component as Cpt\n\n# Undulator\n\nclass Undulator(PVPositionerPC):\n readback = Cpt(EpicsSignal... | python | chosen |
[
{
"from": "system",
"value": "Update rest api url config error message\n"
},
{
"from": "human",
"value": "import json\n\nfrom django.core.exceptions import ImproperlyConfigured\n\nfrom ..compat import NoReverseMatch, render, render_to_string, reverse\n\n\ndef render_embed(nodes=None, request=Non... | python | chosen |
[
{
"from": "system",
"value": "Update Detective per 2021-04-29 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\nfrom .validators import boolean\n\n\nclass Graph(A... | python | chosen |
[
{
"from": "system",
"value": "Use DRF query params and data request attrs\n"
},
{
"from": "human",
"value": "class FormMixin(object):\n \"\"\"Mixin to provide form validation and data cleaning of GET or POST\n requests.\n \"\"\"\n form_class = None\n\n @property\n def form(self... | python | chosen |
[
{
"from": "system",
"value": "Remove dead code now part of the REST API.\n"
},
{
"from": "human",
"value": "from tornado import gen, web\n\nfrom remoteappmanager.handlers.base_handler import BaseHandler\n\n\nclass HomeHandler(BaseHandler):\n \"\"\"Render the user's home page\"\"\"\n\n @web... | python | chosen |
[
{
"from": "system",
"value": "MNT: Fix new lint found by flake8\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015,2019 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Tools for reading, calculating, and plotting ... | python | chosen |
[
{
"from": "system",
"value": "Datalogger: Fix trivial off by 1 in the livestream datalogger example\n"
},
{
"from": "human",
"value": "from pymoku import Moku, MokuException, NoDataException\nfrom pymoku.instruments import *\nimport time, logging, traceback\n\nlogging.basicConfig(format='%(ascti... | python | chosen |
[
{
"from": "system",
"value": "Change error class to function\n"
},
{
"from": "human",
"value": "\"\"\" Оповещение администратора о возникших ошибках \"\"\"\n\nfrom traceback import format_exception, format_exc\nfrom lib.config import emergency_id\nfrom lib.commands import vk, api\n\n\nclass Erro... | python | chosen |
[
{
"from": "system",
"value": "Create AdminViewPermission on contrib multisite\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\nfrom .models import SitePermission\n\n\nadmin.site.register(SitePermission)\n"
},
{
"from": "... | python | chosen |
[
{
"from": "system",
"value": "Write correct titles for opening plots\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\n\ndef parse_opening_list(filename):\n with open(filename) as f:\n open_count = dict()\n openings = []\n for line in (raw.strip() for ra... | python | chosen |
[
{
"from": "system",
"value": "Index creation should apply across the board.\n"
},
{
"from": "human",
"value": "import logging\n\ntry:\n NullHandler = logging.NullHandler\nexcept AttributeError:\n class NullHandler(logging.Handler):\n def emit(self, record):\n pass\n\nlog ... | python | chosen |
[
{
"from": "system",
"value": "Remove migration dependency from Django 1.8"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nfrom django.conf import settings\n\n\nclass Migration(migrations.Migration):\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix issue running database creation, should be run as the deployment user\n"
},
{
"from": "human",
"value": "# -*- encoding:utf8 -*-\nfrom fabric.api import env\n\n\nclass RootUser(object):\n \"\"\"\n Class to define Root user.\n \"\"\"\n uid=0\n\n @c... | python | chosen |
[
{
"from": "system",
"value": "Prepare application test with current brand and party.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom unittest import TestCase\n\nfrom byceps.application import create_app\nfrom byceps.database import db\n\n\nclass AbstractAppTestCase(TestCase):\... | python | chosen |
[
{
"from": "system",
"value": "Make use of StateChanged signal of DBUS Server object\n\n\ngit-svn-id: ff687e355030673c307e7da231f59639d58f56d5@172 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2.4\n\nimport dbus\nimport dbus.glib\nimport gtk\n\nfrom time... | python | chosen |
[
{
"from": "system",
"value": "Add an interface to update global context\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Template\"\"\"\n\nimport peanut\nimport jinja2\nfrom os import path\nfrom jinja2 import FileSystemLoader\nfrom jinja2.exceptions impo... | python | chosen |
[
{
"from": "system",
"value": "Disable contracts in jobs parser\n"
},
{
"from": "human",
"value": "# coding: utf-8\nimport urllib\nfrom celery import shared_task\nfrom apps.vacancies.parsers import VacancySync, YandexRabotaParser\n\n\n@shared_task(ignore_result=True)\ndef update_vacancies():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add attr.gpu decorator to gpu test of dropout\n"
},
{
"from": "human",
"value": "import unittest\n\nimport numpy\n\nimport chainer\nfrom chainer import cuda\nfrom chainer import functions\nfrom chainer import testing\n\n\nif cuda.available:\n cuda.init()\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Bump app version to 2019.12.0\n\nSigned-off-by: Guillaume Tucker <e7e20b7c30f19d4ca6b81319ef81bf200369d137@collabora.com>\n"
},
{
"from": "human",
"value": "__version__ = \"2019.11.1\"\n__versionfull__ = __version__\n"
},
{
"from": "gpt",
"value": "__ver... | python | chosen |
[
{
"from": "system",
"value": "Use the script dir as base_dir for now.\n"
},
{
"from": "human",
"value": "import os, os.path\n\nbase_dir = os.getcwd()\nscript_dir = os.path.realpath(os.path.dirname(__file__))\n\ndef get_crawl_dir():\n return os.path.join(base_dir, \"crawl\")\n\ndef revision_pr... | python | chosen |
[
{
"from": "system",
"value": "Make bechmark compatible with python3\n"
},
{
"from": "human",
"value": "# Copyright 2019 Google LLC\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://developers.google.com/open-source/licenses... | python | chosen |
[
{
"from": "system",
"value": "Use context manager in example\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport unittest\nimport modfoo\nimport saliweb.test\nimport os\n\nclass JobTests(saliweb.test.TestCase):\n \"\"\"Check custom ModFoo Job class\"\"\"\n\n de... | python | chosen |
[
{
"from": "system",
"value": "Rename test case to be clearly for the web-facing parts of Tappy Terror\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n Tappy Terror Tests\n ------------------\n\n Tests Tappy Terror\n\n :license: MIT; details in LICENSE\n\"\"\"\n\ni... | python | chosen |
[
{
"from": "system",
"value": "Remove the dbLocation as we do this within plugin.py\n"
},
{
"from": "human",
"value": "###\n# Copyright (c) 2012, spline\n# All rights reserved.\n#\n#\n###\n\nimport os\n\nimport supybot.conf as conf\nimport supybot.registry as registry\nfrom supybot.i18n import Pl... | python | chosen |
[
{
"from": "system",
"value": "Update docs' html_theme value: default → classic\n\nNew proposed default is 'alabaster', which looks nice but leaves less\nroom to the core content. 'classic' replaces 'default'.\n\nAnyway readthedocs.org applies its own theme so this only impacts local\nbuilds.\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Fix failing user profile test\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom django.test import TestCase\n\nfrom fortuitus.fcore.factories import UserF\nfrom fortuitus.fcore.models import FortuitusProfile\n\n\nclass HomeViewTes... | python | chosen |
[
{
"from": "system",
"value": "Fix py3.9 check that total weight need to be more than zero\n"
},
{
"from": "human",
"value": "from typing import List\n\nfrom pyosmo.algorithm.base import OsmoAlgorithm\nfrom pyosmo.history.history import OsmoHistory\nfrom pyosmo.model import TestStep\n\n\nclass We... | python | chosen |
[
{
"from": "system",
"value": "Change the first gregorian date in the English calendar.\n"
},
{
"from": "human",
"value": "from datetime import date\n\nfrom base import Calendar\nfrom main import JulianCalendar\n\nclass JulianToGregorianCalendar(Calendar):\n def date(self, year, month, day):\n... | python | chosen |
[
{
"from": "system",
"value": "Add marker attr spec function to chart import.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n# defaults and constants\nfrom .utils import DEFAULT_PALETTE\nfrom ._chart_options import default_options as defaults\n\n# main components\nfr... | python | chosen |
[
{
"from": "system",
"value": "Fix iteration was over whole element instead of only over subelements.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n================================================================================\n:mod:`header` -- XML handler for header\n======... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.