conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add documentation for SearchTrip form\n" }, { "from": "human", "value": "from django.contrib.auth.forms import AuthenticationForm\nfrom django import forms\nfrom .models import PoolingUser\n\n\nclass LoginForm(AuthenticationForm):\n username = forms.CharField(wid...
python
chosen
[ { "from": "system", "value": "Add docstrings for most public API methods.\n" }, { "from": "human", "value": "from collections import MutableMapping\n\n\nclass BetterOrderedDict(MutableMapping):\n def __init__(self, **kwargs):\n self._d = dict()\n self._keys = []\n\n def __len...
python
chosen
[ { "from": "system", "value": "fix: Make catt refuse to install under 2 more\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n__author__ = \"Stavros Korokithakis\"\n__email__ = \"hi@stavros.io\"\n__version__ = \"0.9.3\"\n" }, { "from": "gpt", "value": "# -*- coding: utf-8...
python
chosen
[ { "from": "system", "value": "Load all storage plugins in the printer application\n" }, { "from": "human", "value": "from Cura.Wx.WxApplication import WxApplication\nfrom Cura.Wx.MainWindow import MainWindow\n\nclass PrinterApplication(WxApplication):\n def __init__(self):\n super(Prin...
python
chosen
[ { "from": "system", "value": "DOC: Add Errors to the public API.\n" }, { "from": "human", "value": "from .simple_broker import _DataBrokerClass, EventQueue, Header\nfrom .handler_registration import register_builtin_handlers\n\nDataBroker = _DataBrokerClass() # singleton\nregister_builtin_handl...
python
chosen
[ { "from": "system", "value": "Rename functions to include sorting and merging\n\nThe algorithm will require sorting in order to run in O(nlogn) time.\nThe implementation will closely follow that of merge-sort, so the\nfunctions were renamed to reflect this.\n" }, { "from": "human", "value": "fro...
python
chosen
[ { "from": "system", "value": "Add service functions to get transactions by time\n" }, { "from": "human", "value": "from datetime import date\nfrom datetime import timedelta\n\nfrom django.utils import timezone\n\nfrom books.models import Transaction\n\n\ndef get_months_transactions():\n today...
python
chosen
[ { "from": "system", "value": "Add OK_TESTS and DISABLE_LOGIN to TE\n\nThe OK_TESTS environment variable can be used to disable logins\nby setting OK_TESTS=DISABLE_LOGIN. The test isn't equality, but 'in'.\nSo, you can add more things to that flag.\n" }, { "from": "human", "value": "from flask im...
python
chosen
[ { "from": "system", "value": "Prepare development of new version." }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# Copyright © 2009 Ben Finney <ben+python@benfinney.id.au>\n# Copyright © 2006 Robert Niederreiter\n#\n# This is free software: you may copy, modify, and/or distribute th...
python
chosen
[ { "from": "system", "value": "Fix validation of Client objects\n" }, { "from": "human", "value": "import uuid\n\nfrom django.db import transaction, IntegrityError\n\nfrom mygpo.users.settings import STORE_UA\nfrom mygpo.users.models import Client\n\nimport logging\nlogger = logging.getLogger(__n...
python
chosen
[ { "from": "system", "value": "Add flushing to stdout/stderr in system calls.\n" }, { "from": "human", "value": "import sys\nfrom subprocess import Popen, PIPE\nfrom IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC\n\n\nclass ZMQInteractiveShell(InteractiveShell):\n \...
python
chosen
[ { "from": "system", "value": "Stop creating an unbounded number of \"Jack is my hero\" files under Windows.\nNot that Jack doesn't deserve them, but saying it so often cheapens the\nsentiment.\n" }, { "from": "human", "value": "#! /usr/bin/env python\n\"\"\"Test script for the binhex C module\n\...
python
chosen
[ { "from": "system", "value": "Allow trailing slash at the end of URLs\n\nSpecifically app detail page and category app list.\n" }, { "from": "human", "value": "from django.conf.urls import url, include\nfrom django.contrib import admin\n\nfrom nextcloudappstore.core.views import CategoryAppListV...
python
chosen
[ { "from": "system", "value": "Raise ValidationError properly in SignupForm\n" }, { "from": "human", "value": "from django import forms\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.forms import UserCreationForm\nfrom django.core.validators import RegexValidator\n\nalphan...
python
chosen
[ { "from": "system", "value": "Remove unnecessary assignment to self.client in test cases.\n" }, { "from": "human", "value": "from django.core.urlresolvers import reverse\nfrom django.test import Client, TestCase\n\nfrom users.models import User\n\n\nclass UserRedirectViewTestCase(TestCase):\n\n ...
python
chosen
[ { "from": "system", "value": "Improve printing of signature and version\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# \n# Copyright (c) 2017 Ralf Horstmann <ralf@ackstorm.de>\n# \n# Permission to use, copy, modify, and distribute this software for any\n# purpose with or without fee...
python
chosen
[ { "from": "system", "value": "Add sites app, change how installed_apps are edited.\n" }, { "from": "human", "value": "from settings import *\nINSTALLED_APPS.append('complex')\nINSTALLED_APPS.append('django.contrib.comments')\n\nROOT_URLCONF = 'complex.urls'\n" }, { "from": "gpt", "va...
python
chosen
[ { "from": "system", "value": "Remove explicit initialize_tpu_system call from model garden.\n\nPiperOrigin-RevId: 290354680\n" }, { "from": "human", "value": "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# ...
python
chosen
[ { "from": "system", "value": "Remove bson, datetime, and mongo\n\nCurrent BSON fails to work\ndatetime can't be serialized by json_util\nmongodb is not needed; just use JSON\n" }, { "from": "human", "value": "#!/usr/bin/env python\n#\n# Convert browser bookmark export (NETSCAPE-Bookmark-file-1 f...
python
chosen
[ { "from": "system", "value": "Unify access in Pythonic built ins\n" }, { "from": "human", "value": "class ThingObjectBase(object):\n\n def __getitem__(self, item):\n return getattr(self, item)\n\n def __contains__(self, item):\n return hasattr(self, item)\n\n\nclass ThingObje...
python
chosen
[ { "from": "system", "value": "Add warning if 'phantasy_apps' cannot be found.\n" }, { "from": "human", "value": "# encoding: UTF-8\n#\n# Copyright (c) 2015-2016 Facility for Rare Isotope Beams\n#\n\n\"\"\"\nPhysics Applications\n\"\"\"\n\nfrom .latticemodel import lmapp\n\nfrom phantasy_apps imp...
python
chosen
[ { "from": "system", "value": "Add review status to serializer\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nfrom rest_framework import serializers\n\nfrom .models import PostResult, ResultSet, CandidateResult\n\nfrom candidates.serializers import (\n Membership...
python
chosen
[ { "from": "system", "value": "extensions: Make the user field into a raw field\n\nIt's a bit annoying having to navigate through a 20,000 line combobox.\n" }, { "from": "human", "value": "\nfrom django.contrib import admin\n\nfrom extensions.models import Extension, ExtensionVersion\nfrom extens...
python
chosen
[ { "from": "system", "value": "Modify client to read the socket concurrently\n" }, { "from": "human", "value": "import sys, time\nimport socket\n\n\ndef make_new_connection(name, host, port):\n sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n sockobj.connect((host, port))\n\n ...
python
chosen
[ { "from": "system", "value": "Allow setting of postgres user via an environment variable\n\nTouch #73\n" }, { "from": "human", "value": "from __future__ import absolute_import\nimport os\n\nos.environ['INBOX_TESTING'] = '1'\nos.environ[\"INBOXEN_ADMIN_ACCESS\"] = '1'\nfrom settings import *\n\nC...
python
chosen
[ { "from": "system", "value": "Fix import to not include project." }, { "from": "human", "value": "from django.test import TestCase\nfrom readthedocs.core import hacks\n\nclass TestHacks(TestCase):\n fixtures = ['eric.json', 'test_data.json']\n\n def setUp(self):\n hacks.patch_meta_p...
python
chosen
[ { "from": "system", "value": "Add dummy cache setting so code can be loaded\n\nI mimic what will happen on ReadTheDocs locally by doing the following:\n\n * Don't start my hq environment (no couch, pillowtop, redis, etc)\n * Enter my hq virtualenv\n * Move or rename `localsettings.py` so it won't be found\n...
python
chosen
[ { "from": "system", "value": "Remove membership internal ID and change person to name\n" }, { "from": "human", "value": "from rest_framework import serializers\n\nfrom popolo import models as popolo_models\nfrom parties.serializers import MinimalPartySerializer\n\n\nclass MinimalPostSerializer(s...
python
chosen
[ { "from": "system", "value": "Add debugging output to app demo\n" }, { "from": "human", "value": "def main():\n from psi.experiment.workbench import PSIWorkbench\n workbench = PSIWorkbench()\n\n io_manifest = 'io_manifest.IOManifest'\n controller_manifest = 'simple_experiment.Control...
python
chosen
[ { "from": "system", "value": "Change migration name to more proper\n" }, { "from": "human", "value": "from django.db import migrations\n\n\ndef assign_access_key(apps, schema):\n vatlayer_configuration = (\n apps.get_model(\"plugins\", \"PluginConfiguration\")\n .objects.filter(...
python
chosen
[ { "from": "system", "value": "Handle other iterable types gracefully in split_level utility function\n" }, { "from": "human", "value": "def is_expanded(request, key):\n \"\"\" Examines request object to return boolean of whether\n passed field is expanded.\n \"\"\"\n expand = req...
python
chosen
[ { "from": "system", "value": "Tidy up and apply PEP8 guidelines.\n" }, { "from": "human", "value": "'''\n\nDr Who Box: Blue Effects LED\n\n'''\n\nfrom __future__ import print_function\nimport RPi.GPIO as GPIO\nimport time\nfrom multiprocessing import Process\nimport math\n\n# Define PINS\nLED = ...
python
chosen
[ { "from": "system", "value": "Fix validate DB when DB is disabled and not connected\n" }, { "from": "human", "value": "# TODO: Add private API with Redis Cache and PostgreSQL (or any SQL DB with SQLAlchemy)\nfrom api import api, cache, db\nfrom flask import abort, Flask\nfrom flask_restful impor...
python
chosen
[ { "from": "system", "value": "Improve output of the manual testing command adding headers\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport csv\nimport sys\n\nfrom gwaith import get_rates, processors\n\nonly = ('PLN', 'GBP')\n\nfor data in get_rates(processor=processors.to_json, o...
python
chosen
[ { "from": "system", "value": "Fix issues with changing passwords\n" }, { "from": "human", "value": "from django.contrib.auth import get_user_model\nfrom django.contrib.auth.backends import ModelBackend\n\n\nclass CaseInsensitiveModelBackend(ModelBackend):\n\n def authenticate(email=None, pass...
python
chosen
[ { "from": "system", "value": "Raise if response is not 200\n" }, { "from": "human", "value": "import logging, email, yaml\nfrom django.utils import simplejson as json\nfrom google.appengine.ext import webapp, deferred\nfrom google.appengine.ext.webapp.mail_handlers import InboundMailHandler\nfro...
python
chosen
[ { "from": "system", "value": "Use an iterator to get pages\n" }, { "from": "human", "value": "from itertools import count\n\nfrom demands import HTTPServiceClient\nfrom yoconfig import get_config\n\n\nclass CloudFlareService(HTTPServiceClient):\n def __init__(self, **kwargs):\n config ...
python
chosen
[ { "from": "system", "value": "events: Raise error when user is registering to the event multiple times\n" }, { "from": "human", "value": "from django.contrib import messages\nfrom django.contrib.auth.decorators import login_required\nfrom django.views.generic.list import ListView\nfrom django.vi...
python
chosen
[ { "from": "system", "value": "Implement checks to pass tests\n" }, { "from": "human", "value": "from django import forms\nfrom django.forms.fields import IntegerField, CharField\n\nimport evelink.account\n\n\nclass AddAPIForm(forms.Form):\n key_id = IntegerField()\n v_code = CharField(max_...
python
chosen
[ { "from": "system", "value": "Fix bug with Date fields and SOQL.\n\nFixes https://github.com/freelancersunion/django-salesforce/issues/10" }, { "from": "human", "value": "# django-salesforce\n#\n# by Phil Christensen\n# (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org)\n# See LIC...
python
chosen
[ { "from": "system", "value": "Disable after_all() output for now.\n" }, { "from": "human", "value": "# -*- coding: UTF-8 -*-\n\"\"\"\nbefore_step(context, step), after_step(context, step)\n These run before and after every step.\n The step passed in is an instance of Step.\n\nbefore_scenar...
python
chosen
[ { "from": "system", "value": "Make application use log file if its name is not None\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n'''\nurl-shortener\n==============\n\nAn application for generating and storing shorter aliases for\nrequested urls. Uses `spam-lists`__ to prevent gene...
python
chosen
[ { "from": "system", "value": "Make use of slots to reduce in-memory size\n" }, { "from": "human", "value": "#\n# Jasy - JavaScript Tooling Refined\n# Copyright 2010 Sebastian Werner\n#\n\nclass MetaData:\n \"\"\" \n Data structure to hold all dependency information \n\n Hint: Must be a ...
python
chosen
[ { "from": "system", "value": "Make cached_function not modify function name\n" }, { "from": "human", "value": "# Various utility functions\nimport os\n\n\nSHOULD_CACHE = os.environ['ENV'] == 'production'\n\n\ndef cached_function(func):\n data = {}\n\n def wrapper(*args):\n if not SH...
python
chosen
[ { "from": "system", "value": "Fix an incorrect library name.\n" }, { "from": "human", "value": "import clr\nclr.AddReference(\"fft\")\n\nfrom numpy__fft__fftpack_cython import *" }, { "from": "gpt", "value": "import clr\nclr.AddReference(\"fftpack_lite\")\n\nfrom numpy__fft__fftpack_...
python
chosen
[ { "from": "system", "value": "Save call tree indices as integers\n" }, { "from": "human", "value": "class CallTree(object):\n\n def __init__(self, node):\n\n self.call_id = node.get('id')\n self.region_id = node.get('calleeId')\n self.children = []\n self.metrics =...
python
chosen
[ { "from": "system", "value": "Use the first mention for saving\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nimport random\nimport tweepy\n\nimport config\n\n\nlast_seen_path = os.path.join(os.path.dirname(__file__), 'last-seen')\n\n\ndef get_api():\n auth = tweepy.OA...
python
chosen
[ { "from": "system", "value": "Handle single param definition (following Yahoo! changes)\n" }, { "from": "human", "value": "# pipeurlbuilder.py\n#\n\nimport urllib\nfrom pipe2py import util\n\ndef pipe_urlbuilder(context, _INPUT, conf, **kwargs):\n \"\"\"This source builds a url and yields it ...
python
chosen
[ { "from": "system", "value": "Fix asyncio.__all__: export also unix_events and windows_events symbols\n\nFor example, on Windows, it was not possible to get ProactorEventLoop or\nDefaultEventLoopPolicy using \"from asyncio import *\".\n" }, { "from": "human", "value": "\"\"\"The asyncio package,...
python
chosen
[ { "from": "system", "value": "Move import that depends on devserver\n" }, { "from": "human", "value": "import os\n\nfrom django.core import checks\nfrom google.appengine.tools.devappserver2.application_configuration import ModuleConfiguration\n\nfrom djangae.environment import get_application_ro...
python
chosen
[ { "from": "system", "value": "New: Print SEP urls for debug\n" }, { "from": "human", "value": "from lxml import html\nimport re\nimport requests\nfrom constants import SEP_URL\n\n\nclass SEPSearchResult():\n\n query = None\n results = None\n\n def __init__(self, query):\n self.se...
python
chosen
[ { "from": "system", "value": "Add South Guide, made message for it\n" }, { "from": "human", "value": "from django.db import models\n\n# Create your models here.\n\nclass Join(models.Model):\n\temail = models.EmailField()\n\tip_address = models.CharField(max_length=120, default='ABC')\n\ttimestam...
python
chosen
[ { "from": "system", "value": "Make variables self descriptive and create a testing set.\n" }, { "from": "human", "value": "import matplotlib.pyplot as plt\n\nfrom sklearn import datasets\nfrom sklearn import svm\n\ndigits = datasets.load_digits()\n\nclf = svm.SVC(gamma=0.0001, C=100)\n\ntraining...
python
chosen
[ { "from": "system", "value": "Remove Deprecation Warning, add since when things were deprecated.\n" }, { "from": "human", "value": "\"\"\"\nShim to maintain backwards compatibility with old IPython.consoleapp imports.\n\"\"\"\n# Copyright (c) IPython Development Team.\n# Distributed under the te...
python
chosen
[ { "from": "system", "value": "Revert order of usage property\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.db import models\nfrom django.core.cache import cache\nfrom django.contrib.auth.models import User\nfrom bawebauth.decorators import cache_property\nfrom django.ut...
python
chosen
[ { "from": "system", "value": "Fix Old-style class, subclass object explicitly.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nThis module holds some types we'll have use for along the way.\n\nIt's your job to implement the Closure and Environment types.\nThe DiyLangError c...
python
chosen
[ { "from": "system", "value": "Remove numActiveBuilds as its unused\n" }, { "from": "human", "value": "from __future__ import absolute_import, division, unicode_literals\n\nfrom sqlalchemy.orm import joinedload\n\nfrom changes.api.base import APIView\nfrom changes.constants import Status\nfrom ch...
python
chosen
[ { "from": "system", "value": "Update interface for rigs - in/out versus None/cache\n" }, { "from": "human", "value": "import pyblish.api\n\n\nclass ValidateStarterRigFormat(pyblish.api.InstancePlugin):\n \"\"\"A rig must have a certain hierarchy and members\n\n - Must reside within `rig_GR...
python
chosen
[ { "from": "system", "value": "Remove incorrect use of __all__" }, { "from": "human", "value": "from icalendar.cal import (\n Calendar,\n Event,\n Todo,\n Journal,\n Timezone,\n TimezoneStandard,\n TimezoneDaylight,\n FreeBusy,\n Alarm,\n ComponentFactory,\n)\n# Prop...
python
chosen
[ { "from": "system", "value": "Implement a RandomCard helper for definitions\n" }, { "from": "human", "value": "import random\nimport fireplace.cards\nfrom ..actions import *\nfrom ..enums import CardType, GameTag, Race, Rarity, Zone\nfrom ..targeting import *\n\n\ndef hand(func):\n\t\"\"\"\n\t@h...
python
chosen
[ { "from": "system", "value": "Use a generator for rendering, and pass nodelist unwrapped\n" }, { "from": "human", "value": "\nimport ast\n\nfrom . import parse\n\n\nclass Template:\n def __init__(self, raw):\n self.raw = raw\n self.root = parse.parse(raw)\n\n code = ast.E...
python
chosen
[ { "from": "system", "value": "Fix ID generation for js package documentation\n" }, { "from": "human", "value": "#\n# Jasy - Web Tooling Framework\n# Copyright 2010-2012 Zynga Inc.\n# Copyright 2013-2014 Sebastian Werner\n#\n\nimport os\n\nimport jasy.js.api.Data as Data\nimport jasy.core.Text as...
python
chosen
[ { "from": "system", "value": "Add commands for listing available analytics commadns\n" }, { "from": "human", "value": "import argparse\n\nparser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')\nparser.add_argument('-v', '--version', action='version', version='0.1.0...
python
chosen
[ { "from": "system", "value": "Make it possible to run examples on any branch!\n" }, { "from": "human", "value": "# pyinfra\n# File: pyinfra/example/config.py\n# Desc: entirely optional config file for the CLI deploy\n# see: pyinfra/api/config.py for defaults\n\nfrom pyinfra import hook, lo...
python
chosen
[ { "from": "system", "value": "Add options -amc; do lstat if possible; columnize properly.\n" }, { "from": "human", "value": "#! /usr/local/python\n\n# byteyears file ...\n#\n# Print a number representing the product of age and size of each file,\n# in suitable units.\n\nimport sys, posix, time\n...
python
chosen
[ { "from": "system", "value": "Remove unrelated thing from migration\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.3 on 2017-01-02 15:27\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Mi...
python
chosen
[ { "from": "system", "value": "Add workaround for frozen-flask generating static pages for dynamic api pages like /oauth/.\n" }, { "from": "human", "value": "import os\n\nfrom flask.ext.frozen import Freezer\nimport webassets\n\nfrom content import app, assets\n\nbundle_files = []\nfor bundle in ...
python
chosen
[ { "from": "system", "value": "Add support for paths relative to project folders\n" }, { "from": "human", "value": "import sublime\nimport sublime_plugin\nimport os\n\nclass JumpToFile(sublime_plugin.TextCommand):\n def run(self, edit = None):\n view = self.view\n for region in v...
python
chosen
[ { "from": "system", "value": "BUG: Fix tests to be moroe robust\n" }, { "from": "human", "value": "from nose.tools import assert_equals\n\nfrom .. import datasets\nfrom ..pca import PCA\n\niris = datasets.load_iris()\n\nX = iris.data\n\ndef test_pca():\n \"\"\"\n PCA\n \"\"\"\n\n pca...
python
chosen
[ { "from": "system", "value": "Add content-type to requests in example\n" }, { "from": "human", "value": "# coding: utf-8\nimport os\nimport requests\n\n\n\nROOT = os.path.dirname(os.path.realpath(__file__))\n\nENDPOINT = os.environ.get('ES_ENDPOINT_EXTERNAL', 'localhost:9200')\nINDEX = 'gsiCrawl...
python
chosen
[ { "from": "system", "value": "Add redirect for old hotlinks\n" }, { "from": "human", "value": "from django.conf.urls import url, include\nfrom django.contrib import admin\nfrom django.contrib.auth.views import login, logout_then_login\nfrom keyform import views\n\nurlpatterns = [\n url(r'^$',...
python
chosen
[ { "from": "system", "value": "Add pipeline flow (in comments) to thread template\n" }, { "from": "human", "value": "import spam\n\n#Convert the LTA file to the UVFITS format\n\nspam.convert_lta_to_uvfits('Name of the file')\n\nspam.precalibrate_targets('Name of UVFITS output file')\n\nspam.proce...
python
chosen
[ { "from": "system", "value": "Make browse work with non-default sites\n" }, { "from": "human", "value": "from _json import dumps\nfrom django.http import HttpResponse\nfrom django.shortcuts import render_to_response\nfrom jsonrpc.site import jsonrpc_site\nfrom jsonrpc import mochikit\n\ndef brow...
python
chosen
[ { "from": "system", "value": "Disable bbox draw in sponza example\n" }, { "from": "human", "value": "import moderngl as mgl\nfrom demosys.effects import effect\n\n\nclass SceneEffect(effect.Effect):\n \"\"\"Generated default effect\"\"\"\n def __init__(self):\n self.scene = self.get...
python
chosen
[ { "from": "system", "value": "Switch to new engine facade for StandardAttribute objects\n\nEnable the new Engine Facade for StandardAttribute objects.\n\nChange-Id: Ia3eb436d07e3b2fc633b219aa00c78cc07ed30db\n" }, { "from": "human", "value": "# Licensed under the Apache License, Version 2.0 (t...
python
chosen
[ { "from": "system", "value": "Change system.rate-limit to prioritize disk\n" }, { "from": "human", "value": "\"\"\"\nsentry.options.defaults\n~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"...
python
chosen
[ { "from": "system", "value": "fix: Remove payment order from bank dashboard\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nfrom frappe import _\n\n\ndef get_data():\n\treturn {\n\t\t'fieldname': 'bank',\n\t\t'transactions': [\n\t\t\t{\n\t\t\t\t'label': _('Bank Deat...
python
chosen
[ { "from": "system", "value": "Disable the STATE parameter - it doesn't play nice with the SurveyMonkey App Directory links\n" }, { "from": "human", "value": "\"\"\"\nSurveyMonkey OAuth2 backend, docs at:\n https://developer.surveymonkey.com/api/v3/#authentication\n\"\"\"\nfrom .oauth import B...
python
chosen
[ { "from": "system", "value": "Add sleep before new Chatbot instance is created on crash\n" }, { "from": "human", "value": "import ConfigParser\nimport threading\nimport time\n\nimport chatbot\n\n\ndef runbot(t):\n config = ConfigParser.ConfigParser()\n config.readfp(open('./config.ini'))\n...
python
chosen
[ { "from": "system", "value": "Make version hack more reliable\n" }, { "from": "human", "value": "import importlib.metadata\nfrom typing import Optional, Protocol\n\n\nclass BasePath(Protocol):\n \"\"\"A protocol that various path objects conform.\n\n This exists because importlib.metadata ...
python
chosen
[ { "from": "system", "value": "Refactor key to access files from a folder's JSON\n" }, { "from": "human", "value": "from .core import OSFCore\nfrom .file import File\n\n\nclass Storage(OSFCore):\n def _update_attributes(self, storage):\n if not storage:\n return\n\n # ...
python
chosen
[ { "from": "system", "value": "Remove reference to wrong view\n" }, { "from": "human", "value": "from django.conf.urls import patterns, include\n\nurlpatterns = patterns(\n 'custom.enikshay.integrations.ninetyninedots.views',\n (r'^99dots/', include(\"custom.enikshay.integrations.ninetynine...
python
chosen
[ { "from": "system", "value": "Fix navigition links a bit again\n" }, { "from": "human", "value": "import datetime\nfrom sqlalchemy import desc\n\nfrom application import db\n\nclass Page(db.Model):\n\t__tablename__ = 'page'\n\n\tid = db.Column(db.Integer, primary_key=True)\n\tpath = db.Column(db...
python
chosen
[ { "from": "system", "value": "Add use of Game.character.current_location to example\n" }, { "from": "human", "value": "from vengeance.game import Direction\nfrom vengeance.game import Game\nfrom vengeance.game import Location\n\ngo_up = Direction('up')\ngo_down = Direction('down')\ngo_up.opposit...
python
chosen
[ { "from": "system", "value": "Move get_subjects and delete_subjects to qipipe helpers.\n" }, { "from": "human", "value": "import os, re\nfrom base64 import b64encode as encode\nfrom qipipe.staging import airc_collection as airc\nfrom qipipe.staging.staging_helper import SUBJECT_FMT\nfrom qipipe....
python
chosen
[ { "from": "system", "value": "Make update_lectures return outside the loop\n" }, { "from": "human", "value": "from glob import glob\n\ncourse_map = {'course_folder_name' : 'Full Course Name'}\n\ndef update_lectures():\n course_lectures = dict()\n for course_id in course_map:\n vid_f...
python
chosen
[ { "from": "system", "value": "Add flat patterns for Api\nAdd register/autodiscover system for Api\n" }, { "from": "human", "value": "\n\n# TODO: Add other patterns to allow introspection?\n\nclass Api(object):\n '''Helper class for registering many Publishers in one URL namespace'''\n def ...
python
chosen
[ { "from": "system", "value": "Add get_serializer_class to document model" }, { "from": "human", "value": "from django.db import models\n\nfrom filingcabinet.models import (\n AbstractDocument,\n AbstractDocumentCollection,\n)\n\n\nclass Document(AbstractDocument):\n original = models.Fo...
python
chosen
[ { "from": "system", "value": "Remove sessions when scrubbing DB for public release\n" }, { "from": "human", "value": "import os\nimport sys\n\nimport django\n\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"museum...
python
chosen
[ { "from": "system", "value": "Fix typo in resource name" }, { "from": "human", "value": "from .base import *\n\n\nclass Webhooks(ListableApiResource, CreateableApiResource,\n UpdateableApiResource, DeleteableApiResource):\n resource_name = 'webhooks'\n" }, { "from": "gpt...
python
chosen
[ { "from": "system", "value": "Add handler send logic to message\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport json\nfrom enum import Enum\n\n\nclass BEMessages(Enum):\n ALL_MAIN_BROADCAST = 'ALL_MAIN_BROADCAST'\n\n\nclass FEMessages(Enum):\n pass\n\n\nclass AllMainBroa...
python
chosen
[ { "from": "system", "value": "Remove delay when responding to messages\n\nNot needed anymore.\n\nFixes #123\n" }, { "from": "human", "value": "\"\"\"Handles message receiving for GroupMe provider.\"\"\"\n\nimport logging\nimport json\nimport time\n\nimport flask\n\nfrom c3po.provider.groupme imp...
python
chosen
[ { "from": "system", "value": "Support kwargs along with args for functions\n" }, { "from": "human", "value": "\"\"\"\nThis module is to include utils for managing compatibility between Python and Odin releases.\n\"\"\"\nimport inspect\nimport warnings\n\n\ndef deprecated(message, category=Deprec...
python
chosen
[ { "from": "system", "value": "Add some info and outfile to prepare function\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# encoding: utf-8\nimport sys\nimport re\nimport argparse\n\nfrom patterns import pre_patterns\n\n\ndef prepare(infile):\n \"\"\"\n Apply pre_patterns from ...
python
chosen
[ { "from": "system", "value": "Add more fabric commands and fix deploy command\n" }, { "from": "human", "value": "from fabric.api import * # noqa\n\n\nenv.hosts = [\n '104.131.30.135',\n]\nenv.user = \"root\"\nenv.directory = \"/home/django/freemusic.ninja/django\"\n\n\ndef deploy():\n wit...
python
chosen
[ { "from": "system", "value": "Fix os-brick in virtual environments\n\nWhen running os-brick in a virtual environment created by a non root\nuser, we get the following error:\n\n ModuleNotFoundError: No module named 'os_brick.privileged.rootwrap'\n\nThis happens because the privsep daemon drops all the priv...
python
chosen
[ { "from": "system", "value": "Allow newest versions of numpy and pandas\n" }, { "from": "human", "value": "#! /usr/bin/env python\n\n\"\"\"Setup information of demandlib.\n\"\"\"\n\nfrom setuptools import setup, find_packages\nimport os\n\n\ndef read(fname):\n return open(os.path.join(os.path...
python
chosen
[ { "from": "system", "value": "Add task clean() to remove *.pyc files\n" }, { "from": "human", "value": "import os\n\nfrom fabric.api import *\n\ndef unit():\n current_dir = os.path.dirname(__file__)\n command = \" \".join([\"PYTHONPATH=$PYTHONPATH:%s/videolog\" % current_dir,\n \"n...
python
chosen
[ { "from": "system", "value": "Add an additional post gen hook to remove the jinja2 templates\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\nlogger = logging.getLogger('post_gen_project')\n\nimport shu...
python
chosen
[ { "from": "system", "value": "Update pypi description and release new version\n" }, { "from": "human", "value": "\"\"\"\r\nPiPocketGeiger\r\n-----\r\nRadiation Watch Pocket Geiger Type 5 library for Raspberry Pi.\r\n\r\nLinks\r\n`````\r\n* `code and documentation <https://github.com/MonsieurV/Pi...
python
chosen