conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Reset values of external link add-on to default when deleted.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom modularodm import fields\nfrom modularodm.validators import (\n URLValidator, MinValueValidator, MaxValueValidator\n)\nfrom modularodm... | python | chosen |
[
{
"from": "system",
"value": "Remove exception for bslalg_constructorproxy test driver on AIX shared library builds.\n"
},
{
"from": "human",
"value": "{\n 'bslmf_addreference': [ {'OS': 'Windows'} ],\n 'bslstl_iteratorutil': [ {'OS': 'SunOS'} ],\n 'bslstl_unorderedmultiset': [ {'OS': '... | python | chosen |
[
{
"from": "system",
"value": "Use uuid.hex instead of reinventing it.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\n# OpenFisca -- A versatile microsimulation software\n# By: OpenFisca Team <contact@openfisca.fr>\n#\n# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team\n# http... | python | chosen |
[
{
"from": "system",
"value": "Add support for rolling dice for easy random number generation in scripts.\n"
},
{
"from": "human",
"value": "\nimport datetime\n\nfrom mongoengine_models import Message\n\nclass Script(object):\n '''This is a placeholder class used for doing object script things... | python | chosen |
[
{
"from": "system",
"value": "Test for writing and removing server info files\n"
},
{
"from": "human",
"value": "\"\"\"Test NotebookApp\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (C) 2013 The IPython Development Team\n#\n# Distributed u... | python | chosen |
[
{
"from": "system",
"value": "Add loaddatasets serializer tests for real\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom jarbas.core.management.commands.loaddatasets import Command\n\n\nclass TestSerializer(TestCase):\n\n def setUp(self):\n self.command = Co... | python | chosen |
[
{
"from": "system",
"value": "Fix the ASDF test for TimeDelta formats\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n# -*- coding: utf-8 -*-\n\nimport pytest\n\nasdf = pytest.importorskip('asdf')\nfrom asdf.tests.helpers import assert_roundtri... | python | chosen |
[
{
"from": "system",
"value": "Add IndexResource to example module.\n"
},
{
"from": "human",
"value": "def install_module(app):\n \"\"\"Installs this localmodule.\"\"\"\n install_module\n"
},
{
"from": "gpt",
"value": "class IndexResource(object):\n\n def on_get(self, req, re... | python | chosen |
[
{
"from": "system",
"value": "REFACTOR : Import YAMLError so it is usable as a generic exception.\n"
},
{
"from": "human",
"value": "# The all important loader\nfrom strictyaml.parser import load\n\n# Validators\nfrom strictyaml.validators import Optional\nfrom strictyaml.validators import Valid... | python | chosen |
[
{
"from": "system",
"value": "Remove forgotten if in customer.py\n"
},
{
"from": "human",
"value": "from .Base import Base\n\n\nclass Customer(Base):\n @property\n def id(self):\n return self.getProperty('id')\n\n @property\n def name(self):\n return self.getProperty('n... | python | chosen |
[
{
"from": "system",
"value": "Fix PEP8 and add more data\n\nAdded tvdb_id and tvrage_id entries to returned data\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals, division, absolute_import\nimport logging\nimport requests\n\nfrom flexget import plugin\nfrom flexget.even... | python | chosen |
[
{
"from": "system",
"value": "Order JobPhase by date started, date created\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom flask import Response\nfrom sqlalchemy.orm import joinedload, subqueryload_all\n\nfrom changes.api.base import APIView\nfrom changes.api.se... | python | chosen |
[
{
"from": "system",
"value": "Use vendor and product id for udev rules\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport os\nfrom select import select\nfrom sys import exit, stderr\nfrom time import sleep\n\nWRITE_BYTES = [0x0 for b in range(0, 8)]\nWRITE_BYTES[0] = 0x08\nWRITE... | python | chosen |
[
{
"from": "system",
"value": "Enable SHA-256-sess to see if it works or not.\n"
},
{
"from": "human",
"value": "from lib.test_config import AUTH_CREDS as AUTH_CREDS_orig\n\nclass AUTH_CREDS(AUTH_CREDS_orig):\n enalgs = ('SHA-256', 'MD5-sess', None)\n\n def __init__(self):\n AUTH_CRE... | python | chosen |
[
{
"from": "system",
"value": "Add default permission of StaffPermissionLogic\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\"\"\"\ndjango-permission application configure\n\"\"\"\n__author__ = 'Alisue <lambdalisue@hashnote.net>'\n__all__ = ('settings',)\nfrom django.conf import settings\nfr... | python | chosen |
[
{
"from": "system",
"value": "Remove uneccesary import in downloads API test\n\nThe test_downloads_routes.py module was uneccessarily importing augur.server\ndue to the remnants of the previous testing architecture. This import\nwas causing the build to error out, so it's been removed.\n\nSigned-off-by: Car... | python | chosen |
[
{
"from": "system",
"value": "Change the str representation of AppHookConfig by using the related CMSApp name instead of the type\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom app_data import AppDataField\nfrom django.db import models\nfrom django.utils.translation import uget... | python | chosen |
[
{
"from": "system",
"value": "Modify error check in check_dates()\n"
},
{
"from": "human",
"value": "import os\r\nfrom dateutil.parser import parse\r\nfrom ...common import run, chdir\r\n\r\n\r\ndef check_dates(spec_id, username, spec, basedir):\r\n \"\"\" Port of the CheckDates program from ... | python | chosen |
[
{
"from": "system",
"value": "Remove some unused code that unnecessarily introduced depends\n\nThis should be regarded as an update to 9aa5b02e12a2287642a285541c43790a10d6444f\nthat removes unnecessary dependencies for the lqr.py example.\n\nIn the example provided by 9aa5b02e12a2287642a285541c43790a10d6444... | python | chosen |
[
{
"from": "system",
"value": "Change port for breakpad to available port.\n\nBUG=366164, 359557\nR=johnw@google.com\n\nReview URL: https://codereview.chromium.org/526553002\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@291789 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Add cache_object and get_object functions.\n"
},
{
"from": "human",
"value": "import redis\n\nfrom pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB\n\ndef get_client():\n client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB)\n return ... | python | chosen |
[
{
"from": "system",
"value": "Use startswith in favor of indexing\n"
},
{
"from": "human",
"value": "from waterbutler.core import metadata\n\nclass BaseOsfStorageMetadata:\n @property\n def provider(self):\n return 'osfstorage'\n\n\nclass OsfStorageFileMetadata(BaseOsfStorageMetadat... | python | chosen |
[
{
"from": "system",
"value": "Add the setup for logging\n"
},
{
"from": "human",
"value": "from settings_common import *\n\nPACKAGE_VERSION = \"0.5\"\n\nDEBUG = TEMPLATE_DEBUG = True\n\nDAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline')\nEXTERNAL_PATH = os.path.join(P... | python | chosen |
[
{
"from": "system",
"value": "Use Pytest's skipif decorator instead of returning to skip assert statements.\n"
},
{
"from": "human",
"value": "import platform\n\nfrom keyring.util.platform_ import (\n config_root,\n data_root,\n _config_root_Linux,\n _config_root_Windows,\n _data_... | python | chosen |
[
{
"from": "system",
"value": "Update docstring for the ActiveHref template tag.\n"
},
{
"from": "human",
"value": "from django import template\n\nfrom bs4 import BeautifulSoup\n\nregister = template.Library()\n\n@register.tag(name='activehref')\ndef do_active_href(parser, token):\n nodelist =... | python | chosen |
[
{
"from": "system",
"value": "Fix hash tag linking entities\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.contrib.auth.models import User\nfrom django.utils.safestring import mark_safe\nimport re\nimport urllib\n\nregister = template.Library()\n\nusername_re = re.co... | python | chosen |
[
{
"from": "system",
"value": "Update docs to version v0.16.1\n"
},
{
"from": "human",
"value": "__version__ = \"0.16.0-dev\"\n__libnetwork_plugin_version__ = \"v0.7.0-dev\"\n__libcalico_version__ = \"v0.11.0-dev\"\n__felix_version__ = \"1.3.0a6-dev\"\n"
},
{
"from": "gpt",
"value": "... | python | chosen |
[
{
"from": "system",
"value": "Add feature to set start/end messages\n"
},
{
"from": "human",
"value": "import logging\n\n\nclass rangelog:\n logger = None\n startlog = \"--> Start: {name}\"\n endlog = \"<-- End:\" # noqa\n\n @classmethod\n def set_logger(cls, logger=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a redirect on successful update of settings.\n"
},
{
"from": "human",
"value": "\nfrom django.contrib import admin\nfrom django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect\r\nfrom django.utils.translation import ugettext_lazy a... | python | chosen |
[
{
"from": "system",
"value": "Use test feature from North America\n"
},
{
"from": "human",
"value": "# node 2356117215\nassert_has_feature(\n 16, 34003, 23060, 'pois',\n { 'kind': 'put_in' })\n\n# way 308154534\nassert_has_feature(\n 13, 2448, 2992, 'roads',\n { 'kind': 'portage_way'... | python | chosen |
[
{
"from": "system",
"value": "Fix Bunny crawler crash on non-date image names\n"
},
{
"from": "human",
"value": "from comics.crawler.base import BaseComicCrawler\nfrom comics.crawler.meta import BaseComicMeta\n\nclass ComicMeta(BaseComicMeta):\n name = 'Bunny'\n language = 'en'\n url = ... | python | chosen |
[
{
"from": "system",
"value": "Switch to using the `add_arguments` method.\n\nThis is an alternative to using the `option_list` and\n`optparse.make_option`. Django deprecated the use of `optparse` in\nmanagement commands in Django 1.8 and removed it in Django 1.10.\n"
},
{
"from": "human",
"value... | python | chosen |
[
{
"from": "system",
"value": "ca_on_candidates: Make CSV URL more specific\n"
},
{
"from": "human",
"value": "from utils import CSVScraper\n\nfrom datetime import date\n\n\nclass OntarioCandidatesPersonScraper(CSVScraper):\n csv_url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQhrWSeOE... | python | chosen |
[
{
"from": "system",
"value": "Add ID to Artist in Top\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand, CommandError\nfrom django.db.models import Count\nfrom django.db import connection\nfrom mangaki.models import Rating, Anime\nfrom collections import Coun... | python | chosen |
[
{
"from": "system",
"value": "Allow images in EXTRACTs, etc.\n"
},
{
"from": "human",
"value": "from regparser.tree.depth import markers as mtypes\nfrom regparser.tree.struct import Node\nfrom regparser.tree.xml_parser import (\n paragraph_processor, simple_hierarchy_processor, us_code)\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix ConnectedSWFObject: restrict attributes set by constructor\n\n- credentials: SETTINGS | kwargs\n- region: SETTINGS | kwargs | boto.swf.layer1.Layer1.DefaultRegionName\n- connection: kwargs\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\n# Copyright ... | python | chosen |
[
{
"from": "system",
"value": "Add attribution to quotes in plugin\n"
},
{
"from": "human",
"value": "\"\"\"Displays a randomly generated witticism from Brian Chu himself.\"\"\"\n\nimport json\nimport random\n\n__match__ = r\"!brian\"\n\n\nwith open('plugins/brian_corpus/cache.json', 'r') as infi... | python | chosen |
[
{
"from": "system",
"value": "Add ApiKey to Users page in Django Admin\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.auth.admin import UserAdmin\nfrom django.contrib.auth.models import User\n\nfrom django_digest.models import PartialDigest, UserNonce\n\... | python | chosen |
[
{
"from": "system",
"value": "Define a path to the image folder for fake beps generator\n\nPath is defined in beps_gen_utils\nUsers can still provide their own images if they want."
},
{
"from": "human",
"value": "\n\nimport numpy as np\n\ndef combine_in_out_field_loops(in_vec, out_vec):\n \"... | python | chosen |
[
{
"from": "system",
"value": "Add function for backward compability\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport json\n\n\ndef open_file_as_string(filepath):\n with open(filepath, 'r') as ftemp:\n templateString = ftemp.read()\n return templateString\n\n\ndef ret... | python | chosen |
[
{
"from": "system",
"value": "Test files stored in CAS are still readable.\n"
},
{
"from": "human",
"value": "from fridge.cas import ContentAddressableStorage\nfrom fridge.memoryfs import MemoryFS\n\n\nclass TestContentAddressableStorage(object):\n def create_cas(self, fs=None, path='cas'):\n... | python | chosen |
[
{
"from": "system",
"value": "Update callback to support two parameters\n"
},
{
"from": "human",
"value": "import argparse\nimport asyncio\nimport logging\n\nfrom .protocol import create_anthemav_reader\n\ndef console():\n parser = argparse.ArgumentParser(description=console.__doc__)\n par... | python | chosen |
[
{
"from": "system",
"value": "Allow isprintable() util function to work with unicode\n\nFixes #6842\n"
},
{
"from": "human",
"value": "def isprintable(instring):\n #http://stackoverflow.com/a/3637294\n import string\n printset = set(string.printable)\n isprintable = set(instring).iss... | python | chosen |
[
{
"from": "system",
"value": "Extend a docstring in PBC-Gamma TDHF\n\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module is an alias for `pyscf.tdscf.rhf_slow`. It works with single k-point HF objects.\n\"\"\"\nfrom pyscf.tdscf.rhf_slow import *"
},
{
"from": "gpt",
"value": "\"\"... | python | chosen |
[
{
"from": "system",
"value": "Change wrapper code to use [] notation for attribute access\n"
},
{
"from": "human",
"value": "from t2activity import NestedWorkflow\nfrom t2types import ListType, String\nfrom t2flow import Workflow\n\nclass WrapperWorkflow(Workflow):\n\n\tdef __init__(self, flow):... | python | chosen |
[
{
"from": "system",
"value": "Add 10 days only in the leap day case too.\n"
},
{
"from": "human",
"value": "from datetime import date, timedelta\n\nclass DateWithCalendar(object):\n def __init__(self, calendar_class, date):\n self.calendar = calendar_class\n self.date = date\n\n... | python | chosen |
[
{
"from": "system",
"value": "Make sure looking up by id works correctly\n"
},
{
"from": "human",
"value": "import motor\nimport error\nfrom tornado import gen\n\n\nclass Connection(object):\n def __init__(self, host='localhost', port=None, db=None):\n self.host = host\n self.po... | python | chosen |
[
{
"from": "system",
"value": "Use RABBIT_HOST in env.json if it exists\n"
},
{
"from": "human",
"value": "from settings import *\nimport json\nfrom logsettings import get_logger_config\n\nwith open(ENV_ROOT / \"env.json\") as env_file:\n ENV_TOKENS = json.load(env_file)\n\nXQUEUES = ENV_TOKEN... | python | chosen |
[
{
"from": "system",
"value": "Comment out expends until we get them cleaned up\n"
},
{
"from": "human",
"value": "from django.core.management import call_command\nfrom calaccess_campaign_browser.management.commands import CalAccessCommand\n\n\nclass Command(CalAccessCommand):\n help = 'Transf... | python | chosen |
[
{
"from": "system",
"value": "Fix test (wikipedia entries seem to change)"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\" \"\"\"\n\n# Standard library modules.\nimport unittest\nimport logging\n\n# Third party modules.\n\n# Local modules.\nfrom pyxray.parser.wikipedia import Wikip... | python | chosen |
[
{
"from": "system",
"value": "Replace deprecated imp usage with importlib\n"
},
{
"from": "human",
"value": "import imp\n\nfrom django.template import loaders\nfrom os import listdir\nfrom os.path import dirname, splitext\n\nMODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()])... | python | chosen |
[
{
"from": "system",
"value": "Replace true/false from JSON to python False/True\n\nSigned-off-by: Vivek Galatage <bbe41406aa2af935662c4582fd181c8ca0156a8e@visteon.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport os\nimport sys\n\nsys.path.insert(0, os.path.dirname(os.path.abspat... | python | chosen |
[
{
"from": "system",
"value": "Fix the test case for block cache.\n"
},
{
"from": "human",
"value": "import angr\n\nimport logging\nl = logging.getLogger(\"angr.tests\")\n\nimport os\ntest_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))\n\ndef tes... | python | chosen |
[
{
"from": "system",
"value": "Install uwsgi in venv on web upgrade\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\nimport errno\nimport pathlib\nimport platform\nimport sys\nimport subprocess\n\n\ndef main():\n dist = platform.dist()\n if dist[0] != 'debian' and dist[0] != 'Ubuntu':... | python | chosen |
[
{
"from": "system",
"value": "Use LocationChoiceProvider in enikshay location view\n"
},
{
"from": "human",
"value": "from django.http.response import JsonResponse\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic.base import View\n\nfrom corehq.apps.domain.decorat... | python | chosen |
[
{
"from": "system",
"value": "Add types to ImageProvider and RequiresData\n"
},
{
"from": "human",
"value": "import json\nimport inspect\nfrom os.path import join, exists\n\n\ndef not_implemented():\n frame_info = inspect.currentframe().f_back\n msg = ''\n\n if 'self' in frame_info.f_lo... | python | chosen |
[
{
"from": "system",
"value": "Update dev tool for applying ES patches\n\nAdds path rewrite for `test/framework` -> `es/es-testing/`"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n\"\"\"\nUse to apply patches from ES upstream with:\n\n git apply --reject \\\n <(curl -L https... | python | chosen |
[
{
"from": "system",
"value": "Update example autograding code to use heading names\n"
},
{
"from": "human",
"value": "from nose.tools import eq_ as assert_eq\n\n@score(problem=\"hello\", points=0.5)\ndef grade_hello1():\n \"\"\"Grade 'hello' with input 'Jessica'\"\"\"\n msg = hello(\"Jessi... | python | chosen |
[
{
"from": "system",
"value": "Add celeryd prefetch multiplier setting\n"
},
{
"from": "human",
"value": "import os\n\nREDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')\nBROKER_URL = os.getenv(\n 'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)\nCELERYD_TA... | python | chosen |
[
{
"from": "system",
"value": "Fix Collector and EC2Reporter tests.\nToken user used for test now requires the correct permissions.\n"
},
{
"from": "human",
"value": "import pytest\nfrom django.contrib.auth.models import User\nfrom rest_framework.authtoken.models import Token\n\npytestmark = pyte... | python | chosen |
[
{
"from": "system",
"value": "Add credentials + code clean up\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport pika\nimport json\nimport requests\n\nRABBIT_MQ_SERVER = os.environ[\"RABBIT_MQ_SERVER\"]\n\nconnection = pika.BlockingConnection(pika.ConnectionParameters(\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix csv saving for arbitrary parameter sets\n"
},
{
"from": "human",
"value": "\"\"\"Various utility functions, mostly dealing with input/output\"\"\"\r\n\r\nimport os\r\n\r\nimport numpy as np\r\n\r\ndef load_snapshots(directory_name, stack_coords=False):\r\n \"... | python | chosen |
[
{
"from": "system",
"value": "Use correct m2m join table name in LatestCommentsFeed\n\n--HG--\nextra : convert_revision : svn%3Abcc190cf-cafb-0310-a4f2-bffc1f526a37/django/trunk%409089\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib.syndication.feeds impo... | python | chosen |
[
{
"from": "system",
"value": "Set default logging level to WARNING\n\nFixes tests with pytest 3.3.0+\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\"\"\"\n weasyprint.logging\n ------------------\n\n Logging setup.\n\n The rest of the code gets the logger through this module ra... | python | chosen |
[
{
"from": "system",
"value": "Add check for logging state\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import, unicode_literals\n\nimport tabledata\n\nfrom ._null_logger ... | python | chosen |
[
{
"from": "system",
"value": "Add more information to the feed entry\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n flask-rst.modules.atom\n ~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: (c) 2011 by Christoph Heer.\n :license: BSD, see LICENSE for more details.\n\"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Add function to migrate forum data to mongodb\n"
},
{
"from": "human",
"value": "'''\nInsert the edx discussion board .mongo files into mongodb database\n'''\n\nimport pymongo\nimport sys\nimport json\n\n\ndef connect_to_db_collection(db_name, collection_name):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update 'get_current_usersettings' to catch 'DoesNotExist' error\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\n\n\ndef get_usersettings_model():\n \"\"\"\n Returns the ``UserSetting... | python | chosen |
[
{
"from": "system",
"value": "Fix bug when transcriptions are empty\n"
},
{
"from": "human",
"value": "from flask import render_template, jsonify, request\nfrom app import app\nfrom app import evolver\n\n\n@app.route('/')\n@app.route('/index')\ndef index():\n return render_template('index.htm... | python | chosen |
[
{
"from": "system",
"value": "Add extract_tar and post_install_script option.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom fabric.api import cd, env, run\nfrom .. import signal, configuration\n\ndef init():\n configuration.setdefault('curl_url', '')\n configuration.se... | python | chosen |
[
{
"from": "system",
"value": "Add __version__ to vumi_http_api package.\n"
},
{
"from": "human",
"value": "from .vumi_api import VumiApiWorker\n\n__all__ = ['VumiApiWorker']\n"
},
{
"from": "gpt",
"value": "from .vumi_api import VumiApiWorker\n\n__version__ = \"0.0.1a\"\n\n__all__ = ... | python | chosen |
[
{
"from": "system",
"value": "Remove call to _checkRegions method\n\nAt one point it was a method of the super (I believe), but it's\nno longer there.\n"
},
{
"from": "human",
"value": "\"\"\"A custom ILAMB confrontation for net ecosystem productivity (nep).\"\"\"\nimport os\nimport numpy as np\... | python | chosen |
[
{
"from": "system",
"value": "Check if checkbox value has updated.\n"
},
{
"from": "human",
"value": "\nfrom scriptcore.testing.testcase import TestCase\nfrom scriptcore.console.asciimatics.widgets.checkbox import CheckBox\nfrom asciimatics.widgets import CheckBox as ACheckBox\n\n\nclass TestChe... | python | chosen |
[
{
"from": "system",
"value": "Copy the S3 object into the new bucket\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8\n\nimport boto3\n\n\ndef get_existing_records(dynamodb_client):\n \"\"\"\n Generates existing Miro records from the SourceData table.\n \"... | python | chosen |
[
{
"from": "system",
"value": "Use integer values for the remote subscribe form to comply with the django oauth_provider.\n"
},
{
"from": "human",
"value": "from django import forms\n\nclass RemoteSubscribeForm(forms.Form):\n username = forms.CharField(max_length=64, label=\"Username\")\n p... | python | chosen |
[
{
"from": "system",
"value": "Decrease line length for pycodestyle compliance\n\nA line exceeded 75 characters in length.\n"
},
{
"from": "human",
"value": "\"\"\"Inspects dictionary for desired keys and stores for later usage.\"\"\"\n\nfrom hostel_huptainer.errors import InputError\n\n\nclass E... | python | chosen |
[
{
"from": "system",
"value": "Fix because we're not timezone aware.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport datetime\nfrom django.utils.timezone import utc\n\n\nclass Migration(migrati... | python | chosen |
[
{
"from": "system",
"value": "Revert previous change. MAL preferred the old version.\n"
},
{
"from": "human",
"value": "\"\"\" Python 'bz2_codec' Codec - bz2 compression encoding\n\n Unlike most of the other codecs which target Unicode, this codec\n will return Python string objects for b... | python | chosen |
[
{
"from": "system",
"value": "Use moving average n=1 instead of n=2\n"
},
{
"from": "human",
"value": "import numpy as np\n\n\ndef circular_store(redis, stat_name, stat_value):\n stat_value = np.average(np.append(np.asfarray(redis.lrange(stat_name, 0, 2)), stat_value))\n\n redis.lpush(stat... | python | chosen |
[
{
"from": "system",
"value": "Store json file as .json\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport json\n\nimport utils\n\nfrom datetime import datetime\nfrom experiments import *\n\nRESULTS_DIR = \"results\"\nDATA_DIR = \"data\"\n\nEXPERIMENTS = {\n \"http_request\" :... | python | chosen |
[
{
"from": "system",
"value": "win: Update libchromiumcontent to fix shared workers.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport platform\nimport sys\n\nNODE_VERSION = 'v0.11.13'\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONT... | python | chosen |
[
{
"from": "system",
"value": "Fix __all__ to the current list of exported modules (must pass the\ntests in test_email.py).\n"
},
{
"from": "human",
"value": "# Copyright (C) 2001 Python Software Foundation\n# Author: barry@zope.com (Barry Warsaw)\n\n\"\"\"A package for parsing, handling, and gen... | python | chosen |
[
{
"from": "system",
"value": "[FEATURE] Use environment variable with deafult path when no path given\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom infcommon.factory import Factory\nfrom infcommon.yaml_reader.yaml_reader import YamlReader\n\n\ndef yaml_reader(path=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Make Request Logging a little better\n\nUse the flask.request properties instead of direct environ lookups,\nas this is more representative of what is happening in the application.\n\nChange-Id: Ic16c5ea26b2f526b51ef167e6f6977c72df1d06a\nPartial-Bug: #1776504\n"
},
{
"f... | python | chosen |
[
{
"from": "system",
"value": "Fix another use of the rbuilder postgres user\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#\n# Copyright (c) 2009 rPath, Inc.\n#\n# All rights reserved.\n#\n\nimport logging\nfrom conary import dbstore\nfrom mint.scripts.db2db import db2db\n\n\nlog = loggi... | python | chosen |
[
{
"from": "system",
"value": "Add documentation\nClean duplicate code\nremove unused code\n"
},
{
"from": "human",
"value": "import os\nimport unittest\nfrom gateway.utils.resourcelocator import ResourceLocator\nfrom unittest import TestLoader\n\nTEST_PATH = \"tests\"\n\nverbosity = 1\n\ntest_lo... | python | chosen |
[
{
"from": "system",
"value": "Update CloVal to allow for specifying multiple parameters\n\n"
},
{
"from": "human",
"value": "from .environment import Environment\n\nfrom viper.parser.ast.nodes import Expr\n\n\nclass Value:\n pass\n\n\nclass TupleVal(Value):\n def __init__(self, *vals: Valu... | python | chosen |
[
{
"from": "system",
"value": "Delete commented out old code.\n"
},
{
"from": "human",
"value": "\"\"\"\nOPAL Lookuplists\n\"\"\"\nfrom django.contrib.contenttypes.fields import GenericRelation\nfrom django.db import models\n\n# class LookupList(models.Model):\n# class Meta:\n# abstra... | python | chosen |
[
{
"from": "system",
"value": "Use the python MBox class rather than parsing the mailbox manually\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\n Simple Python module to parse a Thunderbird mail file and\n scan each email message with ClamAV in order to detect\n susp... | python | chosen |
[
{
"from": "system",
"value": "Use python2 pyyaml instead of python3.\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\n\ndef fix_imports():\n here = os.path.dirname(__file__)\n dirs = [\n os.path.normpath(os.path.join(here, '..', '..')),\n os.path.normpath(os.path.join(here... | python | chosen |
[
{
"from": "system",
"value": "Add descriptions to timezone functions\n\nThese are quite complex things and benefit from having better descriptions.\n\nNote, we weren't quite happy with the names of the functions.\n\n`aware_gmt_datetime` should really be `aware_london_datetime` and\nthe other two functions c... | python | chosen |
[
{
"from": "system",
"value": "Fix prepend BASE_URL for ACCOUNT_LOGOUT_REDIRECT_URL\n"
},
{
"from": "human",
"value": "import os\n\n# include settimgs from daiquiri\nfrom daiquiri.core.settings import *\n\n# include settings from base.py\nfrom .base import *\n\n# include settings from local.py\nf... | python | chosen |
[
{
"from": "system",
"value": "Fix query by unique name\n"
},
{
"from": "human",
"value": "from dj_experiment.models import Catalog\nfrom django.core.management.base import BaseCommand, CommandError\nfrom humanfriendly.tables import format_pretty_table\n\n\nclass Command(BaseCommand):\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Add search, filter to access tokens"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import AccessToken\n\n\nclass AccessTokenAdmin(admin.ModelAdmin):\n raw_id_fields = ('user',)\n\n\nadmin.site.register(AccessToken, AccessTokenAd... | python | chosen |
[
{
"from": "system",
"value": "Make logged in user endpoint available w/o token"
},
{
"from": "human",
"value": "from rest_framework import serializers, views, permissions, response\n\nfrom oauth2_provider.contrib.rest_framework import TokenHasScope\n\nfrom .models import User\n\n\nclass UserSeri... | python | chosen |
[
{
"from": "system",
"value": "Add password as a write_only field on CreateUserSerializer\n"
},
{
"from": "human",
"value": "from django.core.exceptions import ValidationError\nfrom django.contrib.auth.password_validation import validate_password\nfrom ovp_users import models\nfrom rest_framework... | python | chosen |
[
{
"from": "system",
"value": "Remove atomic transaction from command to reduce memory usage\n"
},
{
"from": "human",
"value": "import logging\n\nfrom django.core.management.base import BaseCommand\nfrom django.db import transaction\n\nfrom document.models import Document\nfrom document.models im... | python | chosen |
[
{
"from": "system",
"value": "Use optparser for generate length\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport json\nimport os\nimport optparse\nimport random\n\nfrom crypto import *\nfrom file_io import *\nfrom settings import *\n\noptions = None\narguments = None\n\ndef main(... | python | chosen |
[
{
"from": "system",
"value": "Change order of permission changes\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.core.management.base import BaseCommand\nfrom django.conf import settings\n\nclass Command(BaseCommand):\n args = ''\n help = \"Set all permissions in the uploads di... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in variable name\n"
},
{
"from": "human",
"value": "## Copyright (C) 2011 Aldebaran Robotics\n\n\"\"\"Small set of tools to interact with the user\n\n\"\"\"\n\n#TODO: color!\n\ndef ask_choice(choices, input_text):\n \"\"\"Ask the user to choose from a li... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.