conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Rename proc object config key from proc_entry to simply object.\n"
},
{
"from": "human",
"value": "import re\nimport snmpy\n\nclass proc_query(snmpy.plugin):\n def create(self):\n for key, val in sorted(self.conf['objects'].items()):\n extra = {... | python | chosen |
[
{
"from": "system",
"value": "Enable the consul secret engine\n"
},
{
"from": "human",
"value": "\"\"\"Vault secrets engines endpoints\"\"\"\nfrom hvac.api.secrets_engines.aws import Aws\nfrom hvac.api.secrets_engines.azure import Azure\nfrom hvac.api.secrets_engines.gcp import Gcp\nfrom hvac.ap... | python | chosen |
[
{
"from": "system",
"value": "Add logic for db host during runtime\n"
},
{
"from": "human",
"value": "from decouple import config\n\nfrom jobs.settings import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'test_db',\n 'U... | python | chosen |
[
{
"from": "system",
"value": "Change hello world to include my github username\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Prints a ``Hello World`` statement.\"\"\"\n\n\nprint \"Hello Derrick Naminda!\"\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Use proper setting for static files in development\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import patterns, url, include\nfrom django.conf.urls.static import static\nfrom django.contrib.gis import admin\nfrom huts.u... | python | chosen |
[
{
"from": "system",
"value": "Update for 1.6.0 - TODO: add Windows"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name = 'brunnhilde',\n version = '1.5.3',\n url = 'https://github.com/timothyryanwalsh/brunnhilde',\n author = 'Tim Walsh',\n author_email =... | python | chosen |
[
{
"from": "system",
"value": "Add dev credentials for transformer rabbitmq user\n"
},
{
"from": "human",
"value": "DATABASE_NAME = \"backdrop\"\nMONGO_HOSTS = ['localhost']\nMONGO_PORT = 27017\nLOG_LEVEL = \"DEBUG\"\nDATA_SET_AUTO_ID_KEYS = {\n \"lpa_volumes\": (\"key\", \"start_at\", \"end_a... | python | chosen |
[
{
"from": "system",
"value": "Delete 'borad_slug' parameter on 'new_comment' url\n"
},
{
"from": "human",
"value": "# Created by JHJ on 2016. 10. 5.\n\nfrom django.conf.urls import url\n\nfrom . import views\n\napp_name = 'board'\nurlpatterns = [\n url(r'^$', views.board_list, name='board_lis... | python | chosen |
[
{
"from": "system",
"value": "Remove strange outbox requirement for SSLIFY_DISABLE\n\nI don't understand why that was a condition of the SSLIFY_DISABLE flag, so I removed it."
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core import mail\nfrom django.http import ... | python | chosen |
[
{
"from": "system",
"value": "Fix a typo in precompute_word_count command help text.\n"
},
{
"from": "human",
"value": "import tqdm\n\nfrom django.core.management.base import BaseCommand\n\nimport manoseimas.common.utils.words as words_utils\nimport manoseimas.mps_v2.models as mpsv2_models\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Make the version number just dev instead of numbers and releases are more frequent now\n"
},
{
"from": "human",
"value": "from .global_vars import HAS_PANDAS, device\n\n__all__ = [\"HAS_PANDAS\", \"device\"]\n__version__ = \"v0.1.9.dev11\"\n"
},
{
"from": "g... | python | chosen |
[
{
"from": "system",
"value": "Delete existing urls before each run\n"
},
{
"from": "human",
"value": "import csv\nimport os\n\nfrom django.core.management.base import BaseCommand\n\nimport resultsbot\nfrom elections.models import Election\n\n\nclass Command(BaseCommand):\n def handle(self, **... | python | chosen |
[
{
"from": "system",
"value": "Add builtAssets to webserver-writable dirs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nSet the file permissions appropriately for deployment. Call with the argument\nof the webserver user (e.g. 'www-data') that should have permissions to uploa... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Add ids for balance product in transactions_not_entry_line\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# © <YEAR(S)> <AUTHOR(S)>\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nfrom openerp import api, _, models\nfrom o... | python | chosen |
[
{
"from": "system",
"value": "LinearQueue: Add default values and changed names for getter and setter\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n''' Linear queue '''\n\n\nclass Queue:\n def __init__(self):\n self.items = list()\n\n def is_Empty(self):\n return... | python | chosen |
[
{
"from": "system",
"value": "Delete 'board_slug' in 'view_post' url\n"
},
{
"from": "human",
"value": "# Created by JHJ on 2016. 10. 5.\n\nfrom django.conf.urls import url\n\nfrom . import views\n\napp_name = 'board'\nurlpatterns = [\n url(r'^$', views.board_list, name='board_list'),\n ur... | python | chosen |
[
{
"from": "system",
"value": "Use owner or member filter for the dropdown\n"
},
{
"from": "human",
"value": "from .utils import organization_manager\nfrom .models import Organization\n\n\ndef organizations(request):\n \"\"\"\n Add some generally useful metadata to the template context\n ... | python | chosen |
[
{
"from": "system",
"value": "Add LIMIT to 10 rows\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, redirect, get_object_or_404\nfrom django.urls import reverse\nfrom mainmodels.models import Course, Review\n# Create your views here.\ndef index(req):\n mostPopularCourse... | python | chosen |
[
{
"from": "system",
"value": "[WB-8591] Fix issue where sagemaker run ids break run queues\n\n"
},
{
"from": "human",
"value": "import json\nimport os\nimport socket\n\nfrom . import files as sm_files\n\n\ndef parse_sm_secrets():\n \"\"\"We read our api_key from secrets.env in SageMaker\"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Update version 0.8.16 -> 0.8.17\n\nFixes\r\n-----\r\n* Sample sets with non-integer sample dtypes now correctly serialize"
},
{
"from": "human",
"value": "# Copyright 2018 D-Wave Systems Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");... | python | chosen |
[
{
"from": "system",
"value": "Revert \"bind flask to 127.0.0.1\"\n\nThis reverts commit 097b126e511d3d7bf5f431cc6df552843fad4477.\n\nI guess I was way wrong about that.\n"
},
{
"from": "human",
"value": "from shale import app\n\nif __name__ == '__main__':\n app.run(\n host='127.0.0.1',... | python | chosen |
[
{
"from": "system",
"value": "Fix path resolving in part.url\n"
},
{
"from": "human",
"value": "#import os, json\n#from jasy.core.Util import executeCommand\n#import jasy.core.Console as Console\n#import urllib.parse\n\n# Little helper to allow python modules in current jasylibrarys path\nimport... | python | chosen |
[
{
"from": "system",
"value": "Add Apache 2.0 license to source file\n\nAs per OpenStack licensing guide lines [1]:\n[H102 H103] Newly contributed Source Code should be licensed under\nthe Apache 2.0 license.\n[H104] Files with no code shouldn't contain any license header nor\ncomments, and must be left comp... | python | chosen |
[
{
"from": "system",
"value": "Implement Aberrant Berserker, Infested Tauren, and Spawn of N'Zoth\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\nclass OG_151:\n\t\"Tentacle of N'Zoth\"\n\tdeathrattle = Hit(ALL_MINIONS, 1)\n\n\nclass OG_156:\n\t\"Bilefin Tidehunter\... | python | chosen |
[
{
"from": "system",
"value": "Use routers instead of manual routes\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url, include\nfrom api import views\n\n# The API URLs are now determined automatically by the router.\n# Additionally, we include the login URLs for the br... | python | chosen |
[
{
"from": "system",
"value": "Add iteration tests on pipes\n"
},
{
"from": "human",
"value": "from slug import Pipe\n\n\ndef test_goesthrough():\n p = Pipe()\n p.side_in.write(b\"Hello\")\n p.side_in.close()\n\n data = p.side_out.read()\n assert data == b'Hello'\n\n\ndef test_eof(... | python | chosen |
[
{
"from": "system",
"value": "Extend RequestMock, add RequestBareMock w/o flag\n\nRequestMock always pretends that htmlmin has seen the request, so\nall other tests work normally.\n"
},
{
"from": "human",
"value": "# Copyright 2013 django-htmlmin authors. All rights reserved.\n# Use of this sour... | python | chosen |
[
{
"from": "system",
"value": "Fix response example time output"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vi:ts=4:et\n\nimport pycurl\ntry:\n from io import BytesIO\nexcept ImportError:\n from StringIO import StringIO as BytesIO\n\nbuffer = BytesIO(... | python | chosen |
[
{
"from": "system",
"value": "Add test case for dependence constants\n\nExpect to depend filename by 'CONFIG_FILENAME' constants.\n"
},
{
"from": "human",
"value": "# Copyright 2015-2016 Masayuki Yamamoto\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not u... | python | chosen |
[
{
"from": "system",
"value": "Fix issues with importing the Login form\n\nThe Login form lives in openstack_auth.forms and should be directly\nimported from that file.\n\nChange-Id: I42808530024bebb01604adbf4828769812856bf3\nCloses-Bug: #1332149\n(cherry picked from commit 345ccc9d503e6e55fe46d7813958c0081c... | python | chosen |
[
{
"from": "system",
"value": "Build eror complaining of blank lines?\n\nBuild error complaining of blank lines?\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom sorl.thumbnail.admin import AdminImageMixin\n\nfrom .models import Section, Group, Item, Image, Area, Profile... | python | chosen |
[
{
"from": "system",
"value": "Fix to use binary read format\n"
},
{
"from": "human",
"value": "from struct import unpack\nfrom os import walk, sep\nfrom os.path import expanduser\nfrom re import search\n\nshared_objects_dirs = [\n 'Library/Application Support/Google/Chrome/Default/Pepper Data/S... | python | chosen |
[
{
"from": "system",
"value": "Undo dependency name change in last migration"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (... | python | chosen |
[
{
"from": "system",
"value": "Add support for query relatives in simple example\n"
},
{
"from": "human",
"value": "from aiohttp_json_api.schema import BaseSchema, fields, relationships\n\nfrom .models import Article, Comment, People\n\n\nclass SchemaWithStorage(BaseSchema):\n @property\n d... | python | chosen |
[
{
"from": "system",
"value": "Add logging to debug hanging auth\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom accounts.models import (\n RcLdapUser,\n User\n)\nimport pam\nimport logging\n\nlogger = logging.getLogger('accounts')\n\nclass PamBackend():\n def a... | python | chosen |
[
{
"from": "system",
"value": "Remove unused import; split a long line of code\n"
},
{
"from": "human",
"value": "from openprocurement_client.client import Client\nimport sys\n\n\ndef prepare_api_wrapper(key='', host_url=\"https://api-sandbox.openprocurement.org\", api_version='0.8'):\n return... | python | chosen |
[
{
"from": "system",
"value": "Hide support functions from the public interface\n"
},
{
"from": "human",
"value": "from fabric.api import cd, run, sudo, env, execute\nfrom datetime import datetime\n\nenv.hosts = ['andrewlorente.com']\napps = {\n 'bloge': ['bloge@andrewlorente.com'],\n 'andr... | python | chosen |
[
{
"from": "system",
"value": "Add tests for Month functionality\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_months\n----------------------------------\n\nTests for `months` module.\n\"\"\"\n\nimport unittest\n\nfrom months import months\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Implement ACL for call url creation\n"
},
{
"from": "human",
"value": "from cornice import Service\nfrom tokenlib.errors import Error as TokenError\n\n\ncallurl = Service(name='callurl', path='/call-url')\ncall = Service(name='call', path='/call/{token}')\n\ndef is_... | python | chosen |
[
{
"from": "system",
"value": "Support static files via new Pelican API\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\nAUTHOR = u'Lex Toumbourou'\nSITENAME = u'LexToumbourou.com'\nSITEURL = 'http://lextoumbourou.com'... | python | chosen |
[
{
"from": "system",
"value": "Reduce the number of recent users we display.\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com>\n"
},
{
"from": "human",
"value": "from django.http import HttpResponseRedirect\nfrom django.conf import settings\nfrom django.contrib ... | python | chosen |
[
{
"from": "system",
"value": "Add some print statements for debugging.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom django.core.management.base import BaseCommand\n\nfrom pillow_retry.models import PillowError\n\nfrom corehq.apps.change_feed.producer import pro... | python | chosen |
[
{
"from": "system",
"value": "Fix admin URL import in devproject for Django 2.0\n\nFor #191\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, static, url\nfrom django.contrib import admin\n\n\nurlpatterns = [\n url(r'^admin/', include(admin.site.urls)),\n\n url(r'^fl... | python | chosen |
[
{
"from": "system",
"value": "Add in on_delete clause to work with more modern versions of Django\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n depen... | python | chosen |
[
{
"from": "system",
"value": "Add given, when, then comment\n"
},
{
"from": "human",
"value": "from test_plus.test import TestCase\n\nfrom posts.factories import PostFactory\n\n\nclass PostsTest(TestCase):\n def test_get_list(self):\n post = PostFactory()\n post_list_url = self.... | python | chosen |
[
{
"from": "system",
"value": "Make tags an optional field of Checklist\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\nfrom taggit.managers import TaggableManager\n\nclass Checklist(models.Model):\n title = models.CharField(max_len... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Think this url is causing issues\"\n\nThis reverts commit ca4df2f1f23b5ff85b7c1685c6bbcd015f9789cf.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom api import views\n\nurlpatterns = [\n url(r'^machines/(?P<serial>.+)/$', views.m... | python | chosen |
[
{
"from": "system",
"value": "Add port to logging. Fix print statement.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport network\n\nBLOCK_SIZE = 256\nPORT = 53\n\ndef listen(port):\n if port is None:\n port = PORT\n\n print('Listening for data via DNS.')\n l = n... | python | chosen |
[
{
"from": "system",
"value": "Refactor availability zone functional test\n\nUsing json format output in availability zone list functional test\n\nChange-Id: I7098b1c3bee680e47e414dcb4fa272628cdec1eb\n"
},
{
"from": "human",
"value": "# Licensed under the Apache License, Version 2.0 (the \"Lic... | python | chosen |
[
{
"from": "system",
"value": "Fix division by zero error"
},
{
"from": "human",
"value": "from __future__ import print_function, division\n\nimport time\n\nimport numpy as np\n\n\nclass Timer(object):\n\n def __init__(self):\n self.time1 = time.time()\n self.n = 0\n self.... | python | chosen |
[
{
"from": "system",
"value": "Print first element of array\n\nPrint first element of array\n"
},
{
"from": "human",
"value": "import RPi.GPIO as GPIO\nimport time\n\nfrom socketIO_client import SocketIO, LoggingNamespace\nsocketIO = SocketIO('localhost:3000')\n\ndef onCommand(*args):\n print(... | python | chosen |
[
{
"from": "system",
"value": "Remove CD permissions for program audit reader\n"
},
{
"from": "human",
"value": "# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: anze@recip... | python | chosen |
[
{
"from": "system",
"value": "Add use of local playsoud.py\n"
},
{
"from": "human",
"value": "from ..queues import QueueTtS\nfrom ..components import _BaseComponent\nfrom gtts import gTTS\nfrom playsound import playsound\n\nimport os\n\n\nclass TextToSpeech(_BaseComponent):\n\n def __init__(s... | python | chosen |
[
{
"from": "system",
"value": "Change to use class variable as logger\n"
},
{
"from": "human",
"value": "import logging\n\nlogger = logging.getLogger()\nlogger.setLevel(getattr(logging, 'INFO'))\nlogger.addHandler(logging.StreamHandler())\n\n\nclass rangelog:\n\n def __init__(self, name):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use format_html if it is available, fallback for dj 1.4\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.forms import widgets\nfrom django.forms.util import flatatt\nfrom django.utils.safestring impor... | python | chosen |
[
{
"from": "system",
"value": "Remove everything but the VERSION constants from global namespace.\n"
},
{
"from": "human",
"value": "\"\"\"\nsignac aids in the management, access and analysis of large-scale\ncomputational investigations.\n\nThe framework provides a simple data model, which helps ... | python | chosen |
[
{
"from": "system",
"value": "Switch revision query to outer join\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, unicode_literals\n\nfrom sqlalchemy.orm import joinedload, contains_eager\n\nfrom changes.api.base import APIView\nfrom changes.models import Bui... | python | chosen |
[
{
"from": "system",
"value": "Put servers in a list, use FQDNs if available, rename context var.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\nobelisk-cardiograph\nMonitor obelisk servers' heartbeat.\nAuthor: Noel Maersk <veox ta wemakethings tod net>\n\nBased on \"Pubsub e... | python | chosen |
[
{
"from": "system",
"value": "Add missing args docstring details\n"
},
{
"from": "human",
"value": "\"\"\"Return ordered groups of lessons.\"\"\"\n\nfrom collections import OrderedDict\n\n\ndef group_lessons_by_age(lessons):\n \"\"\"Return ordered groups of lessons.\n\n Lessons are grouped... | python | chosen |
[
{
"from": "system",
"value": "Improve BaseChecker class by using __metaclass__ keyword + add a filename setter\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"OpenERP community addons standard plugin for flake8\"\"\"\nfrom __future__ import absolute_import\n\nimport common_chec... | python | chosen |
[
{
"from": "system",
"value": "Change environment attribute name to datetime_format\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport arrow\n\nfrom jinja2 import nodes\nfrom jinja2.ext import Extension\n\n\nclass TimeExtension(Extension):\n tags = set(['now'])\n\n def __i... | python | chosen |
[
{
"from": "system",
"value": "TST: Update test after RE -> gs.RE change.\n"
},
{
"from": "human",
"value": "\nfrom metadatastore.utils.testing import mds_setup, mds_teardown\nfrom dataportal import DataBroker as db\nfrom bluesky.examples import *\nfrom bluesky.standard_config import RE\n\ndef se... | python | chosen |
[
{
"from": "system",
"value": "Add handler to main app\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport tornado\nfrom curldrop import StreamHandler, config\nfrom contextlib import closing\nimport sqlite3\n\nschema = '''drop table if exists files;\ncreate table files (\n... | python | chosen |
[
{
"from": "system",
"value": "Add extra fields to status info page\n"
},
{
"from": "human",
"value": "from mint.rest.modellib import Model\nfrom mint.rest.modellib import fields\n\nclass RbuilderStatus(Model):\n version = fields.CharField()\n conaryVersion = fields.CharField()\n p... | python | chosen |
[
{
"from": "system",
"value": "Validate dynamic interface's range's container, not dynamic interface's range's domain's container.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nfrom django.core.exceptions import ValidationError\nimport re\n\n\nERROR_TOO_LONG = 'MAC address is too long'\n\... | python | chosen |
[
{
"from": "system",
"value": "Add importing SdA in init script.\n"
},
{
"from": "human",
"value": "#-*- coding: utf-8 -*-\n\nfrom .dA import dA\n\n"
},
{
"from": "gpt",
"value": "#-*- coding: utf-8 -*-\n\nfrom .dA import dA\nfrom .SdA import SdAClassifier, SdARegressor\n"
}
] | python | chosen |
[
{
"from": "system",
"value": "Add function to parse team info\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"Module that is used for getting information\nabout the (MLB) league and the teams in it.\n\"\"\"\n\nimport mlbgame.data\n\nimport lxml.etree as etree\n\ndef get_league_... | python | chosen |
[
{
"from": "system",
"value": "Expand rdflib to content-type mapping.\n"
},
{
"from": "human",
"value": "#\nfrom rdflib.plugin import register\nfrom rdflib.serializer import Serializer\nfrom rdflib.parser import Parser\nimport re\n\n# Fix rdflib's ntriples parser\nfrom rdflib.plugins.parsers impo... | python | chosen |
[
{
"from": "system",
"value": "Support python 2 and 3 compatability\n"
},
{
"from": "human",
"value": "#!/bin/python\n\nimport urllib.request\nimport json\n\n\nclass RESTfulApi:\n \"\"\"\n Generic REST API call\n \"\"\"\n def __init__(self):\n \"\"\"\n Constructor\n ... | python | chosen |
[
{
"from": "system",
"value": "Update to dev version 2022-01-04"
},
{
"from": "human",
"value": "\"\"\"The version number defined here is read automatically in setup.py.\"\"\"\n\n__version__ = \"0.11.1\"\n"
},
{
"from": "gpt",
"value": "\"\"\"The version number defined here is read au... | python | chosen |
[
{
"from": "system",
"value": "Make file pattern quote the name\n\nMight not be the right place for it, but this does need to be done.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformatics Institute\nLicensed under the Apache Lice... | python | chosen |
[
{
"from": "system",
"value": "Remove overide of default scriptpath\n\n\ngit-svn-id: 9a050473c2aca1e14f53d73349e19b938c2cf203@11370 6a7f98fc-eeb0-4dc1-a6e2-c2c589a08aa6\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n__version__ = '$Id$'\n\nfrom pywikibot import family\n\n# The Wik... | python | chosen |
[
{
"from": "system",
"value": "Fix version back to .dev\n"
},
{
"from": "human",
"value": "#######################################################################\n# This file is part of steve.\n#\n# Copyright (C) 2012, 2013 Will Kahn-Greene\n# Licensed under the Simplified BSD License. See LICEN... | python | chosen |
[
{
"from": "system",
"value": "Fix a misspelling in a comment\n\nChange-Id: If049cef6def1249fd0f70e16385aa7a4167edbde\n"
},
{
"from": "human",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. Yo... | python | chosen |
[
{
"from": "system",
"value": "Add a 'b()' utility for forcing encoding to bytes.\n\nIn Python2, the 'bytes()' builtin doesn't take an encoding argument.\n"
},
{
"from": "human",
"value": "try:\n TEXT = unicode\nexcept NameError: #pragma NO COVER Py3k\n TEXT = str\n STRING_TYPES = (str, ... | python | chosen |
[
{
"from": "system",
"value": "Delete existing localhost entry for site.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\ndef set_homepage(apps, schema_editor):\n Site = apps.get_model('wagtailc... | python | chosen |
[
{
"from": "system",
"value": "Add email change process serializer\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom maker.models import Maker\n\n\nclass RegistrationRequestSerializer(serializers.Serializer):\n\n email = serializers.EmailField(required=True)\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix pylama integration to work with file skip comments\n"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom contextlib import contextmanager\nfrom typing import Any, Dict, List\n\nfrom pylama.lint import Linter as BaseLinter\n\nfrom . import api\n\n\n@cont... | python | chosen |
[
{
"from": "system",
"value": "Print some stats in the crawler\n"
},
{
"from": "human",
"value": "from scrapy.utils.project import get_project_settings\nfrom scrapy.crawler import CrawlerProcess\n\n\nif __name__ == '__main__':\n settings = get_project_settings()\n\n settings.set('LOG_FILE',... | python | chosen |
[
{
"from": "system",
"value": "Add messageType to message factory\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nimport string\nimport factory\n\nfrom django.contrib.auth.models import User\n\nfrom message.models import Message\nfrom test.utils import generate_string, lorem_ipsum\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Complete day 4 part 1\n"
},
{
"from": "human",
"value": "import hashlib\n\n\npuzzle_input = 'iwrupvqb'\n"
},
{
"from": "gpt",
"value": "import hashlib\n\n\npuzzle_input = b'iwrupvqb'\nnumber = 100000\n\nwhile True:\n key = puzzle_input + str(number).e... | python | chosen |
[
{
"from": "system",
"value": "Add insert_into_file to skeleton module\n"
},
{
"from": "human",
"value": "\"\"\"\nBasic Template system for project skeleton.\n\nskeleton is similar to the template part of PasteScript but \nwithout any dependencies; it should also be compatible with Python 3.\n\nH... | python | chosen |
[
{
"from": "system",
"value": "Include defaults in generated global args list.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom os import path\n\nfrom pyinfra.api.operation_kwargs import OPERATION_KWARGS\n\n\ndef build_global_kwargs_doc():\n this_dir = path.dirname(path.realpat... | python | chosen |
[
{
"from": "system",
"value": "Add locally referenced subtype to element referenced opcodes\n"
},
{
"from": "human",
"value": "class Reference(object):\n\n def __init__(self, type):\n super().__init__()\n self._type = type\n \n @property\n def type(self):\n re... | python | chosen |
[
{
"from": "system",
"value": "Allow iterating over rendered contents\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nfrom collections import OrderedDict\n\nfrom django.db.models import Model\nfrom django.utils.html import conditional_escape, mark_sa... | python | chosen |
[
{
"from": "system",
"value": "Add missing type hint for field_schema parameter"
},
{
"from": "human",
"value": "from typing import Any, Callable, Iterable, Optional, Type\n\nfrom django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile\nfrom pydantic.fields import ModelField\n\n_... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug that caused tests to raise a DatabaseError\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.management import call_command\n\nsettings.configure(\n DATABASES = {\n 'default': {\n 'ENGINE': 'sqlite3'... | python | chosen |
[
{
"from": "system",
"value": "Remove Home from list of popular pages\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\n\nfrom django.db.models import Count\n\nfrom mpages.models import Page, PageRead\n\n\ndef menus(request):\n main_menu = Page.objects.get(slug=\"main-men... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings to test fixtures\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n Acolyte Tests\n\"\"\"\n\nimport pytest\nfrom acolyte import create_app\nfrom acolyte.database import db\nfrom config import TestConfig, TestConfigCRSF\n\n\n@pytes... | python | chosen |
[
{
"from": "system",
"value": "Add hug_api fixture, and all future fixtures to default test config\n"
},
{
"from": "human",
"value": "\nimport sys\n\ncollect_ignore = []\n\nif sys.version_info < (3, 5):\n collect_ignore.append(\"test_async.py\")\n\nif sys.version_info < (3, 4):\n collect_ig... | python | chosen |
[
{
"from": "system",
"value": "Add prototype implementation for optimize()\n\nIt is currently doing a \"Grid search\" without actually searching for\nanything ;)\n"
},
{
"from": "human",
"value": "def optimize(f, param_spec=None, return_spec=None):\n \"\"\"Assume f has to be minimized for now.\"... | python | chosen |
[
{
"from": "system",
"value": "Set the log level of the network logger to ERROR, since it's less needed now\n"
},
{
"from": "human",
"value": "import logging\nfrom rackattack.ssh import connection\n\nformatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\nlogging.ge... | python | chosen |
[
{
"from": "system",
"value": "Modify Barcode Checksum Poster resource to dynamically overlay text\n"
},
{
"from": "human",
"value": "\"\"\"Class for Barcode Checksum Poster resource generator.\"\"\"\n\nfrom PIL import Image\nfrom utils.BaseResourceGenerator import BaseResourceGenerator\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Fix sliding window type specs\n"
},
{
"from": "human",
"value": "import itertools\nfrom typing import TypeVar, Iterator, Tuple, Optional\n\nT = TypeVar('T')\n\n\ndef window(iterator: Iterator[T], behind: int = 0, ahead: int = 0) -> Iterator[Tuple[Optional[T]]]:\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix login error in Django 1.8.\n"
},
{
"from": "human",
"value": "__author__ = 'weijia'\nfrom django.contrib.admin.sites import AdminSite\nfrom django.contrib.admin.forms import AdminAuthenticationForm\nfrom django import forms\nfrom django.utils.translation import ... | python | chosen |
[
{
"from": "system",
"value": "Remove this merge as numpy shouldn't be a dependency\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\ntwython.compat\n~~~~~~~~~~~~~~\n\nThis module contains imports and declarations for seamless Python 2 and\nPython 3 compatibility.\n\"\"\"\n\ni... | python | chosen |
[
{
"from": "system",
"value": "Use a versioned filename for the PCL profiles.\n"
},
{
"from": "human",
"value": "import glob\nimport os\nimport shutil\n\n\nclass PCLReferenceAssembliesPackage(Package):\n def __init__(self):\n Package.__init__(self,\n name='mono-p... | python | chosen |
[
{
"from": "system",
"value": "Use terminaltables.SingleTable for displaying letter bank\n"
},
{
"from": "human",
"value": "def render(object, **kw):\n if object == 'gallows':\n render_gallows(**kw)\n if object == 'bank':\n render_bank(**kw)\n if object == 'game_state':\n ... | python | chosen |
[
{
"from": "system",
"value": "Add argparse arguments to websockets server"
},
{
"from": "human",
"value": "import logging\nimport json\n\nfrom tornado import web, ioloop\nfrom sockjs.tornado import SockJSRouter, SockJSConnection\n\nfrom blimp.utils.websockets import WebSocketsRequest\n\n\nclass ... | python | chosen |
[
{
"from": "system",
"value": "Use a 3 digit semver version\n"
},
{
"from": "human",
"value": "\"\"\"\nOAuth Support for Django REST Framework\n\"\"\"\n__title__ = 'Django REST framework OAuth'\n__version__ = '0.1'\n__author__ = 'Jharrod LaFon'\n__license__ = 'MIT'\n__copyright__ = 'Copyright 201... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.