conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Create a new figure for imshow if there is already data\n"
},
{
"from": "human",
"value": "import matplotlib.pyplot as plt\n\n\ndef imshow(*args, **kwargs):\n kwargs.setdefault('interpolation', 'nearest')\n kwargs.setdefault('cmap', 'gray')\n plt.imshow(*ar... | python | chosen |
[
{
"from": "system",
"value": "Add some git hook related tasks to paver file\n"
},
{
"from": "human",
"value": "import os.path\nfrom paver.easy import sh, task\n\n\nconfig = \"\"\"# replace pass with values you would like to overwrite from DefaultConfig in\n# default_config.py. Values you do not ... | python | chosen |
[
{
"from": "system",
"value": "Fix argument ordering in Mistress of Pain\n\nFixes #71\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\n# Mistress of Pain\nclass GVG_018:\n\tevents = [\n\t\tDamage().on(\n\t\t\tlambda self, source, target, amount: source is self and [H... | python | chosen |
[
{
"from": "system",
"value": "Make the password hashing unicode safe.\n"
},
{
"from": "human",
"value": "import hashlib\nimport os\nimport string\nimport random\n\nfrom django.conf import settings\n\ndef hasher(string):\n '''Helper method to hash a string to SHA512'''\n h = hashlib.sha512(... | python | chosen |
[
{
"from": "system",
"value": "Allow test to run without MTurk/AWS credentials configured, and defend against other tests which don’t clean up database\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport os\nimport mock\nfrom dallinger.config import get_config\nf... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary arguments from autograd hessian\n"
},
{
"from": "human",
"value": "\"\"\"\nModule containing functions to differentiate functions using autograd.\n\"\"\"\nimport autograd.numpy as np\nfrom autograd.core import grad\n\nfrom ._backend import Backend... | python | chosen |
[
{
"from": "system",
"value": "Make all data records store record id keys as strings\n"
},
{
"from": "human",
"value": "class DataRecord:\n\n @classmethod\n def get_store( cls ):\n if hasattr( cls, 'store' ): return cls.store\n cls.store = {}\n return cls.store\n\n @classmethod\n def... | python | chosen |
[
{
"from": "system",
"value": "Modify regex group for username to allow periods\n\nFix for #1076"
},
{
"from": "human",
"value": "from app.plugins import PluginBase, Menu, MountPoint\nfrom django.shortcuts import render\nfrom django.contrib.auth.decorators import login_required\nfrom django.utils... | python | chosen |
[
{
"from": "system",
"value": "Remove stupid South thing that is messing up Heroku\n\nremove, I say!!"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# This manage.py exists for the purpose of creating migrations\nimport sys\n\nimport django\n\nfrom django.conf import settings\n\nsettin... | python | chosen |
[
{
"from": "system",
"value": "Allow to format messages sent to Slack\n"
},
{
"from": "human",
"value": "from slackclient import SlackClient\n\n\ndef send_to_slack(app_token, userid, message):\n client = SlackClient(token=app_token)\n client.api_call(\n \"chat.postMessage\", channel=... | python | chosen |
[
{
"from": "system",
"value": "Use empty dict instead of True for remote resource queryset\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\nimport json\nimport six\n\nfrom rest_framework.relations import *\nfrom rest_framework_json_api.relations import ResourceRelatedField\... | python | chosen |
[
{
"from": "system",
"value": "[Disk] Allow Agent to properly pull version info"
},
{
"from": "human",
"value": "# (C) Datadog, Inc. 2018\n# All rights reserved\n# Licensed under a 3-clause BSD style license (see LICENSE)\nfrom .disk import Disk\n\n__all__ = ['Disk']\n"
},
{
"from": "gpt"... | python | chosen |
[
{
"from": "system",
"value": "Change create_subtraction permission to modify_subtraction\n\n"
},
{
"from": "human",
"value": "#: A list of the permission strings used by Virtool.\nPERMISSIONS = [\n \"cancel_job\",\n \"create_sample\",\n \"create_subtraction\",\n \"manage_users\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Document source and target arguments of envy scp\n\nFix issue #67\n"
},
{
"from": "human",
"value": "import logging\n\nimport fabric.api\nimport fabric.operations\n\nfrom cloudenvy.envy import Envy\n\n\nclass EnvySCP(object):\n \"\"\"SCP Files to your ENVy\"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Make sure that have intervals of the form [start, end).\n"
},
{
"from": "human",
"value": "class IntervalStorage(object):\n def __init__(self, interval_map=None):\n if interval_map == None:\n self.interval_map = {}\n else:\n if... | python | chosen |
[
{
"from": "system",
"value": "Fix file not found error on directory\n\n"
},
{
"from": "human",
"value": "import subprocess\n\nfrom functools import wraps\nimport os\n\nextensions = {}\n\n\ndef extension(f):\n # keep unwrapped function\n unwrapped = f\n\n @wraps(f)\n def wrapper(**kwa... | python | chosen |
[
{
"from": "system",
"value": "Correct JSON/BSON terminology in docstrings\n"
},
{
"from": "human",
"value": "\"\"\"Representation filters for API\"\"\"\n\nfrom flask import make_response, current_app\nfrom bson.json_util import dumps\n\n\ndef output_bson(data, code, headers=None):\n \"\"\"Mak... | python | chosen |
[
{
"from": "system",
"value": "Update packer system to include REVISION number too\n"
},
{
"from": "human",
"value": "import sys\nimport os\n\noutput = '../build/Tween.js';\n\n# os.system(\"java -jar yuicompressor-2.4.2.jar ../src/Tween.js -o ../build/Tween.js --charset utf-8 -v\");\nos.system(\"... | python | chosen |
[
{
"from": "system",
"value": "Add new user domain event collector to main keen events script\n"
},
{
"from": "human",
"value": "from framework.celery_tasks import app as celery_app\nfrom scripts.analytics.base import DateAnalyticsHarness\nfrom scripts.analytics.node_log_events import NodeLogEven... | python | chosen |
[
{
"from": "system",
"value": ":sparkles: Update tutorial src renamer to use sub-directories\n"
},
{
"from": "human",
"value": "#%%\nfrom pathlib import Path\nfrom string import digits\n\n\n#%%\ndirectory = Path(\"./docs/tutorial/src\")\noutput_directory = Path(\"./docs/tutorial/out\")\noutput_di... | python | chosen |
[
{
"from": "system",
"value": "Add data to Source serialization\n"
},
{
"from": "human",
"value": "from changes.api.serializer import Serializer, register\nfrom changes.models import Source\n\n\n@register(Source)\nclass SourceSerializer(Serializer):\n def serialize(self, instance, attrs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add method to log to console\n\nAdd a method to set the GUI logging window to be the stream handler for\nmy plug in.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# Module imports\nimport logging\nimport os\n\nimport vitables\n\n_defaults = dict(\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix run section with import statement\n"
},
{
"from": "human",
"value": "from fickle import API\n\nfrom fickle.classifier import GenericSVMClassifier\nbackend = GenericSVMClassifier()\n\napp = API(__name__, backend)\n\nif __name__ == '__main__':\n host = '0.0.0.0... | python | chosen |
[
{
"from": "system",
"value": "Check for permission in apq\n"
},
{
"from": "human",
"value": "import requests\nfrom functools import wraps\n\nfrom flask import request, current_app\n\nfrom utils.decorators.signature import sign\n\ndef require(resource_namespace, permissions, resource_id=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix an import path bug masked by remaining .pyc files\n"
},
{
"from": "human",
"value": "import socket\nimport logger\nfrom groundstation.broadcast_socket import BroadcastSocket\n\nimport logger\nlog = logger.getLogger(__name__)\n\nclass BroadcastAnnouncer(Broadcast... | python | chosen |
[
{
"from": "system",
"value": "Use mock instead of own class\n"
},
{
"from": "human",
"value": "\nimport os\nimport pytest\nfrom cisco_olt_http import operations\nfrom cisco_olt_http.client import Client\n\n\n@pytest.fixture\ndef data_dir():\n return os.path.abspath(\n os.path.join(os.p... | python | chosen |
[
{
"from": "system",
"value": "Add more skeleton function code and TODOs\n"
},
{
"from": "human",
"value": "# Python 3.6\n\nclass Expr:\n pass\n\n\nclass App(Expr):\n def __init__(self, fname, args=()):\n self.fname = fname\n self.args = args\n\n def __str__(self):\n r... | python | chosen |
[
{
"from": "system",
"value": "Add docstring into user_path function\n\nDescribe dependnce for constants and environments.\n"
},
{
"from": "human",
"value": "# Copyright 2015-2016 Masayuki Yamamoto\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this ... | python | chosen |
[
{
"from": "system",
"value": "Allow for tuple-based args in map also\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nimport sys\n\nPY3 = sys.version_info[0] == 3\nPY2 = sys.version_info[0] == 2\n\nif PY3:\n import builtins\n from queue... | python | chosen |
[
{
"from": "system",
"value": "Use django's bundled and customised version of six\n"
},
{
"from": "human",
"value": "import six\nimport json\n\nfrom django.utils.html import format_html, mark_safe\nfrom django.core.urlresolvers import reverse\nfrom django.utils.encoding import python_2_unicode_co... | python | chosen |
[
{
"from": "system",
"value": "Fix minor bug in test_get_root_discovers_v1\n\nInvoke json method to get response body instead of referring it.\n\nChange-Id: I5af060b75b14f2b9322099d8a658c070b056cee2\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2013 - Red Hat, Inc.\n#... | python | chosen |
[
{
"from": "system",
"value": "Test for parked check against unresolvable domain\n"
},
{
"from": "human",
"value": "\"\"\"Parked check integration test.\"\"\"\r\n\r\n\r\ndef test_parked_query(webapp):\r\n \"\"\"Test the parked API against our own domain.\"\"\"\r\n request = webapp.get('/api... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.9.0\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.8.2\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\", ... | python | chosen |
[
{
"from": "system",
"value": "[varLib.featureVars] Enable test now that it passes\n"
},
{
"from": "human",
"value": "from __future__ import print_function, division, absolute_import\nfrom fontTools.misc.py23 import *\nfrom fontTools.varLib.featureVars import (\n overlayFeatureVariations)\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Save ontology map in script\n"
},
{
"from": "human",
"value": "import sys\nfrom indra.sources import eidos\nfrom indra.sources.hume.make_hume_tsv import make_file as mht\nfrom indra.sources.sofia.make_sofia_tsv import make_file as mst\nfrom indra.java_vm import auto... | python | chosen |
[
{
"from": "system",
"value": "Set the version to 0.2.0\n"
},
{
"from": "human",
"value": "# Copyright (c) 2018 Forschungszentrum Juelich GmbH\n# Author: Yann Leprince <y.leprince@fz-juelich.de>\n#\n# This software is made available under the MIT licence, see LICENCE.txt.\n\n\"\"\"Conversion of i... | python | chosen |
[
{
"from": "system",
"value": "Fix there was no such thing as blast.recipients_lists\n"
},
{
"from": "human",
"value": "from .. import email\n\n\ndef sync_daily_email_blasts(blast):\n for l in blast.recipients_lists.all():\n l.send(blast)\n\n\ndef sync_recipients_list(recipients_list, b... | python | chosen |
[
{
"from": "system",
"value": "Add decorator to connect to database\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, redirect\nimport psycopg2\nimport os\nimport urlparse\n\napp = Flask(__name__)\n\n\n# def connectDB(wrapped):\n# def inner(*args, **kwargs):\n# ... | python | chosen |
[
{
"from": "system",
"value": "Rewrite without using try-except to break out of two loops.\n"
},
{
"from": "human",
"value": "import nis\n\nverbose = 0\nif __name__ == '__main__':\n verbose = 1\n\nmaps = nis.maps()\ntry:\n for nismap in maps:\n\tif verbose:\n\t print nismap\n\tmapping = ... | python | chosen |
[
{
"from": "system",
"value": "Increment minor version number ahead of release."
},
{
"from": "human",
"value": "\"\"\"Main initialisation for extension.\"\"\"\n\nVERSION = (0, 2, 2)\n__version__ = '.'.join(map(str, VERSION))\n\n\ntry:\n from geokey.extensions.base import register\n\n regis... | python | chosen |
[
{
"from": "system",
"value": "Fix dev commands using string roles.\n"
},
{
"from": "human",
"value": "from discord import Message\nfrom typing import re as typing_re\nfrom MoMMI.commands import command\nfrom MoMMI.master import master\nfrom MoMMI.server import MChannel\n\n@command(\"reload\", \"... | python | chosen |
[
{
"from": "system",
"value": "Fix the queryset for news indexing\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom haystack import indexes\n\nfrom .models import Post\n\n\nclass PostIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharField(document=True, use_t... | python | chosen |
[
{
"from": "system",
"value": "Use more optimal method of getting multiples\n"
},
{
"from": "human",
"value": "def sum_of_multiples(limit, factors):\n return sum(filter(lambda n: n < limit,\n {f*i for i in range(1, limit) for f in factors}))\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Add method to get the most appropriate DataView"
},
{
"from": "human",
"value": "from restlib2.resources import Resource\nfrom avocado.models import DataContext\n\n\nclass BaseResource(Resource):\n param_defaults = {}\n\n def get_params(self, request):\n ... | python | chosen |
[
{
"from": "system",
"value": "Call main when run directly\n"
},
{
"from": "human",
"value": "\"\"\"\nbc125csv - Channel import and export tool for the Uniden BC125AT, UBC125XLT \nand UBC126AT.\n\nCopyright (c) 2015, fdev.nl. All rights reserved.\nReleased under the MIT license.\n\nUniden and Bea... | python | chosen |
[
{
"from": "system",
"value": "Add geo info to status update\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: UTF-8\n'''\nA simple twitter client that posts current weather to twitter\n'''\nimport tweepy\nimport json\nfrom urllib2 import urlopen\nimport os\n\nroot =os.path.... | python | chosen |
[
{
"from": "system",
"value": "Modify the correct merge 1 fct\n"
},
{
"from": "human",
"value": "\"\"\"\nMerge function for 2048 game.\n\"\"\"\n\ndef merge(line):\n \"\"\"\n Function that merges a single row or column in 2048.\n \"\"\"\n l = len(line)\n s1 = [0]*l\n j = 0\n f... | python | chosen |
[
{
"from": "system",
"value": "Add __future__ imports to a new module\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# This file is part of beets.\n# Copyright 2016, Adrian Sampson.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software... | python | chosen |
[
{
"from": "system",
"value": "Document where we got settings injection from.\n"
},
{
"from": "human",
"value": "\"\"\"\n\"\"\"\n__version__ = '0.1'\n__release__ = '0.1a2'\n\ndef inject_app_defaults():\n try:\n import settings as app_settings\n from django.conf import settings, g... | python | chosen |
[
{
"from": "system",
"value": "Remove website from recent comments\n"
},
{
"from": "human",
"value": "from core.models import Comment, Tag\n\nfrom django import template\n\nregister = template.Library()\n\n#May want to ditch this for a middleware that passes in the comments object so that I can d... | python | chosen |
[
{
"from": "system",
"value": "Add comment regarding freetds config\n"
},
{
"from": "human",
"value": "# Configuration settings\n\n# ID of HPO to validate (see resources/hpo.csv)\nhpo_id = 'hpo_id'\n\n# location of files to validate, evaluate\ncsv_dir = 'path/to/csv_files'\n\n# sprint number bein... | python | chosen |
[
{
"from": "system",
"value": "Add iOS implementation to get uncalibrated values\n"
},
{
"from": "human",
"value": "'''\niOS Compass\n---------------------\n'''\n\nfrom plyer.facades import Compass\nfrom pyobjus import autoclass\n\n\nclass IosCompass(Compass):\n\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Switch from celery task logger to logger\n"
},
{
"from": "human",
"value": "import urlparse\n\nimport requests\nfrom celery.utils.log import get_task_logger\n\nfrom api.base import settings\n\nlogger = get_task_logger(__name__)\n\ndef get_varnish_servers():\n # ... | python | chosen |
[
{
"from": "system",
"value": "Modify ObjectType to derive description from docstring\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\n\nfrom graphql.type.definition import GraphQLObjectType\nfrom marshmallow import Schema, SchemaOpts\n\n\nclass ObjectTypeOpts(SchemaOpts):\... | python | chosen |
[
{
"from": "system",
"value": "Fix sponsor level name in the django admin\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom model_utils.models import TimeStampedModel\nfrom ordered_model.models import OrderedModel\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Fix the disconnect after 8 hours bug.\n"
},
{
"from": "human",
"value": "import os\nfrom flask import render_template, jsonify, request\nfrom app import app\nimport pymysql as mdb\n\ncon = mdb.connect('localhost', \"root\", \"ozfgefgvrwix\", 'test1') \n\n@app.route(... | python | chosen |
[
{
"from": "system",
"value": "Update marker call for pytest 3.6+\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport sys\n\nimport pytest\n\n\nclass ExpectedException(Exception):\n pass\n\n\nclass ExpectedMessage(Exception):\n pass\n\n\n@pytest.hookimpl(hookwrapper=True)\nde... | python | chosen |
[
{
"from": "system",
"value": "Add default versions for trove and ironic\n\nChange-Id: Ib7af38664cfbe75c78c70693117f1193c4beb7e6\n"
},
{
"from": "human",
"value": "# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")... | python | chosen |
[
{
"from": "system",
"value": "Fix tests to run against sqlite\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\npytest_plugins = [\n 'sentry.utils.pytest'\n]\n\n\ndef pytest_configure(config):\n from django.conf import settings\n settings.INSTALLED_APPS += ('s... | python | chosen |
[
{
"from": "system",
"value": "Hide simple view by default\n\nIt is an example implementation, most actual applications would probably\nuse something with more features.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Uranium is released under the terms of the AGPLv3 or ... | python | chosen |
[
{
"from": "system",
"value": "Use UserSerializer to serialize current user in the root response\n"
},
{
"from": "human",
"value": "from rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\nfrom .utils import absolute_reverse\n\n@api_view(('GET',))\ndef root(... | python | chosen |
[
{
"from": "system",
"value": "Print report on imported TOSEC sets\n"
},
{
"from": "human",
"value": "import os\nimport hashlib\nfrom tosec.models import Rom\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCommand):\n args = '<folder>'\n help = 'Scan a folder for... | python | chosen |
[
{
"from": "system",
"value": "Fix wavefront obj face index.\n"
},
{
"from": "human",
"value": "import numpy as np\n\ndef readObj(filename):\n vert = []\n face = []\n\n with open(filename, 'r') as file:\n for line in file:\n l = line.split()\n if len(l) > 0:\n if l[0] == 'v... | python | chosen |
[
{
"from": "system",
"value": "Add proxy fix as in lr this will run with reverse proxy\n"
},
{
"from": "human",
"value": "import os, logging\nfrom flask import Flask\nfrom flask.ext.basicauth import BasicAuth\nfrom raven.contrib.flask import Sentry\nfrom lrutils import dateformat\n\napp = Flask(_... | python | chosen |
[
{
"from": "system",
"value": "Make perturb_pmf available in dit.math.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nMathematical tools for dit.\n\"\"\"\n\nfrom __future__ import absolute_import\n\n# Global random number generator\nimport numpy as np... | python | chosen |
[
{
"from": "system",
"value": "Remove vim header from source files\n\ntrivialfix\n\nChange-Id: I6ccd551bc5cec8f5a682502b0a6e99a6d02cad3b\n"
},
{
"from": "human",
"value": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2013 Hewlett-Packard Development Company, L.P.\n# All Rights Reser... | python | chosen |
[
{
"from": "system",
"value": "Fix check of an app's presence in INSTALLED_APPS\n\nIn TenantSyncRouter, the logic to check whether an app is a tenant app or shared app was too simplistic. Django 1.7 allows two ways to add an app to INSTALLED_APPS. 1) By specifying the app's name, and 2) By specifying the dot... | python | chosen |
[
{
"from": "system",
"value": "Disable CGC simprocedures, it's unhelpful at the moment\n"
},
{
"from": "human",
"value": "import angr\nimport simuvex\n\nclass DrillerTransmit(simuvex.SimProcedure):\n '''\n CGC's transmit simprocedure which supports errors\n '''\n\n def run(self, fd, b... | python | chosen |
[
{
"from": "system",
"value": "Switch to python3 specifically in gephi mock script.\n\nCan't change the docker image to make python==python3 right now because we need python2 on the image as it is used in the older branches that still support that version. CTR\n"
},
{
"from": "human",
"value": "#... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add very basic tests for codata and constants.\n"
},
{
"from": "human",
"value": "\nimport warnings\n\nfrom scipy.constants import find\nfrom numpy.testing import assert_equal, run_module_suite\n\ndef test_find():\n\n warnings.simplefilter('ignore', Deprecat... | python | chosen |
[
{
"from": "system",
"value": "Add missing exception to package-level exports.\n"
},
{
"from": "human",
"value": "\"\"\"\nBase package to import top level modules\n\"\"\"\nfrom formish.forms import Form\nfrom formish.validation import FieldError, FormError, FormishError\nfrom formish.widgets impo... | python | chosen |
[
{
"from": "system",
"value": "Add proxy fix as in lr this will run with reverse proxy\n"
},
{
"from": "human",
"value": "import os, logging\nfrom flask import Flask\nfrom raven.contrib.flask import Sentry\n\napp = Flask(__name__)\n\napp.config.from_object(os.environ.get('SETTINGS'))\n\napp.logge... | python | chosen |
[
{
"from": "system",
"value": "Fix buglet introduced by longcode clean-up.\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\nfrom vumi.tests.utils import FakeRedis\n\nfrom go.base.tests.utils import VumiGoDjangoTestCase, declare_longcode_tags\nfrom go.vumitools.tests.utils im... | python | chosen |
[
{
"from": "system",
"value": "Return `None` if no email configuration exists for brand instead of raising an exception\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.email.service\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2017 Jochen Kupperschmidt\n:License: Modified BSD, se... | python | chosen |
[
{
"from": "system",
"value": "Handle name collisions from meetup by attaching the meetup id to the user.\nWhile not perfect, should be good enough.\n"
},
{
"from": "human",
"value": "from django.core.exceptions import ObjectDoesNotExist\nimport requests\nfrom apps.meetings.models import Meeting,... | python | chosen |
[
{
"from": "system",
"value": "Remove project property which is already set by the PhaseDispatchMixin\n"
},
{
"from": "human",
"value": "from django.views import generic\nfrom rules.contrib import views as rules_views\n\nfrom . import mixins, models\n\n\nclass ProjectDetailView(rules_views.Permis... | python | chosen |
[
{
"from": "system",
"value": "Add Enum for PersonIdentifier Fields\n\nThis is similar to the work to remove SimplePopoloFields from the\ndatabase layer. The values here are all the values we want in the\ninitial version of the \"n-links\" on the person page model.\n\nOne day we want to enable any type of li... | python | chosen |
[
{
"from": "system",
"value": "Change setting name to DJPJAX_DECORATED_URLS.\n"
},
{
"from": "human",
"value": "import re\n\nfrom djpjax.utils import strip_pjax_parameter\nfrom django.conf import settings\nimport djpjax\n\n\nclass DjangoPJAXMiddleware(object):\n\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add evaluation metrics to example\n"
},
{
"from": "human",
"value": "# for local run, before pygraphc packaging\nimport sys\nsys.path.insert(0, '../pygraphc/misc')\nfrom IPLoM import *\n\nRawLogPath = '/home/hudan/Git/labeled-authlog/dataset/161.166.232.17/'\nRawLog... | python | chosen |
[
{
"from": "system",
"value": "Modify the field example to remove the use of interface\n"
},
{
"from": "human",
"value": "import graphene\n\n\nclass Person(graphene.Interface):\n name = graphene.String()\n age = graphene.ID()\n\n\nclass Patron(Person):\n id = graphene.ID()\n\n\nclass Que... | python | chosen |
[
{
"from": "system",
"value": "Fix so that error under test actually gets triggered.\n"
},
{
"from": "human",
"value": "import morepath\nimport os\nfrom .template_engine import FormatLoader\n\n\nclass App(morepath.App):\n pass\n\n\n@App.path(path='{name}')\nclass Person(object):\n def __ini... | python | chosen |
[
{
"from": "system",
"value": "Fix path cannot be set when creating new library"
},
{
"from": "human",
"value": "import os\nfrom pathlib import Path\n\nfrom django.contrib.auth import get_user_model\nfrom django.core.management.base import BaseCommand\nfrom django.db.utils import IntegrityError\n... | python | chosen |
[
{
"from": "system",
"value": "Fix missing paren, imports, spelling.\n"
},
{
"from": "human",
"value": "'''\nRetrieves the firendly model name for machines that don't have one yet.\n'''\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom server.models import Machine\nfrom d... | python | chosen |
[
{
"from": "system",
"value": "Clean up import, pre-fill email address\n\nIf user is logged in, their email address is automatically filled in for them.\n\nAlso fixed an error with the messages usage, namely I forgot to pass in the request object.\n"
},
{
"from": "human",
"value": "import binasci... | python | chosen |
[
{
"from": "system",
"value": "Bump version 0.16.0rc7 --> 0.16.0rc8\n\nSigned-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io>\n"
},
{
"from": "human",
"value": "import logging\n\n__version__ = \"0.16.0rc7\"\nversion = tuple(__version__.split('.'))\n\nlogging.getLogger(__na... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in Pax Mininet node class\n\n"
},
{
"from": "human",
"value": "# coding: latin-1\n\n\"\"\"\npax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.\n\"\"\"\n\nfrom mininet.node import Node\nfrom mininet.log import... | python | chosen |
[
{
"from": "system",
"value": "Apply long log formatter only in debug\n"
},
{
"from": "human",
"value": "import sys\nimport logging\n\n\ndef init_logger():\n logging.basicConfig(\n stream=sys.stdout,\n format='%(asctime)s - %(levelname)s - %(message)s',\n level=logging.INF... | python | chosen |
[
{
"from": "system",
"value": "Add tests for the 404 and 500 error handlers.\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom django.test import Client\n\nfrom projects.models import Project\nfrom innovate import urls\n\n\ndef test_routes():\n c = Client()\... | python | chosen |
[
{
"from": "system",
"value": "Add all header elements to httoop.header\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"HTTP headers\n\n.. seealso:: :rfc:`2616#section-2.2`\n\n.. seealso:: :rfc:`2616#section-4.2`\n\n.. seealso:: :rfc:`2616#section-14`\n\"\"\"\n\n__all__ = ['Head... | python | chosen |
[
{
"from": "system",
"value": "Add atom type info output.\n"
},
{
"from": "human",
"value": "import logging\n\nfrom vaspy.iter import OutCar\n\n_logger = logging.getLogger(\"vaspy.script\")\n\nif \"__main__\" == __name__:\n outcar = OutCar()\n poscar = outcar.poscar\n freq_types = outcar... | python | chosen |
[
{
"from": "system",
"value": "Move GUI creation out of __init__ function.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom iconizer.console.launcher import CrossGuiLauncher\nfrom iconizer.qtconsole.PyQtGuiFactory import PyQtGuiFactory\n\n\nclass Iconizer(ob... | python | chosen |
[
{
"from": "system",
"value": "fix: Remove the scheme from the domain\n"
},
{
"from": "human",
"value": "import dj_database_url\nfrom .default import *\n\nDEBUG = False\n\nSECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None)\n\nALLOWED_HOSTS = ['agendaodonto.herokuapp.com']\n\nDATABASES = {'default'... | python | chosen |
[
{
"from": "system",
"value": "Fix 'NoneType' object has no attribute 'endswith'\n"
},
{
"from": "human",
"value": "\"\"\"Git Commit Auto Save.\n\nSublime Text 3 package to auto save commit messages when the window is closed.\nThis allows the user to close the window without having to save before... | python | chosen |
[
{
"from": "system",
"value": "Add convenience functions 'request' and 'notify'\n\nCloses #54\n"
},
{
"from": "human",
"value": "\"\"\"__init__.py\"\"\"\nfrom .request import Request, Notification\n"
},
{
"from": "gpt",
"value": "\"\"\"__init__.py\"\"\"\nfrom .request import Request, ... | python | chosen |
[
{
"from": "system",
"value": "Configure throughput for games collection\n\nThe collection gamemodels should be deleted when it is no longer in use\n"
},
{
"from": "human",
"value": "class Azure:\n resource_group = \"MajavaShakki\"\n location = \"northeurope\"\n cosmosdb_name = f\"{resource_gr... | python | chosen |
[
{
"from": "system",
"value": "Fix hashing for Python 3\n"
},
{
"from": "human",
"value": "try:\n from hashlib import md5\nexcept ImportError:\n from md5 import md5\n\nfrom django.http import HttpResponseBadRequest\n\nfrom secretballot.middleware import SecretBallotIpUseragentMiddleware\n\n... | python | chosen |
[
{
"from": "system",
"value": "Use a weakref for the data object context\n\nThere are no known circular reference issues caused by storing the\ncontext in data objects, but the following changes will refer to data\nobjects in the context, so this change prevents any later issues.\n\nChange-Id: I3680e5678003c... | python | chosen |
[
{
"from": "system",
"value": "Add an event module import\n"
},
{
"from": "human",
"value": "import spyral.memoize\nimport spyral.point\nimport spyral.camera\nimport spyral.util\nimport spyral.sprite\nimport spyral.gui\nimport spyral.scene\nimport spyral._lib\nimport pygame\n\ndirector = scene.Di... | python | chosen |
[
{
"from": "system",
"value": "Remove round of multiplication result for get_geometric_mean and bug fix get edge weight\n"
},
{
"from": "human",
"value": "from itertools import combinations\n\n\nclass ClusterUtility(object):\n @staticmethod\n def get_geometric_mean(weights):\n multip... | python | chosen |
[
{
"from": "system",
"value": "Simplify funcion arg compatibility check\n"
},
{
"from": "human",
"value": "import inspect\n\ndef argspec_set(func):\n if not hasattr(func, 'argspec'):\n func.argspec = inspect.getargspec(func)\n\ndef argspec_iscompat(func, lenargs):\n spec = func.argsp... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.