conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add south to list of installed apps to create migrations\n"
},
{
"from": "human",
"value": "from armstrong.dev.tasks import *\n\nsettings = {\n 'DEBUG': True,\n 'INSTALLED_APPS': (\n 'django.contrib.contenttypes',\n 'armstrong.core.arm_wells',\n ... | python | chosen |
[
{
"from": "system",
"value": "Update the version to 0.1.8\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*-coding:UTF-8 -*-\n\nfrom setuptools import setup, find_packages\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__))\n\nsetup(\n name='dictmysqldb',\n\n versi... | python | chosen |
[
{
"from": "system",
"value": "Change links to blaze org\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom os.path import exists\nfrom setuptools import setup\n\nsetup(name='cachey',\n version='0.1.1',\n description='Caching mindful of computation/storage costs',\n u... | python | chosen |
[
{
"from": "system",
"value": "Return to using latest versions, now vcrpy is fixed.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n__version__ = None\nwith open('mendeley/version.py') as f:\n exec(f.read())\n\nsetup(\n name='mendeley',\n version=__version__,\n pack... | python | chosen |
[
{
"from": "system",
"value": "Add unit tests for enqueue, dequeue and length for Queue\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom aids.queue.queue import Queue\n\nclass QueueTestCase(unittest.TestCase):\n '''\n Unit tests for the Queue data structure\n\n '''\n \n def ... | python | chosen |
[
{
"from": "system",
"value": "Add '+' to list of skipped symbols.\n"
},
{
"from": "human",
"value": "from lib import BaseTest\nimport re\n\n\nclass ShowMirror1Test(BaseTest):\n \"\"\"\n show mirror: regular mirror\n \"\"\"\n fixtureCmds = [\"aptly mirror create mirror1 http://mirror.... | python | chosen |
[
{
"from": "system",
"value": "ZON-3409: Update to version with celery.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nsetup(\n name='zeit.campus',\n version='1.6.4.dev0',\n author='Zeit Online',\n author_email='zon-backend@zeit.de',\n url='http... | python | chosen |
[
{
"from": "system",
"value": "Add Chardet as installation dependency\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom distutils.core import setup\n\nsetup(\n name='freki',\n version='0.3.0-develop',\n description='PDF-Extraction helper for RiPLEs pipeline.',\n author='M... | python | chosen |
[
{
"from": "system",
"value": "Add a description content type for PyPI\n\nA long_description_content_type is required since our README is in markdown\ninstead of restructured text.\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom setuptools import find_packages\n\nwith op... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Updating version now that docs are up-to-date\"\n\nThis reverts commit 3f2ed8f7bfbed7162f4047cea534d83e52e714af.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nconfig = {\n 'include_package_data': True,\n 'description': 'Simulated ... | python | chosen |
[
{
"from": "system",
"value": "Exclude tests and cmdline scripts\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n\tname='coverpy',\n\tversion='0.0.2dev',\n\tpackages=find_packages(),\n\tinstall_requires=['requests'],\n\tlicense='MIT License',\n\tlong_desc... | python | chosen |
[
{
"from": "system",
"value": "Add package dependencies for printing and testing\n\nSigned-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nwith open('README.rst') as f:\n readme = f.re... | python | chosen |
[
{
"from": "system",
"value": "Handle cases where nvidia-smi does not exist\n"
},
{
"from": "human",
"value": "from setuptools import setup\nfrom subprocess import check_output, CalledProcessError\n\ntry:\n num_gpus = len(check_output(['nvidia-smi', '--query-gpu=gpu_name',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add LINCENSE to included files.\n"
},
{
"from": "human",
"value": "\"\"\"\\\nGrip\n----\n\nRender local readme files before sending off to Github.\n\n\nGrip is easy to set up\n``````````````````````\n\n::\n\n $ pip install grip\n $ cd myproject\n $ grip\n ... | python | chosen |
[
{
"from": "system",
"value": "Use unaltered markdown readme for long_description\n"
},
{
"from": "human",
"value": "\"\"\"\nSetup script for the kvadratnet module.\n\"\"\"\n\nimport os\nimport subprocess\nfrom setuptools import setup\n\nimport kvadratnet\n\n\ndef readme():\n \"\"\"\n Retur... | python | chosen |
[
{
"from": "system",
"value": "Add clean command and remove download tarball\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\n__version__ = None\nexec(open('tadtool/version.py').read())\n\nsetup(\n name='tadtool',\n version=__version__,\n description='A... | python | chosen |
[
{
"from": "system",
"value": "Set install_requires: django >= 1.3, < 1.9\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nfrom djcelery_ses import __version__\n\n\nsetup(\n name='django-celery-ses',\n version=__version__,\n description=\"django-celery-ses\... | python | chosen |
[
{
"from": "system",
"value": "Fix for incorrect project url\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom dyn import __version__\n\nwith open('README.rst') as f:\n readme = f.read()\nwith open('HISTORY.rst') as f:\n history = f.read()\n\nsetup(\n name='dyn',\... | python | chosen |
[
{
"from": "system",
"value": "Add missing comma to requirements.\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup\n\nversion = '0.9.2.dev0'\n\n\ndef read_file(fname):\n with open(os.path.join(os.path.dirname(__file__), fname)) as fp:\n return fp.read()\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Exclude test package from builds.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\n\nfrom setuptools import setup, find_packages\nfrom eodatasets import __version__ as version\n\n# Append TeamCity build number if it gives us one.\nif 'BUILD_NUM... | python | chosen |
[
{
"from": "system",
"value": "Add a dependency on healpy\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nfrom numpy.distutils.core import setup, Extension\n\n# Utility function to read the README file.\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file_... | python | chosen |
[
{
"from": "system",
"value": "Fix installation on systems where locales are not properly configured\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom setuptools.command.install import install\n\n\ntry:\n description = open('README.txt').read()\nexcept:\n description... | python | chosen |
[
{
"from": "system",
"value": "Add scipy to project requirements list\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='manifold',\n version='1.0.0',\n packages=find_packages(include=('manifold', 'manifold.*')),\n long_description=open('R... | python | chosen |
[
{
"from": "system",
"value": "Set homepage for package as github url\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n setup\n\n :copyright: (c) 2012-2014 by Openlabs Technologies & Consulting (P) Limited\n :license: GPLv3, see LICENSE for more details.\n\"\"\"\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Update test requirement for PTB\n"
},
{
"from": "human",
"value": "import codecs\n\nfrom os import path\nfrom setuptools import find_packages, setup\n\n\ndef read(*parts):\n filename = path.join(path.dirname(__file__), *parts)\n with codecs.open(filename, enco... | python | chosen |
[
{
"from": "system",
"value": "Switch from py2exe to cx_Freeze\n\npy2exe had issues with pycrypto. cx_Freeze seems to work.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\nimport py2exe\n\nsetup(console=['CryptoUnLocker.py'])\n"
},
{
"from": "... | python | chosen |
[
{
"from": "system",
"value": "Reduce nose version to 1.3.0 for Travis CI.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(name='polycircles',\n version='0.1',\n description='Polycircles: WGS84 Circle approximations using polygons',\n url='http://github.com... | python | chosen |
[
{
"from": "system",
"value": "Revert back to PyBindGen as package name because it's what is already registered in PyPI.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nimport os\nfrom distutils.core import setup\n\nsys.path.insert(0, os.path.dirname(__file__))\nfrom wutils ... | python | chosen |
[
{
"from": "system",
"value": "Check if all sequences are of the same length\n"
},
{
"from": "human",
"value": "import logging\n\n__author__ = \"Antonio J. Nebro\"\n__license__ = \"GPL\"\n__version__ = \"1.0-SNAPSHOT\"\n__status__ = \"Development\"\n__email__ = \"antonio@lcc.uma.es\"\n\nlogging.b... | python | chosen |
[
{
"from": "system",
"value": "Modify the pin number due to the hardware case\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport RPi.GPIO as gpio\n\n\npin_power=12\npin_light=16\n\n# Setup\ngpio.setmode(gpio.BOARD)\ngpio.setup(pin_power, gpio.OUT)\ngpio.setup(pin_light, gpio.OUT)\... | python | chosen |
[
{
"from": "system",
"value": "[Telemetry] Make profile generator wait for pages to load completely.\n\nThe bug that causes this not to work is fixed. It is possible that this\nnon-determinism in the profile could lead to flakiness in the session_restore\nbenchmark.\n\nBUG=375979\n\nReview URL: https://coder... | python | chosen |
[
{
"from": "system",
"value": "Include current classpath when starting java VM\n"
},
{
"from": "human",
"value": "\"\"\"Handles all imports from jnius to prevent conflicts resulting from attempts\nto set JVM options while the VM is already running.\"\"\"\n\nimport os\nimport warnings\nimport jniu... | python | chosen |
[
{
"from": "system",
"value": "Enable leak checks on our ASAN bots.\n\nAfter updating our suppressions, I had clean LSAN runs of dm and nanobench\nyesterday on my desktop. Hopefully this will hold true for the bots.\n\nBUG=skia:\nR=borenet@google.com, mtklein@google.com\n\nAuthor: mtklein@chromium.org\n\nRe... | python | chosen |
[
{
"from": "system",
"value": "Add sample url patterns to views for management functions.\n"
},
{
"from": "human",
"value": "# Copyright (C) 2011 by Christopher Adams\n# Released under MIT License. See LICENSE.txt in the root of this\n# distribution for details.\n\nfrom django.conf.urls.defaults ... | python | chosen |
[
{
"from": "system",
"value": "Make the message panel accessible via menu\n"
},
{
"from": "human",
"value": "import sublime\nimport sublime_plugin\n\nPANEL_NAME = \"SublimeLinter Messages\"\nOUTPUT_PANEL = \"output.\" + PANEL_NAME\n\n\ndef plugin_unloaded():\n for window in sublime.windows():\... | python | chosen |
[
{
"from": "system",
"value": "Add Course field to Admin\n\nOops! forgot..\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import Grade, Group, Pupil, Teacher, Warden\n\nfor model in {Grade, Group, Pupil, Teacher, Warden}:\n admin.site.register(model)\n"
... | python | chosen |
[
{
"from": "system",
"value": "Remove a troubling import *\n"
},
{
"from": "human",
"value": "from mbuild.box import Box\nfrom mbuild.coarse_graining import coarse_grain\nfrom mbuild.coordinate_transform import *\nfrom mbuild.compound import *\nfrom mbuild.pattern import *\nfrom mbuild.packing im... | python | chosen |
[
{
"from": "system",
"value": "Mark the usernames to work only with wikipedia\n\nBug: T120334\n"
},
{
"from": "human",
"value": "import os\n\nmylang = 'test'\nfamily = 'wikipedia'\n\n\ncustom_path = os.path.expanduser('~/user-config.py')\nif os.path.exists(custom_path):\n with open(custom_path... | python | chosen |
[
{
"from": "system",
"value": "Create a random db for the tests each time.\n"
},
{
"from": "human",
"value": "import os\nfrom unittest import TestCase\nimport webtest\n\n\nHERE = os.path.dirname(os.path.abspath(__file__))\n\n\nclass BaseWebTest(TestCase):\n \"\"\"Base Web Test to test your cor... | python | chosen |
[
{
"from": "system",
"value": "Index slugs to reduce search page queries\n"
},
{
"from": "human",
"value": "from haystack import indexes\nfrom tx_people.models import Organization\nfrom tx_salaries.models import Employee\n\n\nclass EmployeeIndex(indexes.SearchIndex, indexes.Indexable):\n text ... | python | chosen |
[
{
"from": "system",
"value": "Fix a problem with a migration between master and stable branch\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.2 on 2016-05-30 10:04\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.db i... | python | chosen |
[
{
"from": "system",
"value": "Add go_api as a dependency.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"go_contacts\",\n version=\"0.1.0a\",\n url='http://github.com/praekelt/go-contacts-api',\n license='BSD',\n description=\"A c... | python | chosen |
[
{
"from": "system",
"value": "Remove Django from dependencies to avoid auto upgrade\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\n\n\nDESCRIPTION = 'Send emails using Django template system'\n\nLONG_DESCRIPTION = None\ntry:\n LONG_DESCRIPTION = ope... | python | chosen |
[
{
"from": "system",
"value": "Remove upper case Not Present\n"
},
{
"from": "human",
"value": "from django import forms\nfrom datasets.models import DatasetRelease, CategoryComment\n\n\nclass DatasetReleaseForm(forms.ModelForm):\n max_number_of_sounds = forms.IntegerField(required=False)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "ext_blog: Allow customizing number of posts displayed\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django import template\nfrom django.conf import settings\nfrom Instanssi.ext_blog.models import BlogEntry\n\nregister = template.Library()\n\n@re... | python | chosen |
[
{
"from": "system",
"value": "Create SimpleServerState object if it doesn't exist.\n"
},
{
"from": "human",
"value": "import socket\n\nfrom ood.minecraft import Client\nfrom ood.models import SimpleServerState\n\n\nclass SimpleServerController(object):\n\n def __init__(self, ood_instance):\n ... | python | chosen |
[
{
"from": "system",
"value": "Make test helpers py 3 compatable\n"
},
{
"from": "human",
"value": "import base64\nimport unittest\n\n\ndef setup_package(self):\n pass\n\n\ndef teardown_package(self):\n pass\n\n\nclass BaseS3EncryptTest(unittest.TestCase):\n\n def decode64(self, data):\n... | python | chosen |
[
{
"from": "human",
"value": "Test package setup and teardown\n"
},
{
"from": "gpt",
"value": "import logging\nimport unittest\n\nfrom cassandra.cluster import Cluster\nfrom cassandra.connection import _loop\nfrom cassandra.policies import HostDistance\n\nlog = logging.getLogger()\nlog.setLevel('... | python | chosen |
[
{
"from": "system",
"value": "fix: Add csrf_exempt to webhook view\n"
},
{
"from": "human",
"value": "from django.http.response import HttpResponse\n\n\ndef webhook(request):\n return HttpResponse('Webhooks not implemented yet', status=501)\n"
},
{
"from": "gpt",
"value": "from dj... | python | chosen |
[
{
"from": "system",
"value": "Remove extraneous and problematic import\n"
},
{
"from": "human",
"value": "import operator\nfrom itertools import imap, repeat\n\nfrom spicedham.config import load_config\nfrom spicedham.baseplugin import BasePlugin\n\nclass NonsenseFilter(BasePlugin):\n \"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "API: Add register_handler with the API.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nfrom .commands import insert_resource, insert_datum, retrieve\n"
},
{
"from": "gpt",
"value": "from __future__ ... | python | chosen |
[
{
"from": "system",
"value": "Make sha256 and sha512 sink names correspond to their commandline arguments\n"
},
{
"from": "human",
"value": "import hashlib\n\nfrom digestive.io import Sink\n\n\nclass HashDigest(Sink):\n def __init__(self, name, digest):\n super().__init__(name)\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong variable reference in configuration\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport os\nfrom datetime import timedelta\n\n_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))\n\nDEFAULT_SERVICE_PORT = 34000\nSWAGGER_YAML_PATH ... | python | chosen |
[
{
"from": "system",
"value": "Fix code which executes on module load.\n"
},
{
"from": "human",
"value": "from pkg_resources import iter_entry_points\n\nfrom spicedham.config import config\n\n# TODO: Wrap all of this in an object with this in an __init__ function\nplugins = []\nfor plugin in iter... | python | chosen |
[
{
"from": "system",
"value": "Update LICENSE in package metadata\n"
},
{
"from": "human",
"value": "__title__ = 'vcspull'\n__package_name__ = 'vcspull'\n__description__ = 'synchronize your repos'\n__version__ = '1.0.3'\n__author__ = 'Tony Narlock'\n__email__ = 'tony@git-pull.com'\n__license__ = ... | python | chosen |
[
{
"from": "system",
"value": "Use original LexicalIDs in Access\n"
},
{
"from": "human",
"value": "from thinglang.lexer.symbols.base import LexicalIdentifier\nfrom thinglang.parser.tokens import BaseToken, DefinitionPairToken\nfrom thinglang.parser.tokens.collections import ListInitializationPar... | python | chosen |
[
{
"from": "system",
"value": "Add that field in the model\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom nhs.prescriptions.models import Product\n\nclass Patent(models.Model):\n drug = models.ForeignKey(Product)\n expiry_date = models.DateField()\n start_... | python | chosen |
[
{
"from": "system",
"value": "Use global request context, because None url_rule sometimes\n"
},
{
"from": "human",
"value": "\"\"\" Session interface switcher \"\"\"\n\nfrom flask.sessions import SecureCookieSessionInterface, SessionMixin\n\nfrom dockci.util import is_api_request\n\n\nclass Fake... | python | chosen |
[
{
"from": "system",
"value": "Add tests for proper values in select/radios\n"
},
{
"from": "human",
"value": "from django.forms import ModelForm, RadioSelect\n\nfrom .models import Product, Option\n\n\nclass ProductForm(ModelForm):\n class Meta:\n model = Product\n\nclass OptionForm(Mo... | python | chosen |
[
{
"from": "system",
"value": "Add initialization for ServerProxy object\n"
},
{
"from": "human",
"value": "import argparse\nfrom time import time\ntry:\n # Python 3\n from xmlrpc.client import ServerProxy\nexcept ImportError:\n # Python 2\n from SimpleXMLRPCServer import ServerProxy\... | python | chosen |
[
{
"from": "system",
"value": "Add parse_off stub and change docstring\n\nI follow the TomDoc format for docstrings.\n"
},
{
"from": "human",
"value": "class HalfedgeMesh:\n def __init__(self, filename=None):\n \"\"\"Make an empty halfedge mesh.\"\"\"\n self.vertices = []\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix for escaping single quote character(s)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\nCopyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)\nSee the file 'doc/COPYING' for copying permission\n\"\"\"\n\nimport re\n\nfrom lib.core.exc... | python | chosen |
[
{
"from": "system",
"value": "Add a bunch of LJ tables\n"
},
{
"from": "human",
"value": "from sqlalchemy import (\n LargeBinary, Boolean, Column, Integer, String, PickleType, ForeignKey)\nfrom sqlalchemy.orm import backref, relationship\nfrom sqlalchemy.orm.exc import NoResultFound\n\nfrom m... | python | chosen |
[
{
"from": "system",
"value": "Set autocomplete off for chat token form field\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport re\nfrom django import forms\nfrom apps.chat.models import Chats\nfrom django.utils.translation import ugettext as _\n\n\nclass CreateChatForm(forms.For... | python | chosen |
[
{
"from": "system",
"value": "Delete item with limited size.\n"
},
{
"from": "human",
"value": "from django.db.models import Q\nfrom django.utils import timezone\n\n\ndef remove_expired_record(expire_days, query_set, time_attr_name=\"timestamp\"):\n expired_record_filter = {\"%s__lt\" % time_... | python | chosen |
[
{
"from": "system",
"value": "Replace string concatenation with .format function\n"
},
{
"from": "human",
"value": "from app import mulungwishi_app as url\nfrom flask import render_template\n\n\n@url.route('/')\ndef index():\n return render_template('index.html')\n\n\n@url.route('/<query>')\n... | python | chosen |
[
{
"from": "system",
"value": "Add routes for other pages\n"
},
{
"from": "human",
"value": "from flask import render_template\nfrom flask_app import app\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -... | python | chosen |
[
{
"from": "system",
"value": "Change upload path for images\n"
},
{
"from": "human",
"value": "from django.contrib.gis.db import models\nimport os\nfrom phonenumber_field.modelfields import PhoneNumberField\n\nclass Image(models.Model):\n \"\"\"\n The Image model holds an image and related... | python | chosen |
[
{
"from": "system",
"value": "Use oslo_config new type PortOpt for port options\n\nThe oslo_config library provides new type PortOpt to validate the\nrange of port now.\n\nChange-Id: Ifbfee642309fec668e363555c2abd103c1f8c4af\nref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114\... | python | chosen |
[
{
"from": "system",
"value": "Update model to match latest PDNS and add other two tables\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Record(models.Model):\n\tdomain_id = models.IntegerField()\n\tname = models.CharField(max_length=30)\n\ttype=models.CharField(max_leng... | python | chosen |
[
{
"from": "system",
"value": "Add checking for zero distance\n"
},
{
"from": "human",
"value": "import jellyfish\nimport multiprocessing\nfrom itertools import combinations\n\n\nclass JaroWinkler(object):\n def __init__(self, event_attributes, event_length):\n self.event_attributes = e... | python | chosen |
[
{
"from": "system",
"value": "Revert \"remove blog urls from index urls\"\n\nThis reverts commit f8d5541a8e5de124dcec62a32bd19a8226869622.\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\nfrom django.views import generic\n\nfrom stardate.models import Blog\nfrom star... | python | chosen |
[
{
"from": "system",
"value": "Send last jobs on initial connection\n"
},
{
"from": "human",
"value": "\"\"\"Manage websocket connections.\"\"\"\n# -*- coding: utf-8 -*-\nimport json\n\nfrom channels import Group\nfrom channels.auth import channel_session_user_from_http, channel_session_user\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Set file open to enforce utf8\n"
},
{
"from": "human",
"value": "import sys\nfrom tinydb import TinyDB, where\nimport markdown2\n\narticles_db = TinyDB(\"data/articles.json\")\n\n\ndef get_all_articles():\n\treturn articles_db.all()\n\n\ndef get_article_data_by_url(... | python | chosen |
[
{
"from": "system",
"value": "Update to use ResourceList methods\n"
},
{
"from": "human",
"value": "from resync.resource_list import ResourceList\nfrom resync.resource import Resource\nfrom resync.sitemap import Sitemap\n\nrl = ResourceList()\nrl.add( Resource('http://example.com/res1', lastmod=... | python | chosen |
[
{
"from": "system",
"value": "Make the settings work when there's no port, and fix up the path manipulation\n"
},
{
"from": "human",
"value": "import sys\nimport os\n\n# This only works if you're running schematic from the zamboni root.\nsys.path.insert(0, os.path.realpath('.'))\n\n# Set up zamb... | python | chosen |
[
{
"from": "system",
"value": "Add get_absolute_url on notification model\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom opps.core.models import Publishab... | python | chosen |
[
{
"from": "system",
"value": "Add depreciation messages to old parse_label methods.\n"
},
{
"from": "human",
"value": "import io\nimport functools\nimport warnings\nimport six\n\nfrom .decoder import LabelDecoder\nfrom .encoder import LabelEncoder\n\n\ndef load(stream):\n \"\"\"Parse an isis ... | python | chosen |
[
{
"from": "system",
"value": "Remove another class (QSqlDriverPlugin) from test\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport pytest\nfrom qtpy import QtSql\n\ndef test_qtsvg():\n \"\"\"Test the qtpy.QtSql namespace\"\"\"\n assert QtSql.QSqlDatabase is... | python | chosen |
[
{
"from": "system",
"value": "Revert cache changes to Twitter queries - since authenticated users bypass the cache, and the Twitter call will generate a lot of queries.\n"
},
{
"from": "human",
"value": "\nfrom django.db.models import Manager\n\nfrom mezzanine.utils.cache import cache_installed\... | python | chosen |
[
{
"from": "system",
"value": "Remove useless code in signal handler example.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom riot.app import quit_app, run_tag\nfrom riot.tags.style import parse_style\nfrom riot.tags.tags import parse_tag_from_node\nfrom riot.tags.utils import ... | python | chosen |
[
{
"from": "system",
"value": "Add an util funcion for mocking options\n"
},
{
"from": "human",
"value": "try:\n from urllib.parse import urlencode\nexcept ImportError:\n from urllib import urlencode\n\nimport tornado.testing\nimport tornado.options\n\nimport celery\n\nfrom flower.app impor... | python | chosen |
[
{
"from": "system",
"value": "Fix misleading message about pylockfile.\n"
},
{
"from": "human",
"value": "try:\n import lockfile\nexcept ImportError:\n lockfile = None\n\nimport threading\n\nimport logging\nlog = logging.getLogger(__name__)\n\nNO_PYLOCKFILE_MESSAGE = \"pylockfile module no... | python | chosen |
[
{
"from": "system",
"value": "Add missing not-equal comparison for wbtypes\n\nBug: T158848\nChange-Id: Ib6e992b7ed1c5b4b8feac205758bdbaebda2b09c\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Wikibase data type classes.\"\"\"\n#\n# (C) Pywikibot team, 2013-2015\n#\n# Distribut... | python | chosen |
[
{
"from": "system",
"value": "Make sure Caller does not return\n"
},
{
"from": "human",
"value": "\nimport simuvex\n\n######################################\n# Caller\n######################################\n\n\nclass Caller(simuvex.SimProcedure):\n \"\"\"\n Caller stub. Creates a Ijk_Call... | python | chosen |
[
{
"from": "system",
"value": "Fix invalid problem ID test\n"
},
{
"from": "human",
"value": "import unittest\nimport os\n\nfrom EasyEuler.cli import commands\n\nfrom click.testing import CliRunner\n\n\nclass CommandLineInterfaceTestCase(unittest.TestCase):\n def setUp(self):\n self.run... | python | chosen |
[
{
"from": "system",
"value": "Put verbosity to 2 for the tests because otherwise the ci script things we're hanging\n"
},
{
"from": "human",
"value": "from os.path import abspath, dirname, join\nimport json\n\n\nif __name__ == '__main__':\n file = abspath(join(dirname(__file__), '..', 'unitte... | python | chosen |
[
{
"from": "human",
"value": "Add script to populate Base Tags on app startup\n"
},
{
"from": "gpt",
"value": "from api.models import BaseTag\n\nTAGS = {\n 'fairness': {\n 'color': '#bcf0ff',\n 'description': 'Fairness is ideas of justice, rights, and autonomy.',\n },\n 'cheating': {\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix check for Wells/Calabretta convention"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n\ndef check(header, convention=None, dimensions=[0, 1]):\n\n ix = dimensions[0] + 1\n iy = dimensions[1] + 1\n\n ctypex = header['CTYPE%i' %... | python | chosen |
[
{
"from": "system",
"value": "Fix unit tests for Django 1.8\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.conf import settings\n\n\nclass SettingsTestCase(TestCase):\n\n def test_modified_settings(self):\n with self.settings(CHATTERBOT={'name': 'Jim'}... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug on python-2.6 and use a frozenset()\n\nSigned-off-by: Ralph Bean <bcd66b84ebceb8404db9191d837c83f1b20bab8e@redhat.com>\n"
},
{
"from": "human",
"value": "AGENT = 'agent' # Generic use. \"Who is responsible for this event?\"\nFIELDS = 'fields' # A li... | python | chosen |
[
{
"from": "system",
"value": "Fix json parsing for Python 3"
},
{
"from": "human",
"value": "import json\n\nfrom ffmpy import FF\n\n\nclass FFprobe(FF):\n \"\"\"\n Wrapper for `ffprobe <https://www.ffmpeg.org/ffprobe.html>`_.\n\n Utilizes ffmpeg `pipe protocol <https://www.ffmpeg.org/ff... | python | chosen |
[
{
"from": "system",
"value": "Move the load_data method to the Dataswim lib\n"
},
{
"from": "human",
"value": "import pandas as pd\nfrom goerr import err\nfrom dataswim import DataSwim\nfrom django.db.models.query import QuerySet\nfrom django_pandas.io import read_frame\n\n\nclass ChartFlo(DataS... | python | chosen |
[
{
"from": "system",
"value": "Add message in log with plotting process id.\n"
},
{
"from": "human",
"value": "import datetime\nimport multiprocessing\n\nfrom lobster.cmssw.plotting import Plotter\n\nlogger = multiprocessing.get_logger()\n\nclass DummyPlotter(object):\n def make_plots(*args, *... | python | chosen |
[
{
"from": "system",
"value": "Update for janeway's monkey patch.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.urlresolvers import reverse as django_reverse\nfrom django.utils.encoding import iri_to_uri\n\nfrom core.middleware import GlobalRequestMiddlewar... | python | chosen |
[
{
"from": "system",
"value": "Rename 'square' to 'path' in example script\n"
},
{
"from": "human",
"value": "\n\"\"\"\n gerberlicious, a python library for programmatically generating Gerber files\n\n Example script.\n\"\"\"\n\nfrom gerberlicious.point import Point\nfrom gerberlicious.laye... | python | chosen |
[
{
"from": "system",
"value": "Ch26: Optimize addition of Tag data in migration.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\nTAGS = (\n # ( tag name, tag slug ),\n (\"augmented reality\", ... | python | chosen |
[
{
"from": "system",
"value": "Fix UserCommentForm(), which got broken in the previous commit.\n"
},
{
"from": "human",
"value": "from django.utils.translation import ugettext as _\nfrom django.utils.safestring import mark_safe\nfrom django.contrib.auth.models import User\n\ntry:\n from django... | python | chosen |
[
{
"from": "system",
"value": "Add logging of search key to cache handler.\n"
},
{
"from": "human",
"value": "\"\"\"This module contains a cache handler.\"\"\"\n\n__author__ = 'Aaron Steele'\n\n# MOL imports\nimport cache\n\n# Standard Python imports\nimport json\nimport logging\nimport urllib\ni... | python | chosen |
[
{
"from": "system",
"value": "Use \"os.RTLD_*\" flags in Py3, as \"DLFCN.*\" is only the right thing to use in Py2.\n"
},
{
"from": "human",
"value": "\n# We need to enable global symbol visibility for lupa in order to\n# support binary module loading in Lua. If we can enable it here, we\n# do ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.