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\"\"\"MRV Communications Driver (OptiSwitch).\"\"\"\nfrom __future__ import unicode_literals\nimport time\nimport re\n\nfrom netmiko.cisco_base_connection import CiscoSSHConnection\n\n\nclass MrvOptiswitchSSH(CiscoSSHConnection):\n \"\"\...
python
edit
1
3
mit
5cd9499fcc0c1f9b48216aeca11a7adcd8995a47
ktbyers/netmiko,ktbyers/netmiko
netmiko/mrv/mrv_ssh.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Asynchronous support for garage.threads.actors.\"\"\"\n\n__all__ = [\n 'StubAdapter',\n]\n\nfrom garage.asyncs import futures\n\n\nclass StubAdapter:\n \"\"\"Wrap all method calls, adding FutureAdapter on their result.\n\n Wh...
python
edit
1
2
mit
9cdd86499013c1deac7caeb8320c34294789f716
clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage
py/garage/garage/asyncs/actors.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django import forms\n\nfrom .models import Post, Album, Link\n\nfrom opps.core.widgets import OppsEditor\n\nfrom opps.db.models.fields.jsonf import JSONFormField\nfrom opps.fields.widgets...
python
edit
1
0
mit
78705f598e7e3325e871bd17ff353a31c71bc399
opps/opps,YACOWS/opps,williamroot/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps
opps/articles/forms.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom . import views\nfrom django.conf.urls import url\n\n\nurlpatterns = [\n url(r'^by_topic/', views.bill_list_by_topic),\n url(r'^by_location', views.bill_list_by_location),\n url(r'^latest_activity/', views.latest_bill_activity)...
python
edit
1
0
mit
7a0560d8bd9dcb421b54522df92618d439941e69
jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot
bills/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls import patterns, url, include\n\nfrom tastypie.api import Api\n\nfrom opps.containers.api import Container\nfrom opps.articles.api import Post\n\nfrom .conf import settin...
python
edit
1
0
mit
edb04d8e0ae03c9244b7d934fd713efbb94d5a58
williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps
opps/api/urls.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Fix the bool name in the array API namespace" }, { "role": "assistant", "content": "from .. import int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64\n# Note: This name is changed\nfrom .. import bool_ as ...
python
new_file
1
0
mit
0d2f35ddc27cf4c7155a4d1648c0bbfe0ff3a528
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
numpy/_array_api/dtypes.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik\n# Author: Dominik Gresch <<EMAIL>>\n\nimport pytest\nimport tempfile\nfrom click.testing import CliRunner\n\nimport tbmodels\n...
python
edit
1
1
apache-2.0
8b4b5eb2506feed164b69efa66b4cdae159182c3
Z2PackDev/TBmodels,Z2PackDev/TBmodels
tests/test_cli_parse.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom checks.base import Check\nfrom checks.results import Result\nfrom libs.api import get_settings_ws_api_url\nfrom libs.http import safe_request\n\n\nclass StreamsCheck(Check):\n\n @classmethod\n def run(cls):\n response = sa...
python
edit
1
2
apache-2.0
afb400e16c1335531f259218a8b9937de48644e9
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
polyaxon/checks/streams.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport requests\nimport json\n\nimgUrl = 'https://pixlab.io/images/m3.jpg' # Target picture we want to blur any face on\n\n# Detect all human faces in a given image via /facedetect first and blur all of them later via /mogrify.\n# https://p...
python
edit
1
0
bsd-2-clause
7b19611d30dfc9091823ae3d960ab2790dfe9cfc
symisc/pixlab,symisc/pixlab,symisc/pixlab
python/blur_human_faces.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Author: Dominik Gresch <<EMAIL>>\n\nimport os\n\nimport pytest\nimport tempfile\nimport bandstructure_utils as bs\nfrom click.testing import CliRunner\n\nimport tbmodels\nfrom tbmodels._...
python
edit
4
1
apache-2.0
52c3981b8880085d060f874eb8feace6ac125411
Z2PackDev/TBmodels,Z2PackDev/TBmodels
tests/test_cli_bands.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os, sys, re, logging\nimport requests\nfrom github import Github\n\nlogging.basicConfig(level=logging.DEBUG)\n\nCIRCLECI_BASEURL = \"https://circleci.com/api/v2\"\nCIRCLECI_ACCESS_TOKEN = os.environ[\"TAO_CIRCLECI_TOKEN\"]\nGITHUB_AC...
python
edit
1
0
apache-2.0
74ecf023ef13fdba6378d6b50b3eaeb06b9e0c97
avatao-content/challenge-toolbox,avatao-content/challenge-toolbox,avatao-content/challenge-toolbox,avatao-content/challenge-toolbox,avatao-content/challenge-toolbox,avatao-content/challenge-toolbox,avatao-content/challenge-toolbox,avatao-content/challenge-toolbox,avatao-content/challenge-toolbox
rebuild_dependant_repos.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.contrib.auth.decorators import login_required\nfrom wye.organisations.models import Organisation\nfrom wye.workshops.models import Workshop\nfrom wye.profiles.models import Profile\nimport da...
python
edit
1
3
mit
d98cdb7eae40b5bb11b5d1fc0eacc35ef6bf310d
pythonindia/wye,pythonindia/wye,pythonindia/wye,pythonindia/wye
wye/reports/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport sys\nfrom .. import support\nimport unittest\n\ndef test_suite(package=__package__, directory=os.path.dirname(__file__)):\n suite = unittest.TestSuite()\n for name in os.listdir(directory):\n if name.startswit...
python
edit
1
7
mit
8713f44fbd35f012ac7e01a64cffcfdf846fee9f
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Lib/test/test_importlib/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport logging\nfrom celery import Celery\n\nfrom temp_config.set_environment import DeployEnv\nruntime_env = DeployEnv()\nruntime_env.load_deployment_environment()\n\nredis_server = os.environ.get('REDIS_HOSTNAME')\nredis_port =...
python
edit
1
0
unlicense
8dcb778c62c3c6722e2f6dabfd97f6f75c349e62
puruckertom/ubertool_ecorest,quanted/ubertool_ecorest,puruckertom/ubertool_ecorest,quanted/ubertool_ecorest,quanted/ubertool_ecorest,puruckertom/ubertool_ecorest,puruckertom/ubertool_ecorest,quanted/ubertool_ecorest
celery_cgi.py
rejected_duplicate
Near-duplicate of sample 949
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom datetime import datetime\n\nTAG_WIDTH = 'EXIF ExifImageWidth'\nTAG_HEIGHT = 'EXIF ExifImageLength'\nTAG_DATETIME = 'Image DateTime'\n\ndef parse_time(tags):\n tag = tags.get(TAG_DATETIME, None)\n if not...
python
edit
1
2
mit
3b5b3afbc66f60df45f0458ffdd0d37b9a7c50d0
vperron/picasa-toolbox
ptoolbox/tags.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.utils.encoding import python_2_unicode_compatible\nfrom model_utils.models import TimeStampedModel\nfrom tinymce.models import HTMLField\nfro...
python
edit
1
0
mit
10f7938e37180c0cb3b701223cf6d1855e7d8f93
watchdogpolska/watchdog-kj-kultura,watchdogpolska/watchdog-kj-kultura,watchdogpolska/watchdog-kj-kultura
watchdog_kj_kultura/main/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\nReader for XVISTA .prof tables.\n\"\"\"\n\nimport numpy as np\nfrom astropy.table import Table\nfrom astropy.io import registry\n\n\ndef xvista_table_reader(filename):\n dt = [('R', np.fl...
python
edit
1
1
bsd-2-clause
d84a4efcf880bb668b2721af3f4ce18220e8baab
jonathansick/xvistaprof
xvistaprof/reader.py
rejected_duplicate
Near-duplicate of sample 1735
true
[ { "role": "user", "content": "Write python code for the following: Complete migrate from django to toilets script" }, { "role": "assistant", "content": "import argparse\n\nfrom ona import OnaApiClient\n\n\ndef generate_location(lat, lon):\n return ' '.join([str(lat), str(lon)])\n\nCONVERSIONS...
python
new_file
3
2
bsd-3-clause
0cc7fbea3952485e8274c8df1b223fc791181035
praekelt/go-imali-yethu-js,praekelt/go-imali-yethu-js,praekelt/go-imali-yethu-js
ona_migration_script/migrate_toilets.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-04-23 19:51\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('ze...
python
edit
1
0
apache-2.0
427629ca4cfe231acd8cd4ad54470038ca03c13e
punchagan/zulip,kou/zulip,synicalsyntax/zulip,vaidap/zulip,brockwhittaker/zulip,j831/zulip,eeshangarg/zulip,jphilipsen05/zulip,jackrzhang/zulip,j831/zulip,shubhamdhama/zulip,brainwane/zulip,verma-varsha/zulip,synicalsyntax/zulip,mahim97/zulip,verma-varsha/zulip,eeshangarg/zulip,showell/zulip,eeshangarg/zulip,andersk/zu...
zerver/migrations/0076_userprofile_emojiset.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport getpass\nimport logging\nimport sys\n\nfrom six.moves import input\n\nfrom rbtools.api.errors import AuthorizationError\nfrom rbtools.commands import CommandError\n\n\ndef get_authenticated_...
python
edit
1
4
mit
c46e472755c7b7dd450626e136f31a29ca9a5321
reviewboard/rbtools,halvorlu/rbtools,beol/rbtools,datjwu/rbtools,davidt/rbtools,datjwu/rbtools,davidt/rbtools,reviewboard/rbtools,haosdent/rbtools,halvorlu/rbtools,haosdent/rbtools,haosdent/rbtools,reviewboard/rbtools,beol/rbtools,beol/rbtools,datjwu/rbtools,halvorlu/rbtools,davidt/rbtools
rbtools/utils/users.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 18 15:09:03 2015\n\n@author: Alexander\n\"\"\"\nclass Match(object):\n '''\n Perform matching algorithm on input data and return a list of indicies\n corresponding to matches.\n ...
python
edit
1
1
mit
8494ece12d8fe27c4c76797083c851a96e054286
aegorenkov/PropensityScoreMatching
PropensityScoreMatching/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport numpy\nimport cupy\nimport scipy.special\nimport cupyx.scipy.special\n\nfrom cupy import testing\nimport pytest\n\nscipy_ufuncs = {\n f\n for f in scipy.special.__all__\n if isinstance(getattr(scipy.special, f), numpy.ufunc)...
python
edit
1
2
mit
5f1f1145d4f01f4b30e8782d284feb44781c21ad
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
tests/cupyx_tests/scipy_tests/special_tests/test_ufunc_dispatch.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nimport os\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand, CommandError\nfrom pontoon.administration.views import _update_from_repository\nfrom pontoon.base.models import Project\n\nclass Command(Bas...
python
edit
2
3
bsd-3-clause
3bef86bd3637642587ed15680249c278504fc4fb
mathjazz/pontoon,yfdyh000/pontoon,jotes/pontoon,mozilla/pontoon,sudheesh001/pontoon,mathjazz/pontoon,jotes/pontoon,vivekanand1101/pontoon,mastizada/pontoon,jotes/pontoon,m8ttyB/pontoon,Jobava/mirror-pontoon,Jobava/mirror-pontoon,participedia/pontoon,jotes/pontoon,yfdyh000/pontoon,m8ttyB/pontoon,vivekanand1101/pontoon,v...
pontoon/administration/management/commands/update_projects.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import render_template, redirect, url_for, flash, request\nfrom flask.ext.login import login_required, current_user\n\nfrom . import admin\nfrom .forms import ProfileForm\n\nfrom .. import db\nfrom ..models import User\n\n@admin....
python
edit
5
2
mit
f8a6b4d8053a60cfec372d8b91bf294d606055ec
finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is
app/admin/routes.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom typing import Union\n\nimport virtool.samples.utils\n\n\ndef join_cache_path(settings: dict, cache_id: str):\n \"\"\"\n Create a cache path string given the application settings and cache id.\n\n :param settings: th...
python
edit
1
2
mit
eabbd0468e7334dfb5d4866baadb7b4265d8536f
virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool
virtool/caches/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport tornado.web\nfrom tornado.options import define\n\nfrom .handlers import LandingHandler, RequestHandler\n\n\nclass InteractApp(tornado.web.Application):\n \"\"\"\n Entry point for the interact app.\n \"\"\"\n d...
python
edit
1
1
apache-2.0
1c867959ea1a4fa61136be8d21e83bb13f26577f
data-8/DS8-Interact,data-8/DS8-Interact,data-8/DS8-Interact
app/interact_app.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport uuid\n\nfrom abc import ABCMeta, abstractmethod\n\n\nclass BaseReader(object):\n __metaclass__ = ABCMeta\n\n @abstractmethod\n def __init__(self):\n pass\n\n @abstractmethod\n def _to_...
python
edit
1
2
bsd-3-clause
ed044a79347fcde11416c51a5c577fe2cc467050
tjcorona/PyFR,tjcorona/PyFR,BrianVermeire/PyFR,tjcorona/PyFR,Aerojspark/PyFR,iyer-arvind/PyFR
pyfr/readers/base.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport requests, json\n\nfrom resources.urls import FACEBOOK_MESSAGES_POST_URL\n\n\nclass HttpClient():\n \"\"\"\n Client which excutes the call to\n facebook's messenger api\n \"\"\"\n\n def submit_request(self, path, method...
python
edit
4
4
mit
267c6591ef7ab3354b0965902585203fbfe04dee
ben-cunningham/pybot,ben-cunningham/python-messenger-bot
pybot/http_client.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Defaults.\"\"\"\n\nfrom .utils import RateLos\n\n\nclass Regions:\n \"\"\"Arbitrary number of counties.\"\"\"\n\n def __init__(self, **kwargs):\n population = 0\n for key, value in kwargs.items():\n seta...
python
edit
1
2
mit
803677bbf54503621af04a59da3a84e79d59f52b
CodeForPhilly/chime,CodeForPhilly/chime,CodeForPhilly/chime
src/penn_chime/defaults.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\nimport sys, os\nimport argparse\nfrom deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo\n\ndef main(argv=None):\n\n parser = argparse.ArgumentParser(description='Print count of objects...
python
edit
6
3
bsd-3-clause
1b1715c4c44c162f650d6da79f5571ac2c0f994b
barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere
utils/get_collection_object_count.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nfrom ..qt import QtGui\n\n\ndef open_file_dialog(default_format='png'):\n \"\"\"Return user-selected file path.\"\"\"\n filename = str(QtGui.QFileDialog.getOpenFileName())\n if len(filename) == 0:\n return None\...
python
edit
1
3
bsd-3-clause
3baa7fe8f3ff7f7840f22647754783967657fe16
juliusbierk/scikit-image,youprofit/scikit-image,rjeli/scikit-image,oew1v07/scikit-image,newville/scikit-image,ajaybhat/scikit-image,warmspringwinds/scikit-image,michaelaye/scikit-image,GaZ3ll3/scikit-image,almarklein/scikit-image,bennlich/scikit-image,dpshelio/scikit-image,jwiggins/scikit-image,dpshelio/scikit-image,ch...
skimage/viewer/utils/dialogs.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom tests.lib import run_pip, reset_env\n\n\ndef test_timeout():\n reset_env()\n result = run_pip(\"--timeout\", \"0.01\", \"install\", \"-vvv\", \"INITools\",\n expect_error=True,\n )\n assert \"Could not fetch URL http...
python
edit
1
1
mit
20c52fdaf8f0eaefd9d857b37d89e7b429cc3013
natefoo/pip,mujiansu/pip,harrisonfeng/pip,xavfernandez/pip,James-Firth/pip,nthall/pip,mujiansu/pip,graingert/pip,prasaianooz/pip,techtonik/pip,zorosteven/pip,rbtcollins/pip,ianw/pip,prasaianooz/pip,zorosteven/pip,ianw/pip,cjerdonek/pip,tdsmith/pip,habnabit/pip,ChristopherHogan/pip,yati-sagade/pip,alex/pip,zvezdan/pip,f...
tests/functional/test_requests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User,Group\nfrom django.db import models\nfrom django.contrib.postgres.fields import JSONField\nfrom ..core.models import TimeStampedModelMixin, UIDMixin\n\n\nclass OAuth(models.Model):\n user = mod...
python
edit
5
1
bsd-3-clause
52f38cd00db200d0520062c27f0d305827edb7d2
venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud,venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud,terranodo/eventkit-cloud,venicegeo/eventkit-cloud
eventkit_cloud/auth/models.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport logging\nimport numpy as np\nimport lmj.cli\nimport lmj.nn\n\nlmj.cli.enable_default_logging()\n\nclass Main(lmj.nn.Main):\n def get_network(self):\n return lmj.nn.recurrent.Autoencoder\n\n def g...
python
edit
3
3
mit
fb5e742e0b820af4a14052d9bd12053dcdc36d52
chrinide/theanets,devdoer/theanets,lmjohns3/theanets
examples/recurrent-phase.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nfrom django.core.management.base import BaseCommand\n\nfrom django_bundles.core import get_bundles\n\n\nclass Command(BaseCommand):\n args = \"target_directory\"\n help = \"Writes out files containing the list of input fi...
python
edit
1
6
mit
f3ad7f31784ea35da8655efa97ad3dd102e6dddb
sdcooke/django_bundles
django_bundles/management/commands/create_bundle_manifests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.shortcuts import get_object_or_404\nfrom rest_framework import permissions, viewsets\n\nfrom similarities.utils import get_similar\nfrom .models import Artist\nfrom similarities.models import UserSimilarity\nfrom .serializers im...
python
edit
3
2
bsd-3-clause
04fc49427a1288b259610c98d7cd82b21e1a79a4
FreeMusicNinja/api.freemusic.ninja
artists/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Project metadata\n\nInformation describing the project.\n\"\"\"\n\n# The package name, which is also the \"UNIX name\" for the project.\npackage = 'my_module'\nproject = \"My Awesome Module\"\nproject_no_space...
python
edit
1
0
mit
567a786e9d20c4519d72c37531d99e8d33b178af
mishin/python-project-template,seanfisk/python-project-template,seanfisk/python-project-template,shekkbuilder/python-project-template,mishin/python-project-template,shekkbuilder/python-project-template
my_module/metadata.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import with_statement\nfrom alembic import context\nimport sqlalchemy\nimport logging\n\nlogging.basicConfig(level=logging.INFO, format=\"[%(asctime)s] %(levelname)s:%(name)s:%(message)s\")\n\ntarget_metadata = None\n\ndef r...
python
edit
1
1
apache-2.0
2566b5698b17ca0d193ef6bf3b22aca91b711222
mrphlip/lrrbot,mrphlip/lrrbot,andreasots/lrrbot,andreasots/lrrbot,andreasots/lrrbot,mrphlip/lrrbot
alembic/env.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.template import Library\n\nregister = Library()\n\n@register.filter\ndef get_representation_for_user(role, user_role):\n if user_role.type == \"juror\":\n if role.type == \"clencher\":\n return \"Clencher (<...
python
edit
1
8
mit
6427ef6e05e3add17533c0a86603943c85020eb6
robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth
inonemonth/challenges/templatetags/challenges_extras.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2010-2011 OpenStack Foundation\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy...
python
edit
1
0
apache-2.0
b158de35c08aa78578f374f125884607468e67d1
openstack/glance,rajalokan/glance,rajalokan/glance,stevelle/glance,openstack/glance,openstack/glance,stevelle/glance
glance/registry/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom Autodesk.Revit.DB import *\nfrom Autodesk.Revit.DB.Architecture import *\nfrom Autodesk.Revit.DB.Analysis import *\nfrom System.Collections.Generic import *\n\nuidoc = __revit__.ActiveUIDocument\ndoc = __revit__.ActiveUIDocument.Docum...
python
edit
2
1
mit
bd3ff327bd04a6688ce7f39964394f921dec6705
Nahouhak/pythoncvc.net,Nahouhak/pythoncvc.net
RevitPyCVC/Outils/copier_type_vues.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\n\nfrom go.dashboard import DiamondashApiError, DiamondashApiClient\n\n\nclass FakeDiamondashApiClient(DiamondashApiClient):\n def __init__(self):\n self.requests = []\n self.response = None\n\n def get_reque...
python
edit
1
2
bsd-3-clause
62c573fadad1b0268353c2dc21c35ac5b645052a
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
go/dashboard/tests/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python2\n\n'''Read and write image files as NumPy arrays'''\n\n\nfrom numpy import asarray, float32\nfrom PIL import Image\n\nfrom . import np\nfrom . import utils\n\n\n_DEFAULT_DTYPE = float32\n\n_PIL_RGB = {\n 'R': 0,\n ...
python
edit
2
3
isc
17a18f72e9e2a7df43d2dafe77a17bfe4777d7aa
eliteraspberries/avena
avena/image.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom go.vumitools.conversation.definition import (\n ConversationDefinitionBase, ConversationAction)\n\n\nclass ViewLogsAction(ConversationAction):\n action_name = 'view_logs'\n action_display_name = 'View Sandbox Logs'\n redire...
python
edit
1
2
bsd-3-clause
e8d2d067c79bf133f98312c328a0e72af6b65f96
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
go/apps/jsbox/definition.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nfrom django.conf import settings\n\n\n__all__ = ['patch']\n\n\n# Idempotence! http://en.wikipedia.org/wiki/Idempotence\n_has_patched = False\n\n\ndef patch():\n global _has_patched\n if _has_patched:\n return\n\...
python
edit
1
5
bsd-3-clause
c0e77cca647232810299c251ecfc96c0c1e4e12e
mozilla/funfactory,mozilla/funfactory
funfactory/monkeypatches.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nimport queue\nimport threading\n\nlog = logging.getLogger(__name__)\n\n\nclass Action:\n func = None\n args = []\n kwargs = {}\n\n def __init__(self, func=None, args=[], kwargs={}):\n self.func = func\n ...
python
edit
1
2
mit
ba57cf57d3e075d5260fb19304ec0e9f903c3ed0
pajlada/tyggbot,pajlada/tyggbot,pajlada/pajbot,pajlada/pajbot,pajlada/pajbot,pajlada/pajbot,pajlada/tyggbot,pajlada/tyggbot
pajbot/actions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging \nimport sys\n\nfrom glaciercmd.gcconfig import GCConfig\n\ndef run():\n logging.basicConfig(format=\"%(asctime)s %(levelname)s %(module)s: %(message)s\", level=logging.DEBUG)\n\n config = GCConfig()\n if config.has_errors...
python
edit
1
5
mit
0501eaca73638ae9c19cd7db2946e28b0a40153e
carsonmcdonald/glacier-cmd
glaciercmd/cli.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2014 Ansible, Inc.\n# All Rights Reserved.\n\nfrom django.conf import settings\n\nfrom awx.main.models import Instance\n\n\ndef is_ha_environment():\n \"\"\"Return True if this is an HA environment, and False\n otherwi...
python
edit
1
4
apache-2.0
719ae63a28a0fdbb379a5ee61a9bb3216ef283bc
snahelou/awx,snahelou/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx
awx/main/ha.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# ----------------------------------------------------------------------------\n# Copyright © 2016, Continuum Analytics, Inc. All rights reserved.\n#\n# The full license is in the file LICENSE.txt, distributed with ...
python
edit
1
6
bsd-3-clause
8810bd03df781e7ec20fcc2d0fcc7cbf423e9cdc
conda/kapsel,conda/kapsel
conda_kapsel/internal/py2_compat.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Creates a CSV of psycholinguistic dictionary\n# downloaded from web\n\n# Headers\n__author__ = 'Somsubhra Bairi'\n__email__ = '<EMAIL>'\n\n\n# All imports\nfrom logger import Logger\n\n\n# The psycholinguistic dat...
python
edit
1
7
mit
2c3ddc18477561f4880c2b857c4aa8a0f8478dfd
Somsubhra/Enrich,Somsubhra/Enrich,Somsubhra/Enrich
src/psycholinguistic_db/psycholinguistic_db_creator.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\nfrom stampman.services import pool\n\n\nclass TestAPIEndpoint(unittest.TestCase):\n pass\n\n```\n\nApply this change: Add unit test for testing flask endpoint\n\nTest GET on the `/` endpoint" }, { "role": "assist...
python
edit
3
1
mit
bf36e307b13148d40e978ebb32151a3ea0e32cf9
thunderboltsid/stampman
stampman/tests/test_api.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport zope.interface\n\nimport zeit.cms.content.reference\n\nimport zeit.campus.interfaces\n\n\nclass TopicpageLink(zeit.cms.related.related.RelatedBase):\n\n zope.interface.implements(zeit.campus.interfaces.ITopicpageLink)\n\n topic...
python
edit
1
0
bsd-3-clause
e388099f6fcc0fbc1904bb24f050d7106204e58c
ZeitOnline/zeit.campus
src/zeit/campus/article.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom cbagent.collectors.libstats.remotestats import RemoteStats, parallel_task\n\n\nclass PSStats(RemoteStats):\n\n METRICS = (\n (\"rss\", 1024), # kB -> B\n (\"vsize\", 1024),\n )\n\n PS_CMD = \"ps -eo pid,rss,vs...
python
edit
1
4
apache-2.0
149c1257f4af4c6962c61e74bddbdddfcc741524
couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner
cbagent/collectors/libstats/psstats.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nclass Query:\n def __init__(self, ident, name, oper, value):\n self.ident = ident\n self.name = name\n self.oper = oper\n self.value = value\n\n def test(self, prop_dict):\n if self.ident is not None...
python
edit
1
9
apache-2.0
20ccdd67d7e398fc4e4b5f72f723da31346e66a7
PHB-CS123/graphene,PHB-CS123/graphene,PHB-CS123/graphene
graphene/traversal/query.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\n# test helper.run_tests function\n\nimport warnings\n\nfrom .....
python
edit
4
1
bsd-3-clause
485c722010882f5273b2cca77305b499cd4674c5
DougBurke/astropy,dhomeier/astropy,kelle/astropy,aleksandr-bakanov/astropy,AustereCuriosity/astropy,kelle/astropy,saimn/astropy,StuartLittlefair/astropy,lpsinger/astropy,DougBurke/astropy,StuartLittlefair/astropy,AustereCuriosity/astropy,dhomeier/astropy,larrybradley/astropy,stargaser/astropy,dhomeier/astropy,astropy/a...
astropy/tests/tests/test_run_tests.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nimport bb_dbconnector_pg\n\nlog = logging.getLogger('bb_log.' + __name__)\n\n\nclass DBConnectorInterfaceFactory:\n\n def __init__(self):\n pass\n\n @staticmethod\n def create():\n return bb_dbconnecto...
python
edit
1
1
mit
f9aae4320522af94dde78bac0c30e909ef4ef4e2
mattstibbs/blockbuster-server,mattstibbs/blockbuster-server
blockbuster/bb_dbconnector_factory.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (C) 2016 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\nfrom integration.ggrc.converters import TestCase\n\nfrom ggrc import models\n\n\nclass TestImportUpdates(TestCase):\n\n \"\...
python
edit
1
1
apache-2.0
18ea019bd77d605c367265080aa40382399b324b
selahssea/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,kr41/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,j0gu...
test/integration/ggrc/converters/test_import_update.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.db.models.signals import post_save, pre_delete\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.dispatch import receiver\n\nfrom .pushers import push_new_content_for_instance\nfro...
python
edit
1
3
mit
7972c0fbaf8b46810dd36e0d824c341ea4234b47
mback2k/swampdragon-live,mback2k/swampdragon-live
swampdragon_live/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport datetime\nimport pymongo\nimport os\nimport sys\nimport time\nfrom courtreader import readers\n\n# Connect to database\nclient = pymongo.MongoClient(os.environ['DISTRICT_DB'])\ndb = client.va_district_court_cases\n\n# Connect to Dist...
python
edit
3
0
mit
f14df4ae507f3161f00ac28648bd53f2bb0bd7c3
bschoenfeld/va-court-scraper,bschoenfeld/va-court-scraper
collect_district_court_case_details.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nclass PangoPackage (GnomePackage):\n\tdef __init__ (self):\n\t\tGnomePackage.__init__ (self,\n\t\t\t'pango',\n\t\t\tversion_major = '1.28',\n\t\t\tversion_minor = '4',\n\t\t\tconfigure_flags = [\n\t\t\t\t'--without-x'\n\t\t\t]\n\t\t)\n\n\t\...
python
edit
5
3
mit
33e17ebd7046e0968db2ee01f9e2759a382b62d9
bl8/bockbuild,bl8/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,bl8/bockbuild
packages/pango.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom changes.api.serializer import Serializer, register\nfrom changes.models import Task\n\n\n@register(Task)\nclass TaskSerializer(Serializer):\n def serialize(self, instance, attrs):\n return {\n 'id': instance.id.hex...
python
edit
1
3
apache-2.0
1b70aee665720ce10e2e0437fb462745adbd6799
bowlofstew/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes
changes/api/serializer/models/task.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright 2020 The StackStorm Developers\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 ...
python
edit
1
1
apache-2.0
54454f7f963730aa3fc91c5b1baf44762b07fb47
StackStorm/st2,Plexxi/st2,StackStorm/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2
contrib/linux/tests/test_action_dig.py
rejected_duplicate
Near-duplicate of sample 13717
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url, include\nfrom django.contrib.auth.decorators import login_required\nfrom django.views.i18n import javascript_catalog\nfrom django.views.decorators.csrf import csrf_protect, ensure_csrf_cookie\n\n\...
python
edit
1
0
bsd-3-clause
ee82b77f562ee1d49c2fc724a3fc58b101c0dd2b
devilry/devilry-django,devilry/devilry-django,devilry/devilry-django,devilry/devilry-django
src/devilry_qualifiesforexam/devilry_qualifiesforexam/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Generated by Django 2.2.28 on 2022-04-20 13:05\n\nfrom django.db import (\n migrations,\n models,\n)\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('accelerator', '0098_update_startup_update_20220408_0...
python
edit
1
0
mit
ea633b9cf062e28525910f5659b6b8f2ddbb74e3
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/migrations/0099_update_program_model.py
rejected_duplicate
Near-duplicate of sample 138
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom geoserver.support import ResourceInfo, atom_link\n\nclass Style(ResourceInfo):\n def __init__(self,catalog, node):\n self.catalog = catalog\n self.name = node.find(\"name\").text \n self.href = atom_link(node)\n self.up...
python
edit
1
3
mit
6dfa381b26948b97b7abc3de9f1a02618fd5ad0f
cristianzamar/gsconfig,scottp-dpaw/gsconfig,boundlessgeo/gsconfig,Geode/gsconfig,afabiani/gsconfig,garnertb/gsconfig.py
src/geoserver/style.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Picklers for working with serialized data.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport pickle\n\n\nclass DjangoCompatUnpickler(pickle.Unpickler):\n \"\"\"Unpickler compatible with changes to Django class/module paths...
python
edit
1
4
bsd-3-clause
a610faf9d64c062ed2dd44a818acc0d12d1f6e0b
beanbaginc/django-evolution
django_evolution/compat/picklers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nfrom discord.ext.commands.errors import CommandError\n\nclass NotServerOwner(CommandError):\n\t'''Not Server Owner'''\n\tpass\n\nclass VoiceNotConnected(CommandError):\n\t'''Voice Not Connected'''\n\tpass\n\nclass PermittedVoiceNotConnect...
python
edit
1
1
mit
3f2c13ecc64c84b51ecc5867004b9cbc32e375ac
Harmon758/Harmonbot,Harmon758/Harmonbot
Discord/utilities/errors.py
rejected_duplicate
Near-duplicate of sample 1183
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2013 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nimport os\nimport subprocess\n\nfrom telemetry.core import util\nfrom tel...
python
edit
3
2
bsd-3-clause
115dbdecabc74f4f08d07099a4997860ebe5278b
SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,benschmaus/catapult,sahiljain/catapult,SummerLW...
telemetry/telemetry/core/platform/profiler/android_screen_recorder_profiler.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom haystack import indexes\nfrom haystack import site\n\nfrom foirequest.models import FoiRequest\n\n\nclass FoiRequestIndex(indexes.SearchIndex):\n text = indexes.EdgeNgramField(document=True, use_template=True)\n title = indexes.C...
python
edit
1
1
mit
5fe71408c740697ebe0b268e9fbac93f5932ef63
ryankanno/froide,stefanw/froide,LilithWittmann/froide,LilithWittmann/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,catcosmo/froide,stefanw/froide,CodeforHawaii/froide,okfse/froide,LilithWittmann/froide,ryankanno/froide,catcosmo/froide,CodeforHawaii/froide,ryankanno/froide,catcosmo/froide,ryankanno/froide,c...
froide/foirequest/search_indexes.py
rejected_duplicate
Near-duplicate of sample 13428
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pywps import Process, LiteralOutput\nfrom pywps.app.Common import Metadata\n\n\nclass UltimateQuestion(Process):\n def __init__(self):\n inputs = []\n outputs = [LiteralOutput('answer', 'Answer to Ultimate Question', d...
python
edit
1
1
apache-2.0
4640b75fdb794e29cb6e7bdc03a6697d8f9f3483
bird-house/emu
emu/processes/wps_ultimate_question.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nPlotting a diagonal correlation matrix\n======================================\n\n_thumb: .3, .6\n\"\"\"\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nsns.set(style=\"white\")\n\n# Generate a large r...
python
edit
1
0
bsd-3-clause
cebe1c3b72eb9e0fd4114d5664e269a73bdc06a1
mia1rab/seaborn,muku42/seaborn,JWarmenhoven/seaborn,mwaskom/seaborn,drewokane/seaborn,jat255/seaborn,phobson/seaborn,bsipocz/seaborn,uhjish/seaborn,arokem/seaborn,tim777z/seaborn,q1ang/seaborn,clarkfitzg/seaborn,dhimmel/seaborn,olgabot/seaborn,Lx37/seaborn,anntzer/seaborn,kyleam/seaborn,oesteban/seaborn,sinhrks/seaborn...
examples/many_pairwise_correlations.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nimport django.dispatch\nfrom django.dispatch import receiver\n\nlogger = logging.getLogger(__name__)\n\n__all__ = ['task_status_changed', 'celery_request_status_update']\n\ntask_status_changed = django.dispatch.Signal(provid...
python
edit
1
1
mit
452bad78228f5cb26c0ed9cc7aa48497f1d3f7f0
Wikia/sparrow,harnash/sparrow,Wikia/sparrow,Wikia/sparrow
apps/tasks/signals.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import pgettext as _\nfrom django_prices.models import PriceField\nfrom satchless.util.models import Subtyped\nfrom satchless.item import ItemRange\nfrom mptt.models import MPTTMod...
python
edit
1
1
bsd-3-clause
a0e432b0ac31ed74256197b1d5df8b6f8a0987db
laosunhust/saleor,mociepka/saleor,paweltin/saleor,mociepka/saleor,jreigel/saleor,taedori81/saleor,UITools/saleor,UITools/saleor,spartonia/saleor,car3oon/saleor,Drekscott/Motlaesaleor,UITools/saleor,HyperManTT/ECommerceSaleor,paweltin/saleor,maferelo/saleor,dashmug/saleor,rodrigozn/CW-Shop,laosunhust/saleor,avorio/saleo...
product/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sublime\n\n\ndef universal_newlines(string):\n return string.replace('\\r\\n', '\\n').replace('\\r', '\\n')\n\n\ndef panel(message, run_async=True):\n message = universal_newlines(str(message))\n view = sublime.active_window...
python
edit
1
2
mit
c76734ea034f2a48de0eab995c5db5667086e0c8
divmain/GitSavvy,divmain/GitSavvy,divmain/GitSavvy
common/util/log.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom collections import namedtuple\n\nResponse = namedtuple('Response', 'command_status message')\n\n\n# Allows use of `environ_or_none(\"foo\") or \"default\"` shorthand\n# noinspection PyBroadException\ndef environ_or_none(key)...
python
edit
1
2
apache-2.0
057ddbf6ee529fff9f511a9cc8bc8c1a20a91833
Charcoal-SE/SmokeDetector,Charcoal-SE/SmokeDetector
helpers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom store import create_directories\nimport options\nimport task\n\ndef parse_jugfile():\n import jugfile\n\ndef print_tasks():\n for i,t in enumerate(task.alltasks):\n print 'Task %s: %s' % (i,t.name)\n\ndef execute_tasks():\...
python
edit
5
7
mit
21f27eecae407e3baa8f55effd7b19ef2fa9ca6d
unode/jug,unode/jug,luispedro/jug,luispedro/jug
jug.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport pandas as pd\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.core.exceptions import ObjectDoesNotExist\n\nfrom fellowms.models import Fellow\n\nclass Command(BaseCommand):\n help = \"Add old infor...
python
edit
4
5
bsd-3-clause
d2730af02bf9032ec5bb10b07f8fae6fab2bba52
softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat
fellowms/management/commands/applicants_data.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport yaml\nfrom jaraco.collections import ItemsAsAttributes\n\n\nclass ConfigDict(ItemsAsAttributes, dict):\n\t@classmethod\n\tdef from_yaml(cls, filename):\n\t\twith open(filename) as f:\n\t\t\treturn cls(yaml.load(f))\n\n\tdef to_yaml(s...
python
edit
1
1
mit
66a5c4199d3e8bbea5ed40e92fef4be60425f827
yougov/pmxbot,yougov/pmxbot,yougov/pmxbot
pmxbot/dictlib.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"NM-Controller accounts are used to provide secure access to the XMLRPC API. They are normal Unix accounts with a shell that tunnels XMLRPC requests to the API server.\"\"\"\n\nimport accounts\nimport logger\nimport tools\n\n\nclass C...
python
edit
4
2
bsd-3-clause
c08013dc2fc32582e8636d84be3e2f68dafe11a0
dreibh/planetlab-lxc-nodemanager,planetlab/NodeManager,planetlab/NodeManager,planetlab/NodeManager,dreibh/planetlab-lxc-nodemanager,planetlab/NodeManager,dreibh/planetlab-lxc-nodemanager
controller.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom cookiecutter.main import cookiecutter\n\n\nclass Cookies(object):\n \"\"\"Class to provide convenient access to the cookiecutter API.\"\"\"\n error = None\n project = None\n\n def...
python
edit
1
4
mit
b295e3e64367073550ceb00faa72e6564f08dd55
hackebrot/pytest-cookies
pytest_cookies.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!python\nimport os\nimport sys\nimport json\nimport requests\n\nif __name__ == '__main__':\n version = sys.argv[1]\n filepath = sys.argv[2]\n filename = filepath.split('/')[-1]\n github_token = os.environ['GITHUB_TOKEN']\n auth = (git...
python
edit
1
1
bsd-2-clause
1d83021ab395804020d1907db7b6db897dbd1efd
moritz9/redash,pubnative/redash,ninneko/redash,hudl/redash,pubnative/redash,vishesh92/redash,imsally/redash,easytaxibr/redash,jmvasquez/redashtest,guaguadev/redash,vishesh92/redash,jmvasquez/redashtest,easytaxibr/redash,44px/redash,amino-data/redash,chriszs/redash,jmvasquez/redashtest,jmvasquez/redashtest,amino-data/re...
bin/upload_version.py
rejected_duplicate
Near-duplicate of sample 22465
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport subprocess\n\nfrom edx_data_research.parsing.parse import Parse\n\nclass SQL(Parse):\n\n def __init__(self, args):\n super(SQL, self).__init__(args)\n self._collections = args.collection\n self.sql_file = args...
python
edit
1
1
mit
f696e320d66f375779692ec073f15d3d6d466059
McGillX/edx_data_research,McGillX/edx_data_research,McGillX/edx_data_research
edx_data_research/parsing/parse_sql.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport flask\nfrom .. import auth\nimport urllib.parse\n\ndef checkForSession():\n\tif \"uid\" in flask.session:\n\t\tsession = auth.validateSession(flask.session[\"uid\"])\n\t\tif session != None:\n\t\t\treturn session\n\treturn None\n\nde...
python
edit
1
3
mit
093c8ac40ba6154ee4a3d3d1430e5b05e68b2e9e
ollien/Timpani,ollien/Timpani,ollien/Timpani
timpani/webserver/webhelpers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nCopyright 2010 Asidev s.r.l.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a co...
python
edit
2
3
apache-2.0
4baa59fd3ea90b604a8cdb5f4daf9ddb61f2e34a
asidev/aybu-manager-cli,asidev/aybu-manager-cli
aybu/manager/cli/task.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\n\n\"\"\"\n\n\ndef get_remote_address(request):\n \"\"\"\n :param: request: request object of sanic\n :return: the ip address of given request (or 127.0.0.1 if none found)\n \"\"\"\n return request.ip[0] or '127.0.0.1'...
python
edit
1
2
mit
808434912ceb176793a559464f767e2eb52b889d
bohea/sanic-limiter
sanic_limiter/util.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport invoke\nimport livereload\nimport shutil\n\nserver = livereload.Server()\n\n\n@invoke.task\ndef clean():\n shutil.rmtree('./build')\n\n\n@invoke.task(pre=[clean])\ndef build():\n invoke.run('sphinx-build ./source ./build', pty=...
python
edit
1
1
mit
3e2c7ca2147b28403761cf57dad6d9173a28dc3d
dmpayton/reqon
docs/tasks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/bin/env python\n#\n# glidein_top\n#\n# Execute a top command in the same glidein as the user job\n#\n# Usage:\n# glidein_top.py <cluster>.<process> [-name <schedd_name>] [-pool <pool_name> ] [-timeout <nr secs>\n#\n\nimport os\nimport s...
python
edit
2
2
bsd-3-clause
788ca6bbd25bcdb55dc92739e7d08b201344b10b
holzman/glideinwms-old,bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS
tools/glidein_top.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# coding: utf-8\n\nimport os\nimport unittest\nfrom adjutant import SC2Replay\n\nTEST_DIR = os.path.realpath(os.path.dirname(__file__)) + '/'\n\nclass TestSC2Replay(unittest.TestCase):\n\n def setUp(self):\n ...
python
edit
1
1
bsd-2-clause
85d800d9979fa122e0888af48c2e6a697f9da458
eagleflo/adjutant
test/test_sc2replay.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nimport os\nfrom tempfile import mkdtemp\nfrom shutil import rmtree\n\nfrom nipy.testing import *\nfrom sneeze import find_pkg, run_nose\n\nimport_strings = [\"from nipype.interfaces.afni import To3d\",\n \"from nipype.int...
python
edit
3
3
bsd-3-clause
f57f3a5a7abec6c9c6077c213cf29ef3fd9b4483
yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD
tools/test_sneeze.py
rejected_duplicate
Near-duplicate of sample 13499
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nfrom pprint import pprint\n\ndef pathparser(path, separator=\".\"):\n return path.split(separator)\n\ndef pathquery(pson, path, separator=\".\", missing=None, iterate=True):\n if isinstance(path,str) or isinstance...
python
edit
5
11
mit
1f9486cff230beae00e5417d6ad2b1ba28526339
imranghory/pson
pson/pson.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\n### Attribute Wrapper\nclass AttrWrapper(object):\n attrs = []\n\n def __setattr__(self, name, value):\n if name not in self.attrs:\n raise AttributeError(\"'%s' is not supported\" % name)\n ...
python
edit
1
4
mit
27e2c86641bac1b2083a36d0eaf84e79553c39ce
xgfone/xutils,xgfone/pycom
pycom/objects.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os.path as osp\n\n\ndef get_data_dir():\n this_dir = osp.dirname(osp.abspath(__file__))\n return osp.realpath(osp.join(this_dir, '../data'))\n\n\ndef get_logs_dir():\n this_dir = osp.dirname(osp.abspath(__file__))\n retur...
python
edit
1
1
mit
da6e9416e12ce71cd3f23ded9bd75dccc62d26fe
wkentaro/fcn
fcn/config.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\n\nfrom models import Job\nfrom interface import get_all_jobs\n\n\ndef run_all():\n for user in User.objects.all():\n creds = user.credentials.all()\n for i, cluster in enumerate(...
python
edit
1
6
mit
634ae735db61ebb211b9e3159ca4dac7861e5553
crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp
cluster/update_jobs.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom mock import Mock\nimport pytest\nimport smtplib\n\nfrom donemail import donemail\n\nBOB = 'bob@example.com'\n\n\n@pytest.fixture(autouse=True)\ndef monkeypatch_send_email(monkeypatch):\n monkeypatch.setattr('smtplib.SMTP', Mock())\n...
python
edit
1
1
mit
393743e391575d6cf4a3bfffb4f53cfa0848c49e
alexandershov/donemail
tests/test_donemail.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .monad import Monad\nfrom .functor import fmap\n\nclass Writer(Monad):\n \"\"\"Stores a value as well as a log of events that have transpired\n with the value.\n \"\"\"\n def __init__(self, v, log):\n self.v = v\n\n ...
python
edit
1
3
mit
23ab67f74fc7c09310638529ccf804ec2271fd6c
justanr/pynads
pynads/writer.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport cmd\nimport argparse\nfrom Interface import *\n\n\nclass Lexeme(cmd.Cmd):\n intro = \"Welcome to Lexeme. Input ? for help and commands\"\n prompt = \"(lexeme) \"\n\n def do_list(self, arg):\n 'List word database.'\n ...
python
edit
13
1
mit
faf6f74348ed09f2ba0ebb5a133acc1a04edb737
kdelwat/Lexeme
main.py
rejected_lint
Too many lint violations: 13
true
[ { "role": "user", "content": "Here is the current file:\n```python\nclass LazyPluggable(object):\n \"\"\"A pluggable backend loaded lazily based on some value.\"\"\"\n\n def __init__(self, pivot, **backends):\n self.__backends = backends\n self.__pivot = pivot\n self.__backend = N...
python
edit
1
3
apache-2.0
2a06886077c05e1bfae7c28a09cf3489da6e450a
rickerc/heat_audit,maestro-hybrid-cloud/heat,dims/heat,JioCloud/heat,cwolferh/heat-scratch,rh-s/heat,citrix-openstack-build/heat,steveb/heat,JioCloud/heat,steveb/heat-cfntools,Triv90/Heat,openstack/heat,dragorosson/heat,ntt-sic/heat,varunarya10/heat,miguelgrinberg/heat,rdo-management/heat,pratikmallya/heat,takeshineshi...
heat/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .base import *\n\nDEBUG = False\n\nALLOWED_HOSTS = ['188.226.249.33', 'cinderella.li']\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': os.environ['DB_NAME'],\n 'US...
python
edit
5
0
mit
808fdc4351254c8f5b32d5997803562091121044
jasisz/cinderella,jasisz/cinderella
cinderella/cinderella/settings/production.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom eduid_am.exceptions import UserDoesNotExist\n\n\ndef attribute_fetcher(db, user_id):\n attributes = {}\n\n user = db.registered.find_one({'_id': user_id})\n if user is None:\n raise UserDoesNotExist(\"No user matching _...
python
edit
1
5
bsd-3-clause
aa4f8943616adce4dba826924b8d21e1e8164299
SUNET/eduid-signup-amp
eduid_signup_amp/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\nfrom .views import ClipboardFileAPIView, ClipboardImageAPIView\n\nurlpatterns = patterns(\n '',\n url(r'^images/(?P<pk>\\d+)$', ClipboardImageAPIView.as_view(), name=\"clipboard_images\"),...
python
edit
1
0
mit
7784186509e41c72bcf7a4ebbd9b268b49449d35
MagicSolutions/django-user-clipboard,IndustriaTech/django-user-clipboard,MagicSolutions/django-user-clipboard,IndustriaTech/django-user-clipboard
user_clipboard/urls.py
accepted
null
true