conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update the contact mail and version\n"
},
{
"from": "human",
"value": "name = \"WSME\"\nversion = \"0.1.0a2\"\n\ndescription = \"Web Services Made Easy\"\nlong_description = \"\"\"\nWeb Service Made Easy is a pure-wsgi and modular rewrite of TGWebServices.\n\"\"\"\n... | python | chosen |
[
{
"from": "system",
"value": "Set except import error on add introspection rules south\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.db.models.fields import CharField\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.utils.enco... | python | chosen |
[
{
"from": "system",
"value": "Allow js2xml.jsonlike... when importing js2xml only\n"
},
{
"from": "human",
"value": "import lxml.etree\nfrom js2xml.parser import CustomParser as Parser\nfrom js2xml.xmlvisitor import XmlVisitor\n\n_parser = Parser()\n_visitor = XmlVisitor()\n\ndef parse(text, enc... | python | chosen |
[
{
"from": "system",
"value": "Change output back to degrees.\n"
},
{
"from": "human",
"value": "from math import atan, tan, radians\n\n\ndef lat_lng(lat, lng):\n \"\"\"\n Return corrected lat/lng.\n Lat: -90 to 90\n Lng: -180 to 180\n \"\"\"\n\n # lat\n # if lat > 180: # r... | python | chosen |
[
{
"from": "system",
"value": "Increase description max length to 2500 characters\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom sqlalchemy import (Column, Integer, String, DateTime, ForeignKey)\nfrom sqlalchemy.orm import relationship, backref\n\nfrom .base import Base\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Test string representations and get_absolute_url() calls.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport pytest\n\nfrom components.events.models import Event, Performance, Venue\nfrom components.events.factories import (EventFactory, PerformanceF... | python | chosen |
[
{
"from": "system",
"value": "Fix tmpdir fixture to remove all the sutff (normally it keeps the last 3, which is a lot).\n"
},
{
"from": "human",
"value": "import os.path\n\nimport pytest\n\n\ndef pytest_collection_modifyitems(items):\n for item in items:\n module_path = os.path.relpat... | python | chosen |
[
{
"from": "system",
"value": "Add a definition about saving latex representation of a term in a file capturing `print` stdout.\n"
},
{
"from": "human",
"value": "\nfrom contextlib import contextmanager\n\nfrom sympy import Eq, Lambda, Function, Indexed\n\ndef define(let, be, **kwds):\n return... | python | chosen |
[
{
"from": "system",
"value": "Add (failing) test for ADHD query. Returns results on site, not through API. Needs investigation\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom api import PubMed\nfrom sysrev.models import Review\n\n\nclass PubmedQueryTestCase(TestCase):... | python | chosen |
[
{
"from": "system",
"value": "Allow MutableMapping for python >= 3.10\n"
},
{
"from": "human",
"value": "from .parser import Udger\n\n__version__ = '4.0.1'\n\n__all__ = ['Udger']\n"
},
{
"from": "gpt",
"value": "from .parser import Udger\n\n__version__ = '4.0.2'\n\n__all__ = ['Udger'... | python | chosen |
[
{
"from": "system",
"value": "Split privmsg if their are too long\n"
},
{
"from": "human",
"value": "\"\"\" Base class for all taemin plugin \"\"\"\n\nclass TaeminPlugin(object):\n helper = {}\n\n def __init__(self, taemin):\n self.taemin = taemin\n\n def start(self):\n pa... | python | chosen |
[
{
"from": "system",
"value": "[geventhttpclient] Remove strong dependency to geventhttpclient>=1.0a\n\nWe can remove the strong dependency on 1.0a, Deepinder Setia manage this\nfix in https://bugs.launchpad.net/opencontrail/+bug/1306715\n\nRefs: http://lists.opencontrail.org/pipermail/dev_lists.opencontrail... | python | chosen |
[
{
"from": "system",
"value": "Fix test involving Element object\n"
},
{
"from": "human",
"value": "from evelink import api\nfrom evelink import constants\n\ndef parse_assets(api_result):\n def handle_rowset(rowset, parent_location):\n results = []\n for row in rowset.findall('ro... | python | chosen |
[
{
"from": "system",
"value": "Tweak JSON api return value to be friendlier\n"
},
{
"from": "human",
"value": "import json\nimport os\nimport tempfile\n\n\ndef store(data, directory=\"/var/www/luke/wikipedia/graphs/\"):\n try:\n json.loads(data)\n except ValueError:\n return \... | python | chosen |
[
{
"from": "system",
"value": "Add indication of what None means\n"
},
{
"from": "human",
"value": "import socket\n\nimport pytest\n\nimport portend\n\n\ndef socket_infos():\n\t\"\"\"\n\tGenerate addr infos for connections to localhost\n\t\"\"\"\n\thost = None\n\tport = portend.find_available_loc... | python | chosen |
[
{
"from": "system",
"value": "Fix unit test by adding back front apps after API tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# This file is part of Shuup.\n#\n# Copyright (c) 2012-2018, Shuup Inc. All rights reserved.\n#\n# This source code is licensed under the OSL-3.0 lice... | python | chosen |
[
{
"from": "system",
"value": "Change types to get the tests to complete.\n"
},
{
"from": "human",
"value": "from llvm import *\nfrom llvm.core import *\nfrom llvm.ee import *\n\nimport logging\n\ntp_int = Type.int()\ntp_float = Type.float()\ndef py_type_to_llvm(tp):\n if tp == int:\n r... | python | chosen |
[
{
"from": "system",
"value": "Use input param key instead of using HEADER field\n"
},
{
"from": "human",
"value": "from app.dataformats import peptable as peptabledata\nfrom app.dataformats import mzidtsv as psmtsvdata\n\n\ndef add_peptide(allpeps, psm, scorecol=False, fncol=None, new=False,\n ... | python | chosen |
[
{
"from": "system",
"value": "Update urlpatterns and remove old patterns pattern"
},
{
"from": "human",
"value": "from functools import wraps\n\nfrom django.conf.urls import patterns, url\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views.decorators.cache import cache_pa... | python | chosen |
[
{
"from": "system",
"value": "Remove other docstring of lies\n"
},
{
"from": "human",
"value": "from rest_framework import serializers as ser\nfrom api.base.serializers import JSONAPISerializer, LinksField\nfrom api.base.utils import absolute_reverse\n\nclass NodeAddonFolderSerializer(JSONAPISer... | python | chosen |
[
{
"from": "system",
"value": "Change regex, added some non-catching groups\n"
},
{
"from": "human",
"value": "import re\nimport urllib2\nimport traceback\n\ntry:\n import simplejson as json\nexcept ImportError:\n import json\n\nclass Twitter(object):\n \"\"\"Checks incoming messages for... | python | chosen |
[
{
"from": "system",
"value": "Stop the repl test on an error, making sure all Pipes are closed\n"
},
{
"from": "human",
"value": "\nfrom tests.util.pipe import Pipe\nfrom threading import Thread\n\nfrom pycell.repl import repl\n\nfrom tests.util.system_test import system_test\nfrom tests.util.al... | python | chosen |
[
{
"from": "system",
"value": "Add TODO regarding conductance congestion approximator\n"
},
{
"from": "human",
"value": "from __future__ import division\nimport numpy as np\nfrom congestion_approx import CongestionApprox\n\n\nclass ConductanceCongestionApprox(CongestionApprox):\n def __init__(s,... | python | chosen |
[
{
"from": "system",
"value": "Change exemple code to generate OTP link\n"
},
{
"from": "human",
"value": "import binascii\nimport base64\nimport os.path\n\ndef __content(f):\n return open(os.path.join(os.path.dirname(__file__), f)).read()\n\ncrypto_js = __content('crypto.js')\nhotp_js = __con... | python | chosen |
[
{
"from": "system",
"value": "Fix import of 'reverse' for Django>1.9\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.conf import settings\nfrom django.core.urlresolvers import reverse\n\nregister = template.Library()\n\n\n@register.simple_tag(takes_context=True)\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Add field 'creator' to table 'runs'\n\nExample of values stored into *.tcx files:\n runtastic - makes sports funtastic, http://www.runtastic.com\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\n# This script has to generate the sqlite database\n#\n# Requireme... | python | chosen |
[
{
"from": "system",
"value": "Fix default redirect to use get_script_prefix\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom django.views.generic import RedirectView\n\nurlpatterns = patterns(\n 'wafer.pages.views',\n url('^index(?:\\.html)?$', RedirectVi... | python | chosen |
[
{
"from": "system",
"value": "Add more search fields to admin team listing page.\n"
},
{
"from": "human",
"value": "from django.utils.html import format_html\n\nfrom wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register\n\nfrom .models import Person\n\n\nclass PeopleAdmin(Model... | python | chosen |
[
{
"from": "system",
"value": "Remove picture files along with data\n"
},
{
"from": "human",
"value": "# muddersOnRails()\n# Sara McAllister November 17, 2017\n# Last updated: 11-17-2017\n\n# delete all data from database (this is super sketch)\nimport dbCalls\n\ndef main():\n print('Deleting ... | python | chosen |
[
{
"from": "system",
"value": "Ch04: Modify homepage view to list Tags.\n"
},
{
"from": "human",
"value": "from django.http.response import HttpResponse\n\n\ndef homepage(request):\n return HttpResponse('Hello (again) World!')\n"
},
{
"from": "gpt",
"value": "from django.http.respo... | python | chosen |
[
{
"from": "system",
"value": "Remove unused variable from `handle_cd_command`\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\n\ndef handle_cd_command(arg):\n \"\"\"Handles a `cd` shell command by calling python's os.chdir.\"\"\"\n CD_CMD = 'cd'\n command = arg.strip()\n... | python | chosen |
[
{
"from": "system",
"value": "Fix bug due to refacto\n"
},
{
"from": "human",
"value": "#-*- coding: utf-8 -*-\n\nfrom src.shell.parser.i_log_parser import ILogParser\n\nclass TypeLogParser(ILogParser):\n \"\"\"\n Parser for type log file\n\n \"\"\"\n\n def __init__(self, *args, ... | python | chosen |
[
{
"from": "system",
"value": "Change version, upload to pypi.\n"
},
{
"from": "human",
"value": "\"\"\"\nClient for Yandex.Disk.\n\"\"\"\n__version__ = '0.3.2'\n\nfrom .YaDiskClient import YaDiskException, YaDisk\n"
},
{
"from": "gpt",
"value": "\"\"\"\nClient for Yandex.Disk.\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Order images by created at\n"
},
{
"from": "human",
"value": "import graphene\n\nfrom falmer.schema.schema import DjangoConnectionField\nfrom . import types\nfrom . import models\n\nclass Query(graphene.ObjectType):\n all_images = DjangoConnectionField(types.Imag... | python | chosen |
[
{
"from": "system",
"value": "Add static web asset cache busting\n"
},
{
"from": "human",
"value": "\"\"\"YARN monitoring built-in UI.\"\"\"\n\nfrom flask import Blueprint, render_template\n\nui_bp = Blueprint('ui', __name__, static_folder='static')\n\n\n@ui_bp.route('/')\ndef index():\n retu... | python | chosen |
[
{
"from": "system",
"value": "Add groups url to serialized urls.\n"
},
{
"from": "human",
"value": "from addons.base.serializer import CitationsAddonSerializer\n\nclass ZoteroSerializer(CitationsAddonSerializer):\n addon_short_name = 'zotero'\n\n @property\n def serialized_node_settings... | python | chosen |
[
{
"from": "system",
"value": "Fix version pin error from last release!\n"
},
{
"from": "human",
"value": "if __name__ == \"__main__\":\n __version__ = \"0.3\"\nelse:\n from animatedsprite import AnimatedSprite\n from tilemap import TileMap, Tilesheet, tmx_file_to_tilemaps\n from laye... | python | chosen |
[
{
"from": "system",
"value": "Simplify Flickr's scope handling a bit\n"
},
{
"from": "human",
"value": "import foauth.providers\n\n\nclass Flickr(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'http://www.flickr.com/'\n docs_url = 'http://www.flickr.com/s... | python | chosen |
[
{
"from": "system",
"value": "Add flask-mail to use for emailing updates\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask.ext.babel import Babel\nimport os\n\napp = Flask(__name__.split('.')[0])\napp.config.from_pyfile(os.path.jo... | python | chosen |
[
{
"from": "system",
"value": "Remove conversion to set, as the new file format uses sets in tuples.\n"
},
{
"from": "human",
"value": "\"\"\"\nDerive a list of impossible differentials.\n\"\"\"\n\nfrom ast import literal_eval\nimport sys\n\ndef parse(line):\n return literal_eval(line)\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Revert \"Testing NoOpDSH() when database commands are executed without a connection being opened.\"\"\n\nThis reverts commit 9c428fbfb69c93ef3da935d0d2ab098fbeb1c317.\n"
},
{
"from": "human",
"value": "# ----- Info ------------------------------------------... | python | chosen |
[
{
"from": "system",
"value": "Fix whitespace error to keep flake8 happy\n"
},
{
"from": "human",
"value": "\"\"\"\nVery partial backport of the `http.HTTPStatus` enum from Python 3.5\n\nThis implements just enough of the interface for our purposes, it does not\nattempt to be a full implementatio... | python | chosen |
[
{
"from": "system",
"value": "Make relations import conditional for layers migration\n"
},
{
"from": "human",
"value": "# Copyright 2014-2015 Canonical Limited.\n#\n# This file is part of jujubigdata.\n#\n# jujubigdata is free software: you can redistribute it and/or modify\n# it under the terms... | python | chosen |
[
{
"from": "system",
"value": "Load from the pre processed data\n"
},
{
"from": "human",
"value": "from __future__ import division\n\nimport gzip\n\ntry:\n from BytesIO import BytesIO\nexcept ImportError:\n from io import BytesIO\n\ntry:\n from urlparse import urlparse\nexcept ImportErro... | python | chosen |
[
{
"from": "system",
"value": "Remove password back door since database updates complete.\n"
},
{
"from": "human",
"value": "import hashlib\n\nfrom os import urandom\nfrom base64 import b64encode, b64decode\nfrom itertools import izip\nfrom lampost.util.pdkdf2 import pbkdf2_bin\n\nSALT_LENGTH = 8... | python | chosen |
[
{
"from": "system",
"value": "Fix Unit Test build environment\n"
},
{
"from": "human",
"value": "# Copyright 2014-present PlatformIO <contact@platformio.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License... | python | chosen |
[
{
"from": "system",
"value": "Fix bool setting dump issue.\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.core.management import BaseCommand\nfrom django.conf import settings\n\n\ndef dump_attrs(obj_instance):\n for attr in dir(obj_instance):\n if attr != attr.upper():\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert changes to helloworld example\n"
},
{
"from": "human",
"value": "# Copyright 2015 gRPC authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a cop... | python | chosen |
[
{
"from": "system",
"value": "Add BioC.dtd one level up\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom bioc import BioCReader\nfrom bioc import BioCWriter\n\ntest_file = '../test_input/PMID-8557975-simplified-sentences.xml'\ndtd_file = '../test_input/BioC.dtd'\n\ndef main():\n ... | python | chosen |
[
{
"from": "system",
"value": "Rename the signed_div test case, and ... disable the multithreaded test case.\n"
},
{
"from": "human",
"value": "import nose\nimport angr\nimport subprocess\n\nimport logging\nl = logging.getLogger('angr.tests.test_signed_div')\n\nimport os\ntest_location = str(os.p... | python | chosen |
[
{
"from": "system",
"value": "Add unit test case for desired placement behavior\n"
},
{
"from": "human",
"value": "\"\"\"Tests for the isort import placement module\"\"\"\nfrom functools import partial\n\nfrom isort import place, sections\nfrom isort.settings import Config\n\n\ndef test_module(s... | python | chosen |
[
{
"from": "system",
"value": "Fix empty Q() filters on Django 1.8\n"
},
{
"from": "human",
"value": "from django.db.models.expressions import Star\nfrom django.db.models.sql.datastructures import EmptyResultSet\n\nfrom .version_19 import Parser as BaseParser\n\n\nclass Parser(BaseParser):\n d... | python | chosen |
[
{
"from": "system",
"value": "Test execution: Add bear tests\n"
},
{
"from": "human",
"value": "#! /bin/python3\n\n\"\"\"\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, eit... | python | chosen |
[
{
"from": "system",
"value": "Fix test after changing array structure\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom numba.ctypes_support import *\nimport numpy\nimport numba.unittest_support as unittest\nfrom numba._numpyadapt import get_ndarray_adaptor\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Add Content-Length to message in the body of a bad request\n"
},
{
"from": "human",
"value": "import os\nimport cvmfs_geo\n\nnegative_expire_secs = 60*5; # 5 minutes\n\ndef bad_request(start_response, reason):\n response_body = 'Bad Request: ' + reason + \... | python | chosen |
[
{
"from": "system",
"value": "Make minor improvements to comments and formatting\n"
},
{
"from": "human",
"value": "import turtle\n\ndef draw_initials():\n #Set up screen, etc.\n window = turtle.Screen()\n window.bgcolor('gray')\n\n ###THE LETTER B###\n letter = turtle.Turtle()\n ... | python | chosen |
[
{
"from": "system",
"value": "Add rpm-build into environment setup message for CentOS\n\nChange-Id: I44bd14f2f3c3e76c24f5efd26a5ff6a545dcaf72\nImplements: blueprint plugin-major-version-for-releases\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright 2014 Mirantis, Inc.\... | python | chosen |
[
{
"from": "system",
"value": "Add timestamps to management task output\n"
},
{
"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\n# file, You can obtain one at http://mozilla.org... | python | chosen |
[
{
"from": "system",
"value": "Initialize engine with load_system parameter.\n"
},
{
"from": "human",
"value": "\"\"\"\nA simple standalone target for the prolog interpreter.\n\"\"\"\n\nimport sys\nfrom prolog.interpreter.translatedmain import repl, execute\n\n# __________ Entry point _________... | python | chosen |
[
{
"from": "system",
"value": "Add imports to init with noqa comments\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# coding: utf8\n\n# TODO: Move imports to specific modules that need them\n\n# CORE\nfrom .api import get, yahoo, bing, geonames, google, mapquest # noqa\nfrom .api import ... | python | chosen |
[
{
"from": "system",
"value": "Update version 1.0.0.dev6 -> 1.0.0.dev7"
},
{
"from": "human",
"value": "__version__ = '1.0.0.dev6'\n__author__ = 'D-Wave Systems Inc.'\n__authoremail__ = 'acondello@dwavesys.com'\n__description__ = 'A shared API for binary quadratic model samplers.'\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Switch to non-privledged port to make testing easier.\n\nUser the new server.run() method.\n"
},
{
"from": "human",
"value": "import asyncore,time,signal,sys\nfrom secure_smtpd import SMTPServer, FakeCredentialValidator\n\nclass SecureSMTPServer(SMTPServer):\n \n... | python | chosen |
[
{
"from": "system",
"value": "Disable updating active counts on startup\n"
},
{
"from": "human",
"value": "from django.core.management import BaseCommand\nfrom tasks import data_integrity_checks\n\nclass Command(BaseCommand):\n help = 'Run data integrity checks'\n\n def handle(self, *args,... | python | chosen |
[
{
"from": "system",
"value": "Add url rules for public unauthorised routes\n"
},
{
"from": "human",
"value": "from flask_sqlalchemy import SQLAlchemy\nimport connexion\n\nfrom config import config\n\ndb = SQLAlchemy()\n\n\ndef create_app(config_name):\n app = connexion.FlaskApp(__name__, spec... | python | chosen |
[
{
"from": "system",
"value": "Fix pytest when pyfakefs + future is installed\n\n`python-future` is notorious for breaking modules which use `try:` / `except:`\nto import modules based on version. In this case, `pyfakefs` imported the\nbackported `builtins` module which changes the semantics of the `open()`... | python | chosen |
[
{
"from": "system",
"value": "Make integration longer bc now ends before interrupt?\n"
},
{
"from": "human",
"value": "import sys\nimport numpy\nfrom galpy.orbit import Orbit\nfrom galpy.potential import MiyamotoNagaiPotential\n\nif __name__ == '__main__':\n # python orbitint4sigint.py sympl... | python | chosen |
[
{
"from": "system",
"value": "Add StatementDescriptor for card web payins"
},
{
"from": "human",
"value": "from mangopaysdk.types.payinpaymentdetails import PayInPaymentDetails\n\n\nclass PayInPaymentDetailsCard(PayInPaymentDetails):\n \"\"\"Class represents Card type for mean of payment in P... | python | chosen |
[
{
"from": "system",
"value": "Add a title attribute to the SearchIndex for pages.\n\nThis is useful when displaying a list of search results because we\ncan display the title of the result without hitting the database to\nactually pull the page.\n"
},
{
"from": "human",
"value": "\"\"\"Django ha... | python | chosen |
[
{
"from": "system",
"value": "Use in-place operations in ImageNormalize\n"
},
{
"from": "human",
"value": "\"\"\"\nNormalization class for Matplotlib that can be used to produce colorbars.\n\"\"\"\n\nimport numpy as np\nfrom numpy import ma\n\nfrom matplotlib.colors import Normalize\n\n\n__all__... | python | chosen |
[
{
"from": "system",
"value": "Add pySwarm code - tests fixed.\n"
},
{
"from": "human",
"value": "\"\"\"Tests for pyswarm.\"\"\"\nfrom unittest import TestCase\nfrom grortir.externals.pyswarm.pso import pso\n\n\nclass TestPso(TestCase):\n \"\"\"Class for tests PSO.\"\"\"\n\n def test_run_si... | python | chosen |
[
{
"from": "system",
"value": "Add check for src field\n\nSrc field can be absent in copy task,\nand content field can be used instead,\nso we should check if src is present to\navoid Keyerror exception.\n"
},
{
"from": "human",
"value": "from ansiblelint import AnsibleLintRule\n\n\nformat = \"{}... | python | chosen |
[
{
"from": "system",
"value": "Swap '2016' for '1996' to stop faulty logic from passing unit test\n\n[This leap solution](http://exercism.io/submissions/7ef5b0ab93b540f79cdee9f153e0a21c) should not pass the unit test, since it checks whether `year % 100` and `year % 400` are equal in order to tell whether th... | python | chosen |
[
{
"from": "system",
"value": "Rework tree to store inserted nodes\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\n\nclass Mutabl... | python | chosen |
[
{
"from": "system",
"value": "Use a function to rename the kv file in hooks\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Rename the generated kv file to be compatible with the original kivy kv file\ndetection of `App.load_kv`.\n\"\"\"\n\nimport os\n\... | python | chosen |
[
{
"from": "system",
"value": "Add factory for capakey and utility method for doing a request.\n"
},
{
"from": "human",
"value": "from suds.client import Client\n\ndef crab_factory(**kwargs):\n if 'wsdl' in kwargs:\n wsdl = kwargs['wsdl']\n del kwargs['wsdl']\n else:\n ... | python | chosen |
[
{
"from": "system",
"value": "Refactor for better logical flow.\n"
},
{
"from": "human",
"value": "import logging\nimport os\nfrom django.conf import settings\n\nVERSION = (1, 2, 9)\n\n\ndef get_version():\n return '%s.%s.%s' % VERSION\n\ntry:\n LOGFILE = os.path.join(settings.DIRNAME, 'ax... | python | chosen |
[
{
"from": "system",
"value": "Return server version from update API\n\n"
},
{
"from": "human",
"value": "import virtool.app\nimport virtool.updates\nfrom virtool.handlers.utils import json_response\n\n\nasync def get(req):\n # db = req.app[\"db\"]\n settings = req.app[\"settings\"]\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update xml writer test to work\n"
},
{
"from": "human",
"value": "import glob\nimport itertools as it\nimport os\n\nimport parmed as pmd\nfrom pkg_resources import resource_filename\nimport pytest\n\nfrom foyer import Forcefield\nfrom foyer.tests.utils import atomty... | python | chosen |
[
{
"from": "system",
"value": "Add message attr to LaboratoryException\n"
},
{
"from": "human",
"value": "class LaboratoryException(Exception):\n pass\n\n\nclass MismatchException(LaboratoryException):\n pass\n"
},
{
"from": "gpt",
"value": "class LaboratoryException(Exception):... | python | chosen |
[
{
"from": "system",
"value": "Use relative path instead of only filename"
},
{
"from": "human",
"value": "import pytest\nimport inspect\nimport os.path\n\ndef pytest_namespace():\n def assume(expr, msg=''):\n if not expr:\n # get filename, line, and context\n (fil... | python | chosen |
[
{
"from": "system",
"value": "Make output more easily parsable\n"
},
{
"from": "human",
"value": "#\n# Copyright 2012 Cisco Systems, Inc.\n#\n# Author: Soren Hansen <sorhanse@cisco.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file e... | python | chosen |
[
{
"from": "system",
"value": "Truncate target table before creating division items\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport traceback\n\nfrom db.common import session_scope\nfrom db.team import Team\nfrom db.division import Division\n... | python | chosen |
[
{
"from": "system",
"value": "Fix generator being passed to the wfile.write method of the HttpHandler instead of string\n"
},
{
"from": "human",
"value": "import os\nfrom BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer\nfrom jinja2 import Environment, FileSystemLoader\n\nfrom jinger.con... | python | chosen |
[
{
"from": "system",
"value": "Fix the manager methods for deferred/non_deferred\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django_mailer import constants\n\n\nclass QueueManager(models.Manager):\n use_for_related_fields = True\n\n def high_priority(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a few more tests for edge cases\n"
},
{
"from": "human",
"value": "from random import shuffle\nimport pytest\n\nfrom quick_sort import quick_srt\n\n\ndef test_quick_srt():\n expected = range(20)\n actual = expected[:]\n shuffle(actual)\n quick_srt(ac... | python | chosen |
[
{
"from": "system",
"value": "Change extensions to use pathlib in helpers instead of lists\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nExtension that omits the creation of file `skeleton.py`\n\"\"\"\n\nfrom ..api import Extension, helpers\n\n\nclass NoSkeleton(Extension):... | python | chosen |
[
{
"from": "system",
"value": "Change log level to warning\n"
},
{
"from": "human",
"value": "import logging\nimport time\nfrom functools import wraps\n\nfrom . import compat\n\ncompat.patch() # monkey-patch time.perf_counter\n\nlog = logging.getLogger('amqpy')\n\n\ndef synchronized(lock_name):\... | python | chosen |
[
{
"from": "system",
"value": "Change to model from class on 10/10/2016\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\n\n# Create your models here.\n"
},
{
"from": "gpt",
"value": "from __future__ import unicode_literals\n\n... | python | chosen |
[
{
"from": "system",
"value": "Remove English [initialize] default block for now to get tests to pass\n"
},
{
"from": "human",
"value": "from typing import Optional\nfrom thinc.api import Model\n\nfrom .tokenizer_exceptions import TOKENIZER_EXCEPTIONS\nfrom .stop_words import STOP_WORDS\nfrom .le... | python | chosen |
[
{
"from": "system",
"value": "Test when path not is a directory.\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\nfrom subprocess import check_call\n\nfrom pytest import raises\n\nfrom csft import __main__ as main\n\n\ndef test_call():\n check_call(['python', '-m', 'csft', '.'])\n... | python | chosen |
[
{
"from": "system",
"value": "Add converter before blueprint registration\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_login import LoginManager\nfrom flask_oauthlib.client import OAuth\n\nfrom config import config\n\ndb = SQLAlc... | python | chosen |
[
{
"from": "system",
"value": "Add solution for excel sheet column title\n"
},
{
"from": "human",
"value": "\"\"\"\nSource : https://oj.leetcode.com/problems/excel-sheet-column-number/\nAuthor : Changxi Wu\nDate : 2015-01-21\n\nGiven a column title as appear in an Excel sheet, return its corres... | python | chosen |
[
{
"from": "system",
"value": "Add one more if to speed up"
},
{
"from": "human",
"value": "# Remove Element https://oj.leetcode.com/problems/remove-element/\n# Given an array and a value, remove all instances of that value in place and return the new length.\n# The order of elements can be chang... | python | chosen |
[
{
"from": "system",
"value": "Add capability to upvote/downvote yaks many times\n"
},
{
"from": "human",
"value": "import pyak\nimport time\n\nclass YikBot(Yakker):\n def boot(self):\n while True:\n print \"DEBUG: Scanning feed\"\n yaks = yikBot.get_yaks()\n ... | python | chosen |
[
{
"from": "system",
"value": "Test that extending setuptools' build sub_commands does not extend distutils\n"
},
{
"from": "human",
"value": "from setuptools.dist import Distribution\nfrom setuptools.command.build import build\n\n\ndef test_distribution_gives_setuptools_build_obj(tmpdir_cwd):\n ... | python | chosen |
[
{
"from": "system",
"value": "Prepare the main script to accept multi-way pots.\n"
},
{
"from": "human",
"value": "# usage: python one_time_eval.py as8sqdtc\n\nfrom deuces.deuces import Card\nfrom convenience import find_pcts, pr, str2cards\nimport sys\n\ncards_str = sys.argv[1]\nboard_str = ''\... | python | chosen |
[
{
"from": "system",
"value": "Add 'where do you live' answer.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom os.path import abspath, dirname, join\nfrom gendo import Gendo\n\nHERE = dirname(abspath(__file__))\nconfig_path = join(HERE, 'config.yaml')\nbot = Gendo.config_from_yam... | python | chosen |
[
{
"from": "system",
"value": "Remove some test code that got left behind\n"
},
{
"from": "human",
"value": "import platform\nfrom stats_file_backend import StatsFileBackend\n\nclass StatsBackend:\n \"\"\"\n This is a class to manage the Stats backend.\n \"\"\"\n def __init__(self, options={}... | python | chosen |
[
{
"from": "system",
"value": "Update form to pass new test\n"
},
{
"from": "human",
"value": "\"\"\"forms for accounts app\n\n\"\"\"\nfrom django import forms\nfrom django.contrib.auth import get_user_model\nfrom django.core.mail import EmailMultiAlternatives\nfrom django.contrib.sites.shortcuts... | python | chosen |
[
{
"from": "system",
"value": "Add output option for profiler\n"
},
{
"from": "human",
"value": "\nimport argparse\nimport inspect\nimport subprocess\nimport sys\n\nclass PyFrcProfiler:\n \"\"\"\n Wraps other commands by running them via the built in cProfile module.\n Use this t... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.