conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add R_MIPS_JUMP_SLOT and R_MIPS_GLOB_DAT relocations\n"
},
{
"from": "human",
"value": "from . import generic\n\narch = 'MIPS32'\n\nR_MIPS_32 = generic.GenericAbsoluteAddendReloc\nR_MIPS_REL32 = generic.GenericRelativeReloc\nR_MIPS_TLS_DTPMOD32 = generic.GenericTLSM... | python | chosen |
[
{
"from": "system",
"value": "Add very basic logic to figure out supported cipher suites.\n"
},
{
"from": "human",
"value": "import click\n\n\nCONTEXT_SETTINGS = dict(help_option_names=[\"-h\", \"--help\"])\n\n\n@click.command(context_settings=CONTEXT_SETTINGS)\n@click.argument(\"host\", type=cl... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fixed check in test_tornado_connection_call_parent.\" accidentally committed to wrong branch\n\nThis reverts commit 3ca1365eafa63712e6d0dca7f5d6aa134f05d580.\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for pika.adapters.tornado_connection\n\n\"\"\"\nim... | python | chosen |
[
{
"from": "system",
"value": "Implement rollover correctly and a lot more concisely\n"
},
{
"from": "human",
"value": "def n_to_i(num, n):\n \"\"\"\n Translate num, ranging from\n -(n-1)/2 through (n-1)/2\n into an index i from 0 to n-1\n\n If num > (n-1)/2, map it into the interv... | python | chosen |
[
{
"from": "system",
"value": "Fix \"test\" target in Windows\n"
},
{
"from": "human",
"value": "from SCons.Script import *\n\n\ndef run_tests(env):\n import shlex\n import subprocess\n import sys\n\n sys.exit(subprocess.call(shlex.split(env.get('TEST_COMMAND'))))\n\n\ndef generate(en... | python | chosen |
[
{
"from": "system",
"value": "Python: Remove unnecessary statement from example\n"
},
{
"from": "human",
"value": "class ElektraPlugin(object):\n\tdef __init__(self):\n\t\tself.x = 1\n\t\tpass\n\n\tdef open(self, config, errorKey):\n\t\tprint(\"[CLASS-PYTHON-2] open -->\")\n\t\tself.x = self.x +... | python | chosen |
[
{
"from": "system",
"value": "Remove reference to Deadline in window title\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nimport avalon.api\nimport avalon.fusion\n\nimport pyblish_qml\n\n\ndef _install_fusion():\n\n from pyblish_qml import settings\n import pyblish_qml.host as... | python | chosen |
[
{
"from": "system",
"value": "Update `unique_together`. Order matters. Fields are scanned by PostgreSQL in order.\n\nThe first field should be the one most likely to uniquely identify an\nobject.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom icekit.content_collections.abs... | python | chosen |
[
{
"from": "system",
"value": "Fix analogWrite API naming issue\n"
},
{
"from": "human",
"value": "from pygalileo.io.dio import Dio\nfrom pygalileo.io.pwmio import Pwmio\n\n'''\nDefining Digital Pins modes: INPUT, INPUT_PULLUP, and OUTPUT\n'''\nINPUT = 'in'\nOUTPUT = 'out'\n\n'''\nDefining Pin Le... | python | chosen |
[
{
"from": "system",
"value": "Remove relation to user model in order to keep things simpler\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\nABODE_TYPES = (\n ('SH', 'Small house'),\n ('H', 'House'),\n ('SB', 'Small buildin... | python | chosen |
[
{
"from": "system",
"value": "Fix __repl__ implementation for TupleVal\n\n"
},
{
"from": "human",
"value": "from .environment import Environment\n\nfrom viper.parser.ast.nodes import Expr\n\n\nclass Value:\n pass\n\n\nclass TupleVal(Value):\n def __init__(self, *vals: Value):\n self... | python | chosen |
[
{
"from": "system",
"value": "Fix incompatibility with Python 2.6\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import unicode_literals\n\n\"\"\"\nA registry of all documents.\n\"\"\"\n\n_documents_registry = {}\n\n\ndef get_document(name, module=None):\n if module:\n ... | python | chosen |
[
{
"from": "system",
"value": "Use len of set to check for duplicates in list of packages.\n\nResolves: #154.\n\nChecking for equality of the two lists was a mistake, since\nthe order of the list generated from the set is undefined.\n"
},
{
"from": "human",
"value": "# vim:set fileencoding=utf-8\... | python | chosen |
[
{
"from": "system",
"value": "Make UglifyJSFilter docstring more consistent with other filters\n"
},
{
"from": "human",
"value": "\"\"\"Minify Javascript using `UglifyJS <https://github.com/mishoo/UglifyJS/>`_.\n\nUglifyJS is an external tool written for NodeJS; this filter assumes that\nthe ``u... | python | chosen |
[
{
"from": "system",
"value": "Change data param to json\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport requests\nfrom dbaas_services.analyzing.exceptions import ServiceNotAvailable\n\n\nclass AnalyzeService(object):\n def __init__(self, endpoint, healh_check_route, healh_c... | python | chosen |
[
{
"from": "system",
"value": "Make sure {% print %} is always available for you in templates\n"
},
{
"from": "human",
"value": "VERSION = (1, 1, 0)\n"
},
{
"from": "gpt",
"value": "VERSION = (1, 1, 0)\n\n# Make sure the ``{% print %}`` is always available, even without a {% load debu... | python | chosen |
[
{
"from": "system",
"value": "Add options for choices fields, Add new fields to Tutorial model\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom markdownx.models import MarkdownxField\n\n# Create your models here.\n\n\nclass Tutorial(models.Model):\n # ToDo: Fields that ar... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in acme_challenge view (str.join() takes a single iterable, not *args)\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nfrom django.http import HttpResponse\nfrom django.views.generic import TemplateView\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Remove untested checker code path"
},
{
"from": "human",
"value": "def check(process_output, judge_output, **kwargs):\n from six.moves import zip\n process_lines = list(filter(None, process_output.split(b'\\n')))\n judge_lines = list(filter(None, judge_outp... | python | chosen |
[
{
"from": "system",
"value": "Add quick aliases to PD.\n\n\nFormer-commit-id: 6a0680d54cc1d391a351f4d5e8ff72f696d303db [formerly 5fe981c7ed92d45548d3f7ab6abb38d149d0ada2]\nFormer-commit-id: f76e0dc538c182b4978eb54b51cbebafa257ce04"
},
{
"from": "human",
"value": "# coding: utf-8\n# Copyright (c)... | python | chosen |
[
{
"from": "system",
"value": "MAINT: Add a missing subscription slot to `NestedSequence`\n"
},
{
"from": "human",
"value": "\"\"\"\nThis file defines the types for type annotations.\n\nThese names aren't part of the module namespace, but they are used in the\nannotations in the function signatur... | python | chosen |
[
{
"from": "system",
"value": "Bump version for next release\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n__author__ = 'Odoo Community Association (OCA)'\n__email__ = 'support@odoo-community.org'\n__version__ = '1.0.0'\n__doc__ = \"\"\"A library with support functions to be calle... | python | chosen |
[
{
"from": "system",
"value": "Make sure to finish span when there is an exception\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nimport opentracing.ext.tags as ext\nimport instana\nimport opentracing\nimport wrapt\n\n\n@wrapt.patch_function_wrapper('urllib3', 'PoolMan... | python | chosen |
[
{
"from": "system",
"value": "Use consistent arguments for invocation_flow method\n\nTrivial-Fix\nChange-Id: I6481147a722b2f366300f2ac7952ebd94f1a2ada\n"
},
{
"from": "human",
"value": "# Copyright IBM Corp. 2015, 2015 All Rights Reserved\n# Copyright (c) 2010-2016 OpenStack Foundation\n#\n# Lic... | python | chosen |
[
{
"from": "system",
"value": "fix: Fix IndexError: pop from empty list\n\nCreate Linker instance for each run, to bypass html5lib bugs\n\nRefs #15\n"
},
{
"from": "human",
"value": "from bleach.linkifier import Linker\n\nfrom markdown.postprocessors import Postprocessor\nfrom markdown.extensions... | python | chosen |
[
{
"from": "system",
"value": "Fix integration tests on Mint 20\n"
},
{
"from": "human",
"value": "from . import *\n\n\n# MSBuild backend doesn't support generated_source yet.\n@skip_if_backend('msbuild')\nclass TestQt(IntegrationTest):\n def run_executable(self, exe):\n if env.host_pla... | python | chosen |
[
{
"from": "system",
"value": "Add a helper function for exception logging\n"
},
{
"from": "human",
"value": "from twisted.python import log, util\nimport logging\n\n\nclass LevelLoggingObserver(log.FileLogObserver):\n def __init__(self, logfile, logLevel):\n log.FileLogObserver.__init_... | python | chosen |
[
{
"from": "system",
"value": "Test for Travis CI variable a little less recklessly.\n"
},
{
"from": "human",
"value": "import os\nimport unittest\n\nimport tweedr\n\n\nclass TestCredentials(unittest.TestCase):\n def test_mysql(self):\n if 'TRAVIS' in os.environ:\n print 'For... | python | chosen |
[
{
"from": "system",
"value": "Modify subscription handler interface name\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.5\n##\n## @file contextOrientationTCs.py\n##\n## Copyright (C) 2008 Nokia. All rights reserved.\n##\n## \n## \n##\n## Requires python2.5-gobject and python2.5-dbus\n... | python | chosen |
[
{
"from": "system",
"value": "Remove tests or removed Model.setup method\n"
},
{
"from": "human",
"value": "# encoding: utf8\nfrom __future__ import unicode_literals\nimport pytest\nfrom flexmock import flexmock\nfrom hypothesis import given, strategies\nimport abc\n\nfrom .... import base\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "UPDATE TokenPayload pydantic model to support guest flag\n"
},
{
"from": "human",
"value": "# stdlib\nfrom typing import Optional\n\n# third party\nfrom pydantic import BaseModel\n\n\nclass Token(BaseModel):\n access_token: str\n token_type: str\n metadata:... | python | chosen |
[
{
"from": "system",
"value": "Update target count to consider users who subded to `all`\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, redirect\nfrom django.views.generic import View\nfrom django.core.urlresolvers import reverse\nfrom django.contrib import messages\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Make /api/profile return no private data\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\nfrom rest_framework import serializers\n\n\nclass ProfileSerializer(serializers.ModelSerializer):\n... | python | chosen |
[
{
"from": "system",
"value": "Add support for the [img] tag.\n"
},
{
"from": "human",
"value": "from django.http import HttpResponse\nfrom django.shortcuts import render\nfrom django.db import connections\n\nimport bbcode\n\n\ndef dictfetchall(cursor):\n \"Returns all rows from a cursor as a ... | python | chosen |
[
{
"from": "system",
"value": "Fix copy/paste error in Gzip open\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport bz2\nimport gzip\nimport optparse\nimport os\nimport sys\nimport time\n\n\nif __name__ == '__main__':\n # Create the option parser, and give a small usage example.\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"commiting failing dummytest to test CI-setup\"\n\nThis reverts commit eaac3ef8430d0a0c02ebaed82e1e8d27889124a6.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#-*- coding: utf-8 -*-\n\n###########################################################\n# © ... | python | chosen |
[
{
"from": "system",
"value": "Remove time granularity from rcaap\n"
},
{
"from": "human",
"value": "from share.provider import OAIProviderAppConfig\n\n\nclass AppConfig(OAIProviderAppConfig):\n name = 'providers.pt.rcaap'\n version = '0.0.1'\n title = 'rcaap'\n long_title = 'RCAAP - ... | python | chosen |
[
{
"from": "system",
"value": "Add mime types for jpeg, gif.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.template import RequestContext\nfrom django.http import HttpResponse, HttpResponseNotFound\nfrom django.template import Template\nfrom cancer_browser.core.... | python | chosen |
[
{
"from": "system",
"value": "Use analytics name for subreddits if available.\n\nThis allows a catch-all for multis to be used.\n"
},
{
"from": "human",
"value": "from urllib import quote\n\nfrom pylons import c, g\n\nfrom r2.lib.pages import Ads as BaseAds\n\n\nclass Ads(BaseAds):\n def __in... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in polynomial differentiate module\n"
},
{
"from": "human",
"value": "import random\nfrom sympy import *\n\nimport fm.mathengine.problemTypes.problem as problem\n\nclass derivPolynomial(problem.Problem):\n\tterms = [1,2,3,4,5]\n\texponents = [0,1,2,3,4,5,6]\... | python | chosen |
[
{
"from": "system",
"value": "Allow DefconError to contain a report.\n"
},
{
"from": "human",
"value": "class DefconError(Exception): pass"
},
{
"from": "gpt",
"value": "class DefconError(Exception):\n\n _report = None\n\n def _set_report(self, value):\n self._report = v... | python | chosen |
[
{
"from": "system",
"value": "Clean up assert statements and add test for successful commit\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom tests.base import ApiTestCase, fake\n\nimport mock\nfrom nose.tools import * # flake8: noqa\n\nfrom api.base.middleware import TokuTrans... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong module name in migrations\n"
},
{
"from": "human",
"value": "from django.utils.encoding import smart_str\n\nfrom kitsune.products.models import Product\nfrom kitsune.taggit.models import Tag\nfrom kitsune.wiki.models import Document\n\ntags_to_migrate = {\... | python | chosen |
[
{
"from": "human",
"value": "Revert changes to models init\n"
},
{
"from": "gpt",
"value": "from scoring_engine.models.user import User\nfrom scoring_engine.models.service import Service\nfrom scoring_engine.models.account import Account\nfrom scoring_engine.models.property import Property\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Fix bad initial count in slug creation helper"
},
{
"from": "human",
"value": "from django.db import IntegrityError\nfrom django.template.defaultfilters import slugify\n\n\ndef save_obj_with_slug(obj, attribute='title', **kwargs):\n obj.slug = slugify(getattr(obj... | python | chosen |
[
{
"from": "system",
"value": "Move config parsing to plugin, use for SSL keys\n"
},
{
"from": "human",
"value": "from zope.interface import implements\n\nfrom twisted.python import usage\nfrom twisted.plugin import IPlugin\nfrom twisted.application.service import IServiceMaker\nfrom twisted.appl... | python | chosen |
[
{
"from": "system",
"value": "Add \"passwordinput\" to class_converter, because it needs the textInput class too.\n"
},
{
"from": "human",
"value": "from django import template\n\nregister = template.Library()\n\nclass_converter = {\n \"textinput\":\"textinput textInput\",\n \"fileinput\":... | python | chosen |
[
{
"from": "system",
"value": "Put back the trailing / and fix it in the JS model\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom openbudget.apps.projects.views import api\n\n\nurlpatterns = patterns('',\n\n url(r'^$',\n api.ProjectList.as_view(),\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix link previous to TOC and Fix priority\n"
},
{
"from": "human",
"value": "from markdown.extensions import Extension\nfrom markdown_i18n.parser import I18NTreeProcessor\n\n\nclass I18NExtension(Extension):\n\n def __init__(self, **kwargs):\n self.config ... | python | chosen |
[
{
"from": "system",
"value": "Add test for bug involving function definitions that Jordan found.\n"
},
{
"from": "human",
"value": "import unittest\nimport os\n\nimport scipy\n\nfrom SloppyCell.ReactionNetworks import *\n\nfrom AlgTestNets import algebraic_net_assignment\nbase_net = algebraic_ne... | python | chosen |
[
{
"from": "system",
"value": "Use try_update_model in sign in handler instead of dict update.\n"
},
{
"from": "human",
"value": "\"\"\"\n\"\"\"\n\nfrom wheezy.core.collections import attrdict\nfrom wheezy.core.comp import u\nfrom wheezy.security import Principal\nfrom wheezy.web.authorization im... | python | chosen |
[
{
"from": "system",
"value": "[CFG] Put shutter control entirely in the user's hands\n"
},
{
"from": "human",
"value": "from ophyd.controls.area_detector import (AreaDetectorFileStoreHDF5,\n AreaDetectorFileStoreTIFF,\n ... | python | chosen |
[
{
"from": "system",
"value": "8: Create documentation of DataSource Settings \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.... | python | chosen |
[
{
"from": "system",
"value": ": Create documentation of DataSource Settings \n\nTask-Url: "
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.stoettner@stoeps.de\n# Documentation: http://scri... | python | chosen |
[
{
"from": "system",
"value": "Add a little function to make it easier to create users on-the-fly via NIS\n\n\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib.auth.models import User, check_password\nimport crypt\nimport nis\n\nclass NISBackend:\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Allow to override kwargs of filter\n"
},
{
"from": "human",
"value": "from django.views import generic\n\n\nclass FilteredListView(generic.ListView):\n \"\"\"List view with support for filtering and sorting via django-filter.\n\n Usage:\n Set filter_set... | python | chosen |
[
{
"from": "system",
"value": "Refactor applying custom configuration after it is loaded\n\nThe call sending custom_config_loaded is being replaced with direct\ncalls to the functions configure_random_factory and configure_url_validator.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\... | python | chosen |
[
{
"from": "system",
"value": "Use pyenchant and bump to v0.0.2\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup\n\nsetup(\n name='etl_utils',\n version='0.0.1',\n url='http://github.com/mvj3/etl_utils/',\n license='MIT',\n author='David Ch... | python | chosen |
[
{
"from": "system",
"value": "Add another script in install and add a dependency link for pysam\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='MetaSV',\n version='0.1-alpha',\n description='MetaSV: An accurate and integrative struc... | python | chosen |
[
{
"from": "system",
"value": "Update favicon based on UniqueFeed values, not Feed\n"
},
{
"from": "human",
"value": "from optparse import make_option\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand\nfrom django.db import connection\n\nfrom raven import Cl... | python | chosen |
[
{
"from": "system",
"value": "Fix order for 'first to complete' calculation\n"
},
{
"from": "human",
"value": "from optparse import make_option\nimport sys\nfrom django.core.management.base import BaseCommand\nfrom challenge.models import Challenge, UserChallenge\nfrom resources.models import Re... | python | chosen |
[
{
"from": "system",
"value": "Print warning when wurstball downloads fail\n"
},
{
"from": "human",
"value": "import re\nimport socket\nimport urllib\nfrom bs4 import BeautifulSoup\n\n\nWURSTBALL_RE = re.compile(\"^http[s]://wurstball.de/[0-9]+/\")\n\n\ndef default_handler(metadata):\n return ... | python | chosen |
[
{
"from": "system",
"value": "Set project when doing neutron DB migrations\n\nThat way, the default configuration files/dirs from the neutron\nprojects are read when doing the DB migrations.\nThis is useful if eg. some configuration files are in\n/etc/neutron/neutron.conf.d/ . Theses files will then be auto... | python | chosen |
[
{
"from": "system",
"value": "Add tests for sending messages to \"user\" projects\n"
},
{
"from": "human",
"value": "from nose.tools import *\nfrom lamson.testing import *\nimport os\nfrom lamson import server\n\nrelay = relay(port=8823)\nclient = RouterConversation(\"queuetester@localhost\", \"... | python | chosen |
[
{
"from": "system",
"value": "Add stub methods for expected paths\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();\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Reorder imports in UML module\n"
},
{
"from": "human",
"value": "# Here, order matters\nfrom gaphor.UML.uml2 import * # noqa: isort:skip\nfrom gaphor.UML.presentation import Presentation # noqa: isort:skip\nimport gaphor.UML.uml2overrides # noqa: isort:skip\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Fix typo inside of LANGUAGES_SUPPORTED.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n#\n# In here we shall keep track of all variables and objects that should be\n# instantiated only once and be common to pieces of GLBackend code.\n\n__version__ = '... | python | chosen |
[
{
"from": "system",
"value": "[fix] Make dataset directory if it does not exist.\n"
},
{
"from": "human",
"value": "import tarfile\nimport os\nfrom six.moves.urllib import request\n\nurl_dir = 'https://www.cs.toronto.edu/~kriz/'\nfile_name = 'cifar-10-python.tar.gz'\nsave_dir = 'dataset'\ntar_pa... | python | chosen |
[
{
"from": "system",
"value": "Insert plain.tex into REPL state\n"
},
{
"from": "human",
"value": "from nex.state import GlobalState\nfrom nex.reader import Reader, EndOfFile\nfrom nex.lexer import Lexer\nfrom nex.instructioner import Instructioner\nfrom nex.banisher import Banisher\nfrom nex.par... | python | chosen |
[
{
"from": "system",
"value": "Fix doctest - not sure why it was failing on the quotation marks\n"
},
{
"from": "human",
"value": "import re\nimport os\nimport contextlib\n\nfrom . import pipeline\n\n\n@contextlib.contextmanager\ndef maintained_selection():\n comp = pipeline.get_current_comp()... | python | chosen |
[
{
"from": "system",
"value": "Add support for switching dpms\n"
},
{
"from": "human",
"value": "# pylint: disable=C0111,R0903\n\n\"\"\"Enable/disable automatic screen locking.\n\nRequires the following executables:\n * xset\n * notify-send\n\"\"\"\n\nimport bumblebee.input\nimport bumblebe... | python | chosen |
[
{
"from": "system",
"value": "Add simple ndb_persitence Context storage model\n"
},
{
"from": "human",
"value": "\ndef store_async_result(async):\n \"\"\"Persist the Async's result to the datastore.\"\"\"\n pass\n\n\ndef store_async_marker(async):\n \"\"\"Persist a marker indicating the... | python | chosen |
[
{
"from": "system",
"value": "Fix return string from user model\n\n Also return username if there is no email address set\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import AbstractUser\nfrom django.db import models\n\n\nclass Person(AbstractUser):\n description = mode... | python | chosen |
[
{
"from": "system",
"value": "Change subscribed topic and message type\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport rospy\nfrom nav_msgs.msg import Odometry\n\ncurrent_odometry = None\n\ndef get_odometry(message):\n global current_odometry\n current_odometry = message... | python | chosen |
[
{
"from": "system",
"value": "Add normal field to test model\n"
},
{
"from": "human",
"value": "from django.db.models import loading\nfrom django.contrib.gis.db import models\nfrom django.contrib.gis.geos import GEOSGeometry\n\nfrom mapentity.models import MapEntityMixin\n\n\nclass MushroomSpot(... | python | chosen |
[
{
"from": "system",
"value": "Rename print_struct to generate_template and use multi_map\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport json\nimport os\n\nfrom engine import types, consts\n\ntemplate_dir = os.path.join(os.environ['PORTER'], 'templates')\n\nstructs = (\n (t... | python | chosen |
[
{
"from": "system",
"value": "Add brackets around rule ID in parseable format.\n\nThis formatter was supposed to model after the PEP8 format,\nbut was incorrect. The actualy format is:\n\"<filename>:<linenumber>: [<rule.id>] <message>\"\n"
},
{
"from": "human",
"value": "class Formatter:\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix OneToOneField instance check in filter_by_district\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.contrib.auth.models import User\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix default behavior; popup window pref is (for now) stored as a string 'true'/'false', not a python Bool.\n"
},
{
"from": "human",
"value": "import logging\n\nlogger = logging.getLogger(__name__)\n\nKNOWN_PREFS = {'popups': True}\n\nPREF_MAP = {'false': False, 'tru... | python | chosen |
[
{
"from": "system",
"value": "Add OCA as author of OCA addons\n\nIn order to get visibility on https://www.odoo.com/apps the OCA board has\ndecided to add the OCA as author of all the addons maintained as part of the\nassociation.\n"
},
{
"from": "human",
"value": "{\n 'name': 'Base Partner M... | python | chosen |
[
{
"from": "system",
"value": "Fix bad indentation in processor\n"
},
{
"from": "human",
"value": "from datapackage_pipelines.wrapper import process\n\n\ndef process_row(row, row_index,\n spec, resource_index,\n parameters, stats):\n for f in spec['schema']['field... | python | chosen |
[
{
"from": "system",
"value": "Fix capitalization method in class_names\n"
},
{
"from": "human",
"value": "HEADER = \"\"\"/**\n {file_name}\n Auto-generated code - do not modify.\n thinglang C++ transpiler, 0.0.0\n**/\n\"\"\"\n\n\nFOUNDATION_ENUM = HEADER + \"\"\"\n#pragma once\n\n#inclu... | python | chosen |
[
{
"from": "system",
"value": "Add the message during the processing of the response."
},
{
"from": "human",
"value": "from django.contrib import messages\n\nfrom async_messages import get_message\n\n\nclass AsyncMiddleware(object):\n\n def process_request(self, request):\n # Check for ... | python | chosen |
[
{
"from": "system",
"value": "Update : uppercase every input commands\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2012 theo crevon\n#\n# See the file LICENSE for copying permission.\n\nfrom clint.textui import puts, colored\n\nfrom elevator.utils.patterns import... | python | chosen |
[
{
"from": "system",
"value": "Set help text for app logo\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.db import models\n\nfrom solo.models import SingletonModel\nfrom ckeditor.fields import RichTextField\n\nclass Contacto(SingletonModel):\n \"\"\"\n This model st... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Allow running jobsteps to be deallocated\"\n\nThis reverts commit 9b720026722ce92a8c0e05aa041d6e861c5e4e82.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, unicode_literals\n\nfrom changes.api.base import APIView\nfrom c... | python | chosen |
[
{
"from": "system",
"value": "CLI: Support -h as a shortcut for --help\n"
},
{
"from": "human",
"value": "import click\n\n\n@click.group()\ndef main():\n \"\"\"\n Populus\n \"\"\"\n pass\n"
},
{
"from": "gpt",
"value": "import click\n\n\nCONTEXT_SETTINGS = dict(\n # Su... | python | chosen |
[
{
"from": "system",
"value": "Use slugify to filenameify the strings passed in. This should probably live in a test_utils.utils. Too many utils!"
},
{
"from": "human",
"value": "from django.http import HttpResponse\nimport logging\nfrom test_utils.testmaker import Testmaker\n\ndef set_logging(re... | python | chosen |
[
{
"from": "system",
"value": "Add flag to plot_pollutant unit test\n\nalso change assertTrue to assertEqual"
},
{
"from": "human",
"value": "#run the test with default values of df, state and year \n\n\nimport unittest\nfrom plot_pollutants import plot_pollutants\nimport pandas as pd\n\n\ndf = p... | python | chosen |
[
{
"from": "system",
"value": "Clean __main__ + header boiler plate\n\nThen flake8 warnings re: os / sys etc.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Xtriage.py\n# Copyright (C) 2017 Diamond Light Source, Richard Gildea\n#\n# This code is distributed under the BSD license,... | python | chosen |
[
{
"from": "system",
"value": "Raise a warning instead of failing on plugin overwrite\n\nI'm not sure why but my local developer versions of plugins are\nregistering more than once with different names. I think it might be\nbecause I have a difference between the package name and the module\nname. Not sure. ... | python | chosen |
[
{
"from": "system",
"value": "Feature: Handle two arguments while converting to JSON"
},
{
"from": "human",
"value": "'''\nSequential Price-Trend Models: MACD with Price-Bar-Chunk (MDC)\n'''\nimport numpy\nimport json\n\nfrom techmodels.overlays.trend.price.chunk import sign_chunker\nfrom techmo... | python | chosen |
[
{
"from": "system",
"value": "Add util to convert between short and long postId formats\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\ndef strptime(string, fmt='%Y-%m-%dT%H:%M:%S.%f'):\n return datetime.strptime(string, fmt)\n\n# From http://stackoverflow.com/a/14620633\n... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug in caching\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import render_template\n\nfrom cache import cache\nfrom models.person import Person\n\n\n@cache.memoize(24 * 60 * 60)\ndef card(person_or_id, **kwargs):\n\n if isinstanc... | python | chosen |
[
{
"from": "system",
"value": "Remove real database during testing\n"
},
{
"from": "human",
"value": "import pytest\nimport vcr\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\n\nfrom k2catalogue.models import EPIC, create_session\nfrom k2catalogue.simbad import Simbad\... | python | chosen |
[
{
"from": "system",
"value": "Sort codes in ICD 9 parsing example\n"
},
{
"from": "human",
"value": "from clinvoc.icd9 import ICD9CM\n\n# This string describes a set of ICD 9 codes\ncodestring = '745.0-745.3, 745.6*, 746, 747.1-747.49, 747.81, 747.89, 35.8, 35.81, 35.82, 35.83, 35.84'\n\n# Use c... | python | chosen |
[
{
"from": "system",
"value": "Use unabbreviated --quiet-git option in clone test\n"
},
{
"from": "human",
"value": "import unittest\nfrom cvsgit.command.clone import clone\nfrom os.path import dirname, join, exists\nfrom shutil import rmtree\n\nclass Test(unittest.TestCase):\n\n def setUp(sel... | python | chosen |
[
{
"from": "system",
"value": "Remove FakeEnv from Greedy test suite\n"
},
{
"from": "human",
"value": "import unittest\nfrom capstone.policy import GreedyPolicy\nfrom capstone.util import play_match\n\n\nclass FakeEnv(object):\n\n def __init__(self):\n self._actions = []\n\n def cur... | python | chosen |
[
{
"from": "system",
"value": "Fix migration to use actual value instead of non-existing attribute\n"
},
{
"from": "human",
"value": "# Generated by Django 2.2.15 on 2020-09-21 11:38\n\nfrom django.db import migrations\n\nfrom resolwe.flow.utils import iterate_fields\n\n\ndef purge_data_dependenc... | python | chosen |
[
{
"from": "system",
"value": "Correct author list, add OCA\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Guewen Baconnier\n# Copyright 2015 Camptocamp SA\n#\n# This program is free... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.