conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add fields to user serializer\n"
},
{
"from": "human",
"value": "from rest_framework import serializers as ser\n\nfrom api.base.serializers import JSONAPISerializer, LinksField, Link\n\nclass UserSerializer(JSONAPISerializer):\n\n id = ser.CharField(read_only=Tru... | python | chosen |
[
{
"from": "system",
"value": "Fix exception when task result is null\n"
},
{
"from": "human",
"value": "from selinon import StoragePool\nfrom cucoslib.models import WorkerResult, Analysis\n\nfrom .base import BaseHandler\n\n\nclass CleanPostgres(BaseHandler):\n \"\"\" Clean JSONB columns in P... | python | chosen |
[
{
"from": "system",
"value": "Adjust IMC2 trigger regex to handle multiple colons correctly.\n"
},
{
"from": "human",
"value": "import re\n\nfrom battlesnake.core.triggers import TriggerTable\nfrom battlesnake.core.triggers import Trigger\nfrom battlesnake.plugins.imc2 import imc2\nfrom battlesn... | python | chosen |
[
{
"from": "system",
"value": "Fix super call for python2\n"
},
{
"from": "human",
"value": "import sys\n\nimport xml.etree.ElementTree as ET\n\nfrom ..distributions import Distribution\nfrom .baseclock import BaseClock\nfrom .strict import StrictClock\n\n\nclass RatePriorClock (BaseClock):\n ... | python | chosen |
[
{
"from": "system",
"value": "Order screenshots by ascending upload time in the front-end\n\nSo that it's easy to order them intentionally. :)\n... Until we come up with a better ordering solution, with weights or\nsomething.\n"
},
{
"from": "human",
"value": "from django.db.models import Manage... | python | chosen |
[
{
"from": "system",
"value": "Change default port to 8080\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\n\nimport bottle\n\nimport multivid\n\n# where static files are kept\nSTATIC_FILES_ROOT = os.path.abspath(\"static\")\n\n@bottle.route(\"/\")\ndef index():\n return ... | python | chosen |
[
{
"from": "system",
"value": "Fix adjectives filename in serer.py\n"
},
{
"from": "human",
"value": "import cherrypy\nimport cgi\nfrom configReader import ConfigReader\nimport os.path\nimport hashlib\nfrom time import time\n\nconfigReader = ConfigReader(name = \"serverConfig.txt\")\nkeys = confi... | python | chosen |
[
{
"from": "system",
"value": "Add Functionality for HTTP requests\n"
},
{
"from": "human",
"value": "import socket\n\n\ndef server():\n server_socket = socket.socket(\n socket.AF_INET,\n socket.SOCK_STREAM,\n socket.IPPROTO_IP)\n server_socket.bind(('127.0.0.1', 50000)... | python | chosen |
[
{
"from": "system",
"value": "Add to log db connection url\n"
},
{
"from": "human",
"value": "import tornado.ioloop\nimport tornado.web\nimport logging\nimport motor\nfrom settings import routing\nfrom tornado.options import options\nimport os\n\nif not os.path.exists(options.log_dir):\n os.m... | python | chosen |
[
{
"from": "system",
"value": "Fix test error on Python 3\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\nimport hashlib\nimport six\n\n\nclass ObjectDict(dict):\n\n def __getattr__(self, key):\n if key in self:\n return self[key]\... | python | chosen |
[
{
"from": "system",
"value": "Use sys.platform to look at the current platform\n\nAvoids a uname system call\n"
},
{
"from": "human",
"value": "import platform, os\n\ndef is_running_on_tingbot():\n \"\"\"\n Return True if running as a tingbot.\n \"\"\"\n # TB_RUN_ON_LCD is an environ... | python | chosen |
[
{
"from": "system",
"value": "ZON-3514: Remove services and jobs from ZODB, too.\n"
},
{
"from": "human",
"value": "from lovely.remotetask.interfaces import ITaskService\nimport zeit.cms.generation\nimport zeit.cms.generation.install\nimport zope.component\n\n\ndef update(root):\n site_manage... | python | chosen |
[
{
"from": "system",
"value": "Add decimal types to Garmin PGRME fields.\n"
},
{
"from": "human",
"value": "# Garmin\r\n\r\nfrom ... import nmea\r\n\r\nclass GRM(nmea.ProprietarySentence):\r\n sentence_types = {}\r\n\r\n def __new__(_cls, manufacturer, data):\r\n name = manufacturer ... | python | chosen |
[
{
"from": "system",
"value": "Raise a DeprecationWarning when using pre-Flask-0.8 import scheme\n"
},
{
"from": "human",
"value": "from .scss import Scss\n"
},
{
"from": "gpt",
"value": "from .scss import Scss\n\nfrom warnings import warn\nwarn(DeprecationWarning('Deprecated import m... | python | chosen |
[
{
"from": "system",
"value": "Use MutableAddress instead of Address\n"
},
{
"from": "human",
"value": "# This file is part of Shoop Gifter Demo.\n#\n# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.\n#\n# This source code is licensed under the AGPLv3 license found in the\n# LICENSE file... | python | chosen |
[
{
"from": "system",
"value": "Use the existing version of params from secrets\n\nThis way we don't need to add them manually!\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom email.mime.text import MIMEText\nfrom subprocess import call\nimport sys\n\ndef send(recipient, sender, sen... | python | chosen |
[
{
"from": "system",
"value": "Fix issue displaying deferred queue\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.utils import timezone\n\n\nregister = template.Library()\n\n\n@register.filter\ndef to_localtime(time):\n '''\n A function to convert naive date... | python | chosen |
[
{
"from": "system",
"value": "Add some verbose to know if we process things\n"
},
{
"from": "human",
"value": "import sys\nimport os\nimport numpy as np\n\nfrom skcycling.utils import load_power_from_fit\nfrom skcycling.power_profile import Rpp\n\n# The first input argument corresponding to the ... | python | chosen |
[
{
"from": "system",
"value": "Change data migration to work even if facilitator group already exists\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\ndef create_facilitators_group(apps, schema_edito... | python | chosen |
[
{
"from": "system",
"value": "Clean up imports after expirements with signals for quitting\n"
},
{
"from": "human",
"value": "import subprocess\nfrom os import path, mkdir\n\nfrom tympeg.util import renameFile\nimport platform\nimport signal\nimport sys\n\n\nclass StreamSaver:\n def __init__(... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add helper function to save state\n\nSanitizes the Atom.__getstate() function for any blacklisted\nAtom members that are unimportant for state saving or\nnon-JSON-serializable\n"
},
{
"from": "human",
"value": "\"\"\"Module for Enaml widgets that are generally ... | python | chosen |
[
{
"from": "system",
"value": "Add test for Claimant slug field\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom .models import fix_url\n\nclass FixURLTest(TestCase):\n def test_none(self):\n url = None\n expected_url = None\n\n self.assertEqual(... | python | chosen |
[
{
"from": "system",
"value": "Use __all__ to shut up Flake8\n"
},
{
"from": "human",
"value": "# IMPORT ORDER MATTERS!\n\n# inherit from BaseConfig\nfrom cumulusci.core.keychain.BaseProjectKeychain import BaseProjectKeychain\nfrom cumulusci.core.keychain.BaseProjectKeychain import DEFAULT_CONNEC... | python | chosen |
[
{
"from": "system",
"value": "Use benchmark directory to load skeleton\n"
},
{
"from": "human",
"value": "import os\n\nfrom contextlib import contextmanager\nfrom collections import OrderedDict\nfrom time import process_time\n\nimport numpy as np\n\nfrom skan import csr\n\nrundir = os.path.dirna... | python | chosen |
[
{
"from": "system",
"value": "add_manager: Fix to allow dynamic ip parameters to work correctly.\n\nAddresses-Issue: Jira/AQUILONAQD-163\nWhen the dynamic ip parameters were added to the commands beyond\nadd_host that took --ip, the required_parameters array for\nadd_manager_manager was not updated. The co... | python | chosen |
[
{
"from": "system",
"value": "Make __str__ = to repr\n"
},
{
"from": "human",
"value": "\"\"\"Errors specific to TwistedSNMP\"\"\"\nnoError = 0\ntooBig = 1 # Response message would have been too large\nnoSuchName = 2 #There is no such variable name in this MIB\nbadValue = 3 # The value given has... | python | chosen |
[
{
"from": "system",
"value": "Convert TelegramBotApiException to a ApiException in ApiCall\n"
},
{
"from": "human",
"value": "from bot.api.call.params import ApiCallParams\nfrom bot.api.domain import ApiObject\nfrom bot.api.telegram import TelegramBotApiException\nfrom bot.multithreading.work im... | python | chosen |
[
{
"from": "system",
"value": "Fix regression where unable to open file on remote.\n"
},
{
"from": "human",
"value": "from sublime_plugin import TextCommand\n\nfrom ...common.file_and_repo import FileAndRepo\nfrom ..github import open_file_in_browser\n\n\nclass GsOpenFileOnRemoteCommand(TextComma... | python | chosen |
[
{
"from": "system",
"value": "Delete CONTENT_LENGTH and CONTENT_TYPE if empty.\n\nFor some reason, the WSGI server puts these things in the\nenvironment even when they were not in the request.\nTheir presence messes up the output in those cases.\n"
},
{
"from": "human",
"value": "from __future__... | python | chosen |
[
{
"from": "system",
"value": "Remove extraneous import in test.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport unittest\nimport StringIO\n\nfrom csvkit.utilities.in2csv import In2CSV\nfrom csvkit.utilities.csvstat import CSVStat\n\nclass TestIn2CSV(unittest.TestCase):\n de... | python | chosen |
[
{
"from": "system",
"value": "Fix hello world sample flow\n"
},
{
"from": "human",
"value": "from viewflow import flow, lock, views as flow_views\nfrom viewflow.base import this, Flow\nfrom viewflow.site import viewsite\n\n\nfrom .models import HelloWorldProcess\nfrom .tasks import send_hello_wo... | python | chosen |
[
{
"from": "system",
"value": "Write the formatted date data out as a module\n"
},
{
"from": "human",
"value": "from datetime import datetime, timedelta\nimport sys\n\nfrom icalendar import Calendar\n\n\ndef data_for_vevent(ev):\n start_date, end_date = [ev[which].dt.replace(tzinfo=None) + tim... | python | chosen |
[
{
"from": "system",
"value": "Include more exception data on exchange rate failure\n"
},
{
"from": "human",
"value": "import decimal\nimport logging\nimport threading\n\nimport requests\n\nlogger = logging.getLogger('btc.priceticker.exchangerate')\n\nclass ExchangeRate(threading.Thread):\n YA... | python | chosen |
[
{
"from": "system",
"value": "Print test names when running full testsuite"
},
{
"from": "human",
"value": "import sys, os\nimport unittest\n\ntry: # use the 'installed' mpi4py\n import mpi4py\nexcept ImportError: # or the no yet installed mpi4py\n from distutils.util import get_platform\n... | python | chosen |
[
{
"from": "system",
"value": "Add --insecure option to hg clone to avoid self-assigned certificate issue\n"
},
{
"from": "human",
"value": "from conans import ConanFile\nimport os\n\nclass EigenConan(ConanFile):\n name = \"eigen\"\n version = \"3.2\"\n settings = \"os\", \"compiler\", \... | python | chosen |
[
{
"from": "system",
"value": "Use receiver decorator instead of `signal.connect`\n\nI've contributed to this decorator upstream! It should be used. :-)\n"
},
{
"from": "human",
"value": "from autoslug.fields import AutoSlugField\nfrom django.contrib.auth.models import User\nfrom django.db import... | python | chosen |
[
{
"from": "system",
"value": "Use POST for all methods requiring it in specs\n\nAdded all missing methods from https://dev.twitter.com/docs/api/1.1\nAlso included some of the streaming methods which work with both GET\nand POST but accept arguments like \"track\" which can quickly require\nPOST.\n\n(Closes ... | python | chosen |
[
{
"from": "system",
"value": "Add an additional null handler\n"
},
{
"from": "human",
"value": "\"\"\"\nRejected is a Python RabbitMQ Consumer Framework and Controller Daemon\n\n\"\"\"\n__author__ = 'Gavin M. Roy <gavinmroy@gmail.com>'\n__since__ = \"2009-09-10\"\n__version__ = \"3.4.2\"\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Add tests for CheckoutSessionMixin.check_basket_is_valid method.\n"
},
{
"from": "human",
"value": "import mock\n\nfrom django.test import TestCase\n\nfrom oscar.apps.checkout.mixins import OrderPlacementMixin\n\n\nclass TestOrderPlacementMixin(TestCase):\n\n def... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug in the cache manager\n\nIt is possible that the previous state is None\n"
},
{
"from": "human",
"value": "import pickle\nimport claripy\nimport logging\nfrom ..simprocedures import receive\n\nl = logging.getLogger(\"tracer.cachemanager.CacheManager\")\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Make ChannelLevel actually a valid module\n"
},
{
"from": "human",
"value": "from twisted.plugin import IPlugin\nfrom txircd.module_interface import IModuleData, ModuleData\nfrom zope.interface import implements\n\nclass ChannelLevel(ModuleData):\n\timplements(IModu... | python | chosen |
[
{
"from": "system",
"value": "Put prefix to enum values. Removed old hack.\n"
},
{
"from": "human",
"value": "from scripts.old_single_meta_class_generator import CUBA_DATA_CONTAINER_EXCLUDE\n\n\nclass CUBAEnumGenerator(object):\n \"\"\"Generator class for cuba.py enumeration.\n \"\"\"\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Convert JSON blob to relational db structure.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# chameleon-crawler\n#\n# Copyright 2015 ghostwords.\n#\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of... | python | chosen |
[
{
"from": "system",
"value": "Add is_silent & is_dry_run arguments to module API\n\nThis way all the features of the command line commands is also in the module API\n"
},
{
"from": "human",
"value": "\"\"\"\ndploy script is an attempt at creating a clone of GNU stow that will work on\nWindows as... | python | chosen |
[
{
"from": "system",
"value": "Add jsonify to api returns"
},
{
"from": "human",
"value": "from flask import Blueprint\n\n# Set up api Blueprint\napi = Blueprint('api', __name__)\n\n# API Post Route\n@api.route('/create', methods=['GET', 'POST'])\ndef api_create():\n return \"Create JSON Bluep... | python | chosen |
[
{
"from": "system",
"value": "Test anonymous user do not access user list endpoint\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.contrib.auth.models import User\nfrom rest_framework import status\nfrom rest_framework.test import APIClient, APIRequestFactory, \\... | python | chosen |
[
{
"from": "system",
"value": "Convert variable from int to float, in order to accept floating value as well\n"
},
{
"from": "human",
"value": "number = raw_input('Enter a number to find a square : ')\ntry :\n actualNumber = int(number)**2\n print 'Square of the number is', actualNumber\nexcept... | python | chosen |
[
{
"from": "system",
"value": "Update RAML Cop version requirement to 1.0.0\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Ethan Zimmerman,,,\n# Copyright (c) 2014 Ethan Zimmerman,,,\n#\n# License: MIT\... | python | chosen |
[
{
"from": "system",
"value": "Check for the asset directory once at the beginning\n"
},
{
"from": "human",
"value": "\nfrom subprocess import check_call\nimport urllib\nimport json\nimport os\nimport os.path\n\n\ndef install():\n with open('.bowerrc') as f:\n bowerrc = json.load(f)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add source link to docstring\n"
},
{
"from": "human",
"value": "\"\"\"\n[Tutorials] for [TensorFlow].\n\n[Tutorials]: https://www.tensorflow.org/versions/r0.8/tutorials/index.html\n[TensorFLow]: https://www.tensorflow.org/\n\"\"\"\nfrom .version import __version__\n... | python | chosen |
[
{
"from": "system",
"value": "Fix PicleCache error on Python3\n"
},
{
"from": "human",
"value": "from __future__ import with_statement\nimport os\nimport pickle\nfrom contextlib import closing\ntry:\n from redis import Redis\nexcept ImportError:\n Redis = None\n\n\nclass Cache(object):\n ... | python | chosen |
[
{
"from": "system",
"value": "Mark all fields as read only in the dashboard\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom jarbas.core.models import Reimbursement\n\n\nclass SuspiciousListFilter(admin.SimpleListFilter):\n\n title = 'Is suspicious'\n\n parameter_n... | python | chosen |
[
{
"from": "system",
"value": "Stop reactor and find files\n"
},
{
"from": "human",
"value": "from twisted.internet.protocol import DatagramProtocol\nfrom twisted.internet import reactor\nfrom twisted.application.internet import MulticastServer\n\nfrom BeautifulSoup import BeautifulSoup, SoupStra... | python | chosen |
[
{
"from": "system",
"value": "Update with new metadata file system (removing use of ggd repo cloning)\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport os\nimport sys\nimport subprocess as sp\nimport pytest\nimport yaml\nimport requests\nimport argparse\nimport re\... | python | chosen |
[
{
"from": "system",
"value": "Replace bytes by strings in zilencer/migrations.\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\n dependencies = [\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix import error due to wrong import line\n"
},
{
"from": "human",
"value": "# Copyright (c) 2016, Daniele Venzano\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 may ... | python | chosen |
[
{
"from": "system",
"value": "[Discord] Remove no longer used Missing Capability error\n\n"
},
{
"from": "human",
"value": "\nfrom discord.ext.commands.errors import CommandError\n\nclass NotServerOwner(CommandError):\n\t'''Not Server Owner'''\n\tpass\n\nclass VoiceNotConnected(CommandError):\n\... | python | chosen |
[
{
"from": "system",
"value": "Store hyperparameters with the other settings\n\nInstead of storing them in their own 'parameters' directory. "
},
{
"from": "human",
"value": "from __future__ import print_function, absolute_import, division\n\nimport csv\nimport json\nfrom six.moves import cString... | python | chosen |
[
{
"from": "system",
"value": "Change module docstring to make Travis CI build pass\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jack Brewer\n# Copyright (c) 2015 Jack Brewer\n#\n# License: MIT\n\n\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix test cases for Python2\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport itertools\n\nimport pytest\nimport six\nfrom six... | python | chosen |
[
{
"from": "system",
"value": "Validate email the correct way"
},
{
"from": "human",
"value": "from django.contrib.auth.backends import ModelBackend\nfrom django.core.validators import email_re\nfrom django.contrib.auth import models, load_backend, login\nfrom django.conf import settings\n\n\ncla... | python | chosen |
[
{
"from": "human",
"value": "judge: Add basic compiling ability capable of throwing 'CompilationError'.\n"
},
{
"from": "gpt",
"value": "import hashlib\nimport os\nimport subprocess\n\nclass CompilationError(Exception):\n def __init__(self,e):\n self.e = e\n def __str__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add export inline for Nurse Registrations\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import NurseSource, NurseReg\n\nadmin.site.register(NurseSource)\nadmin.site.register(NurseReg)\n"
},
{
"from": "gpt",
"value": ... | python | chosen |
[
{
"from": "system",
"value": "Add New Temps to Beginning\n"
},
{
"from": "human",
"value": "import time\n\nimport requests\n\n\nclass TemperatureMonitor:\n def __init__(self, temperature_sensor, interval=60, smoothing=5, observers=()):\n self.temperature_sensor = temperature_sensor\n ... | python | chosen |
[
{
"from": "system",
"value": "Modify init to only import available modules\n"
},
{
"from": "human",
"value": "\"\"\"Properties\n\nGiving structure (and documentation!) to the properties you use in your\ncode avoids confusion and allows users to interact flexibly and provide\nmultiple styles of i... | python | chosen |
[
{
"from": "system",
"value": "Update VCF parsing to output SNP-column sample-row DataFrame\n"
},
{
"from": "human",
"value": "import pandas\n\n\ndef read_vcf(filename):\n \"\"\"\n Reads an input VCF file containing lines for each SNP and columns with genotype info for each sample.\n\n :... | python | chosen |
[
{
"from": "system",
"value": "Set default Db to inmemory storage\n"
},
{
"from": "human",
"value": "class DefaultConfig(object):\n SECRET_KEY = '%^!@@*!&$8xdfdirunb52438#(&^874@#^&*($@*(@&^@)(&*)Y_)((+'\n SQLALCHEMY_DATABASE_URI = 'sqlite://'\n\nclass DevelopmentConfig(DefaultConfig):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add say alias to echo\n"
},
{
"from": "human",
"value": "import time\n\nclass Plugin:\n def __call__(self, bot):\n bot.on_respond(r\"ping$\", lambda bot, msg, reply: reply(\"PONG\"))\n bot.on_respond(r\"echo (.*)$\", lambda bot, msg, reply: reply(ms... | python | chosen |
[
{
"from": "system",
"value": "Implement two of the \"early\" InvalidPreconditionTests which can be checked prior to seeing the wrapping function.\n"
},
{
"from": "human",
"value": "class PreconditionError (TypeError):\n pass\n\n\ndef preconditions(*precs):\n def decorate(f):\n def g... | python | chosen |
[
{
"from": "system",
"value": "Fix a small styling error in the lazy_resolve definition\n"
},
{
"from": "human",
"value": "from django.http import HttpResponseRedirect\nfrom django.core.urlresolvers import reverse\nfrom django.contrib import messages\nfrom django.utils.functional import lazy\nfro... | python | chosen |
[
{
"from": "system",
"value": "Use relative import for file manipulation module.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nUtilities to help with common Isis patterns.\n\"\"\"\n\n__all__ = [\n 'write_file_list',\n 'file_variations',\n 'ImageName',\n]\n\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Add 'last modified' field to Post model"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n\nclass User(models.Model):\n\tdisplay_name = models.CharField(max_length=64)\n\tauth_key = models.CharField(max_length=64)\n\nclass ... | python | chosen |
[
{
"from": "system",
"value": "fix(token): Fix user token endpoint authorization\n"
},
{
"from": "human",
"value": "from flask import Response\nfrom sqlalchemy.exc import IntegrityError\n\nfrom zeus import auth\nfrom zeus.config import db\nfrom zeus.models import UserApiToken\n\nfrom .base import... | python | chosen |
[
{
"from": "system",
"value": "Make submitter a raw_id_field to prevent long select tag\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.contenttypes.admin import GenericTabularInline\n\nfrom import_export.admin import ExportMixin\n\nfrom .models import Add... | python | chosen |
[
{
"from": "system",
"value": "Complete ds: binary_tree using ls of ls\n"
},
{
"from": "human",
"value": "def binary_tree(r):\n\tpass\n\n\ndef main():\n\tpass\n\n\nif __name__ == '__main__':\n\tmain()\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import\nfrom __futu... | python | chosen |
[
{
"from": "system",
"value": "Make review feedback not a Markdown widget\n\nReview feedback wasn't supposed to be in markdown. Change the\nwidget to a regular text area.\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom markedit.widgets import MarkEdit\n\nfrom symposion.reviews... | python | chosen |
[
{
"from": "system",
"value": "Change import level of flask.\n"
},
{
"from": "human",
"value": "import StringIO\nimport base64\nimport signal\n\nfrom flask import Flask, render_template, request, make_response\n\nfrom quiver.plotter import FieldPlotter\n\napp = Flask(__name__)\n\n@app.route('/')\... | python | chosen |
[
{
"from": "system",
"value": "Add support for FTDI devices under linux\n"
},
{
"from": "human",
"value": "import subprocess\nimport time\nimport glob\n\n\ndef detectPlatform():\n data = []\n proc = subprocess.Popen([\"uname\"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)\n\n while True:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add support for cursor position, centered title, and an info bar\n"
},
{
"from": "human",
"value": "import sys\n\nESC = chr(27)\nCLEAR = ESC + \"[2J\"\nMOVE_HOME = ESC + \"[H\"\nERASE = CLEAR + MOVE_HOME\n\nLINES = 24\nCOLS = 80\n\n\nclass Display:\n ... | python | chosen |
[
{
"from": "system",
"value": "Implement checking the format of settings\n"
},
{
"from": "human",
"value": "import sublime\nimport sublime_plugin\n\n\nclass ProjectTemplateCommand(sublime_plugin.WindowCommand):\n\n def run(self):\n # Check whether the folder is open only one in the curr... | python | chosen |
[
{
"from": "system",
"value": "Fix syntax in featureCounts test\n"
},
{
"from": "human",
"value": "import sequana.featurecounts as fc\nfrom sequana import sequana_data\n\n\ndef test_featurecounts():\n RNASEQ_DIR_0 = sequana_data(\"featurecounts\") + \"/rnaseq_0\"\n RNASEQ_DIR_1 = sequana_da... | python | chosen |
[
{
"from": "system",
"value": "Use assertIn instead of assertTrue to test membership.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport unittest\n\nfrom mopidy.core import History\nfrom mopidy.models import Artist, Track\n\n\nclass PlaybackHistoryTest(unittest.T... | python | chosen |
[
{
"from": "system",
"value": "Make very basic font size calculator\n"
},
{
"from": "human",
"value": "\"\"\"Functions for working out what font_size text needs to be\"\"\"\n\ndef get_font_size(s, width, height):\n return 10\n"
},
{
"from": "gpt",
"value": "\"\"\"Functions for work... | python | chosen |
[
{
"from": "system",
"value": "Make MissingError translatable for auto install of postgis extension, plus fix some typos\n"
},
{
"from": "human",
"value": "# Copyright 2011-2012 Nicolas Bessi (Camptocamp SA)\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\"\"\"Helper to setup P... | python | chosen |
[
{
"from": "system",
"value": "Allow str type comparison in py2/3\n"
},
{
"from": "human",
"value": "\"\"\" Test utilities for ensuring the correctness of products\n\"\"\"\nimport arrow\nimport six\n\nfrom tilezilla.core import BoundingBox, Band\n\n\nMAPPING = {\n 'timeseries_id': str,\n 'a... | python | chosen |
[
{
"from": "system",
"value": "FE: Update button label (call back time picker)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"Contact constants\"\n\nfrom flask.ext.babel import lazy_gettext as _\n\n\nDAY_TODAY = 'today'\nDAY_SPECIFIC = 'specific_day'\nDAY_CHOICES = (\n (DAY_TODA... | python | chosen |
[
{
"from": "system",
"value": "Add compatibility for Haystack 2.0.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom haystack import indexes\nfrom haystack.sites import site\n\nfrom faq.settings import SEARCH_INDEX\nfrom faq.models import Topic, Question\n\n\nclass FAQIndexBase(S... | python | chosen |
[
{
"from": "system",
"value": "Create a pre-release version for PyPI, to test tweaks to readme and setup.py.\n"
},
{
"from": "human",
"value": "# Package versioning solution originally found here:\n# http://stackoverflow.com/q/458550\n\n# Store the version here so:\n# 1) we don't load dependencie... | python | chosen |
[
{
"from": "system",
"value": "Fix local opts from CLI\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nReact by calling async runners\n'''\n# Import python libs\nfrom __future__ import absolute_import, print_function, unicode_literals\n# import salt libs\nimport salt.runner\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Make it so that django build actually uses it's own code.\n"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom base import BaseBuild\nfrom pony_build import client as pony\n\nclass DjangoBuild(BaseBuild):\n\n def __init__(self):\n super(DjangoBui... | python | chosen |
[
{
"from": "system",
"value": "Add debug flag, printing debug info\n"
},
{
"from": "human",
"value": "from sys import argv\nfrom os.path import expanduser, join\nfrom argparse import ArgumentParser\n\nfrom . import __version__\nfrom .bureaucrate import init\nfrom .utils import Config\n\n\ndef pro... | python | chosen |
[
{
"from": "system",
"value": "Fix 'add user' form in Admin\n"
},
{
"from": "human",
"value": "# Django\nfrom django import forms\n\n# Local\nfrom .models import User\n\n\nclass UserCreationForm(forms.ModelForm):\n\n class Meta:\n model = User\n fields = '__all__'\n\n def save... | python | chosen |
[
{
"from": "system",
"value": "Upgrade version to 0.11.3 final\n"
},
{
"from": "human",
"value": "\"\"\"EditorConfig Python Core\"\"\"\n\nfrom editorconfig.versiontools import join_version\n\nVERSION = (0, 11, 3, \"development\")\n\n__all__ = ['get_properties', 'EditorConfigError', 'exceptions']\... | python | chosen |
[
{
"from": "system",
"value": "Store rows as dictionaries of lists.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n lilkv.columnfamily\n\n This module implements the client-facing aspect of the `lilkv` app. All\n requests are handled through this interface.\n\"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Fix property name in CondSet\n\nSigned-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com>\n"
},
{
"from": "human",
"value": "from __future__ import print_function, division\n\nfrom sympy.core.basic import Basic\nfrom sympy.sets.sets import (Set... | python | chosen |
[
{
"from": "system",
"value": "Read JSON file to be processed\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nThis script cleans and processes JSON data scraped, using Scrapy, from\nworkabroad.ph.\n\"\"\"\n\nimport argparse\nimport json\nimport sys\n\ndef main():\n parser = a... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in constructor and remove set_integrator method\n"
},
{
"from": "human",
"value": "import hoomd._integrator\n\n\nclass Operations:\n def __init__(self, simulation=None):\n self.simulation = None\n self._auto_schedule = False\n self._... | python | chosen |
[
{
"from": "system",
"value": "Allow underscore or dash in URL.\n"
},
{
"from": "human",
"value": "from rest_framework import routers\nfrom .views import (UserViewSet, SubjectViewSet,\n SubjectDetailViewSet, SessionDetailViewSet)\n\nrouter = routers.SimpleRouter()\nrouter.regis... | python | chosen |
[
{
"from": "system",
"value": "Print exception when no other info on exception is available"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport os\nimport sys\n\nsys.path.append(os.path.dirname(os.path.realpath(__file__)) +\"/pypaswas\")\n\nfrom pacasus.pacasusall import Pacasus\nimport lo... | python | chosen |
[
{
"from": "system",
"value": "Define class with `class`, not `def`\n\nI don't make calsses much, can you tell?\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nfrom twisted.internet import reactor, protocol, threads, defer\nfrom twisted.protocols.basic import LineRecei... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.