conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use python2 pyyaml instead of python3.\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\n\ndef fix_imports():\n here = os.path.dirname(__file__)\n dirs = [\n os.path.normpath(os.path.join(here, '..', '..')),\n os.path.normpath(os.path.join(here... | python | chosen |
[
{
"from": "system",
"value": "Change the prefix from features/ to feature/.\n"
},
{
"from": "human",
"value": "import sys\nimport click\nfrom slugify import slugify\n\n\nclass SlugBranchGetter(object):\n def __init__(self, base_branch='master'):\n self.base_branch = base_branch\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Support API keys on organization project list (fixes GH-1666)\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom rest_framework.response import Response\n\nfrom sentry.api.base import DocSection\nfrom sentry.api.bases.organization impo... | python | chosen |
[
{
"from": "system",
"value": "Fix res returned on delegate\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\r\n##############################################################################\r\n#\r\n# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)\r\n# Releasing chi... | python | chosen |
[
{
"from": "system",
"value": "Delete sync logs 25 at a time\n"
},
{
"from": "human",
"value": "\ndef delete_sync_logs(before_date, limit=1000):\n from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date\n from casexml.apps.phone.models import SyncLog\n fr... | python | chosen |
[
{
"from": "system",
"value": "Remove the depth for now.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom rest_framework import serializers\n\nfrom apps.broadcasts.models import Broadcast, Raid, Series\nfrom apps.games.models import Game\n\n\nclass BroadcastSerializer(serializers.... | python | chosen |
[
{
"from": "system",
"value": "Change name of database for test\n"
},
{
"from": "human",
"value": "from endpoints import Controller, CorsMixin\nimport sqlite3\nfrom datetime import datetime\n\nconn = sqlite3.connect('CIUK.db')\ncur = conn.cursor()\n\nclass Default(Controller, CorsMixin):\n def G... | python | chosen |
[
{
"from": "system",
"value": "Move string above the imports so it becomes a docstring\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom bottle import route\nfrom textwrap import dedent\nfrom bottledaemon import daemon_run\n\n\"\"\" Simple AFP mock to allow testing the afp-cli. \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix to keep build-chain Python 2.6 compatible\n"
},
{
"from": "human",
"value": "# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: vraj@recipr... | python | chosen |
[
{
"from": "system",
"value": "Change to exists instead of catching DoesNotExist exception.\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\n\nfrom django.conf import settings\n\nfrom holonet.mappings.helpers import clean_address, split_address\n\nfrom .models import DomainBlacklist, Do... | python | chosen |
[
{
"from": "system",
"value": "Add caveat about UsernamePassword already being an IUsernamePassword implementation\n"
},
{
"from": "human",
"value": "from axiom import attributes, item\nfrom twisted.cred import credentials\n\n\nclass UsernamePassword(item.Item):\n \"\"\"\n A stored username... | python | chosen |
[
{
"from": "system",
"value": "Add check for empty tags\n"
},
{
"from": "human",
"value": "from .request import url\n\nclass Search(object):\n def __init__(self, key=None, q=[], sf=\"created_at\", sd=\"desc\"):\n self._parameters = {\n \"key\": key,\n \"q\": q,\n \"sf\": sf,\n ... | python | chosen |
[
{
"from": "system",
"value": "Change DB location to production.\n"
},
{
"from": "human",
"value": "import os\n\nPROJECT_NAME = \"lightning-talks\"\n\nMONGO_DATABASE = 'lightningtalk-dev'\n\nVOTING = False\n\nENVIRONMENTS = {\n \"prd\": {\n \"hosts\": ['104.236.202.196']\n }\n}"
},... | python | chosen |
[
{
"from": "system",
"value": "Revert to using current AppImage update info\n\nhttps://github.com/FreeCAD/FreeCAD-AppImage/issues/35"
},
{
"from": "human",
"value": "import sys\nimport os\nimport subprocess\nimport platform\n\nplatform_dict = {}\nplatform_dict[\"Darwin\"] = \"OSX\"\n\nsys_n_arch ... | python | chosen |
[
{
"from": "system",
"value": "Make more examples in make_definitions\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom jedi import api\n\n\ndef make_definitions():\n return api.defined_names(\"\"\"\n import sys\n\n class C:\n pass\n\n x = C()\n\n def f():\n pa... | python | chosen |
[
{
"from": "system",
"value": "Update creation of default user to only run with ``--noinput`` passed to ``syncdb``.\n"
},
{
"from": "human",
"value": "\nfrom django.conf import settings\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth import models as auth_app\nfrom django.d... | python | chosen |
[
{
"from": "system",
"value": "Allow all values to be compared with either literally or with a pattern\n"
},
{
"from": "human",
"value": "import abc\nimport re\n\n\nclass Matcher(object):\n __metaclass__ = abc.ABCMeta\n\n @abc.abstractmethod\n def assert_request_matched(self, request):\n... | python | chosen |
[
{
"from": "system",
"value": "Add back-office to student URL\n"
},
{
"from": "human",
"value": "\"\"\"halaqat URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views... | python | chosen |
[
{
"from": "system",
"value": "Fix latex build: make some unicode characters found in help work\n"
},
{
"from": "human",
"value": "# vim:fileencoding=utf-8:noet\nfrom __future__ import (unicode_literals, division, absolute_import, print_function)\n\nimport os\nimport sys\n\n\nsys.path.insert(0, o... | python | chosen |
[
{
"from": "system",
"value": "Change name of boundary conditions for Biomeng321 Lab1.\n"
},
{
"from": "human",
"value": "'''\n Copyright 2015 University of Auckland\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with t... | python | chosen |
[
{
"from": "system",
"value": "Allow staff user to manage hooks.\n"
},
{
"from": "human",
"value": "from nodeconductor.core.permissions import StaffPermissionLogic\n\n\nPERMISSION_LOGICS = (\n ('logging.Alert', StaffPermissionLogic(any_permission=True)),\n ('logging.SystemNotification', Sta... | python | chosen |
[
{
"from": "system",
"value": "Clear registry between each test\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom nymms import registry\nfrom nymms.resources import Command, MonitoringGroup\nfrom weakref import WeakValueDictionary\n\nclass TestRegistry(unittest.TestCase):\n def test_e... | python | chosen |
[
{
"from": "system",
"value": "Add farmer max timeout constant"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nSAVE_PASSWORD_HASHED = True\nMAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3\nMAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3\nMAX_RETRIES_NEGOTIATE_CONTRACT = 10\nMAX_RETRIES_GET_FILE_POINT... | python | chosen |
[
{
"from": "system",
"value": "Fix SoundCloud embed width/height replacement.\n\nSoundCloud embeds aren't always 500x500.\n\nAlso, don't set the \"width\" embed dict key to '100%':\n\"width\"/\"height\" keys expect integers only.\n"
},
{
"from": "human",
"value": "from urllib.parse import urlpars... | python | chosen |
[
{
"from": "system",
"value": "Clarify purpose of test by...adding a smiley!\n"
},
{
"from": "human",
"value": "import matplotlib\nimport matplotlib.pyplot as plt\nimport mpld3\nfrom mpld3 import plugins\n\n\ndef create_plot():\n fig, ax = plt.subplots()\n ax.plot([1, 3], [1, 2])\n fmtr ... | python | chosen |
[
{
"from": "system",
"value": "Disable sleep function when stopping\n"
},
{
"from": "human",
"value": "import threading\nimport queue\n\nclass Routine(threading.Thread):\n def __init__(self):\n threading.Thread.__init__(self)\n self.queue = queue.Queue()\n self.manager = N... | python | chosen |
[
{
"from": "system",
"value": "Add logging to database management script\n"
},
{
"from": "human",
"value": "\"\"\"Database management and migration functionality.\"\"\"\n\n# pylint: disable=no-name-in-module,import-error\nfrom flask.ext.script import Manager\nfrom flask.ext.migrate import Migrate... | python | chosen |
[
{
"from": "system",
"value": "[flask] Fix source code encoding error\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template_string\nimport jinja2\n\ndef test_undefined_variable__no_error():\n app = Flask(__name__)\n assert issubclass(app.jinja_env.undefined, jinja2.Und... | python | chosen |
[
{
"from": "system",
"value": "Make home directory selection more portable\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\n\ncdir = os.path.dirname(os.path.abspath(__file__))\nsourcedir = os.path.join(cdir, 'src')\ntargetdir = '~'\n\nfor dotfile in os.listdir(sourcedir):\n s... | python | chosen |
[
{
"from": "system",
"value": "Check NCCL existence in test decorators\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom cupy import cuda\nfrom cupy.testing import attr\n\n\n@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')\nclass TestNCCL(unittest.TestCase):\n\n @attr.... | python | chosen |
[
{
"from": "system",
"value": "Add a __unicode__ method to the Address model in utils.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django_countries import CountryField\n\n\nclass Address(models.Model):\n \"\"\"\n A postal address.\n \"\"\"\n address_line1 = m... | python | chosen |
[
{
"from": "system",
"value": "Increase pagination size for careeropportunity api\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.shortcuts import render\nfrom django.utils import timezone\n# API v1\nfrom rest_framework import mixins, viewsets\nfrom rest_framework.permis... | python | chosen |
[
{
"from": "system",
"value": "Implement a sort key method for the aggregate timeseries\n\nThis should return null because we want to mix up the identifying information\nfrom the timeseries and sorting will re-impose some order. Also sorting takes\ntoo much time!\n"
},
{
"from": "human",
"value":... | python | chosen |
[
{
"from": "system",
"value": "Update test for rename of list type\n"
},
{
"from": "human",
"value": "from numba.typesystem import *\n\nassert int_.is_int\nassert int_.is_numeric\nassert long_.is_int\nassert long_.is_numeric\nassert not long_.is_long\n\nassert float_.is_float\nassert float_.is_nu... | python | chosen |
[
{
"from": "system",
"value": "Remove trailing comma from example\n"
},
{
"from": "human",
"value": "from pupa.scrape import Jurisdiction\n\nfrom .people import PersonScraper\n\n\nclass Example(Jurisdiction):\n jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'\n name = ... | python | chosen |
[
{
"from": "system",
"value": "Add helper functions for adding menu items & shortcuts\n"
},
{
"from": "human",
"value": "import os\r\nimport stat\r\nimport time\r\n\r\n\r\ndef updateModificationTime(path):\r\n accessTime = os.stat(path)[stat.ST_ATIME]\r\n modificationTime = time.time()\r\n ... | python | chosen |
[
{
"from": "system",
"value": "Implement ratelimit on routes cache.\n"
},
{
"from": "human",
"value": "from . import base\n\n\nclass RoutesCachePreprocessor(base.BasePreprocessor):\n KIND = '_routes_cache'\n\n def __init__(self, pod):\n self.pod = pod\n\n def run(self, build=True)... | python | chosen |
[
{
"from": "system",
"value": "Fix malformed URLs in bulk import\n"
},
{
"from": "human",
"value": "from django.conf.urls import url, include\n\nfrom . import views\n\n\nurlpatterns = [\n url(r'^events/import/?$',\n views.ConferenceImport.as_view(),\n name='event_import'),\n u... | python | chosen |
[
{
"from": "system",
"value": "Complete social ids for wordpress and faa\n"
},
{
"from": "human",
"value": "#\r\n# define overloading of ids for each social site\r\n# to be customized for your accounts\r\n#\r\n\r\n#\r\n# flickr\r\n#\r\ndef flickr_api_secret():\r\n return \"\"\r\n\r\ndef flickr... | python | chosen |
[
{
"from": "system",
"value": "Fix - the project_path is the first member of tuple\n"
},
{
"from": "human",
"value": "# Copyright 2014 0xc0170\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 obt... | python | chosen |
[
{
"from": "system",
"value": "Use locmem cache for tests.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\nINSTALLED_APPS = ['post_office']\n\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': ':memory:',\n },\n}\n\n\nCACHES = {... | python | chosen |
[
{
"from": "system",
"value": "Handle when database is None\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nfrom framework.mongo import database as proxy_database\nfrom website import settings as osfsettings\n\nlogger = logging.getLogger(__name__)\n\n\ndef begin(databa... | python | chosen |
[
{
"from": "system",
"value": "Fix adhoc multisubreddit promo_request network request\n"
},
{
"from": "human",
"value": "import re\n\nfrom r2.lib.errors import errors\nfrom r2.lib.validator import (\n VMultiByPath,\n Validator,\n)\nfrom r2.models import (\n NotFound,\n Subreddit,\n)\n... | python | chosen |
[
{
"from": "system",
"value": "Add index test for Hadamard+MatMul mix\n"
},
{
"from": "human",
"value": "from sympy.matrices.expressions import MatrixSymbol, HadamardProduct\nfrom sympy.matrices import ShapeError\nfrom sympy import symbols\nfrom sympy.utilities.pytest import raises\n\n\ndef test_... | python | chosen |
[
{
"from": "system",
"value": "Remove REST test imports to avoid some tests being run twice\n"
},
{
"from": "human",
"value": "from test_create_resource import *\nfrom test_resource_file import *\nfrom test_resource_list import *\nfrom test_resource_meta import *\nfrom test_resource_types import ... | python | chosen |
[
{
"from": "system",
"value": "Add `max_length` to char fields\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass TestUser0(models.Model):\n username = models.CharField()\n test_field = models.CharField('My title')\n\n class Meta:\n app_label = 'controlcent... | python | chosen |
[
{
"from": "system",
"value": "Set svn:eol-style='native' on some text files that were lacking it.\n\n\ngit-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@855475 13f79535-47bb-0310-9956-ffa450edef68\n"
},
{
"from": "human",
"value": "#\r\n# strip-po-charset.py\r\n#\r\n\r\nimport sys, string\r\n... | python | chosen |
[
{
"from": "system",
"value": "Fix copy paste bug in test class name.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\n# Standard library\nimport inspect\nimport unittest\n\nfrom cinspect import getfile, getsource\n\n\nclass TestHelloModule(unittest.Tes... | python | chosen |
[
{
"from": "system",
"value": "Remove aci files after tests have run\n"
},
{
"from": "human",
"value": "try:\n from http.server import SimpleHTTPRequestHandler\nexcept ImportError:\n from SimpleHTTPServer import SimpleHTTPRequestHandler\n\ntry:\n from socketserver import TCPServer\nexcep... | python | chosen |
[
{
"from": "system",
"value": "Fix image_obj template tag when sending Nonetype image\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django import template\nfrom django.conf import settings\nfrom ..generate import image_url as url\n\n\nregister = template.... | python | chosen |
[
{
"from": "system",
"value": "Add filter for \"argparse\" warning\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013, Sascha Peilicke <saschpe@gmx.de>\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 version 2... | python | chosen |
[
{
"from": "system",
"value": "Make acquire_context always return some Context\n"
},
{
"from": "human",
"value": "\"\"\"Placeholder model for Zinnia\"\"\"\nimport inspect\n\nfrom cms.models.fields import PlaceholderField\nfrom cms.plugin_rendering import render_placeholder\n\nfrom zinnia.models.e... | python | chosen |
[
{
"from": "system",
"value": "Fix missing final line from format_cmdline()\n\nThe previous code was missing 'yield line' after the for loop.\nThis commit fixes that, as well as the extra space at the beginning\nof each line. Normally, we'd use str.join() to avoid such a problem,\nbut this code is accumulati... | python | chosen |
[
{
"from": "system",
"value": "Fix - No more crash when entering an url with letter\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\n\nfrom .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted\n\nurlpatterns = patterns('',\n\t# Examples:\n\tur... | python | chosen |
[
{
"from": "system",
"value": "Add unit conversion for ft\n"
},
{
"from": "human",
"value": "import discord\n\nclient = discord.Client()\n\n\n@client.event\nasync def on_message(message):\n if message.author == client.user:\n return\n if message.content.startswith('!ping'):\n ... | python | chosen |
[
{
"from": "system",
"value": "Reorder when the tangelo instance gets shut down in a test so that if an assert fails, other tests will still be able to run.\n"
},
{
"from": "human",
"value": "import fixture\n\n\ndef test_standard_verbosity():\n stderr = fixture.start_tangelo(stderr=True)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add support for slack messaging\n"
},
{
"from": "human",
"value": "from django.core.mail import send_mail\nfrom clowder_account.models import ClowderUser\n\nADMIN_EMAIL = 'admin@clowder.io'\n\ndef send_alert(company, name):\n for user in ClowderUser.objects.filte... | python | chosen |
[
{
"from": "system",
"value": "Add read static files feature.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nclass Routes:\n\t'''Define the feature of route for URIs.'''\n\tdef __init__(self):\n\t\tself._Routes = []\n\n\tdef AddRoute(self, uri, callback):\n\t\t'''Add an URI into the... | python | chosen |
[
{
"from": "system",
"value": "Create the minimal class MiniMax\n"
},
{
"from": "human",
"value": "class Heuristic:\n\n def heuristic(self, board, color):\n raise NotImplementedError('Dont override this class')\n"
},
{
"from": "gpt",
"value": "class Heuristic:\n\n def heuristic(s... | python | chosen |
[
{
"from": "system",
"value": "Move json print methods into if statement\n"
},
{
"from": "human",
"value": "import os\nimport json\n\nfrom dateutil.parser import parse\n\nfrom scrapi.util import safe_filename\n\n\ndef migrate_from_old_scrapi():\n for dirname, dirs, filenames in os.walk('archiv... | python | chosen |
[
{
"from": "system",
"value": "Add get blocked server hashes call\n"
},
{
"from": "human",
"value": "import json\n\nimport requests\nimport time\n\n\ndef get_statuses():\n return requests.get('https://status.mojang.com/check/').json()\n\n\ndef get_uuid(username, unix_timestamp=None):\n if u... | python | chosen |
[
{
"from": "system",
"value": "Add try/catch to improve error handling\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com>\n# See LICENSE for details.\n\nimport bluetooth\nimport os\nimport logging\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Fix comments for beta spec language\n"
},
{
"from": "human",
"value": "\"\"\"ResourceSync Resource Container object\n\nBoth ResourceList and Change Set objects are collections of Resource\nobjects with additional metadata regarding capabilities and \ndiscovery infor... | python | chosen |
[
{
"from": "system",
"value": "Add tests for add_header example\n"
},
{
"from": "human",
"value": "import glob\n\nfrom mitmproxy import utils, script\nfrom mitmproxy.proxy import config\nfrom netlib import tutils as netutils\nfrom netlib.http import Headers\nfrom . import tservers, tutils\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Add a test for a date missing from English historical calendars.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom datetime import date\n\nimport qual\n\nclass TestProlepticGregorianCalendar(unittest.TestCase):\n def setUp(self):\n self.calendar =... | python | chosen |
[
{
"from": "system",
"value": "Add test for removing item\n"
},
{
"from": "human",
"value": "import jsonsempai\n\nimport os\nimport shutil\nimport sys\nimport tempfile\n\nTEST_FILE = '''{\n \"three\": 3,\n \"one\": {\n \"two\": {\n \"three\": 3\n }\n }\n}'''\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Add MintableToken as new token type\n"
},
{
"from": "human",
"value": "PHASES = (\n ('PHASE_01', 'In review',),\n ('PHASE_02', 'Active',),\n ('PHASE_02', 'Inactive',),\n)"
},
{
"from": "gpt",
"value": "PHASES = (\n ('PHASE_01', 'In review',),... | python | chosen |
[
{
"from": "system",
"value": "Improve performance of birth date data migration\n"
},
{
"from": "human",
"value": "# Generated by Django 3.2.4 on 2021-10-27 14:41\n\nfrom django.db import migrations\n\n\ndef get_birth_year(apps, schema_editor):\n Person = apps.get_model(\"people\", \"Person\")... | python | chosen |
[
{
"from": "system",
"value": "newuser: Add some explanation as to what to do with the output.\n"
},
{
"from": "human",
"value": "import logging\nimport getpass\nfrom wikked.bcryptfallback import generate_password_hash\nfrom wikked.commands.base import WikkedCommand, register_command\n\n\nlogger ... | python | chosen |
[
{
"from": "system",
"value": "Disable warnings about disabling SSL verification.\n\nDisabling SSL certificate verification results in a warning for every\nHTTPS request:\n\"InsecureRequestWarning: Unverified HTTPS request is being made. Adding\n certificate verification is strongly advised. See:\n https://... | python | chosen |
[
{
"from": "system",
"value": "Add caching for getTeams API call"
},
{
"from": "human",
"value": "# Create your views here.\nfrom django.http import HttpResponse\nfrom registration.models import Team\nfrom django.core import serializers\n\ndef get_teams(request):\n return_data = serializers.s... | python | chosen |
[
{
"from": "system",
"value": "Add tracks to playlist on update\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\nfrom .models import Playlist, Track, Favorite\n\nclass TrackSerializer(serializers.ModelSerializer):\n class Meta:\n model = Track\n fields =... | python | chosen |
[
{
"from": "system",
"value": "Downgrade migration table name updated is current\n"
},
{
"from": "human",
"value": "\"\"\"create redmine tables\n\nRevision ID: d596dc9b53d9\nRevises: 2ffb0d589280\nCreate Date: 2017-08-14 14:43:31.234637\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\n... | python | chosen |
[
{
"from": "system",
"value": "Remove \"work programme\" option from quick history\n"
},
{
"from": "human",
"value": "from django import forms\nfrom . import widgets\n\n\nclass HistoryDetailsForm(forms.Form):\n\n CIRCUMSTANCE_CHOICES = [\n (\"full_time\", \"Full time\"),\n (\"par... | python | chosen |
[
{
"from": "system",
"value": "Remove put_demographics from the permset of the background apps\n"
},
{
"from": "human",
"value": "\"\"\"\nRules for PHAs, AccessTokens, ReqTokens\n\"\"\"\n\nfrom smart.views import *\n\ndef grant(happ, permset):\n \"\"\"\n grant the permissions of an account ... | python | chosen |
[
{
"from": "system",
"value": "Make the listener automatically update the subscriptions.\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand, CommandError\nfrom mqtt_logger.models import *\n\n\nclass Command(BaseCommand):\n help = 'Start listening to mqtt sub... | python | chosen |
[
{
"from": "system",
"value": "Add a main runner for mandel\n"
},
{
"from": "human",
"value": "import fractal\nimport bmp\n\npixels = fractal.mandelbrot(488, 256)\n\nbmp.write_grayscale('mandel.bmp', pixels)"
},
{
"from": "gpt",
"value": "import fractal\nimport bmp\n\n\ndef main():\n ... | python | chosen |
[
{
"from": "system",
"value": "Test hash needed to change.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\nimport helpers\n\n\ndef plot():\n from matplotlib import pyplot as plt\n import numpy as np\n\n fig = plt.figure()\n\n x = np.ma.arange(0, 2*np.pi, 0.02)\n y1 =... | python | chosen |
[
{
"from": "system",
"value": "Purge unnecessary patterns function from urls\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, patterns, url\n\nfrom rest_framework.routers import SimpleRouter\n\nfrom .. import views\n\n\nrouter = SimpleRouter(trailing_slash=False)\nrouter.r... | python | chosen |
[
{
"from": "system",
"value": "Define class sentry with main actions"
},
{
"from": "human",
"value": "\nfrom pysc2.agents import base_agents\nfrom pysc2.lib import actions\n\n\n## SENTINEL FUNCTIONS\n\n# Functions related with Hallucination\n\n_HAL_ADEPT = actions.FUNCTIONS.Hallucination_Adept_qu... | python | chosen |
[
{
"from": "system",
"value": "Add some comments and a shebang on top.\n"
},
{
"from": "human",
"value": "import random\n\nrandom.seed()\n\nwhile True:\n print(chr(random.getrandbits(8)), end='')\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/python3\nimport random\n\nrandom.seed() #... | python | chosen |
[
{
"from": "system",
"value": "Move simplejson to requires, not install_requires.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nimport sys\nsys.path += ['src']\n\nsetup(\n name = \"epidb-client\",\n version = '0.1.2',\n url = 'http://www.epiwork.eu/',\n descriptio... | python | chosen |
[
{
"from": "system",
"value": "Add script's path to the python path"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n leisure\n ~~~~~~~~\n\n Leisure a local job runner for Disco based project.\n\n It provides a useful method for running your disco project without\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix prefetch_translations() -- be sure we only deal with iteratables.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport collections\nimport itertools\n\nfrom . import utils\n\n\ndef prefetch_translations(instances, **kwargs):\n \"\"\"\n Prefet... | python | chosen |
[
{
"from": "system",
"value": "Improve serialization of asset metadata.\n"
},
{
"from": "human",
"value": "from flask import jsonify, url_for\n\nfrom madam_rest import app, asset_storage\n\n\n@app.route('/assets/')\ndef assets_retrieve():\n assets = [asset_key for asset_key in asset_storage]\n... | python | chosen |
[
{
"from": "system",
"value": "Set default race and class without extra database queries\n"
},
{
"from": "human",
"value": "from django.shortcuts import get_object_or_404, redirect, render\n\nfrom characters.forms import CharacterForm\nfrom characters.models import Character, Class, Race\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Fix prefix in environment variable that contains SH's key\n"
},
{
"from": "human",
"value": "import imp, os, netrc, ConfigParser\n\nSCRAPY_CFG_FILE = os.path.expanduser(\"~/.scrapy.cfg\")\nNETRC_FILE = os.path.expanduser('~/.netrc')\n\ndef missing_modules(*modules):... | python | chosen |
[
{
"from": "system",
"value": "Read all images using tf itself\n"
},
{
"from": "human",
"value": "import time\nimport cv2\nimport os\nimport glob\n\n# path = 'by_class'\npath = 'test'\n\nt1 = time.time()\nfile_names=glob.glob(os.path.join(path,'*','train_*','*.[pP][nN][gG]'))\nt2 = time.time()\np... | python | chosen |
[
{
"from": "system",
"value": "Fix Dangerous default value {} as argument, pylint.\n"
},
{
"from": "human",
"value": "import datetime\nfrom openedoo.core.libs.tools import hashing_werkzeug\nfrom openedoo_project import db\nfrom .users import User\n\n\nclass Employee(User):\n\n @classmethod\n ... | python | chosen |
[
{
"from": "system",
"value": "Include i18n URLs in sandbox\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.conf import settings\nfrom django.contrib import admin\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfrom django.... | python | chosen |
[
{
"from": "system",
"value": "Set py2app.__version__ using pkg_resources, that ensures that the version\nstays in sync with the value in setup.py\n"
},
{
"from": "human",
"value": "\"\"\"\nbuilds Mac OS X application bundles from Python scripts\n\nNew keywords for distutils' setup function speci... | python | chosen |
[
{
"from": "system",
"value": "Make the plugin request server info from JIRA.\n"
},
{
"from": "human",
"value": "from neb.engine import Plugin, Command\n\nimport requests\n\nclass JiraPlugin(Plugin):\n\n def get_commands(self):\n \"\"\"Return human readable commands with descriptions.\n... | python | chosen |
[
{
"from": "system",
"value": "Update logging config to actually log exceptions to console.\n"
},
{
"from": "human",
"value": "import os\n\nfrom keybar.conf.base import *\n\ncertificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')\n\nKEYBAR_SERVER_CERTIFICATE = os.path.join... | python | chosen |
[
{
"from": "system",
"value": "Add call to get the database size, as JSON\n"
},
{
"from": "human",
"value": "import argparse\n\nfrom flask import Flask, request\n\nparser = argparse.ArgumentParser(description=\"Start a Blindstore server.\")\nparser.add_argument('-d', '--debug', action='store_true... | python | chosen |
[
{
"from": "system",
"value": "Add text representation for Entry object\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.conf import settings\n\nfrom tempel import utils\n\nclass Entry(models.Model):\n content = models.TextField()\n language = models.CharField(ma... | python | chosen |
[
{
"from": "system",
"value": "Add error handling in statistics sender\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom dateutil import parser\n\nfrom statsSend.teamCity.teamCityConnection import TeamCityConnection\nfrom statsSend.teamCity.teamCityUrlBuilder import TeamCityUrlBui... | python | chosen |
[
{
"from": "system",
"value": "Update group finder to new schemas\n"
},
{
"from": "human",
"value": "from .contentbase import LOCATION_ROOT\nCHERRY_LAB_UUID = 'cfb789b8-46f3-4d59-a2b3-adc39e7df93a'\n\n\ndef groupfinder(login, request):\n if ':' not in login:\n return None\n namespace... | python | chosen |
[
{
"from": "system",
"value": "Add links to site detail in site list\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib.gis.db import models\nfrom django.utils.translation import gettext_lazy as _\nfrom geotrek.authent.models import StructureRelated\nfrom geo... | python | chosen |
[
{
"from": "system",
"value": "Remove unneeded import, fix python path and add coding\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2.7\n\nfrom Handler import Handler\nimport urllib\nimport urllib2\n\n\nclass HttpPostHandler(Handler):\n\n# Inititalize Handler with url and batch size\n de... | python | chosen |
[
{
"from": "system",
"value": "Make regex a None property\n"
},
{
"from": "human",
"value": "\"\"\" Class to encapsulate a message \"\"\"\n\nimport logging\n\nclass Message:\n \"\"\" A message object \"\"\"\n\n def __init__(self, text, user, room, connector):\n \"\"\" Create object w... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.