conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add whitespace to trigger travis\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages, Command\n\nversion = __import__('eemeter').get_version()\n\nlong_description = \"Standard methods for calculating energy efficiency savings.\"\n\nclass P... | python | chosen |
[
{
"from": "system",
"value": "Update my contacts and the copyright.\n"
},
{
"from": "human",
"value": "# vim:fileencoding=utf-8\n# Copyright (c) gocept gmbh & co. kg\n# See also LICENSE.txt\n\nimport os.path\nfrom setuptools import setup, find_packages\n\n\nsetup(\n name='pycountry',\n ver... | python | chosen |
[
{
"from": "system",
"value": "Replace url with multiple project urls\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\"\"\"\nInstall the wakeonlan module.\n\n\"\"\"\nfrom setuptools import setup\n\n\nwith open('README.rst') as f:\n readme = f.read()\n\nset... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in ParticleSorter initialization\n"
},
{
"from": "human",
"value": "from hoomd.operation import _Tuner\nfrom hoomd.parameterdicts import ParameterDict\nfrom hoomd.typeconverter import OnlyType\nfrom hoomd.trigger import Trigger\nfrom hoomd import _hoomd\nfro... | python | chosen |
[
{
"from": "system",
"value": "Remove dependency links for pybloom.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name = 'fastqp',\n provides = 'fastqp',\n version = \"0.1.5\",\n author = 'Matthew Shirley',\n author_email = 'mdshw... | python | chosen |
[
{
"from": "system",
"value": "Use the same packages for installing with pip and distutils\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nversion = '0.1'\n\nsetup(name='mamba',\n version=version,\n description=\"\",\n long_description=open('README... | python | chosen |
[
{
"from": "system",
"value": "Remove progressbar as a requirement\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distribute_setup import use_setuptools\nuse_setuptools()\n\nfrom setuptools import setup\n\nimport re\nmain_py = open('morfessor.py').read()\nmetadata = dict(re.find... | python | chosen |
[
{
"from": "system",
"value": "Add migrations to package. Bump version.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:\n README = readme.read()\n\n# allow setup.py to be run from any path\... | python | chosen |
[
{
"from": "system",
"value": "Update troposphere & awacs to latest releases\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\nimport glob\n\nVERSION = \"0.6.3\"\n\nsrc_dir = os.path.dirname(__file__)\n\ninstall_requires = [\n \"troposphere>=1.2.2\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add missing dependency on pandas\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nversion = '0.2.dev0'\n\nlong_description = '\\n\\n'.join([\n open('README.rst').read(),\n open('CREDITS.rst').read(),\n open('CHANGES.rst').read(),\n ])\n... | python | chosen |
[
{
"from": "system",
"value": "Install the plotting template, too.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(\n name='Lobster',\n version='1.0',\n description='Opportunistic HEP computing tool',\n author='Anna Woodard, Matthias W... | python | chosen |
[
{
"from": "system",
"value": "Add classifiers for pypi, update version number.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom setuptools import setup\n\nsetup(\n name='pyroaring',\n version='0.0.2',\n description='Fast and lightweight set for unsigned 32 bits integers... | python | chosen |
[
{
"from": "system",
"value": "Add egg suffix for pyopenworm install dependency\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='ChannelWorm',\n packages=[\n 'channelworm',\n 'channelworm.ion_channel',\n 'channelworm.digitizer',\n ... | python | chosen |
[
{
"from": "system",
"value": "Upgrade deps to latest point releases\n\n- nose 1.3.0 to 1.3.1\n- Sphinx 1.2.1 to 1.2.2\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='tangled',\n version='0.1a7.dev0',\n description='Tangled namespace and utilities',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings to jwt handlers"
},
{
"from": "human",
"value": "import jwt\nfrom rest_framework_jwt.settings import api_settings\n\n\ndef jwt_payload_handler(user):\n # The handler from rest_framework_jwt removed user_id, so this is a fork\n payload = {\n ... | python | chosen |
[
{
"from": "system",
"value": "Disable date_hierarchy for now since it requires tzinfo in MySQL\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.contrib import admin\nfrom .models import Project, Repository, Change, Builder, Build\n\nclass ProjectAdmin(admin.ModelAdmin):\n ... | python | chosen |
[
{
"from": "system",
"value": "Change MARA_XXX variables to functions to delay importing of imports (requires updating mara-app to 2.0.0)\n"
},
{
"from": "human",
"value": "from mara_db import config, views, cli\n\nMARA_CONFIG_MODULES = [config]\n\nMARA_NAVIGATION_ENTRY_FNS = [views.navigation_en... | python | chosen |
[
{
"from": "system",
"value": "Remove some more ST2 specific code\n\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nimport sublime\nimport traceback\n\nST3 = int(sublime.version()) >= 3000\n\nif ST3:\n from markdown import Markdown, util\n from markdown.extensions... | python | chosen |
[
{
"from": "system",
"value": "[Telemetry] Set facebook_crendentials_backend_2's url to https\n\nTBR=tonyg@chromium.org\n\nBUG=428098\n\nReview URL: https://codereview.chromium.org/688113003\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#301945}\n"
},
{
"from": "human",
"value"... | python | chosen |
[
{
"from": "system",
"value": "Add unit test to pass Trigger instance.\n"
},
{
"from": "human",
"value": "import unittest\n\nimport mock\n\nfrom chainer import testing\nfrom chainer.training import extensions\n\n\n@testing.parameterize(\n {'trigger': ('epoch', 2)},\n {'trigger': ('iteration... | python | chosen |
[
{
"from": "system",
"value": "Fix `prompt_from_list` misbehaving with nonlist_validator\n"
},
{
"from": "human",
"value": "import click\n\n\ndef prompt_from_list(options, prompt, nonlist_validator=None):\n for i, option in enumerate(options, 1):\n click.echo('{number} {name} {descripti... | python | chosen |
[
{
"from": "system",
"value": "Add new Flask MethodView called CreateUnikernel\n"
},
{
"from": "human",
"value": "from flask import Module, jsonify\nfrom flask.views import MethodView\n\nfrom core.api.decorators import jsonp\n\napi = Module(\n __name__,\n url_prefix='/api'\n)\n\n\ndef jsoni... | python | chosen |
[
{
"from": "system",
"value": "Clean up the upgrader logic and add a config option for it\n"
},
{
"from": "human",
"value": "from flask_sqlalchemy import SQLAlchemy\nfrom flask_alembic import Alembic\n\ndb = SQLAlchemy()\nalembic = Alembic()\n\ndef init_db():\n # import all modules here that m... | python | chosen |
[
{
"from": "system",
"value": "Save the session-key as a unicode string in the db\n\nThe session-key should be saved as a string, not a byte string.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nimport os\nimport binascii\n\n\nclass Preferences:\n\n defaults = [\n (\"s... | python | chosen |
[
{
"from": "system",
"value": "Exclude Videos article and non-scrapable info-galleries and picture-galleries via URL-pattern\n"
},
{
"from": "human",
"value": "from baseparser import BaseParser\nfrom BeautifulSoup import BeautifulSoup, Tag\n\n\nclass RPOParser(BaseParser):\n domains = ['www.rp... | python | chosen |
[
{
"from": "system",
"value": "Remove tests depending on pyglet entirely\n"
},
{
"from": "human",
"value": "import unittest\nimport os\n\nimport pywavefront.texture\nimport pywavefront.visualization # power of two test\n\n\ndef prepend_dir(file):\n return os.path.join(os.path.dirname(__file__... | python | chosen |
[
{
"from": "system",
"value": "Increase size of `password` column"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport sys\nfrom sqlalchemy import create_engine\nfrom sqlalchemy import Column, Integer, String\nfrom sqlalchemy.ext.declarative import declarative_base\n\nSQLALCHEMY_DAT... | python | chosen |
[
{
"from": "system",
"value": "Use gmpy2 instead of numpy\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim: set fileencoding=UTF-8 :\n\n\nimport numpy as np\n\n\ndef get_exponent(v):\n if isinstance(v, np.float32):\n mask, shift, offset = 0x7f800000, 23, 127\n else:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add CSV folder setting comment\n"
},
{
"from": "human",
"value": "import os\nimport re\n\nfrom imap import EmailCheckError, EmailServer\nfrom postgresql import DatabaseServer\n\n\nCSV_FOLDER = os.getcwd()\n\n# Values come from `EMAIL_SUBJECT_RE`.\nCSV_NAME_FORMAT = ... | python | chosen |
[
{
"from": "system",
"value": "Add -c option to continue if one file has a SyntaxError\n"
},
{
"from": "human",
"value": "import sys\nimport getopt\n\nfrom compiler import compile, visitor\n\ndef main():\n VERBOSE = 0\n DISPLAY = 0\n opts, args = getopt.getopt(sys.argv[1:], 'vqd')\n f... | python | chosen |
[
{
"from": "system",
"value": "Enable sort keys in json dumps to make sure json is stable\n"
},
{
"from": "human",
"value": "from lxml import objectify, etree\nimport simplejson as json\nfrom converter.nsl.nsl_converter import NslConverter\nfrom converter.nsl.other.nsl_other_converter import NslO... | python | chosen |
[
{
"from": "human",
"value": "Update custom permissions after migration\n"
},
{
"from": "gpt",
"value": "# register a signal do update permissions every migration.\n# This is based on app django_extensions update_permissions command\nfrom south.signals import post_migrate\n\ndef update_permission... | python | chosen |
[
{
"from": "system",
"value": "Update failure key in test\n\nSigned-off-by: Zane Burstein <0b53c6e52ca2d19caefaa4da7d81393843bcf79a@anchore.com>\n"
},
{
"from": "human",
"value": "class TestOversizedImageReturns400:\n # Expectation for this test is that the image with tag is greater than the v... | python | chosen |
[
{
"from": "system",
"value": "Check handling of simple rows.\n"
},
{
"from": "human",
"value": "from unittest import TestCase\n\nfrom markdown import Markdown\n\nfrom mdx_attr_cols import AttrColTreeProcessor\n\n\nclass TestAttrColTreeProcessor(TestCase):\n def mk_processor(self, **conf):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use `logging` instead of printing to stdout by default.\n"
},
{
"from": "human",
"value": "import time\nfrom django import db\nfrom django.core.management.base import BaseCommand\nfrom optparse import make_option\n\n\nclass CronBaseCommand(BaseCommand):\n help = ... | python | chosen |
[
{
"from": "system",
"value": "Comment out modules with broken tests.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport unittest\nimport doctest\nimport sys\nfrom optparse import OptionParser\n\nfrom firmant.utils import get_module\n\n# Import this now to avoid it throwing errors.\nimp... | python | chosen |
[
{
"from": "system",
"value": "Make test runner only run basis tests\n\nand not dependecies tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nfrom optparse import OptionParser\nfrom os.path import abspath, dirname\nfrom django.test.simple import DjangoTestSuiteRunner\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add whole image as an input\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2\n# -*- coding: utf-8 -*-\n\npixval = {\n 'hair': 10,\n 'head': 20,\n 'upper': 30,\n 'arms': 40,\n 'lower': 50,\n 'legs': 60,\n 'feet': 70\n}\n\ngroups = [\n [10... | python | chosen |
[
{
"from": "system",
"value": "Hide expiry date field from job post create page\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom .models import Job\n\n\nclass JobForm(forms.ModelForm):\n\n # class Meta:\n # model = Job\n # fields = ('title', 'creator',)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Change from camelcase to underscores.\n"
},
{
"from": "human",
"value": "import numpy\n\n\"\"\"\nBoard represents a four in a row game board.\n\nAuthor: Isaac Arvestad\n\"\"\"\nclass Board:\n \"\"\"\n Initializes the game with a certain number of rows\n and... | python | chosen |
[
{
"from": "system",
"value": "Add is_active to category serializer\n"
},
{
"from": "human",
"value": "from categories.models import Category, Keyword, Subcategory\nfrom rest_framework import serializers\n\n\nclass SubcategoryListSerializer(serializers.ModelSerializer):\n class Meta:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add registry settings to scheduler\n"
},
{
"from": "human",
"value": "from polyaxon.config_settings.k8s import *\nfrom polyaxon.config_settings.dirs import *\nfrom polyaxon.config_settings.spawner import *\nfrom .apps import *\n"
},
{
"from": "gpt",
"val... | python | chosen |
[
{
"from": "system",
"value": "Handle geojson feature without latlon\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Define your item pipelines here\n#\n# Don't forget to add your pipeline to the ITEM_PIPELINES setting\n# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.h... | python | chosen |
[
{
"from": "system",
"value": "Use a sortable list instead of a dictionary of values for the return value\n"
},
{
"from": "human",
"value": "import os\nimport json\n\nfrom kitchen.settings import KITCHEN_LOCATION\n\ndef load_data(data_type):\n retval = {}\n nodes_dir = os.path.join(KITCHEN_... | python | chosen |
[
{
"from": "system",
"value": "Update regexp to detect magic comment\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport re\n\n__version__ = '0.1.0'\n\n\nclass CodingChecker(object):\n name = 'flake8_coding'\n version = __version__\n\n def __init__(self, tree, filename):... | python | chosen |
[
{
"from": "system",
"value": "Rework blog license add-on urls\n"
},
{
"from": "human",
"value": "\"\"\"\nURLCONF for the blog app.\n\"\"\"\n\nfrom django.conf.urls import url\n\nfrom . import views, feeds\n\n\n# URL patterns configuration\nurlpatterns = (\n\n # License index page\n url(r'^... | python | chosen |
[
{
"from": "system",
"value": "Use ISO formatted time stamps\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module is for generating fake game data for use with the API.\n\nAn example of some game data::\n\n {\n \"id\": 1,\n \"logURL\": \"http://derp.nope/\",\n \"winner\"... | python | chosen |
[
{
"from": "system",
"value": "Make the build script P2/3 compatible\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nimport os\nimport stat\nimport zipfile\nimport StringIO\n\npackage_dir = 'xyppy'\npython_directive = '#!/usr/bin/env python'\n\npacked = StringIO.StringIO()\npacked_wr... | python | chosen |
[
{
"from": "system",
"value": "Make fields on model have defaults value\n\nLike who cares for their default value\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.test import TestCase\nfrom django.utils.baseconv import base64\nfrom django_base64field.fields import Base... | python | chosen |
[
{
"from": "system",
"value": "Move allowed data types out of search and fix for bills\n"
},
{
"from": "human",
"value": "class Transforms:\n\tconvert_rules = {\n\t\t\"committee\": {\n\t\t\t\"id\": \"id\",\n\t\t\t\"title\": \"name\",\n\t\t\t\"description\": [\"info\", \"about\"]\n\t\t},\n\t\t\"co... | python | chosen |
[
{
"from": "system",
"value": "Send and Connect frame tests\n"
},
{
"from": "human",
"value": "import unittest\nfrom Decode import Decoder\nimport Frames\n\nclass TestDecoder(unittest.TestCase):\n def setUp(self):\n self.decoder = Decoder()\n\n def test_decoder_get_frame_class(self):... | python | chosen |
[
{
"from": "system",
"value": "Add tests for ValueError and TypeError\n"
},
{
"from": "human",
"value": "import sys\nfrom socket import htonl, inet_ntoa\nfrom struct import pack\n\nimport pytest\n\nfrom arpreq import arpreq\n\n\ndef test_localhost():\n assert arpreq('127.0.0.1') == '00:00:00:0... | python | chosen |
[
{
"from": "system",
"value": "Allow users with the permission 'blog.can_read_private' to see posts from the future.\n"
},
{
"from": "human",
"value": "from lithium.blog.models import Post\n\ndef decorator(request, view, author=None, tag=None, *args, **kwargs):\n \"\"\"\n A view decotator t... | python | chosen |
[
{
"from": "system",
"value": "Add test for unicode characters\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport unittest\n\nimport mlbgame\n\n\nclass TestObject(unittest.TestCase):\n \n def test_object(self):\n data = {\n 'string': 'string',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add options to generate single executable file"
},
{
"from": "human",
"value": "from distutils.core import setup\nimport py2exe\n\nsetup(console=['process.py'])\n"
},
{
"from": "gpt",
"value": "from distutils.core import setup\nimport py2exe, sys\n\nsys.... | python | chosen |
[
{
"from": "system",
"value": "Make client a global variable\n"
},
{
"from": "human",
"value": "from raven import Client\n\nclient = None\n\ndef get_client(ctx):\n if client:\n return client\n dsn = ctx.teuthology_config.get('sentry_dsn')\n if dsn:\n client = Client(dsn=dsn... | python | chosen |
[
{
"from": "system",
"value": "Add links to admin dashboard\n"
},
{
"from": "human",
"value": "from django.utils.translation import ugettext_lazy as _\nfrom grappelli.dashboard import modules, Dashboard\n\n\nclass UQAMDashboard(Dashboard):\n def __init__(self, **kwargs):\n Dashboard.__i... | python | chosen |
[
{
"from": "system",
"value": "Fix for html escaped characters\n"
},
{
"from": "human",
"value": "import re\nimport requests\nimport logging\n\nfrom base import BaseBot\n\nlogger = logging.getLogger(__name__)\n\nCHUCK_API_URL = 'http://api.icndb.com'\nCHUCK_REGEX = re.compile(r'^!chuck')\n\ndef r... | python | chosen |
[
{
"from": "system",
"value": "Use __builtins__ directly instead of import __builtin__.\n"
},
{
"from": "human",
"value": "import __builtin__\n\nfrom disco import util\nfrom discodb import DiscoDB, Q\n\ndef open(url, task=None):\n if task:\n disco_data = task.disco_data\n ddfs_da... | python | chosen |
[
{
"from": "system",
"value": "Update comment and optional instructions\n"
},
{
"from": "human",
"value": "import sys\n\nfrom starlette.requests import Request\nfrom starlette.types import Receive, Scope, Send\n\nimport rollbar\nfrom .requests import store_current_request\nfrom rollbar.contrib.as... | python | chosen |
[
{
"from": "system",
"value": "Add a guess about tRNA\n"
},
{
"from": "human",
"value": "MAPPING = {\n \"RNase_MRP_RNA\": None,\n \"RNase_P_RNA\": None,\n \"SRP_RNA\": None,\n \"Y_RNA\": None,\n \"antisense_RNA\": None,\n \"autocatalytically_spliced_intron\": None,\n \"guide_... | python | chosen |
[
{
"from": "system",
"value": "Rename local Firefox options variable\n"
},
{
"from": "human",
"value": "import capybara\nfrom capybara.tests.suite import DriverSuite\n\n\n@capybara.register_driver(\"selenium_marionette\")\ndef init_selenium_marionette_driver(app):\n from selenium.webdriver.com... | python | chosen |
[
{
"from": "system",
"value": "Fix 691 - HTML not getting decoded properly by Middleware in Django 2.2\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.core.exceptions import MiddlewareNotUsed\nfrom django.utils.encoding import DjangoUnicodeDecodeError\nfr... | python | chosen |
[
{
"from": "system",
"value": "Handle a missing dictionary exception\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport argparse\nfrom glob import glob\nimport random\nimport os.path\nfrom contextlib import contextmanager\n\n@contextmanager\ndef cd(path):\n old_dir = os.getcwd()\n os.... | python | chosen |
[
{
"from": "system",
"value": "Add a little bit more documentation for round2submission script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport opensim as osim\n\nfrom osim.redis.client import Client\nfrom osim.env import *\nimport numpy as np\nimport argparse\nimport os\n\n\"\"... | python | chosen |
[
{
"from": "system",
"value": "Add Repository.triggers backref to look up Triggers\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\n\nTRIGGER_TYPES = (\n ('manual', 'Manual'),\n ('commit', 'Commit'),\n ('tag', 'Tag'),\n ('pr',... | python | chosen |
[
{
"from": "system",
"value": "Allow \"-\" as a char in a filename\n"
},
{
"from": "human",
"value": "'''Constants used by TRender.\n\n:copyright: 2015, Jeroen van der Heijden (Transceptor Technology)\n'''\n\n\nLINE_IF = 1\nLINE_ELSE = 2\nLINE_ELIF = 4\nLINE_END = 8\nLINE_MACRO = 16\nLINE_COMMENT... | python | chosen |
[
{
"from": "system",
"value": "report.clipped_list: Add option to limit the number of lookups\n"
},
{
"from": "human",
"value": "def plural(s, number):\n return s.format(number=number, s=\"s\" if number % 100 != 1 else \"\")\n\n\ndef plural_w(s, number, capitalize=False):\n numbers = (\"zer... | python | chosen |
[
{
"from": "system",
"value": "Install initscript link into /etc/init.d. Allows for system integration while the original file can still be modified\n"
},
{
"from": "human",
"value": "import os\n\nfrom fabric.api import put, task\n\nfrom fablib import authbind, requires_root\nfrom fablib.twisted ... | python | chosen |
[
{
"from": "system",
"value": "manage.py: Add arguments skylines-host and -port\n"
},
{
"from": "human",
"value": "import logging\nfrom ognskylines.gateway import ognSkylinesGateway\nfrom ognskylines.dbutils import session\n\nfrom manager import Manager\ngateway_manager = Manager()\n\n\n@gateway_... | python | chosen |
[
{
"from": "system",
"value": "Update Flask-WTF imports to >0.9.0-style\n"
},
{
"from": "human",
"value": "from flask.ext.wtf import Form, TextField, PasswordField, BooleanField, validators\nfrom models import User\n\n\nclass LoginForm(Form):\n username = TextField('username', [validators.Requ... | python | chosen |
[
{
"from": "system",
"value": "Fix route function to support positional args\n"
},
{
"from": "human",
"value": "from django.views.decorators.csrf import csrf_exempt\nimport json\n\n\ndef route(**kwargs):\n @csrf_exempt\n def routed(request, **kwargs2):\n method = request.method\n ... | python | chosen |
[
{
"from": "system",
"value": "Update: Update Version to 0.0.3 caused by pypi's limit\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup, find_packages\n\nHERE = os.path.abspath(os.path.dirname(__file__))\n\ninstall_requires = (\n \"argparse\",\n \"six>=1.10.0\",\n... | python | chosen |
[
{
"from": "system",
"value": "Add checks for username/password/serverid being defined\n"
},
{
"from": "human",
"value": "import requests\n\nfrom . constants import BASE_URL\nfrom . exceptions import SocketLabsUnauthorized\n\n\nclass SocketLabs():\n\n def __init__(self, username=None, password... | python | chosen |
[
{
"from": "system",
"value": "Use get_success_url to work around reverse_lazy issue on Python3.\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse_lazy\nfrom vanilla import ListView, CreateView, DetailView, UpdateView, DeleteView\nfrom .forms import {{ cookiecutter.m... | python | chosen |
[
{
"from": "system",
"value": "Tidy matching lists by name\n"
},
{
"from": "human",
"value": "from nextactions.list import List\n\n\nclass Board:\n\n def __init__(self, trello, json):\n self._trello = trello\n self.id = json['id']\n self.name = json['name']\n self.n... | python | chosen |
[
{
"from": "system",
"value": "Resolve NameError, add changeable turtle shape constant.\n"
},
{
"from": "human",
"value": "from turtle import *\n\nGROESSE = 0.5\nFARBE = \"red\"\nFAERBEN = True\n\nfillcolor(FARBE)\n\ndef zeichneKerze(brennt):\n pd()\n begin_fill()\n forward(GROESSE*100)\... | python | chosen |
[
{
"from": "system",
"value": "Update the version to 0.3.0.\n"
},
{
"from": "human",
"value": "# _ _\n# ___ _ __ ___ ___ | |_ ___ ___ | |___\n# / __| '_ ` _ \\/ __| | __/ _ \\ / _ \\| / __|\n# \\__ \\ | | | | \\__ \\ | || (_) | (_) | \\__ \\\n# |__... | python | chosen |
[
{
"from": "system",
"value": "Add a test for pgcode\n\n\ngit-svn-id: ace7fa9e7412674399eb986d17112e1377537c44@4665 95a46c32-92d2-0310-94a5-8d71aeb3d4b3\n"
},
{
"from": "human",
"value": "from sqlobject import *\nfrom sqlobject.dberrors import DuplicateEntryError\nfrom sqlobject.tests.dbtest impo... | python | chosen |
[
{
"from": "system",
"value": "Remove top-level import of timeseries module\n"
},
{
"from": "human",
"value": "# Capture the original matplotlib rcParams\nimport matplotlib as mpl\n_orig_rc_params = mpl.rcParams.copy()\n\n# Import seaborn objects\nfrom .rcmod import *\nfrom .utils import *\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Adjust metrics test to set up/tear down database\n"
},
{
"from": "human",
"value": "\"\"\"\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\ndef test_metrics(make_admin_app):\n client = _get_test_client(make_... | python | chosen |
[
{
"from": "system",
"value": "Update format placeholder to be 2.6 compatible\n"
},
{
"from": "human",
"value": "import pytest\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\n\nfrom k2catalogue import detail_object\n\n\n@pytest.mark.parametrize('input,expected', [\n ... | python | chosen |
[
{
"from": "system",
"value": "Use random file names inplace of the original file names\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, request, jsonify\nfrom werkzeug.utils import secure_filename\nimport os\n\napp = Flask(__name__)\napp.config.from_object('config.Deb... | python | chosen |
[
{
"from": "human",
"value": "Add BACKENDS_NAMESPACE constant so it's consistent with auth backends.\n"
},
{
"from": "gpt",
"value": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additi... | python | chosen |
[
{
"from": "system",
"value": "Update documentation links to Django 1.9\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# This file is execfile()d with the current directory set to its containing\n# directory.\n\nimport os\nimport sys\n\nsys.path.append(os.path.join(os.path.abspath... | python | chosen |
[
{
"from": "system",
"value": "Add the new change feed module to __all__\n"
},
{
"from": "human",
"value": "from model_parser import ModelParser, getFileString\n\n__all__=['ModelParser', 'getFileString']\n"
},
{
"from": "gpt",
"value": "# !/usr/bin/python\n# Copyright 2011 Lockheed Ma... | python | chosen |
[
{
"from": "system",
"value": "Add text commands hook for other plugins"
},
{
"from": "human",
"value": "import sublime_plugin\n\nclass OpenSearchInNewTab(sublime_plugin.EventListener):\n\tdef on_deactivated(self, view):\n\t\tif view.name() == 'Find Results':\n\t\t\t# set a name with space\n\t\t\... | python | chosen |
[
{
"from": "system",
"value": "Apply options defined in user settings to the formatting command\n"
},
{
"from": "human",
"value": "from .command import Command\nfrom .settings import Settings\n\n\nclass Formatter(object):\n def __init__(self, name=None, source=None, binary=None):\n self... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Use HTTPS to retrieve ranking from DBB\"\n\nNot using HTTPS avoids certificate errors.\n\nThis ranking data is not sensitive, so it should be fine to continue as\nbefore the original change.\n"
},
{
"from": "human",
"value": "\"\"\"\ndbbrankingparser.httpcl... | python | chosen |
[
{
"from": "system",
"value": "Fix a couple trivial bugs.\n"
},
{
"from": "human",
"value": "class UnitId:\n def __init__(self, playerId, unitSubId):\n self.playerId = playerId\n self.subId = unitSubId\n\n def __eq__(self, rhs):\n return self.playerId == rhs.playerId... | python | chosen |
[
{
"from": "system",
"value": "Add missing `svn:eol-style : native` prop, which prevented making clean patches against the early 0.9b1 archives (now both the .zip and the .tar.gz have CRLFs for this file)\n\ngit-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@2214 af82e41b-90c4-0310-8c96-b1721e28e2e2\n"
}... | python | chosen |
[
{
"from": "system",
"value": "Fix class name in template loader check"
},
{
"from": "human",
"value": "from django.core.checks import register, Warning\nfrom django.template.loader import get_template, TemplateDoesNotExist\n\n\nW001 = Warning(\n 'You must add \"admin_tools.template_loaders.Te... | python | chosen |
[
{
"from": "system",
"value": "Allow filtering of registrations by complete status.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom commoner.registration.models import PartialRegistration\n\nclass PartialRegistrationAdmin(admin.ModelAdmin):\n\n pass\n\nadmin.site.regi... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Bump Python binding to 0.4.0\"\n\nThis reverts commit d46e582186ee0fdc30f52319b2bb2cfca1a7d59b.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nwith open('README.md') as file:\n long_description = file.read()\n\nsetup(\n... | python | chosen |
[
{
"from": "system",
"value": "Use plain Python list for urlpatterns.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.conf.urls import patterns, url\n\nfrom markitup.views import apply_filter\n\nurlpatterns = patterns(\n '',\n url(r'preview/$', appl... | python | chosen |
[
{
"from": "system",
"value": "[client] Change idna stub to use python's default\n\nFix a regression from 690b8ae29be2ca3b4782fa6ad0e7f2454443c38d which broke\nselect bots running inside docker.\n\nThe new stub is still simpler than https://pypi.org/project/idna/ and lighter\nweight but much better than igno... | python | chosen |
[
{
"from": "system",
"value": "Check submission names more leniently\n\nFixes #55\n"
},
{
"from": "human",
"value": "from django.core.validators import RegexValidator\nfrom django.core.exceptions import ValidationError\nfrom dulwich.repo import check_ref_format\n\nimport re\n\nsha1_validator = Re... | python | chosen |
[
{
"from": "system",
"value": "Support layout on template endpoints\n"
},
{
"from": "human",
"value": "from dataclasses import dataclass\nfrom datetime import datetime\n\n\n@dataclass\nclass AuthResponse:\n email: str\n image_access: bool\n search_access: bool\n created: datetime\n ... | python | chosen |
[
{
"from": "system",
"value": "Rename Criminal Justice to Law & Order, per Emily's request\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\n\nfrom topics.models import Topic\n\n\nclass Command(BaseCommand):\n help = u'Bootstrap the topic lists in the data... | python | chosen |
[
{
"from": "system",
"value": "Exclude user name from api\n"
},
{
"from": "human",
"value": "from .models import Record, HarvestedRecord, AllRecords\nfrom django.contrib.auth.models import User\nfrom rest_framework import serializers\nimport datetime\n\n\nclass AllRecordsSerializer(serializers.Mo... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.