conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add a length argument in TestMethods.interleave\n"
},
{
"from": "human",
"value": "import interleaving as il\nimport numpy as np\nnp.random.seed(0)\n\nclass TestMethods(object):\n\n def assert_almost_equal(self, a, b, error_rate=0.1):\n half_error_rate = e... | python | chosen |
[
{
"from": "system",
"value": "Make cute respect guild nicknames\n"
},
{
"from": "human",
"value": "import discord\nfrom discord.ext.commands import Bot\nimport json\n\nclient = Bot(\"~\", game=discord.Game(name=\"~help\"))\n\n@client.event\nasync def on_ready():\n print('We have logged in as ... | python | chosen |
[
{
"from": "system",
"value": "Add common in import statement\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)\n# All Right Reserved\n#\n# A... | python | chosen |
[
{
"from": "system",
"value": "Use Django's module loading rather than __import__\n\n__import__ doesn't deal well with dotted paths, in my instance my root url conf is in a few levels \"appname.config.urls\". unfortunately, for __import__ this means that just `appname` is imported, but `config.urls` is loade... | python | chosen |
[
{
"from": "system",
"value": "Fix queryset filtering for active offers\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django.db import models\n\n\nclass ActiveOfferManager(models.Manager):\n \"\"\"\n For searching/creating ACTIVE offers only.\n \"\"\"\n def get_query_set(... | python | chosen |
[
{
"from": "system",
"value": "Stop hard-coding the navigation level in the extension\n"
},
{
"from": "human",
"value": "from django.utils.text import capfirst\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom feincms.module.page.extensions.navigation import NavigationExtension, Pa... | python | chosen |
[
{
"from": "system",
"value": "Clean up include dir code\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Gregory Oschwald\n# Copyright (c) 2013 Gregory Oschwald\n#\n# License: MIT\n#\n\n\"\"\"This module... | python | chosen |
[
{
"from": "system",
"value": "Add optional support for SSL SNI\n"
},
{
"from": "human",
"value": "import collections\nfrom client import Client\n\n\nclass EtcdResult(collections.namedtuple(\n 'EtcdResult',\n [\n 'action',\n 'index',\n 'key',\n 'prevValue',\n ... | python | chosen |
[
{
"from": "system",
"value": "Use newer interface for filtering\n\nThe image provided by `plone.app.contenttypes` does reintroduce the global\nIImage identifier lost during the transition to dexterity based types\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Module providing ... | python | chosen |
[
{
"from": "system",
"value": "Change the order when loading xml data\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n##############################################################################\n{\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix tests for file timestamps to drop the LLVM epoch offset.\n\nNow that Swift is not using LLVM's TimeValue (564fc6f2 and previous commit)\nthere is no offset from the system_clock epoch. The offset could be added\ninto the tests that use touch.py (so the times would not be ba... | python | chosen |
[
{
"from": "system",
"value": "Test case test_connect_remote() has been passing consistently for some times.\nLet's remove the @expectedFailure marker from it.\n\n\ngit-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@133294 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from": "human",
"value": "... | python | chosen |
[
{
"from": "system",
"value": "Add missing vat alias for Canada\n"
},
{
"from": "human",
"value": "# __init__.py - collection of Canadian numbers\n# coding: utf-8\n#\n# Copyright (C) 2017 Arthur de Jong\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the ter... | python | chosen |
[
{
"from": "system",
"value": "Change data access script to issue SELECTs that actually return a value\n\nThis makes the part about tracing the SQL statements and tracing the\nnumber of rows returned a little more interesting.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys... | python | chosen |
[
{
"from": "system",
"value": "Change the version to 1.2.0\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\ndynesty is nested sampling package.\nThe main functionality of dynesty is performed by the\ndynesty.NestedSampler and dynesty.DynamicNestedSampler\... | python | chosen |
[
{
"from": "system",
"value": "Bring forward more contents into top namespace\n"
},
{
"from": "human",
"value": "from .__about__ import __version__\nfrom .compiler import RDLCompiler\nfrom .walker import RDLListener, RDLWalker\nfrom .messages import RDLCompileError\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Add test for enumeration editing\n\nSigned-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>\n"
},
{
"from": "human",
"value": "from gi.repository import Gtk\n\nfrom gaphor import UML\nfrom gaphor.UML.classes import ClassItem\nfrom gaphor.UML.class... | python | chosen |
[
{
"from": "system",
"value": "Add function to print comprehensive dependence list\n"
},
{
"from": "human",
"value": "from ._convert import convert\nfrom . import log\nfrom . import random\nfrom . import version\nfrom .version import module as __version__\nfrom .version import api as __api_versio... | python | chosen |
[
{
"from": "system",
"value": "Allow N > 1 randhs to be generated\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n__all__ = [\"randh\", \"wrap\"]\n\nimport numpy as np\nimport numpy.random as rng\n\ndef randh():\n \"\"\"\n Generate from the heavy-tailed distribution.\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "[SwiftSyntax] Add convenience initializer for `BinaryOperatorExpr`\n"
},
{
"from": "human",
"value": "SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {\n 'DeclBuildable': [\n 'CodeBlockItem',\n 'MemberDeclListItem',\n 'SyntaxBuildable'\n ],... | python | chosen |
[
{
"from": "system",
"value": "Use Heroku instance of webapp if not in DEBUG mode.\n"
},
{
"from": "human",
"value": "import logging\nimport logging.handlers\n\nDEBUG = True\n\nLOG_FORMAT = '[%(asctime)s: %(levelname)s] %(message)s'\nif DEBUG:\n LOG_LEVEL = logging.DEBUG\nelse:\n LOG_LEVEL ... | python | chosen |
[
{
"from": "system",
"value": "Change 'password_reset_done' URL name to 'password_reset_complete'\n\nThe built-in password reset views use a different name for the last page in the\nflow than we did before, and somehow we never noticed this until recently.\nTrivial fix.\n\nFixes bug 3345.\n"
},
{
"fr... | python | chosen |
[
{
"from": "system",
"value": "Make globalName nullable for now.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\nimport os\nimport sys\nfrom sqlalchemy import Column, ForeignKey, Integer, String\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.orm import relationsh... | python | chosen |
[
{
"from": "system",
"value": "Test analyse page checks domain validity\n"
},
{
"from": "human",
"value": "\"\"\"Test analysis page.\"\"\"\n\n\ndef test_analysis(webapp):\n \"\"\"Test we can analyse a page.\"\"\"\n response = webapp.get('/analyse/646e73747769737465722e7265706f7274')\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Bots: Adjust Incrementor bot to use StateHandler\n"
},
{
"from": "human",
"value": "# See readme.md for instructions on running this code.\n\n\nclass IncrementorHandler(object):\n\n def __init__(self):\n self.number = 0\n self.message_id = None\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Increase version to 0.9.3 for release\n"
},
{
"from": "human",
"value": "__version__ = '0.9.2'\n\nfrom dicomweb_client.api import DICOMwebClient\n"
},
{
"from": "gpt",
"value": "__version__ = '0.9.3'\n\nfrom dicomweb_client.api import DICOMwebClient\n"
... | python | chosen |
[
{
"from": "system",
"value": "Split Entry into Income and Expense schemes\n\nSplitting the Entry schema into two seperate schemes allows\nus to use different collections to store them, which in turn makes\nour work easier later on.\n"
},
{
"from": "human",
"value": "from app import db\nfrom app.... | python | chosen |
[
{
"from": "system",
"value": "Remove profile 'show' page, only 'edit' page is provided.\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\n\nurlpatterns = patterns('',\n (r'^edit/$', 'epiweb.apps.profile.views.edit'),\n (r'^$', 'epiweb.apps.profile.views.index'),\n... | python | chosen |
[
{
"from": "system",
"value": "Update CollectionForm to handle slug field\n"
},
{
"from": "human",
"value": "from django import forms\nfrom ...product.models import Collection\n\n\nclass CollectionForm(forms.ModelForm):\n class Meta:\n model = Collection\n exclude = []\n"
},
... | python | chosen |
[
{
"from": "system",
"value": "Add title to Graph object constructor\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nfrom app import db, bcrypt\n\nclass User(db.Model):\n __tablename__ = \"users\"\n \n id = db.Column(db.Integer, primary_key=True)\n username = db.Co... | python | chosen |
[
{
"from": "system",
"value": "Make this the default so we can create User objects.\n\nSigned-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom django_enumfield import EnumField\n\nfrom librement.utils.... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in token authentication\n"
},
{
"from": "human",
"value": "import os\nfrom flask import Flask, Blueprint, request, jsonify\n\napp = Flask(__name__)\n# Read configuration to apply from environment\nconfig_name = os.environ.get('FLASK_CONFIG', 'development')\n... | python | chosen |
[
{
"from": "system",
"value": "Add Access-Control headers to python\n"
},
{
"from": "human",
"value": "import json\nimport functools\nfrom flask import Flask, Response\nfrom foxgami.red import Story\n\napp = Flask(__name__)\n\n\ndef return_as_json(inner_f):\n @functools.wraps(inner_f)\n def... | python | chosen |
[
{
"from": "system",
"value": "Fix action object and target thumbnail urls"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom .models import Notification\n\n\nclass NotificationSerializer(serializers.ModelSerializer):\n target = serializers.Field(source='data.targe... | python | chosen |
[
{
"from": "system",
"value": "Correct the definitions of old-style classes\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom scipy.interpolate import PchipInterpolator\n\n\nclass UcPoly():\n def __init__(self, coef):\n self.p = np.poly1d(coef)\n\n def machine_to_physics(se... | python | chosen |
[
{
"from": "system",
"value": "Use try clause for config in optimizer\n"
},
{
"from": "human",
"value": "\"\"\"Module for optimized functions\n\nSome methods performed in Python may be slowing down solvers. In this optimization\nmodule we place optimized functions that are to be used instead of d... | python | chosen |
[
{
"from": "system",
"value": "Simplify regex using non-greedy qualifier\n"
},
{
"from": "human",
"value": "import re\n\n# <a> followed by another <a> without any intervening </a>s\nlink_inside_link_regex = re.compile(\n ur\"(?P<outer_link><a ((?!</a>).)*)(<a ((?!</a>).)*>\"\n ur\"(?P<inter... | python | chosen |
[
{
"from": "system",
"value": "Clean the output of the demo server\n"
},
{
"from": "human",
"value": "from anser import Anser\n\n\nserver = Anser(__name__, debug=True)\n\n\n@server.action('default')\ndef action_a(message, address):\n print message['type']\n print message['body']\n\n\nserver... | python | chosen |
[
{
"from": "system",
"value": "Fix merge conflict in bert_trainer_example.py\n"
},
{
"from": "human",
"value": "import unittest\nimport time\nimport shutil\nimport pandas as pd\nfrom bert_trainer import BERTTrainer\nfrom utils import *\n\nclass TestBERT(unittest.TestCase):\n\n def __init__(sel... | python | chosen |
[
{
"from": "system",
"value": "Update login form clean method to return full cleaned data.\n"
},
{
"from": "human",
"value": "#! coding: utf-8\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.contrib.auth import authenticate\n\n\nclass LoginForm(form... | python | chosen |
[
{
"from": "system",
"value": "Add fallback to 'cwd' if not defined\n"
},
{
"from": "human",
"value": "import logging\nimport os\nimport uuid\n\nfrom contextlib import contextmanager\nfrom subprocess import check_call, CalledProcessError\n\nLOG = logging.getLogger(__name__)\n\n\ndef touch(directo... | python | chosen |
[
{
"from": "system",
"value": "Change package core mdoels init\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom opps.core.models.channel import *\nfrom opps.core.models.profile import *\nfrom opps.core.models.source import *\nfrom opps.core.models.publisher import *\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Add the good old middleware\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright (C) 2011 by Florian Mounier, Kozea\n# This file is part of pystil, licensed under a 3-clause BSD license.\n\"\"\"\npystil - An elegant site web... | python | chosen |
[
{
"from": "system",
"value": "Read from doc url mapping file at load time, rather than once per request\n"
},
{
"from": "human",
"value": "import ConfigParser\nfrom django.conf import settings\n\n\ndef doc_url(request):\n config_file = open(settings.REPO_ROOT / \"docs\" / \"config.ini\")\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix response with json for get_work\n"
},
{
"from": "human",
"value": "import json\nfrom django.http import Http404, JsonResponse\nfrom django.views.decorators.csrf import csrf_exempt\nfrom breach.strategy import Strategy\nfrom breach.models import Victim\n\n\ndef g... | python | chosen |
[
{
"from": "system",
"value": "Add `cmd.run_all` to `__salt__`. Required for the unit test.\n"
},
{
"from": "human",
"value": "import tempfile\n\nfrom saltunittest import TestCase, TestLoader, TextTestRunner\n\nfrom salt import config as sconfig\nfrom salt.modules import file as filemod\nfrom sal... | python | chosen |
[
{
"from": "system",
"value": "Fix test for unwelded scopes.\n"
},
{
"from": "human",
"value": "\nimport types\n\ndb = connect( \"test\" );\nt = db.pythonnumbers\nt.drop()\n\nthing = { \"a\" : 5 , \"b\" : 5.5 }\nassert( type( thing[\"a\"] ) == types.IntType );\nassert( type( thing[\"b\"] ) == typ... | python | chosen |
[
{
"from": "system",
"value": "Deploy Travis CI build 976 to GitHub\n"
},
{
"from": "human",
"value": "\"\"\"Unit tests configuration file.\"\"\"\n\nimport logging\n\n\ndef pytest_configure(config):\n \"\"\"Disable verbose output when running tests.\"\"\"\n logging.basicConfig(level=logging... | python | chosen |
[
{
"from": "system",
"value": "Make identifiers camel-case; remove redundant space.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nfrom typing import ClassVar, List\n\n\n# Annotated function (Issue #29)\ndef foo(x: int) -> int:\n return x + 1\n\n\n# Annotated variables #575\nCONST:... | python | chosen |
[
{
"from": "system",
"value": "Exclude test data utilities from lit.\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nimport lit.formats\nimport lit.util\n\nimport lit.llvm\n\n# Configuration file for the 'lit' test runner.\nlit.llvm.initialize(lit_config, config)\n\n# name: The name o... | python | chosen |
[
{
"from": "system",
"value": "Update the build branch for stable to 0.7\n\nTBR=ricow\n\nReview URL: https://codereview.chromium.org/26993005\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@228644 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "# Copyright 2013 The... | python | chosen |
[
{
"from": "system",
"value": "Use context so the test file to get closed after tests\n"
},
{
"from": "human",
"value": "from urllib import request\n\nfrom bs4 import BeautifulSoup\n\nHEADERS = {\n 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Fire... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Make SFC test a python call to main()\"\n\nThis reverts commit d5820bef80ea4bdb871380dbfe41db12290fc5f8.\n\nRobot test runs before SFC test and it imports\nhttps://github.com/robotframework/SSHLibrary\nwhich does a monkey patching in \nthe python runtime / paramiko.\nU... | python | chosen |
[
{
"from": "system",
"value": "Create TalksUser model when a user is created\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\nfrom django.contrib.contenttypes.fields import GenericForeignKey\nfrom django.contrib.contenttypes.models impo... | python | chosen |
[
{
"from": "system",
"value": "Add fallback: from backport_collections import Counter\n"
},
{
"from": "human",
"value": "from collections import Counter\nimport datetime\n\n\nfrom parler.managers import TranslatableManager\n\n\nclass RelatedManager(TranslatableManager):\n\n # TODO: uncomment t... | python | chosen |
[
{
"from": "system",
"value": "Fix: Fix bug in register aftter login\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom rest_framework import serializers\nfrom rest_framework.exceptions import ValidationError\n\nfrom users.models import User\n\n\nclass UserSerializer(serial... | python | chosen |
[
{
"from": "system",
"value": "Fix test for python 2\n"
},
{
"from": "human",
"value": "from __future__ import print_function, division, absolute_import\n\nimport numpy as np\n\nfrom .common import *\nfrom train.utils import preprocessImage, loadNetwork, predict\nfrom constants import *\n\ntest_i... | python | chosen |
[
{
"from": "system",
"value": "Add to start urls to contain all dataset pages\n"
},
{
"from": "human",
"value": "from scrapy.contrib.spiders import CrawlSpider, Rule\nfrom scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor\nfrom scrapy.selector import Selector\nfrom .. import items\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Fix vies url -- Increase version number\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\n\n__version__ = \"5.0.1\"\n\nlogger = logging.getLogger('vies')\n\nVIES_WSDL_URL = str('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl... | python | chosen |
[
{
"from": "system",
"value": "ADD institution / website as optional fields during user creation\n"
},
{
"from": "human",
"value": "# stdlib\nfrom typing import Optional\nfrom typing import Union\n\n# third party\nfrom nacl.encoding import HexEncoder\nfrom nacl.signing import SigningKey\nfrom pyd... | python | chosen |
[
{
"from": "system",
"value": "Fix ImportError when loading change_(prev|next) module on windows\n"
},
{
"from": "human",
"value": "import sublime_plugin\ntry:\n from VcsGutter.view_collection import ViewCollection\nexcept ImportError:\n from view_collection import ViewCollection\n\nclass V... | python | chosen |
[
{
"from": "system",
"value": "Bump version for v0.7.0 release\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Author: Taylor Smith <taylor.smith@alkaline-ml.com>\n#\n# The pyramid module\n\n__version__ = \"0.7.0-dev\"\n\ntry:\n # this var is injected in the setup build to ena... | python | chosen |
[
{
"from": "system",
"value": "Add Slack channels the Slack Plugin\n"
},
{
"from": "human",
"value": "from drupdates.utils import *\nfrom drupdates.constructors.reports import *\nimport json\n\nclass slack(Reports):\n\n def __init__(self):\n self.currentDir = os.path.dirname(os.path.realpath(... | python | chosen |
[
{
"from": "system",
"value": "Add argument to print usernames\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\"\"\"\nA program to extract raw text from Telegram chat log\n\"\"\"\nimport argparse\nfrom json import loads\n\ndef main():\n\n parser = argparse.ArgumentParser(\n ... | python | chosen |
[
{
"from": "system",
"value": "Sort list of files inside h5py\n"
},
{
"from": "human",
"value": "import distutils.sysconfig\nfrom glob import glob\nimport os\nfrom os.path import join as pjoin, basename\nfrom shutil import copy\nfrom sys import platform\n\ndef main():\n \"\"\"\n Copy HDF5 D... | python | chosen |
[
{
"from": "system",
"value": "Allow filtering by state code"
},
{
"from": "human",
"value": "from django.contrib.gis import admin\n\nfrom cities.models import *\n\nclass CityAdmin(admin.OSMGeoAdmin):\n\tlist_display = ('__unicode__', 'population_2000')\n\tlist_filter = ('pop_range',)\n\tsearch_f... | python | chosen |
[
{
"from": "system",
"value": "Fix permission name in upgrade-1101\n"
},
{
"from": "human",
"value": "import logging\n\nfrom Acquisition import aq_base\nfrom Acquisition import aq_inner\nfrom Acquisition import aq_parent\n\nfrom Products.CMFCore import permissions\nfrom bika.lims.permissions impo... | python | chosen |
[
{
"from": "system",
"value": "Correct mistaken assertTrue() -> assertEquals()\n"
},
{
"from": "human",
"value": "from core.models import Category\n\nfrom django.test.testcases import TestCase\nfrom django.urls import reverse\n\n\nclass ExportViewMixinTest(TestCase):\n\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Move debugger line to the top\n"
},
{
"from": "human",
"value": "\"\"\"lambda_function.py main entry point for aws lambda\"\"\"\n\nimport json\nimport urllib.request\nfrom typing import Dict, Optional\n\nimport settings\nfrom logger import logger\nfrom spot import t... | python | chosen |
[
{
"from": "system",
"value": "Change command installation check process\n\nTo properly check even if the user is not root.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_im... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.16.5\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.16.4\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"... | python | chosen |
[
{
"from": "system",
"value": "Use Python 3 division on Python 2\n\nMake sure that floating point division is used on Python 2. This\nbasically happens anyways as we have a floating point value divided by\nan integral value. Still it is good to ensure that our average doesn't\nget truncated by accident.\n"
... | python | chosen |
[
{
"from": "system",
"value": "Set title for SQUASH admin interface\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\nfrom django.contrib import admin\nfrom rest_framework.authtoken.views import obtain_auth_token\nfrom rest_framework.routers import DefaultRouter\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Change model fields to lower case letters\n"
},
{
"from": "human",
"value": "\"\"\"Models.\"\"\"\nfrom django.db import models\n\n\n# Create your models here.\n\n\nclass ImagerProfile(models.Model):\n \"\"\"Imager Profile Model.\"\"\"\n\n camera_model = models... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in the ascii bar graph\n"
},
{
"from": "human",
"value": "# To change this license header, choose License Headers in Project Properties.\n# To change this template file, choose Tools | Templates\n# and open the template in the editor.\n\n__author__=\"UShareS... | python | chosen |
[
{
"from": "system",
"value": "Fix __unicode__ for DataPoint model\n"
},
{
"from": "human",
"value": "import numpy\nimport ast\n\nfrom django.db import models\n\n\nclass DataPoint(models.Model):\n name = models.CharField(max_length=600)\n exact_name = models.CharField(max_length=1000, null=... | python | chosen |
[
{
"from": "system",
"value": "tests: Test IAM Policy with no \"services\"\n\nSee also: PSOBAT-1482\n"
},
{
"from": "human",
"value": "\"\"\"Test IAM Policies for correctness.\"\"\"\nimport json\n\nfrom foremast.iam.construct_policy import construct_policy\n\nANSWER1 = {\n 'Version': '2012-10-... | python | chosen |
[
{
"from": "system",
"value": "Add tests on closing connection by error\n"
},
{
"from": "human",
"value": "import aiohttp\n\nasync def test_async_with_session(loop):\n async with aiohttp.ClientSession(loop=loop) as session:\n pass\n\n assert session.closed\n"
},
{
"from": "gp... | python | chosen |
[
{
"from": "system",
"value": "Include SUIR JS on logs page\n\nThis is not pretty, as we don't even use SUIR there, but\nindico/utils/redux imports a module that imports SUIR and thus breaks\nthe logs page if SUIR is not included.\n"
},
{
"from": "human",
"value": "# This file is part of Indico.\... | python | chosen |
[
{
"from": "system",
"value": "Add additional tests for templates.\n"
},
{
"from": "human",
"value": "import xmlsec\n\n\ndef test_create_signature_template():\n node = xmlsec.create_signature_template()\n\n assert node.tag.endswith('Signature')\n assert node.xpath('*[local-name() = \"Sig... | python | chosen |
[
{
"from": "system",
"value": "Fix reading log/report templates/dependencies in UTF-8.\n\nSome of the updated js dependencies (#2419) had non-ASCII data in\nUTF-8 format but our code reading these files didn't take that into\naccount.\n"
},
{
"from": "human",
"value": "# Copyright 2008-2015 Noki... | python | chosen |
[
{
"from": "system",
"value": "Add scope_types for revoke event policies\n\nThis commit associates `system` to revoke event policies, since these\npolicies were developed to assist the system in offline token\nvalidation.\n\nFrom now on, a warning will be logged when a project-scoped token is\nused to get re... | python | chosen |
[
{
"from": "system",
"value": "Fix new CA signal message\n"
},
{
"from": "human",
"value": "# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: urban@reciprocitylabs.com\n# Ma... | python | chosen |
[
{
"from": "system",
"value": "Move references of deleted generate_cifar10_like_example.py to the new name cifar.py\n\nPiperOrigin-RevId: 225386826\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Copyright 2018 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version... | python | chosen |
[
{
"from": "system",
"value": "Check for empty cluster dr files.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport hashlib\nimport json\nimport os\nimport sys\nprint(sys.path)\nfrom gigacluster import Doc, dr, Tokenizer\n\ntok = Tokenizer()\nfor root, dirs, files in os.walk(sys.... | python | chosen |
[
{
"from": "system",
"value": "Raise exception if sdb does not exist\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# Copyright 2015-2016 Samsung Electronics Co., Ltd.\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": "Add action to zero out tips for given match\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom .models import Match\nfrom .models import Tip\n\ndef delete_tips(modeladmin, request, queryset):\n for match in queryset:\n tips = Tip.obj... | python | chosen |
[
{
"from": "system",
"value": "Remove type ignore comment from functional enum API call\n\nThis is supported as of Mypy 0.510 and no longer raises an error.\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.util.image.models\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2017 Jochen Kupperschmidt\... | python | chosen |
[
{
"from": "system",
"value": "Use 'import' for 'tempfile' module\n"
},
{
"from": "human",
"value": "import subprocess\n\nfrom tempfile import NamedTemporaryFile\n\n\ndef dump_table(table):\n def handle_record(record, fields):\n def handle_field(column, field):\n return '%d:%... | python | chosen |
[
{
"from": "system",
"value": "Add model manager, still needs work\n"
},
{
"from": "human",
"value": "\"\"\"Models.\"\"\"\nfrom django.db import models\n\n\n# Create your models here.\n\n\nclass ImagerProfile(models.Model):\n \"\"\"Imager Profile Model.\"\"\"\n\n camera_model = models.CharF... | python | chosen |
[
{
"from": "system",
"value": "Revert system names to normal\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom cyder.base.mixins import ObjectUrlMixin\nfrom cyder.base.models import BaseModel\nfrom cyder.cydhcp.keyvalue.models import KeyValue\n\n\nclass System(BaseModel, Obj... | python | chosen |
[
{
"from": "system",
"value": "Add the possibility of browsing the tree of a particular commit.\n"
},
{
"from": "human",
"value": "from datetime import datetime\nfrom errno import ENOENT\nfrom stat import S_IFDIR\nfrom pygit2 import GIT_SORT_TIME\n\nfrom gitfs import FuseOSError\nfrom log impor... | python | chosen |
[
{
"from": "system",
"value": "Fix missing self in class methods and wrong formatting\n"
},
{
"from": "human",
"value": "class TestCase:\n\n def assertEqual(value, expected):\n if value != expected:\n raise CaseFailed(\"{0} != {1}\")\n\n def assertTrue(value):\n ass... | python | chosen |
[
{
"from": "system",
"value": "Use libopus codec while converting to Voice\n"
},
{
"from": "human",
"value": "from pydub import AudioSegment\nfrom io import BytesIO\n\n\ndef convert_to_ogg(f):\n bio = BytesIO()\n\n AudioSegment.from_file(f).export(bio, format='ogg')\n bio.seek(0)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix division for bits (not bytes)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport os\nimport subprocess\nimport re\nimport datetime\nimport pygsheets\nimport speedtest\n\n# Set constants\nDATE = datetime.datetime.now().strftime(\"%d-%m-%y %H:%M:%... | python | chosen |
[
{
"from": "system",
"value": "Add a magic member __nonzero__ to Extra\n"
},
{
"from": "human",
"value": "\nclass Extra(object):\n\n def __init__(self, where=None, tables=None):\n self.where = where if where is not None else []\n self.tables = tables if tables is not None else []... | python | chosen |
[
{
"from": "system",
"value": "Update xsan flavor now that they're running on GCE bots.\n\n - Don't add ~/llvm-3.4 to PATH: we've installed Clang 3.4 systemwide.\n - Don't `which clang` or `clang --version`: tools/xsan_build does it anyway.\n - Explicitly disable LSAN. Clang 3.5 seems to enable this by d... | python | chosen |
[
{
"from": "system",
"value": "Remove unused model class from db layer\n\nChange-Id: I42cf91dc3132d0d0f2f509b5350958b7499c68f9\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012 OpenStack Foundation.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Licen... | python | chosen |
[
{
"from": "system",
"value": "Add version number to help text\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport click\n\n\nclass JungleCLI(click.MultiCommand):\n\n \"\"\"Jangle CLI main class\"\"\"\n\n def list_commands(self, ctx):\n \"\"\"return available modules\"... | python | chosen |
[
{
"from": "system",
"value": "Update to new storage payload api\n"
},
{
"from": "human",
"value": "\"\"\"\nCommand that will allow for a user to inject triples into a database.\n\"\"\"\nfrom rhobot.components.commands.base_command import BaseCommand\nfrom rdflib.namespace import FOAF, RDF\nfrom ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.