conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Update test to avoid pipeline fail\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\n\nfrom scout.demo import cnv_report_path\nfrom scout.commands import cli\n\n\ndef test_load_cnv_report(mock_app, case_obj):\n \"\"\"Testing the load delivery... | python | chosen |
[
{
"from": "system",
"value": "Update Watcher example to use HumiditySensor instead of second TemperatureSensor"
},
{
"from": "human",
"value": "\"\"\"\nAn example showing how to use the Watcher to track multiple devices in one\nprocess.\n\"\"\"\n\nfrom ninja.api import NinjaAPI, Watcher\nfr... | python | chosen |
[
{
"from": "system",
"value": "Change Table name to correct name\n\nThe table name is currently wrong in this version and needs to\nbe changed to the correct name. It is preventing the database\nmigration script from running correctly.\n\nCloses-Bug: #1562091\nChange-Id: I9be88a4385ab58b37be5842aaaefd8353a2f... | python | chosen |
[
{
"from": "system",
"value": "Add checks in case site.py is broken (eg: virtualenv).\n"
},
{
"from": "human",
"value": "import site\nimport sys\nfrom distutils.sysconfig import get_python_lib\n\n\nSITE_PACKAGES_PATHS = set(site.getsitepackages())\nSITE_PACKAGES_PATHS.add(site.getusersitepackages... | python | chosen |
[
{
"from": "system",
"value": "Remove commented out debug print lines\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom helpers import HTTPEventHandler\nimport looping\nimport buffer_event\n\nclass StatusClient(HTTPEventHandler):\n\n def __init__(self, server, sock, address, r... | python | chosen |
[
{
"from": "system",
"value": "Fix a bunch of PEP8 warnings."
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nimport argparse\nimport csv\nimport itertools\nimport logging\nimport math\nimport os\n\nimport miseq_logging\n\nBAD_ERROR_RATE = 7.5\n\ndef parseArgs():\n parser = argparse.... | python | chosen |
[
{
"from": "system",
"value": "Save images instead of paths in Catalog.\n"
},
{
"from": "human",
"value": "# This file is part of Redmill.\n#\n# Redmill is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published by\n# the Fr... | python | chosen |
[
{
"from": "system",
"value": "Add time serial test, buy or sell point.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom goristock import goristock\na = goristock(8261)\nfor i in range(3):\n a.display(3,6,9)\n\n a.raw_data.pop()\n a.data_date.pop()\n a.s... | python | chosen |
[
{
"from": "system",
"value": "Add modules to pytac namespace.\n"
},
{
"from": "human",
"value": "\"\"\"Pytac: Python Toolkit for Accelerator Controls.\"\"\"\n\n# PV types\nSP = 'setpoint'\nRB = 'readback'\n# Unit systems\nENG = 'engineering'\nPHYS = 'physics'\n# Model types.\nSIM = 'simulation'\... | python | chosen |
[
{
"from": "system",
"value": "Enable video content for cms pages\n\n[#110289088]\n"
},
{
"from": "human",
"value": "from django.db import models\n\n# Create your models here.\n\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom feincms.module.page.models import Page\nfrom feincms.c... | python | chosen |
[
{
"from": "system",
"value": "Add /firefox/nightly/all/ to download link tests\n"
},
{
"from": "human",
"value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://moz... | python | chosen |
[
{
"from": "system",
"value": "Tag commit for v0.0.10-master generated by gitmake.py\n"
},
{
"from": "human",
"value": "major = 0\nminor=0\npatch=0\nbranch=\"dev\"\ntimestamp=1376425015.74"
},
{
"from": "gpt",
"value": "major = 0\nminor=0\npatch=10\nbranch=\"master\"\ntimestamp=137650... | python | chosen |
[
{
"from": "system",
"value": "Add special task id to test source\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport json\nimport app\n\nWORK_END_TASK = 73847457\n\n\ndef test():\n body = {\n \"event_name\": \"item:completed\",\n \"event_data\": {\n \... | python | chosen |
[
{
"from": "system",
"value": "fab: Add docs and autodocs tasks\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 test():\n lo... | python | chosen |
[
{
"from": "system",
"value": "Fix monkey patch test condition.\n"
},
{
"from": "human",
"value": "# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n\n\"\"\"\nTests for ``flocker.provision._ssh._monkeypatch``.\n\"\"\"\n\nfrom twisted.trial.unittest import SynchronousTestCase as TestCa... | python | chosen |
[
{
"from": "system",
"value": "Add more tests for Config\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2015 grafana-dashboard-builder contributors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance wi... | python | chosen |
[
{
"from": "system",
"value": "Test that an empty name field doesn't raise errors\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom store.forms import ReviewForm\nfrom store.models import Review\nfrom .factories import *\n\n\nclass ReviewFormTest(TestCase):\n\n def te... | python | chosen |
[
{
"from": "system",
"value": "Add install task to fab file\n"
},
{
"from": "human",
"value": "from fabric import api\n\n\ndef raspberry_pi(name):\n\tapi.env.hosts = [\"{0}.local\".format(name)]\n\tapi.env.user = 'pi'\n\n\ndef deploy():\n\tapi.require('hosts', provided_by=[raspberry_pi])\n\n\twit... | python | chosen |
[
{
"from": "human",
"value": "Add foward propagation and network initialization functions\n"
},
{
"from": "gpt",
"value": "import numpy as np\n\ndef initializeNetwork(layerSizes = [1,2,3,4,1]):\n l = len(layerSizes)\n parameters = {}\n for i in range(1,l):\n parameters['W'+str(i)]... | python | chosen |
[
{
"from": "system",
"value": "Make worker listener config backwards compat\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2016 matrix.org\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Li... | python | chosen |
[
{
"from": "system",
"value": "Set default label color to black\n"
},
{
"from": "human",
"value": "from SVGGenerator import SVGGenerator\n\n\nclass Label(SVGGenerator):\n def __init__(self, x, y, text):\n SVGGenerator.__init__(self, './label.svg.mustache')\n self.x = x\n s... | python | chosen |
[
{
"from": "system",
"value": "Test for DSU on Python\n"
},
{
"from": "human",
"value": "\nparent=[]\nsize=[]\n\ndef initialize(n):\n\tfor i in range(0,n+1):\n\t\tparent.append(i)\n\t\tsize.append(1)\n\ndef find(x):\n\tif parent[x] == x:\n\t\treturn x\n\telse:\n\t\treturn find(parent[x])\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "tests: Add another test for break-from-for-loop.\n"
},
{
"from": "human",
"value": "# Testcase for break in a for [within bunch of other code]\n# https://github.com/micropython/micropython/issues/635\n\ndef foo():\n seq = [1, 2, 3]\n v = 100\n i = 5\n wh... | python | chosen |
[
{
"from": "system",
"value": "fabric: Use sudo() function for db migration call\n"
},
{
"from": "human",
"value": "from fabric.api import env, local, cd, run\n\nenv.use_ssh_config = True\nenv.hosts = ['root@skylines']\n\n\ndef deploy(branch='master', force=False):\n push(branch, force)\n r... | python | chosen |
[
{
"from": "system",
"value": "Use repr() instead of str() for printing\n"
},
{
"from": "human",
"value": "import traceback\nimport sys\nimport logging\n\n# always print stuff on the screen:\nlogging.basicConfig(level=logging.INFO)\n\ndef log_exception(func):\n def wrapper(*args, **kwargs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix RDID reading code to ignore leading space\n"
},
{
"from": "human",
"value": "import serial\n\nclass iButton(object):\n\n def __init__(self, ibutton_address, rfid_address, debug=False):\n # self.ibutton_serial = serial.Serial(ibutton_address)\n s... | python | chosen |
[
{
"from": "system",
"value": "Remove the dumplicate top stories\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport datetime\n\nimport requests\nfrom flask import Flask, render_template, request\n\napp = Flask(__name__)\n\n\n@app.route('/')\ndef index():\n... | python | chosen |
[
{
"from": "system",
"value": "Increment version to 0.1.2 to fix pip not updating to edge\n"
},
{
"from": "human",
"value": "\nVERSION = (0, 1, 1)\n\ndef get_version():\n \"Returns the version as a human-format string.\"\n return '.'.join([str(i) for i in VERSION])\n\n"
},
{
"from":... | python | chosen |
[
{
"from": "system",
"value": "Fix URLconf for example project.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.views.static import serve\n\nurlpatterns = [\n # Examples:\n # url(r'... | python | chosen |
[
{
"from": "system",
"value": "Migrate with model from app state\n- Not from app code\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.15 on 2018-10-16 20:22\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom osf.models import ... | python | chosen |
[
{
"from": "system",
"value": "Fix production ID and run command without sudo\n"
},
{
"from": "human",
"value": "from fabric.api import (\n cd,\n env,\n put,\n sudo,\n task\n)\n\n\nPRODUCTION_IP = ''\nPROJECT_DIRECTORY = '/home/ubuntu/ztm/'\nCOMPOSE_FILE = 'compose-production.yml'\... | python | chosen |
[
{
"from": "system",
"value": "Update deployment process to use frozen requirements.\n"
},
{
"from": "human",
"value": "import os\n\nfrom fabric.api import task, run, local, sudo, cd, env\n\n\nenv.hosts = [\n os.environ['TWWEB_HOST'],\n]\n\n\ndef virtualenv(command, user=None):\n run('sourc... | python | chosen |
[
{
"from": "system",
"value": "Add fab commands to push and pull\n"
},
{
"from": "human",
"value": "from fabric.api import *\n\n\nenv.hosts = [\n\t'192.168.1.144'\n]\nenv.user = 'pi'\n\n\ndef prepare_raspberry_pi():\n\tpass\n\ndef remote_pull():\n\twith cd('virtualenvs/queen/queen'):\n\t\trun('gi... | python | chosen |
[
{
"from": "system",
"value": "Use the correct \"name\" for Jinja2 instrumentation.\n"
},
{
"from": "human",
"value": "from opbeat.instrumentation.packages.base import AbstractInstrumentedModule\n\n\nclass Jinja2Instrumentation(AbstractInstrumentedModule):\n name = 'pylibmc'\n\n instrument_... | python | chosen |
[
{
"from": "system",
"value": "Add applications to study groups\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\n# Register your models here.\nfrom studygroups.models import Course, StudyGroup, StudyGroupSignup, Application\n\nclass CourseAdmin(admin.ModelAdmin):\n pass\n... | python | chosen |
[
{
"from": "system",
"value": "Add hack experiment for issues and labels\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom github3 import login\nmytoken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'\ngh = login('xxxxx', token=mytoken)\n\nuser = gh.user()\n\nprint(user.name)\nprint... | python | chosen |
[
{
"from": "system",
"value": "Fix test_writable_stream failing in Python 3.3 and 3.4\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport io\nimport os\nimport unittest\nimport tempfile\n\ntry:\n from uni... | python | chosen |
[
{
"from": "system",
"value": "Add knot vector normalization test\n"
},
{
"from": "human",
"value": "\"\"\"\n Tests for the NURBS-Python package\n Released under The MIT License. See LICENSE file for details.\n Copyright (c) 2018 Onur Rauf Bingol\n\n Tests geomdl.utilities module. Req... | python | chosen |
[
{
"from": "system",
"value": "Use M-Lab project number for BigQuery access.\n"
},
{
"from": "human",
"value": "import httplib2\n\nfrom apiclient.discovery import build\nfrom oauth2client.client import flow_from_clientsecrets\nfrom oauth2client.file import Storage\nfrom oauth2client import tools\... | python | chosen |
[
{
"from": "system",
"value": "Use fixture for robot_arm test\n"
},
{
"from": "human",
"value": "import unittest\nimport numpy as np\nfrom numpy import pi\nimport matplotlib.pyplot as plt\n\nfrom robot_arm import RobotArm\nfrom plotting import path_figure\n\nclass TestPlotting(unittest.TestCase):... | python | chosen |
[
{
"from": "system",
"value": "Fix tests broken by new log configuration option\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nimport pytest\nfrom screen19.screen import Screen19\n\n\ndef test_screen19_command_line_help_does_not_crash():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add details of demo EC2 server.\n"
},
{
"from": "human",
"value": "from fabric.api import *\n\n\"\"\"\nDefine the server environments that this app will be deployed to.\nEnsure that you have SSH access to the servers for the scripts in 'fabfile.py' to work.\n\"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Solve 1000 digit fib number\n"
},
{
"from": "human",
"value": "'''\nProblem 025\n\nThe Fibonacci sequence is defined by the recurrence relation:\n\nFn = Fnβ1 + Fnβ2, where F1 = 1 and F2 = 1.\nHence the first 12 terms will be:\n\nF1 = 1\nF2 = 1\nF3 = 2\nF4 = 3\nF5 = ... | python | chosen |
[
{
"from": "system",
"value": "Fix order of migration in operations\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.22 on 2019-10-31 16:33\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, OperationalError, ProgrammingError\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Fix check for accounts.py file in system tests.\n"
},
{
"from": "human",
"value": "# This file contains pytest fixtures as well as some config\n\nAPI_BASE = \"http://localhost:5555/n/\"\nTEST_MAX_DURATION_SECS = 240\nTEST_GRANULARITY_CHECK_SECS = 0.1\n\n# we don't w... | python | chosen |
[
{
"from": "system",
"value": "Fix the index dumper code\n"
},
{
"from": "human",
"value": "\"\"\"This is a script to dump all the corpora on S3 into an index file.\"\"\"\n\nimport boto3\n\nres = s3.list_objects(Bucket='world-modelers', Prefix='indra_models')\ns3 = boto3.session.Session(profile_n... | python | chosen |
[
{
"from": "system",
"value": "Update to version 1.2.0 - version needed for exoplanet data challenge\n"
},
{
"from": "human",
"value": "__version__ = \"1.1.3\"\n\nfrom . import preproc\nfrom . import config\nfrom . import fits\nfrom . import invprob\nfrom . import psfsub\nfrom . import fm\nfrom .... | python | chosen |
[
{
"from": "system",
"value": "FEAT: Add custom conv layer module\n"
},
{
"from": "human",
"value": "import torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n################################################################################\n# ... | python | chosen |
[
{
"from": "system",
"value": "Return a dictionary for transcription/translation services (instead of list)\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom collections import defaultdict, OrderedDict\n\nfrom django.db import models\nfrom rest_framework import serializers\n\n\nclass BaseS... | python | chosen |
[
{
"from": "system",
"value": "Refactor building command using join()\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 oper... | python | chosen |
[
{
"from": "system",
"value": "Fix check for valid resolver_match\n"
},
{
"from": "human",
"value": "from django.template import Library\nfrom django.template.defaulttags import URLNode, url\nfrom django.utils.html import escape, mark_safe\n\nregister = Library()\n\n\nclass MenuLINode(URLNode):\n... | python | chosen |
[
{
"from": "system",
"value": "Use the HTMLParser module instead of htmllib\n"
},
{
"from": "human",
"value": "import plugin\nimport urllib2\nimport logging\nimport re\n\nfrom httplib import HTTPException\nfrom htmllib import HTMLParser\n\nclass Plugin(plugin.baseplugin):\n def __init__(self, ... | python | chosen |
[
{
"from": "system",
"value": "Append app path to Python path in WSGI\n"
},
{
"from": "human",
"value": "\"\"\"\nWSGI config for federez_ldap project.\n\nThis module contains the WSGI application used by Django's development server\nand any production WSGI deployments. It should expose a module-l... | python | chosen |
[
{
"from": "system",
"value": "Update BaseTest class (removing registry).\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.test import TestCase\n\nfrom ..registry import LinguistRegistry as Registry\nfrom ..models import Translation\n\nfrom . import settings\nfrom .translat... | python | chosen |
[
{
"from": "system",
"value": "Fix test issue with mocking import for Python 3\n"
},
{
"from": "human",
"value": "from mock import patch\n\nfrom turbodbc.cursor import _has_numpy_support\n\n\ndef test_has_numpy_support_fails():\n with patch('__builtin__.__import__', side_effect=ImportError):\n... | python | chosen |
[
{
"from": "system",
"value": "Make `refresh` return self for chaining actions\n"
},
{
"from": "human",
"value": "\nclass APIObject(object):\n\n def __init__(self, client, json_data):\n super(APIObject, self).__init__()\n self.client = client\n self._data = json_data\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Set __version__ to 0.9.1 for release.\n"
},
{
"from": "human",
"value": "\n__version__ = '0.9.1.dev0'\n__author__ = 'Bruno Rocha'\n__email__ = 'rochacbruno@gmail.com'\n\n\nfrom jsonschema import ValidationError # noqa\nfrom .base import Swagger, Flasgger, NO_SANITI... | python | chosen |
[
{
"from": "system",
"value": "Use sys.executable as the default python executable\n"
},
{
"from": "human",
"value": "import json\nimport logging\nimport os\n\n\nlog_format = \"[{levelname}][{name}] {message}\"\n\n\ndef configure_logging(log_level):\n\tlogging.basicConfig(level = log_level, forma... | python | chosen |
[
{
"from": "system",
"value": "Use or operator in python to tidy up completion building.\n"
},
{
"from": "human",
"value": "import vim, syncrequest, types\nclass Completion:\n def get_completions(self, column, partialWord):\n parameters = {}\n parameters['column'] = vim.eval(colu... | python | chosen |
[
{
"from": "system",
"value": "Add explicit xml export options (indent, new line and encoding)\n"
},
{
"from": "human",
"value": "from xml.dom.minidom import parseString\n\nfrom django.http import HttpResponse\n\n\nclass XMLResponse(HttpResponse):\n\n def __init__(self, xml, name=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use the new tools/clean_output_directory.py script for clobbering builders.\n\nThis will unify our clobbering functionality across builders that use annotated steps and builders with test setup in the buildbot source.\nTBR=foo\n\nReview URL: https://chromiumcodereview.appspot.c... | python | chosen |
[
{
"from": "system",
"value": "Make temp dirs for each scenario.\n"
},
{
"from": "human",
"value": "import os\nimport shutil\nimport tempfile\n\n\ndef before_all(context):\n context.starting_dir = os.getcwd()\n context.temp_dir = tempfile.mkdtemp()\n os.chdir(context.temp_dir)\n\n\ndef a... | python | chosen |
[
{
"from": "system",
"value": "Fix build errors with Python <3.6\n\nThe `ModuleNotFoundError` was introduced in Python 3.6.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# The MIT License (MIT)\n#\n# Copyright Β© 2014-2016 Tim Bielawa <timbielawa@gmail.com>\n# See GitHub Contributors... | python | chosen |
[
{
"from": "system",
"value": "Fix instantiating the preparation when plug-ins are done loading\n\nThe new position of the state variable.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#-*- coding: utf-8 -*-\n\n#This software is distributed under the Creative Commons license (CC0) ver... | python | chosen |
[
{
"from": "system",
"value": "Add simple company form routes\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nimport views\n\nurlpatterns = [\n # urls begin with /client/\n\n url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing curren... | python | chosen |
[
{
"from": "system",
"value": "Remove an extra global variable in xorcise package\n"
},
{
"from": "human",
"value": "import curses\n\nfrom .character import Character\nfrom .console import Console\nfrom .line import Line\nfrom .attribute import RenditionAttribute, ColorAttribute\nfrom .misc impor... | python | chosen |
[
{
"from": "system",
"value": "Increase version for release candidate\n"
},
{
"from": "human",
"value": "__version__ = '0.14.0'\n\nfrom dicomweb_client.api import DICOMwebClient\n"
},
{
"from": "gpt",
"value": "__version__ = '0.20.0rc'\n\nfrom dicomweb_client.api import DICOMwebClient... | python | chosen |
[
{
"from": "system",
"value": "Fix np array issues again\n"
},
{
"from": "human",
"value": "import logging\n\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\nfrom ..utils import Timer\n\n__all__ = ['PureTransformer', 'identity']\n\n\nlogger = logging.getLogger(__... | python | chosen |
[
{
"from": "system",
"value": "Install as a script as well\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom distutils.core import setup\n\nVERSION = \"2.00\"\n\nsetup(\n name = \"SocksipyChain\",\n version = VERSION,\n description = \"A Python SOCKS/HTTP Proxy module\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the failing dns test on Windows\n\nGets the name of the first interface on the system. Windows network\ninterfaces don't have the same name across Window systems. YOu can even\ngo as far as naming them whatever you want. The test was failing because\nthe interface name was ... | python | chosen |
[
{
"from": "system",
"value": "Make backing up to S3 use a year/month/date structure for backups, for S3 clients that 'fake' directory structures.\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.core.management.base import BaseCommand\nfrom django.conf import settings\n\nfrom fabtasti... | python | chosen |
[
{
"from": "system",
"value": "Fix broken imports after file namechange\n"
},
{
"from": "human",
"value": "from test_app.tests.generator import *\nfrom test_app.tests.factory import *\nfrom test_app.tests.utils import *\n"
},
{
"from": "gpt",
"value": "from test_app.tests.test_generat... | python | chosen |
[
{
"from": "system",
"value": "Convert the list to a tuple\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom . import utils\nfrom .main import Centerline\n\n__all__ = ['utils', 'Centerline']\n"
},
{
"from": "gpt",
"value": "#... | python | chosen |
[
{
"from": "system",
"value": "Store last github commit in `events` table\n"
},
{
"from": "human",
"value": "import sqlite3\nfrom flask import Flask, jsonify\napp = Flask(__name__)\n\n\ndef get_db():\n return sqlite3.connect(\":memory:\")\n\n@app.route(\"/status\")\ndef status():\n return j... | python | chosen |
[
{
"from": "system",
"value": "ADMIN: Add list filter for searching\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom clowder_account.models import ClowderUser, ClowderUserAdmin\nfrom clowder_server.models import Alert, Ping\n\nadmin.site.register(Alert)\nadmin.site.regist... | python | chosen |
[
{
"from": "system",
"value": "Fix missing dependency on core.0059 migration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.29 on 2021-10-13 15:57\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef set_about_plugin_to_hpe(... | python | chosen |
[
{
"from": "system",
"value": "Add a note if no emails are available to send\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom nightreads.emails.models import Email\nfrom nightreads.emails.email_service import send_email_obj\nfrom nightreads.emails.views... | python | chosen |
[
{
"from": "system",
"value": "Fix buggy patched QuerySet methods\n"
},
{
"from": "human",
"value": "# This file is part of e-GieΕda.\n# Copyright (C) 2014 Mateusz MaΔkowski and Tomasz ZieliΕski\n#\n# e-GieΕda is free software: you can redistribute it and/or modify\n# it under the terms of the G... | python | chosen |
[
{
"from": "system",
"value": "Remove logging. It will just break travis.\n"
},
{
"from": "human",
"value": "from api.caching.tasks import ban_url, logger\nfrom framework.guid.model import Guid\nfrom framework.tasks.handlers import enqueue_task\nfrom modularodm import signals\n\n@signals.save.con... | python | chosen |
[
{
"from": "system",
"value": "Add header and footer sections to the .sty.\n"
},
{
"from": "human",
"value": "import re\n\n# Input file created from http://astronautweb.co/snippet/font-awesome/\nINPUT_FILE = 'htmlfontawesome.txt'\nOUTPUT_FILE = 'fontawesome.sty'\n\nwith open(INPUT_FILE) as r, ope... | python | chosen |
[
{
"from": "system",
"value": "Refactor DNZ fetch script before overhaul\n"
},
{
"from": "human",
"value": "import os\nimport math\nimport json\n\nfrom pprint import pprint\nfrom pydnz import Dnz\n\ndnz = Dnz(os.environ.get('DNZ_KEY'))\n\nresults = []\n\n\ndef dnz_request(page=1):\n filters = ... | python | chosen |
[
{
"from": "system",
"value": "Fix import and tokenizer exceptions\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom ...language import Language\nfrom ...attrs import LANG\nfrom ...fr.language_data import get_tokenizer_exceptions, STOP_WORDS\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Add UniqueMixin import to init\n"
},
{
"from": "human",
"value": "__title__ = 'DRF writable nested'\n__version__ = '0.4.3'\n__author__ = 'beda.software'\n__license__ = 'BSD 2-Clause'\n__copyright__ = 'Copyright 2014-2018 beda.software'\n\n# Version synonym\nVERSION ... | python | chosen |
[
{
"from": "system",
"value": "Add a hack for fixing failing tests\n\nThough it might actually be a proper fix. Need to talk to Nikita.\n"
},
{
"from": "human",
"value": "import tempfile\nimport unittest\nimport os\nfrom server import app\nfrom server.models import db\n\n\nclass BaseTestCase(unit... | python | chosen |
[
{
"from": "system",
"value": "Switch to Blueprints, custom 404 handler.\n"
},
{
"from": "human",
"value": "# -*- encoding:utf-8 -*-\nfrom flask import Flask\nfrom cyclonejet.views.frontend import frontend\nfrom flaskext.sqlalchemy import SQLAlchemy\nimport settings\n\n\napp = Flask(__name__)\nap... | python | chosen |
[
{
"from": "system",
"value": "Change exception message to be same as stdlib.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nfrom fastpbkdf2._fastpbkdf2 import ffi, lib\n\n\ndef pbkdf2_hmac(name, password, salt, rounds, dklen=None):\n if ... | python | chosen |
[
{
"from": "system",
"value": "Add ``remove`` flag to DecoratorScope\n"
},
{
"from": "human",
"value": "from dodo_commands.framework.singleton import Dodo\n\n\n# Resp: add the current command_name\n# to the list of commands decorated by decorator_name.\nclass DecoratorScope:\n def __init__(sel... | python | chosen |
[
{
"from": "system",
"value": "Make sure we auto-connect to the IDL server\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport actorcore.ICC\n\nclass OurActor(actorcore.ICC.ICC):\n def __init__(self, name,\n productName=None, configFile=None,\n mo... | python | chosen |
[
{
"from": "system",
"value": "Add a skiptest to support PY34 testing\n\nThe third party astkit library does not yet support the latest\nPY34 changes to the ast module. Until this is resolved the PY34\ntests will skip any use of that library.\n\nSigned-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54... | python | chosen |
[
{
"from": "system",
"value": "Add doc comment to nwod lint tests\n"
},
{
"from": "human",
"value": "import npc\nimport pytest\nimport os\nfrom tests.util import fixture_dir\n\ndef test_has_virtue():\n char_file = fixture_dir('linter', 'nwod', 'Has Virtue.nwod')\n with open(char_file, 'r') ... | python | chosen |
[
{
"from": "system",
"value": "Increment version for minor release\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright (c) 2016 Randal S. Olson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software\nand associated documentatio... | python | chosen |
[
{
"from": "system",
"value": "Make ProposalAdmin work when creating\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.contenttypes.admin import GenericTabularInline\n\nfrom import_export.admin import ExportMixin\n\nfrom .models import AdditionalSpeaker, Tal... | python | chosen |
[
{
"from": "system",
"value": "Handle removal; keep track of devices and info\n"
},
{
"from": "human",
"value": "import re\nfrom subprocess import Popen, PIPE, STDOUT\nfrom sys import stdout\n\n\np = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE,\n stderr=STDOUT, bufsi... | python | chosen |
[
{
"from": "system",
"value": "Send methods need to return the result\n\nSigned-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>\n"
},
{
"from": "human",
"value": "class AbstractObject(object):\n \n def __init__(self):\n pass\n \n def send(self,... | python | chosen |
[
{
"from": "system",
"value": "Add sync trigger to latest migration\n"
},
{
"from": "human",
"value": "\"\"\"empty message\n\nRevision ID: 2f3192e76e5\nRevises: 3dbc20af3c9\nCreate Date: 2015-11-24 15:28:41.695124\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '2f3192e76e5'\ndo... | python | chosen |
[
{
"from": "system",
"value": "Add the blacklist checking to the bulk\n"
},
{
"from": "human",
"value": "from datetime import timedelta\n\nCELERYBEAT_SCHEDULE = {\n \"reddit-validations\": {\n \"task\": \"reddit.tasks.process_validations\",\n \"schedule\": timedelta(minutes=10),\... | python | chosen |
[
{
"from": "system",
"value": "Simplify the AutoUserModes mode type check\n"
},
{
"from": "human",
"value": "from twisted.plugin import IPlugin\nfrom txircd.module_interface import IModuleData, ModuleData\nfrom txircd.utils import ModeType\nfrom zope.interface import implements\n\nclass AutoUserM... | python | chosen |
[
{
"from": "system",
"value": "Stop requiring psycopg2 to run tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os, sys, re, shutil\nos.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'\n\n\n# Use psycopg2cffi for PyPy\ntry:\n import psycopg2 # noqa\nexcept ImportError... | python | chosen |
[
{
"from": "system",
"value": "Move 'application' outside of if '__main__' -.-\n"
},
{
"from": "human",
"value": "if __name__ == \"__main__\":\n from plenario import create_app\n application = create_app()\n application.run(host=\"0.0.0.0\")\n"
},
{
"from": "gpt",
"value": "f... | python | chosen |
[
{
"from": "system",
"value": "Add comment with link to more info\n"
},
{
"from": "human",
"value": "\"\"\"GO-DAG constants.\"\"\"\n\n__copyright__ = \"Copyright (C) 2010-2018, DV Klopfenstein, H Tang, All rights reserved.\"\n__author__ = \"DV Klopfenstein\"\n\n\n# pylint: disable=too-few-public-... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.