conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "[ref] Integrate tray icon in the app\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\nimport wx\nimport gettext\nfrom CozyFrame import CozyFrame, TaskBarIcon\n\nif __name__ == \"__main__\":\n gettext.install(\"app\") # replace ... | python | chosen |
[
{
"from": "system",
"value": "Change test name for the _reinit() method.\n"
},
{
"from": "human",
"value": "from nose.tools import assert_true, assert_false, assert_equal\nfrom ..base import BaseEstimator\n\nclass MyEstimator(BaseEstimator):\n\n def __init__(self, l1=0):\n self.l1 = l1... | python | chosen |
[
{
"from": "system",
"value": "Add plugins to the domains which handle temp files\n"
},
{
"from": "human",
"value": "# Miscellaneos functions relating the projects app\nimport os\nfrom datetime import datetime\nfrom django.http import HttpResponseRedirect\nfrom django.utils.http import urlquote\n... | python | chosen |
[
{
"from": "system",
"value": "Use production settings by default; Display settings version in use\n"
},
{
"from": "human",
"value": "# Project Settings - Settings that don't exist in settings.py that you want to\n# add (e.g. USE_THOUSAND_SEPARATOR, GRAPPELLI_ADMIN_TITLE, CELERYBEAT_SCHEDULER,\n#... | python | chosen |
[
{
"from": "system",
"value": "Adjust for multiple bot instances\n\n"
},
{
"from": "human",
"value": "import asyncio\n\nfrom urllib.request import urlopen\n\nfrom jshbot import configurations\nfrom jshbot.exceptions import BotException\nfrom jshbot.utilities import future\n\n__version__ = '0.1.0'... | python | chosen |
[
{
"from": "system",
"value": "Make sure all .h5 files are closed before trying to remove them while testing\n"
},
{
"from": "human",
"value": "# re-enable deprecation warnings\nimport warnings\nwarnings.simplefilter('default')\n\nfrom nilmtk import *\nfrom nilmtk.version import version as __vers... | python | chosen |
[
{
"from": "system",
"value": "Add fromSymbol and toSymbol to rule\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom .Constants import EPSILON\n\n\nclass Rule:\n #TODO rules ->... | python | chosen |
[
{
"from": "system",
"value": "Fix error in telemetry task\n\nA condition had been changed to always match for debugging purposes, and\nwas accidentally committed that way.\n"
},
{
"from": "human",
"value": "from django.core.cache import cache\n\nfrom celery.utils.log import get_task_logger\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary if true/else false"
},
{
"from": "human",
"value": "\"\"\"utils.py\"\"\"\n\nimport random\n\nfrom pyechonest import config as echonest_config\nfrom pyechonest import song as echonest_song\nimport rfc3987\n\nfrom gweetr import app\nfrom gweetr.exce... | python | chosen |
[
{
"from": "system",
"value": "Use __file__ instead of argv[0]\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom confman import ConfigSource\n\noptions = \\\n{\n 'tags': ['desktop'],\n 'hostname': 'test',\n}\n\nfrom sys import argv\nfrom os import path\nsamples_path = path.join... | python | chosen |
[
{
"from": "system",
"value": "Add translation URLs as required by Oscar\n\nFixes #5.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\n\nfrom oscar.app import shop\nfrom oscar_mws.dashboard.... | python | chosen |
[
{
"from": "system",
"value": "Clean up sample city file\n"
},
{
"from": "human",
"value": "from bs4 import BeautifulSoup\nimport json\nimport datetime\nimport pytz\n\n# The URL for the page where the parking lots are listed\ndata_url = \"http://example.com\"\n\n# Name of the city, just in case i... | python | chosen |
[
{
"from": "system",
"value": "Prepare for y (yellow) first argument\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n\n'''\nGiven:\n1. status code: (0 - OK, other value - BAD)\n2. terminal window width\n\nshows red/green bar to visualize return code of previous command\n'''\n\nimport s... | python | chosen |
[
{
"from": "system",
"value": "Set better defaults for numpy's print function\n"
},
{
"from": "human",
"value": "from spinsys import constructors\nfrom spinsys import exceptions\nfrom spinsys import half\nfrom spinsys import hamiltonians\nfrom spinsys import quantities\nfrom spinsys import state_... | python | chosen |
[
{
"from": "system",
"value": "Document observe_value and observe_lr trigger interval\n"
},
{
"from": "human",
"value": "from chainer.training import extension\n\n\ndef observe_value(observation_key, target_func):\n \"\"\"Returns a trainer extension to continuously record a value.\n\n Args:... | python | chosen |
[
{
"from": "system",
"value": "Add uninstall HTML Terminal extension\n\nBUG=\nTEST=This is a test to uninstall HTML terminal extension\n\n\nReview URL: https://chromiumcodereview.appspot.com/10332227\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@137790 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Add check of command line program execution"
},
{
"from": "human",
"value": "\n\nimport re\nimport requests\nfrom bs4 import BeautifulSoup\nfrom utils import download_file\nimport os\n\nSUBJECT = 'seo'\nINDEX_ENDPOINT = 'http://www.tutorialspoint.com/%s/index.htm'\n... | python | chosen |
[
{
"from": "system",
"value": "Fix flake8 error in travis\n"
},
{
"from": "human",
"value": "from flask import abort, Blueprint, jsonify\n\nfrom httpobs import SOURCE_URL, VERSION\nfrom httpobs.conf import BROKER_URL\nfrom httpobs.database import get_cursor\n\nimport kombu\n\nmonitoring_api = Blu... | python | chosen |
[
{
"from": "system",
"value": "Fix remaining broken import of remove_trailing_dashes\n"
},
{
"from": "human",
"value": "\"\"\"Run a django-manage command.\"\"\"\nimport argparse\nfrom dodo_commands.extra.standard_commands import DodoCommand\nfrom dodo_commands.util import remove_trailing_dashes\n... | python | chosen |
[
{
"from": "system",
"value": "Adjust when to load data.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport schedule\nfrom feed import load_feed\nfrom twitter import send_queued_tweet\nimport time\nimport os\n\n\nRSS_FEED_LIST = os.environ['RSS_FEED_LIST']\n\n\ndef parse_feed_li... | python | chosen |
[
{
"from": "system",
"value": "Make annotator.model 'import *' friendly\n"
},
{
"from": "human",
"value": "from .annotation import Annotation\nfrom .consumer import Consumer\nfrom .user import User\n"
},
{
"from": "gpt",
"value": "__all__ = ['Annotation', 'Consumer', 'User']\n\nfrom .... | python | chosen |
[
{
"from": "system",
"value": "Update latest migration to use the database provided to the migrate management command\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nfrom django.contrib.contenttypes.m... | python | chosen |
[
{
"from": "system",
"value": "Update collect ini script. Now it shows if field is required.\n"
},
{
"from": "human",
"value": "\"\"\"\ncollect information about fields and values in ini file\n\nusage run script with file name in directory with unpacked stats.\n\nScript will collect data from all... | python | chosen |
[
{
"from": "system",
"value": "Allow tty process longer time to spawn in feature tests\n"
},
{
"from": "human",
"value": "import time, pexpect, re\nimport nose.tools as nt\nimport subprocess as spr\n\nPROMPT = \"root@\\w+:[^\\r]+\"\nENTER = \"\\n\"\n\ndef type(process, input_):\n process.sen... | python | chosen |
[
{
"from": "system",
"value": "Return a Markup object when the host is not supported\n\nThis might be an issue with the Markdown parser used by lektor (mistune),\nbut when a Markup() object is returned, then regular links must also\nbe marked as Markup() or they won't be escaped.\n"
},
{
"from": "hum... | python | chosen |
[
{
"from": "system",
"value": "Use date_url for .dates(), as Django 1.6 doesn't like DateTimeField here\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.utils import timezone\nfrom blanc_basic_news.news import get_post_model\nfrom blanc_basic_news.news.models import Cat... | python | chosen |
[
{
"from": "system",
"value": "Fix bad indentation in a pyximport test\n\nThe indentation was inadvertently broken when expanding tabs in\ne908c0b9262008014d0698732acb5de48dbbf950.\n\nFixes:\n\n $ python pyximport/test/test_reload.py\n File \"pyximport/test/test_reload.py\", line 23\n assert h... | python | chosen |
[
{
"from": "system",
"value": "Fix WA 10: remove limit heuristics\n\n- in CF Div 3 579C\n\nSigned-off-by: Karel Ha <70f8965fdfb04f1fc0e708a55d9e822c449f57d3@gmail.com>\n"
},
{
"from": "human",
"value": "from math import gcd, sqrt, ceil\n\nn = int(input())\na = list(map(int, input().split()))\n\na... | python | chosen |
[
{
"from": "system",
"value": "Mark vectors test as xfail (temporary)\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom __future__ import unicode_literals\nfrom io import StringIO\n\nword2vec_str = \"\"\", -0.046107 -0.035951 -0.560418\nde -0.648927 -0.400976 -0.527124\n. 0.113685 0.4399... | python | chosen |
[
{
"from": "system",
"value": "Fix getting model of foreign key field.\n"
},
{
"from": "human",
"value": "# coding=utf-8\nimport six\nimport django\nfrom django.db import models\n\nif django.VERSION >= (2, 0):\n from django.urls import reverse\nelse:\n from django.core.urlresolvers import r... | python | chosen |
[
{
"from": "system",
"value": "Replace line endings with whitespace instead of deleting them.\n"
},
{
"from": "human",
"value": "from evaluate_user import evaluate_user\n\ndef main():\n user_id = \"\"\n while user_id != 'exit':\n user_id = raw_input(\"Enter user id: \")\n if u... | python | chosen |
[
{
"from": "system",
"value": "Move imports to top of module\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2014 John Vandenberg\n# Licensed under the MIT License, see LICENSE file for details.\n\n\"\"\"Sphinx epytext support.\"\"\"\n\nfrom sphinx_epytext.process_docstrin... | python | chosen |
[
{
"from": "system",
"value": "Call rnasync after truncating db on dev deploy\n"
},
{
"from": "human",
"value": "import logging\n\nfrom commander.deploy import task\n\nfrom deploy_base import * # noqa\n\n\nlog = logging.getLogger(__name__)\n\n\n@task\ndef database(ctx):\n with ctx.lcd(setting... | python | chosen |
[
{
"from": "system",
"value": "Smallfix: Send more print message to sys.stderr\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nimport os\n\ntry:\n print \"Trying import local.py settings...\"\n from .local import *\nexcept ImportError:\n... | python | chosen |
[
{
"from": "system",
"value": "Allow round_id for submissions to be calculated dynamically\n"
},
{
"from": "human",
"value": "import logging\nfrom datetime import datetime\n\nimport sqlalchemy as sql\nfrom sqlalchemy import Table, Column, Integer, String, DateTime, Text, ForeignKey\nfrom sqlalche... | python | chosen |
[
{
"from": "system",
"value": "Mark ubuntupkg tests as flaky\n"
},
{
"from": "human",
"value": "# MIT licensed\n# Copyright (c) 2017 Felix Yan <felixonmars@archlinux.org>, et al.\n\nimport pytest\npytestmark = pytest.mark.asyncio\n\nasync def test_ubuntupkg(get_version):\n assert await get_ver... | python | chosen |
[
{
"from": "system",
"value": "Change class name Publisher to Published on models\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.Ma... | python | chosen |
[
{
"from": "system",
"value": "Remove prefix from URL paths\n\nThis path information should be set by the including project.\n"
},
{
"from": "human",
"value": "\"\"\"\nURLconf for CAS server URIs as described in the CAS protocol.\n\"\"\"\n\nfrom django.conf.urls import patterns\nfrom django.conf.... | python | chosen |
[
{
"from": "system",
"value": "Allow format function to be provided to Formatter constructor\n"
},
{
"from": "human",
"value": "import json\nfrom collections import OrderedDict\nfrom .command import Command\nfrom .settings import FormatterSettings\n\n\nclass Formatter():\n def __init__(self, n... | python | chosen |
[
{
"from": "system",
"value": "Switch from raw dict to context dict"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom event_manager.models import Suggestion, Event\nfrom django.contrib.auth.decorators import login_required\n\ndef home(request):\n\treturn render(request, '... | python | chosen |
[
{
"from": "system",
"value": "Add a restart() method to Timer.\n"
},
{
"from": "human",
"value": "inf = infinity = float('inf')\n\nclass Timer:\n\n def __init__(self, duration, *callbacks):\n self.duration = duration\n self.callbacks = list(callbacks)\n\n self.elapsed = 0... | python | chosen |
[
{
"from": "system",
"value": "Fix extend artifact name migration script.\n\nTest Plan: ran migration locally and checked table schema\n\nReviewers: anupc, kylec\n\nReviewed By: kylec\n\nSubscribers: changesbot\n\nDifferential Revision: https://tails.corp.dropbox.com/D151824\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Comment about the directory structure\n"
},
{
"from": "human",
"value": "# django-salesforce\n#\n# by Phil Christensen\n# (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org)\n# See LICENSE.md for details\n#\n\n\"\"\"\nDatabase backend for the Salesforc... | python | chosen |
[
{
"from": "system",
"value": "Develop program for points file generation\n"
},
{
"from": "human",
"value": "# Thermo State Solver\n# Solves for state parameters at various points in a simple thermodynamic model \n# Developed by Neal DeBuhr\n\nimport csv\nimport argparse\nimport itertools\n"
},... | python | chosen |
[
{
"from": "system",
"value": "Change variable name for consistency\n"
},
{
"from": "human",
"value": "SP = 'setpoint'\nRB = 'readback'\nENG = 'machine'\nPHY = 'physics'\n"
},
{
"from": "gpt",
"value": "SP = 'setpoint'\nRB = 'readback'\nENG = 'engineering'\nPHY = 'physics'\n"
}
] | python | chosen |
[
{
"from": "system",
"value": "Set up loggers after the configuration file is loaded\n"
},
{
"from": "human",
"value": "# coding: utf-8\n###################################################################\n# Copyright (c) 2016-2020 European Synchrotron Radiation Facility #\n# ... | python | chosen |
[
{
"from": "system",
"value": "Fix decode test to actually decode message from stdin\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport capnp\nimport os\ncapnp.add_import_hook([os.getcwd(), \"/usr/local/include/\"]) # change this to be auto-detected?\n\nimport test_capnp\n\nimport s... | python | chosen |
[
{
"from": "system",
"value": "Remove XFAIL on functional tor test\n"
},
{
"from": "human",
"value": "import os\nimport re\nimport pytest\n\nsdvars = pytest.securedrop_test_vars\n\n\n@pytest.mark.xfail\n@pytest.mark.parametrize('site', sdvars.tor_url_files)\n@pytest.mark.skipif(os.environ.get('FP... | python | chosen |
[
{
"from": "system",
"value": "Update test models for new metaclass support.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*_\nfrom django.db import models\n\nfrom ..base import ModelTranslationBase\nfrom ..mixins import ModelMixin, ManagerMixin\n\n\nclass FooManager(ManagerMixin, model... | python | chosen |
[
{
"from": "system",
"value": "Add ipaddress.IPv[46]Network to the supported types\n"
},
{
"from": "human",
"value": "# Copyright (c) 2005-2016 Stefanos Harhalakis <v13@v13.gr>\n# Copyright (c) 2016-2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may... | python | chosen |
[
{
"from": "system",
"value": "Fix highlighting of \"External ID Types\" menu entry\n"
},
{
"from": "human",
"value": "# This file is part of Indico.\n# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).\n#\n# Indico is free software; you can redistribute it and/or\n# mo... | python | chosen |
[
{
"from": "system",
"value": "Disable updating serviceInfo when retrieving daily data.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport json, os, requests\nfrom awsauth import S3Auth\n\nkey = os.environ.get('UWOPENDATA_APIKEY')\nACCESS_KEY = os.environ.get('AWS_ACCESS_KEY_ID')\nS... | python | chosen |
[
{
"from": "system",
"value": "Return only alphabetic words from sentence\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division, print_function, unicode_literals\n\nfrom itertools import chain\nfrom .._compat import to... | python | chosen |
[
{
"from": "system",
"value": "Add x, y and n_components to docstring\n"
},
{
"from": "human",
"value": "\"\"\"\nUser-facing interface for plotting all dimensionality reduction algorithms\n\"\"\"\n\ndef smushplot(data, smusher='PCA', x=1, y=2, n_components=2, marker='o',\n marker_ord... | python | chosen |
[
{
"from": "system",
"value": "Make largest stock a property\n"
},
{
"from": "human",
"value": "import collections\n\n# simple structure to keep track of a specific piece\nPiece = collections.namedtuple('Piece', 'id, length')\n\nclass Planner(object):\n\n def __init__(self, sizes, needed, loss... | python | chosen |
[
{
"from": "system",
"value": "Add helper function to produce some dummy tuples (for testing and debugging)\n"
},
{
"from": "human",
"value": "__all__ = ['identity', 'print_generated_sequence']\n\n\ndef identity(x):\n \"\"\"\n Helper function which returns its argument unchanged.\n That ... | python | chosen |
[
{
"from": "system",
"value": "Load middleware before we fork.\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>\n"
},
{
"from": "human",
"value": "import logging\n\nfrom optparse import make_option\n\nfrom django.core.management.base import NoArgsCommand\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Remove additional nesting from Shutter.snapshots results\n\nIn order to remove the bug we flatten the return value of txn.fetchall().\nAfter the change rerunning the tests confirms that the service is behaving accordingly to our expectations.\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Fix version number to upload to PyPI\n"
},
{
"from": "human",
"value": "\"\"\"django todo\"\"\"\n__version__ = '1.4.dev'\n\n__author__ = 'Scot Hacker'\n__email__ = 'shacker@birdhouse.org'\n\n__url__ = 'https://github.com/shacker/django-todo'\n__license__ = 'BSD Lice... | python | chosen |
[
{
"from": "system",
"value": "Set the default device to native in Python binding\n"
},
{
"from": "human",
"value": "from xchainer._core import * # NOQA\n\n_global_context = Context()\n_global_context.get_backend('native')\nset_global_default_context(_global_context)\n"
},
{
"from": "gpt... | python | chosen |
[
{
"from": "system",
"value": "Support new location of ProxyFix helper\n"
},
{
"from": "human",
"value": "# flake8: noqa\n\nfrom flask import Flask\n\nfrom werkzeug.contrib.fixers import ProxyFix\n\n__version__ = '1.0.1'\n\napp = Flask(__name__)\napp.config.from_object('oauthclientbridge.default_... | python | chosen |
[
{
"from": "system",
"value": "Allow to set default value in template\n"
},
{
"from": "human",
"value": "from django.template import Library\nfrom django.utils.translation import get_language\n\nfrom simpleseo import settings\nfrom simpleseo.models import SeoMetadata\n\nregister = Library()\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Update build system requirements patch\n"
},
{
"from": "human",
"value": "import subprocess\n\ndef execute():\n subprocess.call([\n 'npm', 'install',\n 'babel-core',\n 'chokidar',\n 'babel-preset-es2015',\n 'babel-preset-es2016'... | python | chosen |
[
{
"from": "system",
"value": "Allow string arguments (as slugs) when saving/updating EnumFields\n\nThis fixes issues where:\n\n MyModel.objects.update(my_enum_field='slug')\n\nwould result in SQL like:\n\n UPDATE app_mymodel SET my_enum_field = 'slug'\n\n.. instead of what that's slug's integer value is.\... | python | chosen |
[
{
"from": "system",
"value": "Use debug mode in tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport flask\n\nimport pytest\nimport webtest\n\nimport marshmallow as ma\n\nclass Bunch(object):\n\n def __init__(self, **kwargs):\n self.__dict__.update(**kwargs)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add () to fixture definitions"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Part of the masterfile package: https://github.com/njvack/masterfile\n# Copyright (c) 2018 Board of Regents of the University of Wisconsin System\n# Wr... | python | chosen |
[
{
"from": "system",
"value": "Fix tests for Python 2.7\n"
},
{
"from": "human",
"value": "import pytest\ntry:\n import cPickle as pickle\nexcept ImportError:\n import pickle\n\nfrom .models import Post\n\n\npytestmark = pytest.mark.django_db\n\n\n@pytest.mark.django_db\n@pytest.fixture\nde... | python | chosen |
[
{
"from": "system",
"value": "Rename paths variable to fnames.\n"
},
{
"from": "human",
"value": "import os\n\nclass FileIterator(object):\n \"\"\"\n This FileIterator iterates over the paths contained in one or more directories.\n \"\"\"\n def __init__(self, *paths):\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Improve detection of page encoding\n"
},
{
"from": "human",
"value": "import bs4\nimport cgi\n\n\ndef get_content(data, errors='strict'):\n headers = {k.lower(): v for k, v in data.get('headers', {}).items()}\n content_type_header = headers.get('content-type',... | python | chosen |
[
{
"from": "system",
"value": "Update password in unit test to comply with password rules\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom tenable_io.api.users import UserCreateRequest\n\nfrom tests.base import BaseTest\nfrom tests.config import TenableIOTestConfig\n\n\nclass TestImperson... | python | chosen |
[
{
"from": "system",
"value": "Handle scalar values in _assert_eq_nan\n\nAdd some special handling in `_assert_eq_nan` to handle having scalar\nvalues passed in. Basically ensure that everything provided is an array.\nThis is a no-op for arrays, but converts scalars into 0-D arrays. By\ndoing this, we are ab... | python | chosen |
[
{
"from": "system",
"value": "Change structure of the output properties\n"
},
{
"from": "human",
"value": "import json\nfrom chemml.models.keras.trained import OrganicLorentzLorenz\n\nfrom openbabel import OBMol, OBConversion\n\ndef ob_convert_str(str_data, in_format, out_format):\n mol = OBM... | python | chosen |
[
{
"from": "system",
"value": "Add session and logging to test setup.\n"
},
{
"from": "human",
"value": "import sys\nfrom django.conf import settings\n\nsettings.configure(\n DATABASES={\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n }\n },\n ROOT_URL... | python | chosen |
[
{
"from": "system",
"value": "Update search api filter out unwanted information\n"
},
{
"from": "human",
"value": "from apiclient.discovery import build\nimport json\n\n\n# Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps\n# tab of\n# https://cloud.google.com/conso... | python | chosen |
[
{
"from": "system",
"value": "Fix case typo in 'to_dataframe' abstract method return type.\n\nAlso updates abstract property to abstract method.\n\nPiperOrigin-RevId: 339248589\n"
},
{
"from": "human",
"value": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (th... | python | chosen |
[
{
"from": "system",
"value": "Add break line on clean txt files\n"
},
{
"from": "human",
"value": "\"\"\"\nScript to clean the txt generated files and kept only the 37 class: LICENSE-PLATE and set the number 0 to the class.\n\"\"\"\nimport os\n\ndataset_dir = \"data/dataset/\"\n\nfor filename in... | python | chosen |
[
{
"from": "system",
"value": "Disable jaeger logging by default\n"
},
{
"from": "human",
"value": "from jaeger_client.config import (\n DEFAULT_REPORTING_HOST,\n DEFAULT_REPORTING_PORT,\n DEFAULT_SAMPLING_PORT,\n Config,\n)\n\nfrom microcosm.api import binding, defaults, typed\n\n\nS... | python | chosen |
[
{
"from": "system",
"value": "Adjust test for returned name"
},
{
"from": "human",
"value": "from common import *\n\n\nclass TestBasicCreate(TestCase):\n \n def test_create_default_return(self):\n sg = Shotgun()\n type_ = 'Dummy' + mini_uuid().upper()\n spec = dict(nam... | python | chosen |
[
{
"from": "system",
"value": "Use FileWrapper to send files to browser in chunks of 8KB\n\nMaybe this will fix a problem on the test server when it tries to send a huge file.\n"
},
{
"from": "human",
"value": "import mimetypes\nimport os\n\nfrom django.http import HttpResponse\n\n\nmimetypes.ini... | python | chosen |
[
{
"from": "system",
"value": "Allow south to handle MarkupFilebrowserFiled\n"
},
{
"from": "human",
"value": "from markitup.fields import MarkupField\nimport widgets\n\nclass MarkupFilebrowserFiled(MarkupField):\n def formfield(self, **kwargs):\n defaults = {'widget': widgets.MarkitUpF... | python | chosen |
[
{
"from": "system",
"value": "Move parsing loop into the class itself.\n"
},
{
"from": "human",
"value": "from pprint import pprint\ninput = open('example_ignition.txt').read()\nhands = input.split('\\n\\n\\n')\n\nclass Hand:\n def __init__(self, se=None, p=None, f=None, t=None, r=None, su=No... | python | chosen |
[
{
"from": "system",
"value": "Reduce fetch size to 5000. Don't run job on startup.\n"
},
{
"from": "human",
"value": "from apscheduler.schedulers.blocking import BlockingScheduler\n\nfrom twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,\n update_status)\n\nfrom memory... | python | chosen |
[
{
"from": "system",
"value": "Validate email id, while editing user profile\n"
},
{
"from": "human",
"value": "from django import forms\nfrom .models import Issue,Bounty,UserProfile\nfrom django.contrib.auth.models import User\n\nclass IssueCreateForm(forms.ModelForm):\n issueUrl = forms.Char... | python | chosen |
[
{
"from": "system",
"value": "Add state column to user create api\n"
},
{
"from": "human",
"value": "import uuid\n\nfrom ckan import model\nfrom ckan.lib import dictization\nfrom ckan.plugins import toolkit\nfrom sqlalchemy import Column, types\nfrom sqlalchemy.ext.declarative import declarative... | python | chosen |
[
{
"from": "system",
"value": "Use testtools as test base class.\n\nOn the path to testr migration, we need to replace the unittest base classes\nwith testtools.\nReplace tearDown with addCleanup, addCleanup is more resilient than tearDown.\nThe fixtures library has excellent support for managing and cleanin... | python | chosen |
[
{
"from": "system",
"value": "Make py starterpackage more like java/c++ one\n"
},
{
"from": "human",
"value": "import math\nimport sys\n\n# A helper class for working with points.\nclass Point:\n\tdef __init__(self, x, y):\n\t\tself.x = x\n\t\tself.y = y\nclass Edge:\n\tdef __init__(self, p1, p2... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Made commands consistent on use of underscores. Re-enabled 'interpret' command that had been misplaced.\"\n\nThis reverts commit 7827598d1060442570685e94633093c550ce7ff2.\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\nimport flask_script as sc... | python | chosen |
[
{
"from": "system",
"value": "Patch S3Boto3Storage to prevent closed file error when collectin static\n\nThis is copied from the aggregator API and prevents a bug where the\nstorage closes the files too early, raising a boto exception.\n"
},
{
"from": "human",
"value": "from storages.backends.s3... | python | chosen |
[
{
"from": "system",
"value": "Remove check for domain in DOI\n"
},
{
"from": "human",
"value": "import logging\nimport time\n\nfrom website.app import init_app\nfrom website.identifiers.utils import get_top_level_domain, request_identifiers_from_ezid\n\nlogger = logging.getLogger(__name__)\nlogg... | python | chosen |
[
{
"from": "system",
"value": "Select only unsubscribed contacts from mailjet on sync script\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom django.db import DEFAULT_DB_ALIAS\n\nfrom optparse import make_option\n\n\nclass Command(BaseCommand):\n\n o... | python | chosen |
[
{
"from": "system",
"value": "Add option to timestamp each line from serial\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom argparse import ArgumentParser\nimport sys\nimport serial\n\ndef run(device, baud):\n with serial.Serial(device, baud, timeout=0.1) as ser:\n whi... | python | chosen |
[
{
"from": "system",
"value": "Use sessions to Tie it a with language. Also helps us to retrieve session code later \"\n\"\n"
},
{
"from": "human",
"value": "from flask import Blueprint, g\n\nweb = Blueprint('web', __name__, template_folder='templates',\n static_folder='static',\n... | python | chosen |
[
{
"from": "system",
"value": "Remove removeOperation from grouped operation\n\nThis function is never used and actually should never be used. The operation may not be modified after it is used, so removing an operation from the list makes no sense.\n"
},
{
"from": "human",
"value": "# Copyright ... | python | chosen |
[
{
"from": "system",
"value": "Add default (7) on limit field queryset model boxes\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#from django.conf import settings\n#from django.utils.importlib import import_module\nfrom django.db import models\nfrom django.uti... | python | chosen |
[
{
"from": "system",
"value": "Allow specifying multiple cmd elements\n"
},
{
"from": "human",
"value": "from lxml import etree\n\nfrom ncclient.xml_ import *\nfrom ncclient.operations.rpc import RPC\n\nclass ExecCommand(RPC):\n def request(self, cmd):\n parent_node = etree.Element(qual... | python | chosen |
[
{
"from": "system",
"value": "Allow toggling active/inactive in VersionAdmin\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom . import models\n\n\nclass BaseReadOnlyAdmin(admin.ModelAdmin):\n list_display_links = None\n\n def has_change_permission(self, request, ... | python | chosen |
[
{
"from": "system",
"value": "tests: Reset configuration fixture after each test"
},
{
"from": "human",
"value": "import pytest\nfrom tests.utils import FakeBugsnagServer\n\nimport bugsnag\n\n\n@pytest.fixture\ndef bugsnag_server():\n server = FakeBugsnagServer()\n bugsnag.configure(endpoi... | python | chosen |
[
{
"from": "system",
"value": "Change python asserts to unittest asserts\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\n tests.unit.utils.cache_test\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Test the salt cache objects\n'''\n\n# Import Salt Testing libs\nfrom salttesting import... | python | chosen |
[
{
"from": "system",
"value": "Add userprefs and email reg view\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\n\n# Create your views here.\n\nfrom registration.views import RegistrationView\nfrom registration.forms import RegistrationFormUniqueEmail\n\nclass EmailRegistra... | python | chosen |
[
{
"from": "system",
"value": "Test in the original URL\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom . import views\n\nurlpatterns = [\n url(r'^linha/(?P<idLinha>[0-9]+)$', views.getLinha),\n url(r'^linha/(?P<idLinha>[0-9]+)/(?P<token>.+)/(?P<lat>.+)/(?P<lng>.+)... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.