conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use better syntax for unpacking tuples\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nimport sys, os\nimport nltk\n\nif len(sys.argv) < 2:\n print(\"Please supply a filename.\")\n sys.exit(1)\n\nfilename = sys.argv[1]\n\nwith open(filename, 'r') as f... | python | chosen |
[
{
"from": "system",
"value": "Fix constructor for SpaceAlignedTableWriter class\n"
},
{
"from": "human",
"value": "import copy\n\nimport dataproperty\n\nfrom ._csv import CsvTableWriter\n\n\nclass SpaceAlignedTableWriter(CsvTableWriter):\n \"\"\"\n A table writer class for space aligned fo... | python | chosen |
[
{
"from": "system",
"value": "Add a hack so that the number of jobs running will update correctly\n"
},
{
"from": "human",
"value": "from models import Job\n\n\ndef running_jobs(request):\n if request.user.is_authenticated():\n temp = len(Job.get_running_jobs(user=request.user))\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the timeseries tests in the installed package\n"
},
{
"from": "human",
"value": "def get_package_data():\n return {'sunpy.data': ['sunpyrc'],\n 'sunpy.data.test': ['*.*', '*/*.*']}\n"
},
{
"from": "gpt",
"value": "def get_package_data()... | python | chosen |
[
{
"from": "system",
"value": "Fix super call for Python 2.7"
},
{
"from": "human",
"value": "import json\n\nfrom django import forms\n\nfrom .models import PublicBody\n\n\nclass PublicBodySelect(forms.Widget):\n input_type = \"text\"\n template_name = 'publicbody/_chooser.html'\n initia... | python | chosen |
[
{
"from": "system",
"value": "Add data splitter for cross validation\n"
},
{
"from": "human",
"value": "import numpy as np\n\n\ndef overwrite_labels(y):\n classes = np.unique(y)\n y[y==classes[0]] = -1\n y[y==classes[1]] = 1\n return y\n"
},
{
"from": "gpt",
"value": "imp... | python | chosen |
[
{
"from": "system",
"value": "Add note that Struct's field collection is an OrderedDict\n"
},
{
"from": "human",
"value": "\"\"\"\nAll the different types that the compiler handles.\n\"\"\"\nfrom collections import namedtuple\n\nIntegerType = namedtuple('IntegerType', [])\nInteger = IntegerType(... | python | chosen |
[
{
"from": "system",
"value": "Change in database configuration file\n"
},
{
"from": "human",
"value": "from bdo_platform.settings_management.development import *\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'bdo_platform',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix to local data filepath\n"
},
{
"from": "human",
"value": "import os\nimport urllib\nfrom xml.etree import ElementTree as ET\nfrom astropy.tests.helper import pytest\nfrom ...utils.testing_tools import MockResponse\nfrom ... import open_exoplanet_catalogue as oec... | python | chosen |
[
{
"from": "system",
"value": "Set praise list as home\n"
},
{
"from": "human",
"value": "\"\"\"pronto_praise URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.11/topics/http/urls/\nExamples:\nFunction views... | python | chosen |
[
{
"from": "system",
"value": "Fix problem with sites that blocks bots\n"
},
{
"from": "human",
"value": "\"\"\"\nValidator functions\n\"\"\"\nfrom urllib import request\nfrom urllib.error import HTTPError\n\nfrom django.core.exceptions import ValidationError\n\nimport PyPDF2\n\ndef online_docume... | python | chosen |
[
{
"from": "system",
"value": "Add test case for Pollard's Rho at zero to bump test coverage\n"
},
{
"from": "human",
"value": "import random\nimport unittest\n\nfrom algorithms.factorization.pollard_rho import pollard_rho\nfrom algorithms.factorization.trial_division import trial_division\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Fix imports for management command\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.management.base import BaseCommand\nfrom django.db import transaction\nfrom twitter import OAuth, Twitter\n\nfrom ..models import Tweet\nfrom ..u... | python | chosen |
[
{
"from": "system",
"value": "Prepare 0.17.0 Vegas for BlackHat Arsenal\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\r\n#\r\n##################################################################################\r\n#\r\n# Copyright 2014-2017 Félix Brezo and Yaiza Rubio (i3visio, con... | python | chosen |
[
{
"from": "system",
"value": "Support if skill group/types are changed\n"
},
{
"from": "human",
"value": "from celery.decorators import task\nfrom eve_proxy.models import CachedDocument\nfrom eve_api.utils import basic_xml_parse_doc\nfrom eve_api.models import EVESkill, EVESkillGroup\n\n@task()\... | python | chosen |
[
{
"from": "system",
"value": "Allow a single email as the to email field\n"
},
{
"from": "human",
"value": "from django.core.mail import EmailMessage\nfrom django.template import loader, Context\nfrom django.conf import settings\n\n\ndef send_email(to_list, subject, message_template, message_con... | python | chosen |
[
{
"from": "system",
"value": "Fix bug where boolean combination values were not changed to strings\n"
},
{
"from": "human",
"value": "\"\"\"Create list of all possible valid resource combinations.\"\"\"\n\nimport itertools\nfrom utils.bool_to_yes_no import bool_to_yes_no\n\n\ndef resource_valid_... | python | chosen |
[
{
"from": "system",
"value": "Add support for 5d20 instead of d20\n"
},
{
"from": "human",
"value": "import random\n\nfrom cardinal.decorators import command\n\n\nclass RandomPlugin:\n @command('roll')\n def roll(self, cardinal, user, channel, msg):\n args = msg.split(' ')\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove implicit addition of leading slash\n"
},
{
"from": "human",
"value": "\"\"\"Image renderer module.\"\"\"\n\ndef render_img_tag(fp, src=None, alt=''):\n \"\"\"A simple image tag renderer.\n\n :param str:\n \"\"\"\n # Default src to the filename\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert 232677 \"Revert 232670 \"Fix script after r232641\"\"\n\nFalse alarm, tests we failing due to PDT switch.\n\n> Revert 232670 \"Fix script after r232641\"\n> \n> Needs to be out to speculatively revert r232641.\n> \n> > Fix script after r232641\n> > \n> > BUG=314253\n> > ... | python | chosen |
[
{
"from": "system",
"value": "Improve the util module unit test docstring.\n"
},
{
"from": "human",
"value": "\"\"\"Tests for the `scmtiles.util`.\"\"\"\n# Copyright 2016 Andrew Dawson\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in ... | python | chosen |
[
{
"from": "human",
"value": "Revert \"Make it find this\"\n\nThis reverts commit f4d8589a9c424d32ae403eddd7d97366c27cb8fd.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nRead the license at:\nhttps://github.com/IzunaDevs/nsfw_dl/blob/master/LICENSE\n\"\"\"\n\nfrom .dl import NSFWDL # noqa\n\n__title_... | python | chosen |
[
{
"from": "system",
"value": "Print 16 bit per line\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n\"\"\"\nAnalyze superblock in ext2 filesystem.\n\nUsage:\n superblock.py <filename>\n\"\"\"\nimport sys\nimport string\nfrom binascii import hexlify\n\n\nBLOCKSIZE = 512\n\n\ndef blo... | python | chosen |
[
{
"from": "system",
"value": "Make the lib imports work on other computers than Simon's"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\npaths = (\n '/home/simon/sites/djangopeople.net',\n '/home/simon/sites/djangopeople.net/djangopeoplenet',\n '/home/simon/sites/djan... | python | chosen |
[
{
"from": "system",
"value": "Throw ValidationError for invalid form, drop get_query_form()\n"
},
{
"from": "human",
"value": "class ModelSerializerMixin(object):\n \"\"\"Provides generic model serializer classes to views.\"\"\"\n model_serializer_class = None\n\n def get_serializer_cla... | python | chosen |
[
{
"from": "system",
"value": "Fix setting connectivity for NSX offerings\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport click\nfrom Cosmic.CI import *\nfrom Cosmic.NSX import *\n\n\n@click.command()\n@click.option('--marvin-config', '-m', help='Marvin config file', required=T... | python | chosen |
[
{
"from": "system",
"value": "Add Apache 2.0 license to source file\n\nAs per OpenStack licensing guide lines [1]:\n[H102 H103] Newly contributed Source Code should be licensed under\nthe Apache 2.0 license.\n[H104] Files with no code shouldnt contain any license header nor\ncomments, and must be left comp... | python | chosen |
[
{
"from": "system",
"value": "Remove inlcudes for no longer needed libraries.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom flask.ext.assets import Bundle, Environment\n\ncss = Bundle(\n \"libs/bootstrap/dist/css/bootstrap.css\",\n \"css/style.css\",\n \"libs/annotato... | python | chosen |
[
{
"from": "human",
"value": "Implement function to upload and rotate a file with an existing timestamp\n"
},
{
"from": "gpt",
"value": "from dcu.active_memory.rotate import rotate\nfrom dcu.active_memory.rotate import splitext\nfrom dcu.active_memory.upload import multipart_upload\n\nimport os.p... | python | chosen |
[
{
"from": "system",
"value": "Update 0.4.2\n- Added hashtags\n"
},
{
"from": "human",
"value": "\nimport tweepy\nfrom secrets import *\nfrom voyager_distance import get_distance\nfrom NEO_flyby import NEO\n\n# standard for accessing Twitter API\nauth = tweepy.OAuthHandler(C_KEY, C_SECRET)\nauth.... | python | chosen |
[
{
"from": "system",
"value": "Use ResourceController instead of duplicating logic.\n"
},
{
"from": "human",
"value": "import six\nfrom pecan import abort\nfrom pecan.rest import RestController\nfrom mongoengine import ValidationError\n\nfrom st2common import log as logging\nfrom st2common.persis... | python | chosen |
[
{
"from": "system",
"value": "Change role and permission tag parameter format, no need \"\"\n"
},
{
"from": "human",
"value": "from uliweb.core.template import BaseBlockNode\nfrom uliweb import functions\n\nclass PermissionNode(BaseBlockNode):\n def __init__(self, name='', content=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Change to try and improve importability - Undone\n"
},
{
"from": "human",
"value": "\"\"\"\n.. Copyright 2016 EMBL-European Bioinformatics Institute\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compl... | python | chosen |
[
{
"from": "system",
"value": "Add TestDirectory.setUp() to the directory package's test file\n"
},
{
"from": "human",
"value": "\"\"\"Contains the unit tests for the inner directory package\"\"\"\n\nimport unittest\n\n\nclass TestDirectory(unittest.TestCase):\n pass\n\n\nif __name__ == \"__ma... | python | chosen |
[
{
"from": "system",
"value": "Make sure \"percentage\" is a string before concatenating it.\n"
},
{
"from": "human",
"value": "\"\"\"Find top stocks and post them to Twitter.\"\"\"\nimport sys\nimport tweetPoster\nimport stockPrices\nfrom stockList import getStockList\nimport time\n\ndef main():... | python | chosen |
[
{
"from": "system",
"value": "Use one of the real data files in test\n"
},
{
"from": "human",
"value": "import pytest\r\nimport parse_vcf as pv\r\n\r\n\r\n\r\ndef test_openfile():\r\n assert pv.openfile('test_parse_vcf.py')[0] == True\r\n"
},
{
"from": "gpt",
"value": "import pyte... | python | chosen |
[
{
"from": "system",
"value": "Correct identity data in test\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\nimport pytest\n\nfrom sentry.auth.exceptions import IdentityNotValid\nfrom sentry.auth.providers.oauth2 import OAuth2Provider\nfrom sentry.mode... | python | chosen |
[
{
"from": "system",
"value": "Add more syntactic construct lexing.\n"
},
{
"from": "human",
"value": "from pygments.token import Keyword, Text, Token\nfrom pygments.lexer import RegexLexer\n\nclass K3Lexer(RegexLexer):\n name = 'K3'\n aliases = ['k3']\n filenames = ['*.k3']\n\n keywo... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary line from test\n"
},
{
"from": "human",
"value": "import asyncio\nimport sys\n\nfrom scrapy import Spider\nfrom scrapy.crawler import CrawlerProcess\nfrom scrapy.utils.defer import deferred_from_coro\nfrom twisted.internet.defer import Deferred\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix UserFactory for django 1.4\n"
},
{
"from": "human",
"value": "import factory\n\nfrom django.contrib.auth import get_user_model\n\n\nclass UserFactory(factory.DjangoModelFactory):\n FACTORY_FOR = get_user_model()\n email = factory.Sequence(lambda i: 'email{... | python | chosen |
[
{
"from": "system",
"value": "Add stacklevel=2 to make calling code clear"
},
{
"from": "human",
"value": "\"\"\"For backward compatibility, expose main functions from\n``setuptools.config.setupcfg``\n\"\"\"\nimport warnings\nfrom functools import wraps\nfrom textwrap import dedent\nfrom typing ... | python | chosen |
[
{
"from": "human",
"value": "Set up the bct model\n"
},
{
"from": "gpt",
"value": "\"\"\"This is a model to produce dendrograms of the dtm.\"\"\"\n\nimport pandas as pd\nfrom typing import NamedTuple, Optional\nfrom lexos.models.base_model import BaseModel\nfrom lexos.models.matrix_model import ... | python | chosen |
[
{
"from": "system",
"value": "Change test to show WebOb filters consume completely before resulting in a body\n"
},
{
"from": "human",
"value": "# Test various types of WebOb middleware\n\nimport sys\n\nfrom fireside import WSGIFilter\nfrom webob.dec import wsgify\nfrom servlet_support import * ... | python | chosen |
[
{
"from": "system",
"value": "Send back GET request in response\n\nThe response to a GET request now returns the request string\nand all header fields as a JSON encoded response.\n"
},
{
"from": "human",
"value": "#! /bin/env python3\n#\n# Simple HTTP server for testing purposes.\n\nimport http.... | python | chosen |
[
{
"from": "system",
"value": "Fix version to include 3 digits.\n"
},
{
"from": "human",
"value": "# Tweepy\n# Copyright 2009-2010 Joshua Roesslein\n# See LICENSE for details.\n\n\"\"\"\nTweepy Twitter API library\n\"\"\"\n__version__ = '3.1'\n__author__ = 'Joshua Roesslein'\n__license__ = 'MIT'\... | python | chosen |
[
{
"from": "system",
"value": "DeprecationWarning: Use of salt.utils.which detected. This function has been moved to salt.utils.path.which as of Salt 2018.3.0\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport salt.utils\nimport salt.modules.cmdmod\n\n__salt__ = {'cmd.run': salt... | python | chosen |
[
{
"from": "system",
"value": "Implement adding legislation XML from string\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport os\n\nfrom openfisca_core.taxbenefitsystems import TaxBenefitSystem\n\nfrom . import entities, scenarios\n\n\nCOUNTRY_DIR = os.path.dirname(os.path.absp... | python | chosen |
[
{
"from": "system",
"value": "Add SubjectAltNameWarning and a helper function\n\nshade hits the SubjectAltName problem when talking to Rackspace. Also,\none of the things you want to do is turn off the warnings - so add a\nfunction for that.\n\nChange-Id: I3a55c66e5a4033a47a9d8704dd30709a5c53edc9\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Solve castle on grid (timeout test case 11)\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\nclass CastleOnGrid:\n\n def __init__(self, grid, start, goal):\n self.grid = grid\n self... | python | chosen |
[
{
"from": "system",
"value": "Use Dj provided compat tools\n"
},
{
"from": "human",
"value": "#-*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom six import string_types\n\n\ndef render_stars(num, max_stars, star_set):\n \"\"\"\n Star renderer returns a HTML string of s... | python | chosen |
[
{
"from": "system",
"value": "Check whether required id parameter is specified\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n\tsphinxcontrib.openstreetmap\n\t===========================\n\n\tEmbed OpenStreetMap on your documentation.\n\n\t:copyright: Copyright 2015 HAYASHI ... | python | chosen |
[
{
"from": "system",
"value": "Change the way to instaniate models\n"
},
{
"from": "human",
"value": "from flask import Blueprint, request, json\nfrom alfred_db.models import Repository, Commit\n\nfrom .database import db\nfrom .helpers import parse_hook_data\n\n\nwebhooks = Blueprint('webhooks',... | python | chosen |
[
{
"from": "system",
"value": "Add functionality to store courses in database\n"
},
{
"from": "human",
"value": "'''\nThis module aggregates all the course information from different MOOC platforms\nand stores them in the database (MongoDB)\n'''\nfrom mongoengine import connect\nfrom flask.ext.mo... | python | chosen |
[
{
"from": "system",
"value": "Fix typo: GenericForenikeyConfig → GenericForeignKeyConfig\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.apps import AppConfig\n\n\nclass GenericForenikeyConfig(AppConfig):\n name = 'generic_foreignkey'\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Fix some code quality issues.\n"
},
{
"from": "human",
"value": "from typing import Text, Type\n\nimport pytest\n\nfrom rasa.core.policies.rule_policy import RulePolicy\nfrom rasa.nlu.classifiers.fallback_classifier import FallbackClassifier\nfrom rasa.shared.core.c... | python | chosen |
[
{
"from": "system",
"value": "Fix slices for Python 3\n"
},
{
"from": "human",
"value": "def merge(a, b):\n if len(a) * len(b) == 0:\n return a + b\n\n v = (a[0] < b[0] and a or b).pop(0)\n return [v] + merge(a, b)\n\n\ndef mergesort(list):\n if len(list) < 2:\n return ... | python | chosen |
[
{
"from": "system",
"value": "Check for parent filterable fields as well as local filterable fields\n"
},
{
"from": "human",
"value": "from rest_framework import serializers as ser\n\nfrom api.base.serializers import JSONAPISerializer, LinksField, Link\n\n\nclass UserSerializer(JSONAPISerializer... | python | chosen |
[
{
"from": "system",
"value": "Update tests to match new metadata\n"
},
{
"from": "human",
"value": "# Copyright 2015 Isotoma Limited\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 obtain a cop... | python | chosen |
[
{
"from": "system",
"value": "Add new types to INTERNAL_TYPE_ORDERING\n"
},
{
"from": "human",
"value": "from thinglang.lexer.values.identifier import Identifier\n\n\"\"\"\nThe internal ordering of core types used by the compiler and runtime\n\"\"\"\n\nINTERNAL_TYPE_ORDERING = {\n Identifier(... | python | chosen |
[
{
"from": "system",
"value": "Add drake in the PYTHONPATH for the tests.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nsys.path.append('../src')\n\nimport drake\n\ndrake.run('..')\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n\nimport os\nimport sys\n\nsys... | python | chosen |
[
{
"from": "system",
"value": "Fix 401 in test suite"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport balanced\n\nfrom . import utils\n\n\nclass TestClient(utils.TestCase):\n\n def setUp(self):\n super(TestClient, self).setUp()\n\n def test_configure... | python | chosen |
[
{
"from": "system",
"value": "WebRTC: Make clean script return successful if clean dir is missing.\n\nI thought it would be good to have the script fail for an\nincorrectly specified directory, but the out/ dir is missing\non fresh installed slave machines, so better just skip cleaning\nwith a line printed ... | python | chosen |
[
{
"from": "system",
"value": "Add spawner to event handlers\n"
},
{
"from": "human",
"value": "from polyaxon.config_settings.volume_claims import *\nfrom .apps import *\n"
},
{
"from": "gpt",
"value": "from polyaxon.config_settings.volume_claims import *\nfrom polyaxon.config_setting... | python | chosen |
[
{
"from": "system",
"value": "Add /rq to banned course names\n"
},
{
"from": "human",
"value": "\"\"\"App constants\"\"\"\n\nSTUDENT_ROLE = 'student'\nGRADER_ROLE = 'grader'\nSTAFF_ROLE = 'staff'\nINSTRUCTOR_ROLE = 'instructor'\nLAB_ASSISTANT_ROLE = 'lab assistant'\nVALID_ROLES = [STUDENT_ROLE, ... | python | chosen |
[
{
"from": "system",
"value": "Use an absolute import to avoid breaking the docs build.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2007-2014 by Enthought, Inc.\n# All rights reserved.\n\"\"\" A multi-platform object drawing library.\n Part of the Enable project of the Enthought Tool ... | python | chosen |
[
{
"from": "system",
"value": "Remove helper functions from sharepa init\n"
},
{
"from": "human",
"value": "from sharepa.search import ShareSearch, basic_search # noqa\nfrom sharepa.analysis import bucket_to_dataframe, merge_dataframes # noqa\nfrom sharepa.helpers import source_agg, source_coun... | python | chosen |
[
{
"from": "system",
"value": "Fix typo: `succesfully` -> `successfully`\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nCreated on Tue Aug 15 11:26:23 2017\nThis script processes NCBI data exports (from ftp://ftp.ncbi.nlm.nih.gov/genomes/GENOME_REPORTS/IDS/)\nto extract lists of... | python | chosen |
[
{
"from": "system",
"value": "Add hash_id column to user-info output\n"
},
{
"from": "human",
"value": "'''\nThis module will retrieve info about students registered in the course\n\n'''\n\ndef user_info(edx_obj):\n edx_obj.collections = ['certificates_generatedcertificate', 'auth_userprofile... | python | chosen |
[
{
"from": "system",
"value": "Change app name in import to lowercase\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom ImagerProfile.models import ImagerProfile\nfrom django.contrib.auth.admin import UserAdmin\nfrom django.contrib.auth.models import User\n\n# admin.site.u... | python | chosen |
[
{
"from": "system",
"value": "Make travis tests work with sites\n"
},
{
"from": "human",
"value": "\"\"\" Custom happening database manipulation. \"\"\"\n\nfrom django.contrib.sites.managers import CurrentSiteManager as Manager\nfrom django.db import models\nfrom django.contrib.sites.models impo... | python | chosen |
[
{
"from": "system",
"value": "Rename variables used for setting up logging\n"
},
{
"from": "human",
"value": "import logging\nimport sys\n\nlogger = logging.getLogger()\nlogFormatter = logging.Formatter(\"%(message)s\")\nconsoleHandler = logging.StreamHandler(sys.stdout)\nconsoleHandler.setForma... | python | chosen |
[
{
"from": "system",
"value": "Clean up post formatting and response code\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport BaseHTTPServer\n\nServerClass = BaseHTTPServer.HTTPServer\nRequestHandlerClass = BaseHTTPServer.BaseHTTPRequestHandler\n\nSERVER_NAME = ''\nSERVER_PORT = 90... | python | chosen |
[
{
"from": "system",
"value": "Reset learners password when user is unGDPRed/unretired via django admin.\n"
},
{
"from": "human",
"value": "\"\"\"\nDjango forms for accounts\n\"\"\"\n\nfrom django import forms\nfrom django.core.exceptions import ValidationError\n\n\nclass RetirementQueueDeletionF... | python | chosen |
[
{
"from": "system",
"value": "Add helper to load a single test case.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\"\"\"Utility routines\n\"\"\"\n\n\nimport os\nimport re\nfrom enum import Enum\nfrom contextlib import contextmanager\n\n\ndef pyname_join(seq):\n return \".\".j... | python | chosen |
[
{
"from": "system",
"value": "Add 'sent items' to default folder mapping\n"
},
{
"from": "human",
"value": "\n# Folder name mappings, based on http://tools.ietf.org/html/rfc6154\nINBOX = 'inbox'\nDRAFTS = 'drafts'\nSPAM = 'spam'\nARCHIVE = 'archive'\nSENT = 'sent'\nTRASH = 'trash'\nALL = 'all'\n... | python | chosen |
[
{
"from": "system",
"value": "Fix StayAway strat for pull request\n"
},
{
"from": "human",
"value": "# Under MIT license, see LICENSE.txt\n\nfrom ai.STA.Tactic.stay_away_from_ball import StayAwayFromBall\nfrom ai.STA.Strategy.Strategy import Strategy\nfrom ai.Util.role import Role\n\nclass StayA... | python | chosen |
[
{
"from": "system",
"value": "Fix pip install failing due to wtforms monkeypatch\n"
},
{
"from": "human",
"value": "# This file is part of Indico.\n# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).\n#\n# Indico is free software; you can redistribute it and/or\n# modi... | python | chosen |
[
{
"from": "system",
"value": "Update invalidate to remove failed trials.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# Copyright (c) 2017, John Skinner\nimport sys\nimport logging\nimport logging.config\n\nimport config.global_configuration as global_conf\nimport database.client\n... | python | chosen |
[
{
"from": "system",
"value": "Fix email module could not be imported\n\nThis helpful message alerted me to this problem:\n\n ImproperlyConfigured: <django.utils.functional.__proxy__ object at\n0x10b023990>\n"
},
{
"from": "human",
"value": "from . import email\n\n\ndef sync_daily_email_blasts... | python | chosen |
[
{
"from": "system",
"value": "Update category and website on module description\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n{\n 'name': 'Document Attachment',\n 'version': '1.2',\n 'author': 'XCG Consulting',\n 'category': 'Dependency',\n 'description': \"\"\"Encha... | python | chosen |
[
{
"from": "system",
"value": "Modify dev versioning; see PEP 440\n"
},
{
"from": "human",
"value": "# -----------------------------------------------------------------------------\n\n__title__ = 'lamana'\n__version__ = '0.4.11-dev'\n__author__ = 'P. Robinson II'\n__license__ = 'BSD'\n__copyright... | python | chosen |
[
{
"from": "system",
"value": "Set heartbeat attrib in init\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport json\nimport random\nimport hashlib\n\nimport requests\nfrom heartbeat import Challenge, Heartbeat\n\nfrom .utils import urlify\nfrom .e... | python | chosen |
[
{
"from": "system",
"value": "Add the account manager that support the creation of accounts.\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import AbstractBaseUser, BaseUserManager\nfrom django.db import models\n\n'''\n @name : Account\n @desc : Account model. This mode... | python | chosen |
[
{
"from": "system",
"value": "Move setting of row factory to after session object is created\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport argparse\nimport getpass\nfrom cassandra import query\nfrom cassandra.cqlengine.management import sync_table\nfrom cassandra.cqlengine.m... | python | chosen |
[
{
"from": "system",
"value": "Fix tests failing when foodcritic is not installed.\n\nTool tests should skip, not fail.\n"
},
{
"from": "human",
"value": "from lintreview.review import Comment\nfrom lintreview.review import Problems\nfrom lintreview.tools.foodcritic import Foodcritic\nfrom unitte... | python | chosen |
[
{
"from": "system",
"value": "Update settings for new configuration\n"
},
{
"from": "human",
"value": "# Amazon S3 Settings\nAWS_KEY = 'REQUIRED'\nAWS_SECRET_KEY = 'REQUIRED'\nAWS_BUCKET = 'REQUIRED'\nAWS_DIRECTORY = '' # Leave blank *not false* unless project not at base URL\n ... | python | chosen |
[
{
"from": "system",
"value": "Add plugin workflow fetching to API\n"
},
{
"from": "human",
"value": "from flask import Blueprint, jsonify\n\nfrom .security import validate_request_authentication\nfrom qiime.sdk import PluginManager\n\nv1 = Blueprint('v1', __name__)\nv1.before_request(validate_re... | python | chosen |
[
{
"from": "system",
"value": "Add Sink class to initial spotify-connect import\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport spotifyconnect\n\n\nclass Sink(object):\n\n def on(self):\n \"\"\"Turn on the alsa_sink sink.\n\n This is done auto... | python | chosen |
[
{
"from": "system",
"value": "Use django_pams pam.authenticate, instead of some other pam module.\n"
},
{
"from": "human",
"value": "import pam\n\nfrom django.contrib.auth import models as auth_models\n\nclass User(auth_models.User):\n class Meta:\n proxy = True\n def check_password... | python | chosen |
[
{
"from": "system",
"value": "Change assertTrue(isinstance()) by optimal assert\n\nSome of tests use different method of assertTrue(isinstance(A, B))\nor assertEqual(type(A), B). The correct way is to use assertIsInstance(A, B)\nprovided by testtools\n\nChange-Id: Id6ff634d7af3ee3b2eb4add770b0ba589bb08d1d\n... | python | chosen |
[
{
"from": "system",
"value": "Fix test to work with python 2.6\n"
},
{
"from": "human",
"value": "import sys\nimport logging\nimport subprocess\n\nsys.path.insert(0, '..')\n\nfrom unittest2 import TestCase\n\n\nclass MockLoggingHandler(logging.Handler):\n \"\"\"Mock logging handler to check f... | python | chosen |
[
{
"from": "system",
"value": "Implement Shaman cards for The Grand Tournament\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\n# Tuskarr Totemic\nclass AT_046:\n\tplay = Summon(CONTROLLER, RandomTotem())\n\n\n# Draenei Totemcarver\nclass AT_047:\n\tplay = Buff(SELF,... | python | chosen |
[
{
"from": "system",
"value": "Fix py script to package all .pdb files now that its moved to tools.\n"
},
{
"from": "human",
"value": "import os\nimport os.path\nimport sys\nimport zipfile\n\n'''\nSeeks for *.pdb files from current directory and all child directories.\nAll found pdb files are cop... | python | chosen |
[
{
"from": "system",
"value": "Put validators in phone numbers\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom people.models import Customer\nfrom people.models import InternalUser\n\nclass CustomerSerializer(serializers.ModelSerializer):\n phone_number = seri... | python | chosen |
[
{
"from": "system",
"value": "Support CACHE_URL for the Celery broker as well.\n"
},
{
"from": "human",
"value": "import os\nfrom datetime import timedelta\n\nBROKER_URL = os.environ['CELERY_BROKER_URL']\n# Set environment variable if you want to run tests without a redis instance\nCELERY_ALWAYS... | python | chosen |
[
{
"from": "system",
"value": "Change importing in order to make Wagtail<2.0 comp"
},
{
"from": "human",
"value": "# Generated by Django 2.0.1 on 2018-01-28 01:16\n\nfrom django.conf import settings\nfrom django.db import migrations, models\nimport django.db.models.deletion\nimport wagtail.core.m... | python | chosen |
[
{
"from": "system",
"value": "Use the pkg api for reading the resources in the package\n\nIssue cobweb-eu/pcapi#18\n"
},
{
"from": "human",
"value": "import argparse\nimport os\nimport shutil\n\nfrom pcapi import get_resource\n\n\ndef create_skeleton(path):\n if os.path.exists(path):\n ... | python | chosen |
[
{
"from": "system",
"value": "Move import to top of the file\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Decrypt(models.Aggregate):\n \"\"\"`Decrypt` creates an alias for `DecryptFunctionSQL`.\n\n `alias` is `{self.lookup}__decrypt` where 'decrypt' is `self.n... | python | chosen |
[
{
"from": "system",
"value": "Add error handling code to bulk delete\n"
},
{
"from": "human",
"value": "from .celerybungie import CeleryBungieTask\nfrom bungiesearch import Bungiesearch\nfrom bungiesearch.utils import update_index\n\n\nclass BulkDeleteTask(CeleryBungieTask):\n\n def run(self,... | python | chosen |
[
{
"from": "system",
"value": "Save data to file from CLI.\n"
},
{
"from": "human",
"value": "\"\"\"\nUsage:\n loldb --path=<path> [options]\n loldb -h | --help\n loldb --version\n\nOptions:\n -p, --path=<path> Location of LoL installation.\n --lang=<language> Language to output [default: ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.