conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Revert \"changes in locator_50 file (current and old versions)\"\n\nThis reverts commit 819dfa4ed2033c1f82973edb09215b96d3c4b188.\n"
},
{
"from": "human",
"value": "from locators_51 import *\nimport copy\n\nnpsp_lex_locators = copy.deepcopy(npsp_lex_locators)\n\n# c... | python | chosen |
[
{
"from": "system",
"value": "Add test case for read_system_setting()\n"
},
{
"from": "human",
"value": "from arrange_schedule import *\n\n\ndef test_crawler_cwb_img(system_setting):\n send_msg = {}\n send_msg['server_dir'] = system_setting['board_py_dir']\n send_msg['user_id'] = 1\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove test settings to see if it fixes jenkins."
},
{
"from": "human",
"value": "from .base import *\ntry:\n from .local import *\nexcept ImportError, exc:\n exc.args = tuple(['%s (did you rename settings/local.py-dist?)'\n % exc.args[0]]... | python | chosen |
[
{
"from": "system",
"value": "Use topk in the click model\n"
},
{
"from": "human",
"value": "from math import exp\n\nclass ClickModel(object):\n '''\n Simple Position-biased Model:\n P(C_r=1) = P(A_r=1|E_r=1)P(E_r=1),\n where\n C_r is click on the r-th document,\n A_r i... | python | chosen |
[
{
"from": "system",
"value": "Add group fetching from AD\n"
},
{
"from": "human",
"value": "import ldap\n\ndef checkCredentials(username, password):\n\tif password == \"\":\n\t\treturn 'Empty Password'\n\t\n\tcontroller = 'devdc'\n\tdomainA = 'dev'\n\tdomainB = 'devlcdi'\n\tdomain = domainA + '.... | python | chosen |
[
{
"from": "system",
"value": "Switch to using bottle in test suite\n"
},
{
"from": "human",
"value": "import BaseHTTPServer\nimport threading\nimport time\nimport owebunit\n\nclass Handler(BaseHTTPServer.BaseHTTPRequestHandler):\n def do_GET(self):\n self.wfile.write(\"HTTP/1.0 200 OK\... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in Python commit id script.\n\nBUG=angle:529\n\nChange-Id: Ife174e3fb4cb32342f519691d1d5d5c015cf2727\nReviewed-on: https://chromium-review.googlesource.com/187541\nReviewed-by: Nicolas Capens <51edc787c30f24c4904e8ffbb5523c3a9f7a451d@chromium.org>\nReviewed-by: Shannon... | python | chosen |
[
{
"from": "system",
"value": "Fix parsing of errors returned by API.\n"
},
{
"from": "human",
"value": "import logging\nimport exceptions\n\nclass Response(object):\n\tdef __init__(self, body, meta=None):\n\t\tself.meta = meta\n\t\tself.body = body\n\n\t\t# todo: handle non-\"ok\" status\n\t\tse... | python | chosen |
[
{
"from": "system",
"value": "Fix string layout for readability\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom django.core.management import execute_manager\nimport imp\ntry:\n imp.find_module('settings') # Assumed to be in the same directory.\nexcept ImportError:\n import ... | python | chosen |
[
{
"from": "system",
"value": "Add config option to start moa clock.\n"
},
{
"from": "human",
"value": "'''A framework for designing and running experiments in Python using Kivy.\n'''\n\n__version__ = '0.1-dev'\n\nfrom kivy import kivy_home_dir\nfrom os import environ\nfrom os.path import join\nf... | python | chosen |
[
{
"from": "system",
"value": "Add print description, use function arguments\n\n- changed name and ID to being name and region\n- Add a string to the print calls denoting what's being printed out\n"
},
{
"from": "human",
"value": "import cassiopeia as cass\nfrom cassiopeia.core import Summoner\n\... | python | chosen |
[
{
"from": "system",
"value": "Rename factory to match what it creates\n"
},
{
"from": "human",
"value": "\"\"\"\nFactory that configures SQLAlchemy for PostgreSQL.\n\n\"\"\"\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\n\nfrom microcosm.api import binding, defau... | python | chosen |
[
{
"from": "system",
"value": "Mark filter headers in My Library for translation\n"
},
{
"from": "human",
"value": "import django_filters\n\nfrom .models import Language, Partner\nfrom .helpers import get_tag_choices\n\n\nclass PartnerFilter(django_filters.FilterSet):\n tags = django_filters.C... | python | chosen |
[
{
"from": "system",
"value": "Add helper funtions for making pairs\n"
},
{
"from": "human",
"value": "import json\n\nfrom django.conf import settings\n\n\ndef _get_default_file_content():\n return {'status': False}\n\n\ndef _write_status_file():\n file_path = settings.STATUS_FILE\n with... | python | chosen |
[
{
"from": "system",
"value": "Add a help_text string to the admin form\n"
},
{
"from": "human",
"value": "import csv\n\nfrom django import forms\n\n\nclass BulkUploadForm(forms.Form):\n data = forms.FileField()\n\n def clean(self):\n cleaned_data = super(BulkUploadForm, self).clean(... | python | chosen |
[
{
"from": "system",
"value": "Add simulation time for a squared trajectory\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nTRAJECTORY_TYPE = 'circular'\n\nif TRAJECTORY_TYPE == 'linear':\n SIMULATION_TIME_IN_SECONDS = 40\nelif TRAJECTORY_TYPE == 'circular':\n SIMULATION_TIME_IN... | python | chosen |
[
{
"from": "system",
"value": "Use OPPS_MULTISITE_ADMIN on queryset AdminViewPermission\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\nfrom django.conf import settings\nfrom django.utils import timezone\n\nfrom .models import S... | python | chosen |
[
{
"from": "system",
"value": "Add attaching units to example.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017 Siphon Contributors.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"\nWyoming Upper Air Data Request\n===============... | python | chosen |
[
{
"from": "system",
"value": "Install pgcrypto PGSQL extension but only if it does not exist already (e.g. from template1)\n"
},
{
"from": "human",
"value": "from django.core.management import call_command\nfrom django.test.utils import get_runner\nfrom django.conf import settings\nfrom django.d... | python | chosen |
[
{
"from": "system",
"value": "Handle the exception case in the account context_processor.\n\ngit-svn-id: 51ba99f60490c2ee9ba726ccda75a38950f5105d@1119 45601e1e-1555-4799-bd40-45c8c71eef50\n"
},
{
"from": "human",
"value": "\nfrom account.models import Account, AnonymousAccount\n\ndef openid(requ... | python | chosen |
[
{
"from": "system",
"value": "Make sure to import build from googleapiclient.discovery.\n"
},
{
"from": "human",
"value": "\"\"\"[START auth]\"\"\"\n\nfrom oauth2client.client import GoogleCredentials\nfrom googleapiclient.discovery\n\ndef get_service():\n credentials = GoogleCredentials.get_... | python | chosen |
[
{
"from": "system",
"value": "Add description content type for pypi.\n"
},
{
"from": "human",
"value": "import os\nimport json\nfrom setuptools import setup\n\nf = open(os.path.join(os.path.dirname(__file__), 'README.md'))\nreadme = f.read()\nf.close()\n\nf = open(os.path.join(os.path.dirname(__... | python | chosen |
[
{
"from": "system",
"value": "Include pip as required install\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\n\"\"\"setup.py: setuptools control.\"\"\"\n\n\nimport re\nfrom setuptools import setup, find_packages\nimport pip\n\n\nversion = re.search(\n '^__version__\\s*=\\s*\"(... | python | chosen |
[
{
"from": "system",
"value": "Bump version to fix pypi packaging\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom setuptools import setup\n\nsetup(\n name='rq-scheduler',\n version='0.1',\n author='Selwin Ong',\n author_email='selwin.ong@gmail.com',\n packages=['rq... | python | chosen |
[
{
"from": "system",
"value": "Remove empty string from requirements list\n\nWhen we moved to Python 3 we used this simpler method to read the requirements\nfile. However we need to remove the empty/Falsey elements from the list.\n\nThis fixes the error:\n\n```\nFailed building wheel for molo.polls\n```\n"
... | python | chosen |
[
{
"from": "system",
"value": "Use absolute path for requirements file\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom pip.req import parse_requirements\n\ninstall_reqs = parse_requirements(\"./requirements.txt\")\nreqs = [str(ir.req) for ir in install_reqs]\n\nsetup(\n ... | python | chosen |
[
{
"from": "system",
"value": "Add Python 3 only classifier\n"
},
{
"from": "human",
"value": "from setuptools import setup\nfrom codecs import open\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__))\nwith open(path.join(here, 'README.md'), encoding='utf-8') as f:\n readme = f... | python | chosen |
[
{
"from": "system",
"value": "Add nose to the requirements, why not?\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='tattler',\n author='Joe Friedl',\n author_email='joe@joefriedl.net',\n version='0.1',\n description='A nose plugin that tattles ... | python | chosen |
[
{
"from": "system",
"value": "Reset version number for newly named pkg\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nlong_description = \"\"\"Publish browser extensions to their stores.\nCurrently only available for Google Chrome.\"\"\"\n\nsetup(\n name='we... | python | chosen |
[
{
"from": "system",
"value": "Remove classifiers that get outdated\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nfrom setuptools import setup\n\n\nif os.path.exists('README.rst'):\n long_description = open('README.rst').read()\nelse:\n long... | python | chosen |
[
{
"from": "system",
"value": "Fix install requirements due to Python versions.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport re\n\nfrom distutils.core import setup\n\n\nDIRNAME = os.path.abspath(os.path.dirname(__file__))\nrel = lambda *parts: os.path.abspath(os.p... | python | chosen |
[
{
"from": "system",
"value": "Add support for python 3.7 and 3.8 in package classifiers\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\nfrom github_backup import __version__\n\n\ndef open_file(fname):\n return open(... | python | chosen |
[
{
"from": "system",
"value": "Change dateutil to python-dateutil because some loser decided to rename it. (Thanks Leigh)\n\ngit-svn-id: 7187af8a85e68091b56e148623cc345c4eafc588@188 d723f978-dc38-0410-87ed-da353333cdcc\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages... | python | chosen |
[
{
"from": "system",
"value": "Disable more plugins to make it work again.\n\nWill fix venues parsing later.\n\nSigned-off-by: Ville Valkonen <989b9f9979d21943697628c770235933300d59bc@gmail.com>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Execute this file to see what plugins ... | python | chosen |
[
{
"from": "system",
"value": "Remove libraries not required for most use cases\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup\n\n# Ensure that the ssdeep library is built, otherwise install will fail\nos.environ['BUILD_LIB'] = '1'\n\nsetup(\n name=\"stoq\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add support for Python 3.7 and Django 2.2\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom codecs import open\n\nfrom setuptools import find_packages, setup\n\n\nwith open('README.rst', 'r', 'utf-8') as f:\n readme = f.read()\n\n\nsetup(\n name='... | python | chosen |
[
{
"from": "system",
"value": "Update requests to fix security issue"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nfrom pypandoc import convert\n\n\ndef convert_markdown_to_rst(file):\n return convert(file, 'rst')\n\n\nsetup(name='gitlabform',\n version='... | python | chosen |
[
{
"from": "system",
"value": "Remove oauth_provider as that's the eggname for django-oauth-plus.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(name='SpaceScout-Server',\n version='1.0',\n description='REST Backend for SpaceScout',... | python | chosen |
[
{
"from": "system",
"value": "Rename commentthreadwriter to commentthreadworker since it does not write\nanything...\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='zeit.care',\n version='0.2dev',\n author='Christian Zagrodnick, Ron Drong... | python | chosen |
[
{
"from": "system",
"value": "Include data files in pacakge\n"
},
{
"from": "human",
"value": "from setuptools import setup, Extension\nimport numpy\n\nsetup (name = 'xfel', \\\n version = '1.0', \\\n packages = ['xfel',\n 'xfel.core',\n 'xfel.o... | python | chosen |
[
{
"from": "system",
"value": "Use an older raven until our Sentry is upgraded to 5.1\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='jmbo-skeleton',\n version='0.6',\n description='Create a Jmbo project environment quickly. Includes a Jmb... | python | chosen |
[
{
"from": "system",
"value": "Add PyPI classifiers for Python 3.4, 3.5 and 3.6\n\nSince the tests pass on Python 3.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name = \"wsgi-sslify\",\n description = \"WSGI middleware to force HTTPS.\",\n version = \"1.0.... | python | chosen |
[
{
"from": "system",
"value": "Convert read data to unicode.\n\nThe NamedTemporaryFile is in binary mode by default, so the read returns raw\nbytes.\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport tempfile\n\nfrom twisted.trial import unittest\nfrom twisted.python import util\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add test for getting pure html tag\n"
},
{
"from": "human",
"value": "import pytest\nimport cleaner\n\nclass TestTagRemoval():\n def test_span_removal(self):\n text = ('<span style=\"font-family: "helvetica neue" ,'\n '"arial" , ... | python | chosen |
[
{
"from": "system",
"value": "Use histogram of local binary patterns\n"
},
{
"from": "human",
"value": "\"\"\"\nDefine all features to be extracted from the data\n\"\"\"\n\nfrom PIL import Image\nfrom PIL.ImageStat import Stat\n\nfrom skimage.feature import local_binary_pattern\n\n\nclass BaseFe... | python | chosen |
[
{
"from": "system",
"value": "Add possibility to set fields"
},
{
"from": "human",
"value": "from rest_framework.views import APIView\nfrom rest_framework.response import Response\n\n\nclass EnumView(APIView):\n permission_classes = []\n\n def get(self, *args, **kwargs):\n enums = s... | python | chosen |
[
{
"from": "system",
"value": "Change detection of Shotgun server for tests"
},
{
"from": "human",
"value": "from pprint import pprint, pformat\nimport datetime\nimport os\n\nfrom sgmock import Fixture\nfrom sgmock import TestCase\n\nif 'USE_SHOTGUN' in os.environ:\n from shotgun_api3 import S... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in python client\n"
},
{
"from": "human",
"value": "# lockd client\n\nimport httplib\nimport json\n\nclass LockdClient(object):\n\n def __init__(self, host=\"127.0.0.1\", port=2080):\n self._host_port = \"%s:%s\" % (host, port)\n\n def is_locked... | python | chosen |
[
{
"from": "system",
"value": "Comment out entire function to stop unexpected EOF effor\n"
},
{
"from": "human",
"value": "from django.apps import AppConfig\n\n\nclass CivictechprojectsConfig(AppConfig):\n name = 'civictechprojects'\n\n def ready(self):\n # Remove any tags that aren'... | python | chosen |
[
{
"from": "system",
"value": "Handle incoming messages that aren't JSON objects.\n"
},
{
"from": "human",
"value": "import json\nimport socket\n\n\nfrom orderbook import create_confirm\n\n\ndef send_msg(ip, port, message):\n sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n sock.c... | python | chosen |
[
{
"from": "system",
"value": "Add loop to sleep structur\n"
},
{
"from": "human",
"value": "import time\nimport transitions\n\nfrom panoptes.utils.logger import has_logger\n\n\n@has_logger\nclass PanState(transitions.State):\n\n \"\"\" Base class for PANOPTES transitions \"\"\"\n\n def __i... | python | chosen |
[
{
"from": "system",
"value": "Read test logs in bytes mode\n"
},
{
"from": "human",
"value": "import os\nfrom datetime import datetime\n\n\ndef save_logs(groomer, test_description):\n divider = ('=' * 10 + '{}' + '=' * 10 + '\\n')\n test_log_path = 'tests/test_logs/{}.log'.format(test_desc... | python | chosen |
[
{
"from": "system",
"value": "Fix errors when contents of a file contains UTF-8 chars.\n\n- Convert tabs to spaces.\n- Use a more pythonic way to open (and write into) the file.\n- Add UTF-8 encoding before writing the contents of the file.\n"
},
{
"from": "human",
"value": "import json\nimport ... | python | chosen |
[
{
"from": "system",
"value": "Read twitter tokens from .env\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\n\nfrom dotenv import load_dotenv, find_dotenv\n\nload_dotenv(find_dotenv())\nOPS_KEY = os.environ['OPS_KEY']\nOPS_SECRET = os.environ['OPS_SECRET']\n"
},
{
"... | python | chosen |
[
{
"from": "system",
"value": "Make the tests compatible with python2.\n"
},
{
"from": "human",
"value": "import nonstdlib\n\ndef test_capture_output():\n import sys\n\n with nonstdlib.capture_output() as output:\n print('std', end='', file=sys.stdout)\n print('st', end='', fi... | python | chosen |
[
{
"from": "human",
"value": "Add database helpers to test base\n"
},
{
"from": "gpt",
"value": "from kitten import db\n\n\nclass MockDatabaseMixin(object):\n def setup_method(self, method):\n db.Base.metadata.create_all(db.engine)\n self.session = db.Session()\n\n def teardow... | python | chosen |
[
{
"from": "system",
"value": "test: Clear caches in test item teardown\n\nRather than relying on the user manually clearing the COFS function\ncache and linear problem cache, clear them in the teardown step of each\ntest.\n"
},
{
"from": "human",
"value": "import pytest\n\n\ndef pytest_addoption... | python | chosen |
[
{
"from": "system",
"value": "Use pytest instead of unittest\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_ttt\n----------------------------------\n\nTests for `ttt` module.\n\"\"\"\n\nimport unittest\n\nfrom ttt import ttt\n\n\nclass TestPat(u... | python | chosen |
[
{
"from": "system",
"value": "Use more descriptive unit test names\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom libs.upbeatbot import UpBeatBot\n\n\nclass TestUpbeatBot(unittest.TestCase):\n @classmethod\n def setUpClass(cls):\n cls.upbeat_bot = UpBeatBot()\n\n def ... | python | chosen |
[
{
"from": "system",
"value": "Add intended error to see flake8 report\n"
},
{
"from": "human",
"value": "def merge(a, b):\n if len(a) * len(b) == 0:\n return a + b\n\n v = (a[0] < b[0] and a or b).pop(0)\n return [v] + merge(a, b)\n\n\ndef mergesort(list):\n if len(list) < 2:\... | python | chosen |
[
{
"from": "system",
"value": "Add network target as a params\n\nSigned-off-by: Jacobo Tibaquira <d8d2a0ed36dd5f2e41c721fffbe8af2e7e4fe993@gmail.com>\n"
},
{
"from": "human",
"value": "import nmap\n\nclass HelperNmap:\n\n def __init__(self,args=\"\"):\n self.args = args\n\n def process(self)... | python | chosen |
[
{
"from": "system",
"value": "Add naming suffix option for SQS backends\n"
},
{
"from": "human",
"value": "from .base import BackendFactory, Backend\nfrom ..queue.sqs import SQSQueue\n\nclass SQSBackendFactory(BackendFactory):\n def __init__(self, sqs_connection_thunk, visibility_timeout=30, ... | python | chosen |
[
{
"from": "system",
"value": "Use full paths & print our current command fully\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport subprocess\nimport argparse\n\nparser = argparse.ArgumentParser(description=\"Tweet some Train Statuses!\")\nparser.add_argument(\"-s\", \"--station\"... | python | chosen |
[
{
"from": "system",
"value": "Test if we look after a non-existing repo\n"
},
{
"from": "human",
"value": "from nose.tools import eq_\nfrom mock import MagicMock, patch\n\nfrom pyolite.models.repository import Repository\n\n\nclass TestRepositoryModel(object):\n def test_it_should_be_possible_t... | python | chosen |
[
{
"from": "system",
"value": "Add tinyurl.com as a minifier\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# This file is part of tofbot, a friendly IRC bot.\n# You may redistribute it under the Simplified BSD License.\n# If we meet some day, and you think this stuff is worth it,... | python | chosen |
[
{
"from": "system",
"value": "Add a debug message to find an unexpected error\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nimport time\nfrom threading import Thread\nfrom .models import Pokemon\n\nlog = logging.getLogger(__name__)\nlog.setLevel(level=10)\n\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Increment to next dev version."
},
{
"from": "human",
"value": "__version__ = (0, 2)\n\n\n# Make a couple frequently used things available right here.\nfrom bundle import Bundle\nfrom registry import register"
},
{
"from": "gpt",
"value": "__version__ = ... | python | chosen |
[
{
"from": "system",
"value": "Add test for silent fail when creating Alfred data dir\n"
},
{
"from": "human",
"value": "# tests.test_filter_refs_prefs\n# coding=utf-8\n\nfrom __future__ import unicode_literals\nimport nose.tools as nose\nimport yvs.filter_refs as yvs\nfrom tests.decorators impor... | python | chosen |
[
{
"from": "system",
"value": "Add missing include, and switch to exclude projects with HIDDEN status from public display\n"
},
{
"from": "human",
"value": "# This file is part of the FragDev Website.\n# \n# the FragDev Website is free software: you can redistribute it and/or modify\n# it under t... | python | chosen |
[
{
"from": "system",
"value": "Add function in AutoMounter to handle mounting of LUKS-devices not opened by udiskie\n"
},
{
"from": "human",
"value": "\"\"\"\nUdiskie automounter daemon.\n\"\"\"\n__all__ = ['AutoMounter']\n\nclass AutoMounter(object):\n \"\"\"\n Automatically mount newly ad... | python | chosen |
[
{
"from": "system",
"value": "Remove events_type from alert test case\n"
},
{
"from": "human",
"value": "import os.path\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../../alerts\"))\n\nfrom alert_test_suite import AlertTestSuite\n\n\nclass AlertTestCase(object):\n de... | python | chosen |
[
{
"from": "system",
"value": "Increment minor version to 0.6\n"
},
{
"from": "human",
"value": "\"\"\"yolk\n\nAuthor: Rob Cakebread <cakebread at gmail>\n\nLicense : BSD\n\n\"\"\"\n\n__version__ = '0.5.2'\n"
},
{
"from": "gpt",
"value": "\"\"\"yolk\n\nAuthor: Rob Cakebread <cakebrea... | python | chosen |
[
{
"from": "system",
"value": "Tidy up UserModel unit test\n"
},
{
"from": "human",
"value": "\"\"\"accounts app unittests for models\n\n\"\"\"\nfrom django.test import TestCase\nfrom django.contrib.auth import get_user_model\n\n\nTEST_EMAIL = 'newvisitor@example.com'\n\n\nclass UserModelTest(Tes... | python | chosen |
[
{
"from": "system",
"value": "Build custom route requester class\n"
},
{
"from": "human",
"value": "\"\"\"\n This class holds all the necessary information required for a proposed route\n\"\"\"\nACCEPTABLE_MODES = set([\"driving\", \"walking\", \"bicycling\", \"transit\"])\n\nclass Directions... | python | chosen |
[
{
"from": "system",
"value": "Move S3 bucket connection into `upload_image`\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport StringIO\n\nimport shortuuid\nfrom boto.s3.connection import S3Connection\n\nfrom ga import settings\n\n\nconn = S3Connection(settings.AWS_KEY, setting... | python | chosen |
[
{
"from": "system",
"value": "Use binary mode to open \"wave\" files.\n"
},
{
"from": "human",
"value": "from test_support import TestFailed\nimport os, tempfile\nimport wave\n\ndef check(t, msg=None):\n if not t:\n raise TestFailed, msg\n\nnchannels = 2\nsampwidth = 2\nframerate = 800... | python | chosen |
[
{
"from": "system",
"value": "Fix python namespaces for test runs\n\nWe need to make sure we don't use namespaced versions that are already installed\non the system but rather use local version from current sources\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# This file is part o... | python | chosen |
[
{
"from": "system",
"value": "Patch readfile not to return mols\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom cinfony import rdk\nfrom cinfony.rdk import *\n\nclass Fingerprint(rdk.Fingerprint):\n @property\n def raw(self):\n return np.array(self.fp, dtype=bool)\n ... | python | chosen |
[
{
"from": "system",
"value": "Add from_configfile method to Project\n"
},
{
"from": "human",
"value": "class Project(object):\n \"\"\"Holds project configuration parameters, such as data directory.\"\"\"\n\n def __init__(self, data_directory):\n self.data_directory = data_directory\... | python | chosen |
[
{
"from": "system",
"value": "Allow different input files to be specified.\n\nr18478\n"
},
{
"from": "human",
"value": "'''\nCreated on Feb 20, 2013\n\n@author: crisr\n'''\nimport xml.etree.ElementTree as ET\nimport os\nfrom Simulation import Simulation\n\ndebug = True\n\nif __name__ == '__main_... | python | chosen |
[
{
"from": "system",
"value": "Add tests for path overlapping check\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.test import TestCase\n\nfrom unittest import skipIf\n\nfrom geotrek.core.factories import TrailFactory\nfrom geotrek.authent.factories import UserFa... | python | chosen |
[
{
"from": "system",
"value": "Correct a reading of a code\n"
},
{
"from": "human",
"value": "import fileinput\n\ndef read_code():\n return ''.join([line for line in fileinput.input()])\n\nif __name__ == '__main__':\n code = read_code()\n print(code)\n"
},
{
"from": "gpt",
"v... | python | chosen |
[
{
"from": "system",
"value": "Add pretty and latex for Sequence\n"
},
{
"from": "human",
"value": "\"\"\"This module handles sequences.\n\nCopyright 2020 Michael Hayes, UCECE\n\n\"\"\"\n\nfrom .expr import ExprList\n\nclass Sequence(ExprList):\n\n def __init__(self, seq, n=None):\n\n s... | python | chosen |
[
{
"from": "system",
"value": "Make it clear that the E-Mail address is optional.\n"
},
{
"from": "human",
"value": "from wtforms import Form, SubmitField, BooleanField, TextField, SelectField, \\\n PasswordField, IntegerField, FieldList, FormField, validators\n\n\nclass LoginForm(Form):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update SWFError with a formatted type\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2013, Theo Crevon\n# Copyright (c) 2013, Greg Leclercq\n#\n# See the file LICENSE for copying permission.\n\nclass SWFError(Exception):\n def __ini... | python | chosen |
[
{
"from": "system",
"value": "Update the DB-inserting script for wifi.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"Temperature into database\"\"\"\n\nimport glob\nfrom time import sleep\nimport urllib2\nimport urllib\n\nbase_dir = '/sys/bus/w1/devices/'\ndevice_folder = glo... | python | chosen |
[
{
"from": "system",
"value": "Clean up model data after tests have been executed.\n"
},
{
"from": "human",
"value": "from nose.tools import eq_\n\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase\n\nfrom us_ignite.events.tests import fixtures\nfrom us_ignite.events.m... | python | chosen |
[
{
"from": "system",
"value": "Enable full location for profile\n"
},
{
"from": "human",
"value": "from .models import MakerScienceProfile\nfrom tastypie.resources import ModelResource\nfrom tastypie.authorization import DjangoAuthorization\nfrom tastypie import fields\nfrom tastypie.constants im... | python | chosen |
[
{
"from": "system",
"value": "Update to set screensize and take camera IOC as arg\n"
},
{
"from": "human",
"value": "from time import sleep\nfrom monitor.camera import Camera\nfrom monitor.plotter_pygame import PyGamePlotter\n\n\ndef run(plotter, camera):\n\n while True:\n plotter.show... | python | chosen |
[
{
"from": "system",
"value": "Add iterative and recursive solutions to reverse strings\n"
},
{
"from": "human",
"value": "'''\nReverse a string\n\n'''\n\ndef reverse_string_iterative(string):\n\tpass\n\ndef reverse_string_recursive(string):\n\tpass\n\ndef reverse_string_pythonic(string):\n\tretu... | python | chosen |
[
{
"from": "system",
"value": "Fix logging compatibility with the latest Channels\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport channels.log\nimport logging\nimport os\nimport sys\n\nPROJECT_ROOT = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))\nsys.path.insert(0, ... | python | chosen |
[
{
"from": "system",
"value": "Fix bugs occuring when no response is given.\n"
},
{
"from": "human",
"value": "import json\nimport threading\nimport socket\nimport SocketServer\n\nfrom orderbook import asks, bids\n\n\nclass ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):\n\n def ha... | python | chosen |
[
{
"from": "system",
"value": "Make ignore_errors False by default\n"
},
{
"from": "human",
"value": "import contextlib\nimport shutil\nimport tempfile\n\nimport numpy\n\nfrom chainer.utils import walker_alias # NOQA\n\n\n# import class and function\nfrom chainer.utils.conv import get_conv_outsi... | python | chosen |
[
{
"from": "system",
"value": "Rename clerking -> Book in\n"
},
{
"from": "human",
"value": "\"\"\"\nacute - Our OPAL Application\n\"\"\"\nfrom opal.core import application\n\nclass Application(application.OpalApplication):\n schema_module = 'acute.schema'\n flow_module = 'acute.flow'\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix to fetching tables from MS SQL Server."
},
{
"from": "human",
"value": "import pypyodbc\nimport csv\n\nconn = pypyodbc.connect(\"DSN=\")\ncur = conn.cursor()\n\ntables = []\n\ncur.tables(\"%\", \"\", \"\")\nfor row in cur.fetchall():\n tables.append(row[2])\n... | python | chosen |
[
{
"from": "system",
"value": "Move QGL import inside function\n\nA channel library is not always available\n"
},
{
"from": "human",
"value": "from . import bbn\nimport auspex.config\nfrom auspex.log import logger\nfrom QGL import *\nChannelLibrary()\n\ndef pulse_marker(marker_name, length = 100e... | python | chosen |
[
{
"from": "system",
"value": "Add email parameter for creating test user\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django_webtest import WebTest\n\nfrom django.contrib.auth.models import User\n\nfrom django_comments.models import Comment\n\nfrom pylab.core.models import Project\... | python | chosen |
[
{
"from": "system",
"value": "Fix error when there is no git\n"
},
{
"from": "human",
"value": "import os\n\ndef git_file_path(view, git_path):\n if not git_path:\n return False\n full_file_path = view.file_name()\n git_path_to_file = full_file_path.replace(git_path,'')\n \n if git_pat... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Use importlib instead of __import__\"\n\nThis reverts commit 1c40e03b487ae3dcef9a683de960f9895936d370.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2013-2014 Simon Jagoe\n# All rights reserved.\n#\n# This software may be modif... | python | chosen |
[
{
"from": "system",
"value": "Add table names to core model items\n"
},
{
"from": "human",
"value": "from django.db import models\n\n##\n# Location Types\n##\nclass World(models.Model):\n\tname = models.CharField(max_length=30)\n\thomes = models.ManyToManyField(Home)\n\t\nclass Home(models.Model... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.