conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add search index for faq categories\n"
},
{
"from": "human",
"value": "from aldryn_search.base import AldrynIndexBase\nfrom aldryn_search.utils import strip_tags\nfrom django.template import RequestContext\nfrom haystack import indexes\n\nfrom .models import Questio... | python | chosen |
[
{
"from": "system",
"value": "Allow to overwrite the pipeline processor return value\n"
},
{
"from": "human",
"value": "import functools\n\n\ndef coroutine(fn):\n def wrapper(*args, **kwargs):\n generator = fn(*args, **kwargs)\n next(generator)\n return generator\n\n r... | python | chosen |
[
{
"from": "system",
"value": "Test add site_scons as SCons module\n"
},
{
"from": "human",
"value": "import platform\nfrom SCons.Script import AddOption, GetOption\n\nSYSTEMS = dict(Linux = \"linux\",\n\t Darwin = \"osx\",\n\t Windows = \"windows\")\n\n\nsystem = str(platf... | python | chosen |
[
{
"from": "system",
"value": "Check for empty strings in required validator\n"
},
{
"from": "human",
"value": "import json\nimport jsonschema\n\nfrom django.core.exceptions import ValidationError\n\n\n# Add path to required validator so we can get property name\ndef _required(validator, required... | python | chosen |
[
{
"from": "system",
"value": "Improve help messages from release_test\n"
},
{
"from": "human",
"value": "import argparse, common, sys, tests\nfrom features import check_features, get_features\n\n\ndef arguments(argv=sys.argv[1:]):\n parser = argparse.ArgumentParser()\n\n parser.add_argumen... | python | chosen |
[
{
"from": "system",
"value": "Add test for applying a distance to a coordinate via a quantity\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom __future__ import print_function\n\nfrom numpy import testing as npt\n\n... | python | chosen |
[
{
"from": "system",
"value": "Use imported views instead of lazy import\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\ntry:\n from account.decorators import login_required\nexcept ImportError:\n from django.contrib.auth.decorators import login_required\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add stderr redirect to git_suffix to get more clean messages\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright (c) 2014, GEM Foundation.\n#\n# OpenQuake is free software: you can redistribute it an... | python | chosen |
[
{
"from": "system",
"value": "Print messages for prepare upload.\n"
},
{
"from": "human",
"value": "import sys\nimport olrcdb\nimport os\n\n# Globals\nCOUNT = 0\n\n\nclass FileParser(object):\n '''Object used to parse through a directory for all it's files. Collects\n the paths of all the ... | python | chosen |
[
{
"from": "system",
"value": "Remove orientation tag parsing, not needed.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom datetime import datetime\n\nTAG_WIDTH = 'EXIF ExifImageWidth'\nTAG_HEIGHT = 'EXIF ExifImageLength'\nTAG_DATETIME = 'Image DateTime'\nTAG_ORIENTATION = 'Ima... | python | chosen |
[
{
"from": "system",
"value": "Use from_date to construct from year, month, day.\n"
},
{
"from": "human",
"value": "from datetime import date, timedelta\n\nclass DateWithCalendar(object):\n def __init__(self, calendar_class, date):\n self.calendar = calendar_class\n self.date = d... | python | chosen |
[
{
"from": "system",
"value": "Remove '.wav' addition to all files uploaded\n"
},
{
"from": "human",
"value": "from flask import Flask, request, jsonify, send_from_directory\nimport os\nimport uuid\napp = Flask(__name__)\nUPLOAD_FOLDER = \"uploads/\"\n\n@app.route(\"/\")\ndef index():\n return... | python | chosen |
[
{
"from": "system",
"value": "Use `<input type=\"tel\">` for phone number field\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.blueprints.user.current.forms\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix magnitudes test for Python 2.7 in CI\n"
},
{
"from": "human",
"value": "from skyfield.api import load\nfrom skyfield.magnitudelib import planetary_magnitude\n\ndef test_magnitudes():\n ts = load.timescale()\n #t = ts.utc(1995, 5, 22) # Rings edge-on from ... | python | chosen |
[
{
"from": "system",
"value": "Add really hacky way to reformat restic repos\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport ipaddress\n\n\ndef site_code(ipv4):\n # Verify IP address\n _ = ipaddress.ip_address(ipv4)\n\n segments = ipv4.split(\".\")\n\n return int(segmen... | python | chosen |
[
{
"from": "system",
"value": "Make it compile with recent version of twilio\n"
},
{
"from": "human",
"value": "from urllib.parse import urlparse, urlunparse\nfrom functools import wraps\nfrom flask import abort, current_app, request\nfrom twilio.twiml import Response\nfrom twilio.util import Req... | python | chosen |
[
{
"from": "system",
"value": "Add missing config options, allow to define via env vars\n"
},
{
"from": "human",
"value": "import uuid\n\nDEBUG = False\nTESTING = False\nSECRET_KEY = str(uuid.uuid4())\nUSERNAME = str(uuid.uuid4())\nPASSWORD = str(uuid.uuid4())\n\nNAME = 'datapusher'\n\n# database... | python | chosen |
[
{
"from": "system",
"value": "Use more explicit name for error\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom rest_framework.status import HTTP_400_BAD_REQUEST\n\nfrom ..exceptions import InvalidExpiredToken\n\n\nclass InvalidExpiredTokenTest(TestCase):\n \"\"\"Asse... | python | chosen |
[
{
"from": "system",
"value": "Add piste test to catch dev issue\n"
},
{
"from": "human",
"value": "# http://www.openstreetmap.org/way/313466665\nassert_has_feature(\n 15, 5467, 12531, 'roads',\n { 'kind': 'piste',\n 'piste_type': 'downhill',\n 'piste_difficulty': 'easy',\n '... | python | chosen |
[
{
"from": "system",
"value": "Use assertGreater(len(x), y) instead of assertTrue(len(x) > y)\n\nassertGreater provides a nicer error message if it fails.\n\nChange-Id: Ibfe6a85760a766d310d75bc484e933e96cb0c02f\n"
},
{
"from": "human",
"value": "# Copyright 2016 - Nokia\n#\n# Licensed under the A... | python | chosen |
[
{
"from": "system",
"value": "Move return to inside try\n\nIt is easy to understand if 'return' statement is moved\ninside try clause and there is no need to initialize a value.\n\nFollow-up minor fixes for review 276086\n\nChange-Id: I3968e1702c0129ae02517e817da189ca137e7ab4\n"
},
{
"from": "human"... | python | chosen |
[
{
"from": "system",
"value": "Support for Lastuser push notifications.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import Response, redirect, flash\nfrom flask.ext.lastuser.sqlalchemy import UserManager\nfrom coaster.views import get_next_url\n\nfrom hasjob import ap... | python | chosen |
[
{
"from": "system",
"value": "Use list comprehension as pylint suggests\n"
},
{
"from": "human",
"value": "\"\"\"\nThis linter reports missing primary / unique index\n\"\"\"\nfrom collections import OrderedDict\n\nfrom indexdigest.utils import LinterEntry\n\n\ndef check_missing_primary_index(dat... | python | chosen |
[
{
"from": "system",
"value": "Fix EXIT command to have execute method for abstract class\n"
},
{
"from": "human",
"value": "from graphene.commands.command import Command\n\nclass ExitCommand(Command):\n def __init__(self):\n pass\n"
},
{
"from": "gpt",
"value": "from graphe... | python | chosen |
[
{
"from": "system",
"value": "Fix deoplete variable naming and conditional logic\n\n* Module-level variables should be CAPITALIZED.\n* if len(my_list) != 0 can be more-safely changed to \"if my_list\"\n * An empty list if falsey, a non-empty list is truthy. We're also safe\n from unexpected \"None\" value... | python | chosen |
[
{
"from": "system",
"value": "Remove this haystack setting as well.\n"
},
{
"from": "human",
"value": "from .base import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'docs',\n 'USER': 'postgres', # ... | python | chosen |
[
{
"from": "system",
"value": "Upgrade 1117 - add run_dependencies=False\n\nSomehow re-importing the 'portlets' step, causes\na beforeDelete handler to fail a HoldingReference\ncheck.\n"
},
{
"from": "human",
"value": "from Acquisition import aq_inner\nfrom Acquisition import aq_parent\nfrom Prod... | python | chosen |
[
{
"from": "system",
"value": "Change run script to use worker pool\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Automatically generate phylogenies from a settings file\n# specifying input fasta and genomes\nimport sys\nimport dendrogenous as dg\nimport dendrogenous.settings\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Fix fuzzer to include instrumentation"
},
{
"from": "human",
"value": "\"\"\"\nFuzzing setup for OSS-Fuzz.\n\nSee https://github.com/google/oss-fuzz/tree/master/projects/jsonschema for the\nother half of the setup here.\n\"\"\"\nimport sys\n\nfrom hypothesis import ... | python | chosen |
[
{
"from": "system",
"value": "[testsuite] Remove trailing characters from command output.\n\nWhen running the test suite on macOS with Python 3 we noticed a\ndifference in behavior between Python 2 and Python 3 for\nseven.get_command_output. The output contained a newline with Python 3,\nbut not for Python ... | python | chosen |
[
{
"from": "system",
"value": "Fix formatting of docstring example\n\nIt runs together in the built HTML.\n"
},
{
"from": "human",
"value": "\"\"\"\nHTML parsing library based on the WHATWG \"HTML5\"\nspecification. The parser is designed to be compatible with existing\nHTML found in the wild and... | python | chosen |
[
{
"from": "system",
"value": "Add test for index route\n"
},
{
"from": "human",
"value": "import unittest\nfrom flask import json\nfrom api import create_app, db\n\n\nclass AuthenticationTestCase(unittest.TestCase):\n def setUp(self):\n self.app = create_app(config_name='TestingEnv')\n... | python | chosen |
[
{
"from": "system",
"value": "Fix the datalogger example script to use roll mode and a high decimation\n"
},
{
"from": "human",
"value": "from pymoku import Moku\nfrom pymoku.instruments import *\nimport time, logging\n\nlogging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s... | python | chosen |
[
{
"from": "system",
"value": "Update the camb3lyp example to libxc 5 series\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Author: Qiming Sun <osirpt.sun@gmail.com>\n#\n\n'''\nThe default XC functional library (libxc) supports the energy and nuclear\ngradients for range separated... | python | chosen |
[
{
"from": "system",
"value": "Remove the unused convert_png_to_jpg method.\n"
},
{
"from": "human",
"value": "from django.core.files.storage import get_storage_class\nfrom storages.backends.s3boto import S3BotoStorage\nfrom PIL import Image\n\n\ndef convert_png_to_jpg(img):\n \"\"\"\n Conv... | python | chosen |
[
{
"from": "system",
"value": "Exit the loop early when experimenting."
},
{
"from": "human",
"value": "#!/usr/bin/python3\nimport sys\n\nimport git\n\nr = git.Repo( sys.argv[1] )\n\ndef printTree( tree, indent=0 ):\n prefix = ' '*indent\n print( prefix, '-' * 16 )\n print( prefix, 'Tree... | python | chosen |
[
{
"from": "system",
"value": "Add binary_url member to Job.\n"
},
{
"from": "human",
"value": "# scheduler.core: Data structures for managing K3 jobs.\n\nclass Job:\n def __init__(self, roles):\n self.roles = roles\n self.tasks = None\n self.status = None\n\nclass Role:\n def __init__... | python | chosen |
[
{
"from": "system",
"value": "Fix other failure - assuming that the change in sort key value for winter sports was intentional.\n"
},
{
"from": "human",
"value": "assert_has_feature(\n 15, 5467, 12531, 'landuse',\n { 'kind': 'winter_sports',\n 'sort_key': 33 })\n"
},
{
"from":... | python | chosen |
[
{
"from": "system",
"value": "Fix \"string argument without an encoding\" python3 error in bcrypt script\n\ngenerate-bcrypt-hashed-password raises an error on python3 since\n`bytes` is called without an encoding argument. Replacing it with\n`.encode` should fix the problem.\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Activity was imported twice\"\n\nThis reverts commit a0600929774c1e90c7dc43043ff87b5ea84213b4.\n"
},
{
"from": "human",
"value": "from os import unlink\nfrom jnius import autoclass, cast\nfrom plyer.facades import Camera\nfrom plyer.platforms.android import... | python | chosen |
[
{
"from": "system",
"value": "Use pdbkdf_sha256 hasher for testing too.\n"
},
{
"from": "human",
"value": "import factory\nfrom django.contrib.auth.hashers import make_password\n\nfrom keybar.models.user import User\n\n\nclass UserFactory(factory.DjangoModelFactory):\n email = factory.Sequenc... | python | chosen |
[
{
"from": "system",
"value": "Fix for os.path.join with model_id, was breaking on non-string model_id values.\n"
},
{
"from": "human",
"value": "import os\n\nimport requests\n\n\nclass LumidatumClient(object):\n\n def __init__(self, authentication_token, model_id=None, host_address='https://w... | python | chosen |
[
{
"from": "system",
"value": "Fix std::optional access in SplitPairedReader pythonization\n"
},
{
"from": "human",
"value": "from goetia.pythonizors.utils import is_template_inst\n\ndef pythonize_goetia_parsing(klass, name):\n is_fastx, _ = is_template_inst(name, 'FastxParser')\n if is_fas... | python | chosen |
[
{
"from": "system",
"value": "Remove any existing localhost sites and use the page id rather than the object to set the default homepage.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef create_homepa... | python | chosen |
[
{
"from": "system",
"value": "admin_auth: Use passwordinput in password field.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django import forms\nfrom uni_form.helper import FormHelper\nfrom uni_form.layout import Submit, Layout, Fieldset, ButtonHolder\n\nclass LoginForm(for... | python | chosen |
[
{
"from": "system",
"value": "Order feedback items by their timestamp.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.db import models\n\n\nclass FeedbackItem(models.Model):\n timestamp = models.DateTimeField(auto_now_add=True)\n user = models.ForeignKey(s... | python | chosen |
[
{
"from": "system",
"value": "Update test to reflect new method name.\n"
},
{
"from": "human",
"value": "from context import slot_users_controller as uc\n\n\nclass TestUsers:\n\n def test_validate_credentials_returns_true_for_valid_credentials(self):\n result = uc.return_user_if_valid_... | python | chosen |
[
{
"from": "system",
"value": "Fix mock path to fix broken test.\n"
},
{
"from": "human",
"value": "\n\nimport mock\nimport unittest2\n\nfrom thanatos import utils\n\n\nclass UtilsTestCase(unittest2.TestCase):\n\n def setUp(self):\n pass\n\n @mock.patch('thanatos.questions.Question._... | python | chosen |
[
{
"from": "system",
"value": "Make it possible to specify which app to represent in sentry"
},
{
"from": "human",
"value": "import os\nimport raven\n\nfrom decouple import config\n\nRAVEN_CONFIG = {\n 'dsn': config('OW4_RAVEN_DSN', default='https://user:pass@sentry.io/project'),\n 'environ... | python | chosen |
[
{
"from": "system",
"value": "Move 'me' check outside of author lookup\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, unicode_literals\n\nfrom sqlalchemy.orm import joinedload\n\nfrom changes.api.base import APIView\nfrom changes.api.auth import get_current_... | python | chosen |
[
{
"from": "system",
"value": "Use actual constant name (molar_gas_constant)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import (absolute_import, division, print_function)\nimport math\n\n\ndef nernst_potential(ion_conc_out, ion_conc_in, charge, T,\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix dumb out of bounds error.\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom blaze.blir import compile, execute\n\nsource = \"\"\"\ndef main(x: array[int], n : int) -> void {\n var int i;\n var int j;\n for i in range(n) {\n for j in ran... | python | chosen |
[
{
"from": "system",
"value": "Fix Pipeline Args Bug on dict length\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport random\nfrom EmeraldAI.Entities.BaseObject import BaseObject\n\n\nclass PipelineArgs(BaseObject):\n\n def __init__(self, input):\n # ... | python | chosen |
[
{
"from": "system",
"value": "Use request.user_set in context preprocessor\n"
},
{
"from": "human",
"value": "from comics.sets.models import UserSet\n\ndef user_set(request):\n try:\n user_set = UserSet.objects.get(user=request.user)\n return {\n 'user_set': user_set,... | python | chosen |
[
{
"from": "system",
"value": "Revert \"unique for date validator\"\n\nThis reverts commit 7d2eee38eebf62787b77cdd41e7677cfdad6d47b.\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\nfrom rest_framework.validators import UniqueTogetherValidator, UniqueForDateValidator\n\n... | python | chosen |
[
{
"from": "system",
"value": "Test dependencies: On Python 2.5, require Jinja 2.6\n"
},
{
"from": "human",
"value": "#! /usr/bin/python\nimport platform\nimport subprocess\nimport sys\n\ndef _execute(*args, **kwargs):\n result = subprocess.call(*args, **kwargs)\n if result != 0:\n s... | python | chosen |
[
{
"from": "system",
"value": "Prepare for next development version\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\n__title__ = 'python-gssapi'\n__author__ = 'Hugh Cole-Baker and contributors'\n__version__ = '0.6.2'\n\n__license__ = 'The MIT License (MIT)'\n__copyrig... | python | chosen |
[
{
"from": "system",
"value": "Make GO term export part of FTP export\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file ex... | python | chosen |
[
{
"from": "system",
"value": "Allow gridlines on both major and minor axes.\n"
},
{
"from": "human",
"value": "from boomslang.LineStyle import LineStyle\n\nclass Grid(object):\n def __init__(self, color=\"#dddddd\", style=\"-\", visible=True):\n self.color = color\n self._lineSt... | python | chosen |
[
{
"from": "system",
"value": "Customize scripts to work with menu\n"
},
{
"from": "human",
"value": "#import ibmcnx.test.loadFunction\nimport sys\nfrom java.lang import String\nfrom java.util import HashSet\nfrom java.util import HashMap\nimport java\nimport lotusConnectionsCommonAdmin\n\nglobdi... | python | chosen |
[
{
"from": "system",
"value": "Use insert_text instead of changed\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport gtk\n\nfrom kiwi.controllers import BaseController\nfrom kiwi.ui.views import BaseView\nfrom kiwi.ui.gadgets import quit_if_last\n\nclass FarenControl(BaseController)... | python | chosen |
[
{
"from": "system",
"value": "Add script to fetch data from AWS\n"
},
{
"from": "human",
"value": "\"\"\"\nAutomated processing of associated exposures\n\"\"\"\n\n\n"
},
{
"from": "gpt",
"value": "\"\"\"\nAutomated processing of associated exposures\n\"\"\"\n\ndef fetch_from_AWS_buck... | python | chosen |
[
{
"from": "system",
"value": "Make use of new collection config vector\n"
},
{
"from": "human",
"value": "import os\n\nfrom invoke import ctask as task, Collection\n\n\ndocs_dir = 'docs'\nbuild_dir = os.path.join(docs_dir, '_build')\n\n\n@task(aliases=['c'])\ndef _clean(ctx):\n ctx.run(\"rm -... | python | chosen |
[
{
"from": "system",
"value": "Remove my personal domain from the public jirafs git config.\n"
},
{
"from": "human",
"value": "from jirafs import __version__ as version\n\n# Metadata filenames\nTICKET_DETAILS = 'fields.jira'\nTICKET_COMMENTS = 'comments.read_only.jira'\nTICKET_NEW_COMMENT = 'new_... | python | chosen |
[
{
"from": "system",
"value": "Modify board_slug in url regex to pass numeric letter\n"
},
{
"from": "human",
"value": "# Created by JHJ on 2016. 10. 5.\n\nfrom django.conf.urls import url\n\nfrom . import views\n\napp_name = 'board'\nurlpatterns = [\n url(r'^$', views.board_list, name='board_... | python | chosen |
[
{
"from": "system",
"value": "Make the bot to save memory by sending events as soon as it reads through the corresponding lines of the input file.\n"
},
{
"from": "human",
"value": "\"\"\"\nSpamhaus XBL list handler.\n\nMaintainer: Sauli Pahlman <sauli@codenomicon.com>\n\"\"\"\n\nimport idiokit\... | python | chosen |
[
{
"from": "system",
"value": "Revert early removal of certificate field\n"
},
{
"from": "human",
"value": "\"\"\"\nModels for the records app.\n\"\"\"\nimport uuid\n\nfrom django.db import models\nfrom django_extensions.db.models import TimeStampedModel\n\nfrom credentials.apps.catalog.models im... | python | chosen |
[
{
"from": "system",
"value": "Fix Symbol equality to be reference equal\n\nSigned-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>\n"
},
{
"from": "human",
"value": "from som.primitives.primitives import Primitives\nfrom som.vmobjects.primitive import Primitive\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add ticket and branch arguments\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom .command import Command\nfrom matador import utils\nimport subprocess\nimport os\n\n\nclass DeployTicket(Command):\n\n def _add_arguments(self, parser):\n parser... | python | chosen |
[
{
"from": "system",
"value": "Use any_endpoint on invalid id test\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for passing invalid endpoints which require a target ID to be given.\n\"\"\"\n\nimport pytest\nimport requests\nfrom requests import codes\n\nfrom mock_vws._constants import ResultC... | python | chosen |
[
{
"from": "system",
"value": "Add missing vat alias for New Zealand\n\nCloses https://github.com/arthurdejong/python-stdnum/pull/202\n"
},
{
"from": "human",
"value": "# __init__.py - collection of New Zealand numbers\n# coding: utf-8\n#\n# Copyright (C) 2019 Arthur de Jong\n#\n# This library is... | python | chosen |
[
{
"from": "system",
"value": "Use final Memory limit env variable name\n"
},
{
"from": "human",
"value": "import os\nimport json\nimport psutil\nfrom notebook.utils import url_path_join\nfrom notebook.base.handlers import IPythonHandler\n\ndef get_metrics():\n cur_process = psutil.Process()\n... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Added a prod option to the rquirements checker\"\n\nThis reverts commit 5b9ae76d157d068ef456d5caa5c4352a139f528b.\n"
},
{
"from": "human",
"value": "import subprocess\n\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCommand):\n ... | python | chosen |
[
{
"from": "system",
"value": "Implement Adrenaline Rush why not\n"
},
{
"from": "human",
"value": "from ..card import *\n\n\n# The Coin\nclass GAME_005(Card):\n\tdef action(self):\n\t\tself.controller.tempMana += 1\n"
},
{
"from": "gpt",
"value": "from ..card import *\n\n\n# The Coin... | python | chosen |
[
{
"from": "system",
"value": "Add documentation for Source class\n"
},
{
"from": "human",
"value": "from mythril.solidity.soliditycontract import SolidityContract\nfrom mythril.ethereum.evmcontract import EVMContract\n\n\nclass Source:\n def __init__(\n self, source_type=None, source_f... | python | chosen |
[
{
"from": "system",
"value": "Add common ignore list per README\n"
},
{
"from": "human",
"value": "# pylint: disable=R0904,W0212\n\n# Copyright (c) 2011-2013 Rackspace Hosting\n# All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use th... | python | chosen |
[
{
"from": "system",
"value": "Fix Python3s lack of .next().\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom .. import KeyValueStore\nfrom .._compat import BytesIO\n\nfrom .._compat import pickle\nfrom bson.binary import Binary\n\n\nclass MongoStore(KeyVa... | python | chosen |
[
{
"from": "system",
"value": "Update to new mayor version"
},
{
"from": "human",
"value": "\"\"\"\npdftools Package.\n\n:author: Stefan Lehmann <stlm@posteo.de>\n:license: MIT, see license file or https://opensource.org/licenses/MIT\n\n:created on 2018-04-14 20:35:21\n:last modified by: Stefan... | python | chosen |
[
{
"from": "system",
"value": "Use separate API key for feedback about app.\n"
},
{
"from": "human",
"value": "import json\nimport requests\nfrom django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotAllowed, HttpResponseNotFound\nfrom django.conf import settings\nfrom django.vi... | python | chosen |
[
{
"from": "system",
"value": "Select third renderer if 'text/html' in accept\n"
},
{
"from": "human",
"value": "from rest_framework.negotiation import BaseContentNegotiation\n\n\nclass CustomClientContentNegotiation(BaseContentNegotiation):\n def select_parser(self, request, parsers):\n ... | python | chosen |
[
{
"from": "system",
"value": "Throw 404 if category/topic with given id is not found.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.blueprints.board.views\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2014 Jochen Kupperschmidt\n\"\"\"\n\nfrom ...util.framework... | python | chosen |
[
{
"from": "system",
"value": "Add SITE_ID to test settings setup for Django 1.3.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nfrom django.conf import settings\n\n\nif not settings.configured:\n settings.configure(\n DATABASES={\n 'defaul... | python | chosen |
[
{
"from": "system",
"value": "Fix PyCharm warnings like this: \"Cannot find reference `request` in `PhantomJS | WebDriver`\"\n"
},
{
"from": "human",
"value": "from selenium.webdriver import Firefox, Chrome, Ie, Edge, Opera, Safari, BlackBerry, PhantomJS, Android, Remote\n\nfrom seleniumrequests... | python | chosen |
[
{
"from": "system",
"value": "Update stacked bar example to use the hover kwarg.\n"
},
{
"from": "human",
"value": "from bokeh.charts import Bar, output_file, show\nfrom bokeh.charts.operations import blend\nfrom bokeh.charts.attributes import cat, color\nfrom bokeh.charts.utils import df_from_j... | python | chosen |
[
{
"from": "system",
"value": "Make unwrap visible in the exposure package.\n"
},
{
"from": "human",
"value": "from .exposure import histogram, equalize, equalize_hist, \\\n rescale_intensity, cumulative_distribution, \\\n adjust_gamma, adjust_sigmoid, ad... | python | chosen |
[
{
"from": "system",
"value": "Revert \"turn proxy back on\"\n\nThis reverts commit c5b3a15a2815ff362104afaa6a996fab6f35ae1a.\n"
},
{
"from": "human",
"value": "\"\"\"private_base will be populated from puppet and placed in this directory\"\"\"\n\nimport logging\n\nimport dj_database_url\n\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Update tests for cython parameters\n"
},
{
"from": "human",
"value": "\"\"\"Tests for functions that calculate plasma parameters using cython.\"\"\"\n\nimport numpy as np\nimport pytest\nfrom astropy import units as u\nfrom warnings import simplefilter\n\nfrom ...ut... | python | chosen |
[
{
"from": "system",
"value": "Support for variable number of layers"
},
{
"from": "human",
"value": "import numpy as np\n# import pandas as pd\n# import sys\nfrom scipy.special import expit\nfrom sklearn import ensemble\n\ndef get_activations(exp_data, w, b):\n exp_data = np.transpose(exp_dat... | python | chosen |
[
{
"from": "system",
"value": "Use repository hierarchy instead of absolute path for sfile\n\nThe test chapel.sfile-inline.py was depending on an absolute path to find the\nlocation of a chapel file that was outside the normal sfile storage location.\nThe absolute location was both machine and user-specific.... | python | chosen |
[
{
"from": "system",
"value": "Add a test for get_config()\n"
},
{
"from": "human",
"value": "import plotly.plotly.plotly as py\nimport plotly.tools as tls\n\n\ndef test_get_credentials():\n if 'username' in py._credentials:\n del py._credentials['username']\n if 'api_key' in py._cre... | python | chosen |
[
{
"from": "system",
"value": "Check a leap year date from before the start of the calendar.\n\nThis is not really a strong test of the proleptic calendar. All days back to year 1 which are valid in the Julian calendar are valid in the Gregorian calendar.\n"
},
{
"from": "human",
"value": "import... | python | chosen |
[
{
"from": "system",
"value": "[FIX] event: Set default value for event_count\n\nFixes https://github.com/odoo/odoo/pull/39583\nThis commit adds a default value for event_count\nAssigning default value for non-stored compute fields is required in 13.0\n\ncloses odoo/odoo#39974\n\nX-original-commit: 9ca72b98... | python | chosen |
[
{
"from": "system",
"value": "Make tests run from correct directory.\n"
},
{
"from": "human",
"value": "import GenotypeNetwork as gn\nimport os\nimport networkx as nx\n\nGN = gn.GenotypeNetwork()\nGN.read_sequences('test/Demo_052715.fasta')\nGN.generate_genotype_network()\nGN.write_genotype_netw... | python | chosen |
[
{
"from": "system",
"value": "Order only by house/initial number then address string\n"
},
{
"from": "human",
"value": "from elasticsearch import Elasticsearch\nfrom elasticsearch_dsl import Search\nfrom service import app\n\nELASTICSEARCH_ENDPOINT = app.config['ELASTIC_SEARCH_ENDPOINT']\nMAX_NU... | python | chosen |
[
{
"from": "system",
"value": "Test for deterministic results when testing BERT model\n"
},
{
"from": "human",
"value": "import unittest\nimport time\nimport pandas as pd\nfrom bert_trainer import BERTTrainer\nfrom utils import *\n\nclass TestBERT(unittest.TestCase):\n\n def test_init(self):\n... | python | chosen |
[
{
"from": "system",
"value": "tests/length: Test the axioms of normed vector spaces\n"
},
{
"from": "human",
"value": "from math import sqrt\n\nimport pytest # type: ignore\nfrom hypothesis import given\n\nfrom ppb_vector import Vector\nfrom utils import isclose, vectors\n\n\n@pytest.mark.param... | python | chosen |
[
{
"from": "system",
"value": "Fix race condition during `mimetypes` initialization.\n\nInitial patch from Steven R. Loomis.\nCloses #8629.\n\n\ngit-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@9740 af82e41b-90c4-0310-8c96-b1721e28e2e2\n"
},
{
"from": "human",
"value": "# With mod_python we'l... | python | chosen |
[
{
"from": "system",
"value": "Use larger values for stable test.\n"
},
{
"from": "human",
"value": "import unittest\n\nimport numpy\n\nimport chainer.functions as F\nfrom chainer import testing\n\n\ndef make_data(dtype, shape):\n x = numpy.random.uniform(0.1, 1, shape).astype(dtype)\n gy =... | python | chosen |
[
{
"from": "system",
"value": "Fix TRACE test also in rel-yau\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\nimport sys\nimport os\nsys.path.insert(1, os.path.join(\"..\",\"..\",\"..\"))\nimport h2o\nfrom h2o.exceptions import H2OServerError\nfrom tests impor... | python | chosen |
[
{
"from": "system",
"value": "Modify the perfect simulator to calculate dedup percentages based on file sizes (1 - data_in / data_total)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport timer\nimport sys\nimport utils\n\n# A set of files already in the storage\nseen = set()\n\n#... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.