conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Return None for unsupported platforms\n"
},
{
"from": "human",
"value": "import os\nimport os.path\nimport sys\n\n\ndef enumerate():\n ports = []\n\n if sys.platform == 'win32':\n # Iterate through registry because WMI does not show virtual serial ports... | python | chosen |
[
{
"from": "system",
"value": "Put comments in to hint a decent strategy to profile runtime performance\n\nTo do performance optimization in this sort of application, this is\nabout as well as I have been able to manage in python. I will say perl with\nNYTProf seems to be significantly better for data, but ... | python | chosen |
[
{
"from": "system",
"value": "Add a function for generating normalised Jacobi polynomials.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport sympy as sy\n\n\ndef lagrange_basis(points, sym):\n \"\"\"Generates a basis of polynomials, :math:`l_i(x)`, such that\n .. math::\... | python | chosen |
[
{
"from": "system",
"value": "Add a way to scrape commits from a file.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport sys\n\ndef main(argv):\n return 0\n\nif __name__ == \"__main__\":\n sys.exit(main(sys.argv))\n\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\nimp... | python | chosen |
[
{
"from": "system",
"value": "Move catalogue to products URL namespace\n"
},
{
"from": "human",
"value": "\"\"\"compshop 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:\nFun... | python | chosen |
[
{
"from": "system",
"value": "Add FloatArgument to arguments module\n"
},
{
"from": "human",
"value": "from .base import BaseArgument, ListArgument\nfrom .boolean import BooleanArgument\nfrom .number import IntegerArgument\nfrom .scope import ScopeArgument\nfrom .string import StringArgument, St... | python | chosen |
[
{
"from": "system",
"value": "Add URL to setup script\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport shutil\n\n\nif not os.path.exists('/opt/Pi-Box'):\n\tos.makedirs('/opt/Pi-Box')\nshutil.copy('./main.py', '/opt/Pi-Box')\n\nif not os.path.exists('/opt/Pi-Box/dropbox.txt'):\n\t... | python | chosen |
[
{
"from": "system",
"value": "Remove unused statement & format for python3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Python script to fetch interface name and their operation status\n\nfrom ncclient import manager\n\n\ndef connect(host, port, user, password):\n conn = manage... | python | chosen |
[
{
"from": "system",
"value": "Update osm way used due to data change\n"
},
{
"from": "human",
"value": "# http://www.openstreetmap.org/way/367477828\nassert_has_feature(\n 16, 10471, 25331, 'roads',\n { 'id': 367477828, 'kind': 'path', 'crossing': 'zebra' })\n\n# Way: The Embarcadero (3971... | python | chosen |
[
{
"from": "system",
"value": "Remove importing UnitCase from Cramer tests\n"
},
{
"from": "human",
"value": "# Licensed under an MIT open source license - see LICENSE\n\n\n'''\nTest functions for Cramer\n'''\n\nfrom unittest import TestCase\n\nimport numpy as np\nimport numpy.testing as npt\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Fix pyglet and game loading.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Point of execution for play.\n\nConfigures module path and libraries and then calls lib.main.main.\n\n\"\"\"\n\nimport sys\nsys.path.insert(0, 'pyglet-c9188efc2e30')\n\nimpo... | python | chosen |
[
{
"from": "system",
"value": "Fix parsing of JSON formatting errors\n"
},
{
"from": "human",
"value": "import json\nfrom collections import OrderedDict\n\n\ndef format_json(input, settings=None):\n indent = 4\n if settings:\n indent = settings.get('tab_size', indent)\n try:\n ... | python | chosen |
[
{
"from": "system",
"value": "Tests: Disable tests that don't work on travis\n"
},
{
"from": "human",
"value": "# Copyright 2015 Isotoma Limited\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 ... | python | chosen |
[
{
"from": "system",
"value": "Use the new get_minion_data function\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nFunctions to interact with the pillar compiler on the master\n'''\n\n# Import salt libs\nimport salt.pillar\nimport salt.utils.minions\n\n\ndef show_top(minion=None... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fixes to the create_user pipeline\"\n\nThis reverts commit 49dd1b5205498425f7af247f7c390a48a423db4c.\n"
},
{
"from": "human",
"value": "from django.utils.translation import ugettext\nfrom django.contrib.auth.models import User\n\nfrom social_auth.backends.p... | python | chosen |
[
{
"from": "system",
"value": "Fix up migrations, part 2\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('package_monitor',... | python | chosen |
[
{
"from": "system",
"value": "Add fpp k/d data to the model.\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\nclass RatingData(models.Model):\n userName = models.CharField(max_length=30)\n solofpp = models.CharField(max_length=5, null=True)\n ... | python | chosen |
[
{
"from": "system",
"value": "Use µ- prefix rather than u-\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom . import meta\n\n__version__ = \"0.1.0+\"\n\n__doc__ = \"\"\"This is pyatmlab\n\"\"\"\n\nfrom pint import UnitRegistry\nureg = UnitRegistry()\n"
},
{
"from": "gpt",... | python | chosen |
[
{
"from": "system",
"value": "Add ref to ligiermirror CLU\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=utf-8\n# vim: ts=4 sw=4 et\n\"\"\"\n=============\nLigier Mirror\n=============\n\nSubscribes to given tag(s) and sends them to another Ligier.\n\n\"\"\"\n# Author: Tamas ... | python | chosen |
[
{
"from": "system",
"value": "Add adjacency_dict for strongly connected graphs\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef dfs_recur():\n\tpass\n\ndef traverse_dfs_recur():\n\tpass\n\nd... | python | chosen |
[
{
"from": "system",
"value": "chore: Write part of a test\n"
},
{
"from": "human",
"value": "import affect_ai\nimport pytest\n\n# words: foo, bar, baz, goo, car, caz, hoo, dar, daz, ioo, ear, eaz, loo, far, faz; corpora: happiness 1, satisfaction 2, elation 2, 3\n\n# Test that an affect_AI objec... | python | chosen |
[
{
"from": "system",
"value": "Remove the bulk delete action if the user does not have delete permissions on the model being viewed\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.admin.forms import AdminAuthenticationForm\nfrom django import forms\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "jenkins: Allow boots for unknown labs\n\nSigned-off-by: Florent Jacquet <692930aa2e4df70616939784b5b6c25eb1f2335c@free-electrons.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding:utf-8 -*\n#\n\nimport os\nimport sys\nimport configparser\n\... | python | chosen |
[
{
"from": "system",
"value": "Test all the Jmbo content types\n"
},
{
"from": "human",
"value": "from os.path import expanduser\n\nfrom foundry.settings import *\n\n# Postgis because we want to test full functionality\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.contrib.gis.db.bac... | python | chosen |
[
{
"from": "system",
"value": "Fix failing test about passing nested iterables to pack\n"
},
{
"from": "human",
"value": "'''Some utilities used around town'''\n\nimport struct\n\n\ndef pack(message):\n '''Pack the provided message'''\n if isinstance(message, basestring):\n # Return\... | python | chosen |
[
{
"from": "system",
"value": "Allow user to set their initial amount of cash and drugs\n"
},
{
"from": "human",
"value": "from selenium import webdriver\nfrom selenium.webdriver.common.keys import Keys\nimport time\n\ndriver = webdriver.Chrome()\ndriver.get(\"http://clickingbad.nullism.com/\")\n... | python | chosen |
[
{
"from": "system",
"value": "test: Add helper function to find devices\n\nAdd a helper function to the utility library as an alternative to the\nconvenience method Adapter.FindDevice() in the D-Bus API.\n"
},
{
"from": "human",
"value": "import dbus\n\nSERVICE_NAME = \"org.bluez\"\nADAPTER_INTE... | python | chosen |
[
{
"from": "system",
"value": "Enable Dictionaries or Lists to create the Machine\n"
},
{
"from": "human",
"value": "class StateMachine(object):\r\n def __init__(self,RequiredStates,InitialState=0):\r\n \r\n self.States = RequiredStates\r\n self.StateCodes = dict([(v,k) for k,... | python | chosen |
[
{
"from": "system",
"value": "Rename the nagios-results test suite into a valid identifier.\n\nThis way, we can run its tests from within a test.runner module.\n"
},
{
"from": "human",
"value": "import sys\nimport os\nimport test.cache as tc\nimport test.dateandtime as td\nimport test.nagios as ... | python | chosen |
[
{
"from": "system",
"value": "Fix use of escape characters in \"set terminal title\" segment.\n\nEscape characters were incorrect for non-BASH shells.\n"
},
{
"from": "human",
"value": "def add_term_title_segment():\n term = os.getenv('TERM')\n if not (('xterm' in term) or ('rxvt' in term)... | python | chosen |
[
{
"from": "system",
"value": "Add generic monkeypatch call stub\n"
},
{
"from": "human",
"value": "from uuid import uuid4\n\nfrom valohai_cli.utils import get_random_string\n\n\ndef get_project_data(n_projects):\n return {\n 'results': [\n {'id': str(uuid4()), 'name': get_ra... | python | chosen |
[
{
"from": "system",
"value": "Add the output_frame_size parameter to PitchgramTransformer.\n\nWithout it the deserialization via jsonpickle fails.\n"
},
{
"from": "human",
"value": "from sklearn.base import BaseEstimator, TransformerMixin\n\nfrom .signal import SignalFrames\nfrom .reassignment i... | python | chosen |
[
{
"from": "system",
"value": "Fix 'zero length field name in format' error\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Metric(models.Model):\n class Meta:\n db_table = 'metric'\n\n def __unicode__(self):\n return self.name\n\n name = models.C... | python | chosen |
[
{
"from": "system",
"value": "Set debug mode to True in development\n"
},
{
"from": "human",
"value": "import os\nfrom horus.apps import create_app\n\n\nconfig_file = os.path.join(os.path.dirname(os.path.realpath(__file__))\n , 'config.py')\nprint config_file\napp = cre... | python | chosen |
[
{
"from": "system",
"value": "Revert \"add __all__ parameter to main module\"\n\nThis reverts commit bc9e574206e75b1a50bd1b8eb4bd56f96a18cf51.\n"
},
{
"from": "human",
"value": "\"\"\"A small django app around sendgrid and its webhooks\"\"\"\n\nfrom utils import SendgridEmailMessage, SendgridEma... | python | chosen |
[
{
"from": "system",
"value": "Add missing required heroku config variable\n"
},
{
"from": "human",
"value": "\"\"\"\nFile to easily switch between configurations between production and\ndevelopment, etc.\n\"\"\"\n\nimport os\n\n\n# You must set each of these in your heroku environment with the h... | python | chosen |
[
{
"from": "system",
"value": "Add verbose name for SLURM package [WAL-1141]\n"
},
{
"from": "human",
"value": "from decimal import Decimal\n\nfrom django.db import models\nfrom django.core.validators import MinValueValidator\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom nodeco... | python | chosen |
[
{
"from": "system",
"value": "Add default ordering to weight entries\n"
},
{
"from": "human",
"value": "# This file is part of Workout Manager.\n# \n# Workout Manager is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as publish... | python | chosen |
[
{
"from": "system",
"value": "Make it possible to run the histograms XML validator from directories other than tools/metrics/histograms.\n\nReview URL: https://codereview.chromium.org/80433003\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@236508 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "CLI: Change confirmation flag to '--sure y'\n"
},
{
"from": "human",
"value": "from ognskylines.dbutils import engine\nfrom ognskylines.model import Base\n\nfrom manager import Manager\nmanager = Manager()\n\n\n@manager.command\ndef init():\n \"\"\"Initialize the... | python | chosen |
[
{
"from": "system",
"value": "Add onset detection processing node to top-level exports\n"
},
{
"from": "human",
"value": "from node.duration import \\\n Hours, Minutes, Seconds, Milliseconds, Microseconds, Picoseconds\n\nfrom node.audio_metadata import MetaData, AudioMetaDataEncoder\n\nfrom n... | python | chosen |
[
{
"from": "system",
"value": "Fix TypeError if `LANG` is not set in on osx\n\nIn macosx.uniqueid, `$LANG` is retrieved with `old_lang = environ.get('LANG')`. This means that if `LANG` is not set, `old_lang` will be none. When plyer later tries to restore the original value of lang, `putenv` will complain th... | python | chosen |
[
{
"from": "system",
"value": "Delete a stray Python 2 print statement.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2014, Matt Layman\n\nimport inspect\nimport tempfile\nimport unittest\n\nfrom handroll import configuration\n\n\nclass FakeArgs(object):\n\n def __init__(self):\n s... | python | chosen |
[
{
"from": "system",
"value": "Use implicit ordering of AsyncIndicator model\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\n\nfrom datetime import datetime\n\nfrom django.db.models import Min\n\nfrom corehq.apps.userreports.models impor... | python | chosen |
[
{
"from": "system",
"value": "Choose one when there are multiple options, preferring (for now) System\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom generateSymbolTable import generate_default_symbol_table\nfrom scanner import scan_source_files\nfrom glob import glob\n\nfilenam... | python | chosen |
[
{
"from": "system",
"value": "Add a test for quoted strings with {\"quotes\"} in .bib files.\n"
},
{
"from": "human",
"value": "from pybtex.database import BibliographyData\nfrom pybtex.core import Entry\nfrom pybtex.database.input.bibtex import Parser\nfrom cStringIO import StringIO\n\ntest_dat... | python | chosen |
[
{
"from": "system",
"value": "Use new Epsilon versioned feature.\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\ndistobj = setup(\n name=\"Axiom\",\n version=\"0.1\",\n maintainer=\"Divmod, Inc.\",\n maintainer_email=\"support@divmod.org\",\n url=\"http://di... | python | chosen |
[
{
"from": "system",
"value": "Add Homepage and Source project URLs for PyPI\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport re\nfrom codecs import open\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\npackages = [\n 'sl... | python | chosen |
[
{
"from": "system",
"value": "Add more Data Models with different Column types\n"
},
{
"from": "human",
"value": "import uuid\nfrom cassandra.cqlengine import columns, models\n\n\nclass Blog(models.Model):\n blog_id = columns.UUID(primary_key=True, default=uuid.uuid4)\n created_at = column... | python | chosen |
[
{
"from": "system",
"value": "Update create() method of view to include extra data\n"
},
{
"from": "human",
"value": "from rest_framework.generics import ListCreateAPIView\nfrom rest_framework.permissions import BasePermission\nfrom rest_framework.throttling import AnonRateThrottle\nfrom .serial... | python | chosen |
[
{
"from": "system",
"value": "Validate user is in conversation on create message\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom foodsaving.conversations.models import Conversation, ConversationMessage\n\n\nclass ConversationSerializer(serializers.ModelSerialize... | python | chosen |
[
{
"from": "system",
"value": " Add sleeping spin-wait to listener script\n\nThis will prevent the script from exiting, thus defeating the entire purpose of\nusing a separate GPIO button to shutdown\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport RPIO\nimport subprocess\n\nPI... | python | chosen |
[
{
"from": "system",
"value": "Remove images created by tests\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom __future__ import absolute_import\nfrom fig.packages.docker import Client\nfrom fig.service import Service\nfrom fig.cli.utils import docker_url\nfrom . i... | python | chosen |
[
{
"from": "system",
"value": "Set RemovedInOscar15Warning for existing deprecation warnings\n"
},
{
"from": "human",
"value": "try:\n from types import ClassType\nexcept ImportError:\n # Python 3\n CHECK_TYPES = (type,)\nelse:\n # Python 2: new and old-style classes\n CHECK_TYPES ... | python | chosen |
[
{
"from": "system",
"value": "Use the `noon` function instead of `sun`.\n\nAll we're doing is check that we can call the function for all locations.\nThis can fail for `sun` but does not for `noon`\n"
},
{
"from": "human",
"value": "from astral.geocoder import all_locations\r\nfrom astral.sun im... | python | chosen |
[
{
"from": "system",
"value": "Increase plenum version to 0.1.158\n"
},
{
"from": "human",
"value": "\"\"\"\nplenum package metadata\n\"\"\"\n__version_info__ = (0, 1, 157)\n__version__ = '{}.{}.{}'.format(*__version_info__)\n__author__ = \"Evernym, Inc.\"\n__license__ = \"Apache 2.0\"\n\n__all__... | python | chosen |
[
{
"from": "system",
"value": "Disable delete_to_trash to prevent an error while deleting\n"
},
{
"from": "human",
"value": "import os\nc.NotebookApp.ip = '*'\nc.MultiKernelManager.kernel_manager_class = 'lc_wrapper.LCWrapperKernelManager'\nc.KernelManager.shutdown_wait_time = 10.0\n\nif 'PASSWOR... | python | chosen |
[
{
"from": "system",
"value": "Add a test for read_magic."
},
{
"from": "human",
"value": "# encoding: utf-8\n# ---------------------------------------------------------------------------\n# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.\n# Distributed under the terms of ... | python | chosen |
[
{
"from": "system",
"value": "Create UserInfoAction that shows the info of the user which the message replies to, or the current user if there is no reply\n"
},
{
"from": "human",
"value": "from bot.action.core.action import Action\nfrom bot.action.standard.info.formatter.chat import ChatInfoFor... | python | chosen |
[
{
"from": "system",
"value": "Test fail because of an import\n"
},
{
"from": "human",
"value": "\"\"\"Django page CMS test suite module\"\"\"\nimport unittest\nfrom pages.tests.test_functionnal import FunctionnalTestCase\nfrom pages.tests.test_unit import UnitTestCase\nfrom pages.tests.test_regr... | python | chosen |
[
{
"from": "system",
"value": "Update extension app to include a M2M\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom cms.extensions import PageExtension, TitleExtension\nfrom cms.extensions.extension_pool import extension_pool\nfrom django.db import models\n\nclass MyPageExtensi... | python | chosen |
[
{
"from": "system",
"value": "Use argparse to enable some options\n\nFix #51\n\nNow, `--debug`, `--port/-p` and `--exposed` are available.\n\nNote that most probably you will have to add `--exposed` to the command\nyou use if you run sipa directly in something like a docker container.\n"
},
{
"from"... | python | chosen |
[
{
"from": "system",
"value": "Rename unused but needed variable\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom flask import Flask, redirect, request\n\nfrom resumable import rebuild, split\n\napp = Flask(__name__)\n\n\n# for the purposes of this demo, we will explicitly pass r... | python | chosen |
[
{
"from": "system",
"value": "Implement test for duplicate rooms\n"
},
{
"from": "human",
"value": "import unittest\nfrom src.dojo import Dojo\n\n\nclass TestCreateRoom (unittest.TestCase):\n\n def setUp(self):\n self.dojo = Dojo()\n self.test_office = self.dojo.create_room(\"of... | python | chosen |
[
{
"from": "system",
"value": "Fix naming of Handler to Reciever\n"
},
{
"from": "human",
"value": "import asynchat\nimport asyncore\nimport socket\n\nclass Handler(asynchat.async_chat):\n def __init__(self, server, (conn, addr)):\n asynchat.async_chat.__init__(self, conn)\n\n se... | python | chosen |
[
{
"from": "system",
"value": "Use sys in error cases.\n"
},
{
"from": "human",
"value": "def format_cols(cols):\n widths = [0] * len(cols[0])\n\n for i in cols:\n for idx, val in enumerate(i):\n widths[idx] = max(len(val), widths[idx])\n\n f = \"\"\n\n t = []\n f... | python | chosen |
[
{
"from": "system",
"value": "Remove white space between print and ()\n\nTrivialFix\n\nChange-Id: I5219e319e9d7e5cc8307e45c60e1e2d2d25d9d5c\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Copyright 2014 Hewlett-Packard Development Company, L.P.\n#\n# Author: Kiall Mac Innes <kiall@hp... | python | chosen |
[
{
"from": "system",
"value": "Add alias to TelePythClient which will be deprecated in the future.\n"
},
{
"from": "human",
"value": "# encoding: utf8\n# __init__.py\n\nfrom telepyth.client import TelePythClient\nfrom telepyth.utils import is_interactive\n\nif is_interactive():\n from tele... | python | chosen |
[
{
"from": "system",
"value": "Improve local import detection in `BaseParser.process_imports`\n"
},
{
"from": "human",
"value": "import abc\nimport os\nimport typing\nimport urllib.parse\n\nif typing.TYPE_CHECKING:\n from ..ontology import Ontology\n\n\nclass BaseParser(abc.ABC):\n\n def __... | python | chosen |
[
{
"from": "system",
"value": "Convert binary string to UTF-8\n"
},
{
"from": "human",
"value": "from flask import Flask\nimport consul\nimport socket\nimport pprint\nimport redis\n\n\n# Consul key\nCONSUL_REDIS_KEY = \"redis\"\n\napp = Flask(__name__)\n\ndef GetRedisFromConsul():\n MyConsul =... | python | chosen |
[
{
"from": "system",
"value": "Add date drill down to coding assignment activity list\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom coding.models import (\n Sample, AssignmentTag, CodingAssignment, CodingAssignmentActivity)\n\n\nclass SampleAdmin(admin.ModelAd... | python | chosen |
[
{
"from": "system",
"value": "Add helper for iterating over months and move date proxy here\n\nthe proxy is now needed by two commands\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport importlib\nimport random\n\nfrom django.conf import settings\n\n\ndef get_handler_instance(set... | python | chosen |
[
{
"from": "human",
"value": "Add South post_migrate signal to work with permission changes\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n\ntry:\n # register a signal do update permissions every migration.\n # This is based on app djang... | python | chosen |
[
{
"from": "system",
"value": "Add additional space before inline comment.\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.utils.safestring import mark_safe\n\nfrom akllt.common import formrenderer\n\nregister = template.Library() # pylint: disable=invalid-name\n\n\n@r... | python | chosen |
[
{
"from": "system",
"value": "Improve test script, report namespaces for stuff missing docstrings"
},
{
"from": "human",
"value": "import types\nfrom mpi4py import MPI\nimport mpiunittest as unittest\n\nModuleType = type(MPI)\nClassType = type(MPI.Comm)\nFunctionType = type(MPI.Init)\nMethodDesc... | python | chosen |
[
{
"from": "system",
"value": "Make a tsv instead of a long string\n"
},
{
"from": "human",
"value": "# Graciously adopted from https://github.com/ucscXena/xenaH5\n#\n# Generates a tsv compatible for making a create table statement from a\n# 10xgenomics HDF5 file.\n#\n# Usage\n#\n# python maketsv... | python | chosen |
[
{
"from": "system",
"value": "Remove \"cmp\" occurences improve folder and file names listing\n"
},
{
"from": "human",
"value": "#-*- coding: utf-8 -*-\n# version string following pep-0396 and pep-0386\n__version__ = '0.9pbs.50' # pragma: nocover\n"
},
{
"from": "gpt",
"value": "#-*... | python | chosen |
[
{
"from": "system",
"value": "Add equality methods to SpatialReference\n"
},
{
"from": "human",
"value": "\"\"\"Spatial reference systems\"\"\"\nfrom osgeo import osr\n\n\nclass BaseSpatialReference(osr.SpatialReference):\n \"\"\"Base class for extending osr.SpatialReference.\"\"\"\n\n def... | python | chosen |
[
{
"from": "system",
"value": "Use new print function (part of patch 1031)\n"
},
{
"from": "human",
"value": "# Remove all the .pyc and .pyo files under ../Lib.\nimport sys\n\n\ndef deltree(root):\n import os\n from os.path import join\n\n npyc = npyo = 0\n for root, dirs, files in os... | python | chosen |
[
{
"from": "system",
"value": "Add test to verify that named_tempfile() overrides the `delete` parameter.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom nose.tools import *\nimport os\nimport time\nfrom dit.utils import cd, named_tempfile, tempdir\n\ndef test_c... | python | chosen |
[
{
"from": "system",
"value": "Add clarification comment to extractor\n\nAdd a comment about the behavior of the extractor when the length of the\n`words` list does not match the lenght of the `points` list. The\nextract will only contain the *shorter* of the two lists and assume\nthey match from the front... | python | chosen |
[
{
"from": "system",
"value": "Add vendor dir to path\n"
},
{
"from": "human",
"value": "\"\"\"\nWSGI config for voteswap project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.9/how... | python | chosen |
[
{
"from": "system",
"value": "Remove metadata from jsonify output name\n"
},
{
"from": "human",
"value": "import sys\nfrom glob import glob\nfrom os.path import basename\nimport json\n\nbook_dir, out_dir = sys.argv[1:3]\n\nfiles = [basename(x).rstrip(\".xhtml\") for x in glob(f\"{book_dir}/*.xht... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Revert \"Remove redundant functions (one too many levels of abstraction)@\"\"\n\nThis reverts commit 34fda0b20a87b94d7413054bfcfc81dad0ecde19.\n"
},
{
"from": "human",
"value": "import amqp\nfrom contextlib import closing\n\n\ndef __get_channel(connection):... | python | chosen |
[
{
"from": "system",
"value": "Add 'targeted_technical_details' TypedField to VictimTargeting\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\n# external\nfrom cybox.core import Observables\n\n# internal... | python | chosen |
[
{
"from": "system",
"value": "Add a .__version__ attribute to package\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2015 Legrand Group\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file excep... | python | chosen |
[
{
"from": "system",
"value": "Remove \"Parse error, \" from error messages\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# php.py - sublimelint package for checking php files\n\nimport re\n\nfrom base_linter import BaseLinter\n\nCONFIG = {\n 'language': 'php',\n 'executable':... | python | chosen |
[
{
"from": "system",
"value": "Remove troublesome function from behave's environ.\n"
},
{
"from": "human",
"value": "from behave import *\nimport server\n\n\ndef before_all(context):\n context.app = server.app.test_client()\n server.initialize_mysql(test=True)\n server.initialize_index()... | python | chosen |
[
{
"from": "system",
"value": "Make plugin more stable by introducing async renaming to alternative name\n"
},
{
"from": "human",
"value": "import sublime_plugin\n\nDEFAULT_NAME = 'Find Results'\nALT_NAME = 'Find Results '\n\n\nclass OpenSearchInNewTab(sublime_plugin.EventListener):\n\n # set ... | python | chosen |
[
{
"from": "system",
"value": "Change username to osf uid\n"
},
{
"from": "human",
"value": "from .apps import OsfOauth2AdapterConfig\nfrom allauth.socialaccount import providers\nfrom allauth.socialaccount.providers.base import ProviderAccount\nfrom allauth.socialaccount.providers.oauth2.provide... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong test case name\n"
},
{
"from": "human",
"value": "import unittest\nfrom frijoles import app\n\n\nclass TamalesAPITestCase(unittest.TestCase):\n def setUp(self):\n self.app = app.test_client()\n\n def test_basic(self):\n res = self.app.g... | python | chosen |
[
{
"from": "system",
"value": "Add a few more cases of \"not value\"\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport unittest\n\nimport pep8\n\n\nclass UtilTestCase(unittest.TestCase):\n def test_normalize_paths(self):\n cwd = os.getc... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Modify copy method into inherit\n"
},
{
"from": "human",
"value": "from openerp import models, fields, api\n\n'''\nThis module is to create model of Course\n'''\n\nclass Course(models.Model):\n '''\n This class create model of Course\n ''... | python | chosen |
[
{
"from": "system",
"value": "Add email tag to fronted deploy failures\n"
},
{
"from": "human",
"value": "\nif alert['resource'].startswith('R1'):\n alert['service'] = [ 'R1' ]\nelif alert['resource'].startswith('R2'):\n alert['service'] = [ 'R2' ]\nelif 'content-api' in alert['resource'].... | python | chosen |
[
{
"from": "system",
"value": "Allow passing arguments through dont_me to tread_on\n"
},
{
"from": "human",
"value": "#!python3\n\nimport os\n\nfrom PIL import Image, ImageDraw, ImageFont\n\nlocaldir = os.path.dirname(__file__)\nBLANK_FLAG = Image.open(os.path.join(localdir, \"dont-tread-on-blank... | python | chosen |
[
{
"from": "system",
"value": "Allow saving via --save CLI parameter\n"
},
{
"from": "human",
"value": "import dont_tread_on_memes\nimport click\n\n\n@click.command()\n@click.option(\"--message\", prompt=\"Don't _____ me: \",\n help=(\"The word or phrase to substitute for 'tread' in ... | python | chosen |
[
{
"from": "system",
"value": "Disable L3 agents scheduler extension in Tempest\n\nChange-Id: Ibc2d85bce9abb821e897693ebdade66d3b9199c3\nCloses-Bug: #1707496\n"
},
{
"from": "human",
"value": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this fil... | python | chosen |
[
{
"from": "system",
"value": "Use max duration when uniform time distribution\n"
},
{
"from": "human",
"value": "import sys\n\nfrom aimes.emgr.utils import *\n\n__author__ = \"Matteo Turilli\"\n__copyright__ = \"Copyright 2015, The AIMES Project\"\n__license__ = \"MIT\"\n\n# --------------------... | python | chosen |
[
{
"from": "system",
"value": "Remove line for debugging which lists object type from elements of listbox\n"
},
{
"from": "human",
"value": "import ConfigParser\nfrom gi.repository import Gtk\nfrom pref_mapping import *\nfrom var import *\n\ndef read_config_if_exists(filename):\n\tif os.path.isfi... | python | chosen |
[
{
"from": "system",
"value": "docs: Fix example of services for IAM Policies\n\nSee also: PSOBAT-1482\n"
},
{
"from": "human",
"value": "\"\"\"Construct an IAM Policy from templates.\n\nExamples:\n pipeline.json:\n\n {\n \"services\": {\n \"dynamodb\": [\n ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.