conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix logging bug in gui module introduced in earlier commit.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2016 The Regents of the University of Michigan\n# All rights reserved.\n# This software is licensed under the BSD 3-Clause License.\n\"\"\"Graphical User I... | python | chosen |
[
{
"from": "system",
"value": "Fix example outside the admin\n"
},
{
"from": "human",
"value": "try:\n from django.urls import reverse_lazy\nexcept ImportError:\n from django.core.urlresolvers import reverse_lazy\nfrom django.forms import inlineformset_factory\nfrom django.views import gene... | python | chosen |
[
{
"from": "system",
"value": "chore: Drop another Python 2 shim\n"
},
{
"from": "human",
"value": "from unittest.mock import patch\n\nimport pytest\n\nfrom .core import PostmarkClient, requests\n\n\n@pytest.yield_fixture\ndef postmark_request():\n \"\"\"Mocks network requests to Postmark API.... | python | chosen |
[
{
"from": "system",
"value": "Add a bit of documentation on what AsyncCommand is.\n"
},
{
"from": "human",
"value": "from collections import namedtuple\nfrom django.core.management.base import BaseCommand\n\n\nProgress = namedtuple('Progress', ['progress', 'overall'])\n\n\nclass AsyncCommand(Bas... | python | chosen |
[
{
"from": "system",
"value": "Add AWS::CodeStarConnections::Connection props, per May 14, 2020 update\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012-2020, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\n\nfrom . import AWSObject\n\n\nVALID_C... | python | chosen |
[
{
"from": "system",
"value": "Refactor code to eliminate O(n) hard-coding.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#import sys\n#reload(sys)\n#sys.setdefaultencoding(\"utf-8\")\n\nimport os\nimport random\nfrom io import open\n\ncurses_en = os.path.jo... | python | chosen |
[
{
"from": "system",
"value": "Remove commented code for the mo\n"
},
{
"from": "human",
"value": "class Listener:\n \"\"\"Always invokes the handler.\"\"\"\n def __init__(self, handler):\n self.handler = handler\n\n def handle(self, connection, message):\n self.handler(con... | python | chosen |
[
{
"from": "system",
"value": "Update path to save to mnt dir\n"
},
{
"from": "human",
"value": "from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport subprocess\n\nif __name__ == \"__main__\":\n import argparse\n parser = a... | python | chosen |
[
{
"from": "system",
"value": "Make trailing slash on login view non-optional\n\nThis was causing the UI tests to fail\n"
},
{
"from": "human",
"value": "from django.conf.urls import include\nfrom django.conf.urls import url\nfrom django.contrib.auth.views import login\nfrom django.views.generic.... | python | chosen |
[
{
"from": "system",
"value": "Add secret key to env viarables\n"
},
{
"from": "human",
"value": "import os\n\n\nclass MainConfig(object):\n DEBUG = False\n WTF_CSRF_ENABLED = True\n SQLALCHEMY_TRACK_MODIFICATIONS = False\n # Will generate a random secret key with a sequence of random... | python | chosen |
[
{
"from": "system",
"value": "Add tilde to url lookup for recipient slugs"
},
{
"from": "human",
"value": "from functools import wraps\n\nfrom django.conf.urls import patterns, url\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views.decorators.cache import cache_page\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Remove output_temp.h5 only if it exists\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nimport os\n\nfrom testcases import sim_files\nfrom cyclus_tools import run_cyclus, db_comparator\n\n\"\"\"Tests\"\"\"\ndef test_cyclus():\n \"\"\"Test for all inp... | python | chosen |
[
{
"from": "system",
"value": "Fix bool logic in mask test & add test criteria\n"
},
{
"from": "human",
"value": "import numpy as np\nimport pytest\nimport yatsm._cyprep as cyprep\n\n\ndef test_get_valid_mask():\n n_bands, n_images, n_mask = 8, 500, 50\n data = np.random.randint(0, 10000,\n... | python | chosen |
[
{
"from": "system",
"value": "Add test for finalize method.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\nimport os\n\nimport pytest\n\nfrom pymt import models\n\n\n@pytest.mark.parametrize(\"cls\", models.__all__)\ndef test_model_setup(cls):\n model = models.__dict__[cls]()\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove old default api_key logic in __init__.\n"
},
{
"from": "human",
"value": "import datetime\nimport urllib\nimport json\n\nclass WmataError(Exception):\n pass\n\nclass Wmata(object):\n\n api_url = 'http://api.wmata.com/%(svc)s.svc/json/%(endpoint)s'\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix duplicates in asset import\n\nIt relied on the unique constraint from the database, but it doesn't apply if\nparent_id is null. So it checks the existence of the asset before inserting it.\n"
},
{
"from": "human",
"value": "from zou.app.resources.source.csv.base... | python | chosen |
[
{
"from": "system",
"value": "Add ShortUserRetrieve and LongUserRetrieve serializers\n"
},
{
"from": "human",
"value": "from ovp_users.serializers.user import UserCreateSerializer\nfrom ovp_users.serializers.user import UserUpdateSerializer\nfrom ovp_users.serializers.user import CurrentUserSeri... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in objectified name\n"
},
{
"from": "human",
"value": "from lxml.objectify import fromstring\n\n\nclass BaseMessage(object):\n \"\"\"\n Base XML message.\n \"\"\"\n def __init__(self, xml):\n \"\"\"\n Create an object of BaseMessag... | python | chosen |
[
{
"from": "system",
"value": "Make test work with 1.7\n"
},
{
"from": "human",
"value": "\"\"\"\nTests for the RAW sql functions.\n\"\"\"\n\nfrom django.conf import settings\nfrom django.test import TestCase\nfrom django.db.models import connection\n\nfrom boardinghouse.models import Schema\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Add to doc string: time complexity\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef selection_sort(a_list):\n \"\"\"Selection Sort algortihm.\n\n Procedur... | python | chosen |
[
{
"from": "system",
"value": "Move status into initial check; fails when instance is stopped already\n"
},
{
"from": "human",
"value": "# License under the MIT License - see LICENSE\n\nimport boto.ec2\nimport os\nimport time\n\n\ndef launch(key_name=None, region='us-west-2', image_id='ami-5189a6... | python | chosen |
[
{
"from": "system",
"value": "Revise tower of hanoi alg from Yuanlin\n"
},
{
"from": "human",
"value": "\"\"\"The tower of Hanoi.\"\"\"\nfrom __future__ import print_function\n\n\ndef move_towers(height, from_pole, to_pole, with_pole):\n if height == 1:\n print('Moving disk from {0} to... | python | chosen |
[
{
"from": "system",
"value": "Add support for tern complete_strings plugin\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport json\nimport os.path\n\nfrom completor import Completor\nfrom completor.compat import to_unicode\n\ndirname = os.path.dirname(__file__)\n\n\nclass Tern(... | python | chosen |
[
{
"from": "system",
"value": "Add visibility tagging to MethoDefinition\n"
},
{
"from": "human",
"value": "from thinglang.lexer.definitions.tags import LexicalPrivateTag\nfrom thinglang.lexer.definitions.thing_definition import LexicalDeclarationMember\nfrom thinglang.lexer.values.identifier imp... | python | chosen |
[
{
"from": "system",
"value": "Fix path addition in vendor-wsgi.py.\n"
},
{
"from": "human",
"value": "\"\"\" \nAlternative WSGI entry-point that uses requirements/vendor for\ndependencies.\n\n\"\"\"\nimport os, sys\n\nbase_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nsys.pa... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.14.2\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.14.1\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"... | python | chosen |
[
{
"from": "system",
"value": "Standardize approval Orch Actions docstrings\n\n[DEV-12140]\n"
},
{
"from": "human",
"value": "\"\"\"\nTwo User Approval\n\nOverrides CloudBolt's standard Order Approval workflow. This Orchestration\nAction requires two users to approve an order before it becomes Ac... | python | chosen |
[
{
"from": "system",
"value": "Add source and destination list to setup and teardown\n"
},
{
"from": "human",
"value": "import unittest\nimport os\nimport shutil\n\nclass testMirror(unittest.TestCase):\n\n def setUp(self):\n os.mkdir('test_source')\n os.mkdir('test_dest')\n ... | python | chosen |
[
{
"from": "system",
"value": "Add ability to get calibre db\n"
},
{
"from": "human",
"value": "from django.core.exceptions import ObjectDoesNotExist\nfrom django.core.management.base import NoArgsCommand\nfrom django.conf import settings\nfrom django_dropbox.storage import DropboxStorage\nfrom d... | python | chosen |
[
{
"from": "system",
"value": "Use only the base file name for key\n\n\nFormer-commit-id: 3acbf9e93d3d501013e2a1b6aa9631bdcc663c66 [formerly eea949727d3693aa032033d84dcca3790d9072dd] [formerly ca065bc9f78b1416903179418d64b3273d437987]\nFormer-commit-id: 58c1d18e8960ad3236a34b8080b18ccff5684eaa\nFormer-commit... | python | chosen |
[
{
"from": "system",
"value": "Increase size of large source tree 10x\n\n- up to 1000 source files\n- use parallel make\n- preserve source tree\n"
},
{
"from": "human",
"value": "import unittest\nfrom yeast_harness import *\n\n\nclass TestLargeSourceTree(unittest.TestCase):\n\n def test_large_... | python | chosen |
[
{
"from": "system",
"value": "Add space before inline comment\n"
},
{
"from": "human",
"value": "from yacs.settings.base import *\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nCACHES = {\n 'default': {\n 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',\n 'VERSION': CACHE_V... | python | chosen |
[
{
"from": "system",
"value": "Add time.sleep after binding publisher to give subscribers time to (re-)connect.\n"
},
{
"from": "human",
"value": "import json\nimport logging\nimport time\nfrom datetime import datetime\n\nimport zmq\nfrom django.conf import settings\nfrom django.core.management.b... | python | chosen |
[
{
"from": "system",
"value": "Add files to the exported names.\n"
},
{
"from": "human",
"value": "\"\"\"Read resources contained within a package.\"\"\"\n\nimport sys\n\n\n__all__ = [\n 'Package',\n 'Resource',\n 'ResourceReader',\n 'contents',\n 'is_resource',\n 'open_binary',... | python | chosen |
[
{
"from": "system",
"value": "Add SecureModeNeeded property to PayInExecutionDetailsDirect"
},
{
"from": "human",
"value": "from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails\n\n\nclass PayInExecutionDetailsDirect(PayInExecutionDetails):\n \n def __init__(self):\... | python | chosen |
[
{
"from": "system",
"value": "Add method to create tempfile with content easily\n"
},
{
"from": "human",
"value": "import subprocess32 as subprocess\nimport threading\nimport signal\n\ndef external_process(process_args, input_data='', timeout=None):\n '''\n Pipes input_data via stdin to the ... | python | chosen |
[
{
"from": "system",
"value": "Add test for reaching API health endpoint\n"
},
{
"from": "human",
"value": "import json\nfrom indra.literature.dart_client import _jsonify_query_data\n\n\ndef test_timestamp():\n # Should ignore \"after\"\n assert _jsonify_query_data(timestamp={'on': '2020-01... | python | chosen |
[
{
"from": "system",
"value": "Clean up python script and make it run in linear time.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nimport argparse\nimport re\n\nformat = list('''\n -- --\n-----------\n-----------\n----------\n--------\n-------\n-- --\n-----------\n'''[1:-1])\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Fix DB to fit new requirements\n"
},
{
"from": "human",
"value": "from sqlalchemy import Column, String, ForeignKey\nfrom sqlalchemy.orm import relationship, backref\n\nfrom neutron.db.model_base import BASEV2\nfrom neutron.db.models_v2 import HasId\n\n\nclass Datac... | python | chosen |
[
{
"from": "system",
"value": "[redis] Set the encoding parameter in Redis constructor\n"
},
{
"from": "human",
"value": "from frasco.ext import *\nfrom redis import StrictRedis\nfrom werkzeug.local import LocalProxy\nfrom .templating import CacheFragmentExtension\n\n\nclass FrascoRedis(Extension... | python | chosen |
[
{
"from": "system",
"value": "Change the motionactivity formatter to match the new version of the google play library\n\nWe bumped up the play version number in\nhttps://github.com/e-mission/e-mission-data-collection/commit/a93bc993ddcc1e78ab7fc15e6c9a588ce28a5e45\nwhich will change the fields that show up ... | python | chosen |
[
{
"from": "system",
"value": "Fix command line argument construction\n\nBoolean values not parsed correctly\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nfile: gromacs_gromit.py\n\nPrepaire gromit command line input\n\"\"\"\n\nGROMIT_ARG_DICT = {\n 'forcefield': '-ff',... | python | chosen |
[
{
"from": "system",
"value": "Add a test that reproduces the crash if you sign up a second time with the same name\n"
},
{
"from": "human",
"value": "from debexpo.tests import TestController, url\nfrom debexpo.model import meta\nfrom debexpo.model.users import User\n\nclass TestRegisterControlle... | python | chosen |
[
{
"from": "system",
"value": "Raise error on bad alpha value\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom random import betavariate, uniform\n\n\ndef weighted_choice(weights):\n choices = range(len(weights))\n total = sum(weights)\n r = uniform(0, total)\n upto ... | python | chosen |
[
{
"from": "system",
"value": "Add new versions of Postgres\n"
},
{
"from": "human",
"value": "from stacker.blueprints.rds import base\n\n\nclass PostgresMixin(object):\n def engine(self):\n return \"postgres\"\n\n def get_engine_versions(self):\n return ['9.3.1', '9.3.2', '9.... | python | chosen |
[
{
"from": "system",
"value": "Use different assert for Python 2 v 3"
},
{
"from": "human",
"value": "import unittest\n\nfrom HARK.validators import non_empty\n\nclass ValidatorsTests(unittest.TestCase):\n '''\n Tests for validator decorators which validate function arguments\n '''\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add validator to initial user migration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nfrom django.conf import settings\n\n\nclass Migration(migrations.Migration):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update policy names in test\n"
},
{
"from": "human",
"value": "import os\nimport shutil\nfrom .datasets import Dataset\nfrom mclearn.experiment import ActiveExperiment\n\nclass TestExperiment:\n @classmethod\n def setup_class(cls):\n cls.data = Dataset(... | python | chosen |
[
{
"from": "system",
"value": "Add init for empty query response\n"
},
{
"from": "human",
"value": "\n\nfrom vertica_python.vertica.messages.message import BackendMessage\n\n\nclass EmptyQueryResponse(BackendMessage):\n pass\n\n\nEmptyQueryResponse._message_id(b'I')\n"
},
{
"from": "gp... | python | chosen |
[
{
"from": "system",
"value": "Add processcalaccessdata to update routine\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nUpdate to the latest CAL-ACCESS snapshot and bake static website pages.\n\"\"\"\nimport logging\nfrom django.core.management import ... | python | chosen |
[
{
"from": "system",
"value": "Add python 3.6 to the list of supported versions\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\n\nsetup(\n name='validation',\n url='https://github.com/JOIVY/validation',\n version='0.1.0',\n author='Ben Mather',\n a... | python | chosen |
[
{
"from": "system",
"value": "Use egg attribute of the links\n\nTo correct install it you must do:\n$ python setup.py install\nor\n$ pip install --process-dependency-links bankbarcode\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nset... | python | chosen |
[
{
"from": "system",
"value": "Add support for Python 3.5\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nfrom setuptools import setup\nfrom oauth2 import VERSION\n\nif sys.version_info < (3, 0, 0):\n memcache_require = \"python-memcached\"\nelse:\n memcache_require = \"python3-... | python | chosen |
[
{
"from": "system",
"value": "Fix capitalization of datacats to match command name.\n"
},
{
"from": "human",
"value": "from clint.textui import colored\n\n\nclass DatacatsError(Exception):\n\n def __init__(self, message, format_args=(), parent_exception=None):\n self.message = message\... | python | chosen |
[
{
"from": "system",
"value": "Upgrade to an EditorFactory, so Custom, Text, and Readonly can be written.\n"
},
{
"from": "human",
"value": "#------------------------------------------------------------------------------\n#\n# Copyright (c) 2008, Enthought, Inc.\n# All rights reserved.\n# \n# ... | python | chosen |
[
{
"from": "system",
"value": "Add get raw key from KeyPair\n"
},
{
"from": "human",
"value": "import base64\n\nimport sha3\nimport os\n\nfrom collections import namedtuple\n\n\nclass KeyPair:\n def __init__(self, pub, pri):\n self.private_key = pri\n self.public_key = pub\n\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Add in an item to check for combined notifications\n"
},
{
"from": "human",
"value": "import json\nimport logging\nimport requests\nfrom requests.exceptions import RequestException, ConnectionError, HTTPError\nimport sys\nfrom grading_service import GradingService\n... | python | chosen |
[
{
"from": "system",
"value": "Use os.path.join to join paths. Use relative paths.\n"
},
{
"from": "human",
"value": "'''\nCreated on 03.02.2016.\n\n@author: Lazar\n'''\nfrom textx.metamodel import metamodel_from_file\n\nfrom concepts.layout import Layout\nfrom concepts.object import Object\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Update decorator to optionally include DirtyFieldsMixin\n\nUpdate logic so the class is skipped if it hasattr get_dirty_fields\n\n* Release 0.1.7\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\n__version__ = '0.1.6'\nde... | python | chosen |
[
{
"from": "system",
"value": "Create working constant volume reactor test\n"
},
{
"from": "human",
"value": "#! /usr/bin/python3\n\nprint('Test')\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/python3\nimport cantera as ct\ngas = ct.Solution('mech.cti')\ngas.TPX = 1000,101325,'H2:2,O2:... | python | chosen |
[
{
"from": "system",
"value": "Use transactions to make sure cleangeometry function sticks\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand, AppCommand\nfrom django.db import connection, transaction\nimport os\n\nclass Command(BaseCommand):\n help = \"Inst... | python | chosen |
[
{
"from": "system",
"value": "Print SQLAlchemy exceptions to stdout and reraise\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n Task entry points\n\"\"\"\nfrom sqlalchemy.exc import SQLAlchemyError\nfrom action import scanner\nfrom helpers import make_config, make_session... | python | chosen |
[
{
"from": "system",
"value": "Break out DB setup separately, enable debug\n"
},
{
"from": "human",
"value": "import logging\n\nimport chryso.connection\nimport flask\n\nimport dominus.tables\nimport dominus.views\n\n\ndef run():\n logging.basicConfig()\n logging.getLogger().setLevel(loggin... | python | chosen |
[
{
"from": "system",
"value": "Add api url to default env vars\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\nfrom scheduler.spawners.templates.env_vars import get_from_app_secret\n\n\ndef get_service_env_vars():\n return [\n get_from_app_secret('POLYAXON_SECRET_... | python | chosen |
[
{
"from": "system",
"value": "Move Pillow to tests requirements\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nimport sys\n\nreqs = [\n \"decorator>=3.3.2\",\n \"Pillow>=2.5.0\"\n]\nif sys.version_info[0] == 2:\n # simplejson is not python3 compatible\n ... | python | chosen |
[
{
"from": "system",
"value": "Use README in long description.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nversion = '1.0a1'\n\nsetup(name='pystunnel',\n version=version,\n description='Python interface to stunnel',\n #long_description=open('RE... | python | chosen |
[
{
"from": "system",
"value": "Read long description from README.rst\n"
},
{
"from": "human",
"value": "# -*- encoding: UTF-8 -*\nfrom setuptools import setup\n\nwith open('README.md') as fp:\n README = fp.read()\n\nsetup(\n name='steeve',\n version='0.1',\n author='Sviatoslav Abakumo... | python | chosen |
[
{
"from": "system",
"value": "Change the version number to 0.2.0\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(name='programmabletuple',\n version='0.1',\n description='Python metaclass for making named tuples with programmability',\n... | python | chosen |
[
{
"from": "system",
"value": "Use official Flask-Script distribution (>= 0.3.2)\n"
},
{
"from": "human",
"value": "\"\"\"\nFlask-Celery\n------------\n\nCelery integration for Flask\n\n\"\"\"\nfrom setuptools import setup\n\nsetup(\n name='Flask-Celery',\n version='2.4.1',\n url='http:/... | python | chosen |
[
{
"from": "system",
"value": "Correct the packaging of packages on winsys\n\nmodified setup.py\n"
},
{
"from": "human",
"value": "from distutils.core import setup\r\n\r\nimport winsys\r\n\r\nif __name__ == '__main__':\r\n setup (\r\n name='WinSys',\r\n version=winsys.__version__,\r\... | python | chosen |
[
{
"from": "system",
"value": "Use contents of README as long_description\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom setuptools import setup\nfrom ipyrmd import __version__\n\nsetup(name=\"ipyrmd\",\n version=__version__,\n description=\"Convert between IPython/Ju... | python | chosen |
[
{
"from": "system",
"value": "Fix the numpy include path used by the Cython extension\n\nApparently this only worked because I had numpy installed system-wide\n(broke on virtualenv-only installs).\n"
},
{
"from": "human",
"value": "import sys\nfrom distutils.core import setup\nfrom distutils.ext... | python | chosen |
[
{
"from": "system",
"value": "Add sorl-thumbnail and Django as installation requirements.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding: utf-8\nfrom setuptools import find_packages, setup\n\nsetup(\n name=\"django-flexible-images\",\n version=\"1.0.0\",\n url=\"http... | python | chosen |
[
{
"from": "system",
"value": "Rename project name to realexpayments\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='realex-client',\n version='0.8.0',\n packages=['realexpayments'],\n url='https://github.com/viniciuschiele/realex-client',\n licens... | python | chosen |
[
{
"from": "system",
"value": "Install Python Markdown when installing cmsplugin-simple-markdown.\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name='cmsplugin-simple-markdown',\n version=\".\".join(map(str, __import__('cmsplugin_simple_markdown').__version... | python | chosen |
[
{
"from": "system",
"value": "Add `fap` as a console script.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='fapistrano',\n version='0.5.1',\n license='MIT',\n description='Capistrano style deployment with fabric',\n zip_safe=False,\n include... | python | chosen |
[
{
"from": "system",
"value": "Use pip version of python-payer-api instead.\n"
},
{
"from": "human",
"value": "import os\nfrom distutils.core import setup\nfrom setuptools import find_packages\n\n\nVERSION = __import__(\"django_shop_payer_backend\").VERSION\n\nCLASSIFIERS = [\n 'Intended Audie... | python | chosen |
[
{
"from": "system",
"value": "Update the Python version classifiers, and remove use_2to3\n\nstaticjinja supports Python 2.6, 2.7 and 3.3.\n\nThis change also removes support for Python 2.5, which isn't\nsupported by tox (so ensuring staticjinja works with 2.5 is\ntricky).\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Fix reserved keyword override with import\n"
},
{
"from": "human",
"value": "\"\"\"\nA setuptools based setup module.\nSee:\nhttps://packaging.python.org/en/latest/distributing.html\nhttps://github.com/pypa/sampleproject\n\"\"\"\n\nfrom setuptools import setup\n# To... | python | chosen |
[
{
"from": "system",
"value": "Change relative imports to absolute.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .filters import ResourceTypeFilter\nfrom .mixins import LogEntryAdminMixin\nfrom .models import LogEntry\n\n\nclass LogEntryAdmin(admin.ModelAdmin, LogEn... | python | chosen |
[
{
"from": "system",
"value": "Prepare once plug-ins are loaded\n\nWith the new version of the listen hook.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#-*- coding: utf-8 -*-\n\n#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this licens... | python | chosen |
[
{
"from": "system",
"value": "Add mezzo task, for copy project to mezzo\n"
},
{
"from": "human",
"value": "from invoke import task\nimport jschema\n\n\n@task\ndef pip(ctx):\n ctx.run(\"rm -rf dist jschema.egg-info\")\n ctx.run(\"./setup.py sdist\")\n ctx.run(\"twine upload dist/jschema-... | python | chosen |
[
{
"from": "system",
"value": "Check for registration_id in serializer errors\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom .. import serializers\n\n\nclass TestAPNSDeviceSerializer(TestCase):\n def test_fields(self):\n expected = {'url', 'name', 'device_id... | python | chosen |
[
{
"from": "system",
"value": "Add method set to GObject to set attributes\n"
},
{
"from": "human",
"value": "from .meta import GObjectMeta\nfrom . import signals\nfrom . import meta\n\n@meta.apply\nclass GObject(metaclass=GObjectMeta):\n # Attributes of the object\n __attributes__ = ()\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add context when calling UserSerializer\n"
},
{
"from": "human",
"value": "from rest_framework.decorators import api_view\nfrom rest_framework.response import Response\n\nfrom .utils import absolute_reverse\nfrom api.users.serializers import UserSerializer\n\n@api_v... | python | chosen |
[
{
"from": "system",
"value": "Improve error handling in stream status view\n\n- Check if stream exists and raise a 404 otherwise\n- Check if upstream returned a success status code and raise a 500 otherwise\n"
},
{
"from": "human",
"value": "from api.streams.models import StreamConfiguration\nfr... | python | chosen |
[
{
"from": "system",
"value": "Improve test coverage on base Interface and Message classes\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport pickle\n\nfrom sentry.interfaces import Interface\n\nfrom sentry.testutils import TestCase\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove Shepway election id (waiting on feedback)\n"
},
{
"from": "human",
"value": "from data_collection.morph_importer import BaseMorphApiImporter\n\nclass Command(BaseMorphApiImporter):\n\n srid = 4326\n districts_srid = 4326\n council_id = 'E07000112'\n... | python | chosen |
[
{
"from": "system",
"value": "Change module finder to ignore modules starting with '_'\n"
},
{
"from": "human",
"value": "import pkgutil, os, sys\n\ndef getmodules():\n\t\"\"\"Returns all modules that are found in the current package.\n\tExcludes modules starting with '__'\"\"\"\n\treturn [ name... | python | chosen |
[
{
"from": "system",
"value": "Address Python lint issue in unrelated file\n"
},
{
"from": "human",
"value": "# ===--- compiler_stage.py -----------------------------------------------===#\n#\n# This source file is part of the Swift.org open source project\n#\n# Copyright (c) 2014 - 2021 Apple In... | python | chosen |
[
{
"from": "system",
"value": "Fix a broken example script.\n\n* check-modified.py (FORCE_COMPARISON): New variable.\n\n (run): Add FORCE_COMPARISON arg to call to svn_wc_text_modified_p.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#\n# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR... | python | chosen |
[
{
"from": "system",
"value": "Use \"utf-8\"-encoding if `TERMINAL_STREAM` lacks `encoding`-attribute.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2013-2015, Sebastian Linke\n\n# Released under the Simplified BSD license\n# (see LICENSE file for details).\n\n\"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Add order to PerObjectSettings tool\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Uranium is released under the terms of the AGPLv3 or higher.\n\nfrom . import PerObjectSettingsTool\n\nfrom UM.i18n import i18nCatalog\ni18n_catalog = i18nC... | python | chosen |
[
{
"from": "system",
"value": "Add class representing an element in the ordering\n"
},
{
"from": "human",
"value": "from fractions import Fraction\n\n\nclass Ordering:\n _start = object()\n _end = object()\n\n def __init__(self):\n self._labels = {\n self._start: Fracti... | python | chosen |
[
{
"from": "system",
"value": "Convert Twilio URL to IDN.\n"
},
{
"from": "human",
"value": "from flask import abort, current_app, request\nfrom functools import wraps\nfrom twilio.util import RequestValidator\nfrom config import *\n\ndef validate_twilio_request(f):\n @wraps(f)\n def decora... | python | chosen |
[
{
"from": "system",
"value": "Add -d / --directory option\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:\n\n\n\nimport argparse\nimport os\nimport zipfile\n\n\nparser = argparse.ArgumentParser(description = \"Extract zip fi... | python | chosen |
[
{
"from": "system",
"value": "tests: Fix test breakage when ssh_config missing\n\nI assumed /etc/ssh/ssh_config would be present, but it turns out in a\nmock chroot environment it isn't.\n\nSigned-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>\n"
},
{
"from": "human",
"... | python | chosen |
[
{
"from": "system",
"value": "Exit as soon as KeyboardInterrupt catched\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nimport os, sys\n\nfrom .base import Gor\n\nfrom tornado import gen, ioloop, queues\n\n\nclass TornadoGor(Gor):\n\n def __init__(self, *args, **kwargs):\n super(... | python | chosen |
[
{
"from": "system",
"value": "Set MutableTree.value on the object only\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\n\nclass M... | python | chosen |
[
{
"from": "system",
"value": "Update `get_formatted_book_data` to include page number and year\n"
},
{
"from": "human",
"value": "import re\nimport textwrap\n\nimport html2text\n\ntext_maker = html2text.HTML2Text()\ntext_maker.body_width = 0\n\n\ndef strip_html_tags(text):\n text = re.sub(r'<... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.