messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Setup script for PyPI \"\"\"\nimport os\nfrom setuptools import setup\ntry:\n from ConfigParser import SafeConfigParser\nexcept ImportError:\n from configparser import SafeConfigParser\n\nsettings = SafeConfigParser()\nsettings... | python | edit | 1 | 0 | apache-2.0 | 81d526bb3da4f103462f17d66af25cac83de4d63 | skymill/aws-ec2-assign-elastic-ip | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom os import path as _path\nfrom dynmen.common import TraitMenu as _TraitMenu\nfrom dynmen.generator import (AddOptions as _AddOptions,\n load_options as _load_options,)\n\n\n_dirname ... | python | edit | 1 | 0 | mit | c6fc60ec33c98b0a4b6272f5304b76477f5955f8 | frostidaho/dynmen | src/dynmen/dmenu.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\nsetup(\n name = 'openhomedevice',\n packages = ['openhomedevice'],\n version = '0.2.1',\n description = 'Provides an API for requesting information from an Openhome device',\n author = 'Barry John Will... | python | edit | 1 | 0 | mit | 6c6a774ef2614ca82fbe61ec04e9b6a75415b015 | bazwilliams/openhomedevice | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nversion = '1.9'\n\nsetup(name='jarn.viewdoc',\n version=version,\n description='Python documentation viewer',\n long_description=open('README.rst').read() + '\\n' +\n ... | python | edit | 1 | 0 | bsd-2-clause | 264d9e1748bb7129e0f8c287b657a7ca8b86c402 | Jarn/jarn.viewdoc | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom pupa import __version__\n\nlong_description = ''\n\nsetup(name='pupa',\n version=__version__,\n packages=find_packages(),\n author='James Turk',\n ... | python | edit | 1 | 0 | bsd-3-clause | 97e244878215a802a4f70967cc984f3763be5a30 | mileswwatkins/pupa,datamade/pupa,datamade/pupa,opencivicdata/pupa,opencivicdata/pupa,mileswwatkins/pupa | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='pytest-flakes',\n description='pytest plugin to check source code with pyflakes',\n long_description=open(\"README.rst\").read(),\n license=\"MIT license\",\n version='4.0.1',\n ... | python | edit | 1 | 0 | mit | fdc40813faee6a5867530ad8b8ad6daff48f2f42 | fschulze/pytest-flakes | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__... | python | edit | 1 | 1 | bsd-3-clause | eefe1ac289db85464d3d7f2f8ce3dbf8ab94487f | barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere | setup.py | rejected_duplicate | Near-duplicate of sample 5708 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name=\"virgil-sdk\",\n version=\"4.0.1b\",\n packages=find_packages(),\n install_requires=[\n 'virgil-crypto',\n ],\n author=\"Virgil Security\",\n author_e... | python | edit | 1 | 0 | bsd-3-clause | 66ac5502e689a404cf4372a3a9add75caa2473a6 | VirgilSecurity/virgil-sdk-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name='mock-django',\n version='0.4.0',\n description='',\n license='Apache License 2.0',\n author='David Cramer',\n author_email='<EMAIL>',\n url='http://github.co... | python | edit | 1 | 0 | apache-2.0 | 8dd08da1b7578dccee0d64c236da9a87b911ce84 | bennylope/mock-django,dcramer/mock-django | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n# publish on pypi\n# ---------------\n# $ python3 setup.py sdist\n# $ twine upload dist/imagecluster-x.y.z.tar.gz\n\nimport os\nfrom setuptools import setup\n\nhere = os.path.abspath(os.path.dirname(__file__))\... | python | edit | 1 | 0 | bsd-3-clause | bed95f0c0da7bc81eaf35aab24865bc35f01513b | elcorto/imagecluster | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name = \"ideone\",\n version = \"0.0.1\",\n author = \"Joe Schafer\",\n author_email... | python | edit | 1 | 1 | bsd-3-clause | 4bd197766cff3f4a2bd7231e0822a14efbd75c28 | jschaf/ideone-api | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright 2011 Andrew Ryrie (amr66)\n\nfrom distutils.core import setup\n\nsetup(name='django-pyroven',\n description='A Django authentication backend for Ucam-WebAuth / Raven',\n long_description=open('... | python | edit | 1 | 0 | mit | dab5d49b71700d93b466dc9f9d377a08f7fe68db | pyroven/django-pyroven | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\n\nfrom jeni import __version__\n\n\nCLASSIFIERS = [\n 'Development Status :: 4 - Beta',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: BSD License',\n 'Operating System :: OS... | python | edit | 1 | 0 | bsd-2-clause | fc1bbf6972d8660f24aba0fa073991ca5847829a | rduplain/jeni-python,groner/jeni-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/python\n\nfrom distutils.core import setup\ntry:\n from distutils.command.build_py import build_py_2to3 as build_py\nexcept ImportError:\n # Python 2.x\n from distutils.command.build_py import build_py\nimport photo\nim... | python | edit | 1 | 0 | apache-2.0 | 40a099f9f519f63695afb61a07a7c2d5b7f795af | RKrahl/photo-tools | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nwith open('requirements.txt') as f:\n required = f.read().splitlines()\n\nsetup(name='hackr',\n\n version='0.1.1',\n\n url='https://github.com/pytorn/hackr',\n\n license='Apac... | python | edit | 1 | 0 | apache-2.0 | 5ef6fe75ad8784381824d408a9178e076ddcc97e | pytorn/hackr | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nname, version = 'buildout.wheel', '0'\n\ninstall_requires = ['setuptools', 'wheel', 'humpty', 'six']\nextras_require = dict(test=['manuel', 'mock', 'zope.testing'])\n\nentry_points = \"\"\"\n[zc.buildout.extension]\nwheel = buildout.wheel:l... | python | edit | 1 | 0 | mit | d5eff1a8770315a81c765f50a6d0cbe4ef0fced7 | buildout/buildout.wheel,leorochael/buildout.wheel,buildout/buildout.wheel,leorochael/buildout.wheel,buildout/wheel,buildout/wheel | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport codecs\n#from distutils.core import setup\nfrom setuptools import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\n\nsetup(\n name='django-messages-extends',\n vers... | python | edit | 1 | 1 | mit | 42c064b71ebfce67bf83f4bc30cbf16cf8370ebb | AliLozano/django-messages-extends,AliLozano/django-messages-extends,AliLozano/django-messages-extends | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nurl = \"\"\nversion = \"0.1.0\"\nreadme = open('README.rst').read()\n\nsetup(\n name=\"dtool-create\",\n packages=[\"dtool_create\"],\n version=version,\n description=\"Dtool plugin for creating d... | python | edit | 1 | 0 | mit | 6cefb1f71f05860ab1cf65fe29eb724a6349e493 | jic-dtool/dtool-create | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*-coding:UTF-8 -*-\n\nfrom setuptools import setup, find_packages\nfrom os import path\nimport sys\n\nif sys.version_info[0] >= 3:\n install_requires = [\"PyMySQL\"]\nelse:\n install_requires = [\"MySQL-python\"]... | python | edit | 3 | 0 | mit | 1dc919145219fde72e8b17e3dc93d675441d01e9 | ligyxy/DictMySQLdb,ligyxy/DictMySQL | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='ploodood',\n version='0.1',\n description='Generates words that \"sound like real words\"',\n author = 'Matteo Giordano',\n author_email = '<EMAIL>',\n url = 'https://github.c... | python | edit | 1 | 0 | mit | f46e20c960ebd03eb8e8c194db649751407afb8b | malteo/ploodood | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(name='biosignal',\n version='0.0.1',\n description='',\n url='http://github.com/EmlynC/python-biosignal',\n author='Emlyn Clay',\n author_email='<EMAIL>',\n license='MIT',\... | python | edit | 1 | 0 | mit | 9bc9232f2b2b95b7031afe3b0a8ec12f9d77384a | EmlynC/python-biosignal | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom setuptools import setup\n\nsetup(\n name='asset_bender',\n version='0.1.5',\n description=\"A django runtime implementation for Asset Bender\",\n long_description=open('Readme.md').read(),\n author... | python | edit | 1 | 0 | mit | fd1826588031bfe165cef1cfa8d8cdc9123e25c5 | HubSpot/asset_bender_django | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nFlask-CacheControl\n------------------\n\nA light-weight library to conveniently set Cache-Control\nheaders on the response. Decorate view functions with\ncache_for, cache, or dont_cache decorators. Makes use of\nFlask response.cach... | python | edit | 1 | 0 | bsd-3-clause | 19b9695ae4ec14d813ad95f782a0c3486a53100c | twiebe/Flask-CacheControl | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Mailmerge build and install configuration.\"\"\"\nimport os\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.md')) as rea... | python | edit | 1 | 0 | mit | 34de3e7f3959c0fc05bf746e1bc6882f366bfa56 | awdeorio/mailmerge | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db.models.signals import post_save\nfrom django.dispatch import receiver\n\nfrom mezzanine.blog.models import Bl... | python | edit | 1 | 4 | mit | 24eb92088115a4cd583a3dc759083ff295db3135 | jonge-democraten/website,jonge-democraten/website,jonge-democraten/website,jonge-democraten/website | website/jdpages/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nUsed to manage the outputter system. This package is the modular system used\nfor managing outputters.\n'''\n\n# Import salt utils\nimport salt.loader\n\n\ndef display_output(data, out, opts=None):\n '''\n Print the passed data u... | python | edit | 1 | 5 | apache-2.0 | 9afa5b8b2fe2a5236337346a6f677a04863b82c7 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/output/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom robber import expect\nfrom robber.matchers.boolean import TrueMatcher, FalseMatcher\n\n\nclass TestTrueMatcher:\n def test_matches(self):\n expect(TrueMatcher(True).matches()).to.eq(True)\n expect(TrueMatcher(False).ma... | python | edit | 2 | 1 | mit | f0ceb7d9372766d9b1e55d619b8e05aee5950fb2 | vesln/robber.py | tests/matchers/test_boolean.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport chessmoves # Source: https://github.com/kervinck/floyd.git\nimport floyd as engine\nimport sys\n\ndef parseEpd(rawLine):\n\n # 4-field FEN\n line = rawLine.strip().split(' ', 4)\n pos = ' '.join(line[0:4])\n\n ... | python | edit | 7 | 4 | bsd-2-clause | 8cba7a1af5b590639dbba429a4e9eba3fb5898d8 | kervinck/floyd,kervinck/floyd,kervinck/floyd,kervinck/floyd | Tools/bmtest.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport vx\n\ndef _expose(f=None, name=None):\n if name is None:\n name = f.__name__.lstrip('_')\n if getattr(vx, name, None) is not None:\n raise AttributeError(\"Cannot expose duplicate name: '{}'\".format(name))\n i... | python | edit | 1 | 4 | mit | 96d2e3d47cf193046f68fef859244fd31be2ffa9 | philipdexter/vx,philipdexter/vx | utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.... | python | edit | 1 | 3 | apache-2.0 | f40f951a52c6c19108224d306f0e173465d0054d | jonparrott/google-cloud-python,googleapis/google-cloud-python,tswast/google-cloud-python,Fkawala/gcloud-python,googleapis/google-cloud-python,tartavull/google-cloud-python,tseaver/google-cloud-python,Fkawala/gcloud-python,dhermes/google-cloud-python,calpeyser/google-cloud-python,calpeyser/google-cloud-python,quom/googl... | scripts/pycodestyle_on_repo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright (c) 2016, Gabriel Linder <<EMAIL>>\n#\n# Permission to use, copy, modify, and/or distribute this software for any\n# purpose with or without fee is hereby granted, provided that the above\n# copyright notice and this permissi... | python | edit | 1 | 2 | isc | c65e2b3bb2d43a5d12d50cf79636e94a6a1f1dc5 | dargor/python-guess-random-color,dargor/python-guess-random-color | Algo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom waterbutler.core.streams import BaseStream\n\n\nclass FileStreamReader(BaseStream):\n\n def __init__(self, file_pointer):\n super().__init__()\n self.file_gen = None\n self.file_pointer = file_point... | python | edit | 1 | 3 | apache-2.0 | 9c923b8a94ea534c5b18983e81add7301a1dfa66 | RCOSDP/waterbutler,TomBaxter/waterbutler,rdhyee/waterbutler,CenterForOpenScience/waterbutler,felliott/waterbutler,Johnetordoff/waterbutler | waterbutler/core/streams/file.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/python\n\nimport numpy as np\nimport os\nfrom sklearn import datasets\n\nMESSAGES_DIR = \"data/messages/\"\nJUDGMENTS_PATH = \"data/judgments/judgments.txt\"\n\ndef load_messages():\n messages = []\n for filename in os.lis... | python | edit | 4 | 5 | mit | 6a34e0adb5128e4a46be26e9afa08cc9cd691be7 | chiubaka/actionizer | actionizer.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Forward addon routes.\"\"\"\nfrom framework.routing import Rule, json_renderer\nfrom website.routes import OsfWebRenderer\n\nfrom website.addons.forward import views\n\napi_routes = {\n\n 'rules': [\n\n ... | python | edit | 1 | 0 | apache-2.0 | cf89df9f0c45134b02879781223f9baff77c99d8 | baylee-d/osf.io,himanshuo/osf.io,baylee-d/osf.io,felliott/osf.io,MerlinZhang/osf.io,HarryRybacki/osf.io,hmoco/osf.io,brianjgeiger/osf.io,caseyrygt/osf.io,ckc6cz/osf.io,petermalcolm/osf.io,adlius/osf.io,RomanZWang/osf.io,himanshuo/osf.io,mluo613/osf.io,chennan47/osf.io,Nesiehr/osf.io,emetsger/osf.io,sloria/osf.io,aaxelb... | website/addons/forward/routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nclass Manager(object):\n\n # should be re-defined in a subclass\n state_name = None\n object_type = None\n\n def __init__(self, api):\n self.api = api\n\n # shortcuts\n @property\n def st... | python | edit | 1 | 9 | mit | f80b9f42db599e0416bd4e28f69c81e0fda494d2 | Doist/todoist-python | todoist/managers/generic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport tarfile\n\n\nPROJECT_ROOT = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)\n\n\ndef main(argv):\n target = argv[0]\n t = tarfile.open(target, mode=\"w\")\n for name in [\n ... | python | edit | 1 | 3 | bsd-3-clause | 26b9bed4148cd4085009884df66c7bf9bd09ec00 | topazproject/topaz,babelsberg/babelsberg-r,topazproject/topaz,topazproject/topaz,kachick/topaz,babelsberg/babelsberg-r,babelsberg/babelsberg-r,kachick/topaz,babelsberg/babelsberg-r,babelsberg/babelsberg-r,topazproject/topaz,kachick/topaz | topaz/tools/make_release.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write test for template matching of synthetic scarp"
},
{
"role": "assistant",
"content": "import unittest\nimport dem\nimport WindowedTemplate as wt\nimport filecmp\n\nclass TemplateMatchingTestCase(unittest.TestCase):\n \n ... | python | new_file | 11 | 1 | mit | 8e52298adf81e3ac718559a33f4db799e00e8d16 | stgl/scarplet,rmsare/scarplet | tests/test_scarplet.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Letter(object):\n _values = {\n '#': 0, # Wildcard\n 'ENIOA': 1,\n 'SDTR': 2,\n 'MLKPBG': 3,\n 'ZVUFJH': 4,\n 'CW': 5,\n 'XY': 8,\n 'Q': 10\n }\n\n def __init__(self, l... | python | edit | 1 | 3 | bsd-2-clause | 6d87ef7420cdb544739340eb432a3e2ee68e734e | Mechazawa/WordOn-HD-Bot | wordonhd/Letter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n\n\"\"\"\nFunctional tests for the ``flocker-changestate`` command line tool.\n\"\"\"\nfrom subprocess import check_output\nfrom unittest import skipUnless\n\nfrom twisted.python... | python | edit | 1 | 1 | apache-2.0 | 75c53cc811ae7f374df211b220c220f01d8b37e9 | jml/flocker,agonzalezro/flocker,Azulinho/flocker,AndyHuu/flocker,adamtheturtle/flocker,wallnerryan/flocker-profiles,Azulinho/flocker,1d4Nf6/flocker,LaynePeng/flocker,beni55/flocker,LaynePeng/flocker,hackday-profilers/flocker,beni55/flocker,w4ngyi/flocker,runcom/flocker,jml/flocker,jml/flocker,mbrukman/flocker,hackday-p... | flocker/node/functional/test_script.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom sentry.api.serializers import Serializer, register\nfrom sentry.models import GroupTagValue\n\n\n@register(GroupTagValue)\nclass GroupTagValueSerializer(Serializer):\n def serialize(self, ob... | python | edit | 1 | 5 | bsd-3-clause | c61b08475d82d57dae4349e1c4aa3e58fd7d8256 | ngonzalvez/sentry,mvaled/sentry,daevaorn/sentry,kevinlondon/sentry,imankulov/sentry,gencer/sentry,korealerts1/sentry,Natim/sentry,felixbuenemann/sentry,JamesMura/sentry,JackDanger/sentry,fotinakis/sentry,JackDanger/sentry,jean/sentry,looker/sentry,gencer/sentry,looker/sentry,gencer/sentry,looker/sentry,ngonzalvez/sentr... | src/sentry/api/serializers/models/grouptagvalue.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom functools import lru_cache\n\nfrom rest_framework import serializers\n\n\nclass AbstractFieldSerializer(serializers.RelatedField):\n parent_serializer_class = serializers.ModelSerializer\n\n def to_repres... | python | edit | 1 | 3 | mit | 01331f37c629f0738c5517527a6e78be55334e04 | City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,vikoivun/kerrokantasi,vikoivun/kerrokantasi,vikoivun/kerrokantasi,stephawe/kerrokantasi,City-of-Helsinki/kerrokantasi | democracy/views/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis module provides utility functions for integrating with Shapely.\n\"\"\"\n\nimport shapely.wkb\nimport shapely.wkt\n\nfrom .elements import WKBElement, WKTElement\nfrom .compat import buffer, bytes\n\n\ndef to_shape(element):\n ... | python | edit | 1 | 3 | mit | e475fdcf1054d5942addd28ca2c543542fc8abc5 | geoalchemy/geoalchemy2 | geoalchemy2/shape.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport dj_database_url\n\nfrom .base import *\n\n\nDATABASE_URL = os.environ.get('DATABASE_URL')\n\nDATABASES = {\n 'default': dj_database_url.config()\n}\n\nSTATIC_ROOT = 'static_sources'\nSTATIC_URL = '/static/'\n\nSTATICF... | python | edit | 4 | 0 | mit | c656ac5231d85e5f6a07688d3d7c2f4f07b3e154 | mhotwagner/backstage,mhotwagner/backstage,mhotwagner/backstage | backstage/settings/development.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThe FVCOM Python toolbox (PyFVCOM)\n\n\"\"\"\n\n__version__ = '1.6.2'\n__author__ = 'Pierre Cazenave'\n__credits__ = ['Pierre Cazenave']\n__license__ = 'MIT'\n__maintainer__ = 'Pierre Cazenave'\n__email__ = '<EMAIL>'\n\nimport inspe... | python | edit | 19 | 0 | mit | 76166f243b9f5f21582c95a843ddfa174ded8602 | pwcazenave/PyFVCOM | PyFVCOM/__init__.py | rejected_lint | Too many lint violations: 19 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\r\n\r\nclass RealtimeInterval:\r\n startTime = 0\r\n interval = 0\r\n\r\n def __init__(self, intervalInSeconds):\r\n self.startTime = time.time()\r\n self.interval = intervalInSeconds\r\n\r\n def start(... | python | edit | 1 | 2 | mit | 3e6700e4bd7107c37cb706086ae93adec7164083 | AluminatiFRC/Vision2016,AluminatiFRC/Vision2016 | RealtimeInterval.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import reverse\n\nfrom apps.core.factories import PIXELER_PASSWORD, PixelerFactory\nfrom apps.core.tests import CoreFixturesTestCase\nfrom apps.core.management.commands.make_development_fixtures import (\n m... | python | edit | 1 | 1 | bsd-3-clause | d240faeec0dea1b9dbefe080b479276ea19d2a0b | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | apps/explorer/tests/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport numpy\n\nimport chainer.functions as F\nfrom chainer import testing\n\n\n#\n# sqrt\n\ndef make_data(shape, dtype):\n x = numpy.random.uniform(0.1, 5, shape).astype(dtype)\n gy = numpy.random.uniform(-1, 1, sh... | python | edit | 1 | 1 | mit | b0a637ab19b3a5aca9e8c759fad2213ccde33e28 | wkentaro/chainer,ysekky/chainer,chainer/chainer,hvy/chainer,okuta/chainer,chainer/chainer,keisuke-umezawa/chainer,wkentaro/chainer,wkentaro/chainer,cupy/cupy,kiyukuta/chainer,rezoo/chainer,ronekko/chainer,hvy/chainer,okuta/chainer,ktnyt/chainer,jnishi/chainer,niboshi/chainer,pfnet/chainer,cupy/cupy,kashif/chainer,cupy/... | tests/chainer_tests/functions_tests/math_tests/test_sqrt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.apps import AppConfig\n\n\nclass SiteconfigConfig(AppConfig):\n name = 'siteconfig'\n\n```\n\nApply this change: Disable AliasPlugin since it can accidentally\n\ncause problems if an... | python | edit | 1 | 1 | mit | 377a0d4acd9a578146c0f02f518dbea502c8461f | c4sc/arividam,c4sc/arividam,c4sc/arividam,c4sc/arividam | arividam/siteconfig/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nyaspin.spinners\n~~~~~~~~~~~~~~~\n\nA collection of cli spinners.\n\"\"\"\n\nimport codecs\nimport os\nfrom collections import namedtuple\n\ntry:\n import simplejson as json\nexcept ImportError:\n im... | python | edit | 5 | 1 | mit | c044c804633612608bbbf61621551d892483f179 | pavdmyt/yaspin | yaspin/spinners.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyglet\nfrom pyglet.window.key import SPACE\n\nfrom .levels import Level\n\n\nclass IntroScreen(Level):\n def __init__(self, window):\n self.welcome = pyglet.text.Label('WELCOME\\n\\tTO\\nCLAIRE', x=100, y=window.height-80,\n ... | python | edit | 1 | 2 | mit | 06ac40c2767e73890f9d68ddc2e5d3c7522118ae | simeonf/claire | levels/intro.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf8 -*-\nfrom django.contrib.auth.models import AbstractUser\nfrom django.utils.functional import cached_property\nfrom social.apps.django_app.default.models import UserSocialAuth\n\nfrom frigg.helpers import github\n\n\nclas... | python | edit | 1 | 2 | mit | f291bb4b5bbf711fa12980fa3a9c8ceb831c6104 | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | frigg/authentication/models.py | rejected_duplicate | Near-duplicate of sample 3954 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAppResources\n\n:Authors:\n\tBerend Klein Haneveld\n\"\"\"\n\nimport os\nfrom AppVars import AppVars\n\n\nclass AppResources(object):\n\t\"\"\"\n\tAppResources is a static class that can be used to find common resources\n\teasily. J... | python | edit | 1 | 3 | mit | 08de7924f56606225e1772320831a02f2ae4aabd | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | core/AppResources.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/bin/python\ndef divide1(x,y):\n try:\n return True,x/y\n except Exception , e:\n print e\n return False,None\n\nx1=5\ny1=0\nx2=2\ny2=1\nsuccess1,result1= divide1(x1,y1)\nif not success1:\n print \"Error\"\nelse:\n ... | python | edit | 4 | 2 | mit | 9f39c7740d23b115680c36968407cf110029dbee | Vayne-Lover/Effective | Python/item14.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\nfrom splinter import Browser\nfrom fake_webapp import EXAMPLE_APP\nfrom base import WebDriverTests\n\n\nclass ChromeBrowserTest(W... | python | edit | 1 | 1 | bsd-3-clause | cf25aeb751fc681907b1684c2675fc6d38b537ed | objarni/splinter,underdogio/splinter,bubenkoff/splinter,underdogio/splinter,bmcculley/splinter,lrowe/splinter,bubenkoff/splinter,objarni/splinter,lrowe/splinter,drptbl/splinter,nikolas/splinter,cobrateam/splinter,underdogio/splinter,objarni/splinter,myself659/splinter,bmcculley/splinter,gjvis/splinter,drptbl/splinter,m... | tests/test_webdriver_chrome.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n\nfrom tensorflow.examples.tutorials.mnist import input_data\nimport tensorflow as tf\nimport numpy as np\n\n\nDATASET_PATH = 'data/fashion'\n\ndef load_dataset():\n \"\"\"Loads fashion dataset\n\n Returns:\n ... | python | edit | 1 | 2 | mit | ea40d0c1c51fbf0964cd5642b061bf0e3f3dbe71 | vianasw/fashion-classifier | classifier/utils/misc_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Base error used to create custom errors for loaders.\"\"\"\n\nERROR_TITLE_TEMPLATE = \"****************************ERROR****************************\\n\"\nERROR_FILENAME_TEMPLATE = \"File: {filename}\\n\"\nERROR_REFERENCE_TEMPLATE = \... | python | edit | 1 | 1 | mit | 9ad660586832ea780b75e8b3f783fb6fd5cf40c4 | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/utils/errors/Error.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n#Pysarus\n#A python wrapper for Big Huge Thesarus\n#Jacob Adams\n\nimport urllib.request\nimport json\n\n#where to save reteived defintions\n#if None than no files are saved\nsavepath = \".\"\n\n#Your API key for Big Hug... | python | edit | 1 | 4 | mit | 3c0d465dde4a93fe60b8b2ce897cb4c5745450ad | Tookmund/Pysarus | pysarus.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import DetailView, ListView\nfrom django.views.generic.edit import CreateView, UpdateView, DeleteView\nfrom django.urls import reverse_lazy\nfrom django.shortcuts import render\nfrom django.contrib.messages.views i... | python | edit | 3 | 2 | mit | 424aa401806ddf536b9bc75efb1493561a5c2a5b | borderitsolutions/amadaa,borderitsolutions/amadaa,borderitsolutions/amadaa | product/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial implementation of a Distribution class"
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport glob\n\n\nclass Distribution:\n def __init__(self, path):\n \"\"\"\n Construct a distributio... | python | new_file | 1 | 2 | apache-2.0 | 663f986ff516a401d1ae2c0136a6f6ab4253e9c5 | python/importlib_metadata | importlib_metadata/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef largest_palindrome():\n pass\n\n\ndef smallest_palindrome():\n pass\n\n```\n\nApply this change: palindrome-product: Add parameter to exercise placeholder"
},
{
"role": "assistant",
"content": "def largest_palindrome(m... | python | edit | 1 | 1 | mit | 3c4eb325424fad2f68cfb9360d417bd531106711 | mweb/python,smalley/python,jmluy/xpython,behrtam/xpython,jmluy/xpython,smalley/python,pheanex/xpython,exercism/xpython,N-Parsons/exercism-python,mweb/python,N-Parsons/exercism-python,behrtam/xpython,exercism/python,exercism/python,pheanex/xpython,exercism/xpython | exercises/palindrome-products/palindrome_products.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Sarah M. - 2017\n\nimport sys\nimport datetime\nfrom colors import farben\n\ndef request(flow):\n now = datetime.datetime.now()\n content = flow.request.get_text()\n host = flow.request.pretty_host\n method = flow.request.meth... | python | edit | 3 | 4 | apache-2.0 | 7e0024878352ba544a8b40d2c8b5741aedf05a70 | sarah314/SpyPi | Code/login_proxy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under an MIT open source license - see LICENSE\n\n\n'''\nTests for Dendrogram statistics\n'''\n\nfrom unittest import TestCase\n\nimport numpy as np\nimport numpy.testing as npt\n\nfrom ..statistics import Dendrogram_Stats, Dendr... | python | edit | 1 | 1 | mit | a5926a3ef469c4b323f994dd026b55cac7fa1b2f | Astroua/TurbuStat,e-koch/TurbuStat | turbustat/tests/test_dendro.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A home for all Dallinger Experiments. Experiments should be registered\nwith a ``setuptools`` ``entry_point`` for the ``dallinger.experiments`` group.\n\"\"\"\nimport logging\nfrom pkg_resources import iter_entry_points\nfrom ..experi... | python | edit | 1 | 0 | mit | f15c623374f6ca955a37a90d3c90bd19fb781f00 | Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger | dallinger/experiments/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sounddevice as sd\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nif __name__ == '__main__':\n\n # devList = sd.query_devices()\n # print(devList)\n\n fs = 48000 # Sample rate\n duration = 100e-3 ... | python | edit | 1 | 0 | mit | d566444d584f644afc580ff9d3cf8e1adc7ccb30 | hathach/tinyusb,hathach/tinyusb,hathach/tinyusb | examples/device/audio_test/src/plot_audio_samples.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#Imports a file with lines in the form \"symbolName 0xADDRESS\"\n#@category Data\n#@author \n \nf = askFile(\"Give me a file to open\", \"Go baby go!\")\n\nfor line in file(f.absolutePath): # note, cannot use open(), since that is in Ghidr... | python | edit | 12 | 0 | apache-2.0 | 04069a5d5d6f5647394aba987ae5798629bf4a73 | NationalSecurityAgency/ghidra,NationalSecurityAgency/ghidra,NationalSecurityAgency/ghidra,NationalSecurityAgency/ghidra,NationalSecurityAgency/ghidra,NationalSecurityAgency/ghidra,NationalSecurityAgency/ghidra | Ghidra/Features/Python/ghidra_scripts/ImportSymbolsScript.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom allauth.socialaccount.providers.base import ProviderAccount\nfrom allauth.socialaccount.providers.oauth2.provider import OAuth2Provider\n\n\nclass GitLabAccount(ProviderAccount):\n\n def get_profile_url(self... | python | edit | 1 | 1 | mit | d57a974acfd9054dafca692404f217788da22f01 | spool/django-allauth,pztrick/django-allauth,bittner/django-allauth,pztrick/django-allauth,joshowen/django-allauth,pztrick/django-allauth,rsalmaso/django-allauth,bittner/django-allauth,rsalmaso/django-allauth,pennersr/django-allauth,bittner/django-allauth,AltSchool/django-allauth,lukeburden/django-allauth,lukeburden/dja... | allauth/socialaccount/providers/gitlab/provider.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nclass TestWithExpectedFailures(unittest.TestCase):\n\n @unittest.expectedFailure\n def test_should_fail(self):\n assert False\n \n @unittest.expectedFailure\n def test_should_pass(self):\n ass... | python | edit | 1 | 1 | bsd-2-clause | f844f9e153406577b844a864110bcc54fd6b01f3 | ojengwa/nose2,little-dude/nose2,ptthiem/nose2,ezigman/nose2,ptthiem/nose2,ezigman/nose2,little-dude/nose2,ojengwa/nose2 | nose2/tests/functional/support/scenario/expected_failures/expected_failures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django import template\nfrom django.utils.safestring import mark_safe\n\nregister = template.Library()\n\n\n@register.filter()\ndef bool_icon(value):\n \"\"\"\n Create a safe HTML version of True/False us... | python | edit | 1 | 2 | bsd-2-clause | 8fd968028492f113a91358b87ee045f3f2b5d38b | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | core/templatetags/bootstrap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\n# Test whether a client produces a correct connect and subsequent disconnect.\n\nimport os\nimport subprocess\nimport socket\nimport sys\nimport time\nfrom struct import *\n\nrc = 1\nkeepalive = 60\nconnect_packet = pac... | python | edit | 6 | 0 | bsd-3-clause | c95d6e0f215cb81a00a0af869595bb6e89e887e7 | zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto | test/lib/01-con-discon-success.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic.list import MultipleObjectMixin\n\n__all__ = ('FilterFormMixin',)\n\n\nclass FilterFormMixin(MultipleObjectMixin):\n \"\"\"\n Mixin that adds filtering behaviour for Class Based Views.\n Changed in a way t... | python | edit | 1 | 1 | mit | 69f1f5f78477e6c89338661e71ecd9732a287673 | zorainc/django-datafilters,freevoid/django-datafilters,zorainc/django-datafilters | datafilters/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = '0.2.4'\n\n# This list defines all the modules that will be loaded if a user invokes\n# from climLab import *\n\n# totally out of date!\n\n#__all__ = [\"constants\", \"thermo\", \"orbital_table\",\n# \"long_orbita... | python | edit | 22 | 0 | mit | fb99c40fa0dcf59aaaf45a14b238a240a453bcaa | brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab,brian-rose/climlab,cjcardinale/climlab | climlab/__init__.py | rejected_lint | Too many lint violations: 22 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nAn extension for keywords which expose pieces of native python objects.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom Cauldron.types import Integer, DispatcherKeywordType\nfrom Cauldron.exc import ... | python | edit | 4 | 1 | bsd-3-clause | d137f2cf16b088e2d9722568fce6dad89d950016 | alexrudy/Cauldron | Cauldron/ext/expose/keywords.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom robots.models import Url, Rule\nfrom robots.forms import RuleAdminForm\n\n\nclass RuleAdmin(admin.ModelAdmin):\n form = RuleAdminForm\n ... | python | edit | 1 | 0 | bsd-3-clause | 1eab43e1b1402a53c2dec53abe61bcae5f4b3026 | jazzband/django-robots,jezdez/django-robots,jezdez/django-robots,jscott1971/django-robots,jscott1971/django-robots,jazzband/django-robots | robots/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nc.ServerProxy.servers = {\n 'lab-dev': {\n 'command': [\n 'jupyter',\n 'lab',\n '--debug',\n '--no-browser',\n '--port={port}',\n '--NotebookApp.token=\"\"',\n ... | python | edit | 4 | 0 | bsd-3-clause | c38e9c886bf10f18db7ab182b231ef7a6fe53b8e | jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab | binder/jupyter_notebook_config.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\ntry:\n from django_extensions.db.fields.encrypted import EncryptedTextField, EncryptedCharField\nexcept ImportError:\n\n class EncryptedCharField():\n def __init__(self, **kwargs):\n ... | python | edit | 1 | 1 | mit | be3ee0a06ec350431e66efbcbcead28075056f55 | django-extensions/django-extensions,levic/django-extensions,linuxmaniac/django-extensions,kevgathuku/django-extensions,ewjoachim/django-extensions,joeyespo/django-extensions,Christophe31/django-extensions,Moulde/django-extensions,nikolas/django-extensions,barseghyanartur/django-extensions,atchariya/django-extensions,fr... | django_extensions/tests/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\ndef open_lastrun_file(mode='r'):\n '''Open and return lastrun file.'''\n\n # path to data directory\n data_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data')\n os.makedirs(data_dir, exist_ok=Tr... | python | edit | 1 | 1 | mit | 4dc2bb7e2973f39dabb267fb8d6782fe61fe36a9 | lqmanh/classer | sample/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport json\nfrom mock import MagicMock\nfrom tornado.testing import AsyncHTTPTestCase\nfrom insight_reloaded.api import application\nfrom insight_reloaded import __version__ as VERSION\n\n\nclass InsightApiHTTPTest... | python | edit | 3 | 1 | bsd-3-clause | 969ea8afcb111c68a145cc69791e531303807608 | novapost/insight-reloaded | insight_reloaded/tests/test_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Define a custom User class to work with django-social-auth\nfrom django.db import models\n\n\nclass CustomUserManager(models.Manager):\n def create_user(self, username, email):\n return self.model._default_manager.create(usernam... | python | edit | 1 | 1 | bsd-3-clause | ec33927709b1d9ce484e6f243068a334de389aa1 | beswarm/django-social-auth,omab/django-social-auth,adw0rd/django-social-auth,gustavoam/django-social-auth,limdauto/django-social-auth,michael-borisov/django-social-auth,vuchau/django-social-auth,limdauto/django-social-auth,sk7/django-social-auth,caktus/django-social-auth,vxvinh1511/django-social-auth,duoduo369/django-s... | example/app/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\n\nclass LastSeenMiddleware(object):\n def process_request(self, request):\n if not request.user.is_authenticated():\n return None \n profile = request.user.get_profile()\n profile.last_se... | python | edit | 1 | 2 | bsd-2-clause | 2a3ffa2e8bde58d4e3dec053ad437842eac80106 | cmptrgeekken/evething,Gillingham/evething,Gillingham/evething,madcowfred/evething,Gillingham/evething,madcowfred/evething,cmptrgeekken/evething,cmptrgeekken/evething,madcowfred/evething,Gillingham/evething,madcowfred/evething,cmptrgeekken/evething,cmptrgeekken/evething | thing/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport feedparser, sys, urllib2\n\nfrom bs4 import BeautifulSoup as BS\nfrom feedgen.feed import FeedGenerator\nfrom flask import Flask\n\napp = Flask(__name__)\n\n@app.route('/')\ndef index():\n\n d = feedparser.parse('http://thecodingl... | python | edit | 3 | 3 | mit | a3a1ead4954500b29a1474b333336f90a95718db | chrillux/thecodingloverss | thecodingloverss.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport multiprocessing\r\n\r\nbind = \"127.0.0.1:9000\"\r\n\r\n# Run cores * 4 + 1 workers in gunicorn\r\n# This is set deliberately high in case of long Oracle transactions locking Django up\r\nworkers = multiprocessing.cpu_count() * 4 + 1... | python | edit | 1 | 0 | mit | 95234ec552c7157ed9020e90f19b2abd1f813735 | uclapi/uclapi,uclapi/uclapi,uclapi/uclapi,uclapi/uclapi | backend/uclapi/gunicorn_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom legacy.models import Constituency\n\nclass Boundary(models.Model):\n id = models.IntegerField(primary_key=True)\n constituency_id = models.IntegerField()\n boundary = models.TextField()\n zoom ... | python | edit | 1 | 0 | mit | b95e6069a1faa849b1c5b31daf0dfd4dd4b5be23 | JustinWingChungHui/electionleaflets,electionleaflets/electionleaflets,electionleaflets/electionleaflets,JustinWingChungHui/electionleaflets,DemocracyClub/electionleaflets,JustinWingChungHui/electionleaflets,DemocracyClub/electionleaflets,DemocracyClub/electionleaflets,JustinWingChungHui/electionleaflets | electionleaflets/boundaries/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom hecate.core.topology.mixins import DimensionsMixin\n\n\nclass Border(DimensionsMixin):\n \"\"\"\n Base class for all types of borders.\n\n \"\"\"\n def __init__(self):\n self.topology = None\n\n\nclass TorusBorder(Bo... | python | edit | 1 | 2 | mit | 75615b2328e521b6bb37321d1cd7dc75c4d3bfef | a5kin/hecate,a5kin/hecate | hecate/core/topology/border.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport tempfile\nimport shutil\n\nimport groundstation.node\nimport groundstation.transfer.response\nimport groundstation.transfer.request\nfrom groundstation.station import Station\n\n\nclass MockStream(list):\n def enq... | python | edit | 1 | 2 | mit | 6189ded93330e9483e6d677e26b49319c649c9f0 | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | test/handler_fixture.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis test demonstrates the use of deferred asserts.\nDeferred asserts won't raise exceptions from failures until either\nprocess_deferred_asserts() is called, or the test reaches the tearDown() step.\n\"\"\"\nimport pytest\nfrom sel... | python | edit | 1 | 1 | mit | bc8675b170748b51403fb31d03ed06399268cb7b | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | examples/test_deferred_asserts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test whether the K2onSilicon command-line tool works.\"\"\"\nimport tempfile\n\nfrom ..K2onSilicon import K2onSilicon_main\n\n\ndef test_K2onSilicon():\n \"\"\"Test the basics: does K2onSilicon run without error on a dummy file?\"\... | python | edit | 1 | 2 | mit | 1456ebbf7621d257b7f67117a34bcf4c35de41d3 | KeplerGO/K2fov,mrtommyb/K2fov | K2fov/tests/test_k2onsilicon.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.2.10 on 2021-11-05 12:29\n\nfrom django.db import migrations\nfrom django.db.models.query_utils import Q\n\n\ndef update_url_to_community(apps, schema_editor):\n people_url = \"/people\"\n mentor_url = \"/directory... | python | edit | 1 | 1 | mit | f89d59d89af12473c609948bae518151a9adc64a | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0074_update_url_to_community.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import (\n AbstractBaseUser,\n PermissionsMixin,\n BaseUserManager,\n)\nfrom django.db import models\n\n\nclass MyUserManager(BaseUserManager):\n def create_user(self, email, password=None):\n ... | python | edit | 1 | 0 | apache-2.0 | 2cadf977592bd1082f5914cf365849d3f9897b9c | mfraezz/osf.io,mattclark/osf.io,HalcyonChimera/osf.io,caneruguz/osf.io,Johnetordoff/osf.io,Nesiehr/osf.io,acshi/osf.io,chrisseto/osf.io,mattclark/osf.io,pattisdr/osf.io,CenterForOpenScience/osf.io,brianjgeiger/osf.io,Nesiehr/osf.io,crcresearch/osf.io,Nesiehr/osf.io,hmoco/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,TomBaxt... | admin/common_auth/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Created by JHJ on 2016. 10. 5.\n\nfrom django.conf.urls import url\n\nfrom . import views\n\napp_name = 'board'\nurlpatterns = [\n url(r'^$', views.board_list, name='board_list'),\n url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list... | python | edit | 1 | 0 | mit | 092bd3d506ec281a24adcecef6ca498443df5f59 | hyesun03/k-board,guswnsxodlf/k-board,hyesun03/k-board,kboard/kboard,guswnsxodlf/k-board,kboard/kboard,guswnsxodlf/k-board,cjh5414/kboard,darjeeling/k-board,hyesun03/k-board,kboard/kboard,cjh5414/kboard,cjh5414/kboard | kboard/board/urls.py | rejected_duplicate | Near-duplicate of sample 11132 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom botchallenge import *\n\nUSERNAME = \"\" # Put your minecraft username here\nSERVER = \"\" # Put the address of the minecraft server here\n\nrobot = Robot(USERNAME, SERVER)\n\nwhile True:\n me = robot.get_location()\n owner = r... | python | edit | 3 | 0 | mit | 82c57b4fad49b171cd0833b38867474d6578220c | Rafiot/botchallenge,Rafiot/botchallenge,Rafiot/botchallenge,Rafiot/botchallenge | client/examples/followbot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 10.08.2017 20:33\n:Licence GNUv3\nPart of grammpy-transforms\n\n\"\"\"\n\nfrom grammpy import Grammar\nfrom .NongeneratingSymbolsRemove import remove_nongenerating_symbols\nfr... | python | edit | 1 | 3 | mit | 3072b6dd724255c3fba3bc6f837ec823d507e321 | PatrikValkovic/grammpy | grammpy_transforms/contextfree.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom utils.data_handler import DataHandler\n\nclass Config(object):\n class __Config:\n def __init__(self):\n self.data_handler = DataHandler()\n self.fname = \"config.json\"\n\n config = self.__... | python | edit | 1 | 2 | mit | a2627a5e0fc68be04af50259e1fd504be389aeb1 | DongjunLee/kino-bot | kino/utils/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# build.py\nimport os\n\n# Markdown to HTML library\n# https://pypi.org/project/Markdown/\nimport markdown\n\nfrom staticjinja import Site\n\nmarkdowner = markdown.Markdown(output_format=\"html5\")\n\n\ndef md_contex... | python | edit | 1 | 1 | mit | 57f2a438845cd0d7263da6ac66142d5403e41d98 | Ceasar/staticjinja,Ceasar/staticjinja | examples/markdown/build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mezzanine.pages.models import Page\n\n\ndef page(request):\n \"\"\"\n Adds the current page to the template context and runs its\n ``set_helper`` method. This was previously part of\n ``PageMiddleware``, but moved to a cont... | python | edit | 1 | 2 | bsd-2-clause | 7a94ef4efddc639a13c00669c4cf10f07e8aa290 | wbtuomela/mezzanine,dsanders11/mezzanine,christianwgd/mezzanine,Cicero-Zhao/mezzanine,geodesign/mezzanine,promil23/mezzanine,sjdines/mezzanine,industrydive/mezzanine,sjuxax/mezzanine,dsanders11/mezzanine,christianwgd/mezzanine,ryneeverett/mezzanine,viaregio/mezzanine,geodesign/mezzanine,ryneeverett/mezzanine,vladir/mez... | mezzanine/pages/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom subprocess import Popen, PIPE\n\n\nclass EximHandler(logging.Handler):\n \"\"\"\n A handler class which sends an email using exim for each logging event.\n \"\"\"\n def __init__(self, toaddr, subject, exim_p... | python | edit | 1 | 3 | unlicense | eecde2e8fdd3b105e68a5bd4bab16bdfb9767546 | danmichaelo/eximhandler | eximhandler/eximhandler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Restore Alerts of the format in a JSON dumpfile from the list_alerts.py example.\n#\n\nimport os\nimport sys\nimport json\nsys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))\nf... | python | edit | 5 | 0 | mit | 986dc7064f1dfb651d6185c38a2b5070bf8926f8 | draios/python-sdc-client,draios/python-sdc-client | examples/restore_alerts.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright 2015 Yasser Gonzalez Fernandez\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 3 | apache-2.0 | 61d455cbc2b4177fbb4640211679f5c1948042ff | yasserglez/configurator,yasserglez/configurator | configurator/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom adminsortable.admin import SortableAdmin\nfrom cms.admin.placeholderadmin import PlaceholderAdmin\nfrom django.contrib import admin\nfrom distutils.version import LooseVersion\nfrom hvad.admin import Translatab... | python | edit | 1 | 2 | bsd-3-clause | 41d795736a7e759cf85cbe366567375eb9703a4a | czpython/aldryn-faq,czpython/aldryn-faq,mkoistinen/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq | aldryn_faq/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Standard library imports\nfrom __future__ import unicode_literals\n\n# Third party imports\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\n# Local application / specific... | python | edit | 1 | 1 | bsd-3-clause | 6d21aa9e6d52701d7beacd4ec519ab1bac488886 | franga2000/django-machina,franga2000/django-machina,reinbach/django-machina,reinbach/django-machina,ellmetha/django-machina,franga2000/django-machina,reinbach/django-machina,ellmetha/django-machina,ellmetha/django-machina | machina/models/abstract_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sqlalchemy import ForeignKey, Column\nfrom sqlalchemy import String\nfrom sqlalchemy import Text\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.types import Unicode, Integer\nfrom sqlalchemy.orm import backre... | python | edit | 5 | 0 | mit | e4193b7082cf3d891c993905443415a613630f8f | axant/tgapp-mailtemplates,axant/tgapp-mailtemplates | mailtemplates/model/sqla/models.py | rejected_lint | Too many lint violations: 5 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.