conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Set development process to threaded\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\nfrom titanembeds.app import app\n\ndef init_debug():\n import os\n from flask import jsonify, request\n \n os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Te... | python | chosen |
[
{
"from": "system",
"value": "Add `django.setup()` in `load_ipython_extension` function for django>=1.7 compatibility\n"
},
{
"from": "human",
"value": "# flake8: noqa\nfrom .base import Settings, Configuration\nfrom .decorators import pristinemethod\n\n__version__ = '0.8'\n__all__ = ['Configura... | python | chosen |
[
{
"from": "system",
"value": "Fix Search Strip script again (for sound files)\n"
},
{
"from": "human",
"value": "#=========== MODIFY PARAMETERS HERE =================\n\nsearch_string=\"rea-mix-2016-05-13\"\n\n#=====================================================\n\nimport bpy\n\nseq=bpy.data.... | python | chosen |
[
{
"from": "system",
"value": "Add a \"modified\" property that will only be updated when the entity is actually updated.\n"
},
{
"from": "human",
"value": "from datetime import datetime, timedelta\n\nfrom google.appengine.ext import db\n\n\nclass CHPIncident(db.Model):\n\tCenterID = db.StringPro... | python | chosen |
[
{
"from": "system",
"value": "Allow generating one specific xml file instead of the whole directory.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport os\nimport subprocess\nimport sys\n\nBASEDIR = '../main/src/com/joelapenna/foursquare'\nTYPESDIR = '../captures/types/v1'\n\nfor f i... | python | chosen |
[
{
"from": "system",
"value": "Fix folder structure of created tarballs\n"
},
{
"from": "human",
"value": "import os\nimport tarfile\nimport tempfile\n\n\ndef make_tarball(source, tar_basename, extension=\".tar.gz\", compression=\"gz\"):\n dest = tempfile.mkdtemp()\n tar_name = \"{}{}\".for... | python | chosen |
[
{
"from": "system",
"value": "Fix migrations (filename default value)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nfrom django.conf import settings\nimport django.utils.timezone\nimport user_clipb... | python | chosen |
[
{
"from": "system",
"value": "Remove get_sequence_mask in favor of simpler embedding mask\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport numpy as np\nimport tensorflow as tf\n\ndef get_se... | python | chosen |
[
{
"from": "system",
"value": "Fix for lazy loading of request.user\n"
},
{
"from": "human",
"value": "from django.http import Http404\nfrom django.contrib.auth import get_user_model\nfrom django.shortcuts import render, get_object_or_404\nfrom django.utils.translation import ugettext as _\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Remove logger and fix typos\n\n[DEV-12140]\n"
},
{
"from": "human",
"value": "\"\"\"\nTwo User Approval\n\nOverrides CloudBolt's standard Order Approval workflow. This Orchestration\nAction requires two users to approve an order before it is becomes Active.\n\"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Update reference to Seriesly hostname\n\nChange-Id: I03eb6b3551e21d6987f15ec236c40546b312e663\nReviewed-on: http://review.couchbase.org/71447\nReviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com>\nTested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce... | python | chosen |
[
{
"from": "system",
"value": "Handle cases where the server doesn't return content-type\n\n\ngit-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@120 dda364a1-ef19-0410-af65-756c83048fb2\n"
},
{
"from": "human",
"value": "\"\"\"Warns about large files\"\"\"\n\ndef handle_url(bot, user, channel, ... | python | chosen |
[
{
"from": "system",
"value": "Update PR regarding hook accepted by Odoo\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu)\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nfrom openerp import api, m... | python | chosen |
[
{
"from": "system",
"value": "Fix test_deploy_with_operation_executor_override by setting back the version of target_aware_mock plugin to 1.0\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='target-aware-mock',\n version='4.2',\n packages=['target_aware_... | python | chosen |
[
{
"from": "system",
"value": "USe -q:a flag for mp3 encoder\n"
},
{
"from": "human",
"value": "from multiprocessing import cpu_count\n\n\nENCODING_OPTIONS = {\n 'mp3': '-c:a libmp3lame '\n '-vbr 3 ',\n 'h264': '-c:v libx264 '\n '-preset ultrafast '\n '-crf 2... | python | chosen |
[
{
"from": "system",
"value": "Add preferences model with address rep and sen\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n"
},
{
"from": "gpt",
"value": "from django.db import models\n\nfrom opencivicdata.models.people_orgs import Per... | python | chosen |
[
{
"from": "system",
"value": "Add API to LmdbReader (used by gan_features.py)\n"
},
{
"from": "human",
"value": "# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.\nfrom __future__ import absolute_import\n\nimport lmdb\n\n\nclass DbReader(object):\n \"\"\"\n Reads a database\n... | python | chosen |
[
{
"from": "system",
"value": "Reformat for easier copy and pasting (needed for usability with AWS Console).\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom timeit import default_timer as timer\n\nimport json\nimport datetime\n\nprint('Loading function') \n\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Add test that error gets raised when no plugin available\n"
},
{
"from": "human",
"value": "import os\n\nfrom numpy.testing import assert_array_equal, raises, run_module_suite\nimport numpy as np\n\nimport skimage.io as io\nfrom skimage import data_dir\n\n\ndef test... | python | chosen |
[
{
"from": "system",
"value": "Add user-agent field to html_fetcher\n"
},
{
"from": "human",
"value": "import os\nimport sys\nsys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport requests\n\n\ndef fetch_html_document(url):\n \"\"\"Fetch html from url and re... | python | chosen |
[
{
"from": "system",
"value": "Fix prototype template loading error\n"
},
{
"from": "human",
"value": "import yaml\nimport os.path\n\nfrom django.http import Http404\nfrom django.conf.urls import url\nfrom django.conf import settings\n\n\ndef get_page(path):\n url = ('/%s/' % path) if path els... | python | chosen |
[
{
"from": "system",
"value": "Change port to enable export\n"
},
{
"from": "human",
"value": "import annotator_supreme\n\nif __name__ == \"__main__\":\n app = annotator_supreme.build_app()\n app.run(debug=True, host='0.0.0.0', port=4242)\n print(\"Running app on port {}\".format(4242))\... | python | chosen |
[
{
"from": "system",
"value": "Add failing test for exception handling regression\n\nCode coming out of custom error message needs to be the code expected.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_func... | python | chosen |
[
{
"from": "system",
"value": "Settings: Read database configuration from base directory\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom defaults import * # noqa\nimport json\n\n\nDEBUG = False\nTEMPLATE_DEBUG = False\nALLOWED_HOSTS = ['.searchlogger.tu... | python | chosen |
[
{
"from": "system",
"value": "Add phone to 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 UserSe... | python | chosen |
[
{
"from": "system",
"value": "Use rprop for xor example.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n'''Example using the theanets package for learning the XOR relation.'''\n\nimport climate\nimport logging\nimport numpy as np\nimport theanets\n\nclimate.... | python | chosen |
[
{
"from": "system",
"value": "Test Deploy resource after reworking.\n"
},
{
"from": "human",
"value": "from restkit import Resource\n\nfrom hoppy import api_key\n\nclass Deploy(Resource):\n def __init__(self, use_ssl=False):\n self.api_key = api_key\n super(Deploy, self).__init_... | python | chosen |
[
{
"from": "system",
"value": "Fix state machine using wrong variable\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport rospy\n\n\nclass StopStates(object):\n NORMAL = 0\n FULL_STOP = 1\n IGNORE_STOP_SIGNS = 2\n\n\nclass StopSign(object):\n\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove duplicate fields from ZoneTransferRequest object\n\nThe fields id, version, created_at, updated_at are defined in the\nPersistentObjectMixin which ZoneTransferRequest extends, so this\npatch removes them from ZoneTransferRequest.\n\nChange-Id: Iff20a31b4a208bff0bc879677a... | python | chosen |
[
{
"from": "system",
"value": "Remove extra noise on install.\n"
},
{
"from": "human",
"value": "\nimport os\nfrom numpy.distutils.misc_util import Configuration\n\ndef configuration(parent_package='',top_path=None):\n config = Configuration('misc',parent_package, top_path)\n config.add_dat... | python | chosen |
[
{
"from": "system",
"value": "Fix redirect URI in oauthdone\n"
},
{
"from": "human",
"value": "import requests\nfrom django.shortcuts import render\nfrom django.conf import settings\n\ndef oauthtest(request):\n return render(request, 'oauthtest.html', {\n 'link': '{}o/authorize/?respon... | python | chosen |
[
{
"from": "system",
"value": "Support both windows and shell environments when launching fuseki\n"
},
{
"from": "human",
"value": "__author__ = 'adam'\n\nimport time\nfrom subprocess import Popen\nimport shlex\nimport os\nimport urllib\n\ndef LaunchFuseki():\n fuseki_url = \"http://localhost:... | python | chosen |
[
{
"from": "system",
"value": "Fix arg order for supervisord_restart_prog\n"
},
{
"from": "human",
"value": "from fabric.api import *\nfrom fabtastic.fabric.util import _current_host_has_role\n\ndef supervisord_restart_all(roles='webapp_servers'):\n \"\"\"\n Restarts all of supervisord's ma... | python | chosen |
[
{
"from": "system",
"value": "Fix window test border _again_ (more fixed).\n\n\n\ngit-svn-id: d4fdfcd4de20a449196f78acc655f735742cd30d@1383 14d46d22-621c-0410-bb3d-6f67920f7d95\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\r\n# $Id:$\r\n\r\nfrom pyglet.gl import *\r\n\r\ndef draw_client_b... | python | chosen |
[
{
"from": "system",
"value": "Add user argument to get_jobs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport subprocess as sp\n\nfrom .parser import JobsParser\n\n\ndef get_jobs():\n xml_text = fetch_xml()\n parser = JobsParser(xml_text)\n retu... | python | chosen |
[
{
"from": "system",
"value": "Remove unused imports for lint"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nunittests for yaml outputter\n'''\n\n# Import Python Libs\nfrom __future__ import absolute_import\nfrom StringIO import StringIO\nimport sys\n\n# Import Salt Testing Libs\n... | python | chosen |
[
{
"from": "system",
"value": "Add affected users to userhasoperpermission call in USERHOST\n"
},
{
"from": "human",
"value": "from twisted.plugin import IPlugin\nfrom twisted.words.protocols import irc\nfrom txircd.module_interface import Command, ICommand, IModuleData, ModuleData\nfrom zope.int... | python | chosen |
[
{
"from": "system",
"value": "Fix regex for tern complete_strings plugin\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport json\nimport os.path\nimport re\n\nfrom completor import Completor\nfrom completor.compat import to_unicode\n\ndirname = os.path.dirname(__file__)\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Make sure the limit is an int\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask import jsonify\nfrom red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets\nfrom jsonp_flask import support_jsonp\n\napp = Flask(__name__)\n\n@app... | python | chosen |
[
{
"from": "system",
"value": "Revert \"add 505 and 403 to retry status codes due to amazon s3 random fails while uploading images\"\n\nThis reverts changeset r457\n\n--HG--\nextra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40461\n"
},
{
"from": "human",
"value": "import scra... | python | chosen |
[
{
"from": "system",
"value": "Include example of css render_mode\n"
},
{
"from": "human",
"value": "from bokeh.plotting import figure, show, output_file\nfrom bokeh.models import ColumnDataSource, Range1d, Label\n\noutput_file(\"label.html\", title=\"label.py example\")\n\nsource = ColumnDataSou... | python | chosen |
[
{
"from": "system",
"value": "Fix for assertIs method not being present in Python 2.6.\n"
},
{
"from": "human",
"value": "from datetime import datetime\nimport sys\nimport unittest\n\nimport btceapi\n\n\nclass TestScraping(unittest.TestCase):\n def test_scrape_main_page(self):\n mainPa... | python | chosen |
[
{
"from": "system",
"value": "Maintain compatilbility with <10 version"
},
{
"from": "human",
"value": "\"\"\"Necessary monkey patches to make Odoo work in the buildout context.\n\"\"\"\n\nimport subprocess\n\n\ndef do_patch(gevent_script_path):\n \"\"\"\n Patch odoo prefork so that --work... | python | chosen |
[
{
"from": "system",
"value": "Improve PEP8 compliance in op_client_helper.py\n"
},
{
"from": "human",
"value": "from openprocurement_client.client import Client\nimport sys\n\ndef prepare_api_wrapper(key='', host_url=\"https://api-sandbox.openprocurement.org\", api_version='0.8' ):\n return C... | python | chosen |
[
{
"from": "system",
"value": "Move top-level imports from v0 to v1.\n"
},
{
"from": "human",
"value": "# Import intake to run driver discovery first and avoid circular import issues.\nimport intake\ndel intake\n\nimport warnings\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Change 'add_sample' permission to 'create_sample'\n\n"
},
{
"from": "human",
"value": "#: A list of the permission strings used by Virtool.\nPERMISSIONS = [\n \"add_virus\",\n \"modify_virus\",\n \"remove_virus\",\n \"modify_hmm\",\n \"add_sample\",\n... | python | chosen |
[
{
"from": "system",
"value": "Correct test to support changing N release name\n\noslo.log is going to change to use Newton rather than N so this test\nshould not make an assumption about the way that\nversionutils.deprecated is calling report_deprecated_feature.\n\nChange-Id: I06aa6d085232376811f73597b2d84b... | python | chosen |
[
{
"from": "system",
"value": "Fix get taxlot url and remove trailing slashes\n"
},
{
"from": "human",
"value": "from django.urls import include, re_path, path\nfrom landmapper.views import *\n\nurlpatterns = [\n # What is difference between re_path and path?\n # re_path(r'',\n # hom... | python | chosen |
[
{
"from": "system",
"value": "Return short URL if it's already exists\n"
},
{
"from": "human",
"value": "from flask import Blueprint, jsonify, request\n\nfrom usb.models import db, Redirect, DeviceType\nfrom usb.shortener import get_short_id, get_short_url\n\napi = Blueprint('api', __name__)\n\n... | python | chosen |
[
{
"from": "system",
"value": "Disable error-checking that assumes Python 3 for these Python 2 helpers,\nlandscape.io style\n"
},
{
"from": "human",
"value": "\"\"\"\nString/unicode helper functions\n\"\"\"\n\ndef safe_unicode(obj, *args):\n \"\"\" return the unicode representation of obj \"\"... | python | chosen |
[
{
"from": "system",
"value": "Make local mysql db name overridable with DATABASE_NAME environment variable\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom volunteer_planner.settings.local import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.mysql',\n ... | python | chosen |
[
{
"from": "system",
"value": "Set config logging in init to debug\n"
},
{
"from": "human",
"value": "import os, logging\nfrom flask import Flask\nfrom flask.ext.basicauth import BasicAuth\nfrom raven.contrib.flask import Sentry\n\napp = Flask(__name__)\n\napp.config.from_object(os.environ.get('S... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with headers about additional language in description rather than header\n"
},
{
"from": "human",
"value": "\"\"\"\nConfig file specific to uk to create automated survey\n\"\"\"\n\nclass config:\n\n # To modify, just add the keys of the dictionary\n ... | python | chosen |
[
{
"from": "system",
"value": "Make ipython profile python3 compliant\n"
},
{
"from": "human",
"value": "def bytes(b):\n \"\"\" Print bytes in a humanized way \"\"\"\n def humanize(b, base, suffices=[]):\n bb = int(b)\n for suffix in suffices:\n if bb < base:\n break\n bb... | python | chosen |
[
{
"from": "system",
"value": "Update cumulative similarities on save\n"
},
{
"from": "human",
"value": "from django.shortcuts import get_object_or_404\nfrom rest_framework import permissions, viewsets\n\nfrom similarities.utils import get_similar\nfrom .models import Artist\nfrom similarities.mo... | python | chosen |
[
{
"from": "system",
"value": "Rename method to be more logical\n"
},
{
"from": "human",
"value": "from .base import Base\n\n\nclass List(Base):\n def __init__(self, result, object_type):\n Base.__init__(self, result)\n self.object_type = object_type\n\n def get_resource_name(... | python | chosen |
[
{
"from": "system",
"value": "Print client-POSTed data, more verbose error handling\n\nAnd less fiddling with the returned header. For the time being,\nI don't care about correcting the bugs in that part of the code.\n"
},
{
"from": "human",
"value": "# Adapted from http://stackoverflow.com/ques... | python | chosen |
[
{
"from": "system",
"value": "Fix db_downgrade for \"System editable object state\"\n"
},
{
"from": "human",
"value": "\n\"\"\"System editable object state\n\nRevision ID: 5254f4f31427\nRevises: 512c71e4d93b\nCreate Date: 2015-02-05 02:05:09.351265\n\n\"\"\"\n\n# revision identifiers, used by Al... | python | chosen |
[
{
"from": "system",
"value": "Remove the static pin fir analog read\n"
},
{
"from": "human",
"value": "#Creating a key value store for all the urls\nBASE_URL = 'http://cloud.boltiot.com/remote/'\n\nurl_list = {\n 'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',\n 'digitalR... | python | chosen |
[
{
"from": "system",
"value": "Fix Import error as a result of answering No to include Login\n"
},
{
"from": "human",
"value": "\"\"\"template URL Configuration\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/ur... | python | chosen |
[
{
"from": "system",
"value": "Throw deprecation warnings for these imports, which will be removed in the next version. They've been deprecated for two years so we can make it happen.\n"
},
{
"from": "human",
"value": "# Here for backwards compatibility (deprecated)\nfrom django.utils.safestring ... | python | chosen |
[
{
"from": "system",
"value": "Fix whitespace in bash script code template\n\nSigned-off-by: Arun Sori <e3bf7af6e125f7de61de92cd66a64411bed42bee@gmail.com>\n"
},
{
"from": "human",
"value": "begin_code = \"\"\"\n#!/usr/bin/env bash\ncurl -s --request \"\"\"\n\nrequest_header = \"\"\" --header \"{... | python | chosen |
[
{
"from": "system",
"value": "Use url from the parameters\n"
},
{
"from": "human",
"value": "\"\"\"Functions to retrieve pending list and invoke Graph Sync.\"\"\"\n\nimport f8a_jobs.defaults as configuration\nimport requests\nimport traceback\nimport logging\n\n\nlogger = logging.getLogger(__nam... | python | chosen |
[
{
"from": "system",
"value": "Allow QuerySet objects to be reversed\n"
},
{
"from": "human",
"value": "from reobject.utils import signed_attrgetter\n\nclass QuerySet(list):\n def __init__(self, *args, **kwargs):\n super(QuerySet, self).__init__(*args, **kwargs)\n\n def count(self):\... | python | chosen |
[
{
"from": "system",
"value": "Remove man pages post-install (for now)\n"
},
{
"from": "human",
"value": "import xyz\nimport os\nimport shutil\n\nclass Binutils(xyz.BuildProtocol):\n pkg_name = 'binutils'\n supported_targets = ['arm-none-eabi']\n\n def check(self, builder):\n if b... | python | chosen |
[
{
"from": "system",
"value": "Fix URL pattern after removing\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom .views import settings_json\n\n\nurlpatterns += patterns('',\n url(r'^api/settings.json', settings_json, name='settings_json'),\n)\n"
},
{
"... | python | chosen |
[
{
"from": "system",
"value": "Add logic for grabbing file descriptor from FILE struct\n"
},
{
"from": "human",
"value": "import simuvex\nfrom simuvex.s_type import SimTypeFd\n\nimport logging\nl = logging.getLogger(\"simuvex.procedures.fileno\")\n\n######################################\n# memse... | python | chosen |
[
{
"from": "system",
"value": "Fix notifications building from JSON\n\nSometimes (like in welcome messages), notifications don't have a\n'title' property, so we shouldn't assume there is one.\n\nBug: T139015\nChange-Id: I83e480d04e8e09aa9bcb5edef4f56b47d150e199\n"
},
{
"from": "human",
"value": "... | python | chosen |
[
{
"from": "system",
"value": "Fix url fields when no value is set\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom urlparse import urlparse\n\nfrom django.contrib.admin.widgets import AdminURLFieldWidget\nfrom django.forms.widgets import CheckboxFieldRenderer, C... | python | chosen |
[
{
"from": "system",
"value": "Use DRF's built-in search filter\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.shortcuts import render\n\n# Create your views here.\n\nimport django_filters\n\nfrom rest_framework import viewsets\nfrom rest_framework import filters\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add strings to print hello world\n"
},
{
"from": "human",
"value": "\n#This is my hello world program\nstr1='Hello'\nstr2='Tarun'\nprint str1 +' '+ str2\n\n# this is my hello world program\nprint 'Hello World!'\n\n\n#This is my Hello world program\nstr1='Hello'\nstr... | python | chosen |
[
{
"from": "system",
"value": "Remove trailing $ from regex\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jon Surrell\n# Copyright (c) 2014 Jon Surrell\n#\n# License: MIT\n#\n\n\"\"\"This module export... | python | chosen |
[
{
"from": "system",
"value": "Add instance assertion to table\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Dave Lasley <dave@laslabs.com>\n# Copyright: 2015 LasLabs, Inc [https://las... | python | chosen |
[
{
"from": "system",
"value": "Update shebang to request python 3\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\r\n\r\nimport argparse\r\nimport dice\r\n\r\ndef main():\r\n roller = dice.Roller(args)\r\n for repeat in range(args.repeats):\r\n roller.do_roll()\r\n for re... | python | chosen |
[
{
"from": "system",
"value": "Add logging for UnicodeDecodeError excpetion LoggerBackend\n"
},
{
"from": "human",
"value": "\"\"\"Event tracker backend that saves events to a python logger.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport logging\nimport json\n\nfrom django.conf import ... | python | chosen |
[
{
"from": "system",
"value": "Use Cache location instead of temp folder\n"
},
{
"from": "human",
"value": "\nimport sys\nimport sip\n\nimport qtpy\n\n\n__all__ = [\n 'getQVariantValue',\n 'wheelAngleDelta',\n]\n\n\ntry:\n if qtpy.PYQT5:\n QVARIANT_API = 2\n else:\n QVAR... | python | chosen |
[
{
"from": "system",
"value": "Debug Google Cloud Run support\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n#\n# Define containerized environment for running Diosix on Qemu\n#\n# On Google Cloud Run: Creates HTTP server on port 8080\n# or whatever was specified using the PORT system vari... | python | chosen |
[
{
"from": "system",
"value": "feat: Add storage and repo helper functions\n"
},
{
"from": "human",
"value": "\"\"\"Helper method for getting artifactory information.\"\"\"\nimport logging\n\nfrom .artifactory import Artifactory\n\n\ndef get_artifactory_info(repo_names=None, repo_type='local'):\n... | python | chosen |
[
{
"from": "system",
"value": "Add environment not found exception\n"
},
{
"from": "human",
"value": "class CondaEnvException(Exception):\n pass\n\n\nclass EnvironmentFileNotFound(CondaEnvException):\n def __init__(self, filename, *args, **kwargs):\n msg = '{} file not found'.format(... | python | chosen |
[
{
"from": "system",
"value": "Index only FoiRequests marked is_foi"
},
{
"from": "human",
"value": "from haystack import indexes\n\nfrom celery_haystack.indexes import CelerySearchIndex\n\nfrom .models import FoiRequest\n\n\nclass FoiRequestIndex(CelerySearchIndex, indexes.Indexable):\n text ... | python | chosen |
[
{
"from": "system",
"value": "[python] Mark get_test_binary as not being a test\n\nget_test_binary is a helper method, not a test, make sure nosetests\ndoesn't pick it up as a test.\n\n\n\ngit-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@153173 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from"... | python | chosen |
[
{
"from": "system",
"value": "Fix PEP 8 coding violations\n"
},
{
"from": "human",
"value": "\"\"\"Example config.py\"\"\"\n\nwebhook_urls = [\"DISCORD WEBHOOK\", \"DISCORD WEBHOOK\"] # Used to update webhooks on Discord\nkey_path = \"/path/to/key/in/format/of/file.pem\" # Private key to sign th... | python | chosen |
[
{
"from": "system",
"value": "Use json standard module if simplejson is not present"
},
{
"from": "human",
"value": "import os, sys, re\nfrom simplejson import load as json\nfrom simplejson import dumps as dump\nfrom glob import glob\n\nVERSION = 0.1\n\nall = []\n \nfor p in glob(\"../plugins... | python | chosen |
[
{
"from": "system",
"value": "Add a default value for SENTRY_PARAMS\n"
},
{
"from": "human",
"value": "import logging\n\nimport sanic\n\nimport raven\nimport raven_aiohttp\nfrom raven.handlers.logging import SentryHandler\n\ntry:\n from sanic.log import logger\nexcept ImportError:\n logger... | python | chosen |
[
{
"from": "system",
"value": "Add version number and copyright to goo.js\n\nThis is useful to keep track of which engine version the tool uses, story #294\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport shutil\nimport subprocess\nfrom zipfile import ZipF... | python | chosen |
[
{
"from": "system",
"value": "Enable the review queue on the demo site\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom widgy.site import WidgySite\n\n\nclass DemoWidgySite(WidgySite):\n def valid_parent_of(self, parent, child_class, obj=None):\n if isi... | python | chosen |
[
{
"from": "system",
"value": "Add length method to Raffle\n"
},
{
"from": "human",
"value": "\"\"\"\nSt. George Game\nraffle.py\nSage Berg\nCreated: 9 Dec 2014\n\"\"\"\n\nfrom random import randint\n\n\nclass Raffle(object):\n \"\"\"\n Raffle contains a list of action objects, one of which... | python | chosen |
[
{
"from": "system",
"value": "Use a decorator for slickness.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import Discussion, Group\n\n\nclass GroupAdmin(admin.ModelAdmin):\n filter_horizontal = ('moderators', 'watchers', 'members_if_private')\n\n clas... | python | chosen |
[
{
"from": "system",
"value": "Add filter.rank to __all__ of filter package\n"
},
{
"from": "human",
"value": "from .lpi_filter import inverse, wiener, LPIFilter2D\nfrom .ctmf import median_filter\nfrom ._canny import canny\nfrom .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, pre... | python | chosen |
[
{
"from": "system",
"value": "Fix ordering of query params\n\n3rd time's a charm\n"
},
{
"from": "human",
"value": "import hashlib\nimport urllib\n\n# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py\ndef gravatar(user, use_ssl=False, d=None, r=None, size=... | python | chosen |
[
{
"from": "system",
"value": "Revert \"printing META for troubleshooting\"\n\nThis reverts commit 42d15d528da14866f2f0479da6462c17a02d8c84.\n"
},
{
"from": "human",
"value": "from django.contrib.auth.middleware import RemoteUserMiddleware\n\nclass VodafoneLiveUserMiddleware(RemoteUserMiddleware)... | python | chosen |
[
{
"from": "system",
"value": "Add code to silence requests logger in the handler\n"
},
{
"from": "human",
"value": "import logging\nimport socket\nimport traceback\n\nfrom threading import Thread\n\nimport requests\n\n\nclass SplunkHandler(logging.Handler):\n \"\"\"\n A logging handler to ... | python | chosen |
[
{
"from": "system",
"value": "Use one query with group_by for service status\n"
},
{
"from": "human",
"value": "from flask import jsonify\nfrom sqlalchemy.types import String\nfrom sqlalchemy import func\nimport datetime\n\nfrom .. import main\nfrom ...models import db, Framework, DraftService, ... | python | chosen |
[
{
"from": "system",
"value": "Add more details to event logs for property CRUD\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport logging\n\nfrom .log import event_logger\n\nlogger = logging.getLogger(__name__)\n\n\ndef log_saltstack_property_created(sender, ins... | python | chosen |
[
{
"from": "system",
"value": "Remove more irrelevant tests, those will be replaced with proper casperjs tests\n"
},
{
"from": "human",
"value": "from __future__ import with_statement\n\nimport django\nimport pytest\n\nfrom django.conf import settings as real_settings\nfrom django.utils.encoding ... | python | chosen |
[
{
"from": "system",
"value": "Add custom Admin model TaxonomyNode, hide freesound ex\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode\n\nadmin.site.register(Dataset)\nadmin.si... | python | chosen |
[
{
"from": "system",
"value": "Fix home view so it returns 200 for unauthenticated health check\n"
},
{
"from": "human",
"value": "from django.shortcuts import redirect\nfrom django.urls import reverse\nfrom django.views.generic import View\n\n\nclass HomeView(View):\n\n def get(self, *args, *... | python | chosen |
[
{
"from": "system",
"value": "Use str() not repr() to avoid trailing L on longs\n"
},
{
"from": "human",
"value": "from functools import wraps\n\ndef additional_type_handler(func):\n @wraps(func)\n def _wrapper(self, o):\n if isinstance(o, set):\n # Return a string repres... | python | chosen |
[
{
"from": "system",
"value": "Add testing function from python\n"
},
{
"from": "human",
"value": "from .modinfo import *\n\n# SO file\nfrom .testing import *\n\n\n# For output\nfrom bpmodule import output\n\n\n\n\ndef PrintHeader(s):\n output.Output(output.Line(\"=\"))\n output.Output(\"%1... | python | chosen |
[
{
"from": "system",
"value": "Update version number to 0.2.\n"
},
{
"from": "human",
"value": "\"\"\"Package providing an implementation of the TOPKAPI model and some utilities.\r\n\r\nThe interface isn't stable yet so be prepared to update your code\r\non a regular basis...\r\n\r\n\"\"\"\r\n\r\... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.