conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Increase number of server workers\n"
},
{
"from": "human",
"value": "\"\"\"Configuration file for gunicorn.\"\"\"\n\n# Details from https://cloud.google.com/appengine/docs/flexible/python/runtime\nworker_class = \"gevent\"\nforwarded_allow_ips = \"*\"\nsecure_scheme... | python | chosen |
[
{
"from": "system",
"value": "Add Linux 32-bit search path for Boost libraries\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nfrom SCons.Script import File\n\nfrom path_helpers import path\n\n\ndef get_lib_paths():\n if sys.platform == 'win32':\n lib_paths = set(os.environ... | python | chosen |
[
{
"from": "system",
"value": "Convert to use the base class and update for new plugin path.\n"
},
{
"from": "human",
"value": "import re, snmpy_plugins\n\nclass log_processor:\n def __init__(self, conf):\n self.data = [{'value':0, 'label': conf['objects'][item]['label'], 'regex': re.co... | python | chosen |
[
{
"from": "system",
"value": "Remove Query from import and add explicit event module import.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"The sqlservice package.\n\"\"\"\n\nfrom .__pkg__ import (\n __description__,\n __url__,\n __version__,\n __author__,\n __e... | python | chosen |
[
{
"from": "system",
"value": "Add better connection management ...\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: <encoding name> -*-\n\nimport os\nimport sys\nimport time\nimport re\nimport MySQLdb\nfrom MySQLdb import cursors\n\n\nclass mysql:\n\n cn = None\n\n host ... | python | chosen |
[
{
"from": "system",
"value": "Add URL for django admin access to screenshots\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.views.generic.base import RedirectView\nfrom django.conf import settings\n\nfrom django.contrib import admin\nadmin.aut... | python | chosen |
[
{
"from": "system",
"value": "Add python to install script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport subprocess\n\n\ndef main():\n subprocess.call([\"apt-get\", \"update\"])\n subprocess.call([\"apt-get\", \"-y\", \"upgrade\"])\n subprocess.call([\"apt-get\", \"-y... | python | chosen |
[
{
"from": "system",
"value": "Document the rich text plugin\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\nfrom django.utils.html import strip_tags\nfrom django.utils.text ... | python | chosen |
[
{
"from": "system",
"value": "Allow to specify a database when running a query\n"
},
{
"from": "human",
"value": "from fabric.api import sudo, hide\nfrom braid import package\nfrom pipes import quote\n\n\ndef install():\n package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])\n\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Add message to malformed exception\n"
},
{
"from": "human",
"value": "from .exceptions import MalformedFileError\n\n\nclass WebVTTParser:\n\n def _parse(self, content):\n self.content = content\n\n def read(self, file):\n with open(file, encoding... | python | chosen |
[
{
"from": "system",
"value": "Add structure for feature extractors for JSON files\n"
},
{
"from": "human",
"value": "import json\n\ndef getVersion(b64decodedData):\n json_map = json.loads(b64decodedData)\n if not json_map.has_key(\"View\"):\n return None\n return json.loads(b64de... | python | chosen |
[
{
"from": "system",
"value": "Fix get_pypi_packages for new requirements-parser\n"
},
{
"from": "human",
"value": "\"\"\"Core pep438 utility functions\"\"\"\nfrom __future__ import unicode_literals\n\nimport requests\ntry:\n import xmlrpclib\nexcept:\n import xmlrpc.client as xmlrpclib # ... | python | chosen |
[
{
"from": "system",
"value": "Change url routes to use primary key instead of id\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.contrib.auth.decorators import login_required\nfrom imager_images.views import (AlbumCreate, AlbumUpdate, AlbumDele... | python | chosen |
[
{
"from": "system",
"value": "Set group as read only when inviting students\n"
},
{
"from": "human",
"value": "from aiohttp.web import Application\n\nfrom db_helper import get_most_recent_group\nfrom mail import send_user_email\nfrom permissions import get_users_with_permission\n\n\nasync def st... | python | chosen |
[
{
"from": "system",
"value": "Make Render available under chainerrl.wrappers\n"
},
{
"from": "human",
"value": "from chainerrl.wrappers.cast_observation import CastObservation # NOQA\nfrom chainerrl.wrappers.cast_observation import CastObservationToFloat32 # NOQA\n\nfrom chainerrl.wrappers.ran... | python | chosen |
[
{
"from": "system",
"value": "Make OAuth path hack platform independent.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nrequests._oauth\n~~~~~~~~~~~~~~~\n\nThis module comtains the path hack neccesary for oauthlib to be vendored into requests\nwhile allowing upstream chang... | python | chosen |
[
{
"from": "system",
"value": "Fix task and set language code when sending reminders\n"
},
{
"from": "human",
"value": "from django.utils import timezone\nfrom django.conf import settings\n\nfrom studygroups.models import StudyGroup\nfrom studygroups.models import Reminder\nfrom studygroups.model... | python | chosen |
[
{
"from": "system",
"value": "Add a find_name utility function\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n\"\"\"Small utility functions for use in various places.\"\"\"\n\n__all__ = [\"pick\", \"is_dunder\"]\n\ndef pick(arg, default):\n \"\"\"Handler for default versus given... | python | chosen |
[
{
"from": "system",
"value": "Make sha256sum work with open filehandles too\n"
},
{
"from": "human",
"value": "import hashlib\n\ndef sha256sum(filename):\n \"\"\"Returns sha256sum for file\"\"\"\n\n f = file(filename, 'rb')\n m = hashlib.sha256()\n while True:\n b = f.read(809... | python | chosen |
[
{
"from": "system",
"value": "Add convenience initializers for `MemberDeclList`\n"
},
{
"from": "human",
"value": "SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {\n 'DeclBuildable': [\n 'CodeBlockItem',\n 'MemberDeclListItem',\n 'SyntaxBuildable'\n ],\n 'ExprList':... | python | chosen |
[
{
"from": "system",
"value": "Add 'six' to known_third_party for SortImports\n\nsix was being sorted incorrectly due to being classed as first party.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import absolute_import, division, print_function\n\nfrom pathlib import Path\n... | python | chosen |
[
{
"from": "system",
"value": "Use different puzzle in this test as it uses number that .puz accepts\n"
},
{
"from": "human",
"value": "import unittest\n\nimport ipuz\nimport puz\n\nimport crossword\n\n\nclass FormatUnitTest(unittest.TestCase):\n\n def test_to_ipuz_only_include_ipuz_specific_d... | python | chosen |
[
{
"from": "system",
"value": "Implement tests for replay.dump args\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_replay\n-----------\n\"\"\"\n\n\ndef test_get_user_config():\n config_dict = get_user_config()\n assert 'replay_dir' in config_dict\n\n expected_... | python | chosen |
[
{
"from": "system",
"value": "Use string slices with a stride\n"
},
{
"from": "human",
"value": "import math\n\n\ndef encode(s):\n s = list(filter(str.isalnum, s.lower()))\n size = math.ceil(math.sqrt(len(s)))\n s += \".\" * (size**2 - len(s))\n parts = [s[i*size:(i+1)*size] for i in... | python | chosen |
[
{
"from": "system",
"value": "Add update orphaning job to Airflow\n\nThis depends on the longitudinal job running successfully to run.\n"
},
{
"from": "human",
"value": "from airflow import DAG\nfrom datetime import datetime, timedelta\nfrom operators.emr_spark_operator import EMRSparkOperator\n... | python | chosen |
[
{
"from": "system",
"value": "Fix a TypeError when load mergeTool setting\n\ncx-freeze isn't include pickle module on the Windows platform,\nit cause \"TypeError: unable to convert a C++ 'QVariantList'\ninstance to a Python object\"\n"
},
{
"from": "human",
"value": "import sys\n\nfrom glob impo... | python | chosen |
[
{
"from": "system",
"value": "Verify message sent via SQL\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport cgi, subprocess, json\n\narguments = cgi.FieldStorage()\nbody = arguments.getvalue('body', '')\nmessageTo = arguments.getvalue('messageTo', '')\n\nexitCode = subprocess.ca... | python | chosen |
[
{
"from": "system",
"value": "Use pandas native saving by forcing date to not be index, and be string"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport datetime\n\nimport scraperwiki\nimport numpy\nimport pandas.io.data as web\n\n\ndef get_stock(stock, start, end, service):\n \"\... | python | chosen |
[
{
"from": "system",
"value": "Update to new response handling\n"
},
{
"from": "human",
"value": "from motobot import IRCBot, command, Notice\n\n\ndef get_command_help(bot, command, modifier):\n responses = []\n\n func = lambda x: x.type == IRCBot.command_plugin and x.arg.lower() == command... | python | chosen |
[
{
"from": "system",
"value": "Make /cs/ point to the correct handler, no more apply handlre\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns, include, url\n\n# Uncomment the next two lines to enable the admin:\n# from django.contrib import admin\n# admin.autodisc... | python | chosen |
[
{
"from": "system",
"value": "Add names to stanford view handlers\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import url\n\nimport contentstore.views\n\n\nurlpatterns = [\n url(\n r'^settings/send_test_enrollment_email/{}$'.format(settings... | python | chosen |
[
{
"from": "system",
"value": "Fix typo create_conversion_rates in commands\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\n\nfrom ...tasks import update_conversion_rates, create_conversion_dates\n\n\nclass Command(BaseCommand):\n\n def add_arguments(sel... | python | chosen |
[
{
"from": "system",
"value": "Add temp pic file sequence to takepicture file\n"
},
{
"from": "human",
"value": "import picamera as p\nimport os\nimport time\n\nos.chdir('/home/pi/Desktop')\n\ncam = p.PiCamera()\ncam.resolution = (320,240)\ncam.hflip = True\ncam.vflip = True\n\nx = 0\nwhile x < 1... | python | chosen |
[
{
"from": "system",
"value": "Fix copr build trigger script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport json, os, sys\nimport requests\napi_url = \"https://copr.fedorainfracloud.org/api_2\"\napi_login = os.environ[\"copr_login\"]\napi_token = os.environ[\"copr_token\"]\n\nr... | python | chosen |
[
{
"from": "system",
"value": "Update to new command line\n"
},
{
"from": "human",
"value": "from os.path import dirname\n\nfrom django.conf import settings\nfrom pipeline.compilers import SubProcessCompiler\n\nclass Dart2jsCompiler(SubProcessCompiler):\n output_extension = 'js'\n\n def mat... | python | chosen |
[
{
"from": "system",
"value": "Add a test for s_cells.deploy()\n"
},
{
"from": "human",
"value": "import synapse.axon as s_axon\nimport synapse.cells as s_cells\nimport synapse.cryotank as s_cryotank\n\nfrom synapse.tests.common import *\n\nclass CellTest(SynTest):\n def test_getcells(self):\n... | python | chosen |
[
{
"from": "system",
"value": "Add missing svn:eol-style property to text files.\n"
},
{
"from": "human",
"value": "\"\"\"\r\nA number of function that enhance IDLE on MacOSX when it used as a normal\r\nGUI application (as opposed to an X11 application).\r\n\"\"\"\r\nimport sys\r\n\r\ndef running... | python | chosen |
[
{
"from": "system",
"value": "Fix optional inspection in 3.9\n"
},
{
"from": "human",
"value": "from typing import Tuple, Union\n\n\ndef inspect_optional_typing(annotation) -> Tuple[bool, type]:\n # seems like at some point internal behavior on typing Union changed\n # https://bugs.launchp... | python | chosen |
[
{
"from": "system",
"value": "flake8: Fix all warnings in sets app\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils import timezone\n\nfrom comics.core.models import Comic\n\n\nclass Set(models.Model):\n name = models.SlugField(max_length=100, unique=True,\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove unreachable code. Use functools.wraps.\n\n - Remove code that was unreachable. Thanks Jaskirat\n (http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/#c24691)\n - Use functools.wraps to make the retry decorator \"well behaved\"\n - Fix typo\n"
},... | python | chosen |
[
{
"from": "system",
"value": "Rename url namespace users -> account.\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom django.core.urlresolvers import reverse\nfrom django.utils.functional import lazy\n\nreverse_lazy = lazy(reverse, unicode)\n\nurlpatterns = patter... | python | chosen |
[
{
"from": "system",
"value": "Add a `stop` command to the script."
},
{
"from": "human",
"value": "import six\nfrom subprocess import Popen, PIPE\n\n\ndef run_ipcluster(n=4):\n \"\"\"Convenient way to start an ipcluster for testing.\n\n You have to wait for it to start, however.\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Revert the removal of an unused import (in [14175]) that was referenced in documentation. Thanks for noticing, clong.\n\n--HG--\nextra : convert_revision : svn%3Abcc190cf-cafb-0310-a4f2-bffc1f526a37/django/trunk%4014359\n"
},
{
"from": "human",
"value": "from django... | python | chosen |
[
{
"from": "system",
"value": "Disable config.scan() as well for now\n"
},
{
"from": "human",
"value": "from pyramid.config import Configurator\nfrom pyramid.events import BeforeRender\nfrom sqlalchemy import engine_from_config\n\nfrom . import helpers\nfrom .model import Session, Base\n\n\ndef a... | python | chosen |
[
{
"from": "system",
"value": "Convert card number to string for iteration\n"
},
{
"from": "human",
"value": "# File: luhn.py\n# Purpose: Write a program that can take a number and determine whether\n# or not it is valid per the Luhn formula.\n# Programmer: Amal Shehu\n# ... | python | chosen |
[
{
"from": "system",
"value": "Add DiscussionView to the URLs.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\n\nfrom .views import AwayView, BumperView, GameView, PrologueView\n\n\nurlpatterns = pa... | python | chosen |
[
{
"from": "system",
"value": "Make sure every payment state is present in the counter.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.blueprints.shop_admin.service\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2014 Jochen Kupperschmidt\n\"\"\"\n\nfrom co... | python | chosen |
[
{
"from": "system",
"value": "Update test to match current behavior\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom mock import Mock\nfrom unittest2 import TestCase\nfrom raven.events import Message\n\n\nclass MessageTest(TestCase):\n\n def test_to_string(self):\n un... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong URL for success login\n"
},
{
"from": "human",
"value": "from django.views.generic import FormView, RedirectView\nfrom django.contrib.auth.forms import AuthenticationForm\nfrom django.core.urlresolvers import reverse\nfrom django.contrib.auth import login,... | python | chosen |
[
{
"from": "system",
"value": "Add another url pattern for debugging public layers\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\n\n\nurlpatterns = patterns('lingcod.layers.views',\n url(r'^public/', \n 'get_public_layers', \n name='public-data-layers... | python | chosen |
[
{
"from": "system",
"value": "test: Fix change of function names\n"
},
{
"from": "human",
"value": "import pytest\nimport linkatos.confirmation as confirmation\n\n\ndef test_no_confirmation_with_url():\n expecting_confirmation = False\n parsed_m = {'out': 'http://ex.org', 'channel': 'ch', ... | python | chosen |
[
{
"from": "system",
"value": "Bump version number to 1.1\n"
},
{
"from": "human",
"value": "__version__ = '1.0'\n__all__ = ['TimeZoneField', 'TimeZoneFormField']\n\nfrom timezone_field.fields import TimeZoneField\nfrom timezone_field.forms import TimeZoneFormField\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Remove new_ele() and sub_ele() functions\n"
},
{
"from": "human",
"value": "import re\nfrom lxml import etree\n\n\ndef new_ele(tag, attrs={}, **extra):\n etree.Element(tag, attrs, **extra)\n\n\ndef sub_ele(parent, tag, attrs={}, **extra):\n etree.SubElement(pa... | python | chosen |
[
{
"from": "system",
"value": "Reduce frequency of 'random' ssl tests.\n"
},
{
"from": "human",
"value": "from cgi import FieldStorage\nfrom logging import debug, error, info\nfrom time import time\nfrom trackon import tracker\n\nMAX_MIN_INTERVAL = 60*60*5\nDEFAULT_CHECK_INTERVAL = 60*15\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Support configuring SOCKS proxy in the example\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport traceback\n\nfrom telethon_examples.interactive_telegram_client \\\n import InteractiveTelegramClient\n\n\ndef load_settings(path='api/settings'):\n... | python | chosen |
[
{
"from": "system",
"value": "Clean up input tables class and instance declarations\n"
},
{
"from": "human",
"value": "from utils import write_csv_rows, read_csv_rows\n\nclass input_table:\n def __init__(self, filename, content):\n self.filename = filename\n self.content = conte... | python | chosen |
[
{
"from": "system",
"value": "Add actor username to search fields\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom auditlog.filters import ResourceTypeFilter\nfrom auditlog.mixins import LogEntryAdminMixin\nfrom auditlog.models import LogEntry\n\n\nclass LogEntryAdmin(... | python | chosen |
[
{
"from": "system",
"value": "Add a local asTwistedVersion implementation to Axiom, so as to not add another setup-time dependency on Epsilon"
},
{
"from": "human",
"value": "# -*- test-case-name: axiom.test -*-\nfrom axiom._version import __version__\nfrom epsilon import asTwistedVersion\n\nver... | python | chosen |
[
{
"from": "system",
"value": "Print error on mailing a failed job note"
},
{
"from": "human",
"value": "#! /usr/bin/python\nimport sys, time, optparse, os\nimport PEATSA.Core as Core\nimport PEATSA.WebApp as WebApp\nimport ConstructJob\nimport MySQLdb\n\nusage = \"usage: %prog [options]\"\n\npar... | python | chosen |
[
{
"from": "system",
"value": "Index of the list should be an int\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nConvenience functions for in memory deduplication\n\"\"\"\n\nimport collections\nimport dedupe.core\n\n \n\ndef dataSample(data, sample_siz... | python | chosen |
[
{
"from": "system",
"value": "Add checks for script parameters and correct onInit name\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom libavg import avg, app\nimport sys\n\nclass VideoPlayer(app.MainDiv):\n def init(self):\n self.videoNode = av... | python | chosen |
[
{
"from": "system",
"value": "Add SchemaFormMixin to the LoginForm\n"
},
{
"from": "human",
"value": "import colander\nimport deform\n\nfrom csrf import CSRFSchema\n\nclass LoginForm(CSRFSchema):\n \"\"\"The user login form.\"\"\"\n username = colander.SchemaNode(colander.String(),\n ... | python | chosen |
[
{
"from": "system",
"value": "zsh: Print code used to load json in python helper\n"
},
{
"from": "human",
"value": "import argparse\nimport json\n\nparser = argparse.ArgumentParser()\nparser.add_argument('json_file')\nargs = parser.parse_args()\n\nif __name__ == '__main__':\n with open(args.j... | python | chosen |
[
{
"from": "system",
"value": "tests/basics: Add test for getting name of func with closed over locals.\n\nTests correct decoding of the prelude to get the function name.\n"
},
{
"from": "human",
"value": "def Fun():\n pass\n\nclass A:\n def __init__(self):\n pass\n def Fun(self):... | python | chosen |
[
{
"from": "system",
"value": "Remove test for function that no longer exists\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django.test import TestCase\nfrom django.utils import timezone\n\nfrom ..utils import convert_tstamp, plan_from_stripe_id\n\n\nclass TestTimestampConversion(Tes... | python | chosen |
[
{
"from": "system",
"value": "Delete debug comments and tool\n"
},
{
"from": "human",
"value": "def get_menu_titles(page) -> list:\n page.wait_for_load_state()\n menu_list = page.query_selector_all(\"//*[@class='toctree-wrapper compound']/ul/li/a\")\n\n return [title.as_element().inner_... | python | chosen |
[
{
"from": "system",
"value": "Handle env vars in volumes\n"
},
{
"from": "human",
"value": "from string import Template\nfrom collections import defaultdict\nimport os\nimport yaml\n\n\ndef load_defaults():\n skipper_conf = 'skipper.yaml'\n defaults = {}\n if os.path.exists(skipper_conf... | python | chosen |
[
{
"from": "system",
"value": "Add log to self play\n"
},
{
"from": "human",
"value": "import random\n\nfrom game import Game, DiscState\n\nclass SelfPlay:\n\n def __init__(self, game):\n self.game = game\n\n def play(self):\n while self.game.winner is None:\n col_index = self.calc_m... | python | chosen |
[
{
"from": "system",
"value": "Add a function for getting yellow\n"
},
{
"from": "human",
"value": "BLUE = '\\033[94m'\nGREEN = '\\033[92m'\nYELLOW = '\\033[93m'\nRED = '\\033[91m'\nENDC = '\\033[0m'\nBOLD = '\\033[1m'\nUNDERLINE = '\\033[4m'\n\ndef green(text):\n return GREEN + text + ENDC\n\... | python | chosen |
[
{
"from": "system",
"value": "Split program call into two lines.\n"
},
{
"from": "human",
"value": "import extractor.ui.mainapplication as ui\nimport Tkinter as tk\n\ndef main():\n## root = tk.Tk()\n## root.title('SNES Wolfenstein 3D Extractor')\n## root.minsize(400, 100)\n## ui.Main... | python | chosen |
[
{
"from": "system",
"value": "get: Order download links by pk.\n"
},
{
"from": "human",
"value": "from django.shortcuts import render_to_response\nfrom django.shortcuts import redirect\n\nfrom models import DownloadLink\n\ndef index(request):\n links = DownloadLink.objects.all()\n context ... | python | chosen |
[
{
"from": "system",
"value": "Return hand data as dictionary\n"
},
{
"from": "human",
"value": "import time\nfrom lib import Leap\nfrom lib.Leap import Bone\n\n'''\ngets the current frame from controller\nfor each finger, stores the topmost end of each bone (4 points)\nadjusts bone location rela... | python | chosen |
[
{
"from": "system",
"value": "Add files to be compiled.\n"
},
{
"from": "human",
"value": "import urllib.parse\nimport urllib.request\nimport http.cookiejar\n\nurl = 'http://stwebdv.thyssenkruppelevadores.com.br/scripts/gisdesenv.pl/swfw3.r'\nvalues = {'usuario' : 'admin',\n 'senha' : '... | python | chosen |
[
{
"from": "system",
"value": "Add X509 support only when pyOpenSSL is installed\n"
},
{
"from": "human",
"value": "import sys\n\n__version__ = '0.9.1'\n\nENCODINGS = ['Base64',\n 'Base64 URL',\n 'Base32',\n 'Hex',\n 'URL',\n 'HTML',\n ... | python | chosen |
[
{
"from": "system",
"value": "Reorganize imports to be later\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nfrom django.apps import apps as django_apps\n\nfrom .signals import connect\n\n__version__ = '0.0.1'\ndefault_app_config = 'diffs.apps.DiffL... | python | chosen |
[
{
"from": "system",
"value": "Fix docstring for module (minor)\n"
},
{
"from": "human",
"value": "# No shebang line, this module is meant to be imported\n#\n# Copyright 2014 Ambient Entertainment GmbH & Co. KG\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not... | python | chosen |
[
{
"from": "system",
"value": "Update SI version in init\n"
},
{
"from": "human",
"value": "\"\"\"PyModels package.\"\"\"\n\nimport os as _os\nfrom . import LI_V01_01\nfrom . import TB_V02_01\nfrom . import BO_V03_02\nfrom . import TS_V03_03\nfrom . import SI_V22_02\nfrom . import coordinate_syst... | python | chosen |
[
{
"from": "system",
"value": "Add comments for references later\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, url_for, redirect\nfrom peewee import *\n\napp = Flask(__name__)\ndatabase = SqliteDatabase('developmentData.db')\n\n#class Device(Model):\n\n@app.route('/... | python | chosen |
[
{
"from": "system",
"value": "Allow for user-specified newline breaks in values\n"
},
{
"from": "human",
"value": "# load.py\n# loads and formats bp files\n\nimport re\nimport os\nimport os.path\n\n\ndef load(iterator):\n \"\"\"\n Loads lines from an iterator and does line parsing\n\n 1... | python | chosen |
[
{
"from": "system",
"value": "Add host and port parameters\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n__author__ = 'Louis Taylor'\n__email__ = 'louis@kragniz.eu'\n__version__ = '0.1.0'\n\n__all__ = ['Etcd3Client', 'client']\n\nimport grpc\n\nfrom etcd3.etcdrpc i... | python | chosen |
[
{
"from": "system",
"value": "Fix config_drive migration, per Matt Dietz."
},
{
"from": "human",
"value": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2011 OpenStack LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file exc... | python | chosen |
[
{
"from": "system",
"value": "Add stdout tests for basic usage example\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 - *-\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nimport examples.basic_usage\nimport examples.dataset\nimport examples.variant_ts_difficul... | python | chosen |
[
{
"from": "system",
"value": "Update host to use Pi’s static address\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport socket\nimport atexit\nimport pygame\nfrom message import Message\n\n\nPRECISION = 3\n\nhost = \"localhost\"\nport = 9999\n\n# create a socket object and conne... | python | chosen |
[
{
"from": "system",
"value": "Enable app stats on '-dev' instance.\n\nThis will also enable them on local dev server as well since default app name\nin app.yaml is 'isolateserver-dev'.\n\nR=maruel@chromium.org\n\nReview URL: https://codereview.appspot.com/13457054\n"
},
{
"from": "human",
"value... | python | chosen |
[
{
"from": "system",
"value": "Fix Wikia API to not be limited to SVTFOE Wikia\n\n"
},
{
"from": "human",
"value": "import urllib.request\nimport json\n\nclass Wikia:\n wiki_name = \"\"\n\n def __init__(self, wiki):\n self.wiki_name = wiki\n\n def search(self, term, limit=1):\n ... | python | chosen |
[
{
"from": "system",
"value": "Extend example to include non-ASCII characters"
},
{
"from": "human",
"value": "import gtk\n\nfrom kiwi.ui.widgets.entry import Entry\n\nentry = Entry()\nentry.set_completion_strings(['apa', 'apapa', 'apbla',\n 'apppa', 'aaspa'])\n\nwin ... | python | chosen |
[
{
"from": "system",
"value": "Return the number of ms, not seconds.\n"
},
{
"from": "human",
"value": "# File: badgeeventreminder.py\n# Version: 1\n# Description: Easter egg\n# License: MIT\n# Authors: Renze Nicolai <renze@rnplus.nl>\n\nimport virtualtimers, time, appglue, badge\n\n# Tue Aug 8 ... | python | chosen |
[
{
"from": "system",
"value": "Disable code made for old engine model\n"
},
{
"from": "human",
"value": "import unittest\n \nfrom protoplot.engine.item import Item\nfrom protoplot.engine.item_container import ItemContainer\n\nclass Series(Item):\n pass\n\nSeries.options.register(\"color\", Tru... | python | chosen |
[
{
"from": "system",
"value": "Allow replacements in terms at the start and/or end of a text.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom django.db.models import Manager\nfrom django.template.loader import render_to_string\nimport re\n\n\nclass TermManager(Manager):\n def replac... | python | chosen |
[
{
"from": "system",
"value": "Fix migration script to avoid OOM error.\n"
},
{
"from": "human",
"value": "from django.db import migrations\n\n\ndef drop_events(apps, schema_editor):\n Event = apps.get_model('logging', 'Event')\n Event.objects.filter(event_type='openstack_security_group_rul... | python | chosen |
[
{
"from": "system",
"value": "Fix to git status info\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\n\n__version__ = \"0.1.0-1\"\n\ndef _try_init_git_attrs():\n try:\n _init_git_commit()\n except (OSError, subprocess.CalledProcessError):\n pass\n else:\n ... | python | chosen |
[
{
"from": "system",
"value": "Create Alfred data dir on test setup\n"
},
{
"from": "human",
"value": "# tests.__init__\n\nimport os\nimport os.path\nimport shutil\nimport tempfile\nimport yvs.shared as yvs\nfrom mock import patch\n\n\nyvs.ALFRED_DATA_DIR = os.path.join(tempfile.gettempdir(), 'yv... | python | chosen |
[
{
"from": "system",
"value": "Add custom error class 'InvalidOutputType'\n"
},
{
"from": "human",
"value": "\"\"\"\nscrapple.utils.exceptions\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFunctions related to handling exceptions in the input arguments\n\"\"\"\n\nimport re\n\nclass InvalidType(ValueError):\n\t\"... | python | chosen |
[
{
"from": "system",
"value": "Add config option for weeks to truncate and default to 2 weeks\n"
},
{
"from": "human",
"value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one... | python | chosen |
[
{
"from": "system",
"value": "Load tags sql on connection is created on tests.\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom .fixtures import *\n\n\ndef pytest_addoption(parser):\n parser.addoption(\"--runslow\", action=\"store_true\", help=\"run slow tests\")\n\n\ndef pytest_runte... | python | chosen |
[
{
"from": "system",
"value": "Disable trivial USB test case to get suite running on CI.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom openxc.sources import UsbDataSource, DataSourceError\n\nclass UsbDataSourceTests(unittest.TestCase):\n def setUp(self):\n super(UsbDataSour... | python | chosen |
[
{
"from": "system",
"value": "Add missing rpnpy.range reference for Python 3.\n\nSigned-off-by: Stephane_Chamberland <1054841519c328088796c1f3c72c14f95c4efe35@science.gc.ca>\n(cherry picked from commit 23860277c006d9635dedcaaa5e065c7aad199d8c)\n(cherry picked from commit b613c799afbf95e15f99cee50c2f76516a26... | python | chosen |
[
{
"from": "system",
"value": "Build up style from composable functions\n"
},
{
"from": "human",
"value": "from wordbridge.html import HtmlBuilder\n\nhtml = HtmlBuilder()\n\ndef top_level_element(tag_name):\n return TopLevelElement(tag_name)\n\nclass TopLevelElement(object):\n def __init__(... | python | chosen |
[
{
"from": "system",
"value": "Make mapping & filtering into a list comprehension\n"
},
{
"from": "human",
"value": "from re import split\n\nfrom spicedham.tokenizer import BaseTokenizer\n\nclass SplitTokenizer(BaseTokenizer):\n \"\"\"\n Split the text on punctuation and newlines, lowercase... | python | chosen |
[
{
"from": "system",
"value": "Remove incorrect remark about Postgres 9.5\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.