conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add Numbers and Symbols Exception\n"
},
{
"from": "human",
"value": "# PyArt by MohamadKh75\n# 2017-10-05\n# ********************\n\nfrom pathlib import Path\n\n\n# Set the Alphabet folder path\nfolder_path = Path(\"Alphabet\").resolve()\n\n\n# Read all Capital Lett... | python | chosen |
[
{
"from": "system",
"value": "Add -- to git log call"
},
{
"from": "human",
"value": "import os\r\nfrom dateutil.parser import parse\r\nfrom ..common import run, chdir\r\n\r\n\r\ndef check_dates(spec_id, username, spec, basedir):\r\n \"\"\" Port of the CheckDates program from C++\r\n F... | python | chosen |
[
{
"from": "system",
"value": "Update instead of overriding `DATABASES` setting in `test` settings.\n"
},
{
"from": "human",
"value": "from ._base import *\n\n# DJANGO ######################################################################\n\nDATABASE_NAME = 'test_%s' % DATABASES['default']['NAME'... | python | chosen |
[
{
"from": "system",
"value": "Update cluster config map key format\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nfrom django.conf import settings\n\nJOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'\nDEFA... | python | chosen |
[
{
"from": "system",
"value": "Add a default null logger per python recommendations.\n"
},
{
"from": "human",
"value": "__author__ = 'katharine'\n\nfrom .exceptions import *\n"
},
{
"from": "gpt",
"value": "__author__ = 'katharine'\n\nimport logging\n\nfrom .exceptions import *\n\nlog... | python | chosen |
[
{
"from": "system",
"value": "Add an (unexposed) ResourceHandler so inheriting objects serialise better\n"
},
{
"from": "human",
"value": "\"\"\"\nPiston handlers for notable resources.\n\"\"\"\n\n\nfrom piston.handler import BaseHandler\nfrom portal import models\n\n\nclass RepositoryHandler(Ba... | python | chosen |
[
{
"from": "system",
"value": "Update script to write results to the database.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n#import hashlib\nimport os\n\ndef main():\n for root, dirs, files in os.walk(\"/mcfs/data/materialscommons\"):\n for f in files:\n print ... | python | chosen |
[
{
"from": "system",
"value": "Bring test_frame_of_test_null_file up to date with new signature of frame_of_test().\n"
},
{
"from": "human",
"value": "from os import chdir, getcwd\nfrom os.path import dirname, basename\nfrom unittest import TestCase\n\nfrom nose.tools import eq_\n\nfrom noseprogr... | python | chosen |
[
{
"from": "system",
"value": "Disable clickjacking protection on demos to display them in iframes\n"
},
{
"from": "human",
"value": "from django.shortcuts import get_object_or_404, render\nfrom django.http import HttpResponseRedirect, HttpResponse, Http404\nfrom django.core.urlresolvers import r... | python | chosen |
[
{
"from": "system",
"value": "Switch to fast method for personal timetable\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n url(r'^personal_fast$', views.get_personal_timetable_fast),\n url(r'^personal$', views.get_personal_tim... | python | chosen |
[
{
"from": "system",
"value": "Make server ignore missing environment variables\n\nThis is by far the best solution for setup, CI and testing purposes.\n"
},
{
"from": "human",
"value": "import os\n\nSQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']\n\nACCESS_TOKEN = os.environ['ACCESS_TOKEN']... | python | chosen |
[
{
"from": "system",
"value": "Use __future__.print_function so syntax is valid on Python 3\n"
},
{
"from": "human",
"value": "'''\nCreated on May 10, 2012\n\n@author: sean\n'''\nfrom .bytecode_consumer import ByteCodeConsumer\nfrom argparse import ArgumentParser\n\nclass ByteCodePrinter(ByteCode... | python | chosen |
[
{
"from": "system",
"value": "Add a new dev (optional) parameter and use it\n\nActually use the functionality in 78e2efd09d61c2abee95590aa637a64fa0618896\n"
},
{
"from": "human",
"value": "import json\nimport logging\nimport argparse\n\nimport emission.net.ext_service.push.notify_usage as pnu\n\... | python | chosen |
[
{
"from": "system",
"value": "Test fixed: WorkbenchUser is auto created by signal, so creating it separately is not required\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom .models import Experiment\nfrom UserManager.models import WorkbenchUser\nfrom django.contrib.auth... | python | chosen |
[
{
"from": "system",
"value": "Support custom initializer in links.CRF1d\n"
},
{
"from": "human",
"value": "from chainer.functions.loss import crf1d\nfrom chainer import link\nfrom chainer import variable\n\n\nclass CRF1d(link.Link):\n\n \"\"\"Linear-chain conditional random field loss layer.\... | python | chosen |
[
{
"from": "system",
"value": "Remove use of deprecated `scan_plugins` method \n\n`scan_plugins` has been deprecated in favour of `scan_plugins_regex`. This \r\nis causing warnings to be logged.\r\n\r\nThe new method takes a regular expression as its first argument, rather than a \r\nsimple prefix string. Th... | python | chosen |
[
{
"from": "system",
"value": "Add python3 support in example\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom itertools import chain\nfrom itertools import imap\n\nimport karld\n\nfrom karld.path import i_walk_csv_paths\n\n\ndef main():\n \"\"\"\n Consume many... | python | chosen |
[
{
"from": "system",
"value": "Fix problem with Hopfield energy function for Python 2.7\n"
},
{
"from": "human",
"value": "from numpy import where\n\n\n__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')\n\n\ndef sign2bin(matrix):\n return where(matrix == 1, 1, 0)\n\n\ndef bin2sign(matrix):\... | python | chosen |
[
{
"from": "system",
"value": "Add proper warnings on use of the backwards compatibility shim.\n"
},
{
"from": "human",
"value": "import sys\nimport types\n\n\nclass ShimModule(types.ModuleType):\n\n def __getattribute__(self, key):\n exec 'from IPython import %s' % key\n return ... | python | chosen |
[
{
"from": "system",
"value": "Use numpy's float supporting range\n"
},
{
"from": "human",
"value": "import matplotlib.pyplot as plt\nfrom operator import gt, lt, itemgetter\nfrom lxml.etree import fromstring, XMLSyntaxError\n\n\ndef frange(start, stop, step):\n cur = start\n op = gt if sta... | python | chosen |
[
{
"from": "system",
"value": "Remove unused imports (besides they are Py 2.x only)\n"
},
{
"from": "human",
"value": "\"\"\"\nCPWeb - A collection of commonly used routines to produce CoolProp's online documentation\n=====\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_functi... | python | chosen |
[
{
"from": "system",
"value": "Implement more TGT Neutral Epics\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\n# Kodorider\nclass AT_099:\n\tinspire = Summon(CONTROLLER, \"AT_099t\")\n"
},
{
"from": "gpt",
"value": "from ..utils import *\n\n\n##\n# Mini... | python | chosen |
[
{
"from": "system",
"value": "Remove Python 3 incompatible print statement\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nRandom graph from given degree sequence.\n\"\"\"\n__author__ = \"\"\"Aric Hagberg (hagberg@lanl.gov)\"\"\"\n__date__ = \"$Date: 2004-11-03 08:11:09 -0700 (... | python | chosen |
[
{
"from": "system",
"value": "Fix public body search index by indexing jurisdiction name"
},
{
"from": "human",
"value": "from django.conf import settings\n\nfrom haystack import indexes\nfrom haystack import site\n\nfrom publicbody.models import PublicBody\nfrom helper.searchindex import Queued... | python | chosen |
[
{
"from": "system",
"value": "Print the traceback as well for debugging purposes.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport logging\nimport click\nfrom os import path\n\n# Add top-level module path to sys.path before importing tubular code.\nsys.path.append( pa... | python | chosen |
[
{
"from": "system",
"value": "Improve the get_nick a tiny amount\n"
},
{
"from": "human",
"value": "class IRCMessage:\n\n \"\"\" Class to store and parse an IRC Message. \"\"\"\n\n def __init__(self, msg):\n \"\"\" Parse a raw IRC message to IRCMessage. \"\"\"\n self.sender =... | python | chosen |
[
{
"from": "system",
"value": "Update to test for mount setup\n"
},
{
"from": "human",
"value": "from nose.tools import raises\n\nimport panoptes\nfrom panoptes.mount.ioptron import Mount\n\nclass TestIOptron():\n\n\t@raises(AssertionError)\n\tdef test_no_config_no_commands(self):\n\t\t\"\"\" Mou... | python | chosen |
[
{
"from": "system",
"value": "Add argument for execution of defective server.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n\n\"\"\" Main script. Executes the XML Server implementation with an HTTP\n connection and default parameters.\n\... | python | chosen |
[
{
"from": "system",
"value": "Rename user_id config key to admin_user_id\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport requests\n\nCONFIG_DIR = \"config\"\n\n\nclass Bot:\n def __init__(self):\n self.config = Config(CONFIG_DIR)\n self.api = TelegramBotApi(s... | python | chosen |
[
{
"from": "system",
"value": "Raise exception if connection not succeed and customize error message\n"
},
{
"from": "human",
"value": "import requests\nimport os\nfrom .endpoints import *\n\n\nclass UnauthorizedToken(Exception):\n pass\n\n\nclass ReviewsAPI:\n\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix data provider example file.\n"
},
{
"from": "human",
"value": "from pytf.dataprovider import DataProvider\n\ntry:\n from unittest.mock import call\nexcept ImportError:\n from mock import call\n\n\n@DataProvider([call(max=5), call(max=10), call(max=15)])\nc... | python | chosen |
[
{
"from": "system",
"value": "Clarify the comment about setting the PYTHON variable for the Doc Makefile.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n Sphinx - Python documentation toolchain\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: 2007 by Georg ... | python | chosen |
[
{
"from": "system",
"value": "monkeysphere: Allow SHA256 hashes in URLs\n"
},
{
"from": "human",
"value": "#\n# This file is part of Plinth.\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published b... | python | chosen |
[
{
"from": "system",
"value": "Update links when it starts getting redirected\n"
},
{
"from": "human",
"value": "import os\nimport time\n\nfrom constants import *\nfrom dbhelper import *\nfrom dbItemManagerV2 import DbItemManagerV2\nfrom link import Link\n\nLINK_EXPIRY_TIME_IN_DAYS = 80\n\nclass ... | python | chosen |
[
{
"from": "system",
"value": "Use windows API to change the AppID and use our icon.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# coding: utf-8\n# Raytheon BBN Technologies 2016\n# Contributiors: Graham Rowlands\n#\n# This file runs the main loop\n\n# Use PyQt5 by default\nimport ... | python | chosen |
[
{
"from": "system",
"value": "Add 'me' to profile IdentifierError\n"
},
{
"from": "human",
"value": "from ..error import IdentifierError\nfrom ..objects.profile import Profile\nfrom .base import Base\n\n\nclass Profiles(Base):\n RESOURCE_ID_PREFIX = 'pfl_'\n\n def get_resource_object(self,... | python | chosen |
[
{
"from": "system",
"value": "Fix form retrieval in ModelForm\n"
},
{
"from": "human",
"value": "from achilles.forms import * # noqa\nfrom nazs.models import SingletonModel\n\n\n# Override forms template\nForm.template_name = 'web/form.html'\n\n\nclass ModelForm(ModelForm):\n\n def get_form(... | python | chosen |
[
{
"from": "system",
"value": "FIX price sec. related field as readonly\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in module root\n# direct... | python | chosen |
[
{
"from": "system",
"value": "Fix bug that prevent commands with no values from being added\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Camera(models.Model):\n ssid = models.CharField(max_length=255)\n password = models.CharField(max_length=255)\n date_add... | python | chosen |
[
{
"from": "system",
"value": "Remove default classifier path from default config\n"
},
{
"from": "human",
"value": "\"\"\"\nBase line settings\n\"\"\"\n\nCONFIG = {\n 'input_path': None,\n 'backup_path': None,\n 'dest_path': None,\n 'life_all': None,\n 'db': {\n 'host': Non... | python | chosen |
[
{
"from": "system",
"value": "Update model and add TODO\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom datetime import datetime\n\nfrom app import db\n\n\nclass Checkup(db.Model):\n __tablename__ = 'checkup'\n\n id = db.Column(db.Integer, primary_key=True)\n created = ... | python | chosen |
[
{
"from": "system",
"value": "Move imports inside initialize() method so that we don’t break things on initial setup."
},
{
"from": "human",
"value": "import shopify\n\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\n\n\nVERSION = (0, 1, 5)\n__versi... | python | chosen |
[
{
"from": "system",
"value": "Increment version for speedup release"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright 2016 Randal S. Olson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software\nand associated documentation fi... | python | chosen |
[
{
"from": "system",
"value": "Add error handling for when the meter name does not match the NEM file\n"
},
{
"from": "human",
"value": "\"\"\"\n metering.loader\n ~~~~~~~~~\n Define the meter data models\n\"\"\"\n\nfrom nemreader import read_nem_file\nfrom sqlalchemy.orm import sessionm... | python | chosen |
[
{
"from": "system",
"value": "Add string representation for Activity model\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Activity(models.Model):\n name = models.CharField(max_length=200)\n description = models.TextField()\n"
},
{
"from": "gpt",
"value... | python | chosen |
[
{
"from": "system",
"value": "Make functions that pull a number of tweets and pics\n"
},
{
"from": "human",
"value": "\"\"\" Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django\"\"\"\n\nimport os\nfrom flask import Flask\n\napp = Flask(__name__)\n\n@app.route('... | python | chosen |
[
{
"from": "system",
"value": "Change read_chrom_sizes to read from a FAIDX index if available\n"
},
{
"from": "human",
"value": "from wrappers import bowtie2, picard, samtools\r\n\r\n\r\ndef create_reference_indices(ref_fn):\r\n '''\r\n For a given reference FASTA file, generate several in... | python | chosen |
[
{
"from": "system",
"value": "Remove unused NHS database mockup\n"
},
{
"from": "human",
"value": "import os\n_basedir = os.path.abspath(os.path.dirname(__file__))\n# Plugin settings\nDATABASE_NAMES = ['atc', 'nhs', 'sms']\n# Using sqlite for local development, will be SQL on production.\nSQLALC... | python | chosen |
[
{
"from": "system",
"value": "Add comments indicating source of formulae..\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\ndef sum_seq_squares(n):\n return (n * (n+1) * ((2*n)+1)) / 6\n\ndef sum_seq(n):\n return (n * (n + 1)) / 2\n\ndef main():\n\tsum_seq_sq_100 = sum_seq_squar... | python | chosen |
[
{
"from": "system",
"value": "Update get_time to handle timeout errors.\n"
},
{
"from": "human",
"value": "\"\"\" app.py \"\"\"\n\nfrom flask import Flask, render_template\nimport requests\n\n\napp = Flask(__name__)\n\n\ndef get_time():\n try:\n response = requests.get('http://localhos... | python | chosen |
[
{
"from": "system",
"value": "Add url callback on custom login\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom bottle.ext import auth\n\nfrom utils import conf\n\n\ntry:\n auth_import = conf('auth')['engine'].split('.')[-1]\n auth_from = u\".\".join(... | python | chosen |
[
{
"from": "system",
"value": "Add error field to expected JSON\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.test.client import Client\nfrom django.core.urlresolvers import reverse\nfrom whats_fresh_api.models import *\nfrom django.contrib.gis.db import models\... | python | chosen |
[
{
"from": "system",
"value": "Add more imports for further functionality\n\n`flask_login`, `flask_restless`, `flask_sqlalchemy`"
},
{
"from": "human",
"value": "import os\nimport sys\n\ntry:\n from flask import Flask, render_template, send_file, Response \n import requests\nexcept Impor... | python | chosen |
[
{
"from": "system",
"value": "Add absolute URL for Surprises\n\nThis allows the CreateView to work correctly\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Surprise(models.Model):\n link = models.URLField(max_length=500)\n description = models.TextField(max_leng... | python | chosen |
[
{
"from": "system",
"value": "Handle exception for bad search strings\n"
},
{
"from": "human",
"value": "from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery\n\nimport shlex\nimport string\n\ndef parseSearchString(search_string):\n search_strings = shlex.split(sear... | python | chosen |
[
{
"from": "system",
"value": "Fix get_sort_by_toggle to work with QueryDicts with multiple values\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\ntry:\n from itertools import zip_longest\nexcept ImportError:\n from itertools import izip_longest as zip_longest\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove BaseMail dependency on User object\n"
},
{
"from": "human",
"value": "from django.core.mail import EmailMultiAlternatives\nfrom django.template import Context, Template\nfrom django.template.loader import get_template\nfrom django.conf import settings\n\nimpo... | python | chosen |
[
{
"from": "system",
"value": "Build 1.14.0.1 package for Windows\n"
},
{
"from": "human",
"value": "# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python\n\nfrom cerbero.packages import package\nfrom cerbero.enums import License\n\nclass GStreamer:\n\n url = \"http://gstreamer.freedes... | python | chosen |
[
{
"from": "system",
"value": "Write the last point for plot completeness\n"
},
{
"from": "human",
"value": "\n# MONOTONE\n\n# Produce a monotonically decreasing output plot from noisy data\n# Input: columns: t x\n# Output: columns: t_i x_i , sampled such that x_i <= x_j\n# ... | python | chosen |
[
{
"from": "system",
"value": "Make \"near\" group optional in regex\n\nSome errors output with a column number. For these, the `near` group should match.\r\n\r\n```\r\n1:2 semicolons error unnecessary semicolon found\r\n```\r\n\r\nBut some won't. For these, the `near` match should be optional.\r\n\r\n```\r\... | python | chosen |
[
{
"from": "system",
"value": "Add `debug=True` to avoid restarting the server after each change\n"
},
{
"from": "human",
"value": "\nimport io\nimport json\nimport logging\nimport os\nimport pdb\nimport traceback\n\nfrom logging import config\n\nfrom functools import wraps\n\nfrom flask import (... | python | chosen |
[
{
"from": "system",
"value": "Fix the REST module name.\n"
},
{
"from": "human",
"value": "import datetime\nimport pytz\nfrom nose.tools import (assert_is_none)\n\nfrom qipipe.helpers.qiprofile_helper import QIProfile\nfrom qiprofile.models import Project\nfrom test import project\nfrom test.hel... | python | chosen |
[
{
"from": "system",
"value": "Make app accessible outside the development machine."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask.ext.script import Manager, Server\nfrom yoyo import create_app\n\n\nmanager = Manager(create_app)\nmanager.add_option('-c', '--configfile', de... | python | chosen |
[
{
"from": "system",
"value": "Fix model import needed by create_all()\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom flask_script import Manager\nfrom flask_migrate import Migrate, MigrateCommand\n\nfrom service import app, db\n\n# db.create_all() needs all models to be import... | python | chosen |
[
{
"from": "system",
"value": "Fix persistence of 'sort by' preference on Windows\n"
},
{
"from": "human",
"value": "from PySide.QtCore import QSettings\n\nfrom inselect.lib.sort_document_items import sort_document_items\n\n# QSettings path\n_PATH = 'sort_by_columns'\n\n# Global - set to instance... | python | chosen |
[
{
"from": "system",
"value": "Fix convert to support python 2 and python 3\n"
},
{
"from": "human",
"value": "class KeyMaker(object):\n def __init__(self, prefix):\n self.prefix = prefix\n\n def convert(self, arg):\n return str(arg)\n\n def args_to_key(self, args):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add dialog title to example\n"
},
{
"from": "human",
"value": "\"\"\"Example showing the Ask User dialog controls and overall usage.\"\"\"\n\nimport fusionless as fu\n\ndialog = fu.AskUserDialog()\ndialog.add_text(\"text\", default=\"Default text value\")\ndialog.ad... | python | chosen |
[
{
"from": "system",
"value": "Fix name (copy paste fail...)\n"
},
{
"from": "human",
"value": "import json\n\nfrom ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree\nfrom ppp_datamodel i... | python | chosen |
[
{
"from": "system",
"value": "Use passed directory in mako engine.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Provide the mako templating engine.\"\"\"\n\nfrom __future__ import print_function\n\n\nfrom mako.template import Template\nfrom mako.lookup import TemplateLookup\n\... | python | chosen |
[
{
"from": "system",
"value": "Add handling of invalid values\n\nValues that are not defined in the data dictionary will be replaced by None.\n"
},
{
"from": "human",
"value": "import pandas as pd\n\nfrom .datadicts import diary\n\n\ndef read_diary_file(path_to_file):\n return pd.read_csv(\n ... | python | chosen |
[
{
"from": "system",
"value": "Allow tests to be called from parent directory of \"test\"\n\ngit-svn-id: 397be6d5b34b040010577acc149a81bea378be26@89 1754e6c4-832e-0410-bb55-0fb906f63d99\n"
},
{
"from": "human",
"value": "import optparse, sys, StringIO\nsys.path.append(\"..\")\nimport ctypesgencor... | python | chosen |
[
{
"from": "system",
"value": "Add __all__ to segmentation package\n"
},
{
"from": "human",
"value": "from .random_walker_segmentation import random_walker\nfrom ._felzenszwalb import felzenszwalb\nfrom ._slic import slic\nfrom ._quickshift import quickshift\nfrom .boundaries import find_boundari... | python | chosen |
[
{
"from": "system",
"value": "Fix USE_X_FORWARDED_FOR for proxied environments\n\nThe settings for USE_X_FORWARDED_FOR were not being respected because the settings were not being passed through."
},
{
"from": "human",
"value": "\nfrom django.conf import settings\n\nDEFAULT_REALM = getattr(setti... | python | chosen |
[
{
"from": "system",
"value": "Add captured_at timestamp to POST payload\n\nTimestamp is in ISO 8601 format\n"
},
{
"from": "human",
"value": "import evdev\nimport requests\nimport json\nimport datetime\nimport yaml\n\ndef main():\n config = load_config()\n\n dev = evdev.InputDevice(config['dev... | python | chosen |
[
{
"from": "system",
"value": "Fix test on kaos with latest qt5\n"
},
{
"from": "human",
"value": "from pyqode.core.api import TextHelper\nfrom pyqode.qt.QtTest import QTest\n\n\ndef test_toggle_button(editor):\n editor.file.open('test/files/example.json')\n editor.show()\n TextHelper(ed... | python | chosen |
[
{
"from": "system",
"value": "Add cache in opps menu list via context processors\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.utils import timezone\nfrom django.conf import settings\nfrom django.contrib.sites.models import get_current_site\n\nfrom .models import Channe... | python | chosen |
[
{
"from": "system",
"value": "Comment post endpoint return a ksopn, fix issue saving comments add post id and convert it to int\n"
},
{
"from": "human",
"value": "from flask import jsonify\nfrom flask_classy import FlaskView\nfrom flask_user import current_user, login_required\nfrom ..models imp... | python | chosen |
[
{
"from": "system",
"value": "Clean up package level imports\n"
},
{
"from": "human",
"value": "__version__ = '0.2'\nfrom .mzml_loader import mzml_to_hdf\nfrom .h5_query import plot_heatmap, plot_spectrogram, plot_xic\nfrom .h5_query import get_data, get_XIC, get_HeatMapRTMZ, get_spectrogram\n"
... | python | chosen |
[
{
"from": "system",
"value": "Use test database on alembic when necessary\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport ... | python | chosen |
[
{
"from": "system",
"value": "Change order of API call\n"
},
{
"from": "human",
"value": "from flask import Blueprint, jsonify\n\nfrom .security import validate_request_authentication\nfrom qiime.sdk import PluginManager\n\nPLUGIN_MANAGER = PluginManager()\nv1 = Blueprint('v1', __name__)\nv1.bef... | python | chosen |
[
{
"from": "system",
"value": "Update only tables in visible schemas\n"
},
{
"from": "human",
"value": "\"\"\"Add meta_search table\n\nRevision ID: 1a73867b1e79\nRevises: 1c6e2fb3d3b6\nCreate Date: 2019-04-29 11:47:04.783168\n\n\"\"\"\nimport sqlalchemy as sa\nfrom alembic import op\nfrom sqlalch... | python | chosen |
[
{
"from": "system",
"value": "Add `one` as shortcut to `dimensionless_unscaled`\n\nI find creating dimensionless `Quantity`es overly painful compared to quantities with dimensions. Currently the two existing options are:\r\n\r\n1. Putting `u.km`, `u.s` next to `u.dimensionless_unscaled`. Too large.\r\n2. Pu... | python | chosen |
[
{
"from": "system",
"value": "Disable exception logging of status code 500 during testing.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n This module sets up the view for handling ``500 Internal Server Error`` errors.\n\"\"\"\n\nimport datetime\n\nimport flask\nimport ... | python | chosen |
[
{
"from": "system",
"value": "Support for non-blank server roots\n\nUsing request.path_info instead of request.path for regex matching.\nThis opens support for root server URLs such in the form of\n'www.example.com/django_root/<view_url>'\n"
},
{
"from": "human",
"value": "from django.contrib.au... | python | chosen |
[
{
"from": "system",
"value": "Clarify comment about Pyhton versions\n"
},
{
"from": "human",
"value": "\"\"\"\nScheduler queues\n\"\"\"\n\nimport marshal\nfrom six.moves import cPickle as pickle\n\nfrom queuelib import queue\n\ndef _serializable_queue(queue_class, serialize, deserialize):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix imports at top of file.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# OpenERP, Open Source Management Solution\n# This module copyright (C) 2013 Therp BV (<h... | python | chosen |
[
{
"from": "system",
"value": "Add period at end of plug-in description\n\nFor consistency. All other plug-ins have this (no really, now).\n\nContributes to issue CURA-1190.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Cura is released under the terms of the AGPLv3 or... | python | chosen |
[
{
"from": "system",
"value": "Update [MediaContainer] children with the correct `section` object\n"
},
{
"from": "human",
"value": "from plex.objects.core.base import Property\nfrom plex.objects.container import Container\nfrom plex.objects.library.section import Section\n\n\nclass MediaContaine... | python | chosen |
[
{
"from": "system",
"value": "Remove indentation level for easier review\n"
},
{
"from": "human",
"value": "\"\"\"\nPython introspection helpers.\n\"\"\"\n\nfrom types import CodeType as code, FunctionType as function\n\n\ndef copycode(template, changes):\n if hasattr(code, \"replace\"):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix for DjangoCMS 3.5: get_cms_setting\n\nImportError: cannot import name get_cms_setting"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nfrom cms.sitemaps import CMSSitemap\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Disable output example_pic.png if exists\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom pyogi.board import Board\nfrom pyogi.plot import plot_board\n\n\nif __name__ == '__main__':\n\n board = Board()\n board.set_initi... | python | chosen |
[
{
"from": "system",
"value": "Add DOI parsing to identifiers\n"
},
{
"from": "human",
"value": "'''\nHarvester for the Smithsonian Digital Repository for the SHARE project\n\nExample API call: http://repository.si.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc\n'''\nfrom __future__ impor... | python | chosen |
[
{
"from": "system",
"value": "Sort the context list in alphabetical order\n"
},
{
"from": "human",
"value": "# Copyright (C) 2010 Jonathan Harker <jon@jon.geek.nz>\n#\n# This file is part of Libravatar\n# \n# Libravatar is free software: you can redistribute it and/or modify\n# it under the ter... | python | chosen |
[
{
"from": "system",
"value": "Remove weight from category serializer\n"
},
{
"from": "human",
"value": "from .models import Category, Keyword\r\nfrom rest_framework import serializers\r\n\r\n\r\nclass CategorySerializer(serializers.ModelSerializer):\r\n class Meta(object):\r\n model = ... | python | chosen |
[
{
"from": "system",
"value": "Implement a noisy __del__ in BaseServer.\n\nIt will complain if the server is still running, and attempt to stop it.\n"
},
{
"from": "human",
"value": "from testrunner import testhelp\n\nclass BaseServer(object):\n \"Base server class. Responsible with setting up... | python | chosen |
[
{
"from": "system",
"value": "Write FASTA output to standard out.\n"
},
{
"from": "human",
"value": "\"\"\"\nConvert a prepared JSON file from augur into a FASTA file.\n\"\"\"\nimport argparse\nimport Bio\nimport json\nimport logging\nimport sys\n\nsys.path.append('..')\n\nfrom base.sequences_pr... | python | chosen |
[
{
"from": "system",
"value": "Fix \"quiet\" mode for shell.execute()\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\n\nfrom ..platform_name import platform_name\n\nif platform_name() == 'windows':\n from .windows import *\nelse:\n from .posix import *\n\n\nclass shell_list... | python | chosen |
[
{
"from": "system",
"value": "Mark beginning of each section with a letter\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n\"\"\"TODO:\n * more flexible sorting options\n * use -o to specify output file\n * check more explicitly for errors in JSON files\n\"\"\"\n\nimport json, sys\n... | python | chosen |
[
{
"from": "system",
"value": "Remove unneeded import of json module.\n"
},
{
"from": "human",
"value": "# This is a software index handler that gives a score based on the\n# number of mentions in open access articles. It uses the CORE\n# aggregator (http://core.ac.uk/) to search the full text o... | python | chosen |
[
{
"from": "system",
"value": "Convert print statement to sys.stderr.write()\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# PYTHON_ARGCOMPLETE_OK\nimport os, imp, inspect\nfrom interpreter import cli_interface\n\ndef k_runner():\n \"\"\"CLI interpreter for the k command.\"\"\"\n ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.