conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Check occurrences for exclusion dates and patterns\n" }, { "from": "gpt", "value": "from datetime import datetime\nfrom recurrence import Recurrence, Rule\nimport recurrence\n\n\ndef test_exclusion_date():\n rule = Rule(\n recurrence.DAILY\n )\n\n pat...
python
chosen
[ { "from": "human", "value": "Add test for loading native libraries of a Java archive.\n" }, { "from": "gpt", "value": "import os\nimport angr\n\nself_dir = os.path.dirname(os.path.realpath(__file__))\n\ndef test_loading_of_native_libs():\n\n binary_dir = os.path.join(self_dir, \"..\", \"..\",...
python
chosen
[ { "from": "human", "value": "Add a py script to get monthly totals.\n" }, { "from": "gpt", "value": "# calculate_totals.py\n\nimport json\nimport datetime\nfrom collections import defaultdict\n\n# http://stackoverflow.com/questions/6999726/how-can-i-convert-a-datetime-object-to-milliseconds-sinc...
python
chosen
[ { "from": "human", "value": "Add magice circle demo app\n" }, { "from": "gpt", "value": "#!/usr/bin/python2\n\nimport sys\nsys.path = ['', 'pyglet-1.1.4'] + sys.path\n\nimport math\n\nimport pyglet\nfrom pyglet.graphics import vertex_list\nfrom pyglet import gl\nfrom pyglet.window import key\n\n...
python
chosen
[ { "from": "human", "value": "Add node to use tf2\n" }, { "from": "gpt", "value": "#!/usr/bin/env python\n\nimport rospy\nimport tf2_ros\nfrom geometry_msgs.msg import TransformStamped\n\n\nclass TransformBroadcaster(object):\n '''This is hack to avoid tf2_ros on python3\n '''\n def __in...
python
chosen
[ { "from": "human", "value": "Add more direct RPC size tests\n" }, { "from": "gpt", "value": "#!/usr/bin/env python\n\nfrom pyon.net.endpoint import RPCClient\n#from interface.services.idatastore_service import IDatastoreService\nfrom interface.services.ihello_service import IHelloService\nfrom p...
python
chosen
[ { "from": "human", "value": "Add script to create plugins faster\n" }, { "from": "gpt", "value": "import os\n\nimport click\n\n\n@click.command()\n@click.option(\n '--matcher',\n type=click.Choice(['url', 'body', 'header']),\n required=True,\n help='Set the matcher type.',\n)\n@click...
python
chosen
[ { "from": "human", "value": "Add tests for the data seeder.\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2010-2012 Cidadania S. Coop. Galega\n#\n# This file is part of e-cidadania.\n#\n# e-cidadania is free software: you can redistribute it and/or modify\n# it und...
python
chosen
[ { "from": "human", "value": "Add script for removing e-book records\n\nAdded temporary script to remove Harmatheque e-book records from R00\nreport. Script should be integrated into mars_enhance.csv.\n" }, { "from": "gpt", "value": "#!/usr/bin/env python\n'''\nScript for removing Harmatheque e-b...
python
chosen
[ { "from": "human", "value": "Throw things into a queue.\n" }, { "from": "gpt", "value": "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\nenqueue-test.py\n\nCreated by Gavin M. Roy on 2009-09-11.\nCopyright (c) 2009 Insider Guides, Inc.. All rights reserved.\n\"\"\"\n\nimport amqplib.client_0_8...
python
chosen
[ { "from": "human", "value": "Add the closure conversion functions\n\nIn order to utilize the general minimization functions of scipy,\nconversion routines are added to convert the previous residue and\nJacobian closure to be used with the general function.\n" }, { "from": "gpt", "value": "\"\"\"...
python
chosen
[ { "from": "human", "value": "Add an example showing the use of the delaunay2d filter to build a surface from a scattered set of points.\n" }, { "from": "gpt", "value": "\"\"\"\nAn example which shows how to plot a surface from data acquired\nirregularly.\n\nData giving the variation of a paramet...
python
chosen
[ { "from": "human", "value": "Add ORM models for filter/qdisc\n" }, { "from": "gpt", "value": "from simplesqlite.model import Integer, Model, Text\n\nfrom .._const import Tc\n\n\nclass Filter(Model):\n device = Text(attr_name=Tc.Param.DEVICE, not_null=True)\n filter_id = Text(attr_name=Tc.P...
python
chosen
[ { "from": "human", "value": "Add a test for the assert statement\n" }, { "from": "gpt", "value": "assert a or b, 'aaa'\n\n\n\nassert : keyword.control.flow.python, source.python\n a : source.python\nor : keyword.operator.python, source.python\n b, : source....
python
chosen
[ { "from": "human", "value": "Add a test for lib.download\n" }, { "from": "gpt", "value": "# Run the following command to test:\n#\n# (in /usr/local/googkit)\n# $ python -m {test_module_name}\n#\n# See also: http://docs.python.org/3.3/library/unittest.html#command-line-interface\n#\n# We ...
python
chosen
[ { "from": "human", "value": "Add script to re-index users' files in quickfiles nodes\n" }, { "from": "gpt", "value": "import sys\n\nimport progressbar\nfrom django.core.paginator import Paginator\n\nfrom website.app import setup_django\nsetup_django()\n\nfrom website.search.search import update_...
python
chosen
[ { "from": "human", "value": "Add unit test for _wget method in tomcat module\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\n\n# Import future libs\nfrom __future__ import absolute_import, print_function, unicode_literals\n\n# Import Salt Testing libs\nfrom tests.support.mixins import ...
python
chosen
[ { "from": "system", "value": "Update the ACME github repository URL.\n" }, { "from": "human", "value": "\"\"\"ACME protocol implementation.\n\nThis module is an implementation of the `ACME protocol`_. Latest\nsupported version: `v02`_.\n\n.. _`ACME protocol`: https://github.com/letsencrypt/acme-...
python
chosen
[ { "from": "system", "value": "Add method comment to population script for easy deploy\n" }, { "from": "human", "value": "from string import ascii_lowercase\nimport django\nimport os\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')\ndjango.setup()\n\nfrom breach.models impor...
python
chosen
[ { "from": "system", "value": "Add url count per agency to the invalid url report\n" }, { "from": "human", "value": "from __future__ import division\nfrom django.core.management.base import BaseCommand\nfrom django.utils import timezone\nfrom thezombies.models import (Agency, Probe)\n\nREPORT_DAT...
python
chosen
[ { "from": "system", "value": "Move activity SQL query into a dedicated function\n\nThe SQL query based on the UNION predicate is now into a function which takes as\nparameters the number of record we want to have in the result. This function\nwill be used for the activity dashboard and also for the new glob...
python
chosen
[ { "from": "system", "value": "Update doc string on location of sensors\n" }, { "from": "human", "value": "# Copyright 2016 by MPI-SWS and Data-Ken Research.\n# Licensed under the Apache 2.0 License.\n\"\"\"\nThis is the main package for antevents. Directly within this package you fill\nfind the ...
python
chosen
[ { "from": "system", "value": "Add visualize to diagnostics import\n" }, { "from": "human", "value": "from .profile import Profiler, ResourceProfiler\nfrom .progress import ProgressBar\n" }, { "from": "gpt", "value": "from .profile import Profiler, ResourceProfiler\nfrom .progress imp...
python
chosen
[ { "from": "system", "value": "Fix DropPrivileges component to be compatible with python3\n" }, { "from": "human", "value": "from pwd import getpwnam\nfrom grp import getgrnam\nfrom traceback import format_exc\nfrom os import getuid, setgroups, setgid, setuid, umask\n\n\nfrom circuits.core import...
python
chosen
[ { "from": "system", "value": "Create somewhat questionable sql function\n" }, { "from": "human", "value": "from os.path import abspath, dirname, join\n\nimport sh\nimport psycopg2\nimport requests\n\nPROJECT_FOLDER=dirname(dirname(abspath(__file__)))\nDOCKER_FOLDER=join(PROJECT_FOLDER, 'docker')...
python
chosen
[ { "from": "system", "value": "Update 0.9 alpha to 0.10 alpha\n" }, { "from": "human", "value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom .utils.version import get_version\n\n#: This may not be the exact version...
python
chosen
[ { "from": "system", "value": "Test log for a string with no \"'b\"\n" }, { "from": "human", "value": "\nimport logging\nimport os.path\nimport shutil\nimport sys\nimport tempfile\n\nimport fiona\n\ndef test_options(tmpdir=None):\n \"\"\"Test that setting CPL_DEBUG=ON works\"\"\"\n if tmpdi...
python
chosen
[ { "from": "system", "value": "Add test for form on Preview Tool\n\nTest to see that the form to enter a URL to use the Preview Tool\nexists, has the correct action and has the correct elements.\n" }, { "from": "human", "value": "import pytest\nfrom web_test_base import *\n\nclass TestIATIPreview...
python
chosen
[ { "from": "system", "value": "Add comment and clean up code.\n" }, { "from": "human", "value": "import unittest\nfrom datetime import datetime\n\nfrom stock import Stock\n\n\nclass StockTest(unittest.TestCase):\n def test_price_of_a_new_stock_class_should_be_None(self):\n stock = Stock...
python
chosen
[ { "from": "system", "value": "Revert \"Adding test case stub.\"\n\nThis reverts commit 6c6b08a63b308690144d73f54b98000e3b1b5672.\n" }, { "from": "human", "value": "\"\"\"Unit tests for `pycall.actions`.\"\"\"\n\n\nclass TestActions(TestCase):\n\t\"\"\"Test all `pycall.actions` classes to ensure ...
python
chosen
[ { "from": "system", "value": "Improve robustness: surround the 'id' fetch from result array with a try clause.\n" }, { "from": "human", "value": "\"\"\" Username to UUID\n Converts a Minecraft username to it's UUID equivalent.\n\nUses the official Mojang API to fetch player data.\n\"\"\"\nimport...
python
chosen
[ { "from": "system", "value": "feature: Change regex to not capture the useless groups\n" }, { "from": "human", "value": "import re\n\nlink_re = re.compile(\"(\\s|^)<(https?://[\\w./?+]+)>(\\s|$)\")\n\n\ndef extract_url(message):\n \"\"\"\n Returns the first url in a message. If there aren'...
python
chosen
[ { "from": "system", "value": "Add support for email and font bbcode tags.\n" }, { "from": "human", "value": "\"\"\"\nThis module defines all of our bbcode capabilities.\n\nTo add a new bbcode tag do the following:\n\n def bbcode_<tag_name>(tag_name, value, options, parent, context):\n ...
python
chosen
[ { "from": "system", "value": "Use single-quotes to satisfy the style nazis.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nextensions = [\n 'sphinx.ext.autodoc',\n 'jaraco.packaging.sphinx',\n 'rst.linker',\n]\n\nmaster_doc = 'index'\n\nlink_files ...
python
chosen
[ { "from": "system", "value": "Remove a deprecation warning when computing the package version.\n\nIn pretty much all of our Python packages, we generate a package version\nusing legacy identifiers of \"alpha\" and \"beta\". These get turned into\n\"a\" and \"b\" by `pkg_resources`, and a warning is thrown t...
python
chosen
[ { "from": "system", "value": "Update includes; set encoding for file.\n" }, { "from": "human", "value": "import sys\r\nimport collections\r\n\r\ndef parameters_from_args(defaults_tuple=None, sys_args):\r\n \"\"\"Provided a set of tuples for default values, return a list of mapped\r\n va...
python
chosen
[ { "from": "system", "value": "Make metric_name option of monitored_batch_queue\n" }, { "from": "human", "value": "import functools\nimport tensorflow as tf\n\nfrom . import cnn_dailymail_rc\nfrom .. import collections\nfrom ..flags import FLAGS\nfrom ..util import func_scope, dtypes\nfrom .util ...
python
chosen
[ { "from": "system", "value": "Make sure report is part of the job dict\n\nTo get around failures like this for now:\n\nhttps://travis-ci.org/frictionlessdata/goodtables.io/builds/179121528\n\nThis should definitely be investigated and fixed as part of #33\n" }, { "from": "human", "value": "from ...
python
chosen
[ { "from": "system", "value": "Change Widget tag on SimultaneousAxes to TEXTINPUT\n" }, { "from": "human", "value": "from annotypes import Anno, Array, Union, Sequence, add_call_types\n\nfrom malcolm.core import Part, StringArrayMeta, Widget, config_tag, \\\n PartRegistrar, APartName\nfrom ..h...
python
chosen
[ { "from": "system", "value": "Return retcode properly iff erroring\n\nfixes #13\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport logging\nlogging.basicConfig(level=logging.INFO)\nlog = logging.getLogger()\n\ndef yield_packages(handle, meta=False, retcode=None):\n for lineno, l...
python
chosen
[ { "from": "system", "value": "Add method to handle UpperCamelCase verification\n" }, { "from": "human", "value": "from tailor.swift.swiftlistener import SwiftListener\nfrom tailor.utils.charformat import isUpperCamelCase\n\n\nclass MainListener(SwiftListener):\n\n def enterClassName(self, ctx...
python
chosen
[ { "from": "system", "value": "Add the relationship field to the Client form\n" }, { "from": "human", "value": "from django.forms import ModelForm\n\nfrom .models import Client\n\n\nclass ClientForm(ModelForm):\n class Meta:\n model = Client\n fields = (\n \"name\",\n ...
python
chosen
[ { "from": "system", "value": "Increment version number to 0.15.0\n" }, { "from": "human", "value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.14.2\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"...
python
chosen
[ { "from": "system", "value": "Add option to ignore expired events for the search index\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom haystack import indexes\n\nfrom .models import Event\n\n\nclass EventIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharFi...
python
chosen
[ { "from": "system", "value": "Call celery task directly from management command instead of calling the signal\n\nAA-461\n" }, { "from": "human", "value": "\"\"\"\nExport course metadata for all courses\n\"\"\"\n\nfrom django.core.management.base import BaseCommand\n\nfrom xmodule.modulestore.dja...
python
chosen
[ { "from": "system", "value": "WIP: Fix adaptive example with LivePlot\n" }, { "from": "human", "value": "import matplotlib.pyplot as plt\n\nfrom bluesky import RunEngine, Mover, SynGauss\nfrom bluesky.examples import adaptive_scan\n\n\nRE = RunEngine()\nRE.verbose = False\nmotor = Mover('motor',...
python
chosen
[ { "from": "system", "value": "Initialize the three API wrapper differently to fix a bug.\n" }, { "from": "human", "value": "from .base import APIView\nfrom django.http import Http404\n\nfrom three import Three\n\nclass QCThree(Three):\n\tdef __init__(self):\n\t\tself.endpoint = \"http://dev-api....
python
chosen
[ { "from": "system", "value": "Remove extraneous Groups from the View in the VU Meter demo.\n" }, { "from": "human", "value": "\n\nfrom traits.api import HasTraits, Instance\nfrom traitsui.api import View, UItem, Item, RangeEditor, Group, VGroup, HGroup\nfrom enable.api import ComponentEditor\n\n...
python
chosen
[ { "from": "system", "value": "Reset script first pulls pin high\n" }, { "from": "human", "value": "#!/usr/local/bin/python\n\nimport mraa\nimport time\n\nresetPin = mraa.Gpio(8)\nresetPin.dir(mraa.DIR_OUT)\n\nresetPin.write(0)\ntime.sleep(0.2)\nresetPin.write(1)\n" }, { "from": "gpt", ...
python
chosen
[ { "from": "system", "value": "Add the statistics information of sequence length\n\nInclude number of sequences, total length, maximum length, and minimum\nlength\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n'''\nScript: fy_print_seq_len_in_fasta.py\nFunction: Print sequence length...
python
chosen
[ { "from": "system", "value": "Test para obtener una tarea que no existe\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# coding=utf-8\n\"Clase de Test\"\nimport unittest\nimport json\n\n\nfrom app import app\n\n\nclass BasicTestCase(unittest.TestCase):\n \"Test Class\"\n\n def s...
python
chosen
[ { "from": "system", "value": "Disable logging on test runner process\n" }, { "from": "human", "value": "import logging\n\nimport mock\n\nimport oauth2u\nimport oauth2u.server.log\n\n\ndef test_should_have_optional_port():\n server = oauth2u.Server()\n assert 8000 == server.port\n\n\ndef te...
python
chosen
[ { "from": "system", "value": "Fix how we find conversion to use file formats\n" }, { "from": "human", "value": "from . import conversions\nfrom .file_formats import FileFormats\n\n\nclass FileConverter(object):\n\n def get_conversion(self, source_format, target_format):\n\n return {\n ...
python
chosen
[ { "from": "system", "value": "Fix a typo in lbaas driver plugin\n\nChange-Id: I0cfbd95d41ea1d6c798a78595ac63ea049a87dbc\n" }, { "from": "human", "value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You m...
python
chosen
[ { "from": "system", "value": "Use closing for Python 2.6 compatibility\n" }, { "from": "human", "value": "import os\nimport zipfile\n\nimport pytest\n\nfrom setuptools.command.upload_docs import upload_docs\nfrom setuptools.dist import Distribution\n\nfrom .textwrap import DALS\nfrom . import co...
python
chosen
[ { "from": "system", "value": "Speed up Python tests by caching pip downloads\n" }, { "from": "human", "value": "from __future__ import with_statement\n\nfrom fabric.api import *\nfrom fabtools import require\nimport fabtools\n\n\n@task\ndef python():\n \"\"\"\n Check Python package install...
python
chosen
[ { "from": "system", "value": "Move migration to a function\n" }, { "from": "human", "value": "import os\n\nfrom playhouse.migrate import *\n\ncistern_folder = os.getenv('CISTERNHOME', os.path.join(os.environ['HOME'], '.cistern'))\ndb = SqliteDatabase(os.path.join(cistern_folder, 'cistern.db'))\n...
python
chosen
[ { "from": "system", "value": "Update accounts model with scoring system\n" }, { "from": "human", "value": "from django.contrib.auth.models import User\nfrom django.db import models\nfrom django.db.models.signals import post_save\nfrom django.dispatch import receiver\n\n\nclass UserProfile(models...
python
chosen
[ { "from": "system", "value": "Bump version for requirejs support\n\n--HG--\nextra : rebase_source : cf5a3545b3e1e2e70a8fe0607461564432a55464\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nif __name__ == '__main__':\n setup(name='sphinxcontrib-coffee',\n ...
python
chosen
[ { "from": "system", "value": "Test all activity nodes for namespacing\n" }, { "from": "human", "value": "import pytest\n\nfrom gaphor import UML\nfrom gaphor.ui.diagrampage import tooliter\nfrom gaphor.UML.toolbox import uml_toolbox_actions\n\n\n@pytest.fixture\ndef action_factory():\n return...
python
chosen
[ { "from": "system", "value": "Remove unused URL, will revisit later\n" }, { "from": "human", "value": "from django.conf.urls import url\n\nurlpatterns = [\n url(r'^upload-batch/', 'mla_game.apps.transcript.views.upload_batch', name='upload-batch'),\n]\n" }, { "from": "gpt", "value...
python
chosen
[ { "from": "system", "value": "fix: Raise non-auth errors from GitHub\n" }, { "from": "human", "value": "import json\n\nfrom zeus import auth\nfrom zeus.api import client\nfrom zeus.exceptions import ApiError\nfrom zeus.models import Email, Identity\n\nfrom .base import Resource\nfrom ..schemas i...
python
chosen
[ { "from": "system", "value": "Update Oslo imports to remove namespace package\n\nChange-Id: I4ec9b2a310471e4e07867073e9577731ac34027d\nBlueprint: drop-namespace-packages\n" }, { "from": "human", "value": "# Copyright 2014 IBM Corp.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Lice...
python
chosen
[ { "from": "system", "value": "Fix function definition to actually fail\n" }, { "from": "human", "value": "from numba import exportmany, export\nfrom numba.pycc import CC\n\n\n# New API\n\ncc = CC('pycc_test_output')\n\n@cc.export('multf', 'f4(f4, f4)')\n@cc.export('multi', 'i4(i4, i4)')\ndef mul...
python
chosen
[ { "from": "system", "value": "Return None if there is no competition\n" }, { "from": "human", "value": "from django import template\nfrom copy import copy\nfrom molo.yourwords.models import (YourWordsCompetition, ThankYou,\n YourWordsCompetitionIndexPage)\nfrom ...
python
chosen
[ { "from": "system", "value": "Add payment cancel (delete) to Payment REST API.\n" }, { "from": "human", "value": "from rest_framework import generics\nfrom .permissions import IsOrderCreator\nfrom .serializers import PaymentSerializer\nfrom .models import Payment\n\n\nclass PaymentDetail(generic...
python
chosen
[ { "from": "system", "value": "Add new decorator for suvery_data\n" }, { "from": "human", "value": "from django.conf.urls.defaults import *\n\nfrom . import views\n\nurlpatterns = patterns('',\n url(r'^profile/$', views.profile_index, name='survey_profile'),\n url(r'^profile/electric/$', vi...
python
chosen
[ { "from": "system", "value": "Use pathlib to read ext.conf\n" }, { "from": "human", "value": "import os\n\nfrom mopidy import config, ext\n\n\n__version__ = \"1.1.1\"\n\n\nclass Extension(ext.Extension):\n\n dist_name = \"Mopidy-ALSAMixer\"\n ext_name = \"alsamixer\"\n version = __versi...
python
chosen
[ { "from": "system", "value": "Add process_c_str function to the numdist API" }, { "from": "human", "value": "from numdist_copy import default_lib_dirs, default_include_dirs, \\\n default_src_dirs, get_standard_file\nfrom numdist_copy import msvc_runtime_library\n\nfrom co...
python
chosen
[ { "from": "system", "value": "Reduce cache time on db queries\n" }, { "from": "human", "value": "import logging\nimport os\nfrom flask import Flask\nfrom flask_cors import CORS\n\nfrom apisql import apisql_blueprint\n\napp = Flask(__name__)\nlog = logging.getLogger(__name__)\nlog.setLevel(loggin...
python
chosen
[ { "from": "system", "value": "Add tests for count and collect\n" }, { "from": "human", "value": "import unittest\n\nfrom bermann import RDD\n\n\nclass TestRDD(unittest.TestCase):\n\n def test_cache_is_noop(self):\n rdd = RDD([1, 2, 3])\n\n cached = rdd.cache()\n\n self.as...
python
chosen
[ { "from": "system", "value": "static: Make debug_mode for default_page_params follow the setting.\n\nFor pages that don't have page_params, the default_page_params now\nensures that debug_mode will correctly follow settings.DEBUG.\n\nThis allows blueslip exception popups to work on portico pages for\ndevelo...
python
chosen
[ { "from": "system", "value": "Add missing `svn:eol-style : native` prop, which prevented making clean patches against the early 0.9b1 archives (now both the .zip and the .tar.gz have CRLFs for this file)" }, { "from": "human", "value": "from trac.versioncontrol.web_ui.browser import *\r\nfrom tr...
python
chosen
[ { "from": "system", "value": "Stop a deprecation warning that is thrown in elasticutils.\n\nThis is not going to be needed once https://github.com/mozilla/elasticutils/pull/160\nhas been released.\n" }, { "from": "human", "value": "import logging\n\nfrom django.conf import settings\nfrom django....
python
chosen
[ { "from": "system", "value": "Comment out broken init test\n" }, { "from": "human", "value": "import os\nimport imp\n\nimport synapse\nfrom synapse.tests.common import *\n\nclass InitTest(SynTest):\n\n def test_init_modules(self):\n os.environ['SYN_MODULES'] = 'fakenotrealmod , badnoth...
python
chosen
[ { "from": "system", "value": "Update CertificateManager per 2021-03-11 changes\n" }, { "from": "human", "value": "# Copyright (c) 2012-2019, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n#\n# *** Do not modify - this file is autogenerated ***\n# Reso...
python
chosen
[ { "from": "system", "value": "chore: Add close comands to MockRedis class\n\nThis closes #15\n\nSigned-off-by: Kai Blin <ad3597797f6179d503c382b2627cc19939309418@biosustain.dtu.dk>\n" }, { "from": "human", "value": "from mockredis import MockRedis as _MockRedis\n\nfrom .generic import GenericCom...
python
chosen
[ { "from": "system", "value": "Allow null values for ocr and cr fields of CompletedCourse\n" }, { "from": "human", "value": "from django.db import models\n\nfrom django.contrib.auth.models import User\n# Create your models here.\n\n\nclass CompletedCourse(models.Model):\n \"\"\"\n Model for...
python
chosen
[ { "from": "system", "value": "Support an ARGS enviromental variable for extra command arguments.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nimport subprocess\n\nif __name__ == '__main__':\n if os.environ.has_key('APP'):\n graphical_app = os.environ['APP']\n ...
python
chosen
[ { "from": "system", "value": "Add name fields to generated templates\n" }, { "from": "human", "value": "import json\nfrom web.MetaInfo import MetaInfo\n\n\ndef generate_language_template(language_id, structure_id, version=None):\n meta_info = MetaInfo()\n if structure_id not in meta_info.d...
python
chosen
[ { "from": "system", "value": "Use py_limited_api=\"auto\" in rust_with_cffi example\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport platform\nimport sys\n\nfrom setuptools import setup\nfrom setuptools_rust import RustExtension\n\nsetup(\n name=\"rust-with-cffi\",\n versio...
python
chosen
[ { "from": "system", "value": "Fix test for upgrade-node command parser\n\nChange-Id: I87746a3806f7dada04f5e650e17796fd4e65f55b\n" }, { "from": "human", "value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License...
python
chosen
[ { "from": "system", "value": "Add help_text to availability_zone field (nc-327)\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ...
python
chosen
[ { "from": "system", "value": "Use protocol-specific URL for media.\n" }, { "from": "human", "value": "from .base import *\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'docs',\n 'USER': 'postgres', # N...
python
chosen
[ { "from": "system", "value": "Add proper context to homepage serializer\n" }, { "from": "human", "value": "from django.utils import translation\n\nfrom rest_framework import response\n\nfrom bluebottle.utils.views import GenericAPIView\nfrom .models import HomePage\nfrom .serializers import Home...
python
chosen
[ { "from": "system", "value": "Add built-in method object test\n" }, { "from": "human", "value": "\"\"\"Tests for fullqualname.\"\"\"\n\nimport nose\nimport sys\n\nfrom fullqualname import fullqualname\n\n\ndef test_builtin_function():\n # Test built-in function object.\n\n obj = len\n\n ...
python
chosen
[ { "from": "system", "value": "Bump version number to 0.5\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='ppp_datamodel',\n version='0.4',\n description='Data model for the Projet Pensées Profondes.',\n url='ht...
python
chosen
[ { "from": "system", "value": "Install irccat as pydle-irccat instead.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nimport pydle\n\nsetup(\n name=pydle.__name__,\n version=pydle.__version__,\n packages=[\n 'pydle',\n 'pydle.features',\n ...
python
chosen
[ { "from": "system", "value": "Fix minimum django version spec\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name=\"django-minio-storage-py-pa\",\n license=\"MIT\",\n use_scm_version=True,\n description=\"Django file storage using the minio python client\...
python
chosen
[ { "from": "system", "value": "Upgrade tangled 0.1a5 => 0.1a9\n" }, { "from": "human", "value": "from setuptools import setup\n\n\nsetup(\n name='tangled.session',\n version='0.1a3.dev0',\n description='Tangled session integration',\n long_description=open('README.rst').read(),\n u...
python
chosen
[ { "from": "system", "value": "Add python3.7 as a classifier" }, { "from": "human", "value": "import os.path\nfrom setuptools import setup\n\nthisdir = os.path.abspath(os.path.dirname(__file__))\nversion = open(os.path.join(thisdir, 'asciigraf', 'VERSION')).read().strip()\n\n\ndef readme():\n ...
python
chosen
[ { "from": "system", "value": "Use comma on every line on multi-line lists\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport setuptools\n\nimport samsungctl\n\nsetuptools.setup(\n name=samsungctl.__title__,\n version=samsungctl.__version__,\n description=samsungctl.__doc...
python
chosen
[ { "from": "system", "value": "Test for compatibility python2 and python3\n" }, { "from": "human", "value": "import setuptools\n\nwith open(\"README.md\", \"r\") as fh:\n long_description = fh.read()\n\nsetuptools.setup(\n name = 'ferretmagic',\n packages = ['ferretmagic'],\n py_modules = [...
python
chosen
[ { "from": "system", "value": "Remove observer extension from init\n" }, { "from": "human", "value": "# flake8: noqa\nfrom .typing import Observer, Scheduler\n\nfrom .disposable import Disposable\nfrom .anonymousobserver import AnonymousObserver\n\nfrom . import observerextensions\nfrom .pipe imp...
python
chosen
[ { "from": "system", "value": "Remove date from addon count script\n" }, { "from": "human", "value": "import sys\nimport logging\nfrom datetime import datetime\nfrom dateutil.parser import parse\n\nfrom website.settings import ADDONS_AVAILABLE\nfrom website.app import init_app\nfrom website.setti...
python
chosen
[ { "from": "system", "value": "Increment version to 3.0.3 which now supports Python 2 and 3\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(name='mailosaur',\n version='3.0.2',\n description='Python client library for Mailosaur',\n url='https://mailosaur.co...
python
chosen
[ { "from": "system", "value": "Remove dependence on sgapi (since we can use shotgun_api3 as well)\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n\n name='sgevents',\n version='0.1-dev',\n description='A simplifying Shotgun event daemon',\n ur...
python
chosen
[ { "from": "system", "value": "Make the package installable at the same time of its requirements.\n\n`python setup.py --version` now works even if sqlalchemy is not\ninstalled.\n" }, { "from": "human", "value": "from sqlalchemy_mptt import __version__\nfrom setuptools import setup\n\nsetup(\n ...
python
chosen
[ { "from": "system", "value": "Raise version for release due to font licensing issues resolution\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nimport sys, os\n\nhere = os.path.abspath(os.path.dirname(__file__))\ntry:\n README = open(os.path.join(here, 'README....
python
chosen
[ { "from": "system", "value": "RDL-4689: Add six to the requirements.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport re\n\nfrom setuptools import find_packages, setup\n\n\nwith open('py_mstr/__init__.py', 'rb') as f:\n version = str(re.search('__version__ = \"(.+?)\"', f.re...
python
chosen