conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update LogOnlySMTPBackend docstring.\nNot only admin emails are allowed, all approved emails are still sent.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.core.mail.backends.smtp import EmailBackend as SMTPBackend\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Fix so testdata can be loaded when setting up local environment\n"
},
{
"from": "human",
"value": "import random\n\nimport factory\nfrom factory.declarations import SubFactory, SelfAttribute, LazyAttribute\nfrom factory.django import DjangoModelFactory\nfrom faker.f... | python | chosen |
[
{
"from": "system",
"value": "Change UNSET to so bool(UNSET) is False.\n"
},
{
"from": "human",
"value": "# The MIT License\n#\n# Copyright (c) 2010 Jeffrey Jenkins\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation... | python | chosen |
[
{
"from": "system",
"value": "Disable debug mode in default configuration."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nDEBUG = True\nSECRET_KEY = '##CHANGEME##'\nSQLALCHEMY_DATABASE_URI = 'postgresql://massa:secret@localhost/massa'\nSQLALCHEMY_ECHO = False\n"
},
{
"from":... | python | chosen |
[
{
"from": "system",
"value": "Adjust tests for python-monascaclient >= 1.3.0\n\nthe exceptions module was moved out of the openstack.common namespace,\nso try to import the new location first and fall back to the old\none if it doesn't exist.\n\nChange-Id: I3305775baaab15dca8d5e7e5cfc0932f94d4d153\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Deploy Travis CI build 381 to GitHub\n"
},
{
"from": "human",
"value": "\"\"\"Package for PythonTemplateDemo.\"\"\"\n\n__project__ = 'PythonTemplateDemo'\n__version__ = '0.0.0'\n\nVERSION = __project__ + '-' + __version__\n"
},
{
"from": "gpt",
"value": ... | python | chosen |
[
{
"from": "system",
"value": "Add an alias !tous for !all\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n# -*- coding: utf8 -*-\n\nfrom taemin import plugin\n\nclass TaeminCafe(plugin.TaeminPlugin):\n helper = {\"all\": \"Envoie un message à tout le monde\",\n \"cafe\... | python | chosen |
[
{
"from": "system",
"value": "InstallCommand: Remove __init__ method, not needed.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom optparse import make_option\nfrom optparse import OptionParser\nfrom scaffolder import get_minion_path\nfrom scaffolder.core... | python | chosen |
[
{
"from": "system",
"value": "Add more info to the permission denied exception\n"
},
{
"from": "human",
"value": "from django.core.exceptions import PermissionDenied\n\nfrom ...order import models\nfrom ..utils import get_node\nfrom .types import Order\n\n\ndef resolve_orders(info):\n user = ... | python | chosen |
[
{
"from": "system",
"value": "Undo member changes in test\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.contrib.auth.models import User\n\nfrom mks.models import Member\nfrom .models import Suggestion\n\n\nclass SuggestionsTests(TestCase):\n\n def setUp(self... | python | chosen |
[
{
"from": "system",
"value": "Move data back before dropping the column for downgrade\n"
},
{
"from": "human",
"value": "\"\"\"\n\nRevision ID: 0209_email_branding_update\nRevises: 84c3b6eb16b3\nCreate Date: 2018-07-25 16:08:15.713656\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\n\... | python | chosen |
[
{
"from": "system",
"value": "Use @dachary's much clearer regex to validate codenames\n"
},
{
"from": "human",
"value": "from flask_babel import gettext\nfrom flask_wtf import FlaskForm\nfrom wtforms import PasswordField\nfrom wtforms.validators import InputRequired, Regexp, Length\n\nfrom db im... | python | chosen |
[
{
"from": "system",
"value": "Remove linked list class and implement algorithm just using single method\n"
},
{
"from": "human",
"value": "# Given a singly linked list of integers l and an integer k, remove all elements from list l that have a value equal to k\n\nclass Node(object): # define con... | python | chosen |
[
{
"from": "system",
"value": "Use a different default port\n"
},
{
"from": "human",
"value": "from attrs import define, field\nfrom tak import mcts\nimport torch\nfrom typing import Optional\n\n\n@define(slots=False)\nclass Config:\n device: str = \"cuda\"\n server_port: int = 5001\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add PageBegin to pkg exports\n"
},
{
"from": "human",
"value": "#copyright ReportLab Inc. 2000\n#see license.txt for license details\n#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/__init__.py?cvsroot=reportlab\n#$Header: /tmp/reportlab/re... | python | chosen |
[
{
"from": "system",
"value": "Remove spurious reference to self. Remove debugging code.\n"
},
{
"from": "human",
"value": "import sys\nimport unittest\nimport tarfile\n\ntry:\n\t# provide skipIf for Python 2.4-2.6\n\tskipIf = unittest.skipIf\nexcept AttributeError:\n\tdef skipIf(condition, reaso... | python | chosen |
[
{
"from": "system",
"value": "Update our customized jQuery ui widgets\n"
},
{
"from": "human",
"value": "from tw.api import Widget, CSSLink\n\nclass JQueryUITheme(Widget):\n css = [CSSLink(link='/css/jquery-ui/ui.theme.css', modname=__name__)]\n template = ''\n"
},
{
"from": "gpt",... | python | chosen |
[
{
"from": "system",
"value": "Add input and random explainer to utility function.\n"
},
{
"from": "human",
"value": "\nfrom .base import *\n\nfrom .gradient_based import *\nfrom .misc import *\nfrom .pattern_based import *\nfrom .relevance_based import *\n\n\ndef create_explainer(name,\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove debugging statements and provide support for Python 2.7\n"
},
{
"from": "human",
"value": "import redis\n\n\nclass RedisPersist:\n _redis_connection = None\n\n def __init__(self, host=\"localhost\", port=6379, db=0):\n self._redis_connection = re... | python | chosen |
[
{
"from": "system",
"value": "Improve subject and text of URL report email\n"
},
{
"from": "human",
"value": "from django.contrib.sites.models import Site\nfrom django.core.mail import mail_managers\nfrom django.core.management.base import NoArgsCommand\nfrom django.core.urlresolvers import reve... | python | chosen |
[
{
"from": "system",
"value": "Modify migration file to include meta data changes\n\nThe OIDCBackChannelLogoutEvent model's meta data was changed in commit\nf62a72b29f. Although this has no effect on the database, Django still\nwants to include the meta data in migrations. Since this migration file\nisn't ye... | python | chosen |
[
{
"from": "system",
"value": "Fix copypaste error in card definitions\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\nclass OG_151:\n\t\"Tentacle of N'Zoth\"\n\tdeathrattle = Hit(ALL_MINIONS, 1)\n"
},
{
"from": "gpt",
"value": "from ..utils import *\n\n... | python | chosen |
[
{
"from": "system",
"value": "Raise ValueError explicitly from __call__ rather than with super()\n\nbecause super() would make another lookup, but we already know the value isn't there.\n"
},
{
"from": "human",
"value": "from enum import Enum, EnumMeta\nfrom functools import total_ordering\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Simplify invalid decode warning text\n\nThe string is already displayed in the error text, so there's no\nreason to duplicate it.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport base32_crockford\nimport logging\n\nfrom django.db.... | python | chosen |
[
{
"from": "system",
"value": "Fix inner exec syntax error in python 2.7\n"
},
{
"from": "human",
"value": "import unittest\n\nimport sys\n\nfrom tests.utils import requires_python_version\n\n\nclass TestTreeTrace(unittest.TestCase):\n maxDiff = None\n\n @requires_python_version(3.5)\n d... | python | chosen |
[
{
"from": "system",
"value": "Add test for property setter\n"
},
{
"from": "human",
"value": "import typing\n\nfrom trafaretrecord import TrafaretRecord\n\n\ndef test_initialization():\n class A(TrafaretRecord):\n a: int\n b: str\n c: typing.List[int]\n\n tmp = A(a=1, ... | python | chosen |
[
{
"from": "system",
"value": "Handle plugin load errors in a helpful way.\n\nOn catching an ImportError, we make a dummy/stub subcommand that\nsits in the list of subcommands as expected and reports the error\nthere.\n"
},
{
"from": "human",
"value": "# main: loader of all the command entry poin... | python | chosen |
[
{
"from": "system",
"value": "Add test cases for product.\n"
},
{
"from": "human",
"value": "import httpretty\n\nfrom paystackapi.tests.base_test_case import BaseTestCase\nfrom paystackapi.product import Product\n\n\n# class TestProduct(BaseTestCase):\n\n# \t@httpretty.activate\n# \tdef test_val... | python | chosen |
[
{
"from": "system",
"value": "Fix spelling test name spelling error\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.test import TestCase\n\nfrom .model_factories import AttributeF\n\nfrom ..models import AttributeArchive\n\n\nclass TestModelAttributeArchive(TestCase):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update migration script for users whose usernames aren't in emails field\n\nOSF-5462\n\nPreviously the script only migrated users who had an empty emails\nfield. This updates the script to also handle users whose username\nisn't in the emails field, even when the emails field i... | python | chosen |
[
{
"from": "system",
"value": "[fix] Use ForeignKey instead of OneToOneField for event organizer\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.conf import settings\n\n# Create your models here.\n#Events :\n# Des users peuvent participer à un event\n# Les gens ... | python | chosen |
[
{
"from": "system",
"value": "Fix a problem reported by Greg Ward and pointed out by John Machin when doing:\n\n return (need_quotes) and ('\"%s\"' % text) or (text)\n\nThe following warning was generated:\n\n Using a conditional statement with a constant value (\"%s\")\n\nThis was because eve... | python | chosen |
[
{
"from": "system",
"value": "Update GeoTIFF cleanup to cleanup .zip\n\n"
},
{
"from": "human",
"value": "from django.conf import settings\nimport os\nimport os.path\nimport time\nimport re\nfrom celery.task import task\n\n@task\ndef cleanup_temp_tif_files(age=7200):\n temp_dir = settings.DAT... | python | chosen |
[
{
"from": "system",
"value": "Add import of django-annoying patch\n"
},
{
"from": "human",
"value": "# This module contains built-in introspector plugins for various common\n# Django apps.\n\n# These imports trigger the lower-down files\nimport south.introspection_plugins.geodjango\nimport south... | python | chosen |
[
{
"from": "system",
"value": "Address review concerns: allow range requirements, specify requirments file path explicitly, ...\n"
},
{
"from": "human",
"value": "import os\nimport re\n\n\ndef update_pins(setup_args):\n # Use requirements and constraints to set version pins\n packages = set... | python | chosen |
[
{
"from": "system",
"value": "Update Star plugin to use new caching API\n\n"
},
{
"from": "human",
"value": "import urllib.request\nimport urllib.error\nimport json\nimport plugin\nimport command\nimport message\nimport os\n\ndef onInit(plugin):\n star_command = command.command(plugin, 'star'... | python | chosen |
[
{
"from": "human",
"value": "Add detection support for bottle.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, unicode_literals, division\n\n\ndef is_available(*capacities):\n \"\"\"\n Detects if the environment is available for use in\n ... | python | chosen |
[
{
"from": "system",
"value": "Create a test to expose the bug\n"
},
{
"from": "human",
"value": "\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"\n\n... | python | chosen |
[
{
"from": "system",
"value": "Store more data about a mod in the registry\n"
},
{
"from": "human",
"value": "import modinfo\n\nclass Mod():\n \"\"\"The Mod class\n\n This is supposed to act like a superclass for mods.\n Execution order is as follows:\n mod_load -> mod_complete\n \... | python | chosen |
[
{
"from": "system",
"value": "Fix import errors from implicit-relative imports.\n"
},
{
"from": "human",
"value": "from case_conversion import (\n camelcase, pascalcase, snakecase, dashcase, kebabcase, spinalcase,\n constcase, dotcase, separate_words, slashcase, backslashcase)\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Add forward/reverse mapping of checkerstati\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nfrom checker.local import LocalChecker as BaseChecker\n#from checker.contest import ContestChecker as BaseChecker\n\nOK = 0\nTIMEOUT = 1\nNOTWORKING = 2\nNOTFOUND = ... | python | chosen |
[
{
"from": "system",
"value": "Remove 2.3 and 2.4 from CI pipeline\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nfrom jinja2 import Template\n\nclusters = ['2_3', '2_4', '2_5', '2_6']\n# Commenting out this as we only have one example and it breaks\ntiles = [] # [d for d ... | python | chosen |
[
{
"from": "system",
"value": "Optimize DB access: use of prefetch_related()\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\n\ndef retrieve_in_order_from_db(model, ids):\n \"\"\"\n Retrieve entities of the given model from the RDBMS in... | python | chosen |
[
{
"from": "system",
"value": "Add a codebase generator to the Github web hoook handler,\nto map the URL to the repo name for use as the codebase.\n"
},
{
"from": "human",
"value": "from buildbot.status.web.hooks.github import GitHubEventHandler\nfrom twisted.python import log\nimport abconfig\n\... | python | chosen |
[
{
"from": "system",
"value": "Revert to try cleanest solution\n"
},
{
"from": "human",
"value": "import sys;s='%s: lines %d, RaSa: %d'\ndef u(z):\n r=I=0;b=1\n for m in open(z):\n r+=1\n for k in m:\n if '{'==k:b+=1\n if ';'==k:I+=b\n if '}'==k:b-=1\n return(r,I)\nc=D=0\nfor z in sys.arg... | python | chosen |
[
{
"from": "system",
"value": "Remove unneeded import from testing."
},
{
"from": "human",
"value": "from django.core.exceptions import ValidationError\nfrom django.core.validators import MinValueValidator, MaxValueValidator\nfrom django.db import models\nfrom netaddr import AddrFormatError, EUI,... | python | chosen |
[
{
"from": "system",
"value": "Add is_active() method to the Baro class\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nimport utils\n\nclass Baro:\n \"\"\"This class contains info about the Void Trader and is initialized with\n data in JSON format\n\n \"\"\"\n\n d... | python | chosen |
[
{
"from": "system",
"value": "Update retrieve() for FoodMenu data\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport json, os, requests\nfrom models import db, FoodMenu, FoodServices\n\nkey = os.environ.get('UWOPENDATA_APIKEY')\n\ndef getData(service):\n\tpayload = {'key': key, 'se... | python | chosen |
[
{
"from": "system",
"value": "Change user activation complete URL to avoid conflicts\n\nBecause a separate django app is overriding 'accounts/activate/w+'\n'accounts/activate/complete' was never being hit.\n\nFixes #1133\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns\nf... | python | chosen |
[
{
"from": "system",
"value": "Fix minor typing issue in union find test.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_union_find\n----------------------------------\n\nTests for `python_algorithms.union_find` module.\n\"\"\"\n\nimport unittest... | python | chosen |
[
{
"from": "system",
"value": "Return ProjectSearchSerializer on ProjectResourceViewSet if action != 'Create'\n"
},
{
"from": "human",
"value": "from ovp_projects import serializers\nfrom ovp_projects import models\n\nfrom ovp_users import models as users_models\n\nfrom rest_framework import mixi... | python | chosen |
[
{
"from": "system",
"value": "Allow kiva.quartz to be imported on non-darwin platforms without error.\n"
},
{
"from": "human",
"value": "# :Author: Robert Kern\n# :Copyright: 2004, Enthought, Inc.\n# :License: BSD Style\n\nfrom mac_context import get_mac_context\n\n\ndef get_macport(dc):\n ... | python | chosen |
[
{
"from": "system",
"value": "Set new developer version `0.2.2`\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport pkg_resources\n\npkg_resources.declare_namespace(__name__)\n\nVERSION = (0, 2, 1)\n\n__version__ = \".\".join(map(str, VERSION))\n__status__ =... | python | chosen |
[
{
"from": "system",
"value": "Add a low-level database API\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Andre Anjos <andre.anjos@idiap.ch>\n# Thu 23 Jun 20:22:28 2011 CEST\n# vim: set fileencoding=utf-8 :\n\n\"\"\"The db package contains simplified APIs to access data for various ... | python | chosen |
[
{
"from": "system",
"value": "Use field.to_python to do django type conversions on the field before checking if dirty.\n\nThis solves issues where you might have a decimal field that you write a string to, eg:\n>>> m = MyModel.objects.get(id=1)\n>>> m.my_decimal_field\nDecimal('1.00')\n>>> m.my_decimal_fiel... | python | chosen |
[
{
"from": "system",
"value": "Add note to gcp session utils method\n"
},
{
"from": "human",
"value": "\"\"\"Session management utilities for Google Cloud Platform (GCP).\"\"\"\nfrom typing import Optional, Any\n\ntry:\n import google.auth\n from google.auth.transport import requests as goo... | python | chosen |
[
{
"from": "system",
"value": "Fix use of 'json' instead of 'j'\n\nThis bug was created when switching from simplejson to json module,\ndue to python 2.5->2.7 migration. Any variables named 'json' needed\nto be renamed, and this is an instance that was missed.\n"
},
{
"from": "human",
"value": "i... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug in LogType that broke migrations creation\n"
},
{
"from": "human",
"value": "# -*- encoding: UTF-8 -*-\n\nfrom enum import IntEnum\n\n\nclass LogType(IntEnum):\n CVN_STATUS = 0\n AUTH_ERROR = 1\n\nLOG_TYPE = (\n (LogType.CVN_STATUS, 'CVN_STATUS'),... | python | chosen |
[
{
"from": "system",
"value": "Add ci parameter to get_ci() and push_ci() methods.\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nimport types\nimport config\n\n\nclass Driver(object):\n\n def __init__(self):\n self.driver_type = self.__class__.__name__\n # Get credentials ... | python | chosen |
[
{
"from": "system",
"value": "Make the default setting retrieval more elegant.\n"
},
{
"from": "human",
"value": "import bcrypt\nfrom django.contrib.auth.models import User\nfrom django.conf import settings\n\n\ntry:\n rounds = settings.BCRYPT_ROUNDS\nexcept AttributeError:\n rounds = 12\n... | python | chosen |
[
{
"from": "system",
"value": "Rename Connection transmit function to process for use in IPFGraph\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport ioport\n\nclass Connection(object):\n \"\"\" Connection class for IPFBlock\n \n Connection binding OPort and IPort of... | python | chosen |
[
{
"from": "system",
"value": "Add version option to CLI.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\n\"\"\"\nThe entry point of csft.\n\"\"\"\n\nimport argparse as ap\nfrom os.path import isdir\n\nfrom .csft import print_result\n\n\ndef main(argv=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove chaves do redis referentes a votaçãoi\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom django.core.management.base import BaseCommand\nfrom ...models import Poll, Option\n\n\nclass Command(BaseCommand):\n\n def handle(self, *args, **kwargs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update Django catch-all URL path to not catch URLs with a . in them.\n\nThis makes missing JS files 404 properly instead of returning the HTML 404 page which confuses the parser.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url, include\nfrom rest... | python | chosen |
[
{
"from": "system",
"value": "Revert string -> integer change for statsd port\n\nTurns out they want a string...\n"
},
{
"from": "human",
"value": "\"\"\"\n bux_grader_framework\n ~~~~~~~~~~~~~~~~~~~~\n\n A framework for bootstraping of external graders for your edX course.\n\n :copy... | python | chosen |
[
{
"from": "system",
"value": "Remove extraneous setting of masked fill value.\n\n\n\ngit-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@115 979d6bd5-6d4d-0410-bece-f567c23bd345\n"
},
{
"from": "human",
"value": "import numpy\n# This gives a nicer printout for masked arrays.\nnumpy.ma.default_r... | python | chosen |
[
{
"from": "system",
"value": "Update Python agent version to include fixes for broken pipe issues.\n\nPiperOrigin-RevId: 315750638\n"
},
{
"from": "human",
"value": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file e... | python | chosen |
[
{
"from": "system",
"value": "Add script to create the recruiting class.\n"
},
{
"from": "human",
"value": "import random\nfrom models import Player\n\ndef create_players():\n\t#TODO: Need to centralize this function call.\n\trandom.seed(123456789)\n\n\t# TODO: Do we need to delete all?\n\tPlaye... | python | chosen |
[
{
"from": "system",
"value": "Add timeit to measure each python implementation of problem 2\n"
},
{
"from": "human",
"value": "def sum_even_fibonacci_numbers_1():\n f1, f2, s, = 0, 1, 0,\n while f2 < 4000000:\n f2, f1 = f1, f1 + f2\n if f2 % 2 == 0:\n s += f2\n ... | python | chosen |
[
{
"from": "system",
"value": "Rename the related name for User one-to-one relationship\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext as _\nfrom Django.contrib.auth.models import User\n\nFEMALE = 'F'\nMALE = 'M'\n\n\nclass Teacher(m... | python | chosen |
[
{
"from": "system",
"value": "Add get_users method to get a list of users\n"
},
{
"from": "human",
"value": "import requests\n\nclass ApiClient:\n def __init__(self, host, username, password):\n self.uri = host + '/nexus/service/local/'\n self.username = username\n self.p... | python | chosen |
[
{
"from": "system",
"value": "Add simple helper properties to Problem.\n"
},
{
"from": "human",
"value": "from src.data import meta\n\n\nclass Problem(object):\n def __init__(self, name, lines):\n self.name = name\n self.lines = lines\n self._solutions = None\n self._constraints = [... | python | chosen |
[
{
"from": "system",
"value": "Add debugging statements to example_app context.\nThis is to help indicate to users that PALE's example_app is operating.\n"
},
{
"from": "human",
"value": "import flask\n\nfrom pale.adapters import flask as pale_flask_adapter\nfrom pale.config import authenticator,... | python | chosen |
[
{
"from": "system",
"value": "Fix tests failing with Python 3\n"
},
{
"from": "human",
"value": "import json\n\nfrom django.test import TestCase\n\nfrom rest_framework import status\n\nfrom tests.models import TestModel\n\n\nclass ProxyPaginationTests(TestCase):\n \"\"\"\n Tests for drf-pr... | python | chosen |
[
{
"from": "system",
"value": "Attach as_jsonapi to models for easy serialization\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\n\nregistry = {}\nbound_registry = {}\n\n\ndef register(cls):\n registry[cls.api_type] = cls\n return cls\n\n\ndef bind(parent=None,... | python | chosen |
[
{
"from": "system",
"value": "Make examples resizable by default\n"
},
{
"from": "human",
"value": "import os\n\nimport moderngl_window as mglw\n\n\nclass Example(mglw.WindowConfig):\n gl_version = (3, 3)\n title = \"ModernGL Example\"\n window_size = (1280, 720)\n aspect_ratio = 16 ... | python | chosen |
[
{
"from": "system",
"value": "Split up lines to pass the linter"
},
{
"from": "human",
"value": "from operator import itemgetter\n\nmapping = {\n 'has_header': True,\n 'currency': 'EUR',\n 'delimiter': ';',\n 'bank': 'GLS Bank',\n 'account': itemgetter('Kontonummer'),\n 'date':... | python | chosen |
[
{
"from": "system",
"value": "Add views for deck CRUD\n"
},
{
"from": "human",
"value": "from django.http import HttpResponse\n\n\ndef index(request):\n return HttpResponse(\"Hallo Welt!\")"
},
{
"from": "gpt",
"value": "# coding=utf-8\n# TODO: User authentication\nfrom django.con... | python | chosen |
[
{
"from": "system",
"value": "Fix db engine name for SQLAlchemy 1.4\n"
},
{
"from": "human",
"value": "import os\n#: Database backend\nSECRET_KEY = 'testkey'\nSQLALCHEMY_DATABASE_URI = 'postgres:///boxoffice_testing'\nSERVER_NAME = 'boxoffice.travis.dev:6500'\nBASE_URL = 'http://' + SERVER_NAME\... | python | chosen |
[
{
"from": "system",
"value": "Convert gcode now houses all files.\n"
},
{
"from": "human",
"value": "import os\nimport sys\nlib_path = os.path.abspath('../')\nsys.path.append(lib_path)\n\nimport s3g\n\n#input_file = '../doc/gcode_samples/skeinforge_single_extrusion_snake.gcode'\n#input_file = '.... | python | chosen |
[
{
"from": "system",
"value": "Remove vestigial (?) \"woo\" default for article slug and title fields.\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 ... | python | chosen |
[
{
"from": "system",
"value": "Remove setting REPORT_TYPE. Reformatted code. Remove ANYBAR_COLOR_FAIL.\n"
},
{
"from": "human",
"value": "{\n 'REPORT_TYPE': 'HTML',\n 'REPORT_RECIPIENTS': 'steven.knight@cashstar.com',\n\n 'JENKINS_USERNAME': 'sknight',\n 'JENKINS_API_TOKEN': '594849... | python | chosen |
[
{
"from": "system",
"value": "Clarify current behavior regarding inheritance\n"
},
{
"from": "human",
"value": "from django.views.generic.base import View\n\nfrom mock import MagicMock\n\nfrom ..permissions import is_location_safe, location_safe\n\n\n@location_safe\ndef safe_fn_view(request, dom... | python | chosen |
[
{
"from": "system",
"value": "Allow assembler to be imported from eodatasets3 root\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nfrom __future__ import absolute_import\n\nfrom ._version import get_versions\n\nREPO_URL = \"https://github.com/GeoscienceAustralia/eo-datasets.git\"\n\n__versi... | python | chosen |
[
{
"from": "system",
"value": "Build random path using os.path.join\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\ntry:\n from django.utils.encoding import force_text\nexcept ImportError:\n # Django < 1.5\n from django.utils.encoding import force_unicode as... | python | chosen |
[
{
"from": "system",
"value": "Fix result loading for novel mutations\n"
},
{
"from": "human",
"value": "from models import Protein, Mutation\n\n\nclass SearchResult:\n\n def __init__(self, protein, mutation, is_mutation_novel, type, **kwargs):\n self.protein = protein\n self.mut... | python | chosen |
[
{
"from": "system",
"value": "Add missing parent for WorkflowAwareModel\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom yawf.config import INITIAL_STATE\nfrom yawf.base_model import WorkflowAwareModelBase\n\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Add interrupt signal handler in non-debug mode\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport signal\nimport sys\nfrom app.main import app, queues, sched\n\n\ndef _teardown(signal, frame):\n sched.shutdown(wait=False)\n for queue... | python | chosen |
[
{
"from": "system",
"value": "fix(tests): Include static file-related tests in 'test' package.\n"
},
{
"from": "human",
"value": "from .test_routes import *\nfrom .test_tenants import *\nfrom .test_cache import *\n"
},
{
"from": "gpt",
"value": "from .files import *\nfrom .staticfile... | python | chosen |
[
{
"from": "system",
"value": "Boost should be referenced automatically by silicium\n"
},
{
"from": "human",
"value": "from conans import ConanFile, CMake\n\nclass ConanUsingSilicium(ConanFile):\n\tsettings = \"os\", \"compiler\", \"build_type\", \"arch\"\n\trequires = \"Boost/1.59.0@lasote/stabl... | python | chosen |
[
{
"from": "system",
"value": "Add shim to new widgets repository.\n"
},
{
"from": "human",
"value": "\"\"\"\nShim to maintain backwards compatibility with old IPython.html imports.\n\"\"\"\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\ni... | python | chosen |
[
{
"from": "system",
"value": "Make code a little cleaner\n"
},
{
"from": "human",
"value": "from extraction.core import ExtractionRunner\nfrom extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult\nimport os\nimport sys\nimport grobid\nimport pdfbox\nimport filters\n\nif ... | python | chosen |
[
{
"from": "system",
"value": "Split out gpg key list into its own class\n\nThis will make it easy to break out into a module when we need it. In\nthe process, window was also set to be in the center of the user's\nscreen.\n"
},
{
"from": "human",
"value": "import gi\nimport gnupg # Requires pyt... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Use namedtuple's getattr rather than indexing\"\n\nThis reverts commit 5c4f93207c1fbfe9b9a478082d5f039a9e5ba720.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\nimport json\nimport requests\nfrom flask import send_from_directory, Resp... | python | chosen |
[
{
"from": "system",
"value": "Add extra point to include start\n"
},
{
"from": "human",
"value": "from linegenerator import LineGenerator\nimport math as m\n\n\nclass StepLineGenerator(LineGenerator):\n\n def __init__(self, name, units, start, end, step):\n\n num = int(m.floor((end - s... | python | chosen |
[
{
"from": "system",
"value": "Add pypi + github to metadata\n"
},
{
"from": "human",
"value": "__title__ = 'libvcs'\n__package_name__ = 'libvcs'\n__description__ = 'vcs abstraction layer'\n__version__ = '0.3.0'\n__author__ = 'Tony Narlock'\n__email__ = 'tony@git-pull.com'\n__license__ = 'MIT'\n_... | python | chosen |
[
{
"from": "system",
"value": "Add a b1 version tag\n\n--HG--\nextra : rebase_source : 637fbf8294dbe0881c87b4bfeea547303dc8ec96\n"
},
{
"from": "human",
"value": "name = \"WSME\"\nversion = \"0.4\"\n\ndescription = \"\"\"Web Services Made Easy makes it easy to \\\nimplement multi-protocol webserv... | python | chosen |
[
{
"from": "system",
"value": "Optimize from 5-6s to 2.9-3.0\n"
},
{
"from": "human",
"value": "import base\nfrom blocks import Blocks\nimport re\n\nclass Sentences(base.Base):\n _type = 'sentences'\n child_class = Blocks\n\n @staticmethod\n def parse(text):\n #re.split('\\!|\\... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Switch to tuple for pref set data key list\"\n\nThis reverts commit 302d9797b7ccb46e7b9575513c0a2c5461e156a5.\n"
},
{
"from": "human",
"value": "# yvs.set_pref\n# coding=utf-8\n\nfrom __future__ import unicode_literals\n\nimport json\nimport sys\n\nimport y... | python | chosen |
[
{
"from": "system",
"value": "Disable vSTATIC version during DEBUG\n\nwhen DEBUG is set we serve static files with max-age of zero which is\nhopefully good enough. Adding to the querystring is messing up chrome\ndevelopment workflow (breakpoints are associated with full uri,\nincluding querystring).\n"
},... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.