conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix test failures after method renames\n"
},
{
"from": "human",
"value": "import unittest\nimport re\nimport importlib\n\nimport importlib_metadata\n\n\nclass BasicTests(unittest.TestCase):\n version_pattern = r'\\d+\\.\\d+(\\.\\d)?'\n\n def test_retrieves_ver... | python | chosen |
[
{
"from": "system",
"value": "Switch to postgis for Travis\n\nAt least until I have time to figure out the spatialite automatic build.\n"
},
{
"from": "human",
"value": "from defaults import *\n\nDATABASES = {\n 'default': {\n #'ENGINE': 'django.db.backends.postgresql_psycopg2',\n# ... | python | chosen |
[
{
"from": "system",
"value": "Add test for non existent url pattern\n"
},
{
"from": "human",
"value": "from djet import assertions, restframework\nfrom rest_framework import status\nimport djoser.constants\nimport djoser.utils\nimport djoser.views\n\n\nclass RootViewTest(restframework.APIViewTes... | python | chosen |
[
{
"from": "system",
"value": "Add audio/video support and bail on findings\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom corehq.apps.domain.models import Domain\nimport csv\n\n\nclass Command(BaseCommand):\n help = 'Find domains with secure submi... | python | chosen |
[
{
"from": "system",
"value": "Change to questions template location.\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom spenglr.education.models import *\n\n# Uncomment the next two lines to enable the admin:\nfrom django.contrib import admin\nadmin.autodiscover()\n... | python | chosen |
[
{
"from": "system",
"value": "Use a real JS construct, WTF knows why this works in chromium.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys, json\n\nfile = sys.argv[1]\nsubject = file.split('.')[0]\n\ndata = {\n \"subject\": subject, \n \"cards\": {}\n}\n\nfc = [lin... | python | chosen |
[
{
"from": "system",
"value": "Create the correct references to other tables in all schemata.\n"
},
{
"from": "human",
"value": "from django.db import models, connection\nfrom django.core.management.color import no_style\n\nfrom multi_schema.models import Schema\n\ndef post_syncdb_duplicator(send... | python | chosen |
[
{
"from": "system",
"value": "Add login and logout to allowed views in DEMO_MODE.\n"
},
{
"from": "human",
"value": "\"\"\"\nSettings for DEMO_MODE.\n\nMust set DEMO_MODE = True in local_settings.py.\n\"\"\"\n\n# Views that are visible in demo mode.\nDEMO_SAFE_VIEWS = [\n 'main.views.home_vie... | python | chosen |
[
{
"from": "system",
"value": "Use axpy on sample Python script\n"
},
{
"from": "human",
"value": "\nimport rust_ext\nimport numpy as np\n\na = np.array([1.0, 2.0])\nrust_ext.mult(3, a)\nprint(a)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport rust_ext\nimport numpy a... | python | chosen |
[
{
"from": "system",
"value": "Add organization to cause model\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Cause(models.Model):\n title = models.CharField(max_length=64)\n description = models.TextField()\n creator = models.ForeignKey('auth.User', related_n... | python | chosen |
[
{
"from": "system",
"value": "Use generic views: Less code is better\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\nfrom apps.polls import views\n\nurlpatterns = patterns('',\n\t# ex: /polls/\n\t\turl(r'^$', views.index, name='index'),\n\t# ex: /polls/5\n\t\turl... | python | chosen |
[
{
"from": "system",
"value": "Add test to delete user in DB\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\nfrom rest_framework import status\nfrom rest_framework.test import APIClient\n\nfrom ..models import U... | python | chosen |
[
{
"from": "system",
"value": "Remove default forcing files if not being used.\n"
},
{
"from": "human",
"value": "import os\nimport shutil\n\nfrom wmt.utils.hook import find_simulation_input_file\n\n\ndef execute(env):\n \"\"\"Perform post-stage tasks for running a component.\n\n Parameters... | python | chosen |
[
{
"from": "system",
"value": "Change indentation tab to spaces.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom flask_debugtoolbar import DebugToolbarExtension\n\nfrom app import app\nfrom app.models import connect_to_db\n\n\nif __name__ == '__main__':\n\n # debug = True as D... | python | chosen |
[
{
"from": "system",
"value": "Update Subject model\n -remove superfluous type field\n -fix parents field type\n -update url building\n"
},
{
"from": "human",
"value": "from modularodm import fields\n\nfrom framework.mongo import (\n ObjectId,\n StoredObject,\n utils as mongo_ut... | python | chosen |
[
{
"from": "system",
"value": "Add the generated Client interfaces to the telepathy.server namespace\n"
},
{
"from": "human",
"value": "\"\"\"\ntelepathy-python - Base classes defining the interfaces of the Telepathy framework\n\nCopyright (C) 2005, 2006 Collabora Limited\nCopyright (C) 2005, 200... | python | chosen |
[
{
"from": "system",
"value": "Bump for icon harmattan build\n"
},
{
"from": "human",
"value": "__pretty_app_name__ = \"e**(j pi) + 1 = 0\"\n__app_name__ = \"ejpi\"\n__version__ = \"1.0.7\"\n__build__ = 2\n__app_magic__ = 0xdeadbeef\n\nIS_MAEMO = True\n"
},
{
"from": "gpt",
"value": "... | python | chosen |
[
{
"from": "system",
"value": "Designer: Add missing index command in revision\n"
},
{
"from": "human",
"value": "\"\"\"Add backside_template column\n\nRevision ID: 3ca338ed5192\nRevises: 35d76c40ca48\nCreate Date: 2017-05-17 11:33:30.295538\n\"\"\"\n\nimport sqlalchemy as sa\nfrom alembic import... | python | chosen |
[
{
"from": "system",
"value": "Remove unimported symbols from __all__\n\nI don't quite understand, why flake8 didn't catch this...\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import, division, print_function\n\nfrom . import exceptions, low_level\... | python | chosen |
[
{
"from": "system",
"value": "Fix method name to conform to tests\n"
},
{
"from": "human",
"value": "class CheckBrackets:\n OPENERS = {'{': '}',\n '[': ']',\n '(': ')'}\n CLOSERS = set(OPENERS.values())\n\n def __init__(self, inp):\n self.check_bracket... | python | chosen |
[
{
"from": "system",
"value": "Split text by \\t, and added lists of bacteria and diseases\n"
},
{
"from": "human",
"value": "class parseFileBacteriaList:\n 'Class for read and print information from text file'\n bacteriaName = []\n fileName = \"\"\n\n def __init__(self,fileName):\n ... | python | chosen |
[
{
"from": "system",
"value": "Enable GRPC Streaming in Python uppercase sample\n"
},
{
"from": "human",
"value": "import os,sys\nsys.path.insert(0, os.path.abspath('.'))\n\nimport grpc\nimport time\nimport function_pb2_grpc as function\nimport fntypes_pb2 as types\nfrom concurrent import futures... | python | chosen |
[
{
"from": "system",
"value": "Update example: add a delay task\n"
},
{
"from": "human",
"value": "from simpleflow import (\n activity,\n Workflow,\n)\n\n\n@activity.with_attributes(task_list='quickstart')\ndef increment(x):\n return x + 1\n\n\n@activity.with_attributes(task_list='quicks... | python | chosen |
[
{
"from": "system",
"value": "Use four spaces, just like in Python.\n"
},
{
"from": "human",
"value": "\"\"\"Nephele - Finding movies to watch on the internet is easy,\nfinding GOOD movies to watch is hard. Let Nephele, the greek\nnymph of the clouds, help you.\n\nUsage:\n nephele.py get_popula... | python | chosen |
[
{
"from": "system",
"value": "Document the party importer command\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\n\nfrom parties.importer import ECPartyImporter\nfrom parties.models import PartyEmblem\n\n\nclass Command(BaseCommand):\n help = \"My shiny... | python | chosen |
[
{
"from": "system",
"value": "Change admin index title: 'Dashboard'\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.contrib.auth import views as auth_views\nfrom django.contrib import admin\nfrom django.views.generic.base import RedirectView\n\... | python | chosen |
[
{
"from": "system",
"value": "Add user to posted print object\n"
},
{
"from": "human",
"value": "from rest_framework import viewsets\nfrom . import serializers, models\n\n\nclass PrintJobViewSet(viewsets.ModelViewSet):\n serializer_class = serializers.PrintJobSerializer\n\n def get_queryse... | python | chosen |
[
{
"from": "system",
"value": "Change topic + add exception handling"
},
{
"from": "human",
"value": "from kafka import KafkaConsumer\nimport os\nimport nexmo\nimport json\n\nclient = nexmo.Client( key=os.environ[\"API_KEY\"],\n secret=os.environ[\"API_SECRET\"])\n... | python | chosen |
[
{
"from": "system",
"value": "Add custom build_dir opt for pyximport.install\n"
},
{
"from": "human",
"value": "__all__ = [\"tools\", \"loader\", \"clib\"]\n\nfrom . import tools\nfrom . import loader\n\nimport pyximport\npyximport.install(build_in_temp=True)\nfrom . import clib\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Add state change to sphinx plugin.\n"
},
{
"from": "human",
"value": "from docutils.parsers.rst import Directive\nfrom twisted.python.reflect import namedAny\nfrom docutils import nodes\nfrom docutils.statemachine import StringList\n\n\nclass FakeRunner(object):\n ... | python | chosen |
[
{
"from": "system",
"value": "TEST - add test for replacement in files\n"
},
{
"from": "human",
"value": "\"\"\" Testing gitwash dumper\n\"\"\"\n\nfrom os.path import join as pjoin, dirname, split as psplit\nimport shutil\nfrom tempfile import mkdtemp\nfrom subprocess import call\n\nfrom nose.to... | python | chosen |
[
{
"from": "system",
"value": "[sync] Fix import for attachment files\n"
},
{
"from": "human",
"value": "from sqlalchemy_utils import UUIDType\n\nfrom zou.app import db\nfrom zou.app.models.serializer import SerializerMixin\nfrom zou.app.models.base import BaseMixin\n\n\nclass AttachmentFile(db.M... | python | chosen |
[
{
"from": "system",
"value": "Add test to confirm url cache is cleared\n"
},
{
"from": "human",
"value": "import pytest\nfrom django.conf import settings\n\nfrom pytest_django_test.compat import force_text\n\npytestmark = pytest.mark.urls('pytest_django_test.urls_overridden')\n\ntry:\n from d... | python | chosen |
[
{
"from": "system",
"value": "DOC: Include Add node in user API documentation\n"
},
{
"from": "human",
"value": "################################################################################\n# Copyright (C) 2013 Jaakko Luttinen\n#\n# This file is licensed under the MIT License.\n############... | python | chosen |
[
{
"from": "system",
"value": "Set root view depending on what views are enabled\n"
},
{
"from": "human",
"value": "\"\"\"Root URL routing\"\"\"\nfrom django.conf.urls.defaults import patterns\nfrom django.conf.urls.static import static\nfrom django.views.generic import TemplateView\n\nfrom kitch... | python | chosen |
[
{
"from": "system",
"value": "[SD-1422] Check that the session is the right one\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8; -*-\n#\n# This file is part of Superdesk.\n#\n# Copyright 2013, 2014 Sourcefabric z.u. and contributors.\n#\n# For the full copyright and license information, p... | python | chosen |
[
{
"from": "system",
"value": "Break an empty func definition into multiple lines for clearer coverage output.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom spiralgalaxygame import callee\n\n\nclass calleeTests (unittest.TestCase):\n def test_str_of_func(self):\n def my_fun... | python | chosen |
[
{
"from": "system",
"value": "Use generic state filter instead of custom one\n\n- ITACLOUD-6837\n"
},
{
"from": "human",
"value": "import django_filters\n\nfrom .models import Deployment\n\n\nclass DeploymentFilter(django_filters.FilterSet):\n db_name = django_filters.CharFilter()\n state ... | python | chosen |
[
{
"from": "system",
"value": "BE: Add Jinja filter to convert URL params to dict\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"Jinja custom filters\"\n\nimport re\nfrom cla_public.apps.base import base\nfrom babel.dates import format_datetime\n\n\n@base.app_template_filter()\ndef... | python | chosen |
[
{
"from": "system",
"value": "Remove textwrap because python 2.7 lacks indent() function\n"
},
{
"from": "human",
"value": "import warnings\nimport platform\n\n\ndef deprecated(func):\n \"\"\"This is a decorator which can be used to mark functions\n as deprecated. It will result in a warni... | python | chosen |
[
{
"from": "system",
"value": "Make scheduler do primary reads only"
},
{
"from": "human",
"value": "from tapiriik.database import db\nfrom tapiriik.messagequeue import mq\nfrom tapiriik.sync import Sync\nimport kombu\nfrom datetime import datetime\nimport time\n\nSync.InitializeWorkerBindings()\... | python | chosen |
[
{
"from": "system",
"value": "Add entry point for the CLI script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nwith open('README.rst') as readme_file:\n... | python | chosen |
[
{
"from": "system",
"value": "Set new minimum django-appconf version\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nimport account\n\n\nsetup(\n name=\"django-user-accounts\",\n version=account.__version__,\n author=\"Brian Rosner\",\n author_email=... | python | chosen |
[
{
"from": "system",
"value": "Fix awscli to 1.12.2 as there are errors in later versions\n"
},
{
"from": "human",
"value": "from setuptools import setup\nsetup(\n name='aws-helpers',\n description='Set of AWS helper scripts',\n url='https://github.com/otype/aws-helpers',\n author='Ha... | python | chosen |
[
{
"from": "system",
"value": "Add POSIX as supported OS type\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\ndef read(f):\n try:\n with open(f) as file:\n return file.read()\n except:\n return \"\"\n\nsetup(name='shellvars-py',\n version='0.... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Pin to same version as on production.\"\n\nThis reverts commit cd93e130ada22ae66c406ad67101e3b1bf892053.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()... | python | chosen |
[
{
"from": "system",
"value": "Fix missing templates in source packages\n\nSigned-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>\n"
},
{
"from": "human",
"value": "\"\"\"Setuptools configuration for rpmvenv.\"\"\"\n\nfrom setuptools import setup\nfrom setuptools import ... | python | chosen |
[
{
"from": "system",
"value": "Fix script name\nBump to 0.1.2\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nwith open('README.rst') as readme:\n long_description = readme.read()\n\nVERSION = '0.1.1'\n\nsetup(\n install_requires=['gmusicapi', 'colorama', 'requests', ... | python | chosen |
[
{
"from": "system",
"value": "Use new invoke's context parameter\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom invoke import task, run\n\n\n@task\ndef clean():\n run(\"rm -rf .coverage dist build\")\n\n\n@task(clean, default=True)\ndef test():\n run(\"py.test\")\n\n\n@... | python | chosen |
[
{
"from": "system",
"value": "Add friends to author view.\n"
},
{
"from": "human",
"value": "# Author: Braedy Kuzma\n\nfrom rest_framework.views import APIView\n\nfrom .serializers import AuthorSerializer\nfrom .dataUtils import getAuthor\nfrom .httpUtils import JSONResponse\n\nclass AuthorView(... | python | chosen |
[
{
"from": "system",
"value": "Use a py3 compatible urlencode"
},
{
"from": "human",
"value": "\nimport urllib\nfrom django import template\n\nregister = template.Library()\n\n@register.inclusion_tag('bootstrap_paginator/paginator.html', takes_context=True)\ndef paginator(context, page=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Make sure MEDIA_URL is available in the context of every template\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\nSETTINGS_TO_ADD = (\n 'GOOGLE_ANALYTICS_ACCOUNT',\n 'SOURCE_HINTS',\n)\n\ndef add_settings(request):\n \"\"\"Add some se... | python | chosen |
[
{
"from": "system",
"value": "mscgen: Improve package short and long descriptions\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nlong_desc = '''\nThis package contains the mscgen Sphinx extension.\n\nAllow mscgen-formatted Message Seq... | python | chosen |
[
{
"from": "system",
"value": "Bump version number to v1.4.4.\n"
},
{
"from": "human",
"value": "__version__ = 'v1.4.3'\nFILE_NAME = 'ok'\n\nimport os\nimport sys\n\nsys.path.insert(0, '')\n# Add directory in which the ok.zip is stored to sys.path.\nsys.path.append(os.path.dirname(os.path.abspath... | python | chosen |
[
{
"from": "system",
"value": "Fix error in getting mouse posititions.\n"
},
{
"from": "human",
"value": "import pygame\n\nLEFT = 1\n\nclass Gui:\n def __init__(self):\n self.gui_elements = list()\n\n def update(self, mouse, events):\n curr_element = None\n for element ... | python | chosen |
[
{
"from": "system",
"value": "Fix date range in worklog_period\n"
},
{
"from": "human",
"value": "from datetime import date\n\nfrom django.db.models import Max, Min\n\n\ndef worklog_period(obj):\n activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))\n article_period = o... | python | chosen |
[
{
"from": "system",
"value": "Add test for peek on empty stack\n"
},
{
"from": "human",
"value": "from stack import Stack\nimport pytest\n\n\ndef test_stack_push():\n stack = Stack()\n stack.push(\"bacon\")\n assert stack.top.value == \"bacon\"\n assert stack.peek() == \"bacon\"\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Add authN/authZ. Start auth process in main()\n"
},
{
"from": "human",
"value": "from pyramid.config import Configurator\nfrom sqlalchemy import engine_from_config\n\nfrom .models import (\n DBSession,\n Base,\n )\n\n\ndef make_session(settings):\n from ... | python | chosen |
[
{
"from": "system",
"value": "Add first pass at a get_package_linkages function\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nimport re\nimport subprocess\n\nfrom conda_build import post\n\nLDD_RE = re.compile(r'\\s*(.*?)\\s*=>\\s*(.*?)\\s... | python | chosen |
[
{
"from": "system",
"value": "Allow empty calendar to be drawn\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom django.views.generic import list_detail\nfrom django.views.generic import date_based\nfrom agenda.events.models import Event\n\ngeneral_info = {\n \"... | python | chosen |
[
{
"from": "system",
"value": "Include the examples in the LiSE package\n"
},
{
"from": "human",
"value": "# This file is part of LiSE, a framework for life simulation games.\n# Copyright (c) Zachary Spector, zacharyspector@gmail.com\nimport sys\nif sys.version_info[0] < 3 or (\n sys.vers... | python | chosen |
[
{
"from": "system",
"value": "Fix failing mock of cache backend\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport unittest\n\nfrom thumbnails.backends import generate_filename, get_thumbnail\nfrom thumbnails.images import SourceFile, Thumbnail\n\nfrom .compat import mock\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Make stop words a set for speed optimization.\n"
},
{
"from": "human",
"value": "import os\nfrom operator import itemgetter\nimport re\n\nfrom haystack.query import SearchQuerySet\nfrom pombola.hansard import models as hansard_models\n\n\nBASEDIR = os.path.dirname(_... | python | chosen |
[
{
"from": "system",
"value": "Add a descriptive docstring to main cclib module\n"
},
{
"from": "human",
"value": "# This file is part of cclib (http://cclib.sf.net), a library for parsing\n# and interpreting the results of computational chemistry packages.\n#\n# Copyright (C) 2006-2013 the cclib... | python | chosen |
[
{
"from": "system",
"value": "[AC-9653]: Implement feedback - remove deletion\n"
},
{
"from": "human",
"value": "from factory import Sequence\nfrom factory.django import DjangoModelFactory\n\nfrom accelerator.models import Community\n\n\nclass CommunityFactory(DjangoModelFactory):\n class Met... | python | chosen |
[
{
"from": "system",
"value": "Add a test for slug collision"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom pages.models import *\nfrom django.test.client import Client\n\nclass PagesTestCase(TestCase):\n fixtures = ['tests.json']\n\n def test_01_add_page(self):\n... | python | chosen |
[
{
"from": "system",
"value": "Fix TypeError: 'NoneType' object is not callable when running tests\n"
},
{
"from": "human",
"value": "from sublime import Region\nfrom sublime_plugin import TextCommand\n\n\nclass PhpunitTestSetupFixtureCommand(TextCommand):\n def run(self, edit, text):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix period validation in daily quota serializer.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom datetime import timedelta\n\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext_lazy as _\nfrom rest_fra... | python | chosen |
[
{
"from": "system",
"value": "Create only one MDAnalysis selection\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\n# Local module\nfrom .structure import Chain, Atom\nfrom .PDB import PDB\n\n# Conditional import\ntry... | python | chosen |
[
{
"from": "system",
"value": "Rename DI1MUX to be underneith the *LUT.\n\nSigned-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# FIXME: getting two bits\n# 00_40 31_46\n# Can we find instance... | python | chosen |
[
{
"from": "system",
"value": "Fix Redis connection over TLS\n\nWhen Designate is configured to use Redis for coordination over a TLS connection, it will fail to connect with \"ssl.SSLError: ('timed out',)\".\nThis is caused by eventlet raising ssl.SSLError instead of the expected socket timeout the core lib... | python | chosen |
[
{
"from": "system",
"value": "Fix urlpatterns for Django 1.10.\n"
},
{
"from": "human",
"value": "from django.conf import urls\n\nfrom tastypie import api\n\nfrom . import resources\n\nv1_api = api.Api(api_name='v1')\nv1_api.register(resources.StreamResource())\n\nurlpatterns = urls.patterns(\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a constant that determines the response when no results are found\n"
},
{
"from": "human",
"value": "from IPython.display import Image\n\nimport requests\n\nAPI_ENDPOINT = 'http://api.giphy.com/v1/gifs/random'\n\n# This is the Giphy API's public beta key, see ht... | python | chosen |
[
{
"from": "system",
"value": "Remove logging and allow anonymous access (for Crucible for example)\n"
},
{
"from": "human",
"value": "import json\nimport logging\nimport requests\nimport plugins.settings as settings\n\nheaders = {'accept': 'application/json'}\n\n\ndef get(config, path, data=None... | python | chosen |
[
{
"from": "system",
"value": "Allow static files to go through (for now)"
},
{
"from": "human",
"value": "import logging\n\nfrom flask import request\nfrom flask.ext.login import current_user, UserMixin, AnonymousUserMixin\n\nfrom .core import app, auth\n\nlog = logging.getLogger(__name__)\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add other options to install packages\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport weka.core.jvm as jvm\nimport weka.core.packages as packages\n\njvm.start()\n\n# checking for installed packages\ninstalled_packages = packag... | python | chosen |
[
{
"from": "system",
"value": "Check semantic similarity of last word in phrase as well as entire phrase\n"
},
{
"from": "human",
"value": "from utils.synonyms import cached_synonyms\nfrom nltk.corpus import wordnet as wn\n\n\ndef semantic_similarity(word1, word2):\n if fast_semantic_similarit... | python | chosen |
[
{
"from": "system",
"value": "Write a docstring for the package\n"
},
{
"from": "human",
"value": "from .camera import Camera\nfrom .scene import Scene, Element, Light\nfrom .version import __version__\nfrom .grid import Grid\nfrom .homogeneous import (translate, scale, rotatex, rotatey, rotatez... | python | chosen |
[
{
"from": "system",
"value": "Remove storageRubeusConfig.js from osfstorage init.py\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\nfrom . import routes, views, model\n\nMODELS = [\n model.OsfStorageNodeSettings,\n model.OsfStorageFileTree,\n model.OsfStor... | python | chosen |
[
{
"from": "system",
"value": "Fix frequency formating and handling\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.core.urlresolvers import reverse\nfrom django.utils.html import format_html\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef active(reques... | python | chosen |
[
{
"from": "system",
"value": "Add policy description for os-host\n\nThis commit adds policy doc for os-host policies.\n\nPartial implement blueprint policy-docs\n\nChange-Id: Ie15125f025dbb4982ff27cfed12047e8fce3a3cf\n"
},
{
"from": "human",
"value": "# Copyright 2016 Cloudbase Solutions Srl\n# ... | python | chosen |
[
{
"from": "system",
"value": "Update BitbucketAuthenticatedMethodsTest's test_get_tags and test_get_branches methods.\n\nSigned-off-by: Baptiste Millou <1cfd48a9a65a966defdcd720f66cd790094000c4@smoothie-creative.com>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport unittest\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add a name to present task in djcelery options\n"
},
{
"from": "human",
"value": "from celery.task import task\nfrom django.conf import settings\nfrom xapi.sender import TinCanSender\n\n\n@task\ndef send_2_tin_can():\n options = settings.TRACKING_BACKENDS['xapi'... | python | chosen |
[
{
"from": "system",
"value": "Add check for maximum length (taken from the original Edgecast ec_encrypt.c example)\n"
},
{
"from": "human",
"value": "from ctypes import CDLL, create_string_buffer, byref\nimport pkg_resources\n\nbf = CDLL(pkg_resources.resource_filename(__name__, '_ecblowfish.so'... | python | chosen |
[
{
"from": "system",
"value": "Add get_updated_field to search index\n\nThis will allow us to only update the search index for models updated in\na given timedelta.\n"
},
{
"from": "human",
"value": "from haystack import indexes\nfrom celery_haystack.indexes import CelerySearchIndex\n\nfrom popol... | python | chosen |
[
{
"from": "system",
"value": "Switch to nose test runners - probably shouldn't use fabric in this project.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nfrom fabric.api import *\nfrom fab_shared import (test, tornado_test_runner, tornado_deploy as deploy,\n setup, d... | python | chosen |
[
{
"from": "system",
"value": "Add comments to MapWidget class and MapWidget.render method\n"
},
{
"from": "human",
"value": "from django.forms import widgets\nfrom django.utils.safestring import mark_safe\n\n\nclass MapWidget(widgets.HiddenInput):\n def render(self, name, value, attrs=None):\... | python | chosen |
[
{
"from": "system",
"value": "Fix super bug in wave\n"
},
{
"from": "human",
"value": "\"\"\" Run wave propagation\"\"\"\n# coding=utf-8\nimport numpy as np\n\nfrom ..algorithms import BoundaryCondition\nfrom ..classes import Grid, Simulation\n\n\nclass wave_propagation(Simulation):\n def __i... | python | chosen |
[
{
"from": "system",
"value": "Add first pass at \"none\" koan. One test left.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n# Based on AboutNil in the Ruby Koans\n#\n\nfrom runner.koan import *\n\nclass AboutNone(Koan):\n\n def test_none_is_an_object(... | python | chosen |
[
{
"from": "system",
"value": "Change line wrap to appease pycodestyle.\n"
},
{
"from": "human",
"value": "\nclass Constellation(object):\n \"\"\"Manage and analyze data from multiple pysat Instruments.\n\n FIXME document this.\n \"\"\"\n def __init__(self, instruments=None, name=None... | python | chosen |
[
{
"from": "system",
"value": "Add temporary default admin user\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport transaction\n\nfrom sqlalchemy import engine_from_config\n\nfrom pyramid.paster import (\n get_appsettings,\n setup_logging,\n )\n\nfrom pyramid.scripts.common... | python | chosen |
[
{
"from": "system",
"value": "Replace base_name with basename\nbase_name is deprecated\n"
},
{
"from": "human",
"value": "import copy\nfrom rest_framework.routers import DefaultRouter, SimpleRouter\nfrom events.api import all_views as events_views\nfrom helevents.api import all_views as users_vi... | python | chosen |
[
{
"from": "system",
"value": "Add example for additional breadcrumb items.\n"
},
{
"from": "human",
"value": "from cruditor.mixins import CruditorMixin\nfrom django.views.generic import TemplateView\n\nfrom examples.mixins import ExamplesMixin\n\n\nclass DemoView(ExamplesMixin, CruditorMixin, Te... | python | chosen |
[
{
"from": "system",
"value": "Move from ps2ascii to ps2txt, for better results\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-:\nimport urllib2\nimport hashlib\nimport os\n\n\ndef construct_body(link):\n if link.content == u'˘':\n # this signals that content generation previ... | python | chosen |
[
{
"from": "system",
"value": "Document unhexlify requirements in hash_token()\n"
},
{
"from": "human",
"value": "import binascii\n\nfrom cryptography.hazmat.backends import default_backend\nfrom cryptography.hazmat.primitives import hashes\nfrom os import urandom as generate_bytes\n\nfrom knox.s... | python | chosen |
[
{
"from": "system",
"value": "Bump django.VERSION for RC 1.\n\ngit-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@11289 bcc190cf-cafb-0310-a4f2-bffc1f526a37\n"
},
{
"from": "human",
"value": "VERSION = (1, 1, 0, 'beta', 1)\n\ndef get_version():\n version = '%s.%s' % (VERSION[0], VERSION[1])... | python | chosen |
[
{
"from": "system",
"value": "Allow comparison within a fixed time period\n\nTo get an idea of average run-time, I wanted to be able to test\nmergesort and quicksort with the same inputs many times over;\nnow by specifying a time limit and array length, the script will\nrun each algorithm on as many times a... | python | chosen |
[
{
"from": "system",
"value": "Stop maintaining old code paths\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\nfrom termcolor import colored\nimport re\n\n\ndef strip_ansi(s):\n # http://stackoverflow.com/questions/13506033/filtering-out-ansi-escape-sequences\n retur... | python | chosen |
[
{
"from": "system",
"value": "Remove raw results from IPWhois object.\n"
},
{
"from": "human",
"value": "\"\"\"\nViews for the rdap_explorer project, query app.\n\"\"\"\n\nimport ipwhois\n\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render\nfrom django.urls import... | python | chosen |
[
{
"from": "system",
"value": "Make our trace decorator a bit more robust\n"
},
{
"from": "human",
"value": "from decorator import decorator\n\n@decorator\ndef trace(f, *args, **kw):\n r = f(*args, **kw)\n print \"%s(%s, %s) = %s\" % (f.func_name, args, kw, r)\n return r\n"
},
{
... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.