conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix upgrade step 1115: rebuild catalog\n"
},
{
"from": "human",
"value": "from Acquisition import aq_inner\nfrom Acquisition import aq_parent\nfrom Products.CMFCore.utils import getToolByName\n\n\ndef upgrade(tool):\n \"\"\" Just some catalog indexes to update\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Added comment and used more generic code in xpath validator\"\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom collections import namedtuple\nfrom corehq.apps.app_manager.xpath_validato... | python | chosen |
[
{
"from": "system",
"value": "Handle updated boto exception format.\n\nSee https://github.com/boto/boto/issues/625\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nThis module contains the set of Dynochemy's exceptions\n\n:copyright: (c) 2012 by Rhett Garber.\n:license: ISC,... | python | chosen |
[
{
"from": "system",
"value": "Make the compression optional, as it slows down.\n"
},
{
"from": "human",
"value": "import theano as _th\nimport numpy as _np\n\n\ndef create_param(shape, init, fan=None, name=None, type=_th.config.floatX):\n return _th.shared(init(shape, fan).astype(type), name=... | python | chosen |
[
{
"from": "system",
"value": "Fix test for transform registry.\n\nIn 24016ce74afc83b18197c89f95d260b388e6e309, the value of\ntransform.validators was changed from a list to an OrderedDict.\n\nUpdate the tests to reflect this change.\n"
},
{
"from": "human",
"value": "from unittest import TestCas... | python | chosen |
[
{
"from": "system",
"value": "Fix bug due to wrong arguments order.\n"
},
{
"from": "human",
"value": "\"\"\"This module contains the main wrapper class.\"\"\"\n\n\nclass BaseWrapper:\n \"\"\"Define base template for function wrapper classes. \"\"\"\n\n def __init__(self, func):\n s... | python | chosen |
[
{
"from": "system",
"value": "Add sklearn as a dependency for ImgProcessingCLI\n"
},
{
"from": "human",
"value": "# This is the setup file for pip\nfrom setuptools import setup, find_packages\nimport os, sys\nfrom os import path\n\nsetup(\n name = 'ImgProcessingCLI',\n\n version = '0.0.1',... | python | chosen |
[
{
"from": "system",
"value": "Add plug-in summary for osc doc\n\nStevedore Sphinx extension handles this comment.\nhttp://docs.openstack.org/developer/python-openstackclient/plugin-commands.html\n\nChange-Id: Id6339d11b900a644647c8c25bbd630ef52a60aab\n"
},
{
"from": "human",
"value": "# Licens... | python | chosen |
[
{
"from": "system",
"value": "Refactor Constants initialization to throw more specific exceptions\n"
},
{
"from": "human",
"value": "from collections import namedtuple\n\n\nclass Constants(object):\n Constant = namedtuple('Constant', ['codename', 'value', 'description'])\n\n def __init__(s... | python | chosen |
[
{
"from": "system",
"value": "Configure logging handlers before submodule imports\n\n- Fix #474\n- Fix #475\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>\n#\n# This code is distributed under the terms and conditions\n# fro... | python | chosen |
[
{
"from": "system",
"value": "Fix syntax to work with Django 3.2\n"
},
{
"from": "human",
"value": "# Needed due to django 1.7 changed app name restrictions\n\nfrom django.apps import AppConfig\n\n\nclass RegistrationConfig(AppConfig):\n label = 'wafer.registration'\n name = 'wafer.registr... | python | chosen |
[
{
"from": "system",
"value": "Decompress downloaded files from disk, not in memory\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport ftplib\nimport gzip\nimport sys\n\nhost = 'ftp.ncdc.noaa.gov'\nbase = '/pub/data/noaa'\nretries = 3\n\nftp = ftplib.FTP(host)\nftp.login()\nfor l... | python | chosen |
[
{
"from": "system",
"value": "Use URL regex as per main Django project\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\nfrom cellcounter.accounts import views\n\nurlpatterns = patterns('',\n url('^new/$', views.RegistrationView.as_view(), name='register'),\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a comment to py3 byte string decode.\n"
},
{
"from": "human",
"value": "from django.contrib import auth\nfrom django.contrib.auth.middleware import AuthenticationMiddleware\n\nimport base64\n\n\nclass AutologinAuthenticationMiddleware(AuthenticationMiddleware):\... | python | chosen |
[
{
"from": "system",
"value": "Use FF as test browser in Travis\n"
},
{
"from": "human",
"value": "# TODO: not sure why but we need to include the SECRET_KEY here - importing from the test_runner file doesn't work\nSECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q=='\n\nfrom .t... | python | chosen |
[
{
"from": "system",
"value": "Modify stdout logging in crawler run\n"
},
{
"from": "human",
"value": "\"\"\"\nscrapple.utils.config\n~~~~~~~~~~~~~~~~~~~~~\n\nFunctions related to traversing the configuration file\n\"\"\"\n\nfrom __future__ import print_function\n\n\ndef traverse_next(page, next,... | python | chosen |
[
{
"from": "system",
"value": "Fix the feed to work with new versions of django\n"
},
{
"from": "human",
"value": "from django.db.models.query import QuerySet\nfrom django.db.models.fields.related import SingleRelatedObjectDescriptor\n\nclass InheritanceQuerySet(QuerySet):\n def select_subclasse... | python | chosen |
[
{
"from": "system",
"value": "Add a dummy secret key to settings\n\n(bad, i know)\n"
},
{
"from": "human",
"value": "from core.settings.base import * # noqa\n\n\nDEBUG = False\n\nALLOWED_HOSTS = ['*.miximum.fr']\n"
},
{
"from": "gpt",
"value": "from core.settings.base import * # no... | python | chosen |
[
{
"from": "system",
"value": "Add default value for date\n\nwith @NerdyProjects\n"
},
{
"from": "human",
"value": "from django.db.models import ForeignKey, DateTimeField, ManyToManyField\nfrom yunity.models.entities import User, Location, Mappable, Message\nfrom yunity.models.utils import BaseMo... | python | chosen |
[
{
"from": "system",
"value": "Validate that the submission URLs are for GitHub\n"
},
{
"from": "human",
"value": "from django.forms import ModelForm\n\nfrom .models import Submission\n\n\nclass SubmissionForm(ModelForm):\n\n class Meta:\n model = Submission\n fields = ('url',)\n... | python | chosen |
[
{
"from": "system",
"value": "Add sufficient leading lines to indicate the launching program of this script.\n"
},
{
"from": "human",
"value": "'''\nCreated on Mar 28, 2017\n\n@author: Jack Rausch\n'''\nimport http.client\nimport json\nimport ssl\nimport tbapy\n#import requests\n\nURL = \"http:/... | python | chosen |
[
{
"from": "system",
"value": "Fix test execution. Doesn't actually do anything.\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom .. import flattener\n\ndef test_thingy():\n assert 1 == 1\n"
},
{
"from": "gpt",
"value": "import pytest\n\nfrom .. import core\n\ndef test_thin... | python | chosen |
[
{
"from": "system",
"value": "Update patch version ahead of a minor release.\n\nPiperOrigin-RevId: 393332838\nChange-Id: I70845f5a679a29f6bd9f497896c5820fd2880df2\n"
},
{
"from": "human",
"value": "# python3\n# Copyright 2018 DeepMind Technologies Limited. All rights reserved.\n#\n# Licensed und... | python | chosen |
[
{
"from": "system",
"value": "Modify function that calculate the expected signature\n"
},
{
"from": "human",
"value": "import logging\nimport hashlib\nimport json\n\nfrom django.http import HttpResponse, HttpResponseForbidden\nfrom django.views.decorators.csrf import csrf_exempt\nfrom app.models... | python | chosen |
[
{
"from": "system",
"value": "Use pkg-config for freetype2 include discovery.\n"
},
{
"from": "human",
"value": "import os\nfrom SCons.Script import *\n\n\ndef configure(conf):\n env = conf.env\n\n conf.CBCheckHome('freetype2',\n inc_suffix=['/include', '/include/freety... | python | chosen |
[
{
"from": "system",
"value": "viewhelpers: Remove import for multiselect and objecttable.\n"
},
{
"from": "human",
"value": "from . import mixins # noqa\nfrom . import generic # noqa\nfrom . import formbase # noqa\nfrom . import crudbase # noqa\nfrom . import create # noqa\nfrom . import up... | python | chosen |
[
{
"from": "system",
"value": "Add negative price exception test.\n"
},
{
"from": "human",
"value": "import unittest\nfrom datetime import datetime\n\nfrom stock import Stock\n\n\nclass StockTest(unittest.TestCase):\n def test_new_stock_price(self):\n \"\"\"A new stock should have a pri... | python | chosen |
[
{
"from": "system",
"value": "Use request.version instead of hardcoding\n"
},
{
"from": "human",
"value": "from rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\nfrom .utils import absolute_reverse\nfrom api.users.serializers import UserSerializer\n\n@api... | python | chosen |
[
{
"from": "system",
"value": "Use ResponseError instead of NoScriptError to be compatible with earlier versions of the redis client\n"
},
{
"from": "human",
"value": "import hashlib\n\nfrom redis.exceptions import NoScriptError\n\n\nclass LuaScript(object):\n\n def __init__(self, redis, templ... | python | chosen |
[
{
"from": "system",
"value": "Exclude tests if there are no credentials in VCAP_SERVICES\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nimport os\n\nimport pytest\nfrom os.path import join, dirname\nfrom glob import glob\n\n# tests to exclude\nexcludes = ['authorization_v1.py', 'alchemy_da... | python | chosen |
[
{
"from": "system",
"value": "Fix for assertIs method not being present in Python 2.6.\n"
},
{
"from": "human",
"value": "from datetime import datetime\nimport sys\nimport unittest\n\nimport btceapi\n\n\nclass TestScraping(unittest.TestCase):\n def test_scrape_main_page(self):\n mainPa... | python | chosen |
[
{
"from": "system",
"value": "Remove grouper and grouper based batchers\n\nI prefer to not use the filter fill value method to\nbatch. I don't like the need to allocate room for\nthe fill value object.\n"
},
{
"from": "human",
"value": "from functools import partial\nfrom itertools import imap\n... | python | chosen |
[
{
"from": "system",
"value": "i18n: Fix test data in an env test on skeleton generation\n\nGitOrigin-RevId: 7be12c5b3b3a333e7e3afebe45fe32770bbdfa81"
},
{
"from": "human",
"value": "import binascii\nimport datetime\nimport <error descr=\"No module named nonexistent\">nonexistent</error>\n\n\npri... | python | chosen |
[
{
"from": "system",
"value": "Update Python expect_exception to be like C++'s\n"
},
{
"from": "human",
"value": "#ckwg +4\n# Copyright 2012 by Kitware, Inc. All Rights Reserved. Please refer to\n# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,\n# Kitware, Inc., 28 Cor... | python | chosen |
[
{
"from": "system",
"value": "Remove logging to stdout when performing tests\n\nDuring tests it logs to /dev/null in order to avoid bottleneck\n\nChange-Id: I4fd54cf1f2c572b9750d63450da67ef06101a8d8\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n#\n# Copyright 2015 Red Hat, Inc.\n... | python | chosen |
[
{
"from": "system",
"value": "Define __all__ to suppress lint warnings.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport logging\nlogger = logging.getLogger('keyring')\n\nfrom .core import (set_keyring, get_keyring, set_password, get_password,\n ... | python | chosen |
[
{
"from": "system",
"value": "Add QA skip for import ordering"
},
{
"from": "human",
"value": "from logging import getLogger\nfrom pkg_resources import get_distribution\n\nfrom django import apps\n\nlog = getLogger(__name__)\n\n\nclass AppConfig(apps.AppConfig):\n name = \"axes\"\n initial... | python | chosen |
[
{
"from": "system",
"value": "Load blog data from command line\n"
},
{
"from": "human",
"value": "from blogtrans.ui.MainWindow import *\nimport sys, traceback\nimport getopt\nimport wx\n\n# Importers / Exporters\nfrom blogtrans.wretch.WretchImporter import WretchImporter\nfrom blogtrans.mt impor... | python | chosen |
[
{
"from": "system",
"value": "Change docstring to inline comment\n\nThis is in response to comment from smichr\n\n\tmodified: sympy/core/tests/test_compatibility.py\n"
},
{
"from": "human",
"value": "from sympy.core.compatibility import default_sort_key, as_int, ordered\nfrom sympy.core.single... | python | chosen |
[
{
"from": "system",
"value": "Support Paginator.page_range returning an iterator or list\n\nPaginator.page_range will return an iterator in Django 1.9+\n"
},
{
"from": "human",
"value": "from django import template\n\nregister = template.Library()\n\n\n@register.filter\ndef four_before_page(page... | python | chosen |
[
{
"from": "system",
"value": "Remove text to make tweet unique for testing\n"
},
{
"from": "human",
"value": "# Listener Class Override\nimport time\nimport json\nfrom tweepy.streaming import StreamListener\nimport sys\n\nclass Listener(StreamListener):\n def __init__(self, twitter_api, start... | python | chosen |
[
{
"from": "system",
"value": "Rename translations to translations_select, switch to HTTPS\n"
},
{
"from": "human",
"value": "\"\"\"\nVerseBot for reddit\nBy Matthieu Grieger\nwebparser.py\nCopyright (c) 2015 Matthieu Grieger (MIT License)\n\"\"\"\n\nfrom bs4 import BeautifulSoup\nfrom urllib.req... | python | chosen |
[
{
"from": "system",
"value": "Change double quotes to single quotes\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys, os \nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\")) \n\nimport messagebird\n\nACCESS_KEY = 'test_gshuPaZoeEG6ovbc8M79w0QyM'\n\ntry:\n # ... | python | chosen |
[
{
"from": "system",
"value": "Use constant_time_compare for view restriction password checks\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import gettext as _\nfrom django.utils.translation import gettext_lazy\n\n\nclass PasswordViewRestrictionForm(fo... | python | chosen |
[
{
"from": "system",
"value": "Set the right description for the OBJ reader\n"
},
{
"from": "human",
"value": "#Shoopdawoop\nfrom . import OBJReader\n\ndef getMetaData():\n return {\n 'type': 'mesh_reader',\n 'plugin': {\n \"name\": \"OBJ Reader\",\n },\n ... | python | chosen |
[
{
"from": "system",
"value": "Create release 1.2.1 with conan and bintray support.\n"
},
{
"from": "human",
"value": "from conans import ConanFile\nimport os\n\n\nclass ArghConan(ConanFile):\n name = \"argh\"\n version = \"1.2.0\"\n url = \"https://github.com/adishavit/argh\"\n descr... | python | chosen |
[
{
"from": "system",
"value": "Fix unicode strings in migration\n\nFixes #31\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nfrom django.conf import settings\n\n\nclass Migration(migrations.Migration)... | python | chosen |
[
{
"from": "system",
"value": "Use META.SERVER_NAME in template view.\n\nWe may want to access this example from a different machine.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.contrib.auth.models import User\nfrom django.http import HttpResponse\nfrom django.views.ge... | python | chosen |
[
{
"from": "system",
"value": "Change cookie name for mobile setting\n\n--HG--\nextra : convert_revision : svn%3Ae08d0fb5-4147-0410-a205-bba44f1f51a3/trunk%40553\n"
},
{
"from": "human",
"value": "from settings import *\nimport settings\n\nTEMPLATE_DIRS_BASE = TEMPLATE_DIRS\n\nTEMPLATE_DIRS = (\n... | python | chosen |
[
{
"from": "system",
"value": "Add sample urls to json.dump\n"
},
{
"from": "human",
"value": "import os, os.path\nimport random\nimport string\nimport json\n\nimport cherrypy\n\n\nfrom . import get_pic\n\n\n\nclass StringGenerator(object):\n @cherrypy.expose\n def index(self):\n ret... | python | chosen |
[
{
"from": "system",
"value": "Convert stub: Python 3 compatibility\n\nImportant for systems where `python` is 3.x, like Arch, even when beets itself\nis running on Python 2.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"A tiny tool used to test the `convert` plugin. It copies... | python | chosen |
[
{
"from": "system",
"value": "Add support for html2text or no parser\nWill still prefer beautifulsoup4 if installed\n"
},
{
"from": "human",
"value": "from bs4 import BeautifulSoup\n\ndef parse(html):\n soup = BeautifulSoup(html, features=\"html.parser\")\n return soup.get_text()"
},
{... | python | chosen |
[
{
"from": "system",
"value": "Remove a class definition that no longer needed\n"
},
{
"from": "human",
"value": "\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\n\nimport subprocess\nimport sys\nfrom typing import Optional\n\nfrom .typing import Command\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Clean play code for GStreamer\n"
},
{
"from": "human",
"value": "import logging\n\nimport gst\n\nfrom mopidy import config\nfrom mopidy.backends import BaseBackend\nfrom mopidy.models import Artist, Album, Track, Playlist\n\nlogger = logging.getLogger(u'backends.gst... | python | chosen |
[
{
"from": "system",
"value": "Disable debug mode in python unit test.\n"
},
{
"from": "human",
"value": "'''Unit tests for CODA binary serialization'''\nimport io\nimport unittest\nfrom coda import descriptors\nfrom coda.io.binarycodec import BinaryCodec\nfrom coda.runtime.descdata import BoolVa... | python | chosen |
[
{
"from": "system",
"value": "Add handling of an empty search\n"
},
{
"from": "human",
"value": "from flask import Flask, Response, request, jsonify\nfrom ldap3 import Server, Connection, ALL\nimport json\nimport re\n\napp = Flask(__name__) # create the application instance :)\n\n@app.route('/')... | python | chosen |
[
{
"from": "system",
"value": "Python: Add false negative test case.\n"
},
{
"from": "human",
"value": "# FP Type annotation counts as redefinition\n# See https://github.com/Semmle/ql/issues/2652\n\ndef type_annotation(x):\n foo = 5\n if x:\n foo : int\n do_stuff_with(foo)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add docstring on every entity"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# This file defines the entities needed by our legislation.\n\nfrom openfisca_core.entities import build_entity\n\nHousehold = build_entity(\n key = \"household\",\n plur... | python | chosen |
[
{
"from": "system",
"value": "Use the webserver module, which means the script is now cross-platform. Hooray, Python\\!\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport re\nimport subprocess\nimport urlparse\nimport platform\nfrom BaseHTTPServer import BaseHTTPRequest... | python | chosen |
[
{
"from": "system",
"value": "Create 'Untitled 2' session name."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.test import TestCase\n\nfrom .models import Session\nfrom .models import Spec\n\n# if self.name == '':\n# names = Session.objects.filter(name__startswith=self... | python | chosen |
[
{
"from": "system",
"value": "Add test for restricted HF theory\n"
},
{
"from": "human",
"value": "\"\"\"Tests for the general model with explicit one-half spin.\"\"\"\n\nimport pytest\n\nfrom drudge import UP, DOWN, SpinOneHalfGenDrudge\n\n\n@pytest.fixture(scope='module')\ndef dr(spark_ctx):\n... | python | chosen |
[
{
"from": "system",
"value": "Fix test for async Block\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport pytest\nimport logging\n\nfrom bitshares.aio.block import Block\n\nlog = logging.getLogger(\"grapheneapi\")\nlog.setLevel(logging.DEBUG)\n\n\n@pytest.mark.asyncio\nasync def ... | python | chosen |
[
{
"from": "system",
"value": "Add exemplar generators for HashDigest, FakerGenerator\n"
},
{
"from": "human",
"value": "from .context import tohu\nfrom tohu.v5.primitive_generators import *\n\n\nEXEMPLAR_PRIMITIVE_GENERATORS = [\n Constant(\"quux\"),\n Integer(100, 200),\n]\n\nEXEMPLAR_DER... | python | chosen |
[
{
"from": "system",
"value": "Allow to supply a different logo version for email\n\n - use symlink if the same logo should be used\n"
},
{
"from": "human",
"value": "from email.mime.image import MIMEImage\n\nfrom django.contrib.staticfiles import finders\n\n\nclass PlatformEmailMixin():\n \"\... | python | chosen |
[
{
"from": "system",
"value": "Add a test for writing to StringIO which is now different and does not work\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: iso-8859-1 -*-\n# vi:ts=4:et\n\nimport pycurl\nimport unittest\n\nfrom . import appmanager\nfrom . import util\n\nset... | python | chosen |
[
{
"from": "system",
"value": "mpd: Test that output enabling/disabling unmutes/mutes audio\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom tests.frontends.mpd import protocol\n\n\nclass AudioOutputHandlerTest(protocol.BaseTestCase):\n def test_enableoutput(s... | python | chosen |
[
{
"from": "system",
"value": "Add cache clear to sync command\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.management import BaseCommand\n\nfrom synctool.functions import sync_data\n\n\nDEFAULT_SYNC_DOMAIN = 'basket.mozilla.org'\n\n\nclass Command(BaseCom... | python | chosen |
[
{
"from": "system",
"value": "Update meta_generator to match case insensitive\n"
},
{
"from": "human",
"value": "def meta_generator(name):\n return '//meta[@name=\"generator\" and contains(@content, \"{}\")]' \\\n '/@content'.format(name)\n"
},
{
"from": "gpt",
"value":... | python | chosen |
[
{
"from": "system",
"value": "Add a link to add a company in user profile\n\nWhen a user change its experience, s⋅he can add an organization (not an\noffice) if it does not exist yet.\n\nLink to autocomplete-light module's doc:\nhttp://django-autocomplete-light.readthedocs.io/en/2.3.1/addanother.html#autoco... | python | chosen |
[
{
"from": "system",
"value": "Fix for Quantities not working with numpy.linspace() in numpy 1.11\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nimport quantities as pq\n\n\n# At least up to quantities 0.10.1 the additional arguments to the min and max\n# function did ... | python | chosen |
[
{
"from": "system",
"value": "Remove unused import left over from an earlier version of this patch\n"
},
{
"from": "human",
"value": "from distutils.core import Extension\nfrom os.path import dirname, join, relpath, exists\n\nASTROPY_UTILS_ROOT = dirname(__file__)\n\ndef get_extensions():\n r... | python | chosen |
[
{
"from": "system",
"value": "Send timestamps as ISO8601 format\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n###############################################################################\n# Copyright Kitware Inc.\n#\n# Licensed under the Apache License... | python | chosen |
[
{
"from": "system",
"value": "Update home controller test to use correct directory structure\n"
},
{
"from": "human",
"value": "import unittest\nimport pyramid.testing\n\nfrom nflpool.tests.web_settings import settings\n\n\nclass HomeControllerTests(unittest.TestCase):\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix zero-length field error when building docs in Python 2.6\n"
},
{
"from": "human",
"value": "import os\n\nimport ramrod\n\nproject = u'stix-ramrod'\ncopyright = u'2015, The MITRE Corporation'\nversion = ramrod.__version__\nrelease = version\n\nextensions = [\n ... | python | chosen |
[
{
"from": "system",
"value": "Add the ability to show multiple debug data values.\n\nImplemented as a slider.\n"
},
{
"from": "human",
"value": "import io\nfrom typing import Any, ContextManager\n\nimport numpy as np\nfrom PIL import Image\nfrom ipywidgets import widgets\n\nfrom puzzle.puzzleped... | python | chosen |
[
{
"from": "system",
"value": "Fix documentation checks by adjusting intersphinx mapping"
},
{
"from": "human",
"value": "from crate.theme.rtd.conf.python import *\n\n\nif \"sphinx.ext.intersphinx\" not in extensions:\n extensions += [\"sphinx.ext.intersphinx\"]\n\n\nif \"intersphinx_mapping\"... | python | chosen |
[
{
"from": "system",
"value": "Fix bugs thanks to Aaron"
},
{
"from": "human",
"value": "import sys, urllib, webbrowser\n\ndef tracestack():\n try:\n last_error = sys.last_value\n except:\n raise Exception(\"No error message available.\")\n error_query = urllib.urlencode(\"... | python | chosen |
[
{
"from": "system",
"value": "Change 9gag collector longpost detector\n"
},
{
"from": "human",
"value": "import time\n\nimport feedparser\nfrom bs4 import BeautifulSoup\nimport boto3\nfrom PIL import Image\nimport requests\nimport logging\n\nNINEGAG_RSS_URL = 'http://www.15minutesoffame.be/9gag/... | python | chosen |
[
{
"from": "system",
"value": "Allow to set the port in adhocracy.domain to make adhocracy work stand alone again.\n"
},
{
"from": "human",
"value": "import logging\n\nfrom adhocracy import model\nfrom pylons import config\n\nlog = logging.getLogger(__name__)\n\n\nclass InstanceDiscriminatorMiddl... | python | chosen |
[
{
"from": "system",
"value": "Add import of abort function.\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask_caching import Cache\n\nimport main\n\n\napp = Flask(__name__)\ncache = Cache(app, config={'CACHE_TYPE': 'simple'})\n\n\n@app.route('/')\ndef display_available():\n ... | python | chosen |
[
{
"from": "system",
"value": "Print statement snuck in there\n"
},
{
"from": "human",
"value": "from django.views.generic import ListView\n\nfrom topics.models import Topic, TopIssue\n\n\nclass LandingView(ListView):\n model = Topic\n template_name = 'landing.html'\n\n def get_context_d... | python | chosen |
[
{
"from": "system",
"value": "Add options in the plot\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n\"\"\"Config file for the cleaning - plotting and notebook process\"\"\"\n\n\nclass CleaningConfig:\n\n # Unprocessed dataset\n raw_data = './dataset... | python | chosen |
[
{
"from": "system",
"value": "Use new temp file directory.\n\nWe created a new scratch directory that matches EC2 mounted temp space and\nsupplied this as a setting in commit 21916b. This switches temporary images to\nbe downloaded there rather than at /tmp.\n"
},
{
"from": "human",
"value": "# ... | python | chosen |
[
{
"from": "system",
"value": "Change port to fit with other script of tcp communication test\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport socket\n\n\nTCP_IP = '127.0.0.1'\nTCP_PORT = 54321\nBUFFER_SIZE = 20 # Normally 1024, but we want fast response\n\ns = socket.socket(so... | python | chosen |
[
{
"from": "system",
"value": "Speed up test by breaking out of a for loop if match found\n"
},
{
"from": "human",
"value": "import unittest2\nimport datetime\n\nfrom google.appengine.ext import testbed\n\nfrom datafeeds.datafeed_fms import DatafeedFms\n\n\nclass TestDatafeedFmsTeams(unittest2.Te... | python | chosen |
[
{
"from": "system",
"value": "Fix int float setting issue.\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.core.management import BaseCommand\nfrom django.conf import settings\n\n\ndef dump_attrs(obj_instance):\n for attr in dir(obj_instance):\n if attr != attr.upper():\n ... | python | chosen |
[
{
"from": "system",
"value": "Copy cert auth from master\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os.path\nimport subprocess\nimport argparse\nimport shutil\n\n\ncl_parser = argparse.ArgumentParser()\nargs = cl_parser.parse_args()\n\nos.chdir(os.path.abspath(os.path.dirna... | python | chosen |
[
{
"from": "system",
"value": "Update last_attended when checking member\n"
},
{
"from": "human",
"value": "\"\"\"Manage society membership by checking member IDs and adding new members\"\"\"\n\nimport sqlite3\n\nclass MemberDatabase:\n def __init__(self, dbFile = 'members.db', safe = True):\n... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Revert \"changes in locator_50 file (current and old versions)\"\"\n\nThis reverts commit 7537387aa80109877d6659cc54ec0ee7aa6496bd.\n"
},
{
"from": "human",
"value": "from locators_51 import *\nimport copy\n\nnpsp_lex_locators = copy.deepcopy(npsp_lex_locat... | python | chosen |
[
{
"from": "system",
"value": "Disable template caching for now.\n"
},
{
"from": "human",
"value": "import os\nimport tornado.web\nfrom tornado.options import define\n\nfrom .handlers import LandingHandler, RequestHandler\n\n\nclass InteractApp(tornado.web.Application):\n \"\"\"\n Entry poi... | python | chosen |
[
{
"from": "system",
"value": "Add docstring to the methods structure in the abstract class\n"
},
{
"from": "human",
"value": "from urllib import request\n\nfrom bs4 import BeautifulSoup\n\n\nclass AbstractScraper():\n\n def __init__(self, url, test=False):\n if test:\n # whe... | python | chosen |
[
{
"from": "system",
"value": "Fix test that caused a pytest hang\n"
},
{
"from": "human",
"value": "import sys\nfrom sequana.gui import messages\nfrom PyQt5 import QtWidgets as QW\n\napp = QW.QApplication(sys.argv)\n\ndef test_warning():\n w = messages.WarningMessage(\"test\")\n\n\ndef test_c... | python | chosen |
[
{
"from": "system",
"value": "Update denon device mock to reflect mixer changes\n"
},
{
"from": "human",
"value": "import unittest\nimport os\n\nfrom mopidy.mixers.denon import DenonMixer\n\nclass DenonMixerDeviceMock(object):\n def __init__(self):\n self._open = True\n self.ret... | python | chosen |
[
{
"from": "system",
"value": "Fix load_plugin loop loading only one plugin\n"
},
{
"from": "human",
"value": "import imp #For plugins\nimport sys\nimport traceback\nimport logging\n\nimport os #For plugins\n\n\nlog = logging.getLogger(__name__)\n\npluginsList = []\n\ndef includeme(config):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix indentation to pass tests"
},
{
"from": "human",
"value": "from notebook.utils import url_path_join\n\nfrom jupyterlab_gitsync.handlers import *\nfrom jupyterlab_gitsync.version import VERSION\n\n__version__ = VERSION\n\n\ndef _jupyter_server_extension_paths():\... | python | chosen |
[
{
"from": "system",
"value": "Add tests for EUI-48 and EUI-64 in ReprHighlighter\n"
},
{
"from": "human",
"value": "import pytest\nfrom rich.highlighter import NullHighlighter\n\n\ndef test_wrong_type():\n highlighter = NullHighlighter()\n with pytest.raises(TypeError):\n highlighte... | python | chosen |
[
{
"from": "system",
"value": "Test reading from bf.ImageReader directly\n"
},
{
"from": "human",
"value": "from cellom2tif import cellom2tif\nimport pytest\n\n\ncfile = 'test-data/d1/MFGTMP_120628160001_C18f00d0.C01'\n\n\ndef test_read_image():\n im = cellom2tif.read_image(cfile)\n assert ... | python | chosen |
[
{
"from": "system",
"value": "Add patch decorator to test_green() function\n"
},
{
"from": "human",
"value": "from greengraph.map import Map\nimport numpy as np\nfrom nose.tools import assert_equal\nimport yaml\n\ndef test_green():\n size = (10,10)\n zoom = 10\n lat = 50\n lon = 50\n... | python | chosen |
[
{
"from": "system",
"value": "Fix arrangement of argument list.\n"
},
{
"from": "human",
"value": "''' test_deltaprel - Test functions for deltaprel module\n\nAuthor: Ian Huston\nFor license and copyright information see LICENSE.txt which was distributed with this file.\n'''\nimport numpy as np\... | python | chosen |
[
{
"from": "system",
"value": "Update description and fix Ruby -> Python syntax"
},
{
"from": "human",
"value": "# --------\n# |@ s >|\n# --------\n\nlevel.description(\"It is too dark to see anything, but you smell sludge nearby.\")\nlevel.tip(\"Use warrior.feel().is_empty to see if there i... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.