conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix test failing in macOS due to short GIdleThread timeout\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom gaphor.misc.gidlethread import GIdleThread\n\n\ndef counter(count):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add functions for adding a node, an edge, and defining a node\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n\nclass Graph(object):\n ''' Create an empty graph. '''\n ... | python | chosen |
[
{
"from": "system",
"value": "Test for multiple waiters on a signal\n"
},
{
"from": "human",
"value": "import os\nimport signal\n\nimport diesel\n\nstate = {'triggered':False}\n\ndef waiter():\n diesel.signal(signal.SIGUSR1)\n state['triggered'] = True\n\ndef test_can_wait_on_os_signals():... | python | chosen |
[
{
"from": "system",
"value": "Fix case sensitive LDAP attributes\n"
},
{
"from": "human",
"value": "from django_auth_ldap.backend import LDAPBackend\n\nclass NumbasAuthBackend(LDAPBackend):\n \n \"\"\"Authentication backend overriding LDAPBackend.\n \n This could be used to override ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Revert \"do not use minified js on prod\"\" (=don't minify to fix things)\n\nThis reverts commit 88f2886393991ac660ac382d48c65088eff56d52.\n"
},
{
"from": "human",
"value": "import os\n\nfrom rmc.config.flask_base import *\nimport rmc.shared.secrets as s\n\... | python | chosen |
[
{
"from": "system",
"value": "Update to newest version of rl.py.\n"
},
{
"from": "human",
"value": "\"\"\"Load the trained q table and make actions based on that.\n\"\"\"\n\nimport time\nimport env\nimport rl\n\nrl.load_q()\nenv.make(\"pygame\")\n\nwhile True:\n env.reset()\n for _ in rang... | python | chosen |
[
{
"from": "system",
"value": "Allow to add a base url to find media\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom markdown2 import markdown, markdown_path\nfrom weasyprint import HTML, CSS\n\nfrom .exceptions import ValidationError\n\n\n__title__ = 'md2pdf'\n__version__ = '0.2... | python | chosen |
[
{
"from": "system",
"value": "Speed up lookup of formatter by source type\n"
},
{
"from": "human",
"value": "from .formatter import *\n\n\nclass FormatterRegistry():\n def __init__(self):\n self.__formatters = []\n\n def populate(self):\n self.__formatters = [\n Cl... | python | chosen |
[
{
"from": "system",
"value": "Update: Update examples for multiple group\n"
},
{
"from": "human",
"value": "from cmdtree import group, argument, entry\n\n\n@group(\"docker\")\n@argument(\"ip\")\ndef docker():\n pass\n\n\n# nested command\n@docker.command(\"run\")\n@argument(\"container-name\"... | python | chosen |
[
{
"from": "system",
"value": "Add slug field to Dataset model. Using slugs for API looks better than pk.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\n\nclass DatasetLicence(models.Model):\n title = models.CharField(max_length=... | python | chosen |
[
{
"from": "system",
"value": "Simplify by removing user login.\n"
},
{
"from": "human",
"value": "\nfrom google.appengine.api import users\n\nimport webapp2\n\n\nclass MainPage(webapp2.RequestHandler):\n\n def get(self):\n\n self.response.set_status(200)\n self.response.headers['Conte... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary call to PartitionConfig\n"
},
{
"from": "human",
"value": "from .config import PartitionConfig\n\nPROXY_APP = 'sql_proxy_accessors'\nSQL_ACCESSORS_APP = 'sql_accessors'\n\nFORM_PROCESSING_GROUP = 'form_processing'\nPROXY_GROUP = 'proxy'\nMAIN_GROU... | python | chosen |
[
{
"from": "system",
"value": "Add arg normalizing function for labels and index\n\nRefactored from code in `center_of_mass`, the `_norm_input_labels_index`\nfunction handles the normalization of `input`, `labels`, and `index`\narguments. As these particular arguments will show up repeatedly in the\nAPI, it ... | python | chosen |
[
{
"from": "system",
"value": "Update 'bdist' format addition to assume a single 'format_commands' as a dictionary, but fall back to the dual dict/list model for compatibility with stdlib.\n"
},
{
"from": "human",
"value": "from distutils.command.bdist import bdist\nimport sys\n\nif 'egg' not in ... | python | chosen |
[
{
"from": "system",
"value": "Add report making for facility\n"
},
{
"from": "human",
"value": "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass facility(object):\n \"\"\" A Facility currently under monitoring\n\n \"\"\"\n\n def __init__(self , data) :... | python | chosen |
[
{
"from": "system",
"value": "Remove unneeded 'reachedPoints' variable from Task class\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\n\nclass Task(object):\n\n def __init__(self, taskID, sheetID, name, description, maxPoints, reachedPoints=0):\n self.id =... | python | chosen |
[
{
"from": "system",
"value": "Introduce unigram data to warehouse module.\n"
},
{
"from": "human",
"value": "from data import anagram_index, crossword, warehouse\nfrom spec.data.fixtures import tries\n\n\ndef _get_unigram_anagram_index():\n return anagram_index.AnagramIndex(warehouse.get('/word... | python | chosen |
[
{
"from": "system",
"value": "Update imports (json in Py2.6+); removed unused datetime import\n"
},
{
"from": "human",
"value": "import datetime\nfrom django.db import models\ntry:\n import json\nexcept ImportError:\n from django.utils import simplejson as json\nfrom django.utils.timezone ... | python | chosen |
[
{
"from": "system",
"value": "Customize how fields on Email are displayed while adding & editing\n\n- Hide fields `targetted_users`, `is_sent` while adding a new\n Email object\n- Display all fields but make `targetted_users`, `is_sent` fields\n read only when editing an Email object\n"
},
{
"from... | python | chosen |
[
{
"from": "system",
"value": "Update code in dipy/reconst (PEP8)\n\nUsing `pycodestyle` output, the file `dipy/reconst/__init__.py` was\nupdated to pass `pycodestyle` check\n\nSigned-off-by: Antonio Ossa <1ecf3d2f96b6e61cf9b68f0fc294cab57dc5d597@uc.cl>\n"
},
{
"from": "human",
"value": "#init fo... | python | chosen |
[
{
"from": "system",
"value": "Fix L2BD arp termination Test Case\n\n==============================================================================\nL2BD arp termination Test Case\n==============================================================================\n12:02:21,850 Couldn't stat : /tmp/vpp-unittest-T... | python | chosen |
[
{
"from": "system",
"value": "Make curl work in py3 again\n"
},
{
"from": "human",
"value": "import logging\nimport os\n\nfrom twisted.web import server, guard, resource\nfrom twisted.cred import portal\n\nfrom lbrynet import conf\nfrom .auth import PasswordChecker, HttpPasswordRealm\nfrom .util... | python | chosen |
[
{
"from": "system",
"value": "Add a line by line parser\n"
},
{
"from": "human",
"value": "class Asset:\n \"\"\"\n This is an ooni-probe asset. It is a python\n iterator object, allowing it to be efficiently looped.\n To create your own custom asset your should subclass this\n and... | python | chosen |
[
{
"from": "system",
"value": "Implement the interface specification in two easy lines (plus an import).\n"
},
{
"from": "human",
"value": "import inspect\n\n\nclass PreconditionError (TypeError):\n pass\n\n\ndef preconditions(*precs):\n\n precinfo = []\n for p in precs:\n spec = ... | python | chosen |
[
{
"from": "system",
"value": "Cover an even deeper nesting of closures for the overflow function, still commented out though.\n"
},
{
"from": "human",
"value": "#\n# Kay Hayen, mailto:kayhayen@gmx.de\n#\n# Python test originally created or extracted from other peoples work. The\n# pa... | python | chosen |
[
{
"from": "system",
"value": "Add module.py test and modify some others for better coverage.\nRemove files not used.\n"
},
{
"from": "human",
"value": "import pytest\nimport os\nfrom SCNIC.general import simulate_correls\nfrom SCNIC.between_correls import between_correls\n\n\n@pytest.fixture()\n... | python | chosen |
[
{
"from": "system",
"value": "Remove unused imports in mesos cluster\n"
},
{
"from": "human",
"value": "from sparkperf.cluster import Cluster\nimport json\nimport re\nimport os\nimport sys\nimport time\nimport urllib2\n\n\nclass MesosCluster(Cluster):\n \"\"\"\n Functionality for interacti... | python | chosen |
[
{
"from": "system",
"value": "Drop the ';' in the Python codegen as it's not necessary.\n"
},
{
"from": "human",
"value": "<% if (showSetup) { -%>\nfrom KalturaClient import *\nfrom KalturaClient.Plugins.Core import *\n<% plugins.forEach(function(p) { -%>\nfrom KalturaClient.Plugins.<%- p.charAt... | python | chosen |
[
{
"from": "system",
"value": "Update logging for message output and consistency.\n"
},
{
"from": "human",
"value": "import logging\n\nfrom flask import request\nfrom flask.views import MethodView\nfrom flask_helpers.build_response import build_response\n\n# Import the Game Controller\nfrom Game.... | python | chosen |
[
{
"from": "system",
"value": "Make setup.py smoke test more specific again as requested in review"
},
{
"from": "human",
"value": "#\n# Copyright (c) 2009 Testrepository Contributors\n# \n# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause\n# license at the users choice. ... | python | chosen |
[
{
"from": "system",
"value": "Fix aiohttp_request to properly perform aiohttp requests\n"
},
{
"from": "human",
"value": "import aiohttp\n\n\nasync def aiohttp_request(loop, method, url, output='text', **kwargs): # NOQA: E999\n async with aiohttp.ClientSession(loop=loop) as session: # NOQA:... | python | chosen |
[
{
"from": "system",
"value": "Add django 1.11 to the import check"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom django import get_version\n\nmyPath = os.path.dirname(os.path.abspath(__file__))\nsys.path.insert(0, myPath)\n\nVERSION = (0, 7, 18)\n\ndefault_app_config = 'django_q.ap... | python | chosen |
[
{
"from": "system",
"value": "Add _clones attribute in new init method\n"
},
{
"from": "human",
"value": "__all__ = ['CloneableMeta']\n\n\nclass CloneableMeta(type):\n\n def __new__(metacls, cg_name, bases, clsdict):\n new_cls = super(CloneableMeta, metacls).__new__(metacls, cg_name, b... | python | chosen |
[
{
"from": "system",
"value": "Remove system name from savelist in lmod"
},
{
"from": "human",
"value": "import os # require by lmod output evaluated by exec()\n\nfrom functools import partial\nfrom os import environ\nfrom subprocess import Popen, PIPE\n\nLMOD_SYSTEM_NAME = environ.get('LMOD_SYST... | python | chosen |
[
{
"from": "system",
"value": "Disable logging in test runs\n\nSPEED!\n"
},
{
"from": "human",
"value": "\"\"\"Django configuration for testing and CI environments.\"\"\"\nfrom .common import *\n\n# Use in-memory file storage\nDEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'\n\n# Speed! \... | python | chosen |
[
{
"from": "system",
"value": "Add in shim nullable FK for initial scriptparameter update\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.4 on 2017-04-25 09:25\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django... | python | chosen |
[
{
"from": "system",
"value": "Rename the processor back to its original name, crop_box\n"
},
{
"from": "human",
"value": "try:\n from PIL import Image\nexcept ImportError:\n import Image\n\n\ndef crop_ci_box(im, size, ci_box=False, **kwargs):\n \"\"\"\n Crop image based on very speci... | python | chosen |
[
{
"from": "system",
"value": "Drop unused import of sys.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Copyright (c) 2012-2013 SEOmoz, Inc.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (... | python | chosen |
[
{
"from": "system",
"value": "crosvm: Enable clippy in windows LUCI\n\nFor linux based systems, clippy continues to run in health_check\n\nBUG=b:257249038\nTEST=CQ\n\nChange-Id: I39d3d45a0db72c61e79fd2c51b195b82c067a244\nReviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993934\nReview... | python | chosen |
[
{
"from": "system",
"value": "Fix with 'newPlayer' event triggering on load\n"
},
{
"from": "human",
"value": "from terrabot.util.streamer import Streamer\n\nfrom terrabot.events.events import Events\n\n\nclass PacketEParser(object):\n def parse(self, world, player, data, ev_man):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update package version to 0.5.5\n"
},
{
"from": "human",
"value": "\"\"\"\nChatterBot is a machine learning, conversational dialog engine.\n\"\"\"\nfrom .chatterbot import ChatBot\n\n__version__ = '0.5.4'\n__author__ = 'Gunther Cox'\n__email__ = 'gunthercx@gmail.com... | python | chosen |
[
{
"from": "system",
"value": "Implement stab of insert article information method.\n"
},
{
"from": "human",
"value": "import sqlite3\n\n\nclass DBControl:\n def __init__(self, db_name : str=\":memory:\"):\n self.db_conn = sqlite3.connect(db_name)\n\n def create_tables(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Set test for start cmd to test env\n"
},
{
"from": "human",
"value": "import unittest\nfrom unittest import mock\n\nfrom click.testing import CliRunner\n\nfrom scuevals_api.cmd import cli\n\n\nclass CmdsTestCase(unittest.TestCase):\n\n @classmethod\n def setUp... | python | chosen |
[
{
"from": "system",
"value": "Remove lint_log view test case\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom flask import url_for\n\n\ndef test_view_build_log(test_client):\n test_client.get(url_for('log.build_log', sha='123456'))\n\n\ndef test_view_lint_log(test_client):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add line state to base parser\n\nReferences #155\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport logging\nimport time\n\nlog = logging.getLogger(__name__)\n\n__all__ = ['BaseParser']\n\n\nclass BaseParser:\n \"\"\"This abstract class represen... | python | chosen |
[
{
"from": "system",
"value": "Replace FalmerUserAdmin with extention of base\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.admin import register\nfrom . import models\n\n@register(models.FalmerUser)\nclass FalmerUserModelAdmin(admin.ModelAdmin):\n li... | python | chosen |
[
{
"from": "system",
"value": "Check if keyfile exists before generating new key\n"
},
{
"from": "human",
"value": "\nimport os\nfrom flask_app.database import init_db\n\n# Generate new secret key\nsecret_key = os.urandom(24).encode('hex').strip()\nwith open('flask_app/secret_key.py', 'w') as key... | python | chosen |
[
{
"from": "system",
"value": "Add channel numbers to 16B spectral setup\n"
},
{
"from": "human",
"value": "\n# Line SPW setup for 16B projects\nlinespw_dict = {0: [\"HI\", \"1.420405752GHz\"],\n 3: [\"OH1612\", \"1.612231GHz\"],\n 5: [\"OH1665\", \"1.6654018GHz\"],... | python | chosen |
[
{
"from": "system",
"value": "Fix for [ticket:281]. Do not forward livebookmarks request.\n\ngit-svn-id: 87d19257dd11500985d055ec4730e446075a5f07@1261 78c7df6f-8922-0410-bcd3-9426b1ad491b\n"
},
{
"from": "human",
"value": "# Copyright (c) 2006-2007 Open Source Applications Foundation\n# Copy... | python | chosen |
[
{
"from": "system",
"value": "Test use vcs plugin to commit.\n"
},
{
"from": "human",
"value": "\"\"\"first_django URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction ... | python | chosen |
[
{
"from": "system",
"value": "Use dict interface to bunch.\n\nI'm not sure why, but we got this error on the server::\n\n Traceback (most recent call last):\n File \"fmn/consumer/util.py\", line 33, in get_fas_email\n if person.email:\n AttributeError: 'dict' object has no attribute 'email... | python | chosen |
[
{
"from": "system",
"value": "Update to non-capturing groups in VALUE and INLINE_COMMENT\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nINDENT = r\"(?P<indent>^ *)\"\nVARIABLE = r\"(?P<variable>.+):\"\nVALUE = r\"(?P<value>((?P<q2>['\\\"]).*?(?P=q2))|[^#]+?)\"\nNEWLINE = r\"$\\n\"... | python | chosen |
[
{
"from": "system",
"value": "Use a more precise pattern to id ^R ezproxy url tokens.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom django.contrib.auth.decorators import login_required\n\nfrom . import views\n\nurlpatterns = [\n url(r'^u/(?P<url>http[s]?://(?:[a-zA... | python | chosen |
[
{
"from": "system",
"value": "Return data in dict form\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport os\nfrom flask import Flask, jsonify, send_from_directory, abort, Response, request\nimport psycopg2\n\napp = Flask(__name__)\n\nconn = psycopg2.connect(\"dbname='rivers' user... | python | chosen |
[
{
"from": "system",
"value": "Add clusterDB to python egg\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom distutils.command.install import install\nimport os\nimport shutil\n\nclass issue(Exception):\n def __init__(self, errorStr):\n self.errorStr = errorStr\n... | python | chosen |
[
{
"from": "system",
"value": "Fix KeyError when accessing non-existing header"
},
{
"from": "human",
"value": "from flask import Request, Response\nclass RqRequest(Request):\n def rq_headers(self):\n headers = {}\n if 'Authorization' in self.headers:\n headers['Author... | python | chosen |
[
{
"from": "system",
"value": "Add option to include static values in properties\n"
},
{
"from": "human",
"value": "from types import UnicodeType, StringType\n\nclass PropertyMappingFailedException(Exception):\n pass\n\ndef get_transformed_properties(source_properties, prop_map):\n results ... | python | chosen |
[
{
"from": "system",
"value": "Use backported commonpath instead of built in os.path.commonpath\n\nThe built in one is only available for Python 3.5\n"
},
{
"from": "human",
"value": "import glob\nimport shutil\nimport os\n\ndef move_glob(src,dst):\n \"\"\"Moves files from src to dest.\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Handle installing px on top of itself\n"
},
{
"from": "human",
"value": "import sys\nimport shutil\n\nimport os\n\n\ndef install(src, dest):\n \"\"\"\n Copy src (file) into dest (file) and make dest executable.\n\n On trouble, prints message and exits with ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"E arruma o alinhamento do texto\"\n\nThis reverts commit a7cb58ef323df97de537bb7cf0571c5ed26e113c.\n"
},
{
"from": "human",
"value": "import os\nimport datetime\nimport time\n\nimport picamera\n\nfrom PIL import Image, ImageStat, ImageFont, ImageDraw\n\n\nw... | python | chosen |
[
{
"from": "system",
"value": "Create the ManagedRunner with all the new args.\n"
},
{
"from": "human",
"value": "# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n\"\"\"\nTests for ``admin.acceptance``.\n\"\"\"\n\nfrom zope.interface.verify import verifyObject\nfrom twisted.trial.uni... | python | chosen |
[
{
"from": "system",
"value": "Add list filter by jurisdiction for public bodies"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom froide.publicbody.models import (PublicBody, FoiLaw, PublicBodyTopic,\n Jurisdiction)\n\n\nclass PublicBodyAdmin(admin.ModelAdmin):\n ... | python | chosen |
[
{
"from": "system",
"value": "Increase default maximum java heap size\n"
},
{
"from": "human",
"value": "\"\"\"Handles all imports from jnius to prevent conflicts resulting from attempts\nto set JVM options while the VM is already running.\"\"\"\n\nfrom __future__ import absolute_import, print_f... | python | chosen |
[
{
"from": "system",
"value": "Add functionality to load/save w2v model\n"
},
{
"from": "human",
"value": "import sys\nfrom os.path import isdir, isfile\nfrom corpus import Corpus\nfrom gensim import models\n\n\nclass W2VCorpus(Corpus):\n\n def __init__(self, dir, dict_loc, vec_loc):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix RSS feed some more.\n"
},
{
"from": "human",
"value": "\nfrom django.contrib.syndication.views import Feed\nfrom django.core.urlresolvers import reverse\nfrom extensions.models import Extension\n\nclass LatestExtensionsFeed(Feed):\n title = \"Latest extension... | python | chosen |
[
{
"from": "system",
"value": "Add ability to go to individual invoice page\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom django.views.generic import RedirectView\nfrom django.core.urlresolvers import reverse_lazy\n\nfrom .views import AppView, reports_export\n\n\n# In... | python | chosen |
[
{
"from": "system",
"value": "Use md5.copy() to be more efficient.\n\nThe hash.copy() documentation says this is more efficient given a common\ninitial substring.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport hashlib\n\nprefix = ''\nnumber = 1\n\nwith open('../inputs/04.txt'... | python | chosen |
[
{
"from": "system",
"value": "Print rancher-compose command to help debug/confirmation\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nDeploy builds to a Rancher orchestrated stack using rancher-compose\n\"\"\"\nimport os\n\nimport drone\nimport subprocess\n\n\ndef main():\n ... | python | chosen |
[
{
"from": "system",
"value": "fix: Remove index argument while creating order products sample\n"
},
{
"from": "human",
"value": "# importing modules/ libraries\nimport pandas as pd\nimport random\nimport numpy as np\n\n# create a sample of prior orders\norders_df = pd.read_csv(\"Data/orders.csv\... | python | chosen |
[
{
"from": "system",
"value": "Update documentation copyright year to 2016\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nAUTHOR = u'Adrian Sampson'\n\n# General configuration\n\nextensions = ['sphinx.ext.autodoc', 'sphinx.ext.extlinks']\n\nexclude_patterns = ['_build']\nsource_suf... | python | chosen |
[
{
"from": "system",
"value": "Add slug generation to Markdown source.\n"
},
{
"from": "human",
"value": "from been.core import DirectorySource, source_registry\n\nclass MarkdownDirectory(DirectorySource):\n kind = 'markdown'\n def process_event(self, event):\n lines = event['content... | python | chosen |
[
{
"from": "system",
"value": "Refactor to use list comprehension\n"
},
{
"from": "human",
"value": "def sum_of_multiples(limit, factors):\n return sum(all_multiples(limit, factors))\n\n\ndef all_multiples(limit, factors):\n multiples = set()\n for factor in factors:\n multiples =... | python | chosen |
[
{
"from": "system",
"value": "Update double-width emoji list to improve \"sbase print FILE\"\n"
},
{
"from": "human",
"value": "from rich.console import Console\nfrom rich.markdown import Markdown\nfrom rich.syntax import Syntax\n\n\ndef process_syntax(code, lang, theme, line_numbers, code_width... | python | chosen |
[
{
"from": "system",
"value": "Remove erroneous reference to self\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import resolve, reverse, Resolver404\nfrom django.http import HttpResponseRedirect\nfrom django.utils import timezone\nfrom datetime import datetime\n\nclass Feb26201... | python | chosen |
[
{
"from": "system",
"value": "Move pager selection into its own function\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport threading\nimport subprocess\n\nfrom . import px_processinfo\n\nif sys.version_info.major >= 3:\n # For mypy PEP-484 static typing validation\n from . i... | python | chosen |
[
{
"from": "system",
"value": "Read a file from Python\n"
},
{
"from": "human",
"value": "def main():\n print (\"Hello world!\")\n\nif __name__ == '__main__':\n main()"
},
{
"from": "gpt",
"value": "def main():\n try:\n fileName = \"MengZi_Traditional.md\"\n fil... | python | chosen |
[
{
"from": "system",
"value": "Fix openQmakeProject to match new combo value.\n\nChange-Id: Ice0050bf1bb7af59eb57c1e9218d96b3114f4c08\nReviewed-on: http://codereview.qt.nokia.com/4129\nReviewed-by: Qt Sanity Bot <5581206bb7e0307f0d99eb71898ae6b694149ca5@ovi.com>\nReviewed-by: Christian Stenger <accbb51712d7b... | python | chosen |
[
{
"from": "system",
"value": "[FIX] hr_payroll_account: Remove journal_id: False in context\n\nIf the wizard to generate payslip was launched without an ´active_id´ in the context.\nA ´journal_id´ entry was set to False in the context later leading to a crash at payslip creation.\nThe crash happens because,... | python | chosen |
[
{
"from": "system",
"value": "Update to specify content-type header\n"
},
{
"from": "human",
"value": "import requests\n\nfrom .resources.batches import Batches\nfrom .resources.jobs import Jobs\n\nDEFAULT_API_ROOT = 'http://app.spare5.com/partner/v2'\n\n\nclass Spare5Client(object):\n def __... | python | chosen |
[
{
"from": "system",
"value": "BUG(2151): Remove import of nonexistant UINT32 type in python bindings\n"
},
{
"from": "human",
"value": "\nfrom xmmsapi import VALUE_TYPE_NONE\nfrom xmmsapi import VALUE_TYPE_ERROR\nfrom xmmsapi import VALUE_TYPE_UINT32\nfrom xmmsapi import VALUE_TYPE_INT32\nfrom x... | python | chosen |
[
{
"from": "system",
"value": "Fix the \"no else after return\" lint\n"
},
{
"from": "human",
"value": "\"\"\"\nBinary search\n\"\"\"\n\n\ndef binary_search0(xs, x):\n \"\"\"\n Perform binary search for a specific value in the given sorted list\n\n :param xs: a sorted list\n :param x:... | python | chosen |
[
{
"from": "system",
"value": "Add condition to only launch updater if -u or --updater is specified\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport time\nfrom multiprocessing import Process, Event\n\nimport mfhclient\nimport update\nfrom arguments import parse\nfrom settings impo... | python | chosen |
[
{
"from": "system",
"value": "Change name of clicase to shellcase\n"
},
{
"from": "human",
"value": "# Import salt libs\nimport integration\n\nclass KeyTest(integration.CliCase):\n '''\n Test salt-key script\n '''\n def test_list(self):\n '''\n test salt-key -L\n ... | python | chosen |
[
{
"from": "system",
"value": "Sort the generated manager file by protocol name\n\n\n20070831193701-4210b-ede9decef118aba3937b0291512956927333dbe6.gz\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport sys\nimport telepathy\nfrom telepathy.interfaces import CONN_MGR_INTERFACE\n\nif len(s... | python | chosen |
[
{
"from": "system",
"value": "API: Add LiveSpecFile to callbacks API.\n"
},
{
"from": "human",
"value": "from .core import (CallbackBase, CallbackCounter, print_metadata, collector,\n LiveMesh, LivePlot, LiveRaster, LiveTable, CollectThenCompute,\n _get_obj_fi... | python | chosen |
[
{
"from": "system",
"value": "Support for Windows serial ports.\n"
},
{
"from": "human",
"value": "__author__ = \"Raido Pahtma\"\n__license__ = \"MIT\"\n\nimport glob\nimport sys\nimport os\n\n\ndef _list_windows_serial_ports():\n raise NotImplementedError(\"windows support\")\n\n\ndef _list_... | python | chosen |
[
{
"from": "system",
"value": "Change module class to use Rect for size and take a surface as an argument to draw()\n"
},
{
"from": "human",
"value": "class module:\n mod_name = \"unnamed_module\";\n mod_id = -1;\n mod_rect = None;\n mod_surface = None;\n mod_attribs = [];\n\n d... | python | chosen |
[
{
"from": "system",
"value": "Make sure django doesn't mangle route\n"
},
{
"from": "human",
"value": "__author__ = 'Nick'\n\nfrom django.conf.urls import url\nfrom search import views\n\nurlpatterns = [\n\turl(r'^$', views.index, name='index'),\n\turl(r'^query$', views.query, name='query')\n]"
... | python | chosen |
[
{
"from": "system",
"value": "Generalize scss bundle to track all scss files\n"
},
{
"from": "human",
"value": "from flask.ext.assets import Bundle\n\napp_css = Bundle(\n 'app.scss',\n filters='scss',\n output='styles/app.css'\n)\n\napp_js = Bundle(\n 'app.js',\n filters='jsmin',\... | python | chosen |
[
{
"from": "system",
"value": "Revert \"adding slot_index to impression_stats_daily\"\n\nThis reverts commit 71202d2f9e2cafa5bf8ef9e0c6a355a8d65d5c7a.\n"
},
{
"from": "human",
"value": "import os\n\n\nclass DefaultConfig(object):\n \"\"\"\n Configuration suitable for use for development\n ... | python | chosen |
[
{
"from": "system",
"value": "Add test to make sure fileKey(s) aren't returned\n"
},
{
"from": "human",
"value": "import pytest\nimport json\n\n\nclass TestRecordings:\n def test_unprocessed_recording_doesnt_return_processed_jwt(self, helper):\n print(\"If a new user uploads a recordin... | python | chosen |
[
{
"from": "system",
"value": "Update list of reserved tokens\n\n"
},
{
"from": "human",
"value": "RESERVED_NAMES = {\n 'def',\n 'pass',\n 'return',\n 'class',\n 'interface',\n 'data',\n 'if',\n 'elif',\n 'else',\n 'or',\n 'and',\n 'not',\n 'for',\n 'true... | python | chosen |
[
{
"from": "system",
"value": "Set the correct doc build dir to copy\n"
},
{
"from": "human",
"value": "import os\nimport shutil\nfrom yank import version\n\nif version.release:\n docversion = version.version\nelse:\n docversion = 'latest'\n\nos.mkdir(\"docs/_deploy\")\nshutil.copytree(\"do... | python | chosen |
[
{
"from": "system",
"value": "Throw warning on missing CSS rather than error, so that tests can still run on Dj1.7\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.core.checks import Error, register\n\n\n@register()\ndef css_install_check(app_configs, **kwargs):\n errors = []\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add support for list input\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n#encoding: UTF-8\n\n# Define a function that computes the length of a given list or string. \n# (It is true that Python has the len() function built in, \n# but writing it yourself... | python | chosen |
[
{
"from": "system",
"value": "Fix context processors analyzer: deprecated processors will be removed in Django 1.5\n"
},
{
"from": "human",
"value": "import ast\n\nfrom .base import BaseAnalyzer, ModuleVisitor, Result\n\n\nclass ContextProcessorsVisitor(ast.NodeVisitor):\n\n def __init__(self... | python | chosen |
[
{
"from": "system",
"value": "Expand tests for Sellers API"
},
{
"from": "human",
"value": "\"\"\"\nTests for the MWS.Sellers API class.\n\"\"\"\nimport unittest\nimport mws\nfrom .utils import CommonRequestTestTools\n\n\nclass SellersTestCase(unittest.TestCase, CommonRequestTestTools):\n \"\... | python | chosen |
[
{
"from": "system",
"value": "Delete all containers on the Docker daemon before running test\n"
},
{
"from": "human",
"value": "from unittest import TestCase\nfrom docker import Client\nfrom plum import Service\n\n\nclass ServiceTestCase(TestCase):\n def setUp(self):\n self.client = Cl... | python | chosen |
[
{
"from": "system",
"value": "Add some tests with row and column\n"
},
{
"from": "human",
"value": "#: E201\nspam( ham[1], {eggs: 2})\n#: E201\nspam(ham[ 1], {eggs: 2})\n#: E201\nspam(ham[1], { eggs: 2})\n#: Okay\nspam(ham[1], {eggs: 2})\n#:\n\n\n#: E202\nspam(ham[1], {eggs: 2} )\n#: E202\nspam(... | python | chosen |
[
{
"from": "system",
"value": "Use absolute filepath instead of relative\n"
},
{
"from": "human",
"value": "import unittest\nfrom ooni.utils import pushFilenameStack\n\nclass TestUtils(unittest.TestCase):\n def test_pushFilenameStack(self):\n f = open(\"dummyfile\", \"w+\")\n f.w... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.