conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix the issue where the mock is persisting calls\n"
},
{
"from": "human",
"value": "import mock\nimport github3\nimport unittest\n\nMockedSession = mock.create_autospec(github3.session.GitHubSession)\n\n\ndef build_url(self, *args, **kwargs):\n # We want to asser... | python | chosen |
[
{
"from": "system",
"value": "Replace legacy ipython import with jupyter_client"
},
{
"from": "human",
"value": "# Configuration file for Jupyter Hub\n\nc = get_config()\n\n# spawn with Docker\nc.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'\n\n# The docker instances need access to th... | python | chosen |
[
{
"from": "system",
"value": "Add recursive search to import function\n"
},
{
"from": "human",
"value": "import os\nimport imp\n\nmodules = {}\n\ndef load_modules(path=\"./modules/\"): # Consider adding recursive searching at some point in the future\n modules['juliet_module'] = imp.load_sour... | python | chosen |
[
{
"from": "system",
"value": "Fix for empty errorMessages, moved length check to main logic for deciding which error\nmessage to use and added check for 'errors' in the response."
},
{
"from": "human",
"value": "import json\n\n\nclass JIRAError(Exception):\n \"\"\"General error raised for all... | python | chosen |
[
{
"from": "system",
"value": "Increase the version number to `0.4.2`\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n__version_... | python | chosen |
[
{
"from": "system",
"value": "Update Python and Pykka version check error messages\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport sys\nimport warnings\nfrom distutils.version import StrictVersion as SV\n\nimport pykka\n\n\nif not (2, 7) <= sys.version_info <... | python | chosen |
[
{
"from": "system",
"value": "plugins.EuropaPlusTV: Fix for \"No connection adapters were found\"\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.plugin.api.util... | python | chosen |
[
{
"from": "system",
"value": "Update AUTH_TOKEN_CLASS setting default value\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom datetime import timedelta\n\nfrom django.conf import settings\nfrom rest_framework.settings import APISettings\n\nUSER_SETTINGS = getattr... | python | chosen |
[
{
"from": "system",
"value": "Add a property to access to the template\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport collections\n\nfrom reportlab.platypus import (\n PageBreak,\n FrameBreak,\n NextP... | python | chosen |
[
{
"from": "system",
"value": "Allow for calling our filters on objects that are None\n"
},
{
"from": "human",
"value": "from django import template\nregister = template.Library()\n\n# Don't really like using relative imports, but no choice here!\nfrom ..helpers import nice_repr, iso8601_repr, to... | python | chosen |
[
{
"from": "system",
"value": "Remove map and filter use\n"
},
{
"from": "human",
"value": "from operator import attrgetter, itemgetter\nfrom itertools import chain\n\nfrom ...utils.py3_hook import with_hook\n\nwith with_hook():\n from arcrest import Catalog\nimport numpy as np\n\n\ndef get_la... | python | chosen |
[
{
"from": "system",
"value": "Fix validation of news creation form\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.blueprints.news_admin.forms\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2017 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nimport r... | python | chosen |
[
{
"from": "system",
"value": "Rename alpha -> learning_rate and gamma -> discount_factor\n"
},
{
"from": "human",
"value": "from ..learner import Learner\nfrom ..policies import RandomPolicy\nfrom ..util import max_action_value\nfrom ..value_functions import TabularF\nfrom ...utils import check_... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add new core.config API functions to the pandas top level module\n"
},
{
"from": "human",
"value": "\n# pylint: disable=W0614,W0401,W0611\n\nimport numpy as np\n\nfrom pandas.core.algorithms import factorize, match, unique, value_counts\n\nfrom pandas.core.comm... | python | chosen |
[
{
"from": "system",
"value": "Fix bew 'No info available'\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n__author__ = 'nickl-'\n\nfrom aero.__version__ import __version__\nfrom .base import BaseAdapter\n\n\nclass Brew(BaseAdapter):\n \"\"\"\n Homebrew adapter.\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a noqa to init\n"
},
{
"from": "human",
"value": "\"\"\"\nPython support for Alexa applications.\n\nBecause like everything Amazon it involves a ton of tedious boilerplate.\n\"\"\"\n\nimport logging\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with conflated pmxbot.logging\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# vim:ts=4:sw=4:noexpandtab\n\nfrom __future__ import absolute_import\n\nimport socket\nimport logging\n\nfrom .dictlib import ConfigDict\n\nconfig = ConfigDict(\n\tb... | python | chosen |
[
{
"from": "system",
"value": "Bump the version number to 0.3-dev.\n"
},
{
"from": "human",
"value": "#\n# Project: retdec-python\n# Copyright: (c) 2015-2016 by Petr Zemek <s3rvac@gmail.com> and contributors\n# License: MIT, see the LICENSE file for more details\n#\n\n\"\"\"The main package o... | python | chosen |
[
{
"from": "system",
"value": "Add script to clean the message table\n"
},
{
"from": "human",
"value": "\ndef printSnapshot(doc):\n print(u'Created {} => {}'.format(doc.id, doc.to_dict()))\n\ndef queryUsers(db):\n users_ref = db.collection(u'users')\n docs = users_ref.get()\n docList = list()... | python | chosen |
[
{
"from": "system",
"value": "Add global imports for rules classes\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nDefine simple search patterns in bulk to perform advanced matching on any string\n\"\"\"\n\nfrom .rebulk import Rebulk\nfrom .match import... | python | chosen |
[
{
"from": "system",
"value": "Revert \"DE-1903 - fix isblank() error\"\n\nThis reverts commit 27fd096d9641971f34cb0811fc2240ebc4f3450b.\n"
},
{
"from": "human",
"value": "def isblank(value):\n return (\n value is not False\n and value != 0\n and value != float... | python | chosen |
[
{
"from": "system",
"value": "Fix \"AttributeError: 'TarFile' object has no attribute '__exit__'\" with Python 3.1.\n"
},
{
"from": "human",
"value": "import sys\nimport tarfile\nimport contextlib\n\ndef _tarfile_open_ex(*args, **kwargs):\n\t\"\"\"\n\tExtend result as a context manager.\n\t\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Add debug console root logging handler.\n"
},
{
"from": "human",
"value": "# Case Conductor is a Test Case Management system.\n# Copyright (C) 2011-2012 Mozilla\n#\n# This file is part of Case Conductor.\n#\n# Case Conductor is free software: you can redistribute it... | python | chosen |
[
{
"from": "system",
"value": "Fix key error due to lack of underscore\n"
},
{
"from": "human",
"value": "from gitlab_personalaccesstoken import generate_personal_access_token\nfrom terraform_external_data import terraform_external_data\n\nimport gitlab\n\n\n@terraform_external_data\ndef get_gitl... | python | chosen |
[
{
"from": "system",
"value": "Bump pyleus version to 0.1.4\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\n__version__ = '0.1.3'\n\nBASE_JAR = \"pyleus-base.jar\"\nBASE_JAR_INSTALL_DIR = \"share/pyleus\"\nBASE_JAR_PATH = os.path.join(sys.prefix, BASE_JAR_INSTALL_DIR, BASE_JAR)\n"
}... | python | chosen |
[
{
"from": "system",
"value": "Remove remnants of internal project naming in one docstring.\n\nPiperOrigin-RevId: 263530441\n"
},
{
"from": "human",
"value": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in... | python | chosen |
[
{
"from": "system",
"value": "Fix Network model name; better import\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nfrom helpers import models as helpermodels\n\n\n# Create your models here.\nclass Networks(models.Model):\n POLICIES = (\n ('reject', 'Reject'),\... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong path composition for data directory\n\n"
},
{
"from": "human",
"value": "import os\nimport time\n\nfrom dj_experiment.tasks.tasks import longtime_add, netcdf_save\nfrom example.settings import (DJ_EXPERIMENT_BASE_DATA_DIR,\n DJ... | python | chosen |
[
{
"from": "system",
"value": "Add a fancy log mode.\n"
},
{
"from": "human",
"value": "# logger module\n\nfrom datetime import datetime\nimport os\n\nlogfile = None\nlogbuf = []\n\ndef init(analysis_path):\n global logfile\n if not os.path.isdir(analysis_path):\n log(\"logger: analy... | python | chosen |
[
{
"from": "system",
"value": "Tag release script now works with semvers.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\n\ndef main():\n if len(sys.argv) != 2:\n print('Usage: %s version' % sys.argv[0])\n os.system('git tag | sort -n | tail -... | python | chosen |
[
{
"from": "system",
"value": "Test EchoServer now uses AsyncServer and deflate extensions\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport logging\nfrom os.path import abspath, dirname\n\nbasepath = abspath(dirname(abspath(__file__)) + '/..')\nsys.path.insert(0, basep... | python | chosen |
[
{
"from": "system",
"value": "Add Request/Response import points for pylons.\n\n--HG--\nbranch : trunk\n"
},
{
"from": "human",
"value": "\"\"\"Base objects to be exported for use in Controllers\"\"\"\n# Import pkg_resources first so namespace handling is properly done so the\n# paste imports wo... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong URL to Python logging lib documentation\n"
},
{
"from": "human",
"value": "\"\"\"Module with specification of all supported command line arguments.\"\"\"\n\nimport argparse\n\ncli_parser = argparse.ArgumentParser()\n\ncli_parser.add_argument('--log-level',... | python | chosen |
[
{
"from": "system",
"value": "Add regression test for MarathonResource\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nfrom marathon.models.base import MarathonObject\nimport unittest\n\n\nclass MarathonObjectTest(unittest.TestCase):\n\n def test_hashable(self):\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix ordering of parameters to save\n"
},
{
"from": "human",
"value": "import sys\nimport numpy as np\n\ndef read_phi(flname, n_steps, n_loci):\n\tsampled_phis = np.zeros((n_steps, n_loci))\n\tfl = open(flname)\n\tcurrent_iter_idx = 0 # index used for storage\n\tlast... | python | chosen |
[
{
"from": "system",
"value": "Fix seeding in management command\n"
},
{
"from": "human",
"value": "# Django\nfrom django.core.management.base import BaseCommand\n\n\nfrom api.factories import (\n InternationalFactory,\n)\n\n\nclass Command(BaseCommand):\n help = \"Command to seed database.... | python | chosen |
[
{
"from": "system",
"value": "Add unit tests for solute and species names\n"
},
{
"from": "human",
"value": "from nose.tools import *\nfrom analyse_idynomics import *\n\nclass TestAnalyseiDynomics:\n def setUp(self):\n self.directory = 'test_data'\n self.analysis = AnalyseiDynom... | python | chosen |
[
{
"from": "system",
"value": "Fix bug setting the key='elb', subkey='name' attribute.\n"
},
{
"from": "human",
"value": "from clusto.drivers.devices.appliance.basicappliance import BasicAppliance\nimport boto.ec2.elb\n\nclass AmazonELB(BasicAppliance):\n _driver_name = 'amazonelb'\n\n def ... | python | chosen |
[
{
"from": "system",
"value": "Remove geolocation test for now\n\nGeolocation doesn't always work, and since location is the one\nabsolutely required parameter to get anything useful out of vane,\nthere's no way to gracefully fall back. I'm going to leave the test\nout until I have time to write a proper one... | python | chosen |
[
{
"from": "system",
"value": "Revert \"fix: NpzPckLoader meddle one-element array\"\n\nThis reverts commit b3bf178ed07d789282a05fa4efac799c9e0c5910.\n\nNpzPckLoader:\n * 1 vs array(1)\n * 'a' vs array('a', dtype='<U1')\n\nNpzPckSaver np.asanyarray:\n * 1 vs np.void(pickle.dumps('1'))\n * 'a' vs np.void(pick... | python | chosen |
[
{
"from": "system",
"value": "Set logging level to DEBUG\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.mongoengine import MongoEngine\n\nimport logging\n\n# Start a flask application context.\napp = Flask(__name__)\n\n# Load configuration from file.\napp.config.from_... | python | chosen |
[
{
"from": "system",
"value": "Use more generic values for version\n"
},
{
"from": "human",
"value": "#!/bin/env python\n\nimport blank_template\nimport json\nimport os\nimport subprocess\nimport sys\nimport tarfile\n\nif __name__ == '__main__':\n\n # Load template\n fname = sys.argv[1]\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix missing table name in alter_table\n"
},
{
"from": "human",
"value": "\"\"\"id(pirmary key) for torsion_init_mol\n\nRevision ID: 1604623c481a\nRevises: fb5bd88ae2f3\nCreate Date: 2020-07-02 18:42:17.267792\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as s... | python | chosen |
[
{
"from": "system",
"value": "Remove used of xrange to support python 3\n"
},
{
"from": "human",
"value": "from kafka.tools.assigner.exceptions import ProgrammingException\n\n\ndef split_partitions_into_batches(partitions, batch_size=10, use_class=None):\n # Currently, this is a very simplist... | python | chosen |
[
{
"from": "system",
"value": "Remove what's already done in KolibriTestBase\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for `kolibri` module.\n\"\"\"\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nimport logging\nimport os\nimport shutil\nimport tempfile\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Update IVS per 2021-04-15 changes\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012-2021, 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# Resource specificat... | python | chosen |
[
{
"from": "system",
"value": "Add to current count if there is a match\n"
},
{
"from": "human",
"value": "# Compress string using counts of repeated characters\n\ndef compress_str(str):\n\toutput = \"\"\n\tcurr_char = \"\"\n\tchar_count = \"\"\n\n\tfor i in str:\n\n\t\tif curr_char != str[i]:\n\... | python | chosen |
[
{
"from": "system",
"value": "[Discord] Remove no longer used custom Missing Permissions error\n\n"
},
{
"from": "human",
"value": "\nfrom discord.ext.commands.errors import CommandError\n\nclass NotServerOwner(CommandError):\n\t'''Not Server Owner'''\n\tpass\n\nclass VoiceNotConnected(CommandEr... | python | chosen |
[
{
"from": "system",
"value": "Fix an issue with the child-task selector.\n"
},
{
"from": "human",
"value": "import logging\nfrom tukio import Workflow\nfrom tukio.task import register\nfrom tukio.task.holder import TaskHolder\n\nfrom nyuki.utils.evaluate import ConditionBlock\nfrom nyuki.workflo... | python | chosen |
[
{
"from": "system",
"value": "Add test for chain-JSON equality\n"
},
{
"from": "human",
"value": "import random\nimport markovify\nimport sys, os\n\nHERE = os.path.dirname(os.path.realpath(__file__))\nwith open(os.path.join(HERE, \"texts/sherlock.txt\")) as f:\n sherlock = f.read()\n\ndef tes... | python | chosen |
[
{
"from": "system",
"value": "dblog: Allow event saving by id\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom logging import Handler\nfrom datetime import datetime \n\nclass DBLogHandler(Handler, object):\n def __init__(self):\n super(DBLogHandler, self).__init__()\n... | python | chosen |
[
{
"from": "system",
"value": "Fix regression in path handling of TenantStaticFileStorage.\n\nFixes #197.\n"
},
{
"from": "human",
"value": "import os\nfrom django.contrib.staticfiles.storage import StaticFilesStorage\nfrom django_tenants.files.storages import TenantStorageMixin\nfrom django.conf... | python | chosen |
[
{
"from": "system",
"value": "Allow for custom image models, 404 on image not found intead of error\n"
},
{
"from": "human",
"value": "from django.http import HttpResponse\nfrom wagtail.wagtailimages.models import Filter, Image\n\n\ndef get_full_image_url(request, image_id):\n image = Image.o... | python | chosen |
[
{
"from": "system",
"value": "Fix country ISO code for US"
},
{
"from": "human",
"value": "import pytest\nfrom mock import Mock\n\nfrom saleor.core.utils import (\n Country, get_country_by_ip, get_currency_for_country)\n\n\n@pytest.mark.parametrize('ip_data, expected_country', [\n ({'count... | python | chosen |
[
{
"from": "system",
"value": "test: Update test after adding cleaning of dist\n"
},
{
"from": "human",
"value": "from unittest import TestCase\n\nfrom semantic_release.pypi import upload_to_pypi\n\nfrom . import mock\n\n\nclass PypiTests(TestCase):\n @mock.patch('semantic_release.pypi.run')\n... | python | chosen |
[
{
"from": "system",
"value": "Test util - unicode removal\n"
},
{
"from": "human",
"value": "# Copyright 2015 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 obtain a copy of the Licens... | python | chosen |
[
{
"from": "system",
"value": "Make the script recuperate the correct method\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport argparse\n\nif __name__ == '__main__':\n # Argument parsing\n parser = argparse.ArgumentParser()\n parser.add_argument(\"metric\", help=\"the desi... | python | chosen |
[
{
"from": "system",
"value": "Add support for ELB to ALLOWED_HOSTS\n"
},
{
"from": "human",
"value": "from config.base.settings import *\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\nROOT_URLCONF = 'config.prod.urls'\nWSGI_APPLICATION = \"config.prod.wsgi.application\"\n\nALLOWED_HOSTS = [\n '174... | python | chosen |
[
{
"from": "system",
"value": "Add input file and converter abstraction\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python \n\nimport argparse\n\n\ndef parsed_command_line():\n \"\"\"Returns an object that results from parsing the command-line for this program argparse.ArgumentParser(...... | python | chosen |
[
{
"from": "system",
"value": "Move the render_index() function out of the constructor and use add_url_rule() instead of the route() decorator to connect it to Flask.\n"
},
{
"from": "human",
"value": "\"\"\"Analysis module for Databench.\"\"\"\n\nfrom flask import Blueprint, render_template\n\ni... | python | chosen |
[
{
"from": "system",
"value": "Check for strip attr for none values\n"
},
{
"from": "human",
"value": "from django import forms\n\n\nclass BugReportForm(forms.Form):\n\n bug = forms.CharField(label=\"Bug (required)\", required=True)\n description = forms.CharField(\n label=\"Descript... | python | chosen |
[
{
"from": "system",
"value": "FIX: Use a NullHandler for all 'traits' loggers per best practice for logging.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n__version__ = '4.3.0'\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import\n\n_... | python | chosen |
[
{
"from": "system",
"value": "Make it possible to run dev server on my desktop.\n\nWhile I'm accessing a suitable database remotely, I don't have enough\nstuff installed locally to have OSMGeoAdmin (no GDAL installed, for\nexample).\n"
},
{
"from": "human",
"value": "from django.contrib.gis impo... | python | chosen |
[
{
"from": "system",
"value": "Add custom arguments for InvalidParameterError\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\n\n\nclass NetworkInterfaceNotFoundError(... | python | chosen |
[
{
"from": "system",
"value": "Add to doc string: time complexity\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef insertion_sort(a_list):\n \"\"\"Insertion Sort algortihm.\"\"\"\n for ... | python | chosen |
[
{
"from": "system",
"value": "Add harvester response model in django ORM\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom django_pgjson.fields import JsonField\n\n\nclass Document(models.Model):\n source = models.CharField(max_length=100)\n docID = models.CharField(m... | python | chosen |
[
{
"from": "system",
"value": "Fix variable name in get_language tag\n"
},
{
"from": "human",
"value": "\"\"\"Gallery templatetags\"\"\"\nfrom django.template import Library\nfrom django.core.exceptions import ObjectDoesNotExist\n\nregister = Library()\n\n\n@register.filter(name='divide')\ndef di... | python | chosen |
[
{
"from": "system",
"value": "Add test for the transpose function.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom libpals.util import (\n xor_find_singlechar_key,\n hamming_distance,\n fixed_xor\n)\n\ndef test_xor_find_singlechar_key():\n input = '1b37373331363f781... | python | chosen |
[
{
"from": "system",
"value": "Support HTML5's input type 'tel'\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.forms.fields import CharField\nfrom django.core.exceptions ... | python | chosen |
[
{
"from": "system",
"value": "Use 'with' instead of lock.acquire/release()\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim:fileencoding=utf-8:noet\n\nfrom powerline import Powerline\nfrom powerline.lib.monotonic import monotonic\n\nimport sys\nimport time\nimport i3\nfrom threadi... | python | chosen |
[
{
"from": "system",
"value": "Use sys.executable when executing nbgrader\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nfrom .. import run_nbgrader, run_command\nfrom .base import BaseTestApp\n\n\nclass TestNbGrader(BaseTestApp):\n\n def test_help(self):\n \"\"\"Does the h... | python | chosen |
[
{
"from": "system",
"value": "Add functionality to get latest tviits\n"
},
{
"from": "human",
"value": "from django.http import HttpResponse, HttpResponseRedirect\nfrom django.views.generic import View\nfrom django.utils.decorators import method_decorator\nfrom django.template import RequestCont... | python | chosen |
[
{
"from": "system",
"value": "Use Setext strategy in GitHub built in Collector\n"
},
{
"from": "human",
"value": "\"\"\"\nFile that initializes a Collector object designed for GitHub style markdown\nfiles.\n\"\"\"\n\nfrom anchorhub.collector import Collector\nfrom anchorhub.builtin.github.cstrat... | python | chosen |
[
{
"from": "system",
"value": "Kill running Skia processes in ChromeOS Install step\n\n(RunBuilders:Test-ChromeOS-Alex-GMA3150-x86-Debug,Test-ChromeOS-Alex-GMA3150-x86-Release,Perf-ChromeOS-Alex-GMA3150-x86-Release)\n\nR=rmistry@google.com\n\nReview URL: https://codereview.chromium.org/17599009\n\ngit-svn-id... | python | chosen |
[
{
"from": "system",
"value": "Update the default language for the media generator\n"
},
{
"from": "human",
"value": "import MySQLdb as mysql\nfrom faker import Factory\n\n# Open database connection\ndb = mysql.connect('localhost', 'root', 'rojak', 'rojak_database')\n\n# Create new db cursor\ncur... | python | chosen |
[
{
"from": "system",
"value": "Remove uniqueness constraint from page_scoped_id\n"
},
{
"from": "human",
"value": "from sqlalchemy import Column, BIGINT, String, Integer\n\nfrom meetup_facebook_bot.models.base import Base\n\n\nclass Speaker(Base):\n __tablename__ = 'speakers'\n id = Column(... | python | chosen |
[
{
"from": "system",
"value": "Set max_len default to 200 when making glue datasets\n"
},
{
"from": "human",
"value": "import argparse\nimport os\n\nimport dill\n\nfrom metal.mmtl.glue.glue_datasets import get_glue_dataset\n\n\ndef make_datasets(task, bert_version):\n datasets = {}\n for sp... | python | chosen |
[
{
"from": "system",
"value": "Add date_created and date_updated to editos.Edito model\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom geelweb.django.editos import settings\n\nclass Edito(models.Model):\n title = models.CharField(max_length=100)\n link = models.URLFiel... | python | chosen |
[
{
"from": "system",
"value": "Move QR Code cache to /tmp\n"
},
{
"from": "human",
"value": "from hashlib import sha1\n\nfrom django.conf import settings\n\nimport qrcode as qr\nfrom django_jinja import library\nfrom jinja2 import Markup\nfrom qrcode.image.svg import SvgPathImage\n\n\nQR_CACHE_PA... | python | chosen |
[
{
"from": "system",
"value": "Fix use of deprecated Exception.message in Python 3\n"
},
{
"from": "human",
"value": "from Crypto.PublicKey import RSA\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCommand):\n help = 'Randomly ge... | python | chosen |
[
{
"from": "system",
"value": "Fix `weather_helper` bug when creating new scenario\n"
},
{
"from": "human",
"value": "\n\n\nfrom flask import current_app\n\nimport cea.config\nimport cea.inputlocator\n\n\ndef deconstruct_parameters(p):\n params = {'name': p.name, 'type': p.typename,\n ... | python | chosen |
[
{
"from": "system",
"value": "model_row: Handle methods and non-field attributes\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.db import models\nfrom django.utils.safestring import mark_safe\n\n\nregister = template.Library()\n\n\n@register.filter\ndef model_row(ins... | python | chosen |
[
{
"from": "system",
"value": "Add missing env keyword arg.\n"
},
{
"from": "human",
"value": "from funcy.seqs import partition\n\nfrom eche.eche_types import Symbol, List\n\n\ndef def_exclamation_mark(ast):\n from eche.eval import eval_ast\n\n _, key, val = ast\n l = List()\n l.appen... | python | chosen |
[
{
"from": "system",
"value": "Ch03: Declare Meta class in Post model. [skip ci]\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom organizer.models import Startup, Tag\n\n\n# Model Field Reference\n# https://docs.djangoproject.com/en/1.8/ref/models/fields/\n\n\nclass Post(mo... | python | chosen |
[
{
"from": "system",
"value": "Handle exception generated by timezone naive datetime objects.\n"
},
{
"from": "human",
"value": "from django.utils import timezone\nfrom rest_framework.renderers import JSONRenderer\nfrom rest_framework.utils import encoders\nimport datetime\nimport warnings\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Test that attrs are passed to 'mesh' DataArray\n"
},
{
"from": "human",
"value": "\"\"\"Unit tests for the pymt.framwork.bmi_ugrid module.\"\"\"\nimport xarray as xr\n\nfrom pymt.framework.bmi_ugrid import Scalar, Vector\nfrom pymt.framework.bmi_bridge import _BmiCa... | python | chosen |
[
{
"from": "system",
"value": "Update database settings in home server\n"
},
{
"from": "human",
"value": "from .base import *\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES = {\n 'default': {\n #'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' ... | python | chosen |
[
{
"from": "system",
"value": "Add supposedly unused imports back again\n"
},
{
"from": "human",
"value": "\"\"\"\nThis package implements a wxPython shell, based on PyShell,\nwhich controls a seperate Python process, creating with the\n`multiprocessing` package.\n\nHere is the canonical way to u... | python | chosen |
[
{
"from": "system",
"value": "Insert filename only, not path\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom downstream_node.config import config\nfrom downstream_node.models import Challenges, Files\n\nfrom heartbeat import Heartbeat\nfrom downstream_no... | python | chosen |
[
{
"from": "system",
"value": "Increment item count in news import mgmt command\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\n\nfrom wagtail.wagtailcore.models import Page\n\nfrom akllt.dataimport.news import import_news\nfrom akllt.models import NewsStor... | python | chosen |
[
{
"from": "system",
"value": "Use ListCreateAPIView as base class to support bookmark creation\n"
},
{
"from": "human",
"value": "from django.db.models import Q\nfrom django.shortcuts import render\nfrom rest_framework.filters import OrderingFilter, SearchFilter\nfrom rest_framework.generics imp... | python | chosen |
[
{
"from": "system",
"value": "Update exception handling syntax for python 3 compatibility.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\n\ntry:\n from faker import Factory as FakerFactory\nexcept ImportError, error:\n ... | python | chosen |
[
{
"from": "system",
"value": "Make sure all React pages have a CSRF token in session\n\nFixes GH-2419\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django.http import HttpResponse\nfrom django.template import loader, Context\n\nfrom sentry.web.frontend.base im... | python | chosen |
[
{
"from": "system",
"value": "Change name: logged_in => check_online\n"
},
{
"from": "human",
"value": "import subprocess\nimport requests\n\ndef logged_in():\n \"\"\"Check whether the device has logged in.\n Return a dictionary containing:\n username\n byte\n duration... | python | chosen |
[
{
"from": "system",
"value": "Remove spaces from version string."
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n# Copyright © 2012-2013 by its contributors. See AUTHORS for details.\n#\n# Distributed under the MIT/X11 software license, see the accompanying\... | python | chosen |
[
{
"from": "system",
"value": "Remove unneeded debug cod\ne\n"
},
{
"from": "human",
"value": "\"\"\"Provide a class to load and parse the help file and \nProvide a simple interface for retrieving help entries\"\"\"\n\nimport json\nimport os\n\n\nclass HelpManager(object):\n _help_dict = {}\n ... | python | chosen |
[
{
"from": "system",
"value": "Clean up names and comments for consistency\n"
},
{
"from": "human",
"value": "# pylint: disable=wildcard-import,unused-wildcard-import,missing-docstring\n\nfrom __future__ import absolute_import\n\nfrom unittest import TestCase\n\nfrom nose.tools import *\nfrom moc... | python | chosen |
[
{
"from": "system",
"value": "Add required default value before downgrade migration\n"
},
{
"from": "human",
"value": "\"\"\"\ncolumn 'instances' will be deleted later. Has to be nullable for transition\n\nRevision ID: 266658781c00\nRevises: 204aae05372a\nCreate Date: 2019-04-15 16:27:22.362244\... | python | chosen |
[
{
"from": "system",
"value": "Return str(self) instead of self.\n"
},
{
"from": "human",
"value": "#\n# Copyright 2008 Andi Albrecht <albrecht.andi@gmail.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Licens... | python | chosen |
[
{
"from": "system",
"value": "Add fakery so \"from asyncio import selectors\" always works.\n"
},
{
"from": "human",
"value": "\"\"\"The asyncio package, tracking PEP 3156.\"\"\"\n\nimport sys\n\n# This relies on each of the submodules having an __all__ variable.\nfrom .futures import *\nfrom .e... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.