conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Store the rotation matrix corresponding to the orientation in the item.\n"
},
{
"from": "human",
"value": "\"\"\"Provide the class Image corresponding to an IdxItem.\n\"\"\"\n\nimport os.path\nimport re\nfrom PySide import QtGui\n\n\nclass ImageNotFoundError(Excepti... | python | chosen |
[
{
"from": "system",
"value": "Create Order and OrderItem Models\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n"
},
{
"from": "gpt",
"value": "from django.db import models\n\nfrom ..shop.models import Product\n\n\nclass Order(models.Mod... | python | chosen |
[
{
"from": "system",
"value": "Fix migration; work around node whose files were unmigrated\n\n[skip ci]\n"
},
{
"from": "human",
"value": "\"\"\"\nThis will add a date_modified field to all nodes. Date_modified will be equivalent to the date of the last log.\n\"\"\"\nimport sys\nimport logging\n... | python | chosen |
[
{
"from": "system",
"value": "Fix BERT -> bert in bert_tasks\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom nose.tools import nottest\n\nfrom metal.mmtl.BERT_tasks import create_tasks\nfrom metal.mmtl.metal_model import MetalModel\nfrom metal.mmtl.trainer import MultitaskTrainer\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix no id property for RadioStation\n"
},
{
"from": "human",
"value": "import time\n\nfrom rootio.radio.models import Station\n\nfrom call_handler import CallHandler\nfrom program_handler import ProgramHandler\nfrom community_menu import CommunityMenu\n\n\nclass Rad... | python | chosen |
[
{
"from": "system",
"value": "Fix iteritems isn't a method name in Py3\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import absolute_import\nimport os\nimport yaml\nfrom .exceptions import EnvironmentNotFound, FileNotFound\nfrom .package import Package\n\n\nclass Config(obj... | python | chosen |
[
{
"from": "system",
"value": "Use the C Loader/Dumper when available\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nfrom collections import OrderedDict\n\nimport yaml\n\n# Adapted from http://stackoverflow.com/a/21912744/8121... | python | chosen |
[
{
"from": "system",
"value": "Define an uninterpreted scheduling function\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nprint \"(set-info :status unknown)\"\nprint \"(set-option :produce-models true)\"\nprint \"; Logic is now \\\"Whatever Z3 accepts\\\" (set-logic AUFBV)\"\nprint \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix the file type asserts on Python 2 (I hope).\n"
},
{
"from": "human",
"value": "from io import BufferedReader, BytesIO\n\nimport factory\nfrom django.core.files import File\n\nfrom incuna_test_utils.factories import images\n\n\ndef test_local_file_field():\n c... | python | chosen |
[
{
"from": "system",
"value": "Add support for NotoSans and Arimo."
},
{
"from": "human",
"value": "\"\"\"\n Copyright 2014 Google Inc. All rights reserved.\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.\... | python | chosen |
[
{
"from": "system",
"value": "Fix TemplateTag issue with filters\n"
},
{
"from": "human",
"value": "import json\nfrom django import template\n\nregister = template.Library()\n\n\n@register.filter(name='key')\ndef key(d, key_name):\n if key_name in d:\n return d[key_name]\n\n return ... | python | chosen |
[
{
"from": "system",
"value": "Allow tweets only from 9am\n"
},
{
"from": "human",
"value": "import os\nimport logging\nfrom datetime import datetime\nfrom pytz import timezone\n\nlogger = logging.getLogger('notifierTwitter')\n\nclass NotifierBase:\n def __init__(self):\n self.domainName = os... | python | chosen |
[
{
"from": "system",
"value": "Fix suggested solution for failure to clone.\n"
},
{
"from": "human",
"value": "from __future__ import division, absolute_import, print_function\n\nimport contextlib\n\nfrom punic.logger import logger\n\n\nclass RepositoryNotClonedError(Exception):\n pass\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Use newer factory-boy Meta syntax for s3\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Factories for the S3 addon.\"\"\"\nfrom factory import SubFactory, Sequence\nfrom tests.factories import ModularOdmFactory, UserFactory, ProjectFactory, Extern... | python | chosen |
[
{
"from": "system",
"value": "Remove leaflet static files included by default by sigal\n\nLeaflet is not used by this theme, those static files are unnecessary.\n"
},
{
"from": "human",
"value": "\"\"\"Use the 153957-theme as theme for the gallery\"\"\"\n\nfrom pathlib import Path\n\nfrom sigal ... | python | chosen |
[
{
"from": "system",
"value": "Support a different path to /nail/etc/services\n\nThis will allow us to distribute location mapping info via an alternate mechanism to yelpsoa-configs,\nas I want to use IP mapping information in preference to DNS to produce the habitat etc mapping\nfor a machine, and I don't w... | python | chosen |
[
{
"from": "system",
"value": "Add a zone port range.\n"
},
{
"from": "human",
"value": "# ##### BEGIN AGPL LICENSE BLOCK #####\n# This file is part of SimpleMMO.\n#\n# Copyright (C) 2011, 2012 Charles Nelson\n#\n# This program is free software: you can redistribute it and/or modify\n# it under ... | python | chosen |
[
{
"from": "system",
"value": "Rename extension to .so so python can import\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport os\nimport shutil\nfrom sys import platform\n\nif platform == 'linux' or platform == 'linux2':\n EXT = '.so'\nelse:\n EXT = '.dylib'\n\nSCRIPT_... | python | chosen |
[
{
"from": "system",
"value": "Add CORS headers to main studio Flask application, to allow initial API version request\n\nRemove before_request from main application\n"
},
{
"from": "human",
"value": "import webbrowser\n\nfrom flask import Flask, jsonify\nfrom gevent.pywsgi import WSGIServer\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Replace cubehelix with the viridis colormap in the RAG drawing example\n"
},
{
"from": "human",
"value": "\"\"\"\n======================================\nDrawing Region Adjacency Graphs (RAGs)\n======================================\n\nThis example constructs a Regi... | python | chosen |
[
{
"from": "system",
"value": "Make it so we can choose port\n"
},
{
"from": "human",
"value": "from geomancer import create_app\n\napp = create_app()\n\nif __name__ == \"__main__\":\n app.run(debug=True)\n"
},
{
"from": "gpt",
"value": "from geomancer import create_app\n\napp = cr... | python | chosen |
[
{
"from": "system",
"value": "Allow to run objgraph before exiting\n\nUse \"--objgraph\" to show most common types.\nAdd \"--show-backrefs <some type>\" do draw a graph of backreferences.\n"
},
{
"from": "human",
"value": "import sys\nfrom swift.common.utils import parse_options\nfrom swift.comm... | python | chosen |
[
{
"from": "system",
"value": "Use oslotest instead of common test module\n\nModule openstack.common.test is obsolete, so we should use\noslotest library instead of it.\nModified tests and common database code, new requirement added.\n\nChange-Id: I853e548f11a4c3785eaf75124510a6d789536634\n"
},
{
"fr... | python | chosen |
[
{
"from": "system",
"value": "Add limitation of this defence in the comment"
},
{
"from": "human",
"value": "import torchaudio\nimport librosa\n\n\n# resampling reference https://core.ac.uk/download/pdf/228298313.pdf\n# resampling input transformation defense for audio\n\nT = torchaudio.transfor... | python | chosen |
[
{
"from": "system",
"value": "Fix url field for runner version serializer\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\nfrom .models import Runner, RunnerVersion\n\n\nclass RunnerVersionSerializer(serializers.ModelSerializer):\n class Meta(object):\n model ... | python | chosen |
[
{
"from": "system",
"value": "Update configuration options for Flask-SQLAlchemy\n"
},
{
"from": "human",
"value": "# This is the config file for the pegasus service. Save a copy of it in\n# one of the following locations:\n#\n# 1. $PWD/service_config.py\n# 2. ~/.pegasus/service_config.py\n# ... | python | chosen |
[
{
"from": "system",
"value": "Add search functions (currently disabled)\n"
},
{
"from": "human",
"value": "from motobot import command\n\n\n@command('rr')\ndef rr_command(message, database):\n return \"If you are looking for anime/manga recommendations we have a database created specifically ... | python | chosen |
[
{
"from": "system",
"value": "Check Python version at runtime\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport sys\n\nPY2 = sys.version_info[0] == 2\n\n\nif PY2: # pragma: no cover\n import urlparse\n from urllib import \\\n quote as urlquote, \\\n unqu... | python | chosen |
[
{
"from": "system",
"value": "Use ManaThisTurn action for The Coin\n"
},
{
"from": "human",
"value": "# The Coin\nclass GAME_005:\n\tdef play(self):\n\t\tself.controller.temp_mana += 1\n"
},
{
"from": "gpt",
"value": "\"\"\"\nGAME set and other special cards\n\"\"\"\nfrom ..utils imp... | python | chosen |
[
{
"from": "system",
"value": "examples: Adjust to Flask>=1.0 extension nanespace\n\nPrevious versions of Flask installed extensions under `flask.ext`; that\nis no longer the case.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright: See the LICENSE file.\n\nfrom flask import ... | python | chosen |
[
{
"from": "system",
"value": "Add the MSF API key and password fields\n"
},
{
"from": "human",
"value": "from nflpool.data.dbsession import DbSessionFactory\n\n\n# You will need an account from MySportsFeed to access their API. They offer free access to developers\n# Edit below with your creden... | python | chosen |
[
{
"from": "system",
"value": "Move testing code into \"if __name__ == '__main__'\" so it's not run on import.\n"
},
{
"from": "human",
"value": "import errno\nimport hotshot\nimport hotshot.stats\nimport os\nimport sys\nimport test.pystone\n\n\nif sys.argv[1:]:\n logfile = sys.argv[1]\nelse:\... | python | chosen |
[
{
"from": "system",
"value": "Fix code to deal with large numbers\n"
},
{
"from": "human",
"value": "# Python 2\r\n\r\n# Enter your code here. Read input from STDIN. Print output to STDOUT\r\n\r\ndef base(m,d): # Converts d (base m) to its decimal equivalent\r\n result = 0\r\n c = 1\r\n ... | python | chosen |
[
{
"from": "system",
"value": "Handle topics with zero elements\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nimport requests as req\nfrom pymongo import MongoClient\n\nfrom pypocketexplore.config import MONGO_URI\nfrom time import sleep\n\ndef extract_topic_items(topic):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add more msgs for staff/user/new view\n"
},
{
"from": "human",
"value": "from django.shortcuts import get_object_or_404, render, redirect\nfrom django.shortcuts import render\nfrom apps.staff.forms import NewUserForm\nfrom django.contrib.auth.models import User\nfro... | python | chosen |
[
{
"from": "system",
"value": "Change the print statement to use __future__.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\n\"\"\"\nReset all tables in the database.\n\"\"\"\n\nfrom lightcurve_pipeline.database.database_interface import base\nfrom lightcurve_pipeline.utils.utils imp... | python | chosen |
[
{
"from": "system",
"value": "Fix flaky mcrouter tko tests\n\nSummary: As above\n\nReviewed By: edenzik\n\nDifferential Revision: D25722019\n\nfbshipit-source-id: 06ff9200e99f3580db25fef9ca5ab167c50b97ed\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. an... | python | chosen |
[
{
"from": "system",
"value": "Make Connect4's __str__ more readable\n"
},
{
"from": "human",
"value": "class Connect4(object):\n def __init__(self):\n self.pieces = [[] for i in xrange(7)]\n self.turn = 0\n\n def move(self, column):\n for i in xrange(column, column + 7... | python | chosen |
[
{
"from": "system",
"value": "Make a bit more sensible model.\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n"
},
{
"from": "gpt",
"value": "from django.db import models\nfrom registration.models import RegistrationProfile\n\n\nclass Pa... | python | chosen |
[
{
"from": "system",
"value": "FIX numerical issues in test on travis-ci\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom autosklearn.pipeline.components.regression.liblinear_svr import \\\n LibLinear_SVR\nfrom autosklearn.pipeline.util import _test_regressor\n\nimport sklearn.metric... | python | chosen |
[
{
"from": "system",
"value": "Load the backend with get_cache\n"
},
{
"from": "human",
"value": "import time\nfrom django.test import TestCase\nfrom infinite_memcached.cache import MemcachedCache\n\nclass InfiniteMemcached(TestCase):\n def test_handle_timeouts(self):\n mc = MemcachedCa... | python | chosen |
[
{
"from": "system",
"value": "Add test for deleting subsystem as normal user\n"
},
{
"from": "human",
"value": "\"\"\"Tests for plugin.py.\"\"\"\n\n\ndef test_plugin():\n pass\n"
},
{
"from": "gpt",
"value": "\"\"\"Tests for plugin.py.\"\"\"\nimport pytest\n\nfrom ckan.tests impor... | python | chosen |
[
{
"from": "system",
"value": "Handle no user at all\n"
},
{
"from": "human",
"value": "from grandchallenge.workstations.models import Session\n\n\ndef workstation_session(request):\n \"\"\" Adds workstation_session. request.user must be set \"\"\"\n\n s = None\n\n if not request.user.is... | python | chosen |
[
{
"from": "system",
"value": "Add sjevents to modules exported.\n"
},
{
"from": "human",
"value": "# Settings for Exporter module.\n\n# Exportable modules.\n# Modules must be a valid python module, in the import path.\nEXPORT_MODULES = ('sjtools', 'sjfs', 'utils')\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Remove NA values from export.\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nclass Exporter():\n def __init__(self, plotinfo, viewbox):\n self.plotinfo = plotinfo\n self.viewbox = viewbox\n\n def updaterange(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use format to properly format file for process_logdata_parser.py\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport argparse\nimport os\n\n\"\"\"\nRuns process_logdata_ekf.py on all the files in the suplied directory with a .ul... | python | chosen |
[
{
"from": "system",
"value": "Move database query assembly and execution from view functions to services ('core_admin' blueprint)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.blueprints.core_admin.views\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2016 ... | python | chosen |
[
{
"from": "system",
"value": "Fix import path to default_commands\n"
},
{
"from": "human",
"value": "# noqa\nfrom dodo_commands.defaults.commands.standard_commands import DodoCommand\nfrom dodo_commands import call_command\nfrom plumbum import local\nfrom plumbum.cmd import git\n\n\nclass Comman... | python | chosen |
[
{
"from": "system",
"value": "Make sure the OEmbed type can never be used to control filenames.\n\nMinor risk, as it's still a template path, but better be safe then sorry.\n"
},
{
"from": "human",
"value": "\"\"\"\nDefinition of the plugin.\n\"\"\"\nfrom django.utils.translation import ugettext... | python | chosen |
[
{
"from": "system",
"value": "test: Put both victory exit and defeat trap on a map\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom ookoobah import core\nfrom ookoobah import utils\n\ngame = core.Game()\nutils.populate_grid_from_string(game.grid, \"\"\"\n # # # # # #\n # > ... | python | chosen |
[
{
"from": "system",
"value": "Change version number to dev again.\n"
},
{
"from": "human",
"value": "__version__ = (0, 10, 1)\n\n\n# Make a couple frequently used things available right here.\nfrom .bundle import Bundle\nfrom .env import Environment\n"
},
{
"from": "gpt",
"value": "_... | python | chosen |
[
{
"from": "system",
"value": "Add setting for CQLENGINE_DEFAULT_KEYSPACE to test app"
},
{
"from": "human",
"value": "# CQLENGINE settings\nCQLENGINE_HOSTS= 'localhost:9160'\n"
},
{
"from": "gpt",
"value": "# CQLENGINE settings\nCQLENGINE_HOSTS= 'localhost:9160'\nCQLENGINE_DEFAULT_KE... | python | chosen |
[
{
"from": "system",
"value": "Add tasks to list of mq tasks\n"
},
{
"from": "human",
"value": "from celery import Celery\nfrom tornado.options import options\n\nfrom tasks.helpers import create_mq_url\n\nqueue_conf = {\n 'CELERY_TASK_SERIALIZER': 'json',\n 'CELERY_ACCEPT_CONTENT': ['json']... | python | chosen |
[
{
"from": "system",
"value": "Fix bug with comparison of lists and tuples\n"
},
{
"from": "human",
"value": "import warnings\nDEFAULT_MPL_BACKEND = 'TkAgg'\ntry:\n import matplotlib\n\n # This is necessary. Random backends might respond incorrectly.\n matplotlib.use(DEFAULT_MPL_BACKEND)... | python | chosen |
[
{
"from": "system",
"value": "Change test to use a user model with name not id for pk\n"
},
{
"from": "human",
"value": "import uuid\nfrom django.db import models\nfrom django.contrib.auth.models import AbstractUser\n\n\nclass MyUser(AbstractUser):\n id = models.UUIDField(primary_key=True, de... | python | chosen |
[
{
"from": "system",
"value": "Test urls - list of urls instead of patterns()\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url, include\nfrom django.contrib import admin\n\n\nadmin.autodiscover()\n\n\nurlpatterns = patterns(\n '',\n url(r'^admin/', include(admin... | python | chosen |
[
{
"from": "system",
"value": "Stop making --integration an argument.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015-2016 MIT Probabilistic Computing Project\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file exc... | python | chosen |
[
{
"from": "system",
"value": "Add docstring explaining the parametrization of data files\n"
},
{
"from": "human",
"value": "\"\"\"Base for all tests with definitions of fixtures\"\"\"\nimport glob\nimport os\n\nTEST_DATA_FILES_LOCATION = os.path.join(os.path.dirname(__file__), \"data\")\nTEST_DA... | python | chosen |
[
{
"from": "system",
"value": "Make sure tests run on 'setup.py test'\n\nNose was parsing the argv passed to setup.py (oh, global variables).\nAssume that if 'distutils' are loaded then this is the case; and pass\nthrough argv if it isn't. Also, update the suggested commands for the\nextra requirements.\n"
... | python | chosen |
[
{
"from": "system",
"value": "Test read from stdin and write to stdout\n"
},
{
"from": "human",
"value": "from mdformat._cli import run\n\nUNFORMATTED_MARKDOWN = \"\\n\\n# A header\\n\\n\"\nFORMATTED_MARKDOWN = \"# A header\\n\"\n\n\ndef test_no_files_passed():\n assert run(()) == 0\n\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Change kotlin dependency version from 1.6.0-RC2 to 1.6.10\n"
},
{
"from": "human",
"value": "import re\nimport subprocess\n\nmany_versions = [ '1.4.32', '1.5.31', '1.6.0-RC2' ]\n\ndef get_single_version():\n versionOutput = subprocess.run(['kotlinc', '-version'],... | python | chosen |
[
{
"from": "system",
"value": "Add proper solution for projects 18 and 67\n"
},
{
"from": "human",
"value": "\nimport math\n\ndef blad():\n ins = open( \"triangles_18.txt\", \"r\" )\n arr = []\n idx = 0\n for line in ins:\n try:\n l = [int(x) for x in line.split()]\n ... | python | chosen |
[
{
"from": "system",
"value": "Set default port to 8000\n"
},
{
"from": "human",
"value": "from gepify import create_app\n\napp = create_app()\n\nif __name__ == \"__main__\":\n app.run(host='0.0.0.0')\n"
},
{
"from": "gpt",
"value": "from gepify import create_app\n\napp = create_ap... | python | chosen |
[
{
"from": "system",
"value": "[svn] Tweak for exporting the symbols\n\n--HG--\nbranch : trunk\n"
},
{
"from": "human",
"value": "import threadinglocal, sys\n\nif sys.version < '2.4':\n class _RequestConfig(object):\n __shared_state = threadinglocal.local()\n def __getattr__(self, name... | python | chosen |
[
{
"from": "system",
"value": "Fix for deprecation warning in django 1.7rc2\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom twango.query import TwistedQuerySet\n\nclass TwistedManager(models.Manager):\n queryset_class = TwistedQuerySet\n\n def get_query_set(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Make sure we don't have a import namespace clash with DRF\n\nFor python 2.7 you need to add from __future__ import absolute_import\n"
},
{
"from": "human",
"value": "import logging\n\nfrom django.contrib.auth import authenticate\nfrom rest_framework import exception... | python | chosen |
[
{
"from": "system",
"value": "Fix output dir for arm target\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\n\n\ndef get_output_dir(target_arch, component):\n # Build in \"out_component\" for component build.\n output_dir = 'out'\n if component == 'shared_library':\n ... | python | chosen |
[
{
"from": "system",
"value": "MNT: Remove coverage on replay; development is suspended.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# This file is closely based on tests.py from matplotlib\n#\n# This allows running the matplotlib tests from the command line: e.g.\n#\n# $ python t... | python | chosen |
[
{
"from": "system",
"value": "Allow the port to overridden by and environment variable.\n"
},
{
"from": "human",
"value": "from mmmpaste import app\n\napp.run(debug = True)\n"
},
{
"from": "gpt",
"value": "import os\n\nfrom mmmpaste import app\n\nPORT = int(os.environ['PORT']) if 'PO... | python | chosen |
[
{
"from": "system",
"value": "Remove duplicated key from dict in Semantic Scholar\n"
},
{
"from": "human",
"value": "# SPDX-License-Identifier: AGPL-3.0-or-later\n\"\"\"\n Semantic Scholar (Science)\n\"\"\"\n\nfrom json import dumps, loads\n\n\nsearch_url = 'https://www.semanticscholar.org/api/1... | python | chosen |
[
{
"from": "system",
"value": "Convert into a class to match the other handlers.\n"
},
{
"from": "human",
"value": "import requests, json, urllib\n\nSEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'\nAPI_KEY = 'FILL THIS IN'\n\ndef getCOREMentions(identifier, **kwargs):\n \"\"\"Return the ... | python | chosen |
[
{
"from": "system",
"value": "Set redis socket timeout to 5s\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, request, make_response, g\nfrom redis import Redis\nimport os\nimport socket\nimport random\nimport json\n\noption_a = os.getenv('OPTION_A', \"Cats\")\noption... | python | chosen |
[
{
"from": "system",
"value": "Change wait period from 30 seconds to 60 seconds\n"
},
{
"from": "human",
"value": "from xbee import ZigBee\nimport sys\nimport serial\nimport datetime\nimport struct\nimport collections\nimport threading\n\nfrom decoder import Decoder\nfrom xbee_gateway import XBee... | python | chosen |
[
{
"from": "system",
"value": "Add trigger as an alias for schedule\n\n\"Have you triggered that pipeline\" is a fairly common thing to say.\n"
},
{
"from": "human",
"value": "from gocd.api.endpoint import Endpoint\n\n\nclass Pipeline(Endpoint):\n base_path = 'go/api/pipelines/{id}'\n id = ... | python | chosen |
[
{
"from": "system",
"value": "Fix user profile signal handler.\n"
},
{
"from": "human",
"value": "from django.db import DatabaseError, connection\nfrom django.db.models.signals import post_save\nfrom mezzanine.accounts import get_profile_for_user\nfrom mezzanine.conf import settings\n\n\n__all__... | python | chosen |
[
{
"from": "system",
"value": "Fix missing auth handler when trying to access EC2.\n"
},
{
"from": "human",
"value": "import os\n\nimport redis as pyredis\n\nfrom cloudly.aws import ec2\nfrom cloudly.memoized import Memoized\nimport cloudly.logger as logger\n\nlog = logger.init(__name__)\n\n\n@Me... | python | chosen |
[
{
"from": "system",
"value": "Update CE per 2021-03-11 changes\n"
},
{
"from": "human",
"value": "# Copyright (c) 2020, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject\n\n\nclass CostCategory(AWSObject):\n resource_type = \... | python | chosen |
[
{
"from": "system",
"value": "Fix the enable coverage issue\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom mamba import settings, formatters, reporter, runners, example_collector\n\n\nclass ApplicationFactory(object):\n\n def __init__(self, arguments):\n self._insta... | python | chosen |
[
{
"from": "system",
"value": "Remove whitespace from json hash\n\nReasoning:\n\nhttps://github.com/aanand/fig/commit/e5d8447f063498164f12567554a2eec16b4a3c88#commitcomment-11243708\n\nSigned-off-by: Ben Firshman <73675debcd8a436be48ec22211dcf44fe0df0a64@firshman.co.uk>\n"
},
{
"from": "human",
"... | python | chosen |
[
{
"from": "system",
"value": "Update test values. Trie no longer provides 2 of the answers.\n"
},
{
"from": "human",
"value": "from data import warehouse\nfrom puzzle.examples.gph import a_basic_puzzle\nfrom puzzle.problems import number_problem\nfrom puzzle.puzzlepedia import prod_config\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add phonelog to postgres models copied by copy_domain\n"
},
{
"from": "human",
"value": "from casexml.apps.stock.models import StockReport, StockTransaction, DocDomainMapping\nfrom corehq.apps.products.models import SQLProduct\n\n\ndef copy_postgres_data_for_docs(re... | python | chosen |
[
{
"from": "system",
"value": "Fix to ensure we dont leave any open file handles laying around\n"
},
{
"from": "human",
"value": "/*\n * Copyright 2012-2014 inBloom, Inc. and its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file ex... | python | chosen |
[
{
"from": "system",
"value": "Use str type instead of bytes in Python 2\n"
},
{
"from": "human",
"value": "\"\"\"\nCompatibility constants and functions for the different Python versions.\n\"\"\"\nimport sys\n\n# Python 2.6 or older?\nPY26 = (sys.version_info < (2, 7))\n\n# Python 3.0 or newer?\... | python | chosen |
[
{
"from": "system",
"value": "Add __repr__ for elements for easier debugging\n"
},
{
"from": "human",
"value": "try:\n from StringIO import StringIO\nexcept ImportError:\n from io import StringIO\nfrom inspect import isgenerator\n\n\nclass Element(object):\n tag = ''\n self_closing =... | python | chosen |
[
{
"from": "system",
"value": "Add new fields to the task model\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils import timezone\n\n\nclass Task(models.Model):\n\n EQUALS_CHECK = 'EQ'\n REGEX_CHECK = 'RE'\n\n CHECK_CHOICES = (\n (EQUALS_CHECK, 'Eq... | python | chosen |
[
{
"from": "system",
"value": "Use fully-qualified edxnotes app name when checking if installed\n"
},
{
"from": "human",
"value": "\"\"\"\nUtilities related to edXNotes.\n\"\"\"\n\n\nimport sys\n\n\ndef edxnotes(cls):\n \"\"\"\n Conditional decorator that loads edxnotes only when they exist... | python | chosen |
[
{
"from": "system",
"value": "Fix naming of output dir and file names\n"
},
{
"from": "human",
"value": "import plotly as py\nfrom os import makedirs\n\nfrom utils.names import output_file_name\n\n_out_dir = 'graphs/'\n\ndef export(fig, module, dates):\n graph_dir = '{}{}/'.format(_out_dir, s... | python | chosen |
[
{
"from": "system",
"value": "Refactor the case insensitive option\n"
},
{
"from": "human",
"value": "def rgrep(pattern='', text='', case=''):\n if pattern == '' or text == '':\n return 'Usage: python rgrep [options] pattern files\\nThe options are the same as grep\\n'\n else:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add search by title and user for API.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom pyramid.view import view_config\n\nfrom openchordcharts import model\n\n\n@view_config(route_name='charts.json', renderer='jsonp')\ndef charts_json(request):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add Piet van Oostrum's name to the comments.\n"
},
{
"from": "human",
"value": "# Echo server program using Unix sockets (handles one connection only)\nfrom socket import *\nFILE = 'blabla' \ns = socket(AF_UNIX, SOCK_STREAM)\ns.bind(FILE)\nprint 'Sock na... | python | chosen |
[
{
"from": "system",
"value": "Make permissions declaration DRY (NC-1282)\n"
},
{
"from": "human",
"value": "from nodeconductor.core.permissions import FilteredCollaboratorsPermissionLogic\nfrom nodeconductor.structure.models import CustomerRole, ProjectGroupRole, ProjectRole\n\n\nPERMISSION_LOGI... | python | chosen |
[
{
"from": "system",
"value": "Use https for links to ORCID\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\n\nfrom django import template\nfrom django.conf import settings\nfrom django.contrib.staticfiles.templatetags.staticfiles import static\nfrom django.utils.html import escape... | python | chosen |
[
{
"from": "system",
"value": "FIX class name in camel case:\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nclass Sheet(object):\n\t\"\"\" sheet: Top level object.\n\t\tModels the entire music sheet \"\"\"\n\tdef __init__(self, name):\n\t\tsuper(sheet, self).__init__()\n\t\tself.name = nam... | python | chosen |
[
{
"from": "system",
"value": "CLEAN class name with camel case\n"
},
{
"from": "human",
"value": "class sheet(object):\n\t\"\"\" sheet: Top level object.\n\t\tModels the entire music sheet \"\"\"\n\tdef __init__(self, name):\n\t\tsuper(sheet, self).__init__()\n\t\tself.name = name\n\t\tself.bars... | python | chosen |
[
{
"from": "system",
"value": "Change default generator for client_id and client_secret: now use a safe set of characters that don't need escaping. That way we should avoid problems with many dummy client implementations\n"
},
{
"from": "human",
"value": "from oauthlib.common import CLIENT_ID_CHA... | python | chosen |
[
{
"from": "system",
"value": "Add a few tests that some endpoints load\n"
},
{
"from": "human",
"value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org... | python | chosen |
[
{
"from": "system",
"value": "Update another reference to PIL.\n"
},
{
"from": "human",
"value": "import Image, cStringIO\ndef response(context, flow):\n if flow.response.headers[\"content-type\"] == [\"image/png\"]:\n s = cStringIO.StringIO(flow.response.content)\n img = Image.... | python | chosen |
[
{
"from": "system",
"value": "Add argument for launching client\n\nBefore, client would launch automatically on port you specify as a\npositional argument.\nThis means you can't just not to launch the client.\nNow, there are 2 options:\n 1) -c to launch client on the port defined in settings\n 2) --cl... | python | chosen |
[
{
"from": "system",
"value": "Fix failed tempest tests with KeystoneV2\n\nChange-Id: I78e6a2363d006c6feec84db4d755974e6a6a81b4\nSigned-off-by: Ruslan Aliev <f0566964e0d23c2ac49e399e34dbe87edb487aa1@mirantis.com>\n"
},
{
"from": "human",
"value": "# (C) Copyright 2016 Hewlett Packard Enterprise D... | python | chosen |
[
{
"from": "system",
"value": "Add argparse and provide usage/command line help\n"
},
{
"from": "human",
"value": "\"\"\"\nProxmox VE exporter for the Prometheus monitoring system.\n\"\"\"\n\nimport sys\nfrom pve_exporter.http import start_http_server\n\ndef main(args=None):\n \"\"\"\n Main... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.