conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add sort by publish date.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\nfrom hadrian.utils import slugs\nfrom ckeditor.fields import RichTextField\nfrom taggit.managers import TaggableManager\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Improve instructions for Lesson 13 mini-project."
},
{
"from": "human",
"value": "#!/usr/bin/python\n\n\n\"\"\"\n starter code for the validation mini-project\n the first step toward building your POI identifier!\n\n start by loading/formatting the data\n\n... | python | chosen |
[
{
"from": "system",
"value": "Remove docstring tests from default tests\n"
},
{
"from": "human",
"value": "'''\n These generic test modules can be applied to :class:`wpilib.iterativerobot.IterativeRobot`\n and :class:`wpilib.samplerobot.SampleRobot` based robots.\n'''\n\n# import basic tes... | python | chosen |
[
{
"from": "system",
"value": "Clarify test_containers_to_host not using libnetwork\n\n\nFormer-commit-id: fbd7c3b5627ba288ac400944ee242f3369143291"
},
{
"from": "human",
"value": "from subprocess import CalledProcessError\n\nfrom test_base import TestBase\nfrom tests.st.utils.docker_host import ... | python | chosen |
[
{
"from": "system",
"value": "Add bestja_project_hierarchy to the list of FPBZ's modules\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n{\n 'name': \"Bestja: FBŻ\",\n 'summary': \"Installation configuration for FPBŻ\",\n 'description': \"Installation configuration for Feder... | python | chosen |
[
{
"from": "system",
"value": "Fix error with generate URL\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom flask import Flask, request, json\nfrom flask.ext.cors import CORS\nimport database\nimport rsser\n\n# Update data before application is allowed to... | python | chosen |
[
{
"from": "system",
"value": "Fix glossary file location to relative\n"
},
{
"from": "human",
"value": "#! /usr/bin/python2.7\n# -*- coding: utf-8 -*-\n\nimport re\nfrom flask import Flask, render_template\n\nfrom settings import BABEL_SETTINGS, SERVER_SETTINGS\nfrom utils.i18n import PopongBabe... | python | chosen |
[
{
"from": "system",
"value": "Move imports to their own line\n"
},
{
"from": "human",
"value": "import zirc, ssl, socket\n\nclass Bot(zirc.Client):\n def __init__(self):\n self.connection = zirc.Socket(family=socket.AF_INET6, wrapper=ssl.wrap_socket)\n self.config = zirc.IRCConf... | python | chosen |
[
{
"from": "system",
"value": "test: Remove one of the unclosed client session warnings\n"
},
{
"from": "human",
"value": "from bowser.Bot import Bot\n\n\ndef main():\n bot = Bot()\n try:\n token = open('token.txt').read().replace('\\n', '')\n bot.run(token)\n except Except... | python | chosen |
[
{
"from": "system",
"value": "Clarify that the MathJax comment is Notebook specific.\n"
},
{
"from": "human",
"value": "\"\"\"Simple magics for display formats\"\"\"\n#-----------------------------------------------------------------------------\n# Copyright (c) 2012 The IPython Development Tea... | python | chosen |
[
{
"from": "system",
"value": "Change note trigger to tell, and make it reply\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# vim: set ts=4 et\n\nimport sqlite3\n\nfrom plugin import *\n\n\nclass Plugin(BasePlugin):\n def on_load(self, reloading):\n self.db = sqlite3.conne... | python | chosen |
[
{
"from": "system",
"value": "Add return statement to Model.get_q\n"
},
{
"from": "human",
"value": "import importlib\nimport logging\nfrom volttron.platform.agent import utils\n\n_log = logging.getLogger(__name__)\nutils.setup_logging()\n__version__ = \"0.1\"\n\n__all__ = ['Model']\n\n\nclass M... | python | chosen |
[
{
"from": "system",
"value": "Make unittests easier to deal with.\n\n- Test everything\n\n ./test_spec.py\n\n- Test suite\n\n ./test_spec.py inverted\n\n- Test unit\n\n ./test_spec.py inverted.test_7\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport unittest\nimport os\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Correct complex integrator for scalar equations\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\nfrom __future__ import division, print_function\nimport numpy as np\nfrom scipy.integrate import ode\n\n\ndef zodeint(func, y0, t):\n \"... | python | chosen |
[
{
"from": "system",
"value": "Add exception handling for invalid XSLT files\n"
},
{
"from": "human",
"value": "from django.conf import settings\r\nfrom os import path\r\n\r\nclass XmlJsonImportModuleException(Exception):\r\n pass\r\n\r\nif not hasattr(settings, 'XSLT_FILES_DIR'):\r\n raise... | python | chosen |
[
{
"from": "system",
"value": "Write bad lines to file for examination\n"
},
{
"from": "human",
"value": "import sys\nimport argparse\nimport csv\n\n\ndef examine_log(filename, save_raw=False):\n \"\"\"\n Download job log files from Amazon EC2 machines\n\n parameters:\n filename - beg... | python | chosen |
[
{
"from": "system",
"value": "Return an actual bool from any()\n"
},
{
"from": "human",
"value": "import __builtin__\n\ndef any(it):\n for obj in it:\n if obj:\n return True\n\ndef all(it):\n for obj in it:\n if not obj:\n return False\n return True\n... | python | chosen |
[
{
"from": "system",
"value": "Declare sleep as a global instead of relying on import\n\nThis is a nicer way to define it in the greenified module. Unused imports may\naccidentally disappear after using your IDE's \"optimize imports\" function.\n"
},
{
"from": "human",
"value": "__time = __import... | python | chosen |
[
{
"from": "system",
"value": "Add method to get initialize url.\n"
},
{
"from": "human",
"value": "from kolibri.plugins.app.kolibri_plugin import App\nfrom kolibri.plugins.registry import registered_plugins\n\n\nSHARE_FILE = \"share_file\"\n\nCAPABILITES = (SHARE_FILE,)\n\n\nclass AppInterface(o... | python | chosen |
[
{
"from": "system",
"value": "Test Lua's globals() and require() from Python\n"
},
{
"from": "human",
"value": "print \"----- import lua -----\"\nimport lua\nprint \"----- lg = lua.globals() -----\"\nlg = lua.globals()\nprint \"----- lg.foo = \\\"bar\\\" -----\"\nlg.foo = 'bar'\nprint \"----- lg... | python | chosen |
[
{
"from": "system",
"value": "Use standard view name for project details\n\nrestframework by default user <modelname>-detail as view name for detail model\napi views.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>\n#\n# See LICENSE... | python | chosen |
[
{
"from": "system",
"value": "Remove the expectedFailure decorator. The test has been passing for some time now.\n\n\ngit-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@138452 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from": "human",
"value": "\"\"\"\nThe evaluating printf(...) after brea... | python | chosen |
[
{
"from": "system",
"value": "Add simple test to exercise DoubleVal, TinyIntVal and BooleanVal\n"
},
{
"from": "human",
"value": "\"\"\"\nA simple demonstration of Impala UDF generation.\n\"\"\"\n\nfrom numba.ext.impala import udf, IntVal, FunctionContext\n\n@udf(IntVal(FunctionContext, IntVal, ... | python | chosen |
[
{
"from": "system",
"value": "Copy pip's import machinery wholesale\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom . import urllib3\n"
},
{
"from": "gpt",
"value": "\"\"\"\npip._vendor is for vendoring dependencies of pip to prevent needing pip to\n... | python | chosen |
[
{
"from": "system",
"value": "Add failing test for DistArrayProxy.__setitem__"
},
{
"from": "human",
"value": "import unittest\nimport numpy as np\nfrom IPython.parallel import Client\nfrom distarray.client import DistArrayContext\n\n\nclass TestDistArrayContext(unittest.TestCase):\n\n def se... | python | chosen |
[
{
"from": "system",
"value": "Fix deprecated use of function on sample test\n"
},
{
"from": "human",
"value": "import time\nfrom unittest import TestCase\n\n\nclass Sample(TestCase):\n def test_sameple_with_big_timeout(self):\n print(\"Testing false assert\")\n self.assertEquals... | python | chosen |
[
{
"from": "system",
"value": "Fix import location of environment variables\n"
},
{
"from": "human",
"value": "#-*- coding: utf-8 -*-\n\nfrom flask.ext.script import Manager, prompt, prompt_bool, prompt_pass\nfrom db_create import (\n init_db,\n drop_db,\n init_admin_user,\n init_entr... | python | chosen |
[
{
"from": "system",
"value": "Remove redundant empty line at end of file\n\nThere is no need to have multiple empty lines in the end.\n"
},
{
"from": "human",
"value": "\"\"\"Power Digit Sum\n\n2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.\n\nWhat is the sum of the digits of ... | python | chosen |
[
{
"from": "system",
"value": "migrations: Fix mypy error in placeholder migration.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.db import migrations\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('zerver', '0126_prereg_remove_users_without_... | python | chosen |
[
{
"from": "system",
"value": "Add another solution for 'Number complement' problem\n"
},
{
"from": "human",
"value": "# Time: O(1)\n# Space: O(1)\n\n# Given a positive integer, output its complement number.\n# The complement strategy is to flip the bits of its binary representation.\n#\n# Note:... | python | chosen |
[
{
"from": "system",
"value": "Compress Discord event connectors into single function\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.announce.discord.connections\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAnnounce events on Discord.\n\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Revised... | python | chosen |
[
{
"from": "system",
"value": "MP3: Move files/tracklist count check to function\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nimport ID3\nimport os\nimport sys\n\ndef read_tracklist():\n tracklist = []\n for line in sys.stdin:\n tracklist.append(line)\n return tracklis... | python | chosen |
[
{
"from": "system",
"value": "Comment out the Shove object, as we are not using it yet\n"
},
{
"from": "human",
"value": "\"\"\"The application's Globals object\"\"\"\n\nfrom app_factory import AppFactoryDict\n\nclass Globals(object):\n \"\"\"Globals acts as a container for objects available ... | python | chosen |
[
{
"from": "system",
"value": "Handle HTTP errors raised within web handlers\n"
},
{
"from": "human",
"value": "\"\"\"Collection of HTTP helpers.\"\"\"\n\nfrom functools import partial, wraps\nfrom inspect import iscoroutine\n\nfrom aiohttp.web import json_response\n\n\ndef async_json_out(orig_me... | python | chosen |
[
{
"from": "system",
"value": "Add modals for creating objects\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: jernej@reciprocitylabs.co... | python | chosen |
[
{
"from": "system",
"value": "Fix random module's help message\n"
},
{
"from": "human",
"value": "def add_random(self, command):\n import random\n global selected_songs\n filelist = []\n for root, dirs, files in os.walk(MUSIC_PATH):\n for name in files:\n root = roo... | python | chosen |
[
{
"from": "system",
"value": "Add url to the license api serializer\n"
},
{
"from": "human",
"value": "from rest_framework import serializers as ser\n\nfrom api.base.serializers import (\n JSONAPISerializer, LinksField, IDField, TypeField\n)\nfrom api.base.utils import absolute_reverse\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Fix race condition in detumbling experiment test\n\nIn detumbling experiment test, experiment was commanded to run for 4\nhours. After that OBC time was advanced also by 4 hours, however it was\nnot enough as during next mission loop OBC time was few milliseconds\nbefore schedu... | python | chosen |
[
{
"from": "system",
"value": "Make context a defaultdict so unknown values yield empty string\n"
},
{
"from": "human",
"value": "from django.template import TemplateDoesNotExist, TemplateSyntaxError # NOQA\nfrom django.template.backends.base import BaseEngine\nfrom django.template.backends.util... | python | chosen |
[
{
"from": "system",
"value": "Rename TestUtils test case to TestHelpers\n"
},
{
"from": "human",
"value": "from app.models import Post\nfrom app.utils.helpers import get_or_create\nfrom tests.general import AppTestCase\n\n\nclass TestUtils(AppTestCase):\n def test_get_or_create(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Load conditionally all available adapters in order to make them available right inside pygrapes.adapter module\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n__author__ = \"mib\"\n__date__ = \"$2011-01-22 12:02:41$\"\n\nfrom abstr... | python | chosen |
[
{
"from": "system",
"value": "Use uniform syntax for wsgiserver imports\n"
},
{
"from": "human",
"value": "__all__ = ['HTTPRequest', 'HTTPConnection', 'HTTPServer',\n 'SizeCheckWrapper', 'KnownLengthRFile', 'ChunkedRFile',\n 'MaxSizeExceeded', 'NoSSLError', 'FatalSSLAlert',\n... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Increase size for abbreviation field\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom odoo import models, fields, _\n\n\nclass Document_Type(models.Model):\n\n _name = 'tmc.document_type'\n\n name = fields.Char(\n string='Documen... | python | chosen |
[
{
"from": "system",
"value": "Update migration to use native JSONField\n"
},
{
"from": "human",
"value": "# Generated by Django 1.9 on 2016-11-29 11:35\n\nfrom django.db import migrations\n\nfrom ..db.fields import JSONField\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [(\"e... | python | chosen |
[
{
"from": "system",
"value": "Make the openquake namespace compatible with old setuptools\n\n\nFormer-commit-id: e5f4dc01e94694bf9bfcae3ecd6eca34a33a24eb"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright (C) 2010-2016 GEM Founda... | python | chosen |
[
{
"from": "system",
"value": "Adjust DJANGO_SETTINGS_MODULE to point to settings module\n"
},
{
"from": "human",
"value": "\"\"\"\nWSGI config for {{ project_name }} project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, s... | python | chosen |
[
{
"from": "system",
"value": "Add related name for cmsplugin ptr\n\nAdd the related name for the cmsplugin_ptr field if the Django CMS version is 3.3.1 or newer. The related name is added to the base model in Django CMS see: https://github.com/divio/django-cms/commit/871a16433f713249ee20b52574803f51941ac20c... | python | chosen |
[
{
"from": "system",
"value": "Add custom JSON serialize for Python datetime\n\nThis adds a custom JSON serializer class which stringifies Python\ndatetime objects in to ISO 8601. JSON does not specify a date/time\nformat, and many parsers break trying to parse a Date() javascript\nobject. 8601 seems a reson... | python | chosen |
[
{
"from": "system",
"value": "Add example rule for test.\n"
},
{
"from": "human",
"value": "\"\"\" Some example rules for the test suite. \"\"\"\n\n\ndef wat_rule(config, message):\n return message['wat'] == 'blah'\n\n\ndef not_wat_rule(config, message):\n return message['wat'] != 'blah'\n... | python | chosen |
[
{
"from": "system",
"value": "Add valitation for reddit domains when in URL mode\n"
},
{
"from": "human",
"value": "import logging\nfrom argparse import Namespace\n\nfrom downloaders import downloader\nfrom downloaders.downloader import Downloader\nfrom downloaders.reddit_downloader import Reddi... | python | chosen |
[
{
"from": "system",
"value": "Update webservice to listen at any interface\n"
},
{
"from": "human",
"value": "import sys\n\ntry:\n from bottle import run, post, request\nexcept ImportError:\n print(\"Install bottle to use the web service ..\")\n sys.exit(0)\n\n\nfrom detectem.cli import... | python | chosen |
[
{
"from": "system",
"value": "Change token atrribute to property\n"
},
{
"from": "human",
"value": "import logging\nimport requests\nimport xmltodict\nfrom urllib.parse import urljoin\n\n\nLOGGER = logging.getLogger('cisco_olt_http.client')\n\n\nclass Client(object):\n\n def __init__(self, ba... | python | chosen |
[
{
"from": "system",
"value": "Add season to Convention filter\n"
},
{
"from": "human",
"value": "import rest_framework_filters as filters\n\nfrom .models import (\n Chart,\n Convention,\n Group,\n Person,\n Venue,\n)\n\n\nclass ChartFilter(filters.FilterSet):\n class Meta:\n ... | python | chosen |
[
{
"from": "system",
"value": "Return only english tweet and print the body of the tweet for analysis via other tools\n"
},
{
"from": "human",
"value": "import os\nfrom utils import Reader\n\nif __name__ == '__main__':\n working_directory = os.getcwd()\n files = Reader.read_directory(workin... | python | chosen |
[
{
"from": "system",
"value": "Update devpi server index lookup result to fix integration test\n"
},
{
"from": "human",
"value": "import json\n\nNEW_INDEX = {\n 'result': {\n 'acl_toxresult_upload': [':ANONYMOUS:'], \n 'acl_upload': ['testuser'], \n 'bases': [], \n ... | python | chosen |
[
{
"from": "system",
"value": "Allow environment variable overrides for DB connection.\n\nThis allows docker-style environment variables to override the default\ndatabase connection info.\n"
},
{
"from": "human",
"value": "# Copyright 2016 Hewlett-Packard Development Company, L.P.\n#\n# Licensed ... | python | chosen |
[
{
"from": "system",
"value": "fix: Use filename for Pipeline name\n\nSee also: #72\n"
},
{
"from": "human",
"value": "# Foremast - Pipeline Tooling\n#\n# Copyright 2016 Gogo, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except i... | python | chosen |
[
{
"from": "system",
"value": "Rename only data sources with duplicates\n"
},
{
"from": "human",
"value": "from redash.models import db\n\nif __name__ == '__main__':\n db.connect_db()\n\n with db.database.transaction():\n # Make sure all data sources names are unique.\n db.dat... | python | chosen |
[
{
"from": "system",
"value": "Add multiple objects returned error.\n"
},
{
"from": "human",
"value": "# Author: Braedy Kuzma\n\nfrom django.http import HttpResponse\nfrom django.views.decorators.csrf import csrf_exempt\nfrom rest_framework.renderers import JSONRenderer\nimport uuid\nfrom dash.mo... | python | chosen |
[
{
"from": "system",
"value": "Fix models unit test for plugging it in\n"
},
{
"from": "human",
"value": "from plugging_it_in.models import TestCase\n\nfrom tests.BaseTestWithDB import BaseTestWithDB\nfrom tests.topics.TopicsTestDataGenerator import TopicsTestDataGenerator\n\n\nclass TestCaseMode... | python | chosen |
[
{
"from": "system",
"value": "[IMP] Add warehouse_id to existing onchange.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2019 Open Source Integrators\n# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).\n\nfrom odoo import api, fields, models\n\n\nclass StockRequestOrder(m... | python | chosen |
[
{
"from": "system",
"value": "Add unittest for rand and randn\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom cupy import testing\n\n\n@testing.gpu\nclass TestSample(unittest.TestCase):\n\n _multiprocess_can_split_ = True\n"
},
{
"from": "gpt",
"value": "import mock\nim... | python | chosen |
[
{
"from": "system",
"value": "Fix formatting, remove unused vars\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\nimport os\n\nimport attr\nimport pytest\n\nimport environ\n\n\n@environ.config(prefix=\"APP\")\nclass AppConfig(object):\n host... | python | chosen |
[
{
"from": "system",
"value": "Revert prev commit in this file.\n"
},
{
"from": "human",
"value": "\"\"\"Test core functions.\"\"\"\n\nimport numpy as np\nfrom tetrahydra.core import closure, perturb, power\n\n\ndef test_closure():\n \"\"\"Test closure operator.\"\"\"\n # Given\n data = ... | python | chosen |
[
{
"from": "system",
"value": "Mark Page's parent field as 'blank'\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Page(models.Model):\n \"\"\"A Page in Dyanote.\"\"\"\n created = models.DateTimeField(auto_now_add=True)\n title = models.CharField(max_length=100, ... | python | chosen |
[
{
"from": "system",
"value": "Fix for urls with user/pass\n"
},
{
"from": "human",
"value": "import requests\n\ndef dcos_api(method, endpoint, body=None, params=None):\n url = \"{url}acs/api/v1{endpoint}\".format(\n url=params['dcos_credentials']['url'],\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix datamigration definition, model methods not available when migrating.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.15 on 2018-08-15 08:08\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Refactor to new F1 erro's message\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\nfrom ooop import OOOP\r\nimport configdb\r\n\r\nO = OOOP(**configdb.ooop)\r\n\r\nimp_obj = O.GiscedataFacturacioImportacioLinia\r\n\r\nimp_del_id... | python | chosen |
[
{
"from": "system",
"value": "Use env vars to config twilio sms plugin\n"
},
{
"from": "human",
"value": "\nfrom twilio.rest import TwilioRestClient\n\nfrom alerta.app import app\nfrom alerta.plugins import PluginBase\n\nLOG = app.logger\n\nTWILIO_ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... | python | chosen |
[
{
"from": "system",
"value": "Check names of files for spaces\n"
},
{
"from": "human",
"value": "from collections import namedtuple\n\nfrom django import forms\n\nIMAGE = \"img\"\n\nUploadType = namedtuple(\"UploadType\", [\"directory\", \"label\"])\n\nFILE_TYPE_CHOICES = (\n UploadType(direc... | python | chosen |
[
{
"from": "system",
"value": "Fix reference URL for images"
},
{
"from": "human",
"value": "import matplotlib\nfrom matplotlib import pyplot as plt\n\nfrom ..utils.decorators import wraps\n\nMPL_VERSION = matplotlib.__version__\n\nROOT = \"http://{server}/testing/astropy/2018-02-01T23:31:45.0131... | python | chosen |
[
{
"from": "system",
"value": "Add basic test for read_file method\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom jsonconfigparser import JSONConfigParser\n\n\nclass JSONConfigTestCase(unittest.TestCase):\n def test_init(self):\n JSONConfigParser()\n\n def test_read_strin... | python | chosen |
[
{
"from": "system",
"value": "Fix test on older pythons\n"
},
{
"from": "human",
"value": "\"\"\"\ntests.pytests.unit.test_crypt\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nUnit tests for salt's crypt module\n\"\"\"\nimport pytest\nimport salt.crypt\nimport salt.utils.files\n\n\ndef test_get_rsa_pub_key_b... | python | chosen |
[
{
"from": "system",
"value": "Fix excessive fields in conversion\n"
},
{
"from": "human",
"value": "# Data Models\n# (C) Poren Chiang 2020\n\nimport dataclasses\nfrom ntuweather import Weather\nfrom sqlalchemy import Table, Column, DateTime, Integer, Float\nfrom sqlalchemy.ext.declarative import... | python | chosen |
[
{
"from": "system",
"value": "Change version number to indicate development version\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nversion = \"v0.0.23\"\nmodes = ['monitor', 'wallet', 'peers', 'block', 'tx', 'console', 'net', 'forks', 'quit']\n"
},
{
"from": "gpt",
"valu... | python | chosen |
[
{
"from": "system",
"value": "Remove test db setup from postgres processor\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\n\nfrom scrapi.linter.document import NormalizedDocument, RawDocument\n\n# Need to force ca... | python | chosen |
[
{
"from": "system",
"value": "Set full static path for config.json file. Necessary for launching manually\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\n\nfrom __future__ import absolute_import\nimport redis\nimport json\n\n#POOL = redis.ConnectionPool(max_connections=4, host='loc... | python | chosen |
[
{
"from": "system",
"value": "Put a blank line before section headings."
},
{
"from": "human",
"value": "\"\"\"Formatters for creating documents.\n\nA formatter is an object which accepts an output stream (usually a file or\nstandard output) and then provides a structured way for writing to that... | python | chosen |
[
{
"from": "system",
"value": "Fix name of parameter `disabledCategories`"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport requests\n\n\ndef get_languages(api_url):\n r = requests.get(api_url + \"languages\")\n return r.json()\n\n\ndef check(input_text, api_url, lang, mother... | python | chosen |
[
{
"from": "system",
"value": "Allow Mongo connections to Mongo Replicaset Cluster\n"
},
{
"from": "human",
"value": "import pymongo\n\nfrom eduid_signup.compat import urlparse\n\nDEFAULT_MONGODB_HOST = 'localhost'\nDEFAULT_MONGODB_PORT = 27017\nDEFAULT_MONGODB_NAME = 'eduid'\nDEFAULT_MONGODB_URI... | python | chosen |
[
{
"from": "system",
"value": "templates: Add django timesince filter to jinja2 filters.\n"
},
{
"from": "human",
"value": "\nfrom typing import Any\n\nfrom django.contrib.staticfiles.storage import staticfiles_storage\nfrom django.template.defaultfilters import slugify, pluralize\nfrom django.ur... | python | chosen |
[
{
"from": "system",
"value": "Update dsub version to 0.4.4.dev0\n\nPiperOrigin-RevId: 344150311\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": "Update dsub version to 0.3.8\n\nPiperOrigin-RevId: 313423046\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 complianc... | python | chosen |
[
{
"from": "system",
"value": "Fix error in field type.\n\nShould be a Char field, not a choice fie.d\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom crits.core.handlers import get_source_names\nfrom crits.core.user_tools import get_user_organization\n\nclass UploadStandardsFo... | python | chosen |
[
{
"from": "system",
"value": "Remove terminal Unicode Escape codes\n"
},
{
"from": "human",
"value": "import sublime\nimport sys\n\nclass CrossPlaformCodecs():\n @classmethod\n def decode_line(self, line):\n line = line.rstrip()\n decoded_line = self.force_decode(line) if sys... | python | chosen |
[
{
"from": "system",
"value": "Fix regex to support Mininet 20.30.40+++\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nfrom subprocess import check_output as co\nfrom sys import exit\n\n# Actually run bin/mn rather than importing via python path\nversion = 'Mininet ' + co( 'PYTHONPATH=. ... | python | chosen |
[
{
"from": "system",
"value": "Move to a generator thinger.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012 Paul Tagliamonte <paultag@debian.org>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the ... | python | chosen |
[
{
"from": "system",
"value": "Add local path to exporter template path\n"
},
{
"from": "human",
"value": "from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir\nimport os\nimport sys\n\nsys.path.append(os.path.join(jupyter_data_dir(), 'extensions'))\n\nc = get_config()\nc.Exporter.... | python | chosen |
[
{
"from": "system",
"value": "Fix decoding bug on log"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport subprocess\nimport re\nimport sublime, sublime_plugin\n\n\nclass ElmFormatCommand(sublime_plugin.TextCommand):\n\tdef run(self, edit):\n\t\tcommand = \"elm-forma... | python | chosen |
[
{
"from": "system",
"value": "Update setup.py file for numscons build.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom os.path import join\n\ndef configuration(parent_package = '', top_path = None):\n from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs... | python | chosen |
[
{
"from": "system",
"value": "Remove json route for retrieving the ip.\n"
},
{
"from": "human",
"value": "from flask import Blueprint, request, jsonify, render_template\n\n\nbp = Blueprint('views', __name__, url_prefix='')\n\n\n@bp.route('/ip', methods=['GET'])\ndef get_ip():\n return jsonify... | python | chosen |
[
{
"from": "system",
"value": "Remove warning message (now fixed)\n"
},
{
"from": "human",
"value": "\"\"\"Cassandra database example\n\nThis example demonstrates connecting to a Cassandra database and executing a query. Note that\nusing the database driver remains exactly the same. The only dif... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary Django < 1.8 check\n\nSupport for old Djangos was dropped in 4f9df0f7b764eda520b2f0428da798db02f66d97\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport django\nfrom django.utils.functional import cached_property\nfrom jinja2 impor... | python | chosen |
[
{
"from": "system",
"value": "Correct cloud type checker in TUI for localhost\n\nSigned-off-by: Adam Stokes <49c255c1d074742f60d19fdba5e2aa5a34add567@users.noreply.github.com>\n"
},
{
"from": "human",
"value": "from conjureup import events, utils\nfrom conjureup.app_config import app\n\nfrom . i... | python | chosen |
[
{
"from": "system",
"value": "Stop getting videos every time script starts\n"
},
{
"from": "human",
"value": "from death_extractor import youtube as yt\nfrom death_extractor import set_interval\nfrom death_extractor import extract_and_upload\n \ndef death_as_a_service(vid_path = 'vids', post_... | python | chosen |
[
{
"from": "system",
"value": "Add a method to test whether an attribute exists\n"
},
{
"from": "human",
"value": "import string\n\n\ndef sanitise_string(messy_str):\n \"\"\"Whitelist characters in a string\"\"\"\n valid_chars = ' {0}{1}'.format(string.ascii_letters, string.digits)\n ret... | python | chosen |
[
{
"from": "system",
"value": "Reorder fields for occurence inline\n"
},
{
"from": "human",
"value": "from django.utils.translation import ugettext_lazy as _\nfrom django.contrib import admin\nfrom mezzanine.core.admin import TabularDynamicInlineAdmin, DisplayableAdmin\n\nfrom fullcalendar.models... | python | chosen |
[
{
"from": "system",
"value": "Change database url for create_engine()\n"
},
{
"from": "human",
"value": "from sqlalchemy import create_engine, Column, String\nfrom sqlalchemy.ext.declarative import declarative_base\n\n\nBase = declarative_base()\n\n\ndef db_connect():\n \"\"\"\n Performs d... | python | chosen |
[
{
"from": "system",
"value": "Refactor Null/True/False to look more pythonic\n"
},
{
"from": "human",
"value": "def if_value(values):\n print('\"if value\":')\n for k, v in values:\n print(\"%s - %s\" % (k, 'true' if v else 'false'))\n print()\n\ndef nil_value(values):\n print('\"if value... | python | chosen |
[
{
"from": "system",
"value": "Fix bug: key_word not passed\n"
},
{
"from": "human",
"value": "from lib.cls_crawl import PixivHackLib\n\nif __name__ == '__main__':\n\tprint('Enter PHPSESSID:')\n\tPHPSESSID = raw_input()\n\tprint('Enter keyword:')\n\tkey_word = raw_input()\n\tprint('Enter minimum ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.