conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Kill possible recursion on csrf decorator\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django.middleware.csrf import REASON_NO_REFERER\n\nfrom sentry.web.frontend.base import BaseView\n\n\nclass CsrfFailureView(BaseView):\n au... | python | chosen |
[
{
"from": "system",
"value": "Add Plotting to default imports.\n\n\n\ngit-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@43 979d6bd5-6d4d-0410-bece-f567c23bd345\n"
},
{
"from": "human",
"value": "import numpy\n# This gives a nicer printout for masked arrays.\nnumpy.ma.default_real_fill_value =... | python | chosen |
[
{
"from": "system",
"value": "Add missing outputs to wordcount_mem topology\n"
},
{
"from": "human",
"value": "from collections import Counter\n\nfrom redis import StrictRedis\n\nfrom streamparse import Bolt\n\n\nclass WordCountBolt(Bolt):\n outputs = ['word', 'count']\n\n def initialize(s... | python | chosen |
[
{
"from": "system",
"value": "Add a url to github.\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport os\n\nversion = 0.1\n\nsetup(\n version=version,\n description=\"A script allowing to setup Amazon EC2 instances through configuration files.\",\n long_description=... | python | chosen |
[
{
"from": "system",
"value": "Remove <1.9 version limit on Django version\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:\n README = readme.read()\n\n# allow setup.py to be run from any p... | python | chosen |
[
{
"from": "system",
"value": "Refactor to ensure closing and also use list comprehension\n"
},
{
"from": "human",
"value": "\"\"\"Read and print an integer series.\"\"\"\n\nimport sys\n\n\ndef read_series(filename):\n f = open(filename, mode='rt', encoding='utf-8')\n series = []\n for l... | python | chosen |
[
{
"from": "system",
"value": "Fix flask version after vulnerability\n\nNo ambiguity left to ensure version is above vulnerable one\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='Flask-RESTful',\n version='0.2.5',\n ... | python | chosen |
[
{
"from": "system",
"value": "Sort events by start and iso format datetimes\n"
},
{
"from": "human",
"value": "import requests\nimport csv\nimport ics_parser\n\nURL_STUDY_ACTIVITIES = 'https://dk.timeedit.net/web/itu/db1/public/ri6Q7Z6QQw0Z5gQ9f50on7Xx5YY00ZQ1ZYQycZw.ics'\nURL_ACTIVITIES = 'http... | python | chosen |
[
{
"from": "system",
"value": "Fix the trove classifer for dev status\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nclassifiers = ['Development Status :: 5 - Stable',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: BSD License',\... | python | chosen |
[
{
"from": "system",
"value": "Add a quick little newline.\n"
},
{
"from": "human",
"value": "#!/bin/env python\n# -*- coding: utf8 -*-\nfrom setuptools import setup\n\nsetup(\n name='fedimg',\n version='0.0.1',\n description='Service to automatically upload built Fedora images \\\n ... | python | chosen |
[
{
"from": "system",
"value": "Add tests module to packaging list\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\nimport os\n\nfrom deflect import __version__ as version\n\n\ndef read_file(filename):\n \"\"\"\n Utility function to read a provide... | python | chosen |
[
{
"from": "system",
"value": "Use sphinx-apidoc to generate API docs from docstrings.\n"
},
{
"from": "human",
"value": "from invoke import task, run\n\n@task\ndef clean_docs():\n run(\"rm -rf docs/_build\")\n\n@task('clean_docs')\ndef docs():\n run(\"sphinx-build docs docs/_build\")\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the wrong input package of pbr of cloudkittyclient\n\nThe cloudkittyclient cannot work because wrong package name was\ninputed to pbr.version.VersionInfo() method.\n\nChange-Id: Iff65bf5b2efd50b0dd29070b89ac5a607d0ecfcb\nCloses-Bug: #1448406\n"
},
{
"from": "human",... | python | chosen |
[
{
"from": "system",
"value": "Handle SAML 1 in addition to SAML 2.\n"
},
{
"from": "human",
"value": "import base64\nimport xmltodict\nimport json\n\nimport colorama\nfrom . safe_print import safe_print\nfrom . exceptions import SAMLAssertionParseError\n\ndef parse_assertion(assertion: str) -> l... | python | chosen |
[
{
"from": "system",
"value": "Fix: Use the correct module path for the AmazonFPS app.\n"
},
{
"from": "human",
"value": "from billing.integration import Integration\nfrom django.conf import settings\nfrom boto.connection import FPSConnection\n\nFPS_PROD_API_ENDPOINT = \"fps.amazonaws.com\"\nFPS_... | python | chosen |
[
{
"from": "system",
"value": "Use tuple for version check\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\n\nimport django\nfrom django.conf import settings\nfrom django.template import loader\nfrom django.test import TestCase\n\ntry:\n from django.test import override_s... | python | chosen |
[
{
"from": "system",
"value": "Correct Valve behavior on Posix\n"
},
{
"from": "human",
"value": "\"\"\"\nVersions of the base functionality optimized for by-the-spec POSIX.\n\nLinux/Mac/BSD-specific code should live elsewhere.\n\"\"\"\nimport signal\nfrom . import base\n\n__all__ = ('Process',)\... | python | chosen |
[
{
"from": "system",
"value": "Add a converter which convert datetime to string\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\nimport re\n\n\ndef lower_bool_converter(bool_v... | python | chosen |
[
{
"from": "system",
"value": "Add ability to disable frame evaluation\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nIS_PY36_OR_OLDER = False\nif (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3:\n IS_PY36_OR_OLDER = True\n\nset_frame_eval = None... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Delete empty \" \" spaces in same string line\n"
},
{
"from": "human",
"value": "# Copyright 2018 Tecnativa - Vicent Cubells <vicent.cubells@tecnativa.com>\n# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3\n\n{\n \"name\": \"Purchase Order Line Dee... | python | chosen |
[
{
"from": "system",
"value": "[13.0][FIX] purchase_product_usage: Change only account if usage is defined in POL\n"
},
{
"from": "human",
"value": "# Copyright 2019 Aleph Objects, Inc.\n# Copyright 2019 ForgeFlow S.L.\n# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Update author info to \"The SoCo-Team\"\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n\"\"\" SoCo (Sonos Controller) is a simple library to control Sonos speakers \"\"\"\n\n# Will be parsed by setup.py to dete... | python | chosen |
[
{
"from": "system",
"value": "Fix plot title not showing up\n"
},
{
"from": "human",
"value": "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nfrom copy import deepcopy\nfrom ..utils.exceptions import GgplotError\n\n\nclass labs(ob... | python | chosen |
[
{
"from": "system",
"value": "Fix cli module for new lint detection\n\nSince the last commit (2015), some of the test dependencies have\nupdated. This commit specifically addresses updates in PyLint which\nresult in more lint being detected in the project that previous test\nruns.\n"
},
{
"from": "h... | python | chosen |
[
{
"from": "system",
"value": "Add another specific error class\n"
},
{
"from": "human",
"value": "import six\n\n\nclass SlackException(ValueError):\n def __init__(self, message, message_data):\n super(SlackException, self).__init__(message)\n self.message_data = message_data\n\n... | python | chosen |
[
{
"from": "system",
"value": "Make the data migration actually work\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\ndef change_to_usage(apps, schema_editor):\n Recipe = apps.get_model(\"recipes\... | python | chosen |
[
{
"from": "system",
"value": "Rewrite the test script to hint all glyphs\n\nWhich reveals that no MM-compatible hinting is really done :(\n"
},
{
"from": "human",
"value": "from psautohint import autohint\nfrom psautohint import psautohint\n\nd = \"tests/data/source-code-pro\"\nmm = (\"Black\", ... | python | chosen |
[
{
"from": "system",
"value": "Increase DSMM test tolerance to 1e-5 to improve consistency.\n"
},
{
"from": "human",
"value": "import torch\nimport gpytorch\nfrom torch.autograd import Variable\n\n\ndef test_forward():\n i = torch.LongTensor([[0, 1, 1],\n [2, 0, 2]])\n... | python | chosen |
[
{
"from": "system",
"value": "Add survey controller to routes\n"
},
{
"from": "human",
"value": "\n# IATI Data Quality, tools for Data QA on IATI-formatted publications\n# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith\n#\n# Copyright (C) 2013 Publish What You Fund\n#\n# This p... | python | chosen |
[
{
"from": "system",
"value": "Switch to memcached cache backend\n\n- Reinstate config file\n- Read server locations and key prefix from config\n"
},
{
"from": "human",
"value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not... | python | chosen |
[
{
"from": "system",
"value": "[IMP] purchase: Remove useless default value for po_lead\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Part of Odoo. See LICENSE file for full copyright and licensing details.\n\nfrom odoo import api, fields, models\n\n\nclass StockConfigSettings(mod... | python | chosen |
[
{
"from": "system",
"value": "Use python internal functions for generating, removing and changing directories\n"
},
{
"from": "human",
"value": "import os\nfrom subprocess import call\nfrom itertools import product, repeat\n\n# To be called from the main OpenSpace\nmodules = os.listdir(\"modules... | python | chosen |
[
{
"from": "system",
"value": "Make version module available in main namespace.\n"
},
{
"from": "human",
"value": "__all__ = []\n\nfrom tools import *\nimport tools\n__all__ += tools.__all__\n\nimport linpred\nfrom linpred import *\n__all__ += linpred.__all__\n\nfrom numpy.testing import Tester\n... | python | chosen |
[
{
"from": "system",
"value": "Move check for authentication to top\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.core.exceptions import PermissionDenied\nfrom junction.conferences.models import ConferenceProposalReviewer\n\nfrom .models import ProposalSectionReviewer\... | python | chosen |
[
{
"from": "system",
"value": "Fix tests: add sleep to the main thread in order to stop in the child threads on the slow IronPython.\n"
},
{
"from": "human",
"value": "try:\n import thread\nexcept :\n import _thread as thread\n\nimport threading\n\ndef bar(y):\n z = 100 + y\n print(\"... | python | chosen |
[
{
"from": "system",
"value": "Fix 'last chance' reminder email\nBoth payment reminder emails were accidentally configured to go out at the same time.\n"
},
{
"from": "human",
"value": "from uber.config import c\nfrom uber.automated_emails import MarketplaceEmailFixture\nfrom uber.utils import da... | python | chosen |
[
{
"from": "system",
"value": "Delete testcases from src file\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom nltk.stem.snowball import HungarianStemmer\n\n\nclass SnowballStemmerSentence:\n def __init__(self, token... | python | chosen |
[
{
"from": "system",
"value": "Remove leftover parameter in settings tests\n"
},
{
"from": "human",
"value": "from scoring_engine.models.setting import Setting\n\nfrom tests.scoring_engine.unit_test import UnitTest\n\n\nclass TestSetting(UnitTest):\n\n def test_init_setting(self):\n set... | python | chosen |
[
{
"from": "system",
"value": "Add index.html alias on api\n"
},
{
"from": "human",
"value": "\"\"\"\nMain budget web app (backend)\nWritten by Fela Maslen, 2016\n\"\"\"\n\nfrom flask import Flask, request, render_template\n\nfrom srv.config import PIE_TOLERANCE\nfrom srv.misc import get_serial\n... | python | chosen |
[
{
"from": "system",
"value": "Update form to handle notes about funding\n"
},
{
"from": "human",
"value": "from django.forms import ModelForm, widgets\n\nfrom .models import Fellow, Event, Expense, Blog\n\nclass FellowForm(ModelForm):\n class Meta:\n model = Fellow\n exclude = [... | python | chosen |
[
{
"from": "system",
"value": "lastfm: Add default config and config schema\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport mopidy\nfrom mopidy import ext\nfrom mopidy.exceptions import ExtensionError\n\n\n__doc__ = \"\"\"\nFrontend which scrobbles the music y... | python | chosen |
[
{
"from": "system",
"value": "Change variable names to reflect that it doesn't use FFT's anymore\n"
},
{
"from": "human",
"value": "from gz_dsp import *\nfrom cfg import *\n\n\n# By FFT, I mean Goertzel transform\ndef detect_tone(signal):\n\tideal_samples_per_fft = SAMPLE_FREQ/float(FFT_FREQ)\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove superfluous importer namespace import in catmaid.control\n\nI double checked that no importer methods are used directly through the\ncatmaid.control module.\n\nThis relates to issue #570.\n"
},
{
"from": "human",
"value": "from common import *\nfrom connector... | python | chosen |
[
{
"from": "system",
"value": "Add empty test function for user interface.\n"
},
{
"from": "human",
"value": "\"\"\"\nName: Paul Briant\nDate: 12/11/16\nClass: Introduction to Python\nAssignment: Final Project\n\nDescription:\nTests for Final Project\n\"\"\"\n\nimport clean_data as cd\nimport mat... | python | chosen |
[
{
"from": "system",
"value": "Put project name in 'notes' field of host\n\nLabs' graphite metrics architecture means we need both the\nproject name and the hostname to find a full path to our\nhost. Abusing this field for that purpose.\n\nChange-Id: If097526f413f36407acdff852cc81216f9c84556\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Throw exception for not existing XSLT_FILES_DIR path\n"
},
{
"from": "human",
"value": "from django.conf import settings\r\n\r\nclass XmlJsonImportModuleException(Exception):\r\n pass\r\n\r\nif not hasattr(settings, 'XSLT_FILES_DIR'):\r\n raise XmlJsonImportMo... | python | chosen |
[
{
"from": "system",
"value": "Add comment about more efficient than bubble sort\n"
},
{
"from": "human",
"value": "def selection_sort(a_list):\n \"\"\"Selection Sort algortihm.\n\n Concept: \n - Find out the max item's original slot first,\n - then swap it and the item at the max... | python | chosen |
[
{
"from": "system",
"value": "Update down_revision in migration file.\n"
},
{
"from": "human",
"value": "\"\"\"add banner_image_url field to session\n\nRevision ID: 07ebe99161d5\nRevises: d6b1904bea0e\nCreate Date: 2018-11-21 19:06:35.140390\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\... | python | chosen |
[
{
"from": "system",
"value": "Remove vaults with data before and after tests.\n"
},
{
"from": "human",
"value": "from glaciertests.util import GlacierTestsConfig\n\ndef purge_prefix_vaults():\n conn = GlacierTestsConfig().connection()\n all_vaults = conn.list_vaults()\n for vault in all... | python | chosen |
[
{
"from": "system",
"value": "Rewrite custom log format to a class, add verbosity, and vars for options.\n"
},
{
"from": "human",
"value": "\"\"\"Created By: Andrew Ryan DeFilippis\"\"\"\n\nprint('Lambda cold-start...')\n\nfrom json import dumps, loads\n\n\ndef lambda_handler(event, context):\n ... | python | chosen |
[
{
"from": "system",
"value": "ext_blog: Tag for getting a valid RSS feed url for event.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django import template\nfrom Instanssi.ext_blog.models import BlogEntry\n\nregister = template.Library()\n\n@register.inclusion_tag('ext_blog... | python | chosen |
[
{
"from": "system",
"value": "Add an option to pass in generated TEI, for speed & troubleshooting\n"
},
{
"from": "human",
"value": "from eulfedora.server import Repository\nfrom django.core.management.base import BaseCommand\nimport shutil\n\nfrom readux.books import annotate, export\nfrom read... | python | chosen |
[
{
"from": "system",
"value": "Remove references to User class\n"
},
{
"from": "human",
"value": "import datetime\nimport psycopg2\nfrom sqlalchemy import (\n Column,\n DateTime,\n Integer,\n Unicode,\n UnicodeText,\n ForeignKey,\n )\nfrom pyramid.security import Allow, Every... | python | chosen |
[
{
"from": "system",
"value": "Fix the metadata for posts.\n"
},
{
"from": "human",
"value": "\"\"\"\n\"\"\"\n\nfrom string import Template\nfrom paper_to_git.config import config\n\n__all__ = [\n 'generate_metadata',\n ]\n\n\nMETADATA_TEMPLATE = Template(\"\"\"\\\n---\ntitle: $title\ndate:... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Conforming LXDESetWallpaper plugin to conform with keep option (DarwinSetWallpaper), also FastForward merge\"\n\nThis reverts commit 7212d223fe95d3042348bb29d9bd353308be2347.\n\nI really should learn to test before I push to github.\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Implement basic file selection tests\n"
},
{
"from": "human",
"value": "pytest_plugins = 'pytester'\n\n\n# TODO: we don't actually _need_ new-style outer classes, do we...no Spec\n# any longer!\n# TODO: trailing underscore stripping\nclass FileCollection:\n def o... | python | chosen |
[
{
"from": "system",
"value": "Automate uninstallation of Chrome by running the uninstall command from the registry.\n\nNOTRY=True\nBUG=264859\nTEST=\n1) Uninstall Chrome.\n2) Put mini_installer.exe in the same folder as test_installer.py.\n3) Run \"python test_installer.py config\\config.config\".\n4) The s... | python | chosen |
[
{
"from": "system",
"value": "Add votes URL scheme to main URL scheme\n"
},
{
"from": "human",
"value": "\"\"\"jay URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction ... | python | chosen |
[
{
"from": "system",
"value": "Update AWS::CertificateManager::Certificate per 2020-06-11 changes\n"
},
{
"from": "human",
"value": "from . import AWSObject, AWSProperty, Tags\n\n\nclass DomainValidationOption(AWSProperty):\n props = {\n 'DomainName': (basestring, True),\n 'Valid... | python | chosen |
[
{
"from": "system",
"value": "Create test to detect submission of empty list items\n"
},
{
"from": "human",
"value": "from unittest import skip\nfrom .base import FunctionalTest\n\nclass ItemValidationTest(FunctionalTest):\n\n def test_cannot_add_empty_list_items(self):\n self.fail(\"w... | python | chosen |
[
{
"from": "system",
"value": "Use Singleton metaclass on Context\n"
},
{
"from": "human",
"value": "class SchemaNotInitialized(Exception):\n pass\n\n\nclass Context(object):\n _instance = None\n\n _schema = None\n\n def __new__(class_, *args, **kwargs):\n if not isinstance(cla... | python | chosen |
[
{
"from": "system",
"value": "Correct name of index view function\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\n\nurlpatterns = patterns('',\n (r'^/?$', 'ocradmin.ocrplugins.views.list'),\n (r'^query/?$', 'ocradmin.ocrplugins.views.query'),\n (r'^query/(?P<... | python | chosen |
[
{
"from": "system",
"value": "Test discover on a vanilla RDD\n"
},
{
"from": "human",
"value": "import pytest\nfrom into import into\nfrom pyspark import RDD\n\n\ndata = [['Alice', 100.0, 1],\n ['Bob', 200.0, 2],\n ['Alice', 50.0, 3]]\n\n\n@pytest.fixture\ndef rdd(sc):\n return ... | python | chosen |
[
{
"from": "system",
"value": "Fix a race condition in error reporting causing highlighted lines to get out of sync\n"
},
{
"from": "human",
"value": "from errormarker import ErrorMarker\n\nfrom util import delayed\n\n\nclass ErrorReporter(object):\n\n def __init__(self, window, error_report, ... | python | chosen |
[
{
"from": "system",
"value": "Check if its a file\n"
},
{
"from": "human",
"value": "try:\n from urlparse import urlparse\nexcept ImportError: # Python 3\n from urllib.parse import urlparse\n\nfrom . import BaseFile, BackendException\n\n\nclass LocalFileException(BackendException):\n \"... | python | chosen |
[
{
"from": "system",
"value": "Add missing s in https for API base URL.\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nNASA Exoplanet Archive Query Tool\n---------------------------------\n\nModule to query the `NASA Exoplanet Archive <... | python | chosen |
[
{
"from": "system",
"value": "FIX example for both Win and NIX\n\nTODO: tasks wont work\n"
},
{
"from": "human",
"value": "import asyncio\nimport sys\nfrom contextlib import suppress\nsys.path.append(\"..\")\nfrom asynccmd import Cmd\n\nclass Commander(Cmd):\n def __init__(self, intro, prompt... | python | chosen |
[
{
"from": "system",
"value": "Use class instead of dict, preparing for methods.\n"
},
{
"from": "human",
"value": "from pprint import pprint\ninput = open('example_ignition.txt').read()\nhands = input.split('\\n\\n\\n')\n\nfor i, h in enumerate(hands):\n segments = \"seats preflop flop turn r... | python | chosen |
[
{
"from": "system",
"value": "Return Pubmed title and abstract\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\nimport httplib\r\n#import xml.dom.minidom as minidom\r\n#import urllib\r\nimport time, sys\r\nimport xml.etree.ElementTree as ET\r\n\r\ndef get_pu... | python | chosen |
[
{
"from": "system",
"value": "Make request a property on HTTPRequestContext.\n"
},
{
"from": "human",
"value": "\"\"\"\nStores HTTPRequestContext\n\"\"\"\nfrom asphalt.core import Context\nfrom typeguard import check_argument_types\n\n\nclass HTTPRequestContext(Context):\n \"\"\"\n Sub-cla... | python | chosen |
[
{
"from": "system",
"value": "Update wrapper to show latest changes to code\n"
},
{
"from": "human",
"value": "\nfrom rsfmri import utils\nfrom rsfmri import register\n\n\"\"\" This is done in native space, add warped after (Renaud others)??\n\ndespike?\nsplit raw func\nrealign (no slicetime (AN... | python | chosen |
[
{
"from": "system",
"value": "Order the tickets correctly in the API.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.shortcuts import get_object_or_404\n\nfrom rest_framework import viewsets\nfrom rest_framework.response import Response\n\nfrom apps.broadcasts.models imp... | python | chosen |
[
{
"from": "system",
"value": "Add balance checking test round\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom breach.models import SampleSet, Victim, Target, Round\n\n\nclass RuptureTestCase(TestCase):\n def setUp(self):\n target = Target.objects.create(\n ... | python | chosen |
[
{
"from": "system",
"value": "Add dates to Conference GraphQL type\n"
},
{
"from": "human",
"value": "import graphene\n\nfrom .models import Conference\n\nfrom graphene_django import DjangoObjectType\n\nfrom tickets.types import TicketType\n\n\nclass ConferenceType(DjangoObjectType):\n ticket... | python | chosen |
[
{
"from": "system",
"value": "Add in axes swapping for normal='y'\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 9 12:52:31 2015\n\n@author: stuart\n\"\"\"\nimport os\nimport glob\n\nimport yt\n\nmodel = 'spruit'\ndatadir = os.path.expanduser('~/mhs_atmos... | python | chosen |
[
{
"from": "system",
"value": "Add potential to include warnings in warthog.exceptions\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport pytest\nimport warthog.api\nimport warthog.exceptions\n\n\n@pytest.fixture\ndef exports():\n return set([item for item in dir(warthog.api)... | python | chosen |
[
{
"from": "system",
"value": "Allow loading of different box sizes\n"
},
{
"from": "human",
"value": "\"\"\"Little module to find the path of a Cosmo box simulation\"\"\"\n\nimport os.path as path\n\nbase=path.expanduser(\"~/data/Cosmo/\")\n\ndef get_name(sim, ff=True):\n \"\"\"Get the direct... | python | chosen |
[
{
"from": "system",
"value": "Delete any files that get moved.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\ntest_collectr\n-------------\n\nSome functions to test the collectr library.\n\n:copyright: (c) 2013 Cory Benfield\n:license: MIT License, for details see LICENSE.\n... | python | chosen |
[
{
"from": "system",
"value": "Support opening files as text streams on tests\n"
},
{
"from": "human",
"value": "import os\n\n\ndef open_file(filename):\n ''' Load a file from the fixtures directory. '''\n path = 'fixtures/' + filename\n if ('tests' in os.listdir('.')):\n path = '... | python | chosen |
[
{
"from": "system",
"value": "Allow using iterable of sentences in 'Paragraph'\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division, print_function, unicode_literals\n\nfrom itertools import chain\nfrom .._compat imp... | python | chosen |
[
{
"from": "system",
"value": "Add missing section into script to migrate configs\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n#\n# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>\n#\n\nfrom libs.qpanel import utils\nimport sys\n\nif __name__ == '__main_... | python | chosen |
[
{
"from": "system",
"value": "Add `export` to emitted lines\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport collections\nimport sys\n\nimport jprops\n\n\ndef do_replacements(s, mappings):\n for old, new in mappings.items():\n s = s.replace(old, new)\n return s\n\n... | python | chosen |
[
{
"from": "system",
"value": "Include social_auth specific URLs only if social_auth is in use\n"
},
{
"from": "human",
"value": "\"\"\"URLs module\"\"\"\nfrom django.urls import path\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom . import views\n... | python | chosen |
[
{
"from": "system",
"value": "Configure the extension to use django_comments\n"
},
{
"from": "human",
"value": "\"\"\"Settings for Zinnia documentation\"\"\"\nfrom zinnia.xmlrpc import ZINNIA_XMLRPC_METHODS\n\nDATABASES = {'default': {'NAME': ':memory:',\n 'ENGINE': 'djan... | python | chosen |
[
{
"from": "system",
"value": "Change name for nova integration\n\nWith Nova's logger setting, logger name starting with 'nova' only gets logged.\n"
},
{
"from": "human",
"value": "# Copyright (C) 2011 Midokura Japan KK\n\n\"\"\"\nInternal Utility Functions\n\"\"\"\n\nimport logging\nimport os.pa... | python | chosen |
[
{
"from": "system",
"value": "Set up v0.3.0 beta 1.\n"
},
{
"from": "human",
"value": "\"\"\"\nNeuPy is the Artificial Neural Network library implemented in Python.\n\"\"\"\n\n\n__version__ = '0.3.0.dev1'\n"
},
{
"from": "gpt",
"value": "\"\"\"\nNeuPy is the Artificial Neural Network... | python | chosen |
[
{
"from": "system",
"value": "Store is using serfnode service discovery\n"
},
{
"from": "human",
"value": "import collections\nimport pickle\n\nimport redis\n\nfrom .serf import node\n\n\nclass Store(collections.MutableMapping):\n\n def __init__(self, db=0):\n host, port = node(role='r... | python | chosen |
[
{
"from": "system",
"value": "Use ID instead of attribute if attribute name is 'Unknown_Attribute'.\n"
},
{
"from": "human",
"value": "import diamond.collector\nimport subprocess\nimport re\nimport os\n\nclass SmartCollector(diamond.collector.Collector):\n \"\"\"\n Collect data from S.M.A.... | python | chosen |
[
{
"from": "system",
"value": "Allow JSONP requests to the roadevents API\n"
},
{
"from": "human",
"value": "from open511.models import RoadEvent\nfrom open511.utils.views import JSONView\n\nclass RoadEventListView(JSONView):\n\n def get(self, request):\n return [\n rdev.to_j... | python | chosen |
[
{
"from": "system",
"value": "Add model auto-imports to IPython profile.\n"
},
{
"from": "human",
"value": "# Case Conductor is a Test Case Management system.\n# Copyright (C) 2011 uTest Inc.\n# \n# This file is part of Case Conductor.\n# \n# Case Conductor is free software: you can redistribute... | python | chosen |
[
{
"from": "system",
"value": "Update docs and license for python\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport zlib\nimport paho.mqtt.client as mqtt\n\n# The callback for when the client receives a CONNACK response from the server.\ndef on_connect(client, userdata, flags, rc):... | python | chosen |
[
{
"from": "system",
"value": "Add working test for only one event per room per slot\n"
},
{
"from": "human",
"value": "from collections import Counter\nfrom conference_scheduler import scheduler\n\n\ndef test_is_valid_schedule(people):\n # Test empty schedule\n schedule = tuple()\n asse... | python | chosen |
[
{
"from": "system",
"value": "BLD: Fix format string for Python-2.6\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom __future__ import division, print_function, absolute_import\n\n\ndef configuration(parent_package='', top_path=None):\n from numpy.distutils.misc_util import Conf... | python | chosen |
[
{
"from": "system",
"value": "Prepare for next development iteration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n__version__ = '0.3.5'\n__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']\n\nfrom .application_master import ApplicationMaster\nfrom .h... | python | chosen |
[
{
"from": "system",
"value": "Add support for using a function\n\n`extversion` can be a a dict with a `function` key -- e.g.:\n\n setup(\n ...\n setup_requires='setuptools_extversion',\n extversion={'function': 'my_package.version:get_package_version'},\n )\n"
},
{
"from":... | python | chosen |
[
{
"from": "system",
"value": "Change to use ESA class in other module\n"
},
{
"from": "human",
"value": "\"\"\"Dasem app.\"\"\"\n\n\nfrom __future__ import absolute_import, division, print_function\n\nfrom flask import Flask\nfrom flask_bootstrap import Bootstrap\n\nfrom ..dannet import Dannet\n... | python | chosen |
[
{
"from": "system",
"value": "Use get_include instead of get_numpy_include.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Install file for example on how to use Pyrex with Numpy.\n\nFor more details, see:\nhttp://www.scipy.org/Cookbook/Pyrex_and_NumPy\nhttp://www.scipy.org/Cook... | python | chosen |
[
{
"from": "system",
"value": "Add test getattr for FUSE\n"
},
{
"from": "human",
"value": "\nimport os\nimport pytest\n\nfrom fuse import FUSE, FuseOSError\n\nfrom diss.fs import id_from_path, DissFilesystem\nfrom .testdata import ID\n\n\n@pytest.fixture\ndef fs():\n return DissFilesystem()\n... | python | chosen |
[
{
"from": "system",
"value": "Add extra test for resource url validator\n"
},
{
"from": "human",
"value": "import nose\nfrom ckanapi import TestAppCKAN, ValidationError\nfrom ckan.tests import helpers, factories\n\neq_ = nose.tools.eq_\nassert_true = nose.tools.assert_true\n\n\nclass TestValidat... | python | chosen |
[
{
"from": "system",
"value": "Use parse_line function like in later sections\n"
},
{
"from": "human",
"value": "from pyspark.sql import SQLContext, Row\n\nlines = sc.textFile(\"/user/admin/Wikipedia/*\")\ntokens = lines.map(lambda l: l.split(\"\\t\"))\ndata = tokens.map(lambda t: Row(year=int(t[... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.