conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add more NbaTeam class tests\n"
},
{
"from": "human",
"value": "import unittest\nimport os\nimport gzip\nimport bs4\nimport logging\nfrom classes import (\n NbaTeam\n)\n\nclass MockRequests:\n def get(self, url):\n pass\n\nclass TestNbaTeamPage(unittest... | python | chosen |
[
{
"from": "system",
"value": "Remove no needed to duplicate parent behaviour\n"
},
{
"from": "human",
"value": "#\n# Copyright 2015 BMC Software, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# Yo... | python | chosen |
[
{
"from": "system",
"value": "Add uuid to update user serializer\n"
},
{
"from": "human",
"value": "#from phonenumber_field.serializerfields import PhoneNumberField\nfrom rest_framework import serializers\nfrom drf_extra_fields.geo_fields import PointField\n\nfrom .models import User\n\n\nclass ... | python | chosen |
[
{
"from": "system",
"value": "Make unittest return exit code 1 on failure\n\nThis is to allow travis to catch test failures\n"
},
{
"from": "human",
"value": "import glob\nimport os\nimport unittest\n\n\ndef build_test_suite():\n suite = unittest.TestSuite()\n\n for test_case in glob.glob(... | python | chosen |
[
{
"from": "system",
"value": "Support providing SECRET_KEY as environment variable.\n"
},
{
"from": "human",
"value": "\"\"\"Settings file for the Django project used for tests.\"\"\"\n\nimport os\n\nfrom django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS\n\n\nPROJECT_NAME = 'project... | python | chosen |
[
{
"from": "system",
"value": "Test to see if abstract classes sneak in.\n\nNow that get_models has been found to skip abstract classes, we want to test\nfor this in case this behaviour ever changes.\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django_snooze import ap... | python | chosen |
[
{
"from": "system",
"value": "Add shebang to cli_tets.py module\n"
},
{
"from": "human",
"value": "import unittest\nfrom unittest.mock import patch, call\nfrom crc import main\n\n\nclass CliTests(unittest.TestCase):\n\n def test_cli_no_arguments_provided(self):\n expected_exit_code = -... | python | chosen |
[
{
"from": "system",
"value": "Fix locators reading on ubuntu\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8; -*-\n#\n# This file is part of Superdesk.\n#\n# Copyright 2013, 2014 Sourcefabric z.u. and contributors.\n#\n# For the full copyright and license information, please see the\n# AU... | python | chosen |
[
{
"from": "system",
"value": "Raise on subproc error everywhere in rever\n"
},
{
"from": "human",
"value": "import builtins\n\n# setup xonsh ctx and execer\nbuiltins.__xonsh_ctx__ = {}\nfrom xonsh.execer import Execer\nbuiltins.__xonsh_execer__ = Execer(xonsh_ctx=builtins.__xonsh_ctx__)\nfrom xo... | python | chosen |
[
{
"from": "system",
"value": "Allow config to be set from environment\n"
},
{
"from": "human",
"value": "import os\n\nimport requests.utils\n\nfrom . import __name__, __version__\n\nOCSPDASH_API_VERSION = 'v0'\n\nOCSPDASH_DIRECTORY = os.path.join(os.path.expanduser('~'), '.ocspdash')\n\nif not o... | python | chosen |
[
{
"from": "system",
"value": "Add extra test for regression\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom ..models import Game\n\n\nclass QuerySetTests(TestCase):\n\n def test_get_by_name(self):\n\n gta_v = Game.objects.create(name='GTA V')\n Game.o... | python | chosen |
[
{
"from": "system",
"value": "Add short flags for version and verbose to match 'python' command\n"
},
{
"from": "human",
"value": "import logging\nimport pkgutil\n\nimport pi\nimport pi.commands\n\n\ncommands = {}\nfor imp_importer, name, ispkg in pkgutil.iter_modules(pi.commands.__path__):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove delivery from depends as useless\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2014-15 Agile Business Group sagl\n# (<http://www.agilebg.com... | python | chosen |
[
{
"from": "system",
"value": "Add tracking for lessons 1, 2, 3\n"
},
{
"from": "human",
"value": "# See also examples/example_track/track_meta.py for a longer, commented example\ntrack = dict(\n author_username='ryanholbrook',\n course_name='computer_vision',\n course_url='https://www.k... | python | chosen |
[
{
"from": "system",
"value": "Validate author_id and return 404 for missing data\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, unicode_literals\n\nfrom sqlalchemy.orm import joinedload\n\nfrom changes.api.base import APIView\nfrom changes.api.auth import ge... | python | chosen |
[
{
"from": "system",
"value": "Add extra beam parsing test\n"
},
{
"from": "human",
"value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nimport pytest\n\n\n@pytest.mark.models('en')\ndef test_beam_parse(EN):\n doc = EN(u'Australia is a country', disable=['ner'])\n ents = EN.... | python | chosen |
[
{
"from": "system",
"value": "Comment more to test heroku deployment.\n"
},
{
"from": "human",
"value": "import sys\nimport os\nfrom threading import Thread\nfrom flask import Flask\nimport pandas as pd\nsys.path.insert(0, \"../financialScraper\")\nfrom financialScraper import getqf\nfrom sqlalc... | python | chosen |
[
{
"from": "system",
"value": "Fix value is \"\" hand value being None in prepare\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom enum import Enum\nfrom typing import TypeVar, Optional, Any, Type # noqa\n\nfrom odin.exceptions import ValidationError\nfrom . impo... | python | chosen |
[
{
"from": "system",
"value": "Add support for new is_unread live notification state.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom .generic import Manager, GetByIdMixin, AllMixin, SyncMixin\n\n\nclass LiveNotificationsManager(Manager, GetByIdMixin, AllMixin, SyncMixin):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix error of applying dask twice\n"
},
{
"from": "human",
"value": "import dask.array as da\nimport h5py\nimport clodius.tiles.hitile as hghi\nimport numpy as np\nimport os.path as op\nimport tempfile\n\n\ndef test_hitile():\n array_size = int(1e6)\n chunk_siz... | python | chosen |
[
{
"from": "system",
"value": "Add test that object coordinates are accurate\n\nSkips over any cases where simbad cannot resolve the name, so it is not perfect...\n"
},
{
"from": "human",
"value": "from astropy.table import Table\n\nTABLE_NAME = 'feder_object_list.csv'\n\n\ndef test_table_can_be_... | python | chosen |
[
{
"from": "system",
"value": "Use consistent load for integ test stability\n"
},
{
"from": "human",
"value": "\"\"\"Basic scenarios, symmetric tests\"\"\"\nimport pytest\nfrom bloop import (\n BaseModel,\n Column,\n GlobalSecondaryIndex,\n Integer,\n MissingObjects,\n)\n\nfrom .mo... | python | chosen |
[
{
"from": "system",
"value": "Disable new test from r1779 for the android generator.\n\nBUG=gyp:379\nTBR=torne@chromium.org\n\nReview URL: https://codereview.chromium.org/68333002"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright (c) 2013 Google Inc. All rights reserved.\n# U... | python | chosen |
[
{
"from": "system",
"value": "Remove use_user_prefs decorator for add_language\n"
},
{
"from": "human",
"value": "# tests.decorators\n\nimport sys\nfrom functools import wraps\nfrom StringIO import StringIO\n\nfrom mock import patch\n\n\ndef redirect_stdout(func):\n \"\"\"temporarily redirect... | python | chosen |
[
{
"from": "system",
"value": "Add warning for where a distance metric is being misused\n"
},
{
"from": "human",
"value": "# Licensed under an MIT open source license - see LICENSE\nfrom __future__ import print_function, absolute_import, division\n\n\nclass TurbuStatTestingWarning(Warning):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use staging for creating a static copy, so refer to in-place assets, not deployed assets\n"
},
{
"from": "human",
"value": "# Prod-like, but with resources in different locations\n\n# Data sources\nLANGUAGE_EXPLORER_DB_URL = 'postgresql://esteele@/language_explorer'... | python | chosen |
[
{
"from": "system",
"value": "Use view.close() to close view.\n"
},
{
"from": "human",
"value": "import sublime\n\nfrom unittest import TestCase\n\n\nclass ViewTestCase(TestCase):\n def setUp(self):\n self.view = sublime.active_window().new_file()\n\n settings = self.view.settin... | python | chosen |
[
{
"from": "system",
"value": "Add with_statement import for python2.5.\n\nSee http://www.python.org/dev/peps/pep-0343/ which describes\nthe with statement.\nReview URL: http://codereview.chromium.org/5690003\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright (c) 2010 Google ... | python | chosen |
[
{
"from": "system",
"value": "Add wrapping of std::ofstream to the example"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nimport sys\n\nimport pybindgen\nfrom pybindgen import ReturnValue, Parameter, Module, Function, FileCodeSink\n\ndef my_module_gen(out_file):\n mod = Module('g'... | python | chosen |
[
{
"from": "system",
"value": "Improve loading of payload from json\n"
},
{
"from": "human",
"value": "from flask import Blueprint, request, json\nfrom alfred_db.models import Repository, Commit\n\nfrom .database import db\nfrom .helpers import parse_hook_data\n\n\nwebhooks = Blueprint('webhooks'... | python | chosen |
[
{
"from": "system",
"value": "Remove the thread local on exceptions\n"
},
{
"from": "human",
"value": "\"\"\"\nMiddleware!\n\"\"\"\nfrom django_tenant_templates import local\n\n\nclass TenantMiddleware(object):\n \"\"\"Middleware for enabling tenant-aware template loading.\"\"\"\n slug_pro... | python | chosen |
[
{
"from": "system",
"value": "Add EventLog stuff to package-level exports\n"
},
{
"from": "human",
"value": "__version__ = '1.16.14'\n\nfrom model import BaseModel\n\nfrom feature import Feature, JSONFeature, TextFeature, CompressedFeature, \\\n PickleFeature\n\nfrom extractor import Node, Gr... | python | chosen |
[
{
"from": "system",
"value": "Fix .format() patterns in test for Python 2.6\n"
},
{
"from": "human",
"value": "\"\"\"Tests against HORIZONS numbers.\"\"\"\n\nfrom skyfield import api\n\n# see the top-level project ./horizons/ directory for where the\n# following numbers come from; soon, we shoul... | python | chosen |
[
{
"from": "system",
"value": "Send default_currency in Client init on client test\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom bluesnap.client import Client\n\n\nclass ClientTestCase(unittest.TestCase):\n DUMMY_CREDENTIALS = {\n 'username': 'username',\n 'password'... | python | chosen |
[
{
"from": "system",
"value": "tests: Fix the temp file initialization\n\nSigned-off-by: Kai Blin <94ddc6985b47aef772521e302594241f46a8f665@biotech.uni-tuebingen.de>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom flask.ext.testing import TestCase\nimport os\nimport tempfile\nimp... | python | chosen |
[
{
"from": "system",
"value": "Split filename only twice (allow ext to contain dots).\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nimport os\nimport random\nimport urllib\nimport urllib2\nimport re\n\n\n# POST_URL = 'http://localhost:8000/domains/'\nPOST_URL = 'http://s... | python | chosen |
[
{
"from": "system",
"value": "Change in the Flows storage\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport datetime\nfrom django.utils import timezone\nfrom datetime import timedelta\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"madapp.settings\")\nfrom django.core.manag... | python | chosen |
[
{
"from": "system",
"value": "Add __unicode__ method to CalendarKey model.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import Group\n\nclass CalendarKey(models.Model):\n\n # The group which has access to this key.\n group = models.Foreig... | python | chosen |
[
{
"from": "system",
"value": "Use formatted strings, add tests filter\n"
},
{
"from": "human",
"value": "def run(tests):\n print '=> Going to run', len(tests), 'tests'\n ok = []\n fail = []\n for number, test in enumerate(tests):\n print '\\t-> [' + str(number) + '/' + str(len... | python | chosen |
[
{
"from": "system",
"value": "Declare unittest lib used within python version\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>\n# Copyright 2012 Google, Inc.\n#\n# Licensed under the Apache License, ... | python | chosen |
[
{
"from": "human",
"value": "Add the compatiblity for py2.6\n"
},
{
"from": "gpt",
"value": "import sys\n\n\n# The unittest module got a significant overhaul\n# in 2.7, so if we're in 2.6 we can use the backported\n# version unittest2.\nif sys.version_info[:2] == (2, 6):\n import unittest2 as... | python | chosen |
[
{
"from": "system",
"value": "Add explicit render layer binding instead of assuming all render passes can be used for compositing\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Cura is released under the terms of the AGPLv3 or higher.\n\nfrom UM.Application import Appl... | python | chosen |
[
{
"from": "system",
"value": "Fix bug with empty db\n"
},
{
"from": "human",
"value": "from random import randrange\n\nfrom paintings.models import Gallery, Painting\n\n\ndef get_Galleries(request):\n\treturn ( {'galleries' : Gallery.objects.all()} )\n\n\ndef get_random_canvasOilPainting(request... | python | chosen |
[
{
"from": "system",
"value": "Change flatpage ordering to order by page name ascending\n"
},
{
"from": "human",
"value": "from django.db import models\nimport markdown\n\nclass Flatpage(models.Model):\n page_name = models.CharField(max_length=100, primary_key=True, unique=True)\n title = m... | python | chosen |
[
{
"from": "system",
"value": "Deploy as the buildbot user, not root.\n"
},
{
"from": "human",
"value": "import unipath\nfrom fabric.api import *\nfrom fabric.contrib import files\n\n# Fab settings\nenv.hosts = ['ve.djangoproject.com']\n\n# Deployment environment paths and settings and such.\nenv... | python | chosen |
[
{
"from": "system",
"value": "Create model for storing total n-gram counts by date\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n\nclass CongressionalRecordVolume(models.Model):\n congress = models.IntegerField(db_index=True)\n session = mod... | python | chosen |
[
{
"from": "system",
"value": "Improve integrate tool wrapper with arguments\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom bioblend import galaxy\nfrom bioblend import toolshed\n\n\nif __name__ == '__main__':\n gi_url = \"http://172.21.23.6:8080/\"\n... | python | chosen |
[
{
"from": "system",
"value": "Fix url path for homepage for sitemap\n"
},
{
"from": "human",
"value": "import rmc.shared.constants as c\nimport rmc.models as m\n\nimport mongoengine as me\nimport os\n\nFILE_DIR = os.path.dirname(os.path.realpath(__file__))\nHTML_DIR = os.path.join(FILE_DIR, 'htm... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Swallow proxy exception from requests\"\n\nThis reverts commit 8d9ccbb2bbde7c2f8dbe60b90f730d87b924d86e.\n"
},
{
"from": "human",
"value": "\"\"\"\nSome code to manage the Amazon Certificate Service.\n\"\"\"\nimport logging\n\nimport boto3\nimport botocore\... | python | chosen |
[
{
"from": "system",
"value": "Update - First question yes, small coding done\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\" Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues.\n\nThis module contains one function diagnose_car(). It is an expert system t... | python | chosen |
[
{
"from": "system",
"value": "Add Next/Previous page links to the docs.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nproject = \"dependencies\"\n\ncopyright = \"2016-2018, Artem Malyshev\"\n\nauthor = \"Artem Malyshev\"\n\nversion = \"0.15\"\n\nrelease = \"0.15\"\n\ntemplates_pat... | python | chosen |
[
{
"from": "system",
"value": "Set up redirect to login view\n"
},
{
"from": "human",
"value": "\"\"\"\nproject URL Configuration\n\n\"\"\"\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\n\nurlpatterns = [\n url(r'^admin/', include(admin.site.urls)),\n url(r'^a... | python | chosen |
[
{
"from": "system",
"value": "Fix off-by-one in HashEmbed test\n"
},
{
"from": "human",
"value": "import numpy\nfrom thinc.api import HashEmbed\n\n\ndef test_init():\n model = HashEmbed(64, 1000).initialize()\n assert model.get_dim(\"nV\") == 1000\n assert model.get_dim(\"nO\") == 64\n ... | python | chosen |
[
{
"from": "system",
"value": "Add methods for Documentation Endpoints\n\nSigned-off-by: Huang Yaming <ce2ec9fa26f071590d1a68b9e7447b51f2c76084@gmail.com>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nURLS = {\n}\n\n\nclass Documentation(object):\n \"\"\" This class provide doc... | python | chosen |
[
{
"from": "system",
"value": "Add \"s\" attr for QSettings\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport os\nimport contextlib\n\nfrom PyQt5 import QtCore\n\nfrom . import __app_name__\nfrom . import helperutils\n\n\ndef _qsettings_group_factory(settings: QtCore.QSettings)... | python | chosen |
[
{
"from": "system",
"value": "Allow sending kwars to mesh shader\n"
},
{
"from": "human",
"value": "from pyrr import Matrix33\n\n\nclass MeshShader:\n\n def __init__(self, shader):\n self.shader = shader\n\n def draw(self, mesh, proj_mat, view_mat):\n \"\"\"Minimal draw funct... | python | chosen |
[
{
"from": "system",
"value": "Fix static files finder errors\n\nConflicts:\n\tbluebottle/utils/staticfiles_finders.py\n"
},
{
"from": "human",
"value": "from django.utils._os import safe_join\nimport os\nfrom django.conf import settings\nfrom django.contrib.staticfiles.finders import FileSystemF... | python | chosen |
[
{
"from": "system",
"value": "Make NamedStruct instance names less confusing\n\nIdeally we'd want to make the name the same as the instance name,\nbut I'm not sure if it's possible without introducing an additional\nconstructor argument.\n"
},
{
"from": "human",
"value": "import string\nimport s... | python | chosen |
[
{
"from": "system",
"value": "Make sure `output` variable is in scope no matter what.\n"
},
{
"from": "human",
"value": "import requests\nfrom collections import defaultdict\nfrom requests.exceptions import RequestException\n\nfrom django.conf import settings\nfrom django.utils.dateparse import ... | python | chosen |
[
{
"from": "system",
"value": "Add helpful list of subcommands.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport importlib\nimport sys\n\ndef main():\n try:\n command = sys.argv[1]\n except IndexError:\n sys.stderr.write('must specify a command\\n')\n re... | python | chosen |
[
{
"from": "system",
"value": "Add devserver handling for password resets.\n"
},
{
"from": "human",
"value": "from ..forms.login import RecoveryForm, login_check\nfrom saylua.utils.email import send_email\n\nfrom flask import render_template, request, flash\n\n\ndef recover_login():\n form = R... | python | chosen |
[
{
"from": "system",
"value": "Add omitted get_all_movies function in main.\n"
},
{
"from": "human",
"value": "\nfrom AllMovies_imdb import add_empty_data, get_connections, get_business_of_movie, check_worksheets, get_companycredits_of_movie, get_fullcredits_of_movie, get_releaseinfo_of_movie, ge... | python | chosen |
[
{
"from": "system",
"value": "Bump version number for release.\n"
},
{
"from": "human",
"value": "\"\"\"\nA collection of Django extensions that add content-management facilities to Django projects.\n\nDeveloped by Dave Hall.\n\n<http://etianen.com/>\n\"\"\"\n\nVERSION = (1, 7, 11)\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Bump version as instructed by bamboo."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n__version__ = '2.3.5pbs.19'\n\n# patch settings\ntry:\n from django.conf import settings\n if 'cms' in settings.INSTALLED_APPS:\n from conf import patch_sett... | python | chosen |
[
{
"from": "system",
"value": "Add picture field member detail api.\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom rest_framework import serializers\nfrom rest_framework.fields import HyperlinkedIdentityField\n\n\nclass MemberDetailSerializer(serializers.Mode... | python | chosen |
[
{
"from": "system",
"value": "Support for externally produced Kinesis partition keys\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Project metadata.\"\"\"\n\npackage = \"lambdautils\"\nproject = \"lambdautils\"\nversion = '0.2.8'\ndescription = \"Simple utilities for AWS Lamb... | python | chosen |
[
{
"from": "system",
"value": "Return ok if db object does not exist in spooler\n"
},
{
"from": "human",
"value": "import uwsgi\nimport django\n\ndjango.setup()\n\nfrom resources.processing import BaseProcessor\nfrom resources.models import Attachment\n\n\ndef content_processing(env):\n print ... | python | chosen |
[
{
"from": "system",
"value": "Add class method decorator demo.\n"
},
{
"from": "human",
"value": "import functools\n\n\ndef logParams(function):\n @functools.wraps(function) # use this to prevent loss of function attributes\n def wrapper(*args, **kwargs):\n print(\"function: {}, arg... | python | chosen |
[
{
"from": "system",
"value": "Undone: Set local worker as default for SyftTensor owner\n"
},
{
"from": "human",
"value": "import random\n\nfrom syft.frameworks.torch.tensors import PointerTensor\n\nimport syft\n\n\nclass TorchTensor:\n \"\"\"\n This tensor is simply a more convenient way t... | python | chosen |
[
{
"from": "system",
"value": "Reduce number of queries of getting attributes display\n"
},
{
"from": "human",
"value": "from django.core.exceptions import ObjectDoesNotExist\n\n\ndef get_attributes_display(variant, attributes):\n display = {}\n for attribute in attributes:\n value =... | python | chosen |
[
{
"from": "system",
"value": "tests: Make specific test files runnable\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport gc\nimport platform\n\nimport cffi\n\ncffi.verifier.cleanup_tmpdir()\n\n\ndef buffer_writer(string):\n \"\"\"Creates a function that take... | python | chosen |
[
{
"from": "system",
"value": "Make DEBUG default to False in production settings\n\nIt is dangerous to keep the template file for production settings\nwithout explicitly specifying that DEBUG needs to be False.\n"
},
{
"from": "human",
"value": "\"\"\"\nA template for settings which should be us... | python | chosen |
[
{
"from": "system",
"value": "Undo accidental global leakage of sys\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\nimport contextlib as __stickytape_contextlib\n\n@__stickytape_contextlib.contextmanager\ndef __stickytape_temporary_dir():\n import tempfile\n import shutil\n ... | python | chosen |
[
{
"from": "system",
"value": "Refactor how remote info is retrieved\n\nThe old way of retrieving remote information was to parse `git status`.\nThis was brittle and lazy. Now the config values storing the remote\ninformation are used.\n"
},
{
"from": "human",
"value": "\"\"\"Get the current upst... | python | chosen |
[
{
"from": "system",
"value": "Make cargs and gargs truly optional\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\n\ndef load_variables_from_env(prefix=\"XII_INTEGRATION_\"):\n length = len(prefix)\n vars = {}\n\n for var in filter(lambda x: x.startswith(prefix), os.en... | python | chosen |
[
{
"from": "system",
"value": "Use Fake redis for tests.\n"
},
{
"from": "human",
"value": "from roku import Roku\n\nfrom app.core.messaging import Receiver\nfrom app.core.servicemanager import ServiceManager\nfrom app.services.tv_remote.service import RokuScanner, RokuTV\n\n\nclass TestRokuScann... | python | chosen |
[
{
"from": "system",
"value": "Add tests for disabled sympification of vectors\n"
},
{
"from": "human",
"value": "\"\"\"Tests for vectors.\"\"\"\n\nfrom sympy import sympify\n\nfrom drudge import Vec\n\n\ndef test_vecs_has_basic_properties():\n \"\"\"Tests the basic properties of vector instan... | python | chosen |
[
{
"from": "system",
"value": "fix: Bring modules into package level\n"
},
{
"from": "human",
"value": "\"\"\"Tools for creating infrastructure and Spinnaker Applications.\"\"\"\n"
},
{
"from": "gpt",
"value": "\"\"\"Tools for creating infrastructure and Spinnaker Applications.\"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Add comment to test settings to advice disabling search indexing\n"
},
{
"from": "human",
"value": "import logging\n\nfrom {{ project_name }}.settings import * # noqa\n\nlogging.disable(logging.CRITICAL)\n\nDEBUG = False\n\nDATABASES = {\n 'default': {\n ... | python | chosen |
[
{
"from": "human",
"value": "Raise error if migrations imported for old Django\n"
},
{
"from": "gpt",
"value": "\"\"\"\nDjango migrations for easy_thumbnails app\n\nThis package does not contain South migrations. South migrations can be found\nin the ``south_migrations`` package.\n\"\"\"\n\nSOU... | python | chosen |
[
{
"from": "system",
"value": "Exclude init file from coverage reporting.\n"
},
{
"from": "human",
"value": "try:\n import collectd\n collectd.register_config\n collectd_present = True\nexcept (ImportError, AttributeError):\n collectd_present = False\n\nfrom .plugin import HAProxyPlug... | python | chosen |
[
{
"from": "system",
"value": "Expand figure when window is resized\n"
},
{
"from": "human",
"value": "from PyQt4 import QtGui\nimport matplotlib as mpl\nfrom matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas\nfrom matplotlib.backends.backend_qt4agg import NavigationTool... | python | chosen |
[
{
"from": "system",
"value": "Add first trip details as well\n"
},
{
"from": "human",
"value": "import emission.core.get_database as edb\n\nfor ue in edb.get_uuid_db().find():\n trip_count = edb.get_analysis_timeseries_db().count_documents({\"user_id\": ue[\"uuid\"], \"metadata.key\": \"analy... | python | chosen |
[
{
"from": "system",
"value": "Add tests for audit changes on issue import\n"
},
{
"from": "human",
"value": "# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n# pylint: disable=maybe-no-member, invalid-name\n\n\"\"\"Test Issue imp... | python | chosen |
[
{
"from": "system",
"value": "Revert \"stop reading fonts/input plugins from environ as we now have a working mapnik-config.bat on windows\"\n\nThis reverts commit d87c71142ba7bcc0d99d84886f3534dea7617b0c.\n"
},
{
"from": "human",
"value": "import os\n\nsettings = os.path.join(os.path.dirname(__... | python | chosen |
[
{
"from": "system",
"value": "Address review comment: Remove another root check.\n"
},
{
"from": "human",
"value": "# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n\n\"\"\"\nFunctional tests for the ``flocker-changestate`` command line tool.\n\"\"\"\n\nfrom os import getuid\nfrom s... | python | chosen |
[
{
"from": "system",
"value": "Fix failing test w/ incomplete regex\n"
},
{
"from": "human",
"value": "import re\n\n\ndef test_tmp_file_is_gone(host):\n tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'\n f = host.file(tmpfile)\n assert not f.exists\n\n\ndef tes... | python | chosen |
[
{
"from": "system",
"value": "Add test for transfer control disable otp\n"
},
{
"from": "human",
"value": "import httpretty\n\nfrom paystackapi.tests.base_test_case import BaseTestCase\nfrom paystackapi.tcontrol import TransferControl\n\n\nclass TestTransfer(BaseTestCase):\n\n @httpretty.acti... | python | chosen |
[
{
"from": "system",
"value": "Use historic PublicBody in data migration"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.6 on 2017-12-24 06:44\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef create_classifications(apps, sc... | python | chosen |
[
{
"from": "system",
"value": "Expand package and module extents.\n"
},
{
"from": "human",
"value": "version = (0, 0, 1)\n\nDEBUG = False\n\nfrom zakopane.file import SumFile\n"
},
{
"from": "gpt",
"value": "version = (0, 0, 1)\n\nDEBUG = False\n\n\nimport os\nfrom zakopane.file impor... | python | chosen |
[
{
"from": "system",
"value": "Use MONO_REPOSITORY to set the repo URL\n"
},
{
"from": "human",
"value": "import os\n\nclass MonoMasterPackage(Package):\n\n\tdef __init__(self):\n\t\tPackage.__init__(self, 'mono', os.getenv('MONO_VERSION'),\n\t\t\tsources = ['git://github.com/mono/mono.git'],\n\t... | python | chosen |
[
{
"from": "system",
"value": "Add a url attribute to the SearchIndex for pages.\n\nThis is useful when displaying a list of search results because we\ncan create a link to the result without having to hit the database\nfor every object in the result list.\n"
},
{
"from": "human",
"value": "\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Replace dummy response with measurements."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import Blueprint\nfrom flask.views import MethodView\n\n\nclass MeasurementList(MethodView):\n def get(self):\n return 'GET: measurement list'\... | python | chosen |
[
{
"from": "system",
"value": "Implement simple mechanism for configuration handling\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n controlbeast\n ~~~~~~~~~~~~\n\n :copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.\n :license: ISC, see LICENSE for ... | python | chosen |
[
{
"from": "system",
"value": "Enable in-memory cache backend for development environment, but not tests\n"
},
{
"from": "human",
"value": "from .settings import *\n\nimport os\n\nDEBUG = True\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add new Algorithm Exception class\n"
},
{
"from": "human",
"value": "class ApiError(Exception):\n '''General error from the Algorithmia API'''\n pass\n\nclass ApiInternalError(ApiError):\n '''Error representing a server error, typically a 5xx status code'''... | python | chosen |
[
{
"from": "system",
"value": "Enable postgresql CFFI compatability if available."
},
{
"from": "human",
"value": "import os\n\nfrom .settings import * # noqa\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',\n 'NAME': 'dtc',\n ... | python | chosen |
[
{
"from": "system",
"value": "Connect to DB on localhost\n"
},
{
"from": "human",
"value": "from bugle_project.configs.settings import *\n\nFAYE_URL = 'http://bugle.fort:8001/faye'\n\nDATABASE_ENGINE = 'postgresql_psycopg2'\nDATABASE_NAME = 'bugle'\nDATABASE_USER = 'bugle'\nDATABASE_PASSWORD = '... | python | chosen |
[
{
"from": "system",
"value": "Add in missing default order\n"
},
{
"from": "human",
"value": "from django.contrib.contenttypes import generic\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db import models\n\n# TODO: Refactor this into a generic utils app to remove the ... | python | chosen |
[
{
"from": "system",
"value": "Use www.wikidata.org instead of wikidata.org\nRewrite-followup to r11105\n\nPatch #3605769 by Legoktm\n\nBecause of various issues [1], using wikidata.org may cause random problems.\nUsing www.wikidata.org will fix these.\n\n[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=45... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.