conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Remove unused forms from context processor\n\nThese forms are not used by any view or template. On every request\nDjango is generating the entire HTML form for these 2 forms which\nis a whole load of unnecessary CPU.\n"
},
{
"from": "human",
"value": "from molo.prof... | python | chosen |
[
{
"from": "system",
"value": "Add modality predictor to output\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom .model import ModalityModel\nfrom .estimator import ModalityEstimator\nfrom .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\\\n MODALITY_TO_CM... | python | chosen |
[
{
"from": "system",
"value": "Change update_addon_node() to return the Addon node, whether created or found.\n"
},
{
"from": "human",
"value": "\"\"\"Addon utilities.\"\"\"\n# Copyright 2015 Solinea, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use ... | python | chosen |
[
{
"from": "system",
"value": "Update fabric examples to reflect changes.\n"
},
{
"from": "human",
"value": "\"\"\"Example of integration between Fabric and Datadog.\n\"\"\"\n\nfrom fabric.api import *\nfrom fabric.colors import *\nfrom dogapi.fab import setup, notify\n\nsetup(api_key = \"YOUR AP... | python | chosen |
[
{
"from": "system",
"value": "Add billing_address and migrate data\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10 on 2016-08-22 23:41\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\ndef add_billing_address(apps, schema_edito... | python | chosen |
[
{
"from": "system",
"value": "Revert \"logs pyzabbix com variavel de ambiente\"\n\nThis reverts commit df796462b07f7470d86f4d0622a414c956a45ced.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport logging\nimport os\nimport sys\n\nfrom dbaas_zabbix.dbaas_api... | python | chosen |
[
{
"from": "system",
"value": "Use six function for input() in recent questions demo\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom __future__ import print_function\n\n# Same directory hack\nimport sys\nsys.path.append('.')\nsys.path.append('..')\n\ntry:\n get_input = raw_input... | python | chosen |
[
{
"from": "system",
"value": "Change number of photos per page\n"
},
{
"from": "human",
"value": "from ..ditto.views import PaginatedListView\n\nfrom .models import Account, Photo, User\n\n\nclass Home(PaginatedListView):\n template_name = 'flickr/index.html'\n\n def get_context_data(self,... | python | chosen |
[
{
"from": "system",
"value": "Simplify nib compiler and support recent Xcode versions by using xcrun\n"
},
{
"from": "human",
"value": "\"\"\"\nAutomatic compilation of XIB files\n\"\"\"\nimport subprocess, os\nfrom py2app.decorators import converts\n\n@converts(suffix=\".xib\")\ndef convert_xib... | python | chosen |
[
{
"from": "system",
"value": "Update time_regex captcher so to work with more sites\n"
},
{
"from": "human",
"value": "import re\n\n\nTIME_REGEX = re.compile(\n r'\\A(\\s*(?P<hours>\\d+)\\s{1}(hours|hrs|hr|h))?((?P<minutes>\\s*\\d+)\\s{1}(minutes|mins|min|m))?\\Z'\n)\n\n\nHTML_SYMBOLS = '\\xa... | python | chosen |
[
{
"from": "system",
"value": "Allow remote and local files.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport os\n\nimport yaml\n\n\ndef main(app, data):\n filepath = os.path.join(app.data_dir, data.get('filename'))\n\n with open(filepath, 'r') as f:\n ... | python | chosen |
[
{
"from": "system",
"value": "8: Create documentation of DataSource Settings \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.... | python | chosen |
[
{
"from": "system",
"value": "Add documentation on the database session stuff.\n"
},
{
"from": "human",
"value": "from sqlalchemy import create_engine\nfrom sqlalchemy.orm import scoped_session, sessionmaker\nfrom sqlalchemy.pool import StaticPool\n\n\nsession = None\n\n\ndef init_session(connec... | python | chosen |
[
{
"from": "system",
"value": "Tag commit for v0.0.9-master generated by gitmake.py\n"
},
{
"from": "human",
"value": "major = 0\nminor=0\npatch=8\nbranch=\"master\"\ntimestamp=1376412892.53"
},
{
"from": "gpt",
"value": "major = 0\nminor=0\npatch=9\nbranch=\"master\"\ntimestamp=13764... | python | chosen |
[
{
"from": "system",
"value": ":lipstick: Add more verbosity on test running\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport sys\nimport os\nimport django\nfrom django.conf import settings\nfrom django.core.management import call_command\n\nsys.path.inser... | python | chosen |
[
{
"from": "system",
"value": "Create internal db initialisation script\n\nPaired by Michael and Richard\n"
},
{
"from": "human",
"value": "__author__ = 'richard'\n"
},
{
"from": "gpt",
"value": "\"\"\"\nScript that is run from the command line in order to\n\"\"\"\nimport sys\nimport ... | python | chosen |
[
{
"from": "system",
"value": "Add in the init the newly introduced function\n"
},
{
"from": "human",
"value": "# expose the most frequently used functions in the top level.\nfrom .path_related import (mkdir_p, rm_if_exists, remove_empty_paths,\n copy_contents_of_folder,... | python | chosen |
[
{
"from": "system",
"value": "Ch05: Tag Detail: get Tag from database.\n"
},
{
"from": "human",
"value": "from django.http.response import HttpResponse\nfrom django.template import Context, loader\n\nfrom .models import Tag\n\n\ndef homepage(request):\n tag_list = Tag.objects.all()\n templ... | python | chosen |
[
{
"from": "system",
"value": "Customize scripts to work with menu\n"
},
{
"from": "human",
"value": "\nimport sys\nfrom java.lang import String\nfrom java.util import HashSet\nfrom java.util import HashMap\nimport java\nglobdict = globals()\ndef loadFilesService():\n global globdict\n exec... | python | chosen |
[
{
"from": "system",
"value": "Add alias method named \"distance\"\n"
},
{
"from": "human",
"value": "from .bycython import eval\n__all__ = ('eval',)\n"
},
{
"from": "gpt",
"value": "from .bycython import eval\n\n\ndef distance(*args, **kwargs):\n \"\"\"\"An alias to eval\"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Add degradation module to init.\n"
},
{
"from": "human",
"value": "from energy_normalization import normalize_with_sapm\n\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n"
},
{
"from": "gpt",
"value": "from... | python | chosen |
[
{
"from": "system",
"value": "Change test template assertion order to be consistent\n"
},
{
"from": "human",
"value": "from tests import ScraperTest\n\nfrom recipe_scrapers.template import Template\n\n\nclass TestTemplateScraper(ScraperTest):\n\n scraper_class = Template\n\n def test_host(... | python | chosen |
[
{
"from": "system",
"value": "Make Trunks have opposite directions in the included lanes\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright (C) 2017 Open Source Robotics Foundation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in complia... | python | chosen |
[
{
"from": "system",
"value": "Switch to courses instead of enrollments - MUWM-457\n\n"
},
{
"from": "human",
"value": "from restclients.canvas import Canvas\nfrom myuw_mobile.dao.pws import Person\nfrom myuw_mobile.logger.timer import Timer\nfrom myuw_mobile.logger.logback import log_resp_time, ... | python | chosen |
[
{
"from": "system",
"value": "Improve test coverage of functional.py.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom transducer.functional import compose\n\n\nclass TestComposition(unittest.TestCase):\n\n def test_single(self):\n \"\"\"\n compose(f)(x) -> f(x)\n ... | python | chosen |
[
{
"from": "system",
"value": "Make the aq client work on Solaris/x86\n\nThe ctypes module cannot be built with the Sun C compiler, therefore it\nis missing from the default Python build on Solaris.\n\nChange-Id: I4b81adc051ea38bf9bde126f71a09d4e78c1b9b3\nAddresses-Issue: Jira/AQUILON-994\nReviewed-By: Natha... | python | chosen |
[
{
"from": "system",
"value": "Increase cache on deprecated self-repair to one week\n\nThis view serves a message that the system is no longer active. We keep\nit around because it is still gets about 40 million hits per day,\nprimarily from Firefox ESR 52, which never got the Normandy client.\nNotably, when... | python | chosen |
[
{
"from": "system",
"value": "Make Clear Inbox keyword more robust.\n"
},
{
"from": "human",
"value": "import os\n\nfrom raven import Client\n\n\ndef generate_event(msg, dsn):\n client = Client(dsn)\n client.captureMessage(msg)\n\n\ndef clear_inbox(maildir):\n print('Clearing inbox at {... | python | chosen |
[
{
"from": "system",
"value": "Allow args and kwargs to upload_handler_name\n\nNow can use args and kwargs for reverse url. Example in template:\r\n{% jfu 'core/core_fileuploader.html' 'core_upload' object_id=1 content_type_str='app.model' %}"
},
{
"from": "human",
"value": "from django.core.cont... | python | chosen |
[
{
"from": "system",
"value": "Make RequestError available in package root.\n"
},
{
"from": "human",
"value": "__title__ = 'pyglab'\n__version__ = '0.0dev'\n__author__ = 'Michael Schlottke'\n__license__ = 'MIT License'\n__copyright__ = '(c) 2014 Michael Schlottke'\n\nfrom .pyglab import Pyglab\nf... | python | chosen |
[
{
"from": "system",
"value": "Use startswith instead of exact string match\n"
},
{
"from": "human",
"value": "from flask import json\nfrom nose.tools import eq_\nfrom server import app\n\nclient = app.test_client()\n\n\ndef test_hello_world():\n # When: I access root path\n resp = client.g... | python | chosen |
[
{
"from": "system",
"value": "Change to use logging and set log level to INFO\n"
},
{
"from": "human",
"value": "\nimport os\nimport logging\n\nfrom decouple import config\n\nFOLDER = 'public'\nFOLDER = FOLDER.strip('/')\n\nlog = logging.getLogger('deploy')\n\n\ndef deploy():\n import boto\n ... | python | chosen |
[
{
"from": "system",
"value": "Break celeryd restart into distict 'stop' and 'start' commands on deploy\n"
},
{
"from": "human",
"value": "from fabric.api import * # noqa\n\n\nenv.hosts = [\n '104.131.30.135',\n]\nenv.user = \"root\"\nenv.directory = \"/home/django/api.freemusic.ninja\"\nenv.... | python | chosen |
[
{
"from": "system",
"value": "Disable testing for index.html, needs ember build\n\nSigned-off-by: Rohan Jain <f3a935f2cb7c3d75d1446a19169b923809d6e623@gmail.com>\n"
},
{
"from": "human",
"value": "from tornado import testing\n\nfrom qotr.server import make_application\nfrom qotr.config import co... | python | chosen |
[
{
"from": "system",
"value": "Read from standard input and perform on each line\n\nThe analyze script can now be run with, for example\n- echo \"Message\" | python analyze.py\n- cat | python analyze.py (enter messages and end with Ctrl-D)\n- python analyze.py < filename\n- MapReduce (at some point)\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Fix the version string generation when not a final or RC release.\n"
},
{
"from": "human",
"value": "# The version of Review Board.\n#\n# This is in the format of:\n#\n# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)\n#\nVERSION = (1, 0, 1, '... | python | chosen |
[
{
"from": "system",
"value": "[master] Add LRU for relationship mapper.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Contains functions to canonicalize relationships.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_function\... | python | chosen |
[
{
"from": "system",
"value": "Update jobs archived flag before setting the default value\n\nRunning an update before setting the column default value reduces\nthe time the table is locked (since most rows don't have a NULL\nvalue anymore), but the migration takes slightly longer to run\noverall.\n"
},
{... | python | chosen |
[
{
"from": "system",
"value": "Fix indentation; override old-style start() from BackendBase\n"
},
{
"from": "human",
"value": "from urllib import urlencode\nfrom urllib2 import urlopen\n\nfrom rapidsms.backends.base import BackendBase\n\nclass TropoBackend(BackendBase):\n \"\"\"A RapidSMS thre... | python | chosen |
[
{
"from": "system",
"value": "Use standard repo for postgresql9 in ubuntu 11.10\n"
},
{
"from": "human",
"value": "import os\nfrom kokki import Execute, Package\n\napt_list_path = '/etc/apt/sources.list.d/pitti-postgresql-lucid.list'\n\nExecute(\"apt-update-postgresql9\",\n command = \"apt-ge... | python | chosen |
[
{
"from": "system",
"value": "Add a cached ballot fetcher to the DevsDC helper\n\nIf we happen to run out of RAM in Lambda (we won't), Lambda will just\nkill the function and invoke a new one next time.\n"
},
{
"from": "human",
"value": "import requests\n\nfrom django.conf import settings\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Add permissions to organisation consultants endpoint\n"
},
{
"from": "human",
"value": "from radar_api.serializers.organisation_consultants import OrganisationConsultantSerializer\nfrom radar.models import OrganisationConsultant\nfrom radar.views.core import Retriev... | python | chosen |
[
{
"from": "system",
"value": "Fix xeddsa crypto_sign shared lib copy\n\nCould be `_crypto_sign.cpython-37m-x86_64-linux-gnu.so` or simply `_crypto_sign.so` depending on the platform/distribution"
},
{
"from": "human",
"value": "from pythonforandroid.recipe import CythonRecipe\nfrom pythonforandr... | python | chosen |
[
{
"from": "system",
"value": "Test type coercion in sanitize_exif_value\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport unittest\n\nfrom ..models import sanitize_exif_value\n\n\nclass SanitizeExifValueTestCase(unittest.TestCase):\n def test_strip_null_byte... | python | chosen |
[
{
"from": "system",
"value": "Split the start_date for better data entry (and Javascript date pickers).\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.template.defaultfilters import slugify\nfrom budget.models import Budget, BudgetEstimate\n\n\nclass BudgetForm(forms.Mo... | python | chosen |
[
{
"from": "system",
"value": "Add adapter module to init file\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Seva Zhidkov\n@contact: zhidkovseva@gmail.com\n@license: The MIT license\n\nCopyright (C) 2015\n\"\"\"\n\n# Bot module contains bot's main class - Sheldon\... | python | chosen |
[
{
"from": "system",
"value": "Remove second ? from URL\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport json\nimport urllib\nimport urllib2\n\napi_key = os.getenv(\"MAPS_API_KEY\")\nif api_key == \"\":\n sys.exit(\"Please obtain an API key from https://developers.google.com/ma... | python | chosen |
[
{
"from": "system",
"value": "Fix custom topology example; outdated import\n\nReported-by: Julius Bachnick\n"
},
{
"from": "human",
"value": "\"\"\"Custom topology example\n\nauthor: Brandon Heller (brandonh@stanford.edu)\n\nTwo directly connected switches plus a host for each switch:\n\n host... | python | chosen |
[
{
"from": "system",
"value": "Test to see if commit works.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url, patterns\n\nfrom newswall.feeds import StoryFeed\nfrom newswall import views\n\n\nurlpatterns = patterns(\n '',\n url(r'^feed/$', StoryFeed()),\n url(r'^$',\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Print statements added for profiling\"\n\nThis reverts commit a6ae05c13666b83a1f1a8707fe21972bd1f758d9.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nCreated on Fri Mar 14 15:25:36 2014\n\n@author: ibackus\n\"\"\"\n\nimport time\n\nt0 = ... | python | chosen |
[
{
"from": "system",
"value": "Order stories by descending creation time\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass Story(models.Model):\n url = models.URLField(_('URL'))\n title = models.CharField(_('T... | python | chosen |
[
{
"from": "system",
"value": "Fix json error handler name"
},
{
"from": "human",
"value": "from flask import jsonify\n\nfrom soundem import app\n\n\ndef json_error_handler(e):\n return jsonify({\n 'status_code': e.code,\n 'error': 'Bad Request',\n 'detail': e.description\... | python | chosen |
[
{
"from": "system",
"value": "Enforce flake8 and NOQA cases\n"
},
{
"from": "human",
"value": "from ctypes import *\nfrom contextlib import contextmanager\nimport os\nimport stat\n\n\ndef get_file_path(f):\n if f:\n name = getattr(f, 'name')\n if name:\n path = os.pat... | python | chosen |
[
{
"from": "system",
"value": "Remove reindex calls after changes\n\nAlready reindex notes on initialization\n"
},
{
"from": "human",
"value": "import argparse\nimport yaml\nimport shutil\nimport os\nfrom subprocess import call\nfrom os.path import expanduser, isdir\n\nfrom config import load_con... | python | chosen |
[
{
"from": "system",
"value": "Add console log send invitations command\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom optparse import make_option\n\nclass Command(BaseCommand):\n help = \"Send invitations to people on the waiting list\"\n opti... | python | chosen |
[
{
"from": "system",
"value": "Remove unused 'skip_run' option flag\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n pytest_pipeline.plugin\n ~~~~~~~~~~~~~~~~~~~~~~\n\n pytest plugin entry point.\n\n :copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>\n :lic... | python | chosen |
[
{
"from": "system",
"value": "Put a blank line among main suites\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom clint.textui import indent, puts, colored\nfrom mamba import spec\n\n\nclass DocumentationFormatter(object):\n\n def __init__(self):\n self.has_failed_tes... | python | chosen |
[
{
"from": "system",
"value": "Fix view name for b2g redirects\n\nbug 792482\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom util import redirect\n\nurlpatterns = patterns('',\n\n redirect(r'^b2g', 'firefoxos'),\n redirect(r'^b2g/faq', 'firefoxos'),\n red... | python | chosen |
[
{
"from": "system",
"value": "Rename new admin dropdown menu\n"
},
{
"from": "human",
"value": "from uber.common import *\nfrom ._version import __version__\nfrom .config import *\nfrom .models import *\nfrom .model_checks import *\nfrom .automated_emails import *\n\nstatic_overrides(join(config... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in automatic email\n"
},
{
"from": "human",
"value": "from django.core.mail import send_mail\n\n\n# TODO: check whether this should be sent from Phuxivator\ndef mailApplicantSubmission(context, sender='phuxivator@tf.fi'):\n name = context['name']\n re... | python | chosen |
[
{
"from": "system",
"value": "Enable development start at localhost\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\n# Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt\n\nfrom bottle import run, debug\n\nfrom bottle_app import application\n\n#debug(True)\nrun(applicat... | python | chosen |
[
{
"from": "system",
"value": "Use 16 bit samples instead of float\n"
},
{
"from": "human",
"value": "import math\nimport numpy\nfrom demodulate.cfg import *\n\ndef gen_tone(pattern, WPM):\n\tcycles_per_sample = MORSE_FREQ/SAMPLE_FREQ\n\tradians_per_sample = cycles_per_sample * 2 * math.pi\n\tele... | python | chosen |
[
{
"from": "system",
"value": "Use the simplejson bundled with django\n"
},
{
"from": "human",
"value": "from django.utils.simplejson import simplejson\n\nfrom oembed.exceptions import OEmbedException\n\nclass OEmbedResource(object):\n \"\"\"\n OEmbed resource, as well as a factory for crea... | python | chosen |
[
{
"from": "system",
"value": "Make sure that the site mode is populated on the request\n\neven if the request winds up getting dispatched to a flatpage.\n"
},
{
"from": "human",
"value": "from opendebates.utils import get_site_mode\n\n\nclass SiteModeMiddleware(object):\n \"\"\"\n Gets or ... | python | chosen |
[
{
"from": "system",
"value": "tests: Fix the stats unit test.\n\nThis has been broken since February. The interface for opening\ninitializing where the stats output should go was changed, but the\ntest wasn't updated.\n\nChange-Id: I54bd8be15bf870352d5fcfad95ded28d87c7cc5a\nReviewed-on: https://gem5-review.... | python | chosen |
[
{
"from": "system",
"value": "Add unit test for make_thumbnail_name()\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: latin-1 -*-\n\n\"\"\"Unit tests.\"\"\"\n\nimport unittest\nimport commonsdownloader\n\n\nclass TestCommonsDownloader(unittest.TestCase):\n\n \"\"\"Test... | python | chosen |
[
{
"from": "human",
"value": "Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.\n"
},
{
"from": "gpt",
"value": "'''\nUtilities to search files and retain meta data about... | python | chosen |
[
{
"from": "system",
"value": "Add framework status to API /_status\n\nTo figure out current framework statuses for the given environment\nyou either need access to the API token or you'd have to look through\na number of frontend pages to infer the status from.\n\nFramework status is a part of almost every ... | python | chosen |
[
{
"from": "system",
"value": "Update IP address Tor traffic comes from\n"
},
{
"from": "human",
"value": "import json\nfrom flask import request, current_app, redirect\nfrom flaskext.bcrypt import generate_password_hash\n\ndef get_ip():\n ip = request.remote_addr\n if ip == '127.0.0.1' or ... | python | chosen |
[
{
"from": "system",
"value": "Add a failure expectation to Linux memory.css3d test.\n\nBUG=373098\nNOTRY=true\nR=kbr@chromium.org\n\nReview URL: https://codereview.chromium.org/303503009\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@273109 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from... | python | chosen |
[
{
"from": "system",
"value": "ca_on_ottawa: Use corrections, as none of utf-8, iso-8859-1 or windows-1252 work\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom utils import CSVScraper\n\n\nclass OttawaPersonScraper(CSVScraper):\n csv_url = 'http://data.ottawa.ca/en/dataset/fd26ae83-fe... | python | chosen |
[
{
"from": "system",
"value": "Fix coverage by removing unused lines\n"
},
{
"from": "human",
"value": "from dash.orgs.views import OrgPermsMixin\nfrom smartmin.views import SmartCRUDL, SmartListView\n\nfrom .models import Rule\n\n\nclass RuleCRUDL(SmartCRUDL):\n \"\"\"\n Simple CRUDL for d... | python | chosen |
[
{
"from": "system",
"value": "Update import to use new style as per SO answer\n\nhttps://stackoverflow.com/questions/20032922/no-module-named-flask-ext-wtf\n"
},
{
"from": "human",
"value": "from flask_wtf import Form\nfrom wtforms import validators\n\nfrom dmutils.forms import StripWhitespaceSt... | python | chosen |
[
{
"from": "system",
"value": "Change permissions to either 644 or 755.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"fix-perm.py - Fix file permissions\n\"\"\"\n\n\nfrom __future__ import print_function\n\nimport os\nimport stat\nimport sys\n\n\nif __name__ == '__main__':\n\n... | python | chosen |
[
{
"from": "system",
"value": "fix: Move properties fetching before dict\n"
},
{
"from": "human",
"value": "\"\"\"Notify Slack channel.\"\"\"\nimport time\n\nfrom ..utils import get_properties, get_template, post_slack_message\n\n\nclass SlackNotification:\n \"\"\"Post slack notification.\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a little more detail to the generator\n\n"
},
{
"from": "human",
"value": "import random\nimport sys\n\npopulation = bytes([i for i in range(256)])\n\nif sys.argv[1] == 'reflector':\n popset = set(population)\n buffer = [None for i in range(256)]\n for ... | python | chosen |
[
{
"from": "system",
"value": "Allow real <= and >= in LateX\n"
},
{
"from": "human",
"value": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For\n# a full list see the documentation:\n# https://www.sphinx-doc.org/... | python | chosen |
[
{
"from": "system",
"value": "Update bookmark interface to work with mercurial 3.0.2\n\n--HG--\nextra : transplant_source : Qn%AB4%08%F4%3D%60%0DDb%10%E1%9C%A2%82%00z%1D5\n"
},
{
"from": "human",
"value": "\n# Mimic the hggit extension.\ntry:\n from hggit import *\n hggit_reposetup = repos... | python | chosen |
[
{
"from": "system",
"value": "Add length validator unit tests"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport pytest\n\nfrom marshmallow import validate, ValidationError\n\ndef test_invalid_email():\n invalid1 = \"user@example\"\n with pytest.raises(ValidationError):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update default queryset for formsets"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom django.shortcuts import redirect, render_to_response\nfrom django.template import RequestContext\n\nfrom campaign.forms import CampaignFormSet, P... | python | chosen |
[
{
"from": "system",
"value": "Test for exception raising on API error.\n"
},
{
"from": "human",
"value": "import unittest\nfrom simplejson import dumps\nfrom twisted.trial.unittest import TestCase\nfrom twisted.internet import defer\n\nfrom mock import patch, Mock\nfrom van.contactology import C... | python | chosen |
[
{
"from": "system",
"value": "Remove pprint and add PEP-8 lf\n"
},
{
"from": "human",
"value": "from pyramid.view import view_config\n\nfrom pyramid.httpexceptions import (\n HTTPNotFound,\n)\n\n@view_config(route_name='page', renderer='templates/page.mako')\n@view_config(route_name='page_vie... | python | chosen |
[
{
"from": "system",
"value": "Add writing_system to ArabicDefaults (experimental)\n"
},
{
"from": "human",
"value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .stop_words import STOP_WORDS\nfrom .lex_attrs import LEX_ATTRS\nfrom .punctuation import TOKENIZER_SUFFIXES\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Add history qs to swf querysets modules\n"
},
{
"from": "human",
"value": "#! -*- coding:utf-8 -*-\n\nfrom swf.querysets.activity import ActivityTypeQuerySet\nfrom swf.querysets.domain import DomainQuerySet\nfrom swf.querysets.workflow import (WorkflowTypeQuerySet,\... | python | chosen |
[
{
"from": "human",
"value": "Add intial tests for decorators.\n"
},
{
"from": "gpt",
"value": "from name.decorators import jsonp\nfrom mock import MagicMock\n\n\ndef test_jsonp_returns_without_status_code_200():\n # Setup the mock view.\n f = MagicMock()\n f.__name__ = 'Wrapped View'\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix case where annotations may not exist\n"
},
{
"from": "human",
"value": "'''\nSimple webhook bridge\nAccepts alert json from Alert Manager and then POSTs individual alerts to\nconfigured webhook destinations\n'''\n\nimport logging\nimport requests\nfrom promgen.s... | python | chosen |
[
{
"from": "system",
"value": "Allow ``table`` attributes during HTML sanitation.\n\nTables are part of the content expected to be added\nin some of the resources in the site.\n"
},
{
"from": "human",
"value": "import bleach\n\nALLOWED_TAGS = [\n 'a',\n 'abbr',\n 'acronym',\n 'b',\n ... | python | chosen |
[
{
"from": "system",
"value": "Make the distutils version number the same as the python version. It\nmust be literally contained here, because it is still possible to\ninstall this distutils in older Python versions.\n"
},
{
"from": "human",
"value": "\"\"\"distutils\n\nThe main package for the ... | python | chosen |
[
{
"from": "system",
"value": "Update conary migration script to deal with extended config\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\n# Copyright (c) 2006 rPath, Inc\n# All rights reserved\n\nimport sys\nimport os\nimport pwd\nfrom conary.server import schema\nfrom conary.lib import ... | python | chosen |
[
{
"from": "system",
"value": "Rename class to sync with new file name.\n"
},
{
"from": "human",
"value": "import subprocess\nimport sys\nimport unittest\n\nfrom django.conf import settings\n\n#\n# Must configure settings before importing base.\n#\n\ndb = 'testdjangodb1'\nschema = 'django1'\nuser... | python | chosen |
[
{
"from": "system",
"value": "Add reset attempts to PillowError actions\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom pillow_retry.models import PillowError\n\n\n@admin.register(PillowError)\nclass PillowErrorAdmin(admin.ModelAdmin):\n\n model = PillowError\n ... | python | chosen |
[
{
"from": "system",
"value": "Solve Code Fights array replace problem\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python\n# Code Fights Add Border Problem\n\n\ndef arrayReplace(inputArray, elemToReplace, substitutionElem):\n pass\n\n\ndef main():\n pass\n\n\nif __name__ == '__main_... | python | chosen |
[
{
"from": "system",
"value": "Remove comments in fsm tests\n"
},
{
"from": "human",
"value": "# Copyright 2015 Yelp 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# You may obtain a copy of the Lic... | python | chosen |
[
{
"from": "system",
"value": "Add ability to get book details\n"
},
{
"from": "human",
"value": "import os\n\nfrom bs4 import BeautifulSoup\nimport requests\n\n\nclass FreePacktBook(object):\n\n base_url = 'https://www.packtpub.com'\n url = base_url + '/packt/offers/free-learning/'\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update Worker API\n- ADD type hints\n- Remove unused imports\n"
},
{
"from": "human",
"value": "# stdlib\nfrom typing import Any\nfrom typing import Dict\n\n# third party\nfrom pandas import DataFrame\n\n# syft relative\nfrom ...messages.infra_messages import Create... | python | chosen |
[
{
"from": "system",
"value": "Add version check for importing django.contrib.postgres.fields.ArrayField\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.5 on 2016-06-09 10:26\nfrom __future__ import unicode_literals\n\nimport django.contrib.postgres.fields\nf... | python | chosen |
[
{
"from": "system",
"value": "Rename event types for consistency\n\n- NC-332\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport logging\n\nfrom nodeconductor.core.log import EventLoggerAdapter\n\n\nlogger = logging.getLogger(__name__)\nevent_logger = EventLogger... | python | chosen |
[
{
"from": "system",
"value": "Rename database in log file.\n"
},
{
"from": "human",
"value": "import os\nimport commands\nimport time\nimport logging\nimport sys\n\nif len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):\n print \"ERROR! Use:\\n python scripts/data_download/school_cen... | python | chosen |
[
{
"from": "system",
"value": "Correct call to super constructor\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom flexbe_core import EventState, Logger\nimport rospy\nimport re\nimport ros\nimport math\n\nclass getDistance(EventState):\n \"\"\"\n Calcule la distance entre de... | python | chosen |
[
{
"from": "system",
"value": "Smallfix: Send print message to sys.stderr\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom rest_framework import views\nfrom rest_framework import status, exceptions\nfrom rest_framework.response import Response\n\ndef patch_api_view():\n from ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.