conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Make IPython renderer shutdown properly\n\n"
},
{
"from": "human",
"value": "# vim:fileencoding=utf-8:noet\n\nfrom powerline.renderers.shell import ShellRenderer\nfrom powerline.theme import Theme\n\n\nclass IpythonRenderer(ShellRenderer):\n\t'''Powerline ipython se... | python | chosen |
[
{
"from": "system",
"value": "Fix ctypes call test for windows\n"
},
{
"from": "human",
"value": "import os\nimport ctypes\n\nfrom numba import *\n\n@autojit(backend='ast', nopython=True)\ndef call_ctypes_func(func, value):\n return func(value)\n\n\ndef test_ctypes_calls():\n libc = ctypes... | python | chosen |
[
{
"from": "system",
"value": "Add the new contrail extension to neutron plugin config file\n\nChange-Id: I2a1e90a2ca31314b7a214943b0f312471b11da9f\n"
},
{
"from": "human",
"value": "import string\n\ntemplate = string.Template(\"\"\"\n[APISERVER]\napi_server_ip = $__contrail_api_server_ip__\napi_... | python | chosen |
[
{
"from": "system",
"value": "Add timeout to requests so that they do get death-locked\n"
},
{
"from": "human",
"value": "import requests\n\nfrom bot.api.domain import ApiObject\n\n\nclass TelegramBotApi:\n def __init__(self, auth_token, debug: bool):\n self.base_url = \"https://api.te... | python | chosen |
[
{
"from": "system",
"value": "Fix an access key `url` bug if data is empty\n"
},
{
"from": "human",
"value": "from urllib.parse import urlparse\n\nimport logbook\nfrom nameko.rpc import rpc\n\nfrom .logger import LoggingDependency\nfrom .storages import RedisStorage\n\nlog = logbook.debug\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Add an a function(view) about which is going to render about page when it is requested\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\n\n\ndef home(request):\n return render(request, 'portal/home.html')\n"
},
{
"from": "gpt",
"... | python | chosen |
[
{
"from": "system",
"value": "Make user metric criteria consistent.\n\n[Resolves #1768]\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Scripts for counting recently added users by email domain; pushes results\nto the specified project.\n\"\"\"\n\nimport datetime\nimport collec... | python | chosen |
[
{
"from": "system",
"value": "Change input method, write to stdout and fix minor issues.\n"
},
{
"from": "human",
"value": "import argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('-f', '--files', nargs='*', default=[], help=\"tsvs that will be concatenated\")\nparser.add_argu... | python | chosen |
[
{
"from": "system",
"value": "Add directive allowing users to use our auth policy\n"
},
{
"from": "human",
"value": "\ndefault_settings = [\n ('auth_url', str, 'http://localhost:5000/v3'),\n ('region', str, 'RegionOne'),\n ('user_domain_name', str, 'Default'),\n ('cac... | python | chosen |
[
{
"from": "system",
"value": "Raise exception on incorrect argument type\n"
},
{
"from": "human",
"value": "\nfrom pysteps.cascade import decomposition, bandpass_filters\n\n_cascade_methods = dict()\n_cascade_methods['fft'] = decomposition.decomposition_fft\n_cascade_methods['gaussian'] = bandpa... | python | chosen |
[
{
"from": "system",
"value": "Add family history and pathology client-side\n"
},
{
"from": "human",
"value": "from radar.lib.models.cohorts import *\nfrom radar.lib.models.common import *\nfrom radar.lib.models.comorbidities import *\nfrom radar.lib.models.diagnosis import *\nfrom radar.lib.mode... | python | chosen |
[
{
"from": "system",
"value": "Configure allowed host for productions setup\n"
},
{
"from": "human",
"value": "\"\"\"\nDjango settings for pc_datamanger project.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.6/topics/settings/\n\nFor the full list of settings and ... | python | chosen |
[
{
"from": "system",
"value": "Use the list item, not the list.\n\nOtherwise you get urls with `[u'1234']` in.\n"
},
{
"from": "human",
"value": "import json\nimport os\nimport sys\nimport time\n\nimport requests\nimport pync\n\n\ntry:\n cache = []\n headers = {'Authorization': 'bearer {0}'... | python | chosen |
[
{
"from": "system",
"value": "Fix resource_path of Group resource\n"
},
{
"from": "human",
"value": "from office365.runtime.client_object import ClientObject\nfrom office365.runtime.odata.odata_path_parser import ODataPathParser\nfrom office365.sharepoint.principal import Principal\nfrom office3... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in The Echo Nest API call\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom purl import Template\nimport requests\n\nfrom .models import SimilarResponse\n\n\nAPI_URL = Template(\"http://developer.echonest.com/api/v4/artist/similar\"\n... | python | chosen |
[
{
"from": "system",
"value": "Add basic draft of example code.\n"
},
{
"from": "human",
"value": "\nimport webapp2\n\nclass IntroHandler(webapp2.RequestHandler):\n def get(self):\n pass\n\napp = webapp2.WSGIApplication([\n ('/', IntroHandler),\n])\n\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Revert URL redirect (didn't work)\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom django.views.generic.simple import redirect_to\n\nurlpatterns = patterns('',\n \n # filebrowser urls\n url(r'^browse/$', redirect_to, {'url': ... | python | chosen |
[
{
"from": "system",
"value": "Use newly exposed oauth2.is_secure_transport instead of duplicate.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom oauthlib.oauth2 import WebApplicationClient, InsecureTransportError\n\nfrom .utils import is_secure_transport\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Use Mandrill templates to send emails\n"
},
{
"from": "human",
"value": "import pprint\n\nfrom django.core.mail import EmailMessage\n\nimport log\nfrom rest_framework.reverse import reverse\nfrom sesame.utils import get_query_string\n\n\ndef send_login_email(user, r... | python | chosen |
[
{
"from": "system",
"value": "Hide resource if doc is False"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n\nclass ApiNamespace(object):\n def __init__(self, api, name, description=None, endpoint=None, path=None, **kwargs):\n self.a... | python | chosen |
[
{
"from": "system",
"value": "Delete images instead of printing\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom collections import defaultdict\nimport subprocess\nimport os\n\nKEEP_LAST_VERSIONS = os.environ.get('KEEP_LAST_VERSIONS', 4)\n\n\ndef find_obsolete_images(images):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add Kubernetes workload connector to documentation\n"
},
{
"from": "human",
"value": "\"\"\".. Ignore pydocstyle D400.\n\n===================\nWorkload Connectors\n===================\n\nThe workload management system connectors are used as glue between the\nResolwe... | python | chosen |
[
{
"from": "human",
"value": "Add tests for some helper functions in views.py.\n"
},
{
"from": "gpt",
"value": "import pytest\nfrom .test_views import twenty_name_fixtures\nfrom django.test.client import RequestFactory\nfrom name.views import (\n normalize_query,\n resolve_q,\n resolve_t... | python | chosen |
[
{
"from": "system",
"value": "Use the mock discovery module\n"
},
{
"from": "human",
"value": "from experiment_config_lib import ControllerConfig\nfrom sts.topology import MeshTopology\nfrom sts.control_flow import Fuzzer, Interactive\nfrom sts.input_traces.input_logger import InputLogger\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add todo note in ExclusiveRegistrationForm.\n"
},
{
"from": "human",
"value": "from django.contrib.auth import get_user_model\nfrom django.core.exceptions import ObjectDoesNotExist, ValidationError\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom reg... | python | chosen |
[
{
"from": "system",
"value": "Use source_delay instead of sleep, and tidy up a bit"
},
{
"from": "human",
"value": "from travispy import TravisPy\nfrom gpiozero import LED\nfrom gpiozero.tools import negated\nfrom time import sleep\nfrom signal import pause\n\ndef build_passed(repo='RPi-Distro/p... | python | chosen |
[
{
"from": "system",
"value": "Fix bug on fudge wrapper\n"
},
{
"from": "human",
"value": "import fudge\nimport inspect\n\n\nclass MethodNotAvailableInMockedObjectException(Exception):\n pass\n\n\ndef getMock(class_to_mock):\n return FudgeWrapper(class_to_mock)\n\n\nclass FudgeWrapper(fudge... | python | chosen |
[
{
"from": "system",
"value": "Remove is_string because it exist in RF 2.9\n"
},
{
"from": "human",
"value": "# Copyright 2008-2011 Nokia Networks\n# Copyright 2011-2016 Ryan Tomac, Ed Manlove and contributors\n# Copyright 2016- Robot Framework Foundation\n#\n# Licensed under the Apache Licen... | python | chosen |
[
{
"from": "system",
"value": "Add functions about setting the parent & children nodes and codes.\n"
},
{
"from": "human",
"value": "class Node:\n\n def __init__(self):\n self.name = ''\n self.weight = 0\n self.code = ''\n\n def initSet(self, name, weight):\n sel... | python | chosen |
[
{
"from": "system",
"value": "Fix colliding ports for tryserver.chromium.gpu\n\nBUG=353434\n\nReview URL: https://codereview.chromium.org/203743004\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@257737 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "# Copyright 2... | python | chosen |
[
{
"from": "human",
"value": "Make sure the local version of the craft ai module is used in tests\n"
},
{
"from": "gpt",
"value": "import sys\nimport os\n\nCRAFTAI_MODULE_SRC_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\nsys.path = [CRAFTAI_MODULE_SRC_DIR] + sys.path\n"
... | python | chosen |
[
{
"from": "system",
"value": "Add test coverage for pork.cli.\n"
},
{
"from": "human",
"value": "from pork.cli import CLI\n\nfrom mock import Mock\n\nclass TestCLI:\n def it_has_a_data_attribute(self):\n assert CLI().data is not None\n"
},
{
"from": "gpt",
"value": "from po... | python | chosen |
[
{
"from": "system",
"value": "Add more pytest fixtures (access_key, secret_key, account_id, timestamp)\n"
},
{
"from": "human",
"value": "import pytest\n\n\n@pytest.fixture\ndef credentials():\n \"\"\"Fake set of MWS credentials\"\"\"\n return {\n \"access_key\": \"AAAAAAAAAAAAAAAAA... | python | chosen |
[
{
"from": "system",
"value": "Remove click dependent import from the main module.\n\nThis leads to import error when textX is installed without CLI support.\n"
},
{
"from": "human",
"value": "# flake8: noqa\nfrom textx.metamodel import metamodel_from_file, metamodel_from_str\nfrom textx.model im... | python | chosen |
[
{
"from": "system",
"value": "Send welcome emails when registrations are added through the web\ninterface.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom commoner.registration.models import PartialRegistration\n\nclass PartialRegistrationAdmin(admin.ModelAdmin):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Address removal of assignment_tag in Django 2.0\n"
},
{
"from": "human",
"value": "from django import template\n\nfrom ..models import Message\n\n\nregister = template.Library()\n\n\n@register.assignment_tag(takes_context=True)\ndef get_messages_for_page(context, ur... | python | chosen |
[
{
"from": "system",
"value": "Make gen_addons_table test generate coverage\n\nThis is done by invoking subprocess with sys.executable,\npytest-cov does the rest.\n\nAlso change test style to pytest instead of unittest.\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\nimport unitt... | python | chosen |
[
{
"from": "system",
"value": "Set essential payzen settings as mandatory for django_payzen.\n"
},
{
"from": "human",
"value": "\"\"\" Default payzen settings.\n\nAll settings should be set in the django settings file and not\ndirectly in this file.\nWe deliberately do not set up default values h... | python | chosen |
[
{
"from": "system",
"value": "Add sketch of bonus payment process\n"
},
{
"from": "human",
"value": "import logging\n\nlogger = logging.getLogger(__file__)\n\n\nclass ProlificServiceException(Exception):\n \"\"\"Some error from Prolific\"\"\"\n\n pass\n\n\nclass ProlificService:\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Support COVERALLS_ENDPOINT for Enterprise usage"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\n\nimport requests\nimport json\n\nURL = 'https://coveralls.io/api/v1/jobs'\n\n\ndef post_report(coverage):... | python | chosen |
[
{
"from": "system",
"value": "Refactor query out into instance with delegates the update\n"
},
{
"from": "human",
"value": "from stagecraft.apps.datasets.models import DataGroup, DataSet, DataType\n\n\nclass DataSetMassUpdate():\n @classmethod\n def update_bearer_token_for_data_type_or_gro... | python | chosen |
[
{
"from": "system",
"value": "Exit with return code from called script\n"
},
{
"from": "human",
"value": "import click\n\nimport lib\n\n\n@click.group()\ndef cli():\n \"\"\"\n Install From Source\n\n When the version in the package manager has gone stale, get a fresh,\n production-re... | python | chosen |
[
{
"from": "system",
"value": "Change of repo name. Update effected paths\n"
},
{
"from": "human",
"value": "import json\nimport matplotlib\nimport numpy as np\nimport pymc as pm\nfrom matplotlib import pyplot as plt\n\n\ndef main():\n matplotlibrc_path = '/home/noel/repo/playground/matplotlib... | python | chosen |
[
{
"from": "system",
"value": "Troubleshoot potential sys.path problem with python 3.x\n"
},
{
"from": "human",
"value": "import sys, os, glob\nfrom os.path import realpath, dirname, join\nfrom traceback import format_exception\n\nPYTHON_MAJOR_MINOR = \"%s.%s\" % (sys.version_info[0], sys.version... | python | chosen |
[
{
"from": "system",
"value": "Include folders with subfolders when creating api tarball\n\n(imported from commit b9d564a6cc4ee6e2afa0108b6d9f18af039fc8cf)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport humbug\n\nimport glob\nimport os\nfrom distutils.... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary imports based on review\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.29 on 2020-07-21 13:42\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrati... | python | chosen |
[
{
"from": "system",
"value": "Switch off debugging func that got through...\n"
},
{
"from": "human",
"value": "import pyrc\nimport pyrc.utils.hooks as hooks\n\nclass GangstaBot(pyrc.Bot):\n @hooks.command()\n def bling(self, channel, sender):\n \"will print yo\"\n self.message(channel, \... | python | chosen |
[
{
"from": "system",
"value": "Change command prefix to $, so that's like a tip.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\nimport asyncio\nimport configparser\nimport discord\nimport os\nfrom discord.ext import commands\n\n# Parse the config and stick in global \"config\" var\nconfig... | python | chosen |
[
{
"from": "system",
"value": "Create shell function for register_user"
},
{
"from": "human",
"value": "from django.shortcuts import render, redirect\nfrom django.http import *\nfrom django.contrib.auth import authenticate, login\n\ndef home(request):\n\treturn render(request, 'login.html', {})\n... | python | chosen |
[
{
"from": "system",
"value": "Add NetworkX version checking to nffg_lib package\n"
},
{
"from": "human",
"value": "# Copyright 2017 Janos Czentye, Balazs Nemeth, Balazs Sonkoly\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complian... | python | chosen |
[
{
"from": "system",
"value": "Change importing structure in init\n"
},
{
"from": "human",
"value": "from .__main__ import main\n\n__version__ = '1.0.0'\n\n__title__ = 'address_extractor'\n__description__ = ''\n__url__ = ''\n\n__author__ = 'Scott Colby'\n__email__ = ''\n\n__license__ = 'MIT Licen... | python | chosen |
[
{
"from": "system",
"value": "Read lib dir, before local dir.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom os import scandir\nfrom sys import argv\nfrom platform import uname\nfrom pathlib import Path\n\n\nfilename_template = \"\"\"\n# ---------------------------------------... | python | chosen |
[
{
"from": "system",
"value": "Test runner: fix line endings, print to stderr"
},
{
"from": "human",
"value": "\r\nimport os, sys\r\n\r\nPROJECT_DIR = os.path.abspath(os.path.dirname( __file__ ))\r\nSRC_DIR = os.path.join(PROJECT_DIR, \"src\")\r\nTEST_DIR = os.path.join(PROJECT_DIR, \"test\")\r\n... | python | chosen |
[
{
"from": "system",
"value": "Add related_name to initial migration so it doesn't try to later"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport django.utils.timezone\nfrom django.conf import sett... | python | chosen |
[
{
"from": "system",
"value": "Make it easy to do a full deploy with fab\n"
},
{
"from": "human",
"value": "from fabric.api import *\n\nenv.runtime = 'production'\nenv.hosts = ['chimera.ericholscher.com']\nenv.user = 'docs'\nenv.code_dir = '/home/docs/sites/readthedocs.org/checkouts/readthedocs.o... | python | chosen |
[
{
"from": "system",
"value": "Add graphviz for converting dot to pdf\n"
},
{
"from": "human",
"value": "from fabric.api import local\n\nvim_bundles = [\n {\n 'git': 'git://github.com/fatih/vim-go.git',\n 'path': '~/.vim/bundle/vim-go'\n }\n]\n\ndef apt_get():\n local('sudo... | python | chosen |
[
{
"from": "system",
"value": "Include handlers in build app\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.apps import AppConfig\n\n\nclass BuildConfig(AppConfig):\n name = 'mrbelvedereci.build'\n"
},
{
"from": "gpt",
"value": "from __fut... | python | chosen |
[
{
"from": "system",
"value": "Use dev email or non prod environments\n"
},
{
"from": "human",
"value": "from .docker import *\n\n\nINSTALLED_APPS.append('raven.contrib.django.raven_compat')\n\nADMINS = (\n ('[STAGING] HMCTS Reform Sustaining Support', 'sustainingteamsupport@HMCTS.NET'),\n)\n\... | python | chosen |
[
{
"from": "system",
"value": "Implement Infested Wolf and Princess Huhuran\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\nclass OG_179:\n\t\"Fiery Bat\"\n\tdeathrattle = Hit(RANDOM_ENEMY_CHARACTER, 1)\n\n\nclass OG_292:\n\t\"Forlorn Stalker\"\n\tplay = Buff(FRIEND... | python | chosen |
[
{
"from": "system",
"value": "Remove deprecated django json shim\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.http import HttpResponse\nfrom django.utils import simplejson as json\nfrom taggit.models import Tag\n\n\nMAX_SUGGESTIONS = getattr(settings, 'TAGGIT_... | python | chosen |
[
{
"from": "system",
"value": "Change version number for dev branch.\n"
},
{
"from": "human",
"value": "__version__ = \"0.13\"\n\n# Void cython.* directives (for case insensitive operating systems). \nfrom Cython.Shadow import *\n"
},
{
"from": "gpt",
"value": "__version__ = \"0.13+\"... | python | chosen |
[
{
"from": "system",
"value": "Add Admin action to feedbacks\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\n# Register your models here.\nfrom .models import Feedback\n\n\nclass FeedbackAdmin(admin.ModelAdmin):\n list_display = ('name', 'email', 'note', 'archive', 'publ... | python | chosen |
[
{
"from": "system",
"value": "Remove paramiko requirement from core\n"
},
{
"from": "human",
"value": "# setup.py for git-keeper-core\n\nfrom setuptools import setup\n\nsetup(\n name='git-keeper-core',\n version='0.1.0',\n description='Core modules for git-keeper-client and git-keeper-s... | python | chosen |
[
{
"from": "system",
"value": "Add corresponding hdf5 parsing file\n"
},
{
"from": "human",
"value": "import sklearn\n\n\ndef make_train_pair(filename):\n h5 = open_h5_file_read(filename)\n title = get_title(h5)\n pitches = get_segments_pitches(h5)[:11] # limit: only look at beginning\n ... | python | chosen |
[
{
"from": "system",
"value": "Initialize inbound and outbound Nodes of a Node\n"
},
{
"from": "human",
"value": "class Node(object):\n def __init__(self):\n # Properties will go here!\n"
},
{
"from": "gpt",
"value": "class Node(object):\n def __init__(self):\n # Node(s) from ... | python | chosen |
[
{
"from": "system",
"value": "Change default python string name str to mystr as str is a reserved name\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python -u \n\nimport cPickle\nimport sys\nimport urllib\nimport base64\n\n#\n# Output the maximum number of instances of this 'callable' to spa... | python | chosen |
[
{
"from": "system",
"value": "Use AccrosticSearch (~BFS) instead of AcrosticIter (~DFS).\n"
},
{
"from": "human",
"value": "from puzzle.heuristics.acrostics import _acrostic_iter\n\n\nclass Acrostic(_acrostic_iter.AcrosticIter):\n \"\"\"Best available Acrostic solver.\"\"\"\n pass\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Fix AttributeError: module 'salt.config' has no attribute '_DFLT_LOG_FMT_JID'\n\n```\n$ python3 -m pytest -ra tests/pytests/integration/_logging/test_jid_logging.py\n_______________________________ test_jid_in_logs _______________________________\n\n @PRE_PYTEST_SKIP\n de... | python | chosen |
[
{
"from": "system",
"value": "Set local worker as default for SyftTensor owner\n"
},
{
"from": "human",
"value": "import random\n\nfrom syft.frameworks.torch.tensors import PointerTensor\n\n\nclass TorchTensor:\n \"\"\"\n This tensor is simply a more convenient way to add custom functions ... | python | chosen |
[
{
"from": "system",
"value": "Fix update of logitem bug in system_log\n"
},
{
"from": "human",
"value": "\n\nfrom solar.system_log import data\nfrom dictdiffer import patch\n\n\ndef set_error(task_uuid, *args, **kwargs):\n sl = data.SL()\n item = sl.get(task_uuid)\n if item:\n it... | python | chosen |
[
{
"from": "system",
"value": "Fix tag cloud weird size\n"
},
{
"from": "human",
"value": "from django import template\n\n\nregister = template.Library()\n\n\n@register.filter\ndef get_style(tags, priority):\n max_priority = max(tags, key=lambda tag: tag[\"priority\"])[\"priority\"]\n size ... | python | chosen |
[
{
"from": "system",
"value": "Tag is not required, of course\n"
},
{
"from": "human",
"value": "\"\"\"Forms for dealing with jobs/posts.\"\"\"\n\nfrom django import forms\n\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Submit\nfrom taggit.models import Tag\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Fix version number reporting so we can be installed before Django.\n"
},
{
"from": "human",
"value": "VERSION = (0, 9, 0, 'beta', 1)\n\n\ndef get_version():\n from django.utils.version import get_version as django_get_version\n return django_get_version(VERSIO... | python | chosen |
[
{
"from": "system",
"value": "Return correct message if elasticsearch fails to connect.\n"
},
{
"from": "human",
"value": "from flask import jsonify, current_app\n\nfrom . import status\nfrom . import utils\nfrom ..main.services.search_service import status_for_all_indexes\n\n\n@status.route('/_... | python | chosen |
[
{
"from": "system",
"value": "Change variable name & int comparison.\n"
},
{
"from": "human",
"value": "from flask import jsonify, current_app\n\nfrom . import status\nfrom . import utils\nfrom .. import api_client\n\n\n@status.route('/_status')\ndef status():\n\n api_response = utils.return_... | python | chosen |
[
{
"from": "system",
"value": "Add deletion of result after build\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\nimport json\nimport threading\nimport time\nimport logging\n\nfrom frigg.worker import config\nfrom frigg.worker.jobs import Build\n\nlogger = logging.getLogger(__name__)\n... | python | chosen |
[
{
"from": "system",
"value": "Make the order of LINKS output consistent\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.interface import imple... | python | chosen |
[
{
"from": "system",
"value": "Make sure to load the S3 cache file when available\n"
},
{
"from": "human",
"value": "import json\nimport os\nfrom tempfile import gettempdir\n\nimport boto3\nfrom botocore.exceptions import ClientError\nimport requests\n\n\ndef fetch_json(uri):\n \"\"\" Perform ... | python | chosen |
[
{
"from": "system",
"value": "Change app-level error handler to use api_client.error exceptions\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nfrom flask import render_template\nfrom . import main\nfrom dmapiclient import APIError\n\n\n@main.app_errorhandler(APIError)\ndef api_error_handle... | python | chosen |
[
{
"from": "system",
"value": "Use BMI method to get ALT value\n\nIt looks like it may not give the correct answer, though.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 10 10:56:16 2017\n\n@author: kangwang\n\"\"\"\n\nimport os\nim... | python | chosen |
[
{
"from": "system",
"value": "Make python3 default also for the samples\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport pandas as pd\nimport numpy as np\nimport gtabview\n\nc_arr = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],\n ['one', 'two', 'one', 'two',... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Add required on field res.partner from model Contacts to avoid the creation of empty coworkers\n"
},
{
"from": "human",
"value": "from openerp.osv import fields, osv\n\nclass web_calendar_contacts(osv.osv):\n _name = 'web_calendar.contacts' \n\n _colu... | python | chosen |
[
{
"from": "system",
"value": "Raise error when creating PChip object with not monotonely increasing y list\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom scipy.interpolate import PchipInterpolator\n\n\nclass UcPoly(object):\n def __init__(self, coef):\n self.p = np.poly1d(... | python | chosen |
[
{
"from": "system",
"value": "Change function name chmod to rmpyc\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n__author__ = 'xilei'\n\nimport os\nfrom os.path import join\nimport stat\n\n\ndef chmod(targetdir):\n \"\"\"\n remove *.pyc files\n \"\"... | python | chosen |
[
{
"from": "system",
"value": "Make sockets print actual output\n\nMake sockets print actual output\n"
},
{
"from": "human",
"value": "import RPi.GPIO as GPIO\nimport time\n\nfrom socketIO_client import SocketIO, LoggingNamespace\nsocketIO = SocketIO('localhost:3000')\n\ndef onCommand(*args):\n ... | python | chosen |
[
{
"from": "system",
"value": "Drop patterns import for Django 1.0 compatibility.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# django-agpl -- tools to aid releasing Django projects under the AGPL\n# Copyright (C) 2008, 2009, 2016 Chris Lamb <chris@chris-lamb.co.uk>\n#\n# This ... | python | chosen |
[
{
"from": "system",
"value": "Fix the logging message in the nightly task\n"
},
{
"from": "human",
"value": "from datetime import datetime, timedelta\n\nfrom flask import current_app\nfrom notifications_utils.statsd_decorators import statsd\n\nfrom app import notify_celery\nfrom app.dao.fact_bil... | python | chosen |
[
{
"from": "system",
"value": "Add the variable `plata.price_includes_tax` to the template context\n"
},
{
"from": "human",
"value": "import plata\n\ndef plata_context(request):\n \"\"\"\n Adds a few variables from Plata to the context if they are available:\n\n * ``plata.shop``: The cur... | python | chosen |
[
{
"from": "system",
"value": "Add tests to compare epsilon with another objects\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\r\n\"\"\"\r\n:Author Patrik Valkovic\r\n:Created 23.06.2017 16:39\r\n:Licence GNUv3\r\nPart of grammpy\r\n\r\n\"\"\"\r\n\r\nfrom unittest import TestCase, main... | python | chosen |
[
{
"from": "system",
"value": "Add SSLify to force SSL\n"
},
{
"from": "human",
"value": "import logging\n\nfrom flask import Flask\nfrom flask_cache import Cache\nfrom flask_login import LoginManager\n\n# Set up logging\nlog = logging.getLogger('slot')\nlog.setLevel(logging.DEBUG)\nch = logging.... | python | chosen |
[
{
"from": "system",
"value": "Remove last trace of BLUEPRINTS\n"
},
{
"from": "human",
"value": "import os\n\nfrom buchner.helpers import truthiness\n\ndef abspath(path):\n return os.path.abspath(os.path.relpath(path, os.path.dirname(__file__)))\n\nDEBUG = truthiness(os.environ.get('DEBUG', F... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in bundled GUI\n"
},
{
"from": "human",
"value": "import version\nversion.append ('$Revision: 83265 $')\ndel version\n\nimport os, pkg_resources\n\n# Enumerate all the available attributes and functions within this\n# module, for the benefit of those that in... | python | chosen |
[
{
"from": "system",
"value": "Add imports of fit to subpackage\n"
},
{
"from": "human",
"value": "from .find_contours import find_contours\nfrom ._regionprops import regionprops, perimeter\nfrom ._structural_similarity import structural_similarity\nfrom ._polygon import approximate_polygon, subd... | python | chosen |
[
{
"from": "system",
"value": "Use py3-style print and string-formatting\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport os\nimport getpass\nimport time\nfrom twisted.internet import task\nfrom twisted.internet import reactor\n\n\n# Configuration \n\ntimeou... | python | chosen |
[
{
"from": "system",
"value": "Use item.config to access config.\n\nFixes #1.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport os\n\nimport pytest\n\n\n# You didn't see that.\n#\n# I hope you don't understand this code.\n\n\n_config = None\n\n\nEXAMINATORS = [\n 'CI',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a relative difference vectorization benchmark\n"
},
{
"from": "human",
"value": "\"\"\"\nBenchmarks for ``@vectorize`` ufuncs.\n\"\"\"\n\nimport numpy as np\n\nfrom numba import vectorize\n\n\n@vectorize([\"float32(float32, float32)\",\n \"float64(flo... | python | chosen |
[
{
"from": "system",
"value": "Check recursion in str() and repr()\n"
},
{
"from": "human",
"value": "from unittest import TestCase\nimport lazydict\n\nclass TestLazyDictionary(TestCase):\n\n def test_circular_reference_error(self):\n d = lazydict.LazyDictionary()\n d['foo'] = la... | python | chosen |
[
{
"from": "system",
"value": "Correct type comment for table columns\n"
},
{
"from": "human",
"value": "\"\"\"Collection of Models used in blogsite.\"\"\"\nfrom . import db\n\n\nclass Post(db.Model):\n \"\"\"Model representing a blog post.\n\n Attributes\n ----------\n id : db.Column... | python | chosen |
[
{
"from": "system",
"value": "Add test for not found URLs\n"
},
{
"from": "human",
"value": "from .helpers import BaseApplicationTest\n\n\nclass TestApplication(BaseApplicationTest):\n def test_index(self):\n response = self.client.get('/')\n assert 200 == response.status_code\n... | python | chosen |
[
{
"from": "system",
"value": "Test HTML handling in markdown\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.template import Context, Template\n\n\nclass BlogTemplatetagsTestCase(TestCase):\n def test_md_as_html5(self):\n\n body = \"\"\"# H1 heading\n\n... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.