conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add import for constants_from_enum to be able to use @gin.constants_from_enum\n\nPiperOrigin-RevId: 198401971\n" }, { "from": "human", "value": "# coding=utf-8\n# Copyright 2018 The Gin-Config Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Lice...
python
chosen
[ { "from": "system", "value": "Remove commented line we definitely will never need\n" }, { "from": "human", "value": "import sys\nimport json\nimport requests\nfrom string import Template\n\nimport dateutil.parser\n\ndef posts_at_url(url):\n \n current_page = 1\n max_page = sys.maxint\n\...
python
chosen
[ { "from": "system", "value": "Make gunicorn log to stdout\n" }, { "from": "human", "value": "import os\nimport multiprocessing\n\nproc_name = 'gunicorn: {}'.format(os.environ['WEB_HOSTNAME'])\nuser = 'www-data'\ngroup = 'www-data'\nbind = '0.0.0.0:80'\nworkers = multiprocessing.c...
python
chosen
[ { "from": "system", "value": "Add an option to disable code reloader to runserver command\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nfrom argh import arg, ArghParser\nfrom argh.exceptions import CommandError\nfrom functools import wraps\n\n\nCONFIG = os.environ.get('A...
python
chosen
[ { "from": "system", "value": "Remove old-style assignment of raised exception\n\nI've removed the old-style assignment of the ``Exception`` because\nit is no longer supported in Python 3.x. Since it is not used, I've\nremoved it completely.\n" }, { "from": "human", "value": "try:\n VERSION = ...
python
chosen
[ { "from": "system", "value": "Make tab widgets look good on ElementaryOS.\n\nAny other linux distribution will probably look bad because of this. In\nthe future a better solution must be found to styling the background of\na widget inside a scrollarea inside a tabwidget.\n" }, { "from": "human", ...
python
chosen
[ { "from": "system", "value": "Add attack function to KING class\n" }, { "from": "human", "value": "class ChessPiece(object):\n\n def __init__(self):\n self.column = 0\n self.row = 0\n self.symbol = ''\n\n # Checks piece can attack the specified position\n def can_at...
python
chosen
[ { "from": "system", "value": "Convert paths to objectnames before trying to use them\n" }, { "from": "human", "value": "from sockets.stream_socket import StreamSocket\nfrom transfer.request import Request\nfrom transfer.notification import Notification\nimport settings\n\nimport groundstation.lo...
python
chosen
[ { "from": "system", "value": "Change AppConf class to use settings defined value or default.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport warnings\n\nfrom django.conf import settings # pylint: disable=W0611\n\nfrom appconf import AppConf\n\n\nclass WatermarkSettings(AppC...
python
chosen
[ { "from": "system", "value": "Implement metadata loading and version retrieval\n" }, { "from": "human", "value": "import os\nimport sys\nimport glob\n\n\nclass Distribution:\n def __init__(self, path):\n \"\"\"\n Construct a distribution from a path to the metadata dir\n ...
python
chosen
[ { "from": "system", "value": "Set tru to config from pyfile\n" }, { "from": "human", "value": "import os\nfrom flask import Flask\nfrom flask_sslify import SSLify\n\n\napp = Flask(__name__, instance_path='/instance')\nif 'DYNO' in os.environ:\n sslify = SSLify(app)\n\napp.config.from_object('...
python
chosen
[ { "from": "system", "value": "TST: Fix pims warning test under Py3\n" }, { "from": "human", "value": "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\nimport six\nimport os\nimport unittest\nimport warnings\n\nimport pims\nimport trac...
python
chosen
[ { "from": "system", "value": "Fix checking apikey outside runserver\n" }, { "from": "human", "value": "from django.contrib.auth.models import AnonymousUser\nfrom rest_framework import authentication\nfrom rest_framework import exceptions\nfrom events.models import DataSource\nfrom django.utils.t...
python
chosen
[ { "from": "system", "value": "Fix typo in GPU worker config setup\n" }, { "from": "human", "value": "\"\"\"\nGrab worker configuration from GCloud instance attributes.\n\"\"\"\nimport json\nimport requests\n\n\nMANAGER_URL_METADATA_URL = \"http://metadata.google.internal/computeMetadata/v1/insta...
python
chosen
[ { "from": "system", "value": "Use pandas dataframes for UCI C4 dataset\n" }, { "from": "human", "value": "from __future__ import division, print_function\nfrom collections import Counter\nfrom capstone.util.c4uci import load_instance\n\nFILENAME = 'datasets/connect-4.data'\n\noutcomes = []\n\nwi...
python
chosen
[ { "from": "system", "value": "Include default values in generated .manager files\n\n\n20070911135919-4210b-773464bb139c29ab8da7ee85334bf2907e5d6e3c.gz\n" }, { "from": "human", "value": "#!/usr/bin/python\nimport sys\nimport telepathy\nfrom telepathy.interfaces import CONN_MGR_INTERFACE\nfrom tel...
python
chosen
[ { "from": "system", "value": "Implement of Cantor Paring Function\n" }, { "from": "human", "value": "#!-*- coding:utf-8 -*-\n\"\"\"\nFloyd's cycle-finding algorithm\nhttp://en.wikipedia.org/wiki/Cycle_detection\nhttp://www.siafoo.net/algorithm/10\n\"\"\"\n\ndef floyd(top):\n \"\"\"\n >>> f...
python
chosen
[ { "from": "system", "value": "Add tests to check links.\n" }, { "from": "human", "value": "import requests\n\ndef check_links(args_obj, parser):\n print(\"\")\n print(\"Checking links\")\n print(\"########################\")\n print(\"Not implemented yet.\")\n print(\"This is supp...
python
chosen
[ { "from": "system", "value": "Fix regexes so that so doesn't match s\n" }, { "from": "human", "value": "#!/usr/bin/env python3\nimport logging\nimport json\nfrom gather.gatherbot import GatherBot\nfrom gather import commands\n\n\ndef main():\n logging.basicConfig(\n level=logging.INFO,...
python
chosen
[ { "from": "system", "value": "Allow the BeetleError class to take a page object as an argument\n" }, { "from": "human", "value": "name = 'beetle'\nversion = '0.4.1-dev'\nproject_url = 'https://github.com/cknv/beetle'\n\nclass BeetleError(Exception):\n pass\n" }, { "from": "gpt", "...
python
chosen
[ { "from": "system", "value": "Add HttpServer.close_socket() to the server's socket\n" }, { "from": "human", "value": "import socket\n\n\nclass HttpServer(object):\n \"\"\"docstring for HttpServer\"\"\"\n def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):\n self._ip = ip\n ...
python
chosen
[ { "from": "system", "value": "Add moving of marble on x axis - currently brokwn\n" }, { "from": "human", "value": "# based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/\n\nfrom sense_hat import SenseHat\nimport time\n\nsense = SenseHat()\nsense.clear()\n\ntime.sleep(0....
python
chosen
[ { "from": "system", "value": "Fix CJK input in command line arguments\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nimport sys\nimport argparse\n\nfrom macdict.dictionary import lookup_word\n\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser....
python
chosen
[ { "from": "system", "value": "Fix code so import works under Python 3.\n" }, { "from": "human", "value": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding ...
python
chosen
[ { "from": "system", "value": "[add] Add a description to an event\n" }, { "from": "human", "value": "from django.db import models\nfrom django.conf import settings\n\n# Create your models here.\n#Events :\n# Des users peuvent participer à un event\n# Les gens peuvnet être \"intéressés\"\n#...
python
chosen
[ { "from": "system", "value": "Update function name to correct spelling\n\nSigned-off-by: Tran Ly Vu <0555cc0f3d5a46ac8c0e84ddf31443494c66bd55@gmail.com>\n" }, { "from": "human", "value": "from .similarity_measure import (\n\tcosine,\n\teuclidean_distance,\n\tpearson_correlation\t\n)\n\nfrom .sim...
python
chosen
[ { "from": "system", "value": "Fix KeyError when no results in time period\n\nFix a KeyError when no results were found for the specified time period.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom pymisp import PyMISP\nfrom keys import misp_url, misp_ke...
python
chosen
[ { "from": "system", "value": "Add description for Userprofile model\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom .models import UserProfile\n\n\nadmin.site.register(UserProfile)\n" }, { "from": "gpt", "value": "from django.contrib import admin\n\nfrom ....
python
chosen
[ { "from": "system", "value": ":green_heart: Add test for StudyProgram deletion\n" }, { "from": "human", "value": "from django.contrib.auth.models import User\nfrom django.test import TestCase\nfrom datetime import datetime\n\nfrom members.models import Member\n\n\nclass MemberTest(TestCase):\n ...
python
chosen
[ { "from": "system", "value": "Add new user form data to db\n" }, { "from": "human", "value": "from flask import Flask, render_template, request\nfrom models import db\nfrom forms import SignupForm\n\napp = Flask(__name__)\n\napp.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost/strabo'...
python
chosen
[ { "from": "system", "value": "Fix api starting with auth set\n" }, { "from": "human", "value": "import importlib\n\nimport pecan\n\nfrom joulupukki.api.controllers.v3.users import UsersController\nfrom joulupukki.api.controllers.v3.projects import ProjectsController\nfrom joulupukki.api.controll...
python
chosen
[ { "from": "system", "value": "Fix config parsing. Tweeting works\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport tweepy, time, sys, os\nfrom ConfigParser import SafeConfigParser\n\nparser = SafeConfigParser()\nparser.read('secrets.cfg')\n\n#enter the c...
python
chosen
[ { "from": "system", "value": "Remove the \"3\" from SublimeLinter3\n" }, { "from": "human", "value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jon LaBelle\n# Copyright (c) 2018 Jon LaBelle\n#\n# License: MIT\n#\n\n\"\"\"This modul...
python
chosen
[ { "from": "system", "value": "Call method 'get_serializer_class' of the Class parent\n" }, { "from": "human", "value": "class DepthSerializerMixin(object):\n\t\"\"\"Custom method 'get_serializer_class', set attribute 'depth' based on query parameter in the url\"\"\"\n\t\n\tdef get_serializer_cla...
python
chosen
[ { "from": "system", "value": "Fix `socketserver` for Python 3\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n'''Test using a proxy.'''\n\n# External imports\nimport multiprocessing\nimport SocketServer\nimport SimpleHTTPServer\nimport pytest\nrequests = pytest.importorskip(\"request...
python
chosen
[ { "from": "system", "value": "Set log level to 2 when migrating so there is some indication it is running\n" }, { "from": "human", "value": "#!/usr/bin/python\n\n# Copyright (c) 2006 rPath, Inc\n# All rights reserved\n\nimport sys\nimport os\nimport pwd\nfrom conary.server import schema\nfrom co...
python
chosen
[ { "from": "system", "value": "Drop useless tests that invoking doctests\n" }, { "from": "human", "value": "import doctest\nimport os\n\n\ndef test_doctest_types():\n from sider import types\n assert 0 == doctest.testmod(types)[0]\n\n\ndef test_doctest_datetime():\n from sider import dat...
python
chosen
[ { "from": "system", "value": "Change directory to test uninitialized project\n" }, { "from": "human", "value": "from tests.test_actions import *\nfrom ltk import actions, exceptions\nimport unittest\n\nclass TestInitAction(unittest.TestCase):\n\n def test_uninitialized(self):\n # todo ...
python
chosen
[ { "from": "system", "value": "Test default case for constraint.solve()\n" }, { "from": "human", "value": "import pytest\n\nfrom gaphas.solver import Constraint, MultiConstraint, Variable\n\n\n@pytest.fixture\ndef handler():\n events = []\n\n def handler(e):\n events.append(e)\n\n ...
python
chosen
[ { "from": "system", "value": "Fix Python 2 compatibility, again\n" }, { "from": "human", "value": "\"Common functions that may be used everywhere\"\n\nfrom __future__ import print_function\n\nimport os\nimport sys\nfrom distutils.util import strtobool\n\n\ndef yes_no_query(question):\n \"\"\"...
python
chosen
[ { "from": "system", "value": "Fix LocalizedFieldsAdminMixin not having a base class\n\nThis was a breaking change and broke a lot of projects.\n" }, { "from": "human", "value": "from . import widgets\nfrom .fields import LocalizedField, LocalizedCharField, LocalizedTextField, \\\n LocalizedFi...
python
chosen
[ { "from": "system", "value": "Add utility method to lazy format lazy string\n\nThis method is useful to format strings that are lazy (such as those in\nForms).\n" }, { "from": "human", "value": "#\n# This file is part of Plinth.\n#\n# This program is free software: you can redistribute it and/or...
python
chosen
[ { "from": "system", "value": "Rename bot and prevent channel spamming\n" }, { "from": "human", "value": "import os\nimport requests\nfrom django.core.mail import send_mail\nfrom clowder_account.models import ClowderUser\n\n\nADMIN_EMAIL = 'admin@clowder.io'\n\ndef send_alert(company, name):\n ...
python
chosen
[ { "from": "system", "value": "Update Charlie's stupid wrong documentation.\n\nI can't promise it's right now, though, cuz I didn't test it either.\n🎉🎉🎉\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"This file should be used to run the flask app with something like Gunicor...
python
chosen
[ { "from": "system", "value": "Add some more arguments for chrome driver\n" }, { "from": "human", "value": "# Lazy objects, for the serializer to find them we put them here\n\nclass LazyDriver(object):\n _driver = None\n\n @classmethod\n def get(cls):\n if cls._driver is None:\n ...
python
chosen
[ { "from": "system", "value": "Make encoding and decoding strict\n\n* programmers must know what kind of data they use\n* don't guess encodings anymore\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom httoop.util import Unicode\n\n\nclass Codec(object):\n\t@classmethod\n\tdef de...
python
chosen
[ { "from": "system", "value": "Add a --filter flag to histograms\n\nThis ignores any lines in the input that don't contain \"INSTATRACE: \"\nand removes anything preceding that string before handling the sample.\n" }, { "from": "human", "value": "# Copyright (C) 2010 Peter Teichman\n\nimport logg...
python
chosen
[ { "from": "system", "value": "Make it more executable than it was\n" }, { "from": "human", "value": "from vulyk.control import cli\n\nif __name__ == '__main__':\n cli()\n" }, { "from": "gpt", "value": "#!/usr/bin/env python\n# -*- coding=utf-8 -*-\n\nfrom vulyk.control import cli\...
python
chosen
[ { "from": "system", "value": "Add missing Auth hook to image builder\n\nChange-Id: I73f17c17a1f4d530c0351dacc2b10fbdcf3122e0\n" }, { "from": "human", "value": "# Copyright 2014 - Rackspace Hosting\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this fil...
python
chosen
[ { "from": "system", "value": "Add contrib.admin to locally installed apps\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nManagement command entry point for working with migrations\n\"\"\"\n\nimport sys\nimport django\nfrom django.conf import settings...
python
chosen
[ { "from": "system", "value": "Change logging setup for Process()\n\nAlso fix usage of badly named .proc variable.\n" }, { "from": "human", "value": "import subprocess as sub\n\nimport logbook\n\n\nclass Process(object):\n \"\"\"\n Helper class for running processes\n\n \"\"\"\n\n def...
python
chosen
[ { "from": "system", "value": "Allow altering the donation amount via a link and default to £3\n" }, { "from": "human", "value": "from django.http import HttpResponseRedirect\n\nfrom .forms import DonationForm\nfrom .helpers import GoCardlessHelper\n\n\nclass DonationFormMiddleware(object):\n ...
python
chosen
[ { "from": "system", "value": "Work around a `httpretty` bug when returning None as the body\n\nI'm not sure if this is a bug or not. The docs state this must be\na string. So this is as empty as we can get.\n" }, { "from": "human", "value": "import httpretty\nimport pytest\nimport webtest\n\nfro...
python
chosen
[ { "from": "system", "value": "Move to new jvm specification.\n\nSigned-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com>\n" }, { "from": "human", "value": "class JVM(object):\n \"\"\"\n Base class for JVMs.\n\n Inheriting classes must implement:\n - ...
python
chosen
[ { "from": "system", "value": "Undo logging and splitting up QVector3D. CURA-3334\n" }, { "from": "human", "value": "# Copyright (c) 2015 Ultimaker B.V.\n# Cura is released under the terms of the AGPLv3 or higher.\n\n\nfrom PyQt5.QtCore import QVariantAnimation, QEasingCurve\nfrom PyQt5.QtGui imp...
python
chosen
[ { "from": "system", "value": "Make Test description more elegant.\n" }, { "from": "human", "value": "\nimport os\n\ndef test():\n \"\"\"Test to find this error below.\n\n Traceback (most recent call last):\n File \"../scripts/find_enrichment.py\", line 130, in <module>\n ...
python
chosen
[ { "from": "system", "value": "Add field for pre-tokenized texts\n" }, { "from": "human", "value": "from typing import Union, List\n\n\nclass InputExample:\n \"\"\"\n Structure for one input example with texts, the label and a unique id\n \"\"\"\n def __init__(self, guid: str = '', te...
python
chosen
[ { "from": "system", "value": "Revert \"Remove IF EXISTS from DROP TABLE when resetting the db.\"\n\nThis reverts commit a7dce25964cd740b0d0db86b255ede60c913e73d.\n" }, { "from": "human", "value": "import sqlite3\n\nDB_FILENAME = 'citationhunt.sqlite3'\n\ndef init_db():\n return sqlite3.connec...
python
chosen
[ { "from": "system", "value": "Use .returns_rows to determine if we should return list type\n" }, { "from": "human", "value": "import functools\nfrom sqlalchemy import create_engine\n\n\n@functools.lru_cache()\ndef engine():\n return create_engine('postgresql://foxgami:foxgami@localhost/foxgam...
python
chosen
[ { "from": "system", "value": "Update test now 'is' is a common word\n" }, { "from": "human", "value": "\nfrom jargonprofiler.util import tag_proper_nouns\nfrom jargonprofiler.munroe import munroe_score\n\n\ndef test_proper_noun_in_sentance():\n assert tag_proper_nouns(\"My name is Eilis.\") =...
python
chosen
[ { "from": "system", "value": "chore(reddit): Use Reddit name as username\n\nUsing Reddit's screen name as username instead of first name will allow the sign to skip one more field." }, { "from": "human", "value": "from allauth.socialaccount.providers.base import ProviderAccount\nfrom allauth.soc...
python
chosen
[ { "from": "system", "value": "Add test case for read_arrange_mode()\n" }, { "from": "human", "value": "from arrange_schedule import *\n\n\ndef test_read_system_setting():\n keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']\n system_setting = read_system_setting()\n for k...
python
chosen
[ { "from": "system", "value": "Add untested support for the darwin platform\n\ngit-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@762 b426a367-1105-0410-b9ff-cdf4ab011145\n" }, { "from": "human", "value": "\"\"\"\nExports the libgeos_c shared lib, GEOS-specific exceptions, and utilities.\n\"\"\...
python
chosen
[ { "from": "system", "value": "Change publish site to softwarejourneyman.com\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\nsys.path.append(os.curdir)\nfrom pelicanconf import *\n\nSITEURL = 'h...
python
chosen
[ { "from": "system", "value": "Remove debug flag from app\n" }, { "from": "human", "value": "from flask import Flask\napp = Flask(__name__)\n\n@app.route(\"/\")\ndef hello():\n return \"Hello World!\"\n\nif __name__ == \"__main__\":\n app.run(debug=True)\n" }, { "from": "gpt", "...
python
chosen
[ { "from": "system", "value": "Clean up response to no queries.\n" }, { "from": "human", "value": "\"\"\"\nThis prints the state of a facet query.\nIt is used for debugging the faceting system.\n\"\"\"\n\nfrom django.core.management.base import BaseCommand\nfrom haystack.query import SearchQueryS...
python
chosen
[ { "from": "system", "value": "Fix the path to external tools\n" }, { "from": "human", "value": "from settings_common import *\n\nPACKAGE_VERSION = \"0.5\"\n\nDEBUG = TEMPLATE_DEBUG = True\n\nDAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline')\nEXTERNAL_PATH = os.path.j...
python
chosen
[ { "from": "system", "value": "Use Python file objects directly as input\n\n- fix wrong separator between path and filename\n\nSigned-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>\n" }, { "from": "human", "value": "import os\n\ndef compile_class_from_file(path, fil...
python
chosen
[ { "from": "system", "value": "Simplify the way modes are loaded into a lattice\n" }, { "from": "human", "value": "import os\nimport csv\nfrom pml import lattice, element, device\n\n\ndef load(directory, name, control_system):\n lat = lattice.Lattice(name, control_system)\n with open(os.pat...
python
chosen
[ { "from": "system", "value": "Add AWS::CodeGuruProfiler::ProfilingGroup.ComputePlatform per 2020-07-09 update\n" }, { "from": "human", "value": "# Copyright (c) 2020, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject\n\n\nclass ...
python
chosen
[ { "from": "system", "value": "Add session in tests Mock HttpRequest\n" }, { "from": "human", "value": "from django.test import TestCase\nfrom django.contrib.auth.models import User\nfrom django.test.client import RequestFactory\n\nclass BaseTest(TestCase):\n\n def setUp(self):\n self.f...
python
chosen
[ { "from": "system", "value": "Add url property to DjangoWebtestResponse so assertRedirects works in 1.6.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.test import Client\nfrom django.http import SimpleCookie\nfrom webtest import TestResponse\nfrom django_webtest.compat ...
python
chosen
[ { "from": "system", "value": "Fix from number on Load testing client\n" }, { "from": "human", "value": "import logging\n\nfrom flask import current_app\n\nfrom app.clients.sms.firetext import (\n FiretextClient\n)\n\nlogger = logging.getLogger(__name__)\n\n\nclass LoadtestingClient(FiretextCl...
python
chosen
[ { "from": "system", "value": "Change web admin page title\n" }, { "from": "human", "value": "\"\"\"web URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n 1...
python
chosen
[ { "from": "system", "value": "Refactor error as a property.\n" }, { "from": "human", "value": "from mock import MagicMock\nimport pbclient\nclass TestDefault(object):\n\n \"\"\"Test class for pbs.helpers.\"\"\"\n\n error = {\"action\": \"GET\",\n \"exception_cls\": \"NotFound\"...
python
chosen
[ { "from": "system", "value": "Remove no longer needed import check\n" }, { "from": "human", "value": "\"\"\"Basic set of tests to ensure entire code base is importable\"\"\"\nimport pytest\n\n\ndef test_importable():\n \"\"\"Simple smoketest to ensure all isort modules are importable\"\"\"\n ...
python
chosen
[ { "from": "system", "value": "Add menu to start new game and quit\n" }, { "from": "human", "value": "from connect_four import ConnectFour\n\ndef main():\n \"\"\" Play a game!\n \"\"\"\n connect_four = ConnectFour()\n # start the game\n connect_four.start()\n\nif __name__ == \"__ma...
python
chosen
[ { "from": "system", "value": "Add import statements for plugin system\n\nSigned-off-by: Reed <f5cabf8735907151a446812c9875d6c0c712d847@plusreed.com>\n" }, { "from": "human", "value": "# Fox, rewritten in Python for literally no reason at all.\n\nimport discord\nimport asyncio\n\nprint(\"Just a m...
python
chosen
[ { "from": "system", "value": "Fix reference to static var" }, { "from": "human", "value": "#! usr/bin/env python3\nfrom docopt import docopt\nfrom matplotlib import pyplot\nimport re\n\n\nclass Schema:\n \"\"\"\n Wraps the SQL source code for a schema and provides methods to get informatio...
python
chosen
[ { "from": "system", "value": "ENN: Make watermark more resilient to err on import.\n" }, { "from": "human", "value": "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\nfrom collections import OrderedDict\nimport importlib\nimport sys\n...
python
chosen
[ { "from": "system", "value": "Fix POSTing from the client\n" }, { "from": "human", "value": "#!/usr/bin/python\n\nimport time\nimport subprocess\nfrom os import path, chdir, getcwd\nimport requests\nfrom watchdog.observers import Observer\nfrom watchdog.events import FileSystemEventHandler\n\ncl...
python
chosen
[ { "from": "system", "value": "Change name for campaign index url\n" }, { "from": "human", "value": "from django.conf.urls import include, url\nfrom rpg_base.views import *\n\nurlpatterns = [\n # Examples:\n # url(r'^$', 'django_rpg.views.home', name='home'),\n # url(r'^blog/', include('...
python
chosen
[ { "from": "system", "value": "Add test to check that uris are set\n" }, { "from": "human", "value": "from mopidy.models import Track\n\nclass BaseCurrentPlaylistControllerTest(object):\n uris = []\n backend_class = None\n\n def setUp(self):\n self.backend = self.backend_class()\n...
python
chosen
[ { "from": "system", "value": "Return json object in flask app\n\nInstead of a string, the flask app now returns the json object retrieved\nfrom the knowledge store.\n" }, { "from": "human", "value": "from flask import Flask\nfrom SPARQLWrapper import SPARQLWrapper, JSON\nfrom flask import reques...
python
chosen
[ { "from": "system", "value": ":muscle: Structure of data generator iimproved\n\nStructure of dataset generator improved\n" }, { "from": "human", "value": "import numpy as np\nimport os \nimport sys\nimport time\nfrom unrealcv import client\n\nclass Dataset(object):\n def __init__(self,folder,...
python
chosen
[ { "from": "system", "value": "Set def arguments to immutable to avoid nasty side effect.\n\nFrom: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>\n\ngit-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@110 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8\n" }, { "from": "human", "value": "# Last Change...
python
chosen
[ { "from": "system", "value": "Read .json file from starter\n" }, { "from": "human", "value": "import sys\nfrom cloudtracker import main\n \ndef run_tracker(input_dir):\n print( \" Running the cloud-tracking algorithm... \" )\n print( \" Input dir: \\\"\" + input_dir + \"\\\" \\n\" )\n\n...
python
chosen
[ { "from": "system", "value": "Add introspection rule; prevent South weirdness\n" }, { "from": "human", "value": "from django.db.models import CharField\nfrom django.core.exceptions import ValidationError\n\nfrom cyder.cydhcp.validation import validate_mac\n\n\nclass MacAddrField(CharField):\n ...
python
chosen
[ { "from": "system", "value": "Update the sequence alignment example.\n" }, { "from": "human", "value": "# Create sequences to be aligned.\nfrom alignment.sequence import Sequence\na = Sequence(\"what a beautiful day\".split())\nb = Sequence(\"what a disappointingly bad day\".split())\nprint \"Se...
python
chosen
[ { "from": "system", "value": "Set package version to 0.2.0" }, { "from": "human", "value": "from avalanche import benchmarks\r\nfrom avalanche import evaluation\r\nfrom avalanche import logging\r\nfrom avalanche import models\r\nfrom avalanche import training\r\n\r\n\r\n__version__ = \"0.1.0a0\"...
python
chosen
[ { "from": "system", "value": "Check to make sure artist is not None, or evil will occur...\n" }, { "from": "human", "value": "from . import Exceptions\nfrom . import MBInfo\nfrom . import Tag\nfrom . import Util\nfrom . import format\nfrom . import Discogs\nimport re\n\n\n# unknown artist input ...
python
chosen
[ { "from": "system", "value": "Add a route for displaying posts by categories\n" }, { "from": "human", "value": "from flask import render_template\n\nfrom . import aflafrettir\nfrom ..models import User, Category, Post\n\n@aflafrettir.route('/')\ndef index():\n categories = Category.get_all_acti...
python
chosen
[ { "from": "system", "value": "Move the file to have an extension of .bed.\n\nA lot of tools detect what type of file it is by the extension,\nso this lets us pass on the BedTool.fn as the filename and\nnot break things.\n" }, { "from": "human", "value": "import pybedtools as bt\nimport six\n\nde...
python
chosen
[ { "from": "system", "value": "Fix cached graph verifier tool to handle case where no graph is cached ATM.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport sys\nfrom pprint import pprint as pp\n\nfrom cc.payment import flow\n\ndef verify():\n for ignore_balances in (True, Fal...
python
chosen
[ { "from": "system", "value": "Add a fallback for older Django versions that doesn't come with \"six\"\n" }, { "from": "human", "value": "from django.utils import six\nfrom rq.decorators import job as _rq_job\n\nfrom .queues import get_queue\n\n\ndef job(func_or_queue, connection=None, *args, **k...
python
chosen
[ { "from": "system", "value": "Add space after EC prefix\n\nCo-authored-by: Charles Tapley Hoyt <71cbf5b94f8862eb69e356b36e0cdaee3e60b67f@gmail.com>" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"Processor for the `Chemical Roles Graph (CRoG)\n<https://github.com/chemical-roles...
python
chosen
[ { "from": "system", "value": "Fix the ASAN build by xfailing test_decimal when ASAN_OPTIONS is set.\n\nAdding decimal columns crashes an ASAN built impalad. This change skips the test.\n\nChange-Id: Ic94055a3f0d00f89354177de18bc27d2f4cecec2\nReviewed-on: http://gerrit.ent.cloudera.com:8080/2532\nReviewed-by...
python
chosen
[ { "from": "system", "value": "Make unit tests path aware\n" }, { "from": "human", "value": "\nimport numpy as np\nfrom numpy.testing import assert_array_equal\n\nimport pyfive\nimport h5py\n\ndef test_read_basic_example():\n\n # reading with HDF5\n hfile = h5py.File('basic_example.hdf5', '...
python
chosen
[ { "from": "system", "value": "Fix failing python style test\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n###############################################################################\n# Copyright Kitware Inc.\n#\n# Licensed under the Apache License, Ve...
python
chosen
[ { "from": "system", "value": "Add list_only and dict_only to JSONPrettyField\n" }, { "from": "human", "value": "import json\n\nfrom django.contrib.postgres.forms.jsonb import InvalidJSONInput, JSONField\n\n\nclass JSONPrettyField(JSONField):\n def __init__(self, *args, **kwargs):\n sel...
python
chosen