conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Make a new entry to import all modules.\n"
},
{
"from": "human",
"value": "\"\"\"\nAll class templated which can be derivated.\nList:\n Platform\n Prompt\n\"\"\"\n"
},
{
"from": "gpt",
"value": "\"\"\"\nAll class templated which can be derivated.\n... | python | chosen |
[
{
"from": "system",
"value": "Update prices for all BlueprintInstances we currently have\n"
},
{
"from": "human",
"value": "import sqlite3\r\nimport urllib2\r\nimport xml.etree.ElementTree as ET\r\n\r\n\r\nMARKET_URL = 'http://api.eve-central.com/api/marketstat?hours=24&%s'\r\n\r\nITEMS = [\r\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix error in file path of where images are loaded from in load_image()\n"
},
{
"from": "human",
"value": "# Defining a function to load images\ndef load_image(image_name, fade_enabled=False):\n \"\"\"fade_enabled should be True if you want images to be able to fa... | python | chosen |
[
{
"from": "system",
"value": "Add smiley face to output\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"A Python calculator\"\"\"\nimport sys\n\ncommand = sys.argv[1]\nnumbers = [float(a) for a in sys.argv[2:]]\na = float(sys.argv[2])\nb = float(sys.argv[3])\n\n\nif command == 'a... | python | chosen |
[
{
"from": "system",
"value": "Implement add_knight_data to generate data directly.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.db import models, migrations\nfrom django.core.management import call_command\n\n\ndef add_knight_da... | python | chosen |
[
{
"from": "system",
"value": "Fix error when running python sample on codebox.io\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\napp = Flask(__name__)\n\n@app.route(\"/\")\ndef hello():\n return \"Hello World!\"\n\nif __name__ == \"__main__\":\n app.run(\n p... | python | chosen |
[
{
"from": "system",
"value": "Remove token from being stored\n"
},
{
"from": "human",
"value": "# Copyright 2014 Dave Kludt\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 copy of the ... | python | chosen |
[
{
"from": "system",
"value": "Fix Django 5.0 deprecation warning.\n"
},
{
"from": "human",
"value": "import os\n\nSECRET_KEY = \"h_ekayhzss(0lzsacd5cat7d=pu#51sh3w&uqn#tz26vuq4\"\n\nDATABASES = {\"default\": {\"ENGINE\": \"django.db.backends.sqlite3\", \"NAME\": \":memory:\"}}\n\nINSTALLED_AP... | python | chosen |
[
{
"from": "system",
"value": "Add logging for DemographicInfo, and ignore empty strings.\n"
},
{
"from": "human",
"value": "\"\"\"\nContains DemographicInfo class, which stores info found by accounts.\n\"\"\"\n\nfrom collections import UserDict\n\nclass DemographicInfo(UserDict):\n\n def __se... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary (and py2) print\n"
},
{
"from": "human",
"value": "import argparse\nimport sys, os\nparser = argparse.ArgumentParser()\nparser.add_argument('pyqlabpath', help='path to PyQLab directory')\nparser.add_argument('qubit', help='qubit name')\nparser.add... | python | chosen |
[
{
"from": "system",
"value": "Make a BCEDate for the dates before CE day 1.\n"
},
{
"from": "human",
"value": "from datetime import date as vanilla_date, timedelta\n\nfrom .base import Calendar\n\nclass JulianDayNumber(Calendar):\n first_ce_day = vanilla_date(1, 1, 1)\n first_ce_day_number... | python | chosen |
[
{
"from": "system",
"value": "Fix Gosport import script error\n"
},
{
"from": "human",
"value": "from data_importers.management.commands import BaseDemocracyCountsCsvImporter\n\n\nclass Command(BaseDemocracyCountsCsvImporter):\n council_id = \"GOS\"\n addresses_name = \"2022-05-05/2022-03-... | python | chosen |
[
{
"from": "system",
"value": "Add github token to model\n"
},
{
"from": "human",
"value": "from bson.objectid import ObjectId\nfrom humbledb import Mongo, Document\n\n\nclass ClassProperty (property):\n \"\"\"Subclass property to make classmethod properties possible\"\"\"\n def __get__(sel... | python | chosen |
[
{
"from": "system",
"value": "Webapp: Add imports for Wm_metrics module\n\nWe have to manually add wm_metrics to the Python Path\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template\napp = Flask(__name__)\n\n@app.route(\"/\")\ndef index():\n return render_template('inde... | python | chosen |
[
{
"from": "system",
"value": "Print time it took to run the source\n"
},
{
"from": "human",
"value": "from sh import cp, rm\nimport sh\nimport os\n\nSURSA_CPP = 'main.cpp'\nPROBLEMA = 'coliziune'\n\ncp('../' + SURSA_CPP, '.')\nos.system('g++ ' + SURSA_CPP)\n\nfor i in range(1, 11):\n print 'Tes... | python | chosen |
[
{
"from": "system",
"value": "Make Ignores init accept default patterns\n\nThis also makes read() an instance method instead of a class method.\n"
},
{
"from": "human",
"value": "import os\nfrom fnmatch import fnmatchcase\nimport click\n\n\nclass Ignores(object):\n @classmethod\n def read(... | python | chosen |
[
{
"from": "system",
"value": "Add logging for Intercom event generation\n"
},
{
"from": "human",
"value": "from intercom.client import Client\nfrom django.conf import settings\nfrom celery import shared_task\n\n\nintercom = Client(personal_access_token=settings.INTERCOM_ACCESS_TOKEN)\n\n\n@share... | python | chosen |
[
{
"from": "system",
"value": "Add a Hypothesis test for Defuzzer\n"
},
{
"from": "human",
"value": "from defuzz import Defuzzer\n\n\ndef test_it():\n dfz = Defuzzer()\n assert dfz.defuzz((1, 2)) == (1, 2)\n assert dfz.defuzz((1, 3)) == (1, 3)\n assert dfz.defuzz((1.00000001, 2)) == (... | python | chosen |
[
{
"from": "system",
"value": "Raise warning when python version is < 3.5\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport sys\n\nif sys.version_info < (3, 5):\... | python | chosen |
[
{
"from": "system",
"value": "Add container for global configurations\n"
},
{
"from": "human",
"value": "\"\"\"Run bcbio-nextgen installations inside of virtual machines and containers.\n\"\"\"\n"
},
{
"from": "gpt",
"value": "\"\"\"Run bcbio-nextgen installations inside of virtual m... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect CustomVision base init.py"
},
{
"from": "human",
"value": "# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See ... | python | chosen |
[
{
"from": "system",
"value": "api/views: Move blueprint imports into register() function\n"
},
{
"from": "human",
"value": "from flask import request\nfrom werkzeug.exceptions import Forbidden\nfrom werkzeug.useragents import UserAgent\nfrom .errors import register as register_error_handlers\nfr... | python | chosen |
[
{
"from": "system",
"value": "Set up argparse to accept params and display usage\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nPARENT_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')\nsys.path.append(PARENT_PATH)\n\nfrom antlr4 import FileStream, CommonTokenStr... | python | chosen |
[
{
"from": "system",
"value": "Improve how the active link is checked\n"
},
{
"from": "human",
"value": "from django import VERSION as DJANGO_VERSION\nfrom django import template\nfrom django.conf import settings\nif DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] <= 9:\n from django.core.urlreso... | python | chosen |
[
{
"from": "system",
"value": "Improve meetup's validation error messages\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom pizzaplace.models import PizzaPlace\nfrom django.core.validators import RegexValidator\nfrom meetup.services.meetup_api_lookup_agent import MeetupApiLook... | python | chosen |
[
{
"from": "system",
"value": "Add copyright header to migration\n"
},
{
"from": "human",
"value": "\n\"\"\"Change conclusion dropdowns options in control assessment\n\nRevision ID: 29dca3ce0556\nRevises: 2d8a46b1e4a4\nCreate Date: 2015-09-11 13:18:18.269109\n\n\"\"\"\n\n# revision identifiers, u... | python | chosen |
[
{
"from": "system",
"value": "Make markup template filter take filter_name argument\n"
},
{
"from": "human",
"value": "\"\"\"\nA filter which can perform many types of text-to-HTML conversion.\n\n\"\"\"\n\nfrom django.template import Library\nfrom template_utils.markup import markup_filter\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Use error severity for flask output\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\n\napp = Flask(__name__)\napp.config.from_pyfile('settings.cfg')\napp.secret_key = os.urandom(128)\n\nfrom scoring_engine.web.views import welcome, scoreboard... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect global comment in include path script\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n\"\"\"\nDeploys the website to a target directory supplied as an argument.\n\"\"\"\n\nimport json\nimport os\nimport sys\n\ndef iterate_over(dict_or_li... | python | chosen |
[
{
"from": "system",
"value": "tests/equality: Replace test for == with an Hypothesis test\n"
},
{
"from": "human",
"value": "from hypothesis import given\nfrom ppb_vector import Vector2\nfrom utils import vectors\n\ndef test_equal():\n test_vector_1 = Vector2(50, 800)\n test_vector_2 = Vector2... | python | chosen |
[
{
"from": "system",
"value": "Set special methods on TohuBaseGenerator to allow e.g. adding two generators\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module is not meant to be imported directly.\nIts purpose is to patch the TohuBaseGenerator class\nso that its special methods __add__, __mul... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fixed a windows bug that prevented run locating the Maven batch file to run mvn commands. This will need to be modified to run on Linux\"\n\nThis reverts commit b9dfad50415d6f7d90d66da30a1a55cbe62a07ef.\n"
},
{
"from": "human",
"value": "#! /usr/bin/python\... | python | chosen |
[
{
"from": "system",
"value": "Use correct parent class for clock\n"
},
{
"from": "human",
"value": "'''\nCopyright (c) 2017, Jairus Martin.\n\nDistributed under the terms of the MIT License.\n\nThe full license is in the file COPYING.txt, distributed with this software.\n\nCreated on May 20, 201... | python | chosen |
[
{
"from": "system",
"value": "Revert \"working on version file\"\n\nThis reverts commit cb159cd3d907aeaa65f6a293d95a0aa7d7f2fee8.\n"
},
{
"from": "human",
"value": "import sys\nimport glob\nimport re\n\nNEW_VERSION = sys.argv[1]\n\nwith open('VERSION') as f:\n VERSION=f.read()\n \n\nprint ... | python | chosen |
[
{
"from": "system",
"value": "peas-demo: Add a configure dialog to the python plugin.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# ex:set ts=4 et sw=4 ai:\n\nimport gobject\nfrom gi.repository import Peas\nfrom gi.repository import Gtk\n\nLABEL_STRING=\"Python Says Hello!\"\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Enforce unique user names in the database model\n\nSet unique=TRUE and deleted TODO comment line\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom common.util.generator import get_random_id\n\n\nclass Student(models.Model):\n # ToDo: Make us... | python | chosen |
[
{
"from": "system",
"value": "Fix test for word vector\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom spacy.en import English\n\nimport pytest\n\n@pytest.mark.models\ndef test_vec(EN):\n hype = EN.vocab['hype']\n assert hype.orth_ == 'hype'\n assert 0... | python | chosen |
[
{
"from": "system",
"value": "Add Lease to public api\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport etcd3.etcdrpc as etcdrpc\nfrom etcd3.client import Etcd3Client\nfrom etcd3.client import Transactions\nfrom etcd3.client import client\nfrom etcd3.members imp... | python | chosen |
[
{
"from": "system",
"value": "Return one project for testing\n"
},
{
"from": "human",
"value": "__author__ = 'jloeffler'\n\ndef list_projects():\n\n return {}\n\ndef list_contributors():\n\n return {}\n"
},
{
"from": "gpt",
"value": "__author__ = 'jloeffler'\n\nfrom github3 imp... | python | chosen |
[
{
"from": "system",
"value": "Add TODO to broken test\n"
},
{
"from": "human",
"value": "\"\"\"Plot to test logscale\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport mpld3\n\n\ndef create_plot():\n fig = plt.figure()\n fig.subplots_adjust(hspace=0.4, wspace=0.4)\n\n ax... | python | chosen |
[
{
"from": "system",
"value": "Add better check for being in a CMS-page request\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom app_data import AppDataContainer, app_registry\nfrom cms.apphook_pool import apphook_pool\nfrom django.core.urlresolvers import resolve\n\n\ndef get_app... | python | chosen |
[
{
"from": "system",
"value": "Remove zopen in pymatgen root.\n\n\nFormer-commit-id: 375be0147716d3b4d2dee95680eae4ee3804716b [formerly 05648421c1fa77f6f339f68be2c43bb7952e918a]\nFormer-commit-id: e5cfaf0277815951ddb09d9d6b30876e400870d7"
},
{
"from": "human",
"value": "__author__ = \", \".join([... | python | chosen |
[
{
"from": "system",
"value": "Return lowercased random tokens for consistency.\n"
},
{
"from": "human",
"value": "import random\nimport hashlib\nimport base64\n\ndef generate_key():\n key = hashlib.sha224(str(random.getrandbits(256))).digest()\n key = base64.b64encode(key, \n ra... | python | chosen |
[
{
"from": "system",
"value": "Fix artifacts name sanitization for root folders\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#\n# Copyright 2018-2022 Polyaxon, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance w... | python | chosen |
[
{
"from": "system",
"value": "Allow additional properties on Text\n\ngit-svn-id: ec97508af0aa29a1d296967d6f0ba22a468c79d6@350 286bb87c-ec97-11de-a004-2f18c49ebcc3\n"
},
{
"from": "human",
"value": "from rctk.widgets.control import Control, remote_attribute\n\nfrom rctk.task import Task\nfrom rct... | python | chosen |
[
{
"from": "system",
"value": "Fix crashes from misc. events\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport time\nfrom slackclient import SlackClient\nimport mh_python as mh\nimport argparse\nimport random\n\n\ndef main():\n parser = argparse.ArgumentParser(\n... | python | chosen |
[
{
"from": "system",
"value": "Remove \"Recompiling...\" output when building .fp files\n\nChange-Id: I41402dc04d4388217d7f7cd8de9aff8fbb4a3765\nReviewed-on: https://skia-review.googlesource.com/c/skia/+/317391\nReviewed-by: John Stiles <f4fcf42d3bb5924557f1eeb3be66747535e585da@google.com>\nCommit-Queue: Bri... | python | chosen |
[
{
"from": "system",
"value": "Add test for 1d array arguments for Wrapper\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom functools import partial\n\nfrom elfi.wrapper import Wrapper\n\nclass Test_wrapper():\n\n def test_echo_exec_arg(self):\n command = \"echo {0}\"\n ... | python | chosen |
[
{
"from": "system",
"value": "feat: Update to Sentimental 2.2.x with undersampling\n"
},
{
"from": "human",
"value": "import re, math\nfrom collections import Counter\nimport itertools\n\nfrom sentimental import sentimental\n\n\nclass SentimentAnalyzer():\n\n _sentimental = sentimental.Sentim... | python | chosen |
[
{
"from": "system",
"value": "Remove sets from tests\nSince python 2.6 does not have literal set syntax"
},
{
"from": "human",
"value": "import unittest\nfrom robber import expect\nfrom robber.matchers.contain import Contain\n\nclass TestAbove(unittest.TestCase):\n def test_matches(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "fix: Change create sample code to ensure matching order ids data\n"
},
{
"from": "human",
"value": "# importing modules/ libraries\nimport pandas as pd\nimport random\n\n# create sample of order products train data\nn = 1384617\ns = round(0.1 * n)\nskip = sorted(ran... | python | chosen |
[
{
"from": "system",
"value": "Use uvloop because apparently it's fast.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport argparse\nimport asyncio\nimport logging\nimport sys\nfrom pathlib import Path\nfrom MoMMI.logsetup import setup_logs\n\n# Do this BEFORE we import master, bec... | python | chosen |
[
{
"from": "system",
"value": "Refactor create action into function\n"
},
{
"from": "human",
"value": "from createCollection import createCollectionFile\nfrom ObjectFactories.ItemFactory import ItemFactory\nfrom DataObjects.Collection import Collection\nimport datetime, json, os.path, argparse\n\... | python | chosen |
[
{
"from": "system",
"value": "Check possible exception with wrong key data\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.forms import Form\nfrom django.test import TestCase\n\nfrom snowpenguin.django.recaptcha2.fields import ReCaptchaField\nfrom snowpenguin.django.recaptcha2.widget... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with HDF5 objects that don't have a value "
},
{
"from": "human",
"value": "import os\nimport h5py\nfrom glue.core import Data\n\n\ndef read_step_to_data(filename, step_id=0):\n \"\"\"\n Given a filename and a step ID, read in the data into a new Dat... | python | chosen |
[
{
"from": "system",
"value": "Add description and user-end functionality\n\nMain.py takes one optional parameter: a filepath for a log file.\nIf left empty, all output goes into stdout.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nfrom ANN import ANN\nfrom random import seed as srand... | python | chosen |
[
{
"from": "system",
"value": "Sort returned images by date, taking into account overrides\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom cms.plugin_base import CMSPluginBase\nfrom cms.plugin_pool import plugin_pool\nfrom .mod... | python | chosen |
[
{
"from": "system",
"value": "Implement ability to save json data to collection file\n"
},
{
"from": "human",
"value": "from createCollection import createCollection\nfrom ObjectFactories.ItemFactory import ItemFactory\nfrom DataObjects.Collection import Collection\nimport datetime\nimport json\... | python | chosen |
[
{
"from": "system",
"value": "Bring the autonomous mode back\n"
},
{
"from": "human",
"value": "\r\ntry:\r\n import wpilib\r\nexcept ImportError:\r\n from pyfrc import wpilib\r\n \r\n# import components here\r\nfrom components import drive, intake, catapult\r\n\r\nclass MyRobot(wpilib.S... | python | chosen |
[
{
"from": "system",
"value": "TST: Test that event_model forbids dots in key names.\n"
},
{
"from": "human",
"value": "from bluesky.run_engine import RunEngine\nfrom bluesky.tests.utils import setup_test_run_engine\nfrom bluesky.examples import simple_scan, motor\n\n\nRE = setup_test_run_engine(... | python | chosen |
[
{
"from": "system",
"value": "Add a level of uper directory\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\n(dir, filename) = os.path.split(os.path.abspath(sys.argv[0]))\nprint(dir)\nfilenames = os.listdir(dir)\nfor file in filenames:\n print(file)\n\nprint('**********************... | python | chosen |
[
{
"from": "system",
"value": "Add new validator that applies data_api_client.email_is_valid_for_admin_user to field\n"
},
{
"from": "human",
"value": "from flask.ext.wtf import Form\nfrom wtforms import validators\n\nfrom dmutils.forms import StripWhitespaceStringField\n\n\nclass EmailAddressFor... | python | chosen |
[
{
"from": "system",
"value": "Add some versioning for dateUpdated so that updated documents aren't bumped to the top of the stream\n"
},
{
"from": "human",
"value": "import logging\n\nfrom elasticsearch import Elasticsearch\n\nfrom scrapi import settings\nfrom scrapi.processing.base import BaseP... | python | chosen |
[
{
"from": "system",
"value": "Use the disco.compat.http_server to work with python3.\n"
},
{
"from": "human",
"value": "from disco.test import TestCase, TestJob\nfrom disco.core import Job\nimport disco\nimport threading\nimport BaseHTTPServer\n\n\ndef map(line, params):\n for word in line.sp... | python | chosen |
[
{
"from": "system",
"value": "Implement a couple of other French templates.\n\nStill need to add tests for these.\n\n\nFormer-commit-id: 4021d27a7bd15a396b637beb57c10fc95936cb3f"
},
{
"from": "human",
"value": "#-*- encoding: utf-8 -*-\n\nimport base\n\nclass SnippetParser(base.SnippetParserBase... | python | chosen |
[
{
"from": "system",
"value": "Add test for new fast correlation\n"
},
{
"from": "human",
"value": "from time import time\nimport numpy as np\nfrom skan.vendored import thresholding as th\n\n\nclass Timer:\n def __init__(self):\n self.interval = 0\n\n def __enter__(self):\n se... | python | chosen |
[
{
"from": "system",
"value": "Use terminal for dev email output\n"
},
{
"from": "human",
"value": "\nimport sys\n\nADMINS = (\n (\"Mike\", \"michael.bryant@kcl.ac.uk\"),\n)\n\nEMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'\n\nif \"test\" in sys.argv:\n DATABASES = {\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove Individual as a book_type - it doesn’t really add anything. AMAAS-639.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nBOOK_TYPES = {'Counterparty', 'Individual', 'Management', 'Tradin... | python | chosen |
[
{
"from": "system",
"value": "Add a bunch of plotting and keyword arguments\n"
},
{
"from": "human",
"value": "\"\"\"\nUser-facing interface to all dimensionality reduction algorithms\n\"\"\"\n\ndef smushplot(data, smusher):\n if isinstance(smusher, str):\n # Need to get appropriate sm... | python | chosen |
[
{
"from": "system",
"value": "Fix the dashboard migration for UUID\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.3 on 2018-06-20 12:37\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Mig... | python | chosen |
[
{
"from": "system",
"value": "Update weather display to be run during specified intervals.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom subprocess import call\n\nURL = 'http://microdash.herokuapp.com/FOG/'\nOUTPUT_FILE = '/mnt/us/weather/weather-script-output.png'\n\n\ndef clea... | python | chosen |
[
{
"from": "system",
"value": "Add EA count bug note\n"
},
{
"from": "human",
"value": "import csv\nimport json\n\nwith open('2015_06_29_NNHS_2015_Selected EA_Final.xlsx - EA_2015.csv') as csvfile:\n reader = csv.reader(csvfile, delimiter=',')\n clusterfile = {}\n next(reader)\n for r... | python | chosen |
[
{
"from": "system",
"value": "Use just a random string instead of uuid in shell name.\n\npython 2.4 lacks uuid module.\n\nChange-Id: I5a1d5339741af2f4defa67d17f557639cd30bb91\nReviewed-on: http://review.couchbase.org/12462\nTested-by: Aliaksey Artamonau <3c875bcfb3adf2a65b2ae7686ca921e6c9433147@gmail.com>\n... | python | chosen |
[
{
"from": "system",
"value": "Add missing open action to the example so that you can open other files\n\n(usefull for testing and evaluating)\n"
},
{
"from": "human",
"value": "\"\"\"\nThis is a very basic usage example of the JSONCodeEdit.\n\nThe interface is minimalist, it will open a test fil... | python | chosen |
[
{
"from": "system",
"value": "Add more variables and bug fixes\n"
},
{
"from": "human",
"value": "__author__ = 'mcsquaredjr'\n\nimport os\n\nnode_file = os.environ[\"NODES\"]\ncad_file = os.environ[\"CAD\"]\nprocs_per_nod = os.environ[\"PROCS_PER_NODE\"]\n\n\ndef my_lines(ip):\n with open(cad... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong mail server in settings\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n talkoohakemisto.settings.production\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This module contains application settings specific to a production\n envi... | python | chosen |
[
{
"from": "system",
"value": "Fix an old migration that was reading configuration before migrating\n"
},
{
"from": "human",
"value": "\"\"\" Add keep as an option in fetches\n\nRevision ID: 3f6994568962\nRevises: 2335c80a6bc3\nCreate Date: 2017-02-02 22:31:00.719703\n\n\"\"\"\n\n# revision ident... | python | chosen |
[
{
"from": "system",
"value": "Make readpst partial output ingest.\n"
},
{
"from": "human",
"value": "from ingestors.base import Ingestor\nfrom ingestors.support.temp import TempFileSupport\nfrom ingestors.support.shell import ShellSupport\nfrom ingestors.support.ole import OLESupport\nfrom inges... | python | chosen |
[
{
"from": "system",
"value": "Fix up parse search func\n"
},
{
"from": "human",
"value": "def parse_app_page(response):\n # Should always be able to grab a title\n title = response.xpath('//div[@class = \"panel panel-default panel-gameinfo\"]/div[@class = \"panel-heading\"]/text()').extrac... | python | chosen |
[
{
"from": "system",
"value": "Add Chainmap support for python2\n"
},
{
"from": "human",
"value": "\"\"\"Determine the generator format\"\"\"\nfrom collections import ChainMap\n\nDEFAULT_FORMAT = {\n 'domain': 'example.com',\n 'app': '{repo}{project}',\n 'dns_elb': '{repo}.{project}.{env... | python | chosen |
[
{
"from": "system",
"value": "Add more joy using decorators\n"
},
{
"from": "human",
"value": "from flask.ext.classy import FlaskView\n\n\nclass AnalyserView(FlaskView):\n def get(self):\n return \"awesome\"\n"
},
{
"from": "gpt",
"value": "from flask.ext.classy import FlaskView\... | python | chosen |
[
{
"from": "system",
"value": "Add yellow color for services\n"
},
{
"from": "human",
"value": "#coding=utf-8\nfrom __future__ import absolute_import\n\n\nfrom fabric.api import local, run, sudo, task\nfrom fabric.contrib.console import confirm\nfrom fabric.state import env\nfrom fabric.context_m... | python | chosen |
[
{
"from": "system",
"value": "Update model enums to match app\n"
},
{
"from": "human",
"value": "class ModelType(object):\n \"\"\"\n Enums for the differnet model types\n DO NOT CHANGE EXISTING ONES\n \"\"\"\n\n EVENT = 0\n TEAM = 1\n MATCH = 2\n EVENT_TEAM = 3\n DISTR... | python | chosen |
[
{
"from": "system",
"value": "Add additional shortcuts for top level package\n"
},
{
"from": "human",
"value": "\"\"\"Dependency injector.\"\"\"\n\nfrom .catalog import AbstractCatalog\nfrom .catalog import override\n\nfrom .providers import Provider\nfrom .providers import Delegate\nfrom .provi... | python | chosen |
[
{
"from": "system",
"value": "Use numpy array for ROI\n"
},
{
"from": "human",
"value": "import cv2\n\nWINDOW_NAME = 'hello'\n\ndef global_on_mouse(event, x, y, unknown, lego_player):\n lego_player.on_mouse(event, x, y)\n\nclass LegoPlayer(object):\n def __init__(self):\n self.rect ... | python | chosen |
[
{
"from": "system",
"value": "Simplify the construction of the __main__ module in run_python_file.\n"
},
{
"from": "human",
"value": "\"\"\"Execute files of Python code.\"\"\"\n\nimport imp, os, sys\n\ndef run_python_file(filename, args):\n \"\"\"Run a python file as if it were the main progr... | python | chosen |
[
{
"from": "system",
"value": "Move pages from registration to accounts/\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom django.contrib import admin\nfrom django.views.generic.simple import direct_to_template\n\nimport settings\n\nadmin.autodiscover()\n\nurlpatter... | python | chosen |
[
{
"from": "system",
"value": "Remove unused LOG to keep code clean\n\nTrivialFix\n\nChange-Id: I21fa9ebda98005c377d395f498cb44cf6599f0e5\n"
},
{
"from": "human",
"value": "# Copyright 2011 VMware, Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License... | python | chosen |
[
{
"from": "system",
"value": "Move user login code to djangoautoconf.\n"
},
{
"from": "human",
"value": "from djangoautoconf.django_utils import retrieve_param\nfrom django.utils import timezone\nfrom provider.oauth2.backends import AccessTokenBackend\nfrom provider.oauth2.models import AccessTo... | python | chosen |
[
{
"from": "system",
"value": "Fix the list of local_date objects in the ModeStatTimeSummary\n"
},
{
"from": "human",
"value": "import logging\nimport emission.core.wrapper.wrapperbase as ecwb\nimport emission.core.wrapper.motionactivity as ecwm\n\n# Used for various metrics such as count, distan... | python | chosen |
[
{
"from": "system",
"value": "Add note for test_api_me django-project test\n"
},
{
"from": "human",
"value": "import unittest\nfrom datetime import datetime\n\nfrom snapshottest.django import TestCase\n\n\ndef api_client_get(url):\n return {\n 'url': url,\n }\n\n\nclass TestDemo(Tes... | python | chosen |
[
{
"from": "system",
"value": "Standardize the fixture directory names.\n"
},
{
"from": "human",
"value": "from nose.tools import *\nimport os, shutil\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nimport sys\nsys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'... | python | chosen |
[
{
"from": "system",
"value": "Fix write program telecommand part size\n"
},
{
"from": "human",
"value": "import struct\r\n\r\nfrom telecommand import Telecommand\r\n\r\n\r\nclass EraseBootTableEntry(Telecommand):\r\n def apid(self):\r\n return 0xB0\r\n\r\n def payload(self):\r\n ... | python | chosen |
[
{
"from": "system",
"value": "Rename OAuth var to avoid naming conflicts\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_login import LoginManager\nfrom flask_oauthlib.client import OAuth\n\nfrom config import config\n\ndb = SQLAlch... | python | chosen |
[
{
"from": "system",
"value": "Add feature to process user input and provide automatic suggestions\n"
},
{
"from": "human",
"value": "# Import non-standard modules\nimport json\n\n\ndef definition(word):\n '''This function returns the available definitions(s) of the input'''\n return data[w... | python | chosen |
[
{
"from": "system",
"value": "Add class method to check if PC is a Mac\n"
},
{
"from": "human",
"value": "import platform\n\n\nclass OSXDodger(object):\n allowed_version = \"10.12.1\"\n\n def __init__(self, applications_dir):\n self.app_dir = applications_dir\n\n def load_applica... | python | chosen |
[
{
"from": "system",
"value": "Add benchmark for writing with index of last dimension\n"
},
{
"from": "human",
"value": "# Write the benchmarking functions here.\n# See \"Writing benchmarks\" in the asv docs for more information.\nimport os.path as osp\nimport numpy as np\nfrom tempfile import Te... | python | chosen |
[
{
"from": "system",
"value": "Remove unecessary parentesis from raise call\n"
},
{
"from": "human",
"value": "from openpassword.exceptions import InvalidPasswordException\n\n\nclass Keychain:\n\n def __init__(self, encryption_key):\n self.encryption_key = encryption_key\n self._... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Disable Django-CMS test on Django 1.10+\"\n\nDjango CMS tests should work now with Django 1.10 and 1.11 too, since\nthe Django CMS version 3.4.5 supports them.\n\nThis reverts commit fcfe2513fc8532dc2212a254da42d75048e76de7.\n"
},
{
"from": "human",
"value"... | python | chosen |
[
{
"from": "system",
"value": "Prepare for next development version\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom celery.signals import setup_logging\nimport orchestrator.logger\n\n__version__ = '0.3.10'\n__author__ = 'sukrit'\n\norchestrator.logger.init_logging(... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.