conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix the list view for podcast files, and allow custom per page number in settings\n"
},
{
"from": "human",
"value": "from django.views.generic import ListView, DateDetailView\nfrom .models import PodcastFile\n\n\nclass PodcastFileListView(ListView):\n queryset = ... | python | chosen |
[
{
"from": "system",
"value": "Add DB connection to amgut init module\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom __future__ import division\n\n# -----------------------------------------------------------------------------\n# Copyright (c) 2014--, The American Gut Project Deve... | python | chosen |
[
{
"from": "system",
"value": "Add a main function with command line arguments\n\nNow able to generate wave files from command line"
},
{
"from": "human",
"value": "#############\n# ECE 612 Spring 2017\n# Joe Parrish\n#\n# Use the same logic from SpectrumTester.py to generate multiple sine waves\... | python | chosen |
[
{
"from": "system",
"value": "Add proper header and fix import.\n"
},
{
"from": "human",
"value": "from .plowshare import *\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# The MIT License (MIT)\n#\n# Copyright (c) 2014 Storj Labs\n#\n# Permission ... | python | chosen |
[
{
"from": "system",
"value": "Fix name of languages table\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.language.dbmodels\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2014-2022 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nfrom ...datab... | python | chosen |
[
{
"from": "system",
"value": "Use environment var for AMI_ID.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport logging\nimport click\nimport tubular.asgard as asgard\n\nlogging.basicConfig(stream=sys.stdout, level=logging.ERROR)\n\n@click.command()\n@click.option('--a... | python | chosen |
[
{
"from": "system",
"value": "Use bounds to determing jra55 grid cell locations.\n"
},
{
"from": "human",
"value": "\nimport numpy as np\nimport netCDF4 as nc\n\nfrom .base_grid import BaseGrid\n\nclass Jra55Grid(BaseGrid):\n\n def __init__(self, h_grid_def, description='JRA55 regular grid'):... | python | chosen |
[
{
"from": "system",
"value": "Add the license header where it's missing.\n"
},
{
"from": "human",
"value": "import abc\n\nimport six\n\n\n@six.add_metaclass(abc.ABCMeta)\nclass BaseBackend(object):\n\n @abc.abstractmethod\n def setup_instance(self):\n \"\"\"Called by setUpClass to s... | python | chosen |
[
{
"from": "system",
"value": "Fix int extractor (greedy > lazy)\n"
},
{
"from": "human",
"value": "# re_set.py\n# Module for generating regex rules\n# r1\n\n\nimport re\n\n\nclass Ree:\n float = None\n number = None\n page_number = None\n extract_int = None\n\n @staticmethod\n ... | python | chosen |
[
{
"from": "system",
"value": "Convert JSON into Tweet and TwitterUser objects\n"
},
{
"from": "human",
"value": "from requests_oauthlib import OAuth1\n\nfrom TweetPoster import User, config\n\n\nclass Twitter(User):\n\n def __init__(self, *a, **kw):\n super(Twitter, self).__init__(*a, ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"revert part of 27cd680\"\n\nc491bbc2302ac7c95c180d31845c643804fa30d3\n"
},
{
"from": "human",
"value": "import shlex\nimport copy\nimport os\nfrom subprocess import STDOUT, run as _run, CalledProcessError, TimeoutExpired\n\n\n# This env stuff is to catch gl... | python | chosen |
[
{
"from": "system",
"value": "Add user to the group when he first connects\n"
},
{
"from": "human",
"value": "from channels.auth import channel_session_user, channel_session_user_from_http\n\n\n@channel_session_user_from_http\ndef ws_connect(message):\n message.reply_channel.send({\n '... | python | chosen |
[
{
"from": "system",
"value": "Fix `vintageous_enter_insert_mode` for NeoVintageous 1.22.0\n\nFixes #1395\n\nIn NeoVintageous/NeoVintageous#749, pushed as 1.22.0 (Oct 2020), the\nrelevant commands were renamed.\n\nWe follow the new names, but for now also call the old ones.\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Add create dns on main workflow\n"
},
{
"from": "human",
"value": "DEPLOY_MYSQL_WORKFLOW = (\n\t'util.gen_names',\n\t'util.gen_dbinfra',\n\t'dbaas_cloudstack.create_vm'\n\t)\n\nDEPLOY_VIRTUALMACHINE = (\n 'workflow.steps.build_databaseinfra.BuildDatabaseI... | python | chosen |
[
{
"from": "system",
"value": "FIX price type 'list_price' inactivation\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in module root\n# direct... | python | chosen |
[
{
"from": "system",
"value": "Add trigger to module import\n"
},
{
"from": "human",
"value": "__version__ = '0.2'\n__author__ = 'Dan Persons <dpersonsdev@gmail.com>'\n__license__ = 'MIT License'\n__github__ = 'https://github.com/dogoncouch/siemstress'\n__all__ = ['core', 'querycore', 'query']\n\... | python | chosen |
[
{
"from": "system",
"value": "Add a (temporary) bounding box around an added mesh\n"
},
{
"from": "human",
"value": "from PyQt5.QtCore import QObject, QCoreApplication, pyqtSlot, QUrl\n\nfrom Cura.Application import Application\nfrom Cura.Scene.SceneNode import SceneNode\n\nclass ControllerProxy... | python | chosen |
[
{
"from": "system",
"value": "Fix the FileAttachment.uuid evolution to match the model field.\n\nThe evolution that was included in the existing code didn't match the\ndefinition of the field. This is a very simple fix.\n\nTesting done:\nRan evolutions.\n\nReviewed at https://reviews.reviewboard.org/r/8141/... | python | chosen |
[
{
"from": "system",
"value": "Change the new endpoint function name\n"
},
{
"from": "human",
"value": "from flask import Flask\nimport relay_api.api.backend as backend\n\n\nserver = Flask(__name__)\n\nbackend.init_relays()\n\n\n@server.route(\"/relay-api/relays/\", methods=[\"GET\"])\ndef get_al... | python | chosen |
[
{
"from": "system",
"value": "Fix test so that it works with both CMS and LMS settings\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.test.utils import override_settings\nfrom django.core.urlresolvers import reverse\nfrom django.conf import settings\nfrom mitxma... | python | chosen |
[
{
"from": "human",
"value": "Add check for `micawber` existance in `oembeditem` plugin.\n"
},
{
"from": "gpt",
"value": "VERSION = (0, 1, 0)\n\n# Do some version checking\ntry:\n import micawber\nexcept ImportError:\n raise ImportError(\"The 'micawber' package is required to use the 'oembe... | python | chosen |
[
{
"from": "system",
"value": "FIX in lot name_get to show location with the stock\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in module roo... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Expose __version__ from the top level cgpm module.\"\n\nThis reverts commit 3b94d4111ea00ff15cf0566392861124fc31b430.\n\nShouldn't've jumped the gun like that, I guess. Apparently this\ndoesn't work and it's not clear to me why.\n"
},
{
"from": "human",
"v... | python | chosen |
[
{
"from": "system",
"value": "Use different usernames for each test. by: Glenn, Giles\n"
},
{
"from": "human",
"value": "# Copyright (c) 2011 Resolver Systems Ltd.\n# All Rights Reserved\n#\n\nfrom urlparse import urljoin\n\nfrom mock import Mock\n\nfrom resolver_test import ResolverTestMixins\... | python | chosen |
[
{
"from": "system",
"value": "Fix the recursion bug in KnowledgeBase after the previous refactor.\n"
},
{
"from": "human",
"value": "\"\"\"Representing the artifacts of a project.\"\"\"\n\nfrom .knowledge_plugins.plugin import default_plugins\n\n\nclass KnowledgeBase(object):\n \"\"\"Represen... | python | chosen |
[
{
"from": "system",
"value": "Add name to patterns in urlpatterns\n\n- so tests can use reverse()\n"
},
{
"from": "human",
"value": "\"\"\"This file maps url patterns to classes.\"\"\"\n\nfrom django.conf.urls import patterns, include, url\n\nfrom django.contrib import admin\nfrom api.views.Clou... | python | chosen |
[
{
"from": "system",
"value": "Change name of constant to match code.\n\nFix #11.\n"
},
{
"from": "human",
"value": "# \n# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.\n# \n\nERROR_MISSING_OWNERS = 'Default copyright owner not set. Please edit the settings file to correct this.'\n... | python | chosen |
[
{
"from": "system",
"value": "Enable min_priority again - seems to be working?\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport board\nimport pente_exceptions\n\nfrom ab_state import *\n\nCAPTURE_SCORE_BASE = 120 ** 3\n\nclass ABGame():\n \"\"\" This class acts as a bridge betwe... | python | chosen |
[
{
"from": "system",
"value": "Add import statement for os"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n##########################################################################\n# scripts/ec2/terminate_all.py\n#\n# Part of Project Thrill - http://project-thrill.org\n#\n# Copyright (C... | python | chosen |
[
{
"from": "system",
"value": "Extend import statement to support Python 3\n"
},
{
"from": "human",
"value": "import os as _os\nimport dash as _dash\nimport sys as _sys\nfrom version import __version__\n\n_current_path = _os.path.dirname(_os.path.abspath(__file__))\n\n_components = _dash.developm... | python | chosen |
[
{
"from": "system",
"value": "Make this Python 2.x compatible\n"
},
{
"from": "human",
"value": "import six\nimport json\n\nfrom django.core.urlresolvers import reverse\nfrom django.utils.html import format_html, mark_safe\n\nCHARTS = {}\n\nclass ChartMeta(type):\n def __new__(cls, name, base... | python | chosen |
[
{
"from": "system",
"value": "Prepend assets dict keys with './' to match filenames in XML\n\nPiperOrigin-RevId: 189602660\n"
},
{
"from": "human",
"value": "# Copyright 2017 The dm_control Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this f... | python | chosen |
[
{
"from": "system",
"value": "Fix Validation import error in older DRF.\n"
},
{
"from": "human",
"value": "from rest_framework import status\nimport rest_framework.exceptions\n\n\nclass ValidationError(rest_framework.exceptions.ValidationError):\n code = ''\n\n def __init__(self, detail, c... | python | chosen |
[
{
"from": "system",
"value": "Fix charts() test (now there are only 174 charts)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport billboard\nimport unittest\nfrom nose.tools import raises\nfrom requests.exceptions import ConnectionError\nimport six\n\n\nclass MiscTest(unittest... | python | chosen |
[
{
"from": "system",
"value": "Update semantic version to 1.0\n\nPiperOrigin-RevId: 258839428\nChange-Id: Idac6ba6750e5fa2c53de0d9a56554d99cc8dcbb8\n"
},
{
"from": "human",
"value": "# pylint: disable=g-bad-file-header\n# Copyright 2019 The dm_env Authors. All Rights Reserved.\n#\n# Licensed unde... | python | chosen |
[
{
"from": "system",
"value": "Replace file_io usage with open\n"
},
{
"from": "human",
"value": "from Crypto.Cipher import AES\nimport os\n\nfrom file_io import *\nfrom settings import *\n\ndef get_cipher(iv, text):\n try:\n key = read_file(KEY_FILE, 'rt').strip()\n except IOError:\... | python | chosen |
[
{
"from": "system",
"value": "Correct the name of the file.\n"
},
{
"from": "human",
"value": "import setuptools\n\nqu_ext = setuptools.Extension(\n 'quantuccia',\n sources=['pyQuantuccia.cpp']\n)\n\nsetuptools.setup(\n name='pyQuantuccia',\n version='0.1.0',\n packages=['pyQuantu... | python | chosen |
[
{
"from": "system",
"value": "Change environment variable names and add placeholders\n"
},
{
"from": "human",
"value": "import os\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\nclass Config:\n \"\"\" Base configuration with values used in all configurations. \"\"\"\n\n SERVER_N... | python | chosen |
[
{
"from": "system",
"value": "Use a different django secret key for each test run.\n"
},
{
"from": "human",
"value": "# Minimum settings that are needed to run django test suite\nimport os\nimport tempfile\n\nSECRET_KEY = 'WE DONT CARE ABOUT IT'\n\nif \"postgresql\" in os.getenv(\"TOX_ENV_NAME\"... | python | chosen |
[
{
"from": "system",
"value": "Update bold init for imports\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n# pylint: disable=unused-import\n\"\"\"\n\nPre-processing fMR... | python | chosen |
[
{
"from": "system",
"value": "Add test make sure rtpevent inside rtp parses\n"
},
{
"from": "human",
"value": "from hypothesis import given\nfrom hypothesis.strategies import binary\nfrom aiortp.packet import rtphdr, pack_rtp, parse_rtp\nfrom aiortp.packet import rtpevent, pack_rtpevent, parse_r... | python | chosen |
[
{
"from": "system",
"value": "Address model testing coverage: 100%\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom django.test import TestCase\nfrom django.contrib.auth import get_user_model\nfrom shop.models.defaults.address import Shippin... | python | chosen |
[
{
"from": "system",
"value": "Check if service is working\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom dbaas.celery import app\nfrom account.models import User\nfrom logical.models import Database\nfrom util.decorators import only_one\nfrom simple_audit.models import AuditReq... | python | chosen |
[
{
"from": "system",
"value": "Implement new python-based menu format\n"
},
{
"from": "human",
"value": "import shutil\n\nfrom cherrypy.lib.static import serve_file\n\nfrom uber.common import *\nfrom panels import *\nfrom bands._version import __version__\nfrom bands.config import *\nfrom bands.m... | python | chosen |
[
{
"from": "system",
"value": "Improve parking area statistics performance\n"
},
{
"from": "human",
"value": "from django.utils import timezone\nfrom rest_framework import serializers, viewsets\n\nfrom parkings.models import Parking, ParkingArea\n\nfrom ..common import WGS84InBBoxFilter\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Fix nav at top of window. Use dark theme to distinguish from content.\n"
},
{
"from": "human",
"value": "\"\"\"Navigation bar view\n\"\"\"\nfrom typing import List\n\nimport dash_html_components as html\nimport dash_bootstrap_components as dbc\nfrom dash.development... | python | chosen |
[
{
"from": "system",
"value": "Allow \"threshold\" to be specified during parse(...).\n"
},
{
"from": "human",
"value": "from IPython import display\n\nfrom puzzle.puzzlepedia import prod_config, puzzle, puzzle_widget\n\n_INITIALIZED = False\n\n\ndef parse(source, hint=None):\n _init()\n result... | python | chosen |
[
{
"from": "system",
"value": "Add future import for Py2.\n"
},
{
"from": "human",
"value": "\"\"\"Generate publication-quality data acquisition methods section from BIDS dataset.\n\"\"\"\nfrom collections import Counter\n\nfrom bids.reports import utils\n\n\nclass BIDSReport(object):\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Add list with list test.\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom eche.reader import read_str\nfrom eche.printer import print_str\n\nimport math\n\n\n@pytest.mark.parametrize(\"test_input\", [\n '1',\n '-1',\n '0',\n str(math.pi),\n st... | python | chosen |
[
{
"from": "system",
"value": "Move is_sticky field into post's advanced options\n\nFor #13\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.contrib import admin\n\nfrom adminsortable.admin import ... | python | chosen |
[
{
"from": "system",
"value": "Add business name to csv output"
},
{
"from": "human",
"value": "import json\n\ndef main():\n\n # print the header of output csv file\n print 'business_id,city,latitude,longitude'\n\n # for each entry in input json file print one csv row\n for line in op... | python | chosen |
[
{
"from": "system",
"value": "Apply default cascade rules for firebird self-ref ForeignKeys.\n\n\ngit-svn-id: 655ff90ec95d1eeadb1ee4bb9db742a3c015d499@3959 8cd8332f-0806-0410-a4b6-96f4b9520244\n"
},
{
"from": "human",
"value": "import testbase\nschema = None\n\n__all__ = 'Table', 'Column',\n\nta... | python | chosen |
[
{
"from": "system",
"value": "Add route '/' with Hello World\n"
},
{
"from": "human",
"value": "from flask import Flask\n\napp = Flask(__name__)\napp.config.from_object(__name__)\napp.config.update(dict(\n SECRET_KEY='development key',\n USERNAME='admin',\n PASSWORD='default'\n))\n"
}... | python | chosen |
[
{
"from": "system",
"value": "Implement generic static file view\n\nUse the send_from_directory helper function from Flask which is used\nto implement the static endpoint of Flask for our custom files\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import Blueprint, send... | python | chosen |
[
{
"from": "system",
"value": "Add note to misleading test\n"
},
{
"from": "human",
"value": "\"\"\"Plot to test custom date axis tick locations and labels\"\"\"\nfrom datetime import datetime\nimport matplotlib.pyplot as plt\nimport mpld3\n\n\ndef create_plot():\n times = [datetime(2013, 12, ... | python | chosen |
[
{
"from": "system",
"value": "Update static import to support Django 3\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom django.utils.html import format_html\nfrom django.contrib.staticfiles.templatetags.staticfiles import static\nfrom wagtail.core import hooks\nfrom wagt... | python | chosen |
[
{
"from": "system",
"value": "Check if epages6 settings are configured\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jonas Gratz\n# Copyright (c) 2015 Jonas Gratz\n#\n# License: MIT\n#\n\n\"\"\"This m... | python | chosen |
[
{
"from": "system",
"value": "Move attribute to \"selector\" in defaults from \"syntax\", as suggested by SublimeLinter\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Ben Edwards\n# Copyright (c) 2015 ... | python | chosen |
[
{
"from": "system",
"value": "Handle new sublime syntax: bash\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by NotSqrt\n# Copyright (c) 2013 NotSqrt\n#\n# License: MIT\n#\n\n\"\"\"\nThis module exports t... | python | chosen |
[
{
"from": "system",
"value": "Fix ft for my bets page\n"
},
{
"from": "human",
"value": "class UserBetsPage(object):\n def __init__(self, test):\n self.test = test\n self.url = self.test.live_server_url + '/my_bets'\n\n def go(self):\n self.test.browser.get(self.url)\n... | python | chosen |
[
{
"from": "system",
"value": "Update install script with full file paths\n\nThis is needed to make the script run on Windows. The `os` package is \nused to make sure it will run under any OS.\n"
},
{
"from": "human",
"value": "import bpy\n\n# install and activate `emboss plane`\nbpy.ops.wm.addo... | python | chosen |
[
{
"from": "system",
"value": "Fix 'get_absolute_url()' refer to url\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.core.urlresolvers import reverse\nfrom django_summernote import models as summer_model\nfrom django_summernote import fields as summer_fields\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Set hostname to '' so the server binds to all interfaces.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom werkzeug import script\n\n\ndef make_app():\n from cadorsfeed.application import CadorsFeed\n return CadorsFeed()\n\n\ndef make_shell():\n ... | python | chosen |
[
{
"from": "system",
"value": "Use production settings as default\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"config.settings.local\")\n\n from django.core.management im... | python | chosen |
[
{
"from": "system",
"value": "Remove the cdecimal debug print\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\n# try using cdecimal for faster Decimal type\ntry:\n import cdecimal\nexcept ImportError:\n pass\nelse:\n sys.modules[\"decimal\"] = cdecima... | python | chosen |
[
{
"from": "system",
"value": "Update ansible version number to 2.8.0.dev0\n"
},
{
"from": "human",
"value": "# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>\n#\n# This file is part of Ansible\n#\n# Ansible is free software: you can redistribute it and/or modify\n# it under the terms o... | python | chosen |
[
{
"from": "system",
"value": "Print message if signing in failed\n"
},
{
"from": "human",
"value": "\"\"\"\ngithub-setup-irc-notifications - Configure all repositories in an organization\nwith irc notifications\n\"\"\"\n\nimport argparse\nimport getpass\n\nimport github3\n\n\ndef main():\n pa... | python | chosen |
[
{
"from": "system",
"value": "Add suffixes to all gifs\n"
},
{
"from": "human",
"value": "import os\n\ndef remove_image_from_csvs(image):\n for csv in os.listdir(\".\"):\n if csv[-4:] != \".csv\":\n continue\n with open(csv, \"r\") as h:\n lines = h.readlin... | python | chosen |
[
{
"from": "system",
"value": "Change dir to allow script to be run from anywhere\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright 2011 Ryan Fobel\n\nThis file is part of Microdrop.\n\nMicrodrop is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Pub... | python | chosen |
[
{
"from": "system",
"value": "Add the PXE VendorPassthru interface to PXEDracDriver\n\nWithout the PXE VendorPassthru interface to expose the \"pass_deploy_info\"\nmethod in the vendor_passthru endpoint of the API the DRAC it can't\ncontinue the deployment after the ramdisk is booted.\n\nCloses-Bug: #137970... | python | chosen |
[
{
"from": "system",
"value": "Upgrade to Django 1.10 style url patterns\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import patterns, url\n\n\nurlpatterns = patterns(\n \"bakery.static_views\",\n url(r\"^(.*)$\", \"serve\", {\n \"documen... | python | chosen |
[
{
"from": "system",
"value": "Check that coverage file exists\n"
},
{
"from": "human",
"value": "import re\n\n\nfilename_matcher = re.compile(r'^\\+\\+\\+ b/([\\w/\\._]+)\\s+.+$')\ndiff_line_matcher = re.compile(r'^@@ -\\d+,\\d+ \\+(\\d+),(\\d+) @@$')\n\ndef report_diffs(diff):\n for line in ... | python | chosen |
[
{
"from": "system",
"value": "Add tests and a bug fix found by tests.\n\nSince small numbers might have a sqrt == 2 add +1 to the range used for testing.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\" Tools for checking and generating prime numbers. \"\"\"\n\nimport math\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Tweak partner form to use textarea for description\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\nfrom casepro.msgs.models import Label\n\nfrom .models ... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug - tests pass\n"
},
{
"from": "human",
"value": "\n# -*- coding: utf-8 -*-\n\n\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\n\nfrom ...trajectories... | python | chosen |
[
{
"from": "system",
"value": "Fix getting product in build_dashboard task\n"
},
{
"from": "human",
"value": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom celery.utils.log import get_task_logger\n\nfrom keeper.celery import celery_app\nfrom keeper.models import P... | python | chosen |
[
{
"from": "system",
"value": "Support PORT envvar from `python -m aspen`\n"
},
{
"from": "human",
"value": "\"\"\"\npython -m aspen\n===============\n\nAspen ships with a server (wsgiref.simple_server) that is\nsuitable for development and testing. It can be invoked via:\n\n python -m aspen\... | python | chosen |
[
{
"from": "system",
"value": "Make Amazon keys non required\n"
},
{
"from": "human",
"value": "import os\nfrom functools import partial\n\nimport boto3\nfrom decouple import config\n\nfrom serenata_toolbox import log\nfrom serenata_toolbox.datasets.contextmanager import status_message\n\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Add \"fields\" attribute to ModelForm.\n"
},
{
"from": "human",
"value": "from cmsplugin_rst.models import RstPluginModel\nfrom django import forms\n\n\nhelp_text = '<a href=\"http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html\">Reference</a>'\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Remove 'TAS' from games blacklist\n"
},
{
"from": "human",
"value": "from bs4 import BeautifulSoup\nimport requests\nimport json\nimport sys\n\nhtml = requests.get(\"http://gamesdonequick.com/schedule\").text\nsoup = BeautifulSoup(html, 'html.parser')\ntable = soup.... | python | chosen |
[
{
"from": "system",
"value": "Simplify plot test for now\n"
},
{
"from": "human",
"value": "\"\"\"Tests K2fov.plot\"\"\"\n\nfrom .. import plot\n\n\"\"\"\ndef test_basics():\n # Make sure this runs without exception.\n try:\n import matplotlib\n plot.create_context_plot(180, ... | python | chosen |
[
{
"from": "system",
"value": "Send mail to admins on all internal server errors.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n This module sets up the view for handling ``500 Internal Server Error`` errors.\n\"\"\"\n\nimport flask\nimport flask_classful\n\nfrom orchar... | python | chosen |
[
{
"from": "system",
"value": "Make categories easier to request\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\n\n# Copyright 2015 Sébastien Maccagnoni-Munch\n#\n# This file is part of AwesomeShop.\n#\n# AwesomeShop is free software: you can redistribute it and/or modify it under\n# t... | python | chosen |
[
{
"from": "system",
"value": "Clean up verification code logic, as per @jermenkoo's feedback\n"
},
{
"from": "human",
"value": "from binascii import hexlify\r\nimport os\r\n\r\n\r\ndef generate_user_token():\r\n key = hexlify(os.urandom(30)).decode()\r\n dashes_key = \"\"\r\n for idx, c... | python | chosen |
[
{
"from": "system",
"value": "Break lowdly on unicode errors\n"
},
{
"from": "human",
"value": "from boto.s3.connection import S3Connection\nfrom boto.s3.bucket import Bucket\nfrom boto.exception import S3ResponseError, S3CreateError\n\nfrom django.conf import settings\n\n\ndef upload(user, pass... | python | chosen |
[
{
"from": "system",
"value": "Modify styling to a proper one\n"
},
{
"from": "human",
"value": "\"\"\"solution to the array pair sum problem\"\"\"\n\n\ndef pair_sum_arrays(k, arr):\n \"\"\"returns the array of pairs using an iterative method.\"\"\"\n\n result = []\n\n for i in range(len... | python | chosen |
[
{
"from": "system",
"value": "Add docstring to formatters package\n"
},
{
"from": "human",
"value": "from . import markdown, json\n"
},
{
"from": "gpt",
"value": "\"\"\"\nCharacter listing formatters\n\nThese modules encapsulate the logic needed to create a character listing in\nvari... | python | chosen |
[
{
"from": "system",
"value": "Replace @represent w/ @config throughout\n\nNew name, same functionality.\n"
},
{
"from": "human",
"value": "from tangled.web import Resource, represent\n\nfrom tangled.site.resources.entry import Entry\n\n\nclass Docs(Entry):\n\n @represent('text/html', template... | python | chosen |
[
{
"from": "system",
"value": "Change namespace image app, use opps image\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom opps.core.models import Article\nfrom opps.core.models.image import I... | python | chosen |
[
{
"from": "system",
"value": "Fix bug that didn't return the right leaderboard\n"
},
{
"from": "human",
"value": "from nameko.rpc import rpc, RpcProxy\nfrom nameko.events import event_handler\n\nclass ScoreService(object):\n name = 'score_service'\n\n player_rpc = RpcProxy('players_service... | python | chosen |
[
{
"from": "system",
"value": "Add tests for inspection reports and cover report templates.\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom model_mommy import mommy\n\nfrom ..models import (\n PracticeType,\n Speciality,\n Qualification,\n PractitionerQuali... | python | chosen |
[
{
"from": "human",
"value": "Allow to load env from a python file\n"
},
{
"from": "gpt",
"value": "# -*- encoding: utf-8 -*-\n#\n# Copyright © 2018 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the Lic... | python | chosen |
[
{
"from": "system",
"value": "Change to use argparse to parse arguments\n"
},
{
"from": "human",
"value": "import discord\r\nimport asyncio\r\nfrom tqdm import tqdm\r\nfrom sys import argv\r\n\r\nscript, fileName = argv\r\nclient = discord.Client()\r\n\r\n@client.event\r\nasync def on_ready():\r... | python | chosen |
[
{
"from": "system",
"value": "Enable 2-pass rendering in html mails with db contents (one django for variables, one markdown for auto HTML/txt output)."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.template import RequestContext\n\nfrom sparks.django import mail\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary setlocale call in templatetags\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n# `setlocale` is not threadsafe\nimport locale\nlocale.setlocale(locale.LC_ALL, 'en_US.UTF-8')\n\nfrom json import dumps as json_dumps\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Fix rough command for correcting operator regions\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom busstops.models import Operator, Region\n\n\nclass Command(BaseCommand):\n @staticmethod\n def maybe_move_operator(op... | python | chosen |
[
{
"from": "system",
"value": "Make environ context helper test more accurate\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for our tests helpers 8-}\n\"\"\"\nimport os\nimport sys\n\nfrom helpers import ArgvContext, EnvironContext\n\n\ndef test_argv_context():\n \"\"\"\n Test if ArgvCo... | python | chosen |
[
{
"from": "system",
"value": "Add new types of peripherals\n"
},
{
"from": "human",
"value": "import copy\n\nfrom ereuse_devicehub.resources.device.schema import Device\nfrom ereuse_devicehub.resources.device.settings import DeviceSubSettings\n\n\nclass Peripheral(Device):\n type = {\n ... | python | chosen |
[
{
"from": "system",
"value": "Handle LESS preprocessor errors more gracefully.\n"
},
{
"from": "human",
"value": "# coding=utf-8\nimport logging\nimport subprocess\nfrom path import path\nfrom engineer.conf import settings\n\n__author__ = 'tyler@tylerbutler.com'\n\nlogger = logging.getLogger(__n... | python | chosen |
[
{
"from": "system",
"value": "Use division_id in place of bounary_id\n"
},
{
"from": "human",
"value": "import os\nimport logging\nimport unicodecsv\n\nfrom billy.core import settings, db\nfrom billy.bin.commands import BaseCommand\n\nlogger = logging.getLogger('billy')\n\n\nclass LoadDistricts(... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.