conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "[REF] openacademy: Add domain or and ilike\n"
},
{
"from": "human",
"value": "\nfrom openerp import fields, models\n\nclass Session(models.Model):\n _name = 'openacademy.session'\n\n name = fields.Char(required=True)\n start_date = fields.Date()\n duration =... | python | chosen |
[
{
"from": "system",
"value": "Update how we set the connection information for MongoDB to support Mongo 3.0.5\n\nSigned-off-by: Robert Dempsey <715b5a941e732be1613fdd9d94dfd8e50c02b187@gmail.com>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom flask import Flask, render_template... | python | chosen |
[
{
"from": "system",
"value": "Remove expired hazards from main map\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\n\nfrom mapApp.models import Incident, Theft, Hazard, Official, AlertArea\nfrom mapApp.forms import IncidentForm, HazardForm, TheftForm, GeofenceForm, EditFor... | python | chosen |
[
{
"from": "system",
"value": "Make the heading doc string a bit more descriptive\n"
},
{
"from": "human",
"value": "# vim: tabstop=4 expandtab autoindent shiftwidth=4 fileencoding=utf-8\n\n\"\"\"\nAssertions that sort of follow Python unittest/Django test cases\n\"\"\"\n\nfrom django.test.testca... | python | chosen |
[
{
"from": "system",
"value": "Update plugin information (name, description, version, author)\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Cura is released under the terms of the AGPLv3 or higher.\nfrom . import OctoPrintOutputDevicePlugin\nfrom . import DiscoverOctoP... | python | chosen |
[
{
"from": "system",
"value": "Improve reloading of the module\n"
},
{
"from": "human",
"value": "from .blendergltf import *"
},
{
"from": "gpt",
"value": "if 'loaded' in locals():\n import imp\n imp.reload(blendergltf)\n from .blendergltf import *\nelse:\n loaded = True\n... | python | chosen |
[
{
"from": "system",
"value": "Add AttrDict to the top level\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\n minimongo\n ~~~~~~~~~\n\n Minimongo is a lightweight, schemaless, Pythonic Object-Oriented\n interface to MongoDB.\n'''\nfrom minimongo.index import Index\nfr... | python | chosen |
[
{
"from": "system",
"value": "Make issue prefix matching case-insensitive\n"
},
{
"from": "human",
"value": "class IssueHandler:\n\tdef __init__(self, repos):\n\t\tself.repos = repos\n\n\tdef handle(self, channel, prefix, issue):\n\t\trepo = self.find_repo(prefix, channel)\n\t\tif repo is not No... | python | chosen |
[
{
"from": "system",
"value": "Add -c option: output only hexdump, without C variable wrapper.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nimport os.path\nimport string\n\ndef path2varname(path):\n path = os.path.basename(path)\n s = ''\n for c in path:\n i... | python | chosen |
[
{
"from": "system",
"value": "Add a test for _get_table_from_database\n"
},
{
"from": "human",
"value": "import mongomock\n\nfrom mongo_thingy import Model\n\n\ndef test_collection_alias():\n col = mongomock.MongoClient().db.collection\n\n class Foo(Model):\n _collection = col\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add exception for import operation error and validation error\n"
},
{
"from": "human",
"value": "class BaseExcelError(Exception):\n\n def __init__(self, message):\n super(BaseExcelError, self).__init__()\n self.message = message\n\n\nclass Validatio... | python | chosen |
[
{
"from": "system",
"value": "Support for diallowing official images.\n"
},
{
"from": "human",
"value": "import os, sys\n\nimport json as _json\n\nfrom flask import Flask, Response, request\napp = Flask(__name__)\napp.debug = True\n\nimport lib\n\n@app.route(\"/\", methods=[\"HEAD\", \"GET\", \"... | python | chosen |
[
{
"from": "system",
"value": "Add izip for Python 2/3 compatibility\n\nSimply use `izip` from `itertools` on Python 2 and alias `izip` as `zip`\non Python 3. This way an iterable form of `zip` remains available on\nboth Python 2 and Python 3 that is named `izip`. Should help avoid\nhaving the performance of... | python | chosen |
[
{
"from": "system",
"value": "Add new line at the end of file\n"
},
{
"from": "human",
"value": "import docker\n\n\ndef execute_batch(batch_id: int):\n container_name = f'mobydq-batch-{batch_id}'\n client = docker.from_env()\n client.containers.run(\n name=container_name,\n ... | python | chosen |
[
{
"from": "system",
"value": "Create basic flow of evolution process.\n"
},
{
"from": "human",
"value": "import csv\nimport yaml\n\nimport parse\nimport deparse\n\n\ndef main():\n with open('data/features.csv', 'r') as f:\n segments = [segment for segment in csv.DictReader(f)]\n\n w... | python | chosen |
[
{
"from": "system",
"value": "Use UTC time (we want to standardise on this)\n"
},
{
"from": "human",
"value": "from flask import jsonify\nfrom sqlalchemy.types import String\nfrom sqlalchemy import func\nimport datetime\n\nfrom .. import main\nfrom ...models import db, Framework, DraftService, S... | python | chosen |
[
{
"from": "system",
"value": "Remove unsed json module import\n"
},
{
"from": "human",
"value": "import requests_unixsocket\nimport urllib\nimport json\nimport re\n\n\ndef dockerapi_dispatcher(app,request):\n method = request.method\n uri = re.match(r\"^.+/dockerapi/(.+)\", request.url).gr... | python | chosen |
[
{
"from": "system",
"value": "Add test of adding nonterminals when grammar is create\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import TestCase, main\nfrom grammp... | python | chosen |
[
{
"from": "system",
"value": "Fix spelling for api/locality/:uuid URL\n\nCloses #121\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url\n\nfrom .views import LocalitiesAPI, LocalityAPI\n\nurlpatterns = patterns(\n '',\n url(\n r'^l... | python | chosen |
[
{
"from": "system",
"value": "Add a URL conf for the EpilogueView.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.views.generic import RedirectView\n\nfrom .views import AwayView, Disc... | python | chosen |
[
{
"from": "system",
"value": "Upgrade the version to 1.3.0\n"
},
{
"from": "human",
"value": "version_info = (1, 2, 0)\nversion = '.'.join(map(str, version_info))\n"
},
{
"from": "gpt",
"value": "version_info = (1, 3, 0)\nversion = '.'.join(map(str, version_info))\n"
}
] | python | chosen |
[
{
"from": "system",
"value": "Allow for shade or hist in mask plot\n"
},
{
"from": "human",
"value": "import os.path as op\nimport numpy as np\nimport nibabel as nib\nimport seaborn as sns\n\ndef plot_mask_distribution(fname, hist=False):\n \"\"\"Plot the distribution of voxel coordinates in ... | python | chosen |
[
{
"from": "system",
"value": "Add field instead of alter field\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n depe... | python | chosen |
[
{
"from": "system",
"value": "Add time in logging trace\n"
},
{
"from": "human",
"value": "\n# -*- coding: utf-8 -*-\n\n\"\"\" Function related to logging \"\"\"\n\n# stp import\nimport sys\nimport logging\n\n# fief import\nfrom fief import filter_effective_parameters as fief\n\nlog = logging.ge... | python | chosen |
[
{
"from": "system",
"value": "Add RedisIntegration to Sentry trial\n\nThis should expose additional performance stats.\n"
},
{
"from": "human",
"value": "import os\n\nimport sentry_sdk\nfrom flask import Flask\nfrom sentry_sdk.integrations.flask import FlaskIntegration\nfrom sentry_sdk.integrati... | python | chosen |
[
{
"from": "system",
"value": "Add permission checks in author app\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns\nfrom django.conf.urls import url\nfrom django.views.generic.base import RedirectView\nfrom django.core.urlresolvers import reverse_lazy\nfrom django.contrib... | python | chosen |
[
{
"from": "system",
"value": "Add GET handler to /incoming.\n"
},
{
"from": "human",
"value": "\"\"\"\\\nGistMail\n\nEmail gist@gistmail.com with a link and get a response with that article's summary.\n\"\"\"\n\nfrom summarize import summarize_page\nfrom flask import Flask, render_template\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add new field to factory\n"
},
{
"from": "human",
"value": "# MIT License\n# Copyright (c) 2017 MassChallenge, Inc.\n\nfrom __future__ import unicode_literals\n\nimport swapper\nfrom factory import (\n DjangoModelFactory,\n Sequence,\n)\n\nfrom accelerator.app... | python | chosen |
[
{
"from": "system",
"value": "Allow SponsorFactory to create active sponsors.\n"
},
{
"from": "human",
"value": "import factory\n\nfrom symposion.schedule.tests.factories import ConferenceFactory\nfrom symposion.sponsorship.models import SponsorLevel, Sponsor\n\n\nclass SponsorLevelFactory(facto... | python | chosen |
[
{
"from": "system",
"value": "Set up for my new 7 seg display.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"Display standard input on LEDs.\"\"\"\n\nimport sys\nimport RPi.GPIO as GPIO\nfrom seven_segment import print_leds\n\npins = [17, 23, 24, 22, 27, 25, 5]\nGPIO.setmode(... | python | chosen |
[
{
"from": "system",
"value": "Test width of progress bar\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom downloads.download import _progress_bar\n\n\n@pytest.mark.parametrize(\n \"current,block_size,total_size\",\n [\n (\n 100,\n 32,\n 100 *... | python | chosen |
[
{
"from": "system",
"value": "Correct priority for STRONGINFO log level\n"
},
{
"from": "human",
"value": "import logging\nimport colorlog\n\nlogging.STRONGINFO = logging.DEBUG + 5\nlogging.addLevelName(logging.STRONGINFO, 'STRONGINFO')\n\n\ndef logStrongInfo(msg, *args, **kwargs):\n \"\"\"Lo... | python | chosen |
[
{
"from": "system",
"value": "Switch empty value to empty string rather than None\n\nWhen None is used this is rendered in the HTML as a string, which then when it is returned to the CKAN server becomes 'None' not None.\nAn empty string represents no value better.\n"
},
{
"from": "human",
"value... | python | chosen |
[
{
"from": "system",
"value": "Fix mistake in sigmoid function\n"
},
{
"from": "human",
"value": "import math\nimport sys\n\ndef sigmoid(x):\n try:\n val = 1/(1 + math.exp(-x))\n except OverflowError:\n val = sys.float_info.max\n return val\n\ndef sigmoidprime(x):\n retu... | python | chosen |
[
{
"from": "system",
"value": "Add test for BadCharError exception.\n"
},
{
"from": "human",
"value": "# coding: pyxl\nimport pytest\n\nfrom pyxl.codec.register import pyxl_decode\nfrom pyxl.codec.parser import ParseError\n\ndef test_malformed_if():\n with pytest.raises(ParseError):\n p... | python | chosen |
[
{
"from": "system",
"value": "Linking: Use import to locate _core\n\nRelated to #8"
},
{
"from": "human",
"value": "\nimport os\nimport ctypes\n\n# We need to manually load the _core SO the first time so that we can specify\n# that it use the RTLD_GLOBAL flag. Otherwise (when not on a Mac) the r... | python | chosen |
[
{
"from": "system",
"value": "Check primary keys for foreign key and one-to-one fields\n"
},
{
"from": "human",
"value": "# Adapted from http://stackoverflow.com/questions/110803/dirty-fields-in-django\nfrom django.db.models.signals import post_save\n\nclass DirtyFieldsMixin(object):\n def __... | python | chosen |
[
{
"from": "human",
"value": "Update the code of visualization.\n"
},
{
"from": "gpt",
"value": "import struct\n\n\nid_i = 0\nvalue_i = 0.0\nid_i_1 = 0\nvalue_i_1 = 1.0\nnumber = 0\nwith open(\"sort.dat\", \"r\") as f:\n for line in f:\n line = line.replace('(', '')\n line = line... | python | chosen |
[
{
"from": "system",
"value": "Add method to find the coordinates of game\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nThis is the main file for a script that reads info off a game on kongregate.com and acts upon it.\n\n\"\"\"\n# import line/s for builtin modules\n# import py... | python | chosen |
[
{
"from": "system",
"value": "Read and parse xml to Matrix\n"
},
{
"from": "human",
"value": "__author__ = 'alex'\n\n\nprint 45\n\nprint 54"
},
{
"from": "gpt",
"value": "_author__ = 'alex'\nimport sys\nimport xml.dom.minidom as dom\n\ndef get_Res_Matrix(length,nodes,nets_d,elem_type... | python | chosen |
[
{
"from": "system",
"value": "Use serverprefs localizer for TestingServerPreferencesGroup\n"
},
{
"from": "human",
"value": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom botus_receptus.app_commands import test_guilds_only\nfrom discord import app_commands\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Order of imports means the config doesn't get set up properly\n"
},
{
"from": "human",
"value": "from app import create_app\nfrom credstash import getAllSecrets\nimport os\n\ndefault_env_file = '/home/ubuntu/environment'\nenvironment = 'live'\n\nif os.path.isfile(de... | python | chosen |
[
{
"from": "system",
"value": "Add import for other python versions"
},
{
"from": "human",
"value": "from operator import itemgetter\n\nmapping = {\n 'has_header': True,\n 'currency': 'EUR',\n 'delimiter': ';',\n 'bank': 'GLS Bank',\n 'account': itemgetter('Kontonummer'),\n\n # ... | python | chosen |
[
{
"from": "system",
"value": "Add wait_for_input and add_callback methods to InputDevice\n"
},
{
"from": "human",
"value": "from RPi import GPIO\n\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setwarnings(False)\n\n\nclass InputDevice(object):\n def __init__(self, pin):\n self.pin = pin\n GPI... | python | chosen |
[
{
"from": "system",
"value": "Fix views file Python 3 issue\n"
},
{
"from": "human",
"value": "from __future__ import print_function, unicode_literals\n\nimport django.views.generic\n\npouet = [\n 'ArchiveIndexView', 'YearArchiveView', 'MonthArchiveView',\n 'WeekArchiveView', 'DayArchiveVi... | python | chosen |
[
{
"from": "system",
"value": "Return config when calling configure def\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nASSETS = {\n 'debug': False,\n 'media_url': '/',\n}\n\n\ndef configure(data):\n ASSETS.update(data)\n"
},
{
"from": "gpt",
"value": "# coding: utf-8\n... | python | chosen |
[
{
"from": "system",
"value": "Use DefaultRouter which includes a default API root view.\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\nfrom django.contrib import admin\nfrom rest_framework import routers\nfrom rest_framework.authtoken.views import obtain_auth_token... | python | chosen |
[
{
"from": "system",
"value": "Make Meta class enforce only known properties\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nclass Meta(object):\n '''Generic container for Meta classes'''\n\n def __new__(cls, meta=None):\n # Return a new class base on ou... | python | chosen |
[
{
"from": "system",
"value": "Fix to new page layout\n"
},
{
"from": "human",
"value": "import requests\n\nfrom bs4 import BeautifulSoup\n\ndef nouda( url , out ):\n\n\tr = requests.get( url )\n\tr.encoding = 'UTF-8'\n\tsoup = BeautifulSoup( r.text )\n\n\tteksti = soup.find_all( class_ ='post-me... | python | chosen |
[
{
"from": "system",
"value": "Add help function to run command in guest\n\nSigned-off-by: Luyao Huang <23d9981432efa88691fd2a71f5525bc2174f7664@redhat.com>\n"
},
{
"from": "human",
"value": "import subprocess\nimport os\nimport sys\n\nSTEPS = \"Step:\"\nRESULT = \"Result:\"\nSETUP = \"Setup:\"\n... | python | chosen |
[
{
"from": "system",
"value": "Allow + in version number\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nfrom subprocess import check_output as co\nfrom sys import exit\n\n# Actually run bin/mn rather than importing via python path\nversion = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --versio... | python | chosen |
[
{
"from": "system",
"value": "fix(test): Fix expression in tornado_server app\n\nSigned-off-by: Ferenc Géczi <056c6d27de7ab660258538226bb901048afb31e4@ibm.com>\n"
},
{
"from": "human",
"value": "# (c) Copyright IBM Corp. 2021\n# (c) Copyright Instana Inc. 2020\n\nimport os\nimport sys\nfrom ...h... | python | chosen |
[
{
"from": "system",
"value": "Remove extra space in usage message text\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport argparse\n\nfrom qlmdm import set_gpg\nfrom qlmdm.server import patch_hosts\n\nset_gpg('server')\n\n\ndef parse_args():\n parser = argparse.ArgumentParser... | python | chosen |
[
{
"from": "system",
"value": "Remove debug print from view\n"
},
{
"from": "human",
"value": "import six\n\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import reverse\nfrom django.conf import settings\n\nfrom openid.consumer import consumer\n\nimport wargaming\n\nwot = wa... | python | chosen |
[
{
"from": "system",
"value": "Add DEBUG_PANEL_ACTIVE setting back into custom DDT settings file\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function, unicode_literals\n\nfrom .base import * # noqa\n\nINTERNAL_IPS = ['127.0.0.1']\n\nDEBUG_TOOLBAR_CONFIG = {\n... | python | chosen |
[
{
"from": "system",
"value": "Add derivative of BB flux with temperature\n\nAdded functions which calculate the derivative of the blackbody flux\nwith temperature (with units and without units)\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom scipy.optimize import curve_fit\nfrom astr... | python | chosen |
[
{
"from": "system",
"value": "Refactor data migration for Group model\n\nUndelying explanation as in commit f580a63909166efccc8030eb36d8b2fe697f7236\n"
},
{
"from": "human",
"value": "\"\"\"Add user roles\n\nRevision ID: 16ef0d8ffae1\nRevises: 8acb1453abb\nCreate Date: 2015-03-17 15:45:05.406297... | python | chosen |
[
{
"from": "system",
"value": "Correct integral used for Exponential distributon\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\nfrom .. import config\nfrom ..distribution import Distribution\n\n\n@Distribution\ndef Exponential(lambda_, name=None):\n X = tf.placeholder(config.dty... | python | chosen |
[
{
"from": "system",
"value": "Include a package version number\n\nThis includes in the core package the concept of a version number that\nunderlying code could use to determine what version of the core it is\ninterfacing with.\n\nThis is only really needed for packages that get at the underlying\ncore code ... | python | chosen |
[
{
"from": "system",
"value": "Split Sprite and Stage, begin code\n\nThe way I see it, sprites should be an extension of the stage. After all, the stage is like one big sprite that can't move.\r\nAlso, begin code has been added."
},
{
"from": "human",
"value": "import pygame\n\nclass Sprite():\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix style test complaing about non-top import.\n"
},
{
"from": "human",
"value": "version_info = (1, 0, 1)\n\n__version__ = \".\".join(map(str, version_info))\n\ntry:\n import collectd\n collectd_present = True\nexcept ImportError:\n collectd_present = Fals... | python | chosen |
[
{
"from": "system",
"value": "[AC-7049] Add tests for the functionality added\n"
},
{
"from": "human",
"value": "# MIT License\n# Copyright (c) 2017 MassChallenge, Inc.\n\nfrom __future__ import unicode_literals\n\nfrom django.test import TestCase\n\nfrom accelerator.tests.factories import Progr... | python | chosen |
[
{
"from": "system",
"value": "Change credit to source models\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom opps.core.models.publishable import Publishable\n\n\n\nclass Image(Publishable):\... | python | chosen |
[
{
"from": "system",
"value": "Add API endpoints to serve data in JSON format.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport json, os, requests\nfrom awsauth import S3Auth\nfrom datetime import datetime\nfrom pytz import timezone\nfrom flask import Flask, render_template, url_f... | python | chosen |
[
{
"from": "system",
"value": "Enable statup_with_url.cold benchmark on android.\n\nThe benchmark works locally, and collects an important datapoint for our\ncurrent optimization work.\n\nReview URL: https://codereview.chromium.org/508303004\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#2... | python | chosen |
[
{
"from": "system",
"value": "Add pop method and implementation\n"
},
{
"from": "human",
"value": "# Author: AlexBanks97\n# Purpose: LIFO Stack implementation using python array.\n# Date: October 15th 2017\n\nclass Stack(object):\n def __init__(self):\n # Initialize stack as empty arra... | python | chosen |
[
{
"from": "system",
"value": "Add column support for sql server\n\n--HG--\nextra : convert_revision : svn%3A69d324d9-c39d-4fdc-8679-7745eae9e2c8/trunk%40111\n"
},
{
"from": "human",
"value": "from django.db import connection\nfrom django.db.models.fields import *\nfrom south.db import generic\n\... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Add pywin32 as Windows required package\n"
},
{
"from": "human",
"value": "import sys\n\nfrom paver.easy import task, needs, path, sh, cmdopts, options\nfrom paver.setuputils import setup, install_distutils_tasks\nfrom distutils.extension import Extension\nfro... | python | chosen |
[
{
"from": "system",
"value": "PYTHON: Create PyPI Release for 1.9.0.0.\n\n\nRevision created by MOE tool push_codebase.\nMOE_MIGRATION=6943\n"
},
{
"from": "human",
"value": "\"\"\"Setup specs for packaging, distributing, and installing gcs lib.\"\"\"\n\nimport distribute_setup\ndistribute_setup... | python | chosen |
[
{
"from": "system",
"value": "Allow host and port that the service listens on to be set from environment variables.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom mcapi.mcapp import app\nfrom mcapi import tservices, public, utils, private, access, process, machine, template, ts... | python | chosen |
[
{
"from": "system",
"value": "Add more test coverage for the server.\n"
},
{
"from": "human",
"value": "from mock import patch\nimport sure # noqa\n\nfrom moto.server import main\n\n\ndef test_wrong_arguments():\n try:\n main([\"name\", \"test1\", \"test2\", \"test3\"])\n asser... | python | chosen |
[
{
"from": "system",
"value": "Add test with currently known-stall sentance.\n"
},
{
"from": "human",
"value": "\nimport boto3\nfrom os import path, chdir\nfrom subprocess import check_call\nfrom nose.plugins.attrib import attr\n\nfrom indra.tools.reading import submit_reading_pipeline as srp\n\n... | python | chosen |
[
{
"from": "system",
"value": "Mark error flag if an object is not present on S3\n"
},
{
"from": "human",
"value": "from selinon import StoragePool\nfrom cucoslib.models import WorkerResult, Analysis\n\nfrom .base import BaseHandler\n\n\nclass CleanPostgres(BaseHandler):\n \"\"\" Clean JSONB c... | python | chosen |
[
{
"from": "system",
"value": "Fix tests: add module function docstring\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Import Python libs\nfrom __future__ import absolute_import\nimport time\n\n# Import Salt libs\nimport salt.utils.decorators\n\n\ndef _fallbackfunc():\n return... | python | chosen |
[
{
"from": "system",
"value": "Change user transfer model from `attrs` to `dataclass`\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.user.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for detail... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in OboSerializer` causing `Ontology.dump` to crash\n"
},
{
"from": "human",
"value": "import io\nfrom typing import BinaryIO, ClassVar\n\nfrom ._fastobo import FastoboSerializer\nfrom .base import BaseSerializer\n\n\nclass OboSerializer(FastoboSerializer, Ba... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in ThingInstace __setitem__\n"
},
{
"from": "human",
"value": "from thinglang.lexer.symbols.base import LexicalIdentifier\n\n\nclass ThingInstance(object):\n\n def __init__(self, cls):\n self.cls = cls\n self.methods = {\n x.name:... | python | chosen |
[
{
"from": "system",
"value": "Add newlines in output for formatting purposes\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n\"\"\"TODO:\n * more flexible sorting options\n * use -o to specify output file\n * check more explicitly for errors in JSON files\n\"\"\"\n\nimport json, sys... | python | chosen |
[
{
"from": "system",
"value": "Remove template variables (not needed)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\n\nimport jinja2\nimport webapp2\n\nJINJA_ENVIRONMENT = jinja2.Environment(\n loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'ht... | python | chosen |
[
{
"from": "system",
"value": "Add message about starting loading data\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport json\nfrom pprint import pprint\ntry:\n import requests\nexcept ImportError:\n print(\n 'Script requires requests package. \\n'\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix CLI module during build\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n\n protolint\n ~~~~~~~~~\n\n\"\"\"\n\nfrom . import cli\nfrom . import linter\nfrom . import output\n\n__version__ = (1, 0, 0)\n"
},
{
"from": "gpt",
"val... | python | chosen |
[
{
"from": "system",
"value": "Bugfix: Stop handling after responding with 500\n"
},
{
"from": "human",
"value": "import http.server\nimport os\n\nimport oldfart.make\n\n\n__all__ = ['make_http_request_handler_class']\n\n\ndef _send_head(self):\n # FIXME: We die here if the directory doesn't e... | python | chosen |
[
{
"from": "system",
"value": "Use psutil.disk_partitions to get FAT formatted partitions.\n"
},
{
"from": "human",
"value": "import os\n\n\ndef get_fat_mounts():\n fat_mounts = []\n mounts = os.popen('mount')\n for line in mounts.readlines():\n device, ign1, mount_point, ign2, fi... | python | chosen |
[
{
"from": "human",
"value": "Add a backwards-compatibility import for ServiceTests.\n\nWe had a class, ServiceTests, which was a base testcase class for\nhosting service unit tests. This was moved recently, which broke\nextensions that provided hosting service unit tests based on this.\n\nThis restores the ... | python | chosen |
[
{
"from": "system",
"value": "Fix for 'naive datetime' complaint when running searches\n"
},
{
"from": "human",
"value": "import datetime\nfrom haystack import indexes\nfrom recipes.models import Recipe\n\n\nclass RecipeIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharField... | python | chosen |
[
{
"from": "system",
"value": "Add an simple abstract user model for school administrators which will be used later\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n"
},
{
"from": "gpt",
"value": "from django.contrib.auth.models import Abs... | python | chosen |
[
{
"from": "system",
"value": "Add role context manager setting role and definitions"
},
{
"from": "human",
"value": "from contextlib import contextmanager\n\nfrom fabric.context_managers import settings, hide\nfrom fabric.state import env\n\n\n@contextmanager\ndef sudo(user=None):\n with sett... | python | chosen |
[
{
"from": "system",
"value": "Update the Value Reference API to be more precise about the types of values being referenced.\n\nPiperOrigin-RevId: 404647934\n"
},
{
"from": "human",
"value": "# Copyright 2021, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 ... | python | chosen |
[
{
"from": "system",
"value": "Change internal name of UNCCD role back to previous correct value\n"
},
{
"from": "human",
"value": "from django.conf import settings # noqa\nfrom appconf import AppConf\n\n\nclass AccountConf(AppConf):\n \"\"\"\n Custom settings for the account module. Mainl... | python | chosen |
[
{
"from": "system",
"value": "Migrate Sniffer unit test to new API\n"
},
{
"from": "human",
"value": "from mock import patch\n\nfrom django.test import TestCase\nfrom breach.sniffer import Sniffer\n\n\nclass SnifferTest(TestCase):\n def setUp(self):\n self.endpoint = 'http://localhost'... | python | chosen |
[
{
"from": "system",
"value": "Remove cell number and language from pod\n\nWe started using the identity store and the hub to fetch this information,\nbut unfortunately the field names are different depending on which service\nthe info is coming from.\n\nThese 2 fields are already displayed in the CasePro in... | python | chosen |
[
{
"from": "system",
"value": "Make sure we test the right binary\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8\n\nimport collections\nimport os\nimport subprocess\nimport unittest\n\n\nResult = collections.namedtuple('Result', 'rc stdout stderr')\n\nROOT = subpr... | python | chosen |
[
{
"from": "system",
"value": "Update decimal tests to only run on text/none.\n\nChange-Id: I9a35f9e1687171fc3f06c17516bca2ea4b9af9e1\nReviewed-on: http://gerrit.ent.cloudera.com:8080/2217\nTested-by: jenkins\nReviewed-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485a125d802@cloudera.com>\n"
},
{
"... | python | chosen |
[
{
"from": "system",
"value": "Set automatic releases as 'prerelease'.\n"
},
{
"from": "human",
"value": "#!python\nimport os\nimport sys\nimport json\nimport requests\n\nif __name__ == '__main__':\n version = sys.argv[1]\n filepath = sys.argv[2]\n filename = filepath.split('/')[-1]\n github_... | python | chosen |
[
{
"from": "system",
"value": "Make sure the event loop gets closed on disconnect\n"
},
{
"from": "human",
"value": "import asyncio\nimport time\n\nfrom autoreiv import AutoReiv\n\ndef main():\n\twhile True:\n\t\tbot = AutoReiv()\n\t\tbot.load()\n\n\t\ttry:\n\t\t\tbot.run(bot.config.get('login'),... | python | chosen |
[
{
"from": "system",
"value": "Add notice on how to add custom apps for development\n"
},
{
"from": "human",
"value": "\"\"\"\nDjango settings for laufpartner_server project.\n\nGenerated by 'django-admin startproject' using Django 1.8.1.\n\nFor more information on this file, see\nhttps://docs.dj... | python | chosen |
[
{
"from": "system",
"value": "Clean it up with a finalizer.\n"
},
{
"from": "human",
"value": "from diesel import quickstart, sleep\nfrom diesel.util.pool import ThreadPool\nfrom diesel.protocols.http import HttpClient, HttpHeaders\nimport random\n\ndef handle_it(i):\n print 'S', i\n sleep... | python | chosen |
[
{
"from": "system",
"value": "Add AuthenticationMiddleware to tests (for 1.7)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nfrom os.path import abspath, dirname\n\nfrom django.conf import settings\nimport django\n\n\nsys.path.insert(0, abspath(dirname(__file__)))\n\n\nif ... | python | chosen |
[
{
"from": "system",
"value": "Allow specifying counter in SYNC message\n\nAddresses #63\n"
},
{
"from": "human",
"value": "\n\nclass SyncProducer(object):\n \"\"\"Transmits a SYNC message periodically.\"\"\"\n\n #: COB-ID of the SYNC message\n cob_id = 0x80\n\n def __init__(self, net... | python | chosen |
[
{
"from": "system",
"value": "Streamline the filesystem looping code.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\nimport subprocess\nimport getopt\n\n\nclass Chdir:\n def __init__(self, newPath):\n self.savedPath = os.getcwd()\n os.chdir(newP... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.