conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add PlayTime class and tie it to user profiles\n\nCreated a PlayTime class in account with from and to times.\nAdded ManyToManyField to UserProfile to keep track of play times.\n"
},
{
"from": "human",
"value": "from django.db import models\r\nfrom django.contrib.au... | python | chosen |
[
{
"from": "system",
"value": "Set up server/client once for the netcode test\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Run from Cryptchat\n# python3 -m unittest discover\n\nimport unittest\nfrom ..network.networkhandler import NetworkHandler\nfrom ..cr... | python | chosen |
[
{
"from": "system",
"value": "Add latest TorchVision models on fastai"
},
{
"from": "human",
"value": "from torchvision.models import ResNet,resnet18,resnet34,resnet50,resnet101,resnet152\nfrom torchvision.models import SqueezeNet,squeezenet1_0,squeezenet1_1\nfrom torchvision.models import dense... | python | chosen |
[
{
"from": "system",
"value": "Fix capitalization in test path\n"
},
{
"from": "human",
"value": "import cdent.test\n\nimport cdent.parser.cdent.yaml\nimport cdent.parser.perl6\n\nclass TestPythonParser(cdent.test.TestCase):\n\n def test_parse_perl6(self):\n parser = cdent.parser.perl6.... | python | chosen |
[
{
"from": "system",
"value": "Make new settings test not run for xcode generator.\n\nTBR=evan\nReview URL: http://codereview.chromium.org/7472006\n\ngit-svn-id: e7e1075985beda50ea81ac4472467b4f6e91fc78@970 78cadc50-ecff-11dd-a971-7dbc132099af\n"
},
{
"from": "human",
"value": "#!/usr/bin/env pyt... | python | chosen |
[
{
"from": "system",
"value": "lib: Fix staticfiles lookups on Heroku\n"
},
{
"from": "human",
"value": "from compressor.filters.base import CompilerFilter\nfrom compressor.filters.css_default import CssAbsoluteFilter\n\n# Work around the fact that django-compressor doesn't succeed in running the... | python | chosen |
[
{
"from": "system",
"value": "Fix read the docs failure\n"
},
{
"from": "human",
"value": "DEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': 'test.db',\n }\n}\nUSE_TZ = False\nSITE_ID = 1\n\nSTATIC_URL = '... | python | chosen |
[
{
"from": "system",
"value": "Support hiding note and notebook template notes\n"
},
{
"from": "human",
"value": "#\n# Copyright (c) 2009 Brad Taylor <brad@getcoded.net>\n#\n# This program is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Affero General Publ... | python | chosen |
[
{
"from": "system",
"value": "Add func_scope to embedding functions\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\nfrom ..flags import FLAGS\nfrom ..variable import variable\n\n\n\ndef embeddings(*, id_space_size, embedding_size, name=None):\n return variable([id_space_size, embe... | python | chosen |
[
{
"from": "system",
"value": "Add namespace to support djangoCMS v3\n"
},
{
"from": "human",
"value": "from cms.app_base import CMSApp\nfrom cms.apphook_pool import apphook_pool\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass EventsApphook(CMSApp):\n name = _(\"Events Apph... | python | chosen |
[
{
"from": "system",
"value": "Allow dots in module names.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.conf.urls.static import static\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfro... | python | chosen |
[
{
"from": "system",
"value": "Replace placeholders in completion text\n\nIn deoplete source, replace the placeholders with the neosnippet format.\n"
},
{
"from": "human",
"value": "import re\nfrom .base import Base\n\n\nCompleteResults = \"g:LanguageClient_completeResults\"\n\n\ndef simplify_sni... | python | chosen |
[
{
"from": "system",
"value": "Change contention counts on front-page\n"
},
{
"from": "human",
"value": "FEATURED_CONTENT_COUNT = 30\nNEWS_CONTENT_COUNT = 30\nUPDATED_CONTENT_COUNT = 30\n\nMAX_PREMISE_CONTENT_LENGTH = 300"
},
{
"from": "gpt",
"value": "FEATURED_CONTENT_COUNT = 50\nNEW... | python | chosen |
[
{
"from": "system",
"value": "Make sure plugins' .name property gets set\n"
},
{
"from": "human",
"value": "# Copyright 2013 John Reese\n# Licensed under the MIT license\n\nimport importlib\nimport os\n\nfrom functools import lru_cache\nfrom os import path\n\nfrom .base import Plugin\n\n@lru_cac... | python | chosen |
[
{
"from": "system",
"value": "Remove xfail from working test\n"
},
{
"from": "human",
"value": "# trivial_example.py\n#\n# Copyright 2014 BitVault.\n#\n# Reproduces the tests in trivial_example.rb\n\n\nfrom __future__ import print_function\n\nimport pytest\nfrom random import randint\n\n\nfrom p... | python | chosen |
[
{
"from": "system",
"value": "Raise error on unknown job type\n"
},
{
"from": "human",
"value": "import yaml\n\nfrom ssbench.constants import *\n\nclass Worker:\n def __init__(self, queue):\n queue.use(STATS_TUBE)\n self.queue = queue\n\n def go(self):\n job = self.que... | python | chosen |
[
{
"from": "system",
"value": "Switch version label to comply with semver"
},
{
"from": "human",
"value": "from frontend import *\nimport tools\n\nversion = \"0.0.1.dev\"\n__version__ = version\n"
},
{
"from": "gpt",
"value": "from frontend import *\nimport tools\n\nversion = \"0.0.1-... | python | chosen |
[
{
"from": "system",
"value": "Set model instance attributes based on fields\n"
},
{
"from": "human",
"value": "import persistent\nimport indexable\nimport exceptions\n\n\nclass Model(persistent.Persistent):\n \"\"\"\n Data model to easily create indexable persistent objects.\n If an obj... | python | chosen |
[
{
"from": "system",
"value": "BUG: Fix version import and test runner\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"See LONG_DESC.txt\"\"\"\n\n# Set up the version\nfrom pkg_resources import get_distribution, DistributionNotFound\n\ntry... | python | chosen |
[
{
"from": "system",
"value": "Correct order of constraint assignment and problem solution\n"
},
{
"from": "human",
"value": "import pulp\nfrom typing import Sequence\nimport conference_scheduler.parameters as params\n\n\ndef is_valid_schedule(schedule):\n \"\"\"Validate an existing schedule a... | python | chosen |
[
{
"from": "system",
"value": "Increment version 0.3.1 -> 0.4.0"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport sys\n\n__version__ = '0.3.1'\n__author__ = 'D-Wave Systems Inc.'\n__authoremail__ = 'acondello@dwavesys.com'\n__description__ = 'A shared API for binar... | python | chosen |
[
{
"from": "system",
"value": "Test getting comment for Mime type\n"
},
{
"from": "human",
"value": "from xdg import Mime\nimport unittest\nimport os.path\nimport tempfile, shutil\n\nimport resources\n\nclass MimeTest(unittest.TestCase):\n def test_get_type_by_name(self):\n appzip = Mim... | python | chosen |
[
{
"from": "system",
"value": "Split the parsing of input and the exporting of the variables for\nreuse\n"
},
{
"from": "human",
"value": "import json\nimport os\n\n\ndef set_environment_variables(json_file_path):\n \"\"\"\n Read and set environment variables from a flat json file.\n\n B... | python | chosen |
[
{
"from": "system",
"value": "Add source admin in Admin Opps Core\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom opps.core.admin.channel import *\nfrom opps.core.admin.profile import *\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom opps.core.admin.ch... | python | chosen |
[
{
"from": "system",
"value": "Add more diagnostics to the courseware import warning\n"
},
{
"from": "human",
"value": "#pylint: disable=missing-docstring\nfrom __future__ import absolute_import\n\nimport warnings\n\nif __name__ == 'courseware':\n warnings.warn(\"Importing 'lms.djangoapps.cour... | python | chosen |
[
{
"from": "system",
"value": "Add the parsing arguments function\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nimport client_wrap\n\ndef get_keys(client):\n key_str = client.GetKeys()\n keys = key_str.split (';')\n del keys[-1]\n\n if len(keys) == 0:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add dummy foreground/background color menu\n"
},
{
"from": "human",
"value": "\ntry:\n\tfrom sexy import SpellEntry as _SpellEntry\nexcept ImportError:\n\tfrom gtk import Entry as _SpellEntry\n\nclass SpellEntry(_SpellEntry):\n\n\t__gtype_name__ = \"SpellEntry\"\n\n... | python | chosen |
[
{
"from": "system",
"value": "Tidy up upload response a bit\n"
},
{
"from": "human",
"value": "import os.path\n\nfrom flask import request, jsonify, redirect, url_for\n\nfrom IATISimpleTester import app, db\nfrom IATISimpleTester.models import SuppliedData\n\n\n@app.route('/upload', methods=['GE... | python | chosen |
[
{
"from": "system",
"value": "Remove reference to scrobbler extension\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom mopidy_scrobbler import Extension, frontend as frontend_lib\n\n\nclass ExtensionTest(unittest.TestCase):\n\n def test_get_default_config(self):\n ext = Exten... | python | chosen |
[
{
"from": "system",
"value": "Fix type hint for avatar URL in user DTO\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.user.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add a few base attributes\n"
},
{
"from": "human",
"value": "\"\"\"Base classes that are extended by low level AMQP frames and higher level\nAMQP classes and methods.\n\n\"\"\"\n\nclass AMQPObject(object):\n \"\"\"Base object that is extended by AMQP low level fr... | python | chosen |
[
{
"from": "system",
"value": "Tweak error message, reformat for flake8\n"
},
{
"from": "human",
"value": "from dbt.adapters.base import Column\nfrom dataclasses import dataclass\nfrom dbt.adapters.base.relation import BaseRelation\nfrom dbt.exceptions import RuntimeException\n\n\n@dataclass(froz... | python | chosen |
[
{
"from": "system",
"value": "Adjust in a BC way to introduce TestCase\n"
},
{
"from": "human",
"value": "from datetime import datetime\nfrom django.core.files import File\nfrom django.conf import settings\n\nfrom armstrong.dev.tests.utils import ArmstrongTestCase\nfrom armstrong.dev.tests.utils... | python | chosen |
[
{
"from": "system",
"value": "Add support for github ping event\n"
},
{
"from": "human",
"value": "import flask\nimport registry\n\napp = flask.Flask(__name__)\n\ndef get_registry():\n r = getattr(flask.g, '_registry', None)\n if r is None:\n r = flask.g._registry = registry.Registr... | python | chosen |
[
{
"from": "system",
"value": "Fix serve media files path\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.http import HttpResponseRedirect\n\n# Uncomment the next two lines to enable the admin:\nfrom django.contrib import admin\nadmin.autodiscov... | python | chosen |
[
{
"from": "system",
"value": "Fix some more unittest assert methods for Python 2.6\n"
},
{
"from": "human",
"value": "import unittest\nimport cybox.bindings.cybox_common_types_1_0 as common_types_binding\nimport cybox.bindings.mutex_object_1_3 as mutex_binding\nfrom cybox.objects.mutex_object im... | python | chosen |
[
{
"from": "system",
"value": "hidden-module-unicode: Return unicode string to pass assertion\n\nXBlock Fragments expect unicode strings, and fail on an assertion when\nit isn't:\n\n```\n2013-11-14 07:55:50,774 ERROR 3788 [django.request] base.py:215 - Internal Server Error: /courses/TestU/TST101/now/coursew... | python | chosen |
[
{
"from": "system",
"value": "Create /run/docker/plugins before using it. (@bearnard)\n"
},
{
"from": "human",
"value": "import yaml\n\nfrom zope.interface import implements\n\nfrom twisted.python import usage\nfrom twisted.plugin import IPlugin\nfrom twisted.application.service import IServiceM... | python | chosen |
[
{
"from": "system",
"value": "Fix: Remove invalid staticmethod decorator from post method.\n"
},
{
"from": "human",
"value": "import requests\n\nfrom django.conf import settings\nfrom django.http import HttpResponse\nfrom django.views.generic.base import View\n\nfrom website.apps.ts_om.check imp... | python | chosen |
[
{
"from": "system",
"value": "Add preliminary ErrorAnalysis test case\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim: set fileencoding=UTF-8 :\n\nfrom ..common import DynamicMethods\nfrom ..expr import Expr, ExprTreeTransformer\n\nfrom ..semantics import cast_error\n\n\nclass An... | python | chosen |
[
{
"from": "system",
"value": "Create random auth token on user signup\n"
},
{
"from": "human",
"value": "from .models import School, User\nimport re\n\n\ndef get_school_list():\n schools = School.objects.all()\n school_list = []\n for s in schools:\n school = {}\n school['... | python | chosen |
[
{
"from": "system",
"value": "Correct path names for fixed files.\n\n--HG--\nbranch : distribute\nextra : rebase_source : d5bd9c6fdb8cf2208eca9e0e5f37cb7fea1d14a5\n"
},
{
"from": "human",
"value": "from distutils import log\nfrom sdist import sdist\nfrom lib2to3.refactor import RefactoringTool, ... | python | chosen |
[
{
"from": "system",
"value": "Fix alembic revision after merge master\n"
},
{
"from": "human",
"value": "\"\"\"text to JSON\n\nRevision ID: 151b2f642877\nRevises: aee7291c81\nCreate Date: 2015-06-12 14:40:56.956657\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '151b2f642877'\... | python | chosen |
[
{
"from": "system",
"value": "Add requirement for opt in\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: David Boucha\n :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.\n :license: Apache 2.0, see LICENSE for more details.\n\n\n s... | python | chosen |
[
{
"from": "system",
"value": "Test added for the ticket tracker url.\n\nThe automatic test now checks also the ticket tracker url (just tests that\nthe javascript contains the word %TICKET%).\n"
},
{
"from": "human",
"value": "import contextlib\n\nimport mock\nimport testify as T\nfrom pushmanag... | python | chosen |
[
{
"from": "system",
"value": "Fix father class of topics view\n\n@15m\n"
},
{
"from": "human",
"value": "from django.views.generic import TemplateView\nfrom simple_faq.models import Topic\n\n\nclass Topics(TemplateView):\n template_name = \"topics.html\"\n context_object_name = \"topics\"\... | python | chosen |
[
{
"from": "system",
"value": "Add NullHandler to the 'spotify' logger\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport os\nimport weakref\n\nimport cffi\n\n\n__version__ = '2.0.0a1'\n\n\n_header_file = os.path.join(os.path.dirname(__file__), 'api.processed.h')... | python | chosen |
[
{
"from": "system",
"value": "Improve search ordering in challenges (+packages)\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.contrib.admin import widgets \n# Smrtr\nfrom network.models import Network\nfrom challenge.models import ... | python | chosen |
[
{
"from": "system",
"value": "Include parsers in top level module\n"
},
{
"from": "human",
"value": "from pyhprof import *\nfrom pyhprof import __doc__\nfrom pyhprof import __all__\n"
},
{
"from": "gpt",
"value": "'''Library for parsing and analyzing Java hprof files \n'''\n\nfrom .p... | python | chosen |
[
{
"from": "system",
"value": "Set the default number of items to 12 because it fits more nicely on the email\n"
},
{
"from": "human",
"value": "from games import models\n\n\ndef get_unpublished_installers(count=10):\n return models.Installer.objects.filter(published=False).order_by('?')[:coun... | python | chosen |
[
{
"from": "system",
"value": "Set MEDIA_ROOT and STATIC_ROOT settings\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom djcelery import setup_loader\nfrom .base import *\n\nDEBUG = True\nALLOWED_HOSTS = ['*']\nSTATIC_URL = '/static/'\n\nCELERY_REDIRECT_STDOUTS = Fal... | python | chosen |
[
{
"from": "system",
"value": "Remove unwanted whitespace from doc str\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport click\n\nfrom cibopath import __version__\n\n\n@click.group()\n@click.version_option(__version__, u'-V', u'--version', prog_name='Cibopath')\ndef cli():\n ... | python | chosen |
[
{
"from": "system",
"value": "Increase version number to 0.4.1\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017 \"Shopify inc.\" All rights reserved.\n# Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.\nfrom __future__ import unicode_litera... | python | chosen |
[
{
"from": "system",
"value": "FIX also drop genericpump/h5pump from init\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Filename: __init__.py\n\"\"\"\nThe extemporary KM3NeT analysis framework.\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\n\ntry:\n __KM3... | python | chosen |
[
{
"from": "system",
"value": "Return parent date if there isn't one on the current object\n\nLook for a prepared date in the ancestors of the current object and use\nthat if it exists\n"
},
{
"from": "human",
"value": "from django.db import models\n\ndef get_prepared_date(cls):\n return cls.p... | python | chosen |
[
{
"from": "system",
"value": "Change message that detects instance type\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport click\nfrom aws_util import Ec2Util\n\n@click.command()\n@click.option('-p', '--profile', default='default', help='Profile name to use.')\n@click.a... | python | chosen |
[
{
"from": "system",
"value": "Use ops instead of _\n"
},
{
"from": "human",
"value": "from tkinter import Tk, Label, Frame\n\nfrom rx import from_\nfrom rx import operators as _\nfrom rx.subjects import Subject\nfrom rx.concurrency import TkinterScheduler\n\n\ndef main():\n root = Tk()\n r... | python | chosen |
[
{
"from": "system",
"value": "Implement binary representation of peers\n"
},
{
"from": "human",
"value": "import struct\nimport socket\nimport time\n\nfrom trackpy.vendors.redis import redis\n\n\nclass Torrent(object):\n def __init__(self, info_hash):\n self.info = redis.hgetall(info_hash)\n... | python | chosen |
[
{
"from": "system",
"value": "Update MathJax URL to 2.7.4\n"
},
{
"from": "human",
"value": "# This file is part of python-markups module\n# License: BSD\n# Copyright: (C) Dmitry Shachnev, 2012-2017\n\nimport os.path\n\n# Some common constants and functions\n(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE... | python | chosen |
[
{
"from": "system",
"value": "Index endpoint now accepts POST\n"
},
{
"from": "human",
"value": "from application import app, db, bcrypt, login_manager\nfrom utils import render_template, user_loader\n\nfrom twitter_explorer.handlers import login, index, config\n\n\nlogin_manager.login_view = 'l... | python | chosen |
[
{
"from": "system",
"value": "Print a warning and exit when not run on FreeBSD.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# file: osversion.py\n# vim:fileencoding=utf-8:fdm=marker:ft=python\n#\n# Author: R.F. Smith <rsmith@xs4all.nl>\n# Created: 2018-04-06 22:34:00 +0200\n# Last... | python | chosen |
[
{
"from": "system",
"value": "Make sponsored event redirect permanent (HTTP 301)\n"
},
{
"from": "human",
"value": "from django.http import Http404\nfrom django.views.generic import DetailView, ListView, RedirectView\n\nfrom proposals.models import TalkProposal\n\nfrom .models import SponsoredEv... | python | chosen |
[
{
"from": "system",
"value": "BUGFIX: Use raw_input [py2] first, then resort to input [py3].\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\next_pylib.input\n~~~~~~~~~~~~~~~~\n\nFunctions for displaying and handling input on the terminal.\n\"\"\"\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Change source to point to which part of the request caused the error, and add the specific reason to detail\n"
},
{
"from": "human",
"value": "\nfrom rest_framework import status\nfrom rest_framework.exceptions import APIException\n\n\ndef json_api_exception_handler... | python | chosen |
[
{
"from": "system",
"value": "Add new status (unknown), and necessary build files.\n"
},
{
"from": "human",
"value": "# Copyright (C) 2014 Linaro Ltd.\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# p... | python | chosen |
[
{
"from": "system",
"value": "Fix refs to body of sconsole\n"
},
{
"from": "human",
"value": "# Import third party libs\nimport urwid\n\n# Import sconsole libs\nimport sconsole.cmdbar\nimport sconsole.static\n\nFOOTER = [\n ('title', 'Salt Console'), ' ',\n ('key', 'UP'), ' ',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix failing test and add 2 more\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.utils import timezone as tz\n\nfrom scoreboard.models import *\n\n\nclass GameUnitTests(TestCase):\n @classmethod\n def setUpClass(cls):\n s... | python | chosen |
[
{
"from": "system",
"value": "Fix to new page layout\n"
},
{
"from": "human",
"value": "import requests\n\nfrom bs4 import BeautifulSoup\n\ndef nouda( url , out ):\n\n\tr = requests.get( url )\n\tr.encoding = 'UTF-8'\n\tsoup = BeautifulSoup( r.text )\n\n\tteksti = soup.find_all( class_ ='Teksti'... | python | chosen |
[
{
"from": "system",
"value": "Make keystone.server.flask more interesting for importing\n\nImporting keystone.server.flask now exposes all the relevant bits\nfrom the sub modules to develop APIs without needing to understand\nall the underlying modules. __all__ has also be setup in a meaningful\nway to allo... | python | chosen |
[
{
"from": "system",
"value": "Fix markdown plugin so it's run only when needed\n"
},
{
"from": "human",
"value": "import markdown\n\n\ndef markdownify_content(context):\n for article in context[\"articles\"]:\n article[\"content\"] = markdown.markdown(article[\"content\"])\n return ... | python | chosen |
[
{
"from": "system",
"value": "Remove sites from explicitly being defined (thanks @niran for pointing it out)\n"
},
{
"from": "human",
"value": "from armstrong.apps.content.models import Content\nfrom armstrong.core.arm_content.mixins import AuthorsMixin\nfrom armstrong.core.arm_content.mixins im... | python | chosen |
[
{
"from": "system",
"value": "Use SyncEmailMixin for account mails\n"
},
{
"from": "human",
"value": "import re\n\nfrom allauth.account.adapter import DefaultAccountAdapter\nfrom django.conf import settings\n\nfrom apps.contrib.emails import Email\nfrom apps.users import USERNAME_INVALID_MESSAGE... | python | chosen |
[
{
"from": "system",
"value": "Fix for rethrowing mysql.connector.Error as IOError\n"
},
{
"from": "human",
"value": "import sys\n\nclass PlayoffDB(object):\n\n db_cursor = None\n DATABASE_NOT_CONFIGURED_WARNING = 'WARNING: database not configured'\n\n def __init__(self, settings):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix article url open new\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\nfrom django.conf.urls.defaults import patterns, url\nfrom django.conf.urls import include\n\nfrom opps.article.views import OppsDetail\n\n\n\nurlpatterns =... | python | chosen |
[
{
"from": "system",
"value": "Fix string/file-like object detection in onnx.load\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom .onnx_pb2 import *\n... | python | chosen |
[
{
"from": "system",
"value": "Replace print statement by print function.\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nfrom django.db.backends import util\n\nimport sqlparse\n\nfrom debug_toolbar.utils import ms_from_timedelta\n\n\nclass PrintQueryWrapper(util.CursorDebugWr... | python | chosen |
[
{
"from": "system",
"value": "Use us-east-1 to query route53\n\nRoute53 is a global service so doesn't belong to a region, but the API endpoint is in us-east-1.\n\nThis makes various listings now work, but not record sets.\n\nUpdates #4.\n"
},
{
"from": "human",
"value": "import boto3\n\n_CLIENT... | python | chosen |
[
{
"from": "system",
"value": "Change single Lecture query to use first() in stead of all()\n"
},
{
"from": "human",
"value": "from flask import request\nfrom flask_restful import Resource, Api, abort, reqparse\nfrom .models import db, Comment, Lecture\n\napi = Api()\n\n\nclass CommentListResourc... | python | chosen |
[
{
"from": "system",
"value": "Add profile photos to list of people.\n"
},
{
"from": "human",
"value": "from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register\nfrom .models import Person\n\n\nclass PeopleAdmin(ModelAdmin):\n model = Person\n menu_icon = 'group'\n me... | python | chosen |
[
{
"from": "system",
"value": "Fix string format for week numbers < 10\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport sys\nimport gzip\nimport datetime\nimport tempfile\nimport boto3\n\nimport logging\nlogger = logging.getLogger()\nlogger.setLevel(logging.INFO)\n\nch = logging.Strea... | python | chosen |
[
{
"from": "system",
"value": "Fix for integer division error:\n\n$ python3 create_images_and_readme.py\nProcessing <function test_circles at 0x10cda6400>\nwritten: graph-0-0.png\nwritten: graph-0-1.png\nProcessing <function test_piechart_1 at 0x10d1d4a60>\nwritten: graph-1-0.png\nwritten: graph-1-1.png\nPro... | python | chosen |
[
{
"from": "system",
"value": "Clear relatives if no family history\n"
},
{
"from": "human",
"value": "from radar.validation.groups import CohortGroupValidationMixin\nfrom radar.validation.core import Field, Validation\nfrom radar.validation.meta import MetaValidationMixin\nfrom radar.validation.... | python | chosen |
[
{
"from": "system",
"value": "Revert previous commit on this specific file (mistake).\n"
},
{
"from": "human",
"value": "from common import exp\n\n\nMIN_PRECISION = 32\n\n\nfor n in [0.5,1.0,2.0,3.0]:\n print ' uint256 constant SCALED_EXP_{} = 0x{:x};'.format(n,int(exp(n)*(1<<MIN_PRECISION... | python | chosen |
[
{
"from": "system",
"value": "Fix rtmpdump locking up when stderr buffer is filled.\n"
},
{
"from": "human",
"value": "from livestreamer.utils import urlopen\n\nimport pbs\n\nclass StreamError(Exception):\n pass\n\nclass Stream(object):\n def open(self):\n raise NotImplementedError\n... | python | chosen |
[
{
"from": "system",
"value": "fix: Use timezone.now() instead of datetime.now()\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom datetime import datetime, timedelta\n\nfrom django.conf import settings\nfrom django.contrib.auth import get_user_model\nfrom django.contrib.auth.backe... | python | chosen |
[
{
"from": "system",
"value": "Add new grammars to Combinator.DEFAULT_GRAMMARS\n"
},
{
"from": "human",
"value": "from copy import copy\nfrom collections import deque\n\nfrom yargy import FactParser\n\nfrom natasha.grammars import Person, Geo\n\n\nclass Combinator(object):\n\n DEFAULT_GRAMMARS... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in VectorName, caused by new Command arguments\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n pylatex.numpy\n ~~~~~~~~~~~~~\n\n This module implements the classes that deals with numpy objects.\n\n :copyright: (c) 2014 by Je... | python | chosen |
[
{
"from": "system",
"value": "Correct crc32 behaviour for all python versions.\n\nThis fixes signedness issue with crc32 from different python versions.\nWas suggested in the documentation: https://docs.python.org/3.4/library/zlib.html\n"
},
{
"from": "human",
"value": "import struct\nfrom zlib ... | python | chosen |
[
{
"from": "system",
"value": "Fix system tests when running on GCE\n\nThe new project ID logic for Cloud SDK invokes Cloud SDK directly. Cloud SDK helpfully falls back to the GCE project ID if the project ID is unset in the configuration. This breaks one of our previous expectations.\n"
},
{
"from":... | python | chosen |
[
{
"from": "system",
"value": "AR: Add some missing election slugs to Argentina's ELECTION_RE\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nELECTION_RE = '(?P<election>diputados-argentina-paso-2015|gobernadores-argentina-paso-2015|senadores-argentina-paso-2015|presidentes-argentin... | python | chosen |
[
{
"from": "system",
"value": "Tweak comment text for clarity\n"
},
{
"from": "human",
"value": "import urllib\nimport urlparse\n\n\ndef add_query_params(url, params):\n \"\"\"\n Inject additional query parameters into an existing URL. If\n existing parameters already exist with the same... | python | chosen |
[
{
"from": "system",
"value": "Change author in about file\n"
},
{
"from": "human",
"value": "\"\"\"Central place for package metadata.\"\"\"\n\n# NOTE: We use __title__ instead of simply __name__ since the latter would\n# interfere with a global variable __name__ denoting object's name.\n_... | python | chosen |
[
{
"from": "system",
"value": "Unify bokeh's text properties' values with bokehjs\n"
},
{
"from": "human",
"value": "\"\"\"Classes that can be mixed-in to HasProps classes to get them the corresponding attributes. \"\"\"\n\nfrom .properties import HasProps, ColorSpec, DataSpec, Enum, DashPattern,... | python | chosen |
[
{
"from": "system",
"value": "Implement tests for getting empty users list and single user list\n"
},
{
"from": "human",
"value": "import json\nfrom tests.helpers import FlaskTestCase, fixtures\n\n\nclass TestUserAPI(FlaskTestCase):\n\n @fixtures('base.json')\n def test_get_empty_users(sel... | python | chosen |
[
{
"from": "system",
"value": "Improve verbose name for assets\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.apps import AppConfig\n\n\nclass GlitterBasicAssetsConfig(AppConfig):\n name = 'glitter.assets'\n label = 'glitter_assets'\n\n def ready(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix to not silently swallow all Exceptions.\n\nGreat lib, thanks!"
},
{
"from": "human",
"value": "\"\"\"Loads celery or non-celery version.\"\"\"\nfrom django.conf import settings\n\ntry:\n from .tasks import write_points as write_points_celery\nexcept Exception... | python | chosen |
[
{
"from": "system",
"value": "Add some bogus tests to try and get this info.\n"
},
{
"from": "human",
"value": "from datetime import date\n\nimport calendar\n\nprint(calendar.__dir__())\nprint(calendar.__dict__)\n\n\ndef test_united_kingdom_is_business_day():\n \"\"\" Check a single day to se... | python | chosen |
[
{
"from": "system",
"value": "Add a test_suite method as used by the Zope3 test runner"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: ascii -*-\n\nimport unittest, os, os.path, sys\nfrom doctest import DocFileSuite\nsys.path.insert(0, os.path.join(os.pardir, os.pardir))\n\... | python | chosen |
[
{
"from": "system",
"value": "Add example to function docstring\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\n Salt proxy state\n\n .. versionadded:: 2015.8.2\n\n State to deploy and run salt-proxy processes\n on a minion.\n\n Set up pillar data for your proxies... | python | chosen |
[
{
"from": "system",
"value": "Allow BeautifulSoup object being passed into hCalendar\n"
},
{
"from": "human",
"value": "import bs4\r\nfrom vcalendar import vCalendar\r\n\r\nclass hCalendar(object):\r\n def __init__(self, markup, value=None, key='id'):\r\n self._soup = bs4.BeautifulSoup... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.