conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Check \"Penny Arcade\" for 404 page without 404 header\n"
},
{
"from": "human",
"value": "from comics.aggregator.crawler import CrawlerBase, CrawlerImage\nfrom comics.core.comic_data import ComicDataBase\n\n\nclass ComicData(ComicDataBase):\n name = \"Penny Arcad... | python | chosen |
[
{
"from": "system",
"value": "Fix previous commit (balancing scripts)\n"
},
{
"from": "human",
"value": "# This script creates a balanced ground truth given an unbalanced on by applying \n# random sampling. The size of the resulting classes equals to the minimum size \n# among original classes.\... | python | chosen |
[
{
"from": "system",
"value": "Add repr to Deployment class\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom github3.models import GitHubCore\nfrom github3.users import User\n\n\nclass Deployment(GitHubCore):\n CUSTOM_HEADERS = {\n 'Accept': 'application/vnd.github.canno... | python | chosen |
[
{
"from": "system",
"value": "Add a 'counter_to_iterable' 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\", \"convert_to_od\"]\n\nimport collections\n\ndef pick(arg, ... | python | chosen |
[
{
"from": "system",
"value": "Improve error logging in file IO\n"
},
{
"from": "human",
"value": "import codecs, os\n\ndef readFile(filePath):\n try:\n with open(filePath, \"r\") as f:\n return f.read()\n except Exception as e:\n print \"*** ERROR: An exception occ... | python | chosen |
[
{
"from": "system",
"value": "Add teams field in MakerScienceProfileResource\n"
},
{
"from": "human",
"value": "from .models import MakerScienceProfile\nfrom tastypie.resources import ModelResource\nfrom tastypie.authorization import DjangoAuthorization\nfrom tastypie import fields\nfrom tastypi... | python | chosen |
[
{
"from": "system",
"value": "Fix applyF_filterG function to pass test case\n"
},
{
"from": "human",
"value": "# Problem 8\n# 20.0 points possible (graded)\n# Implement a function that meets the specifications below.\n\n# For example, the following functions, f, g, and test code:\n\n# def f(i):\... | python | chosen |
[
{
"from": "system",
"value": "Allow empty so we can force new build\n"
},
{
"from": "human",
"value": "import sys\nimport sh\n\nfrom fabric import api as fab\n\nsed = sh.sed.bake('-i bak -e')\nTRAVIS_YAML = '.travis.yml'\nREPLACE_LANGUAGE = 's/language: .*/language: {}/'\n\n\ndef is_dirty():\n ... | python | chosen |
[
{
"from": "system",
"value": "Change bad function decorator implementation\n"
},
{
"from": "human",
"value": "import datetime\nfrom openedoo.core.libs.tools import hashing_werkzeug\nfrom openedoo_project import db\nfrom .users import User\n\n\nclass Employee(User):\n\n @staticmethod\n def ... | python | chosen |
[
{
"from": "system",
"value": "Add date_hierarchy = 'pub_date' to PollAdmin\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom apps.polls.models import Poll, Choice\n\nclass ChoiceInline(admin.TabularInline):\n model = Choice\n extra = 3\n\nclass PollAdmin(admin.Mod... | python | chosen |
[
{
"from": "system",
"value": "Add client and channel models\n"
},
{
"from": "human",
"value": "'''\nCreated on Nov 9, 2014\n\n@author: fechnert\n'''\n\nimport yaml\nimport logging\nimport features\n\n\nclass Configuration(dict):\n ''' Read and provide the yaml config '''\n\n def __init__(s... | python | chosen |
[
{
"from": "system",
"value": "Add tests for loading binaries with malformed sections\n"
},
{
"from": "human",
"value": "import nose\nimport StringIO\n\nimport cle\n\ndef test_patched_stream():\n stream = StringIO.StringIO('0123456789abcdef')\n\n stream1 = cle.PatchedStream(stream, [(2, 'AA... | python | chosen |
[
{
"from": "system",
"value": "tests: Add test for \"not\" of a user defined class.\n"
},
{
"from": "human",
"value": "x = 1\nprint(+x)\nprint(-x)\nprint(~x)\n\nprint(not None)\nprint(not False)\nprint(not True)\nprint(not 0)\nprint(not 1)\nprint(not -1)\nprint(not ())\nprint(not (1,))\nprint(not... | python | chosen |
[
{
"from": "system",
"value": "Remove warning from debug toolbar.\n"
},
{
"from": "human",
"value": "import os\nfrom .default import * # nopep8\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nif DEBUG:\n INSTALLED_APPS += (\n 'debug_toolbar',\n )\n\n # debug toolbar settings\n MIDD... | python | chosen |
[
{
"from": "system",
"value": "Add sort_key assertion to raceway tests\n"
},
{
"from": "human",
"value": "# https://www.openstreetmap.org/way/28825404\nassert_has_feature(\n 16, 10476, 25242, 'roads',\n { 'id': 28825404, 'kind': 'minor_road', 'highway': 'raceway' })\n\n# https://www.openstr... | python | chosen |
[
{
"from": "system",
"value": "Add scratch file for testing new validity\n"
},
{
"from": "human",
"value": "import pandas as pd\nimport numpy as np\nimport operator\nfrom sys import argv\nimport os \n\ndef extract( file_name ):\n with open(file_name) as f:\n for i,line in enumerate(f,1)... | python | chosen |
[
{
"from": "system",
"value": "Python: Add cryptography test for EC\n\nApparently, passing in the class (without instantiating it) is allowed\n"
},
{
"from": "human",
"value": "# see https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa.html\n\nfrom cryptography.hazmat.primitives.asy... | python | chosen |
[
{
"from": "system",
"value": "Use the env prefix setting\n"
},
{
"from": "human",
"value": "import os\n\nimport pydot\nfrom kitchen.settings import STATIC_ROOT\n\n\ndef generate_node_map(nodes):\n \"\"\"Generates a graphviz nodemap\"\"\"\n graph = pydot.Dot(graph_type='digraph')\n graph... | python | chosen |
[
{
"from": "system",
"value": "Update Timezone aware values for CCEAuditModel\n"
},
{
"from": "human",
"value": "import arrow\nfrom django.conf import settings\nfrom django.db import models\nfrom .mixins import ModelPermissionsMixin\n\n\nclass CCEModel(ModelPermissionsMixin, models.Model):\n \... | python | chosen |
[
{
"from": "system",
"value": "Test that framebuffer can't be bound after deletion.\n"
},
{
"from": "human",
"value": "from nose.tools import *\n\nfrom scikits.gpu.fbo import *\nfrom pyglet.gl import *\n\nclass TestFramebuffer(object):\n def create(self, x, y, colours, dtype):\n fbo = F... | python | chosen |
[
{
"from": "system",
"value": "[AC-7397] Make UserRoleContext safe to use\n"
},
{
"from": "human",
"value": "from builtins import object\n\nfrom accelerator.tests.factories import (\n ExpertFactory,\n ProgramFactory,\n ProgramRoleFactory,\n ProgramRoleGrantFactory,\n UserRoleFactor... | python | chosen |
[
{
"from": "system",
"value": "Add logic to check for cross-site anchor tags to naver\n"
},
{
"from": "human",
"value": "from bs4 import BeautifulSoup as bs\nfrom get_root_domain import get_root_domain\n\n\ndef html_has_same_domain(url, resp):\n mod = 'html_has_same_domain'\n cnt = 0\n r... | python | chosen |
[
{
"from": "system",
"value": "Fix TMM as normalization method from edgeR package\n"
},
{
"from": "human",
"value": "import numpy as np\nimport pandas as pd\nfrom rpy2.robjects import r, pandas2ri\npandas2ri.activate()\n\n\nclass TMM(object):\n\n def __init__(self, count_df):\n r(\"supp... | python | chosen |
[
{
"from": "system",
"value": "Make a petlib.run_tests() function that tests an install\n"
},
{
"from": "human",
"value": "# The petlib version\nVERSION = '0.0.25'"
},
{
"from": "gpt",
"value": "# The petlib version\nVERSION = '0.0.26'\n\ndef run_tests():\n # These are only needed ... | python | chosen |
[
{
"from": "system",
"value": "Update script list domain libvirt\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport libvirt\nimport sys\n\nconn=libvirt.open(\"qemu:///system\")\nif conn == None:\n print('Failed to open connection to qemu:///system', sys.stderr)\n exit(1)\n\n#vms... | python | chosen |
[
{
"from": "system",
"value": "Add API to set leds color\n"
},
{
"from": "human",
"value": "from flask import Flask\napp = Flask(__name__)\n\n\n@app.route(\"/\")\ndef home():\n return \"Hello World!\"\n"
},
{
"from": "gpt",
"value": "from flask import Flask, request\nimport pigpio\... | python | chosen |
[
{
"from": "system",
"value": "Use our own spacer widgets\n"
},
{
"from": "human",
"value": "from kivy.uix.screenmanager import Screen\n#from kivy.properties import *\nfrom kivy.uix.settings import SettingSpacer\n\nfrom my_setting import *\nimport audio as a_m\n\nclass SettingsScreen(Screen):\n ... | python | chosen |
[
{
"from": "system",
"value": "Test simple complete run of am_bmi.\n"
},
{
"from": "human",
"value": "import unittest\nimport utils\nimport os\nimport sys\nimport shutil\n\nTOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\nsys.path.append(os.path.join(TOPDIR, 'lib'))\nsys.p... | python | chosen |
[
{
"from": "system",
"value": "Add ratelimit and help to autosummary.\n\nSigned-off-by: Laura F. D <07c342be6e560e7f43842e2e21b774e61d85f047@veriny.tf>\n"
},
{
"from": "human",
"value": "# This file is part of curious.\n#\n# curious is free software: you can redistribute it and/or modify\n# it un... | python | chosen |
[
{
"from": "system",
"value": "Remove reversing heuristics from merge_values for abstract memory.\n\nThis is because SimMemoryObject handles endness now.\n\nAlso re-introduce the logic for dealing with uninit memory values.\n"
},
{
"from": "human",
"value": "import logging\nfrom typing import Ite... | python | chosen |
[
{
"from": "system",
"value": "Add comments to test file\n\nAdd comments after all tests passed\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nimport linked_list\n\n# def func(x):\n# return x + 1\n\n# def tdest_answer():\n# assert func(3) == 5\n\n\n# init\n\na... | python | chosen |
[
{
"from": "system",
"value": "Use SHAs for commit_range rather than refs\n\nRefs are local and might not always be present in the checkout.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport os\nimport argparse\nfrom github import Github\n\n\ndef from_pr(project, repo, pr_number):... | python | chosen |
[
{
"from": "system",
"value": "Change default db name to g2x.db\n"
},
{
"from": "human",
"value": "import sqlite3\nimport time\n\n\nclass SQLiteLogger:\n def __init__(self, filename=\"test.db\"):\n self.filename = filename\n self.connection = None\n\n def __enter__(self):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix another syntax error with newer Python versions\n"
},
{
"from": "human",
"value": "from pkgutil import extend_path\n\n__path__ = extend_path(__path__, __name__)\nprint __path__, __name__\n"
},
{
"from": "gpt",
"value": "from pkgutil import extend_pat... | python | chosen |
[
{
"from": "system",
"value": "Set identity integer source data type\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\n\nfrom ..composition import SeekableSource\n\nimport numpy as np\n\n\nclass IntegerIdentitySource(SeekableSource):\n \"\"\"Re... | python | chosen |
[
{
"from": "system",
"value": "Fix no yield from in middle ages\n"
},
{
"from": "human",
"value": "# pyinfra\n# File: pyinfra/modules/pip.py\n# Desc: manage virtualenvs\n\n'''\nManage Python virtual environments\n'''\n\nfrom __future__ import unicode_literals\n\nfrom pyinfra.api import operation\... | python | chosen |
[
{
"from": "system",
"value": "Fix create user command to work locally and on heroku\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask.ext.script import Manager\nfrom flask.ext.migrate import Migrate\nfrom flask.ext.migrate import MigrateCommand\nfrom flask_security.utils import encrypt_... | python | chosen |
[
{
"from": "system",
"value": "Update entropy example with improved matplotlib usage\n"
},
{
"from": "human",
"value": "\"\"\"\n=======\nEntropy\n=======\n\nImage entropy is a quantity which is used to describe the amount of information\ncoded in an image.\n\n\"\"\"\nimport numpy as np\nimport ma... | python | chosen |
[
{
"from": "system",
"value": "Make sure we have actually looked up a model \nin get_model_from_string.\n"
},
{
"from": "human",
"value": "# Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl>\n#\n# This file is part of django-webshop.\n#\n# django-webshop is free software; you ca... | python | chosen |
[
{
"from": "system",
"value": "Allow raw snippets without trailing slash\n\nFixes an asymmetry where both of\n\n curl https://dpaste.de/xXxx\n curl https://dpaste.de/xXxx/\n\nwork, but\n\n curl https://dpaste.de/xXxx/raw/\n\nfails without a trailing slash (because curl doesn't follow redirects by\ndefault... | python | chosen |
[
{
"from": "system",
"value": "Change default extension to yaml\n\n"
},
{
"from": "human",
"value": "import json\n\nfrom jshbot.exceptions import ConfiguredBotException, ErrorTypes\n\nCBException = ConfiguredBotException('Configurations')\n\n\ndef get(bot, plugin_name, key=None, extra=None, exten... | python | chosen |
[
{
"from": "system",
"value": "Add lastest updates to script\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n\nfrom __future__ import division\nimport feedparser, os\nfrom BeautifulSoup import BeautifulSoup\nimport nltk, re, pprint\nfrom nltk import word_tokenize\n#... | python | chosen |
[
{
"from": "system",
"value": "Make the Python bindings testsuite be able to find the needed shared libraries\non Cygwin. Needed to compensate for Windows' complete lack of library RPATHs.\n\n* subversion/bindings/swig/python/tests/run_all.py: On Cygwin, manipulate $PATH\n so that the relevant shared libr... | python | chosen |
[
{
"from": "system",
"value": "Improve script task to allow multiline\n"
},
{
"from": "human",
"value": "import logging\nfrom tukio.task import register\nfrom tukio.task.holder import TaskHolder\n\n\nlog = logging.getLogger(__name__)\n\n\n@register('python_script', 'execute')\nclass PythonScript(... | python | chosen |
[
{
"from": "system",
"value": "Handle built state tracking on versions"
},
{
"from": "human",
"value": "import logging\n\nfrom django import forms\n\nfrom readthedocs.builds.models import VersionAlias, Version\nfrom readthedocs.core.utils import trigger_build\nfrom readthedocs.projects.models imp... | python | chosen |
[
{
"from": "system",
"value": "Convert iniital json field if possible in migration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.13 on 2018-03-04 23:14\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef populate_default(ap... | python | chosen |
[
{
"from": "system",
"value": "tests/basics: Add test for tuple inplace add.\n"
},
{
"from": "human",
"value": "# basic tuple functionality\nx = (1, 2, 3 * 4)\nprint(x)\ntry:\n x[0] = 4\nexcept TypeError:\n print(\"TypeError\")\nprint(x)\ntry:\n x.append(5)\nexcept AttributeError:\n p... | python | chosen |
[
{
"from": "system",
"value": "Add Register resource to handle user registration and save user data to the database\n"
},
{
"from": "human",
"value": "from flask_restful import Resource\n\n\nclass AccountsManager(Resource):\n \"\"\"docstring for AccountsManager.\"\"\"\n def get(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Return exit code on disco_deploy test and update\n"
},
{
"from": "human",
"value": "\"\"\"Place of record for the package version\"\"\"\n\n__version__ = \"1.1.17\"\n__rpm_version__ = \"WILL_BE_SET_BY_RPM_BUILD\"\n__git_hash__ = \"WILL_BE_SET_BY_EGG_BUILD\"\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Add tests for char in string -- including required exceptions for\nnon-char in string.\n"
},
{
"from": "human",
"value": "from test_support import TestFailed\n\nclass base_set:\n\n\tdef __init__(self, el):\n\t\tself.el = el\n\nclass set(base_set):\n\n\tdef __contain... | python | chosen |
[
{
"from": "system",
"value": "Create constant to define a controller that will be used\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nTRAJECTORY = 'linear'\n\nif TRAJECTORY == 'linear':\n SIMULATION_TIME_IN_SECONDS = 80.0\nelif TRAJECTORY == 'circular':\n SIMULATION_TIME_IN_SE... | python | chosen |
[
{
"from": "system",
"value": "Change str method of profile\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\n\nclass Profile(models.Model):\n user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, blank=True)\n a... | python | chosen |
[
{
"from": "system",
"value": "Index clusters by unique ID\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# x COLUMN NAMES\n\n# 0 State_Name\n# 1 State_code\n# 2 Lga_name\n# 3 Lga_code\n# 4 EA_NAME\n# 5 EA_code\n# 6 EAsize\n# 7 Un... | python | chosen |
[
{
"from": "system",
"value": "Revise doc string with highlighting \"weighted\" graph\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef dijkstra(weighted_graph_d, start_vertex):\n \"\"\"Dij... | python | chosen |
[
{
"from": "system",
"value": "Add a __str__() method to Dto to make debugging easier\n"
},
{
"from": "human",
"value": "class Dto(object):\n \"\"\"Abstract class for all DTOs (entities and their composites).\"\"\"\n \n def GetSubObjects(self):\n \"\"\"Get array with mapping which... | python | chosen |
[
{
"from": "system",
"value": "Add inital commit to post generate hook\n"
},
{
"from": "human",
"value": "import os\nimport subprocess\n\nsrc = os.path.join(os.getcwd(), 'src', 'utils', 'prepare-commit-msg.py')\ndst = os.path.join('.git', 'hooks', 'prepare-commit-msg')\n\nprocess = subprocess.cal... | python | chosen |
[
{
"from": "system",
"value": "Update example HTTPS cert & key filenames.\n\npki/my{cert,key}.pem are used for request payloads; set those as\nthe defaults for HTTPS as well. Note that HTTPS isn't necessarily\nin a working state - this just gets us a bit closer.\n"
},
{
"from": "human",
"value":... | python | chosen |
[
{
"from": "system",
"value": "Test vocab min_freq and specials vocab args, as well as unicode input\n"
},
{
"from": "human",
"value": "import numpy as np\nimport unittest\n\nfrom torchtext import vocab\nfrom collections import Counter\n\n\nclass TestVocab(unittest.TestCase):\n def test_vocab(... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8, articles form E301 expected 1 blank line, found 0\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django import forms\n\nfrom .models import Post, Album, Link\n\nfrom opps.core.widgets import OppsEditor\n\n\nclass Po... | python | chosen |
[
{
"from": "system",
"value": "Add abbreviations and space handling\n"
},
{
"from": "human",
"value": "if __name__ == \"__main__\":\n x, y = 0, 0\n steps = 0\n while True:\n dir = input('Your current position is %s, %s, where would you like to move to? ' % (str(x), str(y)))\n ... | python | chosen |
[
{
"from": "system",
"value": "Allow Node to Node connection.\n"
},
{
"from": "human",
"value": "from neb.api import TrinityResource\nfrom neb.relationship import Relationship\nfrom neb.statistic import NodeStatistic\n\nclass Node(TrinityResource):\n def create(self, node_id, **kwargs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Correct incorrect information in `NoAffinityError` docstring\n\nIncorrectly stated that the minimum number of shared, rated anime needed to calculate affinity was 10, when it's actually 11\n"
},
{
"from": "human",
"value": "\"\"\"malaffinity exceptions.\"\"\"\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Write binary for CSV file."
},
{
"from": "human",
"value": "import pypyodbc\nimport csv\n\nconn = pypyodbc.connect(\"DSN=\")\ncur = conn.cursor()\n\ntables = []\n\ncur.execute(\"select * from sys.tables\")\n\nfor row in cur.fetchall():\n tables.append(row[0])\n\n... | python | chosen |
[
{
"from": "system",
"value": "Remove url images mass, not used\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url, include\nfrom django.contrib import admin\n\n\nadmin.autodiscover()\n\nurlpatterns = patterns(\n '',\n ... | python | chosen |
[
{
"from": "system",
"value": "Use unicode for currency symbols.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2016 Google Inc. All Rights Reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compli... | python | chosen |
[
{
"from": "system",
"value": "Update layers test for RNN change.\n"
},
{
"from": "human",
"value": "import theanets\nimport numpy as np\n\n\nclass TestLayer:\n def test_build(self):\n layer = theanets.layers.build('feedforward', nin=2, nout=4)\n assert isinstance(layer, theanets... | python | chosen |
[
{
"from": "system",
"value": "Update Checking Threshold with pep8 syntax"
},
{
"from": "human",
"value": "\ndef checking_threshold(a, b, avg_heart_rate):\n \"\"\"checking for Tachycardia or Bradycardia\n :param a: int variable, lower bound bpm\n :param b: int variable, upper bound bpm\n... | python | chosen |
[
{
"from": "system",
"value": "Change Rfree and wRte in SmallOpenEconomy test\n\nInterest factor was set to 20%; changing it to a more reasonable 1.03 fixed the weird interaction with the new nan_bool functionality.\n"
},
{
"from": "human",
"value": "import copy\nfrom HARK import distributeParams... | python | chosen |
[
{
"from": "system",
"value": "Add a config that exercises the Multiplexed socketS\n"
},
{
"from": "human",
"value": "from experiment_config_lib import ControllerConfig\nfrom sts.topology import MeshTopology\nfrom sts.control_flow import Fuzzer\nfrom sts.input_traces.input_logger import InputLogg... | python | chosen |
[
{
"from": "system",
"value": "Use string as a default value for PIPENV_MAX_DEPTH\n"
},
{
"from": "human",
"value": "import os\n\n\n# Prevent invalid shebangs with Homebrew-installed Python:\n# https://bugs.python.org/issue22490\nos.environ.pop('__PYVENV_LAUNCHER__', None)\n\n\n# Shell compatibil... | python | chosen |
[
{
"from": "system",
"value": "Add source trail logic to FontmakeError and partly TTFAError\n"
},
{
"from": "human",
"value": "class FontmakeError(Exception):\n \"\"\"Base class for all fontmake exceptions.\"\"\"\n\n pass\n\n\nclass TTFAError(FontmakeError):\n def __init__(self, exitcode... | python | chosen |
[
{
"from": "system",
"value": "Check if slaves are alive and fallback to other slaves and eventually to master.\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\nimport random\n\nfrom django.db.utils import DEFAULT_DB_ALIAS\nfrom django.conf import settings\n\n\nclass ReplicationRouter(o... | python | chosen |
[
{
"from": "system",
"value": "Change path location of django q\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport django\n\nmyPath = os.path.dirname(os.path.abspath(__file__))\nsys.path.insert(0, myPath)\n\nVERSION = (0, 9, 2)\n\ndefault_app_config = 'django_q.apps.DjangoQConfig'\n... | python | chosen |
[
{
"from": "system",
"value": "Switch encoding to UTF-8 from latin1\n\nThis change was originally made in PR #53, but may no longer be required\n(and may cause issues with comments in IR that use non-latin1\ncharacters).\n"
},
{
"from": "human",
"value": "import atexit\n\n\ndef _encode_string(s):... | python | chosen |
[
{
"from": "system",
"value": "Fix naming to folliwng naming conventions for mclab\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\" Set of helper function and variables for plotting.\n\nThis module provides a set of functions and variables that will be useful for\nplotting.\n\n\"\... | python | chosen |
[
{
"from": "system",
"value": "Implement unit test for reap_children function\n"
},
{
"from": "human",
"value": "import os\nimport time\nimport unittest\n\nfrom helpers.utils import sigchld_handler, sigterm_handler, sleep\n\n\ndef nop(*args, **kwargs):\n pass\n\n\ndef os_waitpid(a, b):\n re... | python | chosen |
[
{
"from": "system",
"value": "Use TEMPLATES setting in tests.\n"
},
{
"from": "human",
"value": "from os.path import dirname, join, abspath\n\nBASE_DIR = dirname(abspath(__file__))\n\nINSTALLED_APPS = [\n 'django.contrib.staticfiles',\n 'markitup',\n ]\n\nTEMPLATE_DIRS = [join(BASE_DIR,... | python | chosen |
[
{
"from": "system",
"value": "Clean up Send SMS and MMS Python example\n"
},
{
"from": "human",
"value": "from flask import Flask, request, redirect\nimport twilio.twiml\n\napp = Flask(__name__)\n\n@app.route(\"/\", methods=['GET', 'POST'])\ndef hello_monkey():\n \"\"\"Respond to incoming cal... | python | chosen |
[
{
"from": "system",
"value": "Change 'language' to 'syntax', that is more precise terminology.\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Aparajita Fishman\n# Copyright (c) 2013 Aparajita Fishman\n... | python | chosen |
[
{
"from": "system",
"value": "Change 'tempfile_suffix' and remove filename check.\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Bruno JJE\n# Copyright (c) 2015 Bruno JJE\n#\n# License: MIT\n#\n\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Add AWS::QLDB::Stream per 2020-07-08 update\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012-2019, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n#\n# *** Do not modify - this file is autogenerated ***\n# Resource ... | python | chosen |
[
{
"from": "system",
"value": "Add random merchant_uid for continous testing\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\ndef test_pay_onetime(iamport):\n # Without 'card_number'\n payload_notEnough = {\n 'merchant_uid': 'qwer1234',\n 'amount': 5000,\n ... | python | chosen |
[
{
"from": "system",
"value": "Make sure we always use the same filename for the fixtures translations.\nThis way the translations do not contain accidental changes.\n"
},
{
"from": "human",
"value": "import json\nimport tempfile\n\nfrom django.core.management.commands.makemessages import Command... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Change imports to relative.\"\n\nThis reverts commit 9d0990249b7e0e46e38a665cb8c32a1ee435c291.\n"
},
{
"from": "human",
"value": "__version__ = 0.1\n\nimport pydarkstar.logutils\nimport logging\n\npydarkstar.logutils.setError()\n\ntry:\n import sqlalchem... | python | chosen |
[
{
"from": "system",
"value": "Add handy private debug and print method\n"
},
{
"from": "human",
"value": "from .atflex import AtfLexer\nfrom .atfyacc import AtfParser\nfrom mako.template import Template\n\n\nclass AtfFile(object):\n\n template = Template(\"${text.serialize()}\")\n\n def __... | python | chosen |
[
{
"from": "system",
"value": "Add dev comments and fix variable naming\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\ndef max_luck_balance(contests, num_can_lose):\n \"\"\"\n Returns a single integer denoting the maximum... | python | chosen |
[
{
"from": "system",
"value": "Add a custom script command to add a user to the database\n"
},
{
"from": "human",
"value": "import os\n\nfrom app import create_app\n\nfrom flask.ext.script import Manager\n\napp = create_app(os.getenv('FLASK_CONFIG') or 'default')\nmanager = Manager(app)\n\nif __n... | python | chosen |
[
{
"from": "system",
"value": "Fix servicekonto import to be lazy on ready\n"
},
{
"from": "human",
"value": "from allauth.socialaccount import providers\nfrom django.apps import AppConfig\n\nfrom .provider import ServiceKontoProvider\n\n\nclass Config(AppConfig):\n name = 'meinberlin.apps.ser... | python | chosen |
[
{
"from": "system",
"value": "Add missing parameters (seems bug on django 1.7.x)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\ndef update_total_milestones(apps, schema_editor):\n Project = app... | python | chosen |
[
{
"from": "system",
"value": "Remove outdated and redundant encoding specifier\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nMove Tab\n\nPlugin for Sublime Text to move tabs around\n\nCopyright (c) 2012 Frédéric Massart - FMCorz.net\n\nLicensed under The MIT License\nRedi... | python | chosen |
[
{
"from": "system",
"value": "Fix migration 0023 subscriber model reference\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-03-07 09:37\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.db import migrations,... | python | chosen |
[
{
"from": "system",
"value": "Add policy description for os-fixed-ips\n\nThis commit adds policy doc for os-fixed-ips policies.\n\nPartial implement blueprint policy-docs\n\nChange-Id: Ief255af699cee217ebf963a2c36f9e819ef4ef90\n"
},
{
"from": "human",
"value": "# Copyright 2016 Cloudbase Solutio... | python | chosen |
[
{
"from": "system",
"value": "Make tests forwards-compatible with new email API\n"
},
{
"from": "human",
"value": "import quopri\nfrom daemail.message import DraftMessage\n\nTEXT = 'àéîøü'\n\ndef test_quopri_text():\n msg = DraftMessage()\n msg.addtext(TEXT)\n blob = msg.compile()\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix call to stock instead of run\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lice... | python | chosen |
[
{
"from": "system",
"value": "Make highlight template tag case insensitive\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django import template\nfrom django.utils.html import format_html\nfrom django.utils.encoding import force_text\n... | python | chosen |
[
{
"from": "system",
"value": "Tag filtering by liked photos\n"
},
{
"from": "human",
"value": "from django import template\n\nfrom quickphotos.models import Photo\n\nregister = template.Library()\n\n\n@register.assignment_tag\ndef get_latest_photos(*args, **kwargs):\n limit = kwargs.pop('limi... | python | chosen |
[
{
"from": "system",
"value": "Test non-1D array error in utils\n\nAdds a test for `_bool_cmp_mtx_cnt` to make sure that both arrays are 1D\nonly. Will raise a `ValueError` if this is not the case.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nfrom __futur... | python | chosen |
[
{
"from": "system",
"value": "Add filters to Customer serializer\n"
},
{
"from": "human",
"value": "from django.forms import widgets\nfrom rest_framework import serializers\nfrom taxiexpress.models import Customer, Country, State, City, Driver, Travel, Car\n\nclass CarSerializer(serializers.Mode... | python | chosen |
[
{
"from": "system",
"value": "Fix tests in Django 1.7\n\nDjango 1.7 doesn't include session or auth middleware\nin minimal default config. Djrill admin views require auth.\n"
},
{
"from": "human",
"value": "# python setup.py test\n# or\n# python runtests.py\n\nimport sys\nfrom django.conf impo... | python | chosen |
[
{
"from": "system",
"value": "Use (not so) new processor class names\n"
},
{
"from": "human",
"value": "from galleries.models import Gallery, ImageModel\nfrom django.db import models\nfrom imagekit.models import ImageSpec\nfrom imagekit.processors.resize import Fit\n\n\nclass Photo(ImageModel):\... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.