conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix setting servers through runserver commandline\n"
},
{
"from": "human",
"value": "import traceback\nfrom . import client\nfrom . import app\nfrom .thrift import lang_thrift\nimport os.path\nimport random\n\nservers = []\nwith open(os.path.join(os.path.dirname(__f... | python | chosen |
[
{
"from": "system",
"value": "Load in the double blind auction\n"
},
{
"from": "human",
"value": "\"\"\" Penelophant Models \"\"\"\nfrom .User import User\nfrom .UserAuthentication import UserAuthentication\nfrom .Auction import Auction\nfrom .Bid import Bid\nfrom .Invoice import Invoice\n"
},... | python | chosen |
[
{
"from": "system",
"value": "[Correct]: Check if path is circular or not. Write from correct\nrepository.\n"
},
{
"from": "human",
"value": "from operator import add\nimport math\n\nmoves = raw_input(\"Enter the moves: \")\n\nstart_position = [0,0]\ncurrent_position = [0,0]\n\n'''\nheading = [1... | python | chosen |
[
{
"from": "system",
"value": "Update python script util to detect if paths are already fully qualified\n"
},
{
"from": "human",
"value": "import os\n\n\ndef hdfs_make_qualified(path):\n return path if 'CF_HADOOP_DEFAULT_FS' not in os.environ else os.environ['CF_HADOOP_DEFAULT_FS'] + path\n"
... | python | chosen |
[
{
"from": "system",
"value": "Add newline at the end of the file.\n"
},
{
"from": "human",
"value": "from __future__ import (absolute_import, division,\n print_function, unicode_literals)\nfrom builtins import *\n\nfrom sqlalchemy.engine import Engine\n\nfrom zsl import in... | python | chosen |
[
{
"from": "system",
"value": "Rename McGillException to error (mcgill.error)\n"
},
{
"from": "human",
"value": "import mechanize\nimport os\n\nclass McGillException(Exception):\n pass\n\nurls = {\n 'login': 'twbkwbis.P_WWWLogin',\n 'transcript': 'bzsktran.P_Display_Form?user_type=S&tran... | python | chosen |
[
{
"from": "system",
"value": "Add newline at end of file.\n"
},
{
"from": "human",
"value": "import setuptools\n\nsetuptools.setup(\n name='pyQuantuccia',\n packages=['pyQuantuccia']\n)"
},
{
"from": "gpt",
"value": "import setuptools\n\nsetuptools.setup(\n name='pyQuantucci... | python | chosen |
[
{
"from": "system",
"value": "Add in helper documenation to assist with docker container run\n"
},
{
"from": "human",
"value": "# Copyright 2014 Dave Kludt\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.\... | python | chosen |
[
{
"from": "system",
"value": "Add an option to also output realtime along with monotime.\n"
},
{
"from": "human",
"value": "import getopt, sys\n\nif __name__ == '__main__':\n sippy_path = None\n\n try:\n opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')\n except getopt.Getopt... | python | chosen |
[
{
"from": "system",
"value": "Exclude ja-JP-mac on homepage language select functional test\n"
},
{
"from": "human",
"value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one ... | python | chosen |
[
{
"from": "system",
"value": "Define raw_input as input under Python 3\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nexample app to test running an app as subprocess within pty\n\"\"\"\nfrom __future__ import print_function, unicode_literals\nimport time\n\n# http://stackov... | python | chosen |
[
{
"from": "system",
"value": "testsuite: Simplify Python <3.5 fallback for TextIO\n\n(cherry picked from commit d092d8598694c23bc07cdcc504dff52fa5f33be1)\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module provides some type definitions and backwards compatibility shims\nfor use in the testsu... | python | chosen |
[
{
"from": "system",
"value": "Use standart i18n key in meal model"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nclass Meal(models.Model):\n\tclass Meta:\n\t\tverbose_name_plural = _('Meals')\n\n\t#Meal information\n\tnom... | python | chosen |
[
{
"from": "system",
"value": "Update list of channels when leaving one.\n"
},
{
"from": "human",
"value": "'''\nCreated on Dec 20, 2011\n\n@author: Tyranic-Moron\n'''\n\nfrom IRCMessage import IRCMessage\nfrom IRCResponse import IRCResponse, ResponseType\nfrom Function import Function\nimport Gl... | python | chosen |
[
{
"from": "system",
"value": "Add inter-month padding trait to factory.\n"
},
{
"from": "human",
"value": "#------------------------------------------------------------------------------\n#\n# Copyright (c) 2008, Enthought, Inc.\n# All rights reserved.\n# \n# This software is provided withou... | python | chosen |
[
{
"from": "system",
"value": "Add new company forms to menu view\n"
},
{
"from": "human",
"value": "from django.contrib.auth.decorators import login_required\nfrom django.http import HttpResponse, HttpResponseNotAllowed\nfrom django.shortcuts import render\nfrom django.views.generic import Templ... | python | chosen |
[
{
"from": "system",
"value": "Add a logmsg utility function\n"
},
{
"from": "human",
"value": "'''\nHolds static data components, like the palette\n'''\ndef get_palette(theme='std'):\n '''\n Return the preferred palette theme\n\n Themes:\n std\n The standard theme used by the ... | python | chosen |
[
{
"from": "system",
"value": "Index posts instead of employee titles to fix search results\n"
},
{
"from": "human",
"value": "from haystack import indexes\nfrom tx_salaries.models import Employee\n\n\nclass EmployeeIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharField(docu... | python | chosen |
[
{
"from": "system",
"value": "Change test to use MultiProcessInvoker\n"
},
{
"from": "human",
"value": "from nose.tools import eq_\n\nfrom orges.invoker.simple import SimpleInvoker\nfrom orges.invoker.pluggable import PluggableInvoker\n\nfrom orges.main import custom_optimize\nfrom orges.optimiz... | python | chosen |
[
{
"from": "system",
"value": "Use Docker API property in fixture\n"
},
{
"from": "human",
"value": "import docker\nimport pytest\n\nfrom webcomix.docker import DockerManager, CONTAINER_NAME\n\n@pytest.fixture\ndef cleanup_container():\n yield None\n client = docker.from_env()\n for cont... | python | chosen |
[
{
"from": "system",
"value": "Replace SyftClient calls -> Direct Node calls\n- This avoids to build client ast for every single request\nmaking the backend faster\n"
},
{
"from": "human",
"value": "# stdlib\nfrom typing import Any\nfrom typing import Optional\n\n# third party\nfrom nacl.signing ... | python | chosen |
[
{
"from": "system",
"value": "Use python 2.7+ standard importlib instead of deprecated django importlib\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.utils import importlib\n\n\ndef import_from_string(val, setting_name):\n \"\"\"\n Attempt to import a cla... | python | chosen |
[
{
"from": "system",
"value": "Order people by associated production.\n"
},
{
"from": "human",
"value": "from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register\nfrom .models import Person\n\n\nclass PeopleAdmin(ModelAdmin):\n model = Person\n menu_icon = 'group'\n m... | python | chosen |
[
{
"from": "system",
"value": "Check for sys.platform == linux, not linux2\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport json\n\n\ndef main():\n prefix = os.environ['PREFIX']\n info_file = os.path.join(prefix, 'conda-meta',\n 'always_include_fi... | python | chosen |
[
{
"from": "system",
"value": "Use os.remove instead of os.unlink\n\nIt's easier to understand\n"
},
{
"from": "human",
"value": "from nazs.core import module\nfrom nazs.core.commands import run\nfrom nazs.core.sudo import root\n\nfrom django.utils.translation import ugettext as _\n\nimport os\ni... | python | chosen |
[
{
"from": "system",
"value": "Handle case of memory limit not set.\n"
},
{
"from": "human",
"value": "import os\nimport json\nimport psutil\nfrom notebook.utils import url_path_join\nfrom notebook.base.handlers import IPythonHandler\n\ndef get_metrics():\n cur_process = psutil.Process()\n ... | python | chosen |
[
{
"from": "system",
"value": "Change db configs to default for CI\n"
},
{
"from": "human",
"value": "databases = {\n 'mysql': {\n 'driver': 'mysql',\n 'host': '',\n 'database': '',\n 'user': '',\n 'password': '',\n 'prefix': ''\n }\n}\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Use local console input to drive the calc\n"
},
{
"from": "human",
"value": "from sympy.abc import *\n\nfrom flask import Flask, request\napp = Flask(__name__)\n\n@app.route('/code', methods=['GET', 'POST'])\ndef code():\n return str(eval(request.json['code']))\n... | python | chosen |
[
{
"from": "system",
"value": "Improve compat handling in force_string\n\nIf we know we already have a string, no need to force it into a strinbg\n"
},
{
"from": "human",
"value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom pathlib import Path\nimport sys\n\n\ndef force_path(... | python | chosen |
[
{
"from": "system",
"value": "Fix issue where pandas.Index doesn't have str method\n\n(Index.str was only introduced in pandas 0.19.2)\n"
},
{
"from": "human",
"value": "import pandas as pd\n\ndef load_datadict(filepath, trim_index=True, trim_all=False):\n df = pd.read_csv(filepath, index_col... | python | chosen |
[
{
"from": "system",
"value": "Add Dictionary to shell context\n"
},
{
"from": "human",
"value": "import os\nimport coverage\nfrom flask_script import Manager, Shell\nfrom flask_migrate import Migrate, MigrateCommand\n\nfrom config import basedir\nfrom app import create_app, db\nfrom app.models i... | python | chosen |
[
{
"from": "system",
"value": "Add method to serve prediction result files\n"
},
{
"from": "human",
"value": "import flask\nfrom cref.app.web import app\nfrom cref.app.web.tasks import predict_structure\n\n\ndef success(result):\n return flask.jsonify({\n 'status': 'success',\n '... | python | chosen |
[
{
"from": "system",
"value": "Revert \"change to field for testing\"\n"
},
{
"from": "human",
"value": "from django.shortcuts import redirect\nfrom django.http import JsonResponse\nfrom django.core.mail import EmailMessage\nfrom django.middleware import csrf\n\nfrom rest_framework.decorators imp... | python | chosen |
[
{
"from": "system",
"value": "Increment version to 1.14.0 for release.\n"
},
{
"from": "human",
"value": "__version_info__ = ('1', '14', '0rc1')\n__version__ = '.'.join(__version_info__)\n\nfrom .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,\n BoundFunctionWrapper, W... | python | chosen |
[
{
"from": "system",
"value": "Add new SBAddress APIs to the fuzz tests.\n\n\ngit-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@137625 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from": "human",
"value": "\"\"\"\nFuzz tests an object after the default construction to make sure it does not cr... | python | chosen |
[
{
"from": "system",
"value": "Allow overrides to be blank\n"
},
{
"from": "human",
"value": "from django.contrib.contenttypes.fields import GenericForeignKey\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db import models\n\nPOSITIONS = (\n ('HERO', 'Hero'),\n ('S... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in timeout of generation cache key.\n"
},
{
"from": "human",
"value": "from django.core.cache import cache\nfrom django.utils import crypto\n\n\nGENERATION_KEY_NAME = 'metric:generation'\n\n\ndef generation_key(timeout=60 * 60 * 365):\n \"\"\"\n A ran... | python | chosen |
[
{
"from": "system",
"value": "Fix error with version number\n"
},
{
"from": "human",
"value": "\"\"\"The Basic Model Interface.\"\"\"\nfrom .bmi import Bmi\n\n\n__all__ = ['Bmi']\n__version__ = 0.1.0\n"
},
{
"from": "gpt",
"value": "\"\"\"The Basic Model Interface.\"\"\"\nfrom .bmi i... | python | chosen |
[
{
"from": "system",
"value": "Test Class now returns to base state between different groups of tests\n"
},
{
"from": "human",
"value": "import pytest\nfrom cps2_zmq.gather import MameSink\n\n@pytest.mark.parametrize(\"message, expected\",[\n ({'wid': 420, 'message': 'closing'}, 'worksink clos... | python | chosen |
[
{
"from": "system",
"value": "Fix svg rich backend to correctly show multiple figures.\n"
},
{
"from": "human",
"value": "# Standard library imports\nfrom cStringIO import StringIO\n\n# System library imports.\nfrom matplotlib.backends.backend_svg import new_figure_manager\nfrom matplotlib._pyla... | python | chosen |
[
{
"from": "system",
"value": "Fix noqa comments for new version of flake8\n"
},
{
"from": "human",
"value": "from seed_stage_based_messaging.settings import * # flake8: noqa\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = 'TESTSEKRET'\n\n# SECURITY WARNING: d... | python | chosen |
[
{
"from": "system",
"value": "Change signature of set() method.\n"
},
{
"from": "human",
"value": "import datetime\n\nclass Cache:\n EXPIRE_IN = 'expire_in'\n\n def __init__(self):\n self.store = {}\n\n def get(self, key):\n \"\"\"Gets a value based upon a key.\"\"\" \n ... | python | chosen |
[
{
"from": "system",
"value": "Fix ServerSelectionTimeoutError: No servers found yet\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport ssl\n\nfrom src.testers.decorators import requires_userinfo\n\n\n@requires_userinfo\ndef available(test):\n \"\"\"\n Check if MongoDB is ... | python | chosen |
[
{
"from": "system",
"value": "Add more info to the callback\n"
},
{
"from": "human",
"value": "from celery import Celery\nimport requests\n\nfrom .config import get_engine, _set_connection_string\nfrom .loader import FDPLoader\n\napp = Celery('fdp_loader')\napp.config_from_object('babbage_fiscal... | python | chosen |
[
{
"from": "system",
"value": "Add option to save ir to a text file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport logging\nimport faulthandler\n\nfrom . import analysis\nfrom . import codegen\n\n_f = open('faulthandler.err', 'w')\nfaulthandler.enable(_f)\n\n\ndef wrap(f, debug=... | python | chosen |
[
{
"from": "system",
"value": "Add Odoo Community Association (OCA) in authors\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# OpenERP, Open Source Management Solution\n# This module copyright (... | python | chosen |
[
{
"from": "system",
"value": "Add test for area property of circle.\n"
},
{
"from": "human",
"value": "\"\"\"\nName: Paul Briant\nDate: 11/22/16\nClass: Introduction to Python\nSession: 08\nAssignment: circle lab\n\nDescription:\nTests for Circle lab\n\"\"\"\n\n# -------------------------------I... | python | chosen |
[
{
"from": "system",
"value": "Make compatible with Django >2.1\n"
},
{
"from": "human",
"value": "from django.forms.widgets import Input, ClearableFileInput\nfrom django.template.loader import render_to_string\n\n\nclass CIImgWidget(ClearableFileInput):\n\n def render(self, name, value, attrs... | python | chosen |
[
{
"from": "system",
"value": "Move database connection code into thread-local context\n"
},
{
"from": "human",
"value": "import flask\nimport psycopg2\n\napp = flask.Flask(__name__)\ndb = psycopg2.connect('postgres://rpitours:rpitours@localhost:5432/rpitours')\n\ndef make_tour():\n\ttour = {\n\t... | python | chosen |
[
{
"from": "system",
"value": "Test for expected and unexpected checks\n"
},
{
"from": "human",
"value": "from fontbakery.checkrunner import Section\nfrom fontbakery.fonts_spec import spec_factory\n\n\ndef check_filter(checkid, font=None, **iterargs):\n if checkid in (\n \"com.google.fonts/... | python | chosen |
[
{
"from": "system",
"value": "Move KL Div to utils file\n"
},
{
"from": "human",
"value": "\nimport numpy as np\n\n\ndef hellinger(data1, data2):\n '''\n Calculate the Hellinger Distance between two datasets.\n\n Parameters\n ----------\n data1 : numpy.ndarray\n 1D array.\n... | python | chosen |
[
{
"from": "system",
"value": "Use args.func. Deal with failures, default \"profile'\n"
},
{
"from": "human",
"value": "\"\"\"Main function\n\nCopyright (c) 2015 Francesco Montesano\nMIT Licence\n\"\"\"\n\nimport sys\n\nimport colorama\n\nfrom dodocs.cmdline import parse\n\n__version__ = \"0.0.1\... | python | chosen |
[
{
"from": "system",
"value": "Clean up date guessing benchmarking code\n\n* Remove unused imports\n* use sys.exit(message) instead of exit()\n* Use Pythonic way to call main function (if __name__ == '__main__')\n* Reformat code\n* Avoid encoding / decoding things to / from UTF-8\n"
},
{
"from": "hum... | python | chosen |
[
{
"from": "system",
"value": "Remove print message in mocks\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nMocks for tests on other HW than Raspberry Pi.\n\"\"\"\n\n\nclass GPIO(object):\n\n BOARD = 'board'\n IN = 'in'\n OUT = 'out'\n PUD_UP = 'pud_up'\n FAL... | python | chosen |
[
{
"from": "system",
"value": "Add list of category codes to offices\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\nfrom rest_framework_gis import serializers as gis_serializers\n\nfrom .models import Location, Office, Organisation\n\n\nclass DistanceField(serializers.... | python | chosen |
[
{
"from": "system",
"value": "dist/tools/kconfiglib: Use python3 for RIOT adaption of menuconfig\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\" Menuconfig variant which uses RiotKconfig as base class \"\"\"\nimport menuconfig\nfrom riot_kconfig import standard_riot_kconfig\n\n#... | python | chosen |
[
{
"from": "system",
"value": "Allow getting the unwrapped doc\n"
},
{
"from": "human",
"value": "from corehq.apps.users.models import CommCareUser\n\n\ndef _users_by_location(location_id, include_docs):\n return CommCareUser.view(\n 'locations/users_by_location_id',\n startkey=[... | python | chosen |
[
{
"from": "system",
"value": "Fix running on unconfigured virtualenv.\n"
},
{
"from": "human",
"value": "import os\n\n__version__ = open(os.path.join(os.path.dirname(__file__), \"VERSION\")).read().strip()\n\ntry:\n from fields import TimedeltaField\n from helpers import (\n divide,... | python | chosen |
[
{
"from": "system",
"value": "Load docopt lazily (so that setup.py works)\n"
},
{
"from": "human",
"value": "\"\"\"Dispatch from command-line arguments to functions.\"\"\"\nimport re\nfrom collections import OrderedDict\n\nfrom docopt import docopt\n\n\n__all__ = ('dispatch', 'DispatchError')\n_... | python | chosen |
[
{
"from": "system",
"value": "Remove pre-release flag as 2.x is mainline now\n"
},
{
"from": "human",
"value": "# Global configuration information used across all the\n# translations of documentation.\n#\n# Import the base theme configuration\nfrom cakephpsphinx.config.all import *\n\n# The vers... | python | chosen |
[
{
"from": "system",
"value": "Switch identify to Meta object.\n"
},
{
"from": "human",
"value": "import collections\n\nfrom src.puzzle.problems import crossword_problem\n\n\n_PROBLEM_TYPES = set()\n\n\ndef identify(line):\n scores = {}\n for t in _PROBLEM_TYPES:\n score = t.score(line)\n ... | python | chosen |
[
{
"from": "system",
"value": "Update django.VERSION in trunk per previous discussion\n\ngit-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@9103 bcc190cf-cafb-0310-a4f2-bffc1f526a37\n"
},
{
"from": "human",
"value": "VERSION = (1, 0, 'post-release-SVN')\n\ndef get_version():\n \"Returns the ... | python | chosen |
[
{
"from": "system",
"value": "Disable debug output to avoid hanging on prow\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\nCopyright 2018 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the ... | python | chosen |
[
{
"from": "system",
"value": "Insert importer at beginning of list\n"
},
{
"from": "human",
"value": "import re\nimport sys\n\n\nclass ProcessorImporter(object):\n \"\"\"\n The processors were moved to the PILKit project so they could be used\n separtely from ImageKit (which has a bunch... | python | chosen |
[
{
"from": "system",
"value": "Implement tests for breathing model\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom ..models import Temperature, HeartBeats\n\n\nclass TemperatureTest(TestCase):\n \"\"\"Test class for temperature model\"\"\"\n\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Allow invoking commands by unique prefix\n"
},
{
"from": "human",
"value": "import pkgutil\nfrom importlib import import_module\n\nimport click\n\nfrom . import commands as commands_module\ncommand_modules = sorted(c[1] for c in pkgutil.iter_modules(commands_module.... | python | chosen |
[
{
"from": "system",
"value": "Add run() to the vm, which iterates through all the bytecodes and executes them\n"
},
{
"from": "human",
"value": "class VirtualMachine:\n def __init__(self, ram_size=256, stack_size=32):\n self.data = [None]*ram_size\n self.stack = [None]*stack_siz... | python | chosen |
[
{
"from": "system",
"value": "Add facilities to register virtual devices with the vm\n"
},
{
"from": "human",
"value": "class VirtualMachine:\n def __init__(self, ram_size=256, executing=True):\n self.data = [None]*ram_size\n self.stack = []\n self.executing = executing\n... | python | chosen |
[
{
"from": "system",
"value": "Fix the log autoclean job\n"
},
{
"from": "human",
"value": "from django.conf import settings\nimport logging\nfrom datetime import datetime, timedelta\nfrom celery.decorators import task\nfrom eve_proxy.models import CachedDocument\n\n@task(ignore_result=True)\ndef... | python | chosen |
[
{
"from": "system",
"value": "Return Midgard.Connection if one is opened. None otherwise\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nimport sys\nimport struct\nimport unittest\nfrom test_000_config import TestConfig\n\nfrom gi.repository import Midgard, GObject\n\nclass TestConnection(M... | python | chosen |
[
{
"from": "system",
"value": "release/0.6.2: Fix binary to str conversion\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport subprocess as subp\n\n\nclass DependencyChecker(object):\n\n def _check_test_dependencies(self):\n for dep in self.DEPENDENCIES:\n c... | python | chosen |
[
{
"from": "system",
"value": "Add repository test for adding a dataset\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom d1lod.sesame import Store, Repository, Interface\nfrom d1lod import dataone\n\ndef test_interface_can_be_created(interface):\n assert isinstance(interface, Interface... | python | chosen |
[
{
"from": "system",
"value": "Add unit test on __str__ function\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom member.models import Member\nfrom datetime import date\n\n\nclass MemberTestCase(TestCase):\n\n def setUp(self):\n Member.objects.create(firstname='... | python | chosen |
[
{
"from": "system",
"value": "Fix ref to non-existent __unicode__ function\n"
},
{
"from": "human",
"value": "from .models import *\nfrom django.contrib import admin\n\nclass StoreAdmin(admin.ModelAdmin):\n list_display = (\"__unicode__\",)\n\nclass ItemAdmin(admin.ModelAdmin):\n pass\n\na... | python | chosen |
[
{
"from": "system",
"value": "Remove useless parenthesis in qrcode python demo\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport StringIO\n\nimport angus\nimport cv2\nimport numpy as np\n\nif __name__ == '__main__':\n ### Web cam index might be different from 0 on your setup.\n... | python | chosen |
[
{
"from": "system",
"value": "Add a schema with some functionality to inherit from\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom marshmallow import Schema, fields\n\n__author__ = 'lundberg'\n\n\nclass FluxStandardAction(Schema):\n\n class Meta:\n strict = True\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove initial migration for 002\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.16 on 2018-11-25 21:06\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.db import migrations, models\nimp... | python | chosen |
[
{
"from": "system",
"value": "Delete entries from the South migration history too\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\nfrom django.db.utils import DatabaseError\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Add 'image' to the attrs for VersionDetails\n"
},
{
"from": "human",
"value": "from core.models import ApplicationVersion as ImageVersion\nfrom rest_framework import serializers\nfrom api.v2.serializers.summaries import (\n LicenseSummarySerializer,\n UserSumm... | python | chosen |
[
{
"from": "system",
"value": "Make output_mimetype accessible from the class.\n\nTraitlets are only accessible by instantiating the class. There's no\nclear reason that this needs to be a traitlet, anyway.\n"
},
{
"from": "human",
"value": "\"\"\"Python script Exporter class\"\"\"\n\n#----------... | python | chosen |
[
{
"from": "system",
"value": "Put terminal handlers under base_url\n"
},
{
"from": "human",
"value": "import os\nfrom terminado import NamedTermManager\nfrom .handlers import TerminalHandler, NewTerminalHandler, TermSocket\nfrom . import api_handlers\n\ndef initialize(webapp):\n shell = os.en... | python | chosen |
[
{
"from": "system",
"value": "Add cover test : core factories\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom .. import factories\n\n\nclass CoreFactoriesTest(TestCase):\n \"\"\"\n Ensure factories work as expected.\n Here we just call each one to ensure they... | python | chosen |
[
{
"from": "system",
"value": "Add better handling of temp file\n"
},
{
"from": "human",
"value": "import time\nimport os\n\nfrom tempfile import NamedTemporaryFile\nfrom sys import platform as _platform\n\nfrom gtts import gTTS\nfrom pygame import mixer\n\nfrom .playsound import playsound\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Fix conference title context processor.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.utils import timezone\n\nimport pytz\n\n\ndef core_context(self):\n \"\"\"Context processor for elements appearing on every page.\"\"\"\n c... | python | chosen |
[
{
"from": "system",
"value": "Use a set for comparison\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8; -*-\n#\n# This file is part of Superdesk.\n#\n# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.\n#\n# For the full copyright and license informatio... | python | chosen |
[
{
"from": "system",
"value": "Add press releases to dashboard panel\n"
},
{
"from": "human",
"value": "# Do not commit secrets to VCS.\n\n# Local environment variables will be loaded from `.env.local`.\n# Additional environment variables will be loaded from `.env.$DOTENV`.\n# Local settings will... | python | chosen |
[
{
"from": "system",
"value": "Remove conditional that checked type of arg\n"
},
{
"from": "human",
"value": "# IdeaScaly\n# Copyright 2015 Jorge Saldivar\n# See LICENSE for details.\n\nimport six\nimport dateutil.parser\n\n\ndef parse_datetime(str_date):\n try:\n date_is = dateutil.par... | python | chosen |
[
{
"from": "system",
"value": "Add __repr__ for User model\n"
},
{
"from": "human",
"value": "import os\nimport hashlib\nimport datetime\n\nimport peewee\n\n\ndatabase = peewee.Proxy()\n\n\nclass BaseModel(peewee.Model):\n class Meta:\n database = database\n\n\nclass User(BaseModel):\n ... | python | chosen |
[
{
"from": "system",
"value": "Handle request in context error\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport re\n\nfrom django import template\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.contrib.syndication.views import add_doma... | python | chosen |
[
{
"from": "system",
"value": "Support serializing objects that are saved with F expressions by reading field values for F expressions from database explicitly before serializing.\n"
},
{
"from": "human",
"value": "\"\"\"Django DDP utils for DDP messaging.\"\"\"\nfrom dddp import THREAD_LOCAL as ... | python | chosen |
[
{
"from": "system",
"value": "Add Config to root convenience imports\n"
},
{
"from": "human",
"value": "from ._version import __version_info__, __version__ # noqa\nfrom .tasks import task, ctask, Task # noqa\nfrom .collection import Collection # noqa\nfrom .context import Context # noqa\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Revert cherry-picked jsma tutorial constant change\n"
},
{
"from": "human",
"value": "import unittest\nimport numpy as np\n\n\nclass TestMNISTTutorialJSMA(unittest.TestCase):\n def test_mnist_tutorial_jsma(self):\n\n np.random.seed(42)\n import tens... | python | chosen |
[
{
"from": "system",
"value": "Extend time period at which deadline processing happens\n"
},
{
"from": "human",
"value": "import os\nfrom celery import Celery\nfrom celery.schedules import crontab\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings')\n\napp = Celery('lims', broker='... | python | chosen |
[
{
"from": "system",
"value": "Add functionality to Create DLP tool.\n\n"
},
{
"from": "human",
"value": "#-------------------------------------------------------------------------------\n## Description\n\"\"\"\nCreate Cache Dependency by just cliking.\n\"\"\"\n#----------------------------------... | python | chosen |
[
{
"from": "system",
"value": "Use hooks for progress updates\n"
},
{
"from": "human",
"value": "import youtube_dl, os\nfrom multiprocessing.pool import ThreadPool\nfrom youtube_dl.utils import DownloadError\nfrom datetime import datetime\nfrom uuid import uuid4\n\n\nclass Download:\n link = \... | python | chosen |
[
{
"from": "system",
"value": "Validate for no project selection in newsletter\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.apps import apps\nfrom django.conf import settings\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom adhocracy4.projects.models im... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with how nbgrader is called\n"
},
{
"from": "human",
"value": "import os\n\nfrom .. import run_python_module, run_command\nfrom .base import BaseTestApp\n\n\nclass TestNbGrader(BaseTestApp):\n\n def test_help(self):\n \"\"\"Does the help display ... | python | chosen |
[
{
"from": "system",
"value": "Allow retrieval of external api credentials\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\n\nimport os\nimport json\n\nclass OAEnv(object):\n @property\n def static_http_root(self):\n if self.envcfg['httpinfo']['secure'] is True:\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix for 1.6 & 1.7\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns, include, url\nimport settings\nimport os\n\nfrom django.contrib import admin\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n\n url(r'^$',\n 'django.v... | python | chosen |
[
{
"from": "system",
"value": "Add pygtk_postinstall.py Updated Deprecate gtk.idle_add and friends. Merge\n\n\t* Makefile.am: Add pygtk_postinstall.py\n\t* docs/random/missing-symbols: Updated\n\t* gtk/__init__.py: Deprecate gtk.idle_add and friends.\n\t* gtk/gtk.defs:\tMerge in 2.6 api, for GtkLabel functio... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.