conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Allow creating and viewing stories\n\nCloses #1\n"
},
{
"from": "human",
"value": "import datetime\nimport json\n\nimport falcon\n\nfrom pipeline.api import models, schemas\n\ndef json_serializer(obj):\n if isinstance(obj, datetime.datetime):\n return obj.... | python | chosen |
[
{
"from": "system",
"value": "Make libsigsegv an optional dependency\n"
},
{
"from": "human",
"value": "from spack import *\n\nclass M4(Package):\n \"\"\"GNU M4 is an implementation of the traditional Unix macro processor.\"\"\"\n homepage = \"https://www.gnu.org/software/m4/m4.html\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Introduce a new error class.\n"
},
{
"from": "human",
"value": "#\n## PyMoira client library\n##\n## This file contains the Moira-related errors.\n#\n\nimport moira_constants\n\nclass MoiraBaseError(Exception):\n\t\"\"\"Any exception thrown by the library is inheret... | python | chosen |
[
{
"from": "system",
"value": "Add logging to error output\n"
},
{
"from": "human",
"value": "## module loader, goes to see which submodules have 'html' directories\n## and declares them at the toplevel\n\nimport os,importlib\n\ndef find_module_dirs():\n curdir = os.path.dirname(os.path.abspat... | python | chosen |
[
{
"from": "system",
"value": "[FIX] website_field_autocomplete: Use search_read\n* Use search_read in controller data getter, instead of custom implementation\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2016 LasLabs Inc.\n# License AGPL-3.0 or later (http://www.gnu.or... | python | chosen |
[
{
"from": "system",
"value": "Add test for external redirection.\n"
},
{
"from": "human",
"value": "\"\"\"Check external REDIRECTIONS\"\"\"\n\nimport pytest\n\nfrom nikola import __main__\n\nfrom .helper import append_config, cd\nfrom .test_demo_build import prepare_demo_site\nfrom .test_empty_b... | python | chosen |
[
{
"from": "system",
"value": "Set default locale in test to avoid test failures when different default is used than expected.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n Unit Test: orchard.extensions.babel\n\"\"\"\n\nimport unittest\n\nimport orchard\nimport orchard... | python | chosen |
[
{
"from": "system",
"value": "markdown: Document built-in preprocessor priorities for convenience.\n\nFixes #19810\n"
},
{
"from": "human",
"value": "# Note that in the Markdown preprocessor registry, the highest\n# numeric value is considered the highest priority, so the dict\n# below is ordere... | python | chosen |
[
{
"from": "system",
"value": "Fix dates in test output\n"
},
{
"from": "human",
"value": "import os\nimport re\n\nfrom lxml import etree\n\n\ndef validate_xml(xmlout):\n with open(os.path.join(os.path.dirname(__file__), 'pain.008.001.02.xsd'), 'rb') as schema_file:\n schema_xml = schem... | python | chosen |
[
{
"from": "system",
"value": "Set default LOG_LEVEL to logging.DEBUG\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nDebug tools.\n\nCan be configured by changing values of those variable.\n\nDEBUG = False\nEnable this variable to activate debug feature... | python | chosen |
[
{
"from": "system",
"value": "Remove auto include of numpy namespace.\n"
},
{
"from": "human",
"value": "\"\"\"\\\nSciPy --- A scientific computing package for Python\n===================================================\n\nYou can support the development of SciPy by purchasing documentation\nat\... | python | chosen |
[
{
"from": "system",
"value": "Add LookupEntry to the API.\n"
},
{
"from": "human",
"value": "# flake8: noqa\nfrom .dispatch import dispatch, Dispatch\nfrom .context import (dispatch_method, DispatchMethod,\n methodify, clean_dispatch_methods)\nfrom .arginfo import arginfo\nf... | python | chosen |
[
{
"from": "system",
"value": "booster-bdd: Replace hardcoded Forge API URL by variable.\n"
},
{
"from": "human",
"value": "import pytest\nimport time\nimport requests\nimport support.helpers as helpers\nimport sys\nimport re\nimport os\n\n\nclass ImportBooster(object):\n def importGithubRepo(... | python | chosen |
[
{
"from": "system",
"value": "Make sub_manager test neater and also check key_separator.\n"
},
{
"from": "human",
"value": "\"\"\"Tests for vumi.persist.redis_base.\"\"\"\n\nfrom twisted.trial.unittest import TestCase\n\nfrom vumi.persist.redis_base import Manager\n\n\nclass ManagerTestCase(Test... | python | chosen |
[
{
"from": "system",
"value": "Handle unicode paths in glow_variables\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\n\ndef glow_variables(request):\n return {\n 'MAP_DATA_URL': settings.MAP_DATA_URL,\n 'OG_ABS_URL': 'https://{}{}'.format(request.get_host()... | python | chosen |
[
{
"from": "system",
"value": "Add legacy slug to embedded Party on memberships\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom parties.models import Party, PartyDescription, PartyEmblem\n\n\nclass PartyEmblemSerializer(serializers.HyperlinkedModelSerializer):\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert back to a generator - it's actually slight faster\n"
},
{
"from": "human",
"value": "def sieve(n):\n if n < 2:\n return []\n not_prime = set()\n prime = [2]\n for i in range(3, n+1, 2):\n if i not in not_prime:\n prime.app... | python | chosen |
[
{
"from": "system",
"value": "Add test case for index rebuilding\n"
},
{
"from": "human",
"value": "import ovp_search.apps\n"
},
{
"from": "gpt",
"value": "import ovp_search.apps\nfrom django.test import TestCase\nfrom django.core.management import call_command\n\nclass RebuildIndexT... | python | chosen |
[
{
"from": "system",
"value": "tests: Add min/max \"default\" agrument test\n"
},
{
"from": "human",
"value": "# test builtin min and max functions\n\nprint(min(0,1))\nprint(min(1,0))\nprint(min(0,-1))\nprint(min(-1,0))\n\nprint(max(0,1))\nprint(max(1,0))\nprint(max(0,-1))\nprint(max(-1,0))\n\npr... | python | chosen |
[
{
"from": "system",
"value": "Enable spray to find sbt\n"
},
{
"from": "human",
"value": "\nimport subprocess\nimport sys\nimport time\nimport os\n\ndef start(args, logfile, errfile):\n if os.name == 'nt':\n subprocess.check_call('\"..\\\\sbt\\\\sbt.bat\" assembly', shell=True, cwd=\"spray\"... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fix a codacy issue\"\n\nThis reverts commit 0fe83f1bfa54eda16c42fb5d81b33215dc3ba562.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_botanick\n----------------------------------\n\nTests for `botanick` modu... | python | chosen |
[
{
"from": "system",
"value": "Add logic to try server 3 times, pausing a little more each time.\n"
},
{
"from": "human",
"value": "import os\n\ndef start_server():\n os.system('ssh pi@192.168.2.4 python python-libs/RaspberryDrive/driving_server.py &')\n return\n\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Increment PyPi package to 1.9.16.1\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Setup specs for packaging, distributing, and installing MR lib.\"\"\"\n\nimport distribute_setup\n# User may not have setuptools installed on their machines.\n# This s... | python | chosen |
[
{
"from": "system",
"value": "Replace default links and values\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\nAUTHOR = 'Vitaly Potyarkin'\nBIO = 'Unsorted ramblings, sometimes related to programming'\nSITENAME = 'Ra... | python | chosen |
[
{
"from": "system",
"value": "Remove simple testing from inside class module\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nfrom __future__ import print_function, division\n\n# Spectrum Class\n\n# Begun August 2016\n# Jason Neal\n\n\nclass Spectrum:\n \"\"\" Spectrum class represents a... | python | chosen |
[
{
"from": "system",
"value": "Add osv method from openerp\n"
},
{
"from": "human",
"value": "from openerp.osv import orm\nfrom openerp.tools.translate import _\n\n__all__ = ['OEMetaSL']\n\n\ndef get_overrides():\n overrides = {}\n\n def add_override(func):\n overrides[func.func_name... | python | chosen |
[
{
"from": "system",
"value": "Fix aiohttp utils to pass encondig to response.json\n"
},
{
"from": "human",
"value": "import asyncio\n\nimport aiohttp\n\n\n@asyncio.coroutine\ndef aiohttp_request(loop, method, url, output='text', **kwargs):\n session = aiohttp.ClientSession(loop=loop)\n res... | python | chosen |
[
{
"from": "system",
"value": "Remove the remnants of hlapi.v1arch.asyncore.sync.compat\n"
},
{
"from": "human",
"value": "#\n# This file is part of pysnmp software.\n#\n# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>\n# License: http://snmplabs.com/pysnmp/license.html\n#\nfrom pysnmp... | python | chosen |
[
{
"from": "system",
"value": "Add current_month_score and last_month_score to EmployeeListSerializer\n"
},
{
"from": "human",
"value": "from .models import Employee\nfrom rest_framework import serializers\n\n\nclass EmployeeSerializer(serializers.ModelSerializer):\n class Meta:\n model... | python | chosen |
[
{
"from": "system",
"value": "Update unittest to ignore disabled functions.\n"
},
{
"from": "human",
"value": "# OpenMV Unit Tests.\n#\nimport os, sensor, gc\n\nTEST_DIR = \"unittest\"\nTEMP_DIR = \"unittest/temp\"\nDATA_DIR = \"unittest/data\"\nSCRIPT_DIR = \"unittest/script\"\n\nif n... | python | chosen |
[
{
"from": "system",
"value": "Adjust the APIView query_set to return tasks created or assigned to the currently logged user\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom rest_framework import viewsets\nfrom rest_framework.permissions im... | python | chosen |
[
{
"from": "system",
"value": "Update of the dtypes unit-test.\n"
},
{
"from": "human",
"value": "from common import *\n\n\ndef test_dtype(ds_local):\n ds = ds_local\n for name in ds.column_names:\n assert ds[name].values.dtype == ds.dtype(ds[name])\n\n\ndef test_dtypes(ds_local):\n ds = ... | python | chosen |
[
{
"from": "system",
"value": "Add placeholder for secret key\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Application configuration.\"\"\"\n\nimport os\n\n\nclass Config(object):\n \"\"\"Base configuration.\"\"\"\n\n DEBUG = False\n TESTING = False\n APP_DIR = os... | python | chosen |
[
{
"from": "system",
"value": "Update timestamp to be a string\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport datetime\nimport random\ntimestamp = datetime.datetime.now()\nhumidity = random.random()\ntemperature = random.random() * 100\nprint \"Content-Type: application/json\"\n... | python | chosen |
[
{
"from": "system",
"value": "Mark relative imports as a rabbit hole discussion\n"
},
{
"from": "human",
"value": "\"\"\"\n _\n ___ __ _ | | ___\n / __|/ _` || | / __|\n| (__| (_| || || (__\n \\___|\\__,_||_| \\___|\n\n\nNote:\n The relative imports here (noted by the . prefix)... | python | chosen |
[
{
"from": "system",
"value": "Rearrange admin URL mount point.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\nurlpatterns = patterns(\n '',\n url(r'^admin/', include(a... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in previous commit\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom contextlib import closing\nfrom sqlite3 import connect\nfrom os.path import isfile\nfrom bottle import request, template, route, run\n\n@route('/virustotal/<db>')\ndef virus... | python | chosen |
[
{
"from": "system",
"value": "Fix MatrixStore test patching to work with LiveServerTestCase\n"
},
{
"from": "human",
"value": "import mock\nimport sqlite3\n\nfrom matrixstore.connection import MatrixStore\nfrom matrixstore import db\nfrom matrixstore.tests.import_test_data_fast import import_tes... | python | chosen |
[
{
"from": "system",
"value": "Allow for initial connection lag. Helpful when waiting for an SSH proxy to connect\n"
},
{
"from": "human",
"value": "import datetime\nimport redis\nimport urlparse\n\nimport beaver.transport\n\n\nclass RedisTransport(beaver.transport.Transport):\n\n def __init__... | python | chosen |
[
{
"from": "system",
"value": "Enhance coverage of current_closcksource to 100%\n"
},
{
"from": "human",
"value": "from falafel.mappers.current_clocksource import CurrentClockSource\nfrom falafel.tests import context_wrap\n\nCLKSRC = \"\"\"\ntsc\n\"\"\"\n\n\ndef test_get_current_clksr():\n clk... | python | chosen |
[
{
"from": "system",
"value": "Add comment showing parallel waf invocation\n"
},
{
"from": "human",
"value": "__author__ = 'RMGiroux'\n\nimport asyncio\nfrom asyncio import subprocess\nimport sys\n\nclass OutputCollector:\n def __init__(self, name):\n self.name = name\n\n @asyncio.co... | python | chosen |
[
{
"from": "system",
"value": "Add explicit fields in serializer\n"
},
{
"from": "human",
"value": "from .models import *\nfrom rest_framework import serializers\n\n\nclass MasterWorkableSerializer(serializers.ModelSerializer):\n class Meta:\n model = MasterWorkable\n"
},
{
"fro... | python | chosen |
[
{
"from": "system",
"value": "Update to new multiauthor taxonomy name\n"
},
{
"from": "human",
"value": "import sys\nimport json\nimport requests\nfrom string import Template\n\nimport dateutil.parser\n\ndef posts_at_url(url):\n \n current_page = 1\n max_page = sys.maxint\n\n while c... | python | chosen |
[
{
"from": "system",
"value": "Check that there are data files to import\n\nIt is possible for the pattern to match nothing leading to no files\nbeing imported. This is an error case so we raise an exception if it\nhappens.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nCop... | python | chosen |
[
{
"from": "system",
"value": "Add temp file sequence to take picture file\n"
},
{
"from": "human",
"value": "import picamera as p\nimport os\nimport time\n\nos.chdir('/home/pi/Desktop')\n\ncam = p.PiCamera()\ncam.resolution = (320,240)\ncam.hflip = True\ncam.vflip = True\n\nx = 0\n\nwhile x < 50... | python | chosen |
[
{
"from": "system",
"value": "Enable DBMS pool pre-pinging to avoid connection errors\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.config_defaults\n~~~~~~~~~~~~~~~~~~~~~~\n\nDefault configuration values\n\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for d... | python | chosen |
[
{
"from": "system",
"value": "Add failing rover position reporting test\n"
},
{
"from": "human",
"value": "\nfrom unittest import TestCase\nfrom rover import Rover\n\nclass TestRover(TestCase):\n\n def setUp(self):\n self.rover = Rover()\n\n def test_rover_compass(self):\n as... | python | chosen |
[
{
"from": "system",
"value": "Add worker emoji to subject\n"
},
{
"from": "human",
"value": "import os\nimport boto3\nimport botocore.exceptions\nimport logging\nimport requests\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef format_results_subject(cid, registry_action):\n '''Format the \"... | python | chosen |
[
{
"from": "system",
"value": "Backup directory is made, and a notification is sent and logged if the directory doesn't exist\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2\nimport LogUncaught, ConfigParser, logging, os\n\nsbConfig = ConfigParser.RawConfigParser()\nsbConfig.read('scripts.c... | python | chosen |
[
{
"from": "system",
"value": "Change log level for file handler\n"
},
{
"from": "human",
"value": "import config\nimport logging\nimport logging.handlers\n\n\n# ######### Set up logging ##########\n# log.basicConfig(format=\"%(asctime)s - %(levelname)s: %(message)s\", level=log.DEBUG)\nlogger = ... | python | chosen |
[
{
"from": "system",
"value": "Add int to input statements\n\nRef #23 #10\n"
},
{
"from": "human",
"value": "\"\"\"Creates the station class\"\"\"\n\n\nclass Station:\n \"\"\"\n Each train station is an instance of the Station class.\n Methods:\n __init__: creates a new stations\n ... | python | chosen |
[
{
"from": "system",
"value": "Change Celery RethinkDB backend config\n"
},
{
"from": "human",
"value": "#CELERY_RESULT_BACKEND = 'mltsp.ext.rethinkdb_backend:RethinkBackend'\n\nCELERY_RESULT_BACKEND = \"amqp\"\n\n#CELERY_RETHINKDB_BACKEND_SETTINGS = {\n # 'host': '127.0.0.1',\n # 'port': 2... | python | chosen |
[
{
"from": "system",
"value": "PythagTree: Gather Squares & Triangles Implemented\n"
},
{
"from": "human",
"value": "import sys\n\ndef gather_squares_triangles(p1,p2,depth)\n \"\"\" Draw Square and Right Triangle given 2 points, \n Recurse on new points\n \n args:\n p1,p2 (float,float) : a... | python | chosen |
[
{
"from": "system",
"value": "Fix hcalendar module __doc__ missing\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_lit... | python | chosen |
[
{
"from": "system",
"value": "Add documentation for country mapper\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom geonamescache import GeonamesCache\nfrom . import mappings\n\n\ndef country(from_key='name', to_key='iso'):\n gc = GeonamesCache()\n dataset = gc.get_dataset_... | python | chosen |
[
{
"from": "system",
"value": "Update version to 0.5.1 for Hyperion release\n"
},
{
"from": "human",
"value": "\"\"\"EVELink - Python bindings for the EVE API.\"\"\"\n\nimport logging\n\nfrom evelink import account\nfrom evelink import api\nfrom evelink import char\nfrom evelink import constants\... | python | chosen |
[
{
"from": "system",
"value": "Use prepared data, rather than the object last action date, to determine boost\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nfrom councilmatic_core.haystack_indexes import BillIndex\nfrom django.conf import settings\nfrom haystack import indexe... | python | chosen |
[
{
"from": "system",
"value": "Move imports to beginning of code\n"
},
{
"from": "human",
"value": "# Copyright 2015 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 compliance with the License.\n# You ... | python | chosen |
[
{
"from": "system",
"value": "Use CONTACT_EMAIL als default from address\n"
},
{
"from": "human",
"value": "from django.contrib.sites.models import Site\nfrom django.template.loader import get_template\nfrom django.utils import translation\n\nfrom bluebottle.clients.context import ClientContext\... | python | chosen |
[
{
"from": "system",
"value": "Fix sympy profile to work with sympy 0.7.\n\nSympy 0.7 no longer supports x,y,z = symbols('xyz').\nsymbols ('xyz') is now a single symbol 'xyz'.\n\nChange the sympy profile to symbols(x,y,z).\n"
},
{
"from": "human",
"value": "c = get_config()\napp = c.InteractiveSh... | python | chosen |
[
{
"from": "system",
"value": "Add ansible namespace in root URLconf\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.contrib.auth import views as auth_views\n\n\nurlpatterns = [\n url(r'^login/', auth_views.login, name... | python | chosen |
[
{
"from": "system",
"value": "Fix parse_datetime to parse API datetime string format with Python 3.6\n\nThe '%z' directive didn't accept 'Z' until Python 3.7\n"
},
{
"from": "human",
"value": "# Tweepy\n# Copyright 2010-2021 Joshua Roesslein\n# See LICENSE for details.\n\nimport datetime\n\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Add fixed release rat-tools versions 4, 4.1, 4.2\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# RatToolsDev\n#\n# The development versions of rattools \n#\n# Author P G Jones - 15/10/2012 <p.g.jones@qmul.ac.uk> : First revision\n#####################... | python | chosen |
[
{
"from": "system",
"value": "Add a grayscale rotation node (for testing)\n"
},
{
"from": "human",
"value": "\nimport node\nimport manager\nimport stages\nimport numpy\n\n\nclass Rotate90Node(node.Node):\n \"\"\"\n Rotate a Numpy image by num*90 degrees.\n \"\"\"\n arity = 1\n sta... | python | chosen |
[
{
"from": "system",
"value": "Rename 'name' argument to 'filename'\n"
},
{
"from": "human",
"value": "\nfrom django import template\nfrom django.utils.safestring import mark_safe\n\nfrom ..processors import AssetRegistry\n\n\nregister = template.Library()\n\n\nclass AssetsNode(template.Node):\n\... | python | chosen |
[
{
"from": "system",
"value": "Add public imports to exchange module\n"
},
{
"from": "human",
"value": "from cryptex.exchange.exchange import Exchange\nfrom cryptex.exchange.cryptsy import Cryptsy\nfrom cryptex.exchange.btce import BTCE\n"
},
{
"from": "gpt",
"value": "from cryptex.ex... | python | chosen |
[
{
"from": "system",
"value": "Fix migration for various situations\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.16 on 2019-01-28 18:20\n\nimport pickle\nfrom django.db import migrations, models\nimport evennia.utils.picklefield\nfrom evennia.utils.utils ... | python | chosen |
[
{
"from": "system",
"value": "Add the basic validation routes\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom flask import Flask\n\n\napp = Flask(__name__)\n\n\n@app.route('/')\ndef index():\n return \"Hello World!\"\n\n\napp.run(debug=True)\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Correct --no-binary option, incorrect formatting in pypi doc\n"
},
{
"from": "human",
"value": "import sys\nimport pip\nfrom .helpers import get_rhino_ironpython_path\n\nif __name__ == '__main__':\n location = None\n if len(sys.argv) > 1:\n location = s... | python | chosen |
[
{
"from": "system",
"value": "Make port number the same in both Java and Python examples\n"
},
{
"from": "human",
"value": "import procbridge\n# from procbridge import procbridge\n\n\nhost = '127.0.0.1'\nport = 8077\n\nclient = procbridge.ProcBridge(host, port)\n\nprint(client.request('echo', {}... | python | chosen |
[
{
"from": "system",
"value": "Remove reference to postgis template. Django now installs postgis when database is created.\n"
},
{
"from": "human",
"value": "import os\r\nimport inspect\r\nimport subprocess\r\nfrom django.template import Template\r\nfrom django.template import Context\r\nfrom dj... | python | chosen |
[
{
"from": "system",
"value": "Modify commit count str format\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom github import Github\n\nfrom slack.slackbot import SlackerAdapter\nfrom utils.config import Config\nfrom utils.resource import MessageResource\n\nclass GithubManager(object):\n... | python | chosen |
[
{
"from": "system",
"value": "Fix tab (change to spaces)\n\nFixes:\r\n\r\n$ python ExplorerTest.py\r\n File \"ExplorerTest.py\", line 6\r\n time.sleep(3)\r\n ^\r\nIndentationError: unexpected indent"
},
{
"from": "human",
"value": "import time\nimport spi_serial\n\nif __name__ == \"__main... | python | chosen |
[
{
"from": "system",
"value": "Add blank=True for Page.time_until field"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Chart(models.Model):\n\ttitle = models.CharField(max_length=50)\n\turl = models.CharField(max_length=1024)\n\n\tdef __unicode__(self):\n\t\treturn self.... | python | chosen |
[
{
"from": "system",
"value": "Update to flask_sqlalchemy to use python 3 import"
},
{
"from": "human",
"value": "#!flask/bin/python\nfrom flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)\napp.config.from_object('config')\ndb = SQLAlchemy(app)\n\nfrom app i... | python | chosen |
[
{
"from": "system",
"value": "Fix TLS support in socket test\n"
},
{
"from": "human",
"value": "import kaa\n\n@kaa.coroutine()\ndef new_client(client):\n ip, port = client.address\n print 'New connection from %s:%s' % (ip, port)\n #yield client.starttls_server()\n client.write('Hello... | python | chosen |
[
{
"from": "system",
"value": "Fix the freeze functional test\n"
},
{
"from": "human",
"value": "\"\"\"Test the ``dtool dataset create`` command.\"\"\"\n\nimport os\nimport shutil\n\nfrom click.testing import CliRunner\n\nfrom dtoolcore import DataSet\n\nfrom . import chdir_fixture, tmp_dir_fixtu... | python | chosen |
[
{
"from": "system",
"value": "Change hardcoded ip to localhost\n\nThis patch just changes the hardcoded ip to local host. We should really\nmake this configurable through congress.conf but this will probably be\nfine for now.\n\nChange-Id: If4980beb73e32e458d9b7dfafecb016f9c2f740c\n"
},
{
"from": "h... | python | chosen |
[
{
"from": "system",
"value": "Fix parameter spacing in statup update script invocation from workflow.\n"
},
{
"from": "human",
"value": "from airflow import DAG\nfrom airflow.operators import BashOperator, PythonOperator\nfrom datetime import datetime, timedelta\n\ndefault_args = {\n 'owner':... | python | chosen |
[
{
"from": "system",
"value": "Add a context manager to ignore exceptions\n"
},
{
"from": "human",
"value": "import sys\n\n\ndef import_class(import_str):\n \"\"\"Returns a class from a string including module and class.\"\"\"\n\n mod_str, _sep, class_str = import_str.rpartition(':')\n t... | python | chosen |
[
{
"from": "system",
"value": "Clarify --id parameter help text\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport argparse\nimport csv\nimport shutil\nimport subprocess\nimport sys\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description=\"Chain together In... | python | chosen |
[
{
"from": "system",
"value": "Create path if it doesnt exists\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Define your item pipelines here\n#\n# Don't forget to add your pipeline to the ITEM_PIPELINES setting\n# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove a for loop in favour of a dict comprehension\n"
},
{
"from": "human",
"value": "\nfrom contextlib import contextmanager\nfrom functools import wraps\n\nfrom fastats.core.ast_transforms.convert_to_jit import convert_to_jit\nfrom fastats.core.ast_transforms.pro... | python | chosen |
[
{
"from": "system",
"value": "Include id in CategoryAdmin for easier debugging\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom app.models import Category, Bookmark, Trash\n\nclass CategoryAdmin(admin.ModelAdmin):\n\tlist_display = ['name', 'user', 'row_number', 'column_... | python | chosen |
[
{
"from": "system",
"value": "Fix \"python-pip-requests-ssl\" test to no longer \"import pip\"\n\n(https://blog.python.org/2018/04/pip-10-has-been-released.html)\n\n> In addition, the previously announced reorganisation of pip's internals has now taken place. Unless you are the author of code that imports t... | python | chosen |
[
{
"from": "system",
"value": "Add default to column spam_mark_as_read"
},
{
"from": "human",
"value": "\"\"\"empty message\n\nRevision ID: 8f9ea78776f4\nRevises: 3b7eee912b41\nCreate Date: 2022-03-11 13:53:08.996055\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '8f9ea78776f4'... | python | chosen |
[
{
"from": "system",
"value": "Disable cache middleware and template loader by default. Avoid premature optimisation.\n"
},
{
"from": "human",
"value": "from ._base import *\n\nSITE_PUBLIC_PORT = None # Default: SITE_PORT\n\n# DJANGO ##############################################################... | python | chosen |
[
{
"from": "system",
"value": "Add trailing slash to forward and reverse url resolutions\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom django.utils.module_loading import import_string\n\n\ndef _load(module):\n return import_string(module) if isinstance(module, str) else module\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Raise an exception when setting a construct's type to None.\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom construct import Construct\n\n\nclass Typed (Construct, models.Model):\n\n \"\"\"Indicates that a Topic Maps construct is typed. `A... | python | chosen |
[
{
"from": "system",
"value": "Rename test class (sloppy cut n' paste job)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\nimport unittest\nfrom harness import MockRouter\n\nclass TestLog(unittest.TestCase):\n def test_backend_irc (self):\n rout... | python | chosen |
[
{
"from": "system",
"value": "Use AutoVersionClient to fix client incompatibity issues\n\nFixes #35\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport docker\nimport os\nimport sys\nimport requests\n\n\nDEFAULT_TIMEOUT_SECONDS = 600\n\n\ndef docker_client():\n # Default time... | python | chosen |
[
{
"from": "system",
"value": "ext: Remove env check as Mopidy checks deps automatically\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport os\n\nfrom mopidy import ext, config\nfrom mopidy.exceptions import ExtensionError\n\n\n__version__ = '1.0.4'\n\n\nclass Be... | python | chosen |
[
{
"from": "system",
"value": "Break how flake8 wants me to break\n"
},
{
"from": "human",
"value": "from base64 import standard_b64encode, standard_b64decode\n\nimport nacl.bindings\nimport nacl.utils\nfrom nacl.secret import SecretBox\n\nfrom pymacaroons.field_encryptors.base_field_encryptor im... | python | chosen |
[
{
"from": "system",
"value": "Add imports for error classes\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\n\nfrom ._common import _validate_null_string\nfrom ._app import v... | python | chosen |
[
{
"from": "system",
"value": "Allow country to be empty in Address model.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django_countries import CountryField\n\n\nclass Address(models.Model):\n \"\"\"\n A postal address.\n \"\"\"\n address_line1 = models.CharFi... | python | chosen |
[
{
"from": "system",
"value": "Clean-up: Use globally define number of spaces.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom lib2to3.fixer_base import BaseFix\nfrom lib2to3.pytree import Leaf\n\nSPACES = ' ' * 4\n\nclass FixTabs(BaseFix):\n '''\n For new p... | python | chosen |
[
{
"from": "system",
"value": "Add mock User and Anonymous user classes for testing\n"
},
{
"from": "human",
"value": "from django.test import TestCase as BaseTestCase\n\nfrom django.test import RequestFactory\n\nfrom permissions import PermissionsRegistry as BasePermissionsRegistry\n\n\nclass Pe... | python | chosen |
[
{
"from": "system",
"value": "tools: Exclude base/, build/, third_party/ and tools/ from cpplint.\n"
},
{
"from": "human",
"value": "#\r\n# Pre-commit check\r\n#\r\n\r\nimport pipes\r\nimport sys\r\n\r\ndef main():\r\n git_pipe = pipes.Template()\r\n git_pipe.prepend('git diff --cached --n... | python | chosen |
[
{
"from": "system",
"value": "Fix flatatt import path for Django 1.9\n"
},
{
"from": "human",
"value": "from django import forms\r\nfrom django.forms.util import flatatt\r\nfrom django.template.loader import render_to_string\r\nfrom django.utils.encoding import force_text\r\nfrom django.utils.sa... | python | chosen |
[
{
"from": "system",
"value": "Remove permission to edit tables\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom gym_app.models import Task, Athlete, PersonalTrainer, BodyScreening, WorkoutPlan, Tracker, MailBox, Message\nfrom django.contrib.auth.models import Permission\... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.