conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix to account for casing diffs between Mac OS X and Linux\n" }, { "from": "human", "value": "from django.test import TestCase\n\nfrom core import utils\n\n\nclass SlugifyOC(TestCase):\n\n def test_oc_slugify(self):\n\n lst = (\n ('test.this.val...
python
chosen
[ { "from": "system", "value": "Fix links in ANDS RIF-CS script\n" }, { "from": "human", "value": "\"\"\"\nCreate an ANDS RIF-CS XML file.\n\nLinks\n-----\n\n- http://ands.org.au/guides/cpguide/cpgrifcs.html\n\n- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html\n\n- http://ww...
python
chosen
[ { "from": "system", "value": "Update to the latest method signature\n\n\n\ngit-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@65 dda364a1-ef19-0410-af65-756c83048fb2\n" }, { "from": "human", "value": "\"\"\"Warns about large files\"\"\"\n\ndef handle_url(bot, user, channel, url):\n\n if cha...
python
chosen
[ { "from": "system", "value": "Update the script to set the international flag to do the notifications and notification_history in separate loops.\nIt takes about 1.5 minutes to update 27,000 notifications and 27,000 notification_history. The update is a row level lock so will only affect updates to the same...
python
chosen
[ { "from": "system", "value": "docs: Fix simple typo, trnslate -> translate\n\nThere is a small typo in paypal/payflow/codes.py.\n\nShould read `translate` rather than `trnslate`.\n" }, { "from": "human", "value": "# Make strings collectable with gettext tools, but don't trnslate them here:\n_ = ...
python
chosen
[ { "from": "system", "value": "Fix tests for django 2.2\n" }, { "from": "human", "value": "import os\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\n\nSECRET_KEY = 'fake-key'\nHASHID_FIELD_SALT = 'gg ez'\nINSTALLED_APPS = [\n \"django.contrib.auth\",\n \"django.contrib.contenttype...
python
chosen
[ { "from": "system", "value": "Change Form to FlaskForm (prevent deprecated)\n" }, { "from": "human", "value": "from flask_wtf import Form\nfrom wtforms import StringField, SubmitField\nfrom wtforms.validators import Required\n\n\nclass SimpleForm(Form):\n name = StringField('Your name', valid...
python
chosen
[ { "from": "system", "value": "Add utf decode for reading data\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport json\nimport websocket\n\nfrom polyaxon_client.logger import logger\n\n\nclass SocketTransportMixin...
python
chosen
[ { "from": "system", "value": "Refactor for clarity around _week_start_at\n" }, { "from": "human", "value": "import datetime\n\n\nclass Record(object):\n\n def __init__(self, data):\n self.data = data\n self.meta = {}\n if \"_timestamp\" in self.data:\n days_sin...
python
chosen
[ { "from": "system", "value": "Add code to accomodate a new '3 circles' approach\n" }, { "from": "human", "value": "from SimpleCV import *\nwinsize = (640,480)\ndisplay = Display(winsize)\n\nvideo = VirtualCamera('stefan_eye.mp4', 'video')\nwhile display.isNotDone():\n a = video.getImage()\n ...
python
chosen
[ { "from": "system", "value": "Fix typos in urlconf registry\n" }, { "from": "human", "value": "\"\"\"Django page CMS urlconf registry.\"\"\"\n\nfrom django.utils.translation import ugettext as _\n\nclass UrlconfAlreadyRegistered(Exception):\n \"\"\"\n An attempt was made to register a widg...
python
chosen
[ { "from": "system", "value": "Add a placeholder test so pytest will not report an error\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"Unit tests for the 'finder' module.\"\"\"\n" }, { "from": "gpt", "value": "#!/usr/bin/env python\n\n\"\"\"Unit tests for the 'find...
python
chosen
[ { "from": "system", "value": "Make `test_except` swift test pass\n\nCurrently it is expected to fail. This asserts that the correct\nexception is raised. Fixes #155.\n" }, { "from": "human", "value": "#!/usr/bin/env python3.5\n\nimport parsl\nfrom parsl import *\n\nparsl.set_stream_logger()\n\nf...
python
chosen
[ { "from": "system", "value": "Add stub to search for players remotely\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport json\n\nfrom db import commit_db_item\nfrom db.player import Player\n\n\ndef migrate_players(plr_src_file=None):\n\n if ...
python
chosen
[ { "from": "system", "value": "Apply modification from Feb 5\n" }, { "from": "human", "value": "import hashlib\nimport models\nimport os\nimport os.path\n\ndef init():\n models.db.connect()\n models.db.create_tables([models.Entry])\n\ndef digest(file_path):\n h = hashlib.sha1()\n file...
python
chosen
[ { "from": "system", "value": "Fix functional test for policy type listing\n\nThis patch fixes the funtional test for policy type listing. We have\nchanged the names of builtin policy types.\n\nChange-Id: I9f04ab2a4245e8946db3a0255658676cc5f600ab\n" }, { "from": "human", "value": "# Licensed unde...
python
chosen
[ { "from": "system", "value": "Use the release version rather than public version for GitHub links\n" }, { "from": "human", "value": "#!/usr/bin/env python3\nfrom importlib.metadata import version\n\nfrom packaging.version import parse\n\nextensions = [\n \"sphinx.ext.autodoc\",\n \"sphinx....
python
chosen
[ { "from": "system", "value": "Refactor Gilda module and add function to get models\n" }, { "from": "human", "value": "\"\"\"This module implements a client to the Gilda grounding web service,\nand contains functions to help apply it during the course of INDRA assembly.\"\"\"\n\nimport requests\n...
python
chosen
[ { "from": "system", "value": "Add post_save handler for MatterSponsor\n" }, { "from": "human", "value": "from django.db.models.signals import pre_save, post_save\nfrom django.dispatch import receiver\nfrom django.utils import timezone\nfrom cityhallmonitor.models import DirtyFieldsModel, \\\n ...
python
chosen
[ { "from": "system", "value": "Align Face and Feature Mapping\n" }, { "from": "human", "value": "import cv2\n\n\nclass FaceDetector:\n def __init__(self, face_cascade_path):\n self.faceCascade = cv2.CascadeClassifier(face_cascade_path)\n\n def detect(self, image, scale_factor=1.1, mi...
python
chosen
[ { "from": "system", "value": "Fix resize tool demo comments.\n" }, { "from": "human", "value": "\"\"\"\nThis demonstrates the most basic drawing capabilities using Enable. A new\ncomponent is created and added to a container.\n\"\"\"\nfrom enable.example_support import DemoFrame, demo_main\nfro...
python
chosen
[ { "from": "system", "value": "Add clarifying comment about Django setup\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Setup Django\n\nfrom django.conf import settings\n\nsettings.configure(\n DEBUG=True,\n DATABASES={\n 'default': {\n 'ENGINE': 'django.db....
python
chosen
[ { "from": "system", "value": "[FIX] Set last id in sequence\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in module root\n# directory\n######...
python
chosen
[ { "from": "system", "value": "Add some range application with list\n" }, { "from": "human", "value": "# -------------------------------------------------------------------------------------------------\n# RANGE\n# ----------------------------------------------------------------------------------...
python
chosen
[ { "from": "system", "value": "Update the most recent fileversions region for copied files across regions\n\n[#PLAT-1100]\n" }, { "from": "human", "value": "\ndef copy_files(src, target_node, parent=None, name=None):\n \"\"\"Copy the files from src to the target node\n :param Folder src: Th...
python
chosen
[ { "from": "system", "value": "Update download links to summary_stats and humanitarian\n\nWith the split of the dashboard and publishing statistics, `humanitarian.csv` and `summary_stats.csv` will be moving to a different url, this PR points to that." }, { "from": "human", "value": "#!/usr/bin/en...
python
chosen
[ { "from": "system", "value": "Fix the return value of get_tty_width() it should return an int.\n\nSigned-off-by: Daniel Nephin <6347c07ae509164cffebfb1e2a0d6ed64958db19@gmail.com>\n" }, { "from": "human", "value": "from __future__ import unicode_literals\nfrom __future__ import absolute_import\n...
python
chosen
[ { "from": "system", "value": "Use different pep257 entry point\n\nThe check_source() function of pep257.py does not handle AllError and\nEnvironmentError exceptions. We can use instead the check() function\nand ignore any errors that do not belong to the pep257.Error class and\nthus are of no use to Flake8....
python
chosen
[ { "from": "system", "value": "Update style test to work with this package.\n" }, { "from": "human", "value": "import glob\nimport os\nimport pep8\n\n\nclass TestCodeFormat:\n def test_pep8(self):\n def match(*p):\n s = ['theanets'] + list(p) + ['*.py']\n return gl...
python
chosen
[ { "from": "system", "value": "Fix import UI django view's tests\n" }, { "from": "human", "value": "import pytest\n\nfrom django.test import TestCase\nfrom django.core.urlresolvers import reverse\n\nfrom molo.core.tests.base import MoloTestCaseMixin\n\n\n@pytest.mark.django_db\nclass TestImportFr...
python
chosen
[ { "from": "system", "value": "Put API under /api/ by default\n" }, { "from": "human", "value": "from flask import Flask, abort, jsonify\nfrom flask_caching import Cache\nfrom flask_cors import CORS\n\nimport main\n\napp = Flask(__name__)\ncache = Cache(app, config={'CACHE_TYPE': 'simple'})\ncors...
python
chosen
[ { "from": "system", "value": "Add one more line of comment in printList function.\n" }, { "from": "human", "value": "\"\"\"\n\tThis file includes several data structures used in LeetCode question.\n\"\"\"\n# Definition for a list node.\nclass ListNode(object):\n\tdef __init__(self, n):\n\t\tself...
python
chosen
[ { "from": "system", "value": "Improve Django Admin interface for Organisations\n\nWe have a lot of nodes now so adding some way of filtering by type and\nsearching by name seemed wise.\n\nI've switched the multiselect box to pick parents for an interface that\nis a little more sane when we have over a 1000 ...
python
chosen
[ { "from": "system", "value": "Use clear cart method from satchless\n\nhttps://github.com/mirumee/satchless/commit/3acaa8f6a27d9ab259a2d66fc3f7416a18fab1ad\n\nThis reverts commit 2ad16c44adb20e9ba023e873149d67068504c34c.\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n...
python
chosen
[ { "from": "system", "value": "Remove the template for now.\n\ngit-svn-id: 9a050473c2aca1e14f53d73349e19b938c2cf203@9344 6a7f98fc-eeb0-4dc1-a6e2-c2c589a08aa6\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nmsg = {\n\t'en': {\n 'commons-file-moved' : u'[[:File:%s|File]] ...
python
chosen
[ { "from": "system", "value": "Add create & update methods for page API\n" }, { "from": "human", "value": "from rest_framework import serializers\n\nfrom wafer.pages.models import Page\n\n\nclass PageSerializer(serializers.ModelSerializer):\n\n class Meta:\n model = Page\n\n def crea...
python
chosen
[ { "from": "system", "value": "Add exception logging to Handlers\n" }, { "from": "human", "value": "\"\"\"Handle handlers.\"\"\"\n\nimport logging\n\nclass Handlers(object):\n \"\"\"Handlers.\"\"\"\n\n def __init__(self, *handlers):\n self.handlers = handlers\n\n def handle(self, ...
python
chosen
[ { "from": "system", "value": "Order sponsors by ID on the sponsors page, too\n" }, { "from": "human", "value": "from django.views.generic.list import ListView\nfrom django.views.generic import DetailView\n\nfrom rest_framework import viewsets\nfrom rest_framework.permissions import DjangoModelPe...
python
chosen
[ { "from": "system", "value": "Fix text to prove that behavior\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport mock\nfrom exam import fixture\n\nfrom sentry.testutils import TestCase\nfrom sentry.interfaces import User\nfrom sentry.mo...
python
chosen
[ { "from": "system", "value": "Add newline at the end of file\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport unittest\nimport glob\nimport sys\n\n\ndef create_test_suite(mod):\n if mod is None:\n test_file_strings = glob.glob('jinger/test/test_*.py')\n module_...
python
chosen
[ { "from": "system", "value": "Add to_currency method in order to be able to convert to a new currency\n" }, { "from": "human", "value": "\nclass Money(object):\n\n def __init__(self, amount, currency):\n self.amount = amount\n self.currency = currency.upper()\n\n def __repr__...
python
chosen
[ { "from": "system", "value": "Reduce title, description search boost on document" }, { "from": "human", "value": "from elasticsearch_dsl.query import Q\n\nfrom froide.helper.search.views import BaseSearchView\nfrom froide.helper.search.filters import BaseSearchFilterSet\n\nfrom filingcabinet.mod...
python
chosen
[ { "from": "system", "value": "Simplify pubtator test to only check for entities, not exact number\n" }, { "from": "human", "value": "\nimport kindred\n\ndef test_pubtator_pmid():\n\tcorpus = kindred.pubtator.load(19894120)\n\n\tassert isinstance(corpus,kindred.Corpus)\n\n\tdocCount = len(corpus....
python
chosen
[ { "from": "system", "value": "Remove reference to manager that no longer exists\n" }, { "from": "human", "value": "from modularodm import Q\n\n\nPREREG_CAMPAIGNS = {\n 'prereg': 'Prereg Challenge',\n 'erpc': 'Election Research Preacceptance Competition',\n}\n\ndef drafts_for_user(user, cam...
python
chosen
[ { "from": "system", "value": "ADD - Python script looping correctly\n" }, { "from": "human", "value": "#!/usr/bin/env python\n## Arguments: numerOfTests program arg1Init-arg1Final arg2Init-arg2Final arg3Init-arg3Final...\n## Ex: ./scalaBee 2 ./examples/omp_pi 1,2,4,8 100000,1000000,10000000,1000...
python
chosen
[ { "from": "system", "value": "[test] Add a test for nix.core.DataArray.label\n" }, { "from": "human", "value": "__author__ = 'gicmo'\nimport unittest\nimport nix.core\n\n\nclass TestFile(unittest.TestCase):\n def setUp(self):\n self.nix_file = nix.core.File.open('test.h5')\n ass...
python
chosen
[ { "from": "system", "value": "Remove unused import and fix typo\n" }, { "from": "human", "value": "from django.core.exceptions import ObjectDoesNotExist\nfrom django.core.management.base import BaseCommand, CommandError\n\nfrom subscriptions.models import Subscription\n\n\nclass Command(BaseComm...
python
chosen
[ { "from": "system", "value": "Revert \"Add bounds checking to BaseHandler.read()\"\n\nThis reverts commit 045ead44ef69d6ebf2cb0dddf084762efcc62995.\n" }, { "from": "human", "value": "from collections import OrderedDict\n\n\nclass BaseHandler:\n def __init__(self, file, file_name):\n se...
python
chosen
[ { "from": "system", "value": "Change docstrings and function names.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# (C) 2015 Jean Nassar\n# Released under BSD version 4\n\"\"\"\nReduce /ardrone_camera framerate to 2 Hz.\n\n\"\"\"\nimport rospy\nfrom sensor_m...
python
chosen
[ { "from": "system", "value": "Add docstrings to exponential backoff\n" }, { "from": "human", "value": "\"\"\"\nMisc. general utility functions, not tied to Kubespawner directly\n\"\"\"\nfrom concurrent.futures import ThreadPoolExecutor\nimport random\n\nfrom jupyterhub.utils import DT_MIN, DT_MA...
python
chosen
[ { "from": "human", "value": "Add WindowAndTextCommand class to sublime_lib\n\nProbably has limited use but w/e.\n" }, { "from": "gpt", "value": "import sublime_plugin\nfrom sublime import Window, View\n\n\nclass WindowAndTextCommand(sublime_plugin.WindowCommand, sublime_plugin.TextCommand):\n ...
python
chosen
[ { "from": "system", "value": "Add functuion to ibots to name a branch\n" }, { "from": "human", "value": "\"\"\"Set up access to important employer data for IPython\"\"\"\n\nfrom dataclasses import dataclass\n\n@dataclass\nclass EmployerData:\n name: str\n\nwwts = EmployerData('wwts')\n" }, ...
python
chosen
[ { "from": "system", "value": "Fix running tests form command line\n" }, { "from": "human", "value": "from cfgen import cfgen\nfrom nose.tools import assert_equals\nimport os\n\ndef setup():\n os.chdir(\"test_dir\")\n clean()\n \n\ndef test_cmd_write():\n cfgen.cmd_write(\"test.cfg\")...
python
chosen
[ { "from": "system", "value": "Add a test for json retrieval.\n" }, { "from": "human", "value": "import unittest\n\nfrom flask import Flask\nfrom flask.ext.autodoc import Autodoc\n\n\nclass TestAutodocWithFlask(unittest.TestCase):\n def setUp(self):\n self.app = Flask(__name__)\n ...
python
chosen
[ { "from": "system", "value": "Add receent activity to dashboard\n" }, { "from": "human", "value": "#_*_ coding: UTF-8 _*_\n\nfrom flask import render_template\n\nfrom application import app\nimport data_models\nimport views\n\nimport funds\nimport projects\nimport grants\nimport pledges\nimport ...
python
chosen
[ { "from": "system", "value": "Support no-args for djangae.core.management.execute_from_commandline - matches django implementation.\n" }, { "from": "human", "value": "import argparse\n\nimport djangae.sandbox as sandbox\n\n\ndef execute_from_command_line(argv=None):\n \"\"\"Wraps Django's `ex...
python
chosen
[ { "from": "system", "value": "Fix ImportError and use bytes in outstream\n" }, { "from": "human", "value": "\n\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obta...
python
chosen
[ { "from": "system", "value": "Use dict in render_to_string when sending email\n\nBuilding a Context manually like this is deprecated in Django 1.11, so\nlet's not do it this way.\n" }, { "from": "human", "value": "import logging\nfrom django.conf import settings\nfrom django.core.mail import sen...
python
chosen
[ { "from": "system", "value": "Comment out pandas because its unused\n" }, { "from": "human", "value": "from matplotlib import pyplot as plt\nimport numpy as np\nimport os\nimport pandas as pd\n\ndata_files = \"./data\"\n\ndef movingAv(interval, window_size):\n window = np.ones(int(window_size))...
python
chosen
[ { "from": "system", "value": "Validate token when fetching channels\n" }, { "from": "human", "value": "import json\nfrom slackclient import SlackClient\n\nclass SlackBotConf(object):\n def __init__(self):\n self.username = 'Luigi-slack Bot'\n\nclass SlackAPI(object):\n \n def __i...
python
chosen
[ { "from": "system", "value": "Use correct m2m join table name in LatestCommentsFeed\n\n\ngit-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@9089 bcc190cf-cafb-0310-a4f2-bffc1f526a37\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.contrib.syndication.feeds impor...
python
chosen
[ { "from": "system", "value": "Change default value to use UTC time\n" }, { "from": "human", "value": "from datetime import datetime, timedelta\n\nRESOURCE_METHODS = ['GET', 'POST', 'DELETE']\nITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']\nDATE_FORMAT = '%Y-%m-%d %H:%M:%S GMT'\n\nschema = {\n ...
python
chosen
[ { "from": "system", "value": "Fix extra blank window on Windows via PyInstaller\n" }, { "from": "human", "value": "from multiprocessing import freeze_support\nfrom ELiDE.app import ELiDEApp\nimport sys\nimport os\nwd = os.getcwd()\nsys.path.extend([wd + '/LiSE', wd + '/ELiDE', wd + '/allegedb'])...
python
chosen
[ { "from": "system", "value": "Use discover runner on older djangos\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Adapted from https://raw.githubusercontent.com/hzy/django-polarize/master/runtests.py\n\nimport sys\n\nfrom django.conf import settings\nfrom django.core.management im...
python
chosen
[ { "from": "system", "value": "Fix an integer out of range error with a migration to the transient integer bounds field (superseded by a float bounds field).\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-06-27 19:14\nfrom __future__ import unicod...
python
chosen
[ { "from": "system", "value": "Replace global var with threading.local\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport six\nfrom django.core.handlers.wsgi import WSGIHandler\n\nwsgi_tb = None\n\n\ndef null_technical_500_response(request, exc_type, exc_value, tb, status_code=500...
python
chosen
[ { "from": "system", "value": "Handle IPv6 in REST API\n" }, { "from": "human", "value": "\"\"\"\nWhip's REST API\n\"\"\"\n\n# pylint: disable=missing-docstring\n\nfrom socket import inet_aton\n\nfrom flask import Flask, abort, make_response, request\n\nfrom .db import Database\n\napp = Flask(__n...
python
chosen
[ { "from": "system", "value": "Allow hooks to return values (and simplify the code)\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2014 Université Catholique de Louvain.\n#\n# This file is part of INGInious.\n#\n# INGInious is free software: you can redistribute it...
python
chosen
[ { "from": "system", "value": "Fix a stupid bug in get_people_from_memberships\n\nThe rebinding of the function's election_data parameter was breaking\nthe listing of candidates for a post.\n" }, { "from": "human", "value": "from django.core.urlresolvers import reverse\nfrom django.conf import se...
python
chosen
[ { "from": "system", "value": "Clarify that submission ID != task ID\n\nCalling this out in the helptext will hopefully help avoid people\nconflating these two quite as easily. (An imperfect solution for an\nimperfect world.)\n" }, { "from": "human", "value": "import click\n\nfrom globus_cli.pars...
python
chosen
[ { "from": "system", "value": "Change soundcloud sync to happen every 20 minutes\n" }, { "from": "human", "value": "import logging\nimport newrelic.agent\n\nlog = logging.getLogger(__name__)\n\n\ndef send_saved_search_alerts():\n from pmg import app\n from pmg.models import SavedSearch\n\n ...
python
chosen
[ { "from": "system", "value": "[FIX] purchase_stock_picking_return_invoicing: Hide button on proper counter\n\nWe should hide the view refunds button when there are no refunds, not\nwhen there aren't invoices.\n\nIt hasn't been detected till now, because you usually have an invoice\nbefore doing a refund, bu...
python
chosen
[ { "from": "system", "value": "Increase keepalive timeout to 5 minutes.\n" }, { "from": "human", "value": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regar...
python
chosen
[ { "from": "system", "value": "Make default ALA's date the day before yesterday\n" }, { "from": "human", "value": "import logging\nfrom django.core.management.base import BaseCommand\nfrom apps.processing.ala.util import util\nfrom dateutil.parser import parse\nfrom datetime import date, timedelt...
python
chosen
[ { "from": "system", "value": "TST: Add smoke-testing of the DKI fit.\n" }, { "from": "human", "value": "from AFQ import dki\nimport numpy.testing as npt\n\n\ndef test_fit_dki_inputs():\n data_files = [\"String in a list\"]\n bval_files = \"just a string\"\n bvec_files = \"just another s...
python
chosen
[ { "from": "system", "value": "Use logging directly in main\n" }, { "from": "human", "value": "import logging\nimport os\n\nfrom apscheduler.schedulers.blocking import BlockingScheduler\nfrom raven.base import Client as RavenClient\n\nimport warner\nimport archiver\nimport announcer\nimport flagg...
python
chosen
[ { "from": "system", "value": "Revert \"Remove redundant migration operation.\"\n\nThis reverts commit 9d34264d275acd32122de3567e60b24a417d6098.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9 on 2016-02-08 15:29\nfrom __future__ import unicode_literals\n\nfr...
python
chosen
[ { "from": "system", "value": "Discard title and description from wurstball\n" }, { "from": "human", "value": "import logging\nimport re\nimport socket\nimport urllib\nfrom bs4 import BeautifulSoup\n\nlogger = logging.getLogger(__name__)\nWURSTBALL_RE = re.compile(\"^http[s]://wurstball.de/[0-9]+...
python
chosen
[ { "from": "system", "value": "Add option parser and main method\n" }, { "from": "human", "value": "from Crypto.Cipher import AES\nimport json\nimport os\n\nKEY_LENGTH = 256\nBLOCK_LENGTH = 16\n\nKEY_FILE = 'key'\nENCRYPTED_FILE = 'data'\nDECRYPTED_FILE = 'tmp'\n\nEOT_CHAR = '\\x04'\n\ndef get_ci...
python
chosen
[ { "from": "system", "value": "Remove line meant to test trailing whitespace since that kind of whitespace is\nautomatically removed.\n\nAlso annotate what each line is meant to test.\n" }, { "from": "human", "value": "\"\"\"Test file for syntax highlighting of editors.\n\nMeant to cover a wide r...
python
chosen
[ { "from": "system", "value": "Fix for formula interpretation triggering in Excel\n" }, { "from": "human", "value": "import tablib\n\nfrom multi_import.fields import FieldHelper\n\n__all__ = [\n 'Exporter',\n]\n\n\nclass Exporter(FieldHelper):\n\n def __init__(self, queryset, serializer):\n...
python
chosen
[ { "from": "system", "value": "Hide comments meant as unseen\n" }, { "from": "human", "value": "from ckan.plugins import toolkit as tk\n\n\ndef archiver_resource_show(resource_id):\n data_dict = {'id': resource_id}\n return tk.get_action('archiver_resource_show')(data_dict)\n\n\ndef archive...
python
chosen
[ { "from": "system", "value": "Add documentation for goto command\n\nChange-Id: I94e280eef509abe65f552b6e78f21eabfe4192e3\nSigned-off-by: Sarah Liske <e262b8a15d521183e33ead305fd79e90e1942cdd@polybeacon.com>\n" }, { "from": "human", "value": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyr...
python
chosen
[ { "from": "system", "value": "Correct method signature for BaseModel create\n" }, { "from": "human", "value": "\"\"\"Interface for Models.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport abc\nimport tensorflow as t...
python
chosen
[ { "from": "system", "value": "Handle chapters as sequence modules\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"XModule\",\n version=\"0.1\",\n packages=find_packages(),\n install_requires=['distribute'],\n package_data={\n ...
python
chosen
[ { "from": "system", "value": "Fix typo \"ech\" -> \"each\"\n" }, { "from": "human", "value": "\"\"\"\nThis plugin implements :func:`startTestRun`, setting a test executor\n(``event.executeTests``) that just collects tests without executing\nthem. To do so it calls result.startTest, result.addSuc...
python
chosen
[ { "from": "system", "value": "Remove test_single_gene_deletion (renamed in cobra=0.4.0b1)\n" }, { "from": "human", "value": "# Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this...
python
chosen
[ { "from": "system", "value": "Use raven for logging if available\n" }, { "from": "human", "value": "# -*- coding: UTF-8 -*-\n\"\"\"\n trytond_async.celery\n\n Implementation of the celery app\n\n This module is named celery because of the way celery workers lookup\n the app when `--p...
python
chosen
[ { "from": "system", "value": "Use parse_known_args and pass leftovers to lettuce\n\nSeems to be more reliable at handling weird argument ordering than\nREMAINDER was\n" }, { "from": "human", "value": "import sys\nimport argparse\n\nfrom lettuce.bin import main as lettuce_main\nfrom lettuce impor...
python
chosen
[ { "from": "system", "value": "ievv_sms: Add pswin backend to registry.\n" }, { "from": "human", "value": "from django.apps import AppConfig\n\n\nclass ModelSmsAppConfig(AppConfig):\n name = 'ievv_opensource.ievv_sms'\n verbose_name = \"IEVV SMS\"\n\n def ready(self):\n from ievv_...
python
chosen
[ { "from": "system", "value": "Update licence header + Introduction of docstrings\n" }, { "from": "human", "value": "#!/bin/env python\n\n# A-John-Shots - Python module/library for saving Security Hash Algorithms into JSON format.\n# Copyright (C) 2017 Funilrys - Nissar Chababy <contact at...
python
chosen
[ { "from": "system", "value": "Use Python 3 by default\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"Call the main setup_git.py. This should be\ncopied to the main directory of your project and named setup_git.py.\"\"\"\n\nimport os\nimport os.path\nos.system(os.path.join(\"to...
python
chosen
[ { "from": "system", "value": "Remove useless code from LinearColorMapper\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nimport numpy as np\nfrom six import string_types\n\nfrom ..plot_object import PlotObject\nfrom ..properties import Any, Float, Color\nfrom .. impo...
python
chosen
[ { "from": "system", "value": "Bump app version to 2021.3.0\n\nSigned-off-by: Guillaume Tucker <e7e20b7c30f19d4ca6b81319ef81bf200369d137@collabora.com>\n" }, { "from": "human", "value": "__version__ = \"2020.11.2\"\n__versionfull__ = __version__\n" }, { "from": "gpt", "value": "__vers...
python
chosen
[ { "from": "system", "value": "Add test for with_path_overlay also.\n" }, { "from": "human", "value": "from rwt import launch\n\n\ndef test_with_path(tmpdir, capfd):\n\tparams = ['-c', 'import sys; print(sys.path)'\t]\n\tlaunch.with_path(str(tmpdir), params)\n\tout, err = capfd.readouterr()\n\tas...
python
chosen
[ { "from": "system", "value": "Add docstring to load() method\n" }, { "from": "human", "value": "\"\"\"Facility to load plugins.\"\"\"\n\nimport sys\nimport os\n\nfrom importlib import import_module\n\n\nclass StraightPluginLoader(object):\n \"\"\"Performs the work of locating and loading stra...
python
chosen
[ { "from": "system", "value": "Use pkg_resources.parse_requirements() to simplify parsing.\n" }, { "from": "human", "value": "# ============================================================================\n# PAVER EXTENSION/UTILITY: Read PIP requirements files\n# =================================...
python
chosen
[ { "from": "system", "value": "Convert rendered html to unicode before substring matching\n" }, { "from": "human", "value": "# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors\n# MIT License. See license.txt\nfrom __future__ import unicode_literals\nimport frappe\nimport unittes...
python
chosen
[ { "from": "system", "value": "Fix flake8 error for missing whitespace\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n" }, { "from": "human", "value": "import pytest\n\nfrom gaphor.diagram.tests.fixtures import allow, connect, disconnect\nfrom gaphor.SysML import s...
python
chosen
[ { "from": "system", "value": "Use a dict instead of Context instance in DjangoDebuggerTests test project, to avoid a TypeError in latest version of Django.\n" }, { "from": "human", "value": "from django.template import Context, loader\n# Create your views here.\nfrom django.http import HttpRespo...
python
chosen