conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Raise ConnectionException when device unusable\n"
},
{
"from": "human",
"value": "# Copyright 2015 Spotify AB. All rights reserved.\n#\n# The contents of this file are licensed under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file exc... | python | chosen |
[
{
"from": "system",
"value": "Add tests for Attr nesting\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Author: Florian Mayer <florian.mayer@bitsrc.org>\n\nfrom __future__ import absolute_import\n\nfrom sunpy.net import attr\n\ndef test_dummyattr():\n one = attr.DummyAttr()\n ... | python | chosen |
[
{
"from": "system",
"value": "Correct default passphrase length following d9913ce\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"Utility for generating memorable passwords\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\n\nimport argp... | python | chosen |
[
{
"from": "system",
"value": "Add types to top-level import to simplify porting from h5py\n\nPreviously, types like Dataset would have to be imported\nthrough exdir.core.Dataset, which exposes an internal implementation\ndetail (everything being in exdir.core).\n\nType-checking by comparing the type to the ... | python | chosen |
[
{
"from": "system",
"value": "Fix invalid statement for SubjectAlternativeName in self signed cert.\n"
},
{
"from": "human",
"value": "import datetime\nfrom cryptography.hazmat.backends import default_backend\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives... | python | chosen |
[
{
"from": "system",
"value": "Use actuall mp3s for testing\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom mopidy.backends.gstreamer import GStreamerBackend\n\nfrom tests.backends.basetests import (BasePlaybackControllerTest,\n BaseCurrentPlaylistC... | python | chosen |
[
{
"from": "system",
"value": "Use return value in subgenerator test\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom resumeback import send_self\n\nfrom . import CustomError, defer, wait_until_finished, State\n\n\ndef test_subgenerator_next():\n ts = State()\n\n def subgenerator(th... | python | chosen |
[
{
"from": "system",
"value": "Use \">>\" for indicating next event, fix bug with indexing\n"
},
{
"from": "human",
"value": "def parseinfo_context(parseinfo, context_amount = 3):\n buffer = parseinfo.buffer\n context_start_line = max(parseinfo.line - 1 - context_amount, 0)\n before_cont... | python | chosen |
[
{
"from": "system",
"value": "Change import structure for doctests\n"
},
{
"from": "human",
"value": "from __future__ import division, absolute_import, print_function\n\nfrom numpy import pad as numpy_pad\n\n\ndef pad(array, pad_width, mode, **kwargs):\n return numpy_pad(array, pad_width, mod... | python | chosen |
[
{
"from": "system",
"value": "Increase test coverage of `profiling.sampling`\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import division\nimport sys\n\nimport pytest\n\nfrom profiling.sampling import SamplingProfiler\nfrom profiling.sampling.samplers import Itimer... | python | chosen |
[
{
"from": "system",
"value": "Add test_i_filter_random_words_not_in_lexicon() to assert the stock phrase is returned if all the words are not in the lexicon\n"
},
{
"from": "human",
"value": "import chatbot_brain\n\n\ndef test_initialize_bot():\n bot = chatbot_brain.Chatbot()\n assert len(... | python | chosen |
[
{
"from": "system",
"value": "Test of logger is testing an testPhrase instead of two manually writen strings\n\nSigned-off-by: TeaPackCZ <a78d8486eff6e2cb08b2d9907449b92187b8e215@gmail.com>\n"
},
{
"from": "human",
"value": "import os\nimport unittest\nfrom Logger import Logger\n\nclass TestLogg... | python | chosen |
[
{
"from": "system",
"value": "Remove third dimension from image array\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nimport time\nimport zmq\nimport numpy as np\ntry:\n import progressbar\nexcept ImportError:\n progressbar = None\n\ntry:\n import pylepton \nexce... | python | chosen |
[
{
"from": "system",
"value": "Fix once again nobody being allowed to connect\n"
},
{
"from": "human",
"value": "from txircd.channel import IRCChannel\nfrom txircd.modbase import Module\n\nclass Autojoin(Module):\n\tdef joinOnConnect(self, user):\n\t\tif \"client_join_on_connect\" in self.ircd.se... | python | chosen |
[
{
"from": "system",
"value": "Adjust user filter to author, not related\n"
},
{
"from": "human",
"value": "from rest_framework import viewsets, authentication\nfrom tweets import models\nfrom tweets import serializers\nfrom tweets.permissions import MessagePermission, ProfilePermissions\nfrom dj... | python | chosen |
[
{
"from": "system",
"value": "Update argument lists for abstract methods\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\"\"\"An abstract base class for all Dakota component plugins.\"\"\"\n\nfrom abc import ABCMeta, abstractmethod\n\n\nclass PluginBase(object):\n\n \"\"\"Describe... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Ship all of our examples in the API update tarball.\"\n\nThis reverts commit 4162114707f69bcfb6ecea95d7bdf4c080b4b168.\n\n(imported from commit a4d68bc2a68209bed8e00e6d58dd5f5d3a3187f9)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding:... | python | chosen |
[
{
"from": "system",
"value": "Fix test to work with new selenium release\n\nCurrently testing needs bleeding edge of lettuce_webdriver which can be installed via\npip install -e git+git://github.com/bbangert/lettuce_webdriver.git\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom l... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Revert \"Do not cache discovery\"\"\n\nThis reverts commit e8aca80abcf8c309c13360c386b9505a595e1998.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nimport httplib2\nimport json\nimport time\nimport random\n\nfrom apiclient impor... | python | chosen |
[
{
"from": "system",
"value": "Remove dead code from test\n\nSigned-off-by: Don MacMillen <1f1e67e5fdb25d2e5cd18ddc0fee425272daab56@macmillen.net>\n"
},
{
"from": "human",
"value": "from openroad import Design, Tech\nimport helpers\nimport gpl_aux\n\ntech = Tech()\ntech.readLiberty(\"./library/na... | python | chosen |
[
{
"from": "system",
"value": "Remove documenting argument from Signal\n"
},
{
"from": "human",
"value": "from django.dispatch import Signal\n\n#: Signal fired when a new issue is posted via the API.\nissue_posted = Signal(providing_args=('request', 'issue'))\n"
},
{
"from": "gpt",
"v... | python | chosen |
[
{
"from": "system",
"value": "Upgrade libchromiumcontent to fix linking error\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport platform\nimport sys\n\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONTENT_COMMIT = '44c71d88d9c098ece5d... | python | chosen |
[
{
"from": "system",
"value": "Fix encoding of source image to work on Python3\n"
},
{
"from": "human",
"value": "import base64\nimport json\nimport os\nimport random\nfrom dallinger.nodes import Source\n\n\nclass DrawingSource(Source):\n \"\"\"A Source that reads in a random image from a file... | python | chosen |
[
{
"from": "system",
"value": "Allow docs to test to be found elsewhere.\n(they're not unpacked by installing the sdist)"
},
{
"from": "human",
"value": "# Copyright (c) 2009-2012 Simplistix Ltd\n#\n# See license.txt for more details.\n\nfrom doctest import REPORT_NDIFF,ELLIPSIS\nfrom glob import... | python | chosen |
[
{
"from": "system",
"value": "Fix the one broken test due to OptionType enum.\n"
},
{
"from": "human",
"value": "from av.option import Option\n\nfrom common import *\n\n\nclass TestOptions(TestCase):\n\n def test_mov_options(self):\n\n mov = av.ContainerFormat('mov')\n options =... | python | chosen |
[
{
"from": "system",
"value": "Fix accuracy when topk > num_classes\n"
},
{
"from": "human",
"value": "\"\"\" Eval metrics and related\n\nHacked together by / Copyright 2020 Ross Wightman\n\"\"\"\n\n\nclass AverageMeter:\n \"\"\"Computes and stores the average and current value\"\"\"\n def ... | python | chosen |
[
{
"from": "system",
"value": "Fix syntax error in tests\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url, include\nfrom django.contrib import admin\n\nfrom tests.urls import urlpatterns\n\n\nadmin.autodiscover()\nurlpatterns += patterns('',\n url(r'^admin/', inclu... | python | chosen |
[
{
"from": "system",
"value": "Enable submission of new songs via form.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nfrom flask import Flask, render_template\n\napp = Flask(__name__)\n\n@app.route('/')\ndef root():\n\tgenres = ('Hip Hop', 'Electronic', 'R&B')\n\tsongs = [\... | python | chosen |
[
{
"from": "system",
"value": "Add link to queue graphs for `CeleryAliveCheck` result.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom time import time\n\nfrom sentry import options\n\nfrom .base import StatusCheck, Problem\n\n\nclass CeleryAliveCheck(StatusCheck... | python | chosen |
[
{
"from": "system",
"value": "Add ports and fix bug\n"
},
{
"from": "human",
"value": "chatbot_ubuntu = {\n 'path': '',\n 'model_id': '',\n 'python_env': ''\n}\nchatbot_swisscom = {\n 'path': '',\n 'model_id': '',\n 'python_env': ''\n}\nchatbot_ubuntu_seq2seq = {\n 'socket_a... | python | chosen |
[
{
"from": "system",
"value": "Fix the option name for Tableau server version\n"
},
{
"from": "human",
"value": "from luigi_td.targets.result import ResultTarget\n\nimport urllib\n\nimport logging\nlogger = logging.getLogger('luigi-interface')\n\nclass TableauServerResultTarget(ResultTarget):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use migrations because `kolibri start` was added to tox matrix\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function, unicode_literals\n\nfrom .base import * # noqa\n\nKOLIBRI_SKIP_AUTO_DATABASE_MIGRATION = True\n"
},
{
"... | python | chosen |
[
{
"from": "system",
"value": "Update to reflect new create_app signature\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nfrom getpass import getpass\nimport readline\nimport sys\n\nimport annotator\nfrom annotator.model import Consumer, User\n\nif __name__ == '__main_... | python | chosen |
[
{
"from": "system",
"value": "Use explicit related-lookup syntax in ban search.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom users.models import UserBan\n\n\nclass UserBanAdmin(admin.ModelAdmin):\n fields = ('user', 'by', 'reason', 'is_active')\n list_display... | python | chosen |
[
{
"from": "system",
"value": "Set current strategy on pyramid app\n"
},
{
"from": "human",
"value": "def includeme(config):\n config.add_route('social.auth', '/login/{backend}')\n config.add_route('social.complete', '/complete/{backend}')\n config.add_route('social.disconnect', '/discon... | python | chosen |
[
{
"from": "system",
"value": "Save archive ids to dynamodb\n"
},
{
"from": "human",
"value": "import boto\n\nclass CommandUploadFileToVault(object):\n\n def execute(self, args, config):\n glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_... | python | chosen |
[
{
"from": "system",
"value": "Call fuelclient directly passing over the object\n"
},
{
"from": "human",
"value": "from fuelclient.commands import base\nfrom fuelclient.commands import environment as env_commands\nfrom fuelclient.common import data_utils\n\n\nclass EnvClone(env_commands.EnvMixIn,... | python | chosen |
[
{
"from": "system",
"value": "Increase flashing time from 2 to 3 seconds\n"
},
{
"from": "human",
"value": "from PyQt5.QtCore import Qt\n\nFREQ = [\n\t6.666666666666667,\n#\t12.195121951219512,\n\t5.882352941,\n\t10,\n\t7.575757575757576\n]\n# fifth freq \n# 8.620689655172415\n# \n# TODO: Adjust... | python | chosen |
[
{
"from": "system",
"value": "Make the code more compact\n"
},
{
"from": "human",
"value": "\"\"\"\nUtilities for handling the cmap table\nand character mapping in general.\n\"\"\"\n\ndef extractCMAP(ttFont):\n cmap = {}\n cmapIDs = [(3, 10), (0, 3), (3, 1)]\n for i in range(len(cmapIDs... | python | chosen |
[
{
"from": "system",
"value": "Fix double quotes to single quotes\n"
},
{
"from": "human",
"value": "from pydantic import BaseModel\n\n\nclass Person(BaseModel):\n name: str\n age: int\n\n class Config:\n schema_extra = {\n \"examples\": [\n {\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove an extra blank line\n"
},
{
"from": "human",
"value": "import curses\n\nfrom .character import Character\nfrom .console import Console\nfrom .line import Line\nfrom .misc import ESCAPE_CHARS, DELETE_CHARS, BACKSPACE_CHARS, \\\n is_printable_c... | python | chosen |
[
{
"from": "system",
"value": "Remove import for graphite responder\n"
},
{
"from": "human",
"value": "# vim: set fileencoding=utf-8 :\n\nclass Responder(object):\n def support(message):\n pass\n\n def generate(message):\n pass\n \n def on_start(self, consumer):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add test name to plot as title, maximize plot window\n"
},
{
"from": "human",
"value": "import glob\nimport csv\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfor file in glob.glob(\"*.csv\"):\n data = np.genfromtxt(file, delimiter = ',', names = True)\n... | python | chosen |
[
{
"from": "system",
"value": "Comment out failing check. See GH-199.\n"
},
{
"from": "human",
"value": "import attr\nimport pytest\n\nfrom eli5.base_utils import attrs\n\n\ndef test_attrs_with_default():\n\n @attrs\n class WithDefault(object):\n def __init__(self, x, y=1):\n ... | python | chosen |
[
{
"from": "system",
"value": "Rename encode/decode parameterization in test\n"
},
{
"from": "human",
"value": "from collections import deque\n\nfrom hypothesis import given\nfrom hypothesis.strategies import (frozensets, integers, lists, one_of, sets,\n tuples)\... | python | chosen |
[
{
"from": "system",
"value": "Fix exception handling syntax error\n"
},
{
"from": "human",
"value": "\"\"\"\nMain class for doing the work.\n\"\"\"\n\nfrom helper import Helper\nfrom renderer import Renderer\n\n\nclass Generator(object):\n @classmethod\n def generate_statements(cls, class_... | python | chosen |
[
{
"from": "system",
"value": "TEST: Add test for parameter_space ordering.\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for our testing utilities.\n\"\"\"\nfrom itertools import product\nfrom unittest import TestCase\nfrom zipline.utils.test_utils import parameter_space\n\n\nclass TestParame... | python | chosen |
[
{
"from": "system",
"value": "Add character replacements for RT search\n"
},
{
"from": "human",
"value": "import requests\n\nfrom bs4 import BeautifulSoup\nfrom source.models.rt_rating import RTRating\n\n\nclass RottenTomatoesService:\n\n __URL = 'http://www.rottentomatoes.com/m/'\n __SEPE... | python | chosen |
[
{
"from": "system",
"value": "Add mail_certificate which sends email with flask-mail\n\nReplace COMMAND_MAIL. Send certs from /etc/openvpn/client/\nUse template /templates/mail.txt\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport datetime\nfrom subproce... | python | chosen |
[
{
"from": "system",
"value": "[owners] Implement ListOwnersForFile for Depot Tools\n\nAdd DepotToolsClient to implement the OwnersClient API\nfor Depot Tools, and implement the ListOwnersForFile method.\n\nChange-Id: I933a262898439d879c919d695aa62d7702b4c9a4\nReviewed-on: https://chromium-review.googlesourc... | python | chosen |
[
{
"from": "system",
"value": "Fix type casts and incorrect numbers\n\nReplaced int casts to float casts to eliminate need for recasting to float. Was resetting dayHours to 0 when it should have been 0.0 and if hourIn was bigger than hourOut it was adding 24 when it should have been adding 12.\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Add log file for deleted lines.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport sys\n\n_args = sys.argv\n\nif __name__ == \"__main__\":\n if len(_args) == 4:\n keys_file = _args[1]\n target_file = _args[2]\n result_file = ... | python | chosen |
[
{
"from": "system",
"value": "conan: Copy find modules to root of module path\n"
},
{
"from": "human",
"value": "from conans import ConanFile\nfrom conans.tools import download, unzip\nimport os\n\nVERSION = \"0.0.2\"\n\n\nclass IWYUCTargetCmakeConan(ConanFile):\n name = \"iwyu-target-cmake\"... | python | chosen |
[
{
"from": "system",
"value": "Clean up any left over browser processes in the RecreateSKPs buildstep.\n\nBUG=skia:2055\nR=borenet@google.com\n\nReview URL: https://codereview.chromium.org/140003003\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Copyright (c) 2014 The Chromium Author... | python | chosen |
[
{
"from": "system",
"value": "Change a couple of defaults\n"
},
{
"from": "human",
"value": "\nclass GenomeException(Exception):\n pass\n\nclass Genome(object):\n def __init__(self, name):\n defaults = {\n \"name\": name,\n \"use_openings_book\": True,\n ... | python | chosen |
[
{
"from": "system",
"value": "Add seating plan to aircraft\n"
},
{
"from": "human",
"value": "\"\"\"Model for aircraft flights\"\"\"\n\n\nclass Flight:\n def __init__(self, number):\n if not number[:4].isalpha():\n raise ValueError(\"No airline code in '{}'\".format(number))... | python | chosen |
[
{
"from": "system",
"value": "Stop looping to do nothing, just pass.\n"
},
{
"from": "human",
"value": "\"\"\"Check for errs in the AST.\n\nThe Python parser does not catch all syntax errors. Others, like\nassignments with invalid targets, are caught in the code generation\nphase.\n\nThe compil... | python | chosen |
[
{
"from": "system",
"value": "Add support for component initialization that returns lists\n"
},
{
"from": "human",
"value": "from importlib import import_module\nimport json\n\ndef read_component_configuration(path):\n if path.endswith('.json'):\n with open(path) as f:\n con... | python | chosen |
[
{
"from": "system",
"value": "Comment out login system for debugging\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://doc... | python | chosen |
[
{
"from": "system",
"value": "Send whole location object over websocket\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2016 Steven Oud. All rights reserved.\n# Use of this source code is governed by a MIT-style license that can be found\n# in the LICENSE file.\n\nfrom fl... | python | chosen |
[
{
"from": "system",
"value": "Print the banner in IPython\n"
},
{
"from": "human",
"value": "\nimport code\nimport collections\nimport logging\nimport sys\n\ntry:\n import matplotlib.pyplot as plt\nexcept ImportError:\n plt = None\n\nimport numpy\n\nimport rasterio\n\n\nlogger = logging.ge... | python | chosen |
[
{
"from": "system",
"value": "Add a line that was removed by mistake\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\"\"\"\nMain entry point to run all tests\n\"\"\"\nimport sys\nfrom pathlib import Path\nfrom unittest import TestLoader, TestSuite, TextTestRunner\n\nPATH = Path(__fil... | python | chosen |
[
{
"from": "system",
"value": "Use .state instead of .is_online to keep internal state\n"
},
{
"from": "human",
"value": "import glib\nimport dbus\nfrom dbus.mainloop.glib import DBusGMainLoop\nfrom pyee import EventEmitter\nimport logbook\nlogger = logbook.Logger('connman-dispatcher')\n\n__all__... | python | chosen |
[
{
"from": "system",
"value": "Correct endpoint for result and score\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nclass URLResources(object):\n PROJECT = \"/project/\"\n FIELD = \"/field/\"\n INDEX = \"/index/\"\n QUERY_COUNT_ENTITY = \"/query... | python | chosen |
[
{
"from": "system",
"value": "Change id field unicode string to ascii string\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.conf import settings\nfrom phonenumber_field.modelfields import PhoneNumberField\n\nfrom whats_fresh.models import *\nfrom django.contrib.... | python | chosen |
[
{
"from": "system",
"value": "Add test_setData() for PlotDataItem class\n"
},
{
"from": "human",
"value": "import numpy as np\nimport pyqtgraph as pg\n\npg.mkQApp()\n\n\ndef test_fft():\n f = 20.\n x = np.linspace(0, 1, 1000)\n y = np.sin(2 * np.pi * f * x)\n pd = pg.PlotDataItem(x, ... | python | chosen |
[
{
"from": "system",
"value": "Set Town Hall pop time to 2 minutes instead of 5.\n"
},
{
"from": "human",
"value": "\"\"\"Game buildings.\"\"\"\r\n\r\nfrom attr import attrs, attrib, Factory\r\nfrom objects import ObjectWithHP, TYPE_BUILDING\r\nfrom mobiles import mobile_types\r\n\r\n\r\n@attrs\r... | python | chosen |
[
{
"from": "system",
"value": "Use list comprehensions to format all errors where message is not a dict\n"
},
{
"from": "human",
"value": "\nfrom rest_framework import status\nfrom rest_framework.exceptions import APIException, ParseError\n\n\ndef json_api_exception_handler(exc, context):\n \"... | python | chosen |
[
{
"from": "system",
"value": "Update reviews model for new added field in 5.5\n"
},
{
"from": "human",
"value": "import itertools\n\nfrom django.db import models\n\nimport amo\nfrom translations.fields import TranslatedField\nfrom translations.models import Translation\n\n\nclass Review(amo.Mode... | python | chosen |
[
{
"from": "system",
"value": "Test requests don't have a charset attribute\n"
},
{
"from": "human",
"value": "import json\nimport functools\n\nfrom django.conf import settings\nfrom django.test import Client, TestCase\n\n__all__ = ['JsonTestClient', 'JsonTestMixin', 'JsonTestCase']\n\n\nclass Js... | python | chosen |
[
{
"from": "system",
"value": "Stop directly importing non-module symbol\n"
},
{
"from": "human",
"value": "from chainer.functions.activation.elu import elu\n\n\ndef selu(x,\n alpha=1.6732632423543772848170429916717,\n scale=1.0507009873554804934193349852946):\n \"\"\"Scaled Ex... | python | chosen |
[
{
"from": "system",
"value": "Change settings to use API key and CKAN URL"
},
{
"from": "human",
"value": "# path to ckan config file\nCKAN_CONFIG = '/home/okfn/pyenv/src/ckan/ckan.ini'\n\n# directory to save downloaded files to\nARCHIVE_DIR = '/tmp/archive'\n\n# Use this user name when requesti... | python | chosen |
[
{
"from": "system",
"value": "Put news on non-root path for clarity\n"
},
{
"from": "human",
"value": "from django.urls import path\n\nfrom . import views\n\napp_name='ddcz'\n\nurlpatterns = [\n path('', views.index, name='news'),\n path('rubriky/<creative_page_slug>/', views.common_articl... | python | chosen |
[
{
"from": "system",
"value": "Allow Filepicker JS version to be configured\n\nFilepicker JS version can now be configured\r\nusing FILEPICKER_JS_VERSION. Version 0 is\r\ndefault.\r\n\r\nChanged the logic of INPUT_TYPE to use\r\ngetattr instead of hasattr and an if\r\nstatement."
},
{
"from": "human"... | python | chosen |
[
{
"from": "system",
"value": "Add a function returning js bytecode."
},
{
"from": "human",
"value": "import pyjsparser\nfrom space import Space\nimport fill_space\nfrom byte_trans import ByteCodeGenerator\nfrom code import Code\nfrom simplex import MakeError\nimport sys\nsys.setrecursionlimit(10... | python | chosen |
[
{
"from": "system",
"value": "Return formatted messages in APIError\n"
},
{
"from": "human",
"value": "class APIError(Exception):\n pass\n\n\nclass ImproperlyConfigured(Exception):\n pass\n\n\nclass ValidationError(Exception):\n pass\n"
},
{
"from": "gpt",
"value": "class AP... | python | chosen |
[
{
"from": "system",
"value": "Add author to latex_documents to fix sphinx build\n"
},
{
"from": "human",
"value": "import sys\n\nfrom os.path import dirname, abspath\n\nsys.path.insert(0, dirname(dirname(abspath(__file__))))\n\nfrom django.conf import settings\n\nsettings.configure()\n\nproject ... | python | chosen |
[
{
"from": "system",
"value": "TEST Add 'ps' variable to idealized run\n"
},
{
"from": "human",
"value": "from aospy.run import Run\n\n\ntest_am2 = Run(\n name='test_am2',\n description=(\n 'Preindustrial control simulation.'\n ),\n data_in_direc=('/archive/Yi.Ming/sm2.1_fixed/... | python | chosen |
[
{
"from": "system",
"value": "Add missing function doc string.\n"
},
{
"from": "human",
"value": "# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version ... | python | chosen |
[
{
"from": "system",
"value": "Tidy up list of tests to write.\n"
},
{
"from": "human",
"value": "\"\"\"\nlog of integration tests to write:\n\nwrite test_switch_branches_restarts_containers\n\ncommand:\n docker-compose up -d (in a directory with appropriate docker-compose.yml file)\nexpected ... | python | chosen |
[
{
"from": "system",
"value": "Set default values for command and args\n"
},
{
"from": "human",
"value": "import json\nfrom collections import OrderedDict\nfrom .command import ShellCommand\nfrom .settings import FormatterSettings\n\n\nclass Formatter():\n def __init__(self, name, command=None... | python | chosen |
[
{
"from": "system",
"value": "Add an include_paths property to the SourceFile class.\n"
},
{
"from": "human",
"value": "from os import listdir\nfrom os.path import abspath, isfile, join, splitext\n\n# C, C++, Obj-C, & Obj-C++\nSOURCE_EXTENSIONS = ('.h', '.hh', '.hpp', '.c', '.cpp', '.cxx', '.m',... | python | chosen |
[
{
"from": "system",
"value": "Check for duplicates in existing dataset. Fix reference to dump file.\n"
},
{
"from": "human",
"value": "import json\nfrom backend.app import app, db\nfrom backend.models import *\nfrom flask import url_for\n\n# read in json redirect dump\nwith open('data/prod_url_a... | python | chosen |
[
{
"from": "system",
"value": "Fix pickling/unpickling of Resource objects\n\nAdd __getstate__ and __setstate__ methods to the Resource class to avoid hitting the recursion limit when trying to pickle/unpickle Resource objects.\n\nA similar issue/solution can be found here: https://stackoverflow.com/a/121026... | python | chosen |
[
{
"from": "system",
"value": "Add another constant for the number of vanilla dates.\n"
},
{
"from": "human",
"value": "from datetime import date as vanilla_date\nfrom dates.base import BasicBCEDate\n\nfirst_julian_date = BasicBCEDate(-45, 1, 1)\n\nfirst_vanilla_date = vanilla_date(1, 1, 1)\nlast... | python | chosen |
[
{
"from": "system",
"value": "Fix testing for wrong platform name"
},
{
"from": "human",
"value": "import os\nimport platform\n\nif platform.system() == 'Darwin':\n if os.environ.get('LINUX_WITHOUT_DBUS', '0') == '0':\n from .gatt_linux import *\n else:\n from .gatt_stubs imp... | python | chosen |
[
{
"from": "system",
"value": "Fix y axis tick labels for boxplot\n"
},
{
"from": "human",
"value": "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matp... | python | chosen |
[
{
"from": "system",
"value": "Create a ImmediateWorker that executes the posted jobs on the same thread synchronously\n"
},
{
"from": "human",
"value": "import queue\n\nfrom bot.multithreading.work import Work\n\n\nclass Worker:\n def run(self):\n raise NotImplementedError()\n\n def... | python | chosen |
[
{
"from": "system",
"value": "Add URL for monitoring hook"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom django.views.generic.base import RedirectView\n\nfrom gitlab import views\n\nurlpatterns = patterns('',\n url(r'^favicon\\.ico$', RedirectView.as_view(ur... | python | chosen |
[
{
"from": "system",
"value": "Add functions: mute & open\n"
},
{
"from": "human",
"value": "from wit import Wit\nfrom . import text_to_speech as tts\nfrom . import config\n\n\nWIT_AI_KEY = config.WIT_AI_KEY\nsession_id = config.USER\n\n\ndef say(session_id, context, msg):\n tts.talk(msg)\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Add more information to SnowballStemmer\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom nltk.stem.snowball import HungarianStemmer\nfrom nltk import word_tokenize\n\nstemmer = HungarianSt... | python | chosen |
[
{
"from": "system",
"value": "Switch to StringIO for fake config data\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Filename: test_config.py\n\"\"\"\nTest suite for configuration related functions and classes.\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\n... | python | chosen |
[
{
"from": "system",
"value": "Correct spelling in a comment\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Test for Conditional Xmodule functional logic.\"\"\"\n\nfrom xmodule.conditional_module import ConditionalDescriptor\nfrom . import LogicTest\n\n\nclass ConditionalModule... | python | chosen |
[
{
"from": "system",
"value": "Put / after dir path\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\nimport json\nfrom pathlib import Path\n\nimport ptt_core\nl = ptt_core.l\n\n\n_TARGETS_DIR_PATH = Path('targets')\n\nif not _TARGETS_DIR_PATH.exists():\n _TARGETS_DIR_PATH.mkdir()\... | python | chosen |
[
{
"from": "system",
"value": "Implement a nicer way of execution modules\n"
},
{
"from": "human",
"value": "from mythril.analysis.report import Report\nfrom .modules import delegatecall_forward, unchecked_suicide, ether_send, unchecked_retval, delegatecall_to_dynamic, integer_underflow, call_to_... | python | chosen |
[
{
"from": "system",
"value": "Add object for saving modish test results\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom .model import ModalityModel\nfrom .estimator import ModalityEstimator\nfrom .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\\\n MODAL... | python | chosen |
[
{
"from": "system",
"value": "Update job state when we finish the task\n"
},
{
"from": "human",
"value": "import os\nimport time\n\nimport requests\n\nfrom krunchr.vendors.celery import celery\n\n\n@celery.task\ndef get_file(url, path):\n name, ext = os.path.splitext(url)\n name = str(int(time... | python | chosen |
[
{
"from": "system",
"value": "Add SkipTest for when matplotlib and/or pyplot are not present\n"
},
{
"from": "human",
"value": "\"\"\"\nHelper functions for determining which tests to skip.\n\"\"\"\n\n__authors__ = \"Ian Goodfellow\"\n__copyright__ = \"Copyright 2010-2012, Universite de Montreal... | python | chosen |
[
{
"from": "system",
"value": "Update cmake for MSVC builds."
},
{
"from": "human",
"value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at https://mozilla.org/MPL/2.0/.\n... | python | chosen |
[
{
"from": "system",
"value": "Replace import * with explicit names\n"
},
{
"from": "human",
"value": "\n\"\"\"Module containing only html v5 tags. All deprecated tags have been removed.\n\"\"\"\n\nfrom .common import *\n\ndel ACRONYM\ndel APPLET\ndel BASEFONT\ndel BIG\ndel CENTER\ndel DIR\ndel F... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.