conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove leading and trailing slash of MEDIA_URL\n\nConflicts:\n\n\tmapentity/static/mapentity/Leaflet.label\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import patterns, url\n\nfrom . import app_settings\nfrom .views impo... | python | chosen |
[
{
"from": "system",
"value": "Add correct setUp/tearDown methods for integration sqs test\n"
},
{
"from": "human",
"value": "import os\nfrom asyncaws import SQS\nfrom tornado.testing import AsyncTestCase, gen_test\n\naws_key_id = os.environ['AWS_ACCESS_KEY_ID']\naws_key_secret = os.environ['AWS_... | python | chosen |
[
{
"from": "system",
"value": "Include admin in example project.\n"
},
{
"from": "human",
"value": "import re\nimport sys\n\nfrom django.conf import settings\nfrom django.conf.urls.static import static\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib.staticfiles.urls impo... | python | chosen |
[
{
"from": "system",
"value": "Add explicit version check for Django 1.7 or above\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom south.db import DEFAULT_DB_ALIAS\n\nclass MigrationHistory(models.Model):\n app_name = models.CharField(max_length=255)\n migration = model... | python | chosen |
[
{
"from": "system",
"value": "Use range instead of xrange\n"
},
{
"from": "human",
"value": "import os\nimport tempfile\nfrom subprocess import call\n\n\nclass SlidePresenter(object):\n\n def __init__(self):\n pass\n\n def present(self, slides):\n for sno, slide in enumerate(... | python | chosen |
[
{
"from": "system",
"value": "Add throwing item usage to test AI\n\nUnforutnately the item isn't evicted from the inventory on usage,\nso the guy with the throwing item can kill everybody, but it's\nworking - he does throw it!\n"
},
{
"from": "human",
"value": "class MonsterAI(object):\n def ... | python | chosen |
[
{
"from": "system",
"value": "Remove user from db connection string\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom flask import Flask\nimport os\nimport psycopg2\nfrom contextlib import closing\n\nDB_SCHEMA = \"\"\"\nDROP TABLE IF EXISTS entries;\nCREATE TABLE entries (\n id... | python | chosen |
[
{
"from": "system",
"value": "Use three public functions instead of one\n"
},
{
"from": "human",
"value": "STARTER = -1\nSEPARATOR = 0\nTERMINATOR = 1\n\ndef readlines(fp, sep, mode=TERMINATOR, retain=True, size=512):\n if mode < 0:\n return _readlines_start(fp, sep, retain, size)\n ... | python | chosen |
[
{
"from": "system",
"value": "Make sure epoch return type is int\n"
},
{
"from": "human",
"value": "# For now I am assuming the investment date will be returned from the db \n# as a string yyyy-mm-dd, representing the day the trend was purchased in UTC time\n\n#!/usr/bin/env python3\n\nfrom date... | python | chosen |
[
{
"from": "system",
"value": "Remove root that wasn't used.\n"
},
{
"from": "human",
"value": "from .interfaces import IRoot, IApp\nfrom .publish import publish\nfrom .request import Request\nfrom .traject import Traject\nfrom comparch import ClassRegistry, Lookup, ChainClassLookup\n\nknown_apps... | python | chosen |
[
{
"from": "system",
"value": "Fix s3 url regex to ensure path-based bucket and key does not catch.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom moto.compat import OrderedDict\nfrom .responses import S3ResponseInstance\n\nurl_bases = [\n \"https?://s3(.*).... | python | chosen |
[
{
"from": "system",
"value": "Add an item to the shopping list.\n"
},
{
"from": "human",
"value": "shopping_list = []\n\ndef show_help():\n print(\"What should we pick up at the store?\")\n print(\"Enter DONE to stop. Enter HELP for this help. Enter SHOW to see your current list.\")\n\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Remove debug output and pycodestyle\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\nfrom collections import Counter\n\ndef countTriplets(arr, r):\n potential_triplets_with_middle = Counter()\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix mistake with socket constructor\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport json\nimport socket\nimport sys\n\nif len(sys.argv) < 4:\n print(\"Error: Usage <register-result> <client> <name> <output> <status> <ttl>\")\n sys.exit(128)\... | python | chosen |
[
{
"from": "system",
"value": "Disable the check for the initial versions push\n"
},
{
"from": "human",
"value": "import json\n\ntry:\n # Only works in Python 3.5\n from urllib.request import urlopen\nexcept ImportError:\n from urllib2 import urlopen\nfrom yank import version\n\nif not v... | python | chosen |
[
{
"from": "system",
"value": "Add code to clean up\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)\n# Copyright (c) 2008-2014 California Institute of Technology.\n# License: 3-clause BSD. The full license text is availabl... | python | chosen |
[
{
"from": "system",
"value": "Add an error message when trying to load nisl without having Numpy, Scipy and Sklearn installed.\n"
},
{
"from": "human",
"value": "\"\"\"\nMachine Learning module for NeuroImaging in python\n==================================================\n\nSee http://nisl.gith... | python | chosen |
[
{
"from": "system",
"value": "Fix import error when CUDA is not available\n"
},
{
"from": "human",
"value": "import chainerx\nfrom chainerx import _pybind_cuda\n\ntry:\n import cupy\n _cupy_available = True\nexcept Exception:\n _cupy_available = False\n\n\n_chainerx_allocator = None\n\n... | python | chosen |
[
{
"from": "system",
"value": "Update convex hull of the group when removing a node from the group\n\nCURA-2573\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Uranium is released under the terms of the AGPLv3 or higher.\n\nfrom . import Operation\n\nfrom UM.Scene.Select... | python | chosen |
[
{
"from": "system",
"value": "Move newline handling to a function.\n\nAllows library users to choose to force trailing newlines.\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport sys\nimport os\nimport fcntl\nimport termios\nimport argparse\n\n\nclass RootRequired(... | python | chosen |
[
{
"from": "system",
"value": "Use animation if dirname is provided\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport matplotlib.pyplot as plt\nfrom numpy import array, log\nimport sys\n\nx = []\n\ny = []\n\ninfile = open(sys.argv[1])\n\nfor line in infil... | python | chosen |
[
{
"from": "system",
"value": "Add Pygments as installation requirement\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nsetup(\n name='snippets',\n version='0.0.dev',\n license='ISC',\n description='Code snippets repository generator',\n url='htt... | python | chosen |
[
{
"from": "system",
"value": "Update to appropriate version number"
},
{
"from": "human",
"value": "from distutils.core import setup\nsetup(name='pv_atmos',\n version='1.1',\n description='Utilities for scientific visualization with ParaView',\n long_description='This package is d... | python | chosen |
[
{
"from": "system",
"value": "Remove string from a copy and paste fail.\n"
},
{
"from": "human",
"value": "\"\"\"Setup script to generate an stand-alone executable.\n\nAuthor-email: \"Dietmar Winkler\" <dietmar.winkler@dwe.no>\n\nLicense: See UNLICENSE file\n\nUsage: Run the build process by run... | python | chosen |
[
{
"from": "system",
"value": "Change version `2016.8` => `2016.10`\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup\n\nsetup(\n name='py-vkontakte',\n version='2016.8',\n packages=['vk'],\n url='https://github.com/sgaynetdinov/py-vkontakte',\n ... | python | chosen |
[
{
"from": "system",
"value": "Update Python version classifiers to supported versions\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport xml4h\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nsetup(\n... | python | chosen |
[
{
"from": "system",
"value": "Add missing space in description\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\ndesc = (\n 'An interface to the Pluggable Authentication Modules (PAM) library'\n 'on linux, written in pure python (using ctypes)'\n)\n\nsetup(name='python... | python | chosen |
[
{
"from": "system",
"value": "Add ws4py to normal requirements in an attempt to get Travis to install it\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nsetup(\n name=\"echidna\",\n version=\"0.0.1-dev\",\n url='http://github.com/praekelt/echidna',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the docbuilds path location.\n"
},
{
"from": "human",
"value": "from django_website.settings.www import *\n\nPREPEND_WWW = False\nAPPEND_SLASH = True\nINSTALLED_APPS = ['django_website.docs']\nTEMPLATE_CONTEXT_PROCESSORS += [\"django.core.context_processors.requ... | python | chosen |
[
{
"from": "system",
"value": "Raise exception if version does not exist\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nimport codecs\nimport os\nimport re\n\nroot_dir = os.path.abspath(os.path.dirname(__file__))\nPACKAGE = 'hackernews_scraper'\n\ndef get_versio... | python | chosen |
[
{
"from": "system",
"value": "Add .md and .txt files to package\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport collections\nfrom setuptools import setup\n\nfrom pip.req import parse_requirements\n\ndependency_links = []\ninstall_requires = []\n\nReqOpts = collections.namedtuple... | python | chosen |
[
{
"from": "system",
"value": "Upgrade version to publish a release without tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nwith open('README.rst') as file:\n long_description = file.read()\n\nclassifiers = [\n 'Programming Language :: P... | python | chosen |
[
{
"from": "system",
"value": "PY-22460: Check variable before accessing it\n"
},
{
"from": "human",
"value": "# coding=utf-8\nimport os\nfrom unittest import main\n\nfrom _jb_runner_tools import jb_start_tests, jb_doc_args\nfrom teamcity import unittestpy\n\nif __name__ == '__main__':\n path,... | python | chosen |
[
{
"from": "system",
"value": "Add Python 2 and 3 PyPI classifiers.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='tephi',\n version='0.2.0-alpha',\n url='https://github.com/SciTools/tephi',\n author='Bill Little',\n author_email='bill.james.lit... | python | chosen |
[
{
"from": "system",
"value": "Use function described in readme"
},
{
"from": "human",
"value": "def get_price_without_vat(price_to_show, vat_percent):\n raise NotImplementedError()\n\n\ndef get_price_without_vat_from_other_valuta(conversion_rate, origin_price,\n ... | python | chosen |
[
{
"from": "system",
"value": "Archive logs from the tools\n\nChange-Id: I184473d20cc2763fbc97c993bfcab36b80d1c864\nReviewed-on: http://review.couchbase.org/76571\nTested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>\nReviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e... | python | chosen |
[
{
"from": "system",
"value": "Update file handlers to use Python3 urllib\n"
},
{
"from": "human",
"value": "import csv\nimport sys\nimport urllib\n\nfrom scheduleitem import ScheduleItem\nfrom team import Team\n\n\ndef read(uri):\n \"\"\"Open a File or a Web URL\"\"\"\n if uri.startswith('... | python | chosen |
[
{
"from": "system",
"value": "Update package version to v1.1.0\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n# To use a consistent encoding\nfrom codecs import open\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__))\n\nwith open(\"README.md\", \... | python | chosen |
[
{
"from": "system",
"value": "Move development status to alpha\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nwith open('README.rst') as readme_file:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add database router allow_migrate() for Django 1.7\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\n\nclass TenantSyncRouter(object):\n \"\"\"\n A router to control which applications will be synced,\n depending if we are syncing the s... | python | chosen |
[
{
"from": "system",
"value": "Add sc-mixed.py in installed scripts\n\nSigned-off-by: Stany MARCEL <3e139d47b96f775f4bc13af807cbc2ea7c67e72b@gmail.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\ntry:\n from setuptools import setup, Extension\nexcept ImportError:\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove the importing of the \"cythonize\" function.\n"
},
{
"from": "human",
"value": "from distutils.core import Extension, setup\n\nfrom Cython.Build import cythonize\n\ntry:\n from Cython.Distutils import build_ext\nexcept ImportError:\n use_cython = False\... | python | chosen |
[
{
"from": "system",
"value": "Add project dependencies to install\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#coding: utf-8\nfrom distribute_setup import use_setuptools\nuse_setuptools()\n\nfrom aero.__version__ import __version__, __title__, __authors__, __email__, __license__, _... | python | chosen |
[
{
"from": "system",
"value": "Update Django requirement to latest LTS\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='django-lightweight-queue',\n\n url=\"https://chris-lamb.co.uk/projects/django-lightweight-queue\",\n version='2.0.1',\n ... | python | chosen |
[
{
"from": "system",
"value": "Use correct MIT license classifier.\n\n`LICENSE` contains the MIT/Expat license but `setup.py` uses the LGPLv3\nclassifier. I assume the later is an oversight.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='pytest-flakes',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with version setter\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup\n\nPACKAGE_VERSION = '0.3'\n\n\ndef version():\n if os.getenv('TRAVIS'):\n return os.getenv('TRAVIS_BUILD_NUMBER')\n else:\n import odintoo... | python | chosen |
[
{
"from": "system",
"value": "Bump version number in preparation for next release.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Django/PostgreSQL implementation of the Meteor DDP service.\"\"\"\nimport os.path\nfrom setuptools import setup, find_packages\n\nsetup(\n name='d... | python | chosen |
[
{
"from": "system",
"value": "Update key usage when the usage_left counter is still greater than zero.\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\n\nclass Key(models.Model):\n user = models.Fore... | python | chosen |
[
{
"from": "system",
"value": "Remove the match param to fix RCE."
},
{
"from": "human",
"value": "from re import split as resplit\nfrom typing import Callable, Union\n\nfrom dmoj.result import CheckerResult\nfrom dmoj.utils.unicode import utf8bytes\n\nverdict = u\"\\u2717\\u2713\"\n\n\ndef check... | python | chosen |
[
{
"from": "system",
"value": "Update test again after better aggregation\n"
},
{
"from": "human",
"value": "from nose.plugins.attrib import attr\nfrom indra.sources.tas import process_from_web\n\n\n@attr('slow')\ndef test_processor():\n tp = process_from_web(affinity_class_limit=10)\n asse... | python | chosen |
[
{
"from": "system",
"value": "Test LICQ condition of constraint gradient\n"
},
{
"from": "human",
"value": "import unittest\n\nimport numpy as np\n\nfrom constraints import (generate_constraints_function,\n generate_constraint_gradients_function, )\nfrom robot_arm import ... | python | chosen |
[
{
"from": "system",
"value": "Improve determination of array shape for constant expressions\n\nWhen Evaluating a constant expression, I only used to look at the first\ncolumn in the df dictionary. But that could also be a constant or\nexpression. So look instead at all columns and find the first numpy\nar... | python | chosen |
[
{
"from": "system",
"value": "mypy: Add imports needed for new migration.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.4 on 2017-08-24 02:39\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\ndef fix_realm_string_ids(apps, sc... | python | chosen |
[
{
"from": "system",
"value": "Make UsersResource reusable for LDAP\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8; -*-\n#\n# This file is part of Superdesk.\n#\n# Copyright 2013, 2014 Sourcefabric z.u. and contributors.\n#\n# For the full copyright and license information, please see the... | python | chosen |
[
{
"from": "system",
"value": "Check for trailing slash in path"
},
{
"from": "human",
"value": "\"\"\" Utility functions for PhotoScan processing \"\"\"\n\nimport os, sys\nimport PhotoScan\n\ndef align_and_clean_photos(chunk):\n ncameras = len(chunk.cameras)\n for frame in chunk.frames:\n ... | python | chosen |
[
{
"from": "system",
"value": "Set default logger to file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# MAKE IT UNICODE OK\nimport sys\nreload( sys )\nsys.setdefaultencoding( 'utf-8' )\n\nimport os, sys\nimport Bot\nimport logging\n\t\nif __name__ == '__main__':\n\tlogging.basicCo... | python | chosen |
[
{
"from": "system",
"value": "Use output stream's encoding (if any).\nBlindly using UTF-8 would break output on Windows terminals.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2013-2015, Sebastian Linke\n\n# Released under the Simplified BSD license\n# (see LICENSE... | python | chosen |
[
{
"from": "system",
"value": "Update barcode resource to new resource specification\n"
},
{
"from": "human",
"value": "\"\"\"Module for generating Barcode Checksum Poster resource.\"\"\"\n\nfrom PIL import Image\nfrom utils.retrieve_query_parameter import retrieve_query_parameter\n\n\ndef resour... | python | chosen |
[
{
"from": "system",
"value": "Fix unit test fixtures files\n"
},
{
"from": "human",
"value": "import shutil\nimport os\n\nfrom django.core.files.storage import default_storage\nfrom django.test import TestCase\n\nclass SampleFilesTestCase(TestCase):\n fixtures = ['sample']\n\n @classmethod... | python | chosen |
[
{
"from": "system",
"value": "Fix parsing attributes filter values in GraphQL API\n"
},
{
"from": "human",
"value": "from graphene.types import Scalar\nfrom graphql.language import ast\n\n\nclass AttributesFilterScalar(Scalar):\n\n @staticmethod\n def coerce_filter(value):\n if isin... | python | chosen |
[
{
"from": "system",
"value": "Add more core tests / Rename test\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom . import BaseTestCase\n\nfrom ..models import Channel\n\n\nclass TestCoreModels(BaseTestCase):\n def setUp(self):\n # Create method was not returning the created obj... | python | chosen |
[
{
"from": "system",
"value": "Fix warnings about URLconf in Django 1.9\n\n* django.conf.urls.patterns will be removed in Django 1.10\n* Passing a dotted path and not a view function will be deprecated in\n Django 1.10\n"
},
{
"from": "human",
"value": "try:\n from django.conf.urls import pat... | python | chosen |
[
{
"from": "system",
"value": "Add user table to module init\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\nfrom flask.ext.assets import Bundle, Environment\nfrom flask.ext.login import LoginManager\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix import when using python3.3\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# vim: set ts=4\n\n# Copyright 2013 Rémi Duraffort\n# This file is part of RandoAmisSecours.\n#\n# RandoAmisSecours is free software: you can redistribute it and/or modify\n#... | python | chosen |
[
{
"from": "system",
"value": "Replace newlines with spaces for readability\n"
},
{
"from": "human",
"value": "import logging\n\nfrom functools import partial\nfrom lala.util import command, msg\nfrom twisted.internet.utils import getProcessOutput\n\n@command\ndef fortune(user, channel, text):\n ... | python | chosen |
[
{
"from": "system",
"value": "Change order of operations within migration so breaking schema changes come last\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-05-01 16:41\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations... | python | chosen |
[
{
"from": "system",
"value": "Use super() instead of super(classname, self)\n"
},
{
"from": "human",
"value": "# Copyright 2019 Akretion France <https://akretion.com/>\n# @author: Alexis de Lattre <alexis.delattre@akretion.com>\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\n... | python | chosen |
[
{
"from": "system",
"value": "scripts: Allow to override the JSON loading and dumping parameters.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# Touhou Community Reliant Automatic Patcher\n# Scripts\n#\n# ----\n#\n\"\"\"Utility functions shared among all the scripts.\"\"\"\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Drop old names from v0\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport h5py\n\ninfiles = sys.argv[1:]\n\nfor infile in infiles:\n with h5py.File(infile, 'a') as h5:\n print(infile)\n if 'format-version' in h5.attrs and h... | python | chosen |
[
{
"from": "system",
"value": "Switch console to use tracing-develop\n"
},
{
"from": "human",
"value": "import logging\nlogging.basicConfig(level=logging.DEBUG)\n\nimport mdk_tracing\nimport time\n\nimport quark\n\ntracer = mdk_tracing.Tracer.withURLsAndToken(\"ws://localhost:52690/ws\", None, No... | python | chosen |
[
{
"from": "system",
"value": "Add test for extend method.\n"
},
{
"from": "human",
"value": "from twisted.trial.unittest import TestCase\nimport vumi.blinkenlights.message20110818 as message\nimport time\n\n\nclass TestMessage(TestCase):\n\n def test_to_dict(self):\n now = time.time()\... | python | chosen |
[
{
"from": "system",
"value": "style: Use more descriptive variable names\n\nSee also: PSOBAT-1197\n"
},
{
"from": "human",
"value": "\"\"\"Render Jinja2 template.\"\"\"\nimport logging\nimport os\n\nimport jinja2\n\nLOG = logging.getLogger(__name__)\n\n\ndef get_template(template_file='', **kwar... | python | chosen |
[
{
"from": "system",
"value": "Ch03: Add options to NewsLink model fields. [skip ci]\n\nField options allow us to easily customize behavior of a field.\n\nVerbose name documentation:\n\n https://docs.djangoproject.com/en/1.8/ref/models/fields/#verbose-name\n https://docs.djangoproject.com/en/1.8/topics... | python | chosen |
[
{
"from": "system",
"value": "Fix the output when there is wrong usage\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport time\n\nfrom watchdog.observers import Observer\n\nfrom specchio.handlers import SpecchioEventHandler\nfrom specchio.util... | python | chosen |
[
{
"from": "system",
"value": "Write all log lines to log files\n\nOnly the virtool logger was being written before."
},
{
"from": "human",
"value": "import logging.handlers\n\nimport coloredlogs\n\n\ndef configure(verbose=False):\n logging_level = logging.INFO if verbose else logging.DEBUG\n\... | python | chosen |
[
{
"from": "human",
"value": "Create a small detail view for videodiscs.\n"
},
{
"from": "gpt",
"value": "from django.views.generic import DetailView\n\nfrom .models import Videodisc\n\n\nclass VideodiscDetailView(DetailView):\n model = Videodisc\n template_name = 'merchandise/media/videodi... | python | chosen |
[
{
"from": "system",
"value": "Fix DomainsConfig.name to fix rtfd build\n"
},
{
"from": "human",
"value": "from django.apps import AppConfig\n\n\nclass DomainsConfig(AppConfig):\n name = \"domains\"\n"
},
{
"from": "gpt",
"value": "from django.apps import AppConfig\n\n\nclass Domai... | python | chosen |
[
{
"from": "system",
"value": "Mark tags as not required in filter form\n"
},
{
"from": "human",
"value": "\nfrom django import forms\nfrom django.forms import widgets\n\nfrom . import models\n\n\nclass ThreadCreateForm(forms.ModelForm):\n\n class Meta:\n model = models.Thread\n ... | python | chosen |
[
{
"from": "system",
"value": "Add t5x.losses to public API.\n\nPiperOrigin-RevId: 417631806\n"
},
{
"from": "human",
"value": "# Copyright 2021 The T5X Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lice... | python | chosen |
[
{
"from": "system",
"value": "Reset colors at the end\n"
},
{
"from": "human",
"value": "from colorama import Fore\nfrom pkgutil import iter_modules\n\n\ndef check_import(packagename):\n \"\"\"\n Checks that a package is present. Returns true if it is available, and\n false if not avail... | python | chosen |
[
{
"from": "system",
"value": "Implement parser method for optional offset\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport arrow\n\nfrom jinja2 import nodes\nfrom jinja2.ext import Extension\n\n\nclass TimeExtension(Extension):\n tags = set(['now'])\n\n def __init__(sel... | python | chosen |
[
{
"from": "system",
"value": "Disable braekpad automatic registration while we figure out stuff\n\nReview URL: http://codereview.chromium.org/462022\n\ngit-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@33686 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "# Copyright (... | python | chosen |
[
{
"from": "system",
"value": "Add test check readonly field slug of channel\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom django.test import TestCase\nfrom django.contrib.sites.models import Site\nfrom django.contrib.auth import get_user_model\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Rename class to match intent\n"
},
{
"from": "human",
"value": "from twisted.web.server import Site, Request\n\n\nclass AddCSPHeaderRequest(Request):\n CSP_HEADER_VALUES = \"default-src 'self'; style-src 'self' 'unsafe-inline'\"\n\n def process(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add logging NullHandler to prevent \"no handler found\" errors\n\nThis fixes the issue where \"no handler found\" errors would be printed by\nthe library if library clients did not set up logging.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# This ... | python | chosen |
[
{
"from": "system",
"value": "Add option to edit currency\n"
},
{
"from": "human",
"value": "\"\"\"\nDjango Forms for interacting with Company app\n\"\"\"\n\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom InvenTree.forms import HelperForm\n\nfrom .models import Company\... | python | chosen |
[
{
"from": "system",
"value": "Use `dataclass` instead of `attr` for attendance model\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.attendance.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENS... | python | chosen |
[
{
"from": "system",
"value": "Fix comments in horizontal boxplot example\n"
},
{
"from": "human",
"value": "\"\"\"\nHorizontal boxplot with observations\n====================================\n\n_thumb: .7, .37\n\"\"\"\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\ns... | python | chosen |
[
{
"from": "system",
"value": "Change to signup url to allow steps"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\nfrom . import views\n\napi_urlpatterns = patterns(\n # Prefix\n '',\n\n (r'auth/signin/$', views.SigninAPIView.as_view()),\n (r'auth/signup... | python | chosen |
[
{
"from": "system",
"value": "Change log file size to 1MB\n"
},
{
"from": "human",
"value": "import string\n\ntemplate = string.Template(\"\"\"#\n# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.\n#\n# DNS configuration options\n#\n\n[DEFAULT]\n# dns_config_file=dns_config.xml\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Inline Validation fails silently if request is malformed\"\n\nThis reverts commit 723e4eb603568d3a60190d8d292cc335a74b79d5.\n"
},
{
"from": "human",
"value": "from Products.Archetypes.browser.validation import InlineValidationView as _IVV\nfrom Acquisition ... | python | chosen |
[
{
"from": "system",
"value": "Fix bug reading filenames for days with 1 number\n"
},
{
"from": "human",
"value": "import yaml\nfrom time import gmtime, strftime\nfrom shutil import copy\n\nwith open('../config/betfair_config.yml', 'r') as f:\n doc = yaml.load(f)\n\ndata_dir = doc['default']['... | python | chosen |
[
{
"from": "system",
"value": "Implement first tests for _nan_to_zero\n\n- Remove outdated dict test class\n- write some test methods\n"
},
{
"from": "human",
"value": "__author__ = 'intsco'\n\nimport cPickle\nfrom engine.pyIMS.image_measures.level_sets_measure import measure_of_chaos_dict\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Use TCX coordinates to fetch local weather\n"
},
{
"from": "human",
"value": "import tcxparser\nfrom configparser import ConfigParser\nfrom datetime import datetime\nimport urllib.request\nimport dateutil.parser\n\nt = '1984-06-02T19:05:00.000Z'\n# Darksky weather A... | python | chosen |
[
{
"from": "system",
"value": "Fix an issue with the new aprslib\n"
},
{
"from": "human",
"value": "import aprslib\nimport logging\n\nimport nmea\n\nclass AprsIS:\n\n\tlogger = None\n\n\tdef __init__(self, callsign, password):\n\t\tself.logger = logging.getLogger(__name__)\n\t\tself.aprs_connecti... | python | chosen |
[
{
"from": "system",
"value": "Add unit test for overrides\n"
},
{
"from": "human",
"value": "import unittest\nimport types\n\nimport cedexis.radar.cli\n\nclass TestCommandLineInterface(unittest.TestCase):\n\n def test_main(self):\n self.assertTrue(isinstance(cedexis.radar.cli.main, typ... | python | chosen |
[
{
"from": "system",
"value": "Add test for recursive agg\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport cooler.contrib.higlass as cch\nimport h5py\nimport os.path as op\n\ntestdir = op.realpath(op.dirname(__file__))\n\ndef test_data_retrieval():\n data_file... | python | chosen |
[
{
"from": "system",
"value": "Test simple lattice with one element.\n"
},
{
"from": "human",
"value": "import rml.lattice\n\ndef test_create_lattice():\n l = rml.lattice.Lattice()\n assert(len(l)) == 0\n\ndef test_non_negative_lattice():\n l = rml.lattice.Lattice()\n assert(len(l)) >... | python | chosen |
[
{
"from": "system",
"value": "Make sure to keep certain report fields out of resources\n"
},
{
"from": "human",
"value": "from scrapi.processing.osf import crud\nfrom scrapi.processing.osf import collision\nfrom scrapi.processing.base import BaseProcessor\n\n\nclass OSFProcessor(BaseProcessor):\... | python | chosen |
[
{
"from": "system",
"value": "Use parse() method to instantiate Requirement\n\n[Fix #224]\n\nSigned-off-by: Tony Wong <3261da024e85c36767bb9324ced93ba4333a2c77@pivotal.io>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport json\nfrom pip.req import parse_requirements\nfrom pip.do... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.