conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix bug when family_data.py was deleted\n"
},
{
"from": "human",
"value": "from . import lattice as _lattice\nfrom . import accelerator as _accelerator\nfrom . import family_data as _family_data\nfrom . import record_names\n\ncreate_accelerator = _accelerator.create... | python | chosen |
[
{
"from": "system",
"value": "BUG: Add 'draw' and 'feature' sub-modules.\n"
},
{
"from": "human",
"value": "import os\n\ndef configuration(parent_package='', top_path=None):\n from numpy.distutils.misc_util import Configuration\n\n config = Configuration('image', parent_package, top_path)\... | python | chosen |
[
{
"from": "system",
"value": "Add new stuff to the css bundle\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\nfrom flask.ext.assets import Bundle, Environment\nfrom flask.ext.bcrypt import Bcrypt\nfrom flask.ext.login import LoginManager, current_user\nfrom flask.ext.mig... | python | chosen |
[
{
"from": "system",
"value": "Update signatures of FieldABC methods\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Abstract base classes.\n\nThese are necessary to avoid circular imports between core.py and fields.py.\n\"\"\"\nimport copy\n\n\nclass FieldABC(object):\n \"\"... | python | chosen |
[
{
"from": "system",
"value": "Use LRUCache correctly (minimal improvement)\n"
},
{
"from": "human",
"value": "from pyramid.threadlocal import manager\nfrom sqlalchemy.util import LRUCache\n\n\nclass ManagerLRUCache(object):\n \"\"\" Override capacity in settings.\n \"\"\"\n def __init__... | python | chosen |
[
{
"from": "system",
"value": "Add commit message for commits and for parents\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask import render_template\napp = Flask(__name__)\napp.config['DEBUG'] = True\n\nrepo_path = '../ames-py'\n\n@app.route(\"/\")\ndef main():\n return ... | python | chosen |
[
{
"from": "system",
"value": "Make all log messages show by default\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom werkzeug import secure_filename\nimport os\nimport logging\nimport stripe\n\n\nAPP_ROOT = os.path.dirname(os.path.absp... | python | chosen |
[
{
"from": "system",
"value": "Make logger sort by date\n"
},
{
"from": "human",
"value": "import sys\nimport os\nimport logging\n\nif not os.path.exists(os.path.expanduser(\"~/.chatserver\")):\n os.makedirs(os.path.expanduser(\"~/.chatserver\"))\nlogging.basicConfig(filename=os.path.expanduse... | python | chosen |
[
{
"from": "system",
"value": "Create in MinMax the calculate_min_max\n"
},
{
"from": "human",
"value": "class Heuristic:\n\n def __init__(self, color):\n self.color = color\n\n def heuristic(self, board, color):\n raise NotImplementedError('Dont override this class')\n\n def eval(self, ... | python | chosen |
[
{
"from": "system",
"value": "Update user who sent the message\n"
},
{
"from": "human",
"value": "\"\"\"\nmodels.py\n\nApp Engine datastore models\n\n\"\"\"\n\n\nfrom google.appengine.ext import db\n\n\nclass ExampleModel(db.Model):\n \"\"\"Example Model\"\"\"\n example_name = db.StringPro... | python | chosen |
[
{
"from": "system",
"value": "Improve errors when effect packages or effects are not found\n"
},
{
"from": "human",
"value": "from demosys.project.base import BaseProject\r\nfrom demosys.effects.registry import effects, parse_package_string\r\n\r\n\r\nclass Project(BaseProject):\r\n \"\"\"\r\... | python | chosen |
[
{
"from": "system",
"value": "Make import backward compatible (Django<1.7)\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.forms.models import ModelForm\nfrom django.forms.utils import ErrorList\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom cms.models ... | python | chosen |
[
{
"from": "system",
"value": "Fix logic bug for API result\n"
},
{
"from": "human",
"value": "import requests\n\nAPI_URL = 'https://opendata.miamidade.gov/resource/vvjq-pfmc.json'\n\n\ndef is_valid_permit(id):\n # checks if the ID is a valid Miami-Dade Permit or Process Number\n API = API_... | python | chosen |
[
{
"from": "system",
"value": "Allow customer owner to create packages\n\n - wal-26\n"
},
{
"from": "human",
"value": "from nodeconductor.core.permissions import StaffPermissionLogic\n\n\nPERMISSION_LOGICS = (\n ('packages.PackageTemplate', StaffPermissionLogic(any_permission=True)),\n ('pa... | python | chosen |
[
{
"from": "system",
"value": "Write tab but don't warn\n"
},
{
"from": "human",
"value": "import ply.yacc\nfrom slimit.parser import Parser\nfrom js2xml.lexer import CustomLexer as Lexer\nfrom js2xml.log import logger\n\nlextab, yacctab = 'lextab', 'yacctab'\n\n\nclass CustomParser(Parser):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Delete many to reduce round trips to the cache.\n"
},
{
"from": "human",
"value": "from django.core.cache import cache\nfrom django.core.cache.utils import make_template_fragment_key\n\n\ndef update_submission(id):\n key = 'version:submission-%d' % id\n cache.... | python | chosen |
[
{
"from": "system",
"value": "Remove removal of DISPLAY environment variable\n\nThe issue has to do with the two lines:\r\n\r\n` if \"DISPLAY\" in os.environ:\r\n del os.environ[\"DISPLAY\"]`\r\n\r\nThis seems to remove the DISPLAY environment variable unnecessarily, as on line 50 of xvfbwrapper.py, self... | python | chosen |
[
{
"from": "system",
"value": "Add check for failed reminders so that it doesn't case an Exception\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom celery import shared_task\n\nfrom django.utils import timezone\nfrom django.conf import settings\n\nfrom studygroups... | python | chosen |
[
{
"from": "system",
"value": "Make initial ./manage.py migrate work in example\n"
},
{
"from": "human",
"value": "from django.contrib.auth import get_user_model\n\n\ndef disable_admin_login():\n \"\"\"\n Disable admin login, but allow editing.\n\n amended from: https://stackoverflow.com... | python | chosen |
[
{
"from": "system",
"value": "Mod: Make comment removal a fallback when failed.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nJSON-LD extractor\n\"\"\"\n\nimport json\nimport re\n\nimport lxml.etree\nimport lxml.html\n\n\nHTML_OR_JS_COMMENTLINE = re.compile('^\\s*(//.*|<!--... | python | chosen |
[
{
"from": "system",
"value": "Set log level to info, fixed bug with map object\n"
},
{
"from": "human",
"value": "import logging\nimport numpy as np\n\nimport settings\nfrom models import Robby\n\n\ndef evolve():\n population = np.array([Robby() for i in range(0, settings.POPULATION)])\n f... | python | chosen |
[
{
"from": "system",
"value": "Modify lecture method in ArrogantProfessor class using inheritance\n"
},
{
"from": "human",
"value": "# Problem 6-1\n# 10.0 points possible (graded)\n\n\nclass Person(object):\n def __init__(self, name):\n self.name = name\n def say(self, stuff):\n ... | python | chosen |
[
{
"from": "system",
"value": "Change from timestamp to Integer\n"
},
{
"from": "human",
"value": "from grum import db\n\n\nclass Message(db.Model):\n id = db.Column(db.String(128), primary_key=True)\n\n recipient = db.Column(db.String(128))\n recipient_nice = db.Column(db.String(128))\n... | python | chosen |
[
{
"from": "system",
"value": "Add crawled_at field to HackernewsScrapyItem\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport scrapy\n\n\nclass HackernewsScrapyItem(scrapy.Item):\n\ttitle = scrapy.Field()\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Fix typo, make routes a little more legible.\n\n\n"
},
{
"from": "human",
"value": "from pyramid.config import Configurator\nfrom pyramid_zodbconn import get_connection\n\nfrom .models import appmaker\nfrom .views import publish, subscribe\n\n\ndef root_factory(requ... | python | chosen |
[
{
"from": "system",
"value": "Add a boolean field to Store model (store.has_coffee)\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom django.db import models\n\n\nclass Author(models.Model):\n name = models.CharField(max_length=100)\n age = models.IntegerField()\n friends = model... | python | chosen |
[
{
"from": "system",
"value": "Add test for git commit\n"
},
{
"from": "human",
"value": "import globals as gbl\nfrom matador.commands import CreateTicket, CreatePackage\nfrom dulwich.repo import Repo\n\n\ndef test_add_to_git(project_repo):\n pass\n\n\ndef test_create_ticket(project_repo):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix characters which break terminal-notifier\n\nIf your message starts with either a [ or - (and probably more I haven't\nfound yet) terminal-notifier blows up because of the way it parses its\narguments\n"
},
{
"from": "human",
"value": "# This weechat plugin sends... | python | chosen |
[
{
"from": "system",
"value": "Update tests + add username field\n"
},
{
"from": "human",
"value": "from findspam import FindSpam\r\nimport pytest\r\n\r\n@pytest.mark.parametrize(\"text, match\", [\r\n ('18669786819 gmail customer service number 1866978-6819 gmail support number', True),\r\n ... | python | chosen |
[
{
"from": "system",
"value": "Change variable name to more suitable ones\n"
},
{
"from": "human",
"value": "# Load the machine\nimport pkg_resources\npkg_resources.require('aphla')\nimport aphla as ap\n\n# Load the machine\nap.machines.load('SRI21')\n\nmyLattice = ap.machines.getLattice()\n\nlen... | python | chosen |
[
{
"from": "system",
"value": "Add comment telling where to get updated geoip database\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals, print_function, division\nimport pygeoip\nimport os.path\nimport sys\nimport socket\n\nDATAFILE = os.path.join(sys.path[0], \"GeoIP.da... | python | chosen |
[
{
"from": "system",
"value": "Add test to ensure reject does not remove duplicates\n"
},
{
"from": "human",
"value": "from . import reject\n\n\ndef test_reject_filters_out_unwanted_items_in_iterable():\n assert reject(lambda x: x % 2 == 1, [1, 2, 3, 4]) == [2, 4]\n\n\ndef test_curry_reject_fi... | python | chosen |
[
{
"from": "system",
"value": "Add --all to push option\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n\nimport git\n\n\nclass PullPush:\n\n\n def __init__(self, repo_dir):\n \"\"\"\n :param repo_dir: Directory in which to pull into\n \"\"\"\n\n self.r... | python | chosen |
[
{
"from": "human",
"value": "Add test for search input field query\n"
},
{
"from": "gpt",
"value": "from base64 import b64encode\n\nfrom django.conf import settings\nfrom django.db import connection\nfrom django.test import TestCase\nfrom django.test.client import RequestFactory\nfrom django.url... | python | chosen |
[
{
"from": "system",
"value": "Replace unittest.TestCase with Django’s own TestCase.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_djangocms-responsive-wrapper\n------------\n\nTests for `djangocms-responsive-wrapper` models module.\n\"\"\"\n\ni... | python | chosen |
[
{
"from": "system",
"value": "Create CLI entry point automatically\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nVERSION = 0.1\n\nwith open('requirements.txt') as f:\n requirements = f.read().splitlines()\n\nsetup(\n name=\"tldt\",\n version=VERSION,\... | python | chosen |
[
{
"from": "system",
"value": "Split multiple arguments for consistency\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n#__version__ = '0.0.0'\n\n#import from data_utils\nfrom data_utils import load_csv_data\nfrom data_utils import load_Xy_one_hot_data2\nfrom data_uti... | python | chosen |
[
{
"from": "system",
"value": "Add Gruppe to Turbasen import __inti\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\n# Import the models we want directly available through the root module\nfrom .models impo... | python | chosen |
[
{
"from": "system",
"value": "Add image_alt for adding Alt attribute to img tags\n\nAdded image_alt for adding alt attribute to img tags for SEO"
},
{
"from": "human",
"value": "from openerp.osv import osv, fields\n\nclass product_image(osv.Model):\n _name = 'product.image'\n\n _columns = ... | python | chosen |
[
{
"from": "system",
"value": "Add test case for no valid move in finish bug\n"
},
{
"from": "human",
"value": "from move_manager import MoveManager\nfrom board import Board, Field\n\nimport unittest\n\nclass TestMoves(unittest.TestCase):\n\n def test_valid_moves(self):\n pass\n\n\nif _... | python | chosen |
[
{
"from": "system",
"value": "Update routing branch to be 1.3 development branch\n"
},
{
"from": "human",
"value": "\"\"\"\nMolly Project\nhttp://mollyproject.org\nA framework for creating Mobile Web applications for HE/FE institutions.\n\"\"\"\n\n__version__ = '1.2.1'\n"
},
{
"from": "g... | python | chosen |
[
{
"from": "system",
"value": "Use nodes check for light export.\n"
},
{
"from": "human",
"value": "import bpy\nimport json\nfrom .common import *\n\n\ndef light_data_path(blender_object):\n path = library_path(blender_object) + \"light_data/\" + blender_object.name + \".light_data\"\n retu... | python | chosen |
[
{
"from": "system",
"value": "Clean up some loose ends\n"
},
{
"from": "human",
"value": "\"\"\"Functions for checking files\"\"\"\nimport os\nimport stat\n\nfrom .checker import is_link\n\ndef file_exists(path):\n try:\n with open(path, mode='r') as test:\n pass\n except... | python | chosen |
[
{
"from": "system",
"value": "Fix a typo in STEAMDIR\n"
},
{
"from": "human",
"value": "from command.default import ManagerDefaultController\nfrom cement.core.controller import expose\nfrom util.config import Configuration\nimport os\nimport sys\n\n\nclass SetupController(ManagerDefaultControlle... | python | chosen |
[
{
"from": "system",
"value": "Use get_backend in proxy methods\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\nfrom django.db.models.query import QuerySet\n\n\nclass FollowQuerySet(QuerySet):\n pass\n\n\nclass Fol... | python | chosen |
[
{
"from": "system",
"value": "Use requests to follow redirects\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright © 2009-2013 Kimmo Parviainen-Jalanko <k@77.fi>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and asso... | python | chosen |
[
{
"from": "system",
"value": "Add type of variable budget\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Budget(models.Model):\n number = models.CharField(max_length=100, unique=True)\n initial_date = models.DateTimeField()\n final_date = models.DateTimeField(b... | python | chosen |
[
{
"from": "system",
"value": "Make words optional for get_doc\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom ..tokens import Doc\nfrom ..attrs import ORTH, POS, HEAD, DEP\n\n\ndef get_doc(vocab, words, tags=None, heads=None, deps=None):\n \... | python | chosen |
[
{
"from": "system",
"value": "Replace usage of ndimage from nd to ndi\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom scipy import ndimage as nd\n\n\ndef nd_sobel_magnitude(image, spacing=None):\n \"\"\"Compute the magnitude of Sobel gradients along all axes.\n\n Parameters\n ... | python | chosen |
[
{
"from": "system",
"value": "Move the location for grader.egg-info\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(name=\"grader\",\n # http://semver.org/spec/v2.0.0.html\n version=\"0.0.1\",\n url='https://github.com/brhoades/grader',\n ... | python | chosen |
[
{
"from": "system",
"value": "Increase default test timeout value\n"
},
{
"from": "human",
"value": "import json\n\nimport testtools\n\nfrom testtools.twistedsupport import AsynchronousDeferredRunTest\n\nfrom uritools import urisplit\n\n\nclass TestCase(testtools.TestCase):\n \"\"\" TestCase ... | python | chosen |
[
{
"from": "system",
"value": "Convert to unittest and add test for expand_path.\n"
},
{
"from": "human",
"value": "from directions import load_directions, turn, follow_directions\n\n\ndef test_load_directions():\n with open(\"directions.txt\") as f:\n directions = [direction.strip(',')... | python | chosen |
[
{
"from": "system",
"value": "Fix Meta init and from_dict\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\n\nfrom malcolm.core.serializable import Serializable\n\n\n@Serializable.register(\"malcolm:core/Meta:1.0\")\nclass Meta(Serializable):\n \"\"\"Meta class for descr... | python | chosen |
[
{
"from": "system",
"value": "Update consumer to rebuild 'Start' expression tree for condor resources\n\nThis code is untested.\n"
},
{
"from": "human",
"value": "import htcondor\nimport redis\nimport time\nimport json\nimport classad\n\ndef setup_redis_connection():\n r = redis.StrictRedis(h... | python | chosen |
[
{
"from": "system",
"value": "Tag commit for v0.0.26-master generated by gitmake.py\n"
},
{
"from": "human",
"value": "major = 0\nminor=0\npatch=25\nbranch=\"master\"\ntimestamp=1376610207.69"
},
{
"from": "gpt",
"value": "major = 0\nminor=0\npatch=26\nbranch=\"master\"\ntimestamp=13... | python | chosen |
[
{
"from": "system",
"value": "Make tests pass on Django 1.7 without warnings.\n"
},
{
"from": "human",
"value": "# Only used for running the tests\n\nimport os\n\nCONTACT_EMAILS = ['charlie@example.com']\n\nDATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3'}}\n\nINSTALLED_APPS = ['c... | python | chosen |
[
{
"from": "system",
"value": "Remove day of the week row\n"
},
{
"from": "human",
"value": "# This file copied from https://github.com/unmonoqueteclea/calendar-telegram\n\nfrom telebot import types\nimport calendar\n\ndef create_calendar(year,month):\n markup = types.InlineKeyboardMarkup()\n ... | python | chosen |
[
{
"from": "system",
"value": "Test grouping with matched nodes\n"
},
{
"from": "human",
"value": "import pytest\nfrom katana.utils import Node, Pair, prepare\nfrom katana.compound import sequence, group, repeat, option, maybe\nfrom katana.term import term\n\n\nTa, Tb, Tc = [term(k) for k in 'abc... | python | chosen |
[
{
"from": "system",
"value": "Fix tests on travis ci.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Manage temporary directories.\"\"\"\nimport os\nimport shutil\nimport tempfile\n\n\nclass temporary_directory(object):\n \"\"\"Create, yield, and finally delete a temporary ... | python | chosen |
[
{
"from": "system",
"value": "Add alternative warning if sqlite is >=3.19 but is missing fts5 support\n"
},
{
"from": "human",
"value": "from django.apps import AppConfig\nfrom django.core.checks import Tags, Warning, register\nfrom django.db import connection\nfrom django.utils.translation impo... | python | chosen |
[
{
"from": "system",
"value": "Change version until ready for release\n"
},
{
"from": "human",
"value": "from .base import WhiteNoise\n\n__version__ = '2.0.6'\n\n__all__ = ['WhiteNoise']\n"
},
{
"from": "gpt",
"value": "from .base import WhiteNoise\n\n__version__ = 'development'\n\n__... | python | chosen |
[
{
"from": "system",
"value": "Add support for single row checking\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf8 -*-\n\"\"\"\nUsage:\nexgrep TERM [options] EXCEL_FILE...\n\nOptions:\nTERM The term to grep for. Can be any valid (python) regular expression.\nE... | python | chosen |
[
{
"from": "system",
"value": "Check more data about riemann\n"
},
{
"from": "human",
"value": "from pytest import fixture\n\nfrom oshino.config import Config, RiemannConfig\n\n\n@fixture\ndef base_config():\n return Config({\"riemann\": {\"host\": \"localhost\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Make test models self contained specific defining Model classes\n"
},
{
"from": "human",
"value": "from pysagec import models\n\n\ndef test_auth_info():\n values = [\n ('mrw:CodigoFranquicia', 'franchise_code', '123456'),\n ('mrw:CodigoAbonado', 'su... | python | chosen |
[
{
"from": "system",
"value": "Add delay to resize test\n"
},
{
"from": "human",
"value": "import webview\nfrom .util import run_test\nfrom time import sleep\n\n\ndef test_resize():\n window = webview.create_window('Set Window Size Test', 'https://www.example.org', width=800, height=600)\n ... | python | chosen |
[
{
"from": "system",
"value": "Make path to sample project shorter\n"
},
{
"from": "human",
"value": "\"\"\"Provide APP constant for the purposes of manually running the flask app\n\nFor example, build the front end, then run the app with environment variables::\n cd smif/app/\n npm... | python | chosen |
[
{
"from": "system",
"value": "Fix more of the test.\n"
},
{
"from": "human",
"value": "import json\n\nfrom jazzband.projects.tasks import update_project_by_hook\nfrom jazzband.tasks import JazzbandSpinach\n\n\ndef post(client, hook, data, guid=\"abc\"):\n headers = {\"X-GitHub-Event\": hook, ... | python | chosen |
[
{
"from": "system",
"value": "Fix issue when running setup.py on python<3.8\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport sys\n\n__author__ = 'Odoo Community Association (OCA)'\n__email__ = 'support@odoo-community.org'\n__doc__ = \"\"\"A library with support functions to be ... | python | chosen |
[
{
"from": "system",
"value": "Add fixture decorator to make tests better\n"
},
{
"from": "human",
"value": "\"\"\"\ngargoyle.tests\n~~~~~~~~~~~~~~\n\n:copyright: (c) 2010 DISQUS.\n:license: Apache License 2.0, see LICENSE for more details.\n\"\"\"\n\nfrom tests import *"
},
{
"from": "gp... | python | chosen |
[
{
"from": "system",
"value": "Add note on advantages of SAM format.\n"
},
{
"from": "human",
"value": "#!python\n\n# Load libraries\nimport sys, getopt\nimport libPipeline\n\n# Set constants\nhelpMsg ='''\nSYNOPSIS\n parseBowtieOutput\n parseBowtieOutput [OPTIONS] [FILE]\n #\nDESCRIPTIO... | python | chosen |
[
{
"from": "system",
"value": "Add default status=200 to async_json_out decorator\n"
},
{
"from": "human",
"value": "\"\"\"Collection of HTTP helpers.\"\"\"\n\nfrom functools import partial, wraps\nfrom inspect import iscoroutine\n\nfrom aiohttp.web import json_response\n\n\ndef async_json_out(or... | python | chosen |
[
{
"from": "system",
"value": "Support large meshes on Fermi-class hardware.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nfrom pyfr.backends.cuda.provider import CudaKernelProvider\nfrom pyfr.backends.cuda.queue import CudaComputeKernel\nfrom pyfr.nputil imp... | python | chosen |
[
{
"from": "system",
"value": "Add 'attempts_left' to the http exception.\n"
},
{
"from": "human",
"value": "import json\n\nimport requests\n\n\nSMS_AUTH_ENDPOINT = 'http://localhost:5000'\n\n\nclass SMSAuthClient(object):\n\n def __init__(self, endpoint=SMS_AUTH_ENDPOINT):\n self.endpo... | python | chosen |
[
{
"from": "system",
"value": "Update SQL query with \"and communication is null\"\n\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2014 Akretion (http://www.akretion.com/)\n# @au... | python | chosen |
[
{
"from": "system",
"value": "Use a the regular connection for alembic\n"
},
{
"from": "human",
"value": "import os\nfrom urllib import parse\n\nDEBUG = False\n\n\nDATABASE_SA = os.environ.get('HEROKU_POSTGRESQL_CHARCOAL_URL_PGBOUNCER')\n\nbits = parse.urlparse(DATABASE_SA)\n\nDATABASE = {\n ... | python | chosen |
[
{
"from": "system",
"value": "Update template loaders analyzer to target Django 1.5\n"
},
{
"from": "human",
"value": "import ast\n\nfrom .base import BaseAnalyzer, Result\n\n\nclass TemplateLoadersVisitor(ast.NodeVisitor):\n\n def __init__(self):\n self.found = []\n\n deprecated_it... | python | chosen |
[
{
"from": "system",
"value": "Add ability to get github token from user model\n"
},
{
"from": "human",
"value": "from github import Github\nfrom django.contrib.auth.models import User\nfrom tools.decorators import extend\n\n\n@extend(User)\nclass Profile(object):\n \"\"\"Add shortcuts to user... | python | chosen |
[
{
"from": "system",
"value": "Disable lib2to3 by default, unless run explicitly.\n"
},
{
"from": "human",
"value": "# Skipping test_parser and test_all_fixers\n# because of running\nfrom lib2to3.tests import test_fixers, test_pytree, test_util\nimport unittest\nfrom test.test_support import run_... | python | chosen |
[
{
"from": "system",
"value": "Update code for support new methodology\n"
},
{
"from": "human",
"value": "from fedora.template.fedora import FedoraTemplate\nfrom fedora.manager.manager import FedoraConnectionManager\n\nif '__main__' == __name__:\n fedoraTemplate = FedoraTemplate()\n a = Fed... | python | chosen |
[
{
"from": "system",
"value": "Put imports as they are in init\n"
},
{
"from": "human",
"value": "import sys\nPYTHONPATH = '/home/nick/PycharmProjs/tl_cycling/caar'\nsys.path.append(PYTHONPATH)\nPYTHONPATH = '/home/nick/PycharmProjs/tl_cycling/backports'\nsys.path.append(PYTHONPATH)\nPYTHONPATH =... | python | chosen |
[
{
"from": "system",
"value": "Disable redirecting git output in _get_version\n"
},
{
"from": "human",
"value": "\"\"\"Adaptive configuration dialogs.\n\nAttributes:\n __version__: The current version string.\n\"\"\"\n\nimport os\nimport subprocess\n\n\ndef _get_version(version=None): # overw... | python | chosen |
[
{
"from": "system",
"value": "Allow to filter expert bids by a customer [WAL-1169]\n"
},
{
"from": "human",
"value": "import django_filters\n\nfrom nodeconductor.core import filters as core_filters\n\nfrom . import models\n\n\nclass ExpertProviderFilter(django_filters.FilterSet):\n customer =... | python | chosen |
[
{
"from": "system",
"value": "Replace the test data set with this one.\n"
},
{
"from": "human",
"value": "import os.path as op\n\nimport numpy as np\nimport numpy.testing as npt\n\nimport nibabel as nib\nimport nibabel.tmpdirs as nbtmp\n\nimport dipy.data as dpd\nfrom dipy.reconst.shm import cal... | python | chosen |
[
{
"from": "system",
"value": "Add a default for JINJA_EXTENSIONS (default is no extensions)\n"
},
{
"from": "human",
"value": "import os\n\n_DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),\n \"themes/notmyidea\"])\n_DEFAULT_CONFIG = {'PATH': ... | python | chosen |
[
{
"from": "system",
"value": "Add login restrictions to chatroom\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\n\n# Create your views here.\n"
},
{
"from": "gpt",
"value": "from django.shortcuts import render\nfrom django.http import HttpResponse, Http404\nfr... | python | chosen |
[
{
"from": "system",
"value": "Fix SAM checker to for better coverage\n"
},
{
"from": "human",
"value": "\"\"\"Functions for checking files\"\"\"\nimport os\nimport stat\nimport mimetypes\n\nfrom .checker import is_link\nfrom .config import CONFIG\n\ndef is_fastq(fi):\n \"\"\"Check whether a g... | python | chosen |
[
{
"from": "system",
"value": "Append G(app) to os $PATH\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport hook_system_variables as hook\nimport os_operations as op\nimport os\n\n\ndef setup():\n home_dir = op.get_home()\n app_tree = home_dir + op.separ... | python | chosen |
[
{
"from": "system",
"value": "Create new exception to catch APIException\n"
},
{
"from": "human",
"value": "from rest_framework.views import exception_handler\nfrom rest_framework.exceptions import APIException\n\nfrom rest_framework_friendly_errors import settings\nfrom rest_framework_friendly_... | python | chosen |
[
{
"from": "system",
"value": "Add additional test for strings\n"
},
{
"from": "human",
"value": "from hashring import HashRing\n\ndef test_basic_ring():\n hr = HashRing(range(3))\n actual = hr.get_node('howdy')\n expected = 1\n assert expected == actual\n"
},
{
"from": "gpt",... | python | chosen |
[
{
"from": "system",
"value": "Add str method for debugging to node\n"
},
{
"from": "human",
"value": "from cfr.constants import NUM_ACTIONS\n\n\nclass Node:\n def __init__(self, parent):\n super().__init__()\n self.parent = parent\n self.children = {}\n\n def set_child... | python | chosen |
[
{
"from": "system",
"value": "Add the support for the new module constants to the LiveEntryManager\n\n\ngit-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@71 5f8205a5-902a-0410-8b63-8f478ce83d95\n"
},
{
"from": "human",
"value": "from comment_utils.managers import CommentedObjectManager\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Fix websockets process after celery upgrade\n\nmake it do the same patching that manage.py does\n"
},
{
"from": "human",
"value": "import os\nimport gevent.socket\nimport redis.connection\nfrom manage import _set_source_root_parent, _set_source_root\n\nos.environ.se... | python | chosen |
[
{
"from": "system",
"value": "Make 00:00:00:00:00:00 an invalid MAC address\n"
},
{
"from": "human",
"value": "from django.core.exceptions import ValidationError\nimport re\n\n\nmac_pattern = re.compile(r'^([0-9a-f]{2}:){5}[0-9a-f]{2}$')\n\ndef validate_mac(mac):\n if not isinstance(mac, base... | python | chosen |
[
{
"from": "system",
"value": "Clean up all test dbs after test run.\n"
},
{
"from": "human",
"value": "# Copyright 2010 10gen, Inc.\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 obtain a copy... | python | chosen |
[
{
"from": "system",
"value": "Use identity operator when comparing with None\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nfrom libthumbor import CryptoURL\n\nclass ThumborService(object):\n\... | python | chosen |
[
{
"from": "system",
"value": "Reorder filters to make the easier to use.\n"
},
{
"from": "human",
"value": "from bonvortaro.vortaro.models import Root, Word, Definition #, Translation\nfrom django.contrib import admin\n\nclass RootAdmin(admin.ModelAdmin):\n list_display = [\"root\", \"kind\",... | python | chosen |
[
{
"from": "system",
"value": "Fix bug and correct indentation"
},
{
"from": "human",
"value": "import os\nfrom os.path import expanduser\n\nUSER_HOME = expanduser(\"~\")\n\n#MASIMATLAB dir:\nif 'MASIMATLAB_PATH' not in os.environ:\n MASIMATLAB_PATH = os.path.join(USER_HOME,'masimatlab')\nelse:\... | python | chosen |
[
{
"from": "system",
"value": "Update import to correct path for Django 1.4->1.6 compatibility\n"
},
{
"from": "human",
"value": "from django.utils.functional import Promise\nfrom django.utils.translation import force_unicode\n\n\ndef resolve_promise(o):\n if isinstance(o, dict):\n for ... | python | chosen |
[
{
"from": "system",
"value": "Fix the compile error of define classes which derivate from other classes in class.\n"
},
{
"from": "human",
"value": "#--coding:utf-8--\n#Platform\n\nclass BasePlatform(object):\n \"\"\"\n A template for codes which are dependent on platform, whatever shell t... | python | chosen |
[
{
"from": "system",
"value": "Add is_ha variable to change config rollback\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nfrom . import run_vm_script\nfrom ...util.base import BaseStep\n\nLOG = logging.getLogger(__name__)\n\n\nclass ChangeDatabaseConfigFile(BaseStep)... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.