conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add support for relativedelta timespecs\n\nThis uses the django-relativedeltafield formatter. We could copy the\nformatter into here but that's not great either. This can be improved\nonce we have a pluggable JSON serializer.\n"
},
{
"from": "human",
"value": "imp... | python | chosen |
[
{
"from": "system",
"value": "Enable keyword arguments when requesting metafields\n"
},
{
"from": "human",
"value": "import shopify.resources\n\nclass Countable(object):\n\n @classmethod\n def count(cls, _options=None, **kwargs):\n if _options is None:\n _options = kwargs... | python | chosen |
[
{
"from": "system",
"value": "Fix directory listing on windows.\n"
},
{
"from": "human",
"value": "from UM.Qt.ListModel import ListModel\nfrom UM.Application import Application\n\nfrom PyQt5.QtCore import Qt, pyqtProperty, pyqtSignal, QUrl\n\nimport os\nimport os.path\n\nclass DirectoryListModel... | python | chosen |
[
{
"from": "system",
"value": "Add name method to ConsoleBridge\n\nAdd method to name an id, be it a user, bridge, or the manager itself.\n"
},
{
"from": "human",
"value": "import threading\n\nfrom . import BaseBridge\nfrom .. import BaseEvent\n\nclass ConsoleBridge(BaseBridge):\n def __init__... | python | chosen |
[
{
"from": "system",
"value": "[IMP] event_registration_hr_contract: Remove the dependence with the module hr_contract_stage.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# (c) 2016 Alfredo de la Fuente - AvanzOSC\n# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html\n{... | python | chosen |
[
{
"from": "system",
"value": "Modify the code in the getKey() function so that it gracefully ignores non-integer input.\n"
},
{
"from": "human",
"value": "# Caesar Cipher\n\nMAX_KEY_SIZE = 26\n\ndef getMode():\n while True:\n print('Do you wish to encrypt or decrypt a message?')\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix import bug due to rebase\n"
},
{
"from": "human",
"value": "from ._hog import hog\nfrom ._greycomatrix import greycomatrix, greycoprops\nfrom .hog import hog\nfrom .texture import greycomatrix, greycoprops, local_binary_pattern\nfrom .peak import peak_local_max\... | python | chosen |
[
{
"from": "system",
"value": "Add command-line flags for spline order and accuracy.\n"
},
{
"from": "human",
"value": "import climate\nimport lmj.plot\nimport numpy as np\n\nimport source\nimport plots\n\n\n@climate.annotate(\n root='load experiment data from this directory',\n pattern='pl... | python | chosen |
[
{
"from": "system",
"value": "Reorder imports and use Black code style.\nUpdated version to 0.4.4\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom graphql.type.directives import specified_directives as default_directives\n\nfrom .list import ShuffleGraphQLDirective, SampleGraphQL... | python | chosen |
[
{
"from": "system",
"value": "Fix writing UTF-8 texts to certificate templates\n\nThe certificate PDF can’t reliably render all variants of UTF-8 text.\nWe will need to disable non-ASCII input."
},
{
"from": "human",
"value": "from os import system\nfrom os import unlink\nfrom os.path import dir... | python | chosen |
[
{
"from": "system",
"value": "Add get_data method to data importer\n\nSigned-off-by: Matheus Fernandes <9de26933bf4170c6685be29c190c23bc8c34d55f@gmail.com>\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom urllib.parse import urljoin, urlencode\n\n\nclass ComputerDataImpo... | python | chosen |
[
{
"from": "system",
"value": "Rename one test, use default dx and dz, fix naming of test class.\n"
},
{
"from": "human",
"value": "import unittest\nimport numpy as np\nfrom anemoi import AnalyticalHelmholtz\n\nclass TestMiniZephyr(unittest.TestCase):\n\n def setUp(self):\n pass\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix usage of `version_info` on Python 2.\n"
},
{
"from": "human",
"value": "# vim: fileencoding=utf-8\nfrom __future__ import print_function, absolute_import, unicode_literals\nimport sys\n\nclass VersionError (ValueError):\n pass\n\ndef check_ex ():\n major, ... | python | chosen |
[
{
"from": "system",
"value": "Change subject to every mail to was sent\n"
},
{
"from": "human",
"value": "# Copyright 2013 Rooter Analysis S.L.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may o... | python | chosen |
[
{
"from": "system",
"value": "Remove replacement of non existing migration\n\nFixes #16\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.5 on 2016-07-28 02:33\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nclass Migration(mi... | python | chosen |
[
{
"from": "system",
"value": "Increase polling freqency to speed up tests.\n"
},
{
"from": "human",
"value": "# Copyright 2018 Nathan Sommer and Ben Coleman\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as publi... | python | chosen |
[
{
"from": "system",
"value": "Print stack trace of exception.\n"
},
{
"from": "human",
"value": "import sys\nimport traceback\n\nclass CustomException(Exception):\n def __init__(self, *args, **kwargs):\n super(CustomException, self).__init__(*args, **kwargs)\n\ndef custom_function():\n... | python | chosen |
[
{
"from": "system",
"value": "Delete Actions if the related object is deleted\n\nAs we are loosing all the information when the object of an action is\ndeleted, the action itself may be deleted, too.\n"
},
{
"from": "human",
"value": "from django.apps import apps\nfrom django.conf import setting... | python | chosen |
[
{
"from": "system",
"value": "Update base api to include module and object imports, fix missing import of random subpackage\n"
},
{
"from": "human",
"value": "\"\"\"\nImport the main names to top level.\n\"\"\"\n\ntry:\n\timport numba\nexcept:\n\traise ImportError(\"Cannot import numba from curr... | python | chosen |
[
{
"from": "system",
"value": "Add test for go correspondance file begin\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nimport argparse\nimport re\n\ndef format_go_correspondance(args):\n go = {}\n with open(args.go_correspondance... | python | chosen |
[
{
"from": "system",
"value": "[BLD] Resolve RuntimeError: Invalid DISPLAY variable - tst\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Dec 30 02:37:25 2013\n\n@author: Jan\n\"\"\"\n\nimport unittest\n\n\nclass PlotStyleTest(unittest.TestCase):\n def test_d... | python | chosen |
[
{
"from": "system",
"value": "Comment for types of area that need importing\n"
},
{
"from": "human",
"value": "import time\n\nimport requests\nfrom bs4 import BeautifulSoup\n\nfrom django.core.management.base import BaseCommand\nfrom django.contrib.gis.geos import GEOSGeometry\nfrom django.contr... | python | chosen |
[
{
"from": "system",
"value": "Remove a useless trailing $\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, patterns, url\n\nfrom manoseimas.lobbyists import views\n\nurlpatterns = patterns(\n '',\n url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),\n ... | python | chosen |
[
{
"from": "system",
"value": "Add plant names and childs\n"
},
{
"from": "human",
"value": "# File: kindergarten_garden.py\n# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.\n# Programmer: Amal Shehu\n... | python | chosen |
[
{
"from": "system",
"value": "NetworkFeeder: Set default delay to 5 seconds (because of my slow laptop).\n"
},
{
"from": "human",
"value": "\nimport time\nimport threading\nimport socket\n\n\nclass NetworkFeeder:\n \"\"\"\n A class that feeds data to a socket port\n \"\"\"\n\n def __... | python | chosen |
[
{
"from": "system",
"value": "Add a comment to this example\n"
},
{
"from": "human",
"value": "import logging\nlogging.basicConfig()\n\nfrom jenkinsapi.jenkins import Jenkins\nJ = Jenkins('http://localhost:8080')\njobName = 'create_fwrgmkbbzk'\n\nconfig = J[jobName].get_config()\n\nprint config\... | python | chosen |
[
{
"from": "system",
"value": "Remove python2 print from img server\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n This example implements a server taking a single image when receiving a message from the client.\n\n The image will be fragmented into chunks. The first pac... | python | chosen |
[
{
"from": "system",
"value": "Fix post_syncdb signal for demo user to work with Django 1.1\n"
},
{
"from": "human",
"value": "\nfrom django.conf import settings\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth import models as auth_app\nfrom django.db.models.signals import ... | python | chosen |
[
{
"from": "system",
"value": "Add email notification when new user has signed up\n"
},
{
"from": "human",
"value": "from django import forms\n\n\nclass SignupForm(forms.Form):\n def signup(self, request, user):\n user.is_active = False\n user.save()\n"
},
{
"from": "gpt"... | python | chosen |
[
{
"from": "system",
"value": "Add `polymorphic` to `INSTALLED_APPS`, and also `MessageMiddlware` (because Django wants it).\n"
},
{
"from": "human",
"value": "\"\"\"\nTest settings for ``polymorphic_auth`` app.\n\"\"\"\n\nAUTH_USER_MODEL = 'polymorphic_auth.User'\nPOLYMORPHIC_AUTH = {\n 'DEFA... | python | chosen |
[
{
"from": "system",
"value": "Add tests for year and month archives\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8\n\nimport pytest\nimport requests\n\n\n@pytest.mark.parametrize('path', [\n # Check pagination is working correctly\n '/page/2/', '/page/3/',\... | python | chosen |
[
{
"from": "system",
"value": "Update relative imports in the Python library to support Python3\n"
},
{
"from": "human",
"value": "import shim\n\ntmpdir = None\n\ndef setUp():\n global tmpdir\n tmpdir = shim.setup_shim_for('kubectl')\n\ndef tearDown():\n global tmpdir\n shim.teardown_... | python | chosen |
[
{
"from": "system",
"value": "[FIX] mass_mailing_partner: Add sudo() to prevent user without mailing access try to merge contacts\n"
},
{
"from": "human",
"value": "# Copyright 2020 Tecnativa - Víctor Martínez\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nfrom odoo imp... | python | chosen |
[
{
"from": "system",
"value": "Change the is_producttype template tag to return a boolean rather than a string.\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.conf import settings\nfrom django.core import urlresolvers\nfrom django.template import Context, Template\nfr... | python | chosen |
[
{
"from": "system",
"value": "Add some more importing shortcuts\n"
},
{
"from": "human",
"value": "\"\"\"\nSupport for working with different sources of configuration values.\n\n class DefaultSettings(schema.Settings):\n SECRET_KEY = schema.Value(str)\n DEBUG = schema.Value(type... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Updated fields for Project model.\"\n\nThis reverts commit f68fc56dd2a7ec59d472806ffc14e993686e1f24.\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom django.db import models\nfrom uuidfield.fields import UUIDField\nfrom s... | python | chosen |
[
{
"from": "system",
"value": "Fix test runner importing wrong module.\n"
},
{
"from": "human",
"value": "import sys\n\ntry:\n from django.conf import settings\n\n settings.configure(\n DEBUG=True,\n USE_TZ=True,\n DATABASES={\n 'default': {\n ... | python | chosen |
[
{
"from": "system",
"value": "Rework the pip runner to use `PathFinder`\n\nThis makes it possible to only \"replace\" `pip` and have the submodules\nget correctly located by the regular importlib machinery. This also\nasserts that it was able to locate the module, ensuring that failure to\nlocate the module... | python | chosen |
[
{
"from": "system",
"value": "Add SNS topic for event NewCorsSiteRequestReceived\n"
},
{
"from": "human",
"value": "from amazonia.classes.sns import SNS\n\nfrom troposphere import Ref, Join, cloudwatch\nfrom troposphere.sns import Topic, Subscription\n\ndef user_registration_topic(emails):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update workshops as well as talks\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand, CommandError\n\nfrom events.models import Event\n\n\nclass Command(BaseCommand):\n help = \"Copies talk title and descriptions from the appli... | python | chosen |
[
{
"from": "system",
"value": "Define public interface in sms module\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright 2016 Messente Communications OÜ\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance ... | python | chosen |
[
{
"from": "system",
"value": "Choose which branch will be deployed\n"
},
{
"from": "human",
"value": "#encoding: utf-8\nfrom fabric.api import run, settings, cd, env\n\nenv.use_ssh_config = True\nenv.ssh_config_path = '~/.ssh/config'\n\n\ndef deploy():\n with settings(host_string='dash.dalton... | python | chosen |
[
{
"from": "system",
"value": "Return the right URL when a file is posted\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# vim: set ts=4\n\nfrom django.forms import ModelForm\nfrom django.http import Http404, HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Add check for PDF files\n"
},
{
"from": "human",
"value": "import ckan.model as model\nimport ckan.plugins as plugins\nimport ckan.plugins.toolkit as toolkit\nimport os\n\n\ndef get_number_of_files():\n return model.Session.execute(\"select count(*) from resource... | python | chosen |
[
{
"from": "system",
"value": "Fix .published() to accept current date as well.\n"
},
{
"from": "human",
"value": "\"\"\"\nThe manager class for the CMS models\n\"\"\"\nfrom datetime import datetime\nfrom django.db import models\nfrom django.db.models.query import QuerySet\nfrom django.db.models.... | python | chosen |
[
{
"from": "system",
"value": "Move string above the imports so it becomes a docstring\n"
},
{
"from": "human",
"value": "from __future__ import print_function, absolute_import, unicode_literals, division\n\nfrom datetime import datetime, timedelta\nfrom textwrap import dedent\n\nfrom bottle impo... | python | chosen |
[
{
"from": "system",
"value": "ENH: Make ID3Lab allow attr to be pluggable\n"
},
{
"from": "human",
"value": "import IPython\n\nimport ts_charting.lab.lab as tslab\nimport ipycli.standalone as sa\n\nfrom workbench import sharedx\n\nclass ID3Lab(tslab.Lab):\n def get_varname(self):\n \"\... | python | chosen |
[
{
"from": "system",
"value": "Add test for run-together interpolated expressions.\n"
},
{
"from": "human",
"value": "from src.circular.template.interpolatedstr import InterpolatedStr\nfrom src.circular.template.context import Context\nfrom tests.utils import TObserver\n\n\n\n\ndef test_string_in... | python | chosen |
[
{
"from": "system",
"value": "Use json module instead of django.utils.simplejson for Django 1.5\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom classytags.core import Tag, Options\nfrom django import template\nfrom django.core.serializers.json import DjangoJSONEncoder\nfrom djan... | python | chosen |
[
{
"from": "system",
"value": "Add TODO to comment in registration helper to reduce risk of task being forgotten\n"
},
{
"from": "human",
"value": "def get_referrer_from_request(request):\n # determine what source led the user to the export directory\n # if navigating internally then return... | python | chosen |
[
{
"from": "system",
"value": "Change obj to self in selfparams\n\nThis is so sphinx detects the first parameter in decorated functions\nas `self`, and therefore does not display it in the method signature.\n"
},
{
"from": "human",
"value": "import numba\n\n\ndef selfparams(f):\n def wrapped_f... | python | chosen |
[
{
"from": "system",
"value": "Set wrapping to soft on textareas\n"
},
{
"from": "human",
"value": "from django import forms\nimport cube.diary.models\n\nclass DiaryIdeaForm(forms.ModelForm):\n class Meta(object):\n model = cube.diary.models.DiaryIdea\n\nclass EventForm(forms.ModelForm)... | python | chosen |
[
{
"from": "system",
"value": "Add try/except to catch if no extensions are parsed.\n"
},
{
"from": "human",
"value": "###################################################################################################\n#\n# chrome_extensions.py\n# Adds the name and description of each Chrome e... | python | chosen |
[
{
"from": "system",
"value": "Tidy imports and opening the tmpfile\n"
},
{
"from": "human",
"value": "import os\nimport json\n\nfrom django.http import HttpResponse\nfrom django.views.decorators.csrf import csrf_exempt\n\nfrom . import actions\n\n\ndef info(request, uuid):\n \"\"\"\n Retur... | python | chosen |
[
{
"from": "system",
"value": "Disable autouse for set_up so that help tests don't generate unnecessary files."
},
{
"from": "human",
"value": "# pylint: disable=C0111\nimport pytest\nimport os\nimport tarfile\n\nBASEDIR = os.path.dirname(__file__)\n\n\n@pytest.fixture(autouse=True)\ndef set_up(t... | python | chosen |
[
{
"from": "system",
"value": "Add back 1.0.X compatibility for Router URL resolution.\n\nSigned-off-by: Simon Willison <088e16a1019277b15d58faf0541e11910eb756f6@simonwillison.net>"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns\nfrom django.core import urlresolver... | python | chosen |
[
{
"from": "system",
"value": "Throw an error if bluetooth is not supported on the py3 installation\n"
},
{
"from": "human",
"value": "import bluePoV\nimport pygame\n\nx,y = (480,64)\nMAC = \"00:00:00:00:00:00\"\n\npygame.init()\npygame.display.set_mode((x,y))\n\ns = pygame.display.get_surface()\... | python | chosen |
[
{
"from": "system",
"value": "Add test for cypress defaults\n"
},
{
"from": "human",
"value": "\"\"\"\"\"\"\nfrom penn_chime.parameters import Parameters\n\n\ndef test_cli_defaults():\n \"\"\"Ensure if the cli defaults have been updated.\"\"\"\n # TODO how to make this work when the module... | python | chosen |
[
{
"from": "system",
"value": "Replace commas in names of cities with spaces"
},
{
"from": "human",
"value": "import json\n\ndef main():\n\n # print the header of output csv file\n print 'business_id,city,latitude,longitude'\n\n # for each entry in input json file print one csv row\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix jupyterlab import error message\n"
},
{
"from": "human",
"value": "\"\"\"Server extension for JupyterLab.\"\"\"\n\n# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\ntry:\n from ._version import __version_... | python | chosen |
[
{
"from": "system",
"value": "Fix BaseHTTPAdapter for the SSL case\n\nSigned-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com>\n"
},
{
"from": "human",
"value": "import requests.adapters\n\n\nclass BaseHTTPAdapter(requests.adapters.HTTPAdapter):\n def close(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Improve list of headers returned with health route in order to remove /r/n\n"
},
{
"from": "human",
"value": "from flask import request, Blueprint, Response\nfrom flask import current_app\nimport json\n\n# This is the blueprint object that gets registered into the a... | python | chosen |
[
{
"from": "system",
"value": "Add tests for non-chunked roundtrip\n"
},
{
"from": "human",
"value": "import lz4.frame as lz4frame\nimport pytest\n\ndef test_create_compression_context():\n context = lz4frame.create_compression_context()\n assert context != None\n\ndef test_create_decompres... | python | chosen |
[
{
"from": "system",
"value": "Stop using django's internal `_create_object_from_params`\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import absolute_import, unicode_literals\n\nfrom django.db.models import QuerySet, Q\nfrom django.utils import timezone\n\nimport logging\n\... | python | chosen |
[
{
"from": "system",
"value": "Update test for largest stock\n"
},
{
"from": "human",
"value": "import cutplanner\nimport unittest\n\nclass TestPlanner(unittest.TestCase):\n\n def setUp(self):\n sizes = [80, 120]\n needed = [10, 25, 75]\n loss = 0.25\n self.planner ... | python | chosen |
[
{
"from": "system",
"value": "Fix OnAccess job link for JobConfig\n"
},
{
"from": "human",
"value": "\"\"\"\nJob metadata stored along side the code\n\"\"\"\n\nfrom yaml_model import LoadOnAccess, Model, OnAccess\n\n\ndef get_job(slug):\n \"\"\"\n Wrapper to import, and return a Job object... | python | chosen |
[
{
"from": "system",
"value": "Improve runtime by using an array of diffs\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\n\ndef arrayManipulation(n, queries):\n array = [0] * n\n for a, b, k in queries:\n # Start is... | python | chosen |
[
{
"from": "system",
"value": "Monitor temperature script as used for heating measurement\n"
},
{
"from": "human",
"value": "import time\nimport serial\nimport matplotlib.pyplot as plt\nimport csv\nimport os\nimport brewkettle\nreload(brewkettle)\n\nfilename = time.strftime(\"%Y-%m-%d %H:%M\") + ... | python | chosen |
[
{
"from": "system",
"value": "Fix a issue when a provider has not been added\n"
},
{
"from": "human",
"value": "# Stdlib imports\n# E.g.: from math import sqrt\n\n# Core Django imports\nfrom django.contrib.auth.decorators import login_required\nfrom django.shortcuts import redirect, render\n\n# ... | python | chosen |
[
{
"from": "system",
"value": "Use simple_tag instead of assignment_tag.\n\nhttps://docs.djangoproject.com/en/2.2/releases/1.9/#assignment-tag\n"
},
{
"from": "human",
"value": "from django import template\n\nfrom symposion.reviews.models import ReviewAssignment\n\n\nregister = template.Library()... | python | chosen |
[
{
"from": "system",
"value": "util: Call super __init__ from Namespace.__init__\n"
},
{
"from": "human",
"value": "\"\"\"\nStuff for building namespace\n\"\"\"\n\nfrom _compat import *\n\nclass Namespace(object):\n \"\"\"\n Backport of SimpleNamespace() class added in Python 3.3\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Disable South migrations for tests.\n"
},
{
"from": "human",
"value": "DATABASES = {\n 'default': {\n 'ENGINE': 'sqlite3',\n 'NAME': ':memory:'\n }\n}\n\nMIDDLEWARE_CLASSES = [\n 'fandjango.middleware.FacebookMiddleware'\n]\n\nINSTALLED_APPS =... | python | chosen |
[
{
"from": "system",
"value": "Update receive and send functions according to the new requirements\n"
},
{
"from": "human",
"value": "from channels import Group\n\n\ndef ws_echo(message):\n Group(str(message.content['text'])).add(message.reply_channel)\n message.reply_channel.send({\n ... | python | chosen |
[
{
"from": "system",
"value": "4: Create script to save documentation to a file \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christop... | python | chosen |
[
{
"from": "system",
"value": "Add first test for ccs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport unittest\nimport sys\n\n# This line allows the tests to run if you just naively run this script.\n# But the preferred way is to use run_tests.sh\nsys.path.insert(0,'../MultiQC... | python | chosen |
[
{
"from": "system",
"value": "Add test for redactor block creation\n"
},
{
"from": "human",
"value": "\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Set scheduler to start at 8pm\n"
},
{
"from": "human",
"value": "import bottle\nimport waitress\nimport controller\nimport breathe\nfrom pytz import timezone\nfrom apscheduler.schedulers.background import BackgroundScheduler\n\nbottle_app = bottle.app()\nscheduler =... | python | chosen |
[
{
"from": "system",
"value": "Make sure to close the file afterwards\n"
},
{
"from": "human",
"value": "import web\nimport cPickle as pickle\nimport json\n\nurls = (\n '/latest', 'latest',\n '/history', 'history'\n)\n\nclass latest:\n def GET(self):\n try:\n latest = p... | python | chosen |
[
{
"from": "system",
"value": "Add lagged phase space plot\n"
},
{
"from": "human",
"value": "\"\"\"\nGenerate nice plots providing additional information\n\"\"\"\nimport sys\n\nimport numpy as np\nimport matplotlib.pylab as plt\n\n\ndef neural_spike():\n \"\"\" Plot various neural spikes\n ... | python | chosen |
[
{
"from": "system",
"value": "Move wait_time.py into user module"
},
{
"from": "human",
"value": "from .user.sequential_taskset import SequentialTaskSet\nfrom .user.task import task, TaskSet\nfrom .user.users import HttpUser, User\nfrom .event import Events\nfrom .wait_time import between, const... | python | chosen |
[
{
"from": "system",
"value": "Add print statements for clarity\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python3\n# Python Challenge - 6\n# http://www.pythonchallenge.com/pc/def/channel.html\n# http://www.pythonchallenge.com/pc/def/channel.zip\n# Keyword: hockey -> oxygen\n\nimport re\... | python | chosen |
[
{
"from": "system",
"value": "Add tests for the clustering of cities\n"
},
{
"from": "human",
"value": "\"\"\" Tests for the clustering computation \"\"\"\nfrom nose.tools import *\nimport marble as mb\n\n\n# Test c = 0 in the checkerboard case\n# Test c = 1 in the fully clustered case\n# Test a... | python | chosen |
[
{
"from": "system",
"value": "Remove references to traffic balance\n\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import annotations\nfrom typing import List, Optional\n\nfrom sipa.model.pycroft.unserialize import unserializer\n\n\n@unserializer\nclass UserData:\n ... | python | chosen |
[
{
"from": "system",
"value": "Use abspath for COPY command\n"
},
{
"from": "human",
"value": "import os\nimport glob\n\nfrom django.apps import apps\nfrom django.db import connection\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCommand):\n \"\"\"\n Turn off a... | python | chosen |
[
{
"from": "system",
"value": "Fix up settings for upstream Girder change\n"
},
{
"from": "human",
"value": "from girder.api import access\nfrom girder.api.describe import Description, autoDescribeRoute\nfrom girder.api.rest import Resource, RestException\nfrom girder.constants import AccessType,... | python | chosen |
[
{
"from": "system",
"value": "Fix KeyError when getting fedmsg message info.\n"
},
{
"from": "human",
"value": "#!/bin/env python\n# -*- coding: utf8 -*-\n\nimport fedmsg.consumers\nimport fedmsg.encoding\n\nimport fedimg.uploader\n\n\nclass KojiConsumer(fedmsg.consumers.FedmsgConsumer):\n # ... | python | chosen |
[
{
"from": "system",
"value": "Exclude uri fields from EventResource\n"
},
{
"from": "human",
"value": "from tastypie.resources import ModelResource\nfrom models import Event\n\nfrom mozcal.base.serializers import MozcalSerializer\n\n\nclass EventResource(ModelResource):\n class Meta:\n query... | python | chosen |
[
{
"from": "system",
"value": "Add typed positional argument examples\n"
},
{
"from": "human",
"value": "import argparse\n\nparser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatte... | python | chosen |
[
{
"from": "system",
"value": "Update down-revision of queue migration script\n"
},
{
"from": "human",
"value": "\"\"\"add enqueue_job column to smtpserver table\n\nRevision ID: 849170064430\nRevises: a63df077051a\nCreate Date: 2018-11-22 10:04:00.330101\n\n\"\"\"\n\n# revision identifiers, used ... | python | chosen |
[
{
"from": "system",
"value": "Make batch less, because sqlite cannot handle big batches\n"
},
{
"from": "human",
"value": "from django.core.management import BaseCommand\nfrom django_pyowm.models import Location\nfrom pyowm.webapi25.location import Location as LocationEntity\n\nfrom weather_api.... | python | chosen |
[
{
"from": "system",
"value": "Reset caching variable to False\n"
},
{
"from": "human",
"value": "# set debug to False on non prod env\nIS_DEV = True\n\n# profile speed of methods and output it to terminal\nPROFILE_METHODS = False\n\n# set to false if you want to disable accessing redis\nCACHE_DA... | python | chosen |
[
{
"from": "system",
"value": "Simplify the groupfinder a little. In general we should try to use session.query(...).get() rather than .filter().\n"
},
{
"from": "human",
"value": "from sqlalchemy.orm.exc import NoResultFound\nfrom .storage import (\n DBSession,\n UserMap,\n )\n\n\ndef g... | python | chosen |
[
{
"from": "system",
"value": "Add integration tests for CRM app.\n"
},
{
"from": "human",
"value": "\"\"\"\nTest the frontend.\n\"\"\"\n\nfrom base import IntegrationTestCase\nfrom abilian.web.frontend import CRUDApp, BreadCrumbs\n\n\nclass FrontendTestCase(IntegrationTestCase):\n\n def test(se... | python | chosen |
[
{
"from": "system",
"value": "Update to display notes count bubble only when new notes are available\n"
},
{
"from": "human",
"value": "from django.template import Library, Node, TemplateSyntaxError\nfrom django.utils.html import escape\nfrom django.utils.http import urlquote\nfrom django.utils.... | python | chosen |
[
{
"from": "human",
"value": "Test that get last record method\n"
},
{
"from": "gpt",
"value": "from unittest import TestCase\nfrom unittest.mock import (\n Mock,\n patch,\n)\n\nimport requests.exceptions\n\nfrom py_nist_beacon import NistRandomnessBeacon\nfrom py_nist_beacon.nist_randomnes... | python | chosen |
[
{
"from": "system",
"value": "Update User model class with flask-login methods\n"
},
{
"from": "human",
"value": "from werkzeug.security import generate_password_hash, check_password_hash\n\nclass User(object):\n \"\"\"represents a user who can CRUD his own bucketlists\"\"\"\n\n users = {}... | python | chosen |
[
{
"from": "system",
"value": "Fix remaining absolute path in tests\n"
},
{
"from": "human",
"value": "import pytest\nfrom skidl import *\nfrom .setup_teardown import *\n\ndef test_parser_1():\n netlist_to_skidl(r'C:\\xesscorp\\KiCad\\tools\\skidl\\tests\\Arduino_Uno_R3_From_Scratch.net')\n"
... | python | chosen |
[
{
"from": "system",
"value": "Fix for using NAG Fortran 95, due to James Graham <jg307@cam.ac.uk>\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nfrom numpy.distutils.cpuinfo import cpu\nfrom numpy.distutils.fcompiler import FCompiler\n\nclass NAGFCompiler(FCompiler):\n\n compiler... | python | chosen |
[
{
"from": "system",
"value": "Add an interface to change loading encoding for File/URL loaders\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\n\nfrom ..interface imp... | python | chosen |
[
{
"from": "system",
"value": "Add format and lw kwargs\n"
},
{
"from": "human",
"value": "data = []\n\ndef plot(x, y, label=None):\n d = {\n \"data\": zip(x, y),\n }\n if label:\n d[\"label\"] = label\n data.append(d)\n\ndef show():\n from plotserver.runserver im... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.