conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove output_dir fixture from test\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_create_template\n--------------------\n\"\"\"\n\n\nimport os\nimport pytest\nimport subprocess\n\n\n@pytest.fixture\ndef output_dir(tmpdir):\n return st... | python | chosen |
[
{
"from": "system",
"value": "Increase the resolution to 1024x768.\n\nThis will make it easier to see things like the house. 800x600 is just\ntoo small.\n"
},
{
"from": "human",
"value": "import pygame\nfrom pygame.locals import *\n\n\nfrom thecure.engine import TheCureEngine\n\n\ndef main():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add test to Path compare."
},
{
"from": "human",
"value": "from farmfs.fs import normpath as _normalize\nfrom farmfs.fs import userPath2Path as up2p\nfrom farmfs.fs import Path\n\ndef test_normalize_abs():\n assert _normalize(\"/\") == \"/\"\n assert _normal... | python | chosen |
[
{
"from": "system",
"value": "Add decorator to send_mail function to celery taskify.\n"
},
{
"from": "human",
"value": "from django.core.mail.message import EmailMultiAlternatives\nfrom django.template.loader import get_template\n\nfrom project.settings import EMAIL_FROM_ADDRESS, BASE_URL\n\n\n#... | python | chosen |
[
{
"from": "system",
"value": "Fix a weird situation when a function run in a thread raises StopIteration, which was erroneusly interpreted that the thread returned None.\n"
},
{
"from": "human",
"value": "from __future__ import with_statement\nimport threado\nimport threading\nimport Queue\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Fix return code when running unittests.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Test runner for sqlparse.\"\"\"\n\nimport optparse\nimport os\nimport sys\nimport unittest\n\ntest_mod = os.path.abspath(os.path.join(o... | python | chosen |
[
{
"from": "system",
"value": "Fix unit test for util.py\n"
},
{
"from": "human",
"value": "import util\n\nfrom nose.tools import assert_equal\n\n\nclass TestPick():\n def check(self, filenames, expected, k, randomized):\n result = util.pick(filenames, k, randomized)\n assert_equ... | python | chosen |
[
{
"from": "system",
"value": "Change tags to kwarg in full text record\n\nThis change will allow us to set the tags value with kwargs that are set\nin custom attribute values.\n"
},
{
"from": "human",
"value": "# Copyright (C) 2016 Google Inc.\n# Licensed under http://www.apache.org/licenses/LIC... | python | chosen |
[
{
"from": "system",
"value": "Rename test as it really is a full integration test.\n"
},
{
"from": "human",
"value": "import unittest\nfrom django.test import SimpleTestCase\n\n\nclass BasicTest(SimpleTestCase):\n\n def test_success(self):\n self.assertEqual(1 + 1, 2)\n\n def test_e... | python | chosen |
[
{
"from": "system",
"value": "Fix getattr() takes no keyword arguments\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib import admin\nfrom django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin\nfrom django.contrib.flatpages.models import FlatPa... | python | chosen |
[
{
"from": "system",
"value": "[AC-7594] Make changes to the migration file\n"
},
{
"from": "human",
"value": "# Generated by Django 2.2.10 on 2020-04-09 21:24\n\nfrom django.db import migrations\n\n\ndef add_deferred_user_role(apps, schema_editor):\n DEFERRED_MENTOR = 'Deferred Mentor'\n U... | python | chosen |
[
{
"from": "system",
"value": "Add debian-squeeze support for os detection.\n"
},
{
"from": "human",
"value": "from fabric.api import run, quiet\nfrom braid import succeeds, cacheInEnvironment\n\n@cacheInEnvironment\ndef distroName():\n \"\"\"\n Get the name of the distro.\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Print all evaluation metrics associated with the model\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport argparse\nimport pickle\nimport tensorflow.keras as keras\nimport numpy as np\nimport sys\nimport cv2\n\nparser = argparse.ArgumentParser(descr... | python | chosen |
[
{
"from": "system",
"value": "Verify that recent list is cleared when language is changed\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nimport nose.tools as nose\nimport yv_suggest.set_pref as yvs\nimport context_man... | python | chosen |
[
{
"from": "system",
"value": "[FIX] Remove unneeded and inefficient \"store=True\"\n"
},
{
"from": "human",
"value": "# Copyright 2017 ACSONE SA/NV\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\nfrom odoo import fields, models\n\n\nclass AccountMoveLine(models.Model):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add support for further processing of the payment while maintaining compatibility\n"
},
{
"from": "human",
"value": "# Create your views here.\n\nfrom django.core.urlresolvers import reverse_lazy\nfrom django.contrib.auth.decorators import login_required\nfrom djang... | python | chosen |
[
{
"from": "system",
"value": "Add chainer to required packages\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup\n\nsetup(\n name='chainer-cuda-deps',\n version='1.0.0',\n description='Install dependent packages to use Chainer on CUDA',\n author='... | python | chosen |
[
{
"from": "system",
"value": "Fix passing keyword arg to task\n"
},
{
"from": "human",
"value": "from django.core.management import BaseCommand\n\nfrom custom.onse.tasks import update_facility_cases_from_dhis2_data_elements\n\n\nclass Command(BaseCommand):\n help = ('Update facility_supervisi... | python | chosen |
[
{
"from": "system",
"value": "Remove date field (insert and update)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom datetime import datetime\n\n\n\nclass PublisherMnager(models.Manager):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use requestcontext in error views.\n"
},
{
"from": "human",
"value": "from django.http import HttpResponse, HttpResponseServerError\nfrom django.template import Context, loader\nfrom django.conf import settings\n\nimport logging\nlogger = logging.getLogger('comrade.... | python | chosen |
[
{
"from": "system",
"value": "Move roles menu item into a submenu\n\n- 'organization' for conferences\n- 'advanced' for other event types\n"
},
{
"from": "human",
"value": "# This file is part of Indico.\n# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).\n#\n# Indico... | python | chosen |
[
{
"from": "system",
"value": "Set _version requirement for annotation\n"
},
{
"from": "human",
"value": "\nfrom tornado.web import Finish\n\nfrom biothings.web.api.es.handlers.base_handler import ESRequestHandler\n\n\nclass BiothingHandler(ESRequestHandler):\n '''\n Handle requests to the ... | python | chosen |
[
{
"from": "system",
"value": "Break test flow into logical subsets [WAL-615]\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom nodeconductor.structure.tests import factories\n\n\nclass ServiceProjectLinkTest(TestCase):\n\n def setUp(self):\n self.link = factor... | python | chosen |
[
{
"from": "system",
"value": "Remove exceptional namespaces from test\n"
},
{
"from": "human",
"value": "import os\nimport csv\nfrom indra.statements.validate import validate_db_refs, validate_ns\nfrom indra.preassembler.grounding_mapper import default_grounding_map\nfrom indra.preassembler.grou... | python | chosen |
[
{
"from": "system",
"value": "Make EtlClass attribute access more robust\n"
},
{
"from": "human",
"value": "\"\"\"Base EtlClass that all EtlClasses should inherit\"\"\"\n\nclass EtlClass(object):\n\n def __init__(self, config):\n\n self.config = config\n\n def __setattr__(self, key,... | python | chosen |
[
{
"from": "system",
"value": "Move setting VCAP_SERVICES out of fixture\n\nThis was inconsistent with the source data for the fixture being\noveridden in some of the tests. We only need to set it in the env\nonce, so it makes sense to just put the code there.\n"
},
{
"from": "human",
"value": "i... | python | chosen |
[
{
"from": "system",
"value": "Allow RedirectMixin to work within flask-admin\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\" Module provides mixins for issuing HTTP Status codes using the\nFlask ``View``.\n\"\"\"\n\nfrom flask import url_for\nfrom flask.views import View\nfr... | python | chosen |
[
{
"from": "system",
"value": "Use low quality audio (sounds good enough)\n"
},
{
"from": "human",
"value": "import sha\nimport os\n\n\ndef sha_hash(content):\n return sha.new(content).hexdigest()\n\n\ndef download_audio(url):\n from subprocess import call\n\n retcode = call([\"youtube-d... | python | chosen |
[
{
"from": "system",
"value": "Use request.path if no path was passed to the default view\n"
},
{
"from": "human",
"value": "from django.http import HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\n\nfrom feincms.models import Page... | python | chosen |
[
{
"from": "system",
"value": "Add main() for draw_net unittest, fix import errors\n"
},
{
"from": "human",
"value": "import os\nimport unittest\n\nfrom google import protobuf\n\nimport caffe.draw\nfrom caffe.proto import caffe_pb2\n\ndef getFilenames():\n \"\"\"Yields files in the source tree... | python | chosen |
[
{
"from": "system",
"value": "Fix assignment of database url\n"
},
{
"from": "human",
"value": "\"\"\"Create a connection to the database.\"\"\"\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker, scoped_session\nfrom sqlalchemy.ext.declarative import declarative_ba... | python | chosen |
[
{
"from": "system",
"value": "Allow access to state.output via API.\n"
},
{
"from": "human",
"value": "\"\"\"\nNon-init module for doing convenient * imports from.\n\nNecessary because if we did this in __init__, one would be unable to import\nanything else inside the package -- like, say, the v... | python | chosen |
[
{
"from": "system",
"value": "Fix a runtime error when direct_passthrough is used.\n"
},
{
"from": "human",
"value": "import gzip\nimport StringIO\nfrom flask import request\n\n\nclass Gzip(object):\n def __init__(self, app, compress_level=6, minimum_size=500):\n self.app = app\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a feed_storage and feed_cache to our Globals object.\n"
},
{
"from": "human",
"value": "\"\"\"The application's Globals object\"\"\"\n\nfrom app_factory import AppFactoryDict\n\nclass Globals(object):\n \"\"\"Globals acts as a container for objects available ... | python | chosen |
[
{
"from": "system",
"value": "Update gunicorn timeout after gunicorn issue was answered.\n"
},
{
"from": "human",
"value": "# This file contains gunicorn configuration setttings, as described at\n# http://docs.gunicorn.org/en/latest/settings.html\n# The file is loaded via the -c ichnaea.gunicorn... | python | chosen |
[
{
"from": "system",
"value": "Fix no module 'new', replaced new.instancemethod with types.MethodType\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n"
},
{
"from": "human",
"value": "\"\"\"\nSome extra picklers needed to gracefully dump and load a canvas.\n\"\"\"\n... | python | chosen |
[
{
"from": "system",
"value": "Fix test broken by change in message capitalization\n\nGitOrigin-RevId: 48f81146490e925712005aa91064e56670abfbda"
},
{
"from": "human",
"value": "<error descr=\"starred assignment target must be in a list or tuple\">*hi</error> = [1, 2]\n*a, = range(5)\nfor a, *b in... | python | chosen |
[
{
"from": "system",
"value": "fix: Correct padding on array aggregations\n\nThis was incorrectly building padding based on a single row.\n"
},
{
"from": "human",
"value": "import re\n\nfrom sqlalchemy.sql import func\nfrom sqlalchemy.types import String, TypeDecorator\n\n# https://bitbucket.org/... | python | chosen |
[
{
"from": "system",
"value": "Revert \"[FIX] website: add missing module dependency `base_setup`\"\n\nThis reverts commit d269eb0eb62d88e02c4fa33b84178d0e73d82ef1.\nThe issue has been fixed in 61f2c90d507645492e1904c1005e8da6253788ea.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\... | python | chosen |
[
{
"from": "system",
"value": "Make RequestHandler's code less redundant.\n"
},
{
"from": "human",
"value": "\"\"\"Request handler of the module.\"\"\"\n\nimport ppp_datamodel\nfrom ppp_datamodel import Sentence\nfrom ppp_datamodel.communication import TraceItem, Response\nfrom ppp_nlp_ml_standal... | python | chosen |
[
{
"from": "system",
"value": "Add page size for sql query\n"
},
{
"from": "human",
"value": "CONFIG = {\n 'database': './ida_info.sqlite3',\n 'out_dir': './code_gen/',\n 'verbose': False\n}\n"
},
{
"from": "gpt",
"value": "CONFIG = {\n 'database': './ida_info.sqlite3',\n ... | python | chosen |
[
{
"from": "system",
"value": "Drop test ch. 6 since sympy is not in travis-ci\n"
},
{
"from": "human",
"value": "\"\"\"Unit tests for documentation\"\"\"\n\nimport unittest\nfrom sciunit.utils import NotebookTools\n\n\nclass DocumentationTestCase(NotebookTools, unittest.TestCase):\n \"\"\"Uni... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Dont error if 0063 index was already cleaned up\"\n\nThis reverts commit b3a51fa482fc949de75d962ddd9fe3464fa70e58.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom dja... | python | chosen |
[
{
"from": "system",
"value": "Allow re-use of a port a la SO_REUSEADDRESS\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\"\"\"\nSimple TCP server that sends back the IP address and port from which it \nsees you connect. Useful when used with `telnet` for network debugging.\nCurrently onl... | python | chosen |
[
{
"from": "system",
"value": "Add example of supervisor event and member join\n"
},
{
"from": "human",
"value": "from base_handler import BaseHandler\nfrom utils import truncated_stdout, with_payload\n\n\nclass MyHandler(BaseHandler):\n\n @truncated_stdout\n @with_payload\n def hello(se... | python | chosen |
[
{
"from": "system",
"value": "Disable min_priority filter for now\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport board\nimport pente_exceptions\n\nfrom ab_state import *\n\nCAPTURE_SCORE_BASE = 120 ** 3\n\nclass ABGame():\n \"\"\" This class acts as a bridge between the AlphaB... | python | chosen |
[
{
"from": "system",
"value": "Add django.setup to the AppConfig\n"
},
{
"from": "human",
"value": "from django.apps import AppConfig\n\n\nclass BitFieldAppConfig(AppConfig):\n name = 'bitfield'\n verbose_name = \"Bit Field\"\n"
},
{
"from": "gpt",
"value": "import django\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add mock response to sharpspring test\n"
},
{
"from": "human",
"value": "from unittest.mock import patch\n\nfrom pmg.sharpspring import Sharpspring\nfrom tests import PMGTestCase\n\n\nclass TestSharpspring(PMGTestCase):\n @patch(\"pmg.sharpspring.requests.post\")... | python | chosen |
[
{
"from": "system",
"value": "Update Python/Django: Restore admin.autodiscover() for Django 1.6 compatibility\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\nfrom django.contrib import admin\n\n\nurlpatterns = [\n url(r'^admin/', include(admin.site.urls)),\n u... | python | chosen |
[
{
"from": "system",
"value": "Allow users to be created with blank (unusable) passwords.\n"
},
{
"from": "human",
"value": "import bcrypt\nfrom django.contrib.auth.models import User\nfrom django.conf import settings\n\n\ntry:\n rounds = settings.BCRYPT_ROUNDS\nexcept AttributeError:\n rou... | python | chosen |
[
{
"from": "system",
"value": "Fix new i18n utils imports.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom .i18n import (get_language_name,\n get_language,\n get_fallback_language,\n build_localized_field_name,\n ... | python | chosen |
[
{
"from": "system",
"value": "Edit dedupe campus slugs code\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom django.db.models import Count\nfrom django.utils.text import slugify\n\nfrom scuole.campuses.models import Campus\n\nclass Command(BaseCommand)... | python | chosen |
[
{
"from": "system",
"value": "Load Nova Client only once to avoid reconnecting\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 may obtain\n# a copy of the Licen... | python | chosen |
[
{
"from": "system",
"value": "Remove 'field' and 'icon' from column list\n"
},
{
"from": "human",
"value": "from Products.CMFCore.utils import getToolByName\nfrom Products.bika import logger\nfrom Products.bika.browser.bika_folder_contents import BikaFolderContentsView\nfrom plone.app.content.br... | python | chosen |
[
{
"from": "system",
"value": "Add __str__ method to pretty print the Booking model.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.contrib.auth.models import User\nfrom django.db import models\n\n\nclass WhitelistedUsername(models.Model):\n # TODO: c... | python | chosen |
[
{
"from": "system",
"value": "Check config if not null in migrations\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.10 on 2018-03-07 08:24\nfrom __future__ import unicode_literals\n\nimport json\nfrom django.db import migrations\n\n\nclass Migration(migrat... | python | chosen |
[
{
"from": "system",
"value": "Fix missing default value for RateLimitExceeded constructor\n"
},
{
"from": "human",
"value": "\"\"\"errors and exceptions.\"\"\"\n\nfrom flask.wrappers import Response\nfrom werkzeug import exceptions\n\nfrom .typing import Optional\nfrom .wrappers import Limit\n\n... | python | chosen |
[
{
"from": "system",
"value": "Bring the forum to the foreground\n\nThe default landing page is now the forum, to hopefully encourage people to use it\n"
},
{
"from": "human",
"value": "from django.urls import include, path\nfrom django.contrib import admin\nfrom django.views.generic import Templ... | python | chosen |
[
{
"from": "system",
"value": "Correct fake action test name\n\nChange-Id: Ibb2322139fd8d7f3365d3522afde622def910fe9\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2013 - StackStorm, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# ... | python | chosen |
[
{
"from": "system",
"value": "Add function for loading sampled set\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module contains processing functions.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport os\n\ndef load_force_coeffs(steady=False):\n \"\"\"\n Load force coefficients ... | python | chosen |
[
{
"from": "system",
"value": "Add dummy implementation for login\"\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\nfrom flask import jsonify\nfrom flask import request\n\n\napp = Flask(__name__)\n\n\nFLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)\n\n\n@app.route(\"/v... | python | chosen |
[
{
"from": "system",
"value": "Use our new base image"
},
{
"from": "human",
"value": "\"\"\"HassIO docker utilitys.\"\"\"\nimport re\n\nfrom ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64\n\n\nRESIN_BASE_IMAGE = {\n ARCH_ARMHF: \"resin/armhf-alpine:3.5\",\n ARCH_AARCH64: \"... | python | chosen |
[
{
"from": "system",
"value": "Update config sample to remove unused config items\n"
},
{
"from": "human",
"value": "# App\nAPP_NAME = 'uchan'\nSITE_NAME = 'µchan'\nSITE_URL = 'http://127.0.0.1'\n\nDEBUG = True\nDEFAULT_NAME = 'Anonymous'\nSHOW_BOARDS_AT_TOP = True\n\n# Flask\nDATABASE_CONNECT_ST... | python | chosen |
[
{
"from": "system",
"value": "Remove the old coast import.\n"
},
{
"from": "human",
"value": "\"\"\"\nThe FVCOM Python toolbox (PyFVCOM)\n\n\"\"\"\n\n__version__ = '2.1.3'\n__author__ = 'Pierre Cazenave'\n__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']\n__license__ = 'MI... | python | chosen |
[
{
"from": "system",
"value": "Allow YouTube plugin to be used in PMs.\n"
},
{
"from": "human",
"value": "from plumeria.api.youtube import YouTube\nfrom plumeria.command import commands, CommandError, channel_only\nfrom plumeria.message import Response\nfrom plumeria.util.ratelimit import rate_li... | python | chosen |
[
{
"from": "system",
"value": "Add options dry-run mode and days\n"
},
{
"from": "human",
"value": "import logging\nfrom datetime import timedelta\n\nfrom django.core.management.base import BaseCommand\nfrom django.utils import timezone\n\nfrom geotrek.feedback.models import Report\n\nlogger = lo... | python | chosen |
[
{
"from": "system",
"value": "TEST - setup teardown for test\n"
},
{
"from": "human",
"value": "\"\"\" Testing gitwash dumper\n\"\"\"\n\nfrom os.path import join as pjoin, dirname, split as psplit\nimport shutil\nfrom tempfile import mkdtemp\nfrom subprocess import call\n\nfrom nose.tools import... | python | chosen |
[
{
"from": "system",
"value": "Add complex test for rmap\n"
},
{
"from": "human",
"value": "from skrt.utils import rmap\n\n\ndef test_list():\n list_ = [1, 2, 3, 4, 5]\n assert rmap(list_, lambda x: x**2, int) == [1, 4, 9, 16, 25]\n\n\ndef test_tuple():\n tuple_ = (1, 2, 3, 4, 5)\n as... | python | chosen |
[
{
"from": "system",
"value": "Remove special case for redirect_stdout.\n"
},
{
"from": "human",
"value": "from io import StringIO\n\ntry:\n from contextlib import redirect_stdout\nexcept ImportError:\n import contextlib\n import sys\n\n @contextlib.contextmanager\n def redirect_st... | python | chosen |
[
{
"from": "system",
"value": "Update trigger can now be specified on the command line as the second argument, and the module can now be run as a script.\n"
},
{
"from": "human",
"value": "import base64\nimport datetime\nimport os\nimport pickle\n\nfrom lxml import etree\nimport redis\n\nfrom dja... | python | chosen |
[
{
"from": "system",
"value": "Remove failing test for now\n"
},
{
"from": "human",
"value": "from django.contrib.staticfiles.testing import StaticLiveServerTestCase\nfrom django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\n\nfrom opencivicdata.models import Bill... | python | chosen |
[
{
"from": "system",
"value": "Update test for GOVUK Frontend libraries parity\n"
},
{
"from": "human",
"value": "import json\nfrom importlib import metadata\n\nfrom packaging.version import Version\n\n\ndef test_govuk_frontend_jinja_overrides_on_design_system_v3():\n with open(\"package.json\... | python | chosen |
[
{
"from": "system",
"value": "Use the environment in envlist instead of the contant py27\n"
},
{
"from": "human",
"value": "import tox.config\nfrom tox import hookimpl\n\n\ndef getargvlist(reader, command):\n return tox.config._ArgvlistReader.getargvlist(reader, command)\n\n\n@hookimpl\ndef t... | python | chosen |
[
{
"from": "system",
"value": "Add TviitForm into main View\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 RequestContext, loade... | python | chosen |
[
{
"from": "system",
"value": "Switch to datetime based on calls for updates.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Apr 30 01:14:12 2017\n\n@author: colm\n\"\"\"\n\nfrom flask import Flask, jsonify\nfrom parse_likecharity import... | python | chosen |
[
{
"from": "system",
"value": "Append instead of truncating log file\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# logger.py\n\n\"\"\"Log the serial output from the Arduino to a text file.\n\"\"\"\n\nimport sys\nimport serial\nfrom datetime import datetime\n\ndef log_serial(filenam... | python | chosen |
[
{
"from": "system",
"value": "Fix on function generate random solution\n"
},
{
"from": "human",
"value": "from abc import ABC, abstractmethod\nimport random as random\n\n\nclass AbstractHeuristic(ABC):\n @abstractmethod\n def calculate(self, solution):\n pass\n\n def calculateCos... | python | chosen |
[
{
"from": "system",
"value": "Set homepage to first semester fysmat\n"
},
{
"from": "human",
"value": "\"\"\"kokekunster URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFun... | python | chosen |
[
{
"from": "system",
"value": "Fix paths for local execution different from cloud server.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nfrom joblib import Parallel, delayed\nimport multiprocessing\n\nimport os\nfrom subprocess import call\n\ninputpath = '/data/amnh/darwin/images'\nsegment... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Improvement to custom storage.\"\n\nThis reverts commit 6f185ac7398f30653dff9403d5ebf5539d222f4c.\n"
},
{
"from": "human",
"value": "from django.contrib.staticfiles.storage import CachedFilesMixin\n\nfrom pipeline.storage import PipelineMixin\n\nfrom storag... | python | chosen |
[
{
"from": "system",
"value": "Add a nose-based blaze.test() function as a placeholder\n\nHopefully we find something better, but this at least gives\nus behavior similar to NumPy as a start.\n"
},
{
"from": "human",
"value": "\n# build the blaze namespace with selected functions\n\nfrom construc... | python | chosen |
[
{
"from": "system",
"value": "Update migration 177 to check for table existence first\n"
},
{
"from": "human",
"value": "\"\"\"add run state to eas folders\n\nRevision ID: 2b9dd6f7593a\nRevises: 48a1991e5dbd\nCreate Date: 2015-05-28 00:47:47.636511\n\n\"\"\"\n\n# revision identifiers, used by Al... | python | chosen |
[
{
"from": "system",
"value": "Add search feature to the Route API.\n"
},
{
"from": "human",
"value": "from rest_framework import mixins, serializers, viewsets\n\nfrom .models import Route, Trip\n\n\nclass TripSerializer(serializers.HyperlinkedModelSerializer):\n class Meta:\n model = T... | python | chosen |
[
{
"from": "system",
"value": "Add _capnp for original Cython module. Meant for testing.\n"
},
{
"from": "human",
"value": "\"\"\"A python library wrapping the Cap'n Proto C++ library\n\nExample Usage::\n \n import capnp\n\n addressbook = capnp.load('addressbook.capnp')\n\n # Building... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Change DATE_FORMAT to be equivalent to datetime.isoformat()\"\n\nThis reverts commit 2085cf0c103df44c500bae9bccdc2ce16cd8710f.\n\nSee discussion of the original commit https://github.com/amiv-eth/amivapi/commit/2085cf0c103df44c500bae9bccdc2ce16cd8710f\n"
},
{
"... | python | chosen |
[
{
"from": "system",
"value": "Fix occasional error when querying addic7ed\n"
},
{
"from": "human",
"value": "\ntry:\n from urllib.parse import urljoin\nexcept ImportError:\n from urlparse import urljoin\n\nimport requests\nfrom pyquery import PyQuery\n\n__all__ = ['session']\n\n\nclass Res... | python | chosen |
[
{
"from": "system",
"value": "Ch07: Refactor TagForm to inherit ModelForm.\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.core.exceptions import ValidationError\n\nfrom .models import Tag\n\n\nclass TagForm(forms.Form):\n name = forms.CharField(max_length=31)\n sl... | python | chosen |
[
{
"from": "system",
"value": "Improve l0 servo api with target_position accessor.\n"
},
{
"from": "human",
"value": "from .module import Module, interact\nfrom .gpio import Pwm\n\n\nclass L0Servo(Module):\n def __init__(self, id, alias, robot):\n Module.__init__(self, 'L0Servo', id, al... | python | chosen |
[
{
"from": "system",
"value": "Fix PEP8: W292 no newline at end of file\n"
},
{
"from": "human",
"value": "class Commission(object):\n def __init__(self, locks, stocks, barrels):\n self.locks = locks\n self.stocks = stocks\n self.barrels = barrels\n\n @property\n def... | python | chosen |
[
{
"from": "system",
"value": "Remove debugging print statement, opps\n"
},
{
"from": "human",
"value": "from django.utils.duration import _get_duration_components\n\nfrom datetime import timedelta\n\n\ndef duration_string_from_delta(delta):\n seconds = delta.total_seconds()\n split = str(s... | python | chosen |
[
{
"from": "system",
"value": "Remove magic number check in Trade str method\n"
},
{
"from": "human",
"value": "class Trade(object):\n BUY = 0\n SELL = 1\n def __init__(self, trade_id, trade_type, base_currency, counter_currency,\n time, order_id, amount, price, fee=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove all moderator made comments before 2021/01/01\n"
},
{
"from": "human",
"value": "import random\nimport string\nfrom django.core.management import BaseCommand\nfrom django.utils import timezone\nfrom heltour.tournament.models import *\n\nfrom django_comments.m... | python | chosen |
[
{
"from": "system",
"value": "Use factory to iterate over permutations\n\nSigned-off-by: Jeffrey Elms <23ce84ca7a7de9dc17ad8e8b0bbd717d4f9f9884@freshred.net>\n"
},
{
"from": "human",
"value": "# Simple tests for an adder module\nimport cocotb\nfrom cocotb.triggers import Timer\nfrom cocotb.resul... | python | chosen |
[
{
"from": "system",
"value": "Put many demos in demonstrate_queries()\n"
},
{
"from": "human",
"value": "import argparse\nimport io\n\n#Define commmand line arguments which can be passed to main.py\n#Currently irrelevant, but could be useful later\ndef initialize_argument_parser():\n parser =... | python | chosen |
[
{
"from": "system",
"value": "Add 3rd-party library folder in to system path\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# The main application file\n#\n\nfrom webapp2 import WSGIApplication\nfrom helpers.config import load_config\n\n# Explicitly import controller classes\nfro... | python | chosen |
[
{
"from": "system",
"value": "Set user.email_address.verified as true when user changed his password\n"
},
{
"from": "human",
"value": "from django.contrib.sessions.models import Session\nfrom django.dispatch import receiver\nfrom django.utils.translation import ugettext as _\nfrom account.signa... | python | chosen |
[
{
"from": "system",
"value": "Add cbu validator to utils module\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8-*-\n\n\ndef validate_cuit(cuit):\n \"from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart\"\n # validaciones minimas\n if len(cuit) != 13 or cuit[2... | python | chosen |
[
{
"from": "system",
"value": "Fix non-chanops not being able to query the topic\n"
},
{
"from": "human",
"value": "from twisted.plugin import IPlugin\nfrom twisted.words.protocols import irc\nfrom txircd.module_interface import IMode, IModuleData, Mode, ModuleData\nfrom txircd.utils import ModeT... | python | chosen |
[
{
"from": "system",
"value": "Make SecretServiceNotAvailableException a subclass of SecretStorageException\n\n"
},
{
"from": "human",
"value": "# SecretStorage module for Python\n# Access passwords using the SecretService DBus API\n# Author: Dmitry Shachnev, 2012\n# License: BSD\n\n\"\"\"All sec... | python | chosen |
[
{
"from": "system",
"value": "Add waypoint list and landmark names\n"
},
{
"from": "human",
"value": "import flask\n\napp = flask.Flask(__name__)\n\ndef make_tour():\n\ttour = {\n\t\t'id': 1,\n\t\t'name': 'Test Tour',\n\t\t'route': [\n\t\t\t{\n\t\t\t\t'description': 'This is a description of thi... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.