conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix broken GithubAPIClient constructor args\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nfrom getpass import getpass, _raw_input\nimport logging\nimport sys\n\nfrom argh import ArghParser, arg\nfrom ghtools import cli\nfrom ghtools.api... | python | chosen |
[
{
"from": "system",
"value": "Make `switch` command a bit more helpful\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Gitless - a version control system built on top of Git.\n# Licensed under GNU GPL v2.\n\n\"\"\"gl switch - Switch branches.\"\"\"\n\n\nfrom __future__ import unico... | python | chosen |
[
{
"from": "system",
"value": "Add helper methods and revise doc string\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef topological_sort():\n \"\"\"Topological Sorting for Directed Acycli... | python | chosen |
[
{
"from": "system",
"value": "Fix parsing of fragments without HTML elements.\n"
},
{
"from": "human",
"value": "\"\"\"Shared utility functions\"\"\"\n\nfrom django.conf import settings\nfrom django.template.defaultfilters import slugify as django_slugify\nfrom django.utils.translation import ug... | python | chosen |
[
{
"from": "human",
"value": "Add visualization for search results\n"
},
{
"from": "gpt",
"value": "from search.html import HTMLVisualization\nfrom utils.transcription import WordCoord\n\ndef search_word(word, save=False):\n \"\"\"\n Finds all locations of a word. Optionally the locations c... | python | chosen |
[
{
"from": "system",
"value": "Fix WaterAccount instances pointing to old WaterParcels\n\nStart to make older WaterParcels obsolete\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.contrib.gis.utils import LayerMapping\n\nfrom ..load import get_processed_data_file\nfrom .models import ... | python | chosen |
[
{
"from": "system",
"value": "Enable visualizing trk files without bundle designations.\n"
},
{
"from": "human",
"value": "import tempfile\nimport os.path as op\nimport numpy as np\nimport IPython.display as display\n\nimport nibabel as nib\nfrom dipy.viz import fvtk\nfrom palettable.tableau imp... | python | chosen |
[
{
"from": "system",
"value": "Use the same name for the field in frontend and backend\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Picture(models.Model):\n \"\"\"\n This is a small demo using just two fields. ImageField depends on PIL or\n pillow (where Pil... | python | chosen |
[
{
"from": "system",
"value": "Add back fail_state to context manager\n"
},
{
"from": "human",
"value": "from .models import System\n\n\nclass transition(object):\n \"Transition context manager.\"\n def __init__(self, obj, state, event=None, start_time=None,\n message=None, excep... | python | chosen |
[
{
"from": "system",
"value": "Add testcase for allocator initialization\n"
},
{
"from": "human",
"value": "from support import lib,ffi\nfrom qcgc_test import QCGCTest\n\nclass AllocatorTest(QCGCTest):\n def test_cells_to_bytes(self):\n for i in range(1,17):\n self.assertEqua... | python | chosen |
[
{
"from": "system",
"value": "Add test case for forum crawler\n\nThe forum include: 'inside', 'techorange', 'media'\n"
},
{
"from": "human",
"value": "from arrange_schedule import *\n\n\ndef test_read_system_setting():\n keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']\n s... | python | chosen |
[
{
"from": "system",
"value": "Add reply support to threads\n"
},
{
"from": "human",
"value": "from django.contrib.auth.decorators import login_required\nfrom django.db.models import Q\nfrom django.shortcuts import get_object_or_404\nfrom django.template import RequestContext\n\nfrom user_message... | python | chosen |
[
{
"from": "system",
"value": "Switch default read size to 4 MiB\n"
},
{
"from": "human",
"value": "# VOD metadata file generator - md5_checksum sub-module\n# Copyright 2013 Bo Bayles (bbayles@gmail.com)\n# See README for more information\n# See LICENSE for license\nimport hashlib\n\ndef md5_chec... | python | chosen |
[
{
"from": "system",
"value": "Send track number as CLI argument.\n"
},
{
"from": "human",
"value": "import fore.database\nanalysis = fore.database.get_analysis(2)\nimport pickle, base64\nanalysis = pickle.loads(base64.b64decode(analysis))\nprint(analysis)\n"
},
{
"from": "gpt",
"valu... | python | chosen |
[
{
"from": "system",
"value": "Add route for individual quote\n"
},
{
"from": "human",
"value": "from flask import render_template, g\nfrom porick import app, model\n\n\n@app.route('/')\ndef landing_page():\n return render_template('/index.html')\n\n\n@app.route('/browse')\n@app.route('/browse... | python | chosen |
[
{
"from": "system",
"value": "Add signal hooks to create practice objects\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n"
},
{
"from": "gpt",
"value": "from django.contrib.auth.models import Permission\nfrom django.db.models.signals im... | python | chosen |
[
{
"from": "system",
"value": "Add passed_phases to Product and create main function\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nclass Product():\n def __init__(self, cost, name, date):\n self.cost = cost\n self.name = name\n self.date = date\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Change from MySQL to SQLite3\n"
},
{
"from": "human",
"value": "import os\n\nimport peewee\n\nAPP_DIR = os.path.dirname(__file__)\n\ntry:\n import urlparse\n import psycopg2\n urlparse.uses_netloc.append('postgres')\n url = urlparse.urlparse(os.environ[\... | python | chosen |
[
{
"from": "system",
"value": "Fix compatibility issue with Python 2.6\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2012 Alexander Shorin\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received a... | python | chosen |
[
{
"from": "system",
"value": "Fix path to seminar repository.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nGIT_SEMINAR_PATH = 'data/seminar-test/'\nTASK_MOOSTER_PATH = 'task-mooster/'\n\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nGIT_SEMINAR_PATH = 'd... | python | chosen |
[
{
"from": "system",
"value": "Add students app url configuration\n"
},
{
"from": "human",
"value": "\"\"\"halaqat 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 v... | python | chosen |
[
{
"from": "system",
"value": "Fix the issue when use with multiple cursors and scroll the view when selected\n"
},
{
"from": "human",
"value": "import sublime_plugin\n\n\nclass SelectExactMatchCommand(sublime_plugin.TextCommand):\n last_selection = None\n\n def run(self, edit):\n se... | python | chosen |
[
{
"from": "system",
"value": "Set config logging in init to debug\n"
},
{
"from": "human",
"value": "import os\nimport logging\nfrom flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom raven.contrib.flask import Sentry\n\napp = Flask(__name__)\napp.config.from_object(os.environ... | python | chosen |
[
{
"from": "system",
"value": "Fix python-path when WSGIPythonPath is not defined\n"
},
{
"from": "human",
"value": "\"\"\"\nWSGI config for farnsworth project.\n\nThis module contains the WSGI application used by Django's development server\nand any production WSGI deployments. It should expose ... | python | chosen |
[
{
"from": "system",
"value": "Make sure that .py file is used, even if .pyc got executed\n\nIf python already byte-compiled the source code to .pyc file,\nthe __file__ points to .pyc, rather than to .py, which breaks the\ncopying mechanism.\n\nUse regex substitution to make sure we're always copying the ori... | python | chosen |
[
{
"from": "system",
"value": "Use a template to render json.\n"
},
{
"from": "human",
"value": "import logging\n\nfrom flask import (\n\tFlask,\n\trender_template,\n\tabort\n)\n\nfrom glanerbeard.server import Server\n\napp = Flask(__name__)\napp.config.from_object('glanerbeard.default_settings'... | python | chosen |
[
{
"from": "system",
"value": "Load up database functions into clize\n"
},
{
"from": "human",
"value": "from . import utils\n\n# TODO: Override with port=NNNN if specified by environment\n\n# Note that these functions lazily import their corresponding modules,\n# otherwise package startup would t... | python | chosen |
[
{
"from": "system",
"value": "Add SO_REUSEADDR to socket options\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nimport socket\nimport threading\n\nfrom connection import Connection\nimport shared\n\n\nclass Listener(threading.Thread):\n def __init__(self, host, po... | python | chosen |
[
{
"from": "system",
"value": "Add csv export feature for appointments\n"
},
{
"from": "human",
"value": "from windberg_register import models\nfrom django.contrib import admin\n\n\nclass StarterAdmin(admin.ModelAdmin):\n list_display = (\"name\", \"given\", \"age_group_short\", \"club_name\",... | python | chosen |
[
{
"from": "system",
"value": "fab: Watch the docs/ dir for changes\n"
},
{
"from": "human",
"value": "from fabric.api import execute, local, settings, task\n\n\n@task\ndef preprocess_header():\n local('cpp -nostdinc spotify/api.h > spotify/api.processed.h || true')\n\n\n@task\ndef docs():\n ... | python | chosen |
[
{
"from": "system",
"value": "Support more than one digit for EventTime IDs.\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\n\n\nurlpatterns = patterns('basic.events.views',\n url(r'^(?P<year>\\d{4})/(?P<month>\\w{3})/(?P<day>\\d{1,2})/(?P<slug>[-\\w]+)/(?P<id>\\d)... | python | chosen |
[
{
"from": "system",
"value": "Add an explicit sleep in pointClustering test\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom selenium_test import FirefoxTest, ChromeTest,\\\n setUpModule, tearDownModule\n\n\nclass glPointsBase(object):\n testCase = ('pointClustering',)\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix get_router_replicas infrastructure node count.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''\nCustom filters for use in openshift_hosted\n'''\n\n\nclass FilterModule(object):\n ''' Custom ansible filters for use by openshi... | python | chosen |
[
{
"from": "system",
"value": "Add test for values of text columns in GeoDataFrame from file\n"
},
{
"from": "human",
"value": "import unittest\nimport json\n\nfrom geopandas import GeoDataFrame\n\nclass TestSeries(unittest.TestCase):\n\n def setUp(self):\n # Data from http://www.nyc.go... | python | chosen |
[
{
"from": "system",
"value": "Use cpu_percent instead of getloadavg\n\nThis is functionally similar and available in\nolder versions of psutil\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport psutil\nimport os\nimport time\n\ndef create_bar(filled):\n low = '.'\n high = '|'... | python | chosen |
[
{
"from": "system",
"value": "Add a test for AbstractMoney.__unicode__\n"
},
{
"from": "human",
"value": "from decimal import Decimal\n\nfrom django.test import TestCase\n\nfrom shop.money.money_maker import AbstractMoney, MoneyMaker\n\n\nclass AbstractMoneyTest(TestCase):\n\n def test_is_abs... | python | chosen |
[
{
"from": "system",
"value": "tests/scale: Simplify length & alignment tests\n"
},
{
"from": "human",
"value": "from hypothesis import assume, given, strategies as st\nfrom pytest import raises # type: ignore\n\nfrom ppb_vector import Vector\nfrom utils import angle_isclose, isclose, lengths, v... | python | chosen |
[
{
"from": "system",
"value": "Add a start and end method to MockRequest\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2.5\n#\n# Copyright 2008 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with... | python | chosen |
[
{
"from": "system",
"value": "Add import-time check for pygame (since we can't install automatically)\n"
},
{
"from": "human",
"value": "from . import platform_specific, input\n\nfrom .graphics import screen, Surface, Image\nfrom .run_loop import main_run_loop, every\nfrom .input import touch\nf... | python | chosen |
[
{
"from": "system",
"value": "Move some requirements to extras.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='barsystem',\n version='1.0.0',\n packages=find_packages('src'),\n package_dir={'': 'src'},\n include_package_data=True,\... | python | chosen |
[
{
"from": "system",
"value": "Check every result in Search test\n"
},
{
"from": "human",
"value": "import pycomicvine\nimport unittest\n\napi_key = \"476302e62d7e8f8f140182e36aebff2fe935514b\"\n\nclass TestSearch(unittest.TestCase):\n def test_search_resource_type(self):\n search = pyc... | python | chosen |
[
{
"from": "system",
"value": "Create JSON importer from raw JSON file including web headers and pretty print all of the stat categories for one file\n"
},
{
"from": "human",
"value": "import json\nimport pprint\nimport os\n\n\nwith open('json/test.json') as json_data:\n d = json.load(json_dat... | python | chosen |
[
{
"from": "system",
"value": "Call Darksky API with TCX run time\nUse simpler GET request to Darksky API rather than a third party Python\nwrapper\n"
},
{
"from": "human",
"value": "import tcxparser\nfrom darksky import forecast\nfrom configparser import ConfigParser\n\n# Darksky weather API.\n#... | python | chosen |
[
{
"from": "system",
"value": "Handle situation if timer is already running."
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom Axon.Component import component\nfrom threading import Timer\n\nclass TimerMixIn(object):\n \n def __init__(self, *argl, **argd):\n super(TimerMix... | python | chosen |
[
{
"from": "system",
"value": "Make developers an admin on registration\n"
},
{
"from": "human",
"value": "import re\n\nfrom django.conf import settings\nfrom django.db.models.signals import post_save\nfrom django.dispatch import receiver\n\nfrom user import tokens\nfrom user.models import User\n... | python | chosen |
[
{
"from": "system",
"value": "Add function to resolve settings from multiple sources\n\nutilities.resolve_setting() takes values for a setting from multiple sources and picks the appropriate value in order of source priority.\n"
},
{
"from": "human",
"value": "from six import string_types\n\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Fix out place mismatched out array size.\n"
},
{
"from": "human",
"value": "from .binding import sort as _sort\n\nimport numpy\nfrom numpy.lib.recfunctions import append_fields\n\ntry:\n unicode = unicode\nexcept NameError:\n # 'unicode' is undefined, must be ... | python | chosen |
[
{
"from": "system",
"value": "Send image in embed because aiohttp doesn't know how to parse links\n"
},
{
"from": "human",
"value": "import io\r\n\r\nimport aiohttp\r\nfrom discord.ext import commands\r\nimport yaml\r\n\r\n\r\nclass Cat:\r\n def __init__(self, bot):\r\n self.bot = bot\... | python | chosen |
[
{
"from": "system",
"value": "Add sample Darksky API call\n"
},
{
"from": "human",
"value": "import tcxparser\ntcx = tcxparser.TCXParser('gps_logs/2017-06-15_Running.tcx')\nprint(tcx.duration)\n"
},
{
"from": "gpt",
"value": "import tcxparser\nfrom darksky import forecast\nfrom confi... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Updated function to work on bytes rather than binascii functions.\"\n\nThis reverts commit 25176b64aed599059e4b552fbd76c5f4bc28434e.\n"
},
{
"from": "human",
"value": "\"\"\"Set 01 - Challenge 01.\"\"\"\nimport base64\n\nhex_string = ('49276d206b696c6c696e6... | python | chosen |
[
{
"from": "system",
"value": "Allow URLS to have dataset names in\n"
},
{
"from": "human",
"value": "import DQXUtils\n\n\ndef application(environ, start_response):\n #For the root we do a relative redirect to index.html, hoping the app has one\n if environ['PATH_INFO'] == '/':\n sta... | python | chosen |
[
{
"from": "system",
"value": "Add new relationship to Investment resource\n"
},
{
"from": "human",
"value": "import six\n\nfrom .node import Node\n\n\n@six.python_2_unicode_compatible\nclass Investment(Node):\n \"\"\"Represents a Investment (investor-investment) on CrunchBase\"\"\"\n\n KNO... | python | chosen |
[
{
"from": "system",
"value": "Fix W1505: Using deprecated method assertEquals()\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.urls.base import reverse\n\nfrom survey.models import Response, Survey\nfrom survey.tests.base_test import BaseTest\n\n\nclass TestConfirmView... | python | chosen |
[
{
"from": "system",
"value": "Fix minor bug for Python 2.x\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom abc import ABCMeta, abstractmethod\n\nWithABCMeta = ABCMeta('WithABCMeta', (object,), ... | python | chosen |
[
{
"from": "system",
"value": "Debug song of the week\n"
},
{
"from": "human",
"value": "import sys\nimport random\nfrom pytz import timezone\nfrom datetime import datetime\nimport pytz\nfrom libs import post_text\nimport spotipy\nimport os\nfrom spotipy.oauth2 import SpotifyClientCredentials\n\n... | python | chosen |
[
{
"from": "system",
"value": "Disable redefined outer name pylint warning.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom __future__ import unicode_literals, absolute_import\n\nimport pytest\n\nfrom boxsdk.util.multipart_stream import MultipartStream\n\n\n@pytest.fixture(params=({}, ... | python | chosen |
[
{
"from": "system",
"value": "Add license header and file documentation\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom examples.gbest_pso import main as gbest\nfrom examples.lbest_pso import main as lbest\nfrom examples.gc_pso import main as gc\nfrom examples.pso_optimizer import main ... | python | chosen |
[
{
"from": "system",
"value": "Move query assignment out of try block\n\nmake import relative\n"
},
{
"from": "human",
"value": "from models import User\nfrom passlib.apps import custom_app_context as pwd_context\n\ndef create_user(session, username, password):\n \"\"\"Add a new user to the da... | python | chosen |
[
{
"from": "system",
"value": "Add a test for functions with keyword only arguments\n\nThis adds a test to ensure that no error is raised if a trailing comma\nis missing from a function definition that has keyword only arguments.\n\nReviewed-by: Jakub Stasiak <1d3764b91b902f6b45836e2498da81fe35caf6d6@stasiak... | python | chosen |
[
{
"from": "system",
"value": "Change singletons to instantiate locks per-class\n\nBefore it was creating one for any singleton object, resulting in\nBad Things (infinite lock) happening when one singleton object\ninstantiates another singleton object in its instantiation. (I hope\nthat made sense...)\n"
}... | python | chosen |
[
{
"from": "human",
"value": "Create KeyAPI class + method to construct endpoint\n"
},
{
"from": "gpt",
"value": "# Copyright (c) 2015, Stavros Sachtouris\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that... | python | chosen |
[
{
"from": "system",
"value": "Make basic test more particular.\n"
},
{
"from": "human",
"value": "from indra.sources import rlimsp\n\n\ndef test_simple_usage():\n rp = rlimsp.process_pmc('PMC3717945')\n stmts = rp.statements\n assert len(stmts) == 6, len(stmts)\n\n\ndef test_ungrounded_... | python | chosen |
[
{
"from": "system",
"value": "Call the proper quicksort version depending on type.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport ctypes\nimport os\nimport glob\n\nimport numpy as np\n\n\n# Load the Rust library when loading this module\n\ntarget = \"debug\"\n# target = \"re... | python | chosen |
[
{
"from": "system",
"value": "Add futures as a dependency.\n"
},
{
"from": "human",
"value": "from setuptools import find_packages, setup\n\n\nsetup(\n name='tchannel',\n version='0.1.0+dev0',\n author='Aiden Scandella',\n author_email='dev@uber.com',\n description='Network multip... | python | chosen |
[
{
"from": "system",
"value": "Update updated time on update\n\nI.e., added onupdate=datetime.now to TimestampMixin.updated_at so that it will\nbe automatically updated whenever a record is edited.\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom sqlalchemy.schema import Column\nfrom sq... | python | chosen |
[
{
"from": "system",
"value": "Fix import error for missing file.\n"
},
{
"from": "human",
"value": "# (c) 2013, AnsibleWorks\n#\n# This file is part of Ansible Commander\n#\n# Ansible Commander is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Publi... | python | chosen |
[
{
"from": "system",
"value": "Add names to each url\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom django.conf import settings\n\nfrom django.contrib import admin\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n (r'^\\+media/(?P<path>.*)$', 'django.views... | python | chosen |
[
{
"from": "system",
"value": "Update community to use new lib namespace\n"
},
{
"from": "human",
"value": "import sys\n\nfrom core import Tokenizer\nfrom utilities import url_to_json\n\n\ndef run(project_id, repo_path, cursor, **options):\n t_sub = options.get('sub')\n t_star = options.get... | python | chosen |
[
{
"from": "system",
"value": "Add balance checking test samplesets\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom breach.models import SampleSet, Victim, Target, Round\n\n\nclass RuptureTestCase(TestCase):\n def setUp(self):\n target = Target.objects.create(\... | python | chosen |
[
{
"from": "system",
"value": "Add StaticBorder to public API\n"
},
{
"from": "human",
"value": "from hecate.core.base import CellularAutomaton\nfrom hecate.core.properties import (\n IntegerProperty,\n)\nfrom hecate.core.topology.lattice import (\n OrthogonalLattice,\n)\nfrom hecate.core.t... | python | chosen |
[
{
"from": "system",
"value": "Doc: Remove copyright to code not written by bquach.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nCopyright 2016 Brian Quach\nLicensed under MIT (https://github.com/brianquach/udacity-nano-fullstack-conference/blob/master/LICENSE) # noqa\n\nCod... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.4.0\n\nThis should have been done a while ago... many changes including comprehensive documentation, support for lat-lon grids, bug fixes, etc."
},
{
"from": "human",
"value": "__version__ = '0.3.2'\n\n# This list defines all the modul... | python | chosen |
[
{
"from": "system",
"value": "Update import to use flask.ext"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nFlask-Login example\r\n===================\r\nThis is a small application that provides a trivial demonstration of\r\nFlask-Login, including remember me functionalit... | python | chosen |
[
{
"from": "system",
"value": "Add additional CRUD functions to Quiz class\n"
},
{
"from": "human",
"value": "from database import QuizDB\n\ndb = QuizDB(host=config.REDIS_HOST, port=config.REDIS_PORT)\n\nclass Quiz(Base):\n def __init__(self, id):\n self.id = id\n\n QUESTION_HASH = \... | python | chosen |
[
{
"from": "system",
"value": "Remove useless information from library description\n"
},
{
"from": "human",
"value": "# Licensed under MIT license - see LICENSE.rst\n\n\"\"\"\nThis is an Astropy affiliated package.\n\"\"\"\n\n# Affiliated packages may add whatever they like to this file, but\n# s... | python | chosen |
[
{
"from": "system",
"value": "Fix syntax of a migration\n"
},
{
"from": "human",
"value": "\"\"\"add a flag for review active\n\nRevision ID: 4d45dd3d8ce5\nRevises: 49d09b3d2801\nCreate Date: 2014-02-26 16:29:54.507710\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '4d45dd3d8c... | python | chosen |
[
{
"from": "system",
"value": "Include mask size on docker CIDR.\n"
},
{
"from": "human",
"value": "from pyinfra import inventory, state\n\nfrom pyinfra_docker import deploy_docker\nfrom pyinfra_etcd import deploy_etcd\nfrom pyinfra_kubernetes import deploy_kubernetes_master, deploy_kubernetes_no... | python | chosen |
[
{
"from": "system",
"value": "Make topic_* field on public body search index optional"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nfrom django.conf import settings\n\nfrom haystack import indexes\nfrom celery_haystack.indexes import CelerySearchIndex\n\nfrom .models ... | python | chosen |
[
{
"from": "system",
"value": "Write test that attempts to unpack invalid archive\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\nfrom ..pyautoupdate.launcher import Launcher\nfrom .pytest_skipif import needinternet\nfrom .pytest_makevers import fixtur... | python | chosen |
[
{
"from": "system",
"value": "Load specs from spec/**/*_spec.py if no spec was specified\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport sys\nimport imp\n\nfrom mamba import formatters\nfrom mamba.runner import Runner\n\n\ndef main():\n formatter = formatters.Documentatio... | python | chosen |
[
{
"from": "system",
"value": "Support making available to exec cmd on sub dir\n"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom commands.apply_config import ApplyConfigCommand\nfrom commands.compile import CompileCommand\nfrom commands.init import InitCommand\nfrom commands.setup im... | python | chosen |
[
{
"from": "system",
"value": "Change random range to be between -max_val/2 and max_val for negative numbers.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport numpy as np\nimport copy as cp\nimport rust_sorting as rs\n\nN = 5\nmax_val = 10.0\n\ndtypes = [np.int8, np.int16, np... | python | chosen |
[
{
"from": "system",
"value": "Use better start values for arm\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport socket\nimport time\nimport math\nimport random\n\nHOST, PORT = 'localhost', 7777\n\nLIMIT = 0.5\n\nposx, posy, posz = 0.0, 0.0, 0.0\n\ndef change_pos(*values):\n ra... | python | chosen |
[
{
"from": "system",
"value": "Kill __pycache__ directories in tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom fabric.api import (\n lcd,\n local,\n task)\n\n\n@task\ndef clean():\n local('rm -rf wheelhouse')\n local('rm -rf dist')\n local('rm -rf build'... | python | chosen |
[
{
"from": "system",
"value": "Add str method to TeamStats\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.db.models.signals import pre_save, post_save\nfrom django.dispatch import receiver\nfrom django.conf import settings\n\nfrom competition.models import Team\n\nim... | python | chosen |
[
{
"from": "system",
"value": "Move package metadatas at the code level\n"
},
{
"from": "human",
"value": "\"\"\"Spam checker backends for Zinnia based on Akismet\"\"\"\n"
},
{
"from": "gpt",
"value": "\"\"\"Spam checker backends for Zinnia based on Akismet\"\"\"\n__version__ = '1.0.d... | python | chosen |
[
{
"from": "system",
"value": "Add more unit tests for the image module.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom numpy import all, array, dstack\n\nfrom .. import image\n\n\ndef test_get_channels():\n x = array([[1, 2, 3], [2, 3, 4], [3, 4, 5]])\n y = dstack((x, x, ... | python | chosen |
[
{
"from": "system",
"value": "4: Create script to save documentation to a file \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4"
},
{
"from": "human",
"value": "######\n# Create a file (html or markdown) with the output of\n# - JVMHeap\n# - LogFiles\n# - Ports\n# ... | python | chosen |
[
{
"from": "system",
"value": "Write to file instead of hexdump\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\n\nimport argparse\n\nfrom util.assemble import assemble\nfrom util.hexdump import hexdump\n\n\ndef get_args():\n parser = argparse.ArgumentParser(description='Spym MIPS ... | python | chosen |
[
{
"from": "system",
"value": "Add check for \"green\" status for Hudson\n\nHudson and Jenkins have extremely similar APIs, one of the main differences is that Jenkins uses \"blue\" but Hudson uses \"green\" for a successful last build. Adding the option to check for \"green\" status allows the Jenkins chec... | python | chosen |
[
{
"from": "system",
"value": "Ch18: Add date URL kwarg options to PostGetMixin.\n"
},
{
"from": "human",
"value": "from django.shortcuts import get_object_or_404\n\nfrom .models import Post\n\n\nclass PostGetMixin:\n\n errors = {\n 'url_kwargs':\n \"Generic view {} must be c... | python | chosen |
[
{
"from": "system",
"value": "Load multiple accounts using a config file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\n# import mailboxresource\nfrom mailboxresource import MailboxClient\nimport argparse\n\n\ndef main():\n argparser = argparse.ArgumentPars... | python | chosen |
[
{
"from": "system",
"value": "Support project filter with wildcard\n\nTranslate glob-style wildcards to ILIKE comparisons for the database.\n"
},
{
"from": "human",
"value": "import argparse\n\n\nfrom aeromancer.db.models import Project\n\n\nclass ProjectFilter(object):\n \"\"\"Manage the arg... | python | chosen |
[
{
"from": "system",
"value": "Add missing preamble for wrapper script\n\nChange-Id: I26d002ca739544bc3d431a6cdb6b441bd33deb5a\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# (c) 2014 Brainly.com, Pawel Rozlach <pawel.rozlach@brainly.com>\n\n# This script is intended to only find \... | python | chosen |
[
{
"from": "system",
"value": "Add is_geolocated property for admin purpuse\n"
},
{
"from": "human",
"value": "from django.contrib.gis.db import models as geomodels\nfrom django.contrib.gis.geos.point import Point\n\nfrom geopy import geocoders\n\nclass GeoLocatedModel(geomodels.Model):\n geom... | python | chosen |
[
{
"from": "system",
"value": "Clarify admin user creation message\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport django\ndjango.setup()\n\nimport sys,os\nfrom django.contrib.auth.models import User\nfrom django.core.management import call_command\n\nadmin_username = os.getenv... | python | chosen |
[
{
"from": "system",
"value": "Add seperate test function for smoothing.py\n"
},
{
"from": "human",
"value": "\"\"\"\nTests functions in smoothing.py\nRun with:\n nosetests test_smoothing.py\n\"\"\"\t\n\n# Test method .smooth()\nsmooth1, smooth2 = subtest_runtest1.smooth(0), subtest_runtest1.s... | python | chosen |
[
{
"from": "system",
"value": "Bring coverage back to 100%\n\nAll calls to reraise() are in branches where value is truthy, so we\r\ncan't reach that code."
},
{
"from": "human",
"value": "from types import TracebackType\nfrom typing import NoReturn, Optional, Type, Union\n\n\ndef to_bytes(\n ... | python | chosen |
[
{
"from": "system",
"value": "Add callback, set camera feed selection pins based on msg\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport rospy\nimport Adafruit_BBIO.GPIO as GPIO\nfrom vortex_msgs.msg import CameraFeedSelection\n\nGPIO_PIN_MAP = rospy.get_param('/camera/pin_map')\... | python | chosen |
[
{
"from": "system",
"value": "Switch order of store URLs\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib import admin\nfrom django.conf.urls.static import static\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib.staticfiles.urls im... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.