conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add trove classifier for Python 3.4 support\n" }, { "from": "human", "value": "import wsgi_intercept\n\nfrom setuptools import setup, find_packages\n\nCLASSIFIERS = \"\"\"\nEnvironment :: Web Environment\nIntended Audience :: Developers\nLicense :: OSI Approved :: M...
python
chosen
[ { "from": "system", "value": "Add method for adding users to a custom audience.\n" }, { "from": "human", "value": "import subprocess\nimport sys\nfrom distutils.core import setup, Command\n\n\nclass TestCommand(Command):\n user_options = []\n\n def initialize_options(self):\n pass\n...
python
chosen
[ { "from": "system", "value": "Add long description for PyPI\n" }, { "from": "human", "value": "\"\"\"\nCopyright 2017 BlazeMeter Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of t...
python
chosen
[ { "from": "system", "value": "Use README.rst instead od README.md for doc.\n" }, { "from": "human", "value": "from distutils.core import setup\n\nsetup(\n name='permission',\n version='0.2.0',\n author='Zhipeng Liu',\n author_email='hustlzp@qq.com',\n url='https://github.com/hustl...
python
chosen
[ { "from": "system", "value": "Add note about python 3 support\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\nimport os\nfrom setuptools import find_packages\n\nname = 'Mikko Korpela'\n# I might be just a little bit too much afraid of those bots..\na...
python
chosen
[ { "from": "system", "value": "Make download work using url filename\nAdd user agent string\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nfrom hdx.utilities.path import script_dir_plus_file\n\nrequirements = ['ckanapi',\n 'colorlog',\n ...
python
chosen
[ { "from": "system", "value": "Use a placeholder string instead of a README.\n\nUntil I work out why README.rst isn't being included, use this.\n" }, { "from": "human", "value": "import setuptools\n\nREQUIREMENTS = [\n \"docopt==0.6.1\",\n \"feedparser==5.1.3\",\n \"jabberbot==0.15\",\n ...
python
chosen
[ { "from": "system", "value": "Add download_url so the package can be located from PyPI.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport sys, os\nsys.path.insert(0, os.path.join(os.getcwd(),'lib'))\n\nfrom distutils.core import setup\nimport simpletal\n\nsetup(name=\"SimpleTAL\...
python
chosen
[ { "from": "system", "value": "Add lpeg.c to _ppeg.c dependencies\n" }, { "from": "human", "value": "from distutils.core import setup, Extension\r\n\r\nsetup (\r\n name='PPeg',\r\n version='0.9',\r\n description=\"A Python port of Lua's LPeg pattern matching library\",\r\n url='https:...
python
chosen
[ { "from": "system", "value": "Add sqlalchemy as a dependancy.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"\nCreated by: Lee Bergstrand (2018)\n\nDescription: Setup for installing pygenprop.\n\"\"\"\n\nfrom setuptools import setup\n\nsetup(name='pygenprop',\n version='0...
python
chosen
[ { "from": "system", "value": "Include readme description in pypi.\n\nPiperOrigin-RevId: 426375123\n" }, { "from": "human", "value": "# coding=utf-8\n# Copyright 2022 The Balloon Learning Environment Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not u...
python
chosen
[ { "from": "system", "value": "Make a PEP-386-compatible version number.\n" }, { "from": "human", "value": "import os\nimport sys\n\nfrom setuptools import setup\nfrom setuptools.dist import Distribution\n\n\n# Do this first, so setuptools installs cffi immediately before trying to do\n# the belo...
python
chosen
[ { "from": "system", "value": "Upgrade ldap3 1.0.2 => 1.0.3\n" }, { "from": "human", "value": "import sys\n\nfrom setuptools import find_packages, setup\n\n\nVERSION = '2.0.dev0'\n\n\ninstall_requires = [\n 'django-local-settings>=1.0a10',\n 'stashward',\n]\n\nif sys.version_info[:2] < (3, ...
python
chosen
[ { "from": "system", "value": "Truncate address table before import, only import from one file\n" }, { "from": "human", "value": "import os\nimport glob\n\nfrom django.apps import apps\nfrom django.db import connection\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCo...
python
chosen
[ { "from": "system", "value": "Update requests requirement from <2.23,>=2.4.2 to >=2.4.2,<2.24\n\nUpdates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.\n- [Release notes](https://github.com/psf/requests/releases)\n- [Changelog](https://github.com/psf/requests/b...
python
chosen
[ { "from": "system", "value": "Allow use latest version on twilio-python library.\n" }, { "from": "human", "value": "from os.path import abspath, dirname, join, normpath\n\nfrom setuptools import find_packages, setup\n\n\nsetup(\n\n # Basic package information:\n name = 'django-twilio',\n ...
python
chosen
[ { "from": "system", "value": "Sort the queues by name, so that they are deterministic across instances of `django_rq`.\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\n\nfrom .queues import get_unique_connection_configs...
python
chosen
[ { "from": "system", "value": "Allow specification of custom settings module using DJANGO_SETTINGS_MODULE environment variable.\n" }, { "from": "human", "value": "# vim:ts=4:sts=4:sw=4:expandtab\n\"\"\"The core of the system. Manages the database and operational logic. Functionality is\nexposed o...
python
chosen
[ { "from": "system", "value": "Add searchfield Blacklists, and use count() for recommendation count\n" }, { "from": "human", "value": "from django.contrib import admin\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.admin import UserAdmin\nfrom hr.models import Application,...
python
chosen
[ { "from": "system", "value": "Add test for API endpoint\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"Test UW Menu Flask application.\"\"\"\n\nimport unittest\n\nfrom uwmenu import app, attach_filters\n\n\nclass UWMenuTestCase(unittest.TestCase):\n\n def setUp(self):\n ...
python
chosen
[ { "from": "system", "value": "Update comment about default data.\n" }, { "from": "human", "value": "DEFAULTS = {\n # Install\n 'kubernetes_version': None, # must be provided\n 'kubernetes_download_base_url': 'https://dl.k8s.io',\n 'kubernetes_install_dir': '/usr/local/kubernetes',\n...
python
chosen
[ { "from": "system", "value": "Exclude nulls in translator when operator is range, gt, gte\n\nPreviously, nulls were included in all cases making it appear that null\nwas but 0 and infinity. Now, null is effectively treated as 0.\n\nSigned-off-by: Don Naegely <e690a32c1e2176a2bfface09e204830e1b5491e3@gmail.c...
python
chosen
[ { "from": "system", "value": "Use ValueError for Swig Python test\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nimport deepstream\n\nversion = deepstream.version_to_string()\n\nif deepstream.version_to_string() != \"0.1.0\":\n raise Exception(\"Version mismatch; expected 0.0.1,...
python
chosen
[ { "from": "system", "value": "Add value() to jug namespace\n\nThe jug namespace might need some attention.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# vim: set ts=4 sts=4 sw=4 expandtab smartindent:\n# Copyright (C) 2008-2010, Luis Pedro Coelho <lpc@cmu.edu>\n#\n# Permission is...
python
chosen
[ { "from": "system", "value": "Rebase off develop, add missing parenthesis\n" }, { "from": "human", "value": "from django.test import TestCase\nfrom django.core.urlresolvers import reverse\nfrom whats_fresh_api.models import *\nfrom django.contrib.gis.db import models\nimport json\n\n\nclass List...
python
chosen
[ { "from": "system", "value": "Update warning message if numba import fails\n" }, { "from": "human", "value": "\"\"\"\nWarnings Module\n===============\n\nContains a collection of warning messages for consistent package wide notifications\n\n\"\"\"\n\n#-Numba-#\nnumba_import_fail_message = \"Numb...
python
chosen
[ { "from": "human", "value": "Configure basic securesystemslib top-level logger\n\nAs pointed out by @FlorianVeaux in #210, securesystemslib does not\ncorrectly initialize its loggers. As a consequence the logging\nmodule logs a one-off \"No handler could be found ...\" warning when\nused for the first time ...
python
chosen
[ { "from": "system", "value": "Send json to semanticizer stdin\n" }, { "from": "human", "value": "import json\nimport subprocess\n\n\nclass Semanticizer:\n ''' Wrapper for semanticizest go implementation. '''\n\n def __init__(self, model='nl.go.model', stPath='./bin/semanticizest'):\n ...
python
chosen
[ { "from": "system", "value": "Add formatting to post tree\n" }, { "from": "human", "value": "from django import template\nfrom django.utils.safestring import mark_safe\n\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef make_tree(posts):\n levels = []\n depth = 0\n html = ...
python
chosen
[ { "from": "system", "value": "Fix a platform detection bug\n" }, { "from": "human", "value": "\"\"\"\nSimple test runner to separate out the functional tests and the unit tests.\n\"\"\"\nimport os\nimport subprocess\n\nPLATFORMS = ['bsd', 'linux', 'nt']\n\n# Detect what platform we are on\ntry:\...
python
chosen
[ { "from": "system", "value": "Change bitshuffle call to hdf5plugin\n" }, { "from": "human", "value": "import h5py\nimport bitshuffle.h5\nimport numpy\nimport tempfile\n\n\ndef test_is_h5py_correctly_installed():\n \"\"\"\n If this test fails you probably need to install h5py from source ma...
python
chosen
[ { "from": "system", "value": "Move the db back to the correct location\n" }, { "from": "human", "value": "import os\n_basedir = os.path.abspath(os.path.dirname(__file__))\n\nSQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'app.db')\n\nSECRET_KEY = 'INSECURE'\n\nMAIL_SERVER = 'loc...
python
chosen
[ { "from": "system", "value": "Add option to print astor reconstructed source of template\n" }, { "from": "human", "value": "import ast\n\nfrom .context import ContextScope\nfrom .parser import Parser\nfrom .utils import Helpers\n\n\ndef kompile(src, raw=False, filename='<compiler>'):\n '''\n ...
python
chosen
[ { "from": "system", "value": "Remove last memberships related hooks from project\n" }, { "from": "human", "value": "from django.shortcuts import redirect\nfrom django.views import generic\nfrom rules.contrib import views as rules_views\n\nfrom . import mixins, models\n\n\nclass ProjectDetailView...
python
chosen
[ { "from": "system", "value": "Allow for checking search rate limit.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n\n# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you ma...
python
chosen
[ { "from": "system", "value": "Add playbook file detail view\n" }, { "from": "human", "value": "from django.conf.urls import url\nfrom ansible.forms import AnsibleForm1, AnsibleForm2\nfrom ansible.views import (\n PlaybookWizard, PlaybookListView, PlaybookDetailView,\n)\nfrom . import views\n\...
python
chosen
[ { "from": "system", "value": "Add logging and raise exceptions when loading plugin factories\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2013-2014 Simon Jagoe\n# All rights reserved.\n#\n# This software may be modified and distributed under the terms\n# of the 3-c...
python
chosen
[ { "from": "system", "value": "Allow to pass the encoding via a command option\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n#\n# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>\n#\n# See LICENSE comming with the source of 'trex' for details.\n#\n\nfrom django.core.management.base im...
python
chosen
[ { "from": "system", "value": "Add correct protocol to the Pandas client\n\n@nicolajkirchhof Is this what you were talking about?" }, { "from": "human", "value": "import argparse\nimport pandas as pd\n\nfrom influxdb import DataFrameClient\n\n\ndef main(host='localhost', port=8086):\n user = '...
python
chosen
[ { "from": "system", "value": ":muscle: Make default_confidence into a @property\n" }, { "from": "human", "value": "# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\n...
python
chosen
[ { "from": "system", "value": "[FIX] stock_planning: Fix condition cond.append(('date', '>=', from_date))\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp_...
python
chosen
[ { "from": "system", "value": "Remove invalid imports for TestKerberosAuthentication and fix its styling\n" }, { "from": "human", "value": "import pytest\nimport requests_kerberos\nfrom mock import patch, Mock\nimport pdcupdater.utils\nfrom test.test_support import EnvironmentVarGuard\nimport os\...
python
chosen
[ { "from": "system", "value": "Add Python classifiers for PyPi.\n" }, { "from": "human", "value": "from sys import version\n\nfrom distutils.core import setup\nsetup(name='mosquitto',\n\tversion='1.0.1',\n\tdescription='MQTT version 3.1 client class',\n\tauthor='Roger Light',\n\tauthor_email='rog...
python
chosen
[ { "from": "system", "value": "Fix the __file__ is not defined bug\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\nCreate wordcloud with Arabic\n===============\nGenerating a wordcloud from Arabic text\n\nDependencies:\n- bidi.algorithm\n- arabic_reshaper\n\nDependencies install...
python
chosen
[ { "from": "system", "value": "Add version number to package.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nfrom . import auth, commands, tests, utils, account, auth, blueprint, columns, errors, query, segments\nfrom .auth import authenticate, authorize, revoke\nfrom .blueprint import B...
python
chosen
[ { "from": "system", "value": "Test restarting with Stefan problem instead of heat driven cavity. Removed some redundant tests\n" }, { "from": "human", "value": "\"\"\" This module runs the benchmark test suite. \"\"\"\nfrom .context import phaseflow\n\n\ndef test_lid_driven_cavity_benchmark__ci_...
python
chosen
[ { "from": "system", "value": "Add ability to iterate over all currently loaded ports.\n\nThis function provides a snapshot of ports and does not provide support to\nquery ports that are still loading.\n" }, { "from": "human", "value": "\"\"\"FreeBSD Ports.\"\"\"\n\nfrom __future__ import absolut...
python
chosen
[ { "from": "system", "value": "Add missing python import to utility script\n\nBUG=\nR=lrn@google.com\n\nReview URL: https://codereview.chromium.org//1226963005.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n#\n# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS fil...
python
chosen
[ { "from": "system", "value": "Streamline imports for Element, Page and Site\n\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"sda\n\n.. codeauthor:: John Lane <jlane@fanthreesixty.com>\n\n\"\"\"\n\nfrom sda import element\nfrom sda import locators\nfrom sda import mixins\nfrom ...
python
chosen
[ { "from": "system", "value": "Remove method for copying rules only\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 16.08.2017 19:25\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom .CopyableGrammar import CopyableGrammar as _G\n\n\n\nclass Gr...
python
chosen
[ { "from": "system", "value": "Add description field to transaction\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom datetime import datetime\nfrom django.contrib.auth.models import User\nfrom django.db import models\n\n\nclass Transaction(models.Model):\n title = models.CharFi...
python
chosen
[ { "from": "system", "value": "Use UTF-8 as default encoding.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2013-2015, Sebastian Linke\n\n# Released under the Simplified BSD license\n# (see LICENSE file for details).\n\n\"\"\"\nConstants that are used by `shcol` in m...
python
chosen
[ { "from": "system", "value": "Raise error when plugin not configured\n" }, { "from": "human", "value": "# -*- coding: utf8 -*-\n\"\"\"Main package for pybossa-z3950.\"\"\"\n\nfrom flask import current_app as app\nfrom flask.ext.plugins import Plugin\nfrom flask.ext.z3950 import Z3950Manager\n\n_...
python
chosen
[ { "from": "system", "value": "Support for title in the notification, defaulting to 'Argus'\n" }, { "from": "human", "value": "import http.client\nimport urllib\n\n\ndef send_message(settings, message):\n conn = http.client.HTTPSConnection(\"api.pushover.net:443\")\n conn.request(\"POST\", ...
python
chosen
[ { "from": "system", "value": "Create test-results folder, to make Jenkins happy\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\nfrom __future__ import print_function\nimport gen_csharp\nimport gen_docs_json\nimport gen_java\nimport gen_python\nimport gen_thri...
python
chosen
[ { "from": "system", "value": "Fix file deletion if we're using remote storage\n" }, { "from": "human", "value": "from django.db.models.signals import pre_save, post_delete\nfrom django.core.files.storage import default_storage\n\n\ndef asset_file_change(sender, instance, **kwargs):\n # Must b...
python
chosen
[ { "from": "system", "value": "Handle missing distribution on ReadTheDocs\n" }, { "from": "human", "value": "\"\"\"Package for GitMan.\"\"\"\n\nfrom pkg_resources import get_distribution\n\nfrom .commands import delete as uninstall # pylint: disable=redefined-builtin\nfrom .commands import displ...
python
chosen
[ { "from": "system", "value": "Make HTTP01Responder's resource be at the token's path\n\n* Not /.well-known/acme-challenge/<token>, just /<token>\n* Use twisted.web.static.Data as the child resource\n" }, { "from": "human", "value": "\"\"\"\n``http-01`` challenge implementation.\n\"\"\"\nfrom twi...
python
chosen
[ { "from": "system", "value": "Add test for internationalized domain names\n\nTest that a domain name composed entirely of non-latin characters is\nparsed properly. This should always pass with Python 3 but it will fail\nwith Python 2 because 'parse_domain' returns 'str(second_level_domain)',\nwhich tries to...
python
chosen
[ { "from": "system", "value": "Make all navigation items have an active attribute.\n" }, { "from": "human", "value": "from flask import url_for, request, current_app\nfrom markupsafe import Markup\n\nfrom . import get_renderer\n\n\nclass NavigationItem(object):\n def render(self, renderer=None...
python
chosen
[ { "from": "system", "value": "Allow to add contact to logged in users.\n" }, { "from": "human", "value": "from ajax_select import LookupChannel\nfrom django.utils.html import escape\nfrom django.db.models import Q\nfrom .models import Person\n\n\nclass PersonLookup(LookupChannel):\n\n model =...
python
chosen
[ { "from": "system", "value": "Update name and displayName for a bunch of plugins\n" }, { "from": "human", "value": "#Shoopdawoop\nfrom . import CuraEngineBackend\n\nfrom UM.Preferences import Preferences\n\ndef getMetaData():\n return { \"name\": \"CuraBackend\", \"type\": \"Backend\" }\n\nde...
python
chosen
[ { "from": "system", "value": "Fix servo sweep example in docs" }, { "from": "human", "value": "from gpiozero import Servo\nfrom gpiozero.tools import sin_values\n\nservo = Servo(17)\n\nservo.source = sin_values()\nservo.source_delay = 0.1\n" }, { "from": "gpt", "value": "from gpiozer...
python
chosen
[ { "from": "system", "value": "Make list objects return the embedded resource data again\n" }, { "from": "human", "value": "from .Base import Base\n\n\nclass List(Base):\n def __init__(self, result, object_type):\n Base.__init__(self, result)\n self.object_type = object_type\n\n ...
python
chosen
[ { "from": "system", "value": "Add 2 methods to search product by keywords.\n" }, { "from": "human", "value": "from django.apps import apps\nfrom django.db.models import manager\nfrom django.contrib.postgres.search import SearchVector, SearchQuery, SearchRank\n\n\nclass ProductManager (manager.Ma...
python
chosen
[ { "from": "system", "value": "Change name of session init method\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport logging\nimport argparse\nfrom matador.session import Session\n\n\nclass Command(object):\n\n def __init__(self, **kwargs):\n if kwargs:\n # If k...
python
chosen
[ { "from": "system", "value": "Remove IF EXISTS from DROP TABLE when resetting the db.\n" }, { "from": "human", "value": "import sqlite3\n\nDB_FILENAME = 'citationhunt.sqlite3'\n\ndef init_db():\n return sqlite3.connect(DB_FILENAME)\n\ndef reset_db():\n db = init_db()\n\n with db:\n ...
python
chosen
[ { "from": "system", "value": "BLD: Set default version to 0.2.0.dev-unknown\n" }, { "from": "human", "value": "try:\n from geopandas.version import version as __version__\nexcept ImportError:\n __version__ = '0.1.0'\n\nfrom geopandas.geoseries import GeoSeries\nfrom geopandas.geodataframe ...
python
chosen
[ { "from": "system", "value": "Clean up merge of LOG_METRICS from master\n" }, { "from": "human", "value": "import time\n\ndef start():\n return {'start_time': time.time()}\n\ndef end(start_time):\n print(\"count#requests=1\")\n response_time = time.time() - start_time\n print(\"measu...
python
chosen
[ { "from": "system", "value": "Fix ProjectMap always returning true if it has a config section\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\n wakatime.projects.projectmap\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Information from ~/.waka-projectmap mapping folders (relative ...
python
chosen
[ { "from": "system", "value": "Add the to_dependency method to ProjectPackage\n" }, { "from": "human", "value": "from poetry_core.semver import VersionRange\nfrom poetry_core.semver import parse_constraint\nfrom poetry_core.version.markers import parse_marker\n\nfrom .package import Package\nfrom...
python
chosen
[ { "from": "system", "value": "Fix py3-incompatible test code that causes PY3 test failure.\n" }, { "from": "human", "value": "from rdflib.graph import ConjunctiveGraph\nfrom rdflib.term import Identifier, URIRef\nfrom rdflib.parser import StringInputSource\nfrom os import path\n\n\nDATA = u\"\"\...
python
chosen
[ { "from": "system", "value": "Add test for file closing\n" }, { "from": "human", "value": "import os\n\nfrom cffitsio._cfitsio import ffi, lib\n\n\ndef test_create_file(tmpdir):\n filename = str(tmpdir.join('test.fits'))\n f = ffi.new('fitsfile **')\n status = ffi.new('int *')\n lib....
python
chosen
[ { "from": "system", "value": "Add missing parenthesis to fix syntax of test\n" }, { "from": "human", "value": "#!/usr/bin/python\n# Check if all the errors have been added to\n# docs/reference/telepathy-glib-sections.txt\n\nimport os\nimport sys\n\nimport xml.dom.minidom\n\nfrom libglibcodegen i...
python
chosen
[ { "from": "system", "value": "Add descriptive name to Venues model\n" }, { "from": "human", "value": "from django.db import models\n\nclass Venues(models.Model):\n\tname = models.CharField(max_length=30)\n\twebsite = models.CharField(max_length=50)\n\taddress = models.CharField(max_length=200)\n...
python
chosen
[ { "from": "system", "value": "Add pointer from math library to external numba.math.* functions\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nPostpasses over the LLVM IR.\nThe signature of each postpass is postpass(env, ee, lmod, lfunc) -> lfunc\n\"\"\"\n\nfrom __future__ ...
python
chosen
[ { "from": "system", "value": "Make sure we use the absolute path in generating cron lines\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n'''\nThis tool iterates through all of the scrapers in the datasets module\nand creates a cron-task for each one.\n'''\ni...
python
chosen
[ { "from": "system", "value": "Make sure to disconnect the extra connection before finishing the test\n" }, { "from": "human", "value": "import pytest\n\nfrom juju.controller import Controller\nfrom juju.juju import Juju\nfrom .. import base\n\n\n@base.bootstrapped\n@pytest.mark.asyncio\nasync de...
python
chosen
[ { "from": "system", "value": "Add self to contributors list\n" }, { "from": "human", "value": "from twisted.plugin import IPlugin\nfrom twisted.words.protocols import irc\nfrom txircd import version\nfrom txircd.module_interface import Command, ICommand, IModuleData, ModuleData\nfrom zope.interf...
python
chosen
[ { "from": "system", "value": "Convert map objects to lists\n" }, { "from": "human", "value": "from __future__ import absolute_import, print_function, unicode_literals\n\nimport regex as re\nimport unicodecsv as csv\nimport os.path\nimport pkg_resources\n\n\nclass XSampa(object):\n def __init_...
python
chosen
[ { "from": "system", "value": "Fix unit tests for Version.objects.get_current().\n\nThe unit tests assumed that no Version objects were present, but this\nwasn't always the case. This clears them before the test runs.\n" }, { "from": "human", "value": "from datetime import datetime\n\nfrom django...
python
chosen
[ { "from": "system", "value": "Update to reflect str key change\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nfrom datetime import datetime\nfrom decimal import Decimal\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\nfrom pamqp import encode, d...
python
chosen
[ { "from": "system", "value": "Remove broken and old test\n" }, { "from": "human", "value": "\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"\n\nfrom ...
python
chosen
[ { "from": "system", "value": "Add basic REST API support\n" }, { "from": "human", "value": "from flask import render_template, request, send_from_directory\nimport saliweb.frontend\nfrom saliweb.frontend import get_completed_job\nfrom . import submit\n\n\napp = saliweb.frontend.make_application(...
python
chosen
[ { "from": "system", "value": "Add back missing import from merge commit c40da341b\n" }, { "from": "human", "value": "import sys\nimport warnings\nimport pkg_resources\n\ntry:\n __version__ = pkg_resources.require('python-dispatch')[0].version\nexcept: # pragma: no cover\n __version__ = 'un...
python
chosen
[ { "from": "system", "value": "pyecmd: Make fapi2 test conditional on fapi2 being built into ecmd\n" }, { "from": "human", "value": "from pyecmd import *\n\nwith Ecmd(fapi2=\"ver1\"):\n t = loopTargets(\"pu\", ECMD_SELECTED_TARGETS_LOOP)[0]\n data = t.getScom(0x1234)\n t.putScom(0x123...
python
chosen
[ { "from": "system", "value": "Make the widget error message shorter and more understandable.\n" }, { "from": "human", "value": "from .widget import Widget, DOMWidget, CallbackDispatcher, register\n\nfrom .widget_bool import Checkbox, ToggleButton\nfrom .widget_button import Button\nfrom .widget_...
python
chosen
[ { "from": "system", "value": "Make migration reverse no-op a valid SQL query\n\nWhen using a PostgreSQL database with Django 1.7 empty reverse query\nstatements in DB migrations cause an error, so we replace the empty\nno-op statement with a valid query that still does nothing so the\nreverse migration will...
python
chosen
[ { "from": "system", "value": "Fix Python invokation (2.7 -> 3.7) in ledger-samples.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# a helper for gyp to do file globbing cross platform\n# Usage: python glob.py root_dir pattern [pattern...]\n\nimport fnmatch\nimport os\nimport sys\n\nr...
python
chosen
[ { "from": "system", "value": "Add test of an empty and non empty polygon\n" }, { "from": "human", "value": "from shapely.geometry import MultiPolygon, Polygon\n\n\ndef test_empty_polygon():\n \"\"\"No constructor arg makes an empty polygon geometry.\"\"\"\n assert Polygon().is_empty\n\n\nd...
python
chosen
[ { "from": "system", "value": "Move the responses to a cacheable fixture\n" }, { "from": "human", "value": "# -*- encoding: utf-8\n\nfrom http_crawler import crawl\n\n\ndef test_no_links_are_broken(baseurl):\n \"\"\"\n Check that all internal links point to working pages.\n \"\"\"\n r...
python
chosen
[ { "from": "system", "value": "Update Dockerfile to include extensions\n" }, { "from": "human", "value": "from python_cowbull_game.GameController import GameController\nfrom python_cowbull_game.GameMode import GameMode\n\n\nclass ExtGameController(GameController):\n additional_modes = [\n ...
python
chosen
[ { "from": "system", "value": "Add url setting to test settings\n" }, { "from": "human", "value": "from malaria24.settings import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': 'malaria24',\n }\n}\n\nONAPIE_ACCESS_TOKEN = 'foo'\nVUMI_GO_A...
python
chosen
[ { "from": "system", "value": "Add beta version tagging for 0.5 beta 1\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# EForge project management system, Copyright © 2010, Element43\n#\n# Permission to use, copy, modify, and/or distribute this software for any\n# purpose with or with...
python
chosen
[ { "from": "system", "value": "Change model name (but not table name)\n" }, { "from": "human", "value": "from django.db import models\n\n\nclass Autoreg(models.Model):\n class Meta:\n db_table = 'autoreg'\n\n mac = models.CharField(max_length=17, db_index=True)\n ip = models.Integ...
python
chosen
[ { "from": "system", "value": "Edit to populate the local themeing.\n" }, { "from": "human", "value": "from django.conf import settings\n\ndef context_preprocessor(request):\n d = {\n 'vdi_media_dir': settings.VDI_MEDIA_PREFIX,\n }\n if request.user.is_authenticated():\n d[...
python
chosen
[ { "from": "system", "value": "Fix Hello World test class name & update test\n\nFix test class name to reflect exercise name.\nUpdate tests to reflect Hello World metadata in x-common.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nimport un...
python
chosen
[ { "from": "system", "value": "Add NOTE regarding transaction to db tests setup\n" }, { "from": "human", "value": "import pytest\n\nfrom handy.db import do_sql, fetch_all, fetch_row, fetch_col, fetch_val\n\n\ndef pytestmark(func):\n pytest.mark.django_db(func)\n pytest.mark.usefixtures('tes...
python
chosen
[ { "from": "system", "value": "Fix issue where lang was not parsed properly\n" }, { "from": "human", "value": "import os\n\nimport requests\nfrom django.utils.translation import get_language\n\nfrom wagtailaltgenerator.translation_providers import get_current_provider\nfrom wagtailaltgenerator.pr...
python
chosen
[ { "from": "system", "value": "Update manager API for update.\n" }, { "from": "human", "value": "\"\"\"Valve Manager base class\"\"\"\n\n# pylint: disable=R0201\n# pylint: disable=W0613\nclass ValveManagerBase: # pylint: disable=too-few-public-methods\n \"\"\"Base class for ValveManager object...
python
chosen