conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add missing test for to_float applied on a float (when pint is present).\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n tests.test_unit\n ~~~~~~~~~~~~~~~\n\n Module dedicated to testing the unit utility functions.\n\n :copyright: 20... | python | chosen |
[
{
"from": "system",
"value": "Add shebang for the linux folks out there.\n"
},
{
"from": "human",
"value": "import logging\nimport os\n\nfrom threading import Thread\n\nfrom coinotomy.config.config import STORAGE_CLASS, STORAGE_DIRECTORY, WATCHERS\n\n\nlog = logging.getLogger(\"main\")\nlogging.... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.16.4\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.16.3\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"... | python | chosen |
[
{
"from": "system",
"value": "Comment out logger until resolved properly\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport logging\n\nfrom django.core.exceptions import PermissionDenied\nfrom tastypie.resources import ModelResource, ALL\nfrom tastypie.authorization import Auth... | python | chosen |
[
{
"from": "system",
"value": "Delete old unused pings from users\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django.core.management.base import BaseCommand, CommandError\n\nfrom clowder_server.emailer import send_alert\nfrom clowder_server.models import Alert\n\nclass Command(Base... | python | chosen |
[
{
"from": "system",
"value": "Change camera index, and fix the chessboard preview.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding:utf-8 -*-\n\n#\n# Capture calibration chessboard\n#\n\n# External dependencies\nimport time\nimport cv2\nimport Calibration\n\n# Calibration ... | python | chosen |
[
{
"from": "system",
"value": "Upgrade libchromiumcontent to discard iframe security settings\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport platform\nimport sys\n\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONTENT_COMMIT = '5698... | python | chosen |
[
{
"from": "system",
"value": "Add reset methods to ExtractAttribute\n"
},
{
"from": "human",
"value": "import logging\nfrom operator import attrgetter\nfrom .base_NEW import TohuUltraBaseGenerator\n\n__all__ = ['ExtractAttribute']\n\nlogger = logging.getLogger('tohu')\n\n\nclass ExtractAttribute... | python | chosen |
[
{
"from": "system",
"value": "Modify the interfaces listing view to filter only the port on\nthe mgt network\n\nDHC-1512\n\nChange-Id: If7e5aebf7cfd7e87df0dea8cd749764c142f1676\nSigned-off-by: Rosario Di Somma <73b2fe5f91895aea2b4d0e8942a5edf9f18fa897@dreamhost.com>\n"
},
{
"from": "human",
"val... | python | chosen |
[
{
"from": "system",
"value": "Add image into Tviit Model\nAdd PathAndRename function to rename image path\nAdd TviitForm\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom django.conf import settings\nimport uuid\n\n\nfrom django.db import models\n\nclass Tviit(mode... | python | chosen |
[
{
"from": "system",
"value": "Add default hook url for gitlab\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nfrom app import app, webhooks\n\n@webhooks.hook(app.config.get('GITLAB_HOOK'), handler='gitlab')\nclass Gitlab:\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix thumbnail on gallery page\n"
},
{
"from": "human",
"value": "\"\"\"\nScatterplot with marginal ticks\n===============================\n\n_thumb: .68, .32\n\"\"\"\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nsns.set(style=\"white\"... | python | chosen |
[
{
"from": "system",
"value": "Add path in test to src\n"
},
{
"from": "human",
"value": "import unittest\nimport NGrams\n\n\nclass TestNGrams(unittest.TestCase):\n def test_unigrams(self):\n sentence = 'this is a random piece of text'\n ngram_list = NGrams.generate_ngrams(senten... | python | chosen |
[
{
"from": "system",
"value": "Fix crash in python 3.8 due to a mismatch on the ArgumentParser parameter\n"
},
{
"from": "human",
"value": "\"\"\"ArgumentParser with Italian translation.\"\"\"\n\nimport argparse\nimport sys\n\n\ndef _callable(obj):\n return hasattr(obj, '__call__') or hasattr(... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Modify copy method into inherit\n"
},
{
"from": "human",
"value": "from openerp import models, fields\n'''\nThis module create model of Course\n'''\n\n\nclass Course(models.Model):\n '''\n this class model of Course\n '''\n _name = 'op... | python | chosen |
[
{
"from": "system",
"value": "Change class name to DuplicateScripts\n"
},
{
"from": "human",
"value": "\"\"\"This module provides plugins for basic duplicate code detection.\"\"\"\n\nfrom hairball.plugins import HairballPlugin\n\nclass DuplicateChecks(HairballPlugin):\n\n \"\"\"Plugin that ke... | python | chosen |
[
{
"from": "system",
"value": "Update root directory for tests\n"
},
{
"from": "human",
"value": "\"\"\"Tests for running TopoFlow components in CMI.\"\"\"\nimport os\n\n\ndef locate_topoflow(cache_dir):\n for x in os.listdir(cache_dir):\n if x.startswith('topoflow'):\n retur... | python | chosen |
[
{
"from": "system",
"value": "Fix problems in test init.\n"
},
{
"from": "human",
"value": "from flexmock import flexmock\nfrom flask.ext.storage import MockStorage\nfrom flask_uploads import init\n\ncreated_objects = []\nadded_objects = []\ndeleted_objects = []\ncommitted_objects = []\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Add cache key in HTML source\n"
},
{
"from": "human",
"value": "from django.core.cache import cache\n\n\ndef cache_get_key(*args, **kwargs):\n \"\"\"Get the cache key for storage\"\"\"\n import hashlib\n serialise = []\n for arg in args:\n seriali... | python | chosen |
[
{
"from": "system",
"value": "Set the test path to the project in Packages.\n"
},
{
"from": "human",
"value": "import sublime\n\nimport os\nimport os.path\nimport unittest\n\n\nclass CommandTestCase(unittest.TestCase):\n\n def setUp(self):\n self.project_data = {\n 'code_search': {'cs... | python | chosen |
[
{
"from": "system",
"value": "Check framework has the studios lot before showing start page\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom app import data_api_client\n\nfrom flask import abort, render_template\nfrom ...helpers.buyers_hel... | python | chosen |
[
{
"from": "system",
"value": "tests: Check domain decomposition over Functions\n"
},
{
"from": "human",
"value": "from mpi4py import MPI\n\nimport pytest\n\nfrom devito import Grid, Function, Distributor\n\n\n@pytest.mark.parallel(nprocs=2)\ndef test_hello_mpi():\n size = MPI.COMM_WORLD.Get_s... | python | chosen |
[
{
"from": "system",
"value": "Return validation error messages to client\n"
},
{
"from": "human",
"value": "from flask import request, make_response\nimport json\n\nfrom themint import app\nfrom themint.service import message_service\n\n@app.route('/', methods=['GET'])\ndef index():\n return ... | python | chosen |
[
{
"from": "system",
"value": "Fix ReStructuredText extension in Python3 environment\n"
},
{
"from": "human",
"value": "from docutils.core import publish_string\nimport coffeescript\nfrom scss import Scss\nfrom stylus import Stylus\n\nfrom .util import as_unicode\n\n\n\ndef rst_to_html(source):\n... | python | chosen |
[
{
"from": "system",
"value": "Fix broken default value in a Twitter migration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ... | python | chosen |
[
{
"from": "system",
"value": "Validate user password on creation\n"
},
{
"from": "human",
"value": "from ovp_users import models\nfrom rest_framework import serializers\n\nclass UserCreateSerializer(serializers.ModelSerializer):\n class Meta:\n model = models.User\n fields = ['name', 'ema... | python | chosen |
[
{
"from": "system",
"value": "Make resource type list static\n"
},
{
"from": "human",
"value": "import json\n\nfrom rest_framework.test import APIClient\nfrom rest_framework import status\nfrom rest_framework.test import APITestCase\n\nfrom hs_core.hydroshare.utils import get_resource_types\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Create download directory if not exists.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n# -*- coding: utf8 -*-\n\nimport os\nimport shutil\nimport subprocess\n\nbootstrap_updater_version = 1\n\nBootstrapDownloads = 'BootstrapDownloads/'\nBootstrapPrograms =... | python | chosen |
[
{
"from": "system",
"value": "Add RequestContext to Micro site\n\nThis allows us to populate settings variables such as Google Analytics\ncodes. See original work done for #769.\n\nRefs #920\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nfrom _... | python | chosen |
[
{
"from": "system",
"value": "Add Message.__repr__ for better debugging"
},
{
"from": "human",
"value": "import msgpack\n\n\nclass Message(object):\n def __init__(self, message_type, data, node_id):\n self.type = message_type\n self.data = data\n self.node_id = node_id\n\... | python | chosen |
[
{
"from": "system",
"value": "Disable spec validation on 3x\n"
},
{
"from": "human",
"value": "from .request_test import test_app\n\n\ndef test_200_for_normal_response_validation():\n settings = {\n 'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',\n 'pyramid... | python | chosen |
[
{
"from": "system",
"value": "Use named arguments for RunSQL\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\nfrom query.operations import engine_specific\n\n\nclass Migration(migrations.Migration):... | python | chosen |
[
{
"from": "system",
"value": "Print error in case of no results\n"
},
{
"from": "human",
"value": "\nimport asyncio\nimport json\nimport urllib.parse\n\nimport aiohttp\n\nimport waterbug\n\nclass Commands:\n\n @waterbug.expose\n class prisjakt:\n\n @waterbug.expose\n @asyncio... | python | chosen |
[
{
"from": "system",
"value": "Add comment describing what does the method do\n"
},
{
"from": "human",
"value": "#\n# Perl (Inline::Perl) helpers\n#\n\n\n# FIXME MC_REWRITE_TO_PYTHON: remove after porting all Perl code to Python\ndef decode_string_from_bytes_if_needed(string):\n \"\"\"Convert ... | python | chosen |
[
{
"from": "system",
"value": "Use os.walk() to find files to delete.\n"
},
{
"from": "human",
"value": "# Remove all the .pyc and .pyo files under ../Lib.\n\ndef deltree(root):\n import os\n def rm(path):\n os.unlink(path)\n npyc = npyo = 0\n dirs = [root]\n while dirs:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add marker to Mercurial test\n"
},
{
"from": "human",
"value": "from pip._internal.vcs.mercurial import Mercurial\nfrom tests.lib import _create_test_package\n\n\ndef test_get_repository_root(script):\n version_pkg_path = _create_test_package(script, vcs=\"hg\")\... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary check for dict attr conflicts.\n"
},
{
"from": "human",
"value": "# Attribute prefix for allowing dotlookups when keys conflict with dict\n# attributes.\nPREFIX = '_bd_'\n\n\nclass BetterDict(dict):\n def __init__(self, *args, **kwargs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Clean up the management command stub in preparation of further development.\n"
},
{
"from": "human",
"value": "import os\nimport xlrd\nfrom django.core.management.base import BaseCommand, CommandError\n\nclass Command(BaseCommand):\n \"\"\"\n \"\"\"\n args ... | python | chosen |
[
{
"from": "system",
"value": "Add ControlCharError for process_control_chars function\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2010 Red Hat, Inc\n#\n# kitchen is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser Gen... | python | chosen |
[
{
"from": "system",
"value": "Make engine available in app.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=utf8\n\nfrom flask import Flask\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker, scoped_session\n\nimport model\nimport defaults\nfrom vie... | python | chosen |
[
{
"from": "system",
"value": "Add functions to EntryModel to get language, mimetype, filename, and extension\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.conf import settings\n\nfrom tempel import utils\n\nclass Entry(models.Model):\n content = models.TextField... | python | chosen |
[
{
"from": "system",
"value": "Comment out s3 settings. It was breaking admin static file serve\n"
},
{
"from": "human",
"value": "from project.settings_common import *\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\n# CACHE\nfrom memcacheify import memcacheify\n\nCACHES = memcacheify()\n\nMIDDLEWARE... | python | chosen |
[
{
"from": "system",
"value": "Add load wordnet to tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nUnit test.\n\nEach file in tests/ is for each main package.\n\"\"\"\nimport sys\nimport unittest\n\nsys.path.append(\"../pythainlp\")\n\nloader = unittest.TestLoader()\ntes... | python | chosen |
[
{
"from": "system",
"value": "Remove robots from pytest path ignore, as requested by @gonzalocasas.\n"
},
{
"from": "human",
"value": "import pytest\nimport compas\nimport math\nimport numpy\n\n\ndef pytest_ignore_collect(path):\n if \"rhino\" in str(path):\n return True\n\n if \"bl... | python | chosen |
[
{
"from": "system",
"value": "Add schema version check to sync script\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.\n# This file is part of the Pycroft project and licensed under the terms of\n# the Apache License, Ve... | python | chosen |
[
{
"from": "system",
"value": "Add aioes exceptions to top-level imports\n"
},
{
"from": "human",
"value": "import re\nimport sys\nfrom collections import namedtuple\n\nfrom .client import Elasticsearch\n\n__all__ = ('Elasticsearch',)\n\n\n__version__ = '0.1.0a'\n\nversion = __version__ + ' , Pyt... | python | chosen |
[
{
"from": "system",
"value": "Fix compatibility with Django 1.6\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\n\nurlpatterns = patterns('django_dowser.views',\n url(r'^trace/(?P<typename>[\\.\\-\\w]+)(/(?P<objid>\\d+))?$', 'trace'),\n url(r'^tree/(?P<typename>[... | python | chosen |
[
{
"from": "system",
"value": "Remove language code from path\n\nWe no longer need the language detection in the URL. The locale\nmiddleware already handles the language properly and we can consume\nit from the request.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom .... | python | chosen |
[
{
"from": "system",
"value": "Mark as 1.7.0 beta 1"
},
{
"from": "human",
"value": "version = '1.7.0'\nrevision = ' development'\nmilestone = 'Yoitsu'\nrelease_number = '101'\nprojectURL = 'https://syncplay.pl/'\n"
},
{
"from": "gpt",
"value": "version = '1.7.0'\nrevision = ' beta 1'... | python | chosen |
[
{
"from": "system",
"value": "Split index route into get and post\n"
},
{
"from": "human",
"value": "from flask import Flask, request, render_template, flash, url_for, abort\nfrom itsdangerous import URLSafeSerializer\n\nfrom ca import app, db\nfrom ca.forms import RequestForm\nfrom ca.models im... | python | chosen |
[
{
"from": "system",
"value": "Fix for historylinks connecting to missing objects\n"
},
{
"from": "human",
"value": "\"\"\"Middleware used by the history links service.\"\"\"\n\nfrom django.shortcuts import redirect\nfrom cms.apps.historylinks.models import HistoryLink\n\n\nclass HistoryLinkFallb... | python | chosen |
[
{
"from": "system",
"value": "Add a basic model for the identifications\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n"
},
{
"from": "gpt",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\nclass Cr... | python | chosen |
[
{
"from": "system",
"value": "Fix storage path for Docker mode\n"
},
{
"from": "human",
"value": "import os\nimport pathlib\n\n\n# RELEASE-UPDATE\nAPP_DIR = pathlib.Path(os.path.realpath(__file__)).parent.parent\nROOT_DIR = APP_DIR.parent\nDEFAULT_DB_PATH = '/instance/storage/storage.db'\nPROJEC... | python | chosen |
[
{
"from": "system",
"value": "Remove unnnecessary __author__ and __license__\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom distutils.version import LooseVersion\nfrom marshmallow.utils import missing\n\n# Make marshmallow's validation functions importable from webargs\nfrom ma... | python | chosen |
[
{
"from": "system",
"value": "Use socket instead of nc\n"
},
{
"from": "human",
"value": "# (C) Datadog, Inc. 2010-2016\n# All rights reserved\n# Licensed under Simplified BSD License (see LICENSE)\nimport os\n\nimport pytest\n\nfrom .common import INSTANCE, HOST\nfrom datadog_checks.dev import ... | python | chosen |
[
{
"from": "system",
"value": "Use reify instead of properties for the task backend connections.\n"
},
{
"from": "human",
"value": "from celery import Celery, Task\nfrom redis import StrictRedis\n\nfrom charat2.model import sm\nfrom charat2.model.connections import redis_pool\n\ncelery = Celery(\... | python | chosen |
[
{
"from": "system",
"value": "Remove reference to log, as it's not set up correctly yet.\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nfrom aqt import mw, QAction, QFileDialog\n\nsys.path.append(os.path.join(os.path.dirname(__file__), \"dist\"))\n\nfrom .anki.hook_vendor import Hoo... | python | chosen |
[
{
"from": "system",
"value": "Fix tab/space issues and use automatic name wildcard\n\n- Using a regular query search allows ADS to automatically adjust author\n name to hit multiple abstracts\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys, os\nimport ads\nfrom nameparser imp... | python | chosen |
[
{
"from": "system",
"value": "Make user loggin as the homepage\n"
},
{
"from": "human",
"value": "\"\"\"service_control URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.11/topics/http/urls/\nExamples:\nFun... | python | chosen |
[
{
"from": "system",
"value": "Add a test for .format() method\n"
},
{
"from": "human",
"value": "\"normal {{ normal }} normal {fo.__add__!s}\"\n\n\n\" : source.python, string.quoted.double.python\nnormal : source.python, string.quoted.double.python\n{{ : constant.ch... | python | chosen |
[
{
"from": "system",
"value": "Rewrite structure_check tests with hypothesis\n`OrderedDict` chosen instead of `SimpleNamespace` as the former supports the dictionary-like item access, unlike the latter.\n"
},
{
"from": "human",
"value": "import pytest\nfrom datatyping.datatyping import validate\n... | python | chosen |
[
{
"from": "system",
"value": "Allow replacing get_key_generator class method in subclasses.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nkay.models\n\n:Copyright: (c) 2009 Takashi Matsuo <tmatsuo@candit.jp> All rights reserved.\n:license: BSD, see LICENSE for more detail... | python | chosen |
[
{
"from": "system",
"value": "Add all the paths so includes/extends work\n"
},
{
"from": "human",
"value": "from collections import defaultdict\n\nfrom django.template.base import TemplateDoesNotExist, TemplateSyntaxError # NOQA\nfrom django.template.backends.base import BaseEngine\nfrom django... | python | chosen |
[
{
"from": "system",
"value": "Fix project detail template path\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\n\nfrom organization.projects.models import *\nfrom organization.core.views import *\n\n\nclass ProjectListView(ListView):\n\n model = Project\n template_na... | python | chosen |
[
{
"from": "system",
"value": "Fix end of line format\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\r\n# coding: utf-8\r\n\r\nimport sys\r\nimport signal\r\nimport logging\r\nimport argparse\r\n\r\nfrom lib.DbConnector import DbConnector\r\nfrom lib.Acquisition import Acquisition\r\nfrom l... | python | chosen |
[
{
"from": "system",
"value": "Fix encoding bugs on production server\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.http import HttpResponse\nfrom django.http import HttpResponseRedirect\n\ndef index(request):\n return render(request, 'index.html')\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Rename links from *book* to *tale*\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom .models import Tale \n\ndef tale_list(request):\n\ttale_list = Tale.objects.all()\n\n\n\treturn render(request, 'booksite/index.html', {'tale_list' : tale... | python | chosen |
[
{
"from": "system",
"value": "Add filter for water use in downtown LA zipcodes.\n"
},
{
"from": "human",
"value": "\"\"\"\nName: Paul Briant\nDate: 12/11/16\nClass: Introduction to Python\nAssignment: Final Project\n\nDescription:\nCode for Final Project\n\"\"\"\n\nimport pandas\nfrom datetime i... | python | chosen |
[
{
"from": "system",
"value": "Include dev comment on solution\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\n# See https://en.wikipedia.org/wiki/Longest_common_subsequence_problem\ndef commonChild(s1, s2):\n matrix = [[0 fo... | python | chosen |
[
{
"from": "system",
"value": "Add partition step and swap helper function\n\nThe data is partitioned iterating over the array and moving any\nelement less than the pivot value to the left part of the array.\nThis is done using an additional variable i that represents the\nindex of the smallest value greater... | python | chosen |
[
{
"from": "system",
"value": "Add some actions to settings"
},
{
"from": "human",
"value": "from PyQt4 import QtCore, QtGui\nfrom utilities.backend_config import Configuration\nfrom qt_interfaces.settings_ui_new import Ui_ClientConfiguration\nfrom utilities.log_manager import logger\n\n\n# Confi... | python | chosen |
[
{
"from": "system",
"value": "Change admin sort for slots\n"
},
{
"from": "human",
"value": "\"\"\"Admin for schedule-related models.\"\"\"\n\nfrom pygotham.admin.utils import model_view\nfrom pygotham.schedule import models\n\n# This line is really long because pep257 needs it to be on one line... | python | chosen |
[
{
"from": "system",
"value": "Update tests to correspond with flake8\n"
},
{
"from": "human",
"value": "import logging\nimport unittest\n\nimport six\nif six.PY3:\n from unittest import mock\nelse:\n import mock\n\nfrom engineio import async_eventlet\n\n\nclass TestServer(unittest.TestCase... | python | chosen |
[
{
"from": "system",
"value": "Use zip for a shorter solution\n"
},
{
"from": "human",
"value": "class Matrix(object):\n def __init__(self, s):\n self.rows = [list(map(int, row.split()))\n for row in s.split(\"\\n\")]\n\n @property\n def columns(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Move Author Managers into an abstract base class\n\nCopying of the default manager causes the source model to become poluted.\nTo supply additional managers without replacing the default manager,\nthe Django docs recommend inheriting from an abstract base class.\n\nhttps://docs... | python | chosen |
[
{
"from": "human",
"value": "Document how the Dmark protocol is expected to work.\n"
},
{
"from": "gpt",
"value": "\nfrom vumi.transports.httprpc import HttpRpcTransport\n\n\nclass DmarkUssdTransportConfig(HttpRpcTransport.CONFIG_CLASS):\n \"\"\"Config for Dmark USSD transport.\"\"\"\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Fix test - change in client redirection previously overlooked.\n"
},
{
"from": "human",
"value": "\"\"\"Unit test module for auth\"\"\"\nimport json\nfrom flask.ext.login import login_user, logout_user\nfrom tests import TestCase, LAST_NAME, FIRST_NAME, TEST_USER_ID... | python | chosen |
[
{
"from": "system",
"value": "Set figshare's MAX_FILE_SIZE to 50mb\n"
},
{
"from": "human",
"value": "import os\n\nfrom . import routes, views, model # noqa\n\nMODELS = [\n model.AddonFigShareUserSettings,\n model.AddonFigShareNodeSettings,\n model.FigShareGuidFile\n]\nUSER_SETTINGS_MO... | python | chosen |
[
{
"from": "system",
"value": "Add publication date on github publish\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\nAUTHOR = 'Joao Moreira'\nSITENAME = 'Joao Moreira'\nSITEURL = ''\nBIO = 'lorem ipsum doler umpalum ... | python | chosen |
[
{
"from": "system",
"value": "Fix PeriodicTask interval sleep calculation\n"
},
{
"from": "human",
"value": "from ..vtask import VTask\nimport time\nfrom ..sparts import option\nfrom threading import Event\n\n\nclass PeriodicTask(VTask):\n INTERVAL = None\n\n interval = option('interval', ... | python | chosen |
[
{
"from": "system",
"value": "Support both old and new format\n"
},
{
"from": "human",
"value": "#!/bin/env python\n#\n# cat_StarterLog.py\n#\n# Print out the StarterLog for a glidein output file\n#\n# Usage: cat_StarterLog.py logname\n#\n\nimport os.path\nimport sys\nSTARTUP_DIR=sys.path[0]\nsy... | python | chosen |
[
{
"from": "system",
"value": "FIX Format String Error in Conector Driver Comando\n"
},
{
"from": "human",
"value": "# -*- coding: iso-8859-1 -*-\r\nfrom serial import SerialException\r\nimport importlib\r\nimport threading\r\nimport logging\r\n\r\n\r\nclass ConectorError(Exception):\r\n pass\... | python | chosen |
[
{
"from": "system",
"value": "Add commented out top-level imports\n"
},
{
"from": "human",
"value": "from __future__ import print_function, unicode_literals\nimport logging\n__version__ = '1.3.0'\n\nlogging.basicConfig(format='%(levelname)s: indra/%(name)s - %(message)s',\n le... | python | chosen |
[
{
"from": "system",
"value": "Use modern super() python class function\n"
},
{
"from": "human",
"value": "\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom django.views.generic import TemplateView\n\nfrom voting.models import Bill\nfrom voting.models import Member\n\n\nclass HomeVie... | python | chosen |
[
{
"from": "system",
"value": "Add small test for crop parameter to pipe\n"
},
{
"from": "human",
"value": "import os\nimport pytest\nimport tempfile\n\nimport pandas\nfrom skan import pipe\n\n@pytest.fixture\ndef image_filename():\n rundir = os.path.abspath(os.path.dirname(__file__))\n dat... | python | chosen |
[
{
"from": "system",
"value": "Create new v0.9 development branch\n"
},
{
"from": "human",
"value": "__all__ = 'VERSION', 'VERSION_INFO'\n\n#: (:class:`tuple`) The version tuple e.g. ``(0, 9, 2)``.\nVERSION_INFO = (0, 8, 0)\n\n#: (:class:`basestring`) The version string e.g. ``'0.9.2'``.\nif len(... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Add domain or and ilike\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*_\nfrom openerp import fields, models\n\nclass Session(models.Model):\n\n _name = 'openacademy.session'\n\n name = fields.Char(required=True)\n start_date = ... | python | chosen |
[
{
"from": "system",
"value": "Add required attribute to Category name input\n"
},
{
"from": "human",
"value": "# This file is part of e-Giełda.\n# Copyright (C) 2014 Mateusz Maćkowski and Tomasz Zieliński\n#\n# e-Giełda is free software: you can redistribute it and/or modify\n# it under the ter... | python | chosen |
[
{
"from": "system",
"value": "Make the tweet slightly less robot-y\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# CoffeeOutsideBot\n# Copyright 2016, David Crosby\n# BSD 2-clause license\n#\n# TODO - add rest of the locations, etc\n# TODO - automate weather forecast lookup\n# TODO -... | python | chosen |
[
{
"from": "system",
"value": "Make sure emit_movie_queue test doesn't go online\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals, division, absolute_import\nfrom datetime import timedelta, datetime\n\nfrom flexget.manager import Session\nfrom flexget.plugins.filter.movi... | python | chosen |
[
{
"from": "system",
"value": "Add camera image dimensions to config\n"
},
{
"from": "human",
"value": "\"\"\"\nMinimal config file for kahvibot. Just define values as normal Python code.\n\"\"\"\n\n# put your bot token here as a string\nbot_token = \"\"\n\n# the tg username of the bot's admin.\n... | python | chosen |
[
{
"from": "system",
"value": "Add watermark path to example config\n"
},
{
"from": "human",
"value": "\"\"\"\nMinimal config file for kahvibot. Just define values as normal Python code.\n\"\"\"\n\n# put your bot token here as a string\nbot_token = \"\"\n\n# the tg username of the bot's admin.\na... | python | chosen |
[
{
"from": "system",
"value": "Update context processors analyzer to target Django 1.4\n"
},
{
"from": "human",
"value": "import ast\n\nfrom .base import BaseAnalyzer, ModuleVisitor, Result\n\n\nclass ContextProcessorsVisitor(ast.NodeVisitor):\n\n def __init__(self):\n self.found = []\n... | python | chosen |
[
{
"from": "system",
"value": "Change indentation to conform to PEP8\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nfrom xml.dom import minidom\n\nclass XMLTranslator:\n\n # Parse any other node of the PML file\n def parse_nodes(self, nodes, depth, processes_sofar, proc... | python | chosen |
[
{
"from": "system",
"value": "Fix mistake in last commit\n"
},
{
"from": "human",
"value": "import sys\nfrom datetime import datetime\nfrom courtutils.databases.postgres import PostgresDatabase\nfrom courtreader import readers\nfrom courtutils.logger import get_logger\n\nlog = get_logger()\nread... | python | chosen |
[
{
"from": "system",
"value": "Fix blank lines for PEP-8\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom member.models import Member\nfrom datetime import date\n\nclass MemberTestCase(TestCase):\n\n def setUp(self):\n Member.objects.create(firstname='Katrina', ... | python | chosen |
[
{
"from": "system",
"value": "Disable hyperparam inference for now\n"
},
{
"from": "human",
"value": "\"\"\"Implements the Runner interface fo LDA\n\"\"\"\n\nfrom microscopes.common import validator\nfrom microscopes.common.rng import rng\nfrom microscopes.lda.kernels import lda_crp_gibbs\nfrom ... | python | chosen |
[
{
"from": "human",
"value": "Allow compute driver to load correctly\n\nIn certain environments the load order can be confused between nova\nand zun. This can cause boot issues where 'No module named cmd.compute'\ncan be thrown because the python code is looking in zun/nova for that\ndriver.\n\nThis change e... | python | chosen |
[
{
"from": "system",
"value": "Update test to reflect spaces without quotes in dataset.\n"
},
{
"from": "human",
"value": "import sys\nsys.path.insert(1, \"../../\")\nimport h2o, tests\n\ndef length_check():\n # Connect to a pre-existing cluster\n\n frame = h2o.import_file(path=h2o.locate(\... | python | chosen |
[
{
"from": "system",
"value": "Test the volume rather than series.\n"
},
{
"from": "human",
"value": "import os\nfrom nose.tools import (assert_equal, assert_in, assert_true)\nfrom ...helpers.logging import logger\nfrom qipipe.interfaces import GroupDicom\nfrom ... import ROOT\nfrom ...helpers.lo... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.