conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"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: de016e52bd170d2d4f2344f9bf92d50478b649e0@... | python | chosen |
[
{
"from": "system",
"value": "Add backup code in case network is down\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# `json` is a module that helps us use the JSON data format.\nimport json\n\n# `requests` is a module for interacting with the Internet\nimport requests\n\ndef main()... | python | chosen |
[
{
"from": "system",
"value": "Remove this, it properly belongs to ASN1, and that's for a seperate PR\n"
},
{
"from": "human",
"value": "# 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": "Add timeout for the request and catch more exceptions and print them if debug enabled in the conf\n"
},
{
"from": "human",
"value": "import urllib.request\nimport os\n\n## Get HTML for given url\ndef getHtml( self, url, useragent):\n\ttry:\n\t\tif useragent == True:... | python | chosen |
[
{
"from": "system",
"value": "Make logger format easier to read"
},
{
"from": "human",
"value": "import sys\nimport logging\n\nlogging.basicConfig(level=logging.DEBUG)\n\ntry:\n from . import minivect\nexcept ImportError:\n print logging.error(\"Did you forget to update submodule minivect?... | python | chosen |
[
{
"from": "system",
"value": "Add host for offline tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom .base import *\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False\n\nALLOWED_HOSTS = ['138.197.197.47']\n\nCORS_ORIGIN_WHITELIST = ('138.197.... | python | chosen |
[
{
"from": "system",
"value": "Rename route '/users/{user_name}/{project_name}' to '/projects/{project_name}'\n"
},
{
"from": "human",
"value": "from routes.index import index\nfrom routes.project_page import project\nfrom routes.user_overview import user_overview\nfrom routes.project_overview im... | python | chosen |
[
{
"from": "system",
"value": "Add type annotation to worker_shutdown_stop, which was called in a typed context\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"TaskProcess class to provide helper methods around worker task's process.\n\nAttributes:\n log (logging.Logger): the l... | python | chosen |
[
{
"from": "system",
"value": "Test that there isn't IO done when you get a URL\n"
},
{
"from": "human",
"value": "from nose.tools import assert_true, assert_false\nfrom imagekit.cachefiles import ImageCacheFile\nfrom mock import Mock\nfrom .utils import create_image\nfrom django.core.files.stora... | python | chosen |
[
{
"from": "system",
"value": "Fix build on python 2.6\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import with_statement\nimport os\nimport socket\n\nfrom sphinx.application import Sphinx\nfrom six import StringIO\n\nfrom .base import unittest\nfrom .tmpdir import ... | python | chosen |
[
{
"from": "system",
"value": "Bump version to 0.6.1 for PyPI\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\n__version__ = '0.6.0'\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_liter... | python | chosen |
[
{
"from": "system",
"value": "Switch to using the v1 API to get total hits.\n"
},
{
"from": "human",
"value": "import requests, json, urllib\n\nSEARCH_URL = 'http://core.ac.uk:80/api-v2/articles/search/'\nAPI_KEY = 'FILL THIS IN'\n\ndef getCOREMentions(identifier, **kwargs):\n \"\"\"Return th... | python | chosen |
[
{
"from": "system",
"value": "Remove prints that interfere with json output"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\n\nfrom serf_master import SerfHandlerProxy\nfrom base_handler import BaseHandler\ntry:\n from my_handler import MyHandler\nexcept ImportError:\n pr... | python | chosen |
[
{
"from": "system",
"value": "Remove exclude filtering support from API\n\nI'll just use 'in' instead...\n\nReverts fa099b12f8a4c4d4aa2eb2954c6c315f3a79ea84.\n"
},
{
"from": "human",
"value": "from tastypie.resources import ModelResource\nfrom tastypie.authorization import Authorization\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Update bash kernel to use new shell api and shell help.\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nfrom jupyter_kernel import MagicKernel\n\n\nclass BashKernel(MagicKernel):\n implementation = 'Bash'\n implementation_version = ... | python | chosen |
[
{
"from": "system",
"value": "Migrate to new translate api\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python2\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport json\nimport urllib\nimport datetime\nimport subprocess\n\n# api key, 1000 times per hour\nAPIKEY = 'WGCxN9fzvCxPo0nqlzG... | python | chosen |
[
{
"from": "system",
"value": "Add model unicode support for Python 2\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Setting(models.Model):\n name = models.CharField(max_length=40, unique=True)\n label = models.CharField(max_length=60)\n help_text = models.Tex... | python | chosen |
[
{
"from": "system",
"value": "Add build steps to functional testing annotated steps script\n\nR=messick@google.com\n\nReview URL: https://codereview.chromium.org//312503005\n\ngit-svn-id: c93d8a2297af3b929165606efe145742a534bc71@36878 260f80e4-7a28-3924-810f-c04153c831b5\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Add random people and rooms\n"
},
{
"from": "human",
"value": "\npeople = '123456'\nroom = 'abcdef'\n\n# murder configuration\n# who was where\n# who is the murderer\n\n# current configuration\n# who was where\n# player location\n\n"
},
{
"from": "gpt",... | python | chosen |
[
{
"from": "system",
"value": "Make sure FeatureExtractor returns array2i\n"
},
{
"from": "human",
"value": "from typing import List, Union, Callable, Tuple\n\nfrom ..types import Ints2d, Doc\nfrom ..model import Model\nfrom ..config import registry\n\n\nInT = List[Doc]\nOutT = List[Ints2d]\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Update environment variable name for port to listen on from VCAP_APP_PORT (deprecated) -> PORT\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nfrom flask import Flask\napp = Flask(__name__)\n\n@app.route('/')\n\ndef hello():\n return open('... | python | chosen |
[
{
"from": "system",
"value": "Fix crash when no project is specified\n"
},
{
"from": "human",
"value": "# noqa\nfrom dodo_commands.system_commands import DodoCommand\nfrom dodo_commands.dodo_activate import Activator\n\n\nclass Command(DodoCommand): # noqa\n help = \"\"\n decorators = []\... | python | chosen |
[
{
"from": "system",
"value": "Allow insecure oauth transport in development.\n"
},
{
"from": "human",
"value": "import os\n\nDOMAIN = {\n \"texts\": {\n \"schema\": {\n \"name\": {\n \"type\": \"string\",\n \"required\": True,\n \... | python | chosen |
[
{
"from": "system",
"value": "Use Fuyu's VeryCool™ UTBR impl\n"
},
{
"from": "human",
"value": "import discord\n\n\ndef user_to_bot_ratio(guild: discord.Guild):\n \"\"\" Calculates the user to bot ratio for a guild. \"\"\"\n bots = len(list(filter(lambda u: u.bot, guild.members)))\n use... | python | chosen |
[
{
"from": "system",
"value": "Remove common and errors from root namespace.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2016 The Regents of the University of Michigan\n# All rights reserved.\n# This software is licensed under the BSD 3-Clause License.\n\"\"\"The signac framework aids in t... | python | chosen |
[
{
"from": "system",
"value": "Add url for landing page (/) that links to the base view\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom django.contrib import admin\nfrom chess import views\n\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n url(r'^accoun... | python | chosen |
[
{
"from": "system",
"value": "Fix state leak causing flakiness.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom absl.testing import absltest\n\nfrom grr_response_server import cronjobs\nfrom grr_response_server import server_startup\nfrom grr_response_server.rdfvalues import cronj... | python | chosen |
[
{
"from": "system",
"value": "Add default values for username and passwd and add a TODO.\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\"\"\" This script contains functions for the REST client.\n \n Author: Julien Delplanque\n\"\"\"\nimport http.client\nimport json\n\ndef get_pacman_p... | python | chosen |
[
{
"from": "system",
"value": "Add some prints to improve verbosity\n"
},
{
"from": "human",
"value": "\"\"\"\nMain script to execute the gesture recognition software.\n\"\"\"\n\n# Import native python libraries\nimport inspect\nimport os\nimport sys\nfrom listener import MyListener\nfrom face_de... | python | chosen |
[
{
"from": "system",
"value": "Add weighted undirected graph in main()\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\ndef prim():\n\t\"\"\"Prim's Minimum Spanning Tree in weighted graph.\"\"\"\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix 'cant import from .django'\n"
},
{
"from": "human",
"value": "###################################################################\n#\n# Copyright (c) 2013 Miing.org <samuel.miing@gmail.com>\n# \n# This software is licensed under the GNU Affero General Public \n#... | python | chosen |
[
{
"from": "system",
"value": "Add a setting NEXUS_USE_DJANGO_MEDIA_URL to easily use Django's MEDIA_URL for the nexus MEDIA_PREFIX.\n\nIf you want to make custom modifications to the nexus media it makes sense to have it under your own app's media folder and the NEXUS_USE_DJANGO_MEDIA_URL allows the MEDIA_U... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in property name\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\nimport cybox\nimport cybox.bindings.cybox_core as core_binding\nfrom cybox.common import VocabStr... | python | chosen |
[
{
"from": "system",
"value": "Improve thumbnail processor a little\n"
},
{
"from": "human",
"value": "import logging\n\n\nlogger = logging.getLogger(__name__)\n\ndef crop_corners(image, box=None, **kwargs):\n \"\"\"\n Crop corners to the selection defined by image_cropping\n \"\"\"\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update OperationCelery with max_retries and countdown logic\n"
},
{
"from": "human",
"value": "from pipelines.models import Operation\nfrom polyaxon.celery_api import CeleryTask\n\n\nclass OperationTask(CeleryTask):\n \"\"\"Base operation celery task with basic l... | python | chosen |
[
{
"from": "system",
"value": "Switch out to use the new GenericKeyInline\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib import admin\nfrom django.contrib.contenttypes import generic\nfrom reversion.admin import VersionAdmin\n\nfrom . import models\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Remove unused code in test\n"
},
{
"from": "human",
"value": "from openfisca_core.tools.test_runner import _run_test, _get_tax_benefit_system\nfrom openfisca_core.errors import VariableNotFound\n\n\nimport pytest\n\n\nclass TaxBenefitSystem:\n def __init__(self):... | python | chosen |
[
{
"from": "system",
"value": "fix: Add x-frigg-worker-token header to hq requests\n\nThis will in time be to remove the FRIGG_WORKER_TOKEN header.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nimport socket\n\nimport requests\n\nlogger = logging.getLogger(__name__)\... | python | chosen |
[
{
"from": "system",
"value": "Add note to dev settings re: testing production assets.\n"
},
{
"from": "human",
"value": "from .base import *\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/\n\nSECRET_KEY =... | python | chosen |
[
{
"from": "system",
"value": "Add name to family member\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom quickly.buttons.models import EmergencyButtonClient\n\n\nclass FamilyMember(models.Model):\n \"\"\"\n Model which defines families of the platform with authentica... | python | chosen |
[
{
"from": "system",
"value": "Fix computation of Hamiltonian for k.p models.\n"
},
{
"from": "human",
"value": "import numpy as np\nimport scipy.linalg as la\n\nfrom fsc.export import export\nfrom fsc.hdf5_io import subscribe_hdf5, SimpleHDF5Mapping\n\n\n@export\n@subscribe_hdf5('tbmodels.model'... | python | chosen |
[
{
"from": "system",
"value": "Support Django being on the path but unused.\n"
},
{
"from": "human",
"value": "try:\n from django.conf import settings\nexcept ImportError:\n settings = None\n\nfrom client import StatsClient\n\n\n__all__ = ['StatsClient', 'statsd', 'VERSION']\n\nVERSION = (0... | python | chosen |
[
{
"from": "system",
"value": "Correct the math on project events/day\n"
},
{
"from": "human",
"value": "\"\"\"\nsentry.templatetags.sentry_admin_helpers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE... | python | chosen |
[
{
"from": "system",
"value": "Update parallel convergence test runs to not spawn OMP threads"
},
{
"from": "human",
"value": "import os\nimport time\nimport multiprocessing\n\nthreads = 4\n\ndev_null = \"/dev/null\"\ninput_dir = \"./convergence_inputs/\"\n\nlog_file = dev_null\n\ncall = \"nice -... | python | chosen |
[
{
"from": "system",
"value": "Add environment variable to disable automatic instrumentation\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nimport opentracing\nfrom .sensor import Sensor\nfrom .tracer import InstanaTracer\nfrom .options import Options\n\n# Import & ini... | python | chosen |
[
{
"from": "system",
"value": "Create test to check that a person has been added\n"
},
{
"from": "human",
"value": "import unittest\nfrom src.dojo import Dojo\n\n\nclass TestCreateRoom (unittest.TestCase):\n def test_create_room_successfully(self):\n my_class_instance = Dojo()\n ... | python | chosen |
[
{
"from": "system",
"value": "Add path to convergence test lspr zip file\n"
},
{
"from": "human",
"value": "import os\nimport time\nimport subprocess\nimport datetime\n\nfrom check_for_meshes import check_mesh\n\n# tests to run\ntests = ['sphere_lspr.py', 'sphere_multiple_lspr.py']\n\n# specify ... | python | chosen |
[
{
"from": "system",
"value": ": Create documentation of DataSource Settings \n\nTask-Url: "
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.stoettner@stoeps.de\n# Documentation: http://scri... | python | chosen |
[
{
"from": "system",
"value": "Make running unit tests more friendly\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom unittest import main\n\nfrom test_core import *\nfrom test_lazy import *\n\n\nif __name__ == '__main__':\n main()\n"
},
{
"from... | python | chosen |
[
{
"from": "system",
"value": "Remove input import from six.moves\n\n"
},
{
"from": "human",
"value": "import random\nimport unittest\n\nfrom six.moves import input\n\nfrom .config import *\nfrom tweepy import API, OAuthHandler\n\n\nclass TweepyAuthTests(unittest.TestCase):\n\n def testoauth(s... | python | chosen |
[
{
"from": "system",
"value": "Update the number of components listed in the model.\n"
},
{
"from": "human",
"value": "import os\nimport unittest\n\nimport opensim as osim\n\ntest_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),\n 'tests')\n\n# Silence wa... | python | chosen |
[
{
"from": "system",
"value": "Add --regression command line option\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nfrom dials.conftest import regression_data, run_in_tmpdir\n"
},
{
"from": "gpt",
"value": "from __future__ import ... | python | chosen |
[
{
"from": "system",
"value": "Fix test runner for development Django\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 ... | python | chosen |
[
{
"from": "system",
"value": "Test suite is taking shape. :)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom unittest import TestCase\n\n\nclass TestOneAll(TestCase):\n def test_whether_test_runs(self):\n self.assertTrue(True)\n"
},
{
"from": "gpt",
"value"... | python | chosen |
[
{
"from": "system",
"value": "feat: Merge product reordered column with order ids\n"
},
{
"from": "human",
"value": "# importing modules/ libraries\nimport pandas as pd\nimport numpy as np\n\norders_prior_df = pd.read_csv('Data/orders_prior_sample.csv')\n\norder_products_prior_df = pd.read_csv('... | python | chosen |
[
{
"from": "system",
"value": "Fix if statements checking if header/footer exist\n"
},
{
"from": "human",
"value": "from IPython.nbconvert.preprocessors import Preprocessor\nfrom IPython.nbformat.current import read as read_nb\nfrom IPython.utils.traitlets import Unicode\n\n\nclass IncludeHeaderF... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with non-existing color in compute_histo_RYG\n"
},
{
"from": "human",
"value": "import PIL.Image\nimport PIL.ImageMath\nimport urllib.request\nfrom io import BytesIO\n\n\ndef load_img_url(url):\n req = urllib.request.urlopen(url)\n data = BytesIO(req... | python | chosen |
[
{
"from": "system",
"value": "Add support for the patching connection and the prefix through config dict\n"
},
{
"from": "human",
"value": "from boto.dynamodb2.layer1 import DynamoDBConnection\n\nfrom .model import Model\n\n\ndef patch_dynamodb_connection(**kwargs):\n \"\"\":class:`boto.dynam... | python | chosen |
[
{
"from": "system",
"value": "Remove mfr parameter from init_app\n"
},
{
"from": "human",
"value": "\"\"\"\nUpdate User.comments_viewed_timestamp field & comments model.\nAccompanies https://github.com/CenterForOpenScience/osf.io/pull/1762\n\"\"\"\nfrom modularodm import Q\nfrom framework.auth.c... | python | chosen |
[
{
"from": "system",
"value": "Include createHour field that will streamline groupBy operations in the db\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.timezone import now\n\nclass Reading(models.Model):\n # Authenticating on user\n owner = models.Foreig... | python | chosen |
[
{
"from": "system",
"value": "Create folder if it doesn't exist\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport tornado.web\nimport os\nimport uuid\n\nclass UploadHandler(tornado.web.RequestHandler):\n def post(self):\n fileinfo = self.request.files['filearg'][0]\n ... | python | chosen |
[
{
"from": "system",
"value": "Change wording in error message\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n#\n# Replaces the extension \".la\" with \".so\" in the library URI in all \n# \".cca\" files in %{buildroot}%{_datadir}/cca.\n#\n# Mark Piper (mark.piper@colorado.edu)\n\nimp... | python | chosen |
[
{
"from": "system",
"value": "Add a hashable-dict type for testing\n"
},
{
"from": "human",
"value": "\ndef filterDictToStr(filterDict):\n return ', '.join(['%s=%s' %(key, repr(value)) for key, value in filterDict.items()])\n\nclass DataObject(object):\n\n def __init__(self, **kwargs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove duplicate import. (Thanks to MechanisM)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.views.generic import View\nfrom django.views.decorators.csrf import csrf_exempt\nfrom django.http import HttpResponse\n\ntry:\n from django.ht... | python | chosen |
[
{
"from": "system",
"value": "Switch to ORD. Add MACHINE_NAME.\n"
},
{
"from": "human",
"value": "import threading\n\nfrom flask import Flask\n\nfrom users import users\n\napi = Flask(__name__)\nlock = threading.Lock()\n\nuser_num = 0\n\n@api.route('/')\ndef index():\n return 'Rackspace User ... | python | chosen |
[
{
"from": "system",
"value": "Add version flag to sorted nearest\n"
},
{
"from": "human",
"value": "from sorted_nearest.src.sorted_nearest import (nearest_previous_nonoverlapping,\n nearest_next_nonoverlapping,\n ... | python | chosen |
[
{
"from": "system",
"value": "Use the updated pymongo syntax for mongo snapshot cursor\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport datetime\nimport logging\n\nimport api\n\n\ndef get_now_str():\n format = '%d.%h-%H:%M:%S'\n now = datetime.datetime.now()\n now_str ... | python | chosen |
[
{
"from": "system",
"value": "Fix URL name for submission page\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns, url, include\nfrom piston.resource import Resource\n\nfrom .views import (CreateRepoView, UpdatePasswordView,\n ListSubmissionView,... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong ascii character in comments of base service\n"
},
{
"from": "human",
"value": "from sqlalchemy.exc import StatementError\nfrom zou.app.utils import events\n\n\ndef get_instance(model, instance_id, exception):\n \"\"\"\n Get instance of any model from... | python | chosen |
[
{
"from": "system",
"value": "Use `SECRET_KEY` from env in Heroku\n"
},
{
"from": "human",
"value": "import dj_database_url\n\nfrom .common import *\n\nSECRET_KEY = '4ln7qg*67amc&7-h^=^0%ml_s(w4y_fy4uybib%j(v(46-x0i2'\nDEBUG = False\nALLOWED_HOSTS = ['*']\n\ndb_from_env = dj_database_url.config(... | python | chosen |
[
{
"from": "system",
"value": "[System][Serializer] Use pickle protocole 2 to BC for Python2*\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# This file is part of the pymfony package.\n#\n# (c) Alexandre Quercia <alquerci@email.com>\n#\n# For the full copyright and license informati... | python | chosen |
[
{
"from": "system",
"value": "Put commands in alphabetical order for my own sanity\n"
},
{
"from": "human",
"value": "class OutputHandler(object):\n def __init__(self, connection):\n self.connection = connection\n\n def cmdNICK(self, nick):\n self.connection.sendMessage(\"NIC... | python | chosen |
[
{
"from": "system",
"value": "Change the order of shape.\n"
},
{
"from": "human",
"value": "#\n\"\"\"\n\n\n\"\"\"\n\nfrom ..analytic_signal import analytic_signal\n\nimport numpy as np\n\n\ndef cos(data, fb=None, fs=None, pairs=None):\n \"\"\"\n\n \"\"\"\n n_samples, n_rois = np.shape(d... | python | chosen |
[
{
"from": "system",
"value": "Add test for bitbucket domain\n"
},
{
"from": "human",
"value": "from cookiecutter.main import is_repo_url\n\n\ndef test_is_repo_url():\n \"\"\"Verify is_repo_url works.\"\"\"\n assert is_repo_url('gitolite@server:team/repo') is True\n assert is_repo_url('g... | python | chosen |
[
{
"from": "system",
"value": "Add unit test for opening bible reference urls\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport unittest\nimport yv_suggest.open as yvs\nimport inspect\n\nclass OpenTestCase(unittest.TestCase):\n '''test the handling of Bible reference URLs'''\n\n... | python | chosen |
[
{
"from": "system",
"value": "Reduce the size of log_name so it fits within mysql's limit.\n"
},
{
"from": "human",
"value": "\nfrom database import db\nfrom conversions import datetime_from_str\n\n\nclass LogEntry(db.Model):\n\n id = db.Column(db.Integer, primary_key=True)\n timestamp = d... | python | chosen |
[
{
"from": "system",
"value": "Change to reply only if target has karma\n"
},
{
"from": "human",
"value": "\"\"\"Keeps track of karma counts.\n@package ppbot\n\n@syntax .karma <item>\n\"\"\"\nimport re\n\nfrom modules import *\n\nclass Karmamod(Module):\n\n def __init__(self, *args, **kwargs):... | python | chosen |
[
{
"from": "system",
"value": "Implement backend newaccount form verification\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.http import JsonResponse\nimport common.render\nfrom common.settings import get_page_config\n\n\ndef form(request):\n ''' The signup... | python | chosen |
[
{
"from": "system",
"value": "Update L3 agent drivers singletons to look at new agent\n\nL3 agent drivers are singletons. They're created once, and hold\nself.l3_agent. During testing, the agent is tossed away and\nre-built, but the drivers singletons are pointing at the old\nagent, and its old configuratio... | python | chosen |
[
{
"from": "system",
"value": "Use reverse_lazy to avoid weird url setup circularity.\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.core.urlresolvers import reverse\nfrom django.views.generic.base import RedirectView\n\nfrom django.contrib imp... | python | chosen |
[
{
"from": "system",
"value": "Clarify arguments in tests slightly\n"
},
{
"from": "human",
"value": "from planterbox import (\n step,\n hook,\n)\n\n\nhooks_run = set()\n\n\n@hook('before', 'feature')\ndef before_feature_hook(feature_suite):\n global hooks_run\n hooks_run.add(('before... | python | chosen |
[
{
"from": "system",
"value": "Return geo coordinates in decimal\n"
},
{
"from": "human",
"value": "import csv\nimport os\n\n\nHERE = os.path.dirname(os.path.abspath(__file__))\n\n\ndef load_db():\n with open(os.path.join(HERE, 'The_Haiti_Earthquake_Database.csv')) as f:\n reader = csv.... | python | chosen |
[
{
"from": "system",
"value": "Add Mysql Tracker database to store our data\n"
},
{
"from": "human",
"value": "import os\n\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import sessionmaker\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm.scoping import scoped_ses... | python | chosen |
[
{
"from": "human",
"value": "Implement flow table modifications classes and enums\n"
},
{
"from": "gpt",
"value": "\"\"\"Modifications to the flow table from the controller\"\"\"\n\n# System imports\nimport enum\n\n# Third-party imports\n\n# Local source tree imports\nfrom common import action\n... | python | chosen |
[
{
"from": "system",
"value": "Modify parsing logic for last_modified in JSON\n"
},
{
"from": "human",
"value": "# Stdlib imports\nfrom datetime import datetime\nfrom pytz import timezone\n\n# Core Django imports\nfrom django.utils.timezone import utc\n\n# Imports from app\nfrom sync_center.model... | python | chosen |
[
{
"from": "system",
"value": "Update x and y stage limits according to Orbis stage calibration.\n"
},
{
"from": "human",
"value": "#\nplatedir = 'J:\\\\hte_jcap_app_proto\\\\plate'\nmapdir = 'J:\\\\hte_jcap_app_proto\\\\map'\nrundir = 'C:\\\\INST\\\\RUNS'\nstagx_min = 0\nstagx_max = 101.9\nstagy... | python | chosen |
[
{
"from": "system",
"value": "Enable filtering ProposalVotes by reviewer.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom conf_site.reviews.models import (\n ProposalFeedback,\n ProposalNotification,\n ProposalResult,\n ProposalVote,\n)\n\n\nclass Proposal... | python | chosen |
[
{
"from": "system",
"value": "Update test to reflect the refactor\n"
},
{
"from": "human",
"value": "import mythril.laser.ethereum.transaction as transaction\nfrom mythril.ether import util\nimport mythril.laser.ethereum.svm as svm\nfrom mythril.disassembler.disassembly import Disassembly\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Update frontend to chrome r108801\n"
},
{
"from": "human",
"value": "# Copyright 2011 Google 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 of ... | python | chosen |
[
{
"from": "system",
"value": "Remove default option for `desa`\n"
},
{
"from": "human",
"value": "from conans import ConanFile, CMake\n\n\nclass EsappConan(ConanFile):\n\n name = 'esapp'\n version = '0.4.1'\n url = 'https://github.com/jason2506/esapp'\n license = 'BSD 3-Clause'\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary project root variable from webpack resolve script\n"
},
{
"from": "human",
"value": "import json\nimport os\nimport wiki\n\nPROJECT_ROOT_DIRECTORY = os.path.dirname(globals()['__file__'])\nDJANGO_WIKI_STATIC = os.path.join(os.path.dirname(wiki.__f... | python | chosen |
[
{
"from": "system",
"value": "Add better tests for manifest json schema\n"
},
{
"from": "human",
"value": "\nimport pytest\n\nfrom pre_commit.clientlib.validate_manifest import additional_manifest_check\nfrom pre_commit.clientlib.validate_manifest import InvalidManifestError\nfrom pre_commit.cli... | python | chosen |
[
{
"from": "system",
"value": "Update stable channel builders to 1.6 branch\n\nReview URL: https://codereview.chromium.org/494783003\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@291643 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "# Copyright 2013 The Chromium... | python | chosen |
[
{
"from": "system",
"value": "Update stable channel to 1.1\n\nReview URL: https://codereview.chromium.org/138273002\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@244706 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "# Copyright 2013 The Chromium Authors. All ri... | python | chosen |
[
{
"from": "system",
"value": "Add unmatched_legislator to the spec\n"
},
{
"from": "human",
"value": "from .base import BaseImporter\n\n\nclass MembershipImporter(BaseImporter):\n _type = 'membership'\n\n def __init__(self, jurisdiction_id, person_importer, org_importer):\n super(Me... | python | chosen |
[
{
"from": "system",
"value": "Test two flow invocations after each other\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT\n# All rights reserved. This work is under a BSD license, see LICENSE.TXT.\n\nfrom jenkinsflow.flow import serial\nfrom .fram... | python | chosen |
[
{
"from": "system",
"value": "cputest: Make sure generated files pass syntax-check\n\nThe tests/cputestdata/cpu-parse.sh would produce JSON files with QEMU\nreplies which wouldn't pass syntax-check. Let's fix this by not emitting\nan extra new line after reformatting the JSON file.\n\nSigned-off-by: Jiri De... | python | chosen |
[
{
"from": "system",
"value": "Remove parsing from public interface\n"
},
{
"from": "human",
"value": "\"\"\"EVELink - Python bindings for the EVE API.\"\"\"\n\nimport logging\n\nfrom evelink import account\nfrom evelink import api\nfrom evelink import char\nfrom evelink import constants\nfrom ev... | python | chosen |
[
{
"from": "system",
"value": "Fix in tests for exception messages\n"
},
{
"from": "human",
"value": "class DockerStartError(Exception):\n pass\n\n\nclass NotNamedParameterFound(Exception):\n pass\n\n\nclass SplashError(Exception):\n def __init__(self, msg):\n self.msg = 'Splash e... | python | chosen |
[
{
"from": "system",
"value": "Fix test after updating the French tokenizer stuff\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom ...language import Language\nfrom ...attrs import LANG\nfrom ...fr.language_data import TOKENIZER_EXCEPTIONS, STOP_... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.