conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Set the default auto field to be AutoField\n\nOn django 3.2 it creates a migration to be BigAutoField. This fixes it."
},
{
"from": "human",
"value": "from django.apps import AppConfig\nfrom django.utils.translation import gettext_lazy as _\n\n\nclass FormDesignerCo... | python | chosen |
[
{
"from": "system",
"value": "Remove python decorators from list\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\ndef extract_function_names(module):\n '''\n extract function names from attributes of 'module'.\n '''\n from importlib import import... | python | chosen |
[
{
"from": "system",
"value": "Fix python 3 use of iteritems\n"
},
{
"from": "human",
"value": "import imp\nimport json\nimport os\nimport sys\n\n\nclass Dot(dict):\n\n def __init__(self, d):\n super(dict, self).__init__()\n for k, v in d.iteritems():\n if isinstance(v... | python | chosen |
[
{
"from": "system",
"value": "Fix Effigy to properly reveal itself\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\n# Dalaran Aspirant\nclass AT_006:\n\tinspire = Buff(SELF, \"AT_006e\")\n\n\n# Spellslinger\nclass AT_007:\n\tplay = Give(ALL_PLAYERS, RandomSpell())\n... | python | chosen |
[
{
"from": "system",
"value": "ref: Disable select for update on build mutation\n"
},
{
"from": "human",
"value": "from zeus.config import db, nplusone\nfrom zeus.models import Build, ItemStat, Revision\nfrom zeus.pubsub.utils import publish\n\nfrom .base_build import BaseBuildResource\nfrom ..sc... | python | chosen |
[
{
"from": "system",
"value": "Fix Bug: Encode an int\n"
},
{
"from": "human",
"value": "#--coding:utf-8--\nimport getpass\nimport keyring\n\nn = int(raw_input(\"Number of Accounts: \"))\nkeyring.set_password('FbSpider', 'Account', n)\nfor i in range(0, n):\n Email = raw_input(\"Email: \")\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove debug print and log properly\n"
},
{
"from": "human",
"value": "import os\n\ndef read_map_file(map_name):\n \"\"\" Load map data from disk. \"\"\"\n root = os.path.dirname(os.path.abspath(__file__))\n map_path = os.path.join(root, 'maps', map_name + ... | python | chosen |
[
{
"from": "system",
"value": "Fix bug with campaign id\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\nfrom mail import models as mail_api\nfrom groups import models as group_api\nfrom mailgun import api as mailgun_api\n\ndef send_email( email_uri ):\n \"\"\" Send the e... | python | chosen |
[
{
"from": "system",
"value": "Fix namespace bug of FTPconnector\n"
},
{
"from": "human",
"value": "\nfrom .connectors import (GithubConnector, S3Connector,\n BaltradFTPConnector, LocalConnector)\nfrom .transporters import (BaltradToS3, LocalToS3)\nfrom .s3enram import S3E... | python | chosen |
[
{
"from": "system",
"value": "Modify that using default value when input value is None.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom getpass import getpass\n\n\nclass CLIInput():\n def get_user_name(self):\n return input('user name: ')\n\n def get_password(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Refactor ModelDetail to inherit DetailView GCBV.\n"
},
{
"from": "human",
"value": "from django.shortcuts import (\n get_object_or_404, redirect, render)\nfrom django.views.generic import View\n\nfrom .forms import ExampleForm\nfrom .models import ExampleModel\n\... | python | chosen |
[
{
"from": "system",
"value": "Convert string to raw string, in order to print \"\\\\\" in css. Otherwise the browse cannot reach the file.\n"
},
{
"from": "human",
"value": "import os\nimport re\nfrom ..assets import build_asset\nfrom ..exceptions import FileNotFound\nfrom .base import BaseProce... | python | chosen |
[
{
"from": "system",
"value": "Fix newlines in copying of errors"
},
{
"from": "human",
"value": "# A patched version of QMessageBox that allows copying the error\n\nfrom ...external.qt import QtGui\n\n__all__ = ['QMessageBoxPatched']\n\n\nclass QMessageBoxPatched(QtGui.QMessageBox):\n\n def _... | python | chosen |
[
{
"from": "system",
"value": "Set Content-Length to 0 when no body is set\n"
},
{
"from": "human",
"value": "class HttpResponse(object):\n\n def __init__(self):\n self.body = ''\n self.headers = {}\n self.status_code = 200\n self.status_string = 'OK'\n self.... | python | chosen |
[
{
"from": "system",
"value": "ENH: DEBUG level can be easily overriden from the local environment\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport logbook\n\nLOG_LEVEL = logbook.DEBUG\n\nDATE_TIME_FORMAT = '%Y-%m-%d %H:%M'\n\nAUTO_INGEST = False"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Print stdout, forgot about that.\n"
},
{
"from": "human",
"value": "import subprocess\n\n\ndef read_node_status():\n process = subprocess.Popen('pestat -f', shell=True,\n stdout=subprocess.PIPE)\n process.wait()\n return proces... | python | chosen |
[
{
"from": "system",
"value": "Update REACH reader to new API class path\n"
},
{
"from": "human",
"value": "from indra.java_vm import autoclass, JavaException\n\nclass ReachReader(object):\n \"\"\"The ReachReaader wraps a singleton instance of the REACH reader.\n\n This allows calling the r... | python | chosen |
[
{
"from": "system",
"value": "Fix database connection leak in tests\n\nWithout this, each flask app created in tests will hold\none database connection until all tests are finished. This may result\nin test failure if database limits number of concurrent connections.\n"
},
{
"from": "human",
"va... | python | chosen |
[
{
"from": "system",
"value": "Rename a variable in Matcher.__repr__() to make the code less confusing.\n\nEven though there is technically no name clash, the code is now less confusing.\n"
},
{
"from": "human",
"value": "#\n# Project: retdec-python\n# Copyright: (c) 2015 by Petr Zemek <s3rvac@... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Add dependency on l10n_lu_ext, for the field l10n_lu_matricule\n"
},
{
"from": "human",
"value": "{\n \"name\": \"eCDF annual reports\",\n \"version\": \"8.0.1.0.0\",\n \"author\": \"ACSONE SA/NV\",\n \"license\": \"AGPL-3\",\n \"category\": \"A... | python | chosen |
[
{
"from": "system",
"value": "Add new required middleware to make tests pass on Django 1.7\n"
},
{
"from": "human",
"value": "SECRET_KEY = 'SEKRIT'\n\nINSTALLED_APPS = (\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.auth',\n 'django.contrib.admin',\n... | python | chosen |
[
{
"from": "system",
"value": "Reorganize tests and make them test more useful things\n\nsvn path=/trunk/; revision=738\n"
},
{
"from": "human",
"value": "# -*- Mode: Python -*-\n\nimport os\nimport unittest\n\nfrom common import gio, gobject\n\n\nclass TestInputStream(unittest.TestCase):\n de... | python | chosen |
[
{
"from": "system",
"value": "Use a random number instead of uuid for temp database name."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2007-2009 Christopher Lenz\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you... | python | chosen |
[
{
"from": "system",
"value": "Make feature_file_paths have no duplicates\n"
},
{
"from": "human",
"value": "import os\n\n\nclass Core(object):\n \"\"\"\n The core of the Romaine, provides BDD test API.\n \"\"\"\n # All located features\n feature_file_paths = []\n instance =... | python | chosen |
[
{
"from": "system",
"value": "Use expanduser instead of env\n"
},
{
"from": "human",
"value": "# coding=utf-8\nimport re\nimport os\nimport sys\n\n# Regex for matching URLs\n# See https://mathiasbynens.be/demo/url-regex\nurl_regex = re.compile(r\"((https?|ftp)://(-\\.)?([^\\s/?\\.#-]+\\.?)+(/[^\... | python | chosen |
[
{
"from": "system",
"value": "Add exception to denote YAML environment configuration issues\n\nSigned-off-by: Maxime Petazzoni <0706025b2bbcec1ed8d64822f4eccd96314938d0@signalfuse.com>\n"
},
{
"from": "human",
"value": "# Copyright (C) 2013 SignalFuse, Inc.\n#\n# Docker container orchestration u... | python | chosen |
[
{
"from": "system",
"value": "Add blank to allow no stars/tags in admin\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.db import models\n\n\nclass HashTag(models.Model):\n # The hash tag length can't be more than the body length minus the `#`\n text = mode... | python | chosen |
[
{
"from": "system",
"value": "API: Change implementaton of polyfit method.\n\nUse new numpy.polynomial.polynomial.polyfit instead of implementing leastsquares by hand. This method is supposed to be more robust to numerical errors.\nWith this change, the keyword argument algorithm was removed.\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Comment out wemo stuff for now.\n"
},
{
"from": "human",
"value": "\"\"\"Wemo proxy code.\"\"\"\n\nimport logging\nimport sys\nimport threading\n\nfrom wemo import upnp\n\nclass Wemo(object):\n \"\"\"Hue proxy object.\"\"\"\n\n def __init__(self, refresh_period, c... | python | chosen |
[
{
"from": "system",
"value": "Remove categories from employee serializer\n"
},
{
"from": "human",
"value": "from .models import Employee\nfrom rest_framework import serializers\n\n\nclass EmployeeSerializer(serializers.ModelSerializer):\n class Meta:\n model = Employee\n depth =... | python | chosen |
[
{
"from": "system",
"value": "Add phjCollapseOnPatientID and remove phjGetCollapsedPatientDataframeColumns\n"
},
{
"from": "human",
"value": "# These are the functions that can be accessed from epydemiology.\r\n# Other functions that are used internally cannot be accessed\r\n# directly by end-us... | python | chosen |
[
{
"from": "system",
"value": "Automate Transfers: Paths stored as binary to handle encodings\n"
},
{
"from": "human",
"value": "import os\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy import Sequence\nfrom sqlalchemy import Column, Boolean, Integer, String, Text\nfrom sqlalchemy.ext.d... | python | chosen |
[
{
"from": "system",
"value": "add: Update to support sha1 & sha256 attributes\n"
},
{
"from": "human",
"value": "import json\nimport requests\n\nmisperrors = {'error': 'Error'}\nmispattributes = {'input': ['md5'], 'output': ['text']}\nmoduleinfo = {'version': '0.1', 'author': 'Alexandre Dulaunoy... | python | chosen |
[
{
"from": "system",
"value": "Put static folder on a subdomain if SERVER_NAME isn't None, not if debug is False\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.assets import Environment, Bundle\n\napp = Flask(__name__, static_folder=None)\napp.config.from_pyfile('confi... | python | chosen |
[
{
"from": "system",
"value": "Increment patch version to 0.8.6\n"
},
{
"from": "human",
"value": "\"\"\"yolk.\n\nAuthor: Rob Cakebread <cakebread at gmail>\n\nLicense : BSD\n\n\"\"\"\n\n__version__ = '0.8.5'\n"
},
{
"from": "gpt",
"value": "\"\"\"yolk.\n\nAuthor: Rob Cakebread <cake... | python | chosen |
[
{
"from": "system",
"value": "Add post categorized view urlconf\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\n\nfrom jmbo.urls import v1_api\nfrom jmbo.views import ObjectDetail\n\nfrom post.api import PostResource\n\n\nv1_api.register(PostResource())\n\... | python | chosen |
[
{
"from": "system",
"value": "Use id_sequence_to_embedding and only forward document\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\nfrom ..embedding import embeddings_to_embedding, ids_to_embeddings, embeddings\nfrom ..linear import linear\nfrom ..dropout import dropout\n\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Add side buttons, changing header label on click\n"
},
{
"from": "human",
"value": "import sys\nfrom Tkinter import *\n\nmainWindow = Tk()\n\nwindowWidth = 700\nwindowHeight = 600\nscreenXpos = (mainWindow.winfo_screenwidth() / 2) - (windowWidth / 2)\nscreenYpos = (... | python | chosen |
[
{
"from": "system",
"value": "Add arguments for interarrival and service rates.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\nimport argparse\nimport mm1\nimport sim\nimport time\n\n\n### Parse command line arguments\nparser = argparse.ArgumentParser(description=... | python | chosen |
[
{
"from": "system",
"value": "Use logger rather than raw print"
},
{
"from": "human",
"value": "from .. import config\n\nimport requests\nfrom requests.exceptions import *\nimport hashlib, random\n\ndef run(options):\n ip = options['ip']\n port = options['port']\n\n test = random.choice... | python | chosen |
[
{
"from": "system",
"value": "FIX: Update tests after major broker refactor.\n"
},
{
"from": "human",
"value": "import unittest\nfrom datetime import datetime\nimport numpy as np\nimport pandas as pd\nfrom ..sources import channelarchiver as ca\nfrom ..sources import switch\nfrom ..broker.simple... | python | chosen |
[
{
"from": "system",
"value": "Decrease the needed matplotlib to 1.3, to make it easier to get installed.\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\n\ndef inPython3():\n return os.environ.get(\"CHECK_PYTHON3\",\"0\") == \"1\"\n\ndef checkForMissingModules():\n missing = []... | python | chosen |
[
{
"from": "system",
"value": "Add tests for second protocol.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom address import has_reflection, is_compatible\n\n\nclass TestAddress(unittest.TestCase):\n def test_has_reflection(self):\n assert has_reflection(['mnop']) == False\n ... | python | chosen |
[
{
"from": "system",
"value": "Adjust test to new compiler versions\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\nimport json\nfrom os import path\n\nimport pytest\n\nfrom ethereum.tester import state, ABIContract\nfrom ethereum._solidity import get_solidity, compile_file\n\nSOLIDITY... | python | chosen |
[
{
"from": "system",
"value": "Change assert(False) to assert(True) to avoid having test fail no matter what\n"
},
{
"from": "human",
"value": "# __BEGIN_LICENSE__\n# Copyright (C) 2008-2010 United States Government as represented by\n# the Administrator of the National Aeronautics and Space Admi... | python | chosen |
[
{
"from": "system",
"value": "Remove the need to create an app in the stripe CLI\n"
},
{
"from": "human",
"value": "import logging\n\nimport click\nimport stripe\n\nfrom config import settings\nfrom catwatch.blueprints.billing.services import StripePlan\n\nfrom catwatch.app import create_app\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix prob with wooden board leftover.\n"
},
{
"from": "human",
"value": "import kivy.core.window\nimport pentai.db.zodb_dict as z_m\n\nfrom pentai.gui.screen import Screen\n\nclass GoodByeScreen(Screen):\n def __init__(self, *args, **kwargs):\n super(GoodBy... | python | chosen |
[
{
"from": "system",
"value": "Add a task for tailing the app's log on the emulator\n"
},
{
"from": "human",
"value": "import subprocess\n\nfrom paver.easy import *\n\n\ndef call(*args, **kwargs):\n return subprocess.call(args, **kwargs)\n\n\n@task\ndef push():\n \"\"\"Install the app and s... | python | chosen |
[
{
"from": "system",
"value": "Make urinorm tests runnable on their own\n"
},
{
"from": "human",
"value": "import os\nimport unittest\nimport openid.urinorm\n\nclass UrinormTest(unittest.TestCase):\n def __init__(self, desc, case, expected):\n unittest.TestCase.__init__(self)\n s... | python | chosen |
[
{
"from": "system",
"value": "Clean up after science test\n"
},
{
"from": "human",
"value": "\"\"\"\nScientific tests for SLCosmo package\n\"\"\"\nimport matplotlib\nmatplotlib.use('Agg')\nimport unittest\nimport desc.slcosmo\n\nclass SLCosmoScienceTestCase(unittest.TestCase):\n\n def setUp(s... | python | chosen |
[
{
"from": "system",
"value": "Add test for CubicTemplate to ensure proper labeling\n"
},
{
"from": "human",
"value": "import openpnm as op\nfrom skimage.morphology import ball, disk\n\n\nclass CubicTemplateTest:\n def setup_class(self):\n pass\n\n def teardown_class(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "style: Fix an old flake8 error\n"
},
{
"from": "human",
"value": "import os\n\nfrom frigg_settings.helpers import FileSystemWrapper\n\n\ndef path(*args):\n return os.path.join(os.path.dirname(os.path.dirname(__file__)), *args)\n\n\ndef test_filesystemwrapper_list... | python | chosen |
[
{
"from": "system",
"value": "Comment that physics is a tentative subpackage name\n"
},
{
"from": "human",
"value": "from .parameters import (Alfven_speed,\n ion_sound_speed,\n electron_thermal_speed,\n ion_thermal_speed,\n ... | python | chosen |
[
{
"from": "system",
"value": "Add support for server side authentication.\n\nChange-Id: Iff45fa00b5a5b389f998570827e33d9d232f5d1e\nReviewed-on: http://review.pozytywnie.pl:8080/5087\nReviewed-by: Tomasz Wysocki <f17c2dc043305c950a029074ababd304e0373387@gmail.com>\nTested-by: Tomasz Wysocki <f17c2dc043305c95... | python | chosen |
[
{
"from": "system",
"value": "Remove ability to instantiate with game.\n"
},
{
"from": "human",
"value": "from python_cowbull_game.GameController import GameController\nfrom python_cowbull_game.GameMode import GameMode\n\n\nclass ExtGameController(GameController):\n additional_modes = [\n# ... | python | chosen |
[
{
"from": "system",
"value": "Use stripped-down version of invoke test expect()\n"
},
{
"from": "human",
"value": "\"\"\"\nTests concerned with the ``fab`` tool & how it overrides Invoke defaults.\n\"\"\"\n\nimport re\nimport sys\n\nfrom spec import Spec, trap, assert_contains\n\nfrom fabric.mai... | python | chosen |
[
{
"from": "system",
"value": "Make preprocess testset argument accessible through API\n"
},
{
"from": "human",
"value": "from .io import preprocess\nfrom .train import train\nfrom .network import autoencoder\nfrom .encode import encode\n\n\ndef autoencode(count_matrix, kfold=None, dimreduce=True... | python | chosen |
[
{
"from": "system",
"value": "Make atcd depends on atc_thrift package implicitely\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Copyright (c) 2014, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE f... | python | chosen |
[
{
"from": "system",
"value": "Disable error-checking that assumes Python 3 for these Python 2 helpers\n"
},
{
"from": "human",
"value": "\"\"\"\nString/unicode helper functions\n\"\"\"\n\ndef safe_unicode(obj, *args):\n \"\"\" return the unicode representation of obj \"\"\"\n try:\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove index file created in test\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport unittest\nimport subprocess\n\nclass TestSimpleMapping(unittest.TestCase):\n def test_map_1_read(self):\n subprocess.run(['python', 'bin/sillymap', 'index', ... | python | chosen |
[
{
"from": "system",
"value": "Add test for more complex array initization case\n"
},
{
"from": "human",
"value": "from thinglang.thinglang import run\n\n\ndef test_simple_arrays():\n assert run(\"\"\"\nthing Program\n does start\n array names = [\"yotam\", \"andrew\", \"john\"]\n ... | python | chosen |
[
{
"from": "system",
"value": "Set develop version to 1.4-dev after tagging 1.3\n"
},
{
"from": "human",
"value": "__version_info__ = (1, 3, 0, None)\n\n# Dot-connect all but the last. Last is dash-connected if not None.\n__version__ = '.'.join(str(i) for i in __version_info__[:-1])\nif __version... | python | chosen |
[
{
"from": "system",
"value": "Update tags for new syntax\n"
},
{
"from": "human",
"value": "from .utils import TemplateTestCase, Mock\n\n\nclass BlockTagTest(TemplateTestCase):\n\n def test_block_parse(self):\n self.assertRendered('{% block name %}%{% endblock %}', '%')\n\n\nclass ForT... | python | chosen |
[
{
"from": "system",
"value": "Fix test case to be more explicit\n"
},
{
"from": "human",
"value": "from unittest.mock import MagicMock, patch\n\nimport pytest\nfrom hypothesis_auto import auto_pytest_magic\n\nimport isort.format\n\nauto_pytest_magic(isort.format.show_unified_diff)\n\n\ndef test_... | python | chosen |
[
{
"from": "system",
"value": "Use subject for test settings\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom mamba import describe, context, before\nfrom sure import expect\n\nfrom mamba.settings import Settings\n\nIRRELEVANT_SLOW_TEST_THRESHOLD = '0.1'\n\n\nwith describe('Sett... | python | chosen |
[
{
"from": "system",
"value": "Add a test to check that authentication using the token directly works\n"
},
{
"from": "human",
"value": "def test_info(logged_rocket):\n info = logged_rocket.info().json()\n assert \"info\" in info\n assert info.get(\"success\")\n\n\ndef test_statistics(lo... | python | chosen |
[
{
"from": "system",
"value": "Add test on render method\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.test import TestCase\n\nfrom localized_fields.value import LocalizedValue\nfrom localized_fields.widgets import LocalizedFieldWidget\n\n\nclass LocalizedFieldW... | python | chosen |
[
{
"from": "system",
"value": "Fix two left over renames\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nimport django\n\nfrom django.conf import settings\n\n\nDEFAULT_SETTINGS = dict(\n INSTALLED_APPS=[\n \"django.contrib.auth\",\n \"django.con... | python | chosen |
[
{
"from": "system",
"value": "Fix test runner for trunk\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nfrom os.path import abspath, dirname\n\nimport django\nfrom django.conf import settings\n\n\nsys.path.insert(0, abspath(dirname(__file__)))\n\n\nif not settings.configure... | python | chosen |
[
{
"from": "system",
"value": "Print the Jedi version when REPL completion is used\n\nThis also makes debugging easier, because people see which completion\nthey're actually using.\n"
},
{
"from": "human",
"value": "\"\"\"\nTo use Jedi completion in Python interpreter, add the following in your s... | python | chosen |
[
{
"from": "system",
"value": "Hide yet-to-be-activated usernames from listings\n"
},
{
"from": "human",
"value": "#\n# Copyright (c) 2005 rpath, Inc.\n#\n# All Rights Reserved\n#\n\n(\n USERNAME_ASC,\n USERNAME_DES,\n FULLNAME_ASC,\n FULLNAME_DES,\n CREATED_ASC,\n CREATED_DES,\... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in pore centroid\n"
},
{
"from": "human",
"value": "r\"\"\"\n===============================================================================\npore_centroid\n===============================================================================\n\n\"\"\"\nimport sci... | python | chosen |
[
{
"from": "system",
"value": "Call django.setup() for Django >= 1.7.0"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\n\nfrom django.conf import settings\n\n\nif not settings.configured:\n settings.configure(\n DATABASES={\n 'default': {\n '... | python | chosen |
[
{
"from": "system",
"value": "Return exit code indicating failure\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport unittest\n\nfrom os.path import dirname, abspath\n\nimport tests\n\ndef runtests(*test_args):\n suite = unittest.TestLoader().loadTestsFromModule(test... | python | chosen |
[
{
"from": "system",
"value": "Fix failing attempt to set ACL\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport sys\nimport boto3\n\ns3 = boto3.resource('s3')\nobject = s3.Bucket('ictrp-data').upload_file(sys.argv[1], sys.argv[1])\nobject.Acl().put(ACL='public-read')\n"
},
{
"f... | python | chosen |
[
{
"from": "system",
"value": "Rename the library sessions instead of Sessions\n"
},
{
"from": "human",
"value": "# Copyright 2014 Donald Stufft\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may o... | python | chosen |
[
{
"from": "system",
"value": "Fix FieldsEnabled function & add 'enabled' argument"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n## \\package globals.fieldtests\n\n# MIT licensing\n# See: LICENSE.txt\n\n\nimport wx\n\n\n## Tests if a wx control/instance is enabled/disabled\n# \n# ... | python | chosen |
[
{
"from": "system",
"value": "Add the most basic smoke test. We make a check that the resulting object is a minimal component at least.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport unittest\n\nimport sys; sys.path.append(\"../\")\nfrom Selector import Selector\n\nif __name__==\... | python | chosen |
[
{
"from": "system",
"value": "Use of product.template instead of product.product in bundle line\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nfrom openerp import fields, models, _\n\nimport openerp.addons.decimal_precision as dp\n\n\nclass product_bundle(models.Model):\n _name... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary imports from main"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n'''\nMain driver of the program\n'''\nimport sys\nimport random\nimport os\nimport json\nimport argparse\nimport time\nimport getpass\nimport hashlib... | python | chosen |
[
{
"from": "system",
"value": "Fix example of shutting down a client.\n\nFix #1261.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport asyncio\nimport signal\nimport websockets\n\nasync def client():\n uri = \"ws://localhost:8765\"\n async with websockets.connect(uri) as web... | python | chosen |
[
{
"from": "system",
"value": "Add API to change password\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\nfrom flask import g, jsonify\nfrom gather.account.models import Account\nfrom gather.api import need_auth, EXCLUDE_COLUMNS\nfrom gather.extensions import api_manager\n\n\n__all__... | python | chosen |
[
{
"from": "system",
"value": "Remove extra support for 1000 classes as no longer needed\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom __future__ import absolute_import\nfrom keras.applications.imagenet_utils import decode_predictions\nfrom keras.preprocessing imp... | python | chosen |
[
{
"from": "system",
"value": "Remove unused sys import from conf tests\n"
},
{
"from": "human",
"value": "import sys\nfrom unittest import mock\n\nimport pytest\n\nfrom bottery.conf import Settings\n\n\n@pytest.fixture\ndef mocked_settings():\n settings = mock.MagicMock()\n sys.modules['se... | python | chosen |
[
{
"from": "system",
"value": "Terminate app if handler throws exception.\n"
},
{
"from": "human",
"value": "from ofp_app import ofp_app, ofp_run\nimport asyncio\n\n\napp = ofp_app('conntest')\n\n\n@app.event('start')\nasync def start(_):\n while True:\n await asyncio.sleep(1)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add some tests for stringport\n"
},
{
"from": "human",
"value": "\"\"\"\nUnittests for opal.utils\n\"\"\"\nfrom django.test import TestCase\nfrom django.db.models import ForeignKey, CharField\n\nfrom opal import utils\n\nclass StringportTestCase(TestCase):\n\n de... | python | chosen |
[
{
"from": "system",
"value": "Change the field type of amount and balance to DecimalField\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Category(models.Model):\n name = models.CharField(max_length=50)\n number = models.CharField(max_length=50, unique=True)\n \... | python | chosen |
[
{
"from": "system",
"value": "Remove print and increase speed\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom rgbmatrix import RGBMatrix\nfrom random import randint\nimport time\n\nrows = 16\nchains = 1\nparallel = 1\nledMatrix = RGBMatrix(rows, chains, parallel)\nheight = ledMatr... | python | chosen |
[
{
"from": "system",
"value": "Fix for use in virtualenv\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nimport sys\nimport window\nfrom PyQt5.QtWidgets import QApplication\n\n\ndef main():\n startGUI()\n\n\ndef startGUI():\n app = QApplication(sys.argv)\n ex = window.MainWindow... | python | chosen |
[
{
"from": "system",
"value": "Fix broken test on Python 3.3\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2013 Mark Lee\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You ... | python | chosen |
[
{
"from": "system",
"value": "Change path for the module ClusterEvaluation\n"
},
{
"from": "human",
"value": "from pygraphc.clustering.ClusterDistance import *\nfrom pygraphc.clustering.ClusterEvaluation import *\nfrom pygraphc.clustering.ClusterUtility import *\nfrom pygraphc.clustering.Connect... | python | chosen |
[
{
"from": "system",
"value": "Clean up now that we're no longer trying to use CSV_URL.\n"
},
{
"from": "human",
"value": "import os\ntry:\n from urllib.parse import urljoin\n from urllib.request import urlopen\nexcept:\n # for Python 2.7 compatibility\n from urlparse import urljoin\n... | python | chosen |
[
{
"from": "system",
"value": "Add more unit tests for InfrequentValueEncoder\n"
},
{
"from": "human",
"value": "# pylint: disable=missing-docstring, invalid-name, import-error\nimport pandas as pd\n\nfrom mltils.encoders import InfrequentValueEncoder\n\n\ndef test_infrequent_value_encoder_1():\n... | python | chosen |
[
{
"from": "system",
"value": "Use potential true app ID for D2\n"
},
{
"from": "human",
"value": "\"\"\"\nModule for reading DOTA 2 data using the Steam API\n\nCopyright (c) 2010, Anthony Garcia <lagg@lavabit.com>\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpo... | python | chosen |
[
{
"from": "system",
"value": "Add documentation string for cosntants module\n"
},
{
"from": "human",
"value": "# Coefficients for polynomial fit to bolometric correction - color relation\ncoeff_BminusV = [-0.823, 5.027, -13.409, 20.133, -18.096, 9.084, -1.950]\ncoeff_VminusI = [-1.355, 6.262, -2... | python | chosen |
[
{
"from": "system",
"value": "Create 1 temp directory if no number is given\n"
},
{
"from": "human",
"value": "import functools\nimport tempfile\nimport shutil\n\nclass makedirs(object):\n def __init__(self, num):\n self._num = num\n\n def __call__(self, fn):\n @functools.wra... | python | chosen |
[
{
"from": "system",
"value": "Add features :\n- Restart software in case of accidental unplug-replug\n- Minor bug fixes\n"
},
{
"from": "human",
"value": "__author__ = 'adrie_000'\n\n\np = bytes('HELLO')\nquit('FINISHED')\nprint 'pHELLO'\n"
},
{
"from": "gpt",
"value": "__author__ = ... | python | chosen |
[
{
"from": "system",
"value": "Add init tests to CI.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n########################################################################\n# SimpleFIX\n# Copyright (C) 2016, David Arnold.\n#\n# Permission is hereby granted, free of charge, to any per... | python | chosen |
[
{
"from": "system",
"value": "Add Redis client from flask-redis\n"
},
{
"from": "human",
"value": "import sys\nfrom flask import Flask\nfrom .config import config\n\nfrom .api import api_bp\n\n__project__ = 'cf-predict'\n__version__ = '0.0.0'\n\nVERSION = \"{0} v{1}\".format(__project__, __versi... | python | chosen |
[
{
"from": "system",
"value": "Add some needed IRC numerics\n"
},
{
"from": "human",
"value": "IRC_numeric_to_name = {\"001\": \"RPL_WELCOME\", \"372\": \"RPL_MOTD\", \"375\": \"RPL_MOTDSTART\", \"376\": \"RPL_ENDOFMOTD\", \"433\": \"ERR_NICKNAMEINUSE\"}\nCTCP_DELIMITER = chr(1)"
},
{
"fr... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.