conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Replace deprecated URLopener in `donwload.py`\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom six.moves.urllib import request\n\n\ndef main():\n opener = request.FancyURLopener()\n opener.addheaders = [('User-Agent', '')]\n opener.retrieve(... | python | chosen |
[
{
"from": "system",
"value": "Change imgtool version to 1.7.0a1\n\nSigned-off-by: Ihor Slabkyy <5b878c9a28a92b9cb7e9988086921fcb7ae33592@cypress.com>\n"
},
{
"from": "human",
"value": "# Copyright 2017 Linaro Limited\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you ... | python | chosen |
[
{
"from": "system",
"value": "Include the time in the email\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport log\nfrom jinja2 import Template\nimport traceback\n\nclass Report(object):\n def __init__(self):\n self.logs = log.LogAggregator.new()\n\ndef format_exception... | python | chosen |
[
{
"from": "system",
"value": "Remove statsd code and resultant redundant code"
},
{
"from": "human",
"value": "from django.http import Http404\nfrom django_statsd.clients import statsd\n\n\nclass GraphiteMiddleware(object):\n def process_response(self, request, response):\n statsd.incr... | python | chosen |
[
{
"from": "system",
"value": "Switch to more obvious imports\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\n\nimport collections\n\nfrom xmlrpc2 import client as xmlrpc2\n\n\nclass BaseProcessor(object):\n\n def __init__(self, index... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Set the RELEASE_LINE to hawthorn\"\n\nThis reverts commit f44ac32bc9060cfa5ea6ce4284ce7f15b466be28.\n"
},
{
"from": "human",
"value": "\"\"\"\nInformation about the release line of this Open edX code.\n\"\"\"\n\n# The release line: an Open edX release name ... | python | chosen |
[
{
"from": "system",
"value": "Set logging in overwrite mode\n"
},
{
"from": "human",
"value": "# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the follo... | python | chosen |
[
{
"from": "system",
"value": "Add BootstrapForm to beautify form_template\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom django import forms\n\n# Create your forms here.\n\nclass UserForm(forms.ModelForm):\n password = forms.CharField(widget=forms.Passwor... | python | chosen |
[
{
"from": "system",
"value": "Fix indents on form module\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.contrib.auth.models import User\n\nfrom portal.models import Profile\n\n# Create your forms here.\n\nclass UserForm(forms.ModelForm):\n password = forms.CharField(... | python | chosen |
[
{
"from": "system",
"value": "Add predict path for Residual\n"
},
{
"from": "human",
"value": "from .model import Model\nfrom ...api import layerize\nfrom .affine import Affine\n\nimport cytoolz as toolz\n\n\ndef Residual(layer):\n def residual_fwd(X, drop=0.):\n y, bp_y = layer.begin_... | python | chosen |
[
{
"from": "system",
"value": "FIX bug when sending notification to multiple partners\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)\n# ... | python | chosen |
[
{
"from": "system",
"value": "Disable SSL test on python 2.5\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom tornado.testing import AsyncHTTPTestCase, LogTrapTestCase\nfrom tornado.web import Application, RequestHandler\nimport os\nimport pycurl\nimport re\nimport unittest\nimpo... | python | chosen |
[
{
"from": "system",
"value": "Use pyscrypt.py in package import if libscrypt isn't available\n"
},
{
"from": "human",
"value": "\n# First, try loading libscrypt\n_done = False\ntry:\n from pylibscrypt import *\nexcept ImportError:\n pass\nelse:\n _done = True\n\n# If that didn't work, g... | python | chosen |
[
{
"from": "system",
"value": "Rename classes to reflect intended use.\n"
},
{
"from": "human",
"value": "from twisted.application import internet\nfrom twisted.application.service import Service\nfrom twisted.internet import reactor\n\nfrom autobahn.websocket import connectWS\n\n\nclass ControlS... | python | chosen |
[
{
"from": "system",
"value": "Remove unicode string markers which are removed in python3\n"
},
{
"from": "human",
"value": "\"\"\"Improve repository owner information\n\nRevision ID: 30c0aec2ca06\nRevises: 4fdf1059c4ba\nCreate Date: 2012-09-02 14:45:05.241933\n\"\"\"\n\n# revision identifiers, u... | python | chosen |
[
{
"from": "system",
"value": "Convert entire table to cartesian\n"
},
{
"from": "human",
"value": "\"\"\"\nAdd very large RV errors for stars with no known RVs.\nConvert to cartesian.\n\"\"\"\n\nimport numpy as np\nimport sys\nsys.path.insert(0, '..')\nfrom chronostar import tabletool\nfrom astr... | python | chosen |
[
{
"from": "system",
"value": "Add hash function to RelationKey\n"
},
{
"from": "human",
"value": "\"\"\"Representation of a Myria relation key.\n\nMyria relations are identified by a tuple of user, program, relation_name.\"\"\"\n\nclass RelationKey(object):\n def __init__(self, user='public',... | python | chosen |
[
{
"from": "system",
"value": "Check input dtype before creating pcm device.\n\n\n"
},
{
"from": "human",
"value": "import numpy as np\n\nfrom _alsa import card_name, card_indexes, asoundlib_version\nfrom _alsa import Device, AlsaException\n\ndef play(input, samplerate = 48000):\n if input.ndi... | python | chosen |
[
{
"from": "system",
"value": "Move welcome message to outside the loop\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2.7\n\nimport sys\n\ndel __builtins__.__dict__['__import__']\ndel __builtins__.__dict__['reload']\n\nflag = \"eval_is_fun\"\n\nclass UnbufferedStream(object):\n def __ini... | python | chosen |
[
{
"from": "system",
"value": "Fix for_each incorrectly using lazy map operator\n"
},
{
"from": "human",
"value": "from bot.api.api import Api\nfrom bot.storage import Config, State, Cache\nfrom bot.utils.dictionaryobject import DictionaryObject\n\n\nclass Event(DictionaryObject):\n pass\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add Task's output and parameters columns\n\nChange-Id: I98f57a6a0178bb7258d82f3a165127f060f42f7b\nImplements: blueprint mistral-ui\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2014 - StackStorm, Inc.\n#\n# Licensed under the Apache Lice... | python | chosen |
[
{
"from": "system",
"value": "Call export_card_data on batch save\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom refugeedata import models, forms\n\n\nclass NumberAdmin(admin.ModelAdmin):\n\n list_display = (\"number\", \"short_id\", \"active\")\n\n\nclass BatchAd... | python | chosen |
[
{
"from": "system",
"value": "Use str methods instead of string module\n"
},
{
"from": "human",
"value": "\"\"\"\nbiobox - A command line interface for running biobox Docker containers\n\nUsage:\n biobox <command> <biobox_type> <image> [<args>...]\n\nOptions:\n -h, --help Show this scr... | python | chosen |
[
{
"from": "system",
"value": "Fix case where path is None in sanitize_path\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport os\nimport os.path\nimport sys\nimport fnmatch\nimport glob\n\nfrom nimp.utilities.logging import *\nfrom nimp.utilities.system import *\n\n#-----------... | python | chosen |
[
{
"from": "system",
"value": "Add Topics index page customization\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom .models import Protocol, Topic, Institution\n\n\nclass ProtocolAdmin(admin.ModelAdmin):\n list_display = ['number', 'start_time', 'get_topics', 'informat... | python | chosen |
[
{
"from": "system",
"value": "Remove a legacy Markdown extension when generating e-mails.\n\nThe recent updates for using Python-Markdown 3.x removed the\n`smart_strong` extension from the main Markdown procssing, but failed to\nremove it for the list of extensions used in e-mails. This is a trivial\nchange... | python | chosen |
[
{
"from": "system",
"value": "Set LMS_BASE setting for Studio\n\nThis allows previews in LMS to work properly.\n\nECOM-6634\n"
},
{
"from": "human",
"value": "\"\"\" Overrides for Docker-based devstack. \"\"\"\n\nfrom .devstack import * # pylint: disable=wildcard-import, unused-wildcard-import\... | python | chosen |
[
{
"from": "system",
"value": "Remove Smoothing From Temp Sensor\n"
},
{
"from": "human",
"value": "import smbus\n\n\nclass TemperatureSensor:\n temp_history = []\n last_temp = 0\n\n def __init__(self, address):\n self.bus = smbus.SMBus(1)\n self.address = address\n\n de... | python | chosen |
[
{
"from": "system",
"value": "Fix URLS in contact form\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom django.views.generic import TemplateView\nfrom . import views\n\nurlpatterns = patterns('',\n url(r'^$', views.ContactView.as_view(), name=\"form\"),\n ... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add pandas dataframe capability in variance_inflation_factor\n"
},
{
"from": "human",
"value": "from numpy.testing import assert_almost_equal\n\nfrom statsmodels.datasets import statecrime, get_rdataset\nfrom statsmodels.regression.linear_model import OLS\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Fix yet another stupid mistake\n"
},
{
"from": "human",
"value": "import re\nfrom django.core.exceptions import ValidationError\n\n\ndefault_validator = lambda x: x != '' # FIXME: Do we need this?\n\ndef validate_list(value, validator=default_validator, separator=',... | python | chosen |
[
{
"from": "system",
"value": "Make xvfb e files end with .err\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" util.py\n\nUtility functions/constants across seam\n\"\"\"\n__author__ = 'Scott Burns <scott.s.burns@vanderbilt.edu>'\n__copyright__ = 'Copyri... | python | chosen |
[
{
"from": "system",
"value": "Fix core logging when no message on channel\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport logging\nimport time\n\nfrom .message import Message\nfrom .utils import name_that_thing\n\nlogger = logging.getLogger('django.channels')... | python | chosen |
[
{
"from": "system",
"value": "Use same tagname but different scope\n"
},
{
"from": "human",
"value": "\"\"\"\nstate_tests.py\n\"\"\"\n\nimport os\n\nfrom os.path import splitext\nfrom minicps.state import SQLiteState\n\n\ndef test_SQLiteState():\n\n # TODO: change to /tmp when install SQLites... | python | chosen |
[
{
"from": "system",
"value": "Add `parse_value` test for AppleScript dates\n\nAdded a test case to `parse_value` to parse dates returned in\nAppleScript responses.\n"
},
{
"from": "human",
"value": "\"\"\"\ntest_itunes.py\n\nCopyright © 2015 Alex Danoff. All Rights Reserved.\n2015-08-02\n\nThis ... | python | chosen |
[
{
"from": "system",
"value": "Use get_user_model within test backend\n"
},
{
"from": "human",
"value": "from django.contrib.auth.backends import ModelBackend\nfrom django.contrib.auth.models import User\n\n\nclass ExceptionBackend(ModelBackend):\n \"\"\"Raise an exception on authentication fo... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Fix compute contains_unreserved on NewId records\n"
},
{
"from": "human",
"value": "# Copyright 2018 Camptocamp SA\n# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com)\n# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).\n\nfrom od... | python | chosen |
[
{
"from": "system",
"value": "Remove now useless TearDown method.\n\ngit-svn-id: ac2c3632cb6543e7ab5fafd132c7fe15057a1882@53797 6015fed2-1504-0410-9fe1-9d1591cc4771\n"
},
{
"from": "human",
"value": "# Basic test of dynamic code generation\nimport unittest\nimport os, glob\n\nimport stdio\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add a __repr__ method for LoginToken\n"
},
{
"from": "human",
"value": "import random\nimport re\n\nfrom django.contrib.auth.models import User\nfrom django.db import models\nfrom instances.models import InstanceMixin\n\n\nNUMBER_OF_TOKEN_WORDS = 3\n\ndef generate_t... | python | chosen |
[
{
"from": "system",
"value": "Use few nsteps for testing sim-script\n"
},
{
"from": "human",
"value": "import json\n\nimport numpy as np\nfrom click.testing import CliRunner\nfrom fastimgproto.scripts.simulate_data import cli as sim_cli\n\n\ndef test_simulate_data():\n runner = CliRunner()\n ... | python | chosen |
[
{
"from": "system",
"value": "Rename class name to be consistent with file name. Remove unused import.\n"
},
{
"from": "human",
"value": "from mock import MagicMock\nimport pyaem\nimport unittest\n\nclass TestPyAemException(unittest.TestCase):\n\n\n def test_init(self):\n\n exception = pyaem... | python | chosen |
[
{
"from": "system",
"value": "Fix making threads daemonic on Python 3.2\n"
},
{
"from": "human",
"value": "#\n# Copyright 2014 Infoxchange Australia\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": "NXP-12694: Use generic resource directory finder for icon files\n"
},
{
"from": "human",
"value": "\"\"\"Helper to lookup UI resources from package\"\"\"\n\nimport re\nimport os\nfrom nxdrive.logging_config import get_logger\n\nlog = get_logger(__name__)\n\n\ndef fi... | python | chosen |
[
{
"from": "system",
"value": "Test unrunnable script exceptions too\n"
},
{
"from": "human",
"value": "try:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\n\nfrom village import _luabject\n\n\nclass TestDirect(unittest.TestCase):\n\n def test_new(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add example code copied from django doc\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#-*- coding: UTF-8 -*-\n\nfrom functools import partial\n\nfrom django.conf import settings\nfrom plim import preprocessor as plim_preprocessor\nfrom mako.template impo... | python | chosen |
[
{
"from": "system",
"value": "i3: Remove call to GetTimeouts() after SetTimeouts()\n\nFixed in commit 72e984a54049c77208546b8565cece100e87be48 from\nm45t3r/python-dpms.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom subprocess import check_call, CalledProcessError\nfrom tempfil... | python | chosen |
[
{
"from": "system",
"value": "Add Beam, Bead to main module\n"
},
{
"from": "human",
"value": "from otz.Timestream import CalibrationTimestream, CapturedTimestream\nfrom otz.Calibration import Calibration\n"
},
{
"from": "gpt",
"value": "from otz.Timestream import CalibrationTimestre... | python | chosen |
[
{
"from": "system",
"value": "Remove user from count query to show likes count for all users for obj\n"
},
{
"from": "human",
"value": "from django.contrib.auth.decorators import login_required\nfrom django.contrib.contenttypes.models import ContentType\n\nfrom django.http import HttpResponse\nf... | python | chosen |
[
{
"from": "system",
"value": "Remove runtime dep on python-pbr, python-d2to1\n\nRequires RPM spec to fill in REDHATCINDERVERSION.\n"
},
{
"from": "human",
"value": "# Copyright 2011 OpenStack Foundation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# n... | python | chosen |
[
{
"from": "system",
"value": "Write each byte at a time in protocol\n"
},
{
"from": "human",
"value": "import serial\nimport time\nimport binascii\nimport struct\n\ndef establishConnection():\n # Define Constants\n SERIAL_DEVICE = \"/dev/ttyACM0\"\n\n # Establish Connection\n ser = serial.Se... | python | chosen |
[
{
"from": "system",
"value": "Fix test flakiness by changing timeout to a longer value\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom gaphor.misc.gidlethread import GIdleThread\n\n\ndef counter(count):\n f... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Remove unnecessary and broken DELETE check.\"\n\nThis reverts commit 7906153b4718f34ed31c193a8e80b171e567209c.\n\nReverting commit accidentally commited straight to develop.\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom go.router.view_... | python | chosen |
[
{
"from": "system",
"value": "refactor: Use global API_URL and HEADERS\n\nSee also: PSOBAT-1197\n"
},
{
"from": "human",
"value": "\"\"\"Check Taskid status.\"\"\"\nimport logging\n\nimport requests\nfrom tryagain import retries\n\nfrom ..exceptions import SpinnakerTaskError\n\nHEADERS = {'Conte... | python | chosen |
[
{
"from": "system",
"value": "Fix float type flag definition\n"
},
{
"from": "human",
"value": "import functools\nimport tensorflow as tf\n\n\n\nFLAGS = tf.app.flags.FLAGS\n\ntf.app.flags.DEFINE_string(\"batch-size\", 64, \"\")\ntf.app.flags.DEFINE_float(\"dropout-prob\", 0, \"\")\ntf.app.flags.... | python | chosen |
[
{
"from": "system",
"value": "Add comment to show usage example"
},
{
"from": "human",
"value": "from django.core.exceptions import ValidationError\n\nclass EmptyCheck(object):\n def __call__(self, value):\n if len(value.strip()) == 0:\n raise ValidationError(\"Value cannot ... | python | chosen |
[
{
"from": "system",
"value": "Make the sprint layout a bit easier to look at\n"
},
{
"from": "human",
"value": "'''\nCreate a visual representation of the various DAGs defined\n'''\n\nimport sys\nimport requests\nimport networkx as nx\nimport matplotlib.pyplot as plt\n\n\nif __name__ == '__main_... | python | chosen |
[
{
"from": "system",
"value": "Increase default batch size for align step\n"
},
{
"from": "human",
"value": "from tmlib.workflow.args import BatchArguments\nfrom tmlib.workflow.args import SubmissionArguments\nfrom tmlib.workflow.args import Argument\nfrom tmlib.workflow import register_batch_arg... | python | chosen |
[
{
"from": "system",
"value": "Replace the exceptions in backend classes\n"
},
{
"from": "human",
"value": "# author: Milan Kubik\n\nNOT_IMPLEMENTED_MSG = \"You need to override this method in a subclass\"\n\n\nclass IDMBackendException(Exception):\n pass\n\n\nclass VMsNotCreatedError(IDMBacke... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary objects from root namespace.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\nimport logging\n\nfrom . import bolt, config, follow, search, spout, twitter_api\nfrom .search import SearchManager\nfrom .tw... | python | chosen |
[
{
"from": "system",
"value": "Add shib auth to similar projects page\n"
},
{
"from": "human",
"value": "from django.shortcuts import redirect\n\nfrom approver.workflows import project_crud\nfrom approver.decorators import login_required\nimport approver.utils as utils\nfrom django.core.urlresolv... | python | chosen |
[
{
"from": "system",
"value": "Add id to API reponse for Reaction.\n"
},
{
"from": "human",
"value": "from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField\nfrom django.contrib.auth.models import User\nfrom rest_framework import serializers\nfrom .models impor... | python | chosen |
[
{
"from": "system",
"value": "Add a MAPPING table to remove duplicated loop logic\n"
},
{
"from": "human",
"value": "import logging\n\nfrom promgen.models import Project, Service\n\nlogger = logging.getLogger(__name__)\n\n\nclass SenderBase(object):\n def send(self, data):\n sent = 0\n... | python | chosen |
[
{
"from": "system",
"value": "Remove disconnected client from clients list, allow client callbacks to be set in constructor.\n"
},
{
"from": "human",
"value": "import asyncore\nimport socket\nfrom logging import error, info, warning\n\nfrom client import Client\n\nclass Server(asyncore.dispatche... | python | chosen |
[
{
"from": "system",
"value": "Add bbox to parking area view set\n"
},
{
"from": "human",
"value": "from rest_framework import viewsets\nfrom rest_framework_gis.pagination import GeoJsonPagination\nfrom rest_framework_gis.serializers import GeoFeatureModelSerializer, GeometrySerializerMethodField... | python | chosen |
[
{
"from": "system",
"value": "Create the hook for each repo\n"
},
{
"from": "human",
"value": "\"\"\"\ngithub-setup-irc-notifications - Configure all repositories in an organization\nwith irc notifications\n\"\"\"\n\nimport argparse\nimport getpass\nimport sys\n\nimport github3\n\n\ndef main():\... | python | chosen |
[
{
"from": "system",
"value": "Handle non-existent files in the database.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport rethinkdb as r\nimport optparse\n\n\nif __name__ == \"__main__\":\n parser = optparse.OptionParser()\n parser.add_option(\"-p\", \"--port\", dest=\"po... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Change product types are really dangerous!!!"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2012 OpenERP - Team de Localización Argentina.\n# https://... | python | chosen |
[
{
"from": "system",
"value": "Make the bot reload its secondary modules when you reload the plugin.\n"
},
{
"from": "human",
"value": "###\n# Copyright (c) 2007, Max Kanat-Alexander\n# All rights reserved.\n#\n#\n###\n\n\"\"\"\nInteract with Bugzilla installations.\n\"\"\"\n\nimport supybot\nimp... | python | chosen |
[
{
"from": "system",
"value": "Add upload file size limit\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport os\nfrom flask import Flask, render_template, request, redirect, url_for, send_from_directory\nfrom werkzeug import secure_filename\n\nUPLOAD_FOLDER = '/app/i... | python | chosen |
[
{
"from": "system",
"value": "Enable command-line args for configuration\n"
},
{
"from": "human",
"value": "from scanresults import ScanResults\nimport sys\n\nsr = ScanResults()\nsr.add_files(*sys.argv[1:])\n\nsr.train()\nout = sr.sentences()\nif out is not None:\n print(out)\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Remove unused imports and sort\n"
},
{
"from": "human",
"value": "import sys\nimport os\nsys.path.insert(0, os.path.dirname(__file__))\nfrom . import multiscanner, storage\ncommon = multiscanner.common\nmultiscan = multiscanner.multiscan\nparse_reports = multiscanne... | python | chosen |
[
{
"from": "system",
"value": "Change prompt to a diamond\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport token\nimport lexer as l\nimport parser as p\nimport evaluator as e\nimport context as c\n\ndef main(ctx):\n string = input(\">> \")\n string = string.replace(\"\\\\... | python | chosen |
[
{
"from": "system",
"value": "Add comment on dist of first function"
},
{
"from": "human",
"value": "import pandas\nimport numpy\nimport matplotlib.pyplot as plt\n\n\ndef univariate_stats():\n num_examples = 1000\n z = pandas.Series(numpy.random.randn(num_examples))\n\n # Minimum\n p... | python | chosen |
[
{
"from": "system",
"value": "Add Minecraft Wiki link to version item\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python3\n\nimport requests\n\npeople = requests.get('https://api.wurstmineberg.de/v2/people.json').json()\nstatus = requests.get('https://api.wurstmineberg.de/v2/world/wurstm... | python | chosen |
[
{
"from": "system",
"value": "Fix CSS problem when Flexx is enbedded in page-app\n"
},
{
"from": "human",
"value": "\"\"\" Layout widgets\n\"\"\"\n\nfrom . import Widget\n\n\nclass Layout(Widget):\n \"\"\" Abstract class for widgets that organize their child widgets.\n \n Panel widgets ... | python | chosen |
[
{
"from": "system",
"value": "Update Arch package to 2.7\n"
},
{
"from": "human",
"value": "#\n# Biicode Arch Linux package settings.\n# \n# Check PKGBUILD_template docs for those settings and \n# what they mean.\n#\n\ndef settings():\n\treturn { \"version\": \"2.6.1\",\n\t\t\t \"release_number\... | python | chosen |
[
{
"from": "system",
"value": "Update upstream version of vo\n"
},
{
"from": "human",
"value": "from distutils.core import Extension\nfrom os.path import join\n\nfrom astropy import setup_helpers\n\n\ndef get_extensions(build_type='release'):\n VO_DIR = 'astropy/io/vo/src'\n\n return [Exten... | python | chosen |
[
{
"from": "system",
"value": "Use the URLs input in the UI boxes\n\nParse JSON from two separate URL input boxes, instead of using one input\nbox and parsing one long string containing both URLs.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom __future__ import print_function\ni... | python | chosen |
[
{
"from": "system",
"value": "Drop use of 'oslo' namespace package\n\nThe Oslo libraries have moved all of their code out of the 'oslo'\nnamespace package into per-library packages. The namespace package was\nretained during kilo for backwards compatibility, but will be removed by\nthe liberty-2 milestone. ... | python | chosen |
[
{
"from": "system",
"value": "Add `Post`, `Tag` models to Admin\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\n# Register your models here.\n"
},
{
"from": "gpt",
"value": "from django.contrib import admin\n\nfrom .models import Post, Tag\n\nadmin.site.registe... | python | chosen |
[
{
"from": "system",
"value": "Fix for test failure introduced by basic auth changes\n"
},
{
"from": "human",
"value": "from e2e_framework.page_object import PageObject\nfrom ..lms import BASE_URL\n\n\nclass InfoPage(PageObject):\n \"\"\"\n Info pages for the main site.\n These are basic... | python | chosen |
[
{
"from": "system",
"value": "Update capture profiler to new spec of providing board instead of string.\n"
},
{
"from": "human",
"value": "import cProfile\n\nfrom pqhelper import capture\n\n\ndef main():\n cProfile.run('test_solution(catapult)')\n\n\ndef test_solution(board_string):\n prin... | python | chosen |
[
{
"from": "system",
"value": "Add management functions for migration\n"
},
{
"from": "human",
"value": "from optparse import make_option\nimport sys\nfrom django.core.management.base import BaseCommand\nfrom education.models import Concept\n\nclass Command(BaseCommand):\n args = \"\"\n hel... | python | chosen |
[
{
"from": "system",
"value": "Fix Auth API key check causing error 500s\n"
},
{
"from": "human",
"value": "from django.http import HttpResponseForbidden\nfrom django.contrib.auth.models import AnonymousUser\nfrom api.models import AuthAPIKey\n\nclass APIKeyAuthentication(object):\n\n def is_a... | python | chosen |
[
{
"from": "system",
"value": "Add trailing slash to url\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom django.contrib.admin.views.decorators import staff_member_required\n\nfrom derrida.books.views import (\n PublisherAutocomplete, LanguageAutocomplete, InstanceDeta... | python | chosen |
[
{
"from": "system",
"value": "Add option to ignore static.\n"
},
{
"from": "human",
"value": "from src.markdown.makrdown import jinja_aware_markdown\n\nPREFERRED_URL_SCHEME = 'http'\nSERVER_NAME = 'localhost:5000'\nFLATPAGES_EXTENSION = '.md'\nFLATPAGES_HTML_RENDERER = jinja_aware_markdown\nFREE... | python | chosen |
[
{
"from": "system",
"value": "Add better custom has_permission check.\n"
},
{
"from": "human",
"value": "\"\"\"\nSpecific checks.\n\"\"\"\nfrom discord.ext.commands import CheckFailure\n\n\ndef is_owner(ctx):\n if not ctx.bot.owner_id == ctx.message.author.id:\n raise CheckFailure(mess... | python | chosen |
[
{
"from": "system",
"value": "Swap back to Fuzzer, no monkey patching\n"
},
{
"from": "human",
"value": "from experiment_config_lib import ControllerConfig\nfrom sts.topology import MeshTopology\nfrom sts.control_flow import Fuzzer\nfrom sts.input_traces.input_logger import InputLogger\nfrom sts... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in error message variable\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nfrom .webhooks import WebHook\nfrom werkzeug.exceptions import BadRequest, NotImplemented\n\nEVENTS = {\n 'Pus... | python | chosen |
[
{
"from": "system",
"value": "Fix broken functional tests on windows\n\nSomething must have changed on the Appveyor side since this code\nhasn't been touched recently. The issue was that a functional test\nwas referring to \"/tmp\" which is not valid on Windows. I'm surprised\nthis worked on Windows in the ... | python | chosen |
[
{
"from": "system",
"value": "Convert entire table to cartesian\n"
},
{
"from": "human",
"value": "\"\"\"\nAdd very large RV errors for stars with no known RVs.\nConvert to cartesian.\n\"\"\"\n\nimport numpy as np\nimport sys\nsys.path.insert(0, '..')\nfrom chronostar import tabletool\nfrom astr... | python | chosen |
[
{
"from": "system",
"value": "Handle orgs that you don’t own personally."
},
{
"from": "human",
"value": "import logging\n\nfrom .models import GithubProject, GithubOrganization\n\nlog = logging.getLogger(__name__)\n\ndef make_github_project(user, org, privacy, repo_json):\n if (repo_json['pr... | python | chosen |
[
{
"from": "system",
"value": "Use author display name in document list_filter\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom scanning.models import PendingScan, Document, DocumentPage, Scan, ScanPage, Transcription\n\nclass ScanPageInline(admin.TabularInline):\n m... | python | chosen |
[
{
"from": "system",
"value": "Fix prefetched fields in Institutions in API\n"
},
{
"from": "human",
"value": "import django_filters\nfrom rest_framework import filters, viewsets\nfrom teryt_tree.rest_framework_ext.viewsets import custom_area_filter\n\nfrom .models import Institution, Tag\nfrom .... | python | chosen |
[
{
"from": "system",
"value": "Fix wsgi config file access for HTTPD\n\nBug 1051081\n\nChange-Id: Ie1690c9b1b98ed3f5a78d935878369b7520b35c9\n"
},
{
"from": "human",
"value": "import os\n\nfrom paste import deploy\n\nfrom keystone import config\nfrom keystone.common import logging\n\nLOG = logging... | python | chosen |
[
{
"from": "system",
"value": "Fix reverse since we deprecated post_object_list\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom django.utils.translation import ugettext as _\n\nfrom post.models import Post\nfrom jmbo.generic.views import GenericObjectDetail, ... | python | chosen |
[
{
"from": "system",
"value": "Fix filename creation in csv export action\n"
},
{
"from": "human",
"value": "\nfrom django.http import StreamingHttpResponse\nfrom django.utils.encoding import force_text\n\nfrom .models import modelserialiser_factory\nfrom .simplecsv import CSV\n\n\nclass ExportCs... | python | chosen |
[
{
"from": "system",
"value": "Change sleep function to the end to do repeat everytime\n"
},
{
"from": "human",
"value": "# coding=utf8\n\n# 31.220.16.242\n# 216.58.222.46\n\n\nimport socket\nimport time\nimport webbrowser\n\ndef checkdns():\n print time.ctime()\n retorno = True\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert file to moneymanager master branch.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# vi:tabstop=4:expandtab:shiftwidth=4:softtabstop=4:autoindent:smarttab\n\nimport os, sys\nimport sqlite3\nimport urllib.request\n\nerr = False\nfor version in rang... | python | chosen |
[
{
"from": "system",
"value": "Update script to remove extension from filename\n\nBefore, the script added the extension .json to whatever the file\nname was. Now, it removes the last extension and then appends .json.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport click\nimport ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.