conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Set version back to dev\n"
},
{
"from": "human",
"value": "__version__ = \"2.0.0b1\"\n\nfrom pyquil.quil import Program\nfrom pyquil.api import list_quantum_computers, get_qc\n"
},
{
"from": "gpt",
"value": "__version__ = \"2.0.0b2.dev0\"\n\nfrom pyquil.... | python | chosen |
[
{
"from": "system",
"value": "Add cache headers to self-repair page\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\n\nfrom normandy.base.decorators import short_circuit_middlewares\n\n\n@short_circuit_middlewares\ndef repair(request, locale):\n return render(request, '... | python | chosen |
[
{
"from": "system",
"value": "4: Create script to save documentation to a file \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christop... | python | chosen |
[
{
"from": "system",
"value": "FIX problem after reorganizing test.\n"
},
{
"from": "human",
"value": "# -*- coding: UTF-8 -*-\n\"\"\"\nhttps://github.com/behave/behave/issues/619\n\nWhen trying to do something like::\n\n foo = getattr(context, '_foo', 'bar')\n\nBehave fails with::\n\n File... | python | chosen |
[
{
"from": "system",
"value": "Use database number from redis url if available.\n"
},
{
"from": "human",
"value": "import json\nimport urlparse\nfrom flask import Flask, make_response\nfrom flask.ext.restful import Api\nfrom flask_peewee.db import Database\n\nimport redis\nfrom redash import sett... | python | chosen |
[
{
"from": "system",
"value": "Add try/except in case select function fails\n"
},
{
"from": "human",
"value": "\"\"\"Export all responses from yesterday and save them to a CSV file.\"\"\"\n\nimport sqlite3\nimport csv\nfrom datetime import datetime, timedelta\nimport os\n\n\ntoday = str(datetime.... | python | chosen |
[
{
"from": "system",
"value": "Remove testing of private methods (other than that they exist)\n"
},
{
"from": "human",
"value": "import unittest\nfrom utils import parse_worksheet\n\n\nclass TestParseWorksheet(unittest.TestCase):\n def test_open_worksheet_function_is_defined(self):\n if... | python | chosen |
[
{
"from": "system",
"value": "Fix buildbot flag to GM\n\nUnreviewed\n\ngit-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@8282 2bbb7eff-a529-9590-31e7-b0007b416f81\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Copyright (c) 2013 The Chromium Authors. All rights reserved.\n# Use o... | python | chosen |
[
{
"from": "system",
"value": "Add formatting to directory monitor.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os, sys, time\n\nfolders = sys.argv[1:]\n\ncurrSize = dict((x, 0) for x in folders)\ntotalSize = dict((x, 0) for x in folders)\nmaxSize = dict((x, 0) for x in fol... | python | chosen |
[
{
"from": "system",
"value": "Correct inter sphinx path to Tornado docs.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport alabaster\n\nfrom sprockets.mixins import cors\n\nproject = 'sprockets.mixins.cors'\ncopyright = '2015, AWeber Communication, Inc.'\nversion = cors.__version_... | python | chosen |
[
{
"from": "system",
"value": "Add viewcode to sphinx docs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\n\nextensions = [\n 'sphinx.ext.autodoc',\n 'sphinx.ext.intersphinx'\n]\n\nsource_suffix = '.rst'\n\nmaster_doc = 'index'\n\... | python | chosen |
[
{
"from": "system",
"value": "Exclude preprints from queryset from account/register in the admin app.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django import forms\nfrom django.contrib.auth.models import Group\n\nfrom osf.models import AdminProfile\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Enable Python RSA backend as a fallback.\n"
},
{
"from": "human",
"value": "\ntry:\n from jose.backends.pycrypto_backend import RSAKey\nexcept ImportError:\n from jose.backends.cryptography_backend import CryptographyRSAKey as RSAKey\n\ntry:\n from jose.bac... | python | chosen |
[
{
"from": "system",
"value": "Work on model file handling\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nbase_path = os.path.dirname(__file__)\nsys.path.append(base_path)\n\none_up_path = os.path.abspath(os.path.join(os.path.dirname(__file__),'..'))\nsys.path.append(one_up_path)\n\n... | python | chosen |
[
{
"from": "system",
"value": "TEST - add test for value\n"
},
{
"from": "human",
"value": "\"\"\" Testing Siemens CSA header reader\n\"\"\"\nimport os\nfrom os.path import join as pjoin\n\nimport numpy as np\n\nimport dipy.io.csareader as csa\n\nfrom nose.tools import assert_true, assert_false, ... | python | chosen |
[
{
"from": "system",
"value": "Add \"config file was not fount\" error handler\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nimport os.path\nimport yaml\n\n\nCONFIG_PATH = os.path.join(os.path.dirname(__file__), 'settings.yaml')\n\nwith open(CONFIG_PATH, 'r') as fh:\n config = yaml.loa... | python | chosen |
[
{
"from": "system",
"value": "Add optional authorizer parameter to session class and function.\n"
},
{
"from": "human",
"value": "\"\"\"prawcore.sessions: Provides prawcore.Session and prawcore.session.\"\"\"\n\nimport requests\n\n\nclass Session(object):\n \"\"\"The low-level connection inte... | python | chosen |
[
{
"from": "system",
"value": "Update regexp due to changes in stylint\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jack Brewer\n# Copyright (c) 2015 Jack Brewer\n#\n# License: MIT\n#\n\n\"\"\"This mo... | python | chosen |
[
{
"from": "system",
"value": "Check if epages6 settings are configured\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jonas Gratz\n# Copyright (c) 2015 Jonas Gratz\n#\n# License: MIT\n#\n\n\"\"\"This m... | python | chosen |
[
{
"from": "system",
"value": "Change version to 1.0.2 (stable)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n{\n \"name\": \"Account Credit Transfer\",\n \"version\": \"1.0.1\",\n \"author\": \"XCG Consulting\",\n \"website\": \"http://www.openerp-experts.com\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add session_timeout to ReservationAdmin list_display\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom karspexet.ticket.models import Account, Reservation, Ticket, Voucher, PricingModel\n\n\nclass ReservationAdmin(admin.ModelAdmin):\n li... | python | chosen |
[
{
"from": "system",
"value": "Trivial: Make vertical white space after license header consistent\n\nVertical white space between license header and the actual code is not consistent\nacross files. It looks like majority of the files leaves a single blank line\nafter license header. So make it consistent exc... | python | chosen |
[
{
"from": "system",
"value": "Add neighbrhood property to row\n"
},
{
"from": "human",
"value": "import csv\nimport datetime\n\n\nclass Row(dict):\n\n def __init__(self, *args, **kwargs):\n super(Row, self).__init__(*args, **kwargs)\n self._start_date = None\n self._end_d... | python | chosen |
[
{
"from": "system",
"value": "Exclude unnecessary fields for Enjaz\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.forms.models import inlineformset_factory\nfrom forms_builder.forms.models import Form, Field\n\n\nclass FormToBuildForm(forms.ModelForm):\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Update script to export to nml2 of m1\n"
},
{
"from": "human",
"value": "import M1 # import parameters file\nfrom netpyne import sim # import netpyne sim module\n\nsim.createAndExport(netParams = M1.netParams, \n simConfig = M1.simConfig,\n ... | python | chosen |
[
{
"from": "system",
"value": "Add an error class for string data that is ignored by the parser\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nclass PoyoException(Exception):\n \"\"\"Super class for all of Poyo's exceptions.\"\"\"\n\n\nclass NoMatchException(PoyoException):\n ... | python | chosen |
[
{
"from": "system",
"value": "Structure for sending dummy files\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask import request\nimport flask\nimport hashlib\nimport json\nimport gzip\napp = Flask(__name__)\n\nstored_files = {}\n\n\n@app.route('/profile/<type>', methods=['G... | python | chosen |
[
{
"from": "system",
"value": "Fix utf-8 problem with åäö and friends.\n"
},
{
"from": "human",
"value": "import os\nfrom flask import Flask, render_template\nfrom jinja2 import Template\n\napp = Flask(__name__, template_folder='.', static_url_path='', static_folder='..')\napp.config.from_pyfile(... | python | chosen |
[
{
"from": "system",
"value": "Use Numpy dtype when creating Numpy array\n\n(as opposed to the Numba dtype)\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom numba import from_dtype, cuda\nfrom numba import unittest_support as unittest\n\n\nclass TestAlignment(unittest.TestCase):\n d... | python | chosen |
[
{
"from": "system",
"value": "Change version to 1.0.1 unstable\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n{\n \"name\": \"Account Credit Transfer\",\n \"version\": \"1.0\",\n \"author\": \"XCG Consulting\",\n \"website\": \"http://www.openerp-experts.com\",\n \"... | python | chosen |
[
{
"from": "system",
"value": "Stop trying to be overly clever\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\ndef _tcldis_init():\n import sys\n import _tcldis\n mod = sys.modules[__name__]\n for key, value in _tcldis.__dict__.iteritems():\n if not ... | python | chosen |
[
{
"from": "system",
"value": "Add test re: hide kwarg\n"
},
{
"from": "human",
"value": "from spec import eq_, skip, Spec, raises, ok_\n\nfrom invoke.run import run\nfrom invoke.exceptions import Failure\n\n\nclass Run(Spec):\n \"\"\"run()\"\"\"\n def return_code_in_result(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the check if form is submitted\n"
},
{
"from": "human",
"value": "from django.contrib.auth.decorators import login_required\nfrom django.http import HttpResponse\nfrom django.shortcuts import render\n\nfrom members.models import User\nfrom .models import Protoco... | python | chosen |
[
{
"from": "system",
"value": "Fix mypy import errors due to removed services\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n"
},
{
"from": "human",
"value": "if __name__ == \"__main__\":\n import gaphor\n from gaphor import core\n from gaphor.services.act... | python | chosen |
[
{
"from": "system",
"value": "Add image to ifff request\n"
},
{
"from": "human",
"value": "from logs import *\nimport requests\n\nclass Ifttt(object):\n \"\"\"\n \"\"\"\n\n def __init__(self, config, packpub_info, upload_info):\n self.__packpub_info = packpub_info\n self._... | python | chosen |
[
{
"from": "system",
"value": "Use threading.local() to store a requests.Session object per-thread and use it to perform the requests, allowing connections to be reused, speeding bot replies a lot\n"
},
{
"from": "human",
"value": "import requests\n\n\nclass TelegramBotApi:\n \"\"\"This is a t... | python | chosen |
[
{
"from": "system",
"value": "Increase splinter wait time to 15 seconds\n\n@gtrogers\n@maxfliri\n"
},
{
"from": "human",
"value": "import logging\n\nfrom pymongo import MongoClient\nfrom splinter import Browser\n\nfrom features.support.http_test_client import HTTPTestClient\nfrom features.suppor... | python | chosen |
[
{
"from": "system",
"value": "Add a method to get username if users have valid cookie\n"
},
{
"from": "human",
"value": "# -*- conding: utf-8 -*-\r\nimport os\r\n\r\nimport jinja2\r\nimport webapp2\r\n\r\nimport utils\r\n\r\nJINJA_ENV = jinja2.Environment(\r\n loader=jinja2.FileSystemLoader(o... | python | chosen |
[
{
"from": "system",
"value": "Add URL and description to search index of FoiRequest"
},
{
"from": "human",
"value": "from haystack import indexes\nfrom haystack import site\n\nfrom foirequest.models import FoiRequest\n\n\nclass FoiRequestIndex(indexes.SearchIndex):\n text = indexes.EdgeNgramF... | python | chosen |
[
{
"from": "system",
"value": "Fix python syntax bug in update email fwd's script\n"
},
{
"from": "human",
"value": "# Virtual alias file syntax:\n# email, space, email, (space, email, space, email,) newline, (repeat)\n# Example:\n# groep@arenbergorkest.be \tjef@gmail.com jos@hotmail.com\n# jef@a... | python | chosen |
[
{
"from": "system",
"value": "Fix plugin import for astropy 2.x\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n# this contains imports plugins that configure py.test for astropy tests.\n# by importing them here in conftest.py they are discov... | python | chosen |
[
{
"from": "system",
"value": "Disable JHU kpoint generationt test.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\nimport unittest\n\nimport requests\n\nfrom pymatgen.ext.jhu import get_kpoints\n... | python | chosen |
[
{
"from": "system",
"value": "Add simple form to flask upload server\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, request, redirect, url_for\nfrom werkzeug.utils import secure_filename\nimport datetime\nimport os\n\ndef timestamp():\n return datetime.datetime.n... | python | chosen |
[
{
"from": "system",
"value": "Update track_name, short_label, and long_label per discussions on 2016-09-09\n"
},
{
"from": "human",
"value": "__author__ = 'dcl9'\nfrom render import render_template\nimport argparse\nimport yaml\n\n\ndef generate_track_dict(metadata):\n d = dict()\n d['trac... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with test discovery and broken CUDA drivers.\n\nThis patch allows the test discovery mechanism to work even in the\ncase of a broken/misconfigured CUDA driver.\n\nFixes #2841\n"
},
{
"from": "human",
"value": "from __future__ import print_function, absolut... | python | chosen |
[
{
"from": "human",
"value": "Update init file with descriptions\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"A processor for the `Drug Gene Interaction Database (DGI-DB) <http://www.dgidb.org>`_.\n\n* `Integration of the Drug–Gene Interaction Database (DGIdb 4.0) with open c... | python | chosen |
[
{
"from": "system",
"value": "Fix issue where Pulsar would enter a restart loop when cancelling a buffering\n\nSigned-off-by: Steeve Morin <7f3ba7bbc079b62d3fe54555c2b0ce0ddda2bb7c@gmail.com>\n"
},
{
"from": "human",
"value": "import xbmc\nimport urllib2\nimport threading\nfrom pulsar.config imp... | python | chosen |
[
{
"from": "system",
"value": "Add missing line on the script and some comment\n"
},
{
"from": "human",
"value": "from binascii import unhexlify\n\ndef request(context, flow):\n if (flow.request.host.find('change.me') > -1 and flow.request.path.find('somethingaboutcurrency') > -1):\n \n\... | python | chosen |
[
{
"from": "system",
"value": "Update name of Eidos reading class\n"
},
{
"from": "human",
"value": "import json\nfrom indra.java_vm import autoclass, JavaException\n\nclass EidosReader(object):\n \"\"\"Reader object keeping an instance of the Eidos reader as a singleton.\n\n This allows th... | python | chosen |
[
{
"from": "system",
"value": "Add cassette and failed request as properties of thrown CannotOverwriteCassetteException\n"
},
{
"from": "human",
"value": "class CannotOverwriteExistingCassetteException(Exception):\n def __init__(self, *args, **kwargs):\n message = self._get_message(kwar... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with GO term (unsorted)."
},
{
"from": "human",
"value": "import numpy as np\nimport pandas as pa\nimport unittest\n\nimport pathway_extraction.uniprot_retrieval_data as uniprot_retrieval_data\n\ntest_data_directory_uniprot = 'test_data/' + 'test_uniprot_r... | python | chosen |
[
{
"from": "system",
"value": "Use an immutable tagged version of the Docker CLI container\n"
},
{
"from": "human",
"value": "import os\n\nfrom girder.utility.webroot import Webroot\n\nfrom .rest_slicer_cli import genRESTEndPointsForSlicerCLIsInDocker\n\n_template = os.path.join(\n os.path.dir... | python | chosen |
[
{
"from": "system",
"value": "Disable mouse handling in vterm example.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport urwid\n\ndef main():\n event_loop = urwid.SelectEventLoop()\n\n mainframe = urwid.Frame(\n urwid.Columns([\n ('fixed', 3, urwid.SolidFill('|... | python | chosen |
[
{
"from": "system",
"value": "Include Plot, SPlot in xnuplot.__all__.\n"
},
{
"from": "human",
"value": "from .plot import Plot, SPlot\n__all__ = [\"gnuplot\", \"numplot\"]\n"
},
{
"from": "gpt",
"value": "from .plot import Plot, SPlot\n__all__ = [\"Plot\", \"SPlot\", \"gnuplot\", \"... | python | chosen |
[
{
"from": "system",
"value": "Update shebang to use /usr/bin/env.\n\nRemove the /ms/dist reference.\n"
},
{
"from": "human",
"value": "#!/ms/dist/python/PROJ/core/2.5.2-1/bin/python\n# ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-\n# Copyright (... | python | chosen |
[
{
"from": "system",
"value": "Add players, match_valid to Ladder\n\n-Add rudimentary players() method that creates a set\n-Add match_valid() method that *only* checks that players are in\n the ladder standings\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python3\n\n\nclass Player:\n\n d... | python | chosen |
[
{
"from": "system",
"value": "Update logging to log async functions properly\n"
},
{
"from": "human",
"value": "import sys\nfrom functools import wraps, _make_key\n\nimport redis\n\n\ndef logging(*triggers, out=sys.stdout):\n \"\"\"Will log function if all triggers are True\"\"\"\n log = m... | python | chosen |
[
{
"from": "system",
"value": "Use SublimeLinter-javac as a base\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Josh Hagins\n# Copyright (c) 2014 Josh Hagins\n#\n# License: MIT\n#\n\n\"\"\"This module e... | python | chosen |
[
{
"from": "system",
"value": "Add initial file for GUI\n"
},
{
"from": "human",
"value": "import pyforms\nfrom pyforms import BaseWidget\nfrom pyforms.Controls import ControlText\n\nclass WelcomeScreen(BaseWidget):\n\tdef __init__(self):\n\t\tsuper(WelcomeScreen, self).__init__(\"TEST1\")\n\t\ts... | python | chosen |
[
{
"from": "system",
"value": "Update data migration with new CPS description\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\ndef populate_enrollment_info(apps, schema_editor):\n \"\"\"\n Po... | python | chosen |
[
{
"from": "system",
"value": "display_results: Support users with no name\n\nA user without a name causes an exception, and\nthe dedup algorithm also merged users without\na name as all of their names were `None`.\n\nFixes https://github.com/LABHR/octohatrack/issues/103\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Fix form PageForm needs updating.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib import admin\nfrom django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin\nfrom django.contrib.flatpages.models import FlatPage\nfro... | python | chosen |
[
{
"from": "system",
"value": "Remove xadmin as it will not work with guardian.\n"
},
{
"from": "human",
"value": "from guardian.admin import GuardedModelAdmin\n\n#from django.contrib import admin\nimport xadmin as admin\n\n\ndef register_to_sys(class_inst, admin_class = None):\n if admin_clas... | python | chosen |
[
{
"from": "system",
"value": "Fix KeyError: 'version' due to 403 Forbidden error\n"
},
{
"from": "human",
"value": "import json\nimport sys\nimport requests\n\n\ndef py_version():\n if sys.version_info < (3, 0, 0):\n print(sys.version)\n print('You must use Python 3.x to run thi... | python | chosen |
[
{
"from": "system",
"value": "Add getter for text widget"
},
{
"from": "human",
"value": "from tkinter import *\n\n\nclass TextEditor():\n def __init__(self):\n self.root = Tk()\n self.root.wm_title(\"BrickText\")\n self.text_panel = Text(self.root)\n self.text_pan... | python | chosen |
[
{
"from": "system",
"value": "Fix exception handling in TagField\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import ugettext as _\n\nfrom taggit.utils import parse_tags, edit_string_for_tags\n\nclass TagParseError(Exception):\n pass\n\ndef tags_t... | python | chosen |
[
{
"from": "system",
"value": "Change 'language' to 'syntax', that is more precise terminology.\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Aparajita Fishman\n# Copyright (c) 2013 Aparajita Fishman\n... | python | chosen |
[
{
"from": "system",
"value": "Initialize the log counter to 0xFF\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom time import sleep\n\n# Usage: ./bonus_level.py, then input your plaintext enclosed by quotes\n\n# Note: I haven't made a ciphertext for this because the attack on it d... | python | chosen |
[
{
"from": "system",
"value": "Add krelloptions variant that is used to turn on a configuration option to build the thread safe lightweight libraries.\n"
},
{
"from": "human",
"value": "from spack import *\n\nclass Mrnet(Package):\n \"\"\"The MRNet Multi-Cast Reduction Network.\"\"\"\n home... | python | chosen |
[
{
"from": "system",
"value": "Add missing packages to backend\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"maguire\",\n version=\"0.1\",\n url='https://github.com/picsadotcom/maguire',\n license='BSD',\n author='Picsa',\n aut... | python | chosen |
[
{
"from": "system",
"value": "Move ratelimit functionality into its own class\n"
},
{
"from": "human",
"value": "import time\nimport json\nimport sqlite3\nimport socket\nfrom collections import deque\n\nclass safesocket(socket.socket):\n def __init__(self, *args):\n self.floodQueue = d... | python | chosen |
[
{
"from": "system",
"value": "Make sure to avoid loading hacks on mutant loading\n"
},
{
"from": "human",
"value": "import logging\n\n__version__ = VERSION = (0, 0, 1)\n\nlogger = logging.getLogger('mutant')\n\nimport hacks"
},
{
"from": "gpt",
"value": "import logging\n\n__version__... | python | chosen |
[
{
"from": "system",
"value": "Make it possible for modules to send a response\n"
},
{
"from": "human",
"value": "from module_interface import Module, ModuleType\n\nclass Say(Module):\n def __init__(self):\n self.trigger = \"say\"\n self.moduleType = ModuleType.ACTIVE\n se... | python | chosen |
[
{
"from": "system",
"value": "Fix missing space between lede and rest of article\n"
},
{
"from": "human",
"value": "from bs4 import BeautifulSoup\nimport json\nimport re\n\ndef extract_from_b64(encoded_doc):\n #doc = base64.urlsafe_b64decode(encoded_doc)\n doc = encoded_doc.decode(\"base64... | python | chosen |
[
{
"from": "system",
"value": "Save mul at the end to force execution.\n"
},
{
"from": "human",
"value": "import dask.array as da\nfrom into import into\nfrom dask.array.into import discover\nfrom dask.dot import dot_graph\nimport tempfile\nimport rcnmf.tsqr\n\nx = da.random.standard_normal(size=... | python | chosen |
[
{
"from": "system",
"value": "Use VISION_BONNET_MODELS_PATH env var for custom models path.\n\nChange-Id: I687ca96e4cf768617fa45d50d68dadffde750b87\n"
},
{
"from": "human",
"value": "\"\"\"Utility to load compute graphs from diffrent sources.\"\"\"\n\nimport os\n\ndef load_compute_graph(name):\n... | python | chosen |
[
{
"from": "system",
"value": "Replace custom GRW dist with scipy gengamma. Implement file fitting function.\n"
},
{
"from": "human",
"value": "\"\"\"\nStatistics.\n\"\"\"\n\n\nfrom numpy import exp\nfrom scipy.stats import rv_continuous\nfrom scipy.special import gamma\n\n\nclass grw_gen(rv_con... | python | chosen |
[
{
"from": "system",
"value": "Add some more tests for wc module."
},
{
"from": "human",
"value": "# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>\n \n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as pub... | python | chosen |
[
{
"from": "system",
"value": "Remove destruction of pips/test requires entries that don't exist.\n"
},
{
"from": "human",
"value": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the... | python | chosen |
[
{
"from": "system",
"value": "Make coordinate 'frames' be imported\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"\nThis subpackage contains classes and functions for celestial coordinates\nof astronomical objects. It also contains a f... | python | chosen |
[
{
"from": "system",
"value": "Bump version for v0.2.0 release.\n"
},
{
"from": "human",
"value": "from __future__ import print_function, unicode_literals, absolute_import, division\n\n__all__ = [\n '__version__',\n]\n\n# Examples of valid version strings\n# __version__ = '1.2.3.dev1' # Devel... | python | chosen |
[
{
"from": "system",
"value": "Add random GT to a given vcf\n"
},
{
"from": "human",
"value": "import pysam\nfrom numpy.random import choice\nimport math\n\n\ndef assign_random_gt(input_vcf, outname, sample_name=\"HG\", default_af=0.01):\n vcf_pointer = pysam.VariantFile(filename=input_vcf)\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove test item from config grabbing script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\nimport os, shutil\n\nfiles = [\"/etc/crontab\",\n \"/usr/local/bin/ssu\", \"/usr/local/bin/xyzzy\",\n \"/home/dagon/.bashrc\",\"/home/dagon/.i3sta... | python | chosen |
[
{
"from": "system",
"value": "Add a running state which can be used to know when a workflow is running.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.\n#\n# Licensed under th... | python | chosen |
[
{
"from": "system",
"value": "Handle the weird field names from the new version of the API\n\nAs part of the switch to cordova, we moved to a newer version of the google\nplay API. Unfortunately, this meant that the weird field names for the\nconfidence and type changed to a different set of weird field nam... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8 order import issue\n"
},
{
"from": "human",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.ap... | python | chosen |
[
{
"from": "system",
"value": "Rename version field in Choice to question\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom rest_framework import serializers\n\nclass Question(models.Model):\n version = models.CharField(primary_key=True, max_length=8)\n text = models.Tex... | python | chosen |
[
{
"from": "system",
"value": "Add position table and add field mid in box tables\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\nclass User(models.Model):\n uid = models.AutoField(primary_key=True)\n uname = models.CharField(max_length=128)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add Python note on simple unit test\n"
},
{
"from": "human",
"value": "# Python Notes\n# Version 2.7\n\n# for loop\nfor i in range(10):\n print i\n\n# check list elements of matching string\nrandList = [\"a\", \"ab\", \"bc\", \"de\", \"abc\"]\ntoFind = \"a\"\npri... | python | chosen |
[
{
"from": "system",
"value": "Add target_table attribute to DataRow\n"
},
{
"from": "human",
"value": "class DataRow(dict):\n \"\"\"object for holding row of data\"\"\"\n\n def row_values(self, field_names, default_value=None):\n \"\"\"returns row value of specified field_names\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix typo breaking the TS6 feature.\n"
},
{
"from": "human",
"value": "from merc import errors\nfrom merc import feature\nfrom merc import message\nfrom merc import util\n\n\nclass SidFeature(feature.Feature):\n NAME = __name__\n\n\ninstall = SidFeature.install\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix Netflix in light of the new scope selection system\n"
},
{
"from": "human",
"value": "import urlparse\n\nimport foauth.providers\nfrom oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_QUERY\n\n\nclass Netflix(foauth.providers.OAuth1):\n # General info about the ... | python | chosen |
[
{
"from": "system",
"value": "Update choices descriptions in FileTypes\n"
},
{
"from": "human",
"value": "class ExportEvents:\n \"\"\"The different csv events types.\"\"\"\n\n EXPORT_PENDING = \"export_pending\"\n EXPORT_SUCCESS = \"export_success\"\n EXPORT_FAILED = \"export_failed\... | python | chosen |
[
{
"from": "system",
"value": "Add unexpected character bug fix\n"
},
{
"from": "human",
"value": "# Lidar Project Distance Subsystem\n\nimport serial\nimport socket\nimport time\nimport sys\nsys.path.insert(0, \"/home/pi/lidar/pi_approach/Libraries\")\nimport serverxclient as cli\n\narduino_dist... | python | chosen |
[
{
"from": "system",
"value": "Set default values for `tags` and `availability`\n"
},
{
"from": "human",
"value": "from typing import NamedTuple, Sequence, Dict, Iterable, List\nfrom datetime import datetime\n\n\nclass Slot(NamedTuple):\n venue: str\n starts_at: datetime\n duration: int\... | python | chosen |
[
{
"from": "system",
"value": "Fix not exis channel_long_slug on API access\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib.sites.models import get_current_site\nfrom django.utils import timezone\n\nfrom rest_framework.generics import ListAPI... | python | chosen |
[
{
"from": "system",
"value": "Update 'date_last_synced' field on each patient after midnight fetching\n"
},
{
"from": "human",
"value": "from recover.models import *\nfrom recover.patient_data import *\nfrom datetime import date\n\ndef midnightRun():\n physicians = User.objects()\n for phy... | python | chosen |
[
{
"from": "system",
"value": "Add documentation to Vendor properties\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport six\n\n\n@six.python_2_unicode_compatible\nclass Vendor(object):\n \"\"\"\n Represents a VPS provider.\n \"\... | python | chosen |
[
{
"from": "human",
"value": "Add lib functions to add/edit/delete port relations\n\n"
},
{
"from": "gpt",
"value": "from pycroft.lib.logging import log_room_event, log_event\nfrom pycroft.model.host import SwitchPort, Host, Switch\nfrom pycroft.model.port import PatchPort\nfrom pycroft.model.ses... | python | chosen |
[
{
"from": "system",
"value": "Allow the user to zoom in/out the quick reference text using Ctrl+Mouse Wheel\n\nSee issue #1\n"
},
{
"from": "human",
"value": "\"\"\"\nContains the quick reference widget\n\"\"\"\nfrom pyqode.qt import QtWidgets\nfrom .forms import quick_ref_ui\n\nclass QuickRefWi... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.