conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update importing of prob dists\n\nImport the newly created fixed variance probability dist into\n__init__.py for easier use outside of module.\n"
},
{
"from": "human",
"value": "\"\"\"\nPython Bayesian hierarchical clustering (PyBHC).\nHeller, K. A., & Ghahramani, Z... | python | chosen |
[
{
"from": "system",
"value": "Fix import for python 3\n"
},
{
"from": "human",
"value": "import pyOmicron\nimport STS\n\n__all__=[\"pyOmicron\",\"STS\"]\n__version__ = 0.1\n"
},
{
"from": "gpt",
"value": "import pyOmicron\ntry:\n\timport STS\nexcept:\n\timport pyOmicron.STS\n\n__all_... | python | chosen |
[
{
"from": "system",
"value": "Add the pool_recycle setting to enable connection pooling features for the sql engine. The setting is hard-coded to 3600 seconds (one hour) per the recommendation provided on sqlalchemy's site"
},
{
"from": "human",
"value": "# vim: tabstop=4 shiftwidth=4 softtabst... | python | chosen |
[
{
"from": "system",
"value": "Use json for task serialization\n"
},
{
"from": "human",
"value": "from datetime import timedelta\n\nfrom private import CELERY_BROKER_URL, CELERY_RESULT_BACKEND\n\nBROKER_URL = CELERY_BROKER_URL\nCELERY_RESULT_BACKEND = CELERY_RESULT_BACKEND\n\nCELERY_TIMEZONE = 'U... | python | chosen |
[
{
"from": "system",
"value": "Update bulk image generation command\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nimport easy_thumbnails\nfrom mediaman.models import ArtefactRepresentation\nimport os\n\n\nclass Command(BaseCommand):\n help = \"Generate... | python | chosen |
[
{
"from": "system",
"value": "Fix only one file at a time.\n"
},
{
"from": "human",
"value": "import os\nfrom nipype.interfaces.base import (BaseInterface, BaseInterfaceInputSpec, traits,\n InputMultiPath, File, Directory, TraitedSpec)\nfrom qipipe.staging.fix_dicom import fix_dicom_headers\n... | python | chosen |
[
{
"from": "system",
"value": "Add more greetings to the needs-multilining regex"
},
{
"from": "human",
"value": "from IRCMessage import IRCMessage\r\nfrom IRCResponse import IRCResponse, ResponseType\r\nfrom Function import Function\r\nfrom GlobalVars import *\r\n\r\nimport re\r\n\r\nclass Insta... | python | chosen |
[
{
"from": "system",
"value": "Add check_same_thread argument to make_db_engine_component\n"
},
{
"from": "human",
"value": "\"\"\"Template of DbEngineComponent.\"\"\"\n\n__all__ = [\n 'make_db_engine_component',\n]\n\nimport logging\n\nimport garage.sql.sqlite\nfrom garage import components\n... | python | chosen |
[
{
"from": "system",
"value": "Update test to not use a db model\n"
},
{
"from": "human",
"value": "\"\"\"accounts app unittests\n\n\"\"\"\nfrom django.test import TestCase\nfrom django.contrib.auth import get_user_model\n\nfrom accounts.models import LoginToken\n\n\nTEST_EMAIL = 'newvisitor@exam... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings to unit test\n"
},
{
"from": "human",
"value": "\"\"\"accounts app unittests\n\n\"\"\"\nfrom django.test import TestCase\n\n\nclass WelcomePageTest(TestCase):\n def test_uses_welcome_template(self):\n response = self.client.get('/')\n ... | python | chosen |
[
{
"from": "system",
"value": "Set version number to 0.4.0.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(name='slacker',\n version='0.3.9',\n packages=['slacker'],\n description='Slack API client',\n author='Oktay Sancak',\n author_email='okt... | python | chosen |
[
{
"from": "system",
"value": "Mark requirement for python 3.6\n"
},
{
"from": "human",
"value": "try:\n from setuptools import setup\n from setuptools import find_packages\n packages = find_packages()\nexcept ImportError:\n from distutils.core import setup\n import os\n package... | python | chosen |
[
{
"from": "system",
"value": "Fix url to point to repository.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name = \"ideone\",\n version = \"0.0.1\",\n au... | python | chosen |
[
{
"from": "system",
"value": "Bump version for new build\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\ntry:\n import pypandoc\n long_description = pypandoc.convert('README.md', 'rst')\nexcept(IOError, ImportError):\n long_description = open('README.md').read()\n\nse... | python | chosen |
[
{
"from": "system",
"value": "Update minimum python versioning checks\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom os import path\nimport sys\n\nif sys.version_info < (3, 4):\n sys.exit('DataJoint is only supported on Python 3.4 o... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with path variable\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup\n\nPACKAGE_VERSION = '0.3'\n\n\ndef version():\n def version_file(mode='r'):\n return open(os.path.dirname(os.path.abspath(__file__), 'version.txt'), ... | python | chosen |
[
{
"from": "system",
"value": "Set the version from gocd_cli instead of gocd\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\nimport sys\nfrom setuptools import setup, find_packages\nfrom setuptools.command.test import test as TestCommand\n\n\nclass PyTest(Test... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with building the wheel\n\nThe build trips on an empty string requirement, throwing:\n```\n$ python setup.py sdist bdist_wheel\n...\nValueError: ('No requirements found', '')\n```\n"
},
{
"from": "human",
"value": "import sys\n\nfrom setuptools import setu... | python | chosen |
[
{
"from": "system",
"value": "Add APISections to the python package\n"
},
{
"from": "human",
"value": "# -*-coding:utf-8-*-\n\nfrom setuptools import setup\n\nsetup(\n name=\"rocketchat_API\",\n version=\"1.12.0\",\n packages=[\"rocketchat_API\", \"rocketchat_API.APIExceptions\"],\n ... | python | chosen |
[
{
"from": "system",
"value": "Tweak for building with cython\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Distutils import build_ext\n\nsetup(\n\tname = \"DragonCreole\",\n\tpackages = [\"dragoncreole\"],\n\tversion =... | python | chosen |
[
{
"from": "system",
"value": "Add requests module in the dependencies\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nexec([l for l in open(\"flask_mwoauth/__init__.py\") if l.startswith('__version__')][0])\n\nsetup(name='flask-mwoauth',\n version=__version__,\n desc... | python | chosen |
[
{
"from": "system",
"value": "Convert Python installation to PyPi\n\nThis does mean python-pip or similar will need to be installed on the\nsystem.\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(name='steamfootbridge',\n version='0.0.1',\n packages=['steam... | python | chosen |
[
{
"from": "system",
"value": "Add the Python version and license classifiers\n\nSigned-off-by: Tomas Sedovic <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@sedovic.cz>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\n\nimport distutils.core\nimport sys\n\ntry:\n import setuptoo... | python | chosen |
[
{
"from": "system",
"value": "Use packaging instead of a module"
},
{
"from": "human",
"value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nrequires = [\n 'requests',\n 'rauth'\n]\n\nsetup(\n name='fatsecret',\n version='0.2.1... | python | chosen |
[
{
"from": "system",
"value": "Change name taken in pypi\n"
},
{
"from": "human",
"value": "from setuptools import setup\nfrom util import __version__\n\nsetup(\n name=\"util\",\n author=\"Olav Vahtras\",\n author_email=\"olav.vahtras@gmail.com\",\n version=__version__,\n url=\"htt... | python | chosen |
[
{
"from": "system",
"value": "Fix a stupid mistake in an installer.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(name = 'pymoira',\n version = '0.9',\n description = 'Client library for MIT Moira service managment system protocol... | python | chosen |
[
{
"from": "system",
"value": "Feature: Add test for already registered user\n"
},
{
"from": "human",
"value": "import shutil\nimport pytest\n\nimport hug\n\nfrom overtime_calculator.src import api\nfrom overtime_calculator.src.auth import get_user_folder\n\n\ndef test_register():\n user_name ... | python | chosen |
[
{
"from": "system",
"value": "Split one test into two tests\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom evesp.event import Event\n\nclass TestEvent(unittest.TestCase):\n def setUp(self):\n self.evt = Event(foo='bar')\n\n def test_event_creation(self):\n self.as... | python | chosen |
[
{
"from": "system",
"value": "Add test for loading all torque and drag data\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for foamPy.\n\"\"\"\n\nfrom .core import *\nfrom .dictionaries import *\nfrom .types import *\nfrom .foil import *\n"
},
{
"from": "gpt",
"value": "\"\"\"Tests... | python | chosen |
[
{
"from": "system",
"value": "Remove deprecated import of hompgraphy\n"
},
{
"from": "human",
"value": "from .hough_transform import *\nfrom .radon_transform import *\nfrom .finite_radon_transform import *\nfrom .integral import *\nfrom ._geometric import (warp, warp_coords, estimate_transform,\... | python | chosen |
[
{
"from": "system",
"value": "Make cargs and gargs truly optional\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\n\ndef load_variables_from_env(prefix=\"XII_INTEGRATION_\"):\n length = len(prefix)\n vars = {}\n\n for var in filter(lambda x: x.startswith(prefix), os.en... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect import reference to nw_similarity\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom similarity.nw_similarity import NWAlgorithm\n\n\nclass Test(unittest.TestCase):\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove '?_popup' from toolbar urls\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.core.urlresolvers import reverse\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom cms.toolbar_pool import toolbar_pool\nfrom cms.toolbar_base i... | python | chosen |
[
{
"from": "system",
"value": "Fix lint errors in tests\n"
},
{
"from": "human",
"value": "import os\n\nimport testinfra.utils.ansible_runner\n\ntestinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(\n os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')\n\n\ndef test_hosts_file(ho... | python | chosen |
[
{
"from": "system",
"value": "Make API read-only and publically available.\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom tastypie.resources import ModelResource\nfrom tastypie import fields\nfrom tastypie.authentication import BasicAuthentication\nfrom tast... | python | chosen |
[
{
"from": "system",
"value": "Update comment to reflect switch to unparse.py\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# php2python.py - Converts PHP to Python using codegen.py\n# Usage: php2python.py < input.php > output.py\n\nimport sys\nsys.path.append('..')\n\nfrom phply.ph... | python | chosen |
[
{
"from": "system",
"value": "Refactor West Berks to use new BaseShpShpImporter\n"
},
{
"from": "human",
"value": "\"\"\"\nImport Wokingham Polling stations\n\"\"\"\n\nfrom data_collection.management.commands import BaseShpImporter, import_polling_station_shapefiles\n\nclass Command(BaseShpImpor... | python | chosen |
[
{
"from": "system",
"value": "Implement HTTPTokenAuth\nStore user data in global\n"
},
{
"from": "human",
"value": "from re import search\nfrom flask import g\nfrom flask_restplus import abort\nfrom flask_httpauth import HTTPBasicAuth\nfrom app.models.user import User\nfrom instance.config impor... | python | chosen |
[
{
"from": "system",
"value": "Remove trailing slash from template url\n"
},
{
"from": "human",
"value": "from flask import Blueprint\nfrom flask import (jsonify)\nfrom sqlalchemy.exc import DataError\nfrom sqlalchemy.orm.exc import NoResultFound\n\nfrom app.dao.templates_dao import get_model_tem... | python | chosen |
[
{
"from": "system",
"value": "Allow underscores in meeting endpoints\n\nSee https://www.flowdock.com/app/cos/osf-dev/threads/oX7kE29lhFd8quQWt-hbFpyVriH\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django.conf.urls import url\n\nfrom admin.meetings import vie... | python | chosen |
[
{
"from": "system",
"value": "Add fields to the game display in Admin\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import Game, Framework, Release, Asset\n\n\nclass GameAdmin(admin.ModelAdmin):\n pass\n\n\nclass FrameworkAdmin(admin.ModelAdmin):\n pas... | python | chosen |
[
{
"from": "system",
"value": "ADD comment for python file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport sys\n\nfrom bs4 import BeautifulSoup\nfrom requests import get, codes\n\n\ndef match_soup_class(target, mode='class'):\n def do_match(tag):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add titles to columns and use write instead of print\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nfrom django.core.management.base import BaseCommand\n\nfrom django.apps import apps\n# from reversion import revisions as reversion\nfrom reversion.m... | python | chosen |
[
{
"from": "system",
"value": "fix: Use more concise error message for VPCs\n\nSee also: PSOBAT-1197\n"
},
{
"from": "human",
"value": "\"\"\"Get VPC ID.\"\"\"\nimport logging\n\nimport requests\n\nfrom ..consts import API_URL\nfrom ..exceptions import SpinnakerVPCIDNotFound, SpinnakerVPCNotFound... | python | chosen |
[
{
"from": "system",
"value": "Add skip invalid to debug\n"
},
{
"from": "human",
"value": "from .atflex import AtfLexer\nfrom .atfyacc import AtfParser\nfrom mako.template import Template\n\n\nclass AtfFile(object):\n\n template = Template(\"${text.serialize()}\")\n\n def __init__(self, co... | python | chosen |
[
{
"from": "system",
"value": "Add configuration options for randomness\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\nimport random\nfrom . import config\n\ndef sampler(source):\n def reshuffle():\n copy = list(source)\n random.shuffle(copy)\n return copy\n\n st... | python | chosen |
[
{
"from": "system",
"value": "Remove temp var allocation code.\n"
},
{
"from": "human",
"value": "class Scope(object):\n tmp_index = 0\n\n def __init__(self, parent=None):\n self.parent = parent\n self.prefix = []\n self.declarations = {}\n self.globals = set()\... | python | chosen |
[
{
"from": "system",
"value": "Disable csrf checks for voting\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\n# for voting\nfrom voting.views import vote_on_object\nfrom bookmarks.models import Bookmark\n\nurlpatterns = patterns('',\n url(r'^$', 'bookmarks.view... | python | chosen |
[
{
"from": "system",
"value": "Remove `return`, get Ziggs instead of Renekton, since we're saving as Ziggs\n"
},
{
"from": "human",
"value": "import cassiopeia as cass\nfrom cassiopeia.core import Champion\n\ndef test_cass():\n #annie = Champion(name=\"Annie\", region=\"NA\")\n annie = Cham... | python | chosen |
[
{
"from": "system",
"value": "Update support to Django 1.9\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.conf.urls import patterns, url\n\nurlpatterns = patterns(\n 'darchan.views',\n url(r'^view_matrix/$', 'v_view_last_mat... | python | chosen |
[
{
"from": "system",
"value": "Set frame only when using 2D\n"
},
{
"from": "human",
"value": "from poliastro.bodies import (\n Earth,\n Jupiter,\n Mars,\n Mercury,\n Neptune,\n Saturn,\n Uranus,\n Venus,\n)\nfrom poliastro.plotting.core import OrbitPlotter2D, OrbitPlotter... | python | chosen |
[
{
"from": "system",
"value": "Allow empty strings as instructions\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom experiment_session.models import ExperimentSession\nfrom django.core.validators import MinValueValidator\n\n\nclass Experiment(models.Model):\n LIGHTOFF_FIXE... | python | chosen |
[
{
"from": "system",
"value": "Add data_transfer to price breakdown\n"
},
{
"from": "human",
"value": "import six\n\nfrom sevenbridges.meta.resource import Resource\nfrom sevenbridges.meta.fields import StringField\n\n\nclass Breakdown(Resource):\n \"\"\"\n Breakdown resource contains price... | python | chosen |
[
{
"from": "system",
"value": "Update the version to 1.5.0 to prepare for next release\n\nUpdate the _pkg_meta version to 1.5.0 to prepare for the next release.\n"
},
{
"from": "human",
"value": "version_info = (1, 4, 0)\nversion = '.'.join(map(str, version_info))\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Change conditional for macos pyobjc usage\n\nmacOS 11.x will occasionally identify as 10.16, since there was no real\nreason to prevent on all supported platforms allow.\n"
},
{
"from": "human",
"value": "# Copyright 2017 Virgil Dupras\n\n# This software is licensed... | python | chosen |
[
{
"from": "system",
"value": "Remove all traces of the news module\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\n\n\n__version__ = '0.1.5'\n\n\ndef create_app(name=__name__):\n app = Flask(name)\n app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['DB_URI']\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update scripts to reflect new MOOSE_DIR definition\n\nr25009\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys, os\n\n# get the location of this script\napp_path = os.path.abspath(os.path.dirname(sys.argv[0]))\n# this script is actually in the scr... | python | chosen |
[
{
"from": "system",
"value": "Improve our custom test case\n\n- create a make_prep method that allows quick creation of prep section from anything for good testing of custom transformers (that usually don't transform header section)\n- improve get_pattern_for_spec with section checking\n"
},
{
"from... | python | chosen |
[
{
"from": "system",
"value": "Reconnect if the connection times out.\n"
},
{
"from": "human",
"value": "\nclass Database:\n def __init__(self, db):\n self.db = db\n self.cursor = db.cursor()\n\n def disconnect(self):\n self.cursor.close()\n self.db.close()\n\n ... | python | chosen |
[
{
"from": "system",
"value": "PEP8: Replace star imports with explicit imports\n"
},
{
"from": "human",
"value": "from .conditions import *\nfrom .exceptions import *\nfrom .fields import *\nfrom .lists import *\nfrom .types import *\n"
},
{
"from": "gpt",
"value": "from .conditions ... | python | chosen |
[
{
"from": "system",
"value": "Fix error messages in get_fans\n"
},
{
"from": "human",
"value": "import typing as tp # NOQA\n\nfrom chainer import types # NOQA\nfrom chainer import utils\n\n\nclass Initializer(object):\n \"\"\"Initializes array.\n\n It initializes the given array.\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Switch to tuple for pref set data key list\n"
},
{
"from": "human",
"value": "# yvs.set_pref\n# coding=utf-8\n\nfrom __future__ import unicode_literals\n\nimport json\nimport sys\n\nimport yvs.shared as shared\n\n\n# Parse pref set data from the given JSON string\nd... | python | chosen |
[
{
"from": "system",
"value": "Fix Access-Control-Allow-Origin to return the request origin\n\nrequest.host is the host part of the request url. For example, if\nwebview is trying to access http://localhost:8080/users/profile,\nrequest. It's the Origin field in the headers that we should be\nmatching.\n"
... | python | chosen |
[
{
"from": "system",
"value": "Add all missing French translation strings\nWikia revision: 4190\n"
},
{
"from": "human",
"value": "ELECTRUM_VERSION = \"1.9.3\" # version of the client package\nPROTOCOL_VERSION = '0.6' # protocol version requested\nSEED_VERSION = 6 # bump this every... | python | chosen |
[
{
"from": "system",
"value": "Index the URL of the WidgyPage.\n\nThis way, you don't have to fetch the page object when you want to put a\nlink in the search results.\n"
},
{
"from": "human",
"value": "from haystack import indexes\n\nfrom widgy.contrib.widgy_mezzanine import get_widgypage_model\... | python | chosen |
[
{
"from": "system",
"value": "Clean up poll for init complete script\n"
},
{
"from": "human",
"value": "import sys\nimport time\n\nfrom infrastructure.models import Server\nfrom jobs.models import Job\n\nTIMEOUT = 600\n\n\ndef is_reachable(server):\n \"\"\"\n :type server: Server\n \"\"... | python | chosen |
[
{
"from": "system",
"value": "fix: Raise KeyErrors for missing data in redis\n"
},
{
"from": "human",
"value": "import json\nimport redis\n\n\nclass Database(object):\n def __init__(self):\n self.redis = redis.StrictRedis(host='redis', port=6379, db=0)\n\n def set_data_of_server_cha... | python | chosen |
[
{
"from": "system",
"value": "Make it possible to turn off admin JS\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.db import models\n\nfrom . import widgets\n\nRICH_TEXT_DBFIELD_OVERRIDES = {\n models.TextField: {'widget': widgets.RichTextWidget},\n}\n\n\nclass Backb... | python | chosen |
[
{
"from": "system",
"value": "Move _hal_regex to class scope.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\nimport json\nimport re\n\nfrom .resource import Resource\n\nclass Response(Resource):\n\n \"\"\"Represents an HTTP response that is hopefully a HAL docu... | python | chosen |
[
{
"from": "system",
"value": "Add logging messages to data ingestion tool\n"
},
{
"from": "human",
"value": "from etl import get_local_handles, ingest_feeds, CSV_ETL_CLASSES\nfrom local import LocalConfig\nfrom interface import Marcotti\n\n\nif __name__ == \"__main__\":\n settings = LocalConf... | python | chosen |
[
{
"from": "system",
"value": "Add error handling to reduce dependency on pypi\n"
},
{
"from": "human",
"value": "import xmlrpclib\nfrom socket import gaierror\n\nVERSION_OK = \"0.5.13\"\n\ntry:\n pypi = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')\n VERSION_OK = pypi.package_relea... | python | chosen |
[
{
"from": "system",
"value": "Store settings with the OrderedDict\n"
},
{
"from": "human",
"value": "class Settings(object):\n def __init__(self):\n self._settings = {}\n\n def __setattr__(self, name, value):\n if name.startswith('_'):\n super(Settings, self).__set... | python | chosen |
[
{
"from": "system",
"value": "Use relative path for deployer.rb\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport ConfigParser\n__author__ = 'alforbes'\n\nconfig = ConfigParser.ConfigParser()\n\nconfig.add_section('main')\nconfig.set('main', 'debug_mode', 'false')\... | python | chosen |
[
{
"from": "system",
"value": "Add the possibility of testing SMTP from the command-line.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.core.management.base import BaseCommand\nfrom django.core.urlresolvers import reverse\n\nfrom ...auth import EmailTokenAuthBackend\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Return the order details URL from email body.\n\nThere is currently no Agile API method that will return the order\ndetails for an activity so the URL from the email must be used in\nconjunction with a web scraper to get the relevant details.\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Remove extra label for user\n"
},
{
"from": "human",
"value": "import logging, urllib2\nfrom lighter.util import merge, build_request\n\nclass HipChat(object):\n def __init__(self, url, token):\n self._url = url or 'https://api.hipchat.com'\n self._... | python | chosen |
[
{
"from": "system",
"value": "Allow test discovery on Py26 with unittest2\n"
},
{
"from": "human",
"value": "\"\"\"\nSimple auto test discovery.\n\nFrom http://stackoverflow.com/a/17004409\n\"\"\"\nimport os\nimport sys\nimport unittest\n\ndef additional_tests():\n setup_file = sys.modules['_... | python | chosen |
[
{
"from": "system",
"value": "Reorder redeploy tests within a single module\n\nThe original code for on_redeploy was making the\nassumption that there was only one integration test file.\nWhen test_package.py was added, the tests always failed\nbecause the redeploy tests were run *after* the package tests\n... | python | chosen |
[
{
"from": "system",
"value": "Set up reading lines from file, print count for testing purposes\n"
},
{
"from": "human",
"value": "import sqlite3 as sql\nimport os\nimport sys\nimport logging\nimport benchmark\n\n# bmVerify(['final_r7', 'final_r8'], filepath=\"/home/ysun/disambig/newcode/all/\",... | python | chosen |
[
{
"from": "system",
"value": "Make all changes to app/ run on all trybot platforms, not just the big three.\nAnyone who's changing a header here may break the chromeos build.\n\nBUG=none\nTEST=none\n\nReview URL: http://codereview.chromium.org/2838027\n\ngit-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@... | python | chosen |
[
{
"from": "system",
"value": "Remove param check for backup type on v2.1 API\n\nThe backup type is only used by glance, so nova check it make\nno sense; currently we have daily and weekly as only valid param\nbut someone may add 'monthly' as param. nova should allow it\nand delegate the error. This patch re... | python | chosen |
[
{
"from": "system",
"value": "Add method appendModel on api BaseHandler\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.http import HttpResponse\nfrom django.contrib.auth import authenticate\n\nfrom piston.handler import BaseHandler as Handler\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Fix the tests by mocking the response\n"
},
{
"from": "human",
"value": "from talks.settings import *\n\nINSTALLED_APPS += ('django_nose',)\nTEST_RUNNER = 'django_nose.NoseTestSuiteRunner'\nDEBUG = True\n\nRAVEN_CONFIG = {}\n\nDATABASES = {\n 'default': {\n ... | python | chosen |
[
{
"from": "system",
"value": "Use safer condition for survey start notification\n"
},
{
"from": "human",
"value": "# This file is part of Indico.\n# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).\n#\n# Indico is free software; you can redistribute it and/or\n# modif... | python | chosen |
[
{
"from": "system",
"value": "Fix test_email_url() after changes to email templating for sharing emails\n"
},
{
"from": "human",
"value": "import urlparse\n\nfrom django.test import TestCase, override_settings\nfrom mock import patch, Mock\n\nfrom opendebates.context_processors import global_var... | python | chosen |
[
{
"from": "system",
"value": "Remove some functions from exported model API that are not used outside model layer\n\n- Just some refactoring to trim down the number of things exported that aren't\n necessary at this time.\n"
},
{
"from": "human",
"value": "\"\"\"\nPublic model API\n\"\"\"\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Make it compatible with Python 3.5+\n\nRemove unnecessary usage of f-strings."
},
{
"from": "human",
"value": "from collections import Counter\n\nhands = [line.split(' ') for line in open('p054_poker.txt')]\n\nvalues = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7... | python | chosen |
[
{
"from": "system",
"value": "Use the provided mongo db rather than mongomock\n"
},
{
"from": "human",
"value": "import random\n\nfrom dmp import dmp\n\nusers = [\"adam\", \"ben\", \"chris\", \"denis\", \"eric\"]\nfile_types = [\"fastq\", \"fasta\", \"bam\", \"bed\", \"hdf5\", \"tsv\", \"wig\", ... | python | chosen |
[
{
"from": "system",
"value": "Add APA websites to URL patterns where client is known to be embedded.\n\nURL patterns provided by Kadidra McCloud at APA.\n\nFixes https://github.com/hypothesis/product-backlog/issues/814\n"
},
{
"from": "human",
"value": "import fnmatch\nimport re\nfrom urllib.par... | python | chosen |
[
{
"from": "system",
"value": "Use real measure definitions in e2e tests"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom .test import *\n\nDATABASES = {\n \"default\": {\n \"ENGINE\": \"django.contrib.gis.db.backends.postgis\",\n \"NAME\": utils.get_... | python | chosen |
[
{
"from": "system",
"value": "Allow Questions to be copied\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.contrib import admin\n\nfrom .models import Question, Choice, Answer\n\nclass ChoiceInline(admin.TabularInline):\n mode... | python | chosen |
[
{
"from": "system",
"value": "Fix example and remove extraneous import.\n"
},
{
"from": "human",
"value": "\nimport numpy as np\nfrom bokeh.plotting import *\nfrom bokeh.objects import Range1d\n\nN = 1000\n\nx = np.linspace(0, 10, N)\ny = np.linspace(0, 10, N)\nxx, yy = np.meshgrid(x, y)\nd = np... | python | chosen |
[
{
"from": "system",
"value": "Fix GitHub code editor whitespaces"
},
{
"from": "human",
"value": "from logging import getLogger\nfrom pkg_resources import get_distribution\n\nfrom django import apps\n\nlog = getLogger(__name__)\n\n\nclass AppConfig(apps.AppConfig):\n name = \"axes\"\n init... | python | chosen |
[
{
"from": "system",
"value": "Add test case for Acoustic1D.create_matrices().\n"
},
{
"from": "human",
"value": "import numpy as np\nimport pyfds as fds\n\n\ndef test_acoustic_material():\n water = fds.AcousticMaterial(1500, 1000)\n water.bulk_viscosity = 1e-3\n water.shear_viscosity = ... | python | chosen |
[
{
"from": "system",
"value": "Test script to work out the method for creating tasks\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright 2016 EMBL-European Bioinformatics Institute\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in complianc... | python | chosen |
[
{
"from": "system",
"value": "[ZA] Fix display of people on constituency office page\n\nThis template tag was being called without an organisation, so in\nproduction it was just silently failing, but in development it was\nraising an exception.\n\nThis adds an extra check so that if there is no organisation... | python | chosen |
[
{
"from": "system",
"value": "Add check for empty sequence or regex.\n"
},
{
"from": "human",
"value": "#!/bin/env python3\n# Prosite regular expressions matcher\n# Copyright (c) 2014 Tomasz Truszkowski\n# All rights reserved.\n\nimport prosite_matcher\n\nif __name__ == '__main__':\n\n\tprint(\"... | python | chosen |
[
{
"from": "system",
"value": "Fix IntegerType import for Spark SQL\n"
},
{
"from": "human",
"value": "# A simple demo for working with SparkSQL and Tweets\nfrom pyspark import SparkContext, SparkConf\nfrom pyspark.sql import HiveContext, Row, IntegerType\nimport json\nimport sys\n\nif __name__ =... | python | chosen |
[
{
"from": "system",
"value": "Disable params test for now\n"
},
{
"from": "human",
"value": "from django.test.client import Client\nfrom pytest_django.client import RequestFactory\n\npytest_plugins = ['pytester']\n\ndef test_params(testdir):\n testdir.makeconftest(\"\"\"\n import os, s... | python | chosen |
[
{
"from": "system",
"value": "Exclude it from coverage as these permissions are not used yet.\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\n# This file is part of PyBossa.\n#\n# Copyright (C) 2013 SF Isle of Man Limited\n#\n# PyBossa is free software: you can redistribute it and/or ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.