conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update RenameFileStorage method to be 1.11 compatible\n"
},
{
"from": "human",
"value": "import hashlib\nimport itertools\nimport os\nimport time\n\nfrom django.conf import settings\nfrom django.core.files.storage import FileSystemStorage\n\nfrom storages.backends.s... | python | chosen |
[
{
"from": "system",
"value": "Add hi.wikivoyage to wikivoyage family\n\nBug: T173013\nChange-Id: I82e708c0b55df2e48c83838a4db38e43bf0b5085\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Family module for Wikivoyage.\"\"\"\n#\n# (C) Pywikibot team, 2012-2017\n#\n# Distributed u... | python | chosen |
[
{
"from": "system",
"value": "Hide all unnecessary user info\n\nExcludes all User fields save for useranme, first/last name, email, and\npassword. Also clears the username of its default data.\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.contrib.auth.models import Use... | python | chosen |
[
{
"from": "system",
"value": "Add `commands` property to `CommandManager` to allow retrieving the command table\n"
},
{
"from": "human",
"value": "\n\nclass CommandRegistrar():\n \"\"\"A singleton to manage the command table and command execution\"\"\"\n\n _instance = None\n\n def __ini... | python | chosen |
[
{
"from": "system",
"value": "Remove outdated header as suggested\n\nCo-authored-by: Matthias Bussonnier <bc6ce7c050ee90e1f3b70c16cec57d4205e63b6c@gmail.com>"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modi... | python | chosen |
[
{
"from": "system",
"value": "Change fov scaling to \"Hor+\".\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\nimport sys\n\nfrom direct.showbase.ShowBase import ShowBase\nimport panda3d.core as p3d\n\nimport ecs\nfrom player import PlayerController\n\nclass NodePathComponent(ecs.Compo... | python | chosen |
[
{
"from": "system",
"value": "Set response content type of a json response to application/json\n"
},
{
"from": "human",
"value": "import os\nimport json\nfrom flask import Flask\nfrom flask import request\nfrom flask import json\n\nimport services\n\n\napp = Flask(__name__)\n\ndigitransitAPIServ... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.8.2\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.8.1\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\", ... | python | chosen |
[
{
"from": "system",
"value": "Update stable channel builders to the 1.2 branch\n\nReview URL: https://codereview.chromium.org/179723002\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@253135 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "# Copyright 2013 The Chro... | python | chosen |
[
{
"from": "system",
"value": "Migrate old passwords without \"set_unusable_password\"\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.16 on 2018-10-11 17:28\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef forwards_func(... | python | chosen |
[
{
"from": "system",
"value": "Remove sun setup for now\n"
},
{
"from": "human",
"value": "from teeminus10_helpers import *\nimport unittest\n\nclass TestInTimeOfDay(unittest.TestCase):\n def setUp(self):\n self.location = ephem.city('London')\n self.location.date = datetime(2013... | python | chosen |
[
{
"from": "system",
"value": "Add js tasks to fabric update\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nu\"\"\"\n.. module:: fabfile\nBe aware, that becaus fabric doesn't support py3k You need to execute this\nparticular script using Python 2.\n\"\"\"\n\nimport contextlib\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Add --group option to CLI\n"
},
{
"from": "human",
"value": "import argparse\nimport sys\n\n\ndef main(raw_args=sys.argv[1:]):\n \"\"\"\n A tool to automatically request, renew and distribute Let's Encrypt\n certificates for apps running on Marathon and ser... | python | chosen |
[
{
"from": "system",
"value": "Make sure sents are a list\n"
},
{
"from": "human",
"value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nimport pytest\n\n\n@pytest.mark.xfail\n@pytest.mark.models('en')\ndef test_issue704(EN):\n \"\"\"Test that sentence boundaries are detected co... | python | chosen |
[
{
"from": "system",
"value": "Maintain top 10k order when writing into file\n"
},
{
"from": "human",
"value": "import csv\nimport time\n\nimport requests\nimport lxml.html\n\n\ntop10k = {}\nfor page_index in range(1, 201):\n print('Requesting page {}'.format(page_index))\n url = 'https://o... | python | chosen |
[
{
"from": "system",
"value": "Fix omission in previous commit.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n#\n# Copyright 2013 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with t... | python | chosen |
[
{
"from": "system",
"value": "Set page size to 12\n"
},
{
"from": "human",
"value": "BASE_URL = 'http://svenv.nl'\n\nREST_FRAMEWORK = {\n 'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.OrderingFilter',),\n 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',\n... | python | chosen |
[
{
"from": "system",
"value": "Return 0 tracks in case of error\n"
},
{
"from": "human",
"value": "from flask import Module, render_template, url_for, redirect, session, escape, request\n\nfrom muzicast.web.util import is_first_run\nfrom muzicast.meta import Track\n\nmain = Module(__name__)\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Rewrite robots.txt file in setup\n"
},
{
"from": "human",
"value": "from redsolutioncms.make import BaseMake\nfrom redsolutioncms.models import CMSSettings\n\nclass Make(BaseMake):\n def make(self):\n super(Make, self).make()\n cms_settings = CMSSet... | python | chosen |
[
{
"from": "system",
"value": "Comment out warning for renamed field\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.core.checks import Warning, register\n\n\ndef warn_1_3_changes(app_configs, **kwargs):\n return [\n Warning(\n 'cmsplugin-contact-plus ... | python | chosen |
[
{
"from": "system",
"value": "Add a method to print a message on the sense hat\n"
},
{
"from": "human",
"value": "class HatManager(object):\n\n def __init__(self, sense):\n self.sense = sense\n\n self._pressure = self.sense.get_pressure()\n self._temperature = self.sense.... | python | chosen |
[
{
"from": "system",
"value": "Rename libraries, I'll prefer underscores instead of stuck names\nPrefer unicodes in CronosError\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nfrom django.conf import settings\nfrom django.core.mail import send_mail\n\ndef cronosDebug(m... | python | chosen |
[
{
"from": "system",
"value": "Correct permission tests for organization stats\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django.core.urlresolvers import reverse\n\nfrom sentry.testutils import TestCase, PermissionTestCase\n\n\nclass OrganizationStatsPermiss... | python | chosen |
[
{
"from": "system",
"value": "Add a group chunk, chunks a list into N groups\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom nodes import Node\n\nclass FloorDiv(Node):\n char = \"f\"\n args = 2\n results = 1\n \n @Node.test_func([3,2], [1])\n @Node.test_func([6... | python | chosen |
[
{
"from": "system",
"value": "Add handler for 433 Nickname already in use\n"
},
{
"from": "human",
"value": "import zirc\nimport ssl\nimport socket\nimport utils\nimport commands\n\n\ndebug = False\n\nclass Bot(zirc.Client):\n def __init__(self):\n self.connection = zirc.Socket(family=... | python | chosen |
[
{
"from": "system",
"value": "Use sys.executable instead of harcoded python path\n\nFixes issue when running in a virtualenv and in non-standard python\ninstallations.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport twitter_rss\nimport time\nimport sub... | python | chosen |
[
{
"from": "system",
"value": "Make K transport bar graph\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nThis script generates all the relevant figures from the experiment.\n\n\"\"\"\n\nfrom Modules.processing import *\nfrom Modules.plotting import *\n\nset_sns()\nsave = True... | python | chosen |
[
{
"from": "system",
"value": "Add explicit rating word to rating alt\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.contrib.staticfiles.storage import staticfiles_storage\n\nfrom ..creations import RATING_DESCRIPTIONS\n\nregister = template.Library()\n\n@register.inc... | python | chosen |
[
{
"from": "system",
"value": "Change cart structure and url endpoint for getting cart data\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python\nfrom website import carts\nimport urllib2\nimport json\n\n\ndef load():\n carts.remove_all()\n host = 'http://data.cityofnewyork.us/resourc... | python | chosen |
[
{
"from": "system",
"value": "Patch get_device_model in the setUp and tearDown methods so that we don't send the mock object to each test method."
},
{
"from": "human",
"value": "from mock import patch\n\nfrom django.test.testcases import TestCase\n\nfrom device_notifications import settings\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix login and logout URLs\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\n\nurlpatterns = patterns(\n '',\n url(r'^admin/', include(admin.site.urls)),\n url(r'^accounts/', include('... | python | chosen |
[
{
"from": "system",
"value": "Make the name of an organization required\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom bluebottle.organizations.models import Organization\nfrom bluebottle.utils.serializers import URLField\n\n\nclass OrganizationSerializer(seria... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect import after refactor of dariah_static_data models.\n"
},
{
"from": "human",
"value": "from dariah_static_data.models import VCC\nfrom dariah_static_data.management.commands._private_helper import Command as SuperCommand\n\n\nclass Command(SuperCommand... | python | chosen |
[
{
"from": "system",
"value": "Add tests for packbits and unpackbits\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom cupy import testing\n\n\n@testing.gpu\nclass TestPacking(unittest.TestCase):\n\n _multiprocess_can_split_ = True\n"
},
{
"from": "gpt",
"value": "import n... | python | chosen |
[
{
"from": "system",
"value": "Add documentation for 8ball command\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013-2014 Molly White\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software\n# and associated documentation files (the \"Software\"),... | python | chosen |
[
{
"from": "system",
"value": "Revert a small syntax change introduced by a circular series of changes.\n\n\nFormer-commit-id: 09597b7cf33f4c1692f48d08a535bdbc45042cde"
},
{
"from": "human",
"value": "from nose.tools import eq_, assert_almost_equal\nfrom wordfreq import tokenize, word_frequency\n... | python | chosen |
[
{
"from": "system",
"value": "Add one more empty line to end of import to adjust to H306\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport os.path\nimport urllib\nimport zipfile\n\nurllib.urlretrieve(\n 'http://nlp.stanford.edu/sentiment/trainDevTestTrees_PTB.zip',\n... | python | chosen |
[
{
"from": "system",
"value": "Fix & cleanup profile genesis tests\n"
},
{
"from": "human",
"value": "import pytest\nfrom ethereum import blocks\nfrom ethereum.db import DB\nfrom ethereum.config import Env\nfrom pyethapp.utils import merge_dict\nfrom pyethapp.utils import update_config_from_genes... | python | chosen |
[
{
"from": "system",
"value": "Revise to i_max and enhance comments\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef selection_sort(nums):\n \"\"\"Selection Sort algortihm.\n\n Time com... | python | chosen |
[
{
"from": "system",
"value": "Check for unchecked repos in more than just the edx org\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"List repos missing from repos.yaml.\"\"\"\n\nfrom __future__ import print_function\n\nimport yaml\n\nfrom helpers import paginated_get\n\nREPOS_UR... | python | chosen |
[
{
"from": "system",
"value": "Add oauth endpoints to settings\n"
},
{
"from": "human",
"value": "# OAuth app keys\nBOX_KEY = None\nBOX_SECRET = None\n\nBOX_AUTH_CSRF_TOKEN = 'box-auth-csrf-token'\n"
},
{
"from": "gpt",
"value": "# OAuth app keys\nBOX_KEY = None\nBOX_SECRET = None\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add media url when running in debug mode\n"
},
{
"from": "human",
"value": "from api.views import GraphQLView\nfrom django.contrib import admin\nfrom django.urls import include, path\nfrom django.views.decorators.csrf import csrf_exempt\n\nurlpatterns = [\n path(... | python | chosen |
[
{
"from": "system",
"value": "Fix building Mono 32-bit with Mac 10.7 SDK"
},
{
"from": "human",
"value": "class MonoPackage (Package):\n\tdef __init__ (self):\n\t\tPackage.__init__ (self, 'mono', '2.10.6',\n\t\t\tsources = [\n\t\t\t\t'http://download.mono-project.com/sources/%{name}/%{name}-%{ve... | python | chosen |
[
{
"from": "system",
"value": "Update tests to leverage factory pattern\n"
},
{
"from": "human",
"value": "from flask.ext.testing import TestCase\nimport unittest\nfrom app import app, db\n\nclass BaseTestCase(TestCase):\n def create_app(self):\n app.config.from_object('config.TestingCo... | python | chosen |
[
{
"from": "system",
"value": "Change script to avoid creation of badge URLs to make it work outside of a *party-specific* app context\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"Award a badge to a user.\n\n:Copyright: 2006-2018 Jochen Kupperschmidt\n:License: Modified BSD, ... | python | chosen |
[
{
"from": "system",
"value": "Add Trip and Step ModelForms\n"
},
{
"from": "human",
"value": "from django.contrib.auth.forms import AuthenticationForm\nfrom django import forms\nfrom django.core.validators import MinLengthValidator\nfrom .models import PoolingUser\nfrom users.forms import UserCr... | python | chosen |
[
{
"from": "system",
"value": "Update player season retrieval function\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport concurrent.futures\n\nfrom db.common import session_scope\nfrom db.player import Player\nfrom utils.player_data_retriever import Playe... | python | chosen |
[
{
"from": "system",
"value": "Use path instead of soon to be deprecated url\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom djrichtextfield.views import InitView\n\nurlpatterns = [\n url('^init.js$', InitView.as_view(), name='djrichtextfield_init')\n]\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Add test for index to cells\n"
},
{
"from": "human",
"value": "from support import lib,ffi\nfrom qcgc_test import QCGCTest\n\nclass FitAllocatorTest(QCGCTest):\n def test_macro_consistency(self):\n self.assertEqual(2**lib.QCGC_LARGE_FREE_LIST_FIRST_EXP, li... | python | chosen |
[
{
"from": "system",
"value": "Test generic creator of jobs.\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\n# This file is part of PyBossa.\n#\n# Copyright (C) 2013 SF Isle of Man Limited\n#\n# PyBossa is free software: you can redistribute it and/or modify\n# it under the terms of th... | python | chosen |
[
{
"from": "system",
"value": "Use pyramid.paster instad of paste.deploy\n\n--HG--\nextra : convert_revision : g.bagnoli%40asidev.com-20110509152058-7sd3ek2lvqrdksuw\n"
},
{
"from": "human",
"value": "import os\nimport logging\nfrom paste.deploy import loadapp\nfrom paste.script.util.logging_conf... | python | chosen |
[
{
"from": "system",
"value": "Disable groups.json loading until it's fixed.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.management import call_command\nfrom south.signals import post_migrate\n\n__author__ = 'xaralis'\n\n\nAPPS_TO_WAIT_FOR = ['clients', '... | python | chosen |
[
{
"from": "system",
"value": "Add more logging test stubs\n"
},
{
"from": "human",
"value": "\"\"\"A module containing tests for the library implementation of accessing utilities.\"\"\"\nfrom lxml import etree\nimport iati.core.resources\nimport iati.core.utilities\n\n\nclass TestUtilities(objec... | python | chosen |
[
{
"from": "system",
"value": "Change how the base_url is turned into a domain\n"
},
{
"from": "human",
"value": "from importlib import import_module\nfrom django.contrib.auth import SESSION_KEY, BACKEND_SESSION_KEY, HASH_SESSION_KEY\n\n\ndef force_login(user, driver, base_url):\n from django.... | python | chosen |
[
{
"from": "system",
"value": "Add trash loading. Refactor shared load method\n"
},
{
"from": "human",
"value": "\"\"\"\nargh\n\"\"\"\nimport os\nimport json\nfrom roamer.entry import Entry\n\nentries_path = os.path.expanduser('~/.roamer-data/entries.json')\n\nclass Record(object):\n def __in... | python | chosen |
[
{
"from": "system",
"value": "Fix the auto-generated docstrings of style sheets\n"
},
{
"from": "human",
"value": "# This file is part of rinohtype, the Python document preparation system.\n#\n# Copyright (c) Brecht Machiels.\n#\n# Use of this source code is subject to the terms of the GNU Affer... | python | chosen |
[
{
"from": "system",
"value": "Use port 81 instead of 8889.\n"
},
{
"from": "human",
"value": "# Basic config for stuff that can be easily changed, but which is git-managed.\n# See also apikeys_sample.py for the configs which are _not_ git-managed.\n#server_domain = \"http://www.infiniteglitch.ne... | python | chosen |
[
{
"from": "system",
"value": "Make _CustomAnalyzer a private class\n"
},
{
"from": "human",
"value": "from hoomd.python_action import _PythonAction, _InternalPythonAction\nfrom hoomd.custom_action import _CustomAction, _InternalCustomAction\n\n\nclass CustomAnalyzer(_CustomAction):\n def anal... | python | chosen |
[
{
"from": "system",
"value": "Remove the pointless cluster health check\n"
},
{
"from": "human",
"value": "import aioes\n\nfrom .utils import wait_for_all_services\nfrom .settings import ELASTICSEARCH_ENDPOINTS\n\n\nasync def connect_to_elasticsearch():\n print(\"Connecting to Elasticsearch..... | python | chosen |
[
{
"from": "system",
"value": "Send weekly report to aws\n"
},
{
"from": "human",
"value": "# coding=utf-8\nimport logging\nfrom django.core.management.base import BaseCommand\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass Command(BaseCommand):\n help = \"This runs the MCCB1sSLA report\"... | python | chosen |
[
{
"from": "system",
"value": "Fix “python -m skyfield” following ∆T array rename\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport pkg_resources\nimport skyfield\nfrom skyfield.api import load\nfrom skyfield.functions import load_bundled_npy\n\ndef main():\n print('Skyfield... | python | chosen |
[
{
"from": "system",
"value": "Add the function back for now\n"
},
{
"from": "human",
"value": "from uuid import uuid4\n\n\nclass MessageBus:\n \"\"\"A class that is used behind the scenes to coordinate events and timings of\n animations.\n \"\"\"\n\n def __init__(self):\n self... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.17.5\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.17.4\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"... | python | chosen |
[
{
"from": "system",
"value": "Convert old-style class to new-style class\n"
},
{
"from": "human",
"value": "'''\nImplementation of Stack data structure\n\n'''\n\n\nclass Stack:\n\n def __init__(self):\n\t'''\n\tInitialize stack\n\n\t'''\n\tself.items = []\n\n\n def is_empty(self):\n\t'''\n... | python | chosen |
[
{
"from": "system",
"value": "Edit path and external evaluation\n"
},
{
"from": "human",
"value": "from pygraphc.misc.LKE import *\nfrom pygraphc.evaluation.ExternalEvaluation import *\n\n# set input and output path\nip_address = '161.166.232.17'\nstandard_path = '/home/hudan/Git/labeled-authlog... | python | chosen |
[
{
"from": "system",
"value": "Modify test to match changes in class\n"
},
{
"from": "human",
"value": "'''\nCreated on Jul 16, 2014\n\n@author: thomas\n'''\nimport unittest\n\nclass TestTimeseries (unittest.TestCase):\n\n\n def setUp(self):\n pass\n\n\n def tearDown(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "tests/thread: Make stack-size test run correctly and reliable on uPy.\n"
},
{
"from": "human",
"value": "# test setting the thread stack size\n#\n# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd\n\nimport sys\nimport _thread\n\n# different i... | python | chosen |
[
{
"from": "system",
"value": "Fix networkx 1.11 compatibility issue\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function, unicode_literals\nfrom builtins import dict, str\n\nimport json\nfrom os import path\nfrom indra.util.kappa_util import im_json_to_graph\... | python | chosen |
[
{
"from": "system",
"value": "Fix import issue due to name changes\n"
},
{
"from": "human",
"value": "\"\"\" module SimPEG.EM.NSEM.Utils\n\nCollection of utilities that are usefull for the NSEM problem\n\nNOTE: These utilities are not well test, use with care\n\n\"\"\"\nfrom __future__ import ab... | python | chosen |
[
{
"from": "system",
"value": "Stop using the undocumented get_all_related_objects_with_model API\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom tournamentcontrol.competition.signals.custom import match_forfeit # noqa\nfrom tournamentcontrol.competition.signals.ladders i... | python | chosen |
[
{
"from": "system",
"value": "Reduce number of tiles downloaded\n"
},
{
"from": "human",
"value": "from osmviz.manager import PILImageManager, OSMManager\nimport PIL.Image as Image\n\n\ndef test_pil():\n imgr = PILImageManager(\"RGB\")\n osm = OSMManager(image_manager=imgr)\n image, bnd... | python | chosen |
[
{
"from": "system",
"value": "FIX add links to reports generated v2\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nimport mimetypes\nimport re\nfrom django.core.urlresolvers import reverse\n\n\ndef order_name(name):\n \"\"\"order_name -- Limit a text to 20 chars length, if necessary st... | python | chosen |
[
{
"from": "system",
"value": "Exit process when exception not catch in async task\n"
},
{
"from": "human",
"value": "\"\"\"\nCreated on 1 févr. 2014\n\n@author: inso\n\"\"\"\nimport signal\nimport sys\nimport asyncio\n\nfrom quamash import QEventLoop\nfrom PyQt5.QtWidgets import QApplication\nfr... | python | chosen |
[
{
"from": "system",
"value": "Fix host and port for Heroku\n"
},
{
"from": "human",
"value": "import os\nfrom flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask.ext.script import Manager, Server\nfrom flask.ext.migrate import Migrate, MigrateCommand\nfrom flask.ext.herok... | python | chosen |
[
{
"from": "system",
"value": "Use instance folder to load configuration file.\n"
},
{
"from": "human",
"value": "import requests\nfrom flask import Flask, render_template\n\napp = Flask(__name__)\n\nBBC_id= \"bbc-news\"\nAPI_KEY = \"c4002216fa5446d582b5f31d73959d36\"\n\n@app.route(\"/\")\ndef in... | python | chosen |
[
{
"from": "system",
"value": "Fix name of command sent by send_dialogue action.\n"
},
{
"from": "human",
"value": "from go.vumitools.conversation.definition import (\n ConversationDefinitionBase, ConversationAction)\n\n\nclass SendDialogueAction(ConversationAction):\n action_name = 'send_d... | python | chosen |
[
{
"from": "system",
"value": "Refresh db connections on uwsgi fork\n"
},
{
"from": "human",
"value": "import os\nimport logging\nfrom flask import Flask\nfrom model.base import db\nfrom route.base import blueprint\n\n# Register models and routes\nimport model\nimport route\n\nlogging.basicConfig... | python | chosen |
[
{
"from": "system",
"value": "Fix the build so it no longer double-shades. This removes all the warnings it printed.\n"
},
{
"from": "human",
"value": "import subprocess\nimport sys\nimport setup_util\nimport os\n\ndef start(args):\n try:\n subprocess.check_call(\"mvn clean package shade:sha... | python | chosen |
[
{
"from": "system",
"value": "Move log print to after_step\n"
},
{
"from": "human",
"value": "import time\n\nfrom itest_utils import wait_for_marathon\nfrom itest_utils import print_container_logs\n\n\ndef before_all(context):\n wait_for_marathon()\n\n\ndef after_scenario(context, scenario):\... | python | chosen |
[
{
"from": "system",
"value": "Add more fields to Release serializer.\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\nfrom .models import Release, Track, Comment\n\n\nclass CommentSerializer(serializers.ModelSerializer):\n class Meta:\n model = Comment\n ... | python | chosen |
[
{
"from": "system",
"value": "Use form.save for receipt creation\n"
},
{
"from": "human",
"value": "from django.contrib.auth.decorators import login_required\nfrom django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect\n... | python | chosen |
[
{
"from": "system",
"value": "Print last 10 generated keys when no arguments were given.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport os\nimport sqlite3\nimport sys\nimport time\n\nif len(sys.argv) < 3:\n raise ValueError('Usage: %s \"Firstnam Lastname\" email@example.com' %... | python | chosen |
[
{
"from": "system",
"value": "Change search url regexp to match all characters\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.conf import settings\n\n# Uncomment the next two lines to enable the admin:\nfrom django.contrib import admin\n\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Use the default file upload max memory size\n"
},
{
"from": "human",
"value": "\"\"\"\n@author: Ferdinand E. Silva\n@email: ferdinandsilva@ferdinandsilva.com\n@website: http://ferdinandsilva.com\n\"\"\"\nimport os\nfrom django.utils import simplejson as json\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Add check for valid type of tracks\n"
},
{
"from": "human",
"value": "import time\n\nfrom mycroft.messagebus.message import Message\n\n\nclass AudioService():\n def __init__(self, emitter):\n self.emitter = emitter\n self.emitter.on('MycroftAudioSer... | python | chosen |
[
{
"from": "system",
"value": "Update verion 1.0.0.dev2 -> 1.0.0.dev3"
},
{
"from": "human",
"value": "__version__ = '1.0.0.dev2'\n__author__ = 'D-Wave Systems Inc.'\n__authoremail__ = 'acondello@dwavesys.com'\n__description__ = 'A shared API for binary quadratic model samplers.'\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Remove alloy and s3 from generated docs, just for 0.1 release.\n\ngit-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@496 ead46cd0-7350-4e37-8683-fc4c6f79bf00\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Script to auto-generate our API docs.\n\"\... | python | chosen |
[
{
"from": "system",
"value": "Add messages on idle so that we don't break\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport dbus\n\nclass LogWriter:\n\tdef __init__(self, application):\n\t\tself._application = application\n\t\tbus = dbus.SessionBus()\n\t\tproxy_obj = bus.get_objec... | python | chosen |
[
{
"from": "system",
"value": "Rename olfactory stimulus file and internal array.\n\n--HG--\nbranch : LPU\n"
},
{
"from": "human",
"value": "\"\"\"\nCreate odorant stimuli in hd5 format\n\"\"\"\n\n\"\"\"\nCreate the gexf configuration based on E. Hallem's cell paper on 2006\n\n\"\"\"\n\nimport nu... | python | chosen |
[
{
"from": "system",
"value": "Remove the outer test for __name__; not necessary.\n"
},
{
"from": "human",
"value": "\"\"\"Core XML support for Python.\n\nThis package contains three sub-packages:\n\ndom -- The W3C Document Object Model. This supports DOM Level 1 +\n Namespaces.\n\nparsers... | python | chosen |
[
{
"from": "system",
"value": "Modify s3 connection test for new AWS_S3_HOST setting\n\nThe value is now calculated from the env var at load time, so mocking\nthe env var value is not effective\n\n(cherry picked from commit 044219df7123e3a03a38cc06c9e8e8e9e80b0cbe)\n"
},
{
"from": "human",
"value... | python | chosen |
[
{
"from": "system",
"value": "Change version number for release\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='mdf_forge',\n version='0.5.0',\n packages=['mdf_forge'],\n description='Materials Data Facility python package',\n long_description=\"F... | python | chosen |
[
{
"from": "system",
"value": "Remove language filtration in sitemap.xml\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.utils.translation import get_language\n\nfrom lemon.sitemaps.models import Item\n\n\ndef sitemap_xml(request):\n qs = Item.objects.filter... | python | chosen |
[
{
"from": "system",
"value": "Add a better name for the coordinate functions. Eventually, ll2utm will be deprecated.\n"
},
{
"from": "human",
"value": "\"\"\"\nThe FVCOM Python toolbox (PyFVCOM)\n\n\"\"\"\n\n__version__ = '1.6.1'\n__author__ = 'Pierre Cazenave'\n__credits__ = ['Pierre Cazenave']... | python | chosen |
[
{
"from": "system",
"value": "Fix datathub DCT uris to DC\n"
},
{
"from": "human",
"value": "import sys\n\nfix_url = sys.argv[1]\n\nfor line in sys.stdin:\n e = line.strip().split(\" \")\n\n if e[0].startswith(\"_:\"):\n e[0] = \"<%s>\" % e[0].replace(\"_:\",fix_url)\n if e[2].st... | python | chosen |
[
{
"from": "system",
"value": "Print items that are bad *or* missing\n"
},
{
"from": "human",
"value": "\"\"\"\nWalks through your greader-logs directory (or directory containing them)\nand prints every item_name that has been finished but has no valid .warc.gz\n(as determined by greader-warc-che... | python | chosen |
[
{
"from": "system",
"value": "Check for the name of the submodule we'd like to ignore in a more general way.\n"
},
{
"from": "human",
"value": "import importlib\nimport pkgutil\n\nignore_packages = set(['test'])\n\ndef import_submodules(package, recursive=True):\n \"\"\" Import all submodules... | python | chosen |
[
{
"from": "system",
"value": "Update dsub version to 0.3.3\n\nPiperOrigin-RevId: 266979768\n"
},
{
"from": "human",
"value": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add note to docstring of `figure` and `figsize`.\n"
},
{
"from": "human",
"value": "import matplotlib.pyplot as plt\n\n\n__all__ = ['figure', 'figsize']\n\n\ndef figure(aspect_ratio=1.3, scale=1, width=None, *args, **kwargs):\n \"\"\"Return matplotlib figure... | python | chosen |
[
{
"from": "system",
"value": "Update JSONGeneratorEncoder to subclass DjangoJSONEncoder\nThis handles Decimals and datetimes"
},
{
"from": "human",
"value": "import json\nimport inspect\nfrom _base import BaseExporter\n\n\nclass JSONGeneratorEncoder(json.JSONEncoder):\n \"Handle generator obj... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.