conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Initialize folder only at creation\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os.path\nfrom django.db import models\nfrom django.conf import settings\nfrom django.db.models.signals import post_save\nfrom django.utils.translation import ugette... | python | chosen |
[
{
"from": "system",
"value": "Add docs and issue tracker to metadata\n"
},
{
"from": "human",
"value": "__title__ = 'libtmux'\n__package_name__ = 'libtmux'\n__version__ = '0.8.1'\n__description__ = 'scripting library / orm for tmux'\n__email__ = 'tony@git-pull.com'\n__author__ = 'Tony Narlock'\n... | python | chosen |
[
{
"from": "system",
"value": "Fix _time_to_micros bug. It was calling time.time() when it should use its own argument.\n"
},
{
"from": "human",
"value": "\"\"\" Utility functions\n\"\"\"\nimport random\nimport time\nfrom . import constants\n\ndef _service_url_from_hostport(secure, host, port):\n... | python | chosen |
[
{
"from": "system",
"value": "Fix the import all mamba error\n"
},
{
"from": "human",
"value": "from mamba.loader import describe, context\nfrom mamba.hooks import before, after\nfrom mamba.decorators import skip\n\n__all__ = [describe, context, before, after, skip]\n"
},
{
"from": "gpt"... | python | chosen |
[
{
"from": "system",
"value": "Set timeout on pca test\n"
},
{
"from": "human",
"value": "\n\ndef test_pca():\n from sequana.viz.pca import PCA\n from sequana import sequana_data\n import pandas as pd\n\n data = sequana_data(\"test_pca.csv\")\n df = pd.read_csv(data)\n df = df.s... | python | chosen |
[
{
"from": "system",
"value": "Add unit tests for functions call and check and fold for module player\n"
},
{
"from": "human",
"value": "import unittest\nfrom pypoker import Player\nfrom pypoker import Table\n\nclass PlayerTestCase(unittest.TestCase):\n ''' \n Tests for the Player class\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a few trivial tests\n"
},
{
"from": "human",
"value": "import unittest\nfrom pearhash import PearsonHasher\n\n\n\nclass TestPearsonHasher(unittest.TestCase):\n\n\tdef test_table_is_a_permutation_of_range_256(self):\n\t\thasher = PearsonHasher(2)\n\t\tself.assert... | python | chosen |
[
{
"from": "system",
"value": "Reformat test and use text_file fixture\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom __future__ import unicode_literals\nfrom io import StringIO\n\nimport pytest\n\nword2vec_str = \"\"\", -0.046107 -0.035951 -0.560418\nde -0.648927 -0.400976 -0.527124\... | python | chosen |
[
{
"from": "system",
"value": "Fix a misleading and confusing outdated typo in base layer.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# This is the new base initialization layer for Mineserver.\n# Always call this instead of server_core.py.\nfrom __future... | python | chosen |
[
{
"from": "system",
"value": "Clean up the temporary file when done with it.\n"
},
{
"from": "human",
"value": "from test_support import TESTFN\nfrom UserList import UserList\n\n# verify writelines with instance sequence\nl = UserList(['1', '2'])\nf = open(TESTFN, 'wb')\nf.writelines(l)\nf.close... | python | chosen |
[
{
"from": "system",
"value": "Correct a typo in variable name\n"
},
{
"from": "human",
"value": "import importlib\n\ndef get_specifications(name):\n \"\"\"Return a datasource specification file according to the following pattern:\\n\\\n \n datasource_<name>.py\n \n where <... | python | chosen |
[
{
"from": "system",
"value": "Add json module as fallback for simplejson\n"
},
{
"from": "human",
"value": "import requests\nimport simplejson as json\n\n\ndef getbaseurl(service='search', version='1', method='track',\n format='json'):\n \"\"\"Returns the base URL for a Spotify... | python | chosen |
[
{
"from": "system",
"value": "Allow tests to find mothership module\n"
},
{
"from": "human",
"value": "import os\r\nimport pytest\r\n\r\nfrom mothership import create_app, settings\r\nfrom mothership import db as _db\r\n\r\n\r\n@pytest.fixture(scope='session')\r\ndef app(request):\r\n\tapp = cre... | python | chosen |
[
{
"from": "system",
"value": "Make download first step for install_software process type\n\n"
},
{
"from": "human",
"value": "import virtool.db.processes\n\nFIRST_STEPS = {\n \"delete_reference\": \"delete_indexes\",\n \"clone_reference\": \"copy_otus\",\n \"import_reference\": \"load_f... | python | chosen |
[
{
"from": "system",
"value": "Make volttron a namespace package.\n"
},
{
"from": "human",
"value": "'''\nCopyright (c) 2013, Battelle Memorial Institute\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the foll... | python | chosen |
[
{
"from": "system",
"value": "Add next part of parser, and fix errors in earlier part arising from incomplete data items\n"
},
{
"from": "human",
"value": "# Requires pandas and matplotlib to be installed, e.g.\n#\n# `sudo apt-get install pandas-python`\n\nimport json\nimport re\nimport pand... | python | chosen |
[
{
"from": "system",
"value": "Use the ECMASCRIPT5_STRICT flag otherwise AngularJS dies\n"
},
{
"from": "human",
"value": "\nfrom collections import OrderedDict\nimport os\nimport StringIO\nfrom django.conf import settings\nfrom django.utils.encoding import smart_str\nfrom ..base import Processor... | python | chosen |
[
{
"from": "system",
"value": "Change assertEquals to assertEqual due to deprecation warnings\n"
},
{
"from": "human",
"value": "import flask_testing\nimport logging\nimport unittest\nimport urllib\n\nimport server\n\nlogging.disable(logging.CRITICAL)\n\nclass TestIndex(unittest.TestCase):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add some more utility functions.\n"
},
{
"from": "human",
"value": "import os\nimport os.path\nfrom os.path import join as pjoin\n\ndef download_file(source, target):\n return 'wget %s -O %s' % (source, target)\n\ndef get_file_list(base_path, include_list = None, e... | python | chosen |
[
{
"from": "system",
"value": "Remove del fetched_tweets (now a generator)\n"
},
{
"from": "human",
"value": "from apscheduler.schedulers.blocking import BlockingScheduler\n\nfrom twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,\n update_status)\n\nfrom memory_profiler... | python | chosen |
[
{
"from": "system",
"value": "Remove obsolete python2 unicode helpers\n"
},
{
"from": "human",
"value": "import zipfile\n\nfrom django.views.generic import View\nfrom django.http import HttpResponse\nfrom django.core.files.base import ContentFile\nfrom django.utils.six import b\n\n\nclass BaseZi... | python | chosen |
[
{
"from": "system",
"value": "Switch to an alpha version\n"
},
{
"from": "human",
"value": "\"\"\"An Extensible Dependency Resolver written in Python\n\"\"\"\n\n__version__ = \"0.1.0.dev0\"\n"
},
{
"from": "gpt",
"value": "\"\"\"An Extensible Dependency Resolver written in Python\n\"... | python | chosen |
[
{
"from": "system",
"value": "Fix issue when a private match is found multiple times\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nProcessor functions\n\"\"\"\n\n\ndef conflict_prefer_longer(matches):\n \"\"\"\n Remove shorter matches if they co... | python | chosen |
[
{
"from": "system",
"value": "Remove header from gold script file\n"
},
{
"from": "human",
"value": "#* This file is part of the MOOSE framework\n#* https://www.mooseframework.org\n#*\n#* All rights reserved, see COPYRIGHT for full restrictions\n#* https://github.com/idaholab/moose/blob/master/C... | python | chosen |
[
{
"from": "system",
"value": "Order questions by published date\n\nCloses #23\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Question(models.Model):\n question_text = models.CharField(max_length=140)\n published_at = models.DateTimeField(auto_now_add=True)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix noqa location, bump version\n"
},
{
"from": "human",
"value": "\"\"\"\nRejected is a Python RabbitMQ Consumer Framework and Controller Daemon\n\n\"\"\"\nimport logging\n\n# Add NullHandler to prevent logging warnings\nlogging.getLogger(__name__).addHandler(loggi... | python | chosen |
[
{
"from": "system",
"value": "Fix multiple spaces after ','\n"
},
{
"from": "human",
"value": "\nfrom knowit.rule import Rule\n\n\nclass AlternativeRule(Rule):\n \"\"\"Alternative rule.\"\"\"\n\n def __init__(self, name, prop_name: str, **kwargs):\n super().__init__(name, **kwargs)... | python | chosen |
[
{
"from": "system",
"value": "Add support for mingw-linux toolchains\n"
},
{
"from": "human",
"value": "# Copyright (C) Ivan Kravets <me@ikravets.com>\n# See LICENSE for details.\n\n\"\"\"\n Builder for Windows x86\n\"\"\"\n\nfrom SCons.Script import AlwaysBuild, Default, DefaultEnvironment\n... | python | chosen |
[
{
"from": "system",
"value": "Allow user to enter pebble <cmd> --debug as well as pebble --debug <cmd>\n"
},
{
"from": "human",
"value": "import os\n\nclass PblCommand:\n name = ''\n help = ''\n\n def run(args):\n pass\n\n def configure_subparser(self, parser):\n parser... | python | chosen |
[
{
"from": "system",
"value": "Set dj-stripe as stripe app info\n\nhttps://stripe.com/docs/building-plugins#setappinfo\n"
},
{
"from": "human",
"value": "\"\"\"\n.. module:: djstripe.\n\n :synopsis: dj-stripe - Django + Stripe Made Easy\n\"\"\"\nfrom __future__ import absolute_import, division, ... | python | chosen |
[
{
"from": "system",
"value": "Add PropBase.flatten() support for flattening lists\n"
},
{
"from": "human",
"value": "import facter\nfrom collections import MutableMapping\n\nfrom piper.abc import DynamicItem\n\n\nclass PropBase(DynamicItem):\n def __init__(self):\n super(PropBase, self... | python | chosen |
[
{
"from": "system",
"value": "feat(user): Add login methods to Piazza\n"
},
{
"from": "human",
"value": "class Piazza(object):\n \"\"\"Unofficial Client for Piazza's Internal API\"\"\"\n def __init__(self):\n pass\n"
},
{
"from": "gpt",
"value": "from .rpc import PiazzaR... | python | chosen |
[
{
"from": "system",
"value": "Add calls to furniture placement functions\n"
},
{
"from": "human",
"value": "import sys\nfrom enum import Enum\n\nclass Furniture(Enum):\n bed = 1\n couce = 2\n desk = 3\n chair = 4\n tv = 5\n table = 6\n rug = 7\n shelf = 8\n\nf = open(sys.... | python | chosen |
[
{
"from": "system",
"value": "Update main arguments parser config\n"
},
{
"from": "human",
"value": "from sys import exit\n\nimport argparse\n\nfrom .commands import dispatch\nfrom .config import get_config\nfrom .utils import merge\n\n\ndef main():\n parser = argparse.ArgumentParser()\n p... | python | chosen |
[
{
"from": "system",
"value": "Refactor to reuse the encode method for decoding\n"
},
{
"from": "human",
"value": "import math\nimport secrets\nfrom string import ascii_lowercase\n\n\nclass Cipher(object):\n def __init__(self, key=None):\n if not key:\n key = self._random_key... | python | chosen |
[
{
"from": "system",
"value": "Add optional text to display\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n'''\nGiven:\n1. status code: (0 - OK, other value - BAD)\n2. terminal window width\n\nshows red/green bar to visualize return code of previous command\n'''\n\nimport sys\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Configure Lassie for more information\n"
},
{
"from": "human",
"value": "import lassie\nfrom pyembed.core import PyEmbed\n\nfrom beavy.app import cache\n\npyembed = PyEmbed()\n\n@cache.memoize()\ndef extract_info(url):\n return lassie.fetch(url)\n\n\n@cache.memoi... | python | chosen |
[
{
"from": "system",
"value": "Change qm7 example to use MultiFeature\n"
},
{
"from": "human",
"value": "import numpy\nfrom sklearn.linear_model import Ridge\nfrom sklearn.kernel_ridge import KernelRidge\nfrom sklearn.metrics import mean_absolute_error as MAE\n\nfrom molml.features import Encoded... | python | chosen |
[
{
"from": "system",
"value": "Rename test to something more descriptive.\n"
},
{
"from": "human",
"value": "\"\"\"\nTests utility scripts\n\"\"\"\nimport os\n\nfrom django.test import TestCase, RequestFactory\nfrom django.test.utils import override_settings\n\nimport pivot\nfrom pivot.utils impo... | python | chosen |
[
{
"from": "system",
"value": "Improve management command for exporting pi-xml\n"
},
{
"from": "human",
"value": "import sys\n\nfrom django.core.management.base import BaseCommand\nimport pandas as pd\n\nfrom tslib.readers import PiXmlReader\nfrom tslib.writers import PiXmlWriter\n\nfrom ddsc_cor... | python | chosen |
[
{
"from": "system",
"value": "Make this test a django test case\n"
},
{
"from": "human",
"value": "import pytest\n\nimport os\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"api.api.settings\")\n\nfrom . import utils\nfrom scrapi.linter.document import NormalizedDocument, RawDocument\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add missing UnexpectedResponseFormat for backward compatability\n\nSigned-off-by: Abhijeet Kasurde <6334fd0c217b1f2a15926284df229acde5b4fc3a@redhat.com>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nclass PysnowException(Exception):\n pass\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Change to preferred encoding style.\n\nUTF-8 -> utf-8\n"
},
{
"from": "human",
"value": "\"\"\"\nSerializer plugin interface.\n\nThis module is useful for those wanting to write a serializer that can\nplugin to rdflib. If you are wanting to invoke a serializer you l... | python | chosen |
[
{
"from": "system",
"value": "ci: Fix failing tests on appveyor\n"
},
{
"from": "human",
"value": "\nimport ci_addons\nimport os\nimport pytest\nimport subprocess\n\nfrom . import captured_lines\n\n\ndef test_home():\n expected_home = os.path.abspath(os.path.dirname(__file__) + '/..')\n as... | python | chosen |
[
{
"from": "system",
"value": "Update api url for recent 100 instead of default 30\n"
},
{
"from": "human",
"value": "import requests\nimport collections\n\nAPI_URL = 'https://api.github.com/users/{}/repos'\n\n\ndef main(user):\n return parse(request(user))\n\n\ndef request(user):\n return ... | python | chosen |
[
{
"from": "system",
"value": "Change tourney match transfer model from `attrs` to `dataclass`\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.tourney.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LIC... | python | chosen |
[
{
"from": "system",
"value": "Test custom configuration file feature\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nimport pytest\nimport uuid\nfrom s3keyring.s3 import S3Keyring\n\n\n@pytest.fixture\ndef config(scope='module'):\n return S3Keyring(profile_name='test').config\... | python | chosen |
[
{
"from": "system",
"value": "Move logic for creating RunProcessError to ExecutionResult.to_error\n"
},
{
"from": "human",
"value": "def result(return_code, output, stderr_output, allow_error=False):\n if allow_error or return_code == 0:\n return ExecutionResult(return_code, output, st... | python | chosen |
[
{
"from": "system",
"value": "Use dtype objects instead of classes in the array API\n\nThe array API does not require any methods or behaviors on dtype objects,\nother than that they be literals that can be compared for equality and passed\nto dtype keywords in functions. Since dtype objects are already use... | python | chosen |
[
{
"from": "system",
"value": "Add the ability to use inet socket as well.\n\n\ngit-svn-id: ffaf500d3baede20d2f41eac1d275ef07405e077@1236 a8f5125c-1e01-0410-8897-facf34644b8e\n"
},
{
"from": "human",
"value": "import os\nimport logging\n\nfrom kaa.base import ipc\nfrom client import *\nfrom serve... | python | chosen |
[
{
"from": "system",
"value": "Support for Box direct drawing to screen bitmap"
},
{
"from": "human",
"value": "\"\"\"\nA screen object contains a collection of boxes to be displayed on a\nphysical display device.\n\"\"\"\n\nfrom pydispatch import dispatcher\nfrom reui import SGL_BOX_UPDATE\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Update Acme version to 0.2.1.\n\nPiperOrigin-RevId: 375471102\nChange-Id: I9e134bfa61b07059eac564efd515ab788eb1e4f4\n"
},
{
"from": "human",
"value": "# python3\n# Copyright 2018 DeepMind Technologies Limited. All rights reserved.\n#\n# Licensed under the Apache Lic... | python | chosen |
[
{
"from": "system",
"value": "[Instabot] Make example bot use keepalive\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: ascii -*-\n\n# A small example bot for Instant.\n\nimport sys\n\nimport instabot\n\nNICKNAME = 'Echo'\n\ndef post_cb(self, msg, meta):\n if msg['tex... | python | chosen |
[
{
"from": "system",
"value": "Fix default fixture to initialize database\n"
},
{
"from": "human",
"value": "import pytest\n\n\n@pytest.fixture(scope='module')\ndef app():\n from api import app\n return app\n"
},
{
"from": "gpt",
"value": "import pytest\n\n\n@pytest.fixture(scop... | python | chosen |
[
{
"from": "system",
"value": "Fix HTMLParser compatibility in Python 3\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\ncoop_cms manage compatibilty with django and python versions\n\"\"\"\n\nimport sys\n\n\nfrom django import VERSION\n\nif sys.version_info[0] < 3:\n # Pyth... | python | chosen |
[
{
"from": "system",
"value": "Set code to Invalid argument for ValueErrors\n\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Distributed under the MIT software license, see the accompanying\n# file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfrom grpc import StatusCode\n... | python | chosen |
[
{
"from": "system",
"value": "Add basic load config function\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Seva Zhidkov\n@contact: zhidkovseva@gmail.com\n@license: The MIT license\n\nCopyright (C) 2015\n\"\"\"\n\nfrom sheldon.exceptions import *\nfrom sheldon.man... | python | chosen |
[
{
"from": "system",
"value": "feat: Add created file to sublime\n"
},
{
"from": "human",
"value": "\"\"\"createTodoFile.py: Creates an todo file with title name as current date\"\"\"\n\nimport time\nimport os.path\n\n\ndef createfile():\n # My-File--2009-12-31--23-59-59.txt\n date = time.s... | python | chosen |
[
{
"from": "system",
"value": "Connect person to user account\n"
},
{
"from": "human",
"value": "# Django\n# Third-Party\nfrom django.db.models.signals import pre_delete\nfrom django.db.models.signals import pre_save\nfrom django.dispatch import receiver\nfrom django.conf import settings\n\n# Loc... | python | chosen |
[
{
"from": "system",
"value": "Add test to check if connection is closed after email is sent.\n"
},
{
"from": "human",
"value": "import smtplib\nimport unittest\nfrom unittest import mock\n\nfrom action import PrintAction, EmailAction\n\n\n@mock.patch(\"builtins.print\")\nclass PrintActionTest(un... | python | chosen |
[
{
"from": "system",
"value": "Fix EGreedy policy call order\n"
},
{
"from": "human",
"value": "import random\nfrom .greedy import Greedy\nfrom .random_policy import RandomPolicy\nfrom ..policy import Policy\nfrom ...utils import check_random_state\n\n\nclass EGreedy(Policy):\n\n def __init__(... | python | chosen |
[
{
"from": "system",
"value": "Remove one blank to be friends with the lama.\n"
},
{
"from": "human",
"value": "\"\"\"Test the logger module\"\"\"\n\nfrom gobble.logger import log\n\n\ndef test_gobble_logger_exists():\n assert log.name == 'Gobble'\n\n"
},
{
"from": "gpt",
"value": ... | python | chosen |
[
{
"from": "system",
"value": "Add a test that calls exec_cmd\n"
},
{
"from": "human",
"value": "\"\"\"Tests for ifcfg.tools.\"\"\"\n\nimport logging\nimport os\nimport unittest\n\nimport ifcfg\nfrom nose.tools import eq_\n\n\nclass IfcfgToolsTestCase(unittest.TestCase):\n\n def test_minimal_l... | python | chosen |
[
{
"from": "system",
"value": "Add methord to generate unique robot name\n"
},
{
"from": "human",
"value": "# File: robot_name.py\n# Purpose: Write a program that manages robot factory settings.\n# Programmer: Amal Shehu\n# Course: Exercism\n# Date: Friday 30 September 201... | python | chosen |
[
{
"from": "system",
"value": "Create update view (extends UpdateView generic view).\nDefine get_initail in order to pre populate two custom fields username and email which are not in the original\nArtists model.\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, get_object_o... | python | chosen |
[
{
"from": "system",
"value": "Add universal_newlines paramter to run call\n"
},
{
"from": "human",
"value": "import discord\nimport asyncio\nimport os\nimport signal\nimport sys\nfrom subprocess import run\n\n#Set up Client State\nCLIENT_TOKEN=os.environ['TOKEN']\n\n#Create Discord client\nclien... | python | chosen |
[
{
"from": "system",
"value": "Convert movie year to str\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n# scrapeOMDB.py - parses a movie and year from arguments and returns JSON\n\nimport json, requests\n\nURL_BASE = 'http://www.omdbapi.com/?'\n\ndef OMDBmovie(mTitle, mYear):\n # Craft... | python | chosen |
[
{
"from": "system",
"value": "Change back to django default\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"settings\")\n sys.path.append(os.path.dirname(os.path.dirname(__... | python | chosen |
[
{
"from": "system",
"value": "Add function to get content in list of dicts format\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom picklefield.fields import PickledObjectField\n\nclass Channel(models.Model):\n name = models.SlugField(max_length=50, unique=True)\n upd... | python | chosen |
[
{
"from": "system",
"value": "Remove not needed comment line\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\n# Create your models here.\n\n\n\nclass Data_Ingredient(models.Model):\n \"\"\"\"Class used to Store Ingredients of the recipes found in the crawling process\"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Introduce family id for all\n"
},
{
"from": "human",
"value": "{\n PDBConst.Name: \"config\",\n PDBConst.Columns: [\n {\n PDBConst.Name: \"Name\",\n PDBConst.Attributes: [\"varchar(128)\", \"not null\", \"primary key\"]\n },\n {\n ... | python | chosen |
[
{
"from": "system",
"value": "Use radio buttons for the style and number of answers.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.contrib import admin\nfrom django.utils.translation import ugettext_lazy as _\nfrom . import mod... | python | chosen |
[
{
"from": "system",
"value": "Use compatible(for Python2.6) format string.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom sqlalchemy import Column, String\n\nfrom .db import Base, Session\n\n__all__ = ['Schema']\n\nclass Schema(Base):\n\n __tablename... | python | chosen |
[
{
"from": "system",
"value": "Change all js to point to krisk repo\n"
},
{
"from": "human",
"value": "\nfrom collections import OrderedDict\nfrom IPython.display import Javascript\nimport json\nfrom krisk.util import join_current_dir\n\nECHARTS_URL = 'https://cdnjs.cloudflare.com/ajax/libs/echar... | python | chosen |
[
{
"from": "system",
"value": "Tweak the version number to match other ETS projects.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2005-2013 by Enthought, Inc.\n# All rights reserved.\n\"\"\" Two-dimensional plotting application toolkit.\n Part of the Chaco project of the Enthought Tool... | python | chosen |
[
{
"from": "system",
"value": "Add status to project form\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom .models import Project\n\n\nclass ProjectForm(forms.ModelForm):\n def __init__(self, *args, **kwargs):\n self.user = kwargs.pop('user')\n super(ProjectFor... | python | chosen |
[
{
"from": "system",
"value": "Add kwarg to load function to distinguish from full install\n\nThe load function is used for a full install and thus always adds\ngeneral configuration lines to the loader file, but we don't want that\nfor plugin installation.\n"
},
{
"from": "human",
"value": "from... | python | chosen |
[
{
"from": "human",
"value": "Add test case for list containing words with tags\n"
},
{
"from": "gpt",
"value": "# coding=UTF-8\n\nimport unittest\nimport treetojson\n\n\nclass TreeToJsonTests(unittest.TestCase):\n def test_list(self):\n result = \"{\\\"SENTENCE\\\":[{\\\"NN\\\":\\\"Eve... | python | chosen |
[
{
"from": "system",
"value": "Remove redirect again, it's somehow causing the JS issue and it won't work for other media types\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom django.views.generic.simple import redirect_to\n\nurlpatterns = patterns('',\n \n ... | python | chosen |
[
{
"from": "system",
"value": "RobotError: Use __str__ for formatting the error.\n\nOn a traceback, the __str__ value will be read instead of __repr__ so we\nget the name of the exception class, but not the actual exception.\n\nThis is now no longer the case :-)\n\nSigned-off-by: aszlig <ee1aa092358634f9c53f... | python | chosen |
[
{
"from": "system",
"value": "Customize scripts to work with menu\n"
},
{
"from": "human",
"value": "import loadFunction.py\n\nloadFilesService()\n\nFilesPolicyService.browse( \"title\", \"true\", 1, 25 )\n"
},
{
"from": "gpt",
"value": "import ibmcnx.test.loadFunction\n\nloadFilesSe... | python | chosen |
[
{
"from": "system",
"value": "Clear the operator default engines before running operator tests\n\nReviewed By: akyrola\n\nDifferential Revision: D5729024\n\nfbshipit-source-id: f2850d5cf53537b22298b39a07f64dfcc2753c75\n"
},
{
"from": "human",
"value": "## @package test_util\n# Module caffe2.pyth... | python | chosen |
[
{
"from": "system",
"value": "Add instanciate method + docstring\n"
},
{
"from": "human",
"value": "\"\"\"\nClient for Zuora SOAP API\n\"\"\"\n# TODO:\n# - Handle debug\n# - Handle error\n# - Session policy\nimport os\n\nfrom suds.client import Client\nfrom suds.sax.element import Element\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix PEP8 E713 - test for membership should be \"not in\"\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Import python libs\nimport os\n\n# Import third party libs\nimport yaml\nimport logging\n\n# Import salt libs\nimport salt.utils\n\nlog = logging.g... | python | chosen |
[
{
"from": "system",
"value": "Add test helper method for checking direct_to_template views.\n"
},
{
"from": "human",
"value": "from nose.tools import ok_, eq_\nimport unittest\n\nimport models\n\nclass SimpleModel(models.ComradeBaseModel):\n def __unicode__(self):\n return u'This is a ... | python | chosen |
[
{
"from": "system",
"value": "Increase the number of Gunicorn workers\n"
},
{
"from": "human",
"value": "bind = \"127.0.0.1:4567\"\nlogfile = \"/usr/local/ohc/log/op.gunicorn.log\"\nworkers = 3\ntimeout = 60\n"
},
{
"from": "gpt",
"value": "bind = \"127.0.0.1:4567\"\nlogfile = \"/usr... | python | chosen |
[
{
"from": "system",
"value": "Change root URL to redirect to /rna/\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom nucleus.base import views\n\n\nurlpatterns = (\n url(r'^/?$', views.home, name='base.home'),\n)\n"
},
{
"from": "gpt",
"value": "from djan... | python | chosen |
[
{
"from": "system",
"value": "Fix import issue in h5py.py\n"
},
{
"from": "human",
"value": "\"\"\"Objects for datasets serialized in HDF5 format (.h5).\"\"\"\nimport h5py\nfrom pylearn2.datasets.dense_design_matrix import DenseDesignMatrix\n\n\nclass HDF5Dataset(DenseDesignMatrix):\n \"\"\"D... | python | chosen |
[
{
"from": "system",
"value": "Leverage __call__ on task downstream\n"
},
{
"from": "human",
"value": "import os\n\nfrom invoke.tasks import task\nfrom invoke.runner import run\n\n\ndocs_dir = 'docs'\nbuild = os.path.join(docs_dir, '_build')\n\n\n@task\ndef clean_docs():\n run(\"rm -rf %s\" % ... | python | chosen |
[
{
"from": "system",
"value": "Upgrade libchromiumcontent to loose iframe sandbox.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport platform\nimport sys\n\nNODE_VERSION = 'v0.11.13'\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONTEN... | python | chosen |
[
{
"from": "system",
"value": "Put the code into a comment as an example usage.\n"
},
{
"from": "human",
"value": "import numpy as np\n\ndef mean_power(x_blocks):\n return np.sqrt(np.mean(x_blocks**2, axis=-1))\n\ndef power(x_blocks):\n return np.sqrt(np.sum(x_blocks**2, axis=-1))\n\ndef me... | python | chosen |
[
{
"from": "system",
"value": "Make HTTPDownloader work with YAML config\n"
},
{
"from": "human",
"value": "import requests\n\nclass HttpDownloader():\n def __init__(self, opts={}):\n self.base = opts\n\n def build_request_options(self, opts):\n options = {'method': 'get'}\n ... | python | chosen |
[
{
"from": "system",
"value": "Make signal dispatch_uid values more specific"
},
{
"from": "human",
"value": "from .utils import index, delete\nfrom django.db import models\nimport logging\n\nlogger = logging.getLogger(__name__)\n\nclass ModelIndexingMiddleware (object):\n \"\"\"\n Middlewa... | python | chosen |
[
{
"from": "system",
"value": "Fix bug on API with date in Terms and Conditions not serializable\n"
},
{
"from": "human",
"value": "\"\"\"\n Root views of api\n\"\"\"\n\nimport json\nimport os\nimport markdown2\nfrom django.http import HttpResponse\n\nfrom django.db import models\nfrom rest_fr... | python | chosen |
[
{
"from": "system",
"value": "Implement rudimentary task 2 solution\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom . import render_task\n\n@render_task\ndef solve():\n return dict(\n solution='42',\n title='task2'\n )"
},
{
"from": "gpt",
"... | python | chosen |
[
{
"from": "system",
"value": "Make create_tokenizer work with Japanese\n"
},
{
"from": "human",
"value": "# encoding: utf8\nfrom __future__ import unicode_literals, print_function\n\nfrom os import path\n\nfrom ..language import Language\nfrom ..attrs import LANG\nfrom ..tokens import Doc\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Add one-line summary to docstring.\n"
},
{
"from": "human",
"value": "\nfrom rest_framework.negotiation import DefaultContentNegotiation\n\n\nclass JSONAPIContentNegotiation(DefaultContentNegotiation):\n\n def select_renderer(self, request, renderers, format_suff... | python | chosen |
[
{
"from": "system",
"value": "Change name from MatrixData to DenseData\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom sympy import IndexedBase\n\n\nclass MatrixData(IndexedBase):\n def __init__(self, name, shape, dtype):\n self.name = name\n self.shape = shape\n ... | python | chosen |
[
{
"from": "system",
"value": "Update help to indicate where the necessary script lives\n"
},
{
"from": "human",
"value": "\"\"\" \nEdits the spectide amplitude values to some factor of their original value.\n\nWARNING: When using this on FVCOM input files, it will change the format of\nthe varia... | python | chosen |
[
{
"from": "system",
"value": "Add more files to export on the init.\n"
},
{
"from": "human",
"value": "from SurveyFDEM import *\nfrom FDEM import ProblemFDEM_e, ProblemFDEM_b, ProblemFDEM_j, ProblemFDEM_h\n"
},
{
"from": "gpt",
"value": "from SurveyFDEM import *\nfrom FDEM import Bas... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.