conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add support for pulling hash tags\n"
},
{
"from": "human",
"value": "# -*- coding: UTF-8 -*-\nimport numpy\nfrom tweepy.streaming import StreamListener\nfrom tweepy import OAuthHandler\nfrom tweepy import Stream\nimport json\nimport config\n\n#Much of this code come... | python | chosen |
[
{
"from": "system",
"value": "Refactor node() into a closure\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n eve-swagger.swagger\n ~~~~~~~~~~~~~~~~~~~\n swagger.io extension for Eve-powered REST APIs.\n\n :copyright: (c) 2015 by Nicola Iarocci.\n :license: BSD... | python | chosen |
[
{
"from": "system",
"value": "Fix name of index created for tests.\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\n\"\"\"\nTest tools required by multiple suites.\n\"\"\"\n\nimport contextlib\nimport shutil\nimport subprocess\nimport tempfile\n\nfrom devpi_builder import devpi\n\n\n@context... | python | chosen |
[
{
"from": "system",
"value": "Improve the code, return most collisions. Work on hex strings.\n"
},
{
"from": "human",
"value": "from matasano.util.converters import hex_to_bytestr\nfrom Crypto.Cipher import AES\n\nif __name__ == \"__main__\":\n\n chal_file = open(\"matasano/data/c8.txt\", 'r'... | python | chosen |
[
{
"from": "system",
"value": "Use the HttpResponseRedirect for redirection.\n"
},
{
"from": "human",
"value": "from billing.integrations.amazon_fps_integration import AmazonFpsIntegration as Integration\nfrom django.core.urlresolvers import reverse\nimport urlparse\n\nclass FpsIntegration(Integr... | python | chosen |
[
{
"from": "system",
"value": "Add documentation to cli command arguments\n"
},
{
"from": "human",
"value": "import rslinac\n\ndef run(ini_filename, input_filename, output_filename):\n rslinac.run_beam_solver(ini_filename, input_filename, output_filename)\n"
},
{
"from": "gpt",
"va... | python | chosen |
[
{
"from": "system",
"value": "Handle 404s due to index not existing when doing versioning\n"
},
{
"from": "human",
"value": "import json\nimport logging\n\nfrom elasticsearch import Elasticsearch\n\nfrom scrapi import settings\nfrom scrapi.processing.base import BaseProcessor\n\nes = Elasticsear... | python | chosen |
[
{
"from": "system",
"value": "Revert previous change to auth timestamp."
},
{
"from": "human",
"value": "import tornado.web\nimport tornado.escape\nimport json\nimport time\nimport os\n\nimport settings as global_settings\nfrom lib.handlers.base import BaseHandler\n\n\n\nclass EmbedTerminalHandl... | python | chosen |
[
{
"from": "system",
"value": "Update docstrings for test file\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nimport factory\nfrom django.contrib.auth.models import User\nfrom profiles.models import ImagerProfile\n\n\nclass UserFactory(factory.django.DjangoModelFactory):\n ... | python | chosen |
[
{
"from": "system",
"value": "Make the AB test case more stable.\n"
},
{
"from": "human",
"value": "from . import TheInternetTestCase\nfrom helium.api import go_to, S, get_driver\n\nclass AbTestingTest(TheInternetTestCase):\n\tdef get_page(self):\n\t\treturn \"http://the-internet.herokuapp.com/a... | python | chosen |
[
{
"from": "system",
"value": "Replace newlines with a single space instead of nothing when minifying HTML\n"
},
{
"from": "human",
"value": "import re\n\nfrom django.utils.html import strip_spaces_between_tags\nfrom django.conf import settings\n\nRE_MULTISPACE = re.compile(r'\\s{2,}')\nRE_NEWLIN... | python | chosen |
[
{
"from": "system",
"value": "Fix the media manual updates unit test to account for the new ext dir page.\n\nMy previous change for the extension directory manual updates page broke\nthe unit tests. The existing test for the upload directory didn't take\ninto account that the extension directory would also ... | python | chosen |
[
{
"from": "system",
"value": "Comment compilation options for Windows."
},
{
"from": "human",
"value": "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick... | python | chosen |
[
{
"from": "system",
"value": "Add functional solution to 1\n"
},
{
"from": "human",
"value": "from itertools import chain\n\ndef threes_and_fives_gen(num=1000):\n for i in range(num):\n if i % 3 == 0 or i % 5 == 0:\n yield i\n\ndef threes_and_fives_fun(n):\n return set(ch... | python | chosen |
[
{
"from": "system",
"value": "Add tests for boolean conversion\n"
},
{
"from": "human",
"value": "import unittest\nfrom odml import Property, Section, Document\n\n\nclass TestProperty(unittest.TestCase):\n\n def setUp(self):\n pass\n\n def test_value(self):\n p = Property(\"p... | python | chosen |
[
{
"from": "system",
"value": "Fix celery task for industry indexes by adding missing field\n\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nfrom . import db\nfrom lazyblacksmith.models import Activity\n\n\nclass IndustryIndex(db.Model):\n\n solarsystem_id = db.Column(\n ... | python | chosen |
[
{
"from": "system",
"value": "Clear undo buffer when terminal cleared.\n"
},
{
"from": "human",
"value": "import threading\nimport wx\nfrom styled_text_ctrl import StyledTextCtrl\n\nclass ThreadOutputCtrl(StyledTextCtrl):\n def __init__(self, parent, env, auto_scroll=False):\n StyledTe... | python | chosen |
[
{
"from": "system",
"value": "Work out now() - 7 days\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n\nreturn 1\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python2\n\nfrom datetime import datetime, timedelta\nfrom json import loads\nimport sys\n\nif len(sys.argv) < 2:... | python | chosen |
[
{
"from": "system",
"value": "Remove more remnants of users\n"
},
{
"from": "human",
"value": "# from django.shortcuts import render\nfrom rest_framework import viewsets\nfrom .models import Datapoint, Activity\nfrom .serializers import ActivitySerializer, DatapointSerializer\n\n# Create your vi... | python | chosen |
[
{
"from": "system",
"value": "Optimize the common case to reduce startup time.\n"
},
{
"from": "human",
"value": "from process import Process\nfrom exit import err_exit\n\n\nclass Python(object):\n \"\"\"A Python interpreter path that can test itself.\"\"\"\n\n def __init__(self, defaults,... | python | chosen |
[
{
"from": "system",
"value": "Print build-script notes to stderr\n\nThis makes it easier to ignore them programmatically.\n"
},
{
"from": "human",
"value": "# swift_build_support/diagnostics.py - Diagnostic Utilities -*- python -*-\n#\n# This source file is part of the Swift.org open source ... | python | chosen |
[
{
"from": "system",
"value": "Change to directory config method"
},
{
"from": "human",
"value": "from genes.brew import commands as brew\nfrom genes.curl.commands import download\nfrom genes.debian.traits import is_debian\nfrom genes.directory import DirectoryBuilder\nfrom genes.mac.traits impor... | python | chosen |
[
{
"from": "system",
"value": "Add roles argument for createUser command.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 *-*\nimport logging\nimport unittest\n\nfrom mongolog import MongoHandler\n\ntry:\n from pymongo import MongoClient as Connection\nexcept ImportError:\n from pymo... | python | chosen |
[
{
"from": "system",
"value": "Move the pragma: nocover to except block\n"
},
{
"from": "human",
"value": "import gym\nimport pytest\n\n# Import for side-effect of registering environment\nimport imitation.examples.airl_envs # noqa: F401\nimport imitation.examples.model_envs # noqa: F401\n\nENV... | python | chosen |
[
{
"from": "system",
"value": "Check error repr can be str-ed\n"
},
{
"from": "human",
"value": "\"\"\" Test __str__ methods. \"\"\"\nimport pexpect\n\nfrom . import PexpectTestCase\n\n\nclass TestCaseMisc(PexpectTestCase.PexpectTestCase):\n\n def test_str_spawnu(self):\n \"\"\" Exercis... | python | chosen |
[
{
"from": "system",
"value": "Fix for bug in latest dbf module. Pypy passes now.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom cStringIO import StringIO\n\nimport dbf\n\nfrom csvkit import table\n\ndef dbf2csv(f, **kwargs):\n \"\"\"\n Convert a dBASE .dbf file to csv.\n\... | python | chosen |
[
{
"from": "system",
"value": "Return the json from the parser method\n"
},
{
"from": "human",
"value": "from bs4 import BeautifulSoup\nfrom requests.auth import HTTPBasicAuth\nimport requests\nimport json\n\ndef parse_content():\n rs = requests.get('http://soundspectra.com/admin/', auth=HTTPB... | python | chosen |
[
{
"from": "system",
"value": "Replace @ with , otherwise there is blank output from ansible-lint\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter4, a code checking framework for Sublime Text 3\n#\n# Written by Markus Liljedahl\n# Copyright (c) 2017 Markus Liljedahl\n... | python | chosen |
[
{
"from": "system",
"value": "Use spec 1.1 --with-timing option\n"
},
{
"from": "human",
"value": "from invoke import ctask as task\n\n\n@task(help={\n 'module': \"Just runs tests/STRING.py.\",\n 'runner': \"Use STRING to run tests instead of 'spec'.\",\n 'opts': \"Extra flags for the t... | python | chosen |
[
{
"from": "system",
"value": "Update to inherit from abstract class\n"
},
{
"from": "human",
"value": "import os\nimport redis\n\nfrom urllib.parse import urlparse\n\nredis_url = os.environ.get('REDISCLOUD_URL', 'redis://localhost:6379') \nredis_url_parse = urlparse(redis_url)\nredis_client = re... | python | chosen |
[
{
"from": "system",
"value": "Add monkey patch for mercurial trac\n"
},
{
"from": "human",
"value": "import logging\n\nfrom pylons import config, tmpl_context as c\nfrom pylons.controllers.util import abort\n\n# Conditionally import the trac components in case things trac isn't installed\ntry:\n... | python | chosen |
[
{
"from": "system",
"value": "Add debug code to test login post\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, url_for, redirect\nfrom flask import session, escape, request\nfrom peewee import *\n#from datetime import date\n\napp = Flask(__name__)\n# http://docs.pee... | python | chosen |
[
{
"from": "system",
"value": "Add allowed headers to preflight response."
},
{
"from": "human",
"value": "from jsonrpc import JSONRPCResponseManager\nfrom funcs import d\n\ndef app(environ, start_response):\n if 'POST'!=environ.get('REQUEST_METHOD'):\n if 'OPTIONS'==environ.get('REQUES... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in output json message\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom flask import Flask\nfrom flask import request\nfrom flask import jsonify\nfrom utils import download_file, create_temp_dir, zip_up_dir, delete_dir\nfrom annotations imp... | python | chosen |
[
{
"from": "system",
"value": "Add a \"valid shipping address check\" to account for VAT discrepancies\n\nIf we get a phone number and a city/country combination that yield\nincompatible VAT results, we need to flag this to the user. The best\nplace to do this is, ironically, the shipping address check.\n"
... | python | chosen |
[
{
"from": "system",
"value": "Make the abstract a Markdown field\n"
},
{
"from": "human",
"value": "from django.utils.translation import ugettext_lazy as _\nfrom django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\n\n\n# constants to... | python | chosen |
[
{
"from": "system",
"value": "FIX refresh data when running in loop\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom time import sleep\nfrom utils.mqtt import publish\nfrom weather import Weather\n\nw = Weather()\n\nwhile True:\n publish(w.basics(),\"stormfly\")\n sleep(60... | python | chosen |
[
{
"from": "system",
"value": "Add API number in get_config()\n"
},
{
"from": "human",
"value": "from ._convert import convert\nfrom . import log\nfrom . import random\nfrom . import version\nfrom .version import module as __version__\nfrom .version import api as __api_version__\n\ndef get_includ... | python | chosen |
[
{
"from": "system",
"value": "Return profile from get_profile view instead of user\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils.importlib import import_module\n\nfrom linked_accounts import LINKED_... | python | chosen |
[
{
"from": "system",
"value": "Use sort,pop,remove and so on.\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python\n#a=[1,2,3,4,5,6,7,8,9,10]\n#print a[:3]\n#print a[-3:]\n#print a[:]\n#print a[::2]\n#print a[8:3:-1]\n#print [1,2,3]+[4,5,6]\n#print [\"Hi\"]*3\n#print 1 in a\n#print max(a)\n... | python | chosen |
[
{
"from": "system",
"value": "Make the base request handler available by default\n"
},
{
"from": "human",
"value": "\"\"\"Custom Tinman Handlers add wrappers to based functionality to speed\napplication development.\n\n\"\"\"\nfrom tinman.handlers.session import SessionRequestHandler\n"
},
{... | python | chosen |
[
{
"from": "system",
"value": "Set up data tabulation for gs\n"
},
{
"from": "human",
"value": "\"\"\"\n \n\"\"\"\n\nimport os\nfrom whaler.dataprep import IO\n\nclass Analysis():\n \"\"\"\n \"\"\"\n def __init__(self):\n self.loc = os.getcwd()\n self.structs = next(os.walk... | python | chosen |
[
{
"from": "system",
"value": "Use x-sendfile to serve pre-generated wordcloud JSON.\n\nIf we've pre-generated the wordcloud JSON file, use x-sendfile to\nserve it rather than reading the file in Django.\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.conf import settings\nfrom django... | python | chosen |
[
{
"from": "system",
"value": "Remove comments that don't make sense\n"
},
{
"from": "human",
"value": "import romanesco\nimport unittest\n\n\nclass TestSwiftMode(unittest.TestCase):\n def testSwiftMode(self):\n task = {\n 'mode': 'swift',\n 'script': \"\"\"\ntype ... | python | chosen |
[
{
"from": "system",
"value": "Make the template and env yaml parsing more consistent\n\nin the environment_format.py use the same yaml_loader\n\nPartial-bug: #1242155\nChange-Id: I66b08415d450bd4758af648eaff0f20dd934a9cc\n"
},
{
"from": "human",
"value": "# vim: tabstop=4 shiftwidth=4 softtabsto... | python | chosen |
[
{
"from": "system",
"value": "Rename Template to CfnTemplate to avoid name collision\n"
},
{
"from": "human",
"value": "import boto3\nimport sys\nfrom colors import green, red\nfrom botocore.exceptions import ClientError\n\ns3_client = boto3.client('s3')\n\n\nclass InvalidTemplateError(BaseExcep... | python | chosen |
[
{
"from": "system",
"value": "Refactor code, add page hints\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python3\n# Python Challenge - 2\n# http://www.pythonchallenge.com/pc/def/ocr.html\n# Keyword: equality\n\n\ndef main():\n alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu... | python | chosen |
[
{
"from": "system",
"value": "Switch to getting the API key from the URL instead of a config file.\n\nAllows other people to get their anki calendar if they want."
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport os\nimport logging\n\nfrom django.http import HttpR... | python | chosen |
[
{
"from": "system",
"value": "Update Python simple server script to allow subdomains\n"
},
{
"from": "human",
"value": "import SimpleHTTPServer, SocketServer\nimport urlparse, os\n\nPORT = 3000\n\nclass MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):\n def do_GET(self):\n\n # Parse... | python | chosen |
[
{
"from": "system",
"value": "Remove redundant post migrate step for increasing well_tag_number count (no longer needed, data is no longer being replicated)\n"
},
{
"from": "human",
"value": "\"\"\"\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this ... | python | chosen |
[
{
"from": "system",
"value": "Add script explanation and message when script is complete.\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nimport django\n\nsys.path.append(\"/var/projects/museum/\")\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"museum.settings\")\ndjango.setup(... | python | chosen |
[
{
"from": "system",
"value": "Set default file extension to empty string\n\nBecause with a Bool the regex throws\n"
},
{
"from": "human",
"value": "import re\n\ntry:\n import javascript\n import html\nexcept:\n from . import javascript\n from . import html\n\ndef expand(string, start, end, e... | python | chosen |
[
{
"from": "system",
"value": "Reduce queries used to lookup config\n"
},
{
"from": "human",
"value": "# Eve W-Space\n# Copyright (C) 2013 Andrew Austin and other contributors\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU ... | python | chosen |
[
{
"from": "system",
"value": "Replace parsing with Python's ast\n\nAllows greater flexibility and syntax checks\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim: set fileencoding=UTF-8 :\n\n\nfrom ..semantics import mpq\nfrom .common import OPERATORS, ADD_OP, MULTIPLY_OP\n\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "TST: Remove yield from datasets tests\n\nRemove yield which is pending deprecation in pytest\n\nxref #4000\n"
},
{
"from": "human",
"value": "import numpy as np\nimport pandas as pd\n\nimport statsmodels.datasets as datasets\nfrom statsmodels.datasets import co2\nfr... | python | chosen |
[
{
"from": "system",
"value": "Increase the number of workers\n"
},
{
"from": "human",
"value": "import multiprocessing\nfrom os import getenv\nbind = '127.0.0.1:8001'\nworkers = multiprocessing.cpu_count() * 2\ntimeout = 60\nthreads = multiprocessing.cpu_count() * 2\nmax_requests = 1000\nmax_req... | python | chosen |
[
{
"from": "system",
"value": "Update smb test to include port parameter\n"
},
{
"from": "human",
"value": "from scoring_engine.engine.basic_check import CHECKS_BIN_PATH\n\nfrom tests.scoring_engine.engine.checks.check_test import CheckTest\n\n\nclass TestSMBCheck(CheckTest):\n check_name = 'S... | python | chosen |
[
{
"from": "system",
"value": "Add property decorator to getters\n"
},
{
"from": "human",
"value": "from configparser import ConfigParser\nfrom driver import BTRFSDriver\n\n\nclass Node:\n \"\"\"\n # Dummy config example\n [bk1-z3.presslabs.net]\n ssd = True\n \"\"\"\n def __ini... | python | chosen |
[
{
"from": "system",
"value": "Make it compatible with Bob"
},
{
"from": "human",
"value": "#!usr/bin/env python\n# coding: utf-8\n\n__author__ = \"Jérôme Kieffer\"\n__license__ = \"MIT\"\n__date__ = \"05/09/2017\"\n__copyright__ = \"2015, ESRF\"\n\nimport unittest\nfrom .test_all import suite\n\... | python | chosen |
[
{
"from": "system",
"value": "Add new line to end of init file for Meta Writer application"
},
{
"from": "human",
"value": "from pkg_resources import require\nrequire('pygelf==0.3.1')\nrequire(\"h5py==2.8.0\")\nrequire('pyzmq==16.0.2')"
},
{
"from": "gpt",
"value": "from pkg_resource... | python | chosen |
[
{
"from": "system",
"value": "Use new extension setup() API\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport os\n\nimport pygst\npygst.require('0.10')\nimport gst\nimport gobject\n\nfrom mopidy import config, ext\n\n\n__version__ = '1.0.0'\n\n\nclass Extension... | python | chosen |
[
{
"from": "system",
"value": "Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannon\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\n# Explosive Sheep\nclass GVG_076:\n\tdef deathrattle(self):\n\t\tfor target in self.game.board:\n\t\t\tself.hit(target, 2... | python | chosen |
[
{
"from": "system",
"value": "Add full_name field to API\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom rest_framework import permissions, routers, serializers, generics, mixins\nfrom oauth2_provider.ext.rest_framework import TokenHasReadWriteScope\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Remove period so input corresponds to output.\n\n\nFormer-commit-id: ec6debb1637304407715441ae8319787fe7f0945"
},
{
"from": "human",
"value": "import re\nfrom ufal.udpipe import Model, Pipeline, ProcessingError\n\nclass Parser:\n MODELS = {\n \"swe\": \"da... | python | chosen |
[
{
"from": "system",
"value": "Adjust extras sublime plugin to follow new changes\n"
},
{
"from": "human",
"value": "import sublime\nimport sublime_plugin\nfrom os.path import basename, dirname\nimport subprocess\n\n\ndef parse_file_name(file_name):\n if file_name is None:\n title = \"U... | python | chosen |
[
{
"from": "system",
"value": "pw_cli: Add quotes around user-provided values\n\nChange-Id: Ifc5fafeefef0dea65cb3aba90b985e6be31fa0bd\nReviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/81980\nReviewed-by: Joe Ethier <f5eb8cb2f5310c7fa9df6f16eabccb4436f47999@google.com>\nCommit-Queue: R... | python | chosen |
[
{
"from": "system",
"value": "Send alerts as one mail\n"
},
{
"from": "human",
"value": "from django.conf import settings\nimport logging\nfrom datetime import datetime, timedelta\nfrom celery.decorators import task\nfrom hr.utils import blacklist_values\nfrom django.contrib.auth.models import U... | python | chosen |
[
{
"from": "system",
"value": "Check for missing part thumbnails when the server first runs\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.apps import AppConfig\n\n\nclass PartConfig(AppConfig):\n name = 'part'\n"
},
{
"from": "gpt",
"valu... | python | chosen |
[
{
"from": "system",
"value": "Fix variable and return value\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom celery import shared_task\nfrom twisted.internet import reactor\nfrom scrapy.crawler import Crawler\nfrom scrapy import log, signals\nfrom scrapy.utils.proj... | python | chosen |
[
{
"from": "system",
"value": "Add AbstractSanitizer/AbstractValidator class to import path\n"
},
{
"from": "human",
"value": "\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom .__version__ import __author__, __copyright__, __email__, __license__, __version__... | python | chosen |
[
{
"from": "system",
"value": "Update error message for no plugins\n"
},
{
"from": "human",
"value": "__all__ = ['imshow', 'imread', 'imsave', '_app_show']\n\nimport warnings\n\nmessage = '''\\\nNo plugin has been loaded. Please refer to\n\nskimage.io.plugins()\n\nfor a list of available plugins... | python | chosen |
[
{
"from": "system",
"value": "Add list and define functions.\n"
},
{
"from": "human",
"value": "import json\n\nclass Noah(object):\n pass"
},
{
"from": "gpt",
"value": "import json\n\nclass Noah(object):\n def __init__(self, dictionary_file):\n self.dictionary = json.loa... | python | chosen |
[
{
"from": "system",
"value": "Add dependency on the requests module and refactor\n\nSince I didn't want to have to write my own Multipart POST handler when I start\nwriting the install command, I started doing research on the options and came\nacross \"requests\". I added the dependency and tried it out by ... | python | chosen |
[
{
"from": "system",
"value": "Refactor common serializer selection code.\n"
},
{
"from": "human",
"value": "from rest_framework import viewsets\n\nfrom paranuara_api.models import Company, Person\nfrom paranuara_api.serializers import (\n CompanySerializer, CompanyListSerializer, PersonLi... | python | chosen |
[
{
"from": "system",
"value": "Fix failing reconnects; add quit IRC command\n"
},
{
"from": "human",
"value": "from p1tr.helpers import clean_string\nfrom p1tr.plugin import *\n\n@meta_plugin\nclass Irc(Plugin):\n \"\"\"Provides commands for basic IRC operations.\"\"\"\n\n @command\n @re... | python | chosen |
[
{
"from": "system",
"value": "Update pylint dependency to 1.9.1\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2010-2018 OneLogin, Inc.\n# MIT License\n\nfrom setuptools import setup\n\n\nsetup(\n name='python-saml',\n version='2.4.1',... | python | chosen |
[
{
"from": "system",
"value": "Add csblog to installed scripts.\n"
},
{
"from": "human",
"value": "import platform, sys\nfrom distutils.core import setup\nfrom distextend import *\n\npackages, package_data = findPackages(\"countershape\")\nsetup(\n name = \"countershape\",\n version... | python | chosen |
[
{
"from": "system",
"value": "Bump version to prepare for next release.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\n# Match releases to redis-py versions\n__version__ = '2.9.0.11'\n\n# Jenkins will replace __build__ with a unique val... | python | chosen |
[
{
"from": "system",
"value": "Fix install-time dependency on pymongo.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nfrom setuptools import setup\n\nfrom mongorm import VERSION\n\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__... | python | chosen |
[
{
"from": "system",
"value": "Update broken link in PyPi (Homepage)"
},
{
"from": "human",
"value": "\nimport sys\nfrom setuptools import setup, find_packages\nfrom cement.utils import version\n\nVERSION = version.get_version()\n\nf = open('README.md', 'r')\nLONG = f.read()\nf.close()\n\nsetup(n... | python | chosen |
[
{
"from": "system",
"value": "Remove PIL and docutils from requirements, easy_thumbnails requires it anyway\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom setuptools import setup, find_packages\n\nsetup(name = \"django-image-cropping\",\n version = \"0.3.0\",\n d... | python | chosen |
[
{
"from": "system",
"value": "Handle symlinks in path to home directory\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# © 2017-2019 qsuscs, TobiX\n# Should still run with Python 2.7...\n\nfrom __future__ import print_function, unicode_literals\n\nimport os\n... | python | chosen |
[
{
"from": "system",
"value": "Move 'nose' dependency to 'tests_require'\n\n`nose` is only required for invoking `setup.py test`, not for any other\n`setup.py` command. This avoids the auto-download behavior when just\nbuilding and installing the module (e.g., installing via `pip`).\n\nSigned-off-by: Eric N... | python | chosen |
[
{
"from": "system",
"value": "Use regex for finding version in __init__.py\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport codecs\nimport os\nfrom setuptools import setup, find_packages\n\nimport piazza_api\n\n\ndef read(filename):\n \"\"\"Read and return `f... | python | chosen |
[
{
"from": "system",
"value": "Change version to prevent unleash from choking.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=utf8\n\nimport os\n\nfrom setuptools import setup, find_packages\n\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname))... | python | chosen |
[
{
"from": "system",
"value": "Switch from bold to red highlighting.\n\nWith many terminal fonts bold is subtle. The red is much more clear.\n"
},
{
"from": "human",
"value": "# Copyright Google\n\n# BSD License\n\nimport copy\nimport wash\n\n# from http://stackoverflow.com/questions/8924173/how-... | python | chosen |
[
{
"from": "system",
"value": "Add a configuration key for the URL of the Fedora OpenID server"
},
{
"from": "human",
"value": "SECRET_KEY = 'changeme please'\n\n# TODO -- May I set this to true?\nFAS_OPENID_CHECK_CERT = False\n\n#ADMIN_GROUPS = ['sysadmin-web']\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Fix getting unwatched episodes from Plex\n"
},
{
"from": "human",
"value": "class Plex(object):\n def __init__(self, plex):\n self.plex = plex\n\n def get_watched_episodes(self, section_name):\n watched_episodes = set(self.plex.library.section(se... | python | chosen |
[
{
"from": "system",
"value": "Sort on first name after last name\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom compat import BufferDictWriter\nfrom .models import CSV_ROW_FIELDS\n\n\ndef _candidate_sort_by_name_key(row):\n return (\n row['name'].spl... | python | chosen |
[
{
"from": "system",
"value": "Use strings for IDs in Committee Popolo\n"
},
{
"from": "human",
"value": "from django.http import JsonResponse\nfrom django.views.generic import ListView\n\nfrom pombola.core.models import Organisation\n\n\n# Output Popolo JSON suitable for WriteInPublic for any co... | python | chosen |
[
{
"from": "system",
"value": "Fix from_email in IncomingLetter migrations\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\ndef split_models(apps, schema_editor):\n # We can't import the Person ... | python | chosen |
[
{
"from": "system",
"value": "Add import of the InvalidDirectoryValueError to the directory package's test file\n"
},
{
"from": "human",
"value": "\"\"\"Contains the unit tests for the inner directory package\"\"\"\n\nimport unittest\nimport os\n\nfrom classyfd import Directory\n\nclass TestDire... | python | chosen |
[
{
"from": "system",
"value": "Remove old reimplementation of routes.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom rest_framework import routers\n\n# Special router for actions.\nactions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix a bad import (get_version)\n"
},
{
"from": "human",
"value": "# -*- coding: UTF-8 -*-\n# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend\n\n# Import from itools\nfrom itools.pkg import get_version\n\n\n__version__ = get_version()\n"
},
{
"from": "g... | python | chosen |
[
{
"from": "system",
"value": "TST: Clarify py.test arguments in run_test.py\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport pytest\n\nif __name__ == '__main__':\n sys.exit(pytest.main())\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport sy... | python | chosen |
[
{
"from": "system",
"value": "style(comments): Add comments about security issue\n\n- Added comments about two security issues relating to the session secret key\n"
},
{
"from": "human",
"value": "from wKRApp import app\napp.secret_key = \"my precious\" # 2 security flaws, need to sort out\napp.... | python | chosen |
[
{
"from": "system",
"value": "Change url in dashboard administrador\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom .views import admin_main_dashboard, admin_users_dashboard, \\\n admin_users_create, admin_users_edit, admin_users_edit_form, \\\n ... | python | chosen |
[
{
"from": "system",
"value": "Use classifiers to specify the license.\n\nClassifiers are a standard way of specifying a license, and make it easy\nfor automated tools to properly detect the license of the package.\n\nThe \"license\" field should only be used if the license has no\ncorresponding Trove classi... | python | chosen |
[
{
"from": "system",
"value": "Add Python 3.9 to the list of supported versions.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nlong_description = open('README.rst').read()\n\nsetup(\n name=\"celery-redbeat\",\n description=\"A Celery Beat Scheduler using Redis for persi... | python | chosen |
[
{
"from": "system",
"value": "Add dependency link to daploader from pypi to overide Openshift's cache\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(\n name='Dapi',\n version='1.0',\n description='DevAssistant Package Index',\n autho... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.