conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Exclude fields from the RestrcitedForm (no verification)\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom .models import Project\n\n\nclass ProjectForm(forms.ModelForm):\n def __init__(self, *args, **kwargs):\n self.user = kwargs.pop('us... | python | chosen |
[
{
"from": "system",
"value": "[Feature] Add item_id key to BucketListItem serializer.\n"
},
{
"from": "human",
"value": "\"\"\"This module defines the format used by marshall to map the models.\"\"\"\nfrom flask_restful import fields\n\nbucketlistitem_serializer = {\n 'id': fields.Integer,\n ... | python | chosen |
[
{
"from": "system",
"value": "Deal with CASA's empty header keywords\n"
},
{
"from": "human",
"value": "\n'''\nSwap the axes in a header, without losing keys to WCS\n'''\n\nfrom astropy.wcs import WCS\n\n\ndef header_swapaxes(header, ax1, ax2):\n '''\n '''\n\n mywcs = WCS(header)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove debug messages from import.\n"
},
{
"from": "human",
"value": "import os\r\nimport sys\r\n\r\nfrom config import *\r\n\r\ndef addLocalPaths(paths):\r\n for path_part in paths:\r\n base_path = os.path.join(local_path, path_part)\r\n abs_path =... | python | chosen |
[
{
"from": "system",
"value": "Add Event ordering by datetime\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Artist(models.Model):\n name = models.CharField(max_length=100)\n image_url = models.URLField(blank=True)\n thumb_url = models.URLField(blank=True)\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix missing call to display.setup()\n"
},
{
"from": "human",
"value": "\r\nimport infrastructure\r\nimport display\r\nimport traceables\r\nimport matrix\r\nimport graph\r\n\r\n\r\n# ==========================================================================\r\n# Setu... | python | chosen |
[
{
"from": "system",
"value": "Add debug logging to elm-format\n"
},
{
"from": "human",
"value": "import subprocess\nimport re\nimport sublime, sublime_plugin\n\n\nclass ElmFormatCommand(sublime_plugin.TextCommand):\n\tdef run(self, edit):\n\t\tcommand = \"elm-format {} --yes\".format(self.view.f... | python | chosen |
[
{
"from": "system",
"value": "Remove a few unnecessary imports\n"
},
{
"from": "human",
"value": "from engine.event import *\nfrom engine.action import *\nfrom engine.code import *\nfrom engine.player import *\nfrom engine.round import *\nfrom engine.team import *\n\n\ndef processInput():\n u... | python | chosen |
[
{
"from": "system",
"value": "Include 'tags' in the Image summary (returned by the /v2/instances detail API)\n"
},
{
"from": "human",
"value": "from core.models import Application as Image\nfrom rest_framework import serializers\nfrom api.v2.serializers.fields.base import UUIDHyperlinkedIdentity... | python | chosen |
[
{
"from": "system",
"value": "Improve ShowAdmin to give better overview\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom karspexet.show.models import Production, Show\n\n\n@admin.register(Production)\nclass ProductionAdmin(admin.ModelAdmin):\n list_display = (\"name... | python | chosen |
[
{
"from": "system",
"value": "Fix evaluation query on report\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.views.generic import TemplateView\nfrom django.shortcuts import redirect\nfrom ..evaluation.models import Evaluation, Group_User\n\n\n\nclass showProfe... | python | chosen |
[
{
"from": "system",
"value": "Fix up the cleanup of the temporary DB so it works for BSD DB's\ncompatibility layer as well as \"classic\" ndbm.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\"\"\"Test script for the dbm module\n Roger E. Masse\n\"\"\"\nimport dbm\nfrom dbm import ... | python | chosen |
[
{
"from": "system",
"value": "Remove redundant space on new line\n"
},
{
"from": "human",
"value": "import os, sys\n\n# Production specific settings\nfrom .base import *\n\nDEBUG = True\n\nALLOWED_HOSTS = ['*']\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR ... | python | chosen |
[
{
"from": "system",
"value": "[fix][patch] Delete Bin for non-stock item\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors\n# License: GNU General Public License v3. See license.txt\n\nfrom __future__ import unicode_literals\nimport frappe... | python | chosen |
[
{
"from": "system",
"value": "Add named constant to explain why { } default\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\nimpo... | python | chosen |
[
{
"from": "system",
"value": "FIX : fix text in cov estimation example\n"
},
{
"from": "human",
"value": "\"\"\"\n==============================================\nEstimate covariance matrix from a raw FIF file\n==============================================\n\n\"\"\"\n# Author: Alexandre Gramfort... | python | chosen |
[
{
"from": "system",
"value": "py3: Use print function instead of print statement\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nimport platform\nimport sys\nimport textwrap\nimport warnings\n\n\nif not (2, 7) <= sys.version_info < (3,):\n sys.ex... | python | chosen |
[
{
"from": "system",
"value": "Add threadName to log format\n"
},
{
"from": "human",
"value": "CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s %(name)s\\n %(message)s'\nMPD_LINE_ENCODING = u'utf-8'\nMPD_LINE_TERMINATOR = u'\\n'\nMPD_SERVER_HOSTNAME = u'localhost'\nMPD_SERVER_PORT = 6600\n\nSP... | python | chosen |
[
{
"from": "system",
"value": "Apply black formatting to migration\n"
},
{
"from": "human",
"value": "# Generated by Django 3.0.8 on 2020-07-12 17:33\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('places', '0010_auto_20200712_050... | python | chosen |
[
{
"from": "system",
"value": "Add the import for CommandError\n"
},
{
"from": "human",
"value": "# This script deactivates a particular generation\n\nfrom optparse import make_option\nfrom django.core.management.base import BaseCommand\nfrom mapit.models import Generation\n\nclass Command(BaseCo... | python | chosen |
[
{
"from": "system",
"value": "Replace contrib.auth's \"login\" view with LoginView.\n\nCf. https://docs.djangoproject.com/en/2.1/releases/1.11/#id2\n\ncontrib.auth's login() and logout() function-based views are deprecated in favor of new class-based views LoginView and LogoutView.\n"
},
{
"from": "... | python | chosen |
[
{
"from": "system",
"value": "Rewrite import to avoid accidental misuse\n\nDon't import the AuroraWatchUK class into the snapshot namespace, it\nenables the original AuroraWatchUK class to be used when it was intended\nto use the snapshot version, AuroraWatchUK_SS.\n"
},
{
"from": "human",
"valu... | python | chosen |
[
{
"from": "system",
"value": "Update interface signatures for else branches\n"
},
{
"from": "human",
"value": "from thinglang.lexer.symbols.logic import LexicalEquality\nfrom thinglang.parser.tokens import BaseToken\n\n\nclass Conditional(BaseToken):\n\n ADVANCE = False\n\n def __init__(se... | python | chosen |
[
{
"from": "system",
"value": "Subtract two sets of parameters\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport numpy as np\n\ndef add_params(p1, p2):\n res = []\n for x,y in zip(p1,p2):\n res.append(x+y)\n return res\n\ndef get_neutral(array):\n... | python | chosen |
[
{
"from": "system",
"value": "Use verbose names in example table\n"
},
{
"from": "human",
"value": "from achilles import blocks, tables\nfrom time import sleep\n\nfrom models import Person\n\nregister = blocks.Library('example')\n\nCOUNTER = 0\n\n@register.block(template_name='blocks/message.htm... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with URL routes\n"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom werkzeug.urls import url_quote, url_unquote\nfrom werkzeug.routing import PathConverter\n\n\ndef data_filename(fname):\n basedir = os.path.abspath(os.path.join(os.path.dirnam... | python | chosen |
[
{
"from": "system",
"value": "Switch to a mutation timestamp\n"
},
{
"from": "human",
"value": "import logging\nfrom followthemoney import model\nfrom servicelayer.worker import Worker\n\nfrom ingestors.manager import Manager\n\nlog = logging.getLogger(__name__)\n\n\nclass IngestWorker(Worker):\... | python | chosen |
[
{
"from": "system",
"value": "Update tags for Cache config option\n\nUpdated tags for config options consistency [1].\n\n[1] https://wiki.openstack.org/wiki/ConfigOptionsConsistency\n\nChange-Id: I3f82d2b4d60028221bc861bfe0fe5dff6efd971f\nImplements: Blueprint centralize-config-options-newton\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Return correct status codes from auth rate limiter failure.\n"
},
{
"from": "human",
"value": "from mailu import limiter\n\nimport socket\nimport flask\n\n\ninternal = flask.Blueprint('internal', __name__)\n\n\n@limiter.request_filter\ndef whitelist_webmail():\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove starred expression for 3.4 compatibility\n"
},
{
"from": "human",
"value": "import enum\nimport functools\nimport operator\nimport struct\n\n\nclass Packet(enum.IntEnum):\n connect = 0\n disconnect = 1\n data = 2\n ack = 3\n end = 4\n\n\ndef bu... | python | chosen |
[
{
"from": "system",
"value": "Validate between the Select and create new EventGroup\n\nAdded simple booleans to manage this selection for now\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom .models import Event, EventGroup\n\n\nclass EventForm(forms.ModelForm):\n\n class M... | python | chosen |
[
{
"from": "system",
"value": "Add unused param:language flag for OpenMinTeD purposes\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python \nimport argparse\nimport pubrunner\nimport pubrunner.command_line\nimport os\nimport sys\n\nif __name__ == '__main__':\n\tparser = argparse.ArgumentParse... | python | chosen |
[
{
"from": "system",
"value": "Use existing code (don't clone again)\n"
},
{
"from": "human",
"value": "import os\n\n# Best Python command on your system\nmy_python = \"python\"\n\nprint(\"This script should download and install DNest4 and \\\nreplicate all the runs presented in the paper.\\nNote... | python | chosen |
[
{
"from": "system",
"value": "Add header of Rule.isValid method\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom .Rule import Rule\n\nclass IsMethodsRuleExtension(Rule):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove the wiki link from the smell message\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Bartosz Kruszczynski\n# Copyright (c) 2015 Bartosz Kruszczynski\n#\n# License: M... | python | chosen |
[
{
"from": "system",
"value": "Add mesh points to plot\n"
},
{
"from": "human",
"value": "\"\"\"\n===============================\nPiecewise Affine Transformation\n===============================\n\nThis example shows how to use the Piecewise Affine Transformation.\n\"\"\"\n\nimport numpy as np\n... | python | chosen |
[
{
"from": "system",
"value": "Add `test_not_match` to `no_such_file` tests\n"
},
{
"from": "human",
"value": "import pytest\nfrom thefuck.rules.no_such_file import match, get_new_command\nfrom tests.utils import Command\n\n\n@pytest.mark.parametrize('command', [\n Command(script='mv foo bar/f... | python | chosen |
[
{
"from": "system",
"value": "Use 'pass', not 'return', for empty Python methods\n"
},
{
"from": "human",
"value": "\"\"\"\nTest that Gabble times out the connection process after a while if the server\nstops responding at various points. Real Gabbles time out after a minute; the\ntest suite's G... | python | chosen |
[
{
"from": "system",
"value": "Connect also to the IDS (if idsurl is set) and report its version.\n\ngit-svn-id: 5b1347ddac5aba1438c637217dfe0bb137609099@844 8efdbd46-c5fb-49ab-9956-99f62928ec21\n"
},
{
"from": "human",
"value": "#! /usr/bin/python\n\nfrom __future__ import print_function\nimport... | python | chosen |
[
{
"from": "system",
"value": "Print char repersentation of data\n"
},
{
"from": "human",
"value": "import matplotlib.pyplot as plt\nimport scipy.signal\nimport numpy as np\nimport time\nfrom signal_functions import *\n\n\nmatch_filter = make_match_filter()\nsignal_in = import_wav(\"rec.wav\")\n\... | python | chosen |
[
{
"from": "system",
"value": "Clean up dask client in indexing test\n"
},
{
"from": "human",
"value": "import pytest\nimport os\nimport shutil\nimport xarray as xr\nfrom cosima_cookbook import database\nfrom dask.distributed import Client\n\nfrom sqlalchemy import select, func\n\n@pytest.fixture... | python | chosen |
[
{
"from": "system",
"value": "Drop recent changes on nuke\n"
},
{
"from": "human",
"value": "import sqlite3\n\nif __name__==\"__main__\":\n\tconn = sqlite3.connect('auxgis.db')\n\tc = conn.cursor()\n\n\ttry:\n\t\tc.execute('''DROP TABLE pos;''')\n\texcept:\n\t\tpass\n\ttry:\n\t\tc.execute('''DRO... | python | chosen |
[
{
"from": "system",
"value": "Add check sub grid method\n"
},
{
"from": "human",
"value": "# Implement an algorithm that will check whether a given grid of numbers represents a valid Sudoku puzzle\n\ndef check_rows(grid):\n\ti = 0\n\twhile i < len(grid):\n\t\tj = 0\n\t\tref_check = {}\n\t\twhile... | python | chosen |
[
{
"from": "system",
"value": "Add brokers information to the output of kafka-info\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport json\nimport sys\nfrom itertools import groupby\n\n\ndef groupsortby(data, key):\n \"\"\"Sort and group by the same key.\"\"\"\n... | python | chosen |
[
{
"from": "system",
"value": "Fix having ver info written twice (divergence). Makes \"mk cut_a_release\" ver update work.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Copyright (c) 2008-2010 ActiveState Corp.\n# License: MIT (http://www.opensource.org/licenses/mit-license.php)\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add common factory fixtures to be shared across integration tests\n"
},
{
"from": "human",
"value": "import pytest\n\n\n@pytest.fixture\ndef coinbase():\n return '0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd'\n\n\n@pytest.fixture\ndef private_key():\n return '0x... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in PKGDATA path\n"
},
{
"from": "human",
"value": "\"\"\"Minecraft Curse CLI Client\"\"\"\n\nimport gettext\nfrom pathlib import Path\n\n#: Consistent names definitions\nRESOURCE_NAME = __package__\n\n#: Root of the package\nPKGDIR = Path(__file__).resolve(... | python | chosen |
[
{
"from": "system",
"value": "Fix get_storage cache to hold separate entries for each experiment key\n"
},
{
"from": "human",
"value": "from copy import deepcopy\n\nfrom simpleflake import simpleflake\n\nfrom lab_assistant import conf, utils\n\n\n__all__ = [\n 'get_storage',\n 'store',\n ... | python | chosen |
[
{
"from": "system",
"value": "Use parser.compile_filter instead of my half-baked attempt\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.template.base import TemplateSyntaxError\nfrom tinycontent.models import TinyContent\n\n\nregister = template.Library()\n\n\nclass ... | python | chosen |
[
{
"from": "system",
"value": "Create contour data for multiple climate data types\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport sys\nimport os\n\nsys.path.append('./climatemaps')\n\nimport climatemaps\n\n\nDATA_DIR = './website/data'\n\n\ndef test():\n for month in range... | python | chosen |
[
{
"from": "system",
"value": "Change queryset filtering for positions view\n"
},
{
"from": "human",
"value": "from django.views.generic import ListView\nfrom aspc.senate.models import Document, Appointment\nimport datetime\n\nclass DocumentList(ListView):\n model = Document\n context_objec... | python | chosen |
[
{
"from": "system",
"value": "Add __dir__ method to Client in order to allow autocompletion in interactive terminals, etc.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom . import areas\n\n\nclass FailedRequest(Exception):\n def __init__(self, error):\n self.error = ... | python | chosen |
[
{
"from": "system",
"value": "Disable PyOpenSSL tests by default.\n"
},
{
"from": "human",
"value": "from urllib3.packages import six\n\nif six.PY3:\n from nose.plugins.skip import SkipTest\n raise SkipTest('Testing of PyOpenSSL disabled')\n\nfrom urllib3.contrib.pyopenssl import (inject_i... | python | chosen |
[
{
"from": "system",
"value": "Use better name for matplotlib style\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Filename: __init__.py\n\"\"\"\nThe extemporary KM3NeT analysis framework.\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\n\ntry:\n __KM3PIPE_S... | python | chosen |
[
{
"from": "system",
"value": "Remove test for rest controller. "
},
{
"from": "human",
"value": "from openspending.model.dataset import Dataset\nfrom openspending.tests.base import ControllerTestCase\nfrom openspending.tests.helpers import load_fixture\n\nfrom pylons import url\n\n\nclass TestRe... | python | chosen |
[
{
"from": "system",
"value": "Mark usage of temporary files in `cmd`\n\nThe marker `@` was ambiguous in SublimeLinter. Its usage has been deprecated in favor of explicit markers like `$temp_file`."
},
{
"from": "human",
"value": "\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking fr... | python | chosen |
[
{
"from": "system",
"value": "Remove the executable property to allow override.\n\nThis problem was discussed here : SublimeLinter/SublimeLinter#455\r\n\r\nIf the `executable` property is defined, the plugin require the host system to have a global `phpcs` binary. If I haven't that binary installed (eg. I u... | python | chosen |
[
{
"from": "system",
"value": "Support Additional Error Output Formats\n\nMake the 'near' match group more flexible to support multiple error\noutput styles for some syntax errors.\n\nExamples:\n\n Error: Could not parse for environment production: Syntax error at 'class' at line 27\n Error: Could not ... | python | chosen |
[
{
"from": "system",
"value": "Add tests for more keyword-only arguments behavior\n\nTest for handling of default keyword-only argument values and mixing\nkeyword-only arguments with variable keyword arguments lists.\n"
},
{
"from": "human",
"value": "from unittest import TestCase\nfrom pointfree... | python | chosen |
[
{
"from": "system",
"value": "Handle HTTP Error 410 when checking blog post\n"
},
{
"from": "human",
"value": "\"\"\"\nValidator functions\n\"\"\"\nfrom urllib import request\n\nfrom django.core.exceptions import ValidationError\n\nimport PyPDF2\n\ndef online_document(url):\n \"\"\"Check if o... | python | chosen |
[
{
"from": "system",
"value": "Update format of wave file generator.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nwavelist = []\nfor p in range(48):\n for s in range(24):\n wave = {'method': 'PUT', 'url': 'http://localhost:3520/scenes/_current'}\n wave['name'] = 'P... | python | chosen |
[
{
"from": "system",
"value": "Revert 232670 \"Fix script after r232641\"\n\nNeeds to be out to speculatively revert r232641.\n\n> Fix script after r232641\n> \n> BUG=314253\n> TBR=pfeldman@chromium.org\n> \n> Review URL: https://codereview.chromium.org/49753004\n\nTBR=thakis@chromium.org\n\nReview URL: http... | python | chosen |
[
{
"from": "system",
"value": "Move config file to user home directory\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python2.7 -u\n__author__ = \"Peter Shipley\"\n\n\nimport os\nimport keyring\nimport ConfigParser\n\nfrom ISY.IsyEvent import ISYEvent\n\ndef main() :\n\n config = ConfigP... | python | chosen |
[
{
"from": "system",
"value": "Rename VALENCY constant and change index\n"
},
{
"from": "human",
"value": "REDUCED_RULE_VALENCY_TOKEN = 0\nREDUCED_RULE_POS = 1\nREDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2\nREDUCED_RULE_GLOSSES = 3\n"
},
{
"from": "gpt",
"value": "REDUCED_RULE_POS = 1\nREDU... | python | chosen |
[
{
"from": "system",
"value": "Allow list of flashers as show token value\n"
},
{
"from": "human",
"value": "\"\"\"Flasher config player.\"\"\"\nfrom mpf.config_players.device_config_player import DeviceConfigPlayer\nfrom mpf.core.delays import DelayManager\n\n\nclass FlasherPlayer(DeviceConfigPl... | python | chosen |
[
{
"from": "system",
"value": "Add output option to use response.content stream\n"
},
{
"from": "human",
"value": "# flake8: noqa\nimport asyncio\n\nimport aiohttp\nfrom aiohttp.test_utils import TestClient\n\n\nasync def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content... | python | chosen |
[
{
"from": "system",
"value": "Enable the network by default.\n"
},
{
"from": "human",
"value": "import os\n\nNETWORK_DISABLED = True\nNETWORK_PORT = 11338\n\nPLOW_HOSTS = [\"localhost:11337\"]\n\n\n\n\n\n\n\n"
},
{
"from": "gpt",
"value": "import os\n\nNETWORK_DISABLED = False\nNETWO... | python | chosen |
[
{
"from": "system",
"value": "Use multiprocessing to get quicker updates from PyPI.\n"
},
{
"from": "human",
"value": "from functools import partial\nimport subprocess\nimport requests\n\n\ndef get_pkg_info(pkg_name, session):\n r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_nam... | python | chosen |
[
{
"from": "system",
"value": "Remove unused score filter backend\n"
},
{
"from": "human",
"value": "\n# Third-Party\nfrom django_filters.rest_framework.backends import DjangoFilterBackend\nfrom dry_rest_permissions.generics import DRYPermissionFiltersBase\n\n\nclass CoalesceFilterBackend(DjangoF... | python | chosen |
[
{
"from": "system",
"value": "Create a frame with a menu bar.\n\nThe software will have several buttons, but the idea of the menu\nbar is to have redundancy on the commands and to inform the user\nof the shortcuts.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\nfungui is a s... | python | chosen |
[
{
"from": "system",
"value": "Change case field to case_id in error message\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport json\nfrom django.http import JsonResponse\n\nfrom casepro.pods import registry\n\n\ndef read_pod_data(request, index):\n \"\"\"Dele... | python | chosen |
[
{
"from": "system",
"value": "Add a hack for appending \"IF NOT EXISTS\" clause to \"CREATE INDEX\"\n"
},
{
"from": "human",
"value": "__all__ = [\n 'ensure_only_one_row',\n 'insert_or_ignore',\n]\n\n\ndef ensure_only_one_row(rows):\n row = rows.fetchone()\n if row is None or rows.fe... | python | chosen |
[
{
"from": "system",
"value": "Copy now waits for files to be copies over\n"
},
{
"from": "human",
"value": "import os\nimport shutil\n\ndef copy(orig, dest, useShutil=False):\n if os.path.isdir(orig):\n if useShutil:\n shutil.copytree(orig, dest, symlinks=True)\n else... | python | chosen |
[
{
"from": "system",
"value": "Handle an authentication edge case\n"
},
{
"from": "human",
"value": "from django.http import Http404\nfrom django.utils import timezone\n\nfrom clubadm.models import Member, Season\n\n\nclass SeasonMiddleware(object):\n def process_view(self, request, view_func,... | python | chosen |
[
{
"from": "system",
"value": "Add paramater for template path\n"
},
{
"from": "human",
"value": "import os.path\nimport jinja2\nimport configmanager\n\nconfigs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), \"../configs\")))\ntemplateConfig = configs[\"temp... | python | chosen |
[
{
"from": "system",
"value": "Fix stress test to avoid cdb bus error\nbug ref 125505\n\nSigned-off-by: Marja Hassinen <97dfd0cfe579e2c003b71e95ee20ee035e309879@nokia.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\"\"\"A test provider for the stress testing.\"\"\"\n\n\n# change regis... | python | chosen |
[
{
"from": "system",
"value": "Add new modules to doctests\n"
},
{
"from": "human",
"value": "\nif __name__ == '__main__':\n import doctest\n from lesion import trace\n doctest.testmod(trace)\n\n"
},
{
"from": "gpt",
"value": "\nif __name__ == '__main__':\n import doctest\... | python | chosen |
[
{
"from": "system",
"value": "Add blank lines to comply with PEP8\n"
},
{
"from": "human",
"value": "class PydubException(Exception):\n \"\"\"\n Base class for any Pydub exception\n \"\"\"\n\n\nclass TooManyMissingFrames(PydubException):\n pass\n\n\nclass InvalidDuration(PydubExcepti... | python | chosen |
[
{
"from": "system",
"value": "Add some more basic tests for /t/, which should return all tasks for a user.\n\ngit-svn-id: 062a66634e56759c7c3cc44955c32d2ce0012d25@307 c02d1e6f-6a35-45f2-ab14-3b6f79a691ff\n"
},
{
"from": "human",
"value": "import unittest\nfrom os import path\n\nfrom webtest impo... | python | chosen |
[
{
"from": "system",
"value": "Use stable dev/platforms for CI\n"
},
{
"from": "human",
"value": "# Copyright (c) 2014-present PlatformIO <contact@platformio.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lic... | python | chosen |
[
{
"from": "system",
"value": "Fix pbr if running without git or sdist\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of ... | python | chosen |
[
{
"from": "system",
"value": "Fix bug when creating rooms\n"
},
{
"from": "human",
"value": "from urllib.parse import urlencode\nimport urllib.error\nimport urllib.request\n\nfrom . import shared as G\n\n\ndef create_room(room_name):\n url = 'https://%s/api/room/' % G.DEFAULT_HOST\n # TODO... | python | chosen |
[
{
"from": "system",
"value": "sentry: Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIX\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.contrib.auth.middleware import RemoteUserMiddleware\n\nclass EnvRemoteUserMiddleware(RemoteUserMiddleware):\n header = os.environ.get('REMOTE_... | python | chosen |
[
{
"from": "system",
"value": "Update regex to include filename capture group.\n"
},
{
"from": "human",
"value": "import logging\nimport re\nfrom SublimeLinter.lint import NodeLinter\n\nlogger = logging.getLogger('SublimeLinter.plugin.tslint')\n\n\nclass Tslint(NodeLinter):\n cmd = 'tslint --f... | python | chosen |
[
{
"from": "system",
"value": "Allow all hosts when on Heroku\n"
},
{
"from": "human",
"value": "import dj_database_url\n\nfrom .common import * # noqa\n\nDATABASES = {\n 'default': dj_database_url.config(conn_max_age=500),\n}\n\nDEBUG = False\n\nALLOWED_HOSTS = ['.herokuapp.com']\n"
},
{... | python | chosen |
[
{
"from": "system",
"value": "Fix to take into account history in API queries.\n"
},
{
"from": "human",
"value": "from django_filters import FilterSet, CharFilter, IsoDateTimeFilter\nfrom ui.models import Warc, Seed, Harvest\nfrom django_filters import Filter\nfrom django_filters.fields import L... | python | chosen |
[
{
"from": "system",
"value": "Add simple test for whether WX is installed. Display download link if not.\n"
},
{
"from": "human",
"value": "# Nessus results viewing tools\r\n#\r\n# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy\r\n# http://www.github.com/nccgroup/nessusviewer\r\n#\r\n... | python | chosen |
[
{
"from": "system",
"value": "Add todo for seeking and reading\n\n"
},
{
"from": "human",
"value": "import io\nimport getopt\nimport sys\nimport pickle\n\ndef usage():\n\tprint(\"usage: \" + sys.argv[0] + \" -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results\")\n\ni... | python | chosen |
[
{
"from": "system",
"value": "Update dsub version to 0.4.2.dev0\n\nPiperOrigin-RevId: 328753098\n"
},
{
"from": "human",
"value": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in comp... | python | chosen |
[
{
"from": "system",
"value": "Add installation of repository dependencies for tools\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom bioblend import galaxy\nfrom bioblend import toolshed\n\n\nif __name__ == '__main__':\n gi_url = \"http://172.21.23.6:8... | python | chosen |
[
{
"from": "system",
"value": "Remove self.debug as LoggerMixin was removed from new versions of rapidsms.\n"
},
{
"from": "human",
"value": "import pprint\nimport logging\nimport datetime\nfrom twilio.rest import TwilioRestClient\n\nfrom rapidsms.backends.base import BackendBase\n\n\nlogger = lo... | python | chosen |
[
{
"from": "system",
"value": "Add unauthorize to service template\n\nSigned-off-by: Brandon Myers <9cda508be11a1ae7ceef912b85c196946f0ec5f3@mozilla.com>\n"
},
{
"from": "human",
"value": "from flask import Blueprint, render_template, flash\nfrom flask_login import login_required, current_user\n\... | python | chosen |
[
{
"from": "system",
"value": "Select random open port for gui\n\nRefs #6.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom recipyGui import recipyGui\nimport random, threading, webbrowser\n\nport = 5000 + random.randint(0, 999)\nurl = \"http://127.0.0.1:{0}\".format(port)\n\n# Give... | python | chosen |
[
{
"from": "system",
"value": "Change the Sifter issue number matching\r\n\r\nNow it's only 3-5 digits, optionally with the hash,\r\nand only as a standalone word."
},
{
"from": "human",
"value": "import os\nimport requests\nimport re\nimport json\n\n\nNUM_REGEX = r'\\#([0-9]+)'\nAPI_KEY = os.env... | python | chosen |
[
{
"from": "system",
"value": "Use regularized covariance in CSP by default\n"
},
{
"from": "human",
"value": "# Released under The MIT License (MIT)\n# http://opensource.org/licenses/MIT\n# Copyright (c) 2013-2016 SCoT Development Team\n\n\"\"\"Use mne-python routines as backend.\"\"\"\n\nfrom _... | python | chosen |
[
{
"from": "system",
"value": "Improve selection sort algorithm's documentation\n"
},
{
"from": "human",
"value": "def selection_sort(L):\n \"\"\"\n :param L: unsorted list\n :return: this is a method, there is no return function. The method sorts a list using\n selection sort algor... | python | chosen |
[
{
"from": "system",
"value": "Use new location for web client test util\n"
},
{
"from": "human",
"value": "import os\nimport pytest\nfrom pytest_girder.utils import runWebClientTest\n\n\n@pytest.mark.parametrize('spec', (\n 'annotationListSpec.js',\n 'annotationSpec.js',\n 'geojsAnnotat... | python | chosen |
[
{
"from": "system",
"value": "Add empty reverse migration to be able to unapply the migration in reverse\n"
},
{
"from": "human",
"value": "# Generated by Django 3.2.6 on 2021-09-27 17:49\n\nfrom django.db import migrations\n\nINDEX_POLLSTATS_ORG_RESULT_SQL = \"\"\"\nCREATE INDEX IF NOT EXISTS s... | python | chosen |
[
{
"from": "system",
"value": "Remove TODO's converted to issues\n"
},
{
"from": "human",
"value": "from collections import Counter\nfrom math import log2\n\nfrom digestive import Sink\n\n\n# TODO: stash intermediate histograms in multiple Counters?\n# TODO: output as a spark\n# TODO: output as p... | python | chosen |
[
{
"from": "system",
"value": "Update name of pyramid function in pyramid example description\n"
},
{
"from": "human",
"value": "\"\"\"\n====================\nBuild image pyramids\n====================\n\nThe `build_gaussian_pyramid` function takes an image and yields successive\nimages shrunk by... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.